[med-svn] [beast2-mcmc] 02/09: Imported Upstream version 2.3.1+dfsg

Andreas Tille tille at debian.org
Mon Sep 28 13:19:21 UTC 2015


This is an automated email from the git hooks/post-receive script.

tille pushed a commit to branch master
in repository beast2-mcmc.

commit 5db2939cce65a37855d6853e7bd6c33472670f83
Author: Andreas Tille <tille at debian.org>
Date:   Mon Sep 28 12:45:09 2015 +0200

    Imported Upstream version 2.3.1+dfsg
---
 COPYING                                            |  502 +++
 README.md                                          |   39 +
 build.xml                                          |  705 +++
 debian/README.source                               |    2 -
 debian/README.test                                 |    9 -
 debian/beast-mcmc-doc.install                      |    2 -
 debian/beast-mcmc-examples.install                 |    1 -
 debian/beast-mcmc.1                                |  163 -
 debian/beast-mcmc.1.xml                            |  325 --
 debian/beast-mcmc.docs                             |    2 -
 debian/beast-mcmc.install                          |    3 -
 debian/beast-mcmc.manifest                         |    7 -
 debian/beast-mcmc.manpages                         |    1 -
 debian/beast-mcmc.menu                             |   15 -
 debian/beast-mcmc.xpm                              |  163 -
 debian/beauti.1                                    |   95 -
 debian/beauti.1.xml                                |  185 -
 debian/beauti.xpm                                  |  193 -
 debian/bin/beast-mcmc                              |   28 -
 debian/bin/beauti                                  |    5 -
 debian/bin/loganalyser                             |    5 -
 debian/bin/logcombiner                             |    7 -
 debian/bin/treeannotator                           |    9 -
 debian/bin/treestat                                |    8 -
 debian/changelog                                   |   10 -
 debian/compat                                      |    1 -
 debian/control                                     |  114 -
 debian/copyright                                   |   48 -
 debian/get-orig-source                             |   72 -
 debian/libnucleotidelikelihoodcore0.install        |    1 -
 debian/patches/create_soname.patch                 |   21 -
 debian/patches/enable_hardening.patch              |   21 -
 .../fix_classpath_in_build_tracer_xml.patch        |  141 -
 debian/patches/fix_classpath_in_build_xml.patch    |   98 -
 debian/patches/fix_encoding.patch                  |   15 -
 debian/patches/patch_tex_docs.patch                |   67 -
 debian/patches/series                              |    6 -
 debian/rules                                       |   75 -
 debian/source/format                               |    1 -
 debian/tests/run-unit-test                         |   11 -
 debian/tracer                                      |   11 -
 debian/upstream/metadata                           |   12 -
 debian/watch                                       |    2 -
 doc/slides.pdf                                     |  Bin 0 -> 1182376 bytes
 doc/slides/BEAST.png                               |  Bin 0 -> 37369 bytes
 doc/slides/BEAST.xdl                               |   23 +
 doc/slides/auckland.png                            |  Bin 0 -> 2723 bytes
 doc/slides/beast.gif                               |  Bin 0 -> 124456 bytes
 doc/slides/beast.jpg                               |  Bin 0 -> 85832 bytes
 doc/slides/beastdoc.png                            |  Bin 0 -> 184998 bytes
 doc/slides/beastdoc0.png                           |  Bin 0 -> 191967 bytes
 doc/slides/beastdoc1.png                           |  Bin 0 -> 174245 bytes
 doc/slides/beastdoc2.png                           |  Bin 0 -> 250479 bytes
 doc/slides/beastdoc4.png                           |  Bin 0 -> 186463 bytes
 doc/slides/beauti.png                              |  Bin 0 -> 108281 bytes
 doc/slides/classes1.png                            |  Bin 0 -> 7407 bytes
 doc/slides/classes10.png                           |  Bin 0 -> 16267 bytes
 doc/slides/classes11.png                           |  Bin 0 -> 16460 bytes
 doc/slides/classes12.png                           |  Bin 0 -> 50743 bytes
 doc/slides/classes2.png                            |  Bin 0 -> 12447 bytes
 doc/slides/classes3.png                            |  Bin 0 -> 36929 bytes
 doc/slides/classes4.png                            |  Bin 0 -> 57859 bytes
 doc/slides/classes5.png                            |  Bin 0 -> 6925 bytes
 doc/slides/classes5b.png                           |  Bin 0 -> 205742 bytes
 doc/slides/classes6.png                            |  Bin 0 -> 33737 bytes
 doc/slides/classes7.png                            |  Bin 0 -> 15715 bytes
 doc/slides/classes8.png                            |  Bin 0 -> 30244 bytes
 doc/slides/classes9.png                            |  Bin 0 -> 48089 bytes
 doc/slides/cross.png                               |  Bin 0 -> 18844 bytes
 doc/slides/example1.png                            |  Bin 0 -> 34039 bytes
 doc/slides/example2.png                            |  Bin 0 -> 45640 bytes
 doc/slides/example3.png                            |  Bin 0 -> 104574 bytes
 doc/slides/example4.png                            |  Bin 0 -> 113617 bytes
 doc/slides/example5.png                            |  Bin 0 -> 150402 bytes
 doc/slides/example6.png                            |  Bin 0 -> 186488 bytes
 doc/slides/hierarchy1.png                          |  Bin 0 -> 17802 bytes
 doc/slides/hierarchy2.png                          |  Bin 0 -> 33344 bytes
 doc/slides/hierarchy3.png                          |  Bin 0 -> 7293 bytes
 doc/slides/hky.png                                 |  Bin 0 -> 73118 bytes
 doc/slides/hkymodel.png                            |  Bin 0 -> 36412 bytes
 doc/slides/hkymodel2.png                           |  Bin 0 -> 76247 bytes
 doc/slides/loggables.png                           |  Bin 0 -> 11692 bytes
 doc/slides/modelbuilder.png                        |  Bin 0 -> 143554 bytes
 doc/slides/sdk.pdf                                 |  Bin 0 -> 897232 bytes
 doc/slides/sdk.tex                                 |  640 +++
 doc/slides/slides.aux                              |  102 +
 doc/slides/slides.nav                              |   79 +
 doc/slides/slides.out                              |    5 +
 doc/slides/slides.snm                              |    0
 doc/slides/slides.tex                              |  788 ++++
 doc/slides/slides.toc                              |    7 +
 doc/slides/slides101.tex                           | 1925 ++++++++
 doc/slides/speedup.png                             |  Bin 0 -> 7625 bytes
 doc/slides/spreadsheet.png                         |  Bin 0 -> 90564 bytes
 doc/slides/walk.jpg                                |  Bin 0 -> 242299 bytes
 doc/slides/xml.png                                 |  Bin 0 -> 33860 bytes
 doc/slides/xml1.png                                |  Bin 0 -> 30050 bytes
 doc/slides/xml2.png                                |  Bin 0 -> 34919 bytes
 doc/slides/xml3.png                                |  Bin 0 -> 58783 bytes
 doc/slides/xml4.png                                |  Bin 0 -> 133775 bytes
 doc/tutorial.slides.part1.pdf                      |  Bin 0 -> 1745429 bytes
 doc/tutorial.slides.part2.pdf                      |  Bin 0 -> 1078490 bytes
 doc/tutorial.slides.part3.pdf                      |  Bin 0 -> 893949 bytes
 .../DivergenceDating/DivergenceDatingTutorial.bib  |  111 +
 .../DivergenceDating/DivergenceDatingTutorial.tex  |  887 ++++
 .../DivergenceDatingTutorialv2.0.3.pdf             |  Bin 0 -> 1635325 bytes
 .../DivergenceDatingTutorialv2.2.0.pdf             |  Bin 0 -> 1657554 bytes
 .../DivergenceDating/figures/AddPartition.png      |  Bin 0 -> 28398 bytes
 .../DivergenceDating/figures/AlignmentViewer.png   |  Bin 0 -> 57869 bytes
 doc/tutorials/DivergenceDating/figures/BEAST.png   |  Bin 0 -> 97191 bytes
 .../figures/BEAUti_DataPartitions.png              |  Bin 0 -> 85593 bytes
 .../figures/BEAUti_DataPartitions_final.png        |  Bin 0 -> 81853 bytes
 .../DivergenceDating/figures/BEAUti_Model.png      |  Bin 0 -> 77838 bytes
 .../DivergenceDating/figures/BEAUti_Prior1.png     |  Bin 0 -> 103654 bytes
 .../DivergenceDating/figures/BEAUti_Prior2.png     |  Bin 0 -> 143335 bytes
 .../DivergenceDating/figures/BEAUti_TaxonSets.png  |  Bin 0 -> 36639 bytes
 .../DivergenceDating/figures/DensiTree.png         |  Bin 0 -> 456235 bytes
 doc/tutorials/DivergenceDating/figures/FigTree.png |  Bin 0 -> 173462 bytes
 .../DivergenceDating/figures/GammaPrior.png        |  Bin 0 -> 108120 bytes
 doc/tutorials/DivergenceDating/figures/Tracer1.png |  Bin 0 -> 209867 bytes
 .../figures/Tracer_divergences.png                 |  Bin 0 -> 211521 bytes
 .../figures/Tracer_marginalDensity.png             |  Bin 0 -> 213196 bytes
 .../DivergenceDating/figures/TreeAnnotator1.png    |  Bin 0 -> 56395 bytes
 .../DivergenceDating/figures/cloneFrom.png         |  Bin 0 -> 58426 bytes
 .../figures/primatePriorPosteriorKappa.pdf         |  Bin 0 -> 41604 bytes
 .../figures/primatePriorPosteriorShape.pdf         |  Bin 0 -> 39283 bytes
 doc/tutorials/DivergenceDating/figures/warning.png |  Bin 0 -> 28695 bytes
 .../primatePriorPosteriorKappa.tex                 | 4721 ++++++++++++++++++++
 .../primatePriorPosteriorShape.tex                 | 4347 ++++++++++++++++++
 doc/tutorials/GeneralNotes.pdf                     |  Bin 0 -> 73526 bytes
 doc/tutorials/GeneralNotes.tex                     |  112 +
 doc/tutorials/MEPs/MEPs.bib                        |   38 +
 doc/tutorials/MEPs/MEPs.tex                        |  446 ++
 doc/tutorials/MEPs/MEPsv2.0.2.pdf                  |  Bin 0 -> 1871736 bytes
 doc/tutorials/MEPs/MEPsv2.2.0.pdf                  |  Bin 0 -> 2088707 bytes
 doc/tutorials/MEPs/figures/BEAST.png               |  Bin 0 -> 98888 bytes
 doc/tutorials/MEPs/figures/BEAUti_GuessDates.png   |  Bin 0 -> 55742 bytes
 doc/tutorials/MEPs/figures/BEAUti_Site_Model.png   |  Bin 0 -> 78844 bytes
 doc/tutorials/MEPs/figures/BEAUti_dates.png        |  Bin 0 -> 101034 bytes
 doc/tutorials/MEPs/figures/BEAUti_init.png         |  Bin 0 -> 90169 bytes
 doc/tutorials/MEPs/figures/BEAUti_mcmc.png         |  Bin 0 -> 79270 bytes
 doc/tutorials/MEPs/figures/BEAUti_mcmc_long.png    |  Bin 0 -> 91702 bytes
 doc/tutorials/MEPs/figures/BEAUti_partition.png    |  Bin 0 -> 80531 bytes
 doc/tutorials/MEPs/figures/BEAUti_priors.png       |  Bin 0 -> 107294 bytes
 doc/tutorials/MEPs/figures/BEAUti_priors2.png      |  Bin 0 -> 115604 bytes
 doc/tutorials/MEPs/figures/BEAUti_split.png        |  Bin 0 -> 34673 bytes
 doc/tutorials/MEPs/figures/DensiTree.pdf           |  Bin 0 -> 570696 bytes
 doc/tutorials/MEPs/figures/RSV2_mcc_tree.pdf       |  Bin 0 -> 51129 bytes
 doc/tutorials/MEPs/figures/Tracer1.png             |  Bin 0 -> 269966 bytes
 doc/tutorials/MEPs/figures/Tracer2.png             |  Bin 0 -> 174702 bytes
 doc/tutorials/MEPs/figures/Tracer_density.png      |  Bin 0 -> 164375 bytes
 .../MEPs/figures/Tracer_relativeRates.png          |  Bin 0 -> 181824 bytes
 doc/tutorials/MEPs/figures/cloneFrom.png           |  Bin 0 -> 62134 bytes
 doc/tutorials/MEPs/figures/tracerBSP1.png          |  Bin 0 -> 212236 bytes
 doc/tutorials/MEPs/figures/tracerBSP2.png          |  Bin 0 -> 89012 bytes
 doc/tutorials/MEPs/figures/tracerBSP3.png          |  Bin 0 -> 56117 bytes
 doc/tutorials/README.txt                           |   39 +
 doc/tutorials/STACEY/STACEY_tutorial.bib           |   67 +
 doc/tutorials/STACEY/STACEY_tutorial.tex           |  540 +++
 .../STARBEAST/StarBEASTTutorialv2.0.3.pdf          |  Bin 0 -> 1579669 bytes
 doc/tutorials/STARBEAST/StarBEAST_tutorial.bib     |   32 +
 doc/tutorials/STARBEAST/StarBEAST_tutorial.tex     |  534 +++
 .../STARBEAST/StarBEAST_tutorialv2.2.0.pdf         |  Bin 0 -> 1950172 bytes
 doc/tutorials/STARBEAST/figures/BEAST.png          |  Bin 0 -> 98804 bytes
 .../STARBEAST/figures/BEAUti_ClockModel1.png       |  Bin 0 -> 63087 bytes
 .../STARBEAST/figures/BEAUti_ClockModel2.png       |  Bin 0 -> 62715 bytes
 .../STARBEAST/figures/BEAUti_ClockModel3.png       |  Bin 0 -> 62542 bytes
 .../STARBEAST/figures/BEAUti_DataPartitions.png    |  Bin 0 -> 77348 bytes
 .../STARBEAST/figures/BEAUti_Guess_Taxonsets.png   |  Bin 0 -> 122252 bytes
 doc/tutorials/STARBEAST/figures/BEAUti_MCMC.png    |  Bin 0 -> 102713 bytes
 doc/tutorials/STARBEAST/figures/BEAUti_MSP.png     |  Bin 0 -> 79386 bytes
 doc/tutorials/STARBEAST/figures/BEAUti_Prior.png   |  Bin 0 -> 92972 bytes
 .../STARBEAST/figures/BEAUti_Site_Model.png        |  Bin 0 -> 77597 bytes
 .../STARBEAST/figures/BEAUti_selectTemplate.png    |  Bin 0 -> 81742 bytes
 doc/tutorials/STARBEAST/figures/DensiTree.png      |  Bin 0 -> 592745 bytes
 doc/tutorials/STARBEAST/figures/Tracer1.png        |  Bin 0 -> 176273 bytes
 doc/tutorials/STARBEAST/figures/Tracer2.png        |  Bin 0 -> 213917 bytes
 doc/tutorials/STARBEAST/figures/TreeAnnotator.png  |  Bin 0 -> 56661 bytes
 doc/tutorials/STARBEAST/figures/cloneFrom.png      |  Bin 0 -> 60373 bytes
 doc/tutorials/STARBEAST/figures/figtree.png        |  Bin 0 -> 168456 bytes
 doc/tutorials/STARBEAST/figures/gopher.pdf         |  Bin 0 -> 760041 bytes
 .../STARBEAST/figures/species_population1.pdf      |  Bin 0 -> 23134 bytes
 .../STARBEAST/figures/species_population2.pdf      |  Bin 0 -> 27089 bytes
 .../STARBEAST/figures/species_population3.pdf      |  Bin 0 -> 172057 bytes
 .../STARBEAST/figures/species_population4.pdf      |  Bin 0 -> 26652 bytes
 .../STARBEAST/figures/species_population5.pdf      |  Bin 0 -> 26642 bytes
 doc/tutorials/tex2html.sh                          |   29 +
 examples/beast2vs1/beast1/testBSP1.xml             |  317 ++
 examples/beast2vs1/beast1/testBSPNoClock.xml       |  239 +
 examples/beast2vs1/beast1/testBirthDeathAsYule.xml |  296 ++
 .../beast1/testBirthDeathModel_10taxa.xml          |  111 +
 examples/beast2vs1/beast1/testCalibration.xml      |  241 +
 examples/beast2vs1/beast1/testCoalescent.xml       |  174 +
 .../beast2vs1/beast1/testCoalescentNoClock.xml     |  222 +
 .../beast2vs1/beast1/testCoalescentNoClock1.xml    |  213 +
 examples/beast2vs1/beast1/testEBSP.xml             |  836 ++++
 .../beast2vs1/beast1/testExponentialGrowth.xml     |  232 +
 examples/beast2vs1/beast1/testMCMC.xml             |  175 +
 examples/beast2vs1/beast1/testMultiSubstModel.xml  |  358 ++
 examples/beast2vs1/beast1/testRandomLocalClock.xml |  274 ++
 examples/beast2vs1/beast1/testSRD06CP12_3.xml      |  324 ++
 examples/beast2vs1/beast1/testSiteModelAlpha.xml   |  318 ++
 .../beast2vs1/beast1/testStarBEASTConstant.xml     |  707 +++
 examples/beast2vs1/beast1/testStarBEASTLinear.xml  |  707 +++
 .../beast1/testStarBEASTLinearConstRoot.xml        |  707 +++
 .../beast2vs1/beast1/testStrictClockNoDate.xml     |  234 +
 .../beast2vs1/beast1/testStrictClockNoDate2.xml    |  228 +
 .../beast1/testStrictClockTipDatesSampling.xml     |  372 ++
 .../beast2vs1/beast1/testStrictClockTipTime.xml    |  330 ++
 .../beast1/testUCRelaxedClockLogNormal.xml         |  274 ++
 examples/beast2vs1/beast1/testYule.xml             |  215 +
 examples/beast2vs1/beast1/testYuleModel_10taxa.xml |  108 +
 examples/beast2vs1/testBSP1.xml                    |  197 +
 examples/beast2vs1/testBSPNoClock.xml              |  136 +
 examples/beast2vs1/testBirthDeathAsYule.xml        |  162 +
 examples/beast2vs1/testBirthDeathModel_10taxa.xml  |   59 +
 examples/beast2vs1/testCalibration.xml             |  124 +
 examples/beast2vs1/testCalibrationMono.xml         |  128 +
 examples/beast2vs1/testCoalescent2.xml             |  103 +
 examples/beast2vs1/testCoalescentNoClock.xml       |  128 +
 examples/beast2vs1/testCoalescentNoClock1.xml      |  117 +
 examples/beast2vs1/testCoalescentTipDates.xml      |   70 +
 examples/beast2vs1/testCoalescentTipDates1.xml     |   70 +
 .../beast2vs1/testCoalescentTipDatesSampling.xml   |  101 +
 examples/beast2vs1/testEBSP.xml                    |  317 ++
 examples/beast2vs1/testExponentialGrowth.xml       |  147 +
 examples/beast2vs1/testHKY.xml                     |   89 +
 examples/beast2vs1/testMultiSubstModel.xml         |  141 +
 examples/beast2vs1/testRandomLocalClock.xml        |  148 +
 examples/beast2vs1/testSRD06CP12_3.xml             |  171 +
 examples/beast2vs1/testSiteModelAlpha.xml          |  197 +
 examples/beast2vs1/testStarBEAST.xml               |  473 ++
 examples/beast2vs1/testStarBEASTConstant.xml       |  482 ++
 examples/beast2vs1/testStarBEASTLinear.xml         |  491 ++
 .../beast2vs1/testStarBEASTLinearConstRoot.xml     |  490 ++
 examples/beast2vs1/testStarBeast2.xml              |  354 ++
 examples/beast2vs1/testStrictClock.xml             |  134 +
 examples/beast2vs1/testStrictClock2.xml            |  128 +
 .../beast2vs1/testStrictClockTipDatesSampling.xml  |  227 +
 examples/beast2vs1/testStrictClockTipTime.xml      |  174 +
 examples/beast2vs1/testTipDates.xml                |  162 +
 examples/beast2vs1/testUCRelaxedClockLogNormal.xml |  148 +
 examples/beast2vs1/testYuleModel_10taxa.xml        |   55 +
 examples/benchmark/1/experiment.sh                 |   24 +
 examples/benchmark/1/testHKY1044.xml               |  397 ++
 examples/benchmark/1/testHKY1366.xml               |  352 ++
 examples/benchmark/1/testHKY1510.xml               |  327 ++
 examples/benchmark/1/testHKY1748.xml               |  482 ++
 examples/benchmark/1/testHKY1749.xml               |  517 +++
 examples/benchmark/1/testHKY1809.xml               |  442 ++
 examples/benchmark/1/testHKY336.xml                |  282 ++
 examples/benchmark/1/testHKY3475.xml               |  397 ++
 examples/benchmark/1/testHKY501.xml                |  292 ++
 examples/benchmark/1/testHKY520.xml                |  482 ++
 examples/benchmark/1/testHKY755.xml                |  467 ++
 examples/benchmark/1/testHKY767.xml                |  502 +++
 examples/benchmark/II/experiment.sh                |   24 +
 examples/benchmark/II/testHKY1044.xml              |  283 ++
 examples/benchmark/II/testHKY1366.xml              |  247 +
 examples/benchmark/II/testHKY1510.xml              |  227 +
 examples/benchmark/II/testHKY1748.xml              |  351 ++
 examples/benchmark/II/testHKY1749.xml              |  379 ++
 examples/benchmark/II/testHKY1809.xml              |  319 ++
 examples/benchmark/II/testHKY336.xml               |  191 +
 examples/benchmark/II/testHKY3475.xml              |  283 ++
 examples/benchmark/II/testHKY501.xml               |  199 +
 examples/benchmark/II/testHKY520.xml               |  351 ++
 examples/benchmark/II/testHKY755.xml               |  339 ++
 examples/benchmark/II/testHKY767.xml               |  367 ++
 examples/benchmark/mrbayes/experiment.sh           |   24 +
 examples/benchmark/mrbayes/run1044.nex             |    6 +
 examples/benchmark/mrbayes/run1366.nex             |    6 +
 examples/benchmark/mrbayes/run1510.nex             |    6 +
 examples/benchmark/mrbayes/run1748.nex             |    6 +
 examples/benchmark/mrbayes/run1749.nex             |    6 +
 examples/benchmark/mrbayes/run1809.nex             |    6 +
 examples/benchmark/mrbayes/run336.nex              |    6 +
 examples/benchmark/mrbayes/run3475.nex             |    6 +
 examples/benchmark/mrbayes/run501.nex              |    6 +
 examples/benchmark/mrbayes/run520.nex              |    6 +
 examples/benchmark/mrbayes/run755.nex              |    6 +
 examples/benchmark/mrbayes/run767.nex              |    6 +
 examples/benchmark/mrbayes/testHKY1044.nex         |   67 +
 examples/benchmark/mrbayes/testHKY1366.nex         |   58 +
 examples/benchmark/mrbayes/testHKY1510.nex         |   53 +
 examples/benchmark/mrbayes/testHKY1748.nex         |   84 +
 examples/benchmark/mrbayes/testHKY1749.nex         |   91 +
 examples/benchmark/mrbayes/testHKY1809.nex         |   76 +
 examples/benchmark/mrbayes/testHKY336.nex          |   44 +
 examples/benchmark/mrbayes/testHKY3475.nex         |   67 +
 examples/benchmark/mrbayes/testHKY501.nex          |   47 +
 examples/benchmark/mrbayes/testHKY520.nex          |   84 +
 examples/benchmark/mrbayes/testHKY755.nex          |   81 +
 examples/benchmark/mrbayes/testHKY767.nex          |   88 +
 examples/bitflip.xml                               |   22 +
 examples/nexus/26.nex                              |   63 +
 examples/nexus/29.nex                              |   64 +
 examples/nexus/47.nex                              |   67 +
 examples/nexus/53.nex                              |   63 +
 examples/nexus/59.nex                              |   64 +
 examples/nexus/64.nex                              |   64 +
 examples/nexus/72.nex                              |   64 +
 examples/nexus/Darwins-finches.nex                 |   46 +
 examples/nexus/Dengue4.env.nex                     |   54 +
 examples/nexus/FPV.nex                             |   15 +
 examples/nexus/Flu.nex                             |    1 +
 examples/nexus/M243.nex                            |  214 +
 examples/nexus/ML_analysis.nex                     |  Bin 0 -> 2990 bytes
 examples/nexus/MP_analysis.nex                     |    1 +
 examples/nexus/Primates.nex                        |   24 +
 examples/nexus/RSV2.nex                            |  141 +
 examples/nexus/Shankarappa.Patient9.nex            |  259 ++
 examples/nexus/angiosperms.nex                     |    1 +
 examples/nexus/anolis.nex                          |   37 +
 examples/nexus/avian-ovomucoids.nex                |    1 +
 examples/nexus/dna.nex                             |  142 +
 examples/nexus/gopher.nex                          |   63 +
 examples/nexus/humanChimpSNP.nex                   |   19 +
 examples/nexus/old.nex                             |   25 +
 examples/nexus/primate-mtDNA-interleaved.nex       |    1 +
 examples/nexus/primate-mtDNA.nex                   |    1 +
 examples/nexus/protein.nex                         |   54 +
 examples/nexus/seaview.nxs                         |  606 +++
 examples/nexus/traitlab.nex                        |   35 +
 examples/starbeastinit/sbi-01.xml                  |  170 +
 examples/starbeastinit/sbi-02.xml                  |  170 +
 examples/starbeastinit/sbi-03.xml                  |  210 +
 examples/testBSP.xml                               |  205 +
 examples/testCalYule_5t_2c.xml                     |   55 +
 examples/testCalibration.xml                       |  146 +
 examples/testClassicRootCalibrationPrior.xml       |   78 +
 examples/testCoalescent.xml                        |  126 +
 examples/testConditionalRootCalibrationPrior.xml   |   78 +
 examples/testEBSP.xml                              |  601 +++
 examples/testExponentialGrowth.xml                 |  213 +
 examples/testGTR.xml                               |  211 +
 examples/testHKY.json                              |   87 +
 examples/testHKY.xml                               |  104 +
 examples/testJukesCantor.xml                       |   85 +
 examples/testJukesCantorShort.xml                  |   84 +
 examples/testJukesCantorShortUncertain.xml         |   95 +
 examples/testJukesCantorShortUncertain2.xml        |   96 +
 examples/testJukesCantorShortUncertain2MLE.xml     |   87 +
 .../testMultipleAlignments_randomTaxaOrder.xml     |  332 ++
 examples/testPlates.xml                            |  128 +
 examples/testRNA.xml                               |  212 +
 examples/testRandomLocalClock.xml                  |  120 +
 examples/testRelaxedClock.xml                      |  163 +
 examples/testRestrictedGTR.xml                     |  179 +
 examples/testSRD06.xml                             |  127 +
 examples/testSYM.xml                               |  207 +
 examples/testSeqGen.xml                            |   89 +
 examples/testSimulatedAlignment.xml                |  126 +
 examples/testSliceHKY.xml                          |  127 +
 examples/testStarBeast.xml                         |  349 ++
 examples/testTIM.xml                               |  188 +
 examples/testTN93.xml                              |  161 +
 examples/testTVM.xml                               |  197 +
 examples/testTipDates.xml                          |  199 +
 examples/testTipDates2.xml                         |  113 +
 examples/testTwoCalibrationsPrior.xml              |   91 +
 examples/testYuleCalibrated.xml                    |  151 +
 examples/testYuleOneSite.xml                       |   90 +
 examples/testYuleUncalibrated.xml                  |  150 +
 packages.xml                                       |   71 +
 release/Linux/bin/addonmanager                     |   33 +
 release/Linux/bin/appstore                         |   33 +
 release/Linux/bin/beast                            |   32 +
 release/Linux/bin/beauti                           |   33 +
 release/Linux/bin/densitree                        |   33 +
 release/Linux/bin/logcombiner                      |   33 +
 release/Linux/bin/treeannotator                    |   33 +
 release/Mac/createdmg.sh                           |   58 +
 release/Mac/install.png                            |  Bin 0 -> 17518 bytes
 release/Windows/AppStore_launch4j.xml              |   21 +
 release/Windows/BEAST_launch4j.xml                 |   21 +
 release/Windows/BEAUti_launch4j.xml                |   21 +
 release/Windows/LogCombiner_launch4j.xml           |   21 +
 release/Windows/TreeAnnotator_launch4j.xml         |   20 +
 release/common/LICENSE.txt                         |  504 +++
 release/common/README.txt                          |  203 +
 release/common/VERSION HISTORY.txt                 |  167 +
 release/common/icons/beast.icns                    |  Bin 0 -> 49344 bytes
 release/common/icons/beast.ico                     |  Bin 0 -> 82726 bytes
 release/common/icons/beast.png                     |  Bin 0 -> 27970 bytes
 release/common/icons/beauti.icns                   |  Bin 0 -> 54504 bytes
 release/common/icons/beauti.ico                    |  Bin 0 -> 82726 bytes
 release/common/icons/beauti.png                    |  Bin 0 -> 20131 bytes
 release/common/icons/utility.icns                  |  Bin 0 -> 59742 bytes
 release/common/icons/utility.ico                   |  Bin 0 -> 82726 bytes
 release/common/icons/utility.png                   |  Bin 0 -> 29413 bytes
 release/common/tools/DensiTree.icns                |  Bin 0 -> 10326 bytes
 release/common/tools/DensiTree.ico                 |  Bin 0 -> 7406 bytes
 release/common/tools/DensiTree.png                 |  Bin 0 -> 1608 bytes
 release/common/tools/DensiTree_launch4j.xml        |   16 +
 scripts/doc.pl                                     |   88 +
 src/beast/app/BEASTVersion.java                    |  150 +
 src/beast/app/BeastMCMC.java                       |  533 +++
 src/beast/app/DocMaker.java                        |  567 +++
 src/beast/app/ModelBuilder.java                    |   88 +
 src/beast/app/beastapp/BeastDialog.java            |  252 ++
 src/beast/app/beastapp/BeastLauncher.java          |  152 +
 src/beast/app/beastapp/BeastMain.java              |  622 +++
 src/beast/app/beastapp/WholeNumberField.java       |  202 +
 src/beast/app/beastapp/images/beast.png            |  Bin 0 -> 27970 bytes
 src/beast/app/beauti/0.png                         |  Bin 0 -> 15719 bytes
 src/beast/app/beauti/1.png                         |  Bin 0 -> 9583 bytes
 src/beast/app/beauti/10.png                        |  Bin 0 -> 25275 bytes
 src/beast/app/beauti/11.png                        |  Bin 0 -> 28777 bytes
 src/beast/app/beauti/12.png                        |  Bin 0 -> 24213 bytes
 src/beast/app/beauti/13.png                        |  Bin 0 -> 25275 bytes
 src/beast/app/beauti/2.png                         |  Bin 0 -> 27335 bytes
 src/beast/app/beauti/3.png                         |  Bin 0 -> 27686 bytes
 src/beast/app/beauti/4.png                         |  Bin 0 -> 22591 bytes
 src/beast/app/beauti/5.png                         |  Bin 0 -> 27214 bytes
 src/beast/app/beauti/6.png                         |  Bin 0 -> 9063 bytes
 src/beast/app/beauti/7.png                         |  Bin 0 -> 27158 bytes
 src/beast/app/beauti/8.png                         |  Bin 0 -> 9256 bytes
 src/beast/app/beauti/9.png                         |  Bin 0 -> 9389 bytes
 src/beast/app/beauti/AlignmentListInputEditor.java | 1223 +++++
 src/beast/app/beauti/AlignmentViewer.java          |  286 ++
 src/beast/app/beauti/Beauti.java                   | 1293 ++++++
 src/beast/app/beauti/BeautiAlignmentProvider.java  |  376 ++
 src/beast/app/beauti/BeautiConfig.java             |  303 ++
 src/beast/app/beauti/BeautiConnector.java          |  252 ++
 src/beast/app/beauti/BeautiDoc.java                | 2367 ++++++++++
 src/beast/app/beauti/BeautiDocListener.java        |    9 +
 src/beast/app/beauti/BeautiLauncher.java           |   23 +
 src/beast/app/beauti/BeautiPanel.java              |  463 ++
 src/beast/app/beauti/BeautiPanelConfig.java        |  355 ++
 src/beast/app/beauti/BeautiSubTemplate.java        |  442 ++
 .../app/beauti/ClockModelListInputEditor.java      |  182 +
 src/beast/app/beauti/ClonePartitionPanel.java      |   72 +
 src/beast/app/beauti/Fragment.java                 |   18 +
 src/beast/app/beauti/FrequenciesInputEditor.java   |  111 +
 ...eTreeForSpeciesTreeDistributionInputEditor.java |  107 +
 src/beast/app/beauti/GuessPatternDialog.java       |  634 +++
 src/beast/app/beauti/JPackageDialog.java           |  428 ++
 src/beast/app/beauti/JPackageRepositoryDialog.java |  184 +
 src/beast/app/beauti/LoggerListInputEditor.java    |   61 +
 src/beast/app/beauti/MRCAPriorInputEditor.java     |  184 +
 src/beast/app/beauti/OperatorListInputEditor.java  |  168 +
 .../beauti/ParametricDistributionInputEditor.java  |  345 ++
 src/beast/app/beauti/PartitionContext.java         |   70 +
 src/beast/app/beauti/PriorInputEditor.java         |  126 +
 src/beast/app/beauti/PriorListInputEditor.java     |  272 ++
 src/beast/app/beauti/SiteModelInputEditor.java     |  343 ++
 .../app/beauti/SpeciesTreePriorInputEditor.java    |   38 +
 src/beast/app/beauti/StateNodeListInputEditor.java |   36 +
 src/beast/app/beauti/TaxonSetDialog.java           |  309 ++
 src/beast/app/beauti/TaxonSetInputEditor.java      |  585 +++
 src/beast/app/beauti/TipDatesInputEditor.java      |  613 +++
 .../app/beauti/TreeDistributionInputEditor.java    |  155 +
 src/beast/app/beauti/cancel.png                    |  Bin 0 -> 4750 bytes
 src/beast/app/beauti/finish.png                    |  Bin 0 -> 4484 bytes
 .../app/beauti/guiutil/S11InitialSelection.java    |  153 +
 src/beast/app/beauti/link.png                      |  Bin 0 -> 379 bytes
 src/beast/app/beauti/unlink.png                    |  Bin 0 -> 409 bytes
 src/beast/app/beauti/woosh.wav                     |  Bin 0 -> 15298 bytes
 src/beast/app/draw/Arrow.java                      |  264 ++
 src/beast/app/draw/BEASTObjectDialog.java          |  208 +
 src/beast/app/draw/BEASTObjectInputEditor.java     |  481 ++
 src/beast/app/draw/BEASTObjectPanel.java           |  474 ++
 src/beast/app/draw/BEASTObjectSet.java             |   20 +
 src/beast/app/draw/BEASTObjectShape.java           |  264 ++
 src/beast/app/draw/BooleanInputEditor.java         |   61 +
 src/beast/app/draw/Document.java                   | 1937 ++++++++
 src/beast/app/draw/DoubleInputEditor.java          |   17 +
 src/beast/app/draw/DoubleListInputEditor.java      |  406 ++
 src/beast/app/draw/EnumInputEditor.java            |   76 +
 src/beast/app/draw/ExtensionFileFilter.java        |   95 +
 src/beast/app/draw/HelpBrowser.java                |  200 +
 src/beast/app/draw/InputEditor.java                |  472 ++
 src/beast/app/draw/InputEditorFactory.java         |  349 ++
 src/beast/app/draw/InputShape.java                 |  188 +
 src/beast/app/draw/IntegerInputEditor.java         |   18 +
 src/beast/app/draw/ListInputEditor.java            |  472 ++
 src/beast/app/draw/ModelBuilder.java               | 2157 +++++++++
 src/beast/app/draw/MyAction.java                   |   67 +
 src/beast/app/draw/ParameterInputEditor.java       |  281 ++
 src/beast/app/draw/Selection.java                  |  169 +
 src/beast/app/draw/Shape.java                      |  410 ++
 src/beast/app/draw/SmallButton.java                |   45 +
 src/beast/app/draw/SmallButtonOld.java             |  106 +
 src/beast/app/draw/SmallLabel.java                 |   66 +
 src/beast/app/draw/StringInputEditor.java          |   28 +
 src/beast/app/draw/TrackPoint.java                 |   36 +
 src/beast/app/draw/icons/GenerationD.png           |  Bin 0 -> 2051 bytes
 src/beast/app/draw/icons/add.png                   |  Bin 0 -> 161 bytes
 src/beast/app/draw/icons/alignbottom.png           |  Bin 0 -> 195 bytes
 src/beast/app/draw/icons/alignleft.png             |  Bin 0 -> 191 bytes
 src/beast/app/draw/icons/alignright.png            |  Bin 0 -> 202 bytes
 src/beast/app/draw/icons/aligntop.png              |  Bin 0 -> 201 bytes
 src/beast/app/draw/icons/arrow.bmp                 |  Bin 0 -> 1194 bytes
 src/beast/app/draw/icons/arrow.png                 |  Bin 0 -> 267 bytes
 src/beast/app/draw/icons/beast.png                 |  Bin 0 -> 27970 bytes
 src/beast/app/draw/icons/beauti.png                |  Bin 0 -> 20131 bytes
 src/beast/app/draw/icons/bigger.png                |  Bin 0 -> 236 bytes
 src/beast/app/draw/icons/bold.png                  |  Bin 0 -> 1000 bytes
 src/beast/app/draw/icons/center.png                |  Bin 0 -> 570 bytes
 src/beast/app/draw/icons/centerhorizontal.png      |  Bin 0 -> 186 bytes
 src/beast/app/draw/icons/centervertical.png        |  Bin 0 -> 193 bytes
 src/beast/app/draw/icons/color.png                 |  Bin 0 -> 642 bytes
 src/beast/app/draw/icons/constant.png              |  Bin 0 -> 273 bytes
 src/beast/app/draw/icons/copy.png                  |  Bin 0 -> 204 bytes
 src/beast/app/draw/icons/cut.png                   |  Bin 0 -> 179 bytes
 src/beast/app/draw/icons/del.png                   |  Bin 0 -> 144 bytes
 src/beast/app/draw/icons/down.png                  |  Bin 0 -> 302 bytes
 src/beast/app/draw/icons/edit.png                  |  Bin 0 -> 394 bytes
 src/beast/app/draw/icons/ellipse.bmp               |  Bin 0 -> 1194 bytes
 src/beast/app/draw/icons/ellipse.png               |  Bin 0 -> 274 bytes
 src/beast/app/draw/icons/font.png                  |  Bin 0 -> 261 bytes
 src/beast/app/draw/icons/function.png              |  Bin 0 -> 227 bytes
 src/beast/app/draw/icons/help.png                  |  Bin 0 -> 239 bytes
 src/beast/app/draw/icons/italic.png                |  Bin 0 -> 799 bytes
 src/beast/app/draw/icons/left.png                  |  Bin 0 -> 336 bytes
 src/beast/app/draw/icons/line.bmp                  |  Bin 0 -> 1194 bytes
 src/beast/app/draw/icons/line.png                  |  Bin 0 -> 259 bytes
 src/beast/app/draw/icons/new.png                   |  Bin 0 -> 216 bytes
 src/beast/app/draw/icons/open.png                  |  Bin 0 -> 203 bytes
 src/beast/app/draw/icons/paste.png                 |  Bin 0 -> 221 bytes
 src/beast/app/draw/icons/poly.bmp                  |  Bin 0 -> 1194 bytes
 src/beast/app/draw/icons/poly.png                  |  Bin 0 -> 281 bytes
 src/beast/app/draw/icons/print.png                 |  Bin 0 -> 269 bytes
 src/beast/app/draw/icons/rect.bmp                  |  Bin 0 -> 1194 bytes
 src/beast/app/draw/icons/rect.png                  |  Bin 0 -> 245 bytes
 src/beast/app/draw/icons/redo.png                  |  Bin 0 -> 223 bytes
 src/beast/app/draw/icons/right.png                 |  Bin 0 -> 340 bytes
 src/beast/app/draw/icons/rrect.bmp                 |  Bin 0 -> 1194 bytes
 src/beast/app/draw/icons/rrect.png                 |  Bin 0 -> 260 bytes
 src/beast/app/draw/icons/save.png                  |  Bin 0 -> 176 bytes
 src/beast/app/draw/icons/select.bmp                |  Bin 0 -> 1194 bytes
 src/beast/app/draw/icons/select.gif                |  Bin 0 -> 868 bytes
 src/beast/app/draw/icons/select.jpg                |  Bin 0 -> 773 bytes
 src/beast/app/draw/icons/select.png                |  Bin 0 -> 266 bytes
 src/beast/app/draw/icons/smaller.png               |  Bin 0 -> 216 bytes
 src/beast/app/draw/icons/spacehorizontal.png       |  Bin 0 -> 190 bytes
 src/beast/app/draw/icons/spacevertical.png         |  Bin 0 -> 183 bytes
 src/beast/app/draw/icons/tcolor.png                |  Bin 0 -> 956 bytes
 src/beast/app/draw/icons/undo.png                  |  Bin 0 -> 218 bytes
 src/beast/app/seqgen/MergeDataWith.java            |   76 +
 src/beast/app/seqgen/SequenceSimulator.java        |  321 ++
 src/beast/app/seqgen/SimulatedAlignment.java       |  221 +
 src/beast/app/tools/AppStore.java                  |  479 ++
 src/beast/app/tools/AppStoreLauncher.java          |   19 +
 src/beast/app/tools/EBSPAnalyser.java              |  447 ++
 src/beast/app/tools/LogCombiner.java               |  495 ++
 src/beast/app/tools/LogCombinerDialog.java         |  390 ++
 src/beast/app/tools/LogCombinerLauncher.java       |   17 +
 src/beast/app/tools/TableEditorStopper.java        |   80 +
 src/beast/app/tools/images/EBSPAnalyser.png        |  Bin 0 -> 35295 bytes
 src/beast/app/tools/images/logcombiner.png         |  Bin 0 -> 19198 bytes
 src/beast/app/tools/images/utility.png             |  Bin 0 -> 29413 bytes
 src/beast/app/treeannotator/CladeSystem.java       |  386 ++
 src/beast/app/treeannotator/ContourAttrib.java     |   79 +
 src/beast/app/treeannotator/ContourGenerator.java  |  896 ++++
 src/beast/app/treeannotator/ContourMaker.java      |   11 +
 src/beast/app/treeannotator/ContourPath.java       |  129 +
 src/beast/app/treeannotator/ContourWithSynder.java |   61 +
 src/beast/app/treeannotator/FileDrop.java          |  900 ++++
 .../treeannotator/KernelDensityEstimator2D.java    |  280 ++
 src/beast/app/treeannotator/RealNumberField.java   |  332 ++
 src/beast/app/treeannotator/SnyderContour.java     |  496 ++
 src/beast/app/treeannotator/TreeAnnotator.java     | 1536 +++++++
 .../app/treeannotator/TreeAnnotatorDialog.java     |  241 +
 .../app/treeannotator/TreeAnnotatorLauncher.java   |   22 +
 src/beast/app/treeannotator/TreeSetParser.java     |  618 +++
 src/beast/app/util/Arguments.java                  |  611 +++
 src/beast/app/util/ErrorLogHandler.java            |   71 +
 src/beast/app/util/FileDrop.java                   |  895 ++++
 src/beast/app/util/MessageLogHandler.java          |   46 +
 src/beast/app/util/Utils.java                      |  310 ++
 src/beast/app/util/Utils6.java                     |   98 +
 src/beast/app/util/Version.java                    |   34 +
 src/beast/app/util/WholeNumberField.java           |  202 +
 src/beast/app/util/images/beast.png                |  Bin 0 -> 27970 bytes
 src/beast/core/BEASTInterface.java                 |  377 ++
 src/beast/core/BEASTObject.java                    |   76 +
 src/beast/core/BEASTObjectAnnotation.java          |   12 +
 src/beast/core/CalculationNode.java                |  129 +
 src/beast/core/Citation.java                       |   56 +
 src/beast/core/Description.java                    |   61 +
 src/beast/core/Distribution.java                   |  172 +
 src/beast/core/Evaluator.java                      |    9 +
 src/beast/core/Function.java                       |   29 +
 src/beast/core/Input.java                          |  732 +++
 src/beast/core/Loggable.java                       |   39 +
 src/beast/core/Logger.java                         |  592 +++
 src/beast/core/MCMC.java                           |  575 +++
 src/beast/core/Operator.java                       |  309 ++
 src/beast/core/OperatorSchedule.java               |  325 ++
 src/beast/core/Param.java                          |   43 +
 src/beast/core/Runnable.java                       |   45 +
 src/beast/core/State.java                          |  632 +++
 src/beast/core/StateNode.java                      |  227 +
 src/beast/core/StateNodeInitialiser.java           |   36 +
 src/beast/core/parameter/BooleanParameter.java     |  117 +
 src/beast/core/parameter/BooleanParameterList.java |   44 +
 src/beast/core/parameter/CompoundValuable.java     |  104 +
 src/beast/core/parameter/GeneralParameterList.java |  654 +++
 src/beast/core/parameter/IntegerParameter.java     |  112 +
 src/beast/core/parameter/IntegerParameterList.java |   49 +
 src/beast/core/parameter/Map.java                  |   93 +
 src/beast/core/parameter/Parameter.java            |  472 ++
 src/beast/core/parameter/RealParameter.java        |  119 +
 src/beast/core/parameter/RealParameterList.java    |   49 +
 src/beast/core/util/CompoundDistribution.java      |  238 +
 src/beast/core/util/ESS.java                       |  260 ++
 src/beast/core/util/Evaluator.java                 |    9 +
 src/beast/core/util/Log.java                       |  115 +
 src/beast/core/util/Sum.java                       |  121 +
 src/beast/evolution/alignment/Alignment.java       |  737 +++
 .../evolution/alignment/AscertainedAlignment.java  |   95 +
 .../evolution/alignment/FilteredAlignment.java     |  332 ++
 src/beast/evolution/alignment/Sequence.java        |  165 +
 src/beast/evolution/alignment/Taxon.java           |   89 +
 src/beast/evolution/alignment/TaxonSet.java        |  171 +
 .../evolution/alignment/distance/Distance.java     |   90 +
 .../evolution/alignment/distance/F84Distance.java  |  137 +
 .../alignment/distance/HammingDistance.java        |   21 +
 .../alignment/distance/JukesCantorDistance.java    |   81 +
 .../evolution/alignment/distance/SMMDistance.java  |   31 +
 .../evolution/branchratemodel/BranchRateModel.java |   23 +
 .../branchratemodel/RandomLocalClockModel.java     |  172 +
 .../evolution/branchratemodel/RateStatistic.java   |  191 +
 .../branchratemodel/StrictClockModel.java          |   51 +
 .../branchratemodel/UCRelaxedClockModel.java       |  406 ++
 src/beast/evolution/datatype/Aminoacid.java        |   33 +
 src/beast/evolution/datatype/Binary.java           |   38 +
 src/beast/evolution/datatype/DataType.java         |  291 ++
 src/beast/evolution/datatype/IntegerData.java      |   34 +
 src/beast/evolution/datatype/Nucleotide.java       |   42 +
 src/beast/evolution/datatype/StandardData.java     |  188 +
 src/beast/evolution/datatype/TwoStateCovarion.java |   35 +
 src/beast/evolution/datatype/UserDataType.java     |  110 +
 .../evolution/likelihood/BeagleTreeLikelihood.java | 1032 +++++
 .../evolution/likelihood/BeerLikelihoodCore.java   |  891 ++++
 .../evolution/likelihood/BeerLikelihoodCore4.java  |  311 ++
 .../likelihood/GenericTreeLikelihood.java          |   50 +
 src/beast/evolution/likelihood/LikelihoodCore.java |  181 +
 src/beast/evolution/likelihood/TreeLikelihood.java |  542 +++
 src/beast/evolution/operators/BitFlipOperator.java |   99 +
 .../operators/CompoundParameterHelper.java         |   81 +
 .../evolution/operators/DeltaExchangeOperator.java |  344 ++
 src/beast/evolution/operators/Exchange.java        |  244 +
 .../evolution/operators/IntRandomWalkOperator.java |   57 +
 .../evolution/operators/IntUniformOperator.java    |   43 +
 src/beast/evolution/operators/JointOperator.java   |   78 +
 src/beast/evolution/operators/NodeReheight.java    |  301 ++
 .../operators/RealRandomWalkOperator.java          |  110 +
 src/beast/evolution/operators/ScaleOperator.java   |  317 ++
 src/beast/evolution/operators/SliceOperator.java   |  246 +
 src/beast/evolution/operators/SubtreeSlide.java    |  287 ++
 src/beast/evolution/operators/SwapOperator.java    |   63 +
 .../evolution/operators/TipDatesRandomWalker.java  |  186 +
 src/beast/evolution/operators/TipDatesScaler.java  |  125 +
 src/beast/evolution/operators/TreeOperator.java    |   69 +
 src/beast/evolution/operators/Uniform.java         |  108 +
 src/beast/evolution/operators/UniformOperator.java |   60 +
 src/beast/evolution/operators/UpDownOperator.java  |  192 +
 src/beast/evolution/operators/WilsonBalding.java   |  198 +
 src/beast/evolution/sitemodel/SiteModel.java       |  612 +++
 .../evolution/sitemodel/SiteModelInterface.java    |  188 +
 .../speciation/BirthDeathGernhard08Model.java      |  138 +
 .../speciation/CalibratedBirthDeathModel.java      | 1046 +++++
 .../speciation/CalibratedYuleInitialTree.java      |   79 +
 .../evolution/speciation/CalibratedYuleModel.java  |  892 ++++
 .../speciation/CalibrationLineagesIterator.java    |  296 ++
 .../evolution/speciation/CalibrationPoint.java     |   55 +
 .../GeneTreeForSpeciesTreeDistribution.java        |  401 ++
 src/beast/evolution/speciation/RandomGeneTree.java |   54 +
 .../speciation/SpeciesTreeDistribution.java        |  101 +
 .../evolution/speciation/SpeciesTreeLogger.java    |  177 +
 .../evolution/speciation/SpeciesTreePrior.java     |  194 +
 .../evolution/speciation/StarBeastStartState.java  |  416 ++
 src/beast/evolution/speciation/TreeTopFinder.java  |   61 +
 src/beast/evolution/speciation/YuleModel.java      |  171 +
 .../substitutionmodel/BinaryCovarion.java          |  333 ++
 .../evolution/substitutionmodel/Blosum62.java      |  272 ++
 src/beast/evolution/substitutionmodel/CPREV.java   |  271 ++
 src/beast/evolution/substitutionmodel/Dayhoff.java |  274 ++
 .../substitutionmodel/DefaultEigenSystem.java      |  659 +++
 .../substitutionmodel/EigenDecomposition.java      |  108 +
 .../evolution/substitutionmodel/EigenSystem.java   |   14 +
 .../EmpiricalSubstitutionModel.java                |  132 +
 .../evolution/substitutionmodel/Frequencies.java   |  259 ++
 src/beast/evolution/substitutionmodel/GTR.java     |   94 +
 .../GeneralSubstitutionModel.java                  |  273 ++
 src/beast/evolution/substitutionmodel/HKY.java     |  270 ++
 src/beast/evolution/substitutionmodel/JTT.java     |  273 ++
 .../evolution/substitutionmodel/JukesCantor.java   |   72 +
 src/beast/evolution/substitutionmodel/MTREV.java   |  279 ++
 .../substitutionmodel/MutationDeathModel.java      |  103 +
 src/beast/evolution/substitutionmodel/SYM.java     |  108 +
 .../substitutionmodel/SubstitutionModel.java       |  172 +
 src/beast/evolution/substitutionmodel/TIM.java     |   91 +
 src/beast/evolution/substitutionmodel/TN93.java    |  389 ++
 src/beast/evolution/substitutionmodel/TVM.java     |   95 +
 src/beast/evolution/substitutionmodel/WAG.java     |  727 +++
 src/beast/evolution/tree/CladeSet.java             |  261 ++
 src/beast/evolution/tree/Node.java                 |  813 ++++
 src/beast/evolution/tree/RandomTree.java           |  700 +++
 src/beast/evolution/tree/TraitSet.java             |  256 ++
 src/beast/evolution/tree/Tree.java                 |  956 ++++
 src/beast/evolution/tree/TreeDistribution.java     |   53 +
 src/beast/evolution/tree/TreeHeightLogger.java     |   59 +
 src/beast/evolution/tree/TreeInterface.java        |   65 +
 src/beast/evolution/tree/TreeTraceAnalysis.java    |  309 ++
 src/beast/evolution/tree/TreeUtils.java            |  400 ++
 .../evolution/tree/TreeWithMetaDataLogger.java     |  166 +
 .../evolution/tree/coalescent/BayesianSkyline.java |  351 ++
 .../evolution/tree/coalescent/Coalescent.java      |  148 +
 .../coalescent/CompoundPopulationFunction.java     |  619 +++
 .../tree/coalescent/ConstantPopulation.java        |  141 +
 .../tree/coalescent/ExponentialGrowth.java         |  212 +
 .../evolution/tree/coalescent/IntervalList.java    |  157 +
 .../evolution/tree/coalescent/IntervalType.java    |   75 +
 .../tree/coalescent/PopulationFunction.java        |  256 ++
 .../evolution/tree/coalescent/SampleOffValues.java |   87 +
 .../tree/coalescent/ScaledPopulationFunction.java  |   56 +
 .../evolution/tree/coalescent/TreeIntervals.java   |  491 ++
 src/beast/math/Binomial.java                       |  102 +
 src/beast/math/GammaFunction.java                  |  205 +
 src/beast/math/MachineAccuracy.java                |   82 +
 src/beast/math/distributions/Beta.java             |   53 +
 src/beast/math/distributions/ChiSquare.java        |   48 +
 src/beast/math/distributions/Dirichlet.java        |   82 +
 src/beast/math/distributions/Exponential.java      |   53 +
 src/beast/math/distributions/Gamma.java            |   57 +
 src/beast/math/distributions/InverseGamma.java     |   98 +
 .../math/distributions/LaplaceDistribution.java    |   95 +
 .../distributions/LogNormalDistributionModel.java  |  136 +
 src/beast/math/distributions/MRCAPrior.java        |  316 ++
 .../distributions/MarkovChainDistribution.java     |  123 +
 src/beast/math/distributions/Normal.java           |   67 +
 src/beast/math/distributions/OneOnX.java           |   57 +
 .../math/distributions/ParametricDistribution.java |  201 +
 src/beast/math/distributions/Poisson.java          |   61 +
 src/beast/math/distributions/Prior.java            |   78 +
 src/beast/math/distributions/Uniform.java          |  122 +
 src/beast/math/statistic/DiscreteStatistics.java   |  394 ++
 src/beast/math/statistic/RPNcalculator.java        |  157 +
 .../math/statistic/RPNexpressionCalculator.java    |  199 +
 src/beast/util/AddOnManager.java                   | 1186 +++++
 src/beast/util/ClusterTree.java                    |  809 ++++
 src/beast/util/CollectionUtils.java                |   56 +
 src/beast/util/CredibleSet.java                    |   58 +
 src/beast/util/FrequencySet.java                   |  185 +
 src/beast/util/HeapSort.java                       |  383 ++
 src/beast/util/JSONParser.java                     | 1122 +++++
 src/beast/util/JSONParserException.java            |  137 +
 src/beast/util/JSONProducer.java                   |  449 ++
 src/beast/util/LogAnalyser.java                    |  525 +++
 src/beast/util/LogComparator.java                  |  168 +
 src/beast/util/MersenneTwisterFast.java            |  780 ++++
 src/beast/util/NexusParser.java                    | 1017 +++++
 src/beast/util/NexusParserListener.java            |   16 +
 src/beast/util/OutputUtils.java                    |   65 +
 src/beast/util/Package.java                        |  162 +
 src/beast/util/PackageDependency.java              |   71 +
 src/beast/util/Randomizer.java                     |  494 ++
 src/beast/util/TreeParser.java                     |  630 +++
 src/beast/util/XMLParser.java                      | 1035 +++++
 src/beast/util/XMLParserException.java             |  112 +
 src/beast/util/XMLParserUtils.java                 |  158 +
 src/beast/util/XMLProducer.java                    | 1019 +++++
 src/beast/util/treeparser/Newick.g4                |   38 +
 src/beast/util/treeparser/NewickBaseVisitor.java   |   77 +
 src/beast/util/treeparser/NewickLexer.java         |  136 +
 src/beast/util/treeparser/NewickParser.java        |  627 +++
 src/beast/util/treeparser/NewickVisitor.java       |   67 +
 .../apache/commons/math/ConvergenceException.java  |   73 +
 .../apache/commons/math/ConvergingAlgorithm.java   |  138 +
 .../commons/math/ConvergingAlgorithmImpl.java      |  155 +
 .../commons/math/FunctionEvaluationException.java  |  169 +
 .../commons/math/MathConfigurationException.java   |   74 +
 src/org/apache/commons/math/MathException.java     |  202 +
 .../apache/commons/math/MathRuntimeException.java  |  541 +++
 .../math/MaxEvaluationsExceededException.java      |   75 +
 .../math/MaxIterationsExceededException.java       |   75 +
 .../commons/math/analysis/BinaryFunction.java      |  134 +
 .../math/analysis/BivariateRealFunction.java       |   41 +
 .../commons/math/analysis/ComposableFunction.java  |  577 +++
 .../DifferentiableUnivariateRealFunction.java      |   34 +
 .../math/analysis/MultivariateRealFunction.java    |   41 +
 .../math/analysis/UnivariateRealFunction.java      |   37 +
 .../analysis/integration/RombergIntegrator.java    |  126 +
 .../analysis/integration/TrapezoidIntegrator.java  |  150 +
 .../integration/UnivariateRealIntegrator.java      |  107 +
 .../integration/UnivariateRealIntegratorImpl.java  |  197 +
 .../math/analysis/solvers/BisectionSolver.java     |  116 +
 .../commons/math/analysis/solvers/BrentSolver.java |  362 ++
 .../math/analysis/solvers/MullerSolver.java        |  370 ++
 .../math/analysis/solvers/NewtonSolver.java        |  141 +
 .../math/analysis/solvers/RiddersSolver.java       |  207 +
 .../math/analysis/solvers/SecantSolver.java        |  190 +
 .../analysis/solvers/UnivariateRealSolver.java     |  168 +
 .../solvers/UnivariateRealSolverFactory.java       |   96 +
 .../solvers/UnivariateRealSolverFactoryImpl.java   |   74 +
 .../analysis/solvers/UnivariateRealSolverImpl.java |  280 ++
 .../solvers/UnivariateRealSolverUtils.java         |  254 ++
 .../AbstractContinuousDistribution.java            |  199 +
 .../math/distribution/AbstractDistribution.java    |   70 +
 .../distribution/AbstractIntegerDistribution.java  |  266 ++
 .../math/distribution/BetaDistribution.java        |   70 +
 .../math/distribution/BetaDistributionImpl.java    |  255 ++
 .../math/distribution/BinomialDistribution.java    |   64 +
 .../distribution/BinomialDistributionImpl.java     |  229 +
 .../math/distribution/CauchyDistribution.java      |   67 +
 .../math/distribution/CauchyDistributionImpl.java  |  288 ++
 .../math/distribution/ChiSquaredDistribution.java  |   56 +
 .../distribution/ChiSquaredDistributionImpl.java   |  289 ++
 .../math/distribution/ContinuousDistribution.java  |   54 +
 .../math/distribution/DiscreteDistribution.java    |   35 +
 .../commons/math/distribution/Distribution.java    |   55 +
 .../math/distribution/ExponentialDistribution.java |   56 +
 .../distribution/ExponentialDistributionImpl.java  |  259 ++
 .../commons/math/distribution/FDistribution.java   |   64 +
 .../math/distribution/FDistributionImpl.java       |  302 ++
 .../math/distribution/GammaDistribution.java       |   72 +
 .../math/distribution/GammaDistributionImpl.java   |  315 ++
 .../commons/math/distribution/HasDensity.java      |   45 +
 .../distribution/HypergeometricDistribution.java   |   82 +
 .../HypergeometricDistributionImpl.java            |  363 ++
 .../math/distribution/IntegerDistribution.java     |   85 +
 .../math/distribution/NormalDistribution.java      |   73 +
 .../math/distribution/NormalDistributionImpl.java  |  327 ++
 .../math/distribution/PascalDistribution.java      |   73 +
 .../math/distribution/PascalDistributionImpl.java  |  233 +
 .../math/distribution/PoissonDistribution.java     |   64 +
 .../math/distribution/PoissonDistributionImpl.java |  286 ++
 .../math/distribution/SaddlePointExpansion.java    |  204 +
 .../commons/math/distribution/TDistribution.java   |   48 +
 .../math/distribution/TDistributionImpl.java       |  237 +
 .../math/distribution/WeibullDistribution.java     |   70 +
 .../math/distribution/WeibullDistributionImpl.java |  280 ++
 .../math/distribution/ZipfDistribution.java        |   71 +
 .../math/distribution/ZipfDistributionImpl.java    |  221 +
 src/org/apache/commons/math/special/Beta.java      |  198 +
 src/org/apache/commons/math/special/Erf.java       |   57 +
 src/org/apache/commons/math/special/Gamma.java     |  345 ++
 .../commons/math/util/ContinuedFraction.java       |  213 +
 src/org/apache/commons/math/util/MathUtils.java    | 1864 ++++++++
 .../commons/math/util/OpenIntToDoubleHashMap.java  |  680 +++
 src/org/json/CDL.java                              |  279 ++
 src/org/json/Cookie.java                           |  169 +
 src/org/json/CookieList.java                       |   90 +
 src/org/json/HTTP.java                             |  163 +
 src/org/json/HTTPTokener.java                      |   77 +
 src/org/json/JSONArray.java                        |  987 ++++
 src/org/json/JSONException.java                    |   41 +
 src/org/json/JSONML.java                           |  467 ++
 src/org/json/JSONObject.java                       | 1665 +++++++
 src/org/json/JSONString.java                       |   18 +
 src/org/json/JSONStringer.java                     |   78 +
 src/org/json/JSONTokener.java                      |  446 ++
 src/org/json/JSONWriter.java                       |  327 ++
 src/org/json/Kim.java                              |  373 ++
 src/org/json/Property.java                         |   74 +
 src/org/json/README                                |   68 +
 src/org/json/XML.java                              |  508 +++
 src/org/json/XMLTokener.java                       |  365 ++
 src/org/json/zip/BitInputStream.java               |  169 +
 src/org/json/zip/BitOutputStream.java              |  154 +
 src/org/json/zip/BitReader.java                    |   41 +
 src/org/json/zip/BitWriter.java                    |   51 +
 src/org/json/zip/Compressor.java                   |  575 +++
 src/org/json/zip/Decompressor.java                 |  325 ++
 src/org/json/zip/Huff.java                         |  406 ++
 src/org/json/zip/JSONzip.java                      |  281 ++
 src/org/json/zip/Keep.java                         |   84 +
 src/org/json/zip/MapKeep.java                      |  160 +
 src/org/json/zip/None.java                         |   15 +
 src/org/json/zip/PostMortem.java                   |   47 +
 src/org/json/zip/README                            |    2 +
 src/org/json/zip/TrieKeep.java                     |  396 ++
 src/test/beast/BEASTTestCase.java                  |  140 +
 src/test/beast/app/BeautiSubTemplateTest.java      |  257 ++
 src/test/beast/app/BeautiTest.java                 |  152 +
 src/test/beast/app/beauti/BeautiBase.java          |  358 ++
 .../app/beauti/BeautiDivergenceDatingTest.java     |  601 +++
 .../beast/app/beauti/BeautiRateTutorialTest.java   |  388 ++
 src/test/beast/app/beauti/BeautiSimpleTest.java    |  129 +
 src/test/beast/app/beauti/BeautiStarBeastTest.java |  181 +
 src/test/beast/app/beauti/CloneTest.java           |  158 +
 src/test/beast/app/beauti/FixedMeanRateTest.java   |   98 +
 src/test/beast/app/beauti/LinkUnlinkTest.java      |  546 +++
 .../beast/app/beauti/SimpleClockModelTest.java     |  111 +
 src/test/beast/app/beauti/SimpleTreePriorTest.java |   64 +
 src/test/beast/beast2vs1/ClockModelTest.java       |  111 +
 src/test/beast/beast2vs1/StarBEASTTest.java        |  134 +
 .../beast/beast2vs1/SubstitutionModelTest.java     |  117 +
 src/test/beast/beast2vs1/TaxonOrderTest.java       |   71 +
 src/test/beast/beast2vs1/TestFramework.java        |   86 +
 src/test/beast/beast2vs1/TipTimeTest.java          |  114 +
 src/test/beast/beast2vs1/TreePriorTest.java        |  201 +
 src/test/beast/beast2vs1/TreeTest.java             |   73 +
 .../beast/beast2vs1/trace/DiscreteStatistics.java  |  394 ++
 src/test/beast/beast2vs1/trace/Expectation.java    |   95 +
 src/test/beast/beast2vs1/trace/LogAnalyser.java    |  357 ++
 src/test/beast/beast2vs1/trace/LogFileTraces.java  |  218 +
 .../beast/beast2vs1/trace/NumberFormatter.java     |  164 +
 src/test/beast/beast2vs1/trace/TraceException.java |   43 +
 .../beast/beast2vs1/trace/TraceStatistics.java     |  209 +
 src/test/beast/beast2vs1/trace/TraceType.java      |   33 +
 src/test/beast/beast2vs1/trace/TrimLineReader.java |   78 +
 src/test/beast/core/BEASTInterfaceTest.java        |  123 +
 src/test/beast/core/StateNodeInitialiserTest.java  |   50 +
 .../core/parameter/BooleanParameterListTest.java   |  161 +
 .../core/parameter/IntegerParameterListTest.java   |  129 +
 src/test/beast/core/parameter/ParameterTest.java   |   33 +
 .../core/parameter/RealParameterListTest.java      |  129 +
 .../evolution/alignment/FilteredAlignmentTest.java |  284 ++
 .../alignment/UncertainAlignmentTest.java          |  119 +
 .../alignment/UnorderedAlignmentsTest.java         |  107 +
 .../evolution/likelihood/TreeLikelihoodTest.java   |  690 +++
 .../evolution/operator/ExchangeOperatorTest.java   |  130 +
 .../operator/IntRandomWalkOperatorTest.java        |   79 +
 .../operator/UniformIntegerOperatorTest.java       |   94 +
 .../speciation/BirthDeathGernhard08ModelTest.java  |   65 +
 src/test/beast/evolution/substmodel/GTRTest.java   |  188 +
 src/test/beast/evolution/substmodel/HKYTest.java   |  137 +
 src/test/beast/evolution/tree/RandomTreeTest.java  |  158 +
 .../beast/evolution/tree/TreeAnnotatorTest.java    |  158 +
 .../tree/coalescent/BayesianSkylineTest.java       |   42 +
 .../evolution/tree/coalescent/CoalescentTest.java  |   62 +
 .../evolution/tree/newick/NewickTreeTest.java      |   39 +
 src/test/beast/integration/DocumentationTest.java  |  119 +
 .../beast/integration/ExampleJSONParsingTest.java  |  127 +
 .../beast/integration/ExampleXmlParsingTest.java   |  137 +
 src/test/beast/integration/InputTypeTest.java      |   50 +
 src/test/beast/integration/ResumeTest.java         |   60 +
 src/test/beast/integration/XMLElementNameTest.java |  122 +
 src/test/beast/integration/XMLProducerTest.java    |   82 +
 src/test/beast/math/distributions/GammaTest.java   |   28 +
 .../LogNormalDistributionModelTest.java            |   86 +
 .../beast/math/distributions/MRCAPriorTest.java    |  123 +
 .../MeanOfParametricDistributionTest.java          |  133 +
 src/test/beast/util/ClusterTreeTest.java           |   77 +
 src/test/beast/util/JSONTest.java                  |   29 +
 src/test/beast/util/NexusParserTest.java           |  162 +
 src/test/beast/util/TreeParserTest.java            |  111 +
 templates/ClockModels.xml                          |  293 ++
 templates/ParametricDistributions.xml              |  134 +
 templates/Standard.xml                             |  356 ++
 templates/StarBeast.xml                            |  437 ++
 templates/SubstModels.xml                          |  384 ++
 templates/TreePriors.xml                           |  414 ++
 test.xml                                           |   50 +
 949 files changed, 169101 insertions(+), 1955 deletions(-)

diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..4362b49
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,502 @@
+                  GNU LESSER GENERAL PUBLIC LICENSE
+                       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+                            Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+

+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+

+                  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+

+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+

+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+

+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+

+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+

+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+

+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+                            NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+                     END OF TERMS AND CONDITIONS
+

+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library 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 library 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 library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..4057f2d
--- /dev/null
+++ b/README.md
@@ -0,0 +1,39 @@
+BEAST 2
+=======
+
+BEAST is a cross-platform program for Bayesian inference using MCMC of
+molecular sequences. It is entirely orientated towards rooted,
+time-measured phylogenies inferred using strict or relaxed molecular
+clock models. It can be used as a method of reconstructing phylogenies
+but is also a framework for testing evolutionary hypotheses without
+conditioning on a single tree topology. BEAST uses MCMC to average
+over tree space, so that each tree is weighted proportional to its
+posterior probability. We include a simple to use user-interface
+program for setting up standard analyses and a suit of programs for
+analysing the results.
+
+NOTE: This directory contains the BEAST 2 source code, and is
+therefore of interest primarily to BEAST 2 developers.  For binary
+releases, user tutorials and other information you should visit the
+project website at www.beast2.org.
+
+Development Rules and Philosophy
+--------------------------------
+
+Aspects relating to BEAST 2 development such as coding style, version
+numbering and design philosophy are discussed on the BEAST 2 web page at
+http://beast2.org/core-development-rules/.
+
+License
+-------
+
+BEAST 2 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 software 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 contained in the file COPYING for more
+details.
diff --git a/build.xml b/build.xml
new file mode 100644
index 0000000..1994e77
--- /dev/null
+++ b/build.xml
@@ -0,0 +1,705 @@
+<!-- Build BEAST 2. It is also used by Hudson BEAST_2 project. JUnit test is available for this build. -->
+<project basedir="." default="build_jar_all_BEAST" name="BUILD_BEAST_2">
+    <description>
+        Build BEAST 2.
+        Also used by Hudson BEAST_2 project.
+        JUnit test is available for this build.
+        $Id: build_BEAST_2.xml $
+    </description>
+
+    <!-- set global properties for this build -->
+    <property name="src" location="../beast2/src" />
+    <property name="build" location="../beast2/build" />
+    <property name="lib" location="../beast2/lib" />
+    <property name="doc" location="../beast2/doc" />
+    <property name="dist" location="../beast2/build/dist" />
+    <property name="test" location="../beast2/test" />
+
+    <property name="main_class_BEAST" value="beast.app.beastapp.BeastMain" />
+    <property name="report" value="build/junitreport" />
+
+    <path id="classpath">
+        <fileset dir="${lib}" includes="beagle.jar"/>
+        <fileset dir="${lib}" includes="jam.jar"/>
+        <fileset dir="${lib}" includes="colt.jar"/>
+        <fileset dir="${lib}" includes="fest.jar"/>
+        <fileset dir="${lib}" includes="junit-4.8.2.jar"/>
+        <fileset dir="${lib}" includes="antlr-runtime-4.5.jar"/>
+    </path>
+
+    <!--
+        <path id="testclasspath">
+            <fileset dir="${lib}" includes="**/*.jar" />
+        </path>
+    -->
+
+    <!-- start -->
+    <target name="init">
+        <echo message="${ant.project.name}: ${ant.file}" />
+    </target>
+
+    <target name="clean">
+        <delete dir="${build}" />
+        <delete dir="${test}" />
+    </target>
+
+    <!-- clean previous build, and then compile Java source code, and Juint test -->
+    <target name="build_all_BEAST" depends="clean,compile-all,junit" description="Clean and Build all run-time stuff">
+    </target>
+
+    <!-- clean previous build, compile Java source code, and Junit test, and make the beast.jar and beauti.jar -->
+    <target name="build_jar_all_BEAST"
+            depends="clean,compile-all,junit,dist_all_BEAST"
+            description="Clean and Build all run-time stuff">
+    </target>
+
+
+    <!-- No JUnit Test, clean previous build, compile Java source code, and make the beast.jar and beauti.jar -->
+    <target name="build_jar_all_BEAST_NoJUnitTest"
+            depends="clean,compile-all,dist_all_BEAST"
+            description="Clean and Build all run-time stuff">
+    </target>
+
+    <!-- compile Java source code -->
+    <target name="compile-all" depends="init">
+        <echo>Building BEAST 2</echo>
+        <mkdir dir="${build}" />
+
+        <!-- Compile the java code from ${src} into ${build} /bin -->
+        <javac source="1.8"
+               target="1.8"
+               srcdir="${src}"
+               destdir="${build}"
+               classpathref="classpath"
+               fork="true"
+               memoryinitialsize="256m"
+               memorymaximumsize="1024m"
+               includeAntRuntime='false'>
+            <include name="beast/**/**" />
+            <!-- apache commons math -->
+            <include name="org/**/**" />
+            <!-- compile JUnit test classes -->
+            <include name="test/beast/**" />
+        </javac>
+
+        <!-- compile the launcher apps against Java 6-->
+        <delete file="${build}/beast/app/beastapp/BeastLauncher.class" />
+        <delete file="${build}/beast/app/beauti/BeautiLauncher.class" />
+        <delete file="${build}/beast/app/tools/AppStoreLauncher.class" />
+        <delete file="${build}/beast/app/tools/LogCombinerLauncher.class" />
+        <delete file="${build}/beast/app/treeannotator/TreeAnnotatorLauncher.class" />
+        <delete file="${build}/beast/app/util/Utils6.class" />
+        <javac source="1.6"
+               target="1.6"
+               bootclasspath='/opt/jdk1.6.0_45/jre/lib/rt.jar'
+               srcdir="${src}"
+               destdir="${build}"
+               classpathref="classpath"
+               fork="true"
+               memoryinitialsize="256m"
+               memorymaximumsize="1024m"
+               includeAntRuntime='false'>
+            <include name="beast/**/*Launcher.java" />
+            <include name="beast/**/Utils6.java" />
+        </javac>
+        <copy todir="${build}">
+            <fileset dir="${src}" includes="**/*.properties" />
+            <fileset dir="${src}" includes="**/*.png" />
+        </copy>
+        <echo message="Successfully compiled." />
+    </target>
+
+    <!-- make the beast.jar and beauti.jar -->
+    <target name="dist_all_BEAST" depends="compile-all" description="create BEAST jar">
+        <!-- Create the distribution directory -->
+        <mkdir dir="${dist}" />
+
+        <!-- Put everything in ${build} into the beast.jar file -->
+        <jar jarfile="${dist}/beast.jar">
+            <manifest>
+                <attribute name="Built-By" value="${user.name}" />
+                <attribute name="Main-Class" value="${main_class_BEAST}" />
+            </manifest>
+            <fileset dir="${build}">
+                <include name="beast/**/*.class" />
+                <include name="beast/**/*.properties" />
+                <include name="beast/**/*.png" />
+                <include name="beagle/**/*.class" />
+                <include name="org/**/*.class" />
+            </fileset>
+            <zipgroupfileset dir="${lib}" includes="jam.jar" />
+            <zipgroupfileset dir="${lib}" includes="beagle.jar" />
+            <zipgroupfileset dir="${lib}" includes="colt.jar" />
+            <zipgroupfileset dir="${lib}" includes="commons-math3-3.1.1.jar" />
+            <zipgroupfileset dir="${lib}" includes="antlr-runtime-4.5.jar"/>
+        </jar>
+        <jar jarfile="${dist}/launcher.jar">
+            <fileset dir="${build}">
+                <include name="beast/**/*Launcher.class" />
+                <include name="beast/**/Utils6*.class" />
+                <include name="beast/app/draw/icons/beauti.png"/>
+            </fileset>
+        </jar>
+        <jar jarfile="${dist}/beast.src.jar">
+            <fileset dir="${src}">
+                <include name="beast/**/*.java" />
+                <include name="org/**/*.java" />
+                <include name="test/**/*.java" />
+                <include name="beast/**/*.png" />
+                <include name="beast/**/*.xsl" />
+            </fileset>
+        </jar>
+    </target>
+
+    <!-- run beast.jar -->
+    <target name="run_BEAST">
+        <java jar="${dist}/beast.jar" fork="true" />
+    </target>
+
+    <!-- JUnit test -->
+    <target name="junit">
+        <mkdir dir="${report}" />
+        <junit printsummary="yes" failureproperty="junitfailed">
+            <!--showoutput='yes'-->
+            <classpath>
+                <path refid="classpath" />
+                <path location="${build}" />
+            </classpath>
+
+            <formatter type="xml" />
+
+            <batchtest fork="yes" todir="${report}">
+                <fileset dir="${src}">
+                    <include name="test/**/*Test.java" />
+                    <exclude name="test/beast/beast2vs1/**/*Test.java"/>
+                    <exclude name="test/beast/app/beauti/**/*Test.java"/>
+                </fileset>
+            </batchtest>
+        </junit>
+        <echo message="JUnit test finished." />
+    </target>
+
+    <target name="junitreport">
+        <junitreport todir="${report}">
+            <fileset dir="${report}" includes="*.xml" />
+            <report format="frames" todir="${report}" />
+        </junitreport>
+        <echo message="JUnit test report finished." />
+    </target>
+
+    <!-- Target for Travis-CI with non-zero exit status on test failure. -->
+    <target name="travis" depends="clean, compile-all, junit">
+        <fail if="junitfailed" message="One or more unit tests failed."/>
+    </target>
+
+    <!-- testing beauti gui-->
+    <target name="junitb">
+        <mkdir dir="${report}" />
+        <junit printsummary="yes">
+            <!--showoutput='yes'-->
+            <classpath>
+                <path refid="classpath" />
+                <path location="${build}" />
+            </classpath>
+
+            <formatter type="xml" />
+
+            <batchtest fork="yes" todir="${report}">
+                <fileset dir="${src}">
+                    <include name="test/beast/app/beauti/**/*Test.java"/>
+                </fileset>
+            </batchtest>
+        </junit>
+        <echo message="JUnit test finished." />
+    </target>
+
+
+    <!-- Release -->
+    <property name="version" value="2.3.1" />
+    <property name="version_number" value="2.3.1" />
+    <property name="release_dir" value="release" />
+    <property name="copyright" value="Beast 2 development team 2011-2015" />
+
+    <property name="BEAST_name" value="BEAST" />
+    <property name="beast_name" value="beast" />
+    <property name="BEAUti_name" value="BEAUti" />
+    <property name="TreeAnnotator_name" value="TreeAnnotator" />
+    <property name="LogCombiner_name" value="LogCombiner" />
+    <property name="LogAnalyser_name" value="LogAnalyser" />
+    <property name="AppStore_name" value="AppStore" />
+
+    <property name="common_dir" value="${release_dir}/common" />
+    <property name="Mac_dir" value="${release_dir}/Mac" />
+    <property name="Linux_dir" value="${release_dir}/Linux" />
+    <property name="Windows_dir" value="${release_dir}/Windows" />
+    <property name="beast1_dir" value="${common_dir}/beast1" />
+    <property name="tools_dir" value="${common_dir}/tools" />
+
+    <property name="Mac_package_dir" value="${Mac_dir}/${BEAST_name}" />
+    <property name="Mac_bundle_dir" value="${Mac_package_dir}/${BEAST_name}" />
+    <property name="Linux_package_dir" value="${Linux_dir}/${beast_name}" />
+    <property name="Windows_package_dir" value="${Windows_dir}/${BEAST_name}" />
+
+    <!-- Need to either install Launch4j under {BEAST workspace}/${release}
+                 or install it in the default directory and change the location of launch4j.dir -->
+    <!--depends="build_jar_all_BEAST_NoJUnitTest"-->
+    <target name="windows"
+            description="release Windows version of BEAST, BEAUTI, TreeAnnotator, LogCombiner">
+
+        <delete dir="${Windows_package_dir}" />
+        <!-- Create the release directory -->
+        <mkdir dir="${Windows_package_dir}" />
+
+        <property name="launch4j.dir" location="../launch4j" />
+        <taskdef name="launch4j"
+                 classname="net.sf.launch4j.ant.Launch4jTask"
+                 classpath="${launch4j.dir}/launch4j.jar :${launch4j.dir}/lib/xstream.jar" />
+
+        <copy todir="${Windows_package_dir}/examples/">
+            <fileset dir="examples/">
+                <include name="*.xml" />
+                <include name="nexus/**" />
+                <exclude name="benchmark/**" />
+            </fileset>
+        </copy>
+        <!--<copy todir="${Windows_package_dir}/native">
+            <fileset dir="${common_dir}/native"/>
+        </copy>
+        <copy todir="${Windows_package_dir}/doc">
+            <fileset dir="${common_dir}/doc" />
+        </copy>
+        <copy todir="${Windows_package_dir}/bin">
+            <fileset dir="${Windows_dir}/scripts"/>
+        </copy>
+        <copy file="${dist}/beauti.jar" todir="${Windows_package_dir}/lib"/>-->
+        <copy file="${dist}/beast.jar" todir="${Windows_package_dir}/lib" />
+        <copy file="${dist}/beast.src.jar" todir="${Windows_package_dir}/lib" />
+        <!-- <copy file="${dist}/beast-beagle.jar" todir="${Windows_package_dir}/lib"/>
+        <copy todir="${Windows_package_dir}/lib">
+            <fileset dir="${Windows_dir}/lib"/>
+        </copy>-->
+        <copy file="${common_dir}/VERSION HISTORY.txt" todir="${Windows_package_dir}" />
+        <copy file="${common_dir}/README.txt" todir="${Windows_package_dir}" />
+        <copy file="${common_dir}/LICENSE.txt" todir="${Windows_package_dir}" />
+
+        <!-- BEAUTi v?.?.?.exe -->
+        <launch4j configFile="${Windows_dir}/BEAUti_launch4j.xml"
+                  jar="${dist}/launcher.jar"
+                  outfile="${Windows_package_dir}/${BEAUti_name}.exe"
+                  fileVersion="${version_number}.0"
+                  txtFileVersion="${version}"
+                  productVersion="${version_number}.0"
+                  txtProductVersion="${version}" />
+
+        <!-- BEAST v?.?.?.exe -->
+        <launch4j configFile="${Windows_dir}/BEAST_launch4j.xml"
+                  jar="${dist}/launcher.jar"
+                  outfile="${Windows_package_dir}/${BEAST_name}.exe"
+                  fileVersion="${version_number}.0"
+                  txtFileVersion="${version}"
+                  productVersion="${version_number}.0"
+                  txtProductVersion="${version}" />
+
+        <!--<launch4j configFile="${Windows_dir}/TreeStat_launch4j.xml"
+                              jar="${dist}/beast.jar"
+                              outfile="${Windows_package_dir}/${TreeStat_name}.exe"
+                              fileVersion="${version_number}.0"
+                              txtFileVersion="${version}"
+                              productVersion="${version_number}.0"
+                              txtProductVersion="${version}"/>-->
+
+        <!-- LogAnalyser v?.?.?.exe
+            <launch4j configFile="${Windows_dir}/LogAnalyser_launch4j.xml"
+                              jar="${dist}/beast.jar"
+                              outfile="${Windows_package_dir}/${LogAnalyser_name}v${version}.exe"
+                              fileVersion="${version}.0"
+                              txtFileVersion="${version}"
+                              productVersion="${version}.0"
+                              txtProductVersion="${version}"/>      -->
+
+        <launch4j configFile="${Windows_dir}/LogCombiner_launch4j.xml"
+                  jar="${dist}/launcher.jar"
+                  outfile="${Windows_package_dir}/${LogCombiner_name}.exe"
+                  fileVersion="${version_number}.0"
+                  txtFileVersion="${version}"
+                  productVersion="${version_number}.0"
+                  txtProductVersion="${version}"/>
+
+
+        <launch4j configFile="${Windows_dir}/TreeAnnotator_launch4j.xml"
+                  jar="${dist}/launcher.jar"
+                  outfile="${Windows_package_dir}/TreeAnnotator.exe"
+                  fileVersion="${version_number}.0"
+                  txtFileVersion="${version}"
+                  productVersion="${version_number}.0"
+                  txtProductVersion="${version}"/>
+
+        <launch4j configFile="${tools_dir}/DensiTree_launch4j.xml"
+                  jar="${tools_dir}/DensiTree.jar"
+                  outfile="${Windows_package_dir}/DensiTree.exe"
+                  fileVersion="2.0.0.0"
+                  txtFileVersion="2.0.0.0"
+                  productVersion="2.0.0.0"
+                  txtProductVersion="2.0.0.0" />
+
+        <launch4j configFile="${Windows_dir}/AppStore_launch4j.xml"
+                  jar="${dist}/launcher.jar"
+                  outfile="${Windows_package_dir}/AppStore.exe"
+                  fileVersion="${version_number}.0"
+                  txtFileVersion="${version}"
+                  productVersion="${version_number}.0"
+                  txtProductVersion="${version}"/>
+
+        <copy todir="${Windows_package_dir}/templates/">
+            <fileset dir="templates/" />
+        </copy>
+        <!--
+                <copy file="${beast1_dir}/LogCombiner.exe" todir="${Windows_package_dir}" />
+                <copy file="${beast1_dir}/TreeAnnotator.exe" todir="${Windows_package_dir}" />
+        -->
+        <zip destfile="${Windows_dir}/${BEAST_name}.v${version}.zip">
+            <zipfileset dir="${Windows_package_dir}" prefix="${BEAST_name}" />
+        </zip>
+
+        <echo message="Windows version release is finished." />
+    </target>
+
+    <target name="linux"
+            depends="build_jar_all_BEAST_NoJUnitTest"
+            description="release Linux/Unix version of BEAST, BEAUTI, TreeAnnotator, LogCombiner">
+        <delete dir="${Linux_package_dir}" />
+        <!-- Create the release directory -->
+        <mkdir dir="${Linux_package_dir}" />
+
+        <copy todir="${Linux_package_dir}/bin">
+            <fileset dir="${Linux_dir}/bin" />
+        </copy>
+        <chmod dir="${Linux_package_dir}/bin" perm="755" includes="**/**" />
+
+        <!--<copy todir="${Linux_package_dir}/doc">
+            <fileset dir="${common_dir}/doc" />
+        </copy>-->
+        <copy todir="${Linux_package_dir}/examples/">
+            <fileset dir="examples/">
+                <include name="*.xml" />
+                <include name="nexus/**" />
+                <exclude name="benchmark/**" />
+            </fileset>
+        </copy>
+
+        <copy file="${common_dir}/icons/beast.png" todir="${Linux_package_dir}/images" />
+        <copy file="${common_dir}/icons/beauti.png" todir="${Linux_package_dir}/images" />
+        <!-- <copy file="${common_dir}/icons/utility.png" todir="${Linux_package_dir}/images" />
+        <copy file="${dist}/beauti.jar" todir="${Linux_package_dir}/lib" /> -->
+        <copy file="${dist}/launcher.jar" todir="${Linux_package_dir}/lib" />
+        <copy file="${dist}/beast.jar" todir="${Linux_package_dir}/lib" />
+        <copy file="${dist}/beast.src.jar" todir="${Linux_package_dir}/lib" />
+        <!-- <copy file="${dist}/beast-beagle.jar" todir="${Linux_package_dir}/lib"/>
+        <copy todir="${Linux_package_dir}/lib">
+            <fileset dir="${Linux_dir}/lib" />
+        </copy>-->
+
+        <!--
+        <copy file="${beast1_dir}/beast161.jar" todir="${Linux_package_dir}/lib" />
+        <copy file="${tools_dir}/treeannotator.jar" todir="${Linux_package_dir}/lib" />
+        -->
+
+        <copy file="${tools_dir}/DensiTree.jar" todir="${Linux_package_dir}/lib" />
+        <copy file="${tools_dir}/DensiTree.png" todir="${Linux_package_dir}/images" />
+
+        <copy todir="${Linux_package_dir}/templates/">
+            <fileset dir="templates/" />
+        </copy>
+        <copy file="${common_dir}/VERSION HISTORY.txt" todir="${Linux_package_dir}" />
+        <copy file="${common_dir}/README.txt" todir="${Linux_package_dir}" />
+        <copy file="${common_dir}/LICENSE.txt" todir="${Linux_package_dir}" />
+
+        <!-- Only works under Unix or NonStop Kernel (Tandem) -->
+        <!-- <chmod dir="${Linux_package_dir}/bin" perm="755" includes="**/**"/>
+
+            <tar destfile="${Linux_dir}/${BEAST_name}v${version}.tgz" compression="gzip">
+                    <tarfileset dir="${Linux_package_dir}" prefix="${BEAST_name}v${version}"/>
+            </tar>-->
+        <!-- [ANT Bug 550] the tar task change the mode of the executables files, have to tar manaully -->
+        <echo message="Have to tar manaully, because [ANT Bug 550] the tar task change the mode of the executables files." />
+        <!-- tar -cvzf BEASTv1.x.x.tgz BEASTv1.x.x/ -->
+        <!-- cksum BEASTv1.x.x.tgz -->
+        <!-- tar -xvzf BEASTv1.x.x.tgz -->
+        <echo message="Linux/Unix version release is finished." />
+    </target>
+
+    <!-- Define the appbundler task -->
+    <taskdef name="bundleapp" classname="com.oracle.appbundler.AppBundlerTask" classpath="../beast2/lib/bundler/appbundler-1.0.jar"/>
+
+    <!--property name="AppleSigner" value="Developer ID Application: Alexei Drummond (6M6Y6L7RUP)" /-->
+    <property name="AppleSigner" value="Developer ID Application: Remco Bouckaert (LHFJWE5U63)" />    
+    
+    <!-- Create the app bundle -->
+    <target name="mac">
+        <delete dir="${Mac_package_dir}" />
+        <!--<delete file="${Mac_dir}/pack.temp.dmg"/>-->
+        <delete file="${Mac_dir}/BEAST v${version}.dmg"/>
+        <!-- Create the release directory -->
+        <mkdir dir="${Mac_package_dir}" />
+
+        <copy todir="${Mac_package_dir}/bin">
+            <fileset dir="${Linux_dir}/bin" />
+        </copy>
+        <chmod dir="${Mac_package_dir}/bin" perm="755" includes="**/**" />
+
+        <copy todir="${Mac_package_dir}/examples/">
+            <fileset dir="examples/">
+                <include name="*.xml" />
+                <include name="nexus/**" />
+                <exclude name="benchmark/**" />
+            </fileset>
+        </copy>
+        <!-- <copy todir="${Mac_package_dir}/native">
+            <fileset dir="${common_dir}/native" />
+        </copy>
+<copy todir="${Mac_package_dir}/doc">
+            <fileset dir="${common_dir}/doc" />
+        </copy>
+
+        <copy file="${dist}/beauti.jar" todir="${Mac_package_dir}/lib" /> -->
+        <copy file="${dist}/launcher.jar" todir="${Mac_package_dir}/lib" />
+        <copy file="${dist}/beast.jar" todir="${Mac_package_dir}/lib" />
+        <copy file="${dist}/beast.src.jar" todir="${Mac_package_dir}/lib" />
+        <!-- <copy file="${dist}/beast-beagle.jar" todir="${Mac_package_dir}/lib"/>
+        <copy todir="${Mac_package_dir}/lib">
+            <fileset dir="${Mac_dir}/lib" />
+        </copy> -->
+
+        <copy file="${common_dir}/VERSION HISTORY.txt" todir="${Mac_package_dir}" />
+        <copy file="${common_dir}/README.txt" todir="${Mac_package_dir}" />
+        <copy file="${common_dir}/LICENSE.txt" todir="${Mac_package_dir}" />
+
+        <echo message="Creating BEAST.app ..." />
+
+        <bundleapp outputdirectory="${Mac_package_dir}"
+                   name="${BEAST_name}"
+                   displayname="${BEAST_name}"
+                   identifier="beast.app.beastapp.BeastMain"
+                   icon="${common_dir}/icons/beast.icns"
+                   shortversion="${version}"
+                   copyright="${BEAST_name}, ${copyright}"
+                   mainclassname="beast.app.beastapp.BeastLauncher">
+            <!--librarypath file="${dist}/beast.jar"/-->
+            <classpath file="${Mac_package_dir}/lib/launcher.jar"/>
+            <option value="-Xmx4g"/>
+            <option value="-Dapple.laf.useScreenMenuBar=true"/>
+            <option value="-Djava.library.path=$JAVAROOT:/usr/local/lib"/>
+            <argument value="-window"/>
+            <argument value="-working"/>
+            <argument value="-options"/>
+        </bundleapp>
+
+        <exec executable="codesign">
+            <arg value="--deep"/>
+            <arg value="-s"/>
+            <arg value="${AppleSigner}"/>
+            <arg value="-v"/>
+            <arg value="${Mac_package_dir}/${BEAST_name}.app"/>
+        </exec>
+
+        <echo message="Creating BEAUti.app ..." />
+
+        <bundleapp outputdirectory="${Mac_package_dir}"
+                   name="${BEAUti_name}"
+                   displayname="${BEAUti_name}"
+                   identifier="beast.app.beauti.Beauti"
+                   icon="${common_dir}/icons/beauti.icns"
+                   shortversion="${version}"
+                   copyright="${BEAUti_name}, ${copyright}"
+                   mainclassname="beast.app.beauti.BeautiLauncher">
+            <!--librarypath file="${dist}/beast.jar"/-->
+            <classpath file="${Mac_package_dir}/lib/launcher.jar"/>
+            <option value="-Xmx4g"/>
+            <option value="-Xdock:name="BEAUti""/>
+            <option value="-Dapple.laf.useScreenMenuBar=true"/>
+            <option value="-Djava.library.path=$JAVAROOT:/usr/local/lib"/>
+            <argument value="-capture"/>
+        </bundleapp>
+
+        <exec executable="codesign">
+            <arg value="--deep"/>
+            <arg value="-s"/>
+            <arg value="${AppleSigner}"/>
+            <arg value="-v"/>
+            <arg value="${Mac_package_dir}/${BEAUti_name}.app"/>
+        </exec>
+
+        <echo message="Creating LogCombiner.app ..." />
+
+        <bundleapp outputdirectory="${Mac_package_dir}"
+                   name="${LogCombiner_name}"
+                   displayname="${LogCombiner_name}"
+                   identifier="beast.app.tools.LogCombiner"
+                   icon="${common_dir}/icons/utility.icns"
+                   shortversion="${version}"
+                   copyright="${LogCombiner_name}, ${copyright}"
+                   mainclassname="beast.app.tools.LogCombinerLauncher">
+            <!--librarypath file="${dist}/beast.jar"/-->
+            <classpath file="${Mac_package_dir}/lib/launcher.jar"/>
+            <option value="-Xmx4g"/>
+            <option value="-Dapple.laf.useScreenMenuBar=true"/>
+            <option value="-Djava.library.path=$JAVAROOT:/usr/local/lib"/>
+        </bundleapp>
+
+        <exec executable="codesign">
+            <arg value="--deep"/>
+            <arg value="-s"/>
+            <arg value="${AppleSigner}"/>
+            <arg value="-v"/>
+            <arg value="${Mac_package_dir}/${LogCombiner_name}.app"/>
+        </exec>
+
+        <echo message="Creating TreeAnnotator.app ..." />
+
+        <bundleapp outputdirectory="${Mac_package_dir}"
+                   name="${TreeAnnotator_name}"
+                   displayname="${TreeAnnotator_name}"
+                   identifier="beast.app.treeannotator.TreeAnnotator"
+                   icon="${common_dir}/icons/utility.icns"
+                   shortversion="${version}"
+                   copyright="${TreeAnnotator_name}, ${copyright}"
+                   mainclassname="beast.app.treeannotator.TreeAnnotatorLauncher">
+            <!--librarypath file="${dist}/beast.jar"/-->
+            <classpath file="${Mac_package_dir}/lib/launcher.jar"/>
+            <option value="-Xmx4g"/>
+            <option value="-Dapple.laf.useScreenMenuBar=true"/>
+            <option value="-Djava.library.path=$JAVAROOT:/usr/local/lib"/>
+        </bundleapp>
+
+        <exec executable="codesign">
+            <arg value="--deep"/>
+            <arg value="-s"/>
+            <arg value="${AppleSigner}"/>
+            <arg value="-v"/>
+            <arg value="${Mac_package_dir}/${TreeAnnotator_name}.app"/>
+        </exec>
+
+        <echo message="Creating DensiTree.app ..." />
+
+        <bundleapp outputdirectory="${Mac_package_dir}"
+                   name="DensiTree"
+                   displayname="DensiTree"
+                   identifier="viz.DensiTree"
+                   icon="${tools_dir}/DensiTree.icns"
+                   shortversion="2.0"
+                   copyright="DensiTree, http://compevol.auckland.ac.nz/software/DensiTree/"
+                   mainclassname="viz.DensiTree">
+            <classpath file="${tools_dir}/DensiTree.jar"/>
+            <option value="-Xmx4g"/>
+            <option value="-Dapple.laf.useScreenMenuBar=true"/>
+            <option value="-Djava.library.path=$JAVAROOT:/usr/local/lib"/>
+        </bundleapp>
+
+        <exec executable="codesign">
+            <arg value="-s"/>
+            <arg value="${AppleSigner}"/>
+            <arg value="-v"/>
+            <arg value="${Mac_package_dir}/DensiTree.app"/>
+        </exec>
+
+        <echo message="Creating AppStore.app ..." />
+
+        <bundleapp outputdirectory="${Mac_package_dir}"
+                   name="${AppStore_name}"
+                   displayname="${AppStore_name}"
+                   identifier="beast.app.tools.AppStore"
+                   icon="${common_dir}/icons/utility.icns"
+                   shortversion="${version}"
+                   copyright="${AppStore_name}, ${copyright}"
+                   mainclassname="beast.app.tools.AppStoreLauncher">
+            <!--librarypath file="${dist}/beast.jar"/-->
+            <classpath file="${Mac_package_dir}/lib/launcher.jar"/>
+            <option value="-Xmx1024M"/>
+            <option value="-Dapple.laf.useScreenMenuBar=true"/>
+            <option value="-Djava.library.path=$JAVAROOT:/usr/local/lib"/>
+        </bundleapp>
+
+        <exec executable="codesign">
+            <arg value="--deep"/>
+            <arg value="-s"/>
+            <arg value="${AppleSigner}"/>
+            <arg value="-v"/>
+            <arg value="${Mac_package_dir}/${AppStore_name}.app"/>
+        </exec>
+
+        <copy todir="${Mac_package_dir}/templates/">
+            <fileset dir="templates/" />
+        </copy>
+
+        <echo message="Building disk image." />
+        <exec executable='release/Mac/createdmg.sh'/>
+
+        <exec executable="codesign">
+            <arg value="-s"/>
+            <arg value="${AppleSigner}"/>
+            <arg value="-v"/>
+            <arg value="${Mac_dir}/${BEAST_name} v${version}.dmg"/>
+        </exec>
+
+        <delete file="${Mac_dir}/pack.temp.dmg"/>
+
+        <echo message="Mac version release is finished." />
+    </target>
+
+    <target name="doc" description="Create Developer Docs for Beast 2" depends='javadoc'>
+        <copy file="doc/tutorial.slides.part1.pdf" tofile="release/common/doc/develop/" />
+        <copy file="doc/tutorial.slides.part2.pdf" tofile="release/common/doc/develop/" />
+        <!-- part 3 needs updating -->
+        <!--copy file="doc/tutorial.slides.part3.pdf" tofile="release/common/doc/develop/" /-->
+    </target>
+
+    <target name="javadoc" description="Create Javadocs for Beast 2" depends='docPreProcess'>
+        <mkdir dir="${common_dir}/javadoc/" />
+        <javadoc destdir="${common_dir}/javadoc/">
+            <fileset dir="src2/" includes="beast/**/*.java" />
+            <!--<fileset dir="src2/" includes="beast/core/**/*.java" />-->
+            <!--<fileset dir="src2/" includes="beast/util/**/*.java" />-->
+            <!--<fileset dir="src2/" includes="beast/math/**/*.java" />-->
+            <!--<fileset dir="src2/" includes="beast/evolution/**/*.java" />-->
+        </javadoc>
+
+        <!-- clean up -->
+        <delete dir="src2/"/>
+    </target>
+
+    <!-- run perl script that extracts @Description and Input.description info for javadoc -->
+    <target name="docPreProcess">
+        <exec executable="perl" dir="${basedir}">
+            <arg value="scripts/doc.pl" />
+        </exec>
+    </target>
+
+    <property name="sdk_dir" value="${release_dir}/${BEAST_name}_SDK" />
+
+    <!-- zip up everything that goes in the SDK -->
+    <target name="sdk" description="Create Beast 2 SDK" depends="dist_all_BEAST,javadoc">
+
+        <delete file="${release_dir}/${BEAST_name}_v${version}_SDK.zip" />
+
+        <copy file="doc/slides/sdk.pdf" tofile="${common_dir}/Beast_2_Getting_Started.pdf" />
+
+        <zip destfile="${release_dir}/${BEAST_name}_v${version}_SDK.zip">
+            <fileset dir="${common_dir}">
+                <include name="**/*.txt" />
+                <include name="**/*.pdf" />
+                <include name="javadoc/**/*.*" />
+            </fileset>
+            <fileset dir="${dist}">
+                <include name="beast.jar" />
+                <include name="beast.src.jar" />
+            </fileset>
+        </zip>
+
+        <!-- clean up -->
+        <delete file="${common_dir}/Beast_2_Getting_Started.pdf" />
+
+        <echo message="SDK release is finished." />
+    </target>
+
+</project>
+
diff --git a/debian/README.source b/debian/README.source
deleted file mode 100644
index bf6351d..0000000
--- a/debian/README.source
+++ /dev/null
@@ -1,2 +0,0 @@
-There is a new upstream release with major changes which most probably
-need a lot of packaging changes which has not yet started
diff --git a/debian/README.test b/debian/README.test
deleted file mode 100644
index 55102e6..0000000
--- a/debian/README.test
+++ /dev/null
@@ -1,9 +0,0 @@
-Notes on how this package can be tested.
-────────────────────────────────────────
-
-To run the tests provided by the package you can install the package
-beast-mcmc-examples and run
-
-   sh  run-unit-test
-
-in this directory.
diff --git a/debian/beast-mcmc-doc.install b/debian/beast-mcmc-doc.install
deleted file mode 100644
index b7c85bf..0000000
--- a/debian/beast-mcmc-doc.install
+++ /dev/null
@@ -1,2 +0,0 @@
-doc/*.pdf				usr/share/doc/beast-mcmc
-doc/*/*.pdf				usr/share/doc/beast-mcmc
diff --git a/debian/beast-mcmc-examples.install b/debian/beast-mcmc-examples.install
deleted file mode 100644
index c9c69df..0000000
--- a/debian/beast-mcmc-examples.install
+++ /dev/null
@@ -1 +0,0 @@
-examples/release/*	usr/share/doc/beast-mcmc/examples
diff --git a/debian/beast-mcmc.1 b/debian/beast-mcmc.1
deleted file mode 100755
index af7bdc1..0000000
--- a/debian/beast-mcmc.1
+++ /dev/null
@@ -1,163 +0,0 @@
-.\"     Title: BEAST-MCMC
-.\"    Author: Alexei J. Drummond
-.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 05/28/2010
-.\"    Manual: BEAST-MCMC Manual
-.\"    Source: BEAST 1.5.3
-.\"
-.TH "BEAST\-MCMC" "1" "05/28/2010" "BEAST 1.5.3" "BEAST-MCMC Manual"
-.\" disable hyphenation
-.nh
-.\" disable justification (adjust text to left margin only)
-.ad l
-.SH "NAME"
-beast-mcmc \- Bayesian evolutionary analysis sampling trees
-.SH "SYNOPSIS"
-.HP 11
-\fBbeast\-mcmc\fR [\fBOPTIONS\fR] [\fIinput\&.xml\fR]
-.HP 11
-\fBbeast\-mcmc\fR [\fB\-verbose\fR | \fB\-strict\fR | \fB\-window\fR | \fB\-options\fR | \fB\-working\fR | \fB\-seed\fR | \fB\-errors\ i\fR | \fB\-threads\ i\fR | \fB\-java\fR | \fB\-beagle\fR | \fB\-beagle_info\fR | \fB\-beagle_resource_order\fR | \fB\-help\fR | \fBinput\&.xml\fR]
-.SH "DESCRIPTION"
-.PP
-BEAST is a cross\-platform program for Bayesian MCMC analysis of molecular sequences\&. It is orientated towards rooted, time\-measured phylogenies inferred using strict or relaxed molecular clock models\&. It is intended both as a method of reconstructing phylogenies and as a framework for testing evolutionary hypotheses without conditioning on a single tree topology\&. BEAST uses MCMC to average over tree space, so that each tree is weighted proportional to its posterior probability\&. [...]
-.SH "OPTIONS"
-.PP
-\fB\-verbose\fR
-.RS 4
-verbose XML parsing messages
-.RE
-.PP
-\fB\-strict\fR
-.RS 4
-fail on non conforming BEAST XML file
-.RE
-.PP
-\fB\-window\fR
-.RS 4
-provide a console window
-.RE
-.PP
-\fB\-options\fR
-.RS 4
-display an options dialog
-.RE
-.PP
-\fB\-working\fR
-.RS 4
-change working directory to input file\'s directory
-.RE
-.PP
-\fB\-seed\fR
-.RS 4
-specify a random number generator seed
-.RE
-.PP
-\fB\-errors \fR\fB\fIi\fR\fR
-.RS 4
-maximum number of numerical errors before stopping
-.RE
-.PP
-\fB\-threads \fR\fB\fIi\fR\fR
-.RS 4
-the number of computational threads to use (default 1)
-.RE
-.PP
-\fB\-java\fR
-.RS 4
-use Java only, no native implementations
-.RE
-.PP
-\fB\-beagle\fR
-.RS 4
-use beagle library if available
-.RE
-.PP
-\fB\-beagle_info\fR
-.RS 4
-show information on available beagle resources
-.RE
-.PP
-\fB\-beagle_resource_order\fR
-.RS 4
-set order of beagle resources
-.RE
-.PP
-\fB\-help\fR
-.RS 4
-print usage screen
-.RE
-.SH "BUGS"
-.PP
-The BEAST bug tracking system can be found at
-\fI\%http://code.google.com/p/beast-mcmc/issues/list\fR\&.
-.SH "SEE ALSO"
-.PP
-\fBbeauti\fR(1)\&.
-.SH "REFERENCES"
-.sp
-.RS 4
-\h'-04'\(bu\h'+03'Drummond AJ, Rambaut A (2007) "BEAST: Bayesian evolutionary analysis by sampling trees\&." BMC Evolutionary Biology 7:214\&.
-.RE
-.sp
-.RS 4
-\h'-04'\(bu\h'+03'Drummond AJ, Ho SYW, Phillips MJ & Rambaut A (2006) PLoS Biology 4, e88\&.
-.RE
-.sp
-.RS 4
-\h'-04'\(bu\h'+03'Drummond AJ, Rambaut A & Shapiro B and Pybus OG (2005) Mol Biol Evol 22, 1185\-1192\&.
-.RE
-.sp
-.RS 4
-\h'-04'\(bu\h'+03'Drummond AJ, Nicholls GK, Rodrigo AG & Solomon W (2002) Genetics 161, 1307\-1320\&.
-.RE
-.SH "AUTHORS"
-.PP
-\fBAlexei J\&. Drummond\fR
-.sp -1n
-.IP "" 4
-Copyright holder for BEAST\&.
-.PP
-\fBAndrew Rambaut\fR
-.sp -1n
-.IP "" 4
-Copyright holder for BEAST\&.
-.PP
-\fBMarc A\&. Suchard\fR
-.sp -1n
-.IP "" 4
-Copyright holder for BEAST\&.
-.PP
-\fBFelix Feyertag\fR <\&felix\&.feyertag at googlemail\&.com\&>
-.sp -1n
-.IP "" 4
-Prepared this manpage in DocBook XML for the Debian distribution\&.
-.SH "COPYRIGHT"
-Copyright \(co 2002\(en2010 Alexei J. Drummond, Andrew Rambaut & Marc A. Suchard (BEAST)
-.br
-Copyright \(co 2009\(en2010 Felix Feyertag (This manpage)
-.br
-.PP
-The binaries and source code are made available and can be distributed subject to the following conditions:
-.PP
-BEAST is Copyright (C) 2002\-2006 Alexei Drummond and Andrew Rambaut BEAST is distributed under the terms of the GNU Lesser General Public License\&. See the notice in individual files and the file LICENSE for licensing details\&.
-.PP
-BEAST includes software libraries from projects whose licensing terms require that the following notices be included when they are distributed in binary form and that the recipient be given a copy of their respective licenses\&.
-.sp
-.RS 4
-\h'-04'\(bu\h'+03'This product includes software developed by the JDOM Project (http://www\&.jdom\&.org/)
-.RE
-.sp
-.RS 4
-\h'-04'\(bu\h'+03'This product includes software developed by The Apache Software Foundation (http://www\&.apache\&.org/)
-.RE
-.sp
-.RS 4
-\h'-04'\(bu\h'+03'The license for JDOM can be read in the LICENSE\&.txt file in the source distribution available at http://www\&.jdom\&.org/
-.RE
-.sp
-.RS 4
-\h'-04'\(bu\h'+03'The license for the Commons Math library can be read at http://www\&.apache\&.org/licenses/LICENSE\-2\&.0 or in the LICENSE\&.txt file in the source distribution available at http://jakarta\&.apache\&.org/commons/math/
-.RE
-.PP
-This manual page and its XML source can be used, modified, and redistributed as if it were in public domain\&.
-.sp
diff --git a/debian/beast-mcmc.1.xml b/debian/beast-mcmc.1.xml
deleted file mode 100644
index e36c132..0000000
--- a/debian/beast-mcmc.1.xml
+++ /dev/null
@@ -1,325 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<?xml-stylesheet type="text/xsl"
-	href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"?>
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-	"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
-
-<!-- Template from docbook-xsl-1.73.2.dfsg.1-3 -->
-
-<!-- Process this file with an XSLT processor, e.g. xsltproc:    -->
-<!-- `xsltproc \
-      -''-nonet \
-      -''-param man.charmap.use.subset "0" \
-      -''-param make.year.ranges "1" \
-      -''-param make.single.year.ranges "1" \
-      manpage.xml'                                               -->
-
-  <!ENTITY dhfirstname "Felix">
-  <!ENTITY dhsurname   "Feyertag">
-  <!ENTITY dhemail     "felix.feyertag at googlemail.com">
-  <!ENTITY dhusername  "&dhfirstname; &dhsurname;">
-  <!ENTITY dhrelease   "1.5.3">
-  <!ENTITY dhtitle     "BEAST-MCMC Manual">
-  <!ENTITY dhucpackage "BEAST-MCMC">
-  <!ENTITY dhpackage   "beast-mcmc">
-  <!ENTITY dhproduct   "BEAST">
-  <!ENTITY dhsection   "1">
-]>
-
-<refentry>
-	<refentryinfo>
-		<title>&dhtitle;</title>
-		<productname>&dhproduct;</productname>
-		<releaseinfo role="version">&dhrelease;</releaseinfo>
-		<authorgroup>
-			<author>
-				<firstname>Alexei J.</firstname>
-				<surname>Drummond</surname>
-				<contrib>Copyright holder for &dhproduct;.</contrib>
-			</author>
-			<author>
-				<firstname>Andrew</firstname>
-				<surname>Rambaut</surname>
-				<contrib>Copyright holder for &dhproduct;.</contrib>
-			</author>
-			<author>
-				<firstname>Marc A.</firstname>
-				<surname>Suchard</surname>
-				<contrib>Copyright holder for &dhproduct;.</contrib>
-			</author>
-		</authorgroup>
-    <authorgroup>
-			<author>
-				<firstname>&dhfirstname;</firstname>
-				<surname>&dhsurname;</surname>
-				<contrib>Prepared this manpage in DocBook XML for the Debian distribution.</contrib>
-				<address>
-					<email>&dhemail;</email>
-				</address>
-			</author>
-		</authorgroup>
-		<copyright>
-      <year>2002–2010</year>
-			<holder>Alexei J. Drummond, Andrew Rambaut & Marc A. Suchard (&dhproduct;)</holder>
-		</copyright>
-		<copyright>
-			<year>2009–2010</year>
-			<holder>&dhusername; (This manpage)</holder>
-		</copyright>
-		<legalnotice>
-			<para>
-        The binaries and source code are made available and can be distributed subject to the following conditions:
-      </para>
-          <para>
-BEAST is Copyright (C) 2002-2006 Alexei Drummond and Andrew Rambaut
-BEAST is distributed under the terms of the GNU Lesser General Public License.
-See the notice in individual files and the file LICENSE for licensing details.
-          </para>
-          <para>
-BEAST includes software libraries from projects whose licensing
-terms require that the following notices be included when they are
-distributed in binary form and that the recipient be given a copy of
-their respective licenses.
-          </para>
-      <itemizedlist>
-        <listitem>
-          <para>
-This product includes software developed by the
-JDOM Project (http://www.jdom.org/)
-          </para>
-        </listitem>
-        <listitem>
-          <para>
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/)
-          </para>
-        </listitem>
-        <listitem>
-          <para>
-The license for JDOM can be read in the LICENSE.txt file in the
-source distribution available at http://www.jdom.org/
-          </para>
-        </listitem>
-        <listitem>
-          <para>
-The license for the Commons Math library can be read at
-http://www.apache.org/licenses/LICENSE-2.0 or in the LICENSE.txt file
-in the source distribution available at
-http://jakarta.apache.org/commons/math/
-          </para>
-        </listitem>
-      </itemizedlist>
-    </legalnotice>
-    <legalnotice>
-      <para>
-        This manual page and its XML source can be used, modified, and redistributed as if it were in public domain.
-      </para>
-    </legalnotice>
-	</refentryinfo>
-  
-	<refmeta>
-		<refentrytitle>&dhucpackage;</refentrytitle>
-		<manvolnum>&dhsection;</manvolnum>
-	</refmeta>
-  
-	<refnamediv>
-		<refname>&dhpackage;</refname>
-		<refpurpose>Bayesian evolutionary analysis sampling trees</refpurpose>
-	</refnamediv>
-  
-	<refsynopsisdiv>
-		<cmdsynopsis>
-			<command>&dhpackage;</command>
-			<arg choice="opt"><option>OPTIONS</option></arg>
-            <arg choice="opt"><replaceable>input.xml</replaceable></arg>
-		</cmdsynopsis>
-		<cmdsynopsis>
-			<command>&dhpackage;</command>
-      <!-- Normally the help and version options make the programs stop
-			     right after outputting the requested information. -->
-			<group choice="opt">
-						<arg choice="plain"><option>-verbose</option></arg>
-    					<arg choice="plain"><option>-strict</option></arg>
-    					<arg choice="plain"><option>-window</option></arg>
-    					<arg choice="plain"><option>-options</option></arg>
-    					<arg choice="plain"><option>-working</option></arg>
-    					<arg choice="plain"><option>-seed</option></arg>
-    					<arg choice="plain"><option>-errors i</option></arg>
-    					<arg choice="plain"><option>-threads i</option></arg>
-    					<arg choice="plain"><option>-java</option></arg>
-    					<arg choice="plain"><option>-beagle</option></arg>
-    					<arg choice="plain"><option>-beagle_info</option></arg>
-    					<arg choice="plain"><option>-beagle_resource_order</option></arg>
-    					<arg choice="plain"><option>-help</option></arg>
-    					<arg choice="plain"><option>input.xml</option></arg>
-			</group>
-		</cmdsynopsis>
-	</refsynopsisdiv>
-  
-	<refsect1 id="description">
-		<title>DESCRIPTION</title>
-		<para>
-BEAST is a cross-platform program for Bayesian MCMC analysis of molecular sequences. It is orientated towards rooted,
-time-measured phylogenies inferred using strict or relaxed molecular clock models. It is intended both as a method of
-reconstructing phylogenies and as a framework for testing evolutionary hypotheses without conditioning on a single tree
-topology. BEAST uses MCMC to average over tree space, so that each tree is weighted proportional to its posterior
-probability. We include a simple to use user-interface program for setting up standard analyses and a suite of programs
-for analysing the results.  There are three main areas of research for which the BEAUti/BEAST package is particularly
-applicable.  These areas are species phylogenies for molecular dating, coalescent-based population genetics and
-measurably evolving populations (ancient DNA or time-stamped viral sequence data sets).    
-        </para>
-
-	</refsect1>
-  
-	<refsect1 id="options">
-		<title>OPTIONS</title>
-
-        <variablelist>
-            <varlistentry>
-                <term>
-                    <option>-verbose</option>
-                </term>
-                <listitem>
-                    <para>verbose XML parsing messages</para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>
-                    <option>-strict</option>
-                </term>
-                <listitem>
-                    <para>fail on non conforming BEAST XML file</para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>
-                    <option>-window</option>
-                </term>
-                <listitem>
-                    <para>provide a console window</para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>
-                    <option>-options</option>
-                </term>
-                <listitem>
-                    <para>display an options dialog</para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>
-                    <option>-working</option>
-                </term>
-                <listitem>
-                    <para>change working directory to input file's directory</para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>
-                    <option>-seed</option>
-                </term>
-                <listitem>
-                    <para>specify a random number generator seed</para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>
-                    <option>-errors <replaceable class="parameter">i</replaceable></option>
-                </term>
-                <listitem>
-                    <para>maximum number of numerical errors before stopping</para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>
-                    <option>-threads <replaceable class="parameter">i</replaceable></option>
-                </term>
-                <listitem>
-                    <para>the number of computational threads to use (default 1)</para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>
-                    <option>-java</option>
-                </term>
-                <listitem>
-                    <para>use Java only, no native implementations</para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>
-                    <option>-beagle</option>
-                </term>
-                <listitem>
-                    <para>use beagle library if available</para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>
-                    <option>-beagle_info</option>
-                </term>
-                <listitem>
-                    <para>show information on available beagle resources</para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>
-                    <option>-beagle_resource_order</option>
-                </term>
-                <listitem>
-                    <para>set order of beagle resources</para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>
-                    <option>-help</option>
-                </term>
-                <listitem>
-                    <para>print usage screen</para>
-                </listitem>
-            </varlistentry>
-        </variablelist>
-	</refsect1>
-
-	<refsect1 id="bugs">
-		<!-- Or use this section to tell about upstream BTS. -->
-		<title>BUGS</title>
-		<para>The &dhproduct; bug tracking system can be found at <ulink url="http://code.google.com/p/beast-mcmc/issues/list"/>.</para>
-	</refsect1>
-  
-	<refsect1 id="see_also">
-		<title>SEE ALSO</title>
-		<!-- In alpabetical order. -->
-		<para><citerefentry>
-				<refentrytitle>beauti</refentrytitle>
-				<manvolnum>1</manvolnum>
-			</citerefentry>.</para>
-  </refsect1>
-  
-  <refsect1 id="references">
-    <title>REFERENCES</title>
-    <itemizedlist>
-      <listitem>
-          <para>
-              Drummond AJ, Rambaut A (2007) "BEAST: Bayesian evolutionary analysis by sampling trees." BMC Evolutionary Biology 7:214.
-        </para>
-      </listitem>
-      <listitem>
-        <para>
-            Drummond AJ, Ho SYW, Phillips MJ & Rambaut A (2006) PLoS Biology 4, e88.
-        </para>
-      </listitem>
-      <listitem>
-        <para>
-            Drummond AJ, Rambaut A & Shapiro B and Pybus OG (2005) Mol Biol Evol 22, 1185-1192.
-        </para>
-      </listitem>
-      <listitem>
-        <para>
-            Drummond AJ, Nicholls GK, Rodrigo AG & Solomon W (2002) Genetics 161, 1307-1320.
-        </para>
-      </listitem>
-    </itemizedlist>
- 	</refsect1>
-</refentry>
diff --git a/debian/beast-mcmc.docs b/debian/beast-mcmc.docs
deleted file mode 100644
index 9a4f4f8..0000000
--- a/debian/beast-mcmc.docs
+++ /dev/null
@@ -1,2 +0,0 @@
-debian/README.test
-debian/tests/run-unit-test
diff --git a/debian/beast-mcmc.install b/debian/beast-mcmc.install
deleted file mode 100644
index a96efd0..0000000
--- a/debian/beast-mcmc.install
+++ /dev/null
@@ -1,3 +0,0 @@
-debian/bin 		usr
-debian/*.xpm		usr/share/pixmaps
-build/dist/*.jar	usr/share/beast-mcmc
diff --git a/debian/beast-mcmc.manifest b/debian/beast-mcmc.manifest
deleted file mode 100644
index 4ca998d..0000000
--- a/debian/beast-mcmc.manifest
+++ /dev/null
@@ -1,7 +0,0 @@
-/usr/share/beast-mcmc/beast.jar:
- Main-Class: dr.app.beast.BeastMain
- Class-Path: /usr/share/java/beagle.jar /usr/share/java/commons-math.jar /usr/share/java/jdom1.jar /usr/share/java/jebl.jar /usr/share/java/jam.jar /usr/share/java/treeview.jar
-
-/usr/share/beast-mcmc/beauti.jar:
- Main-Class: dr.app.beauti.BeautiApp
- Class-Path: /usr/share/java/beagle.jar /usr/share/java/colt.jar /usr/share/java/commons-math.jar /usr/share/java/itext1-1.4.jar /usr/share/java/jam.jar /usr/share/java/jdom1.jar /usr/share/java/jebl.jar /usr/share/java/junit4.jar /usr/share/java/mpj.jar /usr/share/java/mtj.jar /usr/share/java/treeview.jar
diff --git a/debian/beast-mcmc.manpages b/debian/beast-mcmc.manpages
deleted file mode 100644
index 0f65186..0000000
--- a/debian/beast-mcmc.manpages
+++ /dev/null
@@ -1 +0,0 @@
-debian/*.1
diff --git a/debian/beast-mcmc.menu b/debian/beast-mcmc.menu
deleted file mode 100644
index d068767..0000000
--- a/debian/beast-mcmc.menu
+++ /dev/null
@@ -1,15 +0,0 @@
-?package(beast-mcmc):\
-  needs="x11"\
-  section="Applications/Science/Biology"\
-  title="BEAST"\
-  command="/usr/bin/beast-mcmc"\
-  hints="Bayesian evolutionary analysis sampling trees"\
-  icon="/usr/share/pixmaps/beast-mcmc.xpm"
-
-?package(beast-mcmc):\
-  needs="x11"\
-  section="Applications/Science/Biology"\
-  title="BEAUti"\
-  command="/usr/bin/beauti"\
-  hints="Bayesian Evolutionary Analysis Utility"\
-  icon="/usr/share/pixmaps/beauti.xpm"
diff --git a/debian/beast-mcmc.xpm b/debian/beast-mcmc.xpm
deleted file mode 100644
index 13d572b..0000000
--- a/debian/beast-mcmc.xpm
+++ /dev/null
@@ -1,163 +0,0 @@
-/* XPM */
-static char *beast_[] = {
-/* columns rows colors chars-per-pixel */
-"32 32 125 2",
-"   c #339C9AEADA00",
-".  c #3AB7A0CCDE9E",
-"X  c #1DD39A39E533",
-"o  c #22BD9A93E25F",
-"O  c #2D609C83E2F4",
-"+  c #32139EECE3EB",
-"@  c #28FBA44EEC0B",
-"#  c #3610A21AE3B7",
-"$  c #3C85A34FE472",
-"%  c #30DDA3ADE883",
-"&  c #2AC5B17FF6E6",
-"*  c #2571BBC6F952",
-"=  c #2855BE49F9D6",
-"-  c #3C6DB692F442",
-";  c #5BFBA296CA0F",
-":  c #4A70A509DDA4",
-">  c #5DBCA8B0D21C",
-",  c #5427A9E9DF9B",
-"<  c #5DCFAB37D96E",
-"1  c #6DF6A677C450",
-"2  c #7281AB17C943",
-"3  c #71A0B1C5D76E",
-"4  c #72DBB4E1DBFE",
-"5  c #777FB83CE05C",
-"6  c #4308A699E58B",
-"7  c #4722A8A8E636",
-"8  c #4C3DAAFDE6DF",
-"9  c #4336AA51EA16",
-"0  c #4BB7AC07E8E9",
-"q  c #534BAE59E7E5",
-"w  c #59A5AEFFE3AE",
-"e  c #4CB2B34EEFF7",
-"r  c #5704B048E854",
-"t  c #5937B0A5E4CF",
-"y  c #54BFB254EB13",
-"u  c #5C92B356E9C2",
-"i  c #3FD1B1DAF2A7",
-"p  c #427ABB57F64B",
-"a  c #539BBABAF1EE",
-"s  c #5EB0BDB3F1C4",
-"d  c #579EBEFCF878",
-"f  c #65BAB458E497",
-"g  c #6D6FB5CEE221",
-"h  c #6E47BA48E4E4",
-"j  c #6449B6AFEA96",
-"k  c #683DB7FAEABE",
-"l  c #6BC5B9CCEAC5",
-"z  c #7493BA48E491",
-"x  c #79E1BAA7E188",
-"c  c #7459BE64EC8F",
-"v  c #7844BFB8ED14",
-"b  c #1F14C9D3FEE6",
-"n  c #1FF1C3CAFC94",
-"m  c #2DE2CA25FD9F",
-"M  c #34A8C5AAFDFA",
-"N  c #3E9FC6BCFD46",
-"B  c #344CCDA4FF5F",
-"V  c #395DC8F1FE40",
-"C  c #3DA2D242FF60",
-"Z  c #3FD6C2D7FBEB",
-"A  c #5F81C198F0D1",
-"S  c #5950C53FF894",
-"D  c #568CCE66FBC3",
-"F  c #5AFCCA9DF9BA",
-"G  c #515ED38EFD5F",
-"H  c #7D38C21EED74",
-"J  c #6553C5D5F4E0",
-"K  c #6236CBE9F4FE",
-"L  c #6C19CAFCF101",
-"P  c #62D4CE97F9A8",
-"I  c #754FCCEEF552",
-"U  c #7C87CAF9F4EF",
-"Y  c #7459CE8AF8E6",
-"T  c #6347D47FFAC6",
-"R  c #69F8DCC9FE83",
-"E  c #7991D138FA44",
-"W  c #74B0DA5CFB9F",
-"Q  c #86B4B2BEC99C",
-"!  c #8433B915D73A",
-"~  c #8C63BBADD590",
-"^  c #8349BC99DE9C",
-"/  c #830CBFF2E513",
-"(  c #9585C45CDE08",
-")  c #8E8EC4EFE521",
-"_  c #83EDC50CEE0C",
-"`  c #8B00C72DEC88",
-"'  c #8CBFCA15EEC4",
-"]  c #937FC732E67F",
-"[  c #9CACCA1CE588",
-"{  c #9197CB15EF27",
-"}  c #99AFCB82E9DB",
-"|  c #9FB2D149EFE2",
-" . c #8606CC91F2F8",
-".. c #8C5ECC12F249",
-"X. c #93CBCCEDF0E4",
-"o. c #99A8CF90F18B",
-"O. c #9618D4A4F76F",
-"+. c #9DCFD21BF2D9",
-"@. c #9F17DA56F670",
-"#. c #A173D0A2ED5B",
-"$. c #A9E0D416ED4B",
-"%. c #A590D562F36C",
-"&. c #AAAAD7D2F419",
-"*. c #ADD5D93BF497",
-"=. c #A33BDF2CFB45",
-"-. c #B2C7DC05F55B",
-";. c #B945DE60F5A8",
-":. c #8E61EC0EFF29",
-">. c #940CEBF4FF2E",
-",. c #9846E8ADFE07",
-"<. c #8E51F3F2FFAE",
-"1. c #BDCEE206F86A",
-"2. c #B392E21CF8F9",
-"3. c #BEF4E281F8CF",
-"4. c #B354EB9CFD08",
-"5. c #ACB1F0D6FF0F",
-"6. c #C0B7E249F730",
-"7. c #C94BE78DF947",
-"8. c #C4F5EA6DFDCE",
-"9. c #D43DEBCDFAAE",
-"0. c #DB31EE9EFAA9",
-"q. c #EB84F6DBFDEA",
-"w. c #F50EFAE8FE66",
-"e. c #FFFFFFFFFFDE",
-"r. c None",
-/* pixels */
-"r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.",
-"r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.",
-"r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.",
-"r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.",
-"r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.$.} r.| %.$.r.r.r.r.r.r.r.",
-"r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.[ ;.&.) ) %.7.r.r.r.r.r.r.r.",
-"r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.] *.%.| ` o.*.) Q r.r.r.r.r.",
-"r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.] ' X.{ o.%.{ ^ ~ ( r.r.r.",
-"! r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.` _ ' ..o.-.*.+.O...] r.r.r.",
-"r.4 r.r.r.r.r.r.r.r.r.r.r.r.r.r.] ' _ _ H _ %.%.' %. at .@.r.r.r.r.",
-"r.r.z r.r.r.r.r.r.r.r.r.r.r.r.` ..X.` H _ ` _ *.&.+.+.O.r.r.r.r.",
-"r.r.r.c H _ x r.r.r.r.r.r.r._ X.` _ v v ..*.o.H H _ _ H 3 r.r.r.",
-"r.r.r.r.r.c H x r.r.r.r.r._ H ' ` H c H o.X.*.2.=.-.+.U h 2 1 r.",
-"r.r.r.r.r.r.z ` r.r.r.r.r.x _ _ H _ k l o.{  .:.,.5.4.,.L > ; r.",
-"r.r.r.r.r.r.r.' I r.r.r.^ _ _ _ H k j j c +.=.W r.r.:.<.r.r.r.r.",
-"r.r.r.r.r.r.r. .W r.r.r.g H ..c j u u j o.%.%.t r.r.r.r.r.r.r.r.",
-"r.r.r.r.r.r.r.I R r.r.4 l H H u q q k j ..H s P s t r.r.r.r.r.r.",
-"r.r.r.r.r.r.5 Y r.r.r.4 _ H k u 0 0 X.;.k X.J T F a a r.r.r.r.r.",
-"r.r.r.r.r.r.h P r.r.r.g v k u 6 0 7 ` q.Y T Y ] r.r.D r.r.r.r.r.",
-"r.r.r.r.r.r.l F r.r.r.g v v q 6 6 u 0.8.D D S E I r.r.r.r.r.r.r.",
-"r.r.r.r.r.r.k d r.r.r., H c 8 6 + %.e.=.p r.r.r.G r.r.r.r.r.r.r.",
-"r.r.r.r.r.r.f u r.r.r.f X.l q 6 6 v w.O.# r.r.r.r.r.r.r.r.r.r.r.",
-"r.r.r.r.r.r.r.f   r.r.< k H 8 6 8 7 X.3.. r.r.r.r.r.r.r.r.r.r.r.",
-"r.r.r.r.r.r.r.y k : , : 8 c u 7 $ 6 q 9.e r.r.r.r.r.r.r.r.r.r.r.",
-"r.r.r.r.r.r.r.r.- S J - @ 0 8 6 # + u 6.- r.r.r.r.r.r.r.r.r.r.r.",
-"r.r.r.r.r.r.r.r.r.B C B & @ + + O O + % o   r.r.r.r.r.r.r.r.r.r.",
-"r.r.r.r.r.r.r.r.r.r.r.r.r.% o + y U  .y 9 k O X @ r.r.r.r.r.r.r.",
-"r.r.r.r.r.r.r.r.r.r.r.r.r.r.@ * m B C V N - = n b r.r.r.r.r.r.r.",
-"r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.n r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.",
-"r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.",
-"r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.",
-"r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r.r."
-};
diff --git a/debian/beauti.1 b/debian/beauti.1
deleted file mode 100644
index ed1c973..0000000
--- a/debian/beauti.1
+++ /dev/null
@@ -1,95 +0,0 @@
-.\"     Title: BEAUTI
-.\"    Author: Alexei J. Drummond
-.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
-.\"      Date: 05/28/2010
-.\"    Manual: BEAUti Manual
-.\"    Source: BEAUti 1.5.3
-.\"
-.TH "BEAUTI" "1" "05/28/2010" "BEAUti 1.5.3" "BEAUti Manual"
-.\" disable hyphenation
-.nh
-.\" disable justification (adjust text to left margin only)
-.ad l
-.SH "NAME"
-beauti \- Bayesian Evolutionary Analysis Utility
-.SH "SYNOPSIS"
-.HP 7
-\fBbeauti\fR [\fInexus_file\ template_file\ beast_file\fR]
-.SH "DESCRIPTION"
-.PP
-BEAUti is a graphical user\-interface (GUI) application for generating beast\-mcmc(1) XML files\&.
-.SH "BUGS"
-.PP
-The BEAUti bug tracking system can be found at
-\fI\%http://code.google.com/p/beast-mcmc/issues/list\fR\&.
-.SH "SEE ALSO"
-.PP
-\fBbeast-mcmc\fR(1)\&.
-.SH "REFERENCES"
-.sp
-.RS 4
-\h'-04'\(bu\h'+03'Drummond AJ, Rambaut A (2007) "BEAST: Bayesian evolutionary analysis by sampling trees\&." BMC Evolutionary Biology 7:214\&.
-.RE
-.sp
-.RS 4
-\h'-04'\(bu\h'+03'Drummond AJ, Ho SYW, Phillips MJ & Rambaut A (2006) PLoS Biology 4, e88\&.
-.RE
-.sp
-.RS 4
-\h'-04'\(bu\h'+03'Drummond AJ, Rambaut A & Shapiro B and Pybus OG (2005) Mol Biol Evol 22, 1185\-1192\&.
-.RE
-.sp
-.RS 4
-\h'-04'\(bu\h'+03'Drummond AJ, Nicholls GK, Rodrigo AG & Solomon W (2002) Genetics 161, 1307\-1320\&.
-.RE
-.SH "AUTHORS"
-.PP
-\fBAlexei J\&. Drummond\fR
-.sp -1n
-.IP "" 4
-Copyright holder for BEAUti\&.
-.PP
-\fBAndrew Rambaut\fR
-.sp -1n
-.IP "" 4
-Copyright holder for BEAUti\&.
-.PP
-\fBMarc A\&. Suchard\fR
-.sp -1n
-.IP "" 4
-Copyright holder for BEAUti\&.
-.PP
-\fBFelix Feyertag\fR <\&felix\&.feyertag at googlemail\&.com\&>
-.sp -1n
-.IP "" 4
-Prepared this manpage in DocBook XML for the Debian distribution\&.
-.SH "COPYRIGHT"
-Copyright \(co 2002\(en2009 Alexei J. Drummond, Andrew Rambaut & Marc A. Suchard (BEAUti)
-.br
-Copyright \(co 2002\(en2009 Felix Feyertag (This manpage)
-.br
-.PP
-The binaries and source code are made available and can be distributed subject to the following conditions:
-.PP
-BEAST is Copyright (C) 2002\-2006 Alexei Drummond and Andrew Rambaut BEAST is distributed under the terms of the GNU Lesser General Public License\&. See the notice in individual files and the file LICENSE for licensing details\&.
-.PP
-BEAST includes software libraries from projects whose licensing terms require that the following notices be included when they are distributed in binary form and that the recipient be given a copy of their respective licenses\&.
-.sp
-.RS 4
-\h'-04'\(bu\h'+03'This product includes software developed by the JDOM Project (http://www\&.jdom\&.org/)
-.RE
-.sp
-.RS 4
-\h'-04'\(bu\h'+03'This product includes software developed by The Apache Software Foundation (http://www\&.apache\&.org/)
-.RE
-.sp
-.RS 4
-\h'-04'\(bu\h'+03'The license for JDOM can be read in the LICENSE\&.txt file in the source distribution available at http://www\&.jdom\&.org/
-.RE
-.sp
-.RS 4
-\h'-04'\(bu\h'+03'The license for the Commons Math library can be read at http://www\&.apache\&.org/licenses/LICENSE\-2\&.0 or in the LICENSE\&.txt file in the source distribution available at http://jakarta\&.apache\&.org/commons/math/
-.RE
-.PP
-This manual page and its XML source can be used, modified, and redistributed as if it were in public domain\&.
-.sp
diff --git a/debian/beauti.1.xml b/debian/beauti.1.xml
deleted file mode 100644
index d6e12dd..0000000
--- a/debian/beauti.1.xml
+++ /dev/null
@@ -1,185 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<?xml-stylesheet type="text/xsl"
-	href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"?>
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-	"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
-
-<!-- Template from docbook-xsl-1.73.2.dfsg.1-3 -->
-
-<!-- Process this file with an XSLT processor, e.g. xsltproc:    -->
-<!-- `xsltproc \
-      -''-nonet \
-      -''-param man.charmap.use.subset "0" \
-      -''-param make.year.ranges "1" \
-      -''-param make.single.year.ranges "1" \
-      manpage.xml'                                               -->
-
-  <!ENTITY dhfirstname "Felix">
-  <!ENTITY dhsurname   "Feyertag">
-  <!ENTITY dhemail     "felix.feyertag at googlemail.com">
-  <!ENTITY dhusername  "&dhfirstname; &dhsurname;">
-  <!ENTITY dhrelease   "1.5.3">
-  <!ENTITY dhtitle     "BEAUti Manual">
-  <!ENTITY dhucpackage "BEAUTI">
-  <!ENTITY dhpackage   "beauti">
-  <!ENTITY dhproduct   "BEAUti">
-  <!ENTITY dhsection   "1">
-]>
-
-<refentry>
-	<refentryinfo>
-		<title>&dhtitle;</title>
-		<productname>&dhproduct;</productname>
-		<releaseinfo role="version">&dhrelease;</releaseinfo>
-		<authorgroup>
-			<author>
-				<firstname>Alexei J.</firstname>
-				<surname>Drummond</surname>
-				<contrib>Copyright holder for &dhproduct;.</contrib>
-			</author>
-			<author>
-				<firstname>Andrew</firstname>
-				<surname>Rambaut</surname>
-				<contrib>Copyright holder for &dhproduct;.</contrib>
-			</author>
-			<author>
-				<firstname>Marc A.</firstname>
-				<surname>Suchard</surname>
-				<contrib>Copyright holder for &dhproduct;.</contrib>
-			</author>
-		</authorgroup>
-    <authorgroup>
-			<author>
-				<firstname>&dhfirstname;</firstname>
-				<surname>&dhsurname;</surname>
-				<contrib>Prepared this manpage in DocBook XML for the Debian distribution.</contrib>
-				<address>
-					<email>&dhemail;</email>
-				</address>
-			</author>
-		</authorgroup>
-		<copyright>
-      <year>2002–2009</year>
-			<holder>Alexei J. Drummond, Andrew Rambaut & Marc A. Suchard (&dhproduct;)</holder>
-		</copyright>
-		<copyright>
-			<year>2002–2009</year>
-			<holder>&dhusername; (This manpage)</holder>
-		</copyright>
-		<legalnotice>
-			<para>
-        The binaries and source code are made available and can be distributed subject to the following conditions:
-      </para>
-          <para>
-BEAST is Copyright (C) 2002-2006 Alexei Drummond and Andrew Rambaut
-BEAST is distributed under the terms of the GNU Lesser General Public License.
-See the notice in individual files and the file LICENSE for licensing details.
-          </para>
-          <para>
-BEAST includes software libraries from projects whose licensing
-terms require that the following notices be included when they are
-distributed in binary form and that the recipient be given a copy of
-their respective licenses.
-          </para>
-      <itemizedlist>
-        <listitem>
-          <para>
-This product includes software developed by the
-JDOM Project (http://www.jdom.org/)
-          </para>
-        </listitem>
-        <listitem>
-          <para>
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/)
-          </para>
-        </listitem>
-        <listitem>
-          <para>
-The license for JDOM can be read in the LICENSE.txt file in the
-source distribution available at http://www.jdom.org/
-          </para>
-        </listitem>
-        <listitem>
-          <para>
-The license for the Commons Math library can be read at
-http://www.apache.org/licenses/LICENSE-2.0 or in the LICENSE.txt file
-in the source distribution available at
-http://jakarta.apache.org/commons/math/
-          </para>
-        </listitem>
-      </itemizedlist>
-    </legalnotice>
-    <legalnotice>
-      <para>
-        This manual page and its XML source can be used, modified, and redistributed as if it were in public domain.
-      </para>
-    </legalnotice>
-	</refentryinfo>
-  
-	<refmeta>
-		<refentrytitle>&dhucpackage;</refentrytitle>
-		<manvolnum>&dhsection;</manvolnum>
-	</refmeta>
-  
-	<refnamediv>
-		<refname>&dhpackage;</refname>
-		<refpurpose>Bayesian Evolutionary Analysis Utility</refpurpose>
-	</refnamediv>
-  
-	<refsynopsisdiv>
-		<cmdsynopsis>
-			<command>&dhpackage;</command>
-            <arg choice="opt"><replaceable>nexus_file template_file beast_file</replaceable></arg>
-		</cmdsynopsis>
-	</refsynopsisdiv>
-  
-	<refsect1 id="description">
-		<title>DESCRIPTION</title>
-		<para>
-            BEAUti is a graphical user-interface (GUI) application for generating beast-mcmc(1) XML files. 
-        </para>
-
-	</refsect1>
-  
-	<refsect1 id="bugs">
-		<!-- Or use this section to tell about upstream BTS. -->
-		<title>BUGS</title>
-		<para>The &dhproduct; bug tracking system can be found at <ulink url="http://code.google.com/p/beast-mcmc/issues/list"/>.</para>
-	</refsect1>
-  
-	<refsect1 id="see_also">
-		<title>SEE ALSO</title>
-		<!-- In alpabetical order. -->
-		<para><citerefentry>
-				<refentrytitle>beast-mcmc</refentrytitle>
-				<manvolnum>1</manvolnum>
-			</citerefentry>.</para>
-  </refsect1>
-  
-  <refsect1 id="references">
-    <title>REFERENCES</title>
-    <itemizedlist>
-      <listitem>
-          <para>
-              Drummond AJ, Rambaut A (2007) "BEAST: Bayesian evolutionary analysis by sampling trees." BMC Evolutionary Biology 7:214.
-        </para>
-      </listitem>
-      <listitem>
-        <para>
-            Drummond AJ, Ho SYW, Phillips MJ & Rambaut A (2006) PLoS Biology 4, e88.
-        </para>
-      </listitem>
-      <listitem>
-        <para>
-            Drummond AJ, Rambaut A & Shapiro B and Pybus OG (2005) Mol Biol Evol 22, 1185-1192.
-        </para>
-      </listitem>
-      <listitem>
-        <para>
-            Drummond AJ, Nicholls GK, Rodrigo AG & Solomon W (2002) Genetics 161, 1307-1320.
-        </para>
-      </listitem>
-    </itemizedlist>
- 	</refsect1>
-</refentry>
diff --git a/debian/beauti.xpm b/debian/beauti.xpm
deleted file mode 100644
index d11251b..0000000
--- a/debian/beauti.xpm
+++ /dev/null
@@ -1,193 +0,0 @@
-/* XPM */
-static char *beauti_[] = {
-/* columns rows colors chars-per-pixel */
-"32 32 155 2",
-"   c #3631362F362E",
-".  c #560A55C85596",
-"X  c #5AC35AC55AC5",
-"o  c #7ED87E837E6A",
-"O  c #39919FC5DFCC",
-"+  c #2F689BF9E262",
-"@  c #2E10A265E76A",
-"#  c #3CE8A304E4A4",
-"$  c #3EBBA676E8A6",
-"%  c #33FAAD5CEE5F",
-"&  c #3BF8AB9FEC47",
-"*  c #7E3DB440D034",
-"=  c #74A6AFA0D4CE",
-"-  c #76D5B285D632",
-";  c #727CB3CFDC0A",
-":  c #724EB911E03F",
-">  c #42B5A5D2E588",
-",  c #47CAA827E65B",
-"<  c #49FEA94DE6A3",
-"1  c #4D2BAECAE9CA",
-"2  c #52D9AD14E72A",
-"3  c #44DBBD99EBAE",
-"4  c #59AFB186E9B0",
-"5  c #50D8B83AF076",
-"6  c #5EF6BF28F241",
-"7  c #61FCB3D6E67F",
-"8  c #6565B8F0E3BF",
-"9  c #6368B566EA27",
-"0  c #6ED9BAE4EBDD",
-"q  c #7B17BC62E397",
-"w  c #759ABE07EC97",
-"e  c #7A1DBF39EB86",
-"r  c #4CEAC538ED99",
-"t  c #5EE1C5AEE658",
-"y  c #55F4C204ED26",
-"u  c #5202C5AAF2E5",
-"i  c #59B9C202F0BA",
-"p  c #64A6C23CE638",
-"a  c #6BFEC5DEE3A0",
-"s  c #6C94C89BED10",
-"d  c #6FF2C06DE3F8",
-"f  c #74BDCA4FE7E1",
-"g  c #7EB2C27BEDCB",
-"h  c #7DEECD7CEC29",
-"j  c #69AFC8A6F10A",
-"k  c #7907C566F36B",
-"l  c #83EC83908363",
-"z  c #89E189698923",
-"x  c #95939541952F",
-"c  c #9C719C5A9C55",
-"v  c #A006A012A034",
-"b  c #9F25B3ABBDE1",
-"n  c #A4B3A48BA46E",
-"m  c #AB4CAB29AB04",
-"M  c #B033B01DB024",
-"N  c #AD2AB2D7B5D8",
-"B  c #A274B4C0BF95",
-"V  c #B5D3B589B568",
-"C  c #B8CFB7EFB7CE",
-"Z  c #B8F5B849B77D",
-"A  c #B47CBD49BE50",
-"S  c #BBE1BBBCBBA4",
-"D  c #8445B364CC4F",
-"F  c #8BD0B5D9CD03",
-"G  c #93FBB5C2C3E7",
-"H  c #91D1B615CC42",
-"J  c #93A0B898CF5A",
-"K  c #9C56B8DEC880",
-"L  c #802DB44BD10C",
-"P  c #897FB771D1DD",
-"I  c #8E08BDAFD6E9",
-"U  c #87C9BE16DCFB",
-"Y  c #A163BB22CB55",
-"T  c #B82CBFE2C42C",
-"R  c #BD65BFAAC08C",
-"E  c #9F9DC40CCE40",
-"W  c #8661C142E004",
-"Q  c #9DCAC465D2C9",
-"!  c #9126C417D8EC",
-"~  c #9FB8C41DD92E",
-"^  c #AE11C66BCF61",
-"/  c #B2CFC10DC65B",
-"(  c #BDB2C47FC68D",
-")  c #B802C6DCCF7C",
-"_  c #B9F0C5EACAC5",
-"`  c #BDC8C9FDCDDB",
-"'  c #A14BC239D70C",
-"]  c #A97EC30AD2FA",
-"[  c #A0F9C467DA25",
-"{  c #A4DDC908DF23",
-"}  c #B019CC96DD1F",
-"|  c #B769C8F4D3BD",
-" . c #B849CBFCD22F",
-".. c #BB75CE72D8D1",
-"X. c #8A3EC3D4E6E7",
-"o. c #8250C9F3E4EE",
-"O. c #8301C49DEEB5",
-"+. c #8932C655ED67",
-"@. c #826BCB28EE4E",
-"#. c #8C0AC962EF58",
-"$. c #9AB0C845E2BB",
-"%. c #9AFBCA9EE334",
-"&. c #956CCB48ECFA",
-"*. c #8E13D3C0ECD1",
-"=. c #98F1D8FFE596",
-"-. c #8111CC31F2DA",
-";. c #8C8ACA85F163",
-":. c #92E9CC76F198",
-">. c #9960CFA6F257",
-",. c #9EE7D2F3F388",
-"<. c #9E6BDD83F717",
-"1. c #9E59DD5EFAFD",
-"2. c #A6F5CB98E1BA",
-"3. c #AC3BCE51E30D",
-"4. c #A273D8B8E373",
-"5. c #A35CD214EF07",
-"6. c #A938D7D5EC8C",
-"7. c #B4C0D22EE3F0",
-"8. c #BD05D3FBE20A",
-"9. c #A48FD4B0F324",
-"0. c #A468DBB6F732",
-"q. c #B2BFD90DF083",
-"w. c #BC43E0AEF807",
-"e. c #C49DC4A7C4BE",
-"r. c #C504C7ABC933",
-"t. c #C63DCA51CBDB",
-"y. c #CDD9CDF6CE00",
-"u. c #D399D11DCFAA",
-"i. c #C496CEC3D2BD",
-"p. c #CAA2CE89D0B0",
-"a. c #C549D0ECD778",
-"s. c #D01DD106D15F",
-"d. c #C69BD4BFDCED",
-"f. c #CC88D735DC9E",
-"g. c #D515D512D503",
-"h. c #D864D84ED833",
-"j. c #D36BD755DA56",
-"k. c #D40CD911DBA9",
-"l. c #DC7BDC74DC6E",
-"z. c #E05BE06FE05D",
-"x. c #C688D7E4E295",
-"c. c #C992D899E124",
-"v. c #C4B5DE55ED6F",
-"b. c #D2DBDCA3E1C3",
-"n. c #DDEEE262E4C8",
-"m. c #DA8AE73CEEE0",
-"M. c #E3D0E3C2E3B9",
-"N. c #E5CEEC2CEFF8",
-"B. c #EC32EC3BEC43",
-"V. c #EE5FF03FF14F",
-"C. c #E229F2D7FD90",
-"Z. c #F49BF494F490",
-"A. c #F8E7F885F84E",
-"S. c #FB3CFB41FB3F",
-"D. c None",
-/* pixels */
-"D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.",
-"D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.",
-"D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.",
-"D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.",
-"D.S g.y.y.u.y.s.y.u.s.y.r.u.y.u.u.s.y.s.s.y.s.y.y.y.u.u.y.g.r.D.",
-"D.g.B.S g.B.S.S.S.A.S.S.V.A.S.A.S.S.S.S.S.S.S.S.S.S.A.y.V l.B.D.",
-"D.g.C o n V Z.A.A.A.A.Z.B.Z.A.A.A.A.A.Z.A.A.A.Z.S.A.M.z z S u.D.",
-"D.g.V o o n B.Z.Z.Z.Z.Z.B.Z.Z.Z.Z.Z.Z.Z.Z.V.N.B.m.N.h.z o z t.D.",
-"D.g.l.n n g.V.V.Z.Z.V.V.M.V.Z.Z.Z.Z.V.Z.B.v.q.3.5.v.f.N v S b.D.",
-"D.g.B.B.B.B.V.V.B.M.M.B.M.B.B.B.B.B.B.B.M.7.9.&.&.9.~ ..n.B.B.D.",
-"D.g.B.B.B.h.y.t.y.d.f.B.z.B.B.B.B.B.B.M.k.2.+.:.,.9.&.%.k.B.z.D.",
-"D.g.B.B.B.l     . ) { k.l.B.M.B.B.M.M.c.&.O.k +.9.,.,.6.j.M.M.D.",
-"D.g.M.B.M.c c n z r.} $.2.8.n.M.M.z.8.&.+.g O.>.&.;.;.X.| f.l.D.",
-"D.h.M.M.M.n g.z.n t.h.i.] X.3.z.M.f.X.+.O.w +.>.<.0.0.-.* K p.D.",
-"D.h.M.M.M.v C R x y.l.h.t.Y :.f.k.Y e O.w 9 w >.*.Q 4.=.F K y.D.",
-"D.h.M.M.n.v S e.c r.z.h.y.] -. .` q O.0 4 4 e >.f D B A S r.s.D.",
-"D.h.l.l.l.n y.l.v r.l.h.r.' h / Y e w 4 < O.;.k s d : ( y.g.g.D.",
-"D.l.h.h.h.n y.l.v S l.j.r.U o.( J w 9 , < 9.<.j @.I ! i.g.g.h.D.",
-"D.l.l.l.h.m g.z.n S l.h.r.U W e.P w 9 # 9 C. at .G I h _ g.h.l.l.D.",
-"D.l.z.l.z.t.m m n e.l.l.t.P ; T H e 9 > 4 q.q K e.t.g.g.l.l.l.D.",
-"D.z.z.z.z.h.Z n m r.z.l.y.^ 4 - = 2 9 , $ w ;.P u.h.h.l.M.z.z.D.",
-"D.M.l.r.e.l.l.u.y.g.z.z.g.p.U 6 5 % $ # + 2 4 - | j.z.y.t.h.M.D.",
-"D.M.S o M y.z.M.M.M.M.z.h.g.y.) ] D O @ 5 6 & 1 @ 8 i.x n Z u.D.",
-"D.M.n o z v l.M.M.M.M.M.l.l.h.u.y.e.* 3 t a p y r f T l l l r.D.",
-"D.B.R z z V M.M.M.M.B.M.l.M.M.M.l.g.t._ ( ( ( _ t.s.g.c l c g.D.",
-"D.g.r.V M e.e.r.r.r.e.e.e.r.r.r.e.( S S C C C C C S S S m C y.D.",
-"D.D.D.X X X X X X X X X . X X X X X X . . . X X X X X X X X D.D.",
-"D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.",
-"D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.",
-"D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.",
-"D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.",
-"D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D."
-};
diff --git a/debian/bin/beast-mcmc b/debian/bin/beast-mcmc
deleted file mode 100644
index 6f5e88a..0000000
--- a/debian/bin/beast-mcmc
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/sh
-
-# upstream has set 1024
-# I had use cases that required more than 2048
-MAXMEM=3072
-
-# Remark: There should be no need to specify CLASSPATH
-# explicitely because it is set in manifest - however, this
-# does not work
-
-# Remark: Adding /usr/lib/$(dpkg-architecture -qDEB_BUILD_MULTIARCH)/jni
-#         to java.library.path helped solving the following problem:
-#  $ beast-mcmc -beagle_info >/dev/null
-#  Failed to load BEAGLE library: no hmsbeagle-jni in java.library.path
-#  Failed to load BEAGLE library: no hmsbeagle-jni in java.library.path
-#  Failed to load BEAGLE library: no hmsbeagle-jni in java.library.path
-#
-# Using the setting above this turns into
-#  BEAGLE resources available:
-#  0 : CPU
-#      Flags: PRECISION_SINGLE PRECISION_DOUBLE COMPUTATION_SYNCH EIGEN_REAL EIGEN_COMPLEX SCALING_MANUAL SCALING_AUTO SCALING_ALWAYS SCALERS_RAW SCALERS_LOG VECTOR_SSE VECTOR_NONE THREADING_NONE PROCESSOR_CPU FRAMEWORK_CPU
-
-
-BEAST_LIB="/usr/share/beast-mcmc"
-DEBJAR="/usr/share/java"
-java -Xms64m -Xmx${MAXMEM}m -Djava.library.path="$BEAST_LIB:/usr/lib:/usr/lib/$(dpkg-architecture -qDEB_BUILD_MULTIARCH)/jni" \
-   -classpath "${CLASSPATH}:${DEBJAR}/jebl.jar:${DEBJAR}/jam.jar:${DEBJAR}/jdom1.jar:${DEBJAR}/colt.jar:${DEBJAR}/commons-math.jar:${DEBJAR}/treeview.jar:${BEAST_LIB}/beast.jar:$BEAST_LIB/beast-beagle.jar" \
-   dr.app.beast.BeastMain $*
diff --git a/debian/bin/beauti b/debian/bin/beauti
deleted file mode 100644
index 86e9f5e..0000000
--- a/debian/bin/beauti
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-BEAST_LIB="/usr/share/beast-mcmc"
-java -Xms64m -Xmx1024m -Djava.library.path="$BEAST_LIB" -jar "$BEAST_LIB/beauti.jar" $*
-
diff --git a/debian/bin/loganalyser b/debian/bin/loganalyser
deleted file mode 100644
index b814954..0000000
--- a/debian/bin/loganalyser
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-BEAST_LIB="/usr/share/beast-mcmc"
-java -Xms64m -Xmx1024m -Djava.library.path="$BEAST_LIB" -cp "$BEAST_LIB/beast.jar" dr.app.tools.LogAnalyser $*
-
diff --git a/debian/bin/logcombiner b/debian/bin/logcombiner
deleted file mode 100644
index 0270179..0000000
--- a/debian/bin/logcombiner
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-BEAST_LIB="/usr/share/beast-mcmc"
-DEBJAR="/usr/share/java"
-java -Xms64m -Xmx1024m -Djava.library.path="$BEAST_LIB" \
-  -classpath ${CLASSPATH}:${BEAST_LIB}/beast.jar:${DEBJAR}/jebl.jar:${DEBJAR}/jam.jar:${DEBJAR}/treeview.jar \
-  dr.app.tools.LogCombiner $*
diff --git a/debian/bin/treeannotator b/debian/bin/treeannotator
deleted file mode 100644
index 02192af..0000000
--- a/debian/bin/treeannotator
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-BEAST_LIB="/usr/share/beast-mcmc"
-DEBJAR="/usr/share/java"
-java -Xms64m -Xmx1024m -Djava.library.path="$BEAST_LIB" \
-  -classpath ${CLASSPATH}:${BEAST_LIB}/beast.jar:${DEBJAR}/jebl.jar:${DEBJAR}/jam.jar:${DEBJAR}/treeview.jar \
-  dr.app.tools.TreeAnnotator $*
-
-
diff --git a/debian/bin/treestat b/debian/bin/treestat
deleted file mode 100644
index 2fa5b20..0000000
--- a/debian/bin/treestat
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-BEAST_LIB="/usr/share/beast-mcmc"
-DEBJAR="/usr/share/java"
-java -Xms64m -Xmx1024m -Djava.library.path="$BEAST_LIB" \
-  -classpath ${CLASSPATH}:${BEAST_LIB}/beast.jar:${DEBJAR}/jebl.jar:${DEBJAR}/jam.jar:${DEBJAR}/treeview.jar:${DEBJAR}/jdom1.jar \
-  dr.app.treestat.TreeStatApp $*
-
diff --git a/debian/changelog b/debian/changelog
deleted file mode 100644
index 54618f5..0000000
--- a/debian/changelog
+++ /dev/null
@@ -1,10 +0,0 @@
-beast2-mcmc (2.1.3-1) UNRELEASED; urgency=medium
-
-  * New upstream version
-  * Important note:  This is no new upstream version of beast-mcmc (1.x)
-    but rather a rewritten version.  We want to provide both versions
-    in parallel for the moment.
-    However, the packaging is shamelessly copied from beast-mcmc and
-    can not work at all before all the cut-n-pastos are fixed.
-
- -- Andreas Tille <tille at debian.org>  Wed, 12 Nov 2014 10:22:58 +0100
diff --git a/debian/compat b/debian/compat
deleted file mode 100644
index ec63514..0000000
--- a/debian/compat
+++ /dev/null
@@ -1 +0,0 @@
-9
diff --git a/debian/control b/debian/control
deleted file mode 100644
index 8acc5ec..0000000
--- a/debian/control
+++ /dev/null
@@ -1,114 +0,0 @@
-Source: beast2-mcmc
-Maintainer: Debian Med Packaging Team <debian-med-packaging at lists.alioth.debian.org>
-Uploaders: Andreas Tille <tille at debian.org>,
-           Olivier Sallou <osallou at debian.org>
-Section: contrib/science
-XS-Autobuild: yes
-Priority: optional
-Build-Depends: debhelper (>= 9),
-               javahelper,
-               ant,
-               ant-optional,
-               default-jdk,
-               libjebl2-java,
-               libjam-java,
-               figtree,
-               liboptions-java,
-               libhmsbeagle-java (>= 1.1r1092),
-               libcolt-java,
-               libmpj-java,
-               r-cran-rjava,
-               libcommons-math-java (>= 2.2),
-               libjdom1-java,
-               junit4,
-               libmtj-java,
-               libitext1-java,
-               texlive-latex-base,
-               texlive-latex-extra
-Standards-Version: 3.9.6
-Vcs-Browser: http://anonscm.debian.org/viewvc/debian-med/trunk/packages/beast2-mcmc/trunk/
-Vcs-Svn: svn://anonscm.debian.org/debian-med/trunk/packages/beast2-mcmc/trunk/
-Homepage: http://beast.bio.ed.ac.uk/
-
-Package: beast2-mcmc
-Architecture: all
-Depends: ${shlibs:Depends},
-         ${misc:Depends},
-         libhmsbeagle-java (>= 1.1r1092),
-         ${java:Depends},
-         default-jre | java6-runtime,
-         libnucleotidelikelihoodcore0 (>= ${source:Version})
-Suggests: beast-mcmc-doc
-Description: Bayesian MCMC phylogenetic inference
- BEAST is a cross-platform program for Bayesian MCMC analysis of molecular 
- sequences. It is entirely orientated towards rooted, time-measured 
- phylogenies inferred using strict or relaxed molecular clock models. It
- can be used as a method of reconstructing phylogenies but is also a 
- framework for testing evolutionary hypotheses without conditioning on a 
- single tree topology. BEAST uses MCMC to average over tree space, so that 
- each tree is weighted proportional to its posterior probability. Included 
- is a simple to use user-interface program for setting up standard 
- analyses and a suit of programs for analysing the results.
- .
- This is no new upstream version of beast-mcmc (1.x) but rather a rewritten
- version.
-
-Package: libnucleotidelikelihoodcore0
-Architecture: amd64
-Section: contrib/libs
-Depends: ${shlibs:Depends},
-         ${misc:Depends}
-Conflicts: beast-mcmc-lib
-Provides: beast-mcmc-lib
-Replaces: beast-mcmc-lib
-Description: implementation of LikelihoodCore for nucleotides used by beast-mcmc
- BEAST is a cross-platform program for Bayesian MCMC analysis of molecular 
- sequences. It is entirely orientated towards rooted, time-measured 
- phylogenies inferred using strict or relaxed molecular clock models. It
- can be used as a method of reconstructing phylogenies but is also a 
- framework for testing evolutionary hypotheses without conditioning on a 
- single tree topology. BEAST uses MCMC to average over tree space, so that 
- each tree is weighted proportional to its posterior probability. Included 
- is a simple to use user-interface program for setting up standard 
- analyses and a suit of programs for analysing the results.
- .
- This package provides an implementation of LikelihoodCore for nucleotides
- that calls native methods for maximum speed.
-
-Package: beast2-mcmc-examples
-Architecture: all
-Section: contrib/doc
-Depends: ${shlibs:Depends},
-         ${misc:Depends}
-Enhances: beast-mcmc
-Description: Bayesian MCMC phylogenetic inference - example data
- BEAST is a cross-platform program for Bayesian MCMC analysis of molecular 
- sequences. It is entirely orientated towards rooted, time-measured 
- phylogenies inferred using strict or relaxed molecular clock models. It
- can be used as a method of reconstructing phylogenies but is also a 
- framework for testing evolutionary hypotheses without conditioning on a 
- single tree topology. BEAST uses MCMC to average over tree space, so that 
- each tree is weighted proportional to its posterior probability. Included 
- is a simple to use user-interface program for setting up standard 
- analyses and a suit of programs for analysing the results.
- .
- This package contains the example data.
-
-Package: beast2-mcmc-doc
-Architecture: all
-Section: contrib/doc
-Depends: ${shlibs:Depends},
-         ${misc:Depends}
-Enhances: beast-mcmc
-Description: Bayesian MCMC phylogenetic inference - documentation
- BEAST is a cross-platform program for Bayesian MCMC analysis of molecular 
- sequences. It is entirely orientated towards rooted, time-measured 
- phylogenies inferred using strict or relaxed molecular clock models. It
- can be used as a method of reconstructing phylogenies but is also a 
- framework for testing evolutionary hypotheses without conditioning on a 
- single tree topology. BEAST uses MCMC to average over tree space, so that 
- each tree is weighted proportional to its posterior probability. Included 
- is a simple to use user-interface program for setting up standard 
- analyses and a suit of programs for analysing the results.
- .
- This package contains the documentation.
diff --git a/debian/copyright b/debian/copyright
deleted file mode 100644
index 0e6cb9d..0000000
--- a/debian/copyright
+++ /dev/null
@@ -1,48 +0,0 @@
-Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
-Upstream-Name: BEAST-MCMC
-Upstream-Contact: Alexei Drummond <alexei at cs.auckland.ac.nz>,
-                  Andrew Rambaut <a.rambaut at ed.ac.uk>
-Source: http://beast-mcmc.googlecode.com/svn/trunk/
-Files-Excluded: *.jar
-                *.so
-                *.o
-                *.jnilib
-
-Files: *
-Copyright: 2002-2011 Alexei Drummond and Andrew Rambaut
-License: LGPL-3+
-
-Files: src/dr/math/matrixAlgebra/RobustSingularValueDecomposition.java
-Copyright: 1999 CERN - European Organization for Nuclear Research
-           1999 Marc A. Suchard
-License: Colt-License-Agreement
- Permission to use, copy, modify, distribute and sell this software and its
- documentation for any purpose is hereby granted without fee, provided that
- the above copyright notice appear in all copies and that both that
- copyright notice and this permission notice appear in supporting
- documentation. CERN makes no representations about the suitability of this
- software for any purpose. It is provided "as is" without expressed or
- implied warranty.
-
-Files: debian/*
-Copyright: 2011-2012 Andreas Tille <tille at debian.org>
-License: LGPL-3+
-
-License: LGPL-3+
- 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 3 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 Lesser General Public License
- along with this program.  If not, see <http://www.gnu.org/licenses/>.
- .
- On a Debian GNU/Linux system, the GNU Lesser GPL license version 3 is included
- in the file ‘/usr/share/common-licenses/LGPL-3’, and the GNU GPL license
- version 3 is included in the file ‘/usr/share/common-licenses/GPL-3’.
-
diff --git a/debian/get-orig-source b/debian/get-orig-source
deleted file mode 100755
index 3f73edc..0000000
--- a/debian/get-orig-source
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/bin/sh
-# get source for beast-mcmc from SVN because there is no source tarball distribution
-
-set -e
-NAME=`dpkg-parsechangelog | awk '/^Source/ { print $2 }'`
-ORIGNAME=beast
-
-if ! echo $@ | grep -q upstream-version ; then
-    VERSION=`dpkg-parsechangelog | awk '/^Version:/ { print $2 }' | sed 's/\([0-9\.]\+\)-[0-9]\+$/\1/'`
-else
-    VERSION=`echo $@ | sed "s?^.*--upstream-version \([0-9.]\+\) .*${ORIGNAME}_release.*?\1?"`
-    if echo "$VERSION" | grep -q "upstream-version" ; then
-        echo "Unable to parse version number"
-        exit
-    fi
-fi
-
-SVNTAG=`echo ${VERSION} | sed 's/\./_/g'`
-rm -f ../${ORIGNAME}_release_${SVNTAG}
-RELEASE=${ORIGNAME}_release_${SVNTAG}
-TARDIR=${NAME}-${VERSION}
-
-mkdir -p ../tarballs
-cd ../tarballs
-# svn export conserves time stamps of the files, checkout does not
-LC_ALL=C svn export http://${NAME}.googlecode.com/svn/tags/${RELEASE} ${TARDIR} >/dev/null 2>/dev/null
-
-# remove jars which are provided as binaries but are not directly needed to build FigTree
-for jar in \
-            JRI.jar \
-            beagle.jar \
-            colt.jar \
-            commons-math-*.jar \
-            figtreepanel.jar \
-            itext-1.4.5.jar \
-            jam.jar \
-            jdom.jar \
-            jebl.jar \
-            junit-4.4.jar \
-            libjri.jnilib \
-            mpj.jar \
-            mtj.jar \
-            options.jar \
-            org.boehn.kmlframework_20090320.jar \
-        ; do
-    rm -rf ${TARDIR}/lib/$jar
-done
-
-# No source available for phylogeography
-find ${TARDIR} -mindepth 1 -maxdepth 1 -name "*phylogeography*" | xargs rm -rf
-
-rm -rf ${TARDIR}/release/Mac ${TARDIR}/release/Windows ${TARDIR}/release/Linux/lib/*
-
-# Remove all preprocessed (duplicated!) docs
-rm -rf ${TARDIR}/release/common/doc/*
-# remove preprocessed docs which can be recreated using LaTeX to make sure that we
-# really have the source and to save some disk space in source archive
-for pdf in \
-            doc/SerialSampleCoalescent.pdf \
-            doc/Yule.pdf \
-            doc/tutorial/EBSP/ebsp-tut.pdf \
-            doc/tutorial/StarBEAST/STARBEAST.pdf \
-        ; do
-    rm -rf ${TARDIR}/$pdf
-done
-# ... and every *.pdf named "Practical_<something>"
-find ${TARDIR}/doc -name "Practical_*.pdf" -delete
-# There is no point in keeping LaTeX's *.aux files
-find ${TARDIR}/doc -name "*.aux" -delete
-
-GZIP="--best --no-name" tar --owner=root --group=root --mode=a+rX -caf "$NAME"_"$VERSION".orig.tar.xz "${TARDIR}"
-rm -rf "${NAME}"-"$VERSION"
diff --git a/debian/libnucleotidelikelihoodcore0.install b/debian/libnucleotidelikelihoodcore0.install
deleted file mode 100644
index 36715b0..0000000
--- a/debian/libnucleotidelikelihoodcore0.install
+++ /dev/null
@@ -1 +0,0 @@
-native/l*.so*			usr/lib
diff --git a/debian/patches/create_soname.patch b/debian/patches/create_soname.patch
deleted file mode 100644
index 50e3bf2..0000000
--- a/debian/patches/create_soname.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-Description: Create SONAME for library
-Author: Andreas Tille <tille at debian.org>
-Created: Mon, 17 Dec 2012 16:43:17 +0100
-
---- beast-mcmc-1.8.0.orig/native/Makefile.linux
-+++ beast-mcmc-1.8.0/native/Makefile.linux
-@@ -1,11 +1,11 @@
- CC=gcc
--CFLAGS += -O2 -funroll-loops 
-+CFLAGS=-O2 -funroll-loops
- INCLUDES=-I${JAVA_HOME}/include/ -I${JAVA_HOME}/include/linux
- 
- OBJS = NucleotideLikelihoodCore.o
- 
- .c.o:
--	${CC} $(CPPFLAGS) ${CFLAGS} $(LDFLAGS) ${INCLUDES} -c $*.c
-+	${CC} ${CFLAGS} ${INCLUDES} -c $*.c
- 
- libNucleotideLikelihoodCore.so: ${OBJS}
--	${CC} $(CPPFLAGS) ${CFLAGS} $(LDFLAGS) ${INCLUDES} -shared -o libNucleotideLikelihoodCore.so ${OBJS}
-+	${CC} ${CFLAGS} ${INCLUDES} -shared -Wl,-soname,libNucleotideLikelihoodCore.so.0 -o libNucleotideLikelihoodCore.so.0 ${OBJS}
diff --git a/debian/patches/enable_hardening.patch b/debian/patches/enable_hardening.patch
deleted file mode 100644
index 0df658f..0000000
--- a/debian/patches/enable_hardening.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-Description: Enable propagation of hardening flags
-Author: Andreas Tille <tille at debian.org>
-Date: Tue, 05 Jun 2012 14:38:11 +0200
-
---- beast-mcmc-1.8.0.orig/native/Makefile.linux
-+++ beast-mcmc-1.8.0/native/Makefile.linux
-@@ -1,11 +1,11 @@
- CC=gcc
--CFLAGS=-O2 -funroll-loops
-+CFLAGS += -O2 -funroll-loops 
- INCLUDES=-I${JAVA_HOME}/include/ -I${JAVA_HOME}/include/linux
- 
- OBJS = NucleotideLikelihoodCore.o
- 
- .c.o:
--	${CC} ${CFLAGS} ${INCLUDES} -c $*.c
-+	${CC} $(CPPFLAGS) ${CFLAGS} $(LDFLAGS) ${INCLUDES} -c $*.c
- 
- libNucleotideLikelihoodCore.so: ${OBJS}
--	${CC} ${CFLAGS} ${INCLUDES} -shared -o libNucleotideLikelihoodCore.so ${OBJS}
-+	${CC} $(CPPFLAGS) ${CFLAGS} $(LDFLAGS) ${INCLUDES} -shared -o libNucleotideLikelihoodCore.so ${OBJS}
diff --git a/debian/patches/fix_classpath_in_build_tracer_xml.patch b/debian/patches/fix_classpath_in_build_tracer_xml.patch
deleted file mode 100644
index 5715a02..0000000
--- a/debian/patches/fix_classpath_in_build_tracer_xml.patch
+++ /dev/null
@@ -1,141 +0,0 @@
-Author: Andreas Tille <tille at debian.org>
-Date: Tue, 10 Jan 2012 22:29:24 +0100
-Description: Make sure also tracer is builded with Debian packages JARs
-
---- beast-mcmc-1.8.0.orig/build_tracer.xml
-+++ beast-mcmc-1.8.0/build_tracer.xml
-@@ -32,6 +32,7 @@
-     <property name="src" location="src"/>
-     <property name="build" location="build"/>
-     <property name="lib" location="lib"/>
-+    <property name="deblib" location="/usr/share/java" />
-     <property name="dist" location="dist"/>
- 
-     <property environment="env"/>
-@@ -56,7 +57,7 @@
-     <target name="compile-basic" depends="init">
-         <!-- Compile the java code from ${src} into ${build} -->
-         <javac source="1.5" target="1.5" srcdir="${src}" destdir="${build}"
--               classpath="${lib}/colt.jar:${lib}/commons-math-2.2.jar:${lib}/jebl.jar:${lib}/jam.jar:${lib}/itext-1.4.5.jar:${lib}/jdom.jar:${lib}/mtj.jar:${lib}/JRI.jar:${lib}/mpj.jar">
-+               classpath="${deblib}/colt.jar:${deblib}/commons-math-2.2.jar:${deblib}/jebl.jar:${deblib}/jam.jar:${deblib}/itext-1.4.5.jar:${deblib}/jdom.jar:${deblib}/mtj.jar:/usr/lib/R/site-library/rJava/jri/JRI.jar:${deblib}/mpj.jar">
-             <include name="dr/app/tracer/**"/>
-             <include name="dr/app/util/**"/>
-             <include name="dr/app/gui/**"/>
-@@ -121,10 +122,10 @@
-                 <include name="dr/app/tracer/**/*.tiff"/>
-                 <include name="org/virion/jam/**/*.png"/>
-             </fileset>
--            <zipgroupfileset dir="${lib}" includes="jebl.jar"/>
--            <zipgroupfileset dir="${lib}" includes="jam.jar"/>
--            <zipgroupfileset dir="${lib}" includes="itext-1.4.5.jar"/>
--            <zipgroupfileset dir="${lib}" includes="commons-math-2.0.jar"/>
-+            <zipgroupfileset dir="${deblib}" includes="jebl.jar"/>
-+            <zipgroupfileset dir="${deblib}" includes="jam.jar"/>
-+            <zipgroupfileset dir="${deblib}" includes="itext-1.4.5.jar"/>
-+            <zipgroupfileset dir="${deblib}" includes="commons-math.jar"/>
-         </jar>
- 
-     </target>
-@@ -136,46 +137,12 @@
- 
-     <property name="common_dir" value="${release_dir}/common" />
- 
--    <property name="Mac_dir" value="${release_dir}/Mac" />
-     <property name="Linux_dir" value="${release_dir}/Linux" />
--    <property name="Windows_dir" value="${release_dir}/Windows" />
- 
--    <property name="Mac_package_dir" value="${Mac_dir}/${name} v${version}" />
-     <property name="Linux_package_dir" value="${Linux_dir}/${name}_v${version}" />
--    <property name="Windows_package_dir" value="${Windows_dir}/${name} v${version}" />
- 
-     <!-- Need to either install Launch4j under {BEAST workspace}/${release}
-                  or install it in the default directory and change the location of launch4j.dir -->
--    <target name="windows" depends="dist" description="release Windows version of Tracer">
--
--        <delete dir="${Windows_package_dir}" />
--        <!-- Create the release directory -->
--        <mkdir dir="${Windows_package_dir}" />
--
--        <property name="launch4j.dir" location="${Windows_dir}/launch4j" />
--        <taskdef name="launch4j" classname="net.sf.launch4j.ant.Launch4jTask"
--            classpath="${launch4j.dir}/launch4j.jar :${launch4j.dir}/lib/xstream.jar" />
--
--        <copy file="${dist}/tracer.jar" todir="${Windows_package_dir}/lib"/>
--        <copy todir="${Windows_package_dir}/lib">
--            <fileset dir="${Windows_dir}/lib"/>
--        </copy>
--        <copy file="${common_dir}/README.txt" todir="${Windows_package_dir}"/>
--
--        <launch4j configFile="${Windows_dir}/tracer_launch4j.xml"
--                  jar="${dist}/tracer.jar"
--                  outfile="${Windows_package_dir}/${name} v${version}.exe"
--                  fileVersion="${version_number}.0"
--                  txtFileVersion="${version}"
--                  productVersion="${version_number}.0"
--                  txtProductVersion="${version}"/>
--
--        <zip destfile="${release_dir}/${name} v${version}.zip">
--            <zipfileset dir="${Windows_package_dir}" prefix="${name} v${version}"/>
--        </zip>
--
--        <echo message="Windows version release is finished." />
--    </target>
- 
-     <target name="linux" description="release Linux/Unix version of Tracer">
-         <delete dir="${Linux_package_dir}" />
-@@ -200,55 +167,4 @@
-         <echo message="Linux/Unix version release is finished." />
-     </target>
- 
--    <target name="mac"
--                                   description="release Mac version of Tracer">
--        <delete dir="${Mac_package_dir}" />
--        <!-- Create the release directory -->
--        <mkdir dir="${Mac_package_dir}" />
--
--        <copy file="${common_dir}/README.txt" todir="${Mac_package_dir}"/>
--
--        <taskdef name="jarbundler" classname="net.sourceforge.jarbundler.JarBundler"/>
--
--        <!-- create a jar bundle for the mac -->
--        <jarbundler dir="${Mac_package_dir}"
--                        name="${name} v${version}"
--                        mainclass="dr.app.tracer.application.TracerApp"
--                        icon="${Mac_dir}/icons/Tracer.icns"
--                        jvmversion="1.5+"
--                        vmoptions="-Xmx1024M"
--                        arguments=""
--                        version="${version}"
--                        infostring="${name} v${version}, Copyright 2003-2009, Andrew Rambaut & Alexei J. Drummond"
--                        bundleid="tracer" >
--            <javaproperty name="apple.laf.useScreenMenuBar" value="true"/>
--            <jarfileset dir="${dist}">
--                <include name="**/tracer.jar"/>
--            </jarfileset>
--            <jarfileset dir="${Mac_dir}/lib">
--                <include name="**/quaqua.jar"/>
--            </jarfileset>
--            <jarfileset dir="${Mac_dir}/lib">
--                <include name="libquaqua*.jnilib"/>
--            </jarfileset>
--        </jarbundler>
--
--        <echo message="Building disk image." />
--
--        <!-- create disk image -->
--        <exec executable="/usr/bin/hdiutil">
--            <arg value="create"/>
--            <arg value="-ov"/>
--            <arg value="-srcfolder"/>
--            <arg value="${Mac_package_dir}"/>
--            <arg value="-volname"/>
--            <arg value="${name} v${version}"/>
--            <arg value="-imagekey"/>
--            <arg value="zlib-level=6"/>
--            <arg value="${release_dir}/${name} v${version}.dmg"/>
--        </exec>
--
--        <echo message="Mac version release is finished." />
--    </target>
--
- </project>
diff --git a/debian/patches/fix_classpath_in_build_xml.patch b/debian/patches/fix_classpath_in_build_xml.patch
deleted file mode 100644
index e6ae98e..0000000
--- a/debian/patches/fix_classpath_in_build_xml.patch
+++ /dev/null
@@ -1,98 +0,0 @@
-Author: Andreas Tille <tille at debian.org>
-Last-Updated: 2012-02-26
-Subject: use Debian jars
-Description: Make sure package builds with Debian packages JARs
-Forwarded: no
---- beast-mcmc-1.8.0.orig/build.xml
-+++ beast-mcmc-1.8.0/build.xml
-@@ -36,6 +36,7 @@
-     <property name="src" location="src"/>
-     <property name="build" location="build"/>
-     <property name="lib" location="lib"/>
-+    <property name="deblib" location="/usr/share/java" />
-     <property name="dist" location="${build}/dist"/>
- 
-     <property name="main_class_BEAST" value="dr.app.beast.BeastMain"/>
-@@ -47,6 +48,19 @@
- 
-     <path id="classpath">
-         <fileset dir="${lib}" includes="**/*.jar"/>
-+        <fileset dir="${deblib}" includes="beagle.jar"/>
-+        <fileset dir="${deblib}" includes="colt.jar"/>
-+        <fileset dir="${deblib}" includes="commons-math.jar"/>
-+        <fileset dir="${deblib}" includes="figtree.jar"/>
-+        <fileset dir="${deblib}" includes="itext1.jar"/>
-+        <fileset dir="${deblib}" includes="jam.jar"/>
-+        <fileset dir="${deblib}" includes="jdom1.jar"/>
-+        <fileset dir="${deblib}" includes="jebl.jar"/>
-+        <fileset dir="/usr/lib/R/site-library/rJava/jri/" includes="JRI.jar"/>
-+        <fileset dir="${deblib}" includes="junit4.jar"/>
-+        <fileset dir="${deblib}" includes="mpj.jar"/>
-+        <fileset dir="${deblib}" includes="mtj.jar"/>
-+        <fileset dir="${deblib}" includes="options.jar"/>
-     </path>
- 
-     <!-- start -->
-@@ -159,14 +173,6 @@
-                 <include name="org/virion/jam/**/*.png"/>
-                 <include name="dr/**/*.properties"/>
-             </fileset>
--            <zipgroupfileset dir="${lib}" includes="jebl.jar"/>
--            <zipgroupfileset dir="${lib}" includes="jam.jar"/>
--            <zipgroupfileset dir="${lib}" includes="jdom.jar"/>
--            <zipgroupfileset dir="${lib}" includes="commons-math-2.2.jar"/>
--            <zipgroupfileset dir="${lib}" includes="mtj.jar"/>
--            <zipgroupfileset dir="${lib}" includes="JRI.jar"/>
--            <zipgroupfileset dir="${lib}" includes="colt.jar"/>
--            <zipgroupfileset dir="${lib}" includes="beagle.jar"/>
-         </jar>
- 
-         <!-- Put everything in ${build} into the beauti.jar file -->
-@@ -222,11 +228,6 @@
-             <fileset dir="${src}">
-                 <include name="dr/**/*.png"/>
-             </fileset>
--            <zipgroupfileset dir="${lib}" includes="jam.jar"/>
--            <zipgroupfileset dir="${lib}" includes="jebl.jar"/>
--            <zipgroupfileset dir="${lib}" includes="jdom.jar"/>
--            <zipgroupfileset dir="${lib}" includes="commons-math-2.2.jar"/>
--            <zipgroupfileset dir="${lib}" includes="mtj.jar"/>
-         </jar>
- 
-     </target>
---- beast-mcmc-1.8.0.orig/.classpath
-+++ beast-mcmc-1.8.0/.classpath
-@@ -1,20 +1,20 @@
- <?xml version="1.0" encoding="UTF-8"?>
- <classpath>
- 	<classpathentry kind="src" path="src"/>
--	<classpathentry kind="lib" path="lib/beagle.jar"/>
--	<classpathentry kind="lib" path="lib/colt.jar"/>
--	<classpathentry kind="lib" path="lib/figtreepanel.jar"/>
--	<classpathentry kind="lib" path="lib/itext-1.4.5.jar"/>
--	<classpathentry kind="lib" path="lib/jam.jar"/>
--	<classpathentry kind="lib" path="lib/jdom.jar"/>
--	<classpathentry kind="lib" path="lib/jebl.jar"/>
--	<classpathentry kind="lib" path="lib/JRI.jar"/>
--	<classpathentry kind="lib" path="lib/junit-4.4.jar"/>
--	<classpathentry kind="lib" path="lib/mpj.jar"/>
--	<classpathentry kind="lib" path="lib/mtj.jar"/>
--	<classpathentry kind="lib" path="lib/options.jar"/>
-+	<classpathentry kind="lib" path="/usr/share/java/beagle.jar"/>
-+	<classpathentry kind="lib" path="/usr/share/java/colt.jar"/>
-+	<classpathentry kind="lib" path="/usr/share/java/figtreepanel.jar"/>
-+	<classpathentry kind="lib" path="/usr/share/java/itext-1.4.5.jar"/>
-+	<classpathentry kind="lib" path="/usr/share/java/jam.jar"/>
-+	<classpathentry kind="lib" path="/usr/share/java/jdom.jar"/>
-+	<classpathentry kind="lib" path="/usr/share/java/jebl.jar"/>
-+	<classpathentry kind="lib" path="/usr/share/java/JRI.jar"/>
-+	<classpathentry kind="lib" path="/usr/share/java/junit-4.4.jar"/>
-+	<classpathentry kind="lib" path="/usr/share/java/mpj.jar"/>
-+	<classpathentry kind="lib" path="/usr/share/java/mtj.jar"/>
-+	<classpathentry kind="lib" path="/usr/share/java/options.jar"/>
- 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
--	<classpathentry kind="lib" path="lib/commons-math-2.2.jar"/>
-+	<classpathentry kind="lib" path="/usr/share/java/commons-math-2.2.jar"/>
- 	<classpathentry kind="output" path="bin"/>
- </classpath>
- 
diff --git a/debian/patches/fix_encoding.patch b/debian/patches/fix_encoding.patch
deleted file mode 100644
index 3182443..0000000
--- a/debian/patches/fix_encoding.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-Author: Andreas Tille <tille at debian.org>
-Last-Update: Tue, 30 Sep 2014 18:15:36 +0200
-Description: Fix encoding issue
-
---- beast-mcmc-1.8.0.orig/src/dr/app/beauti/siteModelsPanel/PartitionModelPanel.java
-+++ beast-mcmc-1.8.0/src/dr/app/beauti/siteModelsPanel/PartitionModelPanel.java
-@@ -243,7 +243,7 @@
-         PanelUtils.setupComponent(setYang96Button);
-         setYang96Button
-                 .setToolTipText("<html>Sets a 3 codon-position model with independent GTR and Gamma as described in<br>"
--                        + "Yang (1996) <i>J Mol Evol</i> <b>42</b>: 587–596. This model is named 3' in this paper.</html>");
-+                        + "Yang (1996) <i>J Mol Evol</i> <b>42</b>: 587-596. This model is named 3' in this paper.</html>");
- 
-         setSRD06Button = new JButton("Use SRD06 model");
-         setSRD06Button.addActionListener(new ActionListener() {
diff --git a/debian/patches/patch_tex_docs.patch b/debian/patches/patch_tex_docs.patch
deleted file mode 100644
index ee5b738..0000000
--- a/debian/patches/patch_tex_docs.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-Description: Fix some latex error that are preventing proper creation of docs
-Author: Andreas Tille <tille at debian.org>
-Date: Tue, 05 Jun 2012 14:38:11 +0200
-LastUpdated: Mon, 17 Dec 2012 16:43:17 +0100
-
---- beast-mcmc-1.8.0.orig/doc/Yule.tex
-+++ beast-mcmc-1.8.0/doc/Yule.tex
-@@ -35,6 +35,7 @@
- \begin{document}
- 
- \title{\textbf{The Yule model}}
-+\date{22. May, 2007}
- 
- \author{\textsc{Alexei J. Drummond}}
- 
---- beast-mcmc-1.8.0.orig/doc/BookSection/BookSection.tex
-+++ beast-mcmc-1.8.0/doc/BookSection/BookSection.tex
-@@ -1,7 +1,7 @@
- 
- \NeedsTeXFormat{LaTeX2e}[1996/06/01]
- 
--\documentclass[cup7b, english]{cupbook}
-+\documentclass[english]{report}
- 
- 
-  \usepackage{graphicx}
-@@ -32,6 +32,7 @@
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
- 
- \title{The Phylogenetics Handbook}
-+\date{September 14, 2007}
- 
- \makeatother
- \begin{document}
---- beast-mcmc-1.8.0.orig/doc/SerialSampleCoalescent.tex
-+++ beast-mcmc-1.8.0/doc/SerialSampleCoalescent.tex
-@@ -33,7 +33,7 @@
- \begin{document}
- 
- \title{\textbf{The serially-sampled coalescent}}
--
-+\date{July 12, 2007}
- \author{\textsc{Alexei J. Drummond}}
- 
- \maketitle
---- beast-mcmc-1.8.0.orig/doc/BEAST14_Manual.tex
-+++ beast-mcmc-1.8.0/doc/BEAST14_Manual.tex
-@@ -35,7 +35,7 @@
- \begin{document}
- 
- \title{\textbf{A Rough Guide to BEAST 1.4}}
--
-+\date{July 6, 2007}
- 
- \author{\textsc{Alexei J. Drummond}$^{1}$, \textsc{Simon Y.W. Ho},\\
-  \textsc{Nic Rawlence}  and \textsc{Andrew Rambaut}$^{2}$\\
---- beast-mcmc-1.8.0.orig/doc/tutorial/Virus_Practical_1_6_1/Practical_BEAST.tex
-+++ beast-mcmc-1.8.0/doc/tutorial/Virus_Practical_1_6_1/Practical_BEAST.tex
-@@ -789,7 +789,7 @@
- 
- \medskip{}
- 
--\includegraphics[scale=0.4]{figures3/BEAUti_Prior}
-+\includegraphics[scale=0.4]{figures3/BEAUTi_Prior}
- 
- \medskip{}
- 
diff --git a/debian/patches/series b/debian/patches/series
deleted file mode 100644
index c01f0dd..0000000
--- a/debian/patches/series
+++ /dev/null
@@ -1,6 +0,0 @@
-enable_hardening.patch
-fix_classpath_in_build_xml.patch
-patch_tex_docs.patch
-fix_classpath_in_build_tracer_xml.patch
-create_soname.patch
-fix_encoding.patch
diff --git a/debian/rules b/debian/rules
deleted file mode 100755
index 36d010c..0000000
--- a/debian/rules
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/usr/bin/make -f
-# -*- makefile -*-
-# debian/rules file for beast-mcmc
-# Andreas Tille <tille at debian.org>
-# GPL
-
-#export DH_VERBOSE=1
-
-PACKAGE := $(shell dpkg-parsechangelog | sed -n 's/^Source: //p')
-
-JAVA_HOME  := /usr/lib/jvm/default-java
-
-DEBJAR    := /usr/share/java
-CLASS_PATH := /usr/share/ant/lib/ant.jar:/usr/share/ant/lib/ant-launcher.jar:/usr/share/ant/lib/ant-nodeps.jar:/usr/share/ant/lib/ant-junit.jar:$(JAVA_HOME)/lib/tools.jar:$(DEBJAR)/beagle.jar:$(DEBJAR)/mpj.jar:$(DEBJAR)/org.boehn.kmlframework.jar:$(DEBJAR)/itext1-1.4.jar:$(DEBJAR)/junit4.jar:$(DEBJAR)/figtree.jar:lib/colt.jar:$(DEBJAR)/options.jar:$(DEBJAR)/mtj.jar:$(DEBJAR)/jam.jar:$(DEBJAR)/jdom1.jar:$(DEBJAR)/jebl.jar:$(DEBJAR)/commons-math.jar:/usr/lib/R/site-library/rJava/jri/JRI.jar
-
-# to run the test suite
-JAVA       := $(JAVA_HOME)/bin/java
-ANT_HOME   := /usr/share/ant
-ANT_BIN    := $(ANT_HOME)/bin/ant
-ANT_ARGS   := -Dcompile.debug=true -Dcompile.optimize=true
-
-%:
-	dh $@ --with javahelper
-
-override_dh_auto_clean:
-	rm -f native/*\.o native/*\.so native/*\.so\.*
-	for cleantex in \
-		    Practical_BEAST \
-		    BookSection \
-		    Practical_BEAST \
-		    Yule \
-		    SerialSampleCoalescent \
-		    BEAST14_Manual \
-		; do \
-    	    find doc -not -name "*.tex" -a -not -name "*.bib" -and -name "$${cleantex}.*" -exec rm -f \{\} \;  ; \
-    	done
-	ant clean
-
-CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
-LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
-PDFLATEX:=pdflatex -interaction=batchmode
-
-override_dh_auto_build:
-	# CLASSPATH=$(CLASS_PATH)
-	ant build
-	ant -buildfile build_tracer.xml all
-	# native/compileNativeLinux.sh does not create dynamic libraries
-	cd native ; $(MAKE) -f Makefile.linux JAVA_HOME=$(JAVA_HOME)
-#		gcc $(CFLAGS) $(LDFLAGS) -Wall -funroll-loops -ffast-math -fstrict-aliasing -c -I/usr/lib/jvm/default-java/include/ NucleotideLikelihoodCore.c -o libNucleotideLikelihoodCore.o ; \
-#		gcc -shared -Wl,-soname,libNucleotideLikelihoodCore.so.0 -o libNucleotideLikelihoodCore.so.0 libNucleotideLikelihoodCore.o -lc ; \
-#		gcc $(CFLAGS) $(LDFLAGS) -Wall -funroll-loops -ffast-math -fstrict-aliasing -c -I/usr/lib/jvm/default-java/include/ AminoAcidLikelihoodCore.c -o libAminoAcidLikelihoodCore.o ; \
-#		gcc -shared -Wl,-soname,libAminoAcidLikelihoodCore.so.0 -o libAminoAcidLikelihoodCore.so libAminoAcidLikelihoodCore.o -lc
-	#
-	# Build extra LaTeX documentation
-	#
-	cd doc/BookSection; $(PDFLATEX) BookSection.tex; $(PDFLATEX) BookSection.tex
-	cd doc/tutorial/Virus_Practical*; $(PDFLATEX) Practical_BEAST.tex; $(PDFLATEX) Practical_BEAST.tex
-	cd doc; $(PDFLATEX) Yule.tex; $(PDFLATEX) Yule.tex
-	cd doc; $(PDFLATEX) SerialSampleCoalescent.tex; $(PDFLATEX) SerialSampleCoalescent.tex
-	cd doc; $(PDFLATEX) BEAST14_Manual.tex; $(PDFLATEX) BEAST14_Manual.tex
-	#
-	#####################################################################
-	## Run test suite                                                  ##
-	## --------------                                                  ##
-	## While this test suite runs quite a bit of time (about 30min) it ##
-	## is recommended to be run at least once per new version upload   ##
-	#####################################################################
-	#
-	# $(JAVA) -classpath $(CLASS_PATH) -Dant.home=$(ANT_HOME) org.apache.tools.ant.Main $(ANT_ARGS) -buildfile build.xml junit
-
-override_dh_compress:
-	dh_compress --exclude=.pdf
-
-get-orig-source:
-	. debian/get-orig-source
diff --git a/debian/source/format b/debian/source/format
deleted file mode 100644
index 163aaf8..0000000
--- a/debian/source/format
+++ /dev/null
@@ -1 +0,0 @@
-3.0 (quilt)
diff --git a/debian/tests/run-unit-test b/debian/tests/run-unit-test
deleted file mode 100755
index 5d10958..0000000
--- a/debian/tests/run-unit-test
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/bash -e
-pkg=beast-mcmc
-if [ "$ADTTMP" = "" ] ; then
-  ADTTMP=`mktemp -d /tmp/${pkg}-test.XXXXXX`
-fi
-cd $ADTTMP
-
-for file in /usr/share/doc/beast-mcmc/examples/*/*\.xml 
-do 
-  beast-mcmc -overwrite $file 
-done
\ No newline at end of file
diff --git a/debian/tracer b/debian/tracer
deleted file mode 100644
index 32afa6e..0000000
--- a/debian/tracer
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-echo "dr/app/tracer/application/TracerApp is missing in beast.jar - build system needs fixing!"
-exit 1
-
-BEAST_LIB="/usr/share/beast-mcmc"
-DEBJAR="/usr/share/java"
-java -Xms64m -Xmx1024m -Djava.library.path="$BEAST_LIB" \
-  -classpath ${CLASSPATH}:${BEAST_LIB}/beast.jar:${DEBJAR}/jebl.jar:${DEBJAR}/jam.jar:${DEBJAR}/treeview.jar \
-  dr/app/tracer/application/TracerApp $*
-
diff --git a/debian/upstream/metadata b/debian/upstream/metadata
deleted file mode 100644
index 9ce71b4..0000000
--- a/debian/upstream/metadata
+++ /dev/null
@@ -1,12 +0,0 @@
-Reference:
-  Author: Alexei J Drummond and Andrew Rambaut
-  Title: "BEAST: Bayesian evolutionary analysis by sampling trees"
-  Journal: BMC Evol Biol
-  Year: 2007
-  Volume: 8
-  Number: 7
-  Pages: 214
-  DOI: 10.1186/1471-2148-7-214
-  PMID: 17996036
-  URL: http://www.biomedcentral.com/1471-2148/7/214/abstract
-  eprint: http://www.biomedcentral.com/content/pdf/1471-2148-7-214.pdf
diff --git a/debian/watch b/debian/watch
deleted file mode 100644
index 932f324..0000000
--- a/debian/watch
+++ /dev/null
@@ -1,2 +0,0 @@
-version=3
-https://github.com/CompEvol/beast2/releases .*/archive/v(\d[\d.-]+)\.(?:tar(?:\.gz|\.bz2)?|tgz)
diff --git a/doc/slides.pdf b/doc/slides.pdf
new file mode 100644
index 0000000..78f888e
Binary files /dev/null and b/doc/slides.pdf differ
diff --git a/doc/slides/BEAST.png b/doc/slides/BEAST.png
new file mode 100644
index 0000000..d1d2f62
Binary files /dev/null and b/doc/slides/BEAST.png differ
diff --git a/doc/slides/BEAST.xdl b/doc/slides/BEAST.xdl
new file mode 100644
index 0000000..c0035b3
--- /dev/null
+++ b/doc/slides/BEAST.xdl
@@ -0,0 +1,23 @@
+<doc name='not named'>
+<roundrectangle roundx='16' roundy='16' label='Plugin' fillcolor='100 200 200' id='id0' x='-355' y='349' w='123' h='67'/>
+<roundrectangle roundx='16' roundy='16' label='MCMC' fillcolor='200 100 200' id='id1' x='-188' y='222' w='123' h='67'/>
+<roundrectangle roundx='16' roundy='16' label='Data' fillcolor='200 100 200' id='id2' x='4' y='444' w='123' h='67'/>
+<roundrectangle roundx='16' roundy='16' label='State' fillcolor='200 100 200' id='id3' x='6' y='212' w='123' h='67'/>
+<roundrectangle roundx='16' roundy='16' label='Distribution' fillcolor='200 100 200' id='id4' x='7' y='318' w='123' h='67'/>
+<roundrectangle roundx='16' roundy='16' label='Operator' fillcolor='200 100 200' id='id5' x='14' y='102' w='123' h='67'/>
+<roundrectangle roundx='16' roundy='16' label='Input' fillcolor='100 200 200' id='id6' x='-354' y='222' w='123' h='67'/>
+<roundrectangle roundx='16' roundy='16' label='Log' fillcolor='200 100 200' id='id7' x='17' y='-1' w='123' h='67'/>
+<roundrectangle roundx='16' roundy='16' label='Parameter' fillcolor='255 255 153' id='id15' x='169' y='247' w='123' h='29'/>
+<roundrectangle roundx='16' roundy='16' label='Tree' fillcolor='255 255 153' id='id16' x='171' y='204' w='123' h='25'/>
+<arrow headid='id6' tailid='id0' penstyle='null' hashead='0' id='id8' x='-294' y='289' w='1' h='61'/>
+<arrow headid='id2' tailid='id2' penstyle='null' hashead='0' id='id10' x='-400' y='478' w='0' h='0'/>
+<arrow headid='id15' tailid='id3' penstyle='null' hashead='0' id='id17' x='128' y='257' w='41' h='-6'/>
+<arrow headid='id16' tailid='id3' penstyle='null' hashead='0' id='id18' x='128' y='228' w='45' h='8'/>
+<arrow headid='id3' tailid='id1' penstyle='null' hashead='0' id='id19' x='-66' y='249' w='72' h='4'/>
+<arrow headid='id2' tailid='id1' penstyle='null' hashead='0' id='id20' x='-99' y='445' w='136' h='-156'/>
+<arrow headid='id4' tailid='id1' penstyle='null' hashead='0' id='id21' x='-68' y='323' w='76' h='-37'/>
+<arrow headid='id5' tailid='id1' penstyle='null' hashead='0' id='id22' x='-72' y='170' w='91' h='54'/>
+<arrow headid='id7' tailid='id1' penstyle='null' hashead='0' id='id23' x='-97' y='66' w='145' h='157'/>
+<roundrectangle roundx='16' roundy='16' label='Sequence' fillcolor='255 255 153' id='id24' x='162' y='464' w='123' h='27'/>
+<arrow headid='id24' tailid='id2' penstyle='null' hashead='0' id='id25' x='126' y='478' w='36' h='0'/>
+</doc>
\ No newline at end of file
diff --git a/doc/slides/auckland.png b/doc/slides/auckland.png
new file mode 100644
index 0000000..0230f90
Binary files /dev/null and b/doc/slides/auckland.png differ
diff --git a/doc/slides/beast.gif b/doc/slides/beast.gif
new file mode 100644
index 0000000..bc7d3fb
Binary files /dev/null and b/doc/slides/beast.gif differ
diff --git a/doc/slides/beast.jpg b/doc/slides/beast.jpg
new file mode 100644
index 0000000..8beb810
Binary files /dev/null and b/doc/slides/beast.jpg differ
diff --git a/doc/slides/beastdoc.png b/doc/slides/beastdoc.png
new file mode 100644
index 0000000..b065a3b
Binary files /dev/null and b/doc/slides/beastdoc.png differ
diff --git a/doc/slides/beastdoc0.png b/doc/slides/beastdoc0.png
new file mode 100644
index 0000000..db53fc0
Binary files /dev/null and b/doc/slides/beastdoc0.png differ
diff --git a/doc/slides/beastdoc1.png b/doc/slides/beastdoc1.png
new file mode 100644
index 0000000..5e5d267
Binary files /dev/null and b/doc/slides/beastdoc1.png differ
diff --git a/doc/slides/beastdoc2.png b/doc/slides/beastdoc2.png
new file mode 100644
index 0000000..0d068d0
Binary files /dev/null and b/doc/slides/beastdoc2.png differ
diff --git a/doc/slides/beastdoc4.png b/doc/slides/beastdoc4.png
new file mode 100644
index 0000000..0f0e315
Binary files /dev/null and b/doc/slides/beastdoc4.png differ
diff --git a/doc/slides/beauti.png b/doc/slides/beauti.png
new file mode 100644
index 0000000..d865b5e
Binary files /dev/null and b/doc/slides/beauti.png differ
diff --git a/doc/slides/classes1.png b/doc/slides/classes1.png
new file mode 100644
index 0000000..ebec7b9
Binary files /dev/null and b/doc/slides/classes1.png differ
diff --git a/doc/slides/classes10.png b/doc/slides/classes10.png
new file mode 100644
index 0000000..7d3b04a
Binary files /dev/null and b/doc/slides/classes10.png differ
diff --git a/doc/slides/classes11.png b/doc/slides/classes11.png
new file mode 100644
index 0000000..0517dd7
Binary files /dev/null and b/doc/slides/classes11.png differ
diff --git a/doc/slides/classes12.png b/doc/slides/classes12.png
new file mode 100644
index 0000000..f0114cf
Binary files /dev/null and b/doc/slides/classes12.png differ
diff --git a/doc/slides/classes2.png b/doc/slides/classes2.png
new file mode 100644
index 0000000..ad0bc81
Binary files /dev/null and b/doc/slides/classes2.png differ
diff --git a/doc/slides/classes3.png b/doc/slides/classes3.png
new file mode 100644
index 0000000..63409c9
Binary files /dev/null and b/doc/slides/classes3.png differ
diff --git a/doc/slides/classes4.png b/doc/slides/classes4.png
new file mode 100644
index 0000000..f0e1d8d
Binary files /dev/null and b/doc/slides/classes4.png differ
diff --git a/doc/slides/classes5.png b/doc/slides/classes5.png
new file mode 100644
index 0000000..1b21305
Binary files /dev/null and b/doc/slides/classes5.png differ
diff --git a/doc/slides/classes5b.png b/doc/slides/classes5b.png
new file mode 100644
index 0000000..f79df97
Binary files /dev/null and b/doc/slides/classes5b.png differ
diff --git a/doc/slides/classes6.png b/doc/slides/classes6.png
new file mode 100644
index 0000000..a1f2b8f
Binary files /dev/null and b/doc/slides/classes6.png differ
diff --git a/doc/slides/classes7.png b/doc/slides/classes7.png
new file mode 100644
index 0000000..df59bbb
Binary files /dev/null and b/doc/slides/classes7.png differ
diff --git a/doc/slides/classes8.png b/doc/slides/classes8.png
new file mode 100644
index 0000000..dc9ab0a
Binary files /dev/null and b/doc/slides/classes8.png differ
diff --git a/doc/slides/classes9.png b/doc/slides/classes9.png
new file mode 100644
index 0000000..937d4f9
Binary files /dev/null and b/doc/slides/classes9.png differ
diff --git a/doc/slides/cross.png b/doc/slides/cross.png
new file mode 100644
index 0000000..1bf8db1
Binary files /dev/null and b/doc/slides/cross.png differ
diff --git a/doc/slides/example1.png b/doc/slides/example1.png
new file mode 100644
index 0000000..1f62306
Binary files /dev/null and b/doc/slides/example1.png differ
diff --git a/doc/slides/example2.png b/doc/slides/example2.png
new file mode 100644
index 0000000..60e1c8e
Binary files /dev/null and b/doc/slides/example2.png differ
diff --git a/doc/slides/example3.png b/doc/slides/example3.png
new file mode 100644
index 0000000..b9bfcf7
Binary files /dev/null and b/doc/slides/example3.png differ
diff --git a/doc/slides/example4.png b/doc/slides/example4.png
new file mode 100644
index 0000000..5ae249b
Binary files /dev/null and b/doc/slides/example4.png differ
diff --git a/doc/slides/example5.png b/doc/slides/example5.png
new file mode 100644
index 0000000..c623921
Binary files /dev/null and b/doc/slides/example5.png differ
diff --git a/doc/slides/example6.png b/doc/slides/example6.png
new file mode 100644
index 0000000..e50ff2a
Binary files /dev/null and b/doc/slides/example6.png differ
diff --git a/doc/slides/hierarchy1.png b/doc/slides/hierarchy1.png
new file mode 100644
index 0000000..33b45b7
Binary files /dev/null and b/doc/slides/hierarchy1.png differ
diff --git a/doc/slides/hierarchy2.png b/doc/slides/hierarchy2.png
new file mode 100644
index 0000000..985a2ae
Binary files /dev/null and b/doc/slides/hierarchy2.png differ
diff --git a/doc/slides/hierarchy3.png b/doc/slides/hierarchy3.png
new file mode 100644
index 0000000..05b9495
Binary files /dev/null and b/doc/slides/hierarchy3.png differ
diff --git a/doc/slides/hky.png b/doc/slides/hky.png
new file mode 100644
index 0000000..fdbbcc5
Binary files /dev/null and b/doc/slides/hky.png differ
diff --git a/doc/slides/hkymodel.png b/doc/slides/hkymodel.png
new file mode 100644
index 0000000..fe1a92c
Binary files /dev/null and b/doc/slides/hkymodel.png differ
diff --git a/doc/slides/hkymodel2.png b/doc/slides/hkymodel2.png
new file mode 100644
index 0000000..e0ec8fa
Binary files /dev/null and b/doc/slides/hkymodel2.png differ
diff --git a/doc/slides/loggables.png b/doc/slides/loggables.png
new file mode 100644
index 0000000..254c7ab
Binary files /dev/null and b/doc/slides/loggables.png differ
diff --git a/doc/slides/modelbuilder.png b/doc/slides/modelbuilder.png
new file mode 100644
index 0000000..9c7cc98
Binary files /dev/null and b/doc/slides/modelbuilder.png differ
diff --git a/doc/slides/sdk.pdf b/doc/slides/sdk.pdf
new file mode 100644
index 0000000..f7f9f8f
Binary files /dev/null and b/doc/slides/sdk.pdf differ
diff --git a/doc/slides/sdk.tex b/doc/slides/sdk.tex
new file mode 100644
index 0000000..5760af9
--- /dev/null
+++ b/doc/slides/sdk.tex
@@ -0,0 +1,640 @@
+\documentclass{article}
+\usepackage{url}
+\usepackage{pgf}
+\usepackage{listings}
+\setlength{\parindent}{0pt}
+\newtheorem{figcaption}[figure]{Figure}
+
+
+\title{Beast II SDK: version 0.2}
+
+%\subtitle{}
+
+\author{Remco R. Bouckaert\\\url{remco at cs.{auckland|waikato}.ac.nz}\\
+  Department of Computer Science\\
+  University of Auckland \& University of Waikato
+}
+
+\begin{document}
+\maketitle
+\begin{abstract}
+This is a short description of the Beast II Software Development Kit,
+which includes a Java library for building Markov Chain Monte Carlo (MCMC) 
+applications using the Metropolis Hastings method and a library for
+Bayesian analysis of evolutionary problems.
+
+In particular, there is support for efficient updating of models,
+GUIs for building models and support for documentation. Newly written Plugins 
+will be directly available in the GUIs, online help and HTML documentation.
+\end{abstract}
+
+
+\section{Introduction}
+
+Beast II is written in Java, open source and licensed under the Lesser GNU Public License.
+The Beast II SDK can be downloaded from \url{http://code.google.com/p/beast2/downloads/list}
+and the source is available from \url{http://code.google.com/p/beast2/source/checkout}.
+
+Beast II typically runs as a standalone application, started from the command line with
+{\tt java -jar beast.jar} which starts {\tt beast.app.BeastMCMC}.
+An XML file should be specified as command line argument. XML files are used to
+store models and data in a single place. See Section \ref{sec.xml} for details.
+
+To use the SDK, you write Java classes that derive from the {\tt Plugin} class, or derive
+from any of the more specialized classes that derive from {\tt Plugin}. By default,
+the classes are expected to reside in a jar file in the {\tt beastlib} directory
+from where BeastMCMC (or any of the other applications) is started. To specify another
+locations, either set the {\tt beastlib} environment variable to the directory (or
+directories where the various directories are separated by a colon, just like in Java
+class paths) where the jar file should be picked up.
+
+
+\section{Example\label{sec.example}}
+
+%\begin{figure*}[h]
+\includegraphics[width=\textwidth]{example1.png}
+\figcaption{\label{fig.jc}Example of a model specifying Jukes Cantors substriution model (JC).
+It shows Plugins represented by rocket shapes connected to other Plugins through inputs 
+(the thrusters of the rocket).}\rm\\\hskip10pt
+%\end{figure*}
+
+Figure \ref{fig.jc} show (part of) a model, representing an nucleotide sequence analysis 
+using the Jukes Cantor substitution model. The 'rockets' represent plugins, and their
+thrusters the inputs. Models can be build up by connecting plugins through these inputs
+with other plugins. For example, in Figure \ref{fig.jc}, the Tree has an Alignment
+as input, and both Tree and Alignment are inputs to the TreeLikelihood. The TreeLikelihood
+calculates the likelihood of the sequence for a given tree. To do this, the TreeLikelihood
+also needs at least a SiteModel as input, and potentially also a BranchRateModel (not
+necessary in this example). The SiteModel specifies everything related to the transition
+probabilities for a site from one node to another in the Tree, such as the number of
+gamma categories, proportion of invariant sites and substitution model. In Figure \ref{fig.jc},
+Jukes Cantor substitution model is used. In this Section,  we extend this with the 
+HKY substitution model and show how this model interacts with the operators,
+state, loggers and other bits and pieces in the model.
+
+
+%\begin{figure*}[h]
+\includegraphics[width=\textwidth]{example2.png}
+\figcaption{\label{fig.hky}Example of a model specifying a HKY substitution model.}\rm\\\hskip10pt
+%\end{figure*}
+
+To define the HKY substitution model, first we need to find out what its inputs should be.
+The kappa parameter of the HKY model represents a variable that can be estimated.
+Plugins in the calculation model (i.e. the part of the model that performs the posterior
+calculation) are divided in StateNodes and CalculationNodes. StateNodes are classes
+an operator can change, while CalculationNodes are classes that change the internal
+state based on Inputs. 
+The HKY model is a CalculationNode, since it internally stores an eigenvalue 
+matrix that is calculated based on kappa. Kappa can be changed by an operator and does
+not calculate antying itself, so the kappa parameter is a StateNode.
+
+The other bit of information required for the HKY model it the character frequencies.
+These can be calculated from the alignment.%, so Frequencies is a CalculationNode. <- NOT CORRECT
+Compare Figure \ref{fig.hky} with Figure \ref{fig.jc} to see how the HKY model differs
+from the JC model.
+See Section \ref{sec.start} for implementation details for plugin classes like HKY.
+
+
+%\begin{figure*}[h]
+\includegraphics[width=\textwidth]{example3.png}
+\figcaption{\label{fig.hky2}Adding operators.}\rm\\\hskip10pt
+%\end{figure*}
+
+In an MCMC framework, operators propose a move in the state space, and these are
+then accepted or rejected based on how good the moves are and luck. Figure \ref{fig.hky2}
+shows the HKY model extended with seven operators: six for changing the tree and
+one for changing the kappa parameter.
+
+
+%\begin{figure*}[h]
+\includegraphics[width=\textwidth]{example4.png}
+\figcaption{\label{fig.hky3}Adding the state.}\rm\\\hskip10pt
+%\end{figure*}
+
+
+The operators work on the tree and the kappa parameter. Any StateNode that an operator
+can work on must be part of the State. Apart from the State being a collection of
+StateNodes, the State performs introspection on the model and controls the order in
+which Plugins are notified of changes and which of them should store or restore their
+internal state. For example, if an operator changes the Tree, the HKY model does not
+need to be bothered with updating its internal state or storing that internal state
+since it never needs to be restored based on the tree change alone.
+
+%\begin{figure*}[h]
+\includegraphics[width=\textwidth]{example5.png}
+\figcaption{\label{fig.hky4}Adding the loggers.}\rm\\\hskip10pt
+%\end{figure*}
+
+For the MCMC analysis to be any useful, we need to log results. Loggers take care of
+this task. Loggers can log anything that is Loggable, such as parameters and trees,
+but it is easy enough to write a custom logger and add it to the list of inputs of
+a Logger. Typically, one logger logs to standard output, one to a log file with
+parameter values (a tab delimited file that can be analysed with Tracer) and one
+log file with trees in Newick format.
+
+
+%\begin{figure*}[h]
+\includegraphics[width=\textwidth]{example6.png}
+\figcaption{\label{fig.hky5}Adding the sequences. This is a complete model description
+that can be executed in Beast II.}\rm\\\hskip10pt
+%\end{figure*}
+
+
+
+Finally, the alignment consist of a list of sequences. Each sequence object containing
+the actual sequence and taxon information. This completes the model, shown in Figure 
+\ref{fig.hky5} and this model can be executed by Beast II.
+
+
+
+
+
+\section{Getting started\label{sec.start}}
+
+
+\subsection{Beast II Philosophy}
+
+Everything is a plug-in!
+
+Plug-ins provide...
+\begin{itemize}
+\item connection with with other plug-ins/values through 'inputs'
+\item validation
+\item documentation
+\item 'XML parsing'
+\end{itemize}
+
+The task of a Plugin writer is to create classes, specify inputs and provide 
+extra validation that is not already provided by inputs. The following snippet
+shows a very basic example.
+
+{\color{blue}\begin{lstlisting}[language=java]
+ at Description("Description of MyPlugin goes here")
+public class MyPlugin extends Plugin {
+    public Input<Integer> m_value = new Input<Integer>("value",
+        "value used by my plugin");
+
+    public void initAndValidate() throws Exception {
+        // go check stuff and 
+        // do stuff that normally goes in a constructor
+    }
+
+} // class MyPlugin
+\end{lstlisting}}
+
+Firstly, the {\tt Description} annotation is used to provide help, which is used in GUIs
+online help and documentation generation. There is also a {\tt Citation} annotation
+that can be used to list a reference and DOI of a publication that should be
+referenced when using the Plugin.
+
+Secondly, all custom Plugins derive from Plugin or any of derived classes from Plugin.
+By deriving from Plugin,  services through introspection like validation of models are
+provided.
+
+To specify an input for a plugin, just declare an {\tt Input} member. Input is a template
+class, so the type of input can be specified to make sure that when Inputs are connected
+to Plugins the correct type of Plugin is used. At least two strings are used in the 
+constructor of an Input:
+\begin{itemize}
+\item a name of the input, used in the XML, in documentation and in GUIs,
+\item a description of the input, used in documentation and GUI help.
+\end{itemize}
+Other constructors exists to support validation, default values, lists of values,
+enumerations of Strings, etc. See Section \ref{ssec.input} for details.
+
+Finally, there is the {\tt initAndValidate} method. This serves as a place to perform
+validation on the Inputs, for instance range checks or check that dimensions of two
+inputs are compatible. Furthermore, it is a place to perform everything that normally
+goes into a constructor. Plugins are typically created by the XMLParser, which firsts
+sets values for all inputs, then calls initAndValidate.
+
+The following shows the skeleton of a bit larger example:
+
+{\color{blue}\begin{lstlisting}[language=java]
+ at Description("HKY85 (Hasegawa, Kishino & Yano, 1985) "+
+        "substitution model of nucleotide evolution.")
+ at Citation("Hasegawa, M., Kishino, H and Yano, T. 1985. "+
+        "Dating the human-ape splitting by a "+ 
+        "molecular clock of mitochondrial DNA. " +
+        "Journal of Molecular Evolution 22:160-174.")
+public final class HKY extends SubstitutionModel.Base {
+    public Input<RealParameter> kappa = new Input<RealParameter>("kappa", 
+        "kappa parameter in HKY model", Validate.REQUIRED);
+
+    @Override
+    public void initAndValidate() throws Exception {
+    }
+
+    @Override
+    public void getTransitionProbabilities(double distance, double[] matrix) {
+        ...
+    }
+
+    @Override
+    protected boolean requiresRecalculation() {
+        ...
+    }
+
+    @Override
+    protected void store() {
+        ...
+    }
+
+    @Override
+    protected void restore() {
+        ...
+    }
+}
+\end{lstlisting}}
+
+
+
+\subsection{Inputs\label{ssec.input}}
+
+Inputs can be created that are primitives, plugins, lists or enumerations.
+By calling the appropriate constructor, the XMLParser validates the input
+after assigning values and can check whether a REQUIRED input is assigned
+a value, or whether two inputs that are XOR have exactly one input specified.
+
+
+\subsubsection{Input creation}
+Inputs can be simple primitives, like Double, Integer, Boolean, String.
+
+
+{\color{blue}\begin{lstlisting}[language=java]
+public Input<Boolean> m_pScaleAll = 
+    new Input<Boolean>("scaleAll", 
+        "if true, all elements of a parameter (not tree) are scaled, otherwise one is randomly selected",
+        new Boolean(false));
+\end{lstlisting}}
+
+Inputs of a plugin can be other plugins.
+
+{\color{blue}\begin{lstlisting}[language=java]
+public Input<Frequencies> m_freqs = 
+    new Input<Frequencies>("frequencies", 
+        "frequencies nucleotide letters");
+\end{lstlisting}}
+
+Inputs can be multiple inputs. When a list of inputs is specified,
+the Input constructor should contain a (typically empty) List as a start value.
+
+{\color{blue}\begin{lstlisting}[language=java]
+public Input<List<RealParameter>> m_pParameters = 
+    new Input<List<RealParameter>>("parameter", 
+        "parameter, part of the state",
+        new ArrayList<RealParameter>());
+\end{lstlisting}}
+
+Inputs cannot be template classes, so {\tt Input<Parameter<T>>} would lead to
+trouble. This is due to a limitation in Java introspection.
+
+To provide an enumeration as input, the following constructor can be
+used: it takes the usual name and description arguments, then the default
+value and an array of strings to choose from. During validation it is 
+checked that the value assigned is in the list.
+
+{\color{blue}\begin{lstlisting}[language=java]
+	final static String [] UNITS =  {"year", "month", "day"};
+	
+	public Input<String> m_sUnits = new Input<String>("units", 
+            "name of the units in which values are posed, " +
+			"used for conversion to a real value. This can be " + 
+            Arrays.toString(UNITS) + " (default 'year')", 
+            "year", 
+            UNITS);
+\end{lstlisting}}
+
+
+\subsubsection{Input validation}
+
+To provide some basic validation, an extra argument can be provided to the Input constructor.
+By default, inputs are considered to be OPTIONAL, i.e., need not necessarily be specified.
+If input is REQUIRED:
+
+{\color{blue}\begin{lstlisting}[language=java]
+public Input<Parameter> m_kappa = 
+    new Input<Parameter>("kappa", 
+        "kappa parameter in HKY model",
+        Validate.REQUIRED);
+\end{lstlisting}}
+
+If a list of inputs need to have at least one element specified, the required
+argument needs to be provided.
+
+{\color{blue}\begin{lstlisting}[language=java]
+public Input<List<Operator>> m_operators = 
+    new Input<List<Operator>>("operator",
+        "operator for generating proposals in MCMC state space",
+        new ArrayList<Operator>(), Validate.REQUIRED);
+\end{lstlisting}}
+
+Sometimes either one or another input is required, but not bot. In that case
+an input is declared XOR and the {\em other} input is provided as extra argument.
+The XOR goes on the second Input.
+
+{\color{blue}\begin{lstlisting}[language=java]
+public Input<Tree> m_pTree = 
+    new Input<Tree>("tree", 
+        "if specified, all tree branch length are scaled");
+public Input<Parameter> m_pParameter = 
+    new Input<Parameter>("parameter", 
+        "if specified, this parameter is scaled"
+        , Validate.XOR, m_pTree);
+\end{lstlisting}}
+
+
+\subsection{MCMC library\label{ssec.mcmc}}
+
+The basic setup: The {\tt MCMC} algorithm has a {\tt State} object. {\tt Operator} objects do 
+proposals to change the State. A {\tt Distribution} object calculates the posterior of the
+new state, and compares it with the old state's posterior (taking the Hasting ration of the
+{\tt Operator} in account) to decide whether to accept or reject the new state.
+
+Typically, a plugin developer will create new {\tt CalculationNode}s and {\tt Operator}s,
+explained below.
+
+\subsubsection{CalculationNodes\label{ssec.calc}}
+
+A {\tt State} contains {\tt StateNodes}, like {\tt Parameter}s and {\tt Tree}s. The {\tt State}
+is responsible for calling {\tt requiresRecalculation}/{\tt store}/{\tt restore} on calculation nodes. It keeps
+track which part of the State is changed by an Operation, hence which {\tt CalculationNode}s
+may need updating.
+
+For example, suppose a scale operator (called kappScaler) changes the kappa parameter in
+a simple HKY model. Then, frequencies, and the tree are not affected, but the substitution
+model, the site model and the tree likelihood need to be updated.
+
+\includegraphics[width=\textwidth]{hky.png}
+
+After an {\tt Operator} has done a proposal, the {\tt State} calls {\tt store} on all {\tt CalculationNode}s
+that could possibly be affected.
+Then State calls {\tt requiresRecalculation} on each of the 
+{\tt CalculationNode}s between the {\tt StateNode}s that are changed and the {\tt Distribution} of the {\tt MCMC}.
+The {\tt requiresRecalculation} method returns true to indicate whether the CalculationNode
+is changed, hence is 'dirty', due to changes in the State. Also, it is a good place to set
+flags whether parts need to be recalculated, e.g. the EigenDecomposition in the HKY model
+after the kappa parameter is changed.
+Then, the distribution is asked to calculated the log-posterior. If the new state is
+accepted, {\tt accept} is called on all {\tt CalculationNode}s, which by default just marks
+them as 'not dirty'. If rejected, a {\tt restore} is called on all {\tt CalculationNode}s
+and this method can be overridden to 
+
+
+In summary: typically a Plugin developer overrides a {\tt CalculationNode}.
+
+{\tt CalculationNode}s can help increase efficiency by overwriting
+\begin{itemize}
+\item {\tt requiresRecalculation} to set flags to recalculate parts and return
+whether the Plugin is dirty or not.
+\item {\tt store} to store internal states.
+\item {\tt restore} to restore when a new State is not accepted.
+\end{itemize}
+
+\subsubsection{Operators\label{ssec.oper}}
+
+{\tt Operator}s need to have at least one {\tt StateNode} as input.
+{\tt StateNode}s are managed by the {\tt State}, which takes care of synchronization,
+store and restore.
+
+To create a new Operator, implement the {\tt public double proposal()} method, 
+which changes one of more {\tt StateNode}s and returns the Hasting ratio of the proposal.
+
+
+\subsubsection{Loggable\label{ssec.logger}}
+
+To create custom loggers, implement the {\tt Loggable} interface, which has three methods:\\
+o init(), for generating header information and called only at the start of the log,\\
+o exit(), for any closing statements, e.g. 'End;' in a Nexus tree file, and\\
+o log(), for periodically logging relevant information.
+
+
+
+\subsection{Evolution library\label{ssec.evo}}
+
+The Evolution library provides support for calculating posteriors for
+phylogenetic analysis. The classes of interest are
+\begin{itemize}
+\item{\em SubstitutionModel} Specifies transition probability matrix for a given distance.
+\item{\em BranchRateModel} Defines a mean rate for each branch in the beast.tree.
+\item{\em SpeciationLikelihood} A likelihood function for speciation processes.
+\item{\em tree.Node} Nodes in building binary beast.tree data structure.
+\item{\em PopulationFunction} A population size function for the Coalescent.
+\end{itemize}
+
+See javadocs for details.
+
+
+\section{XML format\label{sec.xml}}
+
+The easiest way to create XML for a newly created Plugin is to start the ModelBuilder
+({\tt java -cp beast.jar beast.app.ModelBuilder}), load an existing XML file
+from the example directory and change the Plugins, then save the XML.
+
+The basic XML is very very simple: everything can be specified using
+the {\tt input} element. There are 4 reserved attributes, namely id, idref, 
+name and spec.
+
+\begin{verbatim}<input id='myId'
+     idref='otherId'
+     name='inputName'
+     spec='x.y.z.MyClass'  />
+\end{verbatim}
+
+The id attribute allows elements to be referred to from other elements through
+the idref attribute. The name attribute specified the name of the Input in the
+plugin. The spec attribute specifies the Plugin class. The XML parser creates
+an object of this class, then set the input with name {\tt name} of the Plugin
+specified by the enclosing input element. This way every model can be 
+specified, but it is very tedious format to read. So, there are a lot of 
+short cuts, making the XML more palatable.
+
+A hand crafted XML file can be processed through the XMLParser as follows:
+{\tt java -cp beast.jar beast.util.XMLParser <file.xml>} which then 
+tries to beautify the XML and print it to standard output.
+
+\subsection{Short XML spec}
+The following elements are reserved keywords:
+distribution, operator, logger, data, sequence, state, parameter, tree, and run
+which have default mappings to objects.
+Furthermore, {\tt <plate var='n' range='.p1,.p2,.p3'><parameter idref='hky\$(n)'/></plate>}
+is short for 
+{\tt <parameter idref='hky.p1'/>
+<parameter idref='hky.p2'/>
+<parameter idref='hky.p3'/>}
+and the top level element should have attribute {\tt version='2.0'}
+and can have {\tt namespace='x.y.z:'} which allows {\tt spec}-attributes
+to use {\tt x.y.z} as name space. Finally, {\tt <map name='elementName'>x.y.z.Class</map>}
+maps element {\tt elementName} to spec {\tt x.y.z.Class}.
+
+Common abbreviations:
+
+
+Element name = name attribute.
+
+{\color{blue}\tt <input name='x'>...</input> == <x> ... </x>}
+
+Primitive inputs (Integer, Double, Boolean, String) can go inline.
+
+{\color{blue}\tt <input ...> <input name='xyz' value='1.0'/></input> 
+
+== 
+
+<input ... xyz='1.0'/>}
+
+Any plugin with String constructor, like parameters and tree, can go inline
+
+{\color{blue}\tt <input ...> <xyz spec='IntegerParameter' value='10 20'/></input> 
+
+== 
+
+<input ... xyz='10 20'/>}
+
+Idref inline using @ sign.
+
+{\color{blue}\tt <input ...> <input name='xyz' idref='ref'/></input> 
+
+== 
+
+<input ... xyz='@ref'/>}
+
+
+
+
+
+%\subsection{Resolving name}
+%\subsection{Resolving class}
+%\subsection{Resolving idref}
+%\subsection{Plates}
+
+
+
+
+
+\section{FAQ/Known ways to get into trouble\label{sec.faq}}
+
+\subsection{General programming issues}
+
+\subsubsection{{\tt Input} is not declared public.}
+
+If {\tt Input}s are not public, they cannot get values assigned by for
+instance the {\tt XMLParser}.
+
+\subsubsection{Type of input is a template class (other than {\tt List}).}
+
+Thanks to limitations of Java introspection and the way Beast II is set up, Inputs should be 
+of a type that is concrete, and apart from {\tt List<T>} no template class should be used.
+
+\subsubsection{Store/restore do not call {\tt super.store()}/{\tt super.restore()}.}
+
+Obviously, not calling store/restore on super classes may result in unexpected behavior.
+
+\subsubsection{Input rule of base class is not what you want.}
+
+If an Input is REQUIRED for a base class you want to override, but for the derived
+class this Input should be OPTIONAL, set the Input to OPTIONAL in the constructor.
+E.g. for a SNPSequence that derives from Sequence, but for which m\_sData is optional,
+add a constructor
+
+{\color{blue}\begin{lstlisting}[language=java]
+	public SNPSequence() {
+		m_sData.setRule(Validate.OPTIONAL);
+	}
+\end{lstlisting}}
+Note that the constructor needs to be public, to prevent IllegalAccessExceptions
+on construction by e.g. the XMLParser.
+
+\subsubsection{Log header on screen seems to have rubbish in there.}
+
+Put the logger that outputs to screen (i.e. does not have a filename specified)
+as last in the list of loggers.
+
+\subsection{Setting up}
+
+\subsubsection{Setting up an add-on in Intellij}
+
+This assumes that Beast2 source code is checked out from google code
+using 'svn checkout http://beast2.googlecode.com/svn/trunk/ beast2-read-only' and set up 
+as a project in Intellij, named beast2.
+
+To set up a new Add-on to Beast 2 in Intellij
+
+\begin{itemize}
+\item Create new project
+\item Import Beast 2 as follows:\\
+Choose menu File/New Module\\
+then choose 'Import existing module'\\
+select the button for browsing the file to be imported.\\
+Then go to the Beast 2 source folder where you select Beast2.iml
+file.\\
+Press OK
+\item Add dependency on Beast 2 as follows:\\
+Choose menu File/Project structure.\\
+Select Modules tab\\
+Select your new module\\
+Press Add button, select Module Dependencies\\
+Select the Beast 2 module\\
+Press OK
+\end{itemize}
+
+\subsubsection{Setting up an add-on in Eclipse}
+
+This assumes that Beast2 source code is checked out from google code
+using 'svn checkout http://beast2.googlecode.com/svn/trunk/ beast2-read-only' and set up 
+as a project in Eclipse, named beast2.
+
+To set up a new Add-on to Beast 2 in Eclipse
+
+\begin{itemize}
+\item Import beast2 as a project as follows\\
+Choose File/Import menu\\
+The 'import' dialog pops up. Choose 'General/Existing Projects into Workspace'
+and click 'Next'\\
+The next 'import' dialog pops up. Select Browse button\\
+Select the directory containing beast2 in the file choose dialog, click ok\\
+Click next, and beast2 will be added as a project\\
+\item Create new add-on project as follows\\
+Select File/New/Java Project menu\\
+Fill in project name and click the Next button\\
+A 'New Java Project' dialog pops up, select the 'Projects' tab\\
+Click 'Add' button, and a "Required Project Selection" dialog pops up\\
+Select 'beast2' and click OK\\
+Click 'Finish' and all is done
+\end{itemize}
+
+
+\subsubsection{Set up Hudson for a google-code project add-on}
+
+This assumes that there is a build.xml file based on the
+build file for the beastii add-on. Hudson can be set up for
+a new add-on using the following steps:
+
+1. create new job on Hudson Main Page\\
+fill in job name\\
+select 'Build a free-style software project'\\
+click OK\\
+2. Select sensible directory\\
+Under 'Advanced Project Options' click 'Advanced' button\\
+Click 'Use custom workspace'\\
+In Directory entry that now appears, fill in the project name\\
+3. Under 'Source Code Management', select 'Subversion'\\
+Fill in repository URL, say 'http://myaddon.googlecode.com/svn/trunk'\\
+Put a full stop in 'Local module directory (optional)'\\
+4. set up build triggers\\
+Click 'Build after other projects are built'\\
+Fill in 'BEAST\_2\_Trunk' under 'Projects names'\\
+Click 'Poll SCM'\\
+Fill in '* * * * *' under 'Schedule'\\
+5 Add build step\\
+Click "Add build step" button, select 'Invoke Ant'\\
+Fill in the target, e.g., build\_jar\_all\_BEAST\\
+6 Add Post-build actions\\
+Click 'Publish JUnit test result report'\\
+Fill in 'Test report XMLs' with 'build/junitreport/*.xml'\\
+Click 'E-mail notification'\\
+Fill in recipients\\
+7 Click 'Save'.
+
+\end{document}
+
+
diff --git a/doc/slides/slides.aux b/doc/slides/slides.aux
new file mode 100644
index 0000000..604f839
--- /dev/null
+++ b/doc/slides/slides.aux
@@ -0,0 +1,102 @@
+\relax 
+\ifx\hyper at anchor\@undefined
+\global \let \oldcontentsline\contentsline
+\gdef \contentsline#1#2#3#4{\oldcontentsline{#1}{#2}{#3}}
+\global \let \oldnewlabel\newlabel
+\gdef \newlabel#1#2{\newlabelxx{#1}#2}
+\gdef \newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}}
+\AtEndDocument{\let \contentsline\oldcontentsline
+\let \newlabel\oldnewlabel}
+\else
+\global \let \hyper at last\relax 
+\fi
+
+\@writefile{toc}{\beamer at endinputifotherversion {3.07pt}}
+\@writefile{nav}{\beamer at endinputifotherversion {3.07pt}}
+\select at language{english}
+\@writefile{toc}{\select at language{english}}
+\@writefile{lof}{\select at language{english}}
+\@writefile{lot}{\select at language{english}}
+\@writefile{nav}{\headcommand {\slideentry {0}{0}{1}{1/1}{}{0}}}
+\@writefile{nav}{\headcommand {\beamer at framepages {1}{1}}}
+\@writefile{toc}{\beamer at sectionintoc {1}{Vision}{2}{0}{1}}
+\@writefile{nav}{\headcommand {\sectionentry {1}{Vision}{2}{Vision}{0}}}
+\@writefile{nav}{\headcommand {\beamer at sectionpages {1}{1}}}
+\@writefile{nav}{\headcommand {\beamer at subsectionpages {1}{1}}}
+\@writefile{nav}{\headcommand {\slideentry {1}{0}{2}{2/2}{}{0}}}
+\@writefile{nav}{\headcommand {\beamer at framepages {2}{2}}}
+\@writefile{nav}{\headcommand {\slideentry {1}{0}{3}{3/3}{}{0}}}
+\@writefile{nav}{\headcommand {\beamer at framepages {3}{3}}}
+\@writefile{toc}{\beamer at sectionintoc {2}{Basic design}{4}{0}{2}}
+\@writefile{nav}{\headcommand {\sectionentry {2}{Basic design}{4}{Basic design}{0}}}
+\@writefile{nav}{\headcommand {\beamer at sectionpages {2}{3}}}
+\@writefile{nav}{\headcommand {\beamer at subsectionpages {2}{3}}}
+\@writefile{nav}{\headcommand {\slideentry {2}{0}{4}{4/4}{}{0}}}
+\@writefile{nav}{\headcommand {\beamer at framepages {4}{4}}}
+\@writefile{nav}{\headcommand {\slideentry {2}{0}{5}{5/5}{}{0}}}
+\@writefile{nav}{\headcommand {\beamer at framepages {5}{5}}}
+\@writefile{nav}{\headcommand {\slideentry {2}{0}{6}{6/6}{}{0}}}
+\@writefile{nav}{\headcommand {\beamer at framepages {6}{6}}}
+\@writefile{nav}{\headcommand {\slideentry {2}{0}{7}{7/7}{}{0}}}
+\@writefile{nav}{\headcommand {\beamer at framepages {7}{7}}}
+\@writefile{nav}{\headcommand {\slideentry {2}{0}{8}{8/8}{}{0}}}
+\@writefile{nav}{\headcommand {\beamer at framepages {8}{8}}}
+\@writefile{nav}{\headcommand {\slideentry {2}{0}{9}{9/9}{}{0}}}
+\@writefile{nav}{\headcommand {\beamer at framepages {9}{9}}}
+\@writefile{nav}{\headcommand {\slideentry {2}{0}{10}{10/10}{}{0}}}
+\@writefile{nav}{\headcommand {\beamer at framepages {10}{10}}}
+\@writefile{nav}{\headcommand {\slideentry {2}{0}{11}{11/11}{}{0}}}
+\@writefile{nav}{\headcommand {\beamer at framepages {11}{11}}}
+\@writefile{toc}{\beamer at sectionintoc {3}{XML}{12}{0}{3}}
+\@writefile{nav}{\headcommand {\sectionentry {3}{XML}{12}{XML}{0}}}
+\@writefile{nav}{\headcommand {\beamer at sectionpages {4}{11}}}
+\@writefile{nav}{\headcommand {\beamer at subsectionpages {4}{11}}}
+\@writefile{nav}{\headcommand {\slideentry {3}{0}{12}{12/12}{}{0}}}
+\@writefile{nav}{\headcommand {\beamer at framepages {12}{12}}}
+\@writefile{nav}{\headcommand {\slideentry {3}{0}{13}{13/13}{}{0}}}
+\@writefile{nav}{\headcommand {\beamer at framepages {13}{13}}}
+\@writefile{nav}{\headcommand {\slideentry {3}{0}{14}{14/14}{}{0}}}
+\@writefile{nav}{\headcommand {\beamer at framepages {14}{14}}}
+\@writefile{nav}{\headcommand {\slideentry {3}{0}{15}{15/15}{}{0}}}
+\@writefile{nav}{\headcommand {\beamer at framepages {15}{15}}}
+\@writefile{nav}{\headcommand {\slideentry {3}{0}{16}{16/16}{}{0}}}
+\@writefile{nav}{\headcommand {\beamer at framepages {16}{16}}}
+\@writefile{nav}{\headcommand {\slideentry {3}{0}{17}{17/17}{}{0}}}
+\@writefile{nav}{\headcommand {\beamer at framepages {17}{17}}}
+\@writefile{nav}{\headcommand {\slideentry {3}{0}{18}{18/18}{}{0}}}
+\@writefile{nav}{\headcommand {\beamer at framepages {18}{18}}}
+\@writefile{nav}{\headcommand {\slideentry {3}{0}{19}{19/19}{}{0}}}
+\@writefile{nav}{\headcommand {\beamer at framepages {19}{19}}}
+\@writefile{toc}{\beamer at sectionintoc {4}{Applications}{20}{0}{4}}
+\@writefile{nav}{\headcommand {\sectionentry {4}{Applications}{20}{Applications}{0}}}
+\@writefile{nav}{\headcommand {\beamer at sectionpages {12}{19}}}
+\@writefile{nav}{\headcommand {\beamer at subsectionpages {12}{19}}}
+\@writefile{nav}{\headcommand {\slideentry {4}{0}{20}{20/20}{}{0}}}
+\@writefile{nav}{\headcommand {\beamer at framepages {20}{20}}}
+\@writefile{nav}{\headcommand {\slideentry {4}{0}{21}{21/21}{}{0}}}
+\@writefile{nav}{\headcommand {\beamer at framepages {21}{21}}}
+\@writefile{nav}{\headcommand {\slideentry {4}{0}{22}{22/22}{}{0}}}
+\@writefile{nav}{\headcommand {\beamer at framepages {22}{22}}}
+\@writefile{nav}{\headcommand {\slideentry {4}{0}{23}{23/23}{}{0}}}
+\@writefile{nav}{\headcommand {\beamer at framepages {23}{23}}}
+\@writefile{nav}{\headcommand {\slideentry {4}{0}{24}{24/24}{}{0}}}
+\@writefile{nav}{\headcommand {\beamer at framepages {24}{24}}}
+\@writefile{nav}{\headcommand {\slideentry {4}{0}{25}{25/25}{}{0}}}
+\@writefile{nav}{\headcommand {\beamer at framepages {25}{25}}}
+\@writefile{nav}{\headcommand {\slideentry {4}{0}{26}{26/26}{}{0}}}
+\@writefile{nav}{\headcommand {\beamer at framepages {26}{26}}}
+\@writefile{nav}{\headcommand {\slideentry {4}{0}{27}{27/27}{}{0}}}
+\@writefile{nav}{\headcommand {\beamer at framepages {27}{27}}}
+\@writefile{nav}{\headcommand {\slideentry {4}{0}{28}{28/28}{}{0}}}
+\@writefile{nav}{\headcommand {\beamer at framepages {28}{28}}}
+\@writefile{toc}{\beamer at sectionintoc {5}{Summary}{29}{0}{5}}
+\@writefile{nav}{\headcommand {\sectionentry {5}{Summary}{29}{Summary}{0}}}
+\@writefile{nav}{\headcommand {\beamer at sectionpages {20}{28}}}
+\@writefile{nav}{\headcommand {\beamer at subsectionpages {20}{28}}}
+\@writefile{nav}{\headcommand {\slideentry {5}{0}{29}{29/29}{}{0}}}
+\@writefile{nav}{\headcommand {\beamer at framepages {29}{29}}}
+\@writefile{nav}{\headcommand {\beamer at partpages {1}{29}}}
+\@writefile{nav}{\headcommand {\beamer at subsectionpages {29}{29}}}
+\@writefile{nav}{\headcommand {\beamer at sectionpages {29}{29}}}
+\@writefile{nav}{\headcommand {\beamer at documentpages {29}}}
+\@writefile{nav}{\headcommand {\def \inserttotalframenumber {29}}}
diff --git a/doc/slides/slides.nav b/doc/slides/slides.nav
new file mode 100644
index 0000000..b2ed3ee
--- /dev/null
+++ b/doc/slides/slides.nav
@@ -0,0 +1,79 @@
+\beamer at endinputifotherversion {3.07pt}
+\headcommand {\slideentry {0}{0}{1}{1/1}{}{0}}
+\headcommand {\beamer at framepages {1}{1}}
+\headcommand {\sectionentry {1}{Vision}{2}{Vision}{0}}
+\headcommand {\beamer at sectionpages {1}{1}}
+\headcommand {\beamer at subsectionpages {1}{1}}
+\headcommand {\slideentry {1}{0}{2}{2/2}{}{0}}
+\headcommand {\beamer at framepages {2}{2}}
+\headcommand {\slideentry {1}{0}{3}{3/3}{}{0}}
+\headcommand {\beamer at framepages {3}{3}}
+\headcommand {\sectionentry {2}{Basic design}{4}{Basic design}{0}}
+\headcommand {\beamer at sectionpages {2}{3}}
+\headcommand {\beamer at subsectionpages {2}{3}}
+\headcommand {\slideentry {2}{0}{4}{4/4}{}{0}}
+\headcommand {\beamer at framepages {4}{4}}
+\headcommand {\slideentry {2}{0}{5}{5/5}{}{0}}
+\headcommand {\beamer at framepages {5}{5}}
+\headcommand {\slideentry {2}{0}{6}{6/6}{}{0}}
+\headcommand {\beamer at framepages {6}{6}}
+\headcommand {\slideentry {2}{0}{7}{7/7}{}{0}}
+\headcommand {\beamer at framepages {7}{7}}
+\headcommand {\slideentry {2}{0}{8}{8/8}{}{0}}
+\headcommand {\beamer at framepages {8}{8}}
+\headcommand {\slideentry {2}{0}{9}{9/9}{}{0}}
+\headcommand {\beamer at framepages {9}{9}}
+\headcommand {\slideentry {2}{0}{10}{10/10}{}{0}}
+\headcommand {\beamer at framepages {10}{10}}
+\headcommand {\slideentry {2}{0}{11}{11/11}{}{0}}
+\headcommand {\beamer at framepages {11}{11}}
+\headcommand {\sectionentry {3}{XML}{12}{XML}{0}}
+\headcommand {\beamer at sectionpages {4}{11}}
+\headcommand {\beamer at subsectionpages {4}{11}}
+\headcommand {\slideentry {3}{0}{12}{12/12}{}{0}}
+\headcommand {\beamer at framepages {12}{12}}
+\headcommand {\slideentry {3}{0}{13}{13/13}{}{0}}
+\headcommand {\beamer at framepages {13}{13}}
+\headcommand {\slideentry {3}{0}{14}{14/14}{}{0}}
+\headcommand {\beamer at framepages {14}{14}}
+\headcommand {\slideentry {3}{0}{15}{15/15}{}{0}}
+\headcommand {\beamer at framepages {15}{15}}
+\headcommand {\slideentry {3}{0}{16}{16/16}{}{0}}
+\headcommand {\beamer at framepages {16}{16}}
+\headcommand {\slideentry {3}{0}{17}{17/17}{}{0}}
+\headcommand {\beamer at framepages {17}{17}}
+\headcommand {\slideentry {3}{0}{18}{18/18}{}{0}}
+\headcommand {\beamer at framepages {18}{18}}
+\headcommand {\slideentry {3}{0}{19}{19/19}{}{0}}
+\headcommand {\beamer at framepages {19}{19}}
+\headcommand {\sectionentry {4}{Applications}{20}{Applications}{0}}
+\headcommand {\beamer at sectionpages {12}{19}}
+\headcommand {\beamer at subsectionpages {12}{19}}
+\headcommand {\slideentry {4}{0}{20}{20/20}{}{0}}
+\headcommand {\beamer at framepages {20}{20}}
+\headcommand {\slideentry {4}{0}{21}{21/21}{}{0}}
+\headcommand {\beamer at framepages {21}{21}}
+\headcommand {\slideentry {4}{0}{22}{22/22}{}{0}}
+\headcommand {\beamer at framepages {22}{22}}
+\headcommand {\slideentry {4}{0}{23}{23/23}{}{0}}
+\headcommand {\beamer at framepages {23}{23}}
+\headcommand {\slideentry {4}{0}{24}{24/24}{}{0}}
+\headcommand {\beamer at framepages {24}{24}}
+\headcommand {\slideentry {4}{0}{25}{25/25}{}{0}}
+\headcommand {\beamer at framepages {25}{25}}
+\headcommand {\slideentry {4}{0}{26}{26/26}{}{0}}
+\headcommand {\beamer at framepages {26}{26}}
+\headcommand {\slideentry {4}{0}{27}{27/27}{}{0}}
+\headcommand {\beamer at framepages {27}{27}}
+\headcommand {\slideentry {4}{0}{28}{28/28}{}{0}}
+\headcommand {\beamer at framepages {28}{28}}
+\headcommand {\sectionentry {5}{Summary}{29}{Summary}{0}}
+\headcommand {\beamer at sectionpages {20}{28}}
+\headcommand {\beamer at subsectionpages {20}{28}}
+\headcommand {\slideentry {5}{0}{29}{29/29}{}{0}}
+\headcommand {\beamer at framepages {29}{29}}
+\headcommand {\beamer at partpages {1}{29}}
+\headcommand {\beamer at subsectionpages {29}{29}}
+\headcommand {\beamer at sectionpages {29}{29}}
+\headcommand {\beamer at documentpages {29}}
+\headcommand {\def \inserttotalframenumber {29}}
diff --git a/doc/slides/slides.out b/doc/slides/slides.out
new file mode 100644
index 0000000..9e990f9
--- /dev/null
+++ b/doc/slides/slides.out
@@ -0,0 +1,5 @@
+\BOOKMARK [2][]{Outline0.1}{Vision}{}
+\BOOKMARK [2][]{Outline0.2}{Basic design}{}
+\BOOKMARK [2][]{Outline0.3}{XML}{}
+\BOOKMARK [2][]{Outline0.4}{Applications}{}
+\BOOKMARK [2][]{Outline0.5}{Summary}{}
diff --git a/doc/slides/slides.snm b/doc/slides/slides.snm
new file mode 100644
index 0000000..e69de29
diff --git a/doc/slides/slides.tex b/doc/slides/slides.tex
new file mode 100644
index 0000000..312d07d
--- /dev/null
+++ b/doc/slides/slides.tex
@@ -0,0 +1,788 @@
+\nonstopmode
+\documentclass{beamer}
+\usepackage{listings}
+\usepackage{fancyvrb}
+
+\usepackage{pgf}
+\usepackage[english]{babel}
+\usepackage[latin1]{inputenc}
+\usepackage{times}
+\mode<article>
+{
+  \usepackage{times}
+  \usepackage{mathptmx}
+  \usepackage[left=1.5cm,right=6cm,top=1.5cm,bottom=3cm]{geometry}
+}
+
+\usepackage{hyperref}
+\usepackage[T1]{fontenc}
+\usepackage{tikz}
+\usepackage{colortbl}
+%\usepackage{yfonts}
+%\usepackage{colortbl}
+%\usepackage{translator} % comment this, if not available
+
+
+% Common settings for all lectures in this course
+
+\def\lecturename{A Proposal for BEAST 2.0}
+
+\title{\insertlecture}
+
+\author{Till Tantau}
+
+\institute
+{
+  Institut für Theoretische Informatik\\
+  Universität zu Lübeck
+}
+
+\subject{Vorlesung \lecturename}
+
+
+
+
+% Beamer version theme settings
+
+\useoutertheme[height=0pt,width=2cm,right]{sidebar}
+\usecolortheme{rose,sidebartab}
+\useinnertheme{circles}
+\usefonttheme[only large]{structurebold}
+
+\setbeamercolor{sidebar right}{bg=black!15}
+\setbeamercolor{structure}{fg=blue}
+\setbeamercolor{author}{parent=structure}
+
+\setbeamerfont{title}{series=\normalfont,size=\LARGE}
+\setbeamerfont{title in sidebar}{series=\bfseries}
+\setbeamerfont{author in sidebar}{series=\bfseries}
+\setbeamerfont*{item}{series=}
+\setbeamerfont{frametitle}{size=}
+\setbeamerfont{block title}{size=\small}
+\setbeamerfont{subtitle}{size=\normalsize,series=\normalfont}
+
+\setbeamertemplate{navigation symbols}{}
+\setbeamertemplate{bibliography item}[book]
+\setbeamertemplate{sidebar right}
+{
+  {\usebeamerfont{title in sidebar}%
+    \vskip1.5em%
+    \hskip3pt%
+    \usebeamercolor[fg]{title in sidebar}%
+    \insertshorttitle[width=2cm,center,respectlinebreaks]\par%
+    \vskip1.25em%
+  }%
+  {%
+    \hskip3pt%
+    \usebeamercolor[fg]{author in sidebar}%
+    \usebeamerfont{author in sidebar}%
+    \insertshortauthor[width=2cm,center,respectlinebreaks]\par%
+    \vskip1.25em%
+  }%
+  \hbox to2cm{\hss\insertlogo\hss}
+  \vskip1.25em%
+  \insertverticalnavigation{2cm}%
+  \vfill
+  \hbox to 2cm{\hfill\usebeamerfont{subsection in
+      sidebar}\strut\usebeamercolor[fg]{subsection in
+      sidebar}%\insertshortlecture.
+      \insertframenumber\hskip5pt}%
+  \vskip3pt%
+}%
+
+\setbeamertemplate{title page}
+{
+  \vbox{}
+  \vskip1em
+ % {\huge \insertshortlecture\par}
+  {\usebeamercolor[fg]{title}\usebeamerfont{title}\inserttitle\par}%
+  \ifx\insertsubtitle\@empty%
+  \else%
+    \vskip0.25em%
+    {\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle\par}%
+  \fi%     
+  \vskip1em\par
+  %Vorlesung \emph{\lecturename}\ vom \insertdate\par
+  \vskip0pt plus1filll
+  \leftskip=0pt plus1fill\insertauthor\par
+  \insertinstitute\vskip1em
+}
+
+\logo{\includegraphics[width=1cm]{auckland.png}}
+
+
+
+% Article version layout settings
+
+\mode<article>
+
+\makeatletter
+\def\@listI{\leftmargin\leftmargini
+  \parsep 0pt
+  \topsep 5\p@   \@plus3\p@ \@minus5\p@
+  \itemsep0pt}
+\let\@listi=\@listI
+
+
+\setbeamertemplate{frametitle}{\paragraph*{\insertframetitle\
+    \ \small\insertframesubtitle}\ \par
+}
+\setbeamertemplate{frame end}{%
+  \marginpar{\scriptsize\hbox to 1cm{\sffamily%
+      \hfill\strut%\insertshortlecture.
+    \insertframenumber}\hrule height .2pt}}
+\setlength{\marginparwidth}{1cm}
+\setlength{\marginparsep}{4.5cm}
+
+
+
+
+\let\origstartsection=\@startsection
+\def\@startsection#1#2#3#4#5#6{%
+  \origstartsection{#1}{#2}{#3}{#4}{#5}{#6\normalfont\sffamily\color{blue!50!black}\selectfont}}
+
+\makeatother
+
+\mode
+<all>
+
+
+
+
+% Typesetting Listings
+
+\usepackage{listings}
+\lstset{language=Java}
+
+\alt<presentation>
+{\lstset{%
+  basicstyle=\footnotesize\ttfamily,
+  commentstyle=\slshape\color{blue!50!black},
+  keywordstyle=\bfseries\color{blue!50!black},
+  identifierstyle=\color{blue},
+  stringstyle=\color{orange},
+  escapechar=\#,
+  emphstyle=\color{red}}
+}
+{
+  \lstset{%
+    basicstyle=\ttfamily,
+    keywordstyle=\bfseries,
+    commentstyle=\itshape,
+    escapechar=\#,
+    emphstyle=\bfseries\color{red}
+  }
+}
+
+
+
+% Common theorem-like environments
+
+\theoremstyle{definition}
+\newtheorem{exercise}[theorem]{\translate{Exercise}}
+
+
+
+
+% New useful definitions:
+
+\newbox\mytempbox
+\newdimen\mytempdimen
+
+\newcommand\includegraphicscopyright[3][]{%
+  \leavevmode\vbox{\vskip3pt\raggedright\setbox\mytempbox=\hbox{\includegraphics[#1]{#2}}%
+    \mytempdimen=\wd\mytempbox\box\mytempbox\par\vskip1pt%
+    \fontsize{3}{3.5}\selectfont{\color{black!25}{\vbox{\hsize=\mytempdimen#3}}}\vskip3pt%
+}}
+
+\newenvironment{colortabular}[1]{\medskip\rowcolors[]{1}{blue!20}{blue!10}\tabular{#1}\rowcolor{blue!40}}{\endtabular\medskip}
+
+\def\equad{\leavevmode\hbox{}\quad}
+
+\newenvironment{bluecolortabular}[1]
+{\medskip\rowcolors[]{1}{blue!50!black!20}{blue!50!black!10}%
+  \tabular{#1}\rowcolor{blue!50!black!40}}%
+{\endtabular\medskip}
+
+
+%\mode<presentation>
+%{
+%  \usetheme{PaloAlto}
+%  \usetheme{Bergen}
+  %\usetheme{Berkeley}
+  %\setbeamercovered{transparent}
+%}
+
+
+\usepackage[english]{babel}
+\usepackage[latin1]{inputenc}
+\usepackage{times}
+\usepackage[T1]{fontenc}
+
+\title[Beast 2.0]
+{A Proposal for Beast 2.0}
+
+%\subtitle{}
+
+\author[Bouckaert] 
+{Remco R. Bouckaert\\\url{remco at cs.{auckland|waikato}.ac.nz}}
+
+\institute[University of Auckland|Waikato]
+{Department of Computer Science\\
+  University of Auckland \& University of Waikato
+}
+\date[] % (optional)
+{}
+
+\subject{A Proposal for Beast 2.0}
+
+
+% If you wish to uncover everything in a step-wise fashion, uncomment
+% the following command: 
+
+%\beamerdefaultoverlayspecification{<+->}
+
+
+\begin{document}
+
+\begin{frame}
+  \titlepage
+\end{frame}
+
+
+\section{Vision}
+\begin{frame}{Vision}
+To provide tools for computational science that are
+\begin{itemize}
+\item
+{\em easy to use}, that is, well documented, have intuitive user interfaces with small learning curve.
+\item
+{\em open access}, that is, open source, open xml format, facilitating reproducability of results, runs
+on many platforms.
+\item
+{\em easy to extend}, by having extensibility in design.
+\end{itemize}
+\vskip1cm
+{\bf\large\color{blue} Scope}
+\vskip0.5cm
+Efficient testing of probabilistic hypotheses for sequence data analysis involving tree models.
+
+\end{frame}
+
+\begin{frame}{Vision}
+To provide tools for computational science that are
+\begin{itemize}
+\item
+{\em easy to use}, that is, {\color{red} well documented}, have intuitive user interfaces with small learning curve.
+\item
+{\em open access}, that is, open source, open xml format, facilitating reproducability of results, runs
+on many platforms.
+\item
+{\em {\color{red} easy to extend}}, by having extensibility in design.
+\end{itemize}
+\vskip1cm
+{\bf\large\color{blue} Scope}
+\vskip0.5cm
+{\color{orange} Efficient} testing of probabilistic hypotheses for sequence data analysis involving tree models.
+
+\end{frame}
+
+
+\section{Basic design}
+
+\begin{frame}{Core}
+\includegraphics[width=\textwidth]{BEAST.png}
+\end{frame}
+
+\begin{frame}[containsverbatim]
+{\Large Phylosophy}
+
+Everything is a plug-in
+\vskip0.5cm
+\includegraphics[width=\textwidth]{hkymodel.png}
+
+Plug-ins provide...
+\begin{itemize}
+\item connection with with other plug-ins/values through 'inputs'
+\item validation
+\item documentation
+\item 'XML parsing'
+\end{itemize}
+\end{frame}
+
+\begin{frame}[containsverbatim]
+{\Large Plugin class}
+
+\begin{lstlisting}[language=java]
+ at Description("Description goes here")
+public class Plugin {
+    public void initAndValidate(State state)
+
+    public String getCitations()
+
+    public String getID()
+    public void setID(String sID)
+
+    public void store(int nSample)
+    public void restore(int nSample)
+} // class Plugin
+\end{lstlisting}
+
+\end{frame}
+\begin{frame}[containsverbatim]
+{\large HKY Plugin}
+
+{
+%\lstset{basicstyle=\small}
+\tiny
+\begin{lstlisting}[language=java]
+ at Description("HKY85 (Hasegawa, Kishino & Yano, 1985) substitution model of nucleotide evolution.")
+public class HKY extends 'Plugin' {
+    public Input<Frequencies> m_freqs = new Input<Frequencies>("frequencies", "frequencies nucleotide letters");
+    public Input<Parameter> m_kappa = new Input<Parameter>("kappa", "kappa parameter in HKY model", Validate.REQUIRED);
+
+    @Override public void initAndValidate(State state) throws Exception {
+        initialiseEigen();        
+    }
+
+    public void getTransitionProbabilities(double distance, double[] matrix, State state) {
+        ...
+    }
+    @Override public void store(int nSample) {}
+    @Override public void restore(int nSample) {
+        updateMatrix = true;
+        updateIntermediates = true;
+    }
+    @Override public String getCitation() {
+        return "Hasegawa, M., Kishino, H and Yano, T. 1985. Dating the human-ape splitting by a molecular clock of mitochondrial DNA. Journal of Molecular Evolution 22:160-174.";
+    }
+} // class HKY
+\end{lstlisting}
+}
+\end{frame}
+
+\begin{frame}[containsverbatim]
+{\Large Inputs}
+\pgfputat{\pgfxy(5,-1)}{\pgfbox[left,base]{\pgfimage[width=5cm]{hkymodel.png}}}
+Simple primitives
+
+\begin{lstlisting}[language=java]
+public Input<Boolean> m_pScaleAll = 
+    new Input<Boolean>("scaleAll", 
+        "if true, all elements of a parameter (not tree) are scaled, otherwise one is randomly selected",
+        new Boolean(false));
+\end{lstlisting}
+
+Other plugins
+
+\begin{lstlisting}[language=java]
+public Input<Frequencies> m_freqs = 
+    new Input<Frequencies>("frequencies", 
+        "frequencies nucleotide letters");
+\end{lstlisting}
+
+Multiple inputs
+
+\begin{lstlisting}[language=java]
+public Input<List<Parameter>> m_pParameters = 
+    new Input<List<Parameter>>("parameter", 
+        "parameter, part of the state",
+        new ArrayList<Parameter>());
+\end{lstlisting}
+\end{frame}
+
+\begin{frame}[containsverbatim]
+{\Large Input validation}
+
+Default: OPTIONAL (see previous slide)
+\vskip0.2cm
+If input is REQUIRED:
+
+\begin{lstlisting}[language=java]
+public Input<Parameter> m_kappa = 
+    new Input<Parameter>("kappa", 
+        "kappa parameter in HKY model",
+        Validate.REQUIRED);
+\end{lstlisting}
+
+\begin{lstlisting}[language=java]
+public Input<List<Operator>> m_operators = 
+    new Input<List<Operator>>("operator",
+        "operator for generating proposals in MCMC state space",
+        new ArrayList<Operator>(), Validate.REQUIRED);
+\end{lstlisting}
+
+If input is XOR:
+
+\begin{lstlisting}[language=java]
+public Input<Tree> m_pTree = 
+    new Input<Tree>("tree", 
+        "if specified, all tree branch length are scaled");
+public Input<Parameter> m_pParameter = 
+    new Input<Parameter>("parameter", 
+        "if specified, this parameter is scaled"
+        , Validate.XOR, m_pTree);
+\end{lstlisting}
+
+\end{frame}
+
+
+\begin{frame}[containsverbatim]
+{\Large State}
+\begin{itemize}
+\item State is explicit in XML \& as object (unlike Beast 1)
+\item Contains parameters and trees
+\item Operators work on the state
+\begin{lstlisting}[language=java]
+public double proposal(State state) throws Exception {...}
+\end{lstlisting}
+\item Uncertainty calculated given state
+\begin{lstlisting}[language=java]
+public double calculateLogP(State state) throws Exception {...}
+\end{lstlisting}
+\item State can be interrogated on value of parameters/trees
+\begin{lstlisting}[language=java]
+state.getParameter(/**Parameter**/ p)
+state.getTree(/**Tree**/ t)
+\end{lstlisting}
+\end{itemize}
+\end{frame}
+
+\begin{frame}[containsverbatim]
+{\Large Store/Restore}
+
+BEAST 1: push model
+\begin{itemize}
+\item Model
+\item Event handling
+\item Framework and plug-ins responsible
+\item Elegant, undocumented, requires lots of Panadol
+\end{itemize}
+
+BEAST 2: pull model
+\begin{itemize}
+\item store/restore 
+\item sample number provided to prevent multiple (re)stores
+\item MCMC only tells its 'uncertainties' to store/restore, plug-ins responsible
+\end{itemize}
+\end{frame}
+
+
+
+\section{XML}
+
+\begin{frame}{XML}
+\includegraphics[width=1.25\textwidth]{xml3.png}
+\end{frame}
+\begin{frame}[containsverbatim]
+XML parsing/writing provided by the framework
+{\Large XML}
+Reserved elements
+\pgfputat{\pgfxy(1.5,-4)}{\pgfbox[left,base]{\pgfimage[width=5cm]{BEAST.png}}}
+\begin{Verbatim}[commandchars=\\\{\}]
+\textcolor{blue}{\bf <mcmc}\textcolor{blue}{\bf >}
+\textcolor{blue}{\bf <uncertainty}\textcolor{blue}{\bf >}
+\textcolor{blue}{\bf <operator}\textcolor{blue}{\bf >}
+\textcolor{blue}{\bf <log}\textcolor{blue}{\bf >}
+\textcolor{blue}{\bf <data}\textcolor{blue}{\bf >}
+\textcolor{blue}{\bf <sequence}\textcolor{blue}{\bf >}
+\textcolor{blue}{\bf <state}\textcolor{blue}{\bf >}
+\textcolor{blue}{\bf <parameter}\textcolor{blue}{\bf >}
+\textcolor{blue}{\bf <tree}\textcolor{blue}{\bf >}
+
+\textcolor{blue}{\bf <beast} \textcolor{purple}{version=}\textcolor{black}{'2.0'} \textcolor{purple}{namespace=}\textcolor{black}{'x.y.z:'}\textcolor{blue}{\bf >}
+\textcolor{blue}{\bf <map} \textcolor{purple}{name=}\textcolor{black}{'elementName'}\textcolor{blue}{\bf >}x.y.z.Class\textcolor{blue}{\bf </map>}
+\end{Verbatim}
+\end{frame}
+
+\begin{frame}{XML}
+\includegraphics[width=1.25\textwidth]{xml1.png}
+\end{frame}
+\begin{frame}{XML}
+\includegraphics[width=1.25\textwidth]{xml2.png}
+\end{frame}
+
+
+\begin{frame}[containsverbatim]
+{\Large XML}
+Reserved attributes:
+\begin{Verbatim}[commandchars=\\\{\}]
+\textcolor{blue}{\bf  <input} \textcolor{purple}{id=}\textcolor{black}{'myId'} 
+     \textcolor{purple}{idref=}\textcolor{black}{'otherId'} 
+     \textcolor{purple}{name=}\textcolor{black}{'inputName'} 
+     \textcolor{purple}{spec=}\textcolor{black}{'x.y.z.MyClass'}\textcolor{blue}{\bf  />}
+\end{Verbatim}
+\vskip0.5cm
+Resolving plug-in class:
+\begin{itemize}
+\item specified in spec attribute
+\item if not, get from element2class map
+\item if not, use element name (and hope it shows up in the namespace somewhere).
+\end{itemize}
+\end{frame}
+
+
+\begin{frame}[containsverbatim]
+{\Large XML}
+Resolving input name:
+\begin{itemize}
+\item specified in name attribute
+\begin{lstlisting}[language=java]
+    <input name="xyz" >
+\end{lstlisting}
+\item if not, use (non-reserved) attribute name
+\begin{lstlisting}[language=java]
+    <input xyz="3" >
+\end{lstlisting}
+\item if not, use element name
+\begin{lstlisting}[language=java]
+    <xyz value="3" >
+\end{lstlisting}
+\item if input, use 'value' when there is text content, but no element content
+\begin{lstlisting}[language=java]
+    <input>3</input>
+\end{lstlisting}
+\end{itemize}
+\end{frame}
+
+
+\begin{frame}[containsverbatim]
+{\Large XML}
+Resolving input value:
+\begin{itemize}
+\item if idref is specified, use the referred object
+\begin{lstlisting}[language=java]
+    <input idref="other" >
+\end{lstlisting}
+\item specified in value attribute
+\begin{lstlisting}[language=java]
+    <xyz value="3" >
+\end{lstlisting}
+\item if not, use value of (non-reserved) attribute
+\begin{lstlisting}[language=java]
+    <input xyz="3" >
+\end{lstlisting}
+\item if not, use text content when there is text content, but no element content
+\begin{lstlisting}[language=java]
+    <input>3</input>
+\end{lstlisting}
+\end{itemize}
+\end{frame}
+
+
+\begin{frame}[containsverbatim]
+{\Large XML}
+Parsing rules:
+Processing non reserved attributes
+\begin{Verbatim}[commandchars=\\\{\}]
+\textcolor{blue}{\bf  <input} \textcolor{purple}{otherAttribute=}\textcolor{black}{"xyz"}\textcolor{blue}{\bf  />}
+\end{Verbatim}
+equals
+\begin{Verbatim}[commandchars=\\\{\}]
+\textcolor{blue}{\bf  <input}\textcolor{blue}{\bf  >}
+  \textcolor{blue}{\bf  <input} \textcolor{purple}{name=}\textcolor{black}{'otherAttribute'} \textcolor{purple}{value=}\textcolor{black}{'xyz'}\textcolor{blue}{\bf  />}
+\textcolor{blue}{\bf  </input>}
+\end{Verbatim}
+
+Processing non reserved element names
+\begin{Verbatim}[commandchars=\\\{\}]
+\textcolor{blue}{\bf  <myElement}\textcolor{blue}{\bf  />}
+\end{Verbatim}
+==
+\begin{Verbatim}[commandchars=\\\{\}]
+\textcolor{blue}{\bf  <input} \textcolor{purple}{spec=}\textcolor{black}{'myElement'} \textcolor{purple}{name=}\textcolor{black}{'myElement'}\textcolor{blue}{\bf  />}
+\end{Verbatim}
+unless 'spec' is a specified attribute, then that overrides, likewise for 'name' 
+%\end{frame}
+
+
+%\begin{frame}[containsverbatim]
+%{\Large XML}
+Processing of text content (only when there are no enclosing elements)
+\begin{Verbatim}[commandchars=\\\{\}]
+\textcolor{blue}{\bf  <input} \textcolor{purple}{name=}\textcolor{black}{'data'}\textcolor{blue}{\bf  >}xyz\textcolor{blue}{\bf  </input>}
+\end{Verbatim}
+==
+\begin{Verbatim}[commandchars=\\\{\}]
+\textcolor{blue}{\bf  <input} \textcolor{purple}{name=}\textcolor{black}{'data'} \textcolor{purple}{value=}\textcolor{black}{'xyz'/}\textcolor{blue}{\bf  >}
+\end{Verbatim}
+\end{frame}
+
+
+\section{Applications}
+
+
+\begin{frame}{Model builder}
+\includegraphics[width=\textwidth]{hkymodel2.png}
+\end{frame}
+
+
+\begin{frame}{Documentation}
+XML documentation provided through
+
+\begin{itemize}
+\item @Description annotation on plug in
+\item Tooltip text on inputs
+\item getCitation method
+\item Input validation rules
+\end{itemize}
+
+\includegraphics[width=\textwidth]{beastdoc0.png}
+
+\end{frame}
+
+\begin{frame}{Documentation}
+\includegraphics[width=\textwidth]{beastdoc1.png}
+\end{frame}
+\begin{frame}{Documentation}
+\includegraphics[width=\textwidth]{beastdoc2.png}
+\end{frame}
+\begin{frame}{Documentation}
+\includegraphics[width=\textwidth]{beastdoc4.png}
+\end{frame}
+
+
+\begin{frame}[containsverbatim]
+{\Large BEAST 2.0}
+
+\begin{lstlisting}[language=java]
+~> java -cp bin app.BeastMCMC
+
+Usage: BeastMCMC [options] <Beast.xml>
+where <Beast.xml> the name of a file specifying a Beast run
+and the following options are allowed:
+-seed <int> : sets random number seed (default 127)
+-threads <int> : sets number of threads (default 1)
+\end{lstlisting}
+
+\end{frame}
+
+\begin{frame}[containsverbatim]
+{\Large BEAST 2.0}
+HKY + nucleotide data, 'random' initial tree
+
+2000 samples in debug mode, scaling if required, auto optimise on, same logging, operators. etc.
+
+testMCMC.xml -- great apes
+
+\begin{verbatim}
+6 taxa 
+768 sites
+69 patterns
+10M samples  single thread
+        Beast 1.6/java  Beast1.6/native Beast 2.0
+real    3m55.056s       3m38.670s       2m31.794s
+user    3m54.839s       3m38.670s       2m32.162s
+sys     0m0.392s        0m0.428s        0m0.476s
+\end{verbatim}
+\end{frame}
+
+
+\begin{frame}[containsverbatim]
+{\Large BEAST 2.0}
+testMCMC.xml -- 
+
+\begin{verbatim}
+46 taxa
+1363 sites
+199 patterns
+500K samples 
+
+Beast1.6/native core
+real   1m56.097s
+user   1m58.683s
+sys    0m0.332s
+
+Beast 2.0 + auto
+real   0m56.843s
+user   0m59.264s
+sys    0m0.428s
+\end{verbatim}
+\end{frame}
+
+\begin{frame}[containsverbatim]
+{\Large BEAST 2.0}
+testMCMC.xml -- 
+
+\pgfputat{\pgfxy(5,-6.5)}{\pgfbox[left,base]{\pgfimage[width=5cm]{speedup.png}}}
+\begin{verbatim}
+191 taxa
+606 sites
+228 patterns
+100K samples
+
+Beast1.6/native
+real   8m32.418s
+user   8m33.060s
+sys    0m0.476s
+
+Beast 2.0
+real   0m43.962s
+user   0m46.051s
+sys    0m0.432s
+\end{verbatim}
+%\includegraphics[width=\textwidth]{speedup.png}
+\end{frame}
+
+
+\section{Summary}
+\begin{frame}{Summary Beast 2.0}
+
+Extensibility
+\begin{itemize}
+\item Everything is a plug-in
+\item Plug-in implementation:
+\begin{itemize}
+\item Add @Description annotation
+\item Specify Inputs
+\item Implement initAndValidate
+\item Optional: getCitation, store, restore
+\end{itemize}
+\item Get xml-parsing, Input validation, xml-documentation for free
+\item Store/restore more transparent
+\item Explicit state object
+\end{itemize}
+
+Documentation
+\begin{itemize}
+\item Framework 'forces' proper documentation habits
+\item Automatic documentation generation
+\end{itemize}
+
+Performance
+\begin{itemize}
+\item Up to 1 order of magnitude better performance
+\end{itemize}
+\end{frame}
+
+\if0
+\section{Other}
+\begin{frame}{Mercator Projections}
+\includegraphics[width=\textwidth]{mercator/mercator.png}
+\end{frame}
+\begin{frame}{Mercator Projections}
+\includegraphics[width=\textwidth]{mercator/mercatornz.png}
+\end{frame}
+\begin{frame}{Mercator Projections}
+\includegraphics[width=\textwidth]{mercator/mercatorla.png}
+\end{frame}
+\begin{frame}{Mercator Projections}
+\includegraphics[width=\textwidth]{mercator/mercatoreur.png}
+\end{frame}
+\begin{frame}{Mercator Projections}
+\includegraphics[width=\textwidth]{mercator/mercatorchin.png}
+\end{frame}
+\begin{frame}{Mercator Projections}
+\includegraphics[width=\textwidth]{mercator/mercatornz.png}
+\end{frame}
+\begin{frame}{Mercator Projections}
+\includegraphics[width=\textwidth]{mercator/mercatornz2.png}
+\end{frame}
+\begin{frame}{Mercator Projections}
+\includegraphics[width=\textwidth]{mercator/mercatornz3.png}
+\end{frame}
+\fi
+\end{document}
+
+
+
diff --git a/doc/slides/slides.toc b/doc/slides/slides.toc
new file mode 100644
index 0000000..53aa3ff
--- /dev/null
+++ b/doc/slides/slides.toc
@@ -0,0 +1,7 @@
+\beamer at endinputifotherversion {3.07pt}
+\select at language {english}
+\beamer at sectionintoc {1}{Vision}{2}{0}{1}
+\beamer at sectionintoc {2}{Basic design}{4}{0}{2}
+\beamer at sectionintoc {3}{XML}{12}{0}{3}
+\beamer at sectionintoc {4}{Applications}{20}{0}{4}
+\beamer at sectionintoc {5}{Summary}{29}{0}{5}
diff --git a/doc/slides/slides101.tex b/doc/slides/slides101.tex
new file mode 100755
index 0000000..3f78ccb
--- /dev/null
+++ b/doc/slides/slides101.tex
@@ -0,0 +1,1925 @@
+\nonstopmode
+\documentclass{beamer}
+\def\part{1}
+\usepackage{listings}
+\usepackage{fancyvrb}
+
+\usepackage{pgf}
+\usepackage[english]{babel}
+\usepackage[latin1]{inputenc}
+\usepackage{times}
+\mode<article>
+{
+  \usepackage{times}
+  \usepackage{mathptmx}
+  \usepackage[left=1.5cm,right=6cm,top=1.5cm,bottom=3cm]{geometry}
+}
+
+\usepackage{hyperref}
+\usepackage[T1]{fontenc}
+\usepackage{tikz}
+\usepackage{colortbl}
+%\usepackage{yfonts}
+%\usepackage{colortbl}
+%\usepackage{translator} % comment this, if not available
+
+
+% Common settings for all lectures in this course
+
+\def\lecturename{BEAST II 101}
+
+\title{\insertlecture}
+
+\author{Remco Bouckaert}
+
+\institute
+{
+  Auckland University\\
+  New Zealand
+}
+
+\subject{Vorlesung \lecturename}
+
+
+
+
+% Beamer version theme settings
+
+\useoutertheme[height=0pt,width=2cm,right]{sidebar}
+\usecolortheme{rose,sidebartab}
+\useinnertheme{circles}
+\usefonttheme[only large]{structurebold}
+
+\setbeamercolor{sidebar right}{bg=black!15}
+\setbeamercolor{structure}{fg=blue}
+\setbeamercolor{author}{parent=structure}
+
+\setbeamerfont{title}{series=\normalfont,size=\LARGE}
+\setbeamerfont{title in sidebar}{series=\bfseries}
+\setbeamerfont{author in sidebar}{series=\bfseries}
+\setbeamerfont*{item}{series=}
+\setbeamerfont{frametitle}{size=}
+\setbeamerfont{block title}{size=\small}
+\setbeamerfont{subtitle}{size=\normalsize,series=\normalfont}
+
+\setbeamertemplate{navigation symbols}{}
+\setbeamertemplate{bibliography item}[book]
+\setbeamertemplate{sidebar right}
+{
+  {\usebeamerfont{title in sidebar}%
+    \vskip1.5em%
+    \hskip3pt%
+    \usebeamercolor[fg]{title in sidebar}%
+    \insertshorttitle[width=2cm,center,respectlinebreaks]\par%
+    \vskip1.25em%
+  }%
+  {%
+    \hskip3pt%
+    \usebeamercolor[fg]{author in sidebar}%
+    \usebeamerfont{author in sidebar}%
+    \insertshortauthor[width=2cm,center,respectlinebreaks]\par%
+    \vskip1.25em%
+  }%
+  \hbox to2cm{\hss\insertlogo\hss}
+  \vskip1.25em%
+  \insertverticalnavigation{2cm}%
+  \vfill
+  \hbox to 2cm{\hfill\usebeamerfont{subsection in
+      sidebar}\strut\usebeamercolor[fg]{subsection in
+      sidebar}%\insertshortlecture.
+      \insertframenumber\hskip5pt}%
+  \vskip3pt%
+}%
+
+\setbeamertemplate{title page}
+{
+  \vbox{}
+  \vskip1em
+ % {\huge \insertshortlecture\par}
+  {\usebeamercolor[fg]{title}\usebeamerfont{title}\inserttitle\par}%
+  \ifx\insertsubtitle\@empty%
+  \else%
+    \vskip0.25em%
+    {\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle\par}%
+  \fi%     
+  \vskip1em\par
+  %Vorlesung \emph{\lecturename}\ vom \insertdate\par
+  \vskip0pt plus1filll
+  \leftskip=0pt plus1fill\insertauthor\par
+  \insertinstitute\vskip1em
+}
+
+\logo{\includegraphics[width=1cm]{auckland.png}}
+
+
+
+% Article version layout settings
+
+\mode<article>
+
+\makeatletter
+\def\@listI{\leftmargin\leftmargini
+  \parsep 0pt
+  \topsep 5\p@   \@plus3\p@ \@minus5\p@
+  \itemsep0pt}
+\let\@listi=\@listI
+
+
+\setbeamertemplate{frametitle}{\paragraph*{\insertframetitle\
+    \ \small\insertframesubtitle}\ \par
+}
+\setbeamertemplate{frame end}{%
+  \marginpar{\scriptsize\hbox to 1cm{\sffamily%
+      \hfill\strut%\insertshortlecture.
+    \insertframenumber}\hrule height .2pt}}
+\setlength{\marginparwidth}{1cm}
+\setlength{\marginparsep}{4.5cm}
+
+
+
+
+\let\origstartsection=\@startsection
+\def\@startsection#1#2#3#4#5#6{%
+  \origstartsection{#1}{#2}{#3}{#4}{#5}{#6\normalfont\sffamily\color{blue!50!black}\selectfont}}
+
+\makeatother
+
+\mode
+<all>
+
+
+
+
+% Typesetting Listings
+
+\usepackage{listings}
+\lstset{language=Java,XML}
+
+\alt<presentation>
+{\lstset{%
+%  basicstyle=\footnotesize\ttfamily,
+  basicstyle=\scriptsize\ttfamily,
+  commentstyle=\slshape\color{blue!50!black},
+  keywordstyle=\bfseries\color{blue!50!black},
+  identifierstyle=\color{blue},
+  stringstyle=\color{orange},
+  escapechar=\#,
+  emphstyle=\color{red}}
+}
+{
+  \lstset{%
+    basicstyle=\ttfamily,
+    keywordstyle=\bfseries,
+    commentstyle=\itshape,
+    escapechar=\#,
+    emphstyle=\bfseries\color{red}
+  }
+}
+
+
+
+% Common theorem-like environments
+
+\theoremstyle{definition}
+\newtheorem{exercise}[theorem]{\translate{Exercise}}
+
+
+
+
+% New useful definitions:
+
+\newbox\mytempbox
+\newdimen\mytempdimen
+
+\newcommand\includegraphicscopyright[3][]{%
+  \leavevmode\vbox{\vskip3pt\raggedright\setbox\mytempbox=\hbox{\includegraphics[#1]{#2}}%
+    \mytempdimen=\wd\mytempbox\box\mytempbox\par\vskip1pt%
+    \fontsize{3}{3.5}\selectfont{\color{black!25}{\vbox{\hsize=\mytempdimen#3}}}\vskip3pt%
+}}
+
+\newenvironment{colortabular}[1]{\medskip\rowcolors[]{1}{blue!20}{blue!10}\tabular{#1}\rowcolor{blue!40}}{\endtabular\medskip}
+
+\def\equad{\leavevmode\hbox{}\quad}
+
+\newenvironment{bluecolortabular}[1]
+{\medskip\rowcolors[]{1}{blue!50!black!20}{blue!50!black!10}%
+  \tabular{#1}\rowcolor{blue!50!black!40}}%
+{\endtabular\medskip}
+
+
+%\mode<presentation>
+%{
+%  \usetheme{PaloAlto}
+%  \usetheme{Bergen}
+  %\usetheme{Berkeley}
+  %\setbeamercovered{transparent}
+%}
+
+
+\usepackage[english]{babel}
+\usepackage[latin1]{inputenc}
+\usepackage{times}
+\usepackage[T1]{fontenc}
+
+
+
+
+
+
+
+\if \part 1
+\title[Beast II 101]{Beast II 101: Part 1\\ \includegraphics{../../src/beast/app/draw/icons/beast.png}}
+\fi
+\if \part 2
+\title[Beast II 101]{Beast II 101: Part 2\\ \includegraphics[width=0.75\textwidth]{walk.jpg}}
+\fi
+\if \part 3
+\title[Beast II 101]{Beast II 101: Part 3\\ \includegraphics{../../src/beast/app/draw/icons/beast.png}}
+\fi
+
+%\subtitle{}
+
+\author[Bouckaert] 
+{Remco R. Bouckaert\\\url{remco at cs.{auckland|waikato}.ac.nz}}
+
+\institute[University of Auckland|Waikato]
+{Department of Computer Science\\
+  University of Auckland \& University of Waikato
+}
+\date[] % (optional)
+{}
+
+\subject{Beast II 101}
+
+
+% If you wish to uncover everything in a step-wise fashion, uncomment
+% the following command: 
+
+%\beamerdefaultoverlayspecification{<+->}
+
+
+\begin{document}
+\begin{frame}
+  \titlepage
+
+
+
+
+%done: likelihood should check alignment, check frequencies
+%done: validate tree in likelihood covers all taxa
+%done: getters and setters
+%done: fix BeagleTest
+%done: fix random branch rate model
+%
+%done: test all taxa in alignment are unique
+%done: test all taxa in tree are unique
+%done: taxon id -> name (beware impact on BEAUti)
+%done: ambiguous characters + custom data types 
+%done: sync SNAP
+%done: robustify StateNodes
+%done: set up beastii
+%done: check validation rules on all inputs
+%done: ambiguous in TreeLikelihood
+%done: clean up likelihood files
+%TODO: port more substitution models
+%TODO: write test cases
+%TODO: add-on distribution mechanism
+%TODO: finish BEAUti
+\end{frame}
+
+\if \part 1
+
+
+\section{BEAST 2 basics}
+
+
+\begin{frame}{Jukes Cantor}
+\includegraphics[width=\textwidth]{example1.png}
+
+All objects are Plugins - connected to each other through Inputs
+\end{frame}
+\begin{frame}{HKY}
+\includegraphics[width=\textwidth]{example2.png}
+
+Adding kappa parameter and frequencies
+\end{frame}
+\begin{frame}{Adding operators}
+\includegraphics[width=\textwidth]{example3.png}
+
+Operate on kappa parameter and tree
+\end{frame}
+\begin{frame}{Adding State}
+\includegraphics[width=\textwidth]{example4.png}
+
+The state contains every Plugin that operators work on
+\end{frame}
+\begin{frame}{Adding Loggers}
+\includegraphics[width=\textwidth]{example5.png}
+
+3 loggers: screen, trace and trees
+\end{frame}
+\begin{frame}{Adding Sequences}
+\includegraphics[width=\textwidth]{example6.png}
+
+Inputs to alignments, which takes care of the patterns, DataType and set of Taxon names
+\end{frame}
+
+
+\begin{frame}{What BEAST 2 does}
+...supposed to do...
+
+\begin{itemize}
+\item The kind of Bayesian analysis as per citations on the BEAST 1 wiki.
+\item BEAUti 2: GUI to specify analysis.
+\item Provide a platform to develop add-ons - powerful interface, easy extensible XML, templates for BEAUti.
+\item Sequence generator for simulation studies.
+\item Documentation for all the above -- from user to developer, XML tweaker, etc.
+\end{itemize}
+
+\end{frame}
+
+\begin{frame}{What BEAST 2 doesn't}
+\begin{itemize}
+\item Post-analysis processing like Tracer, tree annotator, tree log analyser, DensiTree, KML producer
+\item Most non-Bayesian analysis
+\item Laundry
+\end{itemize}
+
+\end{frame}
+
+
+\subsection{Plugins}
+
+\begin{frame}[containsverbatim]
+{Phylosophy}
+
+Everything is a plug-in
+\vskip0.5cm
+\includegraphics[width=\textwidth]{hkymodel.png}
+
+Plug-ins provide...
+\begin{itemize}
+\item connection with with other plug-ins/values through 'inputs'
+\item validation
+\item documentation
+\item 'XML parsing'
+\end{itemize}
+\end{frame}
+
+\begin{frame}[containsverbatim]
+{Plugin class}
+
+\begin{lstlisting}[language=java]
+ at Description("Description goes here")
+public class Plugin {
+    public void initAndValidate()
+
+    public String getDescription()
+    public String getCitations()
+
+    public String getID()
+    public void setID(String sID)
+
+} // class Plugin
+\end{lstlisting}
+
+\end{frame}
+
+\begin{frame}[containsverbatim]
+{A minimal plugin}
+
+{\color{blue}\begin{lstlisting}[language=java]
+ at Description("Description of MyPlugin goes here")
+public class MyPlugin extends Plugin {
+    public Input<Integer> value = new Input<Integer>("value",
+        "value used by my plugin");
+
+    public void initAndValidate() throws Exception {
+        // go check stuff and 
+        // do stuff that normally goes in a constructor
+    }
+
+} // class MyPlugin
+\end{lstlisting}}
+\end{frame}
+
+
+\begin{frame}[containsverbatim]
+{HKY Plugin}
+
+{
+%\lstset{basicstyle=\small}
+\tiny
+\begin{lstlisting}[language=java]
+ at Description("HKY85 (Hasegawa, Kishino & Yano, 1985) substitution model of nucleotide evolution.")
+ at Citation("Hasegawa, M., Kishino, H and Yano, T. 1985. Dating the human-ape splitting by a molecular clock of mitochondrial DNA. " +
+        "Journal of Molecular Evolution 22:160-174.")
+public class HKY extends 'Plugin' {
+    public Input<Frequencies> freqs = new Input<Frequencies>("frequencies", "frequencies nucleotide letters");
+    public Input<Parameter> kappa = new Input<Parameter>("kappa", "kappa parameter in HKY model", Validate.REQUIRED);
+
+    @Override public void initAndValidate() throws Exception {
+        initialiseEigen();        
+    }
+
+     public void getTransitionProbabilities(Node node, 
+      		double fStartTime, 
+		double fEndTime, 
+		double fRate, 
+		double[] matrix) {...}
+ 
+    @Override
+    protected boolean requiresRecalculation() {...}
+
+    @Override public void store() {...}
+    @Override public void restore() {... }
+} // class HKY
+\end{lstlisting}
+}
+\end{frame}
+
+\subsection{Inputs}
+
+\begin{frame}[containsverbatim]
+{Inputs}
+\pgfputat{\pgfxy(5,-1)}{\pgfbox[left,base]{\pgfimage[width=5cm]{hkymodel.png}}}
+Simple primitives
+
+\begin{lstlisting}[language=java]
+public Input<Boolean> scaleAll = 
+    new Input<Boolean>("scaleAll", 
+        "if true, all elements of a parameter are scaled, otherwise one is randomly selected");
+\end{lstlisting}
+
+Other plugins
+
+\begin{lstlisting}[language=java]
+public Input<Frequencies> freqs = 
+    new Input<Frequencies>("frequencies", 
+        "frequencies of nucleotide letters");
+\end{lstlisting}
+
+Multiple inputs
+
+\begin{lstlisting}[language=java]
+public Input<List<Parameter>> parameters = 
+    new Input<List<Parameter>>("parameter", 
+        "parameter, part of the state",
+        new ArrayList<Parameter>());
+\end{lstlisting}
+\end{frame}
+
+\begin{frame}[containsverbatim]
+{Inputs}
+
+Enumerations
+
+\begin{lstlisting}[language=java]
+final static String [] UNITS =  {"year", "month", "day"};
+
+public Input<String> units = new Input<String>("units", 
+        "name of the units in which values are posed, " +
+		"used for conversion to a real value. This can be " + 
+        Arrays.toString(UNITS) + " (default 'year')", 
+        "year", 
+        UNITS);
+\end{lstlisting}
+\end{frame}
+
+\begin{frame}[containsverbatim]
+{Input validation}
+
+Default: OPTIONAL (see previous slide)
+\vskip0.2cm
+If input is REQUIRED:
+
+\begin{lstlisting}[language=java]
+public Input<Parameter> kappa = 
+    new Input<Parameter>("kappa", 
+        "kappa parameter in HKY model",
+        Validate.REQUIRED);
+\end{lstlisting}
+
+\begin{lstlisting}[language=java]
+public Input<List<Operator>> operators = 
+    new Input<List<Operator>>("operator",
+        "operator for generating proposals in MCMC state space",
+        new ArrayList<Operator>(), Validate.REQUIRED);
+\end{lstlisting}
+
+If input is XOR:
+
+\begin{lstlisting}[language=java]
+public Input<Tree> tree = 
+    new Input<Tree>("tree", 
+        "if specified, all tree branch length are scaled");
+public Input<Parameter> parameter = 
+    new Input<Parameter>("parameter", 
+        "if specified, this parameter is scaled"
+        , Validate.XOR, tree);
+\end{lstlisting}
+
+\end{frame}
+
+
+\section{MCMC library}
+
+
+\begin{frame}[containsverbatim]
+{State}
+\begin{itemize}
+\item State is explicit in XML \& as object (unlike BEAST 1)
+\item Contains StateNodes, e.g., parameters and trees
+\item Operators work on the StateNodes
+\begin{lstlisting}[language=java]
+public double proposal() throws Exception {...}
+\end{lstlisting}
+%\item Log probability calculated given state
+%\begin{lstlisting}[language=java]
+%public double calculateLogP() throws Exception {...}
+%\end{lstlisting}
+%\item State can be interrogated on value of parameters/trees
+%\begin{lstlisting}[language=java]
+%state.getParameter(/**Parameter**/ p)
+%state.getTree(/**Tree**/ t)
+%\end{lstlisting}
+\item State can be stored to disk/restored
+\item State can store/restore itself for MCMC proposals
+\end{itemize}
+\end{frame}
+
+
+\begin{frame}{MCMC Library}
+
+StateNode vs CalculationNode
+
+\includegraphics[width=\textwidth]{hky.png}
+
+\end{frame}
+
+
+\begin{frame}[containsverbatim]{Plugin hierarchy}
+\includegraphics{hierarchy1.png}
+Just parameters and trees
+\end{frame}
+
+\begin{frame}[containsverbatim]{StateNode hierarchy}
+\includegraphics[width=\textwidth]{hierarchy3.png}
+\end{frame}
+
+\begin{frame}[containsverbatim]{CalculationNode hierarchy}
+\includegraphics[width=0.5\textwidth]{hierarchy2.png}
+\end{frame}
+
+
+\subsection{Loop}
+
+\begin{frame}
+{MCMC loop 
+\only<2>{effect on\\ state nodes}
+\only<3>{effect on\\ calculation nodes}
+\only<4>{\\CalculationNode method calls}}
+\pgfputat{\pgfxy(6,-1)}{\pgfbox[left,base]{\pgfimage[width=6cm]{hky.png}}}
+
+\begin{itemize}
+\item[] \only<2-4>{\color{green}Store state}
+\item[] \color{black}Propose new state
+\item[] \only<3-4>{\color{blue}store calculation nodes} \only<4>{\color{red} store()}
+\item[] \only<3-4>{\color{blue}check dirtyness} \only<3>{calculation nodes} \only<4>{\color{red} requiresRecalculation()}
+\item[] \color{black}logP = calculateLogP();
+\item[] \color{black}if (new state is acceptable) 
+\item[] \mbox{\hskip1cm}\only<1>{// do something}\only<2-4>{\color{green}accept state} 
+\item[] \only<3-4>{\mbox{\hskip1cm}\color{blue}mark calculation nodes clean} \only<4>{\color{red} accept()}
+\item[] \color{black}else
+\item[] \mbox{\hskip1cm}\only<1>{// do something else}\only<2-4>{\color{green}restore state}
+\item[] \only<3-4>{\mbox{\hskip1cm}\color{blue}restore calculation nodes} \only<4>{\color{red} restore()}
+\item[] \only<2-4>{\color{green}mark state clean}
+\end{itemize}
+\end{frame}
+
+\subsection{Classes}
+
+\begin{frame}{BEAST class structure}
+\includegraphics[width=0.7\textwidth]{classes1.png}
+
+beast - main beast classes
+
+beagle and apache libraries
+
+test - for junit tests
+
+\end{frame}
+
+\begin{frame}{BEAST core class structure}
+\includegraphics[width=0.7\textwidth]{classes2.png}
+
+app - applications like BeastMCMC, BEAUti, SequenceGenerator
+
+core, evolution - MCMC and evolution libraries
+
+math - mathematical classes
+
+util - utilities like parsers, XML producers, random nr generator, class discovery.
+
+\end{frame}
+
+\begin{frame}{BEAST core class structure}
+\includegraphics[width=\textwidth]{classes3.png}
+\end{frame}
+
+\begin{frame}{BEAST core class structure}
+\includegraphics[width=\textwidth]{classes4.png}
+\end{frame}
+
+
+\section{Evolution library}
+
+\begin{frame}[containsverbatim]{Evolution packages}
+\includegraphics[width=\textwidth]{classes5b.png}
+
+Important classes you might want to derive from: SubstitutionModel, Operator, 
+BranchRateModel, Coalescent, SpeciationLikelihood, (DataType, Alignment,
+SiteModel).
+\end{frame}
+
+\begin{frame}[containsverbatim]{Evolution - alignment classes}
+\includegraphics[width=\textwidth]{classes6.png}
+\end{frame}
+
+\begin{frame}[containsverbatim]{Evolution - branch rate model classes}
+\includegraphics{classes7.png}
+\end{frame}
+
+\begin{frame}[containsverbatim]{Evolution - data type classes}
+\includegraphics[width=\textwidth]{classes8.png}
+\end{frame}
+
+\begin{frame}[containsverbatim]{Evolution - operator classes}
+\includegraphics[width=\textwidth]{classes9.png}
+\end{frame}
+
+
+\begin{frame}[containsverbatim]{Evolution - site model classes}
+\includegraphics{classes10.png}
+\end{frame}
+
+\begin{frame}[containsverbatim]{Evolution - speciation classes}
+\includegraphics{classes11.png}
+\end{frame}
+
+\begin{frame}[containsverbatim]{Utility classes}
+\includegraphics[width=\textwidth]{classes12.png}
+\end{frame}
+
+
+
+
+\section{Design patterns}
+
+\begin{frame}[containsverbatim]{Variable naming}
+
+{\small In case you wondered where those funny names came from...}\vskip0.5cm
+
+Variable name format: {\tt$<$scope$> <$type$> <$name$>$}
+
+scope 
+\begin{itemize}
+\item {\tt m\_} prefix for member variables
+\item {\tt g\_} globals = static member variables
+\item none otherwise
+\end{itemize}
+
+type
+\begin{itemize}
+\item {\tt s} string
+\item {\tt f} floating point number (double or float)
+\item {\tt n} number
+\item {\tt i} indicator
+\item {\tt b} boolean
+\item {\tt p} pointer to object
+\end{itemize}
+
+
+\end{frame}
+
+\begin{frame}[containsverbatim]{Basic plugin layout}
+
+\begin{lstlisting}[language=java]
+ at Description("Some sensible description of the Plugin")
+public class MyPlugin extends Plugin {
+    <!-- inputs first -->
+    public Input<RealParamater> p = new Input<>...;
+
+    <!-- members next -->
+    private Object o;
+
+    <!-- initAndValidate -->
+    @Override
+    public void initAndValidate() {...}
+
+    <!-- class specific methods -->
+
+    <!-- Overriding methods -->
+}
+\end{lstlisting}
+
+\end{frame}
+
+
+\begin{frame}[containsverbatim]{Accessing inputs {\em for reading, not writing!}}
+
+Let there be an input:
+
+\begin{lstlisting}[language=java]
+public Input<RealParamater> p = new Input<>...;
+\end{lstlisting}\vskip0.5cm
+
+To get the parameter of input {\tt m\_p}, use\\ {\tt m\_p.get()}.\vskip0.5cm
+
+To get the value of the parameter, use {\tt m\_p.get().getValue()}.\vskip0.5cm
+
+Alternatively 
+
+\begin{lstlisting}[language=java]
+    RealParamater p = pInput.get();
+    double fValue = p.getValue();
+\end{lstlisting}
+
+\end{frame}
+
+\begin{frame}[containsverbatim]{requiresRecalculation()}
+
+\begin{lstlisting}[language=java]
+public boolean requiresRecalculation() {
+	// for StateNode inputs only
+	if (stateNodeInput.get().somethingIsDirty()) {
+		return true;
+	}
+
+	// for CalculationNode inputs only
+        if (calculationNodeInput.get().isDirtyCalculation()) {
+		return true;
+	}
+	return false;
+}
+\end{lstlisting}
+
+\end{frame}
+
+
+\begin{frame}[containsverbatim]{Lean CalculationNode}
+
+
+\begin{lstlisting}[language=java]
+boolean needsUpdate; // flag to indicate internal state is up to date
+public void initAndValidate() {needsUpdate = true;}
+// CalculationNode specific interface that returns results
+public Object calculateSomeThing() {
+	if (needsUpdate) {
+		update();
+	}
+	return someThing;
+}
+void update() {
+	someThing = ...;
+	needsUpdate = false;
+}
+public boolean requiresRecalculation() {
+	if (someInputIsDirty()) {
+		needsUpdate = true;
+		return true;
+	}
+	return false;
+}
+public void store() {super.store();}
+public void restore() {
+	needsUpdate = true;
+	super.restore();
+}
+\end{lstlisting}
+\end{frame}
+
+\begin{frame}[containsverbatim]{Fat CalculationNode}
+
+As lean CalculationNode, but actually storing something
+
+\begin{lstlisting}[language=java]
+Object intermediateResult;
+Object storedIntermediateResult;
+
+public void initAndValidate() {
+	// reserve space for result objects
+	intermediateResult = new ...;
+ 	storedIntermediateResult = new ...;
+}
+
+public void store() {
+	// copy intermediateResult to storedIntermediateResult
+	...
+	super.store();
+}
+public void restore() {
+	// needsUpdate = true; <- don't need this now
+	Object tmp = intermediateResult;
+	intermediateResult = storedIntermediateResult;
+	storedIntermediateResult = tmp;
+	super.restore();
+}
+\end{lstlisting}
+
+\end{frame}
+
+
+
+\begin{frame}[containsverbatim]{Adding a Substitution model}
+Extend SubstitutionModel.Base class
+
+\begin{itemize}
+\item A substitution model should implement {\tt getTransitionProbabilities(Node node, double fStartTime, double fEndTime, double fRate, double[] matrix)}
+\item Typically, {\tt fRate * (fEndTime - fStartTime)} is the distance $t$ in $e^{Qt}$
+and {\tt Node} can be ignored.
+\item Results should go in the {\tt matrix}: note this is represented as array.
+\item {\tt SubstitutionModel} is a {\tt CalculationNode}, so it may be worth implementing {\tt store/restore/requireRecalculation}
+\end{itemize}
+
+\end{frame}
+
+\begin{frame}[containsverbatim]{Adding an Operator: Extend Operator class}
+
+\begin{itemize}
+\item An operator should have at least one input with a {\tt StateNode} to operate on.
+\item An operator should implement {\tt proposal()} which changes the State.
+\item {\tt proposal()} should return the Hastings ratio.
+\item Return {\tt Double.NEGATIVE\_INFINITY} if the proposal is invalid/doomed
+(don't throw Exceptions).
+\item Implement {\tt optimize()} if auto-optimization applies.
+%\item
+%Note: use {\tt\bf \color{red}m\_parameter.get(this)} in {\tt proposal()} not {\tt \color{blue}m\_parameter.get()}
+%{\bf iff you want to change the value of the {\tt StateNode}}
+\end{itemize}
+
+
+\end{frame}
+
+
+\begin{frame}[containsverbatim]{Adding a logger: Implement Loggable interface}
+
+\begin{lstlisting}[language=java]
+    void init(PrintStream out) throws Exception;
+
+    void log(int nSample, PrintStream out);
+
+    void close(PrintStream out);
+\end{lstlisting}
+
+\includegraphics[widht=0.5\textwidth]{loggables.png}
+
+\end{frame}
+
+
+
+\if0
+\begin{frame}[containsverbatim]{Shadowing inputs}
+
+Never shadow a StateNode
+
+\begin{lstlisting}[language=java]
+    public Input<RealParamater> p = new Input<>...;
+    private RealParameter pShadow;
+\end{lstlisting}
+
+
+Shadow CalculationNodes, 
+primitives (Integer, Double, String, Boolen) inputs, 
+and others is fine.
+
+
+\begin{lstlisting}[language=java]
+    public Input<Integer> p = new Input<>...;
+    private Integer pShadow;
+\end{lstlisting}
+
+
+\end{frame}
+\fi
+
+\begin{frame}[containsverbatim]{Input rule of base class is not what you want.}
+
+If an Input is REQUIRED for a base class you want to override, but for the derived
+class this Input should be OPTIONAL, set the Input to OPTIONAL in the constructor.
+E.g. for a SNPSequence that derives from Sequence, but for which m\_sData is optional,
+add a constructor
+
+{\color{blue}\begin{lstlisting}[language=java]
+	public SNPSequence() {
+		data.setRule(Validate.OPTIONAL);
+	}
+\end{lstlisting}}
+Note that the constructor needs to be public, to prevent IllegalAccessExceptions
+on construction by e.g. the XMLParser.
+
+\end{frame}
+
+\begin{frame}[containsverbatim]{Input parameter dimension is unknown...}
+
+...but a CalculationNode can easily find out.\vskip 0.5cm
+
+Then, in the {\tt initAndValidate()} method of the {\tt CalculationNode},
+call {\tt parameter.setDimension(x)}
+
+
+\end{frame}
+
+\begin{frame}[containsverbatim]{Input parameter {\em value} is unknown...}
+
+...but a CalculationNode can easily find out.\vskip 0.5cm
+
+Then, in the {\tt initAndValidate()} method of the {\tt CalculationNode},
+create a new Parameter X, and use {\tt input.get().assignFromWithoutID(X)}
+
+\begin{lstlisting}[language=java]
+ at Override
+public void initAndValidate() throws Exception {
+    // determine dimension, number of Nodes in a tree here
+	int nNodes = tree.get().getNodeCount();
+
+    // create new Parameter
+	IntegerParameter positions = new IntegerParameter("0", 0, Integer.MAX_VALUE, nNodes);
+	for (int i = 0; i < nNodes; ++) {
+		int iPosX = ...;
+		positions.setValue(i, iPosX);
+	}
+
+    // copy values to the input
+	positions.get().assignFromWithoutID(positions);
+	
+}
+\end{lstlisting}
+
+\end{frame}
+
+\begin{frame}[containsverbatim]{Trees with traits}
+
+For a tree with $n$ leaf nodes, so $2n-1$ nodes in total
+\begin{itemize}
+\item Easiest: associate a parameter with dimension $2n-1$ to the tree
+\begin{itemize}
+\item Leaf nodes are numbered $0,\ldots,n-1$
+\item Internal nodes are numbered $n,\ldots,2n-1$
+\item Root node is not treated as special internal node (no number guaranteed)
+\end{itemize}
+\item Harder: Derive from class {\tt Node} and process as meta-data
+\end{itemize}
+
+\end{frame}
+
+
+\section{Ways to mess up}
+
+\begin{frame}{Common errors}
+
+1. {\bf\color{red} {\tt Input} is not declared public.}
+
+If {\tt Input}s are not public, they cannot get values assigned by for
+instance the {\tt XMLParser}.\vskip1cm
+
+\pause
+
+2. {\bf\color{red} Type of input is a template class (other than {\tt List}).}
+
+Thanks to limitations of Java introspection and the way BEAST II is set up, Inputs should be 
+of a type that is concrete, and apart from {\tt List<T>} no template class should be used.\vskip1cm
+
+\pause
+3. {\bf\color{red} Store/restore do not call {\tt super.store()}/{\tt super.restore()}.}
+
+Obviously, not calling store/restore on super classes may result in unexpected behavior.
+
+\end{frame}
+
+
+\begin{frame}{Uncommon errors}
+\begin{itemize}
+\item Forgot to set {\tt m\_bNeedsUpdate} flag in {\tt requiresRecalculation()}. This way
+the {\tt CalculationNode} will never update its internal state and will always return the
+same (initially calculated) result.
+\item always return {\tt false} from {\tt requiresRecalculation()}. This way {\tt CalculationNode}s 
+downstream may never think of recalculating themselves.
+\end{itemize}
+Both issues will not be picked up during the debugging phase
+of the MCMC loop.
+
+\end{frame}
+
+
+\fi
+\if \part 2
+
+
+
+
+\section{XML}
+
+\begin{frame}{What is XML?}
+"The Extensible Markup Language (XML) is a simple text-based format for representing structured information"\vskip1cm
+
+\includegraphics[width=\textwidth]{xml.png}\vskip1cm
+
+{\small Reserved characters in attribute values: " (\") ' (\') $<$ (\<) $>$ (\>) \& (\&)
+e.g. x="\""}
+
+\end{frame}
+
+
+\begin{frame}{XML}
+Let's put this model into XML 
+
+\includegraphics[width=\textwidth]{example5.png}
+
+First the hky-scale operator
+
+\end{frame}
+
+\begin{frame}[containsverbatim]{BEAST 2 Reserved XML attributes}
+
+{\tt name}, {\tt spec}, {\tt id}, {\tt idref}
+\begin{itemize}
+\item XML element {\tt input} can be used for every plugin.
+\item Specify {\tt name} to match with input name.
+\item Specify {\tt spec} to identity Plugin.
+\item XML id/idref mechanism to reuse Plugins.
+\item XML attributes for primitives (Integer, Double, Boolean, String).
+\end{itemize}
+
+{\small
+\begin{lstlisting}[language=XML]
+<input name='operator' id='kappaScaler' 
+    spec='beast.evolution.operators.ScaleOperator' 
+    scaleFactor='0.5' weight='1'>
+    <input name='parameter' idref='hky.kappa'/>
+</input>
+\end{lstlisting}
+}
+\end{frame}
+
+\begin{frame}[containsverbatim]{XML rule: namespaces}
+
+
+Top level {\tt beast} element can be used to define namespaces
+in the usual Java fashion.
+
+\begin{lstlisting}[language=XML]
+    <beast namespace="beast.core:beast.evolution.operators">
+\end{lstlisting}
+
+This allows shortening of spec-values:
+
+{\small
+\begin{lstlisting}[language=XML]
+<input name='operator' id='kappaScaler' 
+    spec='beast.evolution.operators.ScaleOperator' 
+    scaleFactor='0.5' weight='1'>
+    <input name='parameter' idref='hky.kappa'/>
+</input>
+\end{lstlisting}
+}
+
+becomes
+
+{\small
+\begin{lstlisting}[language=XML]
+<input name='operator' id='kappaScaler' spec='ScaleOperator' 
+    scaleFactor='0.5' weight='1'>
+    <input name='parameter' idref='hky.kappa'/>
+</input>
+\end{lstlisting}
+}
+\end{frame}
+
+\begin{frame}[containsverbatim]{XML rule: input/name}
+
+Input elements with name attributes equal the name's value as element name
+
+\begin{lstlisting}[language=XML]
+<input name='xyz'></input>  == <xyz></xyz>
+\end{lstlisting}
+
+so
+
+{\small
+\begin{lstlisting}[language=XML]
+<input name='operator' id='kappaScaler' spec='ScaleOperator' 
+    scaleFactor='0.5' weight='1'>
+    <input name='parameter' idref='hky.kappa'/>
+</input>
+\end{lstlisting}
+}
+
+equals
+
+{\small
+\begin{lstlisting}[language=XML]
+<operator id='kappaScaler' spec='ScaleOperator' 
+    scaleFactor='0.5' weight='1'>
+    <parameter idref='hky.kappa'/>
+</operator>
+\end{lstlisting}
+}
+\end{frame}
+
+
+\begin{frame}[containsverbatim]{XML rules: idref}
+
+If idref is only attribute in element, an attribute with element
+name and \@ before the idref.
+
+\begin{lstlisting}[language=XML]
+<name idref="some-id"/> == name='@some-id'
+\end{lstlisting}
+
+So
+
+{\small
+\begin{lstlisting}[language=XML]
+<operator id='kappaScaler' spec='ScaleOperator' 
+    scaleFactor='0.5' weight='1'>
+    <parameter idref='hky.kappa'/>
+</operator>
+\end{lstlisting}
+}
+
+equals
+
+{\small
+\begin{lstlisting}[language=XML]
+<operator id='kappaScaler' spec='ScaleOperator' 
+    scaleFactor="0.5" weight="1" parameter="@hky.kappa"/>
+\end{lstlisting}
+}
+\end{frame}
+
+
+\begin{frame}[containsverbatim]{BEAST 2 Reserved XML elements}
+
+{\small
+%\pgfputat{\pgfxy(1.5,-4)}{\pgfbox[left,base]{\pgfimage[width=5cm]{BEAST.png}}}
+\begin{Verbatim}[commandchars=\\\{\}]
+\textcolor{blue}{\bf <beast} \textcolor{purple}{version=}\textcolor{black}{'2.0'} \textcolor{purple}{namespace=}\textcolor{black}{'x.y.z:a.b.c'}\textcolor{blue}{\bf >}
+\textcolor{blue}{\bf <map} \textcolor{purple}{name=}\textcolor{black}{'xyz'}\textcolor{blue}{\bf >}x.y.z.Class\textcolor{blue}{\bf </map>}
+element <xyz> is expanded to 
+<input name='xyz' spec='x.y.z.Class'>
+
+\textcolor{blue}{\bf <input}\textcolor{blue}{\bf >}
+
+\textcolor{blue}{\bf <run}\textcolor{blue}{\bf >} spec must be beast.core.Runnable
+\textcolor{blue}{\bf <distribution}\textcolor{blue}{\bf >} spec must be beast.core.Distribution
+\textcolor{blue}{\bf <operator}\textcolor{blue}{\bf >} spec must be beast.core.Operator
+\textcolor{blue}{\bf <logger}\textcolor{blue}{\bf >}    spec=beast.core.Logger
+\textcolor{blue}{\bf <data}\textcolor{blue}{\bf >}      spec=beast.evolution.alignment.Alignment
+\textcolor{blue}{\bf <sequence}\textcolor{blue}{\bf >}  spec=beast.evolution.alignment.Sequence
+\textcolor{blue}{\bf <state}\textcolor{blue}{\bf >}     spec=beast.core.State
+\textcolor{blue}{\bf <parameter}\textcolor{blue}{\bf >} spec=beast.core.parameter.RealParameter
+\textcolor{blue}{\bf <tree}\textcolor{blue}{\bf >}      spec=beast.evolution.tree.Tree
+
+\textcolor{blue}{\bf <plate}\textcolor{blue}{\bf >} mainly for BEAUti templates
+\end{Verbatim}
+}
+\end{frame}
+
+
+
+\begin{frame}[containsverbatim]{XML: example}
+
+{\small
+
+\begin{lstlisting}[language=XML]
+<input name='substModel' id="hky" spec="HKY">
+    <input name='kappa' idref="hky.kappa" >
+    <input name='frequencies' id="freqs" spec="Frequencies">
+           <input name='data' idref="alignment"/>
+    </input>
+</input>
+
+
+<input spec="TreeLikelihood">
+    <input name='data' idref='alignment'/>
+    <input name='tree' idref='tree'/>
+    <input name='siteModel' spec="SiteModel">
+        <input name='substModel' idref='hky'/>
+    </input>
+</input>
+\end{lstlisting}
+
+
+\color{blue}Assuming {\tt namespace='beast.evolution.sitemodel:
+beast.evolution.substitutionmodel:\
+beast.evolution.likelihood'}
+}
+\end{frame}
+
+
+\begin{frame}[containsverbatim]{Compress inputs}
+Input elements with name attributes equal the name's value as element name
+
+\begin{lstlisting}[language=XML]
+<input name='xyz'></input>  == <xyz></xyz>
+\end{lstlisting}
+
+Applying to the example
+
+
+{\small
+\begin{lstlisting}[language=XML]
+<substModel id="hky" spec="HKY">
+    <kappa idref="hky.kappa" >
+    <frequencies id="freqs" spec="Frequencies">
+           <data idref="alignment"/>
+    </frequencies>
+</substModel>
+
+
+<distribution spec="TreeLikelihood">
+    <data idref='alignment'/>
+    <tree idref='tree'/>
+    <siteModel spec="SiteModel">
+        <substModel idref='hky'/>
+    </siteModel>
+</distribution>
+\end{lstlisting}
+}
+\end{frame}
+
+\begin{frame}[containsverbatim]{Compress idrefs}
+
+if idref is only attribute in element, an attribute with element
+name and \@ before the idref.
+
+\begin{lstlisting}[language=XML]
+<name idref="some-id"/> == name='@some-id'
+\end{lstlisting}
+
+Applying to the example
+
+{\small
+\begin{lstlisting}[language=XML]
+
+<substModel id="hky" spec="HKY" kappa="@hky.kappa" >
+    <frequencies id="freqs" spec="Frequencies" 
+        data="@alignment"/>
+</substModel>
+
+<distribution data="@alignment" spec="TreeLikelihood" 
+    tree="@tree">
+    <siteModel spec="SiteModel" substModel='@hky'/>
+</distribution>
+\end{lstlisting}
+}
+Note: you still can use any of the previous versions! These are just short-cuts.
+\end{frame}
+
+
+
+
+\begin{frame}[containsverbatim]
+{Resolving input name}
+
+\begin{itemize}
+\item specified in name attribute
+\begin{lstlisting}[language=java]
+    <input name="xyz" >
+\end{lstlisting}
+%\item if not, use (non-reserved) attribute name
+%\begin{lstlisting}[language=java]
+%    <input xyz="3" >
+%\end{lstlisting}
+\item if not, use element name
+\begin{lstlisting}[language=java]
+    <xyz value="3" >
+\end{lstlisting}
+\item if input, use 'value' when there is text content, but no element content
+\begin{lstlisting}[language=java]
+    <input>3</input>
+\end{lstlisting}
+\end{itemize}
+\end{frame}
+
+
+\begin{frame}[containsverbatim]
+{Resolving input value}
+
+\begin{itemize}
+\item if idref is specified, use the referred object
+\begin{lstlisting}[language=java]
+    <xyz idref="other" > or xyz='@other'
+\end{lstlisting}
+\item specified in value attribute
+\begin{lstlisting}[language=java]
+    <xyz value="3" >
+\end{lstlisting}
+\item if not, use value of (non-reserved) attribute
+\begin{lstlisting}[language=java]
+    <input xyz="3" >
+\end{lstlisting}
+\item if not, use text content when there is text content, but no element content
+\begin{lstlisting}[language=java]
+    <input>3</input>
+\end{lstlisting}
+\end{itemize}
+\end{frame}
+
+
+\if0
+\begin{frame}[containsverbatim]
+{XML}
+Parsing rules:
+Processing non reserved attributes
+\begin{Verbatim}[commandchars=\\\{\}]
+\textcolor{blue}{\bf  <input} \textcolor{purple}{otherAttribute=}\textcolor{black}{"xyz"}\textcolor{blue}{\bf  />}
+\end{Verbatim}
+equals
+\begin{Verbatim}[commandchars=\\\{\}]
+\textcolor{blue}{\bf  <input}\textcolor{blue}{\bf  >}
+  \textcolor{blue}{\bf  <input} \textcolor{purple}{name=}\textcolor{black}{'otherAttribute'} \textcolor{purple}{value=}\textcolor{black}{'xyz'}\textcolor{blue}{\bf  />}
+\textcolor{blue}{\bf  </input>}
+\end{Verbatim}
+
+Processing non reserved element names
+\begin{Verbatim}[commandchars=\\\{\}]
+\textcolor{blue}{\bf  <myElement}\textcolor{blue}{\bf  />}
+\end{Verbatim}
+==
+\begin{Verbatim}[commandchars=\\\{\}]
+\textcolor{blue}{\bf  <input} \textcolor{purple}{spec=}\textcolor{black}{'myElement'} \textcolor{purple}{name=}\textcolor{black}{'myElement'}\textcolor{blue}{\bf  />}
+\end{Verbatim}
+unless 'spec' is a specified attribute, then that overrides, likewise for 'name' 
+%\end{frame}
+
+
+%\begin{frame}[containsverbatim]
+%{XML}
+Processing of text content (only when there are no enclosing elements)
+\begin{Verbatim}[commandchars=\\\{\}]
+\textcolor{blue}{\bf  <input} \textcolor{purple}{name=}\textcolor{black}{'data'}\textcolor{blue}{\bf  >}xyz\textcolor{blue}{\bf  </input>}
+\end{Verbatim}
+==
+\begin{Verbatim}[commandchars=\\\{\}]
+\textcolor{blue}{\bf  <input} \textcolor{purple}{name=}\textcolor{black}{'data'} \textcolor{purple}{value=}\textcolor{black}{'xyz'/}\textcolor{blue}{\bf  >}
+\end{Verbatim}
+\end{frame}
+
+\fi
+
+
+\begin{frame}
+\includegraphics[width=0.95\textwidth]{xml4.png}
+\end{frame}
+
+
+\begin{frame}[containsverbatim]{XML}
+XMLParser produces semi sensible parser error messages:
+
+{\tiny
+\begin{verbatim}
+
+Error 124 parsing the xml input file
+
+This plugin (treeLikelihood) has no input with 
+name xxx. Choose one of these inputs: data,tree,
+siteModel,branchRateModel,useAmbiguities
+
+Error detected about here:
+  <beast>
+      <run id='mcmc' spec='MCMC'>
+          <distribution id='posterior' spec='CompoundDistribution'>
+              <distribution id='treeLikelihood' spec='TreeLikelihood'>
+\end{verbatim}
+}
+
+and
+
+{\tiny
+\begin{verbatim}
+Error 122 parsing the xml input file
+
+Cannot create class: CompoundDistibution. Class could not be found. 
+Did you mean beast.core.util.CompoundDistribution?
+
+Error detected about here:
+  <beast>
+      <run id='mcmc' spec='MCMC'>
+          <distribution id='posterior' spec='CompoundDistibution'>
+
+\end{verbatim}
+}
+\end{frame}
+
+
+
+\section{Add-ons}
+\begin{frame}{Add-ons}
+A BEAST 2 add-on is a library based on BEAST 2\vskip1cm
+
+Why add-ons:
+\begin{itemize}
+\item Making work easier citable
+\item Making the core easier to learn -- it's a lot smaller / cleaner
+\item Separating out stable / experimental code / dead code
+\item ...
+\end{itemize}
+
+\end{frame}
+
+\begin{frame}{Add-ons}
+
+\begin{itemize}
+\item SnAP - multi-species coalescent for SNP and AFLP data
+\url{http://code.google.com/p/snap-mcmc/}
+\item beastii - utilities, Peter Will's AARS substitution model
+\url{http://code.google.com/p/beastii/}
+\item Subst-BMA - Bayes model averaging over subst. models
+\url{http://code.google.com/p/subst-bma/}
+\item EBSP/*BEAST - Joseph's thesis work
+\item Experimental phylogeography
+\item David Welch's Prevalence/SI-likelihood
+\item Sibon's MCMC monitoring thing
+\item ...
+\end{itemize}
+\end{frame}
+
+\begin{frame}{What makes an Add-on}
+
+\begin{itemize}
+\item A jar file that contains the code
+\item A jar file with the source
+\item Example XML files
+\item Documentation
+\item A BEAUti 2 template
+\end{itemize}\vskip0.5cm
+
+Recommended directory structure:\\
+\begin{tabular}{ll}
+{\color{blue}\tt myAddOn/../beast2} &Beast 2 files\\
+{\color{blue}\tt myAddOn/src} &source files\\
+{\color{blue}\tt myAddOn/examples} &XML examples\\
+{\color{blue}\tt myAddOn/build} &class files\\
+{\color{blue}\tt myAddOn/build/dist} &jar files\\
+{\color{black}\tt myAddOn/lib} &libraries used (if any)\\
+{\color{black}\tt myAddOn/doc} &documentation\\
+{\color{black}\tt myAddOn/templates} &BEAUti templates (optional)
+\end{tabular}
+
+\end{frame}
+
+\begin{frame}{Setting up an Add-on}
+Checkout BEAST 2 code, available at
+\url{http://code.google.com/p/beast2}\vskip0.5cm
+
+Setting up an add-on in Intellij, basic steps
+\begin{itemize}
+\item Make a project containing BEAST 2
+\item Create new module, e.g. called MyAddOn
+\item Create module dependency of MyAddOn on BEAST 2
+\end{itemize}
+see SDK documentation for more details.\vskip0.5cm
+
+Setting up an add-on in Eclipse, basic steps
+\begin{itemize}
+\item Make a project containing BEAST 2
+\item Create new project, e.g. called MyAddOn
+\item Add BEAST 2 to the Java build path of MyAddOn
+\end{itemize}
+see SDK documentation for more details.\vskip0.5cm
+
+Setting up an add-on in Hudson (for automatic regression testing): ask Walter
+\end{frame}
+
+\begin{frame}{Distributing Add-ons}
+
+\begin{itemize}
+\item Create Add-on files containing add-on classes only
+\item Put on a web-site
+\item Download to \$BEAST\_HOME/beastlib
+\item It will be picked up from there when running BeastMCMC or BEAUti
+\end{itemize}
+
+Future work: automate this process, provide catalogue, GUI, etc.
+
+\end{frame}
+
+
+\section{Applications}
+
+\begin{frame}{BEAUti 2: replacement of BEAUti 1}
+\includegraphics[width=\textwidth]{BEAUti.png}
+
+More about BEAUti in Part III
+\end{frame}
+
+
+\begin{frame}{Model builder: GUI for graphical manipulation of Plugins}
+\includegraphics[width=\textwidth]{modelbuilder.png}
+
+In development...
+\end{frame}
+
+\begin{frame}{Spreadsheet: calculates partial results on the fly}
+\includegraphics[width=0.8\textwidth]{spreadsheet.png}
+
+In development...
+\end{frame}
+
+\begin{frame}{Documentation}
+XML documentation provided through
+
+\begin{itemize}
+\item @Description annotation on plug in
+\item Tooltip text on inputs
+\item getCitation method
+\item Input validation rules
+\end{itemize}
+
+\includegraphics[width=\textwidth]{beastdoc0.png}
+
+\end{frame}
+
+
+\begin{frame}{Other}
+o Sequence generator, for simulation studies\\\vskip0.5cm
+o Sequence with XML merging through BEAUti, handy for scripting\\\vskip0.5cm
+o XMLParser to BEAUtify XML\\\vskip0.5cm
+o Alignment viewer: navigate an alignment\\\vskip0.5cm
+o Log analyser: prints statistics of a trace log from command line \\\vskip0.5cm
+%\includegraphics[width=\textwidth]{hkymodel2.png}
+\end{frame}
+
+
+
+
+\begin{frame}[containsverbatim]
+{BEAST 2.0}
+
+\begin{lstlisting}[language=java]
+~> java beast.app.BeastMCMC
+
+Usage: BeastMCMC [options] <Beast.xml>
+where <Beast.xml> the name of a file specifying a BEAST run
+and the following options are allowed:
+-resume : read state that was stored at the end of the last run from file and append log file
+-overwrite : overwrite existing log files (if any). By default, existing files will not be overwritten.
+-seed [<int>|random] : sets random number seed (default 127), or picks a random seed
+-threads <int> : sets number of threads (default 1)
+-beastlib <path> : Colon separated list of directories. All jar files in the path are loaded. (default 'beastlib')
+\end{lstlisting}
+\end{frame}
+
+\fi
+
+
+
+\if \part 3
+
+\begin{frame}[containsverbatim]{What is BEAUti 2}
+
+A GUI for manipulating BEAST 2 specifications\vskip0.5cm
+
+Features:
+\begin{itemize}
+\item Read/write XML specifications
+\item Customizable GUI through templates
+\item Interactive validation of specification
+\item Automatically picks up plug-ins from Add-ons
+\item Batch merging of alignments to XML specifications
+\end{itemize}
+\end{frame}
+
+
+\section{BEAUti 2: A walk through}
+
+\begin{frame}[containsverbatim]{Start up}
+\includegraphics[width=0.6\textwidth]{BEAUti0.png}
+
+Before editing anything, BEAUti needs to know either alignments and template OR existing file.
+\end{frame}
+\begin{frame}[containsverbatim]{Start up: select alignments}
+\includegraphics[width=0.6\textwidth]{BEAUti1.png}
+
+Select one or more alignments\\
+Select an analysis template
+\end{frame}
+\begin{frame}[containsverbatim]{Start up: select existing file}
+\includegraphics[width=0.6\textwidth]{BEAUti2.png}
+\end{frame}
+\begin{frame}[containsverbatim]{Edit parameters}
+\includegraphics[width=0.8\textwidth]{BEAUti5.png}
+
+Familiar panel based user interface for configuring specification
+\end{frame}
+\begin{frame}[containsverbatim]{Flow}
+\includegraphics[width=1\textwidth]{BEAUti3.png}
+
+No new alignment selection once editing is started
+\end{frame}
+
+\begin{frame}[containsverbatim]{Start up}
+\begin{lstlisting}[language=java]
+java beast.app.BEAUti.BEAUti [options]
+where options can be one of the following:
+-template [template file]
+-nex [nexus data file]
+-xmldat [beast xml file]
+-xml [beast file]
+-out [output file name]
+-exitaction [writexml|usetemplate|usexml]
+\end{lstlisting}
+
+Select proper command line functions to short cut the flow\\
+Multiple alignment files allowed\\
+Batch merging of alignment with template
+
+\end{frame}
+
+\begin{frame}[containsverbatim]{Start up: another template}
+\includegraphics[width=0.8\textwidth]{BEAUti4.png}
+
+Template for SNP and AFLP analysis\\
+Customised labels, template button invisible
+\end{frame}
+\begin{frame}[containsverbatim]{Edit: another template}
+\includegraphics[width=0.8\textwidth]{BEAUti7.png}
+
+Custom menu\\
+Only subset of panels used
+\end{frame}
+
+\begin{frame}[containsverbatim]{Spot the differences}
+\includegraphics[width=\textwidth]{BEAUti6.png}
+
+Customized labels\\
+Button visibility
+\end{frame}
+\begin{frame}[containsverbatim]{Spot the differences}
+\includegraphics[width=\textwidth]{BEAUti8.png}
+
+Customized menus: visibility and label names\\
+Customized panels\\
+
+\end{frame}
+
+\begin{frame}[containsverbatim]{Configurable}
+\includegraphics[width=0.6\textwidth]{BEAUti9.png}
+
+A: Partitionable or not\\
+B: Custom behaviour: gamma shape only shown when categories at least 2\\
+C: Expand inputs of a plugin\\
+D: Hide irrelevant inputs
+\end{frame}
+
+
+\begin{frame}[containsverbatim]{What BEAUti does}
+
+\begin{itemize}
+\item Contain a large number of Plugin objects, to ensure a somewhat sensible set of choices\\
+\item User changes link in the model graph
+\includegraphics[width=0.8\textwidth]{BEAUti10.png}\\
+\item User changes values of primitive (String, Integer, Boolean, Double) inputs\\
+\item Automatically update links, e.g. Operator to MCMC\vskip0.5cm
+\end{itemize}
+
+Expert mode allows creation of new Plugin object, but the user is on its own as far as validation is concerned
+
+\end{frame}
+
+\section{BEAUti 2 Templates}
+
+\begin{frame}[containsverbatim]{How to configure BEAUti}
+
+1: XML template\vskip1cm
+
+2: Custom InputEditor classes
+\end{frame}
+
+
+\begin{frame}[containsverbatim]{BEAUti templates}
+
+A BEAUti template is an XML specification with extra features
+\begin{itemize}
+\item {\tt <plate var='n' range='#alignments'>} 'macros'
+\item {\tt <data id="#alignments"/>} for merging alignments
+\item {\tt <mergepoint>}/{\tt <mergewith>} for merging sub-templates
+\item {\tt <BEAUticonfig spec='beast.app.BEAUti.BEAUtiConfig'>} for customizing GUI components
+\end{itemize}\vskip0.5cm
+
+
+Main-templates define type of analysis, e.g. vanilla alignment analysis, *BEAST, Snap\vskip0.5cm
+
+Sub-templates define parts that go anywhere in a main template, e.g. substitution or branch rate models.
+
+
+\end{frame}
+
+
+\begin{frame}[containsverbatim]{{\tt plate} element in templates}
+
+Plate behaves like a macro
+
+{\tt<plate var='n' range='a,b,c'>\\
+ <input id='\$(n)'/>\\
+</plate>}
+
+is interpreted as\\
+{\tt<input id='a'/>\\
+<input id='b'/>\\
+<input id='c'/>\\
+}
+\vskip0.5cm
+
+For example{\small
+
+\begin{verbatim}<plate var='n' range='#alignments'>
+        <input spec='HKY' id='$(n).hky'>
+            <kappa idref='$(n).hky.kappa'/>
+            <frequencies id='$(n).freqs' spec='Frequencies'>
+                <data idref='$(n)'/>
+            </frequencies>
+        </input>
+</plate>\end{verbatim}
+}
+
+\end{frame}
+
+\begin{frame}[containsverbatim]{Merging alignments}
+
+Single alignment merging:\vskip0.5cm
+
+{\tt <data id="\#alignments"/>}\vskip0.5cm
+
+becomes\vskip0.5cm
+
+\includegraphics[width=\textwidth]{BEAUtiseq.png}\vskip0.5cm
+
+and everywhere in the template {\tt \#alignments} becomes {\tt dna}
+
+\end{frame}
+
+\begin{frame}[containsverbatim]{Merging alignments}
+
+Multi alignment merging:\vskip0.5cm
+
+{\tt <data id="\#alignments"/>}\vskip0.5cm
+
+becomes\vskip0.5cm
+
+\includegraphics[width=\textwidth]{BEAUtiseq2.png}\vskip0.5cm
+
+and everywhere in the template {\tt \#alignments} becomes {\tt 26,29}
+
+\end{frame}
+
+\begin{frame}[containsverbatim]{{\tt mergepoint} and {\tt mergewith} elements}
+
+Main templates define {\tt mergepoint}s with ids\vskip0.5cm
+
+Sub-templates define {\tt mergwith} and point to the {\tt mergepoint}s in main template\vskip0.5cm
+
+Typical usage of sub-templates
+\begin{itemize}
+\item specify a new substitution model,
+\item specify prior distributions on parameters of the model
+\item specify operators on parameters of the model
+\end{itemize}
+\end{frame}
+
+\begin{frame}[containsverbatim]{{\tt mergepoint} and {\tt mergewith} Example}
+
+Main-template
+\begin{verbatim}
+    <plate var='n' range='#alignments'>
+        <mergepoint id='substitutionmodel'/>
+    </plate>
+\end{verbatim}
+
+
+Sub-template
+\begin{verbatim}
+    <mergewith point='substitutionmodel'>
+        <input spec='WAG' id='$(n).WAG'/>
+    </mergewith>
+\end{verbatim}
+
+Interpretation of main template
+
+\begin{verbatim}
+    <plate var='n' range='#alignments'>
+        <input spec='WAG' id='$(n).WAG'/>
+    </plate>
+\end{verbatim}
+
+
+\end{frame}
+
+\begin{frame}[containsverbatim]{Configuring BEAUti GUI}
+In template:
+
+{\tt <BEAUticonfig spec='beast.app.BEAUti.BEAUtiConfig'>} 
+
+for customizing 
+\begin{itemize}
+\item which panels are shown at start up
+\item which menus are visible in menubar
+\item which buttons are visible
+\item which inputs are hidden
+\item which inputs are expanded inline
+\item which labels are used
+\end{itemize}
+
+See files in {\tt beast2/templates} directory for details
+\end{frame}
+
+\section{BEAUti 2 Custom GUI}
+
+\begin{frame}[containsverbatim]{Developing custom GUI components}
+
+From a developers view: everything is a Plugin\vskip0.5cm
+
+BEAUti is a tool for \\
+\begin{itemize}
+\item connecting inputs with Plugins\\
+\item configuring inputs\vskip0.5cm
+\end{itemize}
+
+In BEAUti, a panel for a Plugins shows a list of InputEditors.\vskip0.5cm
+
+To create customized behaviour for inputs of specific types, 
+override InputEditor
+\end{frame}
+
+\begin{frame}[containsverbatim]{InputEditor}
+
+
+BEAUti uses the input editor associated with the in type of the InputEditor\vskip0.5cm
+
+
+\begin{lstlisting}[language=java]
+public class MyInputEditor extends InputEditor {
+
+    /** tell the type of input that this Input 
+        Editor applies to **/
+	@Override
+    public Class<?> type() {
+        return MyPlugin.class;
+    }
+
+    /** custom implementation **/
+
+} 
+\end{lstlisting}
+
+See code for gory details of custom implementation possibilities\vskip0.5cm
+
+{\tt beast.app.BEAUti} packages for examples
+
+\end{frame}
+
+
+\begin{frame}[containsverbatim]{ListInputEditor}
+
+Dealing with list of inputs: extend ListInputEditor
+and implement {\tt type()} and {\tt baseType()}
+
+\begin{lstlisting}[language=java]
+public class MyInputEditor extends ListInputEditor {
+
+    /** tell the type of input that this Input 
+        Editor applies to **/
+	@Override
+	public Class<?> type() {
+		return List.class;
+	}
+	@Override
+	public Class<?> baseType() {
+		return Operator.class;
+	}
+
+    /** custom implementation **/
+
+} 
+\end{lstlisting}
+
+\end{frame}
+
+
+\begin{frame}[containsverbatim]{All done!}
+
+Go forth and develop new Plugins \\and BEAUti templates now!\vskip1cm
+
+\begin{center}
+\includegraphics{../../src/beast/app/draw/icons/beast.png}
+\end{center}
+\end{frame}
+
+\fi
+
+\end{document}
+
+
+
diff --git a/doc/slides/speedup.png b/doc/slides/speedup.png
new file mode 100644
index 0000000..59b6ee1
Binary files /dev/null and b/doc/slides/speedup.png differ
diff --git a/doc/slides/spreadsheet.png b/doc/slides/spreadsheet.png
new file mode 100644
index 0000000..303adc0
Binary files /dev/null and b/doc/slides/spreadsheet.png differ
diff --git a/doc/slides/walk.jpg b/doc/slides/walk.jpg
new file mode 100755
index 0000000..7241a75
Binary files /dev/null and b/doc/slides/walk.jpg differ
diff --git a/doc/slides/xml.png b/doc/slides/xml.png
new file mode 100644
index 0000000..167842f
Binary files /dev/null and b/doc/slides/xml.png differ
diff --git a/doc/slides/xml1.png b/doc/slides/xml1.png
new file mode 100644
index 0000000..c570062
Binary files /dev/null and b/doc/slides/xml1.png differ
diff --git a/doc/slides/xml2.png b/doc/slides/xml2.png
new file mode 100644
index 0000000..2b68047
Binary files /dev/null and b/doc/slides/xml2.png differ
diff --git a/doc/slides/xml3.png b/doc/slides/xml3.png
new file mode 100644
index 0000000..90181e0
Binary files /dev/null and b/doc/slides/xml3.png differ
diff --git a/doc/slides/xml4.png b/doc/slides/xml4.png
new file mode 100644
index 0000000..21a275b
Binary files /dev/null and b/doc/slides/xml4.png differ
diff --git a/doc/tutorial.slides.part1.pdf b/doc/tutorial.slides.part1.pdf
new file mode 100644
index 0000000..871a58d
Binary files /dev/null and b/doc/tutorial.slides.part1.pdf differ
diff --git a/doc/tutorial.slides.part2.pdf b/doc/tutorial.slides.part2.pdf
new file mode 100644
index 0000000..e541086
Binary files /dev/null and b/doc/tutorial.slides.part2.pdf differ
diff --git a/doc/tutorial.slides.part3.pdf b/doc/tutorial.slides.part3.pdf
new file mode 100644
index 0000000..5fcff3d
Binary files /dev/null and b/doc/tutorial.slides.part3.pdf differ
diff --git a/doc/tutorials/DivergenceDating/DivergenceDatingTutorial.bib b/doc/tutorials/DivergenceDating/DivergenceDatingTutorial.bib
new file mode 100644
index 0000000..321cd53
--- /dev/null
+++ b/doc/tutorials/DivergenceDating/DivergenceDatingTutorial.bib
@@ -0,0 +1,111 @@
+%% This BibTeX bibliography file was created using BibDesk.
+%% http://bibdesk.sourceforge.net/
+
+
+%% Created for Walter at 2014-09-01 15:13:41 +1200 
+
+
+%% Saved with string encoding Unicode (UTF-8) 
+
+
+
+ at article{drummond2007beast,
+	Author = {Drummond, Alexei J and Rambaut, Andrew},
+	Date-Added = {2014-09-01 03:13:32 +0000},
+	Date-Modified = {2014-09-01 03:13:32 +0000},
+	Journal = {BMC evolutionary biology},
+	Number = {1},
+	Pages = {214},
+	Publisher = {BioMed Central Ltd},
+	Title = {BEAST: Bayesian evolutionary analysis by sampling trees},
+	Volume = {7},
+	Year = {2007}}
+
+ at article{smith2008rates,
+	Author = {Smith, Stephen A and Donoghue, Michael J},
+	Date-Added = {2014-09-01 03:10:15 +0000},
+	Date-Modified = {2014-09-01 03:10:15 +0000},
+	Journal = {science},
+	Number = {5898},
+	Pages = {86--89},
+	Publisher = {American Association for the Advancement of Science},
+	Title = {Rates of molecular evolution are linked to life history in flowering plants},
+	Volume = {322},
+	Year = {2008}}
+
+ at article{nagalingum2011recent,
+	Author = {Nagalingum, NS and Marshall, CR and Quental, TB and Rai, HS and Little, DP and Mathews, S},
+	Date-Added = {2014-09-01 03:09:41 +0000},
+	Date-Modified = {2014-09-01 03:09:41 +0000},
+	Journal = {Science},
+	Number = {6057},
+	Pages = {796--799},
+	Publisher = {American Association for the Advancement of Science},
+	Title = {Recent synchronous radiation of a living fossil},
+	Volume = {334},
+	Year = {2011}}
+
+ at article{bahl2011ancient,
+	Author = {Bahl, Justin and Lau, Maggie CY and Smith, Gavin JD and Vijaykrishna, Dhanasekaran and Cary, S Craig and Lacap, Donnabella C and Lee, Charles K and Papke, R Thane and Warren-Rhodes, Kimberley A and Wong, Fiona KY and others},
+	Date-Added = {2014-09-01 03:08:59 +0000},
+	Date-Modified = {2014-09-01 03:08:59 +0000},
+	Journal = {Nature communications},
+	Pages = {163},
+	Publisher = {Nature Publishing Group},
+	Title = {Ancient origins determine global biogeography of hot and cold desert cyanobacteria},
+	Volume = {2},
+	Year = {2011}}
+
+ at article{rosenberg2003patterns,
+	Author = {Rosenberg, Michael S and Subramanian, Sankar and Kumar, Sudhir},
+	Date-Added = {2014-09-01 02:19:46 +0000},
+	Date-Modified = {2014-09-01 02:19:46 +0000},
+	Journal = {Molecular biology and evolution},
+	Number = {6},
+	Pages = {988--993},
+	Publisher = {SMBE},
+	Title = {Patterns of transitional mutation biases within and among mammalian genomes},
+	Volume = {20},
+	Year = {2003}}
+
+ at article{gelman1996efficient,
+	Author = {Gelman, A and Roberts, G and Gilks, W},
+	Date-Added = {2014-09-01 02:19:02 +0000},
+	Date-Modified = {2014-09-01 02:19:02 +0000},
+	Journal = {Bayesian statistics},
+	Pages = {599--608},
+	Title = {Efficient metropolis jumping hules},
+	Volume = {5},
+	Year = {1996}}
+
+ at article{drummond2010bayesian,
+	Author = {Drummond, Alexei J and Suchard, Marc A},
+	Date-Added = {2014-09-01 00:38:26 +0000},
+	Date-Modified = {2014-09-01 00:38:26 +0000},
+	Journal = {BMC biology},
+	Number = {1},
+	Pages = {114},
+	Publisher = {BioMed Central Ltd},
+	Title = {Bayesian random local clocks, or one rate to rule them all},
+	Volume = {8},
+	Year = {2010}}
+
+ at article{Heled:2012fk,
+	Abstract = {The use of fossil evidence to calibrate divergence time estimation has a long history. More recently, Bayesian Markov chain Monte Carlo has become the dominant method of divergence time estimation, and fossil evidence has been reinterpreted as the specification of prior distributions on the divergence times of calibration nodes. These so-called "soft calibrations" have become widely used but the statistical properties of calibrated tree priors in a Bayesian setting hashave n [...]
+	Author = {Heled, Joseph and Drummond, Alexei J},
+	Date-Added = {2012-05-20 12:15:13 +1200},
+	Date-Modified = {2012-05-20 12:15:13 +1200},
+	Doi = {10.1093/sysbio/syr087},
+	Journal = {Syst Biol},
+	Journal-Full = {Systematic biology},
+	Mesh = {Animals; Bayes Theorem; Calibration; Classification; Computer Simulation; Evolution, Molecular; Fossils; Markov Chains; Marsupialia; Models, Genetic; Monte Carlo Method; Papio; Phylogeny},
+	Month = {Jan},
+	Number = {1},
+	Pages = {138-49},
+	Pmc = {PMC3243734},
+	Pmid = {21856631},
+	Pst = {ppublish},
+	Title = {Calibrated tree priors for relaxed phylogenetics and divergence time estimation},
+	Volume = {61},
+	Year = {2012},
+	Bdsk-Url-1 = {http://dx.doi.org/10.1093/sysbio/syr087}}
diff --git a/doc/tutorials/DivergenceDating/DivergenceDatingTutorial.tex b/doc/tutorials/DivergenceDating/DivergenceDatingTutorial.tex
new file mode 100644
index 0000000..e850607
--- /dev/null
+++ b/doc/tutorials/DivergenceDating/DivergenceDatingTutorial.tex
@@ -0,0 +1,887 @@
+%\NeedsTeXFormat{LaTeX2e}[1996/06/01]
+
+\documentclass[12pt]{article}
+%\usepackage[rightcaption,raggedright]{sidecap}% for side captions
+%\usepackage{framed}         % for floatingboxes
+%\usepackage{soul}           % for letterspacing in theorem-style headings
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Special packages used AJD
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%\usepackage{amsmath}
+
+% for the Harvard author-date referencing system
+%\usepackage[agsm]{harvard}
+
+% if you are using either vancouver.bst or IEEEtran.bst and wish to remove
+% square braces in the reference list, uncomment the line below
+% \removesquarebraces
+
+%\usepackage{rotating}
+%\usepackage{floatpag}
+%\rotfloatpagestyle{empty}
+
+% \usepackage{amsmath}% if you are using this package,
+                      % it must be loaded before amsthm.sty
+%\usepackage{amsthm}
+% \usepackage{txfonts}% times font (used to produce EngCguide.pdf)
+                      % this package must be loaded after amsthm.sty
+\usepackage{graphicx}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Special packages used AJD
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%\usepackage{listings}
+
+%\lstset{
+%stringstyle=\ttfamily, % typewriter type for strings
+%showstringspaces=false % no special string spaces
+%}
+%\lstset{numbers=left, numberstyle=\tiny, stepnumber=1, numbersep=10pt, frame=trbl}
+%\lstset{escapeinside={(*@}{@*)}}
+
+%\usepackage{tikz,pgf}
+  
+%\usetikzlibrary{positioning}
+
+
+%\def\sindex{}
+%\def\aindex{}
+
+  
+% BEAST book specific commands
+\newcommand{\BEASTVersion}{2.2.x}
+\newcommand{\TracerVersion}{1.6}
+\newcommand{\FigTreeVersion}{1.4.2}
+%\newcommand{\TODO}[1]{{\color{red} #1}}
+%\newcommand{\TODO}[1]{}
+%\newcommand{\chapter}[1]{}
+
+
+% see chapter 3 for details
+%\theoremstyle{plain}% default
+%\newtheorem{theorem}{Theorem}
+%\newtheorem{lemma}[theorem]{Lemma}
+%\newtheorem*{corollary}{Corollary}
+
+%\theoremstyle{definition}
+%\newtheorem{definition}[theorem]{Definition}
+%\newtheorem{condition}[theorem]{Condition}
+
+%\theoremstyle{remark}
+%\newtheorem{remark}{Remark}
+%\newtheorem{notation}[remark]{Notation}
+%\newtheorem*{case}{Case}
+
+%\hyphenation{line-break line-breaks docu-ment triangle cambridge amsthdoc
+%cambridgemods baseline-skip author authors cambridgestyle en-vir-on-ment polar}
+
+%\setcounter{tocdepth}{2}% the toc normally lists sections;
+% for the purposes of this document, this has been extended to subsections
+
+%hyperref should come after index to make pagerefs work in index
+\usepackage{hyperref}
+\hypersetup{
+    colorlinks=true,
+    linkcolor=blue,
+    filecolor=magenta,      
+    urlcolor=cyan,
+}
+
+%\usepackage[all]{xy}
+
+\newcommand{\includeimage}[2][]{%
+%HEVEA\imgsrc{#2.hevea.png}%
+%BEGIN LATEX
+\includegraphics[#1]{#2}
+%END LATEX
+}
+\newcommand{\chainLength}{{6,000,000}}
+\newcommand{\logEvery}{{1,000}}
+\newcommand{\tracesNumber}{{6,000}} %% chainLength/logEvery
+\newcommand{\screenEvery}{{10,000}}
+\newcommand{\mccTree}{{\texttt{Primates.MCC.tree}}}
+
+\title{Divergence Dating Tutorial with BEAST {\BEASTVersion}}
+\author{Alexei Drummond, Andrew Rambaut, Remco Bouckaert, and Walter Xie}
+
+\begin{document}
+\maketitle
+
+\section{Introduction}
+
+This tutorial introduces the BEAST software for Bayesian evolutionary analysis through a simple tutorial. The tutorial involves co-estimation of a gene phylogeny and associated divergence times in the presence of calibration information from fossil evidence. 
+
+You will need the following software at your disposal:
+
+\begin{itemize}
+
+\item {\bf BEAST} - this package contains the BEAST program, BEAUti, TreeAnnotator and other utility programs. This tutorial is written for BEAST v{\BEASTVersion}, which has support for multiple partitions. It is available for download from \texttt{http://www.beast2.org/}.
+\item {\bf Tracer} - this program is used to explore the output of BEAST (and other Bayesian MCMC programs). It graphically and
+quantitively summarizes the distributions of continuous parameters and provides diagnostic information. At the time of
+writing, the current version is v{\TracerVersion}. It is available for download from\\*\texttt{http://tree.bio.ed.ac.uk/software/}.
+\item {\bf FigTree} - this is an application for displaying and printing molecular phylogenies, in particular those obtained using
+BEAST. At the time of writing, the current version is v{\FigTreeVersion}. It is available for download from \texttt{http://tree.bio.ed.ac.uk/software/}.
+\end{itemize}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%
+%%% TUTORIAL - RATES AND DATES
+%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%\section{Rates and dates}
+
+This tutorial will guide you through the analysis of an alignment of sequences sampled from twelve primate species (see Figure \ref{fig:primateAlignment}). The goal is to estimate the phylogeny, the rate of evolution on each lineage and the ages of the uncalibrated
+ancestral divergences. 
+
+\begin{figure}	
+\centering
+\includeimage[width=\textwidth]{figures/AlignmentViewer}
+\caption{Part of the alignment for primates.}
+\label{fig:primateAlignment}
+\end{figure}
+
+The first step will be to convert a NEXUS file with a DATA or CHARACTERS block into a BEAST XML input file. This is done using the program BEAUti (which stands for Bayesian Evolutionary Analysis Utility). 
+This is a user-friendly program for setting the evolutionary model and options for the MCMC analysis. 
+The second step is to actually run BEAST using the input file generated by BEAUTi,  which
+contains the data, model and analysis settings. 
+The final step is to explore the output of BEAST in order to diagnose problems and to summarize the results.
+
+\section{BEAUti}
+
+The program BEAUti is a user-friendly program for setting the
+model parameters for BEAST. Run BEAUti by double clicking on its icon. Once running, \texttt{BEAUti} will look similar irrespective
+of which computer system it is running on. For this tutorial, the Mac OS X version is used in the figures but
+the Linux and Windows versions will have the same layout and functionality.
+
+%\TODO{Provide instructions for executing BEAUti  in a Linux environment.}
+
+\subsection{Loading the NEXUS file }
+
+To load a NEXUS format alignment, simply select the \texttt{Import Alignment...} option from the \texttt{File} menu, or drag the file into the middle of {\bf Partitions} panel. 
+
+The example file called \href{https://github.com/CompEvol/beast2/blob/master/examples/nexus/primate-mtDNA.nex?raw=true}{primate-mtDNA.nex} is available from the {\tt examples/nexus/} directory for Mac and Linux and  {\tt examples/nexus/}for Windows inside the directory where BEAST was installed. Or click the link to download the data. After the data is opened in your web browser, right click mouse and save it as \texttt{primate-mtDNA.nex}.
+This file contains an alignment of sequences of 12 species of primates. 
+
+%It looks like this (the lines have been truncated):
+%
+%\begin{verbatim}
+%#NEXUS
+%begin data;
+%dimensions ntax=12 nchar=898;
+%format datatype=dna interleave=no gap=-;
+%matrix
+%Tarsius_syrichta  AAGTTTCATTGGAGCCACCACTCTTATAATTGCCCATGGCCTCACC
+%Lemur_catta       AAGCTTCATAGGAGCAACCATTCTAATAATCGCACATGGCCTTACA
+%Homo_sapiens	     AAGCTTCACCGGCGCAGTCATTCTCATAATCGCCCACGGGCTTACA
+%Pan               AAGCTTCACCGGCGCAATTATCCTCATAATCGCCCACGGACTTACA
+%Gorilla           AAGCTTCACCGGCGCAGTTGTTCTTATAATTGCCCACGGACTTACA
+%Pongo             AAGCTTCACCGGCGCAACCACCCTCATGATTGCCCATGGACTCACA
+%Hylobates         AAGCTTTACAGGTGCAACCGTCCTCATAATCGCCCACGGACTAACC
+%Macaca_fuscata    AAGCTTTTCCGGCGCAACCATCCTTATGATCGCTCACGGACTCACC
+%M_mulatta         AAGCTTTTCTGGCGCAACCATCCTCATGATTGCTCACGGACTCACC
+%M_fascicularis    AAGCTTCTCCGGCGCAACCACCCTTATAATCGCCCACGGGCTCACC
+%M_sylvanus        AAGCTTCTCCGGTGCAACTATCCTTATAGTTGCCCATGGACTCACC
+%Saimiri_sciureus	 AAGCTTCACCGGCGCAATGATCCTAATAATCGCTCACGGGTTTACT
+%;
+%end;
+%
+%begin assumptions;
+%	charset firsthalf = 1-449;
+%	charset secondhalf = 450-898;
+%end;
+%end;\end{verbatim}
+%
+%\medskip{}
+
+%\begin{figure}
+%
+%\includeimage[width=\textwidth]{figures/ImportNexus}
+%
+%\caption{A screenshot of the import nexus file menu option in BEAUti. \TODO{Need to have the correct menu shortcuts for OS X!}}
+%\label{fig:BEAUti_ImportNexus}
+%\end{figure}
+
+An \texttt{Add Partition} window (Figure \ref{fig:addPartition}) would pop up if the related package is installed. If you are using ``pure'' BEAST 2, you can go to the next paragraph.    
+Otherwise, select \texttt{Add Alignment} and click \textbf{OK} to continue.
+
+\begin{figure}
+\centering	
+\includeimage[width=0.5\textwidth]{figures/AddPartition}
+\caption{Add Partition window (Only appear if related packages are installed).}
+\label{fig:addPartition}
+\end{figure}
+
+If there is any coding overlaps in the partitions, the warning message window (Figure \ref{fig:warning}) will appear. Read and click \textbf{OK} to continue.
+
+\begin{figure}	
+\centering	
+\includeimage[width=0.9\textwidth]{figures/warning}
+\caption{Warning message window (Only appear if there is any coding overlaps in the partitions).}
+\label{fig:warning}
+\end{figure}
+
+Once loaded, five character partitions are displayed in the main panel (Figure \ref{fig:BEAUTI_DataPartitions}). The alignment is divided into a protein coding part and a non-coding part,and the coding part is divided in codon positions 1, 2 and 3. 
+{\bf You must remove the `coding' partition before continuing to the next step as it refers to the same nucleotides as partitions `1stpos', `2ndpos' and `3rdpos'.} To remove the `coding' partition select the row and click the `-' button at the bottom of the table. 
+You can view the alignment by double clicking the partition.
+
+\begin{figure}
+\centering	
+\includeimage[width=0.9\textwidth]{figures/BEAUti_DataPartitions}
+\caption{A screenshot of the data tab in BEAUti. This and all following screenshots
+were taken on an Apple computer running Mac OS X and will look slightly different on other operating systems.}
+\label{fig:BEAUTI_DataPartitions}
+\end{figure}
+
+%\begin{figure}[h]
+%
+%\includeimage[width=\textwidth]{figures/AlignmentViewer}
+%
+%\caption{A screenshot of the alignment viewer in BEAUti.}
+%\label{fig:BEAUTI_AlignmentViewer}
+%\end{figure}
+
+\subsection*{Link/Unlink partition models}
+
+\begin{figure}
+\centering	
+\includeimage[width=0.9\textwidth]{figures/BEAUti_DataPartitions_final}
+\caption{A screenshot of the Partitions tab in BEAUti after linking and renaming the clock model and tree.}
+\label{fig:BEAUti_DataPartitions_final}
+\end{figure}
+
+Since the sequences are linked (i.e. they are all from the mitochondrial genome
+which is not believed to undergo recombination in birds and mammals) they
+share the same ancestry, so the partitions should share the same time-tree in
+the model. For the sake of simplicity, we will also assume the partitions share
+the same evolutionary rate for each branch, and hence the same ``clock model''.
+We will restrict our modelling of rate heterogeneity to among-site heterogeneity
+within each partition, and also allow the partitions to have different mean rates of evolution. 
+
+So, at this point we will need to link the clock model and tree. In the {\bf Partitions} panel, select all four partitions in the table (or none, by default all partitions are affected) and click the \texttt{Link Trees} button and then the \texttt{Link Clock Models} button (see Figure \ref{fig:BEAUti_DataPartitions_final}). Then click on the first drop-down menu in the Clock Model column and rename the shared clock model to `clock'. Likewise rename the shared tree to `tree'. This will ma [...]
+
+
+\subsection{Setting the substitution model}
+
+The next step is to set up the substitution model. 
+%First we will temporarily link the site models in the Partitions panel so that we can change the model of all partitions simultaneously. 
+Then, select the {\bf Site Models} tab at the top of the main window (we skip the {\bf Tip Dates} tab since all taxa are from contemporary
+samples). This will reveal the evolutionary model settings for BEAST. The options available depend on whether the data are nucleotides, or amino acids, binary data, or general data. The settings that will appear after loading the primate nucleotide alignment will be the default values for nucleotide data so we need to make some changes. 
+
+\begin{figure}
+\centering	
+\includeimage[width=0.9\textwidth]{figures/BEAUti_Model}
+\caption{A screenshot of the site model tab in BEAUti.}
+\label{fig:BEAUti_Model}
+\end{figure}
+
+Most of the models should be familiar to you. %(see Chapter {\ref{chapter:SubstitutionModels} for details}). 
+First, set the \textbf{Gamma Category Count} to 4 and then tick the `estimate' box for the \textbf{Shape} parameter. This will allow rate variation 
+between sites in each partition to be modelled.  Note that 4 to 6 categories works sufficiently well for most data
+sets, while having more categories takes more time to compute for little added benefit. We leave the Proportion Invariant entry set to zero.
+
+Then select  \textbf{HKY} from the \textbf{Subst Model} drop-down menu. Ideally, a substitution model should be selected that fit the data best for each partition, but here for the sake of simplicity we use HKY for all partitions. Further, select \textbf{Empirical} from the \textbf{Frequencies} drop-down menu. This will fix the frequencies to the proportions observed in the data (for each partition individually, once we unlink the site models). This approach means that we can get a good  [...]
+
+\begin{figure}
+\centering	
+\includeimage[width=0.9\textwidth]{figures/cloneFrom}
+\caption{clone configuration from one site model to others.}
+\label{fig:cloneFrom}
+\end{figure}
+
+Finally check the `estimate' box for the \textbf{Substitution rate} parameter and select the \textbf{Fix mean mutation rate} check box. This will allow the individual partitions to have their relative rates estimated for unlinked the site models (Figure \ref{fig:BEAUti_Model}).
+
+%Now, return to the {\bf Partitions} panel and unlink the site models so that each partition has its own named site model with independent substitution model parameters and relative rate.
+
+At last, hold `shift' key to select all site models on the left side, and click \textbf{OK} to clone the setting from \textbf{noncoding} into \textbf{1stpos}, \textbf{2ndpos} and \textbf{3rdpos} (Figure \ref{fig:cloneFrom}). Go through each site model, as you can see, their configurations are same now. 
+
+
+\subsection{Setting the clock model}
+
+The next step is to select the {\bf Clock Models} tab at the top of the
+main window. This is where we select the molecular clock model. For this exercise we are going to leave the selection at the {\it default} value of a \textbf{strict molecular clock}, because this data is very clock-like, and does not need rate variation among branches to be included in the model.
+
+To test for clock-likeness, you can (i) run the analysis with
+a relaxed clock model and check how much variation among rates are implied
+by the data (see coefficient of variation for more on this), or
+(ii) perform a model comparison between a strict and relaxed clock using path
+sampling, or (iii) use a random local clock model \cite{drummond2010bayesian}
+which explicitly considers whether each branch in the tree needs its own branch
+rate.
+
+%\begin{figure}
+%\includeimage[width=\textwidth]{figures/BEAUti_Clock}
+%\caption{A screenshot of the clock model tab in BEAUti.}
+%\label{fig:BEAUti_Clock}
+%\end{figure}
+
+\subsection{Priors }
+
+The {\bf Priors} tab allows priors to be specified for each parameter in the
+model. The model selections made in the site model and clock model tabs, result in the inclusion of various parameters
+in the model, and these are shown in the priors tab (see Figure \ref{fig:BEAUti_Prior1}).
+
+\begin{figure}
+\centering
+\includeimage[width=\textwidth]{figures/BEAUti_Prior1}
+\caption{A screenshot of the Priors tab in BEAUti. }
+\label{fig:BEAUti_Prior1}
+\end{figure}
+
+Here we also specify that we wish to use the Calibrated Yule model \cite{Heled:2012fk}
+as the tree prior. The Yule model is a simple model of
+speciation that is generally more appropriate when considering sequences from
+different species. %(see Section \ref{section:YuleBirthDeathModels} for details).
+Select the \texttt{Calibrated Yule Model} from the {\bf Tree prior} dropdown menu.
+
+%\begin{figure}
+%\includeimage[width=\textwidth]{figures/BEAUti_Tree}
+%\caption{A screenshot of the tree prior drop down menu in BEAUti.}
+%\label{fig:BEAUti_Tree}
+%\end{figure}
+
+\subsubsection{Defining the calibration node}
+
+We now need to specify a prior distribution on the calibrated node, based on our
+fossil knowledge. This is known as calibrating our tree. To define an extra prior, press the small {\bf +} button below list of priors. If it is not visible in your view, please scroll down the panel to the bottom to find {\bf +} button. 
+You will see a dialog that allows you to define a subset of the taxa in the phylogenetic tree. Once you have created a taxa set you will be able to add calibration information for its most recent common
+ancestor (MRCA) later on. 
+
+Name the taxa set by filling in the taxon set label entry. 
+Call it \texttt{human-chimp}, since it will contain the taxa for {\it Homo sapiens} and {\it Pan}. 
+In the list below you will see the available taxa. Select each of the two taxa in turn and press the $> >$ arrow button. (Figure \ref{fig:BEAUti_TaxonSets}).
+Click OK and the newly defined taxa set will be added in to the prior list.
+As this is a calibrated node to be used in conjunction with the Calibrated Yule prior, monophyly must be enforced, so select the checkbox marked \texttt{Monophyletic}. This will constrain the tree topology so that the human-chimp grouping is kept monophyletic during the course of the MCMC analysis.
+
+\begin{figure}
+\centering
+\includeimage[width=9cm]{figures/BEAUti_TaxonSets}
+\caption{Taxon set editor in BEAUti.}
+\label{fig:BEAUti_TaxonSets}
+\end{figure}
+
+To encode the calibration information we need to specify a distribution for the MRCA of human-chimp.
+Select the \textbf{Log-normal} distribution from the drop down menu to the right of the newly added \texttt{human-chimp.prior}. 
+Click on the black triangle and a graph of the probability density function will appear, along with parameters for the log normal distribution.
+We are going to set $M=1.78$ and $S=0.085$ which will specify a distribution centred at about 6 million
+years with a standard deviation of about 0.5 million years. This will give
+a central 95\% probability range covering 5-7 Mya. This roughly corresponds to the current consensus
+estimate of the date of the most recent common ancestor of humans and chimpanzees (Figure \ref{fig:BEAUti_Prior2}).
+
+%We now need to specify a prior distribution on the calibrated node, based on our prior fossil knowledge. This is known
+%as calibrating our tree. Select the \textbf{Log Normal} distribution from the drop down menu to the right of the newly added \texttt{human-%chimp.prior}. Click on the black triangle to the right and a graph of the probability density function will appear, along with parameters for the log-%normal distribution.
+%We are going to specify a normal distribution centered at 6 million years with a standard deviation of 0.5 million years. This will give a central 95\% range of about 5-7 My. 
+%This roughly corresponds to the current consensus estimate of the date of the most recent common ancestor of humans and chimpanzees (Figure %\ref{fig:BEAUti_TaxonSets}).
+
+\begin{figure}
+\centering	
+\includeimage[width=\textwidth]{figures/BEAUti_Prior2}
+\caption{A screenshot of the calibration prior options in the Priors panel in BEAUti.}
+\label{fig:BEAUti_Prior2}
+\end{figure}
+
+We should convince ourselves that the priors shown in the priors panel really reflect the prior information we have about the parameters of the model. Finally we will also specify some diffuse ``uninformative'' but proper priors on the overall molecular clock rate (\texttt{clockRate}) and the speciation rate (\texttt{birthRateY}) of the Yule tree prior. For each of them, select \textbf{Gamma} from the drop-down menu
+and using the arrow button, expand the view to reveal the parameters of the
+Gamma prior. For both the clock rate and the Yule birth rate set the Alpha
+(shape) parameter to 0.001 and the Beta (scale) parameter to 1000 (Figure \ref{fig:GammaPrior}).
+
+By default each of the gamma shape parameters has an exponential prior
+distribution with a mean of 1. This implies (see Figure 3.7) we expect some
+rate variation. By default the kappa parameters for the HKY model have a log
+normal(1,1.25) prior distribution, which broadly agrees with empirical evidence
+\cite{rosenberg2003patterns} on the range of realistic values for transition/transversion
+bias. These default priors are kept since they are suitable for this particular
+analysis.
+
+\begin{figure}
+\centering
+\includeimage[width=\textwidth]{figures/GammaPrior}
+\caption{Gamma prior.}
+\label{fig:GammaPrior}
+\end{figure}
+
+%Finally, put a log-normal distribution on the kappa parameters. \TODO{with what M and S parameters?}
+%The clock model parameters will appear when the clock rate is estimated. 
+%The priors table should now look like Figure \ref{fig:BEAUti_Prior2}.
+
+%\begin{figure}
+%\includeimage[width=\textwidth]{figures/BEAUti_Prior2}
+%\label{fig:BEAUti_Prior2}
+%\caption{A screenshot of the newly added calibration prior in the Priors panel in BEAUti. \TODO{This figure needs to be changed to remove the HomiCerco.prior.}}
+%\end{figure}
+
+\subsection{Setting the MCMC options}
+
+%Ignore the \textbf{Operators} tab as this just contains technical
+%settings affecting the efficiency of the MCMC program (see Notes for details). 
+
+The next tab, {\bf MCMC}, provides more general
+settings to control the length of the MCMC run and the file names. 
+
+Firstly we have the \textbf{Chain Length}. This is the number of
+steps the MCMC will make in the chain before finishing. How long this
+should be depends on the size of the data set, the complexity of the
+model and the quality of answer required. The default value of 10,000,000
+is entirely arbitrary and should be adjusted according to the size
+of your data set. For this data set let's set the \texttt{chain
+length} to \underline{\chainLength{}} as this will run reasonably quickly on most modern
+computers (a few minutes).
+
+%\begin{figure}
+%\includeimage[width=\textwidth]{figures/BEAUti_MCMC}
+%\label{fig:BEAUti_MCMC}
+%\caption{A screenshot of the MCMC panel in BEAUti.}
+%\end{figure}
+
+The \textbf{Store Every} field determines how often the state is stored to file. Storing
+the state periodically is useful for situations where the computing environment
+is not very reliable and a BEAST run can be interrupted. Having a stored copy
+of the recent state allows you to resume the chain instead of restarting from the
+beginning, so you do not need to get through burn-in again.
+The \textbf{Pre Burnin} field specifies the number of samples that are not logged at the very beginning of
+the analysis. We leave the \textbf{Store Every} and \textbf{Pre Burnin} fields set to their default
+values. Below these are the details of the log files. Each one can be expanded by
+clicking the black triangle.
+
+The next options specify how often the parameter values in the Markov
+chain should be displayed on the screen and recorded in the log file.
+The screen output is simply for monitoring the programs progress so
+can be set to any value (although if set too small, the sheer quantity
+of information being displayed on the screen will actually slow the
+program down). For the log file, the value should be set relative
+to the total length of the chain. Sampling too often will result in
+very large files with little extra benefit in terms of the accuracy
+of the analysis. Sample too infrequently and the log file will not
+record sufficient information about the distributions of the parameters. 
+You probably want to aim to store no more than 10,000 samples so this should be
+set to no less than chain length / 10,000.
+
+For this exercise we will set the \texttt{trace log} and the \texttt{tree log} frequency to \underline{\logEvery{}}
+and the \texttt{screen log} to \underline{\screenEvery{}}.
+Also specify \texttt{Primates.log} as the file name of the trace log file
+and \texttt{Primates.trees} as the file name of the tree log file.
+Make sure that the file name filed of the screen log is left empty,
+or the screen log will not be written to the screen.
+
+\begin{itemize}
+\item If you are using the Windows operating system then we suggest you add the suffix \texttt{.txt} to both of these (so,
+\texttt{Primates.log.txt} and \texttt{Primates.trees.txt}) so that Windows recognizes
+these as text files. 
+\end{itemize}
+
+\subsection{Generating the BEAST XML file }
+
+We are now ready to create the BEAST XML file. To do this,
+select the \textbf{Save} option from the \textbf{File} menu. 
+Check the default priors, and save the file with an appropriate name
+(we usually end the filename with \texttt{.xml}, i.e., \texttt{Primates.xml}).
+We are now ready to run the file through BEAST. 
+
+\section{Running BEAST }
+
+\begin{figure}
+\centering	
+\includeimage[width=0.7\textwidth]{figures/BEAST}
+\caption{A screenshot of BEAST.}
+\label{fig:BEAST}
+\end{figure}
+
+Now run BEAST and when it asks for an input file, provide your newly
+created XML file as input. BEAST will then run until it has finished
+reporting information to the screen. The actual results files are
+save to the disk in the same location as your input file. The output to the screen will
+look something like this: 
+
+{\tiny   
+\begin{verbatim}
+
+             BEAST v2.2.0, 2002-2014
+       Bayesian Evolutionary Analysis Sampling Trees
+                 Designed and developed by
+Remco Bouckaert, Alexei J. Drummond, Andrew Rambaut and Marc A. Suchard
+                              
+               Department of Computer Science
+                   University of Auckland
+                  remco at cs.auckland.ac.nz
+                  alexei at cs.auckland.ac.nz
+                              
+             Institute of Evolutionary Biology
+                  University of Edinburgh
+                     a.rambaut at ed.ac.uk
+                              
+              David Geffen School of Medicine
+           University of California, Los Angeles
+                     msuchard at ucla.edu
+                              
+                Downloads, Help & Resources:
+                    	http://beast2.org/
+                              
+Source code distributed under the GNU Lesser General Public License:
+             	http://github.com/CompEvol/beast2
+                              
+                     BEAST developers:
+	Alex Alekseyenko, Trevor Bedford, Erik Bloomquist, Joseph Heled, 
+	Sebastian Hoehna, Denise Kuehnert, Philippe Lemey, Wai Lok Sibon Li, 
+	Gerton Lunter, Sidney Markowitz, Vladimir Minin, Michael Defoin Platel, 
+          	Oliver Pybus, Chieh-Hsi Wu, Walter Xie
+                              
+                         Thanks to:
+    	Roald Forsberg, Beth Shapiro and Korbinian Strimmer
+
+
+Random number seed: 777
+
+12 taxa
+898 sites
+413 patterns
+TreeLikelihood uses beast.evolution.likelihood.BeerLikelihoodCore4
+TreeLikelihood uses beast.evolution.likelihood.BeerLikelihoodCore4
+TreeLikelihood uses beast.evolution.likelihood.BeerLikelihoodCore4
+TreeLikelihood uses beast.evolution.likelihood.BeerLikelihoodCore4
+===============================================================================
+Citations for this model:
+
+Bouckaert RR, Heled J, Kuehnert D, Vaughan TG, Wu C-H, Xie D, Suchard MA,
+  Rambaut A, Drummond AJ (2014) BEAST 2: A software platform for Bayesian
+  evolutionary analysis. PLoS Computational Biology 10(4): e1003537
+
+Heled J, Drummond AJ (2012) Calibrated Tree Priors for Relaxed Phylogenetics
+  and Divergence Time Estimation. Systematic Biology 61(1):138-149.
+
+Hasegawa M, Kishino H, Yano T (1985) Dating the human-ape splitting by a
+  molecular clock of mitochondrial DNA. Journal of Molecular Evolution
+  22:160-174.
+
+===============================================================================
+Writing file /Primates.log
+Writing file /Primates.trees
+         Sample      posterior ESS(posterior)     likelihood          prior
+              0     -7924.3599              N     -7688.4922      -235.8676 --
+          10000     -5529.0700         2.0        -5459.1993       -69.8706 --
+          20000     -5516.8159         3.0        -5442.3372       -74.4786 --
+          30000     -5516.4959         4.0        -5439.0839       -77.4119 --
+          40000     -5521.1160         5.0        -5445.6047       -75.5113 --
+          50000     -5520.7350         6.0        -5444.6198       -76.1151 --
+          60000     -5512.9427         7.0        -5439.2561       -73.6866 2m39s/Msamples
+          70000     -5513.8357         8.0        -5437.9432       -75.8924 2m39s/Msamples
+          ...
+        5990000     -5516.6832       474.6        -5442.5945       -74.0886 2m40s/Msamples
+        6000000     -5512.3802       472.2        -5440.8928       -71.4874 2m40s/Msamples
+
+Operator                                                     Tuning   #accept   #reject     total  prob.acc
+ScaleOperator(treeScaler.t:tree)                              0.703     39935    174155    214090     0.187 
+ScaleOperator(treeRootScaler.t:tree)                          0.644     37329    177166    214495     0.174 
+Uniform(UniformOperator.t:tree)                                        479419   1668915   2148334     0.223 
+SubtreeSlide(SubtreeSlide.t:tree)                             9.922    272787    801404   1074191     0.254 
+Exchange(narrow.t:tree)                                                   744   1074261   1075005     0.001 
+Exchange(wide.t:tree)                                                       9    214594    214603     0.000 
+WilsonBalding(WilsonBalding.t:tree)                                         4    214548    214552     0.000 
+ScaleOperator(KappaScaler.s:noncoding)                        0.352      1739      5375      7114     0.244 
+DeltaExchangeOperator(FixMeanMutationRatesOperator)           0.425     17277    126203    143480     0.120 
+ScaleOperator(gammaShapeScaler.s:noncoding)                   0.375      1729      5428      7157     0.242 
+ScaleOperator(CalibratedYuleBirthRateScaler.t:tree)           0.245     58005    156128    214133     0.271 
+ScaleOperator(StrictClockRateScaler.c:clock)                  0.706     50080    164952    215032     0.233 
+UpDownOperator(strictClockUpDownOperator.c:clock)             0.589     50809    163882    214691     0.237 
+ScaleOperator(KappaScaler.s:1stpos)                            0.44      1816      5388      7204     0.252 
+ScaleOperator(gammaShapeScaler.s:1stpos)                       0.42      1927      5129      7056     0.273 
+ScaleOperator(KappaScaler.s:2ndpos)                           0.332      1964      5301      7265     0.270 
+ScaleOperator(gammaShapeScaler.s:2ndpos)                      0.303      2033      5177      7210     0.282 
+ScaleOperator(KappaScaler.s:3rdpos)                           0.505      1424      5860      7284     0.195 
+ScaleOperator(gammaShapeScaler.s:3rdpos)                      0.267      1569      5536      7105     0.221 
+
+Total calculation time: 964.067 seconds
+\end{verbatim}}
+
+Note that there is some useful information at the start concerning the alignments and which tree likelihoods are used. Also, all citations relevant for the analysis are mentioned at the start of the run, which can easily be copied to
+manuscripts reporting about the analysis. Then follows reporting of the chain,
+which gives some real time feedback on progress of the chain.
+
+At the end, an operator analysis is printed, which lists all operators used in the
+analysis together with how often the operator was tried, accepted, and rejected
+(see columns \#total, \#accept and \#reject respectively). The acceptance rate is
+the proportion of times an operator is accepted when it is selected for doing a
+proposal. In general, an acceptance rate that is high, say over 0.5 indicates the
+proposals are conservative and do not explore the parameter space efficiently. On
+the other hand a low acceptance rate indicates that proposals are too aggressive
+and almost always result in a state that is rejected because of its low posterior.
+Both too high and too low acceptance rates result in low ESS values. 
+An acceptance rate of 0.234 is the target (based on very limited evidence provided by \cite{gelman1996efficient}) for many (but not all) operators implemented in BEAST.
+
+Some operators have a tuning parameter, for example the scale factor of a
+scale parameter. If the final acceptance rate is not near the target, BEAST will
+suggest a new value for the tuning parameter, which is printed in the operator analysis. In this case, all acceptance rates are good for the operators that have tuning parameters. Operators without tuning parameters include the wide
+exchange and Wilson-Balding operators for this analysis. Both these operators
+attempt to change the topology of the tree with large steps, but since the data
+supports a single topology overwhelmingly, these radical proposals are almost
+always rejected.
+
+\section{Analyzing the results}
+
+\begin{figure}
+\centering	
+\includeimage[width=0.9\textwidth]{figures/Tracer1}
+\caption{A screenshot of Tracer v{\TracerVersion}.}
+\label{fig:Tracer1}
+\end{figure}
+
+Run the program called {\bf Tracer} to analyze the output of BEAST. When the main
+window has opened, choose {\bf Import Trace File...} from the {\bf File} menu and select the file that
+BEAST has created called \texttt{Primates.log} (Figure \ref{fig:Tracer1}).
+
+Remember that MCMC is a stochastic algorithm so the actual numbers will not be exactly the same as those depicted in the figure.
+
+On the left hand side is a list of the different quantities that BEAST has logged to file. 
+There are traces for the posterior (this
+is the natural logarithm of the product of the tree likelihood and the prior density), and the continuous parameters. Selecting a trace
+on the left brings up analyses for this trace on the right hand side depending on tab that is selected. When first opened, the
+`posterior' trace is selected and various statistics of this trace are shown under the Estimates tab.
+In the top right of the window is a table of calculated statistics for the selected trace. 
+
+Select the \texttt{clockRate} parameter in the lefthand list to look at
+the average rate of evolution (averaged over the whole tree and all sites). Tracer will plot a (marginal posterior) histogram for the selected statistic and also give you
+summary statistics such as the mean and median. The 95\% HPD stands for {\it highest posterior density interval} and represents the most compact interval on the selected parameter that contains 95\% of the posterior probability. It can be loosely thought of as a Bayesian analog to a confidence interval. The \texttt{TreeHeight} parameter gives the marginal posterior distribution of the age of the root of the entire tree.
+
+Select the \texttt{TreeHeight} parameter and then Ctrl-click \texttt{mrcatime(human-chimp)}  (Command-click on Mac OS X). This will show a display of the age of the root and the calibration MRCA we specified earlier in BEAUti. You can verify that the divergence that we used to calibrate the tree
+(\texttt{mrcatime(human-chimp)}) has a posterior distribution that matches the prior distribution we specified (Figure \ref{fig:Tracer_divergences}).
+
+\begin{figure}
+\centering	
+\includeimage[width=0.9\textwidth]{figures/Tracer_divergences}
+\caption{A screenshot of the 95\% HPD intervals of the root height and the user-specified (human-chimp) MRCA in Tracer.}
+\label{fig:Tracer_divergences}
+\end{figure}
+
+\section{Marginal posterior estimates}
+
+To show the relative rates for the four partitions, select the mutationRate parameter for each of the four partitions, and select the marginal density tab in Tracer.
+Figure \ref{fig:Tracer_marginalDensity} shows the marginal densities for the relative substitution rates. The
+plot shows that codon positions 1 and 2 have substantially different rates (0.456
+versus 0.183) and both are far slower than codon position 3 with a relative rate of
+2.941. The noncoding partition has a rate intermediate between codon positions
+1 and 2 (0.346). Taken together this result suggests strong purifying selection in
+both the coding and noncoding regions of the alignment.
+
+%Likewise, a marginal posterior estimate can be obtained for the gamma shape
+%parameter and the kappa parameter, which are shown in Figures 6.10 and 6.11
+%respectively. The plot for the gamma shape parameter suggest that there is
+%considerable rate variation for all of the partitions with the least rate variation
+%in the third codon position.
+
+%The plot for the kappa parameter (Figure 6.11) shows that all partitions show
+%considerable transition/transversion bias, but that the third codon position in particular has a high bias with a mean of almost 29 more transitions than transversions.
+
+\begin{figure}
+\centering	
+\includeimage[width=\textwidth]{figures/Tracer_marginalDensity}
+\caption{A screenshot of the marginal posterior densities of the relative substitution rates of the four partitions (relative to the site-weighted mean rate).}
+\label{fig:Tracer_marginalDensity}
+\end{figure}
+
+
+%\if0
+\begin{figure}
+\centering	
+\includeimage[width=\textwidth]{figures/primatePriorPosteriorKappa}
+
+%\include{primatePriorPosteriorShape}
+\caption{The marginal prior and posterior densities for the shape ($\alpha$) parameters. The prior is in gray. The posterior density estimate for each partition is also shown: noncoding (orange) and first (red), second (green) and third (blue) codon positions.}
+\label{fig:primatePriorPosteriorShape}
+%\end{figure}
+
+%\begin{figure}
+%\centering	
+\includeimage[width=\textwidth]{figures/primatePriorPosteriorShape}
+
+%\input{primatePriorPosteriorKappa}
+\caption{The marginal prior and posterior densities for the transition/tranversion bias ($\kappa$) parameters. The prior is in gray. The posterior density estimate for each partition is also shown: noncoding (orange) and first (red), second (green) and third (blue) codon positions.}
+\label{fig:primatePriorPosteriorKappa}
+\end{figure}
+%\fi
+
+\newpage
+\subsection*{Questions}
+\vspace{5 mm}
+
+\textit{What is the estimated rate of molecular evolution for this gene tree (include the 95\% HPD interval)?}
+
+%\vspace{5 mm}
+%\framebox(420,30){}
+%\vspace{5 mm}
+
+\textit{What sources of error does this estimate include?}
+
+%\vspace{5 mm}
+%\framebox(420,30){}
+%\vspace{5 mm}
+
+%\item Does the rate of evolution differ substantially amongst different lineages in the tree?
+
+\textit{How old is the root of the tree (give the mean and the 95\% HPD range)?}
+
+%\vspace{5 mm}
+%\framebox(420,30){}
+%\vspace{5 mm}
+  
+%The \texttt{coefficientOfVariation} statistic gives a summary of how much the rate of evolution varies from lineage to lineage (expressed as a proportion of the mean rate).
+%   
+%\bigskip{}
+%
+%Selecting the \texttt{treeModel.rootHeight} parameter gives the marginal posterior distribution of the age of the root of entire tree (i.e., the divergence between feline papillomavirus and canine oral %papillomavirus).
+%
+%\bigskip{}
+%
+%\textit{How old is the root of the tree (give the mean and the HPD range)?}
+%
+%\vspace{5 mm}
+%\framebox(420,30){}
+%\vspace{5 mm}
+\newpage
+
+\section{Obtaining an estimate of the phylogenetic tree}
+
+BEAST also produces a posterior sample of phylogenetic time-trees along with its sample of parameter estimates. 
+These need to be summarized using the program {\bf TreeAnnotator}. This will take the set of trees and find the best
+supported one. It will then annotate this representative summary tree with the mean ages of all the
+nodes and the corresponding 95\% HPD ranges. It will also calculate the posterior clade probability for each
+node. Run the TreeAnnotator program and set it up as depicted in Figure \ref{fig:TreeAnnotator1}.
+
+\begin{figure}
+\centering	
+\includeimage[width=0.9\textwidth]{figures/TreeAnnotator1}
+\caption{A screenshot of TreeAnnotator.}
+\label{fig:TreeAnnotator1}
+\end{figure}
+
+The burnin is the number of trees to remove from the start of the sample. Unlike {\bf Tracer} which specifies the number of
+steps as a burnin, in {\bf TreeAnnotator} you need to specify the actual number of trees. For this run, you specified a chain
+length of \chainLength{} steps sampling every \logEvery{} steps. Thus the trees file will contain \tracesNumber{} trees and so to specify a 10\% burnin
+in the top text field.
+
+The {\bf Posterior probability limit} option specifies a limit such that if a node is found at less than this frequency in the sample
+of trees (i.e., has a posterior probability less than this limit), it will not be annotated. The default of 0.5 means that only nodes
+seen in the majority of trees will be annotated. Set this to zero to annotate all nodes.
+
+The {\bf Target tree type} specifies the tree topology that will be annotated. You can either choose a specific tree from a file or ask TreeAnnotator to find a tree in your sample.
+The default option, {\bf Maximum clade credibility tree}, finds the tree with the highest product of the posterior probability of
+all its nodes.
+
+For node heights, the default is Common Ancestor Heights, which calculates
+the height of a node as the mean of the MRCA time of all pairs of nodes in
+the clade. For trees with large uncertainty in the topology and thus many clades
+with low support, some other methods can result in trees with negative branch
+lengths. In this analysis, the support for all clades in the summary tree is very
+high, so this is no issue here.
+Choose {\bf Mean heights} for node heights. This sets the heights (ages) of each node in the tree to the mean height across the
+entire sample of trees for that clade.
+
+For the input file, select the trees file that BEAST created and select a file for the
+output (here we called it \mccTree{}). Now press Run and wait for the program to finish.
+
+\section{Visualizing the tree estimate}
+
+Finally, we can visualize the tree in another program called {\bf FigTree}. Run this program, and open
+the \mccTree{} file by using the Open command in the File menu. The tree should appear.
+You can now try selecting some of the options in the control panel on the left. 
+First of all, expend {\bf Trees} option in the panel, and check {\bf Order nodes} and choose \textit{Ordering} by \textit{decreasing}. 
+Try selecting {\bf Node Bars} to get node age error bars. Also turn on {\bf Branch Labels} and select {\bf posterior} to get
+it to display the posterior probability for each node. 
+If you use a non strict clock model then under {\bf Appearance} you can also tell FigTree to colour the branches by the rate.
+You should end up with something similar to Figure \ref{fig:FigTree}.
+
+\begin{figure}
+\centering	
+\includeimage[width=0.9\textwidth]{figures/FigTree}
+\includeimage[width=0.9\textwidth]{figures/DensiTree}
+\caption{A screenshot of FigTree and DensiTree.}
+\label{fig:FigTree}
+\end{figure}
+
+An alternative view of the tree can be made with DensiTree, which is part of Beast 2. The advantage
+of DensiTree is that it is able to visualize both uncertainty in node heights and uncertainty in topology.
+For this particular dataset, the dominant topology is present in more than 99\% of the samples. So, 
+we conclude that this analysis results in a very high consensus on topology (Figure \ref{fig:FigTree}).
+
+
+%\begin{figure}
+%\begin{center}
+%\includeimage[width=0.7\textwidth]{figures/DensiTree}
+%\end{center}
+%\caption{A screenshot of DensiTree.}
+%\label{fig:DensiTree}
+%\end{figure}
+
+\newpage
+\subsection*{Questions}
+%\vspace{5 mm}
+
+\begin{enumerate}
+\item \textit{Does the rate of evolution differ substantially amongst different lineages in the tree?}
+
+%\vspace{5 mm}
+%\framebox(420,60){}
+%\vspace{5 mm}
+
+\item DensiTree has a clade bar (Menu Window/View clade toolbar) to show information on clades.
+
+\textit{What is the support for the clade [Homo\_sapiens, Pan, Gorilla, Hylobates]?}
+
+%\vspace{5 mm}
+%\framebox(420,30){}
+%\vspace{5 mm}
+
+\item You can browse through the topologies in DensiTree using the Browse menu.
+The most popular topology has a support of over 99\%.
+
+\textit{What is the support for the second most popular topology?}
+
+%\vspace{5 mm}
+%\framebox(420,30){}
+%\vspace{5 mm}
+
+\item Under the help menu, DensiTree shows some information.
+
+\textit{How many topologies are in the tree set?}
+
+%\vspace{5 mm}
+%\framebox(420,30){}
+%\vspace{5 mm}
+
+\end{enumerate}
+
+\newpage
+
+\section{Comparing your results to the prior}
+
+It is a good idea to rerun the analysis while sampling from the prior to make sure
+that interactions between priors are not affecting your prior information. The
+interaction between priors can be problematic especially when using calibrations
+since it means putting multiple priors on the tree.
+
+Using BEAUti, set up the same analysis but under the MCMC options, select the {\bf Sample from prior only} option. This will allow you to visualize the full prior distribution in the absence of your sequence data. Summarize the trees from the full prior
+distribution and compare the summary to the posterior summary tree.
+
+Divergence time estimation using ``node dating" of the type described in this
+chapter has been applied to answer a variety of different questions in ecology
+and evolution. For example, node dating with fossils was used in determining
+the species diversity of cycads \cite{nagalingum2011recent}, analysing the rate of
+evolution in flowering plants \cite{smith2008rates}, and investigating the
+origins of hot and cold desert cyanobacteria \cite{bahl2011ancient}.
+
+% \renewcommand{\refname}{Bibliography}% if you prefer this heading
+\bibliographystyle{amsplain} 
+\bibliography{DivergenceDatingTutorial}
+
+
+
+
+
+
+
+
+%\newpage
+
+
+\end{document}
+
+
diff --git a/doc/tutorials/DivergenceDating/DivergenceDatingTutorialv2.0.3.pdf b/doc/tutorials/DivergenceDating/DivergenceDatingTutorialv2.0.3.pdf
new file mode 100644
index 0000000..c5e1147
Binary files /dev/null and b/doc/tutorials/DivergenceDating/DivergenceDatingTutorialv2.0.3.pdf differ
diff --git a/doc/tutorials/DivergenceDating/DivergenceDatingTutorialv2.2.0.pdf b/doc/tutorials/DivergenceDating/DivergenceDatingTutorialv2.2.0.pdf
new file mode 100644
index 0000000..d327ad5
Binary files /dev/null and b/doc/tutorials/DivergenceDating/DivergenceDatingTutorialv2.2.0.pdf differ
diff --git a/doc/tutorials/DivergenceDating/figures/AddPartition.png b/doc/tutorials/DivergenceDating/figures/AddPartition.png
new file mode 100644
index 0000000..0eae992
Binary files /dev/null and b/doc/tutorials/DivergenceDating/figures/AddPartition.png differ
diff --git a/doc/tutorials/DivergenceDating/figures/AlignmentViewer.png b/doc/tutorials/DivergenceDating/figures/AlignmentViewer.png
new file mode 100644
index 0000000..4b975f8
Binary files /dev/null and b/doc/tutorials/DivergenceDating/figures/AlignmentViewer.png differ
diff --git a/doc/tutorials/DivergenceDating/figures/BEAST.png b/doc/tutorials/DivergenceDating/figures/BEAST.png
new file mode 100644
index 0000000..c9c67eb
Binary files /dev/null and b/doc/tutorials/DivergenceDating/figures/BEAST.png differ
diff --git a/doc/tutorials/DivergenceDating/figures/BEAUti_DataPartitions.png b/doc/tutorials/DivergenceDating/figures/BEAUti_DataPartitions.png
new file mode 100644
index 0000000..635ebb9
Binary files /dev/null and b/doc/tutorials/DivergenceDating/figures/BEAUti_DataPartitions.png differ
diff --git a/doc/tutorials/DivergenceDating/figures/BEAUti_DataPartitions_final.png b/doc/tutorials/DivergenceDating/figures/BEAUti_DataPartitions_final.png
new file mode 100644
index 0000000..07fe340
Binary files /dev/null and b/doc/tutorials/DivergenceDating/figures/BEAUti_DataPartitions_final.png differ
diff --git a/doc/tutorials/DivergenceDating/figures/BEAUti_Model.png b/doc/tutorials/DivergenceDating/figures/BEAUti_Model.png
new file mode 100644
index 0000000..33b7d06
Binary files /dev/null and b/doc/tutorials/DivergenceDating/figures/BEAUti_Model.png differ
diff --git a/doc/tutorials/DivergenceDating/figures/BEAUti_Prior1.png b/doc/tutorials/DivergenceDating/figures/BEAUti_Prior1.png
new file mode 100644
index 0000000..8a85bdf
Binary files /dev/null and b/doc/tutorials/DivergenceDating/figures/BEAUti_Prior1.png differ
diff --git a/doc/tutorials/DivergenceDating/figures/BEAUti_Prior2.png b/doc/tutorials/DivergenceDating/figures/BEAUti_Prior2.png
new file mode 100644
index 0000000..a9b4bd3
Binary files /dev/null and b/doc/tutorials/DivergenceDating/figures/BEAUti_Prior2.png differ
diff --git a/doc/tutorials/DivergenceDating/figures/BEAUti_TaxonSets.png b/doc/tutorials/DivergenceDating/figures/BEAUti_TaxonSets.png
new file mode 100644
index 0000000..d81104b
Binary files /dev/null and b/doc/tutorials/DivergenceDating/figures/BEAUti_TaxonSets.png differ
diff --git a/doc/tutorials/DivergenceDating/figures/DensiTree.png b/doc/tutorials/DivergenceDating/figures/DensiTree.png
new file mode 100644
index 0000000..6ed427a
Binary files /dev/null and b/doc/tutorials/DivergenceDating/figures/DensiTree.png differ
diff --git a/doc/tutorials/DivergenceDating/figures/FigTree.png b/doc/tutorials/DivergenceDating/figures/FigTree.png
new file mode 100644
index 0000000..ead5bc5
Binary files /dev/null and b/doc/tutorials/DivergenceDating/figures/FigTree.png differ
diff --git a/doc/tutorials/DivergenceDating/figures/GammaPrior.png b/doc/tutorials/DivergenceDating/figures/GammaPrior.png
new file mode 100644
index 0000000..6629c55
Binary files /dev/null and b/doc/tutorials/DivergenceDating/figures/GammaPrior.png differ
diff --git a/doc/tutorials/DivergenceDating/figures/Tracer1.png b/doc/tutorials/DivergenceDating/figures/Tracer1.png
new file mode 100644
index 0000000..953bb32
Binary files /dev/null and b/doc/tutorials/DivergenceDating/figures/Tracer1.png differ
diff --git a/doc/tutorials/DivergenceDating/figures/Tracer_divergences.png b/doc/tutorials/DivergenceDating/figures/Tracer_divergences.png
new file mode 100644
index 0000000..ea66f65
Binary files /dev/null and b/doc/tutorials/DivergenceDating/figures/Tracer_divergences.png differ
diff --git a/doc/tutorials/DivergenceDating/figures/Tracer_marginalDensity.png b/doc/tutorials/DivergenceDating/figures/Tracer_marginalDensity.png
new file mode 100644
index 0000000..46d851f
Binary files /dev/null and b/doc/tutorials/DivergenceDating/figures/Tracer_marginalDensity.png differ
diff --git a/doc/tutorials/DivergenceDating/figures/TreeAnnotator1.png b/doc/tutorials/DivergenceDating/figures/TreeAnnotator1.png
new file mode 100644
index 0000000..3c2e112
Binary files /dev/null and b/doc/tutorials/DivergenceDating/figures/TreeAnnotator1.png differ
diff --git a/doc/tutorials/DivergenceDating/figures/cloneFrom.png b/doc/tutorials/DivergenceDating/figures/cloneFrom.png
new file mode 100644
index 0000000..a1498f5
Binary files /dev/null and b/doc/tutorials/DivergenceDating/figures/cloneFrom.png differ
diff --git a/doc/tutorials/DivergenceDating/figures/primatePriorPosteriorKappa.pdf b/doc/tutorials/DivergenceDating/figures/primatePriorPosteriorKappa.pdf
new file mode 100644
index 0000000..83855a7
Binary files /dev/null and b/doc/tutorials/DivergenceDating/figures/primatePriorPosteriorKappa.pdf differ
diff --git a/doc/tutorials/DivergenceDating/figures/primatePriorPosteriorShape.pdf b/doc/tutorials/DivergenceDating/figures/primatePriorPosteriorShape.pdf
new file mode 100644
index 0000000..4a2059b
Binary files /dev/null and b/doc/tutorials/DivergenceDating/figures/primatePriorPosteriorShape.pdf differ
diff --git a/doc/tutorials/DivergenceDating/figures/warning.png b/doc/tutorials/DivergenceDating/figures/warning.png
new file mode 100644
index 0000000..7ff3abd
Binary files /dev/null and b/doc/tutorials/DivergenceDating/figures/warning.png differ
diff --git a/doc/tutorials/DivergenceDating/primatePriorPosteriorKappa.tex b/doc/tutorials/DivergenceDating/primatePriorPosteriorKappa.tex
new file mode 100644
index 0000000..bdcef91
--- /dev/null
+++ b/doc/tutorials/DivergenceDating/primatePriorPosteriorKappa.tex
@@ -0,0 +1,4721 @@
+% Created by tikzDevice version 0.6.2 on 2014-09-24 13:25:08
+% !TEX encoding = UTF-8 Unicode
+\documentclass[margin=1pt]{standalone}
+\usepackage{tikz}
+
+\begin{document}
+
+\begin{tikzpicture}[x=1pt,y=1pt]
+\definecolor[named]{drawColor}{rgb}{0.00,0.00,0.00}
+\definecolor[named]{fillColor}{rgb}{1.00,1.00,1.00}
+%\fill[color=fillColor,fill opacity=0.00,] (0,0) rectangle (325.21,216.81);
+\begin{scope}
+%\path[clip] (  0.00,  0.00) rectangle (325.21,216.81);
+\definecolor[named]{drawColor}{rgb}{0.00,0.00,0.00}
+
+\draw[color=drawColor,line cap=round,line join=round,fill opacity=0.00,] ( 49.20, 49.20) -- (293.48, 49.20);
+
+\draw[color=drawColor,line cap=round,line join=round,fill opacity=0.00,] ( 49.20, 49.20) -- ( 49.20, 43.20);
+
+\draw[color=drawColor,line cap=round,line join=round,fill opacity=0.00,] (110.27, 49.20) -- (110.27, 43.20);
+
+\draw[color=drawColor,line cap=round,line join=round,fill opacity=0.00,] (171.34, 49.20) -- (171.34, 43.20);
+
+\draw[color=drawColor,line cap=round,line join=round,fill opacity=0.00,] (232.41, 49.20) -- (232.41, 43.20);
+
+\draw[color=drawColor,line cap=round,line join=round,fill opacity=0.00,] (293.48, 49.20) -- (293.48, 43.20);
+
+\node[color=drawColor,anchor=base,inner sep=0pt, outer sep=0pt, scale=  1.00] at ( 49.20, 25.20) {0};
+
+\node[color=drawColor,anchor=base,inner sep=0pt, outer sep=0pt, scale=  1.00] at (110.27, 25.20) {10};
+
+\node[color=drawColor,anchor=base,inner sep=0pt, outer sep=0pt, scale=  1.00] at (171.34, 25.20) {20};
+
+\node[color=drawColor,anchor=base,inner sep=0pt, outer sep=0pt, scale=  1.00] at (232.41, 25.20) {30};
+
+\node[color=drawColor,anchor=base,inner sep=0pt, outer sep=0pt, scale=  1.00] at (293.48, 25.20) {40};
+
+\draw[color=drawColor,line cap=round,line join=round,fill opacity=0.00,] ( 49.20, 49.20) -- ( 49.20,203.61);
+
+\draw[color=drawColor,line cap=round,line join=round,fill opacity=0.00,] ( 49.20, 49.20) -- ( 43.20, 49.20);
+
+\draw[color=drawColor,line cap=round,line join=round,fill opacity=0.00,] ( 49.20, 87.80) -- ( 43.20, 87.80);
+
+\draw[color=drawColor,line cap=round,line join=round,fill opacity=0.00,] ( 49.20,126.41) -- ( 43.20,126.41);
+
+\draw[color=drawColor,line cap=round,line join=round,fill opacity=0.00,] ( 49.20,165.01) -- ( 43.20,165.01);
+
+\draw[color=drawColor,line cap=round,line join=round,fill opacity=0.00,] ( 49.20,203.61) -- ( 43.20,203.61);
+
+\node[color=drawColor,anchor=base east,inner sep=0pt, outer sep=0pt, scale=  1.00] at ( 37.20, 45.76) {0.0};
+
+\node[color=drawColor,anchor=base east,inner sep=0pt, outer sep=0pt, scale=  1.00] at ( 37.20, 84.36) {0.1};
+
+\node[color=drawColor,anchor=base east,inner sep=0pt, outer sep=0pt, scale=  1.00] at ( 37.20,122.96) {0.2};
+
+\node[color=drawColor,anchor=base east,inner sep=0pt, outer sep=0pt, scale=  1.00] at ( 37.20,161.56) {0.3};
+
+\node[color=drawColor,anchor=base east,inner sep=0pt, outer sep=0pt, scale=  1.00] at ( 37.20,200.17) {0.4};
+
+\draw[color=drawColor,line cap=round,line join=round,fill opacity=0.00,] ( 49.20, 49.20) --
+	(324.01, 49.20) --
+	(324.01,203.61) --
+	( 49.20,203.61) --
+	( 49.20, 49.20);
+\end{scope}
+\begin{scope}
+%\path[clip] (  0.00,  0.00) rectangle (325.21,216.81);
+\definecolor[named]{drawColor}{rgb}{0.00,0.00,0.00}
+
+\node[color=drawColor,anchor=base,inner sep=0pt, outer sep=0pt, scale=  1.00] at (186.61,  1.20) {Transition/transversion bias ($\kappa$)};
+
+\node[rotate= 90.00,color=drawColor,anchor=base,inner sep=0pt, outer sep=0pt, scale=  1.00] at ( 13.20,126.41) {Density};
+\end{scope}
+\begin{scope}
+\path[clip] ( 49.20, 49.20) rectangle (324.01,203.61);
+\definecolor[named]{fillColor}{rgb}{0.00,0.00,1.00}
+
+\draw[fill=fillColor,fill opacity=0.25,draw opacity=0.00,] ( 53.74, 49.20) --
+	( 53.88, 49.20) --
+	( 54.03, 49.21) --
+	( 54.18, 49.21) --
+	( 54.32, 49.21) --
+	( 54.47, 49.21) --
+	( 54.62, 49.21) --
+	( 54.76, 49.21) --
+	( 54.91, 49.22) --
+	( 55.06, 49.22) --
+	( 55.20, 49.22) --
+	( 55.35, 49.23) --
+	( 55.50, 49.23) --
+	( 55.65, 49.24) --
+	( 55.79, 49.24) --
+	( 55.94, 49.25) --
+	( 56.09, 49.26) --
+	( 56.23, 49.27) --
+	( 56.38, 49.28) --
+	( 56.53, 49.29) --
+	( 56.67, 49.30) --
+	( 56.82, 49.31) --
+	( 56.97, 49.32) --
+	( 57.11, 49.34) --
+	( 57.26, 49.35) --
+	( 57.41, 49.37) --
+	( 57.55, 49.38) --
+	( 57.70, 49.40) --
+	( 57.85, 49.41) --
+	( 58.00, 49.43) --
+	( 58.14, 49.45) --
+	( 58.29, 49.47) --
+	( 58.44, 49.48) --
+	( 58.58, 49.50) --
+	( 58.73, 49.52) --
+	( 58.88, 49.54) --
+	( 59.02, 49.55) --
+	( 59.17, 49.57) --
+	( 59.32, 49.58) --
+	( 59.46, 49.59) --
+	( 59.61, 49.60) --
+	( 59.76, 49.61) --
+	( 59.90, 49.62) --
+	( 60.05, 49.63) --
+	( 60.20, 49.63) --
+	( 60.35, 49.63) --
+	( 60.49, 49.64) --
+	( 60.64, 49.64) --
+	( 60.79, 49.63) --
+	( 60.93, 49.63) --
+	( 61.08, 49.62) --
+	( 61.23, 49.62) --
+	( 61.37, 49.61) --
+	( 61.52, 49.60) --
+	( 61.67, 49.59) --
+	( 61.81, 49.58) --
+	( 61.96, 49.57) --
+	( 62.11, 49.56) --
+	( 62.25, 49.54) --
+	( 62.40, 49.53) --
+	( 62.55, 49.52) --
+	( 62.69, 49.51) --
+	( 62.84, 49.50) --
+	( 62.99, 49.48) --
+	( 63.14, 49.47) --
+	( 63.28, 49.46) --
+	( 63.43, 49.46) --
+	( 63.58, 49.45) --
+	( 63.72, 49.44) --
+	( 63.87, 49.43) --
+	( 64.02, 49.43) --
+	( 64.16, 49.42) --
+	( 64.31, 49.41) --
+	( 64.46, 49.41) --
+	( 64.60, 49.41) --
+	( 64.75, 49.40) --
+	( 64.90, 49.40) --
+	( 65.04, 49.39) --
+	( 65.19, 49.39) --
+	( 65.34, 49.39) --
+	( 65.49, 49.38) --
+	( 65.63, 49.38) --
+	( 65.78, 49.38) --
+	( 65.93, 49.37) --
+	( 66.07, 49.37) --
+	( 66.22, 49.37) --
+	( 66.37, 49.37) --
+	( 66.51, 49.36) --
+	( 66.66, 49.36) --
+	( 66.81, 49.36) --
+	( 66.95, 49.36) --
+	( 67.10, 49.36) --
+	( 67.25, 49.36) --
+	( 67.39, 49.36) --
+	( 67.54, 49.37) --
+	( 67.69, 49.37) --
+	( 67.84, 49.38) --
+	( 67.98, 49.40) --
+	( 68.13, 49.41) --
+	( 68.28, 49.44) --
+	( 68.42, 49.46) --
+	( 68.57, 49.49) --
+	( 68.72, 49.53) --
+	( 68.86, 49.57) --
+	( 69.01, 49.63) --
+	( 69.16, 49.69) --
+	( 69.30, 49.76) --
+	( 69.45, 49.84) --
+	( 69.60, 49.93) --
+	( 69.74, 50.04) --
+	( 69.89, 50.16) --
+	( 70.04, 50.29) --
+	( 70.19, 50.44) --
+	( 70.33, 50.61) --
+	( 70.48, 50.80) --
+	( 70.63, 51.01) --
+	( 70.77, 51.24) --
+	( 70.92, 51.49) --
+	( 71.07, 51.76) --
+	( 71.21, 52.07) --
+	( 71.36, 52.41) --
+	( 71.51, 52.77) --
+	( 71.65, 53.16) --
+	( 71.80, 53.58) --
+	( 71.95, 54.04) --
+	( 72.09, 54.53) --
+	( 72.24, 55.05) --
+	( 72.39, 55.62) --
+	( 72.54, 56.21) --
+	( 72.68, 56.85) --
+	( 72.83, 57.53) --
+	( 72.98, 58.24) --
+	( 73.12, 58.99) --
+	( 73.27, 59.78) --
+	( 73.42, 60.61) --
+	( 73.56, 61.48) --
+	( 73.71, 62.39) --
+	( 73.86, 63.34) --
+	( 74.00, 64.32) --
+	( 74.15, 65.33) --
+	( 74.30, 66.39) --
+	( 74.44, 67.48) --
+	( 74.59, 68.61) --
+	( 74.74, 69.77) --
+	( 74.88, 70.96) --
+	( 75.03, 72.19) --
+	( 75.18, 73.45) --
+	( 75.33, 74.75) --
+	( 75.47, 76.08) --
+	( 75.62, 77.44) --
+	( 75.77, 78.84) --
+	( 75.91, 80.27) --
+	( 76.06, 81.75) --
+	( 76.21, 83.26) --
+	( 76.35, 84.80) --
+	( 76.50, 86.39) --
+	( 76.65, 88.02) --
+	( 76.79, 89.70) --
+	( 76.94, 91.42) --
+	( 77.09, 93.19) --
+	( 77.23, 95.01) --
+	( 77.38, 96.87) --
+	( 77.53, 98.78) --
+	( 77.68,100.75) --
+	( 77.82,102.77) --
+	( 77.97,104.83) --
+	( 78.12,106.93) --
+	( 78.26,109.08) --
+	( 78.41,111.28) --
+	( 78.56,113.52) --
+	( 78.70,115.80) --
+	( 78.85,118.10) --
+	( 79.00,120.43) --
+	( 79.14,122.79) --
+	( 79.29,125.17) --
+	( 79.44,127.57) --
+	( 79.58,129.97) --
+	( 79.73,132.38) --
+	( 79.88,134.79) --
+	( 80.03,137.20) --
+	( 80.17,139.59) --
+	( 80.32,141.98) --
+	( 80.47,144.34) --
+	( 80.61,146.68) --
+	( 80.76,149.00) --
+	( 80.91,151.29) --
+	( 81.05,153.54) --
+	( 81.20,155.76) --
+	( 81.35,157.94) --
+	( 81.49,160.09) --
+	( 81.64,162.19) --
+	( 81.79,164.24) --
+	( 81.93,166.25) --
+	( 82.08,168.21) --
+	( 82.23,170.12) --
+	( 82.38,171.97) --
+	( 82.52,173.76) --
+	( 82.67,175.49) --
+	( 82.82,177.16) --
+	( 82.96,178.76) --
+	( 83.11,180.30) --
+	( 83.26,181.74) --
+	( 83.40,183.10) --
+	( 83.55,184.38) --
+	( 83.70,185.58) --
+	( 83.84,186.68) --
+	( 83.99,187.68) --
+	( 84.14,188.56) --
+	( 84.28,189.33) --
+	( 84.43,190.00) --
+	( 84.58,190.56) --
+	( 84.72,191.01) --
+	( 84.87,191.33) --
+	( 85.02,191.53) --
+	( 85.17,191.61) --
+	( 85.31,191.59) --
+	( 85.46,191.46) --
+	( 85.61,191.23) --
+	( 85.75,190.87) --
+	( 85.90,190.43) --
+	( 86.05,189.90) --
+	( 86.19,189.29) --
+	( 86.34,188.62) --
+	( 86.49,187.87) --
+	( 86.63,187.06) --
+	( 86.78,186.21) --
+	( 86.93,185.33) --
+	( 87.07,184.42) --
+	( 87.22,183.48) --
+	( 87.37,182.53) --
+	( 87.52,181.57) --
+	( 87.66,180.62) --
+	( 87.81,179.67) --
+	( 87.96,178.72) --
+	( 88.10,177.79) --
+	( 88.25,176.87) --
+	( 88.40,175.96) --
+	( 88.54,175.07) --
+	( 88.69,174.19) --
+	( 88.84,173.33) --
+	( 88.98,172.47) --
+	( 89.13,171.62) --
+	( 89.28,170.77) --
+	( 89.42,169.92) --
+	( 89.57,169.07) --
+	( 89.72,168.21) --
+	( 89.87,167.33) --
+	( 90.01,166.43) --
+	( 90.16,165.51) --
+	( 90.31,164.56) --
+	( 90.45,163.58) --
+	( 90.60,162.57) --
+	( 90.75,161.51) --
+	( 90.89,160.41) --
+	( 91.04,159.27) --
+	( 91.19,158.09) --
+	( 91.33,156.85) --
+	( 91.48,155.56) --
+	( 91.63,154.22) --
+	( 91.77,152.84) --
+	( 91.92,151.40) --
+	( 92.07,149.92) --
+	( 92.22,148.38) --
+	( 92.36,146.79) --
+	( 92.51,145.16) --
+	( 92.66,143.49) --
+	( 92.80,141.79) --
+	( 92.95,140.04) --
+	( 93.10,138.25) --
+	( 93.24,136.44) --
+	( 93.39,134.60) --
+	( 93.54,132.74) --
+	( 93.68,130.87) --
+	( 93.83,128.97) --
+	( 93.98,127.07) --
+	( 94.12,125.16) --
+	( 94.27,123.25) --
+	( 94.42,121.35) --
+	( 94.56,119.45) --
+	( 94.71,117.56) --
+	( 94.86,115.69) --
+	( 95.01,113.83) --
+	( 95.15,111.99) --
+	( 95.30,110.18) --
+	( 95.45,108.39) --
+	( 95.59,106.64) --
+	( 95.74,104.91) --
+	( 95.89,103.22) --
+	( 96.03,101.56) --
+	( 96.18, 99.95) --
+	( 96.33, 98.37) --
+	( 96.47, 96.84) --
+	( 96.62, 95.34) --
+	( 96.77, 93.89) --
+	( 96.91, 92.48) --
+	( 97.06, 91.13) --
+	( 97.21, 89.82) --
+	( 97.36, 88.56) --
+	( 97.50, 87.35) --
+	( 97.65, 86.18) --
+	( 97.80, 85.07) --
+	( 97.94, 84.01) --
+	( 98.09, 83.00) --
+	( 98.24, 82.03) --
+	( 98.38, 81.11) --
+	( 98.53, 80.24) --
+	( 98.68, 79.42) --
+	( 98.82, 78.64) --
+	( 98.97, 77.90) --
+	( 99.12, 77.20) --
+	( 99.26, 76.54) --
+	( 99.41, 75.90) --
+	( 99.56, 75.31) --
+	( 99.71, 74.73) --
+	( 99.85, 74.18) --
+	(100.00, 73.65) --
+	(100.15, 73.13) --
+	(100.29, 72.63) --
+	(100.44, 72.14) --
+	(100.59, 71.65) --
+	(100.73, 71.17) --
+	(100.88, 70.70) --
+	(101.03, 70.22) --
+	(101.17, 69.74) --
+	(101.32, 69.26) --
+	(101.47, 68.77) --
+	(101.61, 68.28) --
+	(101.76, 67.79) --
+	(101.91, 67.29) --
+	(102.06, 66.79) --
+	(102.20, 66.28) --
+	(102.35, 65.77) --
+	(102.50, 65.26) --
+	(102.64, 64.75) --
+	(102.79, 64.24) --
+	(102.94, 63.73) --
+	(103.08, 63.23) --
+	(103.23, 62.72) --
+	(103.38, 62.23) --
+	(103.52, 61.74) --
+	(103.67, 61.25) --
+	(103.82, 60.78) --
+	(103.96, 60.32) --
+	(104.11, 59.86) --
+	(104.26, 59.42) --
+	(104.41, 58.99) --
+	(104.55, 58.57) --
+	(104.70, 58.16) --
+	(104.85, 57.77) --
+	(104.99, 57.38) --
+	(105.14, 57.02) --
+	(105.29, 56.67) --
+	(105.43, 56.33) --
+	(105.58, 56.01) --
+	(105.73, 55.70) --
+	(105.87, 55.40) --
+	(106.02, 55.12) --
+	(106.17, 54.86) --
+	(106.31, 54.61) --
+	(106.46, 54.37) --
+	(106.61, 54.15) --
+	(106.75, 53.94) --
+	(106.90, 53.75) --
+	(107.05, 53.56) --
+	(107.20, 53.39) --
+	(107.34, 53.24) --
+	(107.49, 53.09) --
+	(107.64, 52.96) --
+	(107.78, 52.83) --
+	(107.93, 52.72) --
+	(108.08, 52.62) --
+	(108.22, 52.52) --
+	(108.37, 52.43) --
+	(108.52, 52.35) --
+	(108.66, 52.28) --
+	(108.81, 52.21) --
+	(108.96, 52.15) --
+	(109.10, 52.09) --
+	(109.25, 52.04) --
+	(109.40, 51.99) --
+	(109.55, 51.94) --
+	(109.69, 51.90) --
+	(109.84, 51.86) --
+	(109.99, 51.82) --
+	(110.13, 51.79) --
+	(110.28, 51.76) --
+	(110.43, 51.73) --
+	(110.57, 51.70) --
+	(110.72, 51.67) --
+	(110.87, 51.64) --
+	(111.01, 51.61) --
+	(111.16, 51.59) --
+	(111.31, 51.56) --
+	(111.45, 51.53) --
+	(111.60, 51.51) --
+	(111.75, 51.48) --
+	(111.90, 51.45) --
+	(112.04, 51.42) --
+	(112.19, 51.39) --
+	(112.34, 51.36) --
+	(112.48, 51.32) --
+	(112.63, 51.29) --
+	(112.78, 51.25) --
+	(112.92, 51.20) --
+	(113.07, 51.16) --
+	(113.22, 51.11) --
+	(113.36, 51.06) --
+	(113.51, 51.01) --
+	(113.66, 50.96) --
+	(113.80, 50.90) --
+	(113.95, 50.84) --
+	(114.10, 50.78) --
+	(114.25, 50.72) --
+	(114.39, 50.65) --
+	(114.54, 50.59) --
+	(114.69, 50.52) --
+	(114.83, 50.45) --
+	(114.98, 50.38) --
+	(115.13, 50.32) --
+	(115.27, 50.25) --
+	(115.42, 50.18) --
+	(115.57, 50.12) --
+	(115.71, 50.05) --
+	(115.86, 49.99) --
+	(116.01, 49.93) --
+	(116.15, 49.88) --
+	(116.30, 49.82) --
+	(116.45, 49.77) --
+	(116.59, 49.72) --
+	(116.74, 49.68) --
+	(116.89, 49.63) --
+	(117.04, 49.60) --
+	(117.18, 49.56) --
+	(117.33, 49.53) --
+	(117.48, 49.50) --
+	(117.62, 49.47) --
+	(117.77, 49.45) --
+	(117.92, 49.43) --
+	(118.06, 49.42) --
+	(118.21, 49.40) --
+	(118.36, 49.40) --
+	(118.50, 49.39) --
+	(118.65, 49.39) --
+	(118.80, 49.38) --
+	(118.94, 49.39) --
+	(119.09, 49.39) --
+	(119.24, 49.40) --
+	(119.39, 49.41) --
+	(119.53, 49.42) --
+	(119.68, 49.43) --
+	(119.83, 49.45) --
+	(119.97, 49.47) --
+	(120.12, 49.48) --
+	(120.27, 49.50) --
+	(120.41, 49.52) --
+	(120.56, 49.54) --
+	(120.71, 49.56) --
+	(120.85, 49.58) --
+	(121.00, 49.60) --
+	(121.15, 49.62) --
+	(121.29, 49.64) --
+	(121.44, 49.66) --
+	(121.59, 49.68) --
+	(121.74, 49.69) --
+	(121.88, 49.70) --
+	(122.03, 49.71) --
+	(122.18, 49.72) --
+	(122.32, 49.72) --
+	(122.47, 49.73) --
+	(122.62, 49.73) --
+	(122.76, 49.73) --
+	(122.91, 49.72) --
+	(123.06, 49.71) --
+	(123.20, 49.70) --
+	(123.35, 49.69) --
+	(123.50, 49.68) --
+	(123.64, 49.66) --
+	(123.79, 49.64) --
+	(123.94, 49.62) --
+	(124.09, 49.60) --
+	(124.23, 49.58) --
+	(124.38, 49.56) --
+	(124.53, 49.54) --
+	(124.67, 49.51) --
+	(124.82, 49.49) --
+	(124.97, 49.47) --
+	(125.11, 49.45) --
+	(125.26, 49.43) --
+	(125.41, 49.41) --
+	(125.55, 49.39) --
+	(125.70, 49.37) --
+	(125.85, 49.35) --
+	(125.99, 49.33) --
+	(126.14, 49.32) --
+	(126.29, 49.31) --
+	(126.44, 49.29) --
+	(126.58, 49.28) --
+	(126.73, 49.27) --
+	(126.88, 49.26) --
+	(127.02, 49.25) --
+	(127.17, 49.25) --
+	(127.32, 49.24) --
+	(127.46, 49.23) --
+	(127.61, 49.23) --
+	(127.76, 49.22) --
+	(127.90, 49.22) --
+	(128.05, 49.22) --
+	(128.20, 49.21) --
+	(128.34, 49.21) --
+	(128.49, 49.21) --
+	(128.64, 49.21) --
+	(128.78, 49.21) --
+	cycle;
+\definecolor[named]{drawColor}{rgb}{0.00,0.00,1.00}
+
+\draw[color=drawColor,line width= 0.6pt,line cap=round,line join=round,fill opacity=0.00,] ( 53.74, 49.20) --
+	( 53.88, 49.20) --
+	( 54.03, 49.21) --
+	( 54.18, 49.21) --
+	( 54.32, 49.21) --
+	( 54.47, 49.21) --
+	( 54.62, 49.21) --
+	( 54.76, 49.21) --
+	( 54.91, 49.22) --
+	( 55.06, 49.22) --
+	( 55.20, 49.22) --
+	( 55.35, 49.23) --
+	( 55.50, 49.23) --
+	( 55.65, 49.24) --
+	( 55.79, 49.24) --
+	( 55.94, 49.25) --
+	( 56.09, 49.26) --
+	( 56.23, 49.27) --
+	( 56.38, 49.28) --
+	( 56.53, 49.29) --
+	( 56.67, 49.30) --
+	( 56.82, 49.31) --
+	( 56.97, 49.32) --
+	( 57.11, 49.34) --
+	( 57.26, 49.35) --
+	( 57.41, 49.37) --
+	( 57.55, 49.38) --
+	( 57.70, 49.40) --
+	( 57.85, 49.41) --
+	( 58.00, 49.43) --
+	( 58.14, 49.45) --
+	( 58.29, 49.47) --
+	( 58.44, 49.48) --
+	( 58.58, 49.50) --
+	( 58.73, 49.52) --
+	( 58.88, 49.54) --
+	( 59.02, 49.55) --
+	( 59.17, 49.57) --
+	( 59.32, 49.58) --
+	( 59.46, 49.59) --
+	( 59.61, 49.60) --
+	( 59.76, 49.61) --
+	( 59.90, 49.62) --
+	( 60.05, 49.63) --
+	( 60.20, 49.63) --
+	( 60.35, 49.63) --
+	( 60.49, 49.64) --
+	( 60.64, 49.64) --
+	( 60.79, 49.63) --
+	( 60.93, 49.63) --
+	( 61.08, 49.62) --
+	( 61.23, 49.62) --
+	( 61.37, 49.61) --
+	( 61.52, 49.60) --
+	( 61.67, 49.59) --
+	( 61.81, 49.58) --
+	( 61.96, 49.57) --
+	( 62.11, 49.56) --
+	( 62.25, 49.54) --
+	( 62.40, 49.53) --
+	( 62.55, 49.52) --
+	( 62.69, 49.51) --
+	( 62.84, 49.50) --
+	( 62.99, 49.48) --
+	( 63.14, 49.47) --
+	( 63.28, 49.46) --
+	( 63.43, 49.46) --
+	( 63.58, 49.45) --
+	( 63.72, 49.44) --
+	( 63.87, 49.43) --
+	( 64.02, 49.43) --
+	( 64.16, 49.42) --
+	( 64.31, 49.41) --
+	( 64.46, 49.41) --
+	( 64.60, 49.41) --
+	( 64.75, 49.40) --
+	( 64.90, 49.40) --
+	( 65.04, 49.39) --
+	( 65.19, 49.39) --
+	( 65.34, 49.39) --
+	( 65.49, 49.38) --
+	( 65.63, 49.38) --
+	( 65.78, 49.38) --
+	( 65.93, 49.37) --
+	( 66.07, 49.37) --
+	( 66.22, 49.37) --
+	( 66.37, 49.37) --
+	( 66.51, 49.36) --
+	( 66.66, 49.36) --
+	( 66.81, 49.36) --
+	( 66.95, 49.36) --
+	( 67.10, 49.36) --
+	( 67.25, 49.36) --
+	( 67.39, 49.36) --
+	( 67.54, 49.37) --
+	( 67.69, 49.37) --
+	( 67.84, 49.38) --
+	( 67.98, 49.40) --
+	( 68.13, 49.41) --
+	( 68.28, 49.44) --
+	( 68.42, 49.46) --
+	( 68.57, 49.49) --
+	( 68.72, 49.53) --
+	( 68.86, 49.57) --
+	( 69.01, 49.63) --
+	( 69.16, 49.69) --
+	( 69.30, 49.76) --
+	( 69.45, 49.84) --
+	( 69.60, 49.93) --
+	( 69.74, 50.04) --
+	( 69.89, 50.16) --
+	( 70.04, 50.29) --
+	( 70.19, 50.44) --
+	( 70.33, 50.61) --
+	( 70.48, 50.80) --
+	( 70.63, 51.01) --
+	( 70.77, 51.24) --
+	( 70.92, 51.49) --
+	( 71.07, 51.76) --
+	( 71.21, 52.07) --
+	( 71.36, 52.41) --
+	( 71.51, 52.77) --
+	( 71.65, 53.16) --
+	( 71.80, 53.58) --
+	( 71.95, 54.04) --
+	( 72.09, 54.53) --
+	( 72.24, 55.05) --
+	( 72.39, 55.62) --
+	( 72.54, 56.21) --
+	( 72.68, 56.85) --
+	( 72.83, 57.53) --
+	( 72.98, 58.24) --
+	( 73.12, 58.99) --
+	( 73.27, 59.78) --
+	( 73.42, 60.61) --
+	( 73.56, 61.48) --
+	( 73.71, 62.39) --
+	( 73.86, 63.34) --
+	( 74.00, 64.32) --
+	( 74.15, 65.33) --
+	( 74.30, 66.39) --
+	( 74.44, 67.48) --
+	( 74.59, 68.61) --
+	( 74.74, 69.77) --
+	( 74.88, 70.96) --
+	( 75.03, 72.19) --
+	( 75.18, 73.45) --
+	( 75.33, 74.75) --
+	( 75.47, 76.08) --
+	( 75.62, 77.44) --
+	( 75.77, 78.84) --
+	( 75.91, 80.27) --
+	( 76.06, 81.75) --
+	( 76.21, 83.26) --
+	( 76.35, 84.80) --
+	( 76.50, 86.39) --
+	( 76.65, 88.02) --
+	( 76.79, 89.70) --
+	( 76.94, 91.42) --
+	( 77.09, 93.19) --
+	( 77.23, 95.01) --
+	( 77.38, 96.87) --
+	( 77.53, 98.78) --
+	( 77.68,100.75) --
+	( 77.82,102.77) --
+	( 77.97,104.83) --
+	( 78.12,106.93) --
+	( 78.26,109.08) --
+	( 78.41,111.28) --
+	( 78.56,113.52) --
+	( 78.70,115.80) --
+	( 78.85,118.10) --
+	( 79.00,120.43) --
+	( 79.14,122.79) --
+	( 79.29,125.17) --
+	( 79.44,127.57) --
+	( 79.58,129.97) --
+	( 79.73,132.38) --
+	( 79.88,134.79) --
+	( 80.03,137.20) --
+	( 80.17,139.59) --
+	( 80.32,141.98) --
+	( 80.47,144.34) --
+	( 80.61,146.68) --
+	( 80.76,149.00) --
+	( 80.91,151.29) --
+	( 81.05,153.54) --
+	( 81.20,155.76) --
+	( 81.35,157.94) --
+	( 81.49,160.09) --
+	( 81.64,162.19) --
+	( 81.79,164.24) --
+	( 81.93,166.25) --
+	( 82.08,168.21) --
+	( 82.23,170.12) --
+	( 82.38,171.97) --
+	( 82.52,173.76) --
+	( 82.67,175.49) --
+	( 82.82,177.16) --
+	( 82.96,178.76) --
+	( 83.11,180.30) --
+	( 83.26,181.74) --
+	( 83.40,183.10) --
+	( 83.55,184.38) --
+	( 83.70,185.58) --
+	( 83.84,186.68) --
+	( 83.99,187.68) --
+	( 84.14,188.56) --
+	( 84.28,189.33) --
+	( 84.43,190.00) --
+	( 84.58,190.56) --
+	( 84.72,191.01) --
+	( 84.87,191.33) --
+	( 85.02,191.53) --
+	( 85.17,191.61) --
+	( 85.31,191.59) --
+	( 85.46,191.46) --
+	( 85.61,191.23) --
+	( 85.75,190.87) --
+	( 85.90,190.43) --
+	( 86.05,189.90) --
+	( 86.19,189.29) --
+	( 86.34,188.62) --
+	( 86.49,187.87) --
+	( 86.63,187.06) --
+	( 86.78,186.21) --
+	( 86.93,185.33) --
+	( 87.07,184.42) --
+	( 87.22,183.48) --
+	( 87.37,182.53) --
+	( 87.52,181.57) --
+	( 87.66,180.62) --
+	( 87.81,179.67) --
+	( 87.96,178.72) --
+	( 88.10,177.79) --
+	( 88.25,176.87) --
+	( 88.40,175.96) --
+	( 88.54,175.07) --
+	( 88.69,174.19) --
+	( 88.84,173.33) --
+	( 88.98,172.47) --
+	( 89.13,171.62) --
+	( 89.28,170.77) --
+	( 89.42,169.92) --
+	( 89.57,169.07) --
+	( 89.72,168.21) --
+	( 89.87,167.33) --
+	( 90.01,166.43) --
+	( 90.16,165.51) --
+	( 90.31,164.56) --
+	( 90.45,163.58) --
+	( 90.60,162.57) --
+	( 90.75,161.51) --
+	( 90.89,160.41) --
+	( 91.04,159.27) --
+	( 91.19,158.09) --
+	( 91.33,156.85) --
+	( 91.48,155.56) --
+	( 91.63,154.22) --
+	( 91.77,152.84) --
+	( 91.92,151.40) --
+	( 92.07,149.92) --
+	( 92.22,148.38) --
+	( 92.36,146.79) --
+	( 92.51,145.16) --
+	( 92.66,143.49) --
+	( 92.80,141.79) --
+	( 92.95,140.04) --
+	( 93.10,138.25) --
+	( 93.24,136.44) --
+	( 93.39,134.60) --
+	( 93.54,132.74) --
+	( 93.68,130.87) --
+	( 93.83,128.97) --
+	( 93.98,127.07) --
+	( 94.12,125.16) --
+	( 94.27,123.25) --
+	( 94.42,121.35) --
+	( 94.56,119.45) --
+	( 94.71,117.56) --
+	( 94.86,115.69) --
+	( 95.01,113.83) --
+	( 95.15,111.99) --
+	( 95.30,110.18) --
+	( 95.45,108.39) --
+	( 95.59,106.64) --
+	( 95.74,104.91) --
+	( 95.89,103.22) --
+	( 96.03,101.56) --
+	( 96.18, 99.95) --
+	( 96.33, 98.37) --
+	( 96.47, 96.84) --
+	( 96.62, 95.34) --
+	( 96.77, 93.89) --
+	( 96.91, 92.48) --
+	( 97.06, 91.13) --
+	( 97.21, 89.82) --
+	( 97.36, 88.56) --
+	( 97.50, 87.35) --
+	( 97.65, 86.18) --
+	( 97.80, 85.07) --
+	( 97.94, 84.01) --
+	( 98.09, 83.00) --
+	( 98.24, 82.03) --
+	( 98.38, 81.11) --
+	( 98.53, 80.24) --
+	( 98.68, 79.42) --
+	( 98.82, 78.64) --
+	( 98.97, 77.90) --
+	( 99.12, 77.20) --
+	( 99.26, 76.54) --
+	( 99.41, 75.90) --
+	( 99.56, 75.31) --
+	( 99.71, 74.73) --
+	( 99.85, 74.18) --
+	(100.00, 73.65) --
+	(100.15, 73.13) --
+	(100.29, 72.63) --
+	(100.44, 72.14) --
+	(100.59, 71.65) --
+	(100.73, 71.17) --
+	(100.88, 70.70) --
+	(101.03, 70.22) --
+	(101.17, 69.74) --
+	(101.32, 69.26) --
+	(101.47, 68.77) --
+	(101.61, 68.28) --
+	(101.76, 67.79) --
+	(101.91, 67.29) --
+	(102.06, 66.79) --
+	(102.20, 66.28) --
+	(102.35, 65.77) --
+	(102.50, 65.26) --
+	(102.64, 64.75) --
+	(102.79, 64.24) --
+	(102.94, 63.73) --
+	(103.08, 63.23) --
+	(103.23, 62.72) --
+	(103.38, 62.23) --
+	(103.52, 61.74) --
+	(103.67, 61.25) --
+	(103.82, 60.78) --
+	(103.96, 60.32) --
+	(104.11, 59.86) --
+	(104.26, 59.42) --
+	(104.41, 58.99) --
+	(104.55, 58.57) --
+	(104.70, 58.16) --
+	(104.85, 57.77) --
+	(104.99, 57.38) --
+	(105.14, 57.02) --
+	(105.29, 56.67) --
+	(105.43, 56.33) --
+	(105.58, 56.01) --
+	(105.73, 55.70) --
+	(105.87, 55.40) --
+	(106.02, 55.12) --
+	(106.17, 54.86) --
+	(106.31, 54.61) --
+	(106.46, 54.37) --
+	(106.61, 54.15) --
+	(106.75, 53.94) --
+	(106.90, 53.75) --
+	(107.05, 53.56) --
+	(107.20, 53.39) --
+	(107.34, 53.24) --
+	(107.49, 53.09) --
+	(107.64, 52.96) --
+	(107.78, 52.83) --
+	(107.93, 52.72) --
+	(108.08, 52.62) --
+	(108.22, 52.52) --
+	(108.37, 52.43) --
+	(108.52, 52.35) --
+	(108.66, 52.28) --
+	(108.81, 52.21) --
+	(108.96, 52.15) --
+	(109.10, 52.09) --
+	(109.25, 52.04) --
+	(109.40, 51.99) --
+	(109.55, 51.94) --
+	(109.69, 51.90) --
+	(109.84, 51.86) --
+	(109.99, 51.82) --
+	(110.13, 51.79) --
+	(110.28, 51.76) --
+	(110.43, 51.73) --
+	(110.57, 51.70) --
+	(110.72, 51.67) --
+	(110.87, 51.64) --
+	(111.01, 51.61) --
+	(111.16, 51.59) --
+	(111.31, 51.56) --
+	(111.45, 51.53) --
+	(111.60, 51.51) --
+	(111.75, 51.48) --
+	(111.90, 51.45) --
+	(112.04, 51.42) --
+	(112.19, 51.39) --
+	(112.34, 51.36) --
+	(112.48, 51.32) --
+	(112.63, 51.29) --
+	(112.78, 51.25) --
+	(112.92, 51.20) --
+	(113.07, 51.16) --
+	(113.22, 51.11) --
+	(113.36, 51.06) --
+	(113.51, 51.01) --
+	(113.66, 50.96) --
+	(113.80, 50.90) --
+	(113.95, 50.84) --
+	(114.10, 50.78) --
+	(114.25, 50.72) --
+	(114.39, 50.65) --
+	(114.54, 50.59) --
+	(114.69, 50.52) --
+	(114.83, 50.45) --
+	(114.98, 50.38) --
+	(115.13, 50.32) --
+	(115.27, 50.25) --
+	(115.42, 50.18) --
+	(115.57, 50.12) --
+	(115.71, 50.05) --
+	(115.86, 49.99) --
+	(116.01, 49.93) --
+	(116.15, 49.88) --
+	(116.30, 49.82) --
+	(116.45, 49.77) --
+	(116.59, 49.72) --
+	(116.74, 49.68) --
+	(116.89, 49.63) --
+	(117.04, 49.60) --
+	(117.18, 49.56) --
+	(117.33, 49.53) --
+	(117.48, 49.50) --
+	(117.62, 49.47) --
+	(117.77, 49.45) --
+	(117.92, 49.43) --
+	(118.06, 49.42) --
+	(118.21, 49.40) --
+	(118.36, 49.40) --
+	(118.50, 49.39) --
+	(118.65, 49.39) --
+	(118.80, 49.38) --
+	(118.94, 49.39) --
+	(119.09, 49.39) --
+	(119.24, 49.40) --
+	(119.39, 49.41) --
+	(119.53, 49.42) --
+	(119.68, 49.43) --
+	(119.83, 49.45) --
+	(119.97, 49.47) --
+	(120.12, 49.48) --
+	(120.27, 49.50) --
+	(120.41, 49.52) --
+	(120.56, 49.54) --
+	(120.71, 49.56) --
+	(120.85, 49.58) --
+	(121.00, 49.60) --
+	(121.15, 49.62) --
+	(121.29, 49.64) --
+	(121.44, 49.66) --
+	(121.59, 49.68) --
+	(121.74, 49.69) --
+	(121.88, 49.70) --
+	(122.03, 49.71) --
+	(122.18, 49.72) --
+	(122.32, 49.72) --
+	(122.47, 49.73) --
+	(122.62, 49.73) --
+	(122.76, 49.73) --
+	(122.91, 49.72) --
+	(123.06, 49.71) --
+	(123.20, 49.70) --
+	(123.35, 49.69) --
+	(123.50, 49.68) --
+	(123.64, 49.66) --
+	(123.79, 49.64) --
+	(123.94, 49.62) --
+	(124.09, 49.60) --
+	(124.23, 49.58) --
+	(124.38, 49.56) --
+	(124.53, 49.54) --
+	(124.67, 49.51) --
+	(124.82, 49.49) --
+	(124.97, 49.47) --
+	(125.11, 49.45) --
+	(125.26, 49.43) --
+	(125.41, 49.41) --
+	(125.55, 49.39) --
+	(125.70, 49.37) --
+	(125.85, 49.35) --
+	(125.99, 49.33) --
+	(126.14, 49.32) --
+	(126.29, 49.31) --
+	(126.44, 49.29) --
+	(126.58, 49.28) --
+	(126.73, 49.27) --
+	(126.88, 49.26) --
+	(127.02, 49.25) --
+	(127.17, 49.25) --
+	(127.32, 49.24) --
+	(127.46, 49.23) --
+	(127.61, 49.23) --
+	(127.76, 49.22) --
+	(127.90, 49.22) --
+	(128.05, 49.22) --
+	(128.20, 49.21) --
+	(128.34, 49.21) --
+	(128.49, 49.21) --
+	(128.64, 49.21) --
+	(128.78, 49.21);
+\definecolor[named]{fillColor}{rgb}{0.00,0.00,0.00}
+
+\draw[fill=fillColor,fill opacity=0.25,draw opacity=0.00,] ( 42.47, 49.20) --
+	( 42.85, 49.20) --
+	( 43.23, 49.20) --
+	( 43.62, 49.20) --
+	( 44.00, 49.20) --
+	( 44.39, 49.20) --
+	( 44.77, 49.20) --
+	( 45.15, 49.20) --
+	( 45.54, 49.20) --
+	( 45.92, 49.20) --
+	( 46.31, 49.20) --
+	( 46.69, 49.20) --
+	( 47.08, 49.20) --
+	( 47.46, 49.20) --
+	( 47.84, 49.20) --
+	( 48.23, 49.21) --
+	( 48.61, 49.21) --
+	( 49.00, 49.21) --
+	( 49.38, 49.21) --
+	( 49.76, 49.21) --
+	( 50.15, 49.21) --
+	( 50.53, 49.21) --
+	( 50.92, 49.21) --
+	( 51.30, 49.22) --
+	( 51.68, 49.22) --
+	( 52.07, 49.22) --
+	( 52.45, 49.22) --
+	( 52.84, 49.22) --
+	( 53.22, 49.23) --
+	( 53.61, 49.23) --
+	( 53.99, 49.23) --
+	( 54.37, 49.24) --
+	( 54.76, 49.24) --
+	( 55.14, 49.24) --
+	( 55.53, 49.25) --
+	( 55.91, 49.25) --
+	( 56.29, 49.25) --
+	( 56.68, 49.26) --
+	( 57.06, 49.26) --
+	( 57.45, 49.26) --
+	( 57.83, 49.27) --
+	( 58.22, 49.27) --
+	( 58.60, 49.28) --
+	( 58.98, 49.28) --
+	( 59.37, 49.28) --
+	( 59.75, 49.29) --
+	( 60.14, 49.29) --
+	( 60.52, 49.29) --
+	( 60.90, 49.30) --
+	( 61.29, 49.30) --
+	( 61.67, 49.30) --
+	( 62.06, 49.31) --
+	( 62.44, 49.31) --
+	( 62.82, 49.31) --
+	( 63.21, 49.31) --
+	( 63.59, 49.31) --
+	( 63.98, 49.32) --
+	( 64.36, 49.32) --
+	( 64.75, 49.32) --
+	( 65.13, 49.32) --
+	( 65.51, 49.32) --
+	( 65.90, 49.32) --
+	( 66.28, 49.32) --
+	( 66.67, 49.32) --
+	( 67.05, 49.32) --
+	( 67.43, 49.32) --
+	( 67.82, 49.32) --
+	( 68.20, 49.32) --
+	( 68.59, 49.32) --
+	( 68.97, 49.33) --
+	( 69.36, 49.33) --
+	( 69.74, 49.33) --
+	( 70.12, 49.33) --
+	( 70.51, 49.33) --
+	( 70.89, 49.33) --
+	( 71.28, 49.34) --
+	( 71.66, 49.34) --
+	( 72.04, 49.34) --
+	( 72.43, 49.35) --
+	( 72.81, 49.35) --
+	( 73.20, 49.36) --
+	( 73.58, 49.36) --
+	( 73.96, 49.37) --
+	( 74.35, 49.37) --
+	( 74.73, 49.38) --
+	( 75.12, 49.39) --
+	( 75.50, 49.40) --
+	( 75.89, 49.41) --
+	( 76.27, 49.42) --
+	( 76.65, 49.44) --
+	( 77.04, 49.45) --
+	( 77.42, 49.47) --
+	( 77.81, 49.48) --
+	( 78.19, 49.50) --
+	( 78.57, 49.52) --
+	( 78.96, 49.55) --
+	( 79.34, 49.57) --
+	( 79.73, 49.60) --
+	( 80.11, 49.63) --
+	( 80.50, 49.66) --
+	( 80.88, 49.70) --
+	( 81.26, 49.74) --
+	( 81.65, 49.79) --
+	( 82.03, 49.84) --
+	( 82.42, 49.89) --
+	( 82.80, 49.95) --
+	( 83.18, 50.02) --
+	( 83.57, 50.09) --
+	( 83.95, 50.17) --
+	( 84.34, 50.25) --
+	( 84.72, 50.35) --
+	( 85.11, 50.45) --
+	( 85.49, 50.56) --
+	( 85.87, 50.68) --
+	( 86.26, 50.81) --
+	( 86.64, 50.95) --
+	( 87.03, 51.10) --
+	( 87.41, 51.26) --
+	( 87.79, 51.44) --
+	( 88.18, 51.63) --
+	( 88.56, 51.83) --
+	( 88.95, 52.05) --
+	( 89.33, 52.27) --
+	( 89.71, 52.52) --
+	( 90.10, 52.78) --
+	( 90.48, 53.05) --
+	( 90.87, 53.35) --
+	( 91.25, 53.65) --
+	( 91.64, 53.98) --
+	( 92.02, 54.32) --
+	( 92.40, 54.68) --
+	( 92.79, 55.05) --
+	( 93.17, 55.44) --
+	( 93.56, 55.85) --
+	( 93.94, 56.28) --
+	( 94.32, 56.72) --
+	( 94.71, 57.18) --
+	( 95.09, 57.65) --
+	( 95.48, 58.14) --
+	( 95.86, 58.64) --
+	( 96.25, 59.16) --
+	( 96.63, 59.70) --
+	( 97.01, 60.24) --
+	( 97.40, 60.80) --
+	( 97.78, 61.37) --
+	( 98.17, 61.95) --
+	( 98.55, 62.54) --
+	( 98.93, 63.14) --
+	( 99.32, 63.75) --
+	( 99.70, 64.37) --
+	(100.09, 65.00) --
+	(100.47, 65.63) --
+	(100.85, 66.26) --
+	(101.24, 66.90) --
+	(101.62, 67.55) --
+	(102.01, 68.20) --
+	(102.39, 68.86) --
+	(102.78, 69.52) --
+	(103.16, 70.18) --
+	(103.54, 70.84) --
+	(103.93, 71.50) --
+	(104.31, 72.17) --
+	(104.70, 72.83) --
+	(105.08, 73.50) --
+	(105.46, 74.16) --
+	(105.85, 74.82) --
+	(106.23, 75.49) --
+	(106.62, 76.15) --
+	(107.00, 76.81) --
+	(107.39, 77.47) --
+	(107.77, 78.12) --
+	(108.15, 78.77) --
+	(108.54, 79.41) --
+	(108.92, 80.06) --
+	(109.31, 80.69) --
+	(109.69, 81.32) --
+	(110.07, 81.94) --
+	(110.46, 82.56) --
+	(110.84, 83.16) --
+	(111.23, 83.76) --
+	(111.61, 84.34) --
+	(111.99, 84.92) --
+	(112.38, 85.49) --
+	(112.76, 86.04) --
+	(113.15, 86.58) --
+	(113.53, 87.10) --
+	(113.92, 87.62) --
+	(114.30, 88.12) --
+	(114.68, 88.60) --
+	(115.07, 89.07) --
+	(115.45, 89.53) --
+	(115.84, 89.97) --
+	(116.22, 90.39) --
+	(116.60, 90.80) --
+	(116.99, 91.19) --
+	(117.37, 91.56) --
+	(117.76, 91.91) --
+	(118.14, 92.25) --
+	(118.53, 92.57) --
+	(118.91, 92.87) --
+	(119.29, 93.16) --
+	(119.68, 93.43) --
+	(120.06, 93.68) --
+	(120.45, 93.90) --
+	(120.83, 94.11) --
+	(121.21, 94.31) --
+	(121.60, 94.48) --
+	(121.98, 94.64) --
+	(122.37, 94.77) --
+	(122.75, 94.88) --
+	(123.13, 94.98) --
+	(123.52, 95.06) --
+	(123.90, 95.12) --
+	(124.29, 95.15) --
+	(124.67, 95.17) --
+	(125.06, 95.17) --
+	(125.44, 95.15) --
+	(125.82, 95.11) --
+	(126.21, 95.06) --
+	(126.59, 94.98) --
+	(126.98, 94.89) --
+	(127.36, 94.78) --
+	(127.74, 94.66) --
+	(128.13, 94.52) --
+	(128.51, 94.36) --
+	(128.90, 94.20) --
+	(129.28, 94.02) --
+	(129.67, 93.83) --
+	(130.05, 93.62) --
+	(130.43, 93.41) --
+	(130.82, 93.19) --
+	(131.20, 92.97) --
+	(131.59, 92.73) --
+	(131.97, 92.49) --
+	(132.35, 92.24) --
+	(132.74, 92.00) --
+	(133.12, 91.75) --
+	(133.51, 91.49) --
+	(133.89, 91.23) --
+	(134.28, 90.98) --
+	(134.66, 90.72) --
+	(135.04, 90.46) --
+	(135.43, 90.20) --
+	(135.81, 89.94) --
+	(136.20, 89.68) --
+	(136.58, 89.42) --
+	(136.96, 89.15) --
+	(137.35, 88.89) --
+	(137.73, 88.62) --
+	(138.12, 88.35) --
+	(138.50, 88.08) --
+	(138.88, 87.80) --
+	(139.27, 87.51) --
+	(139.65, 87.22) --
+	(140.04, 86.92) --
+	(140.42, 86.61) --
+	(140.81, 86.30) --
+	(141.19, 85.97) --
+	(141.57, 85.63) --
+	(141.96, 85.29) --
+	(142.34, 84.93) --
+	(142.73, 84.56) --
+	(143.11, 84.18) --
+	(143.49, 83.78) --
+	(143.88, 83.38) --
+	(144.26, 82.96) --
+	(144.65, 82.53) --
+	(145.03, 82.09) --
+	(145.42, 81.64) --
+	(145.80, 81.18) --
+	(146.18, 80.71) --
+	(146.57, 80.23) --
+	(146.95, 79.74) --
+	(147.34, 79.25) --
+	(147.72, 78.75) --
+	(148.10, 78.25) --
+	(148.49, 77.74) --
+	(148.87, 77.24) --
+	(149.26, 76.73) --
+	(149.64, 76.22) --
+	(150.02, 75.72) --
+	(150.41, 75.22) --
+	(150.79, 74.72) --
+	(151.18, 74.22) --
+	(151.56, 73.73) --
+	(151.95, 73.25) --
+	(152.33, 72.78) --
+	(152.71, 72.31) --
+	(153.10, 71.85) --
+	(153.48, 71.40) --
+	(153.87, 70.95) --
+	(154.25, 70.52) --
+	(154.63, 70.09) --
+	(155.02, 69.68) --
+	(155.40, 69.27) --
+	(155.79, 68.87) --
+	(156.17, 68.47) --
+	(156.56, 68.09) --
+	(156.94, 67.71) --
+	(157.32, 67.34) --
+	(157.71, 66.98) --
+	(158.09, 66.63) --
+	(158.48, 66.27) --
+	(158.86, 65.93) --
+	(159.24, 65.59) --
+	(159.63, 65.25) --
+	(160.01, 64.92) --
+	(160.40, 64.59) --
+	(160.78, 64.27) --
+	(161.16, 63.94) --
+	(161.55, 63.62) --
+	(161.93, 63.31) --
+	(162.32, 62.99) --
+	(162.70, 62.68) --
+	(163.09, 62.37) --
+	(163.47, 62.06) --
+	(163.85, 61.75) --
+	(164.24, 61.45) --
+	(164.62, 61.15) --
+	(165.01, 60.85) --
+	(165.39, 60.55) --
+	(165.77, 60.26) --
+	(166.16, 59.97) --
+	(166.54, 59.68) --
+	(166.93, 59.40) --
+	(167.31, 59.12) --
+	(167.70, 58.85) --
+	(168.08, 58.58) --
+	(168.46, 58.31) --
+	(168.85, 58.05) --
+	(169.23, 57.79) --
+	(169.62, 57.54) --
+	(170.00, 57.29) --
+	(170.38, 57.04) --
+	(170.77, 56.81) --
+	(171.15, 56.57) --
+	(171.54, 56.34) --
+	(171.92, 56.12) --
+	(172.30, 55.90) --
+	(172.69, 55.69) --
+	(173.07, 55.48) --
+	(173.46, 55.27) --
+	(173.84, 55.07) --
+	(174.23, 54.88) --
+	(174.61, 54.69) --
+	(174.99, 54.51) --
+	(175.38, 54.33) --
+	(175.76, 54.15) --
+	(176.15, 53.98) --
+	(176.53, 53.82) --
+	(176.91, 53.66) --
+	(177.30, 53.51) --
+	(177.68, 53.36) --
+	(178.07, 53.22) --
+	(178.45, 53.08) --
+	(178.84, 52.95) --
+	(179.22, 52.83) --
+	(179.60, 52.71) --
+	(179.99, 52.59) --
+	(180.37, 52.49) --
+	(180.76, 52.39) --
+	(181.14, 52.29) --
+	(181.52, 52.20) --
+	(181.91, 52.11) --
+	(182.29, 52.03) --
+	(182.68, 51.96) --
+	(183.06, 51.89) --
+	(183.45, 51.82) --
+	(183.83, 51.75) --
+	(184.21, 51.69) --
+	(184.60, 51.64) --
+	(184.98, 51.58) --
+	(185.37, 51.53) --
+	(185.75, 51.48) --
+	(186.13, 51.43) --
+	(186.52, 51.38) --
+	(186.90, 51.33) --
+	(187.29, 51.29) --
+	(187.67, 51.24) --
+	(188.05, 51.19) --
+	(188.44, 51.15) --
+	(188.82, 51.10) --
+	(189.21, 51.05) --
+	(189.59, 51.00) --
+	(189.98, 50.95) --
+	(190.36, 50.90) --
+	(190.74, 50.85) --
+	(191.13, 50.80) --
+	(191.51, 50.75) --
+	(191.90, 50.69) --
+	(192.28, 50.64) --
+	(192.66, 50.59) --
+	(193.05, 50.54) --
+	(193.43, 50.48) --
+	(193.82, 50.43) --
+	(194.20, 50.38) --
+	(194.59, 50.33) --
+	(194.97, 50.28) --
+	(195.35, 50.23) --
+	(195.74, 50.19) --
+	(196.12, 50.14) --
+	(196.51, 50.10) --
+	(196.89, 50.06) --
+	(197.27, 50.02) --
+	(197.66, 49.98) --
+	(198.04, 49.95) --
+	(198.43, 49.91) --
+	(198.81, 49.88) --
+	(199.19, 49.86) --
+	(199.58, 49.83) --
+	(199.96, 49.80) --
+	(200.35, 49.78) --
+	(200.73, 49.76) --
+	(201.12, 49.74) --
+	(201.50, 49.73) --
+	(201.88, 49.71) --
+	(202.27, 49.70) --
+	(202.65, 49.69) --
+	(203.04, 49.68) --
+	(203.42, 49.67) --
+	(203.80, 49.66) --
+	(204.19, 49.66) --
+	(204.57, 49.65) --
+	(204.96, 49.65) --
+	(205.34, 49.64) --
+	(205.73, 49.64) --
+	(206.11, 49.64) --
+	(206.49, 49.64) --
+	(206.88, 49.64) --
+	(207.26, 49.63) --
+	(207.65, 49.63) --
+	(208.03, 49.63) --
+	(208.41, 49.63) --
+	(208.80, 49.63) --
+	(209.18, 49.63) --
+	(209.57, 49.63) --
+	(209.95, 49.63) --
+	(210.33, 49.63) --
+	(210.72, 49.63) --
+	(211.10, 49.63) --
+	(211.49, 49.63) --
+	(211.87, 49.63) --
+	(212.26, 49.63) --
+	(212.64, 49.63) --
+	(213.02, 49.62) --
+	(213.41, 49.62) --
+	(213.79, 49.62) --
+	(214.18, 49.62) --
+	(214.56, 49.61) --
+	(214.94, 49.61) --
+	(215.33, 49.60) --
+	(215.71, 49.60) --
+	(216.10, 49.59) --
+	(216.48, 49.59) --
+	(216.87, 49.58) --
+	(217.25, 49.57) --
+	(217.63, 49.57) --
+	(218.02, 49.56) --
+	(218.40, 49.55) --
+	(218.79, 49.54) --
+	(219.17, 49.53) --
+	(219.55, 49.52) --
+	(219.94, 49.51) --
+	(220.32, 49.50) --
+	(220.71, 49.49) --
+	(221.09, 49.48) --
+	(221.47, 49.47) --
+	(221.86, 49.46) --
+	(222.24, 49.44) --
+	(222.63, 49.43) --
+	(223.01, 49.42) --
+	(223.40, 49.41) --
+	(223.78, 49.40) --
+	(224.16, 49.39) --
+	(224.55, 49.38) --
+	(224.93, 49.36) --
+	(225.32, 49.35) --
+	(225.70, 49.34) --
+	(226.08, 49.33) --
+	(226.47, 49.32) --
+	(226.85, 49.31) --
+	(227.24, 49.30) --
+	(227.62, 49.30) --
+	(228.01, 49.29) --
+	(228.39, 49.28) --
+	(228.77, 49.27) --
+	(229.16, 49.27) --
+	(229.54, 49.26) --
+	(229.93, 49.25) --
+	(230.31, 49.25) --
+	(230.69, 49.24) --
+	(231.08, 49.24) --
+	(231.46, 49.23) --
+	(231.85, 49.23) --
+	(232.23, 49.23) --
+	(232.62, 49.22) --
+	(233.00, 49.22) --
+	(233.38, 49.22) --
+	(233.77, 49.22) --
+	(234.15, 49.21) --
+	(234.54, 49.21) --
+	(234.92, 49.21) --
+	(235.30, 49.21) --
+	(235.69, 49.21) --
+	(236.07, 49.21) --
+	(236.46, 49.21) --
+	(236.84, 49.20) --
+	(237.22, 49.20) --
+	(237.61, 49.20) --
+	(237.99, 49.20) --
+	(238.38, 49.20) --
+	(238.76, 49.20) --
+	cycle;
+\definecolor[named]{drawColor}{rgb}{0.00,0.00,0.00}
+
+\draw[color=drawColor,line width= 0.6pt,line cap=round,line join=round,fill opacity=0.00,] ( 42.47, 49.20) --
+	( 42.85, 49.20) --
+	( 43.23, 49.20) --
+	( 43.62, 49.20) --
+	( 44.00, 49.20) --
+	( 44.39, 49.20) --
+	( 44.77, 49.20) --
+	( 45.15, 49.20) --
+	( 45.54, 49.20) --
+	( 45.92, 49.20) --
+	( 46.31, 49.20) --
+	( 46.69, 49.20) --
+	( 47.08, 49.20) --
+	( 47.46, 49.20) --
+	( 47.84, 49.20) --
+	( 48.23, 49.21) --
+	( 48.61, 49.21) --
+	( 49.00, 49.21) --
+	( 49.38, 49.21) --
+	( 49.76, 49.21) --
+	( 50.15, 49.21) --
+	( 50.53, 49.21) --
+	( 50.92, 49.21) --
+	( 51.30, 49.22) --
+	( 51.68, 49.22) --
+	( 52.07, 49.22) --
+	( 52.45, 49.22) --
+	( 52.84, 49.22) --
+	( 53.22, 49.23) --
+	( 53.61, 49.23) --
+	( 53.99, 49.23) --
+	( 54.37, 49.24) --
+	( 54.76, 49.24) --
+	( 55.14, 49.24) --
+	( 55.53, 49.25) --
+	( 55.91, 49.25) --
+	( 56.29, 49.25) --
+	( 56.68, 49.26) --
+	( 57.06, 49.26) --
+	( 57.45, 49.26) --
+	( 57.83, 49.27) --
+	( 58.22, 49.27) --
+	( 58.60, 49.28) --
+	( 58.98, 49.28) --
+	( 59.37, 49.28) --
+	( 59.75, 49.29) --
+	( 60.14, 49.29) --
+	( 60.52, 49.29) --
+	( 60.90, 49.30) --
+	( 61.29, 49.30) --
+	( 61.67, 49.30) --
+	( 62.06, 49.31) --
+	( 62.44, 49.31) --
+	( 62.82, 49.31) --
+	( 63.21, 49.31) --
+	( 63.59, 49.31) --
+	( 63.98, 49.32) --
+	( 64.36, 49.32) --
+	( 64.75, 49.32) --
+	( 65.13, 49.32) --
+	( 65.51, 49.32) --
+	( 65.90, 49.32) --
+	( 66.28, 49.32) --
+	( 66.67, 49.32) --
+	( 67.05, 49.32) --
+	( 67.43, 49.32) --
+	( 67.82, 49.32) --
+	( 68.20, 49.32) --
+	( 68.59, 49.32) --
+	( 68.97, 49.33) --
+	( 69.36, 49.33) --
+	( 69.74, 49.33) --
+	( 70.12, 49.33) --
+	( 70.51, 49.33) --
+	( 70.89, 49.33) --
+	( 71.28, 49.34) --
+	( 71.66, 49.34) --
+	( 72.04, 49.34) --
+	( 72.43, 49.35) --
+	( 72.81, 49.35) --
+	( 73.20, 49.36) --
+	( 73.58, 49.36) --
+	( 73.96, 49.37) --
+	( 74.35, 49.37) --
+	( 74.73, 49.38) --
+	( 75.12, 49.39) --
+	( 75.50, 49.40) --
+	( 75.89, 49.41) --
+	( 76.27, 49.42) --
+	( 76.65, 49.44) --
+	( 77.04, 49.45) --
+	( 77.42, 49.47) --
+	( 77.81, 49.48) --
+	( 78.19, 49.50) --
+	( 78.57, 49.52) --
+	( 78.96, 49.55) --
+	( 79.34, 49.57) --
+	( 79.73, 49.60) --
+	( 80.11, 49.63) --
+	( 80.50, 49.66) --
+	( 80.88, 49.70) --
+	( 81.26, 49.74) --
+	( 81.65, 49.79) --
+	( 82.03, 49.84) --
+	( 82.42, 49.89) --
+	( 82.80, 49.95) --
+	( 83.18, 50.02) --
+	( 83.57, 50.09) --
+	( 83.95, 50.17) --
+	( 84.34, 50.25) --
+	( 84.72, 50.35) --
+	( 85.11, 50.45) --
+	( 85.49, 50.56) --
+	( 85.87, 50.68) --
+	( 86.26, 50.81) --
+	( 86.64, 50.95) --
+	( 87.03, 51.10) --
+	( 87.41, 51.26) --
+	( 87.79, 51.44) --
+	( 88.18, 51.63) --
+	( 88.56, 51.83) --
+	( 88.95, 52.05) --
+	( 89.33, 52.27) --
+	( 89.71, 52.52) --
+	( 90.10, 52.78) --
+	( 90.48, 53.05) --
+	( 90.87, 53.35) --
+	( 91.25, 53.65) --
+	( 91.64, 53.98) --
+	( 92.02, 54.32) --
+	( 92.40, 54.68) --
+	( 92.79, 55.05) --
+	( 93.17, 55.44) --
+	( 93.56, 55.85) --
+	( 93.94, 56.28) --
+	( 94.32, 56.72) --
+	( 94.71, 57.18) --
+	( 95.09, 57.65) --
+	( 95.48, 58.14) --
+	( 95.86, 58.64) --
+	( 96.25, 59.16) --
+	( 96.63, 59.70) --
+	( 97.01, 60.24) --
+	( 97.40, 60.80) --
+	( 97.78, 61.37) --
+	( 98.17, 61.95) --
+	( 98.55, 62.54) --
+	( 98.93, 63.14) --
+	( 99.32, 63.75) --
+	( 99.70, 64.37) --
+	(100.09, 65.00) --
+	(100.47, 65.63) --
+	(100.85, 66.26) --
+	(101.24, 66.90) --
+	(101.62, 67.55) --
+	(102.01, 68.20) --
+	(102.39, 68.86) --
+	(102.78, 69.52) --
+	(103.16, 70.18) --
+	(103.54, 70.84) --
+	(103.93, 71.50) --
+	(104.31, 72.17) --
+	(104.70, 72.83) --
+	(105.08, 73.50) --
+	(105.46, 74.16) --
+	(105.85, 74.82) --
+	(106.23, 75.49) --
+	(106.62, 76.15) --
+	(107.00, 76.81) --
+	(107.39, 77.47) --
+	(107.77, 78.12) --
+	(108.15, 78.77) --
+	(108.54, 79.41) --
+	(108.92, 80.06) --
+	(109.31, 80.69) --
+	(109.69, 81.32) --
+	(110.07, 81.94) --
+	(110.46, 82.56) --
+	(110.84, 83.16) --
+	(111.23, 83.76) --
+	(111.61, 84.34) --
+	(111.99, 84.92) --
+	(112.38, 85.49) --
+	(112.76, 86.04) --
+	(113.15, 86.58) --
+	(113.53, 87.10) --
+	(113.92, 87.62) --
+	(114.30, 88.12) --
+	(114.68, 88.60) --
+	(115.07, 89.07) --
+	(115.45, 89.53) --
+	(115.84, 89.97) --
+	(116.22, 90.39) --
+	(116.60, 90.80) --
+	(116.99, 91.19) --
+	(117.37, 91.56) --
+	(117.76, 91.91) --
+	(118.14, 92.25) --
+	(118.53, 92.57) --
+	(118.91, 92.87) --
+	(119.29, 93.16) --
+	(119.68, 93.43) --
+	(120.06, 93.68) --
+	(120.45, 93.90) --
+	(120.83, 94.11) --
+	(121.21, 94.31) --
+	(121.60, 94.48) --
+	(121.98, 94.64) --
+	(122.37, 94.77) --
+	(122.75, 94.88) --
+	(123.13, 94.98) --
+	(123.52, 95.06) --
+	(123.90, 95.12) --
+	(124.29, 95.15) --
+	(124.67, 95.17) --
+	(125.06, 95.17) --
+	(125.44, 95.15) --
+	(125.82, 95.11) --
+	(126.21, 95.06) --
+	(126.59, 94.98) --
+	(126.98, 94.89) --
+	(127.36, 94.78) --
+	(127.74, 94.66) --
+	(128.13, 94.52) --
+	(128.51, 94.36) --
+	(128.90, 94.20) --
+	(129.28, 94.02) --
+	(129.67, 93.83) --
+	(130.05, 93.62) --
+	(130.43, 93.41) --
+	(130.82, 93.19) --
+	(131.20, 92.97) --
+	(131.59, 92.73) --
+	(131.97, 92.49) --
+	(132.35, 92.24) --
+	(132.74, 92.00) --
+	(133.12, 91.75) --
+	(133.51, 91.49) --
+	(133.89, 91.23) --
+	(134.28, 90.98) --
+	(134.66, 90.72) --
+	(135.04, 90.46) --
+	(135.43, 90.20) --
+	(135.81, 89.94) --
+	(136.20, 89.68) --
+	(136.58, 89.42) --
+	(136.96, 89.15) --
+	(137.35, 88.89) --
+	(137.73, 88.62) --
+	(138.12, 88.35) --
+	(138.50, 88.08) --
+	(138.88, 87.80) --
+	(139.27, 87.51) --
+	(139.65, 87.22) --
+	(140.04, 86.92) --
+	(140.42, 86.61) --
+	(140.81, 86.30) --
+	(141.19, 85.97) --
+	(141.57, 85.63) --
+	(141.96, 85.29) --
+	(142.34, 84.93) --
+	(142.73, 84.56) --
+	(143.11, 84.18) --
+	(143.49, 83.78) --
+	(143.88, 83.38) --
+	(144.26, 82.96) --
+	(144.65, 82.53) --
+	(145.03, 82.09) --
+	(145.42, 81.64) --
+	(145.80, 81.18) --
+	(146.18, 80.71) --
+	(146.57, 80.23) --
+	(146.95, 79.74) --
+	(147.34, 79.25) --
+	(147.72, 78.75) --
+	(148.10, 78.25) --
+	(148.49, 77.74) --
+	(148.87, 77.24) --
+	(149.26, 76.73) --
+	(149.64, 76.22) --
+	(150.02, 75.72) --
+	(150.41, 75.22) --
+	(150.79, 74.72) --
+	(151.18, 74.22) --
+	(151.56, 73.73) --
+	(151.95, 73.25) --
+	(152.33, 72.78) --
+	(152.71, 72.31) --
+	(153.10, 71.85) --
+	(153.48, 71.40) --
+	(153.87, 70.95) --
+	(154.25, 70.52) --
+	(154.63, 70.09) --
+	(155.02, 69.68) --
+	(155.40, 69.27) --
+	(155.79, 68.87) --
+	(156.17, 68.47) --
+	(156.56, 68.09) --
+	(156.94, 67.71) --
+	(157.32, 67.34) --
+	(157.71, 66.98) --
+	(158.09, 66.63) --
+	(158.48, 66.27) --
+	(158.86, 65.93) --
+	(159.24, 65.59) --
+	(159.63, 65.25) --
+	(160.01, 64.92) --
+	(160.40, 64.59) --
+	(160.78, 64.27) --
+	(161.16, 63.94) --
+	(161.55, 63.62) --
+	(161.93, 63.31) --
+	(162.32, 62.99) --
+	(162.70, 62.68) --
+	(163.09, 62.37) --
+	(163.47, 62.06) --
+	(163.85, 61.75) --
+	(164.24, 61.45) --
+	(164.62, 61.15) --
+	(165.01, 60.85) --
+	(165.39, 60.55) --
+	(165.77, 60.26) --
+	(166.16, 59.97) --
+	(166.54, 59.68) --
+	(166.93, 59.40) --
+	(167.31, 59.12) --
+	(167.70, 58.85) --
+	(168.08, 58.58) --
+	(168.46, 58.31) --
+	(168.85, 58.05) --
+	(169.23, 57.79) --
+	(169.62, 57.54) --
+	(170.00, 57.29) --
+	(170.38, 57.04) --
+	(170.77, 56.81) --
+	(171.15, 56.57) --
+	(171.54, 56.34) --
+	(171.92, 56.12) --
+	(172.30, 55.90) --
+	(172.69, 55.69) --
+	(173.07, 55.48) --
+	(173.46, 55.27) --
+	(173.84, 55.07) --
+	(174.23, 54.88) --
+	(174.61, 54.69) --
+	(174.99, 54.51) --
+	(175.38, 54.33) --
+	(175.76, 54.15) --
+	(176.15, 53.98) --
+	(176.53, 53.82) --
+	(176.91, 53.66) --
+	(177.30, 53.51) --
+	(177.68, 53.36) --
+	(178.07, 53.22) --
+	(178.45, 53.08) --
+	(178.84, 52.95) --
+	(179.22, 52.83) --
+	(179.60, 52.71) --
+	(179.99, 52.59) --
+	(180.37, 52.49) --
+	(180.76, 52.39) --
+	(181.14, 52.29) --
+	(181.52, 52.20) --
+	(181.91, 52.11) --
+	(182.29, 52.03) --
+	(182.68, 51.96) --
+	(183.06, 51.89) --
+	(183.45, 51.82) --
+	(183.83, 51.75) --
+	(184.21, 51.69) --
+	(184.60, 51.64) --
+	(184.98, 51.58) --
+	(185.37, 51.53) --
+	(185.75, 51.48) --
+	(186.13, 51.43) --
+	(186.52, 51.38) --
+	(186.90, 51.33) --
+	(187.29, 51.29) --
+	(187.67, 51.24) --
+	(188.05, 51.19) --
+	(188.44, 51.15) --
+	(188.82, 51.10) --
+	(189.21, 51.05) --
+	(189.59, 51.00) --
+	(189.98, 50.95) --
+	(190.36, 50.90) --
+	(190.74, 50.85) --
+	(191.13, 50.80) --
+	(191.51, 50.75) --
+	(191.90, 50.69) --
+	(192.28, 50.64) --
+	(192.66, 50.59) --
+	(193.05, 50.54) --
+	(193.43, 50.48) --
+	(193.82, 50.43) --
+	(194.20, 50.38) --
+	(194.59, 50.33) --
+	(194.97, 50.28) --
+	(195.35, 50.23) --
+	(195.74, 50.19) --
+	(196.12, 50.14) --
+	(196.51, 50.10) --
+	(196.89, 50.06) --
+	(197.27, 50.02) --
+	(197.66, 49.98) --
+	(198.04, 49.95) --
+	(198.43, 49.91) --
+	(198.81, 49.88) --
+	(199.19, 49.86) --
+	(199.58, 49.83) --
+	(199.96, 49.80) --
+	(200.35, 49.78) --
+	(200.73, 49.76) --
+	(201.12, 49.74) --
+	(201.50, 49.73) --
+	(201.88, 49.71) --
+	(202.27, 49.70) --
+	(202.65, 49.69) --
+	(203.04, 49.68) --
+	(203.42, 49.67) --
+	(203.80, 49.66) --
+	(204.19, 49.66) --
+	(204.57, 49.65) --
+	(204.96, 49.65) --
+	(205.34, 49.64) --
+	(205.73, 49.64) --
+	(206.11, 49.64) --
+	(206.49, 49.64) --
+	(206.88, 49.64) --
+	(207.26, 49.63) --
+	(207.65, 49.63) --
+	(208.03, 49.63) --
+	(208.41, 49.63) --
+	(208.80, 49.63) --
+	(209.18, 49.63) --
+	(209.57, 49.63) --
+	(209.95, 49.63) --
+	(210.33, 49.63) --
+	(210.72, 49.63) --
+	(211.10, 49.63) --
+	(211.49, 49.63) --
+	(211.87, 49.63) --
+	(212.26, 49.63) --
+	(212.64, 49.63) --
+	(213.02, 49.62) --
+	(213.41, 49.62) --
+	(213.79, 49.62) --
+	(214.18, 49.62) --
+	(214.56, 49.61) --
+	(214.94, 49.61) --
+	(215.33, 49.60) --
+	(215.71, 49.60) --
+	(216.10, 49.59) --
+	(216.48, 49.59) --
+	(216.87, 49.58) --
+	(217.25, 49.57) --
+	(217.63, 49.57) --
+	(218.02, 49.56) --
+	(218.40, 49.55) --
+	(218.79, 49.54) --
+	(219.17, 49.53) --
+	(219.55, 49.52) --
+	(219.94, 49.51) --
+	(220.32, 49.50) --
+	(220.71, 49.49) --
+	(221.09, 49.48) --
+	(221.47, 49.47) --
+	(221.86, 49.46) --
+	(222.24, 49.44) --
+	(222.63, 49.43) --
+	(223.01, 49.42) --
+	(223.40, 49.41) --
+	(223.78, 49.40) --
+	(224.16, 49.39) --
+	(224.55, 49.38) --
+	(224.93, 49.36) --
+	(225.32, 49.35) --
+	(225.70, 49.34) --
+	(226.08, 49.33) --
+	(226.47, 49.32) --
+	(226.85, 49.31) --
+	(227.24, 49.30) --
+	(227.62, 49.30) --
+	(228.01, 49.29) --
+	(228.39, 49.28) --
+	(228.77, 49.27) --
+	(229.16, 49.27) --
+	(229.54, 49.26) --
+	(229.93, 49.25) --
+	(230.31, 49.25) --
+	(230.69, 49.24) --
+	(231.08, 49.24) --
+	(231.46, 49.23) --
+	(231.85, 49.23) --
+	(232.23, 49.23) --
+	(232.62, 49.22) --
+	(233.00, 49.22) --
+	(233.38, 49.22) --
+	(233.77, 49.22) --
+	(234.15, 49.21) --
+	(234.54, 49.21) --
+	(234.92, 49.21) --
+	(235.30, 49.21) --
+	(235.69, 49.21) --
+	(236.07, 49.21) --
+	(236.46, 49.21) --
+	(236.84, 49.20) --
+	(237.22, 49.20) --
+	(237.61, 49.20) --
+	(237.99, 49.20) --
+	(238.38, 49.20) --
+	(238.76, 49.20);
+\definecolor[named]{fillColor}{rgb}{1.00,0.00,0.00}
+
+\draw[fill=fillColor,fill opacity=0.25,draw opacity=0.00,] ( 49.72, 49.20) --
+	( 49.99, 49.20) --
+	( 50.25, 49.20) --
+	( 50.52, 49.20) --
+	( 50.79, 49.20) --
+	( 51.06, 49.20) --
+	( 51.32, 49.20) --
+	( 51.59, 49.20) --
+	( 51.86, 49.20) --
+	( 52.12, 49.20) --
+	( 52.39, 49.21) --
+	( 52.66, 49.21) --
+	( 52.92, 49.21) --
+	( 53.19, 49.21) --
+	( 53.46, 49.21) --
+	( 53.73, 49.21) --
+	( 53.99, 49.21) --
+	( 54.26, 49.22) --
+	( 54.53, 49.22) --
+	( 54.79, 49.22) --
+	( 55.06, 49.22) --
+	( 55.33, 49.22) --
+	( 55.59, 49.23) --
+	( 55.86, 49.23) --
+	( 56.13, 49.23) --
+	( 56.40, 49.24) --
+	( 56.66, 49.24) --
+	( 56.93, 49.24) --
+	( 57.20, 49.25) --
+	( 57.46, 49.25) --
+	( 57.73, 49.25) --
+	( 58.00, 49.26) --
+	( 58.26, 49.26) --
+	( 58.53, 49.26) --
+	( 58.80, 49.27) --
+	( 59.07, 49.27) --
+	( 59.33, 49.27) --
+	( 59.60, 49.28) --
+	( 59.87, 49.28) --
+	( 60.13, 49.28) --
+	( 60.40, 49.28) --
+	( 60.67, 49.29) --
+	( 60.94, 49.29) --
+	( 61.20, 49.29) --
+	( 61.47, 49.29) --
+	( 61.74, 49.29) --
+	( 62.00, 49.29) --
+	( 62.27, 49.30) --
+	( 62.54, 49.30) --
+	( 62.80, 49.30) --
+	( 63.07, 49.30) --
+	( 63.34, 49.30) --
+	( 63.61, 49.30) --
+	( 63.87, 49.30) --
+	( 64.14, 49.31) --
+	( 64.41, 49.31) --
+	( 64.67, 49.31) --
+	( 64.94, 49.32) --
+	( 65.21, 49.32) --
+	( 65.47, 49.33) --
+	( 65.74, 49.33) --
+	( 66.01, 49.34) --
+	( 66.28, 49.35) --
+	( 66.54, 49.36) --
+	( 66.81, 49.38) --
+	( 67.08, 49.39) --
+	( 67.34, 49.41) --
+	( 67.61, 49.43) --
+	( 67.88, 49.46) --
+	( 68.14, 49.49) --
+	( 68.41, 49.52) --
+	( 68.68, 49.56) --
+	( 68.95, 49.60) --
+	( 69.21, 49.65) --
+	( 69.48, 49.70) --
+	( 69.75, 49.76) --
+	( 70.01, 49.83) --
+	( 70.28, 49.90) --
+	( 70.55, 49.98) --
+	( 70.81, 50.07) --
+	( 71.08, 50.17) --
+	( 71.35, 50.28) --
+	( 71.62, 50.40) --
+	( 71.88, 50.54) --
+	( 72.15, 50.68) --
+	( 72.42, 50.84) --
+	( 72.68, 51.01) --
+	( 72.95, 51.20) --
+	( 73.22, 51.40) --
+	( 73.49, 51.62) --
+	( 73.75, 51.85) --
+	( 74.02, 52.11) --
+	( 74.29, 52.38) --
+	( 74.55, 52.68) --
+	( 74.82, 52.99) --
+	( 75.09, 53.33) --
+	( 75.35, 53.69) --
+	( 75.62, 54.08) --
+	( 75.89, 54.49) --
+	( 76.16, 54.93) --
+	( 76.42, 55.40) --
+	( 76.69, 55.90) --
+	( 76.96, 56.43) --
+	( 77.22, 57.00) --
+	( 77.49, 57.59) --
+	( 77.76, 58.21) --
+	( 78.02, 58.88) --
+	( 78.29, 59.59) --
+	( 78.56, 60.33) --
+	( 78.83, 61.10) --
+	( 79.09, 61.92) --
+	( 79.36, 62.77) --
+	( 79.63, 63.67) --
+	( 79.89, 64.61) --
+	( 80.16, 65.58) --
+	( 80.43, 66.59) --
+	( 80.69, 67.64) --
+	( 80.96, 68.73) --
+	( 81.23, 69.86) --
+	( 81.50, 71.02) --
+	( 81.76, 72.21) --
+	( 82.03, 73.44) --
+	( 82.30, 74.69) --
+	( 82.56, 75.97) --
+	( 82.83, 77.28) --
+	( 83.10, 78.60) --
+	( 83.36, 79.94) --
+	( 83.63, 81.30) --
+	( 83.90, 82.67) --
+	( 84.17, 84.05) --
+	( 84.43, 85.43) --
+	( 84.70, 86.82) --
+	( 84.97, 88.20) --
+	( 85.23, 89.58) --
+	( 85.50, 90.95) --
+	( 85.77, 92.31) --
+	( 86.04, 93.65) --
+	( 86.30, 94.98) --
+	( 86.57, 96.28) --
+	( 86.84, 97.57) --
+	( 87.10, 98.82) --
+	( 87.37,100.06) --
+	( 87.64,101.26) --
+	( 87.90,102.44) --
+	( 88.17,103.57) --
+	( 88.44,104.68) --
+	( 88.71,105.75) --
+	( 88.97,106.79) --
+	( 89.24,107.80) --
+	( 89.51,108.76) --
+	( 89.77,109.68) --
+	( 90.04,110.57) --
+	( 90.31,111.42) --
+	( 90.57,112.24) --
+	( 90.84,113.02) --
+	( 91.11,113.76) --
+	( 91.38,114.46) --
+	( 91.64,115.13) --
+	( 91.91,115.76) --
+	( 92.18,116.36) --
+	( 92.44,116.93) --
+	( 92.71,117.46) --
+	( 92.98,117.96) --
+	( 93.24,118.43) --
+	( 93.51,118.88) --
+	( 93.78,119.29) --
+	( 94.05,119.68) --
+	( 94.31,120.04) --
+	( 94.58,120.38) --
+	( 94.85,120.70) --
+	( 95.11,120.99) --
+	( 95.38,121.26) --
+	( 95.65,121.50) --
+	( 95.91,121.73) --
+	( 96.18,121.94) --
+	( 96.45,122.13) --
+	( 96.72,122.31) --
+	( 96.98,122.46) --
+	( 97.25,122.60) --
+	( 97.52,122.72) --
+	( 97.78,122.82) --
+	( 98.05,122.90) --
+	( 98.32,122.97) --
+	( 98.59,123.02) --
+	( 98.85,123.05) --
+	( 99.12,123.06) --
+	( 99.39,123.05) --
+	( 99.65,123.02) --
+	( 99.92,122.96) --
+	(100.19,122.89) --
+	(100.45,122.79) --
+	(100.72,122.67) --
+	(100.99,122.51) --
+	(101.26,122.33) --
+	(101.52,122.12) --
+	(101.79,121.88) --
+	(102.06,121.62) --
+	(102.32,121.31) --
+	(102.59,120.97) --
+	(102.86,120.60) --
+	(103.12,120.20) --
+	(103.39,119.76) --
+	(103.66,119.29) --
+	(103.93,118.78) --
+	(104.19,118.23) --
+	(104.46,117.66) --
+	(104.73,117.06) --
+	(104.99,116.42) --
+	(105.26,115.76) --
+	(105.53,115.06) --
+	(105.79,114.35) --
+	(106.06,113.61) --
+	(106.33,112.85) --
+	(106.60,112.07) --
+	(106.86,111.28) --
+	(107.13,110.48) --
+	(107.40,109.66) --
+	(107.66,108.83) --
+	(107.93,108.00) --
+	(108.20,107.17) --
+	(108.46,106.33) --
+	(108.73,105.49) --
+	(109.00,104.64) --
+	(109.27,103.80) --
+	(109.53,102.96) --
+	(109.80,102.12) --
+	(110.07,101.28) --
+	(110.33,100.45) --
+	(110.60, 99.61) --
+	(110.87, 98.77) --
+	(111.14, 97.94) --
+	(111.40, 97.10) --
+	(111.67, 96.26) --
+	(111.94, 95.41) --
+	(112.20, 94.56) --
+	(112.47, 93.70) --
+	(112.74, 92.84) --
+	(113.00, 91.97) --
+	(113.27, 91.09) --
+	(113.54, 90.20) --
+	(113.81, 89.31) --
+	(114.07, 88.40) --
+	(114.34, 87.48) --
+	(114.61, 86.56) --
+	(114.87, 85.62) --
+	(115.14, 84.68) --
+	(115.41, 83.74) --
+	(115.67, 82.79) --
+	(115.94, 81.84) --
+	(116.21, 80.88) --
+	(116.48, 79.93) --
+	(116.74, 78.98) --
+	(117.01, 78.04) --
+	(117.28, 77.11) --
+	(117.54, 76.18) --
+	(117.81, 75.27) --
+	(118.08, 74.38) --
+	(118.34, 73.50) --
+	(118.61, 72.65) --
+	(118.88, 71.82) --
+	(119.15, 71.01) --
+	(119.41, 70.22) --
+	(119.68, 69.47) --
+	(119.95, 68.74) --
+	(120.21, 68.05) --
+	(120.48, 67.38) --
+	(120.75, 66.74) --
+	(121.01, 66.14) --
+	(121.28, 65.57) --
+	(121.55, 65.03) --
+	(121.82, 64.52) --
+	(122.08, 64.04) --
+	(122.35, 63.59) --
+	(122.62, 63.17) --
+	(122.88, 62.77) --
+	(123.15, 62.40) --
+	(123.42, 62.05) --
+	(123.69, 61.72) --
+	(123.95, 61.42) --
+	(124.22, 61.13) --
+	(124.49, 60.86) --
+	(124.75, 60.61) --
+	(125.02, 60.36) --
+	(125.29, 60.13) --
+	(125.55, 59.91) --
+	(125.82, 59.70) --
+	(126.09, 59.50) --
+	(126.36, 59.30) --
+	(126.62, 59.11) --
+	(126.89, 58.92) --
+	(127.16, 58.73) --
+	(127.42, 58.55) --
+	(127.69, 58.37) --
+	(127.96, 58.18) --
+	(128.22, 58.01) --
+	(128.49, 57.83) --
+	(128.76, 57.65) --
+	(129.03, 57.47) --
+	(129.29, 57.30) --
+	(129.56, 57.13) --
+	(129.83, 56.96) --
+	(130.09, 56.79) --
+	(130.36, 56.62) --
+	(130.63, 56.46) --
+	(130.89, 56.30) --
+	(131.16, 56.15) --
+	(131.43, 55.99) --
+	(131.70, 55.85) --
+	(131.96, 55.70) --
+	(132.23, 55.57) --
+	(132.50, 55.43) --
+	(132.76, 55.31) --
+	(133.03, 55.18) --
+	(133.30, 55.06) --
+	(133.56, 54.95) --
+	(133.83, 54.84) --
+	(134.10, 54.73) --
+	(134.37, 54.62) --
+	(134.63, 54.52) --
+	(134.90, 54.42) --
+	(135.17, 54.32) --
+	(135.43, 54.23) --
+	(135.70, 54.13) --
+	(135.97, 54.03) --
+	(136.24, 53.93) --
+	(136.50, 53.84) --
+	(136.77, 53.73) --
+	(137.04, 53.63) --
+	(137.30, 53.53) --
+	(137.57, 53.42) --
+	(137.84, 53.31) --
+	(138.10, 53.20) --
+	(138.37, 53.08) --
+	(138.64, 52.97) --
+	(138.91, 52.85) --
+	(139.17, 52.72) --
+	(139.44, 52.60) --
+	(139.71, 52.47) --
+	(139.97, 52.35) --
+	(140.24, 52.22) --
+	(140.51, 52.09) --
+	(140.77, 51.96) --
+	(141.04, 51.84) --
+	(141.31, 51.71) --
+	(141.58, 51.59) --
+	(141.84, 51.47) --
+	(142.11, 51.35) --
+	(142.38, 51.24) --
+	(142.64, 51.13) --
+	(142.91, 51.02) --
+	(143.18, 50.92) --
+	(143.44, 50.82) --
+	(143.71, 50.73) --
+	(143.98, 50.64) --
+	(144.25, 50.56) --
+	(144.51, 50.48) --
+	(144.78, 50.41) --
+	(145.05, 50.34) --
+	(145.31, 50.27) --
+	(145.58, 50.22) --
+	(145.85, 50.16) --
+	(146.11, 50.11) --
+	(146.38, 50.07) --
+	(146.65, 50.03) --
+	(146.92, 49.99) --
+	(147.18, 49.95) --
+	(147.45, 49.92) --
+	(147.72, 49.89) --
+	(147.98, 49.87) --
+	(148.25, 49.84) --
+	(148.52, 49.82) --
+	(148.79, 49.80) --
+	(149.05, 49.78) --
+	(149.32, 49.77) --
+	(149.59, 49.75) --
+	(149.85, 49.74) --
+	(150.12, 49.72) --
+	(150.39, 49.71) --
+	(150.65, 49.70) --
+	(150.92, 49.69) --
+	(151.19, 49.68) --
+	(151.46, 49.67) --
+	(151.72, 49.65) --
+	(151.99, 49.64) --
+	(152.26, 49.63) --
+	(152.52, 49.62) --
+	(152.79, 49.61) --
+	(153.06, 49.60) --
+	(153.32, 49.58) --
+	(153.59, 49.57) --
+	(153.86, 49.56) --
+	(154.13, 49.54) --
+	(154.39, 49.53) --
+	(154.66, 49.51) --
+	(154.93, 49.50) --
+	(155.19, 49.49) --
+	(155.46, 49.47) --
+	(155.73, 49.46) --
+	(155.99, 49.44) --
+	(156.26, 49.43) --
+	(156.53, 49.42) --
+	(156.80, 49.40) --
+	(157.06, 49.39) --
+	(157.33, 49.38) --
+	(157.60, 49.37) --
+	(157.86, 49.35) --
+	(158.13, 49.34) --
+	(158.40, 49.34) --
+	(158.67, 49.33) --
+	(158.93, 49.32) --
+	(159.20, 49.32) --
+	(159.47, 49.31) --
+	(159.73, 49.31) --
+	(160.00, 49.30) --
+	(160.27, 49.30) --
+	(160.53, 49.30) --
+	(160.80, 49.31) --
+	(161.07, 49.31) --
+	(161.34, 49.31) --
+	(161.60, 49.32) --
+	(161.87, 49.32) --
+	(162.14, 49.33) --
+	(162.40, 49.34) --
+	(162.67, 49.35) --
+	(162.94, 49.36) --
+	(163.20, 49.37) --
+	(163.47, 49.38) --
+	(163.74, 49.39) --
+	(164.01, 49.40) --
+	(164.27, 49.42) --
+	(164.54, 49.43) --
+	(164.81, 49.45) --
+	(165.07, 49.46) --
+	(165.34, 49.47) --
+	(165.61, 49.49) --
+	(165.87, 49.50) --
+	(166.14, 49.52) --
+	(166.41, 49.53) --
+	(166.68, 49.54) --
+	(166.94, 49.55) --
+	(167.21, 49.57) --
+	(167.48, 49.58) --
+	(167.74, 49.59) --
+	(168.01, 49.60) --
+	(168.28, 49.61) --
+	(168.54, 49.62) --
+	(168.81, 49.63) --
+	(169.08, 49.64) --
+	(169.35, 49.65) --
+	(169.61, 49.66) --
+	(169.88, 49.67) --
+	(170.15, 49.68) --
+	(170.41, 49.69) --
+	(170.68, 49.69) --
+	(170.95, 49.70) --
+	(171.22, 49.71) --
+	(171.48, 49.71) --
+	(171.75, 49.71) --
+	(172.02, 49.72) --
+	(172.28, 49.72) --
+	(172.55, 49.72) --
+	(172.82, 49.72) --
+	(173.08, 49.72) --
+	(173.35, 49.72) --
+	(173.62, 49.72) --
+	(173.89, 49.71) --
+	(174.15, 49.71) --
+	(174.42, 49.70) --
+	(174.69, 49.69) --
+	(174.95, 49.68) --
+	(175.22, 49.67) --
+	(175.49, 49.66) --
+	(175.75, 49.64) --
+	(176.02, 49.63) --
+	(176.29, 49.61) --
+	(176.56, 49.59) --
+	(176.82, 49.57) --
+	(177.09, 49.56) --
+	(177.36, 49.54) --
+	(177.62, 49.52) --
+	(177.89, 49.50) --
+	(178.16, 49.48) --
+	(178.42, 49.46) --
+	(178.69, 49.44) --
+	(178.96, 49.42) --
+	(179.23, 49.40) --
+	(179.49, 49.39) --
+	(179.76, 49.37) --
+	(180.03, 49.35) --
+	(180.29, 49.34) --
+	(180.56, 49.33) --
+	(180.83, 49.31) --
+	(181.09, 49.30) --
+	(181.36, 49.29) --
+	(181.63, 49.28) --
+	(181.90, 49.27) --
+	(182.16, 49.26) --
+	(182.43, 49.25) --
+	(182.70, 49.25) --
+	(182.96, 49.24) --
+	(183.23, 49.23) --
+	(183.50, 49.23) --
+	(183.77, 49.22) --
+	(184.03, 49.22) --
+	(184.30, 49.22) --
+	(184.57, 49.21) --
+	(184.83, 49.21) --
+	(185.10, 49.21) --
+	(185.37, 49.21) --
+	(185.63, 49.21) --
+	(185.90, 49.21) --
+	(186.17, 49.20) --
+	cycle;
+\definecolor[named]{drawColor}{rgb}{1.00,0.00,0.00}
+
+\draw[color=drawColor,line width= 0.6pt,line cap=round,line join=round,fill opacity=0.00,] ( 49.72, 49.20) --
+	( 49.99, 49.20) --
+	( 50.25, 49.20) --
+	( 50.52, 49.20) --
+	( 50.79, 49.20) --
+	( 51.06, 49.20) --
+	( 51.32, 49.20) --
+	( 51.59, 49.20) --
+	( 51.86, 49.20) --
+	( 52.12, 49.20) --
+	( 52.39, 49.21) --
+	( 52.66, 49.21) --
+	( 52.92, 49.21) --
+	( 53.19, 49.21) --
+	( 53.46, 49.21) --
+	( 53.73, 49.21) --
+	( 53.99, 49.21) --
+	( 54.26, 49.22) --
+	( 54.53, 49.22) --
+	( 54.79, 49.22) --
+	( 55.06, 49.22) --
+	( 55.33, 49.22) --
+	( 55.59, 49.23) --
+	( 55.86, 49.23) --
+	( 56.13, 49.23) --
+	( 56.40, 49.24) --
+	( 56.66, 49.24) --
+	( 56.93, 49.24) --
+	( 57.20, 49.25) --
+	( 57.46, 49.25) --
+	( 57.73, 49.25) --
+	( 58.00, 49.26) --
+	( 58.26, 49.26) --
+	( 58.53, 49.26) --
+	( 58.80, 49.27) --
+	( 59.07, 49.27) --
+	( 59.33, 49.27) --
+	( 59.60, 49.28) --
+	( 59.87, 49.28) --
+	( 60.13, 49.28) --
+	( 60.40, 49.28) --
+	( 60.67, 49.29) --
+	( 60.94, 49.29) --
+	( 61.20, 49.29) --
+	( 61.47, 49.29) --
+	( 61.74, 49.29) --
+	( 62.00, 49.29) --
+	( 62.27, 49.30) --
+	( 62.54, 49.30) --
+	( 62.80, 49.30) --
+	( 63.07, 49.30) --
+	( 63.34, 49.30) --
+	( 63.61, 49.30) --
+	( 63.87, 49.30) --
+	( 64.14, 49.31) --
+	( 64.41, 49.31) --
+	( 64.67, 49.31) --
+	( 64.94, 49.32) --
+	( 65.21, 49.32) --
+	( 65.47, 49.33) --
+	( 65.74, 49.33) --
+	( 66.01, 49.34) --
+	( 66.28, 49.35) --
+	( 66.54, 49.36) --
+	( 66.81, 49.38) --
+	( 67.08, 49.39) --
+	( 67.34, 49.41) --
+	( 67.61, 49.43) --
+	( 67.88, 49.46) --
+	( 68.14, 49.49) --
+	( 68.41, 49.52) --
+	( 68.68, 49.56) --
+	( 68.95, 49.60) --
+	( 69.21, 49.65) --
+	( 69.48, 49.70) --
+	( 69.75, 49.76) --
+	( 70.01, 49.83) --
+	( 70.28, 49.90) --
+	( 70.55, 49.98) --
+	( 70.81, 50.07) --
+	( 71.08, 50.17) --
+	( 71.35, 50.28) --
+	( 71.62, 50.40) --
+	( 71.88, 50.54) --
+	( 72.15, 50.68) --
+	( 72.42, 50.84) --
+	( 72.68, 51.01) --
+	( 72.95, 51.20) --
+	( 73.22, 51.40) --
+	( 73.49, 51.62) --
+	( 73.75, 51.85) --
+	( 74.02, 52.11) --
+	( 74.29, 52.38) --
+	( 74.55, 52.68) --
+	( 74.82, 52.99) --
+	( 75.09, 53.33) --
+	( 75.35, 53.69) --
+	( 75.62, 54.08) --
+	( 75.89, 54.49) --
+	( 76.16, 54.93) --
+	( 76.42, 55.40) --
+	( 76.69, 55.90) --
+	( 76.96, 56.43) --
+	( 77.22, 57.00) --
+	( 77.49, 57.59) --
+	( 77.76, 58.21) --
+	( 78.02, 58.88) --
+	( 78.29, 59.59) --
+	( 78.56, 60.33) --
+	( 78.83, 61.10) --
+	( 79.09, 61.92) --
+	( 79.36, 62.77) --
+	( 79.63, 63.67) --
+	( 79.89, 64.61) --
+	( 80.16, 65.58) --
+	( 80.43, 66.59) --
+	( 80.69, 67.64) --
+	( 80.96, 68.73) --
+	( 81.23, 69.86) --
+	( 81.50, 71.02) --
+	( 81.76, 72.21) --
+	( 82.03, 73.44) --
+	( 82.30, 74.69) --
+	( 82.56, 75.97) --
+	( 82.83, 77.28) --
+	( 83.10, 78.60) --
+	( 83.36, 79.94) --
+	( 83.63, 81.30) --
+	( 83.90, 82.67) --
+	( 84.17, 84.05) --
+	( 84.43, 85.43) --
+	( 84.70, 86.82) --
+	( 84.97, 88.20) --
+	( 85.23, 89.58) --
+	( 85.50, 90.95) --
+	( 85.77, 92.31) --
+	( 86.04, 93.65) --
+	( 86.30, 94.98) --
+	( 86.57, 96.28) --
+	( 86.84, 97.57) --
+	( 87.10, 98.82) --
+	( 87.37,100.06) --
+	( 87.64,101.26) --
+	( 87.90,102.44) --
+	( 88.17,103.57) --
+	( 88.44,104.68) --
+	( 88.71,105.75) --
+	( 88.97,106.79) --
+	( 89.24,107.80) --
+	( 89.51,108.76) --
+	( 89.77,109.68) --
+	( 90.04,110.57) --
+	( 90.31,111.42) --
+	( 90.57,112.24) --
+	( 90.84,113.02) --
+	( 91.11,113.76) --
+	( 91.38,114.46) --
+	( 91.64,115.13) --
+	( 91.91,115.76) --
+	( 92.18,116.36) --
+	( 92.44,116.93) --
+	( 92.71,117.46) --
+	( 92.98,117.96) --
+	( 93.24,118.43) --
+	( 93.51,118.88) --
+	( 93.78,119.29) --
+	( 94.05,119.68) --
+	( 94.31,120.04) --
+	( 94.58,120.38) --
+	( 94.85,120.70) --
+	( 95.11,120.99) --
+	( 95.38,121.26) --
+	( 95.65,121.50) --
+	( 95.91,121.73) --
+	( 96.18,121.94) --
+	( 96.45,122.13) --
+	( 96.72,122.31) --
+	( 96.98,122.46) --
+	( 97.25,122.60) --
+	( 97.52,122.72) --
+	( 97.78,122.82) --
+	( 98.05,122.90) --
+	( 98.32,122.97) --
+	( 98.59,123.02) --
+	( 98.85,123.05) --
+	( 99.12,123.06) --
+	( 99.39,123.05) --
+	( 99.65,123.02) --
+	( 99.92,122.96) --
+	(100.19,122.89) --
+	(100.45,122.79) --
+	(100.72,122.67) --
+	(100.99,122.51) --
+	(101.26,122.33) --
+	(101.52,122.12) --
+	(101.79,121.88) --
+	(102.06,121.62) --
+	(102.32,121.31) --
+	(102.59,120.97) --
+	(102.86,120.60) --
+	(103.12,120.20) --
+	(103.39,119.76) --
+	(103.66,119.29) --
+	(103.93,118.78) --
+	(104.19,118.23) --
+	(104.46,117.66) --
+	(104.73,117.06) --
+	(104.99,116.42) --
+	(105.26,115.76) --
+	(105.53,115.06) --
+	(105.79,114.35) --
+	(106.06,113.61) --
+	(106.33,112.85) --
+	(106.60,112.07) --
+	(106.86,111.28) --
+	(107.13,110.48) --
+	(107.40,109.66) --
+	(107.66,108.83) --
+	(107.93,108.00) --
+	(108.20,107.17) --
+	(108.46,106.33) --
+	(108.73,105.49) --
+	(109.00,104.64) --
+	(109.27,103.80) --
+	(109.53,102.96) --
+	(109.80,102.12) --
+	(110.07,101.28) --
+	(110.33,100.45) --
+	(110.60, 99.61) --
+	(110.87, 98.77) --
+	(111.14, 97.94) --
+	(111.40, 97.10) --
+	(111.67, 96.26) --
+	(111.94, 95.41) --
+	(112.20, 94.56) --
+	(112.47, 93.70) --
+	(112.74, 92.84) --
+	(113.00, 91.97) --
+	(113.27, 91.09) --
+	(113.54, 90.20) --
+	(113.81, 89.31) --
+	(114.07, 88.40) --
+	(114.34, 87.48) --
+	(114.61, 86.56) --
+	(114.87, 85.62) --
+	(115.14, 84.68) --
+	(115.41, 83.74) --
+	(115.67, 82.79) --
+	(115.94, 81.84) --
+	(116.21, 80.88) --
+	(116.48, 79.93) --
+	(116.74, 78.98) --
+	(117.01, 78.04) --
+	(117.28, 77.11) --
+	(117.54, 76.18) --
+	(117.81, 75.27) --
+	(118.08, 74.38) --
+	(118.34, 73.50) --
+	(118.61, 72.65) --
+	(118.88, 71.82) --
+	(119.15, 71.01) --
+	(119.41, 70.22) --
+	(119.68, 69.47) --
+	(119.95, 68.74) --
+	(120.21, 68.05) --
+	(120.48, 67.38) --
+	(120.75, 66.74) --
+	(121.01, 66.14) --
+	(121.28, 65.57) --
+	(121.55, 65.03) --
+	(121.82, 64.52) --
+	(122.08, 64.04) --
+	(122.35, 63.59) --
+	(122.62, 63.17) --
+	(122.88, 62.77) --
+	(123.15, 62.40) --
+	(123.42, 62.05) --
+	(123.69, 61.72) --
+	(123.95, 61.42) --
+	(124.22, 61.13) --
+	(124.49, 60.86) --
+	(124.75, 60.61) --
+	(125.02, 60.36) --
+	(125.29, 60.13) --
+	(125.55, 59.91) --
+	(125.82, 59.70) --
+	(126.09, 59.50) --
+	(126.36, 59.30) --
+	(126.62, 59.11) --
+	(126.89, 58.92) --
+	(127.16, 58.73) --
+	(127.42, 58.55) --
+	(127.69, 58.37) --
+	(127.96, 58.18) --
+	(128.22, 58.01) --
+	(128.49, 57.83) --
+	(128.76, 57.65) --
+	(129.03, 57.47) --
+	(129.29, 57.30) --
+	(129.56, 57.13) --
+	(129.83, 56.96) --
+	(130.09, 56.79) --
+	(130.36, 56.62) --
+	(130.63, 56.46) --
+	(130.89, 56.30) --
+	(131.16, 56.15) --
+	(131.43, 55.99) --
+	(131.70, 55.85) --
+	(131.96, 55.70) --
+	(132.23, 55.57) --
+	(132.50, 55.43) --
+	(132.76, 55.31) --
+	(133.03, 55.18) --
+	(133.30, 55.06) --
+	(133.56, 54.95) --
+	(133.83, 54.84) --
+	(134.10, 54.73) --
+	(134.37, 54.62) --
+	(134.63, 54.52) --
+	(134.90, 54.42) --
+	(135.17, 54.32) --
+	(135.43, 54.23) --
+	(135.70, 54.13) --
+	(135.97, 54.03) --
+	(136.24, 53.93) --
+	(136.50, 53.84) --
+	(136.77, 53.73) --
+	(137.04, 53.63) --
+	(137.30, 53.53) --
+	(137.57, 53.42) --
+	(137.84, 53.31) --
+	(138.10, 53.20) --
+	(138.37, 53.08) --
+	(138.64, 52.97) --
+	(138.91, 52.85) --
+	(139.17, 52.72) --
+	(139.44, 52.60) --
+	(139.71, 52.47) --
+	(139.97, 52.35) --
+	(140.24, 52.22) --
+	(140.51, 52.09) --
+	(140.77, 51.96) --
+	(141.04, 51.84) --
+	(141.31, 51.71) --
+	(141.58, 51.59) --
+	(141.84, 51.47) --
+	(142.11, 51.35) --
+	(142.38, 51.24) --
+	(142.64, 51.13) --
+	(142.91, 51.02) --
+	(143.18, 50.92) --
+	(143.44, 50.82) --
+	(143.71, 50.73) --
+	(143.98, 50.64) --
+	(144.25, 50.56) --
+	(144.51, 50.48) --
+	(144.78, 50.41) --
+	(145.05, 50.34) --
+	(145.31, 50.27) --
+	(145.58, 50.22) --
+	(145.85, 50.16) --
+	(146.11, 50.11) --
+	(146.38, 50.07) --
+	(146.65, 50.03) --
+	(146.92, 49.99) --
+	(147.18, 49.95) --
+	(147.45, 49.92) --
+	(147.72, 49.89) --
+	(147.98, 49.87) --
+	(148.25, 49.84) --
+	(148.52, 49.82) --
+	(148.79, 49.80) --
+	(149.05, 49.78) --
+	(149.32, 49.77) --
+	(149.59, 49.75) --
+	(149.85, 49.74) --
+	(150.12, 49.72) --
+	(150.39, 49.71) --
+	(150.65, 49.70) --
+	(150.92, 49.69) --
+	(151.19, 49.68) --
+	(151.46, 49.67) --
+	(151.72, 49.65) --
+	(151.99, 49.64) --
+	(152.26, 49.63) --
+	(152.52, 49.62) --
+	(152.79, 49.61) --
+	(153.06, 49.60) --
+	(153.32, 49.58) --
+	(153.59, 49.57) --
+	(153.86, 49.56) --
+	(154.13, 49.54) --
+	(154.39, 49.53) --
+	(154.66, 49.51) --
+	(154.93, 49.50) --
+	(155.19, 49.49) --
+	(155.46, 49.47) --
+	(155.73, 49.46) --
+	(155.99, 49.44) --
+	(156.26, 49.43) --
+	(156.53, 49.42) --
+	(156.80, 49.40) --
+	(157.06, 49.39) --
+	(157.33, 49.38) --
+	(157.60, 49.37) --
+	(157.86, 49.35) --
+	(158.13, 49.34) --
+	(158.40, 49.34) --
+	(158.67, 49.33) --
+	(158.93, 49.32) --
+	(159.20, 49.32) --
+	(159.47, 49.31) --
+	(159.73, 49.31) --
+	(160.00, 49.30) --
+	(160.27, 49.30) --
+	(160.53, 49.30) --
+	(160.80, 49.31) --
+	(161.07, 49.31) --
+	(161.34, 49.31) --
+	(161.60, 49.32) --
+	(161.87, 49.32) --
+	(162.14, 49.33) --
+	(162.40, 49.34) --
+	(162.67, 49.35) --
+	(162.94, 49.36) --
+	(163.20, 49.37) --
+	(163.47, 49.38) --
+	(163.74, 49.39) --
+	(164.01, 49.40) --
+	(164.27, 49.42) --
+	(164.54, 49.43) --
+	(164.81, 49.45) --
+	(165.07, 49.46) --
+	(165.34, 49.47) --
+	(165.61, 49.49) --
+	(165.87, 49.50) --
+	(166.14, 49.52) --
+	(166.41, 49.53) --
+	(166.68, 49.54) --
+	(166.94, 49.55) --
+	(167.21, 49.57) --
+	(167.48, 49.58) --
+	(167.74, 49.59) --
+	(168.01, 49.60) --
+	(168.28, 49.61) --
+	(168.54, 49.62) --
+	(168.81, 49.63) --
+	(169.08, 49.64) --
+	(169.35, 49.65) --
+	(169.61, 49.66) --
+	(169.88, 49.67) --
+	(170.15, 49.68) --
+	(170.41, 49.69) --
+	(170.68, 49.69) --
+	(170.95, 49.70) --
+	(171.22, 49.71) --
+	(171.48, 49.71) --
+	(171.75, 49.71) --
+	(172.02, 49.72) --
+	(172.28, 49.72) --
+	(172.55, 49.72) --
+	(172.82, 49.72) --
+	(173.08, 49.72) --
+	(173.35, 49.72) --
+	(173.62, 49.72) --
+	(173.89, 49.71) --
+	(174.15, 49.71) --
+	(174.42, 49.70) --
+	(174.69, 49.69) --
+	(174.95, 49.68) --
+	(175.22, 49.67) --
+	(175.49, 49.66) --
+	(175.75, 49.64) --
+	(176.02, 49.63) --
+	(176.29, 49.61) --
+	(176.56, 49.59) --
+	(176.82, 49.57) --
+	(177.09, 49.56) --
+	(177.36, 49.54) --
+	(177.62, 49.52) --
+	(177.89, 49.50) --
+	(178.16, 49.48) --
+	(178.42, 49.46) --
+	(178.69, 49.44) --
+	(178.96, 49.42) --
+	(179.23, 49.40) --
+	(179.49, 49.39) --
+	(179.76, 49.37) --
+	(180.03, 49.35) --
+	(180.29, 49.34) --
+	(180.56, 49.33) --
+	(180.83, 49.31) --
+	(181.09, 49.30) --
+	(181.36, 49.29) --
+	(181.63, 49.28) --
+	(181.90, 49.27) --
+	(182.16, 49.26) --
+	(182.43, 49.25) --
+	(182.70, 49.25) --
+	(182.96, 49.24) --
+	(183.23, 49.23) --
+	(183.50, 49.23) --
+	(183.77, 49.22) --
+	(184.03, 49.22) --
+	(184.30, 49.22) --
+	(184.57, 49.21) --
+	(184.83, 49.21) --
+	(185.10, 49.21) --
+	(185.37, 49.21) --
+	(185.63, 49.21) --
+	(185.90, 49.21) --
+	(186.17, 49.20);
+\definecolor[named]{fillColor}{rgb}{1.00,0.65,0.00}
+
+\draw[fill=fillColor,fill opacity=0.25,draw opacity=0.00,] ( 30.95, 49.20) --
+	( 31.74, 49.20) --
+	( 32.54, 49.20) --
+	( 33.33, 49.20) --
+	( 34.13, 49.20) --
+	( 34.93, 49.20) --
+	( 35.72, 49.20) --
+	( 36.52, 49.20) --
+	( 37.31, 49.20) --
+	( 38.11, 49.20) --
+	( 38.91, 49.20) --
+	( 39.70, 49.20) --
+	( 40.50, 49.21) --
+	( 41.29, 49.21) --
+	( 42.09, 49.21) --
+	( 42.88, 49.21) --
+	( 43.68, 49.21) --
+	( 44.48, 49.21) --
+	( 45.27, 49.21) --
+	( 46.07, 49.22) --
+	( 46.86, 49.22) --
+	( 47.66, 49.22) --
+	( 48.45, 49.22) --
+	( 49.25, 49.23) --
+	( 50.05, 49.23) --
+	( 50.84, 49.23) --
+	( 51.64, 49.23) --
+	( 52.43, 49.24) --
+	( 53.23, 49.24) --
+	( 54.02, 49.24) --
+	( 54.82, 49.25) --
+	( 55.62, 49.25) --
+	( 56.41, 49.25) --
+	( 57.21, 49.26) --
+	( 58.00, 49.26) --
+	( 58.80, 49.26) --
+	( 59.60, 49.26) --
+	( 60.39, 49.27) --
+	( 61.19, 49.27) --
+	( 61.98, 49.27) --
+	( 62.78, 49.27) --
+	( 63.57, 49.27) --
+	( 64.37, 49.27) --
+	( 65.17, 49.27) --
+	( 65.96, 49.27) --
+	( 66.76, 49.27) --
+	( 67.55, 49.27) --
+	( 68.35, 49.27) --
+	( 69.14, 49.27) --
+	( 69.94, 49.27) --
+	( 70.74, 49.27) --
+	( 71.53, 49.26) --
+	( 72.33, 49.26) --
+	( 73.12, 49.26) --
+	( 73.92, 49.26) --
+	( 74.72, 49.25) --
+	( 75.51, 49.25) --
+	( 76.31, 49.25) --
+	( 77.10, 49.25) --
+	( 77.90, 49.24) --
+	( 78.69, 49.24) --
+	( 79.49, 49.24) --
+	( 80.29, 49.24) --
+	( 81.08, 49.24) --
+	( 81.88, 49.24) --
+	( 82.67, 49.23) --
+	( 83.47, 49.23) --
+	( 84.26, 49.23) --
+	( 85.06, 49.23) --
+	( 85.86, 49.23) --
+	( 86.65, 49.23) --
+	( 87.45, 49.23) --
+	( 88.24, 49.22) --
+	( 89.04, 49.22) --
+	( 89.83, 49.22) --
+	( 90.63, 49.22) --
+	( 91.43, 49.22) --
+	( 92.22, 49.22) --
+	( 93.02, 49.22) --
+	( 93.81, 49.22) --
+	( 94.61, 49.22) --
+	( 95.41, 49.22) --
+	( 96.20, 49.22) --
+	( 97.00, 49.22) --
+	( 97.79, 49.22) --
+	( 98.59, 49.22) --
+	( 99.38, 49.22) --
+	(100.18, 49.22) --
+	(100.98, 49.22) --
+	(101.77, 49.22) --
+	(102.57, 49.23) --
+	(103.36, 49.23) --
+	(104.16, 49.23) --
+	(104.95, 49.23) --
+	(105.75, 49.23) --
+	(106.55, 49.23) --
+	(107.34, 49.24) --
+	(108.14, 49.24) --
+	(108.93, 49.24) --
+	(109.73, 49.24) --
+	(110.53, 49.24) --
+	(111.32, 49.25) --
+	(112.12, 49.25) --
+	(112.91, 49.25) --
+	(113.71, 49.25) --
+	(114.50, 49.26) --
+	(115.30, 49.26) --
+	(116.10, 49.26) --
+	(116.89, 49.26) --
+	(117.69, 49.26) --
+	(118.48, 49.27) --
+	(119.28, 49.27) --
+	(120.07, 49.27) --
+	(120.87, 49.27) --
+	(121.67, 49.27) --
+	(122.46, 49.28) --
+	(123.26, 49.28) --
+	(124.05, 49.28) --
+	(124.85, 49.28) --
+	(125.65, 49.28) --
+	(126.44, 49.29) --
+	(127.24, 49.29) --
+	(128.03, 49.29) --
+	(128.83, 49.29) --
+	(129.62, 49.30) --
+	(130.42, 49.30) --
+	(131.22, 49.31) --
+	(132.01, 49.31) --
+	(132.81, 49.32) --
+	(133.60, 49.32) --
+	(134.40, 49.33) --
+	(135.19, 49.34) --
+	(135.99, 49.36) --
+	(136.79, 49.37) --
+	(137.58, 49.38) --
+	(138.38, 49.40) --
+	(139.17, 49.42) --
+	(139.97, 49.44) --
+	(140.76, 49.47) --
+	(141.56, 49.50) --
+	(142.36, 49.53) --
+	(143.15, 49.57) --
+	(143.95, 49.61) --
+	(144.74, 49.65) --
+	(145.54, 49.70) --
+	(146.34, 49.76) --
+	(147.13, 49.82) --
+	(147.93, 49.89) --
+	(148.72, 49.96) --
+	(149.52, 50.04) --
+	(150.31, 50.13) --
+	(151.11, 50.23) --
+	(151.91, 50.33) --
+	(152.70, 50.45) --
+	(153.50, 50.57) --
+	(154.29, 50.70) --
+	(155.09, 50.85) --
+	(155.88, 51.00) --
+	(156.68, 51.16) --
+	(157.48, 51.33) --
+	(158.27, 51.52) --
+	(159.07, 51.72) --
+	(159.86, 51.93) --
+	(160.66, 52.15) --
+	(161.46, 52.38) --
+	(162.25, 52.62) --
+	(163.05, 52.87) --
+	(163.84, 53.14) --
+	(164.64, 53.42) --
+	(165.43, 53.71) --
+	(166.23, 54.01) --
+	(167.03, 54.33) --
+	(167.82, 54.66) --
+	(168.62, 55.00) --
+	(169.41, 55.35) --
+	(170.21, 55.72) --
+	(171.00, 56.10) --
+	(171.80, 56.49) --
+	(172.60, 56.90) --
+	(173.39, 57.32) --
+	(174.19, 57.76) --
+	(174.98, 58.21) --
+	(175.78, 58.68) --
+	(176.58, 59.16) --
+	(177.37, 59.66) --
+	(178.17, 60.18) --
+	(178.96, 60.71) --
+	(179.76, 61.25) --
+	(180.55, 61.82) --
+	(181.35, 62.39) --
+	(182.15, 62.98) --
+	(182.94, 63.59) --
+	(183.74, 64.20) --
+	(184.53, 64.83) --
+	(185.33, 65.46) --
+	(186.12, 66.11) --
+	(186.92, 66.75) --
+	(187.72, 67.40) --
+	(188.51, 68.06) --
+	(189.31, 68.70) --
+	(190.10, 69.35) --
+	(190.90, 69.99) --
+	(191.69, 70.61) --
+	(192.49, 71.22) --
+	(193.29, 71.82) --
+	(194.08, 72.40) --
+	(194.88, 72.96) --
+	(195.67, 73.49) --
+	(196.47, 74.00) --
+	(197.27, 74.48) --
+	(198.06, 74.94) --
+	(198.86, 75.36) --
+	(199.65, 75.75) --
+	(200.45, 76.12) --
+	(201.24, 76.45) --
+	(202.04, 76.75) --
+	(202.84, 77.01) --
+	(203.63, 77.25) --
+	(204.43, 77.47) --
+	(205.22, 77.65) --
+	(206.02, 77.81) --
+	(206.81, 77.94) --
+	(207.61, 78.05) --
+	(208.41, 78.14) --
+	(209.20, 78.21) --
+	(210.00, 78.27) --
+	(210.79, 78.31) --
+	(211.59, 78.33) --
+	(212.39, 78.34) --
+	(213.18, 78.35) --
+	(213.98, 78.34) --
+	(214.77, 78.33) --
+	(215.57, 78.31) --
+	(216.36, 78.28) --
+	(217.16, 78.25) --
+	(217.96, 78.20) --
+	(218.75, 78.16) --
+	(219.55, 78.10) --
+	(220.34, 78.04) --
+	(221.14, 77.96) --
+	(221.93, 77.88) --
+	(222.73, 77.79) --
+	(223.53, 77.69) --
+	(224.32, 77.57) --
+	(225.12, 77.44) --
+	(225.91, 77.30) --
+	(226.71, 77.14) --
+	(227.51, 76.97) --
+	(228.30, 76.78) --
+	(229.10, 76.58) --
+	(229.89, 76.35) --
+	(230.69, 76.12) --
+	(231.48, 75.86) --
+	(232.28, 75.59) --
+	(233.08, 75.31) --
+	(233.87, 75.01) --
+	(234.67, 74.70) --
+	(235.46, 74.37) --
+	(236.26, 74.04) --
+	(237.05, 73.69) --
+	(237.85, 73.34) --
+	(238.65, 72.98) --
+	(239.44, 72.61) --
+	(240.24, 72.24) --
+	(241.03, 71.86) --
+	(241.83, 71.49) --
+	(242.62, 71.11) --
+	(243.42, 70.73) --
+	(244.22, 70.35) --
+	(245.01, 69.97) --
+	(245.81, 69.59) --
+	(246.60, 69.21) --
+	(247.40, 68.84) --
+	(248.20, 68.46) --
+	(248.99, 68.08) --
+	(249.79, 67.71) --
+	(250.58, 67.33) --
+	(251.38, 66.95) --
+	(252.17, 66.57) --
+	(252.97, 66.20) --
+	(253.77, 65.81) --
+	(254.56, 65.43) --
+	(255.36, 65.05) --
+	(256.15, 64.66) --
+	(256.95, 64.27) --
+	(257.74, 63.88) --
+	(258.54, 63.49) --
+	(259.34, 63.10) --
+	(260.13, 62.71) --
+	(260.93, 62.32) --
+	(261.72, 61.93) --
+	(262.52, 61.55) --
+	(263.32, 61.17) --
+	(264.11, 60.79) --
+	(264.91, 60.42) --
+	(265.70, 60.05) --
+	(266.50, 59.69) --
+	(267.29, 59.34) --
+	(268.09, 59.00) --
+	(268.89, 58.67) --
+	(269.68, 58.35) --
+	(270.48, 58.04) --
+	(271.27, 57.73) --
+	(272.07, 57.44) --
+	(272.86, 57.16) --
+	(273.66, 56.89) --
+	(274.46, 56.62) --
+	(275.25, 56.37) --
+	(276.05, 56.12) --
+	(276.84, 55.89) --
+	(277.64, 55.66) --
+	(278.44, 55.44) --
+	(279.23, 55.22) --
+	(280.03, 55.01) --
+	(280.82, 54.81) --
+	(281.62, 54.61) --
+	(282.41, 54.42) --
+	(283.21, 54.24) --
+	(284.01, 54.06) --
+	(284.80, 53.88) --
+	(285.60, 53.71) --
+	(286.39, 53.55) --
+	(287.19, 53.39) --
+	(287.98, 53.24) --
+	(288.78, 53.09) --
+	(289.58, 52.94) --
+	(290.37, 52.80) --
+	(291.17, 52.67) --
+	(291.96, 52.54) --
+	(292.76, 52.42) --
+	(293.55, 52.30) --
+	(294.35, 52.19) --
+	(295.15, 52.08) --
+	(295.94, 51.98) --
+	(296.74, 51.88) --
+	(297.53, 51.79) --
+	(298.33, 51.70) --
+	(299.13, 51.61) --
+	(299.92, 51.53) --
+	(300.72, 51.45) --
+	(301.51, 51.37) --
+	(302.31, 51.30) --
+	(303.10, 51.23) --
+	(303.90, 51.16) --
+	(304.70, 51.10) --
+	(305.49, 51.03) --
+	(306.29, 50.97) --
+	(307.08, 50.91) --
+	(307.88, 50.86) --
+	(308.67, 50.80) --
+	(309.47, 50.75) --
+	(310.27, 50.69) --
+	(311.06, 50.64) --
+	(311.86, 50.59) --
+	(312.65, 50.54) --
+	(313.45, 50.49) --
+	(314.25, 50.45) --
+	(315.04, 50.40) --
+	(315.84, 50.36) --
+	(316.63, 50.31) --
+	(317.43, 50.27) --
+	(318.22, 50.23) --
+	(319.02, 50.19) --
+	(319.82, 50.15) --
+	(320.61, 50.11) --
+	(321.41, 50.07) --
+	(322.20, 50.04) --
+	(323.00, 50.01) --
+	(323.79, 49.97) --
+	(324.59, 49.94) --
+	(325.21, 49.92) --
+	(325.21, 49.20) --
+	cycle;
+\definecolor[named]{drawColor}{rgb}{1.00,0.65,0.00}
+
+\draw[color=drawColor,line width= 0.6pt,line cap=round,line join=round,fill opacity=0.00,] ( 30.95, 49.20) --
+	( 31.74, 49.20) --
+	( 32.54, 49.20) --
+	( 33.33, 49.20) --
+	( 34.13, 49.20) --
+	( 34.93, 49.20) --
+	( 35.72, 49.20) --
+	( 36.52, 49.20) --
+	( 37.31, 49.20) --
+	( 38.11, 49.20) --
+	( 38.91, 49.20) --
+	( 39.70, 49.20) --
+	( 40.50, 49.21) --
+	( 41.29, 49.21) --
+	( 42.09, 49.21) --
+	( 42.88, 49.21) --
+	( 43.68, 49.21) --
+	( 44.48, 49.21) --
+	( 45.27, 49.21) --
+	( 46.07, 49.22) --
+	( 46.86, 49.22) --
+	( 47.66, 49.22) --
+	( 48.45, 49.22) --
+	( 49.25, 49.23) --
+	( 50.05, 49.23) --
+	( 50.84, 49.23) --
+	( 51.64, 49.23) --
+	( 52.43, 49.24) --
+	( 53.23, 49.24) --
+	( 54.02, 49.24) --
+	( 54.82, 49.25) --
+	( 55.62, 49.25) --
+	( 56.41, 49.25) --
+	( 57.21, 49.26) --
+	( 58.00, 49.26) --
+	( 58.80, 49.26) --
+	( 59.60, 49.26) --
+	( 60.39, 49.27) --
+	( 61.19, 49.27) --
+	( 61.98, 49.27) --
+	( 62.78, 49.27) --
+	( 63.57, 49.27) --
+	( 64.37, 49.27) --
+	( 65.17, 49.27) --
+	( 65.96, 49.27) --
+	( 66.76, 49.27) --
+	( 67.55, 49.27) --
+	( 68.35, 49.27) --
+	( 69.14, 49.27) --
+	( 69.94, 49.27) --
+	( 70.74, 49.27) --
+	( 71.53, 49.26) --
+	( 72.33, 49.26) --
+	( 73.12, 49.26) --
+	( 73.92, 49.26) --
+	( 74.72, 49.25) --
+	( 75.51, 49.25) --
+	( 76.31, 49.25) --
+	( 77.10, 49.25) --
+	( 77.90, 49.24) --
+	( 78.69, 49.24) --
+	( 79.49, 49.24) --
+	( 80.29, 49.24) --
+	( 81.08, 49.24) --
+	( 81.88, 49.24) --
+	( 82.67, 49.23) --
+	( 83.47, 49.23) --
+	( 84.26, 49.23) --
+	( 85.06, 49.23) --
+	( 85.86, 49.23) --
+	( 86.65, 49.23) --
+	( 87.45, 49.23) --
+	( 88.24, 49.22) --
+	( 89.04, 49.22) --
+	( 89.83, 49.22) --
+	( 90.63, 49.22) --
+	( 91.43, 49.22) --
+	( 92.22, 49.22) --
+	( 93.02, 49.22) --
+	( 93.81, 49.22) --
+	( 94.61, 49.22) --
+	( 95.41, 49.22) --
+	( 96.20, 49.22) --
+	( 97.00, 49.22) --
+	( 97.79, 49.22) --
+	( 98.59, 49.22) --
+	( 99.38, 49.22) --
+	(100.18, 49.22) --
+	(100.98, 49.22) --
+	(101.77, 49.22) --
+	(102.57, 49.23) --
+	(103.36, 49.23) --
+	(104.16, 49.23) --
+	(104.95, 49.23) --
+	(105.75, 49.23) --
+	(106.55, 49.23) --
+	(107.34, 49.24) --
+	(108.14, 49.24) --
+	(108.93, 49.24) --
+	(109.73, 49.24) --
+	(110.53, 49.24) --
+	(111.32, 49.25) --
+	(112.12, 49.25) --
+	(112.91, 49.25) --
+	(113.71, 49.25) --
+	(114.50, 49.26) --
+	(115.30, 49.26) --
+	(116.10, 49.26) --
+	(116.89, 49.26) --
+	(117.69, 49.26) --
+	(118.48, 49.27) --
+	(119.28, 49.27) --
+	(120.07, 49.27) --
+	(120.87, 49.27) --
+	(121.67, 49.27) --
+	(122.46, 49.28) --
+	(123.26, 49.28) --
+	(124.05, 49.28) --
+	(124.85, 49.28) --
+	(125.65, 49.28) --
+	(126.44, 49.29) --
+	(127.24, 49.29) --
+	(128.03, 49.29) --
+	(128.83, 49.29) --
+	(129.62, 49.30) --
+	(130.42, 49.30) --
+	(131.22, 49.31) --
+	(132.01, 49.31) --
+	(132.81, 49.32) --
+	(133.60, 49.32) --
+	(134.40, 49.33) --
+	(135.19, 49.34) --
+	(135.99, 49.36) --
+	(136.79, 49.37) --
+	(137.58, 49.38) --
+	(138.38, 49.40) --
+	(139.17, 49.42) --
+	(139.97, 49.44) --
+	(140.76, 49.47) --
+	(141.56, 49.50) --
+	(142.36, 49.53) --
+	(143.15, 49.57) --
+	(143.95, 49.61) --
+	(144.74, 49.65) --
+	(145.54, 49.70) --
+	(146.34, 49.76) --
+	(147.13, 49.82) --
+	(147.93, 49.89) --
+	(148.72, 49.96) --
+	(149.52, 50.04) --
+	(150.31, 50.13) --
+	(151.11, 50.23) --
+	(151.91, 50.33) --
+	(152.70, 50.45) --
+	(153.50, 50.57) --
+	(154.29, 50.70) --
+	(155.09, 50.85) --
+	(155.88, 51.00) --
+	(156.68, 51.16) --
+	(157.48, 51.33) --
+	(158.27, 51.52) --
+	(159.07, 51.72) --
+	(159.86, 51.93) --
+	(160.66, 52.15) --
+	(161.46, 52.38) --
+	(162.25, 52.62) --
+	(163.05, 52.87) --
+	(163.84, 53.14) --
+	(164.64, 53.42) --
+	(165.43, 53.71) --
+	(166.23, 54.01) --
+	(167.03, 54.33) --
+	(167.82, 54.66) --
+	(168.62, 55.00) --
+	(169.41, 55.35) --
+	(170.21, 55.72) --
+	(171.00, 56.10) --
+	(171.80, 56.49) --
+	(172.60, 56.90) --
+	(173.39, 57.32) --
+	(174.19, 57.76) --
+	(174.98, 58.21) --
+	(175.78, 58.68) --
+	(176.58, 59.16) --
+	(177.37, 59.66) --
+	(178.17, 60.18) --
+	(178.96, 60.71) --
+	(179.76, 61.25) --
+	(180.55, 61.82) --
+	(181.35, 62.39) --
+	(182.15, 62.98) --
+	(182.94, 63.59) --
+	(183.74, 64.20) --
+	(184.53, 64.83) --
+	(185.33, 65.46) --
+	(186.12, 66.11) --
+	(186.92, 66.75) --
+	(187.72, 67.40) --
+	(188.51, 68.06) --
+	(189.31, 68.70) --
+	(190.10, 69.35) --
+	(190.90, 69.99) --
+	(191.69, 70.61) --
+	(192.49, 71.22) --
+	(193.29, 71.82) --
+	(194.08, 72.40) --
+	(194.88, 72.96) --
+	(195.67, 73.49) --
+	(196.47, 74.00) --
+	(197.27, 74.48) --
+	(198.06, 74.94) --
+	(198.86, 75.36) --
+	(199.65, 75.75) --
+	(200.45, 76.12) --
+	(201.24, 76.45) --
+	(202.04, 76.75) --
+	(202.84, 77.01) --
+	(203.63, 77.25) --
+	(204.43, 77.47) --
+	(205.22, 77.65) --
+	(206.02, 77.81) --
+	(206.81, 77.94) --
+	(207.61, 78.05) --
+	(208.41, 78.14) --
+	(209.20, 78.21) --
+	(210.00, 78.27) --
+	(210.79, 78.31) --
+	(211.59, 78.33) --
+	(212.39, 78.34) --
+	(213.18, 78.35) --
+	(213.98, 78.34) --
+	(214.77, 78.33) --
+	(215.57, 78.31) --
+	(216.36, 78.28) --
+	(217.16, 78.25) --
+	(217.96, 78.20) --
+	(218.75, 78.16) --
+	(219.55, 78.10) --
+	(220.34, 78.04) --
+	(221.14, 77.96) --
+	(221.93, 77.88) --
+	(222.73, 77.79) --
+	(223.53, 77.69) --
+	(224.32, 77.57) --
+	(225.12, 77.44) --
+	(225.91, 77.30) --
+	(226.71, 77.14) --
+	(227.51, 76.97) --
+	(228.30, 76.78) --
+	(229.10, 76.58) --
+	(229.89, 76.35) --
+	(230.69, 76.12) --
+	(231.48, 75.86) --
+	(232.28, 75.59) --
+	(233.08, 75.31) --
+	(233.87, 75.01) --
+	(234.67, 74.70) --
+	(235.46, 74.37) --
+	(236.26, 74.04) --
+	(237.05, 73.69) --
+	(237.85, 73.34) --
+	(238.65, 72.98) --
+	(239.44, 72.61) --
+	(240.24, 72.24) --
+	(241.03, 71.86) --
+	(241.83, 71.49) --
+	(242.62, 71.11) --
+	(243.42, 70.73) --
+	(244.22, 70.35) --
+	(245.01, 69.97) --
+	(245.81, 69.59) --
+	(246.60, 69.21) --
+	(247.40, 68.84) --
+	(248.20, 68.46) --
+	(248.99, 68.08) --
+	(249.79, 67.71) --
+	(250.58, 67.33) --
+	(251.38, 66.95) --
+	(252.17, 66.57) --
+	(252.97, 66.20) --
+	(253.77, 65.81) --
+	(254.56, 65.43) --
+	(255.36, 65.05) --
+	(256.15, 64.66) --
+	(256.95, 64.27) --
+	(257.74, 63.88) --
+	(258.54, 63.49) --
+	(259.34, 63.10) --
+	(260.13, 62.71) --
+	(260.93, 62.32) --
+	(261.72, 61.93) --
+	(262.52, 61.55) --
+	(263.32, 61.17) --
+	(264.11, 60.79) --
+	(264.91, 60.42) --
+	(265.70, 60.05) --
+	(266.50, 59.69) --
+	(267.29, 59.34) --
+	(268.09, 59.00) --
+	(268.89, 58.67) --
+	(269.68, 58.35) --
+	(270.48, 58.04) --
+	(271.27, 57.73) --
+	(272.07, 57.44) --
+	(272.86, 57.16) --
+	(273.66, 56.89) --
+	(274.46, 56.62) --
+	(275.25, 56.37) --
+	(276.05, 56.12) --
+	(276.84, 55.89) --
+	(277.64, 55.66) --
+	(278.44, 55.44) --
+	(279.23, 55.22) --
+	(280.03, 55.01) --
+	(280.82, 54.81) --
+	(281.62, 54.61) --
+	(282.41, 54.42) --
+	(283.21, 54.24) --
+	(284.01, 54.06) --
+	(284.80, 53.88) --
+	(285.60, 53.71) --
+	(286.39, 53.55) --
+	(287.19, 53.39) --
+	(287.98, 53.24) --
+	(288.78, 53.09) --
+	(289.58, 52.94) --
+	(290.37, 52.80) --
+	(291.17, 52.67) --
+	(291.96, 52.54) --
+	(292.76, 52.42) --
+	(293.55, 52.30) --
+	(294.35, 52.19) --
+	(295.15, 52.08) --
+	(295.94, 51.98) --
+	(296.74, 51.88) --
+	(297.53, 51.79) --
+	(298.33, 51.70) --
+	(299.13, 51.61) --
+	(299.92, 51.53) --
+	(300.72, 51.45) --
+	(301.51, 51.37) --
+	(302.31, 51.30) --
+	(303.10, 51.23) --
+	(303.90, 51.16) --
+	(304.70, 51.10) --
+	(305.49, 51.03) --
+	(306.29, 50.97) --
+	(307.08, 50.91) --
+	(307.88, 50.86) --
+	(308.67, 50.80) --
+	(309.47, 50.75) --
+	(310.27, 50.69) --
+	(311.06, 50.64) --
+	(311.86, 50.59) --
+	(312.65, 50.54) --
+	(313.45, 50.49) --
+	(314.25, 50.45) --
+	(315.04, 50.40) --
+	(315.84, 50.36) --
+	(316.63, 50.31) --
+	(317.43, 50.27) --
+	(318.22, 50.23) --
+	(319.02, 50.19) --
+	(319.82, 50.15) --
+	(320.61, 50.11) --
+	(321.41, 50.07) --
+	(322.20, 50.04) --
+	(323.00, 50.01) --
+	(323.79, 49.97) --
+	(324.59, 49.94) --
+	(325.21, 49.92);
+\definecolor[named]{fillColor}{rgb}{0.00,1.00,0.00}
+
+\draw[fill=fillColor,fill opacity=0.25,draw opacity=0.00,] ( 49.20, 49.20) --
+	( 49.20, 49.20) --
+	( 49.89, 91.95) --
+	( 50.58,124.41) --
+	( 51.27,139.95) --
+	( 51.96,146.48) --
+	( 52.64,148.19) --
+	( 53.33,147.26) --
+	( 54.02,144.88) --
+	( 54.71,141.72) --
+	( 55.40,138.18) --
+	( 56.09,134.48) --
+	( 56.78,130.76) --
+	( 57.47,127.11) --
+	( 58.15,123.58) --
+	( 58.84,120.20) --
+	( 59.53,116.97) --
+	( 60.22,113.90) --
+	( 60.91,111.00) --
+	( 61.60,108.26) --
+	( 62.29,105.66) --
+	( 62.98,103.21) --
+	( 63.66,100.90) --
+	( 64.35, 98.72) --
+	( 65.04, 96.66) --
+	( 65.73, 94.72) --
+	( 66.42, 92.88) --
+	( 67.11, 91.14) --
+	( 67.80, 89.49) --
+	( 68.49, 87.93) --
+	( 69.17, 86.46) --
+	( 69.86, 85.06) --
+	( 70.55, 83.73) --
+	( 71.24, 82.47) --
+	( 71.93, 81.27) --
+	( 72.62, 80.13) --
+	( 73.31, 79.05) --
+	( 74.00, 78.02) --
+	( 74.68, 77.04) --
+	( 75.37, 76.10) --
+	( 76.06, 75.21) --
+	( 76.75, 74.36) --
+	( 77.44, 73.54) --
+	( 78.13, 72.76) --
+	( 78.82, 72.02) --
+	( 79.51, 71.31) --
+	( 80.19, 70.63) --
+	( 80.88, 69.98) --
+	( 81.57, 69.35) --
+	( 82.26, 68.75) --
+	( 82.95, 68.18) --
+	( 83.64, 67.62) --
+	( 84.33, 67.09) --
+	( 85.02, 66.59) --
+	( 85.70, 66.10) --
+	( 86.39, 65.63) --
+	( 87.08, 65.17) --
+	( 87.77, 64.74) --
+	( 88.46, 64.32) --
+	( 89.15, 63.92) --
+	( 89.84, 63.53) --
+	( 90.53, 63.15) --
+	( 91.21, 62.79) --
+	( 91.90, 62.44) --
+	( 92.59, 62.10) --
+	( 93.28, 61.78) --
+	( 93.97, 61.47) --
+	( 94.66, 61.16) --
+	( 95.35, 60.87) --
+	( 96.04, 60.59) --
+	( 96.72, 60.31) --
+	( 97.41, 60.05) --
+	( 98.10, 59.79) --
+	( 98.79, 59.54) --
+	( 99.48, 59.30) --
+	(100.17, 59.07) --
+	(100.86, 58.84) --
+	(101.55, 58.62) --
+	(102.23, 58.41) --
+	(102.92, 58.21) --
+	(103.61, 58.01) --
+	(104.30, 57.81) --
+	(104.99, 57.63) --
+	(105.68, 57.45) --
+	(106.37, 57.27) --
+	(107.06, 57.10) --
+	(107.74, 56.93) --
+	(108.43, 56.77) --
+	(109.12, 56.61) --
+	(109.81, 56.46) --
+	(110.50, 56.31) --
+	(111.19, 56.16) --
+	(111.88, 56.02) --
+	(112.57, 55.89) --
+	(113.25, 55.75) --
+	(113.94, 55.62) --
+	(114.63, 55.50) --
+	(115.32, 55.38) --
+	(116.01, 55.26) --
+	(116.70, 55.14) --
+	(117.39, 55.03) --
+	(118.08, 54.91) --
+	(118.76, 54.81) --
+	(119.45, 54.70) --
+	(120.14, 54.60) --
+	(120.83, 54.50) --
+	(121.52, 54.40) --
+	(122.21, 54.31) --
+	(122.90, 54.21) --
+	(123.59, 54.12) --
+	(124.27, 54.04) --
+	(124.96, 53.95) --
+	(125.65, 53.87) --
+	(126.34, 53.78) --
+	(127.03, 53.70) --
+	(127.72, 53.62) --
+	(128.41, 53.55) --
+	(129.10, 53.47) --
+	(129.78, 53.40) --
+	(130.47, 53.33) --
+	(131.16, 53.26) --
+	(131.85, 53.19) --
+	(132.54, 53.12) --
+	(133.23, 53.06) --
+	(133.92, 53.00) --
+	(134.61, 52.93) --
+	(135.29, 52.87) --
+	(135.98, 52.81) --
+	(136.67, 52.75) --
+	(137.36, 52.70) --
+	(138.05, 52.64) --
+	(138.74, 52.59) --
+	(139.43, 52.53) --
+	(140.12, 52.48) --
+	(140.80, 52.43) --
+	(141.49, 52.38) --
+	(142.18, 52.33) --
+	(142.87, 52.28) --
+	(143.56, 52.23) --
+	(144.25, 52.19) --
+	(144.94, 52.14) --
+	(145.63, 52.10) --
+	(146.32, 52.05) --
+	(147.00, 52.01) --
+	(147.69, 51.97) --
+	(148.38, 51.93) --
+	(149.07, 51.89) --
+	(149.76, 51.85) --
+	(150.45, 51.81) --
+	(151.14, 51.77) --
+	(151.83, 51.74) --
+	(152.51, 51.70) --
+	(153.20, 51.66) --
+	(153.89, 51.63) --
+	(154.58, 51.59) --
+	(155.27, 51.56) --
+	(155.96, 51.53) --
+	(156.65, 51.49) --
+	(157.34, 51.46) --
+	(158.02, 51.43) --
+	(158.71, 51.40) --
+	(159.40, 51.37) --
+	(160.09, 51.34) --
+	(160.78, 51.31) --
+	(161.47, 51.28) --
+	(162.16, 51.25) --
+	(162.85, 51.23) --
+	(163.53, 51.20) --
+	(164.22, 51.17) --
+	(164.91, 51.15) --
+	(165.60, 51.12) --
+	(166.29, 51.09) --
+	(166.98, 51.07) --
+	(167.67, 51.05) --
+	(168.36, 51.02) --
+	(169.04, 51.00) --
+	(169.73, 50.97) --
+	(170.42, 50.95) --
+	(171.11, 50.93) --
+	(171.80, 50.91) --
+	(172.49, 50.89) --
+	(173.18, 50.86) --
+	(173.87, 50.84) --
+	(174.55, 50.82) --
+	(175.24, 50.80) --
+	(175.93, 50.78) --
+	(176.62, 50.76) --
+	(177.31, 50.74) --
+	(178.00, 50.72) --
+	(178.69, 50.71) --
+	(179.38, 50.69) --
+	(180.06, 50.67) --
+	(180.75, 50.65) --
+	(181.44, 50.63) --
+	(182.13, 50.62) --
+	(182.82, 50.60) --
+	(183.51, 50.58) --
+	(184.20, 50.57) --
+	(184.89, 50.55) --
+	(185.57, 50.53) --
+	(186.26, 50.52) --
+	(186.95, 50.50) --
+	(187.64, 50.49) --
+	(188.33, 50.47) --
+	(189.02, 50.46) --
+	(189.71, 50.44) --
+	(190.40, 50.43) --
+	(191.08, 50.42) --
+	(191.77, 50.40) --
+	(192.46, 50.39) --
+	(193.15, 50.37) --
+	(193.84, 50.36) --
+	(194.53, 50.35) --
+	(195.22, 50.34) --
+	(195.91, 50.32) --
+	(196.59, 50.31) --
+	(197.28, 50.30) --
+	(197.97, 50.29) --
+	(198.66, 50.27) --
+	(199.35, 50.26) --
+	(200.04, 50.25) --
+	(200.73, 50.24) --
+	(201.42, 50.23) --
+	(202.10, 50.22) --
+	(202.79, 50.20) --
+	(203.48, 50.19) --
+	(204.17, 50.18) --
+	(204.86, 50.17) --
+	(205.55, 50.16) --
+	(206.24, 50.15) --
+	(206.93, 50.14) --
+	(207.61, 50.13) --
+	(208.30, 50.12) --
+	(208.99, 50.11) --
+	(209.68, 50.10) --
+	(210.37, 50.09) --
+	(211.06, 50.08) --
+	(211.75, 50.08) --
+	(212.44, 50.07) --
+	(213.12, 50.06) --
+	(213.81, 50.05) --
+	(214.50, 50.04) --
+	(215.19, 50.03) --
+	(215.88, 50.02) --
+	(216.57, 50.01) --
+	(217.26, 50.01) --
+	(217.95, 50.00) --
+	(218.63, 49.99) --
+	(219.32, 49.98) --
+	(220.01, 49.97) --
+	(220.70, 49.97) --
+	(221.39, 49.96) --
+	(222.08, 49.95) --
+	(222.77, 49.94) --
+	(223.46, 49.94) --
+	(224.14, 49.93) --
+	(224.83, 49.92) --
+	(225.52, 49.91) --
+	(226.21, 49.91) --
+	(226.90, 49.90) --
+	(227.59, 49.89) --
+	(228.28, 49.89) --
+	(228.97, 49.88) --
+	(229.65, 49.87) --
+	(230.34, 49.87) --
+	(231.03, 49.86) --
+	(231.72, 49.86) --
+	(232.41, 49.85) --
+	(233.10, 49.84) --
+	(233.79, 49.84) --
+	(234.48, 49.83) --
+	(235.17, 49.82) --
+	(235.85, 49.82) --
+	(236.54, 49.81) --
+	(237.23, 49.81) --
+	(237.92, 49.80) --
+	(238.61, 49.80) --
+	(239.30, 49.79) --
+	(239.99, 49.79) --
+	(240.68, 49.78) --
+	(241.36, 49.77) --
+	(242.05, 49.77) --
+	(242.74, 49.76) --
+	(243.43, 49.76) --
+	(244.12, 49.75) --
+	(244.81, 49.75) --
+	(245.50, 49.74) --
+	(246.19, 49.74) --
+	(246.87, 49.73) --
+	(247.56, 49.73) --
+	(248.25, 49.72) --
+	(248.94, 49.72) --
+	(249.63, 49.72) --
+	(250.32, 49.71) --
+	(251.01, 49.71) --
+	(251.70, 49.70) --
+	(252.38, 49.70) --
+	(253.07, 49.69) --
+	(253.76, 49.69) --
+	(254.45, 49.68) --
+	(255.14, 49.68) --
+	(255.83, 49.68) --
+	(256.52, 49.67) --
+	(257.21, 49.67) --
+	(257.89, 49.66) --
+	(258.58, 49.66) --
+	(259.27, 49.66) --
+	(259.96, 49.65) --
+	(260.65, 49.65) --
+	(261.34, 49.64) --
+	(262.03, 49.64) --
+	(262.72, 49.64) --
+	(263.40, 49.63) --
+	(264.09, 49.63) --
+	(264.78, 49.63) --
+	(265.47, 49.62) --
+	(266.16, 49.62) --
+	(266.85, 49.62) --
+	(267.54, 49.61) --
+	(268.23, 49.61) --
+	(268.91, 49.60) --
+	(269.60, 49.60) --
+	(270.29, 49.60) --
+	(270.98, 49.60) --
+	(271.67, 49.59) --
+	(272.36, 49.59) --
+	(273.05, 49.59) --
+	(273.74, 49.58) --
+	(274.42, 49.58) --
+	(275.11, 49.58) --
+	(275.80, 49.57) --
+	(276.49, 49.57) --
+	(277.18, 49.57) --
+	(277.87, 49.56) --
+	(278.56, 49.56) --
+	(279.25, 49.56) --
+	(279.93, 49.56) --
+	(280.62, 49.55) --
+	(281.31, 49.55) --
+	(282.00, 49.55) --
+	(282.69, 49.54) --
+	(283.38, 49.54) --
+	(284.07, 49.54) --
+	(284.76, 49.54) --
+	(285.44, 49.53) --
+	(286.13, 49.53) --
+	(286.82, 49.53) --
+	(287.51, 49.53) --
+	(288.20, 49.52) --
+	(288.89, 49.52) --
+	(289.58, 49.52) --
+	(290.27, 49.52) --
+	(290.95, 49.51) --
+	(291.64, 49.51) --
+	(292.33, 49.51) --
+	(293.02, 49.51) --
+	(293.71, 49.50) --
+	(294.40, 49.50) --
+	(295.09, 49.50) --
+	(295.78, 49.50) --
+	(296.46, 49.49) --
+	(297.15, 49.49) --
+	(297.84, 49.49) --
+	(298.53, 49.49) --
+	(299.22, 49.49) --
+	(299.91, 49.48) --
+	(300.60, 49.48) --
+	(301.29, 49.48) --
+	(301.97, 49.48) --
+	(302.66, 49.48) --
+	(303.35, 49.47) --
+	(304.04, 49.47) --
+	(304.73, 49.47) --
+	(305.42, 49.47) --
+	(306.11, 49.47) --
+	(306.80, 49.46) --
+	(307.48, 49.46) --
+	(308.17, 49.46) --
+	(308.86, 49.46) --
+	(309.55, 49.46) --
+	(310.24, 49.45) --
+	(310.93, 49.45) --
+	(311.62, 49.45) --
+	(312.31, 49.45) --
+	(312.99, 49.45) --
+	(313.68, 49.44) --
+	(314.37, 49.44) --
+	(315.06, 49.44) --
+	(315.75, 49.44) --
+	(316.44, 49.44) --
+	(317.13, 49.44) --
+	(317.82, 49.43) --
+	(318.50, 49.43) --
+	(319.19, 49.43) --
+	(319.88, 49.43) --
+	(320.57, 49.43) --
+	(321.26, 49.43) --
+	(321.95, 49.42) --
+	(322.64, 49.42) --
+	(323.33, 49.42) --
+	(324.02, 49.42) --
+	(324.02, 49.20) --
+	cycle;
+\definecolor[named]{drawColor}{rgb}{0.00,1.00,0.00}
+
+\draw[color=drawColor,line width= 0.6pt,line cap=round,line join=round,fill opacity=0.00,] ( 49.20, 49.20) --
+	( 49.89, 91.95) --
+	( 50.58,124.41) --
+	( 51.27,139.95) --
+	( 51.96,146.48) --
+	( 52.64,148.19) --
+	( 53.33,147.26) --
+	( 54.02,144.88) --
+	( 54.71,141.72) --
+	( 55.40,138.18) --
+	( 56.09,134.48) --
+	( 56.78,130.76) --
+	( 57.47,127.11) --
+	( 58.15,123.58) --
+	( 58.84,120.20) --
+	( 59.53,116.97) --
+	( 60.22,113.90) --
+	( 60.91,111.00) --
+	( 61.60,108.26) --
+	( 62.29,105.66) --
+	( 62.98,103.21) --
+	( 63.66,100.90) --
+	( 64.35, 98.72) --
+	( 65.04, 96.66) --
+	( 65.73, 94.72) --
+	( 66.42, 92.88) --
+	( 67.11, 91.14) --
+	( 67.80, 89.49) --
+	( 68.49, 87.93) --
+	( 69.17, 86.46) --
+	( 69.86, 85.06) --
+	( 70.55, 83.73) --
+	( 71.24, 82.47) --
+	( 71.93, 81.27) --
+	( 72.62, 80.13) --
+	( 73.31, 79.05) --
+	( 74.00, 78.02) --
+	( 74.68, 77.04) --
+	( 75.37, 76.10) --
+	( 76.06, 75.21) --
+	( 76.75, 74.36) --
+	( 77.44, 73.54) --
+	( 78.13, 72.76) --
+	( 78.82, 72.02) --
+	( 79.51, 71.31) --
+	( 80.19, 70.63) --
+	( 80.88, 69.98) --
+	( 81.57, 69.35) --
+	( 82.26, 68.75) --
+	( 82.95, 68.18) --
+	( 83.64, 67.62) --
+	( 84.33, 67.09) --
+	( 85.02, 66.59) --
+	( 85.70, 66.10) --
+	( 86.39, 65.63) --
+	( 87.08, 65.17) --
+	( 87.77, 64.74) --
+	( 88.46, 64.32) --
+	( 89.15, 63.92) --
+	( 89.84, 63.53) --
+	( 90.53, 63.15) --
+	( 91.21, 62.79) --
+	( 91.90, 62.44) --
+	( 92.59, 62.10) --
+	( 93.28, 61.78) --
+	( 93.97, 61.47) --
+	( 94.66, 61.16) --
+	( 95.35, 60.87) --
+	( 96.04, 60.59) --
+	( 96.72, 60.31) --
+	( 97.41, 60.05) --
+	( 98.10, 59.79) --
+	( 98.79, 59.54) --
+	( 99.48, 59.30) --
+	(100.17, 59.07) --
+	(100.86, 58.84) --
+	(101.55, 58.62) --
+	(102.23, 58.41) --
+	(102.92, 58.21) --
+	(103.61, 58.01) --
+	(104.30, 57.81) --
+	(104.99, 57.63) --
+	(105.68, 57.45) --
+	(106.37, 57.27) --
+	(107.06, 57.10) --
+	(107.74, 56.93) --
+	(108.43, 56.77) --
+	(109.12, 56.61) --
+	(109.81, 56.46) --
+	(110.50, 56.31) --
+	(111.19, 56.16) --
+	(111.88, 56.02) --
+	(112.57, 55.89) --
+	(113.25, 55.75) --
+	(113.94, 55.62) --
+	(114.63, 55.50) --
+	(115.32, 55.38) --
+	(116.01, 55.26) --
+	(116.70, 55.14) --
+	(117.39, 55.03) --
+	(118.08, 54.91) --
+	(118.76, 54.81) --
+	(119.45, 54.70) --
+	(120.14, 54.60) --
+	(120.83, 54.50) --
+	(121.52, 54.40) --
+	(122.21, 54.31) --
+	(122.90, 54.21) --
+	(123.59, 54.12) --
+	(124.27, 54.04) --
+	(124.96, 53.95) --
+	(125.65, 53.87) --
+	(126.34, 53.78) --
+	(127.03, 53.70) --
+	(127.72, 53.62) --
+	(128.41, 53.55) --
+	(129.10, 53.47) --
+	(129.78, 53.40) --
+	(130.47, 53.33) --
+	(131.16, 53.26) --
+	(131.85, 53.19) --
+	(132.54, 53.12) --
+	(133.23, 53.06) --
+	(133.92, 53.00) --
+	(134.61, 52.93) --
+	(135.29, 52.87) --
+	(135.98, 52.81) --
+	(136.67, 52.75) --
+	(137.36, 52.70) --
+	(138.05, 52.64) --
+	(138.74, 52.59) --
+	(139.43, 52.53) --
+	(140.12, 52.48) --
+	(140.80, 52.43) --
+	(141.49, 52.38) --
+	(142.18, 52.33) --
+	(142.87, 52.28) --
+	(143.56, 52.23) --
+	(144.25, 52.19) --
+	(144.94, 52.14) --
+	(145.63, 52.10) --
+	(146.32, 52.05) --
+	(147.00, 52.01) --
+	(147.69, 51.97) --
+	(148.38, 51.93) --
+	(149.07, 51.89) --
+	(149.76, 51.85) --
+	(150.45, 51.81) --
+	(151.14, 51.77) --
+	(151.83, 51.74) --
+	(152.51, 51.70) --
+	(153.20, 51.66) --
+	(153.89, 51.63) --
+	(154.58, 51.59) --
+	(155.27, 51.56) --
+	(155.96, 51.53) --
+	(156.65, 51.49) --
+	(157.34, 51.46) --
+	(158.02, 51.43) --
+	(158.71, 51.40) --
+	(159.40, 51.37) --
+	(160.09, 51.34) --
+	(160.78, 51.31) --
+	(161.47, 51.28) --
+	(162.16, 51.25) --
+	(162.85, 51.23) --
+	(163.53, 51.20) --
+	(164.22, 51.17) --
+	(164.91, 51.15) --
+	(165.60, 51.12) --
+	(166.29, 51.09) --
+	(166.98, 51.07) --
+	(167.67, 51.05) --
+	(168.36, 51.02) --
+	(169.04, 51.00) --
+	(169.73, 50.97) --
+	(170.42, 50.95) --
+	(171.11, 50.93) --
+	(171.80, 50.91) --
+	(172.49, 50.89) --
+	(173.18, 50.86) --
+	(173.87, 50.84) --
+	(174.55, 50.82) --
+	(175.24, 50.80) --
+	(175.93, 50.78) --
+	(176.62, 50.76) --
+	(177.31, 50.74) --
+	(178.00, 50.72) --
+	(178.69, 50.71) --
+	(179.38, 50.69) --
+	(180.06, 50.67) --
+	(180.75, 50.65) --
+	(181.44, 50.63) --
+	(182.13, 50.62) --
+	(182.82, 50.60) --
+	(183.51, 50.58) --
+	(184.20, 50.57) --
+	(184.89, 50.55) --
+	(185.57, 50.53) --
+	(186.26, 50.52) --
+	(186.95, 50.50) --
+	(187.64, 50.49) --
+	(188.33, 50.47) --
+	(189.02, 50.46) --
+	(189.71, 50.44) --
+	(190.40, 50.43) --
+	(191.08, 50.42) --
+	(191.77, 50.40) --
+	(192.46, 50.39) --
+	(193.15, 50.37) --
+	(193.84, 50.36) --
+	(194.53, 50.35) --
+	(195.22, 50.34) --
+	(195.91, 50.32) --
+	(196.59, 50.31) --
+	(197.28, 50.30) --
+	(197.97, 50.29) --
+	(198.66, 50.27) --
+	(199.35, 50.26) --
+	(200.04, 50.25) --
+	(200.73, 50.24) --
+	(201.42, 50.23) --
+	(202.10, 50.22) --
+	(202.79, 50.20) --
+	(203.48, 50.19) --
+	(204.17, 50.18) --
+	(204.86, 50.17) --
+	(205.55, 50.16) --
+	(206.24, 50.15) --
+	(206.93, 50.14) --
+	(207.61, 50.13) --
+	(208.30, 50.12) --
+	(208.99, 50.11) --
+	(209.68, 50.10) --
+	(210.37, 50.09) --
+	(211.06, 50.08) --
+	(211.75, 50.08) --
+	(212.44, 50.07) --
+	(213.12, 50.06) --
+	(213.81, 50.05) --
+	(214.50, 50.04) --
+	(215.19, 50.03) --
+	(215.88, 50.02) --
+	(216.57, 50.01) --
+	(217.26, 50.01) --
+	(217.95, 50.00) --
+	(218.63, 49.99) --
+	(219.32, 49.98) --
+	(220.01, 49.97) --
+	(220.70, 49.97) --
+	(221.39, 49.96) --
+	(222.08, 49.95) --
+	(222.77, 49.94) --
+	(223.46, 49.94) --
+	(224.14, 49.93) --
+	(224.83, 49.92) --
+	(225.52, 49.91) --
+	(226.21, 49.91) --
+	(226.90, 49.90) --
+	(227.59, 49.89) --
+	(228.28, 49.89) --
+	(228.97, 49.88) --
+	(229.65, 49.87) --
+	(230.34, 49.87) --
+	(231.03, 49.86) --
+	(231.72, 49.86) --
+	(232.41, 49.85) --
+	(233.10, 49.84) --
+	(233.79, 49.84) --
+	(234.48, 49.83) --
+	(235.17, 49.82) --
+	(235.85, 49.82) --
+	(236.54, 49.81) --
+	(237.23, 49.81) --
+	(237.92, 49.80) --
+	(238.61, 49.80) --
+	(239.30, 49.79) --
+	(239.99, 49.79) --
+	(240.68, 49.78) --
+	(241.36, 49.77) --
+	(242.05, 49.77) --
+	(242.74, 49.76) --
+	(243.43, 49.76) --
+	(244.12, 49.75) --
+	(244.81, 49.75) --
+	(245.50, 49.74) --
+	(246.19, 49.74) --
+	(246.87, 49.73) --
+	(247.56, 49.73) --
+	(248.25, 49.72) --
+	(248.94, 49.72) --
+	(249.63, 49.72) --
+	(250.32, 49.71) --
+	(251.01, 49.71) --
+	(251.70, 49.70) --
+	(252.38, 49.70) --
+	(253.07, 49.69) --
+	(253.76, 49.69) --
+	(254.45, 49.68) --
+	(255.14, 49.68) --
+	(255.83, 49.68) --
+	(256.52, 49.67) --
+	(257.21, 49.67) --
+	(257.89, 49.66) --
+	(258.58, 49.66) --
+	(259.27, 49.66) --
+	(259.96, 49.65) --
+	(260.65, 49.65) --
+	(261.34, 49.64) --
+	(262.03, 49.64) --
+	(262.72, 49.64) --
+	(263.40, 49.63) --
+	(264.09, 49.63) --
+	(264.78, 49.63) --
+	(265.47, 49.62) --
+	(266.16, 49.62) --
+	(266.85, 49.62) --
+	(267.54, 49.61) --
+	(268.23, 49.61) --
+	(268.91, 49.60) --
+	(269.60, 49.60) --
+	(270.29, 49.60) --
+	(270.98, 49.60) --
+	(271.67, 49.59) --
+	(272.36, 49.59) --
+	(273.05, 49.59) --
+	(273.74, 49.58) --
+	(274.42, 49.58) --
+	(275.11, 49.58) --
+	(275.80, 49.57) --
+	(276.49, 49.57) --
+	(277.18, 49.57) --
+	(277.87, 49.56) --
+	(278.56, 49.56) --
+	(279.25, 49.56) --
+	(279.93, 49.56) --
+	(280.62, 49.55) --
+	(281.31, 49.55) --
+	(282.00, 49.55) --
+	(282.69, 49.54) --
+	(283.38, 49.54) --
+	(284.07, 49.54) --
+	(284.76, 49.54) --
+	(285.44, 49.53) --
+	(286.13, 49.53) --
+	(286.82, 49.53) --
+	(287.51, 49.53) --
+	(288.20, 49.52) --
+	(288.89, 49.52) --
+	(289.58, 49.52) --
+	(290.27, 49.52) --
+	(290.95, 49.51) --
+	(291.64, 49.51) --
+	(292.33, 49.51) --
+	(293.02, 49.51) --
+	(293.71, 49.50) --
+	(294.40, 49.50) --
+	(295.09, 49.50) --
+	(295.78, 49.50) --
+	(296.46, 49.49) --
+	(297.15, 49.49) --
+	(297.84, 49.49) --
+	(298.53, 49.49) --
+	(299.22, 49.49) --
+	(299.91, 49.48) --
+	(300.60, 49.48) --
+	(301.29, 49.48) --
+	(301.97, 49.48) --
+	(302.66, 49.48) --
+	(303.35, 49.47) --
+	(304.04, 49.47) --
+	(304.73, 49.47) --
+	(305.42, 49.47) --
+	(306.11, 49.47) --
+	(306.80, 49.46) --
+	(307.48, 49.46) --
+	(308.17, 49.46) --
+	(308.86, 49.46) --
+	(309.55, 49.46) --
+	(310.24, 49.45) --
+	(310.93, 49.45) --
+	(311.62, 49.45) --
+	(312.31, 49.45) --
+	(312.99, 49.45) --
+	(313.68, 49.44) --
+	(314.37, 49.44) --
+	(315.06, 49.44) --
+	(315.75, 49.44) --
+	(316.44, 49.44) --
+	(317.13, 49.44) --
+	(317.82, 49.43) --
+	(318.50, 49.43) --
+	(319.19, 49.43) --
+	(319.88, 49.43) --
+	(320.57, 49.43) --
+	(321.26, 49.43) --
+	(321.95, 49.42) --
+	(322.64, 49.42) --
+	(323.33, 49.42) --
+	(324.02, 49.42);
+\end{scope}
+\end{tikzpicture}
+
+\end{document}
diff --git a/doc/tutorials/DivergenceDating/primatePriorPosteriorShape.tex b/doc/tutorials/DivergenceDating/primatePriorPosteriorShape.tex
new file mode 100644
index 0000000..905935e
--- /dev/null
+++ b/doc/tutorials/DivergenceDating/primatePriorPosteriorShape.tex
@@ -0,0 +1,4347 @@
+% Created by tikzDevice version 0.6.2 on 2014-09-24 13:25:09
+% !TEX encoding = UTF-8 Unicode
+\documentclass[margin=1pt]{standalone}
+\usepackage{tikz}
+\begin{document}
+
+\begin{tikzpicture}[x=1pt,y=1pt]
+\definecolor[named]{drawColor}{rgb}{0.00,0.00,0.00}
+\definecolor[named]{fillColor}{rgb}{1.00,1.00,1.00}
+%\fill[color=fillColor,fill opacity=0.00,] (0,0) rectangle (325.21,216.81);
+\begin{scope}
+%\path[clip] (  0.00,  0.00) rectangle (325.21,216.81);
+\definecolor[named]{drawColor}{rgb}{0.00,0.00,0.00}
+
+\draw[color=drawColor,line cap=round,line join=round,fill opacity=0.00,] ( 49.20, 49.20) -- (324.02, 49.20);
+
+\draw[color=drawColor,line cap=round,line join=round,fill opacity=0.00,] ( 49.20, 49.20) -- ( 49.20, 43.20);
+
+\draw[color=drawColor,line cap=round,line join=round,fill opacity=0.00,] (104.16, 49.20) -- (104.16, 43.20);
+
+\draw[color=drawColor,line cap=round,line join=round,fill opacity=0.00,] (159.13, 49.20) -- (159.13, 43.20);
+
+\draw[color=drawColor,line cap=round,line join=round,fill opacity=0.00,] (214.09, 49.20) -- (214.09, 43.20);
+
+\draw[color=drawColor,line cap=round,line join=round,fill opacity=0.00,] (269.05, 49.20) -- (269.05, 43.20);
+
+\draw[color=drawColor,line cap=round,line join=round,fill opacity=0.00,] (324.02, 49.20) -- (324.02, 43.20);
+
+\node[color=drawColor,anchor=base,inner sep=0pt, outer sep=0pt, scale=  1.00] at ( 49.20, 25.20) {0};
+
+\node[color=drawColor,anchor=base,inner sep=0pt, outer sep=0pt, scale=  1.00] at (104.16, 25.20) {1};
+
+\node[color=drawColor,anchor=base,inner sep=0pt, outer sep=0pt, scale=  1.00] at (159.13, 25.20) {2};
+
+\node[color=drawColor,anchor=base,inner sep=0pt, outer sep=0pt, scale=  1.00] at (214.09, 25.20) {3};
+
+\node[color=drawColor,anchor=base,inner sep=0pt, outer sep=0pt, scale=  1.00] at (269.05, 25.20) {4};
+
+\node[color=drawColor,anchor=base,inner sep=0pt, outer sep=0pt, scale=  1.00] at (324.02, 25.20) {5};
+
+\draw[color=drawColor,line cap=round,line join=round,fill opacity=0.00,] ( 49.20, 49.20) -- ( 49.20,179.23);
+
+\draw[color=drawColor,line cap=round,line join=round,fill opacity=0.00,] ( 49.20, 49.20) -- ( 43.20, 49.20);
+
+\draw[color=drawColor,line cap=round,line join=round,fill opacity=0.00,] ( 49.20, 81.71) -- ( 43.20, 81.71);
+
+\draw[color=drawColor,line cap=round,line join=round,fill opacity=0.00,] ( 49.20,114.21) -- ( 43.20,114.21);
+
+\draw[color=drawColor,line cap=round,line join=round,fill opacity=0.00,] ( 49.20,146.72) -- ( 43.20,146.72);
+
+\draw[color=drawColor,line cap=round,line join=round,fill opacity=0.00,] ( 49.20,179.23) -- ( 43.20,179.23);
+
+\node[color=drawColor,anchor=base east,inner sep=0pt, outer sep=0pt, scale=  1.00] at ( 37.20, 45.76) {0};
+
+\node[color=drawColor,anchor=base east,inner sep=0pt, outer sep=0pt, scale=  1.00] at ( 37.20, 78.26) {1};
+
+\node[color=drawColor,anchor=base east,inner sep=0pt, outer sep=0pt, scale=  1.00] at ( 37.20,110.77) {2};
+
+\node[color=drawColor,anchor=base east,inner sep=0pt, outer sep=0pt, scale=  1.00] at ( 37.20,143.28) {3};
+
+\node[color=drawColor,anchor=base east,inner sep=0pt, outer sep=0pt, scale=  1.00] at ( 37.20,175.79) {4};
+
+\draw[color=drawColor,line cap=round,line join=round,fill opacity=0.00,] ( 49.20, 49.20) --
+	(324.01, 49.20) --
+	(324.01,203.61) --
+	( 49.20,203.61) --
+	( 49.20, 49.20);
+\end{scope}
+\begin{scope}
+%\path[clip] (  0.00,  0.00) rectangle (325.21,216.81);
+\definecolor[named]{drawColor}{rgb}{0.00,0.00,0.00}
+
+\node[color=drawColor,anchor=base,inner sep=0pt, outer sep=0pt, scale=  1.00] at (186.61,  1.20) {Gamma shape ($\alpha$)};
+
+\node[rotate= 90.00,color=drawColor,anchor=base,inner sep=0pt, outer sep=0pt, scale=  1.00] at ( 13.20,126.41) {Density};
+\end{scope}
+\begin{scope}
+\path[clip] ( 49.20, 49.20) rectangle (324.01,203.61);
+\definecolor[named]{fillColor}{rgb}{0.00,0.00,1.00}
+
+\draw[fill=fillColor,fill opacity=0.25,draw opacity=0.00,] ( 58.23, 49.20) --
+	( 58.33, 49.20) --
+	( 58.43, 49.20) --
+	( 58.53, 49.20) --
+	( 58.62, 49.20) --
+	( 58.72, 49.21) --
+	( 58.82, 49.21) --
+	( 58.92, 49.21) --
+	( 59.02, 49.21) --
+	( 59.12, 49.21) --
+	( 59.22, 49.21) --
+	( 59.32, 49.22) --
+	( 59.41, 49.22) --
+	( 59.51, 49.22) --
+	( 59.61, 49.23) --
+	( 59.71, 49.23) --
+	( 59.81, 49.24) --
+	( 59.91, 49.24) --
+	( 60.01, 49.25) --
+	( 60.10, 49.26) --
+	( 60.20, 49.26) --
+	( 60.30, 49.27) --
+	( 60.40, 49.29) --
+	( 60.50, 49.30) --
+	( 60.60, 49.31) --
+	( 60.70, 49.33) --
+	( 60.80, 49.34) --
+	( 60.89, 49.36) --
+	( 60.99, 49.38) --
+	( 61.09, 49.40) --
+	( 61.19, 49.43) --
+	( 61.29, 49.45) --
+	( 61.39, 49.48) --
+	( 61.49, 49.52) --
+	( 61.59, 49.55) --
+	( 61.68, 49.59) --
+	( 61.78, 49.63) --
+	( 61.88, 49.68) --
+	( 61.98, 49.73) --
+	( 62.08, 49.78) --
+	( 62.18, 49.84) --
+	( 62.28, 49.91) --
+	( 62.38, 49.98) --
+	( 62.47, 50.05) --
+	( 62.57, 50.13) --
+	( 62.67, 50.22) --
+	( 62.77, 50.32) --
+	( 62.87, 50.43) --
+	( 62.97, 50.54) --
+	( 63.07, 50.67) --
+	( 63.17, 50.80) --
+	( 63.26, 50.95) --
+	( 63.36, 51.11) --
+	( 63.46, 51.28) --
+	( 63.56, 51.47) --
+	( 63.66, 51.67) --
+	( 63.76, 51.89) --
+	( 63.86, 52.12) --
+	( 63.95, 52.37) --
+	( 64.05, 52.65) --
+	( 64.15, 52.94) --
+	( 64.25, 53.26) --
+	( 64.35, 53.59) --
+	( 64.45, 53.95) --
+	( 64.55, 54.34) --
+	( 64.65, 54.75) --
+	( 64.74, 55.19) --
+	( 64.84, 55.66) --
+	( 64.94, 56.16) --
+	( 65.04, 56.69) --
+	( 65.14, 57.25) --
+	( 65.24, 57.85) --
+	( 65.34, 58.48) --
+	( 65.44, 59.14) --
+	( 65.53, 59.84) --
+	( 65.63, 60.58) --
+	( 65.73, 61.37) --
+	( 65.83, 62.18) --
+	( 65.93, 63.04) --
+	( 66.03, 63.94) --
+	( 66.13, 64.89) --
+	( 66.23, 65.88) --
+	( 66.32, 66.92) --
+	( 66.42, 68.00) --
+	( 66.52, 69.12) --
+	( 66.62, 70.29) --
+	( 66.72, 71.52) --
+	( 66.82, 72.78) --
+	( 66.92, 74.10) --
+	( 67.01, 75.45) --
+	( 67.11, 76.87) --
+	( 67.21, 78.33) --
+	( 67.31, 79.83) --
+	( 67.41, 81.38) --
+	( 67.51, 82.97) --
+	( 67.61, 84.61) --
+	( 67.71, 86.29) --
+	( 67.80, 88.01) --
+	( 67.90, 89.78) --
+	( 68.00, 91.58) --
+	( 68.10, 93.41) --
+	( 68.20, 95.29) --
+	( 68.30, 97.20) --
+	( 68.40, 99.14) --
+	( 68.50,101.11) --
+	( 68.59,103.11) --
+	( 68.69,105.13) --
+	( 68.79,107.18) --
+	( 68.89,109.25) --
+	( 68.99,111.34) --
+	( 69.09,113.45) --
+	( 69.19,115.58) --
+	( 69.29,117.72) --
+	( 69.38,119.87) --
+	( 69.48,122.03) --
+	( 69.58,124.21) --
+	( 69.68,126.39) --
+	( 69.78,128.57) --
+	( 69.88,130.76) --
+	( 69.98,132.96) --
+	( 70.07,135.15) --
+	( 70.17,137.34) --
+	( 70.27,139.52) --
+	( 70.37,141.70) --
+	( 70.47,143.87) --
+	( 70.57,146.02) --
+	( 70.67,148.16) --
+	( 70.77,150.28) --
+	( 70.86,152.38) --
+	( 70.96,154.45) --
+	( 71.06,156.49) --
+	( 71.16,158.51) --
+	( 71.26,160.47) --
+	( 71.36,162.40) --
+	( 71.46,164.29) --
+	( 71.56,166.13) --
+	( 71.65,167.92) --
+	( 71.75,169.65) --
+	( 71.85,171.31) --
+	( 71.95,172.92) --
+	( 72.05,174.47) --
+	( 72.15,175.95) --
+	( 72.25,177.34) --
+	( 72.35,178.67) --
+	( 72.44,179.92) --
+	( 72.54,181.11) --
+	( 72.64,182.22) --
+	( 72.74,183.25) --
+	( 72.84,184.20) --
+	( 72.94,185.08) --
+	( 73.04,185.90) --
+	( 73.13,186.64) --
+	( 73.23,187.32) --
+	( 73.33,187.92) --
+	( 73.43,188.46) --
+	( 73.53,188.95) --
+	( 73.63,189.38) --
+	( 73.73,189.76) --
+	( 73.83,190.09) --
+	( 73.92,190.37) --
+	( 74.02,190.60) --
+	( 74.12,190.81) --
+	( 74.22,190.97) --
+	( 74.32,191.09) --
+	( 74.42,191.19) --
+	( 74.52,191.25) --
+	( 74.62,191.29) --
+	( 74.71,191.30) --
+	( 74.81,191.28) --
+	( 74.91,191.23) --
+	( 75.01,191.16) --
+	( 75.11,191.05) --
+	( 75.21,190.93) --
+	( 75.31,190.76) --
+	( 75.41,190.56) --
+	( 75.50,190.33) --
+	( 75.60,190.06) --
+	( 75.70,189.76) --
+	( 75.80,189.41) --
+	( 75.90,189.02) --
+	( 76.00,188.58) --
+	( 76.10,188.10) --
+	( 76.20,187.56) --
+	( 76.29,186.98) --
+	( 76.39,186.34) --
+	( 76.49,185.64) --
+	( 76.59,184.90) --
+	( 76.69,184.10) --
+	( 76.79,183.25) --
+	( 76.89,182.34) --
+	( 76.98,181.37) --
+	( 77.08,180.36) --
+	( 77.18,179.30) --
+	( 77.28,178.19) --
+	( 77.38,177.02) --
+	( 77.48,175.81) --
+	( 77.58,174.56) --
+	( 77.68,173.27) --
+	( 77.77,171.95) --
+	( 77.87,170.58) --
+	( 77.97,169.18) --
+	( 78.07,167.75) --
+	( 78.17,166.29) --
+	( 78.27,164.81) --
+	( 78.37,163.30) --
+	( 78.47,161.77) --
+	( 78.56,160.22) --
+	( 78.66,158.65) --
+	( 78.76,157.08) --
+	( 78.86,155.49) --
+	( 78.96,153.88) --
+	( 79.06,152.27) --
+	( 79.16,150.66) --
+	( 79.26,149.04) --
+	( 79.35,147.42) --
+	( 79.45,145.79) --
+	( 79.55,144.17) --
+	( 79.65,142.55) --
+	( 79.75,140.93) --
+	( 79.85,139.32) --
+	( 79.95,137.71) --
+	( 80.04,136.11) --
+	( 80.14,134.52) --
+	( 80.24,132.93) --
+	( 80.34,131.35) --
+	( 80.44,129.78) --
+	( 80.54,128.22) --
+	( 80.64,126.67) --
+	( 80.74,125.13) --
+	( 80.83,123.59) --
+	( 80.93,122.07) --
+	( 81.03,120.55) --
+	( 81.13,119.04) --
+	( 81.23,117.54) --
+	( 81.33,116.05) --
+	( 81.43,114.57) --
+	( 81.53,113.10) --
+	( 81.62,111.64) --
+	( 81.72,110.19) --
+	( 81.82,108.76) --
+	( 81.92,107.33) --
+	( 82.02,105.92) --
+	( 82.12,104.53) --
+	( 82.22,103.15) --
+	( 82.32,101.79) --
+	( 82.41,100.44) --
+	( 82.51, 99.12) --
+	( 82.61, 97.82) --
+	( 82.71, 96.53) --
+	( 82.81, 95.27) --
+	( 82.91, 94.04) --
+	( 83.01, 92.83) --
+	( 83.10, 91.64) --
+	( 83.20, 90.49) --
+	( 83.30, 89.35) --
+	( 83.40, 88.25) --
+	( 83.50, 87.17) --
+	( 83.60, 86.12) --
+	( 83.70, 85.10) --
+	( 83.80, 84.11) --
+	( 83.89, 83.14) --
+	( 83.99, 82.20) --
+	( 84.09, 81.30) --
+	( 84.19, 80.41) --
+	( 84.29, 79.56) --
+	( 84.39, 78.73) --
+	( 84.49, 77.92) --
+	( 84.59, 77.15) --
+	( 84.68, 76.40) --
+	( 84.78, 75.68) --
+	( 84.88, 74.97) --
+	( 84.98, 74.30) --
+	( 85.08, 73.65) --
+	( 85.18, 73.03) --
+	( 85.28, 72.43) --
+	( 85.38, 71.85) --
+	( 85.47, 71.29) --
+	( 85.57, 70.76) --
+	( 85.67, 70.26) --
+	( 85.77, 69.77) --
+	( 85.87, 69.30) --
+	( 85.97, 68.85) --
+	( 86.07, 68.42) --
+	( 86.16, 68.01) --
+	( 86.26, 67.61) --
+	( 86.36, 67.23) --
+	( 86.46, 66.86) --
+	( 86.56, 66.51) --
+	( 86.66, 66.16) --
+	( 86.76, 65.83) --
+	( 86.86, 65.50) --
+	( 86.95, 65.18) --
+	( 87.05, 64.86) --
+	( 87.15, 64.55) --
+	( 87.25, 64.24) --
+	( 87.35, 63.94) --
+	( 87.45, 63.63) --
+	( 87.55, 63.33) --
+	( 87.65, 63.02) --
+	( 87.74, 62.72) --
+	( 87.84, 62.41) --
+	( 87.94, 62.10) --
+	( 88.04, 61.79) --
+	( 88.14, 61.48) --
+	( 88.24, 61.16) --
+	( 88.34, 60.85) --
+	( 88.44, 60.53) --
+	( 88.53, 60.21) --
+	( 88.63, 59.89) --
+	( 88.73, 59.57) --
+	( 88.83, 59.25) --
+	( 88.93, 58.94) --
+	( 89.03, 58.62) --
+	( 89.13, 58.31) --
+	( 89.23, 58.01) --
+	( 89.32, 57.70) --
+	( 89.42, 57.40) --
+	( 89.52, 57.11) --
+	( 89.62, 56.82) --
+	( 89.72, 56.55) --
+	( 89.82, 56.27) --
+	( 89.92, 56.01) --
+	( 90.01, 55.75) --
+	( 90.11, 55.51) --
+	( 90.21, 55.27) --
+	( 90.31, 55.04) --
+	( 90.41, 54.82) --
+	( 90.51, 54.61) --
+	( 90.61, 54.41) --
+	( 90.71, 54.22) --
+	( 90.80, 54.05) --
+	( 90.90, 53.88) --
+	( 91.00, 53.71) --
+	( 91.10, 53.56) --
+	( 91.20, 53.42) --
+	( 91.30, 53.29) --
+	( 91.40, 53.16) --
+	( 91.50, 53.05) --
+	( 91.59, 52.94) --
+	( 91.69, 52.84) --
+	( 91.79, 52.74) --
+	( 91.89, 52.66) --
+	( 91.99, 52.58) --
+	( 92.09, 52.51) --
+	( 92.19, 52.44) --
+	( 92.29, 52.38) --
+	( 92.38, 52.33) --
+	( 92.48, 52.28) --
+	( 92.58, 52.23) --
+	( 92.68, 52.19) --
+	( 92.78, 52.15) --
+	( 92.88, 52.12) --
+	( 92.98, 52.09) --
+	( 93.07, 52.06) --
+	( 93.17, 52.03) --
+	( 93.27, 52.01) --
+	( 93.37, 51.99) --
+	( 93.47, 51.96) --
+	( 93.57, 51.94) --
+	( 93.67, 51.92) --
+	( 93.77, 51.89) --
+	( 93.86, 51.87) --
+	( 93.96, 51.84) --
+	( 94.06, 51.81) --
+	( 94.16, 51.78) --
+	( 94.26, 51.75) --
+	( 94.36, 51.72) --
+	( 94.46, 51.68) --
+	( 94.56, 51.64) --
+	( 94.65, 51.60) --
+	( 94.75, 51.56) --
+	( 94.85, 51.51) --
+	( 94.95, 51.46) --
+	( 95.05, 51.40) --
+	( 95.15, 51.34) --
+	( 95.25, 51.28) --
+	( 95.35, 51.22) --
+	( 95.44, 51.15) --
+	( 95.54, 51.09) --
+	( 95.64, 51.02) --
+	( 95.74, 50.95) --
+	( 95.84, 50.87) --
+	( 95.94, 50.80) --
+	( 96.04, 50.72) --
+	( 96.13, 50.65) --
+	( 96.23, 50.57) --
+	( 96.33, 50.50) --
+	( 96.43, 50.42) --
+	( 96.53, 50.35) --
+	( 96.63, 50.27) --
+	( 96.73, 50.20) --
+	( 96.83, 50.13) --
+	( 96.92, 50.07) --
+	( 97.02, 50.00) --
+	( 97.12, 49.94) --
+	( 97.22, 49.88) --
+	( 97.32, 49.82) --
+	( 97.42, 49.77) --
+	( 97.52, 49.71) --
+	( 97.62, 49.67) --
+	( 97.71, 49.62) --
+	( 97.81, 49.58) --
+	( 97.91, 49.54) --
+	( 98.01, 49.50) --
+	( 98.11, 49.47) --
+	( 98.21, 49.44) --
+	( 98.31, 49.41) --
+	( 98.41, 49.39) --
+	( 98.50, 49.36) --
+	( 98.60, 49.34) --
+	( 98.70, 49.32) --
+	( 98.80, 49.31) --
+	( 98.90, 49.29) --
+	( 99.00, 49.28) --
+	( 99.10, 49.27) --
+	( 99.20, 49.26) --
+	( 99.29, 49.25) --
+	( 99.39, 49.24) --
+	( 99.49, 49.24) --
+	( 99.59, 49.23) --
+	( 99.69, 49.23) --
+	( 99.79, 49.22) --
+	( 99.89, 49.22) --
+	( 99.98, 49.22) --
+	(100.08, 49.21) --
+	(100.18, 49.21) --
+	(100.28, 49.21) --
+	(100.38, 49.21) --
+	(100.48, 49.21) --
+	(100.58, 49.21) --
+	(100.68, 49.21) --
+	(100.77, 49.21) --
+	(100.87, 49.21) --
+	(100.97, 49.21) --
+	(101.07, 49.21) --
+	(101.17, 49.21) --
+	(101.27, 49.21) --
+	(101.37, 49.21) --
+	(101.47, 49.22) --
+	(101.56, 49.22) --
+	(101.66, 49.22) --
+	(101.76, 49.22) --
+	(101.86, 49.22) --
+	(101.96, 49.23) --
+	(102.06, 49.23) --
+	(102.16, 49.23) --
+	(102.26, 49.24) --
+	(102.35, 49.24) --
+	(102.45, 49.24) --
+	(102.55, 49.24) --
+	(102.65, 49.25) --
+	(102.75, 49.25) --
+	(102.85, 49.25) --
+	(102.95, 49.26) --
+	(103.04, 49.26) --
+	(103.14, 49.26) --
+	(103.24, 49.27) --
+	(103.34, 49.27) --
+	(103.44, 49.27) --
+	(103.54, 49.27) --
+	(103.64, 49.27) --
+	(103.74, 49.28) --
+	(103.83, 49.28) --
+	(103.93, 49.28) --
+	(104.03, 49.28) --
+	(104.13, 49.28) --
+	(104.23, 49.28) --
+	(104.33, 49.28) --
+	(104.43, 49.28) --
+	(104.53, 49.28) --
+	(104.62, 49.28) --
+	(104.72, 49.27) --
+	(104.82, 49.27) --
+	(104.92, 49.27) --
+	(105.02, 49.27) --
+	(105.12, 49.26) --
+	(105.22, 49.26) --
+	(105.32, 49.26) --
+	(105.41, 49.26) --
+	(105.51, 49.25) --
+	(105.61, 49.25) --
+	(105.71, 49.25) --
+	(105.81, 49.24) --
+	(105.91, 49.24) --
+	(106.01, 49.24) --
+	(106.10, 49.23) --
+	(106.20, 49.23) --
+	(106.30, 49.23) --
+	(106.40, 49.23) --
+	(106.50, 49.22) --
+	(106.60, 49.22) --
+	(106.70, 49.22) --
+	(106.80, 49.22) --
+	(106.89, 49.22) --
+	(106.99, 49.21) --
+	(107.09, 49.21) --
+	(107.19, 49.21) --
+	(107.29, 49.21) --
+	(107.39, 49.21) --
+	(107.49, 49.21) --
+	(107.59, 49.21) --
+	(107.68, 49.21) --
+	(107.78, 49.20) --
+	(107.88, 49.20) --
+	(107.98, 49.20) --
+	(108.08, 49.20) --
+	(108.18, 49.20) --
+	(108.28, 49.20) --
+	(108.38, 49.20) --
+	(108.47, 49.20) --
+	(108.57, 49.20) --
+	(108.67, 49.20) --
+	cycle;
+\definecolor[named]{drawColor}{rgb}{0.00,0.00,1.00}
+
+\draw[color=drawColor,line width= 0.6pt,line cap=round,line join=round,fill opacity=0.00,] ( 58.23, 49.20) --
+	( 58.33, 49.20) --
+	( 58.43, 49.20) --
+	( 58.53, 49.20) --
+	( 58.62, 49.20) --
+	( 58.72, 49.21) --
+	( 58.82, 49.21) --
+	( 58.92, 49.21) --
+	( 59.02, 49.21) --
+	( 59.12, 49.21) --
+	( 59.22, 49.21) --
+	( 59.32, 49.22) --
+	( 59.41, 49.22) --
+	( 59.51, 49.22) --
+	( 59.61, 49.23) --
+	( 59.71, 49.23) --
+	( 59.81, 49.24) --
+	( 59.91, 49.24) --
+	( 60.01, 49.25) --
+	( 60.10, 49.26) --
+	( 60.20, 49.26) --
+	( 60.30, 49.27) --
+	( 60.40, 49.29) --
+	( 60.50, 49.30) --
+	( 60.60, 49.31) --
+	( 60.70, 49.33) --
+	( 60.80, 49.34) --
+	( 60.89, 49.36) --
+	( 60.99, 49.38) --
+	( 61.09, 49.40) --
+	( 61.19, 49.43) --
+	( 61.29, 49.45) --
+	( 61.39, 49.48) --
+	( 61.49, 49.52) --
+	( 61.59, 49.55) --
+	( 61.68, 49.59) --
+	( 61.78, 49.63) --
+	( 61.88, 49.68) --
+	( 61.98, 49.73) --
+	( 62.08, 49.78) --
+	( 62.18, 49.84) --
+	( 62.28, 49.91) --
+	( 62.38, 49.98) --
+	( 62.47, 50.05) --
+	( 62.57, 50.13) --
+	( 62.67, 50.22) --
+	( 62.77, 50.32) --
+	( 62.87, 50.43) --
+	( 62.97, 50.54) --
+	( 63.07, 50.67) --
+	( 63.17, 50.80) --
+	( 63.26, 50.95) --
+	( 63.36, 51.11) --
+	( 63.46, 51.28) --
+	( 63.56, 51.47) --
+	( 63.66, 51.67) --
+	( 63.76, 51.89) --
+	( 63.86, 52.12) --
+	( 63.95, 52.37) --
+	( 64.05, 52.65) --
+	( 64.15, 52.94) --
+	( 64.25, 53.26) --
+	( 64.35, 53.59) --
+	( 64.45, 53.95) --
+	( 64.55, 54.34) --
+	( 64.65, 54.75) --
+	( 64.74, 55.19) --
+	( 64.84, 55.66) --
+	( 64.94, 56.16) --
+	( 65.04, 56.69) --
+	( 65.14, 57.25) --
+	( 65.24, 57.85) --
+	( 65.34, 58.48) --
+	( 65.44, 59.14) --
+	( 65.53, 59.84) --
+	( 65.63, 60.58) --
+	( 65.73, 61.37) --
+	( 65.83, 62.18) --
+	( 65.93, 63.04) --
+	( 66.03, 63.94) --
+	( 66.13, 64.89) --
+	( 66.23, 65.88) --
+	( 66.32, 66.92) --
+	( 66.42, 68.00) --
+	( 66.52, 69.12) --
+	( 66.62, 70.29) --
+	( 66.72, 71.52) --
+	( 66.82, 72.78) --
+	( 66.92, 74.10) --
+	( 67.01, 75.45) --
+	( 67.11, 76.87) --
+	( 67.21, 78.33) --
+	( 67.31, 79.83) --
+	( 67.41, 81.38) --
+	( 67.51, 82.97) --
+	( 67.61, 84.61) --
+	( 67.71, 86.29) --
+	( 67.80, 88.01) --
+	( 67.90, 89.78) --
+	( 68.00, 91.58) --
+	( 68.10, 93.41) --
+	( 68.20, 95.29) --
+	( 68.30, 97.20) --
+	( 68.40, 99.14) --
+	( 68.50,101.11) --
+	( 68.59,103.11) --
+	( 68.69,105.13) --
+	( 68.79,107.18) --
+	( 68.89,109.25) --
+	( 68.99,111.34) --
+	( 69.09,113.45) --
+	( 69.19,115.58) --
+	( 69.29,117.72) --
+	( 69.38,119.87) --
+	( 69.48,122.03) --
+	( 69.58,124.21) --
+	( 69.68,126.39) --
+	( 69.78,128.57) --
+	( 69.88,130.76) --
+	( 69.98,132.96) --
+	( 70.07,135.15) --
+	( 70.17,137.34) --
+	( 70.27,139.52) --
+	( 70.37,141.70) --
+	( 70.47,143.87) --
+	( 70.57,146.02) --
+	( 70.67,148.16) --
+	( 70.77,150.28) --
+	( 70.86,152.38) --
+	( 70.96,154.45) --
+	( 71.06,156.49) --
+	( 71.16,158.51) --
+	( 71.26,160.47) --
+	( 71.36,162.40) --
+	( 71.46,164.29) --
+	( 71.56,166.13) --
+	( 71.65,167.92) --
+	( 71.75,169.65) --
+	( 71.85,171.31) --
+	( 71.95,172.92) --
+	( 72.05,174.47) --
+	( 72.15,175.95) --
+	( 72.25,177.34) --
+	( 72.35,178.67) --
+	( 72.44,179.92) --
+	( 72.54,181.11) --
+	( 72.64,182.22) --
+	( 72.74,183.25) --
+	( 72.84,184.20) --
+	( 72.94,185.08) --
+	( 73.04,185.90) --
+	( 73.13,186.64) --
+	( 73.23,187.32) --
+	( 73.33,187.92) --
+	( 73.43,188.46) --
+	( 73.53,188.95) --
+	( 73.63,189.38) --
+	( 73.73,189.76) --
+	( 73.83,190.09) --
+	( 73.92,190.37) --
+	( 74.02,190.60) --
+	( 74.12,190.81) --
+	( 74.22,190.97) --
+	( 74.32,191.09) --
+	( 74.42,191.19) --
+	( 74.52,191.25) --
+	( 74.62,191.29) --
+	( 74.71,191.30) --
+	( 74.81,191.28) --
+	( 74.91,191.23) --
+	( 75.01,191.16) --
+	( 75.11,191.05) --
+	( 75.21,190.93) --
+	( 75.31,190.76) --
+	( 75.41,190.56) --
+	( 75.50,190.33) --
+	( 75.60,190.06) --
+	( 75.70,189.76) --
+	( 75.80,189.41) --
+	( 75.90,189.02) --
+	( 76.00,188.58) --
+	( 76.10,188.10) --
+	( 76.20,187.56) --
+	( 76.29,186.98) --
+	( 76.39,186.34) --
+	( 76.49,185.64) --
+	( 76.59,184.90) --
+	( 76.69,184.10) --
+	( 76.79,183.25) --
+	( 76.89,182.34) --
+	( 76.98,181.37) --
+	( 77.08,180.36) --
+	( 77.18,179.30) --
+	( 77.28,178.19) --
+	( 77.38,177.02) --
+	( 77.48,175.81) --
+	( 77.58,174.56) --
+	( 77.68,173.27) --
+	( 77.77,171.95) --
+	( 77.87,170.58) --
+	( 77.97,169.18) --
+	( 78.07,167.75) --
+	( 78.17,166.29) --
+	( 78.27,164.81) --
+	( 78.37,163.30) --
+	( 78.47,161.77) --
+	( 78.56,160.22) --
+	( 78.66,158.65) --
+	( 78.76,157.08) --
+	( 78.86,155.49) --
+	( 78.96,153.88) --
+	( 79.06,152.27) --
+	( 79.16,150.66) --
+	( 79.26,149.04) --
+	( 79.35,147.42) --
+	( 79.45,145.79) --
+	( 79.55,144.17) --
+	( 79.65,142.55) --
+	( 79.75,140.93) --
+	( 79.85,139.32) --
+	( 79.95,137.71) --
+	( 80.04,136.11) --
+	( 80.14,134.52) --
+	( 80.24,132.93) --
+	( 80.34,131.35) --
+	( 80.44,129.78) --
+	( 80.54,128.22) --
+	( 80.64,126.67) --
+	( 80.74,125.13) --
+	( 80.83,123.59) --
+	( 80.93,122.07) --
+	( 81.03,120.55) --
+	( 81.13,119.04) --
+	( 81.23,117.54) --
+	( 81.33,116.05) --
+	( 81.43,114.57) --
+	( 81.53,113.10) --
+	( 81.62,111.64) --
+	( 81.72,110.19) --
+	( 81.82,108.76) --
+	( 81.92,107.33) --
+	( 82.02,105.92) --
+	( 82.12,104.53) --
+	( 82.22,103.15) --
+	( 82.32,101.79) --
+	( 82.41,100.44) --
+	( 82.51, 99.12) --
+	( 82.61, 97.82) --
+	( 82.71, 96.53) --
+	( 82.81, 95.27) --
+	( 82.91, 94.04) --
+	( 83.01, 92.83) --
+	( 83.10, 91.64) --
+	( 83.20, 90.49) --
+	( 83.30, 89.35) --
+	( 83.40, 88.25) --
+	( 83.50, 87.17) --
+	( 83.60, 86.12) --
+	( 83.70, 85.10) --
+	( 83.80, 84.11) --
+	( 83.89, 83.14) --
+	( 83.99, 82.20) --
+	( 84.09, 81.30) --
+	( 84.19, 80.41) --
+	( 84.29, 79.56) --
+	( 84.39, 78.73) --
+	( 84.49, 77.92) --
+	( 84.59, 77.15) --
+	( 84.68, 76.40) --
+	( 84.78, 75.68) --
+	( 84.88, 74.97) --
+	( 84.98, 74.30) --
+	( 85.08, 73.65) --
+	( 85.18, 73.03) --
+	( 85.28, 72.43) --
+	( 85.38, 71.85) --
+	( 85.47, 71.29) --
+	( 85.57, 70.76) --
+	( 85.67, 70.26) --
+	( 85.77, 69.77) --
+	( 85.87, 69.30) --
+	( 85.97, 68.85) --
+	( 86.07, 68.42) --
+	( 86.16, 68.01) --
+	( 86.26, 67.61) --
+	( 86.36, 67.23) --
+	( 86.46, 66.86) --
+	( 86.56, 66.51) --
+	( 86.66, 66.16) --
+	( 86.76, 65.83) --
+	( 86.86, 65.50) --
+	( 86.95, 65.18) --
+	( 87.05, 64.86) --
+	( 87.15, 64.55) --
+	( 87.25, 64.24) --
+	( 87.35, 63.94) --
+	( 87.45, 63.63) --
+	( 87.55, 63.33) --
+	( 87.65, 63.02) --
+	( 87.74, 62.72) --
+	( 87.84, 62.41) --
+	( 87.94, 62.10) --
+	( 88.04, 61.79) --
+	( 88.14, 61.48) --
+	( 88.24, 61.16) --
+	( 88.34, 60.85) --
+	( 88.44, 60.53) --
+	( 88.53, 60.21) --
+	( 88.63, 59.89) --
+	( 88.73, 59.57) --
+	( 88.83, 59.25) --
+	( 88.93, 58.94) --
+	( 89.03, 58.62) --
+	( 89.13, 58.31) --
+	( 89.23, 58.01) --
+	( 89.32, 57.70) --
+	( 89.42, 57.40) --
+	( 89.52, 57.11) --
+	( 89.62, 56.82) --
+	( 89.72, 56.55) --
+	( 89.82, 56.27) --
+	( 89.92, 56.01) --
+	( 90.01, 55.75) --
+	( 90.11, 55.51) --
+	( 90.21, 55.27) --
+	( 90.31, 55.04) --
+	( 90.41, 54.82) --
+	( 90.51, 54.61) --
+	( 90.61, 54.41) --
+	( 90.71, 54.22) --
+	( 90.80, 54.05) --
+	( 90.90, 53.88) --
+	( 91.00, 53.71) --
+	( 91.10, 53.56) --
+	( 91.20, 53.42) --
+	( 91.30, 53.29) --
+	( 91.40, 53.16) --
+	( 91.50, 53.05) --
+	( 91.59, 52.94) --
+	( 91.69, 52.84) --
+	( 91.79, 52.74) --
+	( 91.89, 52.66) --
+	( 91.99, 52.58) --
+	( 92.09, 52.51) --
+	( 92.19, 52.44) --
+	( 92.29, 52.38) --
+	( 92.38, 52.33) --
+	( 92.48, 52.28) --
+	( 92.58, 52.23) --
+	( 92.68, 52.19) --
+	( 92.78, 52.15) --
+	( 92.88, 52.12) --
+	( 92.98, 52.09) --
+	( 93.07, 52.06) --
+	( 93.17, 52.03) --
+	( 93.27, 52.01) --
+	( 93.37, 51.99) --
+	( 93.47, 51.96) --
+	( 93.57, 51.94) --
+	( 93.67, 51.92) --
+	( 93.77, 51.89) --
+	( 93.86, 51.87) --
+	( 93.96, 51.84) --
+	( 94.06, 51.81) --
+	( 94.16, 51.78) --
+	( 94.26, 51.75) --
+	( 94.36, 51.72) --
+	( 94.46, 51.68) --
+	( 94.56, 51.64) --
+	( 94.65, 51.60) --
+	( 94.75, 51.56) --
+	( 94.85, 51.51) --
+	( 94.95, 51.46) --
+	( 95.05, 51.40) --
+	( 95.15, 51.34) --
+	( 95.25, 51.28) --
+	( 95.35, 51.22) --
+	( 95.44, 51.15) --
+	( 95.54, 51.09) --
+	( 95.64, 51.02) --
+	( 95.74, 50.95) --
+	( 95.84, 50.87) --
+	( 95.94, 50.80) --
+	( 96.04, 50.72) --
+	( 96.13, 50.65) --
+	( 96.23, 50.57) --
+	( 96.33, 50.50) --
+	( 96.43, 50.42) --
+	( 96.53, 50.35) --
+	( 96.63, 50.27) --
+	( 96.73, 50.20) --
+	( 96.83, 50.13) --
+	( 96.92, 50.07) --
+	( 97.02, 50.00) --
+	( 97.12, 49.94) --
+	( 97.22, 49.88) --
+	( 97.32, 49.82) --
+	( 97.42, 49.77) --
+	( 97.52, 49.71) --
+	( 97.62, 49.67) --
+	( 97.71, 49.62) --
+	( 97.81, 49.58) --
+	( 97.91, 49.54) --
+	( 98.01, 49.50) --
+	( 98.11, 49.47) --
+	( 98.21, 49.44) --
+	( 98.31, 49.41) --
+	( 98.41, 49.39) --
+	( 98.50, 49.36) --
+	( 98.60, 49.34) --
+	( 98.70, 49.32) --
+	( 98.80, 49.31) --
+	( 98.90, 49.29) --
+	( 99.00, 49.28) --
+	( 99.10, 49.27) --
+	( 99.20, 49.26) --
+	( 99.29, 49.25) --
+	( 99.39, 49.24) --
+	( 99.49, 49.24) --
+	( 99.59, 49.23) --
+	( 99.69, 49.23) --
+	( 99.79, 49.22) --
+	( 99.89, 49.22) --
+	( 99.98, 49.22) --
+	(100.08, 49.21) --
+	(100.18, 49.21) --
+	(100.28, 49.21) --
+	(100.38, 49.21) --
+	(100.48, 49.21) --
+	(100.58, 49.21) --
+	(100.68, 49.21) --
+	(100.77, 49.21) --
+	(100.87, 49.21) --
+	(100.97, 49.21) --
+	(101.07, 49.21) --
+	(101.17, 49.21) --
+	(101.27, 49.21) --
+	(101.37, 49.21) --
+	(101.47, 49.22) --
+	(101.56, 49.22) --
+	(101.66, 49.22) --
+	(101.76, 49.22) --
+	(101.86, 49.22) --
+	(101.96, 49.23) --
+	(102.06, 49.23) --
+	(102.16, 49.23) --
+	(102.26, 49.24) --
+	(102.35, 49.24) --
+	(102.45, 49.24) --
+	(102.55, 49.24) --
+	(102.65, 49.25) --
+	(102.75, 49.25) --
+	(102.85, 49.25) --
+	(102.95, 49.26) --
+	(103.04, 49.26) --
+	(103.14, 49.26) --
+	(103.24, 49.27) --
+	(103.34, 49.27) --
+	(103.44, 49.27) --
+	(103.54, 49.27) --
+	(103.64, 49.27) --
+	(103.74, 49.28) --
+	(103.83, 49.28) --
+	(103.93, 49.28) --
+	(104.03, 49.28) --
+	(104.13, 49.28) --
+	(104.23, 49.28) --
+	(104.33, 49.28) --
+	(104.43, 49.28) --
+	(104.53, 49.28) --
+	(104.62, 49.28) --
+	(104.72, 49.27) --
+	(104.82, 49.27) --
+	(104.92, 49.27) --
+	(105.02, 49.27) --
+	(105.12, 49.26) --
+	(105.22, 49.26) --
+	(105.32, 49.26) --
+	(105.41, 49.26) --
+	(105.51, 49.25) --
+	(105.61, 49.25) --
+	(105.71, 49.25) --
+	(105.81, 49.24) --
+	(105.91, 49.24) --
+	(106.01, 49.24) --
+	(106.10, 49.23) --
+	(106.20, 49.23) --
+	(106.30, 49.23) --
+	(106.40, 49.23) --
+	(106.50, 49.22) --
+	(106.60, 49.22) --
+	(106.70, 49.22) --
+	(106.80, 49.22) --
+	(106.89, 49.22) --
+	(106.99, 49.21) --
+	(107.09, 49.21) --
+	(107.19, 49.21) --
+	(107.29, 49.21) --
+	(107.39, 49.21) --
+	(107.49, 49.21) --
+	(107.59, 49.21) --
+	(107.68, 49.21) --
+	(107.78, 49.20) --
+	(107.88, 49.20) --
+	(107.98, 49.20) --
+	(108.08, 49.20) --
+	(108.18, 49.20) --
+	(108.28, 49.20) --
+	(108.38, 49.20) --
+	(108.47, 49.20) --
+	(108.57, 49.20) --
+	(108.67, 49.20);
+\definecolor[named]{fillColor}{rgb}{0.00,0.00,0.00}
+
+\draw[fill=fillColor,fill opacity=0.25,draw opacity=0.00,] ( 54.43, 49.22) --
+	( 54.59, 49.24) --
+	( 54.75, 49.27) --
+	( 54.91, 49.32) --
+	( 55.07, 49.40) --
+	( 55.23, 49.51) --
+	( 55.39, 49.69) --
+	( 55.56, 49.96) --
+	( 55.72, 50.33) --
+	( 55.88, 50.85) --
+	( 56.04, 51.54) --
+	( 56.20, 52.46) --
+	( 56.36, 53.67) --
+	( 56.52, 55.22) --
+	( 56.69, 57.18) --
+	( 56.85, 59.64) --
+	( 57.01, 62.66) --
+	( 57.17, 66.34) --
+	( 57.33, 70.75) --
+	( 57.49, 75.97) --
+	( 57.65, 82.14) --
+	( 57.82, 89.24) --
+	( 57.98, 97.32) --
+	( 58.14,106.39) --
+	( 58.30,116.47) --
+	( 58.46,127.51) --
+	( 58.62,139.44) --
+	( 58.79,152.16) --
+	( 58.95,165.48) --
+	( 59.11,179.20) --
+	( 59.27,193.07) --
+	( 59.43,206.86) --
+	( 59.55,216.81) --
+	( 64.73,216.81) --
+	( 64.76,215.66) --
+	( 64.92,208.78) --
+	( 65.08,201.99) --
+	( 65.24,195.19) --
+	( 65.41,188.26) --
+	( 65.57,181.16) --
+	( 65.73,173.89) --
+	( 65.89,166.51) --
+	( 66.05,159.13) --
+	( 66.21,151.88) --
+	( 66.38,144.86) --
+	( 66.54,138.18) --
+	( 66.70,131.92) --
+	( 66.86,126.03) --
+	( 67.02,120.49) --
+	( 67.18,115.24) --
+	( 67.34,110.20) --
+	( 67.51,105.33) --
+	( 67.67,100.59) --
+	( 67.83, 95.98) --
+	( 67.99, 91.52) --
+	( 68.15, 87.25) --
+	( 68.31, 83.23) --
+	( 68.47, 79.53) --
+	( 68.64, 76.19) --
+	( 68.80, 73.28) --
+	( 68.96, 70.80) --
+	( 69.12, 68.70) --
+	( 69.28, 66.95) --
+	( 69.44, 65.48) --
+	( 69.61, 64.23) --
+	( 69.77, 63.13) --
+	( 69.93, 62.13) --
+	( 70.09, 61.18) --
+	( 70.25, 60.26) --
+	( 70.41, 59.36) --
+	( 70.57, 58.47) --
+	( 70.74, 57.59) --
+	( 70.90, 56.74) --
+	( 71.06, 55.92) --
+	( 71.22, 55.13) --
+	( 71.38, 54.40) --
+	( 71.54, 53.71) --
+	( 71.70, 53.07) --
+	( 71.87, 52.49) --
+	( 72.03, 51.97) --
+	( 72.19, 51.51) --
+	( 72.35, 51.13) --
+	( 72.51, 50.81) --
+	( 72.67, 50.57) --
+	( 72.83, 50.39) --
+	( 73.00, 50.27) --
+	( 73.16, 50.21) --
+	( 73.32, 50.19) --
+	( 73.48, 50.21) --
+	( 73.64, 50.25) --
+	( 73.80, 50.30) --
+	( 73.97, 50.35) --
+	( 74.13, 50.39) --
+	( 74.29, 50.41) --
+	( 74.45, 50.41) --
+	( 74.61, 50.38) --
+	( 74.77, 50.32) --
+	( 74.93, 50.24) --
+	( 75.10, 50.13) --
+	( 75.26, 50.01) --
+	( 75.42, 49.88) --
+	( 75.58, 49.75) --
+	( 75.74, 49.63) --
+	( 75.90, 49.52) --
+	( 76.06, 49.44) --
+	( 76.23, 49.37) --
+	( 76.39, 49.33) --
+	( 76.55, 49.30) --
+	( 76.71, 49.30) --
+	( 76.87, 49.30) --
+	( 77.03, 49.32) --
+	( 77.19, 49.36) --
+	( 77.36, 49.40) --
+	( 77.52, 49.46) --
+	( 77.68, 49.51) --
+	( 77.84, 49.57) --
+	( 78.00, 49.62) --
+	( 78.16, 49.65) --
+	( 78.33, 49.68) --
+	( 78.49, 49.69) --
+	( 78.65, 49.69) --
+	( 78.81, 49.67) --
+	( 78.97, 49.64) --
+	( 79.13, 49.61) --
+	( 79.29, 49.57) --
+	( 79.46, 49.52) --
+	( 79.62, 49.48) --
+	( 79.78, 49.44) --
+	( 79.94, 49.41) --
+	( 80.10, 49.37) --
+	( 80.26, 49.34) --
+	( 80.42, 49.31) --
+	( 80.59, 49.29) --
+	( 80.75, 49.27) --
+	( 80.91, 49.25) --
+	( 81.07, 49.23) --
+	( 81.23, 49.22) --
+	( 81.39, 49.22) --
+	( 81.56, 49.21) --
+	( 81.72, 49.21) --
+	( 81.88, 49.20) --
+	( 82.04, 49.20) --
+	( 82.20, 49.20) --
+	( 82.36, 49.20) --
+	( 82.52, 49.20) --
+	( 82.69, 49.20) --
+	( 82.85, 49.20) --
+	( 83.01, 49.20) --
+	( 83.17, 49.20) --
+	( 83.33, 49.20) --
+	( 83.49, 49.20) --
+	( 83.65, 49.20) --
+	( 83.82, 49.20) --
+	( 83.98, 49.20) --
+	( 84.14, 49.20) --
+	( 84.30, 49.20) --
+	( 84.46, 49.20) --
+	( 84.62, 49.20) --
+	( 84.78, 49.20) --
+	( 84.95, 49.20) --
+	( 85.11, 49.20) --
+	( 85.27, 49.20) --
+	( 85.43, 49.20) --
+	( 85.59, 49.20) --
+	( 85.75, 49.20) --
+	( 85.92, 49.20) --
+	( 86.08, 49.20) --
+	( 86.24, 49.20) --
+	( 86.40, 49.20) --
+	( 86.56, 49.20) --
+	( 86.72, 49.20) --
+	( 86.88, 49.20) --
+	( 87.05, 49.20) --
+	( 87.21, 49.20) --
+	( 87.37, 49.20) --
+	( 87.53, 49.20) --
+	( 87.69, 49.20) --
+	( 87.85, 49.20) --
+	( 88.01, 49.20) --
+	( 88.18, 49.20) --
+	( 88.34, 49.20) --
+	( 88.50, 49.20) --
+	( 88.66, 49.20) --
+	( 88.82, 49.20) --
+	( 88.98, 49.20) --
+	( 89.14, 49.20) --
+	( 89.31, 49.20) --
+	( 89.47, 49.20) --
+	( 89.63, 49.20) --
+	( 89.79, 49.20) --
+	( 89.95, 49.20) --
+	( 90.11, 49.20) --
+	( 90.28, 49.20) --
+	( 90.44, 49.20) --
+	( 90.60, 49.20) --
+	( 90.76, 49.20) --
+	( 90.92, 49.20) --
+	( 91.08, 49.20) --
+	( 91.24, 49.20) --
+	( 91.41, 49.20) --
+	( 91.57, 49.20) --
+	( 91.73, 49.20) --
+	( 91.89, 49.20) --
+	( 92.05, 49.20) --
+	( 92.21, 49.20) --
+	( 92.37, 49.20) --
+	( 92.54, 49.20) --
+	( 92.70, 49.20) --
+	( 92.86, 49.20) --
+	( 93.02, 49.20) --
+	( 93.18, 49.20) --
+	( 93.34, 49.20) --
+	( 93.51, 49.20) --
+	( 93.67, 49.20) --
+	( 93.83, 49.20) --
+	( 93.99, 49.20) --
+	( 94.15, 49.20) --
+	( 94.31, 49.20) --
+	( 94.47, 49.20) --
+	( 94.64, 49.20) --
+	( 94.80, 49.20) --
+	( 94.96, 49.20) --
+	( 95.12, 49.20) --
+	( 95.28, 49.20) --
+	( 95.44, 49.20) --
+	( 95.60, 49.20) --
+	( 95.77, 49.20) --
+	( 95.93, 49.20) --
+	( 96.09, 49.20) --
+	( 96.25, 49.20) --
+	( 96.41, 49.20) --
+	( 96.57, 49.20) --
+	( 96.73, 49.20) --
+	( 96.90, 49.20) --
+	( 97.06, 49.20) --
+	( 97.22, 49.20) --
+	( 97.38, 49.20) --
+	( 97.54, 49.20) --
+	( 97.70, 49.20) --
+	( 97.87, 49.20) --
+	( 98.03, 49.20) --
+	( 98.19, 49.20) --
+	( 98.35, 49.20) --
+	( 98.51, 49.20) --
+	( 98.67, 49.20) --
+	( 98.83, 49.20) --
+	( 99.00, 49.20) --
+	( 99.16, 49.20) --
+	( 99.32, 49.20) --
+	( 99.48, 49.20) --
+	( 99.64, 49.20) --
+	( 99.80, 49.20) --
+	( 99.96, 49.20) --
+	(100.13, 49.20) --
+	(100.29, 49.20) --
+	(100.45, 49.20) --
+	(100.61, 49.20) --
+	(100.77, 49.20) --
+	(100.93, 49.20) --
+	(101.10, 49.21) --
+	(101.26, 49.21) --
+	(101.42, 49.22) --
+	(101.58, 49.24) --
+	(101.74, 49.26) --
+	(101.90, 49.28) --
+	(102.06, 49.32) --
+	(102.23, 49.36) --
+	(102.39, 49.41) --
+	(102.55, 49.48) --
+	(102.71, 49.55) --
+	(102.87, 49.63) --
+	(103.03, 49.70) --
+	(103.19, 49.78) --
+	(103.36, 49.85) --
+	(103.52, 49.91) --
+	(103.68, 49.95) --
+	(103.84, 49.97) --
+	(104.00, 49.97) --
+	(104.16, 49.95) --
+	(104.32, 49.90) --
+	(104.49, 49.84) --
+	(104.65, 49.76) --
+	(104.81, 49.68) --
+	(104.97, 49.59) --
+	(105.13, 49.51) --
+	(105.29, 49.43) --
+	(105.46, 49.37) --
+	(105.62, 49.32) --
+	(105.78, 49.28) --
+	(105.94, 49.25) --
+	(106.10, 49.23) --
+	(106.26, 49.22) --
+	(106.42, 49.21) --
+	(106.59, 49.21) --
+	(106.75, 49.20) --
+	(106.91, 49.20) --
+	(107.07, 49.20) --
+	(107.23, 49.20) --
+	(107.39, 49.20) --
+	(107.55, 49.20) --
+	(107.72, 49.20) --
+	(107.88, 49.20) --
+	(108.04, 49.20) --
+	(108.20, 49.20) --
+	(108.36, 49.20) --
+	(108.52, 49.20) --
+	(108.68, 49.20) --
+	(108.85, 49.20) --
+	(109.01, 49.20) --
+	(109.17, 49.20) --
+	(109.33, 49.20) --
+	(109.49, 49.20) --
+	(109.65, 49.20) --
+	(109.82, 49.20) --
+	(109.98, 49.20) --
+	(110.14, 49.20) --
+	(110.30, 49.20) --
+	(110.46, 49.20) --
+	(110.62, 49.20) --
+	(110.78, 49.20) --
+	(110.95, 49.20) --
+	(111.11, 49.20) --
+	(111.27, 49.20) --
+	(111.43, 49.20) --
+	(111.59, 49.20) --
+	(111.75, 49.20) --
+	(111.91, 49.20) --
+	(112.08, 49.20) --
+	(112.24, 49.20) --
+	(112.40, 49.20) --
+	(112.56, 49.20) --
+	(112.72, 49.20) --
+	(112.88, 49.20) --
+	(113.05, 49.20) --
+	(113.21, 49.20) --
+	(113.37, 49.20) --
+	(113.53, 49.20) --
+	(113.69, 49.20) --
+	(113.85, 49.20) --
+	(114.01, 49.20) --
+	(114.18, 49.20) --
+	(114.34, 49.20) --
+	(114.50, 49.20) --
+	(114.66, 49.20) --
+	(114.82, 49.20) --
+	(114.98, 49.20) --
+	(115.14, 49.20) --
+	(115.31, 49.20) --
+	(115.47, 49.20) --
+	(115.63, 49.20) --
+	(115.79, 49.20) --
+	(115.95, 49.20) --
+	(116.11, 49.20) --
+	(116.27, 49.20) --
+	(116.44, 49.20) --
+	(116.60, 49.20) --
+	(116.76, 49.20) --
+	(116.92, 49.20) --
+	(117.08, 49.20) --
+	(117.24, 49.20) --
+	(117.41, 49.20) --
+	(117.57, 49.20) --
+	(117.73, 49.20) --
+	(117.89, 49.20) --
+	(118.05, 49.20) --
+	(118.21, 49.20) --
+	(118.37, 49.20) --
+	(118.54, 49.20) --
+	(118.70, 49.20) --
+	(118.86, 49.20) --
+	(119.02, 49.20) --
+	(119.18, 49.20) --
+	(119.34, 49.20) --
+	(119.50, 49.20) --
+	(119.67, 49.20) --
+	(119.83, 49.20) --
+	(119.99, 49.20) --
+	(120.15, 49.20) --
+	(120.31, 49.20) --
+	(120.47, 49.20) --
+	(120.63, 49.20) --
+	(120.80, 49.20) --
+	(120.96, 49.20) --
+	(121.12, 49.20) --
+	(121.28, 49.20) --
+	(121.44, 49.20) --
+	(121.60, 49.20) --
+	(121.77, 49.20) --
+	(121.93, 49.20) --
+	(122.09, 49.20) --
+	(122.25, 49.20) --
+	(122.41, 49.20) --
+	(122.57, 49.20) --
+	(122.73, 49.20) --
+	(122.90, 49.20) --
+	(123.06, 49.20) --
+	(123.22, 49.20) --
+	(123.38, 49.20) --
+	(123.54, 49.20) --
+	(123.70, 49.20) --
+	(123.86, 49.20) --
+	(124.03, 49.20) --
+	(124.19, 49.20) --
+	(124.35, 49.20) --
+	(124.51, 49.20) --
+	(124.67, 49.20) --
+	(124.83, 49.20) --
+	(125.00, 49.20) --
+	(125.16, 49.20) --
+	(125.32, 49.20) --
+	(125.48, 49.20) --
+	(125.64, 49.20) --
+	(125.80, 49.20) --
+	(125.96, 49.20) --
+	(126.13, 49.20) --
+	(126.29, 49.20) --
+	(126.45, 49.20) --
+	(126.61, 49.20) --
+	(126.77, 49.20) --
+	(126.93, 49.20) --
+	(127.09, 49.20) --
+	(127.26, 49.20) --
+	(127.42, 49.20) --
+	(127.58, 49.20) --
+	(127.74, 49.20) --
+	(127.90, 49.20) --
+	(128.06, 49.20) --
+	(128.22, 49.20) --
+	(128.39, 49.20) --
+	(128.55, 49.20) --
+	(128.71, 49.20) --
+	(128.87, 49.20) --
+	(129.03, 49.20) --
+	(129.19, 49.20) --
+	(129.36, 49.20) --
+	(129.52, 49.20) --
+	(129.68, 49.20) --
+	(129.84, 49.20) --
+	(130.00, 49.20) --
+	(130.16, 49.20) --
+	(130.32, 49.20) --
+	(130.49, 49.20) --
+	(130.65, 49.20) --
+	(130.81, 49.20) --
+	(130.97, 49.20) --
+	(131.13, 49.20) --
+	(131.29, 49.20) --
+	(131.45, 49.20) --
+	(131.62, 49.20) --
+	(131.78, 49.20) --
+	(131.94, 49.20) --
+	(132.10, 49.20) --
+	(132.26, 49.21) --
+	(132.42, 49.21) --
+	(132.59, 49.22) --
+	(132.75, 49.24) --
+	(132.91, 49.26) --
+	(133.07, 49.28) --
+	(133.23, 49.32) --
+	(133.39, 49.36) --
+	(133.55, 49.41) --
+	(133.72, 49.46) --
+	(133.88, 49.51) --
+	(134.04, 49.56) --
+	(134.20, 49.60) --
+	(134.36, 49.63) --
+	(134.52, 49.64) --
+	(134.68, 49.64) --
+	(134.85, 49.61) --
+	(135.01, 49.58) --
+	(135.17, 49.53) --
+	(135.33, 49.48) --
+	(135.49, 49.42) --
+	(135.65, 49.37) --
+	(135.81, 49.33) --
+	(135.98, 49.29) --
+	(136.14, 49.26) --
+	(136.30, 49.24) --
+	(136.46, 49.23) --
+	(136.62, 49.22) --
+	(136.78, 49.21) --
+	(136.95, 49.21) --
+	cycle;
+\definecolor[named]{drawColor}{rgb}{0.00,0.00,0.00}
+
+\draw[color=drawColor,line width= 0.6pt,line cap=round,line join=round,fill opacity=0.00,] ( 54.43, 49.22) --
+	( 54.59, 49.24) --
+	( 54.75, 49.27) --
+	( 54.91, 49.32) --
+	( 55.07, 49.40) --
+	( 55.23, 49.51) --
+	( 55.39, 49.69) --
+	( 55.56, 49.96) --
+	( 55.72, 50.33) --
+	( 55.88, 50.85) --
+	( 56.04, 51.54) --
+	( 56.20, 52.46) --
+	( 56.36, 53.67) --
+	( 56.52, 55.22) --
+	( 56.69, 57.18) --
+	( 56.85, 59.64) --
+	( 57.01, 62.66) --
+	( 57.17, 66.34) --
+	( 57.33, 70.75) --
+	( 57.49, 75.97) --
+	( 57.65, 82.14) --
+	( 57.82, 89.24) --
+	( 57.98, 97.32) --
+	( 58.14,106.39) --
+	( 58.30,116.47) --
+	( 58.46,127.51) --
+	( 58.62,139.44) --
+	( 58.79,152.16) --
+	( 58.95,165.48) --
+	( 59.11,179.20) --
+	( 59.27,193.07) --
+	( 59.43,206.86) --
+	( 59.55,216.81);
+
+\draw[color=drawColor,line width= 0.6pt,line cap=round,line join=round,fill opacity=0.00,] ( 64.73,216.81) --
+	( 64.76,215.66) --
+	( 64.92,208.78) --
+	( 65.08,201.99) --
+	( 65.24,195.19) --
+	( 65.41,188.26) --
+	( 65.57,181.16) --
+	( 65.73,173.89) --
+	( 65.89,166.51) --
+	( 66.05,159.13) --
+	( 66.21,151.88) --
+	( 66.38,144.86) --
+	( 66.54,138.18) --
+	( 66.70,131.92) --
+	( 66.86,126.03) --
+	( 67.02,120.49) --
+	( 67.18,115.24) --
+	( 67.34,110.20) --
+	( 67.51,105.33) --
+	( 67.67,100.59) --
+	( 67.83, 95.98) --
+	( 67.99, 91.52) --
+	( 68.15, 87.25) --
+	( 68.31, 83.23) --
+	( 68.47, 79.53) --
+	( 68.64, 76.19) --
+	( 68.80, 73.28) --
+	( 68.96, 70.80) --
+	( 69.12, 68.70) --
+	( 69.28, 66.95) --
+	( 69.44, 65.48) --
+	( 69.61, 64.23) --
+	( 69.77, 63.13) --
+	( 69.93, 62.13) --
+	( 70.09, 61.18) --
+	( 70.25, 60.26) --
+	( 70.41, 59.36) --
+	( 70.57, 58.47) --
+	( 70.74, 57.59) --
+	( 70.90, 56.74) --
+	( 71.06, 55.92) --
+	( 71.22, 55.13) --
+	( 71.38, 54.40) --
+	( 71.54, 53.71) --
+	( 71.70, 53.07) --
+	( 71.87, 52.49) --
+	( 72.03, 51.97) --
+	( 72.19, 51.51) --
+	( 72.35, 51.13) --
+	( 72.51, 50.81) --
+	( 72.67, 50.57) --
+	( 72.83, 50.39) --
+	( 73.00, 50.27) --
+	( 73.16, 50.21) --
+	( 73.32, 50.19) --
+	( 73.48, 50.21) --
+	( 73.64, 50.25) --
+	( 73.80, 50.30) --
+	( 73.97, 50.35) --
+	( 74.13, 50.39) --
+	( 74.29, 50.41) --
+	( 74.45, 50.41) --
+	( 74.61, 50.38) --
+	( 74.77, 50.32) --
+	( 74.93, 50.24) --
+	( 75.10, 50.13) --
+	( 75.26, 50.01) --
+	( 75.42, 49.88) --
+	( 75.58, 49.75) --
+	( 75.74, 49.63) --
+	( 75.90, 49.52) --
+	( 76.06, 49.44) --
+	( 76.23, 49.37) --
+	( 76.39, 49.33) --
+	( 76.55, 49.30) --
+	( 76.71, 49.30) --
+	( 76.87, 49.30) --
+	( 77.03, 49.32) --
+	( 77.19, 49.36) --
+	( 77.36, 49.40) --
+	( 77.52, 49.46) --
+	( 77.68, 49.51) --
+	( 77.84, 49.57) --
+	( 78.00, 49.62) --
+	( 78.16, 49.65) --
+	( 78.33, 49.68) --
+	( 78.49, 49.69) --
+	( 78.65, 49.69) --
+	( 78.81, 49.67) --
+	( 78.97, 49.64) --
+	( 79.13, 49.61) --
+	( 79.29, 49.57) --
+	( 79.46, 49.52) --
+	( 79.62, 49.48) --
+	( 79.78, 49.44) --
+	( 79.94, 49.41) --
+	( 80.10, 49.37) --
+	( 80.26, 49.34) --
+	( 80.42, 49.31) --
+	( 80.59, 49.29) --
+	( 80.75, 49.27) --
+	( 80.91, 49.25) --
+	( 81.07, 49.23) --
+	( 81.23, 49.22) --
+	( 81.39, 49.22) --
+	( 81.56, 49.21) --
+	( 81.72, 49.21) --
+	( 81.88, 49.20) --
+	( 82.04, 49.20) --
+	( 82.20, 49.20) --
+	( 82.36, 49.20) --
+	( 82.52, 49.20) --
+	( 82.69, 49.20) --
+	( 82.85, 49.20) --
+	( 83.01, 49.20) --
+	( 83.17, 49.20) --
+	( 83.33, 49.20) --
+	( 83.49, 49.20) --
+	( 83.65, 49.20) --
+	( 83.82, 49.20) --
+	( 83.98, 49.20) --
+	( 84.14, 49.20) --
+	( 84.30, 49.20) --
+	( 84.46, 49.20) --
+	( 84.62, 49.20) --
+	( 84.78, 49.20) --
+	( 84.95, 49.20) --
+	( 85.11, 49.20) --
+	( 85.27, 49.20) --
+	( 85.43, 49.20) --
+	( 85.59, 49.20) --
+	( 85.75, 49.20) --
+	( 85.92, 49.20) --
+	( 86.08, 49.20) --
+	( 86.24, 49.20) --
+	( 86.40, 49.20) --
+	( 86.56, 49.20) --
+	( 86.72, 49.20) --
+	( 86.88, 49.20) --
+	( 87.05, 49.20) --
+	( 87.21, 49.20) --
+	( 87.37, 49.20) --
+	( 87.53, 49.20) --
+	( 87.69, 49.20) --
+	( 87.85, 49.20) --
+	( 88.01, 49.20) --
+	( 88.18, 49.20) --
+	( 88.34, 49.20) --
+	( 88.50, 49.20) --
+	( 88.66, 49.20) --
+	( 88.82, 49.20) --
+	( 88.98, 49.20) --
+	( 89.14, 49.20) --
+	( 89.31, 49.20) --
+	( 89.47, 49.20) --
+	( 89.63, 49.20) --
+	( 89.79, 49.20) --
+	( 89.95, 49.20) --
+	( 90.11, 49.20) --
+	( 90.28, 49.20) --
+	( 90.44, 49.20) --
+	( 90.60, 49.20) --
+	( 90.76, 49.20) --
+	( 90.92, 49.20) --
+	( 91.08, 49.20) --
+	( 91.24, 49.20) --
+	( 91.41, 49.20) --
+	( 91.57, 49.20) --
+	( 91.73, 49.20) --
+	( 91.89, 49.20) --
+	( 92.05, 49.20) --
+	( 92.21, 49.20) --
+	( 92.37, 49.20) --
+	( 92.54, 49.20) --
+	( 92.70, 49.20) --
+	( 92.86, 49.20) --
+	( 93.02, 49.20) --
+	( 93.18, 49.20) --
+	( 93.34, 49.20) --
+	( 93.51, 49.20) --
+	( 93.67, 49.20) --
+	( 93.83, 49.20) --
+	( 93.99, 49.20) --
+	( 94.15, 49.20) --
+	( 94.31, 49.20) --
+	( 94.47, 49.20) --
+	( 94.64, 49.20) --
+	( 94.80, 49.20) --
+	( 94.96, 49.20) --
+	( 95.12, 49.20) --
+	( 95.28, 49.20) --
+	( 95.44, 49.20) --
+	( 95.60, 49.20) --
+	( 95.77, 49.20) --
+	( 95.93, 49.20) --
+	( 96.09, 49.20) --
+	( 96.25, 49.20) --
+	( 96.41, 49.20) --
+	( 96.57, 49.20) --
+	( 96.73, 49.20) --
+	( 96.90, 49.20) --
+	( 97.06, 49.20) --
+	( 97.22, 49.20) --
+	( 97.38, 49.20) --
+	( 97.54, 49.20) --
+	( 97.70, 49.20) --
+	( 97.87, 49.20) --
+	( 98.03, 49.20) --
+	( 98.19, 49.20) --
+	( 98.35, 49.20) --
+	( 98.51, 49.20) --
+	( 98.67, 49.20) --
+	( 98.83, 49.20) --
+	( 99.00, 49.20) --
+	( 99.16, 49.20) --
+	( 99.32, 49.20) --
+	( 99.48, 49.20) --
+	( 99.64, 49.20) --
+	( 99.80, 49.20) --
+	( 99.96, 49.20) --
+	(100.13, 49.20) --
+	(100.29, 49.20) --
+	(100.45, 49.20) --
+	(100.61, 49.20) --
+	(100.77, 49.20) --
+	(100.93, 49.20) --
+	(101.10, 49.21) --
+	(101.26, 49.21) --
+	(101.42, 49.22) --
+	(101.58, 49.24) --
+	(101.74, 49.26) --
+	(101.90, 49.28) --
+	(102.06, 49.32) --
+	(102.23, 49.36) --
+	(102.39, 49.41) --
+	(102.55, 49.48) --
+	(102.71, 49.55) --
+	(102.87, 49.63) --
+	(103.03, 49.70) --
+	(103.19, 49.78) --
+	(103.36, 49.85) --
+	(103.52, 49.91) --
+	(103.68, 49.95) --
+	(103.84, 49.97) --
+	(104.00, 49.97) --
+	(104.16, 49.95) --
+	(104.32, 49.90) --
+	(104.49, 49.84) --
+	(104.65, 49.76) --
+	(104.81, 49.68) --
+	(104.97, 49.59) --
+	(105.13, 49.51) --
+	(105.29, 49.43) --
+	(105.46, 49.37) --
+	(105.62, 49.32) --
+	(105.78, 49.28) --
+	(105.94, 49.25) --
+	(106.10, 49.23) --
+	(106.26, 49.22) --
+	(106.42, 49.21) --
+	(106.59, 49.21) --
+	(106.75, 49.20) --
+	(106.91, 49.20) --
+	(107.07, 49.20) --
+	(107.23, 49.20) --
+	(107.39, 49.20) --
+	(107.55, 49.20) --
+	(107.72, 49.20) --
+	(107.88, 49.20) --
+	(108.04, 49.20) --
+	(108.20, 49.20) --
+	(108.36, 49.20) --
+	(108.52, 49.20) --
+	(108.68, 49.20) --
+	(108.85, 49.20) --
+	(109.01, 49.20) --
+	(109.17, 49.20) --
+	(109.33, 49.20) --
+	(109.49, 49.20) --
+	(109.65, 49.20) --
+	(109.82, 49.20) --
+	(109.98, 49.20) --
+	(110.14, 49.20) --
+	(110.30, 49.20) --
+	(110.46, 49.20) --
+	(110.62, 49.20) --
+	(110.78, 49.20) --
+	(110.95, 49.20) --
+	(111.11, 49.20) --
+	(111.27, 49.20) --
+	(111.43, 49.20) --
+	(111.59, 49.20) --
+	(111.75, 49.20) --
+	(111.91, 49.20) --
+	(112.08, 49.20) --
+	(112.24, 49.20) --
+	(112.40, 49.20) --
+	(112.56, 49.20) --
+	(112.72, 49.20) --
+	(112.88, 49.20) --
+	(113.05, 49.20) --
+	(113.21, 49.20) --
+	(113.37, 49.20) --
+	(113.53, 49.20) --
+	(113.69, 49.20) --
+	(113.85, 49.20) --
+	(114.01, 49.20) --
+	(114.18, 49.20) --
+	(114.34, 49.20) --
+	(114.50, 49.20) --
+	(114.66, 49.20) --
+	(114.82, 49.20) --
+	(114.98, 49.20) --
+	(115.14, 49.20) --
+	(115.31, 49.20) --
+	(115.47, 49.20) --
+	(115.63, 49.20) --
+	(115.79, 49.20) --
+	(115.95, 49.20) --
+	(116.11, 49.20) --
+	(116.27, 49.20) --
+	(116.44, 49.20) --
+	(116.60, 49.20) --
+	(116.76, 49.20) --
+	(116.92, 49.20) --
+	(117.08, 49.20) --
+	(117.24, 49.20) --
+	(117.41, 49.20) --
+	(117.57, 49.20) --
+	(117.73, 49.20) --
+	(117.89, 49.20) --
+	(118.05, 49.20) --
+	(118.21, 49.20) --
+	(118.37, 49.20) --
+	(118.54, 49.20) --
+	(118.70, 49.20) --
+	(118.86, 49.20) --
+	(119.02, 49.20) --
+	(119.18, 49.20) --
+	(119.34, 49.20) --
+	(119.50, 49.20) --
+	(119.67, 49.20) --
+	(119.83, 49.20) --
+	(119.99, 49.20) --
+	(120.15, 49.20) --
+	(120.31, 49.20) --
+	(120.47, 49.20) --
+	(120.63, 49.20) --
+	(120.80, 49.20) --
+	(120.96, 49.20) --
+	(121.12, 49.20) --
+	(121.28, 49.20) --
+	(121.44, 49.20) --
+	(121.60, 49.20) --
+	(121.77, 49.20) --
+	(121.93, 49.20) --
+	(122.09, 49.20) --
+	(122.25, 49.20) --
+	(122.41, 49.20) --
+	(122.57, 49.20) --
+	(122.73, 49.20) --
+	(122.90, 49.20) --
+	(123.06, 49.20) --
+	(123.22, 49.20) --
+	(123.38, 49.20) --
+	(123.54, 49.20) --
+	(123.70, 49.20) --
+	(123.86, 49.20) --
+	(124.03, 49.20) --
+	(124.19, 49.20) --
+	(124.35, 49.20) --
+	(124.51, 49.20) --
+	(124.67, 49.20) --
+	(124.83, 49.20) --
+	(125.00, 49.20) --
+	(125.16, 49.20) --
+	(125.32, 49.20) --
+	(125.48, 49.20) --
+	(125.64, 49.20) --
+	(125.80, 49.20) --
+	(125.96, 49.20) --
+	(126.13, 49.20) --
+	(126.29, 49.20) --
+	(126.45, 49.20) --
+	(126.61, 49.20) --
+	(126.77, 49.20) --
+	(126.93, 49.20) --
+	(127.09, 49.20) --
+	(127.26, 49.20) --
+	(127.42, 49.20) --
+	(127.58, 49.20) --
+	(127.74, 49.20) --
+	(127.90, 49.20) --
+	(128.06, 49.20) --
+	(128.22, 49.20) --
+	(128.39, 49.20) --
+	(128.55, 49.20) --
+	(128.71, 49.20) --
+	(128.87, 49.20) --
+	(129.03, 49.20) --
+	(129.19, 49.20) --
+	(129.36, 49.20) --
+	(129.52, 49.20) --
+	(129.68, 49.20) --
+	(129.84, 49.20) --
+	(130.00, 49.20) --
+	(130.16, 49.20) --
+	(130.32, 49.20) --
+	(130.49, 49.20) --
+	(130.65, 49.20) --
+	(130.81, 49.20) --
+	(130.97, 49.20) --
+	(131.13, 49.20) --
+	(131.29, 49.20) --
+	(131.45, 49.20) --
+	(131.62, 49.20) --
+	(131.78, 49.20) --
+	(131.94, 49.20) --
+	(132.10, 49.20) --
+	(132.26, 49.21) --
+	(132.42, 49.21) --
+	(132.59, 49.22) --
+	(132.75, 49.24) --
+	(132.91, 49.26) --
+	(133.07, 49.28) --
+	(133.23, 49.32) --
+	(133.39, 49.36) --
+	(133.55, 49.41) --
+	(133.72, 49.46) --
+	(133.88, 49.51) --
+	(134.04, 49.56) --
+	(134.20, 49.60) --
+	(134.36, 49.63) --
+	(134.52, 49.64) --
+	(134.68, 49.64) --
+	(134.85, 49.61) --
+	(135.01, 49.58) --
+	(135.17, 49.53) --
+	(135.33, 49.48) --
+	(135.49, 49.42) --
+	(135.65, 49.37) --
+	(135.81, 49.33) --
+	(135.98, 49.29) --
+	(136.14, 49.26) --
+	(136.30, 49.24) --
+	(136.46, 49.23) --
+	(136.62, 49.22) --
+	(136.78, 49.21) --
+	(136.95, 49.21);
+\definecolor[named]{fillColor}{rgb}{1.00,0.00,0.00}
+
+\draw[fill=fillColor,fill opacity=0.25,draw opacity=0.00,] ( 53.16, 49.20) --
+	( 53.39, 49.20) --
+	( 53.63, 49.21) --
+	( 53.86, 49.21) --
+	( 54.09, 49.21) --
+	( 54.32, 49.21) --
+	( 54.56, 49.22) --
+	( 54.79, 49.22) --
+	( 55.02, 49.23) --
+	( 55.26, 49.23) --
+	( 55.49, 49.24) --
+	( 55.72, 49.25) --
+	( 55.96, 49.27) --
+	( 56.19, 49.28) --
+	( 56.42, 49.30) --
+	( 56.65, 49.32) --
+	( 56.89, 49.35) --
+	( 57.12, 49.38) --
+	( 57.35, 49.42) --
+	( 57.59, 49.46) --
+	( 57.82, 49.51) --
+	( 58.05, 49.57) --
+	( 58.29, 49.64) --
+	( 58.52, 49.72) --
+	( 58.75, 49.81) --
+	( 58.98, 49.92) --
+	( 59.22, 50.03) --
+	( 59.45, 50.17) --
+	( 59.68, 50.32) --
+	( 59.92, 50.49) --
+	( 60.15, 50.68) --
+	( 60.38, 50.89) --
+	( 60.62, 51.13) --
+	( 60.85, 51.40) --
+	( 61.08, 51.69) --
+	( 61.31, 52.02) --
+	( 61.55, 52.38) --
+	( 61.78, 52.78) --
+	( 62.01, 53.23) --
+	( 62.25, 53.71) --
+	( 62.48, 54.24) --
+	( 62.71, 54.82) --
+	( 62.95, 55.45) --
+	( 63.18, 56.14) --
+	( 63.41, 56.89) --
+	( 63.64, 57.71) --
+	( 63.88, 58.59) --
+	( 64.11, 59.54) --
+	( 64.34, 60.55) --
+	( 64.58, 61.65) --
+	( 64.81, 62.82) --
+	( 65.04, 64.08) --
+	( 65.28, 65.42) --
+	( 65.51, 66.84) --
+	( 65.74, 68.34) --
+	( 65.97, 69.93) --
+	( 66.21, 71.60) --
+	( 66.44, 73.36) --
+	( 66.67, 75.21) --
+	( 66.91, 77.14) --
+	( 67.14, 79.15) --
+	( 67.37, 81.24) --
+	( 67.61, 83.39) --
+	( 67.84, 85.61) --
+	( 68.07, 87.89) --
+	( 68.30, 90.24) --
+	( 68.54, 92.62) --
+	( 68.77, 95.05) --
+	( 69.00, 97.49) --
+	( 69.24, 99.96) --
+	( 69.47,102.44) --
+	( 69.70,104.91) --
+	( 69.94,107.36) --
+	( 70.17,109.78) --
+	( 70.40,112.15) --
+	( 70.63,114.47) --
+	( 70.87,116.73) --
+	( 71.10,118.91) --
+	( 71.33,120.99) --
+	( 71.57,122.97) --
+	( 71.80,124.83) --
+	( 72.03,126.58) --
+	( 72.27,128.21) --
+	( 72.50,129.72) --
+	( 72.73,131.09) --
+	( 72.96,132.31) --
+	( 73.20,133.39) --
+	( 73.43,134.35) --
+	( 73.66,135.18) --
+	( 73.90,135.88) --
+	( 74.13,136.46) --
+	( 74.36,136.93) --
+	( 74.59,137.27) --
+	( 74.83,137.52) --
+	( 75.06,137.68) --
+	( 75.29,137.76) --
+	( 75.53,137.77) --
+	( 75.76,137.71) --
+	( 75.99,137.59) --
+	( 76.23,137.41) --
+	( 76.46,137.19) --
+	( 76.69,136.92) --
+	( 76.92,136.62) --
+	( 77.16,136.28) --
+	( 77.39,135.91) --
+	( 77.62,135.51) --
+	( 77.86,135.07) --
+	( 78.09,134.59) --
+	( 78.32,134.07) --
+	( 78.56,133.51) --
+	( 78.79,132.91) --
+	( 79.02,132.26) --
+	( 79.25,131.56) --
+	( 79.49,130.80) --
+	( 79.72,129.99) --
+	( 79.95,129.11) --
+	( 80.19,128.19) --
+	( 80.42,127.20) --
+	( 80.65,126.16) --
+	( 80.89,125.06) --
+	( 81.12,123.90) --
+	( 81.35,122.70) --
+	( 81.58,121.45) --
+	( 81.82,120.17) --
+	( 82.05,118.86) --
+	( 82.28,117.53) --
+	( 82.52,116.17) --
+	( 82.75,114.81) --
+	( 82.98,113.44) --
+	( 83.22,112.07) --
+	( 83.45,110.71) --
+	( 83.68,109.36) --
+	( 83.91,108.03) --
+	( 84.15,106.72) --
+	( 84.38,105.43) --
+	( 84.61,104.16) --
+	( 84.85,102.92) --
+	( 85.08,101.69) --
+	( 85.31,100.49) --
+	( 85.55, 99.31) --
+	( 85.78, 98.14) --
+	( 86.01, 96.99) --
+	( 86.24, 95.84) --
+	( 86.48, 94.70) --
+	( 86.71, 93.57) --
+	( 86.94, 92.44) --
+	( 87.18, 91.31) --
+	( 87.41, 90.17) --
+	( 87.64, 89.04) --
+	( 87.88, 87.91) --
+	( 88.11, 86.77) --
+	( 88.34, 85.64) --
+	( 88.57, 84.51) --
+	( 88.81, 83.39) --
+	( 89.04, 82.28) --
+	( 89.27, 81.18) --
+	( 89.51, 80.11) --
+	( 89.74, 79.05) --
+	( 89.97, 78.01) --
+	( 90.21, 77.00) --
+	( 90.44, 76.01) --
+	( 90.67, 75.06) --
+	( 90.90, 74.14) --
+	( 91.14, 73.25) --
+	( 91.37, 72.40) --
+	( 91.60, 71.57) --
+	( 91.84, 70.77) --
+	( 92.07, 70.00) --
+	( 92.30, 69.26) --
+	( 92.54, 68.54) --
+	( 92.77, 67.85) --
+	( 93.00, 67.17) --
+	( 93.23, 66.52) --
+	( 93.47, 65.88) --
+	( 93.70, 65.26) --
+	( 93.93, 64.66) --
+	( 94.17, 64.08) --
+	( 94.40, 63.51) --
+	( 94.63, 62.95) --
+	( 94.87, 62.42) --
+	( 95.10, 61.90) --
+	( 95.33, 61.40) --
+	( 95.56, 60.92) --
+	( 95.80, 60.46) --
+	( 96.03, 60.02) --
+	( 96.26, 59.60) --
+	( 96.50, 59.21) --
+	( 96.73, 58.84) --
+	( 96.96, 58.49) --
+	( 97.20, 58.16) --
+	( 97.43, 57.85) --
+	( 97.66, 57.57) --
+	( 97.89, 57.30) --
+	( 98.13, 57.04) --
+	( 98.36, 56.81) --
+	( 98.59, 56.59) --
+	( 98.83, 56.38) --
+	( 99.06, 56.18) --
+	( 99.29, 55.99) --
+	( 99.53, 55.80) --
+	( 99.76, 55.62) --
+	( 99.99, 55.45) --
+	(100.22, 55.28) --
+	(100.46, 55.12) --
+	(100.69, 54.96) --
+	(100.92, 54.80) --
+	(101.16, 54.64) --
+	(101.39, 54.48) --
+	(101.62, 54.33) --
+	(101.85, 54.18) --
+	(102.09, 54.04) --
+	(102.32, 53.90) --
+	(102.55, 53.76) --
+	(102.79, 53.63) --
+	(103.02, 53.50) --
+	(103.25, 53.38) --
+	(103.49, 53.27) --
+	(103.72, 53.17) --
+	(103.95, 53.07) --
+	(104.18, 52.98) --
+	(104.42, 52.90) --
+	(104.65, 52.83) --
+	(104.88, 52.77) --
+	(105.12, 52.71) --
+	(105.35, 52.67) --
+	(105.58, 52.63) --
+	(105.82, 52.59) --
+	(106.05, 52.57) --
+	(106.28, 52.55) --
+	(106.51, 52.54) --
+	(106.75, 52.53) --
+	(106.98, 52.52) --
+	(107.21, 52.52) --
+	(107.45, 52.52) --
+	(107.68, 52.53) --
+	(107.91, 52.53) --
+	(108.15, 52.54) --
+	(108.38, 52.54) --
+	(108.61, 52.54) --
+	(108.84, 52.54) --
+	(109.08, 52.53) --
+	(109.31, 52.52) --
+	(109.54, 52.50) --
+	(109.78, 52.47) --
+	(110.01, 52.44) --
+	(110.24, 52.40) --
+	(110.48, 52.35) --
+	(110.71, 52.29) --
+	(110.94, 52.22) --
+	(111.17, 52.15) --
+	(111.41, 52.07) --
+	(111.64, 51.98) --
+	(111.87, 51.88) --
+	(112.11, 51.78) --
+	(112.34, 51.67) --
+	(112.57, 51.56) --
+	(112.81, 51.45) --
+	(113.04, 51.33) --
+	(113.27, 51.22) --
+	(113.50, 51.10) --
+	(113.74, 50.99) --
+	(113.97, 50.88) --
+	(114.20, 50.77) --
+	(114.44, 50.67) --
+	(114.67, 50.57) --
+	(114.90, 50.48) --
+	(115.14, 50.40) --
+	(115.37, 50.32) --
+	(115.60, 50.25) --
+	(115.83, 50.18) --
+	(116.07, 50.13) --
+	(116.30, 50.08) --
+	(116.53, 50.03) --
+	(116.77, 49.99) --
+	(117.00, 49.96) --
+	(117.23, 49.94) --
+	(117.47, 49.92) --
+	(117.70, 49.91) --
+	(117.93, 49.90) --
+	(118.16, 49.89) --
+	(118.40, 49.90) --
+	(118.63, 49.90) --
+	(118.86, 49.91) --
+	(119.10, 49.92) --
+	(119.33, 49.94) --
+	(119.56, 49.96) --
+	(119.80, 49.98) --
+	(120.03, 50.00) --
+	(120.26, 50.03) --
+	(120.49, 50.06) --
+	(120.73, 50.10) --
+	(120.96, 50.13) --
+	(121.19, 50.17) --
+	(121.43, 50.21) --
+	(121.66, 50.26) --
+	(121.89, 50.30) --
+	(122.13, 50.34) --
+	(122.36, 50.39) --
+	(122.59, 50.43) --
+	(122.82, 50.47) --
+	(123.06, 50.50) --
+	(123.29, 50.53) --
+	(123.52, 50.56) --
+	(123.76, 50.58) --
+	(123.99, 50.59) --
+	(124.22, 50.60) --
+	(124.46, 50.59) --
+	(124.69, 50.58) --
+	(124.92, 50.56) --
+	(125.15, 50.54) --
+	(125.39, 50.50) --
+	(125.62, 50.46) --
+	(125.85, 50.41) --
+	(126.09, 50.36) --
+	(126.32, 50.30) --
+	(126.55, 50.24) --
+	(126.79, 50.17) --
+	(127.02, 50.11) --
+	(127.25, 50.05) --
+	(127.48, 49.99) --
+	(127.72, 49.93) --
+	(127.95, 49.87) --
+	(128.18, 49.83) --
+	(128.42, 49.78) --
+	(128.65, 49.74) --
+	(128.88, 49.72) --
+	(129.11, 49.69) --
+	(129.35, 49.68) --
+	(129.58, 49.67) --
+	(129.81, 49.67) --
+	(130.05, 49.67) --
+	(130.28, 49.68) --
+	(130.51, 49.70) --
+	(130.75, 49.72) --
+	(130.98, 49.74) --
+	(131.21, 49.77) --
+	(131.44, 49.80) --
+	(131.68, 49.83) --
+	(131.91, 49.86) --
+	(132.14, 49.89) --
+	(132.38, 49.92) --
+	(132.61, 49.94) --
+	(132.84, 49.97) --
+	(133.08, 49.99) --
+	(133.31, 50.01) --
+	(133.54, 50.02) --
+	(133.77, 50.03) --
+	(134.01, 50.03) --
+	(134.24, 50.03) --
+	(134.47, 50.03) --
+	(134.71, 50.02) --
+	(134.94, 50.01) --
+	(135.17, 49.99) --
+	(135.41, 49.98) --
+	(135.64, 49.96) --
+	(135.87, 49.94) --
+	(136.10, 49.92) --
+	(136.34, 49.91) --
+	(136.57, 49.89) --
+	(136.80, 49.87) --
+	(137.04, 49.85) --
+	(137.27, 49.84) --
+	(137.50, 49.83) --
+	(137.74, 49.82) --
+	(137.97, 49.81) --
+	(138.20, 49.80) --
+	(138.43, 49.79) --
+	(138.67, 49.78) --
+	(138.90, 49.78) --
+	(139.13, 49.77) --
+	(139.37, 49.77) --
+	(139.60, 49.77) --
+	(139.83, 49.76) --
+	(140.07, 49.76) --
+	(140.30, 49.75) --
+	(140.53, 49.75) --
+	(140.76, 49.74) --
+	(141.00, 49.74) --
+	(141.23, 49.73) --
+	(141.46, 49.72) --
+	(141.70, 49.71) --
+	(141.93, 49.70) --
+	(142.16, 49.69) --
+	(142.40, 49.68) --
+	(142.63, 49.67) --
+	(142.86, 49.65) --
+	(143.09, 49.64) --
+	(143.33, 49.63) --
+	(143.56, 49.62) --
+	(143.79, 49.61) --
+	(144.03, 49.60) --
+	(144.26, 49.59) --
+	(144.49, 49.58) --
+	(144.73, 49.57) --
+	(144.96, 49.56) --
+	(145.19, 49.55) --
+	(145.42, 49.55) --
+	(145.66, 49.54) --
+	(145.89, 49.54) --
+	(146.12, 49.54) --
+	(146.36, 49.54) --
+	(146.59, 49.53) --
+	(146.82, 49.53) --
+	(147.06, 49.54) --
+	(147.29, 49.54) --
+	(147.52, 49.54) --
+	(147.75, 49.55) --
+	(147.99, 49.55) --
+	(148.22, 49.56) --
+	(148.45, 49.57) --
+	(148.69, 49.58) --
+	(148.92, 49.59) --
+	(149.15, 49.60) --
+	(149.39, 49.62) --
+	(149.62, 49.63) --
+	(149.85, 49.65) --
+	(150.08, 49.67) --
+	(150.32, 49.69) --
+	(150.55, 49.70) --
+	(150.78, 49.72) --
+	(151.02, 49.74) --
+	(151.25, 49.76) --
+	(151.48, 49.78) --
+	(151.72, 49.80) --
+	(151.95, 49.81) --
+	(152.18, 49.83) --
+	(152.41, 49.84) --
+	(152.65, 49.85) --
+	(152.88, 49.85) --
+	(153.11, 49.86) --
+	(153.35, 49.86) --
+	(153.58, 49.86) --
+	(153.81, 49.85) --
+	(154.04, 49.85) --
+	(154.28, 49.84) --
+	(154.51, 49.82) --
+	(154.74, 49.81) --
+	(154.98, 49.79) --
+	(155.21, 49.78) --
+	(155.44, 49.76) --
+	(155.68, 49.74) --
+	(155.91, 49.72) --
+	(156.14, 49.70) --
+	(156.37, 49.68) --
+	(156.61, 49.66) --
+	(156.84, 49.65) --
+	(157.07, 49.63) --
+	(157.31, 49.61) --
+	(157.54, 49.60) --
+	(157.77, 49.59) --
+	(158.01, 49.58) --
+	(158.24, 49.57) --
+	(158.47, 49.57) --
+	(158.70, 49.56) --
+	(158.94, 49.55) --
+	(159.17, 49.55) --
+	(159.40, 49.55) --
+	(159.64, 49.54) --
+	(159.87, 49.54) --
+	(160.10, 49.53) --
+	(160.34, 49.53) --
+	(160.57, 49.52) --
+	(160.80, 49.51) --
+	(161.03, 49.50) --
+	(161.27, 49.49) --
+	(161.50, 49.48) --
+	(161.73, 49.47) --
+	(161.97, 49.46) --
+	(162.20, 49.45) --
+	(162.43, 49.43) --
+	(162.67, 49.42) --
+	(162.90, 49.41) --
+	(163.13, 49.39) --
+	(163.36, 49.38) --
+	(163.60, 49.37) --
+	(163.83, 49.35) --
+	(164.06, 49.34) --
+	(164.30, 49.33) --
+	(164.53, 49.32) --
+	(164.76, 49.31) --
+	(165.00, 49.30) --
+	(165.23, 49.29) --
+	(165.46, 49.28) --
+	(165.69, 49.27) --
+	(165.93, 49.27) --
+	(166.16, 49.26) --
+	(166.39, 49.25) --
+	(166.63, 49.25) --
+	(166.86, 49.24) --
+	(167.09, 49.24) --
+	(167.33, 49.23) --
+	(167.56, 49.23) --
+	(167.79, 49.23) --
+	(168.02, 49.22) --
+	(168.26, 49.22) --
+	(168.49, 49.22) --
+	(168.72, 49.21) --
+	(168.96, 49.21) --
+	(169.19, 49.21) --
+	(169.42, 49.21) --
+	(169.66, 49.21) --
+	(169.89, 49.21) --
+	(170.12, 49.20) --
+	(170.35, 49.20) --
+	(170.59, 49.20) --
+	(170.82, 49.20) --
+	(171.05, 49.20) --
+	(171.29, 49.20) --
+	(171.52, 49.20) --
+	(171.75, 49.20) --
+	(171.99, 49.20) --
+	(172.22, 49.20) --
+	cycle;
+\definecolor[named]{drawColor}{rgb}{1.00,0.00,0.00}
+
+\draw[color=drawColor,line width= 0.6pt,line cap=round,line join=round,fill opacity=0.00,] ( 53.16, 49.20) --
+	( 53.39, 49.20) --
+	( 53.63, 49.21) --
+	( 53.86, 49.21) --
+	( 54.09, 49.21) --
+	( 54.32, 49.21) --
+	( 54.56, 49.22) --
+	( 54.79, 49.22) --
+	( 55.02, 49.23) --
+	( 55.26, 49.23) --
+	( 55.49, 49.24) --
+	( 55.72, 49.25) --
+	( 55.96, 49.27) --
+	( 56.19, 49.28) --
+	( 56.42, 49.30) --
+	( 56.65, 49.32) --
+	( 56.89, 49.35) --
+	( 57.12, 49.38) --
+	( 57.35, 49.42) --
+	( 57.59, 49.46) --
+	( 57.82, 49.51) --
+	( 58.05, 49.57) --
+	( 58.29, 49.64) --
+	( 58.52, 49.72) --
+	( 58.75, 49.81) --
+	( 58.98, 49.92) --
+	( 59.22, 50.03) --
+	( 59.45, 50.17) --
+	( 59.68, 50.32) --
+	( 59.92, 50.49) --
+	( 60.15, 50.68) --
+	( 60.38, 50.89) --
+	( 60.62, 51.13) --
+	( 60.85, 51.40) --
+	( 61.08, 51.69) --
+	( 61.31, 52.02) --
+	( 61.55, 52.38) --
+	( 61.78, 52.78) --
+	( 62.01, 53.23) --
+	( 62.25, 53.71) --
+	( 62.48, 54.24) --
+	( 62.71, 54.82) --
+	( 62.95, 55.45) --
+	( 63.18, 56.14) --
+	( 63.41, 56.89) --
+	( 63.64, 57.71) --
+	( 63.88, 58.59) --
+	( 64.11, 59.54) --
+	( 64.34, 60.55) --
+	( 64.58, 61.65) --
+	( 64.81, 62.82) --
+	( 65.04, 64.08) --
+	( 65.28, 65.42) --
+	( 65.51, 66.84) --
+	( 65.74, 68.34) --
+	( 65.97, 69.93) --
+	( 66.21, 71.60) --
+	( 66.44, 73.36) --
+	( 66.67, 75.21) --
+	( 66.91, 77.14) --
+	( 67.14, 79.15) --
+	( 67.37, 81.24) --
+	( 67.61, 83.39) --
+	( 67.84, 85.61) --
+	( 68.07, 87.89) --
+	( 68.30, 90.24) --
+	( 68.54, 92.62) --
+	( 68.77, 95.05) --
+	( 69.00, 97.49) --
+	( 69.24, 99.96) --
+	( 69.47,102.44) --
+	( 69.70,104.91) --
+	( 69.94,107.36) --
+	( 70.17,109.78) --
+	( 70.40,112.15) --
+	( 70.63,114.47) --
+	( 70.87,116.73) --
+	( 71.10,118.91) --
+	( 71.33,120.99) --
+	( 71.57,122.97) --
+	( 71.80,124.83) --
+	( 72.03,126.58) --
+	( 72.27,128.21) --
+	( 72.50,129.72) --
+	( 72.73,131.09) --
+	( 72.96,132.31) --
+	( 73.20,133.39) --
+	( 73.43,134.35) --
+	( 73.66,135.18) --
+	( 73.90,135.88) --
+	( 74.13,136.46) --
+	( 74.36,136.93) --
+	( 74.59,137.27) --
+	( 74.83,137.52) --
+	( 75.06,137.68) --
+	( 75.29,137.76) --
+	( 75.53,137.77) --
+	( 75.76,137.71) --
+	( 75.99,137.59) --
+	( 76.23,137.41) --
+	( 76.46,137.19) --
+	( 76.69,136.92) --
+	( 76.92,136.62) --
+	( 77.16,136.28) --
+	( 77.39,135.91) --
+	( 77.62,135.51) --
+	( 77.86,135.07) --
+	( 78.09,134.59) --
+	( 78.32,134.07) --
+	( 78.56,133.51) --
+	( 78.79,132.91) --
+	( 79.02,132.26) --
+	( 79.25,131.56) --
+	( 79.49,130.80) --
+	( 79.72,129.99) --
+	( 79.95,129.11) --
+	( 80.19,128.19) --
+	( 80.42,127.20) --
+	( 80.65,126.16) --
+	( 80.89,125.06) --
+	( 81.12,123.90) --
+	( 81.35,122.70) --
+	( 81.58,121.45) --
+	( 81.82,120.17) --
+	( 82.05,118.86) --
+	( 82.28,117.53) --
+	( 82.52,116.17) --
+	( 82.75,114.81) --
+	( 82.98,113.44) --
+	( 83.22,112.07) --
+	( 83.45,110.71) --
+	( 83.68,109.36) --
+	( 83.91,108.03) --
+	( 84.15,106.72) --
+	( 84.38,105.43) --
+	( 84.61,104.16) --
+	( 84.85,102.92) --
+	( 85.08,101.69) --
+	( 85.31,100.49) --
+	( 85.55, 99.31) --
+	( 85.78, 98.14) --
+	( 86.01, 96.99) --
+	( 86.24, 95.84) --
+	( 86.48, 94.70) --
+	( 86.71, 93.57) --
+	( 86.94, 92.44) --
+	( 87.18, 91.31) --
+	( 87.41, 90.17) --
+	( 87.64, 89.04) --
+	( 87.88, 87.91) --
+	( 88.11, 86.77) --
+	( 88.34, 85.64) --
+	( 88.57, 84.51) --
+	( 88.81, 83.39) --
+	( 89.04, 82.28) --
+	( 89.27, 81.18) --
+	( 89.51, 80.11) --
+	( 89.74, 79.05) --
+	( 89.97, 78.01) --
+	( 90.21, 77.00) --
+	( 90.44, 76.01) --
+	( 90.67, 75.06) --
+	( 90.90, 74.14) --
+	( 91.14, 73.25) --
+	( 91.37, 72.40) --
+	( 91.60, 71.57) --
+	( 91.84, 70.77) --
+	( 92.07, 70.00) --
+	( 92.30, 69.26) --
+	( 92.54, 68.54) --
+	( 92.77, 67.85) --
+	( 93.00, 67.17) --
+	( 93.23, 66.52) --
+	( 93.47, 65.88) --
+	( 93.70, 65.26) --
+	( 93.93, 64.66) --
+	( 94.17, 64.08) --
+	( 94.40, 63.51) --
+	( 94.63, 62.95) --
+	( 94.87, 62.42) --
+	( 95.10, 61.90) --
+	( 95.33, 61.40) --
+	( 95.56, 60.92) --
+	( 95.80, 60.46) --
+	( 96.03, 60.02) --
+	( 96.26, 59.60) --
+	( 96.50, 59.21) --
+	( 96.73, 58.84) --
+	( 96.96, 58.49) --
+	( 97.20, 58.16) --
+	( 97.43, 57.85) --
+	( 97.66, 57.57) --
+	( 97.89, 57.30) --
+	( 98.13, 57.04) --
+	( 98.36, 56.81) --
+	( 98.59, 56.59) --
+	( 98.83, 56.38) --
+	( 99.06, 56.18) --
+	( 99.29, 55.99) --
+	( 99.53, 55.80) --
+	( 99.76, 55.62) --
+	( 99.99, 55.45) --
+	(100.22, 55.28) --
+	(100.46, 55.12) --
+	(100.69, 54.96) --
+	(100.92, 54.80) --
+	(101.16, 54.64) --
+	(101.39, 54.48) --
+	(101.62, 54.33) --
+	(101.85, 54.18) --
+	(102.09, 54.04) --
+	(102.32, 53.90) --
+	(102.55, 53.76) --
+	(102.79, 53.63) --
+	(103.02, 53.50) --
+	(103.25, 53.38) --
+	(103.49, 53.27) --
+	(103.72, 53.17) --
+	(103.95, 53.07) --
+	(104.18, 52.98) --
+	(104.42, 52.90) --
+	(104.65, 52.83) --
+	(104.88, 52.77) --
+	(105.12, 52.71) --
+	(105.35, 52.67) --
+	(105.58, 52.63) --
+	(105.82, 52.59) --
+	(106.05, 52.57) --
+	(106.28, 52.55) --
+	(106.51, 52.54) --
+	(106.75, 52.53) --
+	(106.98, 52.52) --
+	(107.21, 52.52) --
+	(107.45, 52.52) --
+	(107.68, 52.53) --
+	(107.91, 52.53) --
+	(108.15, 52.54) --
+	(108.38, 52.54) --
+	(108.61, 52.54) --
+	(108.84, 52.54) --
+	(109.08, 52.53) --
+	(109.31, 52.52) --
+	(109.54, 52.50) --
+	(109.78, 52.47) --
+	(110.01, 52.44) --
+	(110.24, 52.40) --
+	(110.48, 52.35) --
+	(110.71, 52.29) --
+	(110.94, 52.22) --
+	(111.17, 52.15) --
+	(111.41, 52.07) --
+	(111.64, 51.98) --
+	(111.87, 51.88) --
+	(112.11, 51.78) --
+	(112.34, 51.67) --
+	(112.57, 51.56) --
+	(112.81, 51.45) --
+	(113.04, 51.33) --
+	(113.27, 51.22) --
+	(113.50, 51.10) --
+	(113.74, 50.99) --
+	(113.97, 50.88) --
+	(114.20, 50.77) --
+	(114.44, 50.67) --
+	(114.67, 50.57) --
+	(114.90, 50.48) --
+	(115.14, 50.40) --
+	(115.37, 50.32) --
+	(115.60, 50.25) --
+	(115.83, 50.18) --
+	(116.07, 50.13) --
+	(116.30, 50.08) --
+	(116.53, 50.03) --
+	(116.77, 49.99) --
+	(117.00, 49.96) --
+	(117.23, 49.94) --
+	(117.47, 49.92) --
+	(117.70, 49.91) --
+	(117.93, 49.90) --
+	(118.16, 49.89) --
+	(118.40, 49.90) --
+	(118.63, 49.90) --
+	(118.86, 49.91) --
+	(119.10, 49.92) --
+	(119.33, 49.94) --
+	(119.56, 49.96) --
+	(119.80, 49.98) --
+	(120.03, 50.00) --
+	(120.26, 50.03) --
+	(120.49, 50.06) --
+	(120.73, 50.10) --
+	(120.96, 50.13) --
+	(121.19, 50.17) --
+	(121.43, 50.21) --
+	(121.66, 50.26) --
+	(121.89, 50.30) --
+	(122.13, 50.34) --
+	(122.36, 50.39) --
+	(122.59, 50.43) --
+	(122.82, 50.47) --
+	(123.06, 50.50) --
+	(123.29, 50.53) --
+	(123.52, 50.56) --
+	(123.76, 50.58) --
+	(123.99, 50.59) --
+	(124.22, 50.60) --
+	(124.46, 50.59) --
+	(124.69, 50.58) --
+	(124.92, 50.56) --
+	(125.15, 50.54) --
+	(125.39, 50.50) --
+	(125.62, 50.46) --
+	(125.85, 50.41) --
+	(126.09, 50.36) --
+	(126.32, 50.30) --
+	(126.55, 50.24) --
+	(126.79, 50.17) --
+	(127.02, 50.11) --
+	(127.25, 50.05) --
+	(127.48, 49.99) --
+	(127.72, 49.93) --
+	(127.95, 49.87) --
+	(128.18, 49.83) --
+	(128.42, 49.78) --
+	(128.65, 49.74) --
+	(128.88, 49.72) --
+	(129.11, 49.69) --
+	(129.35, 49.68) --
+	(129.58, 49.67) --
+	(129.81, 49.67) --
+	(130.05, 49.67) --
+	(130.28, 49.68) --
+	(130.51, 49.70) --
+	(130.75, 49.72) --
+	(130.98, 49.74) --
+	(131.21, 49.77) --
+	(131.44, 49.80) --
+	(131.68, 49.83) --
+	(131.91, 49.86) --
+	(132.14, 49.89) --
+	(132.38, 49.92) --
+	(132.61, 49.94) --
+	(132.84, 49.97) --
+	(133.08, 49.99) --
+	(133.31, 50.01) --
+	(133.54, 50.02) --
+	(133.77, 50.03) --
+	(134.01, 50.03) --
+	(134.24, 50.03) --
+	(134.47, 50.03) --
+	(134.71, 50.02) --
+	(134.94, 50.01) --
+	(135.17, 49.99) --
+	(135.41, 49.98) --
+	(135.64, 49.96) --
+	(135.87, 49.94) --
+	(136.10, 49.92) --
+	(136.34, 49.91) --
+	(136.57, 49.89) --
+	(136.80, 49.87) --
+	(137.04, 49.85) --
+	(137.27, 49.84) --
+	(137.50, 49.83) --
+	(137.74, 49.82) --
+	(137.97, 49.81) --
+	(138.20, 49.80) --
+	(138.43, 49.79) --
+	(138.67, 49.78) --
+	(138.90, 49.78) --
+	(139.13, 49.77) --
+	(139.37, 49.77) --
+	(139.60, 49.77) --
+	(139.83, 49.76) --
+	(140.07, 49.76) --
+	(140.30, 49.75) --
+	(140.53, 49.75) --
+	(140.76, 49.74) --
+	(141.00, 49.74) --
+	(141.23, 49.73) --
+	(141.46, 49.72) --
+	(141.70, 49.71) --
+	(141.93, 49.70) --
+	(142.16, 49.69) --
+	(142.40, 49.68) --
+	(142.63, 49.67) --
+	(142.86, 49.65) --
+	(143.09, 49.64) --
+	(143.33, 49.63) --
+	(143.56, 49.62) --
+	(143.79, 49.61) --
+	(144.03, 49.60) --
+	(144.26, 49.59) --
+	(144.49, 49.58) --
+	(144.73, 49.57) --
+	(144.96, 49.56) --
+	(145.19, 49.55) --
+	(145.42, 49.55) --
+	(145.66, 49.54) --
+	(145.89, 49.54) --
+	(146.12, 49.54) --
+	(146.36, 49.54) --
+	(146.59, 49.53) --
+	(146.82, 49.53) --
+	(147.06, 49.54) --
+	(147.29, 49.54) --
+	(147.52, 49.54) --
+	(147.75, 49.55) --
+	(147.99, 49.55) --
+	(148.22, 49.56) --
+	(148.45, 49.57) --
+	(148.69, 49.58) --
+	(148.92, 49.59) --
+	(149.15, 49.60) --
+	(149.39, 49.62) --
+	(149.62, 49.63) --
+	(149.85, 49.65) --
+	(150.08, 49.67) --
+	(150.32, 49.69) --
+	(150.55, 49.70) --
+	(150.78, 49.72) --
+	(151.02, 49.74) --
+	(151.25, 49.76) --
+	(151.48, 49.78) --
+	(151.72, 49.80) --
+	(151.95, 49.81) --
+	(152.18, 49.83) --
+	(152.41, 49.84) --
+	(152.65, 49.85) --
+	(152.88, 49.85) --
+	(153.11, 49.86) --
+	(153.35, 49.86) --
+	(153.58, 49.86) --
+	(153.81, 49.85) --
+	(154.04, 49.85) --
+	(154.28, 49.84) --
+	(154.51, 49.82) --
+	(154.74, 49.81) --
+	(154.98, 49.79) --
+	(155.21, 49.78) --
+	(155.44, 49.76) --
+	(155.68, 49.74) --
+	(155.91, 49.72) --
+	(156.14, 49.70) --
+	(156.37, 49.68) --
+	(156.61, 49.66) --
+	(156.84, 49.65) --
+	(157.07, 49.63) --
+	(157.31, 49.61) --
+	(157.54, 49.60) --
+	(157.77, 49.59) --
+	(158.01, 49.58) --
+	(158.24, 49.57) --
+	(158.47, 49.57) --
+	(158.70, 49.56) --
+	(158.94, 49.55) --
+	(159.17, 49.55) --
+	(159.40, 49.55) --
+	(159.64, 49.54) --
+	(159.87, 49.54) --
+	(160.10, 49.53) --
+	(160.34, 49.53) --
+	(160.57, 49.52) --
+	(160.80, 49.51) --
+	(161.03, 49.50) --
+	(161.27, 49.49) --
+	(161.50, 49.48) --
+	(161.73, 49.47) --
+	(161.97, 49.46) --
+	(162.20, 49.45) --
+	(162.43, 49.43) --
+	(162.67, 49.42) --
+	(162.90, 49.41) --
+	(163.13, 49.39) --
+	(163.36, 49.38) --
+	(163.60, 49.37) --
+	(163.83, 49.35) --
+	(164.06, 49.34) --
+	(164.30, 49.33) --
+	(164.53, 49.32) --
+	(164.76, 49.31) --
+	(165.00, 49.30) --
+	(165.23, 49.29) --
+	(165.46, 49.28) --
+	(165.69, 49.27) --
+	(165.93, 49.27) --
+	(166.16, 49.26) --
+	(166.39, 49.25) --
+	(166.63, 49.25) --
+	(166.86, 49.24) --
+	(167.09, 49.24) --
+	(167.33, 49.23) --
+	(167.56, 49.23) --
+	(167.79, 49.23) --
+	(168.02, 49.22) --
+	(168.26, 49.22) --
+	(168.49, 49.22) --
+	(168.72, 49.21) --
+	(168.96, 49.21) --
+	(169.19, 49.21) --
+	(169.42, 49.21) --
+	(169.66, 49.21) --
+	(169.89, 49.21) --
+	(170.12, 49.20) --
+	(170.35, 49.20) --
+	(170.59, 49.20) --
+	(170.82, 49.20) --
+	(171.05, 49.20) --
+	(171.29, 49.20) --
+	(171.52, 49.20) --
+	(171.75, 49.20) --
+	(171.99, 49.20) --
+	(172.22, 49.20);
+\definecolor[named]{fillColor}{rgb}{1.00,0.65,0.00}
+
+\draw[fill=fillColor,fill opacity=0.25,draw opacity=0.00,] ( 56.92, 49.20) --
+	( 57.89, 49.20) --
+	( 58.87, 49.20) --
+	( 59.84, 49.20) --
+	( 60.82, 49.20) --
+	( 61.79, 49.20) --
+	( 62.77, 49.20) --
+	( 63.74, 49.20) --
+	( 64.72, 49.20) --
+	( 65.69, 49.20) --
+	( 66.67, 49.20) --
+	( 67.64, 49.20) --
+	( 68.62, 49.20) --
+	( 69.59, 49.20) --
+	( 70.57, 49.20) --
+	( 71.54, 49.20) --
+	( 72.52, 49.20) --
+	( 73.50, 49.21) --
+	( 74.47, 49.21) --
+	( 75.45, 49.21) --
+	( 76.42, 49.21) --
+	( 77.40, 49.21) --
+	( 78.37, 49.21) --
+	( 79.35, 49.21) --
+	( 80.32, 49.22) --
+	( 81.30, 49.22) --
+	( 82.27, 49.22) --
+	( 83.25, 49.23) --
+	( 84.22, 49.23) --
+	( 85.20, 49.24) --
+	( 86.17, 49.25) --
+	( 87.15, 49.25) --
+	( 88.12, 49.26) --
+	( 89.10, 49.27) --
+	( 90.07, 49.28) --
+	( 91.05, 49.29) --
+	( 92.02, 49.31) --
+	( 93.00, 49.32) --
+	( 93.97, 49.34) --
+	( 94.95, 49.36) --
+	( 95.92, 49.38) --
+	( 96.90, 49.40) --
+	( 97.87, 49.43) --
+	( 98.85, 49.46) --
+	( 99.82, 49.49) --
+	(100.80, 49.53) --
+	(101.77, 49.56) --
+	(102.75, 49.60) --
+	(103.73, 49.65) --
+	(104.70, 49.70) --
+	(105.68, 49.75) --
+	(106.65, 49.80) --
+	(107.63, 49.86) --
+	(108.60, 49.93) --
+	(109.58, 50.00) --
+	(110.55, 50.07) --
+	(111.53, 50.15) --
+	(112.50, 50.23) --
+	(113.48, 50.32) --
+	(114.45, 50.41) --
+	(115.43, 50.51) --
+	(116.40, 50.61) --
+	(117.38, 50.72) --
+	(118.35, 50.83) --
+	(119.33, 50.95) --
+	(120.30, 51.07) --
+	(121.28, 51.19) --
+	(122.25, 51.33) --
+	(123.23, 51.46) --
+	(124.20, 51.60) --
+	(125.18, 51.75) --
+	(126.15, 51.90) --
+	(127.13, 52.06) --
+	(128.10, 52.22) --
+	(129.08, 52.39) --
+	(130.05, 52.56) --
+	(131.03, 52.74) --
+	(132.00, 52.92) --
+	(132.98, 53.11) --
+	(133.96, 53.30) --
+	(134.93, 53.50) --
+	(135.91, 53.70) --
+	(136.88, 53.91) --
+	(137.86, 54.12) --
+	(138.83, 54.34) --
+	(139.81, 54.57) --
+	(140.78, 54.79) --
+	(141.76, 55.03) --
+	(142.73, 55.26) --
+	(143.71, 55.51) --
+	(144.68, 55.75) --
+	(145.66, 56.00) --
+	(146.63, 56.26) --
+	(147.61, 56.52) --
+	(148.58, 56.78) --
+	(149.56, 57.05) --
+	(150.53, 57.31) --
+	(151.51, 57.58) --
+	(152.48, 57.86) --
+	(153.46, 58.13) --
+	(154.43, 58.40) --
+	(155.41, 58.68) --
+	(156.38, 58.95) --
+	(157.36, 59.23) --
+	(158.33, 59.50) --
+	(159.31, 59.77) --
+	(160.28, 60.04) --
+	(161.26, 60.30) --
+	(162.23, 60.56) --
+	(163.21, 60.81) --
+	(164.18, 61.06) --
+	(165.16, 61.30) --
+	(166.14, 61.54) --
+	(167.11, 61.76) --
+	(168.09, 61.98) --
+	(169.06, 62.19) --
+	(170.04, 62.39) --
+	(171.01, 62.58) --
+	(171.99, 62.75) --
+	(172.96, 62.92) --
+	(173.94, 63.07) --
+	(174.91, 63.21) --
+	(175.89, 63.34) --
+	(176.86, 63.46) --
+	(177.84, 63.56) --
+	(178.81, 63.65) --
+	(179.79, 63.73) --
+	(180.76, 63.79) --
+	(181.74, 63.84) --
+	(182.71, 63.88) --
+	(183.69, 63.91) --
+	(184.66, 63.92) --
+	(185.64, 63.92) --
+	(186.61, 63.92) --
+	(187.59, 63.90) --
+	(188.56, 63.87) --
+	(189.54, 63.83) --
+	(190.51, 63.79) --
+	(191.49, 63.73) --
+	(192.46, 63.67) --
+	(193.44, 63.61) --
+	(194.41, 63.53) --
+	(195.39, 63.46) --
+	(196.37, 63.38) --
+	(197.34, 63.29) --
+	(198.32, 63.20) --
+	(199.29, 63.11) --
+	(200.27, 63.02) --
+	(201.24, 62.93) --
+	(202.22, 62.84) --
+	(203.19, 62.74) --
+	(204.17, 62.65) --
+	(205.14, 62.56) --
+	(206.12, 62.47) --
+	(207.09, 62.38) --
+	(208.07, 62.29) --
+	(209.04, 62.20) --
+	(210.02, 62.11) --
+	(210.99, 62.02) --
+	(211.97, 61.94) --
+	(212.94, 61.85) --
+	(213.92, 61.77) --
+	(214.89, 61.69) --
+	(215.87, 61.61) --
+	(216.84, 61.53) --
+	(217.82, 61.45) --
+	(218.79, 61.36) --
+	(219.77, 61.28) --
+	(220.74, 61.20) --
+	(221.72, 61.12) --
+	(222.69, 61.04) --
+	(223.67, 60.95) --
+	(224.64, 60.87) --
+	(225.62, 60.78) --
+	(226.60, 60.69) --
+	(227.57, 60.60) --
+	(228.55, 60.51) --
+	(229.52, 60.41) --
+	(230.50, 60.31) --
+	(231.47, 60.21) --
+	(232.45, 60.10) --
+	(233.42, 60.00) --
+	(234.40, 59.89) --
+	(235.37, 59.77) --
+	(236.35, 59.66) --
+	(237.32, 59.54) --
+	(238.30, 59.42) --
+	(239.27, 59.29) --
+	(240.25, 59.16) --
+	(241.22, 59.03) --
+	(242.20, 58.90) --
+	(243.17, 58.76) --
+	(244.15, 58.62) --
+	(245.12, 58.48) --
+	(246.10, 58.34) --
+	(247.07, 58.19) --
+	(248.05, 58.05) --
+	(249.02, 57.90) --
+	(250.00, 57.75) --
+	(250.97, 57.60) --
+	(251.95, 57.45) --
+	(252.92, 57.30) --
+	(253.90, 57.15) --
+	(254.87, 57.00) --
+	(255.85, 56.85) --
+	(256.83, 56.70) --
+	(257.80, 56.55) --
+	(258.78, 56.40) --
+	(259.75, 56.26) --
+	(260.73, 56.11) --
+	(261.70, 55.97) --
+	(262.68, 55.83) --
+	(263.65, 55.69) --
+	(264.63, 55.56) --
+	(265.60, 55.42) --
+	(266.58, 55.29) --
+	(267.55, 55.16) --
+	(268.53, 55.04) --
+	(269.50, 54.92) --
+	(270.48, 54.80) --
+	(271.45, 54.68) --
+	(272.43, 54.56) --
+	(273.40, 54.45) --
+	(274.38, 54.34) --
+	(275.35, 54.24) --
+	(276.33, 54.13) --
+	(277.30, 54.03) --
+	(278.28, 53.93) --
+	(279.25, 53.84) --
+	(280.23, 53.74) --
+	(281.20, 53.65) --
+	(282.18, 53.56) --
+	(283.15, 53.48) --
+	(284.13, 53.40) --
+	(285.10, 53.32) --
+	(286.08, 53.24) --
+	(287.06, 53.16) --
+	(288.03, 53.09) --
+	(289.01, 53.02) --
+	(289.98, 52.95) --
+	(290.96, 52.88) --
+	(291.93, 52.81) --
+	(292.91, 52.75) --
+	(293.88, 52.69) --
+	(294.86, 52.63) --
+	(295.83, 52.58) --
+	(296.81, 52.52) --
+	(297.78, 52.47) --
+	(298.76, 52.42) --
+	(299.73, 52.37) --
+	(300.71, 52.32) --
+	(301.68, 52.27) --
+	(302.66, 52.22) --
+	(303.63, 52.18) --
+	(304.61, 52.13) --
+	(305.58, 52.09) --
+	(306.56, 52.05) --
+	(307.53, 52.00) --
+	(308.51, 51.96) --
+	(309.48, 51.92) --
+	(310.46, 51.87) --
+	(311.43, 51.83) --
+	(312.41, 51.79) --
+	(313.38, 51.74) --
+	(314.36, 51.70) --
+	(315.33, 51.65) --
+	(316.31, 51.60) --
+	(317.29, 51.56) --
+	(318.26, 51.51) --
+	(319.24, 51.46) --
+	(320.21, 51.41) --
+	(321.19, 51.36) --
+	(322.16, 51.30) --
+	(323.14, 51.25) --
+	(324.11, 51.20) --
+	(325.09, 51.15) --
+	(325.21, 51.14) --
+	(325.21, 49.20) --
+	cycle;
+\definecolor[named]{drawColor}{rgb}{1.00,0.65,0.00}
+
+\draw[color=drawColor,line width= 0.6pt,line cap=round,line join=round,fill opacity=0.00,] ( 56.92, 49.20) --
+	( 57.89, 49.20) --
+	( 58.87, 49.20) --
+	( 59.84, 49.20) --
+	( 60.82, 49.20) --
+	( 61.79, 49.20) --
+	( 62.77, 49.20) --
+	( 63.74, 49.20) --
+	( 64.72, 49.20) --
+	( 65.69, 49.20) --
+	( 66.67, 49.20) --
+	( 67.64, 49.20) --
+	( 68.62, 49.20) --
+	( 69.59, 49.20) --
+	( 70.57, 49.20) --
+	( 71.54, 49.20) --
+	( 72.52, 49.20) --
+	( 73.50, 49.21) --
+	( 74.47, 49.21) --
+	( 75.45, 49.21) --
+	( 76.42, 49.21) --
+	( 77.40, 49.21) --
+	( 78.37, 49.21) --
+	( 79.35, 49.21) --
+	( 80.32, 49.22) --
+	( 81.30, 49.22) --
+	( 82.27, 49.22) --
+	( 83.25, 49.23) --
+	( 84.22, 49.23) --
+	( 85.20, 49.24) --
+	( 86.17, 49.25) --
+	( 87.15, 49.25) --
+	( 88.12, 49.26) --
+	( 89.10, 49.27) --
+	( 90.07, 49.28) --
+	( 91.05, 49.29) --
+	( 92.02, 49.31) --
+	( 93.00, 49.32) --
+	( 93.97, 49.34) --
+	( 94.95, 49.36) --
+	( 95.92, 49.38) --
+	( 96.90, 49.40) --
+	( 97.87, 49.43) --
+	( 98.85, 49.46) --
+	( 99.82, 49.49) --
+	(100.80, 49.53) --
+	(101.77, 49.56) --
+	(102.75, 49.60) --
+	(103.73, 49.65) --
+	(104.70, 49.70) --
+	(105.68, 49.75) --
+	(106.65, 49.80) --
+	(107.63, 49.86) --
+	(108.60, 49.93) --
+	(109.58, 50.00) --
+	(110.55, 50.07) --
+	(111.53, 50.15) --
+	(112.50, 50.23) --
+	(113.48, 50.32) --
+	(114.45, 50.41) --
+	(115.43, 50.51) --
+	(116.40, 50.61) --
+	(117.38, 50.72) --
+	(118.35, 50.83) --
+	(119.33, 50.95) --
+	(120.30, 51.07) --
+	(121.28, 51.19) --
+	(122.25, 51.33) --
+	(123.23, 51.46) --
+	(124.20, 51.60) --
+	(125.18, 51.75) --
+	(126.15, 51.90) --
+	(127.13, 52.06) --
+	(128.10, 52.22) --
+	(129.08, 52.39) --
+	(130.05, 52.56) --
+	(131.03, 52.74) --
+	(132.00, 52.92) --
+	(132.98, 53.11) --
+	(133.96, 53.30) --
+	(134.93, 53.50) --
+	(135.91, 53.70) --
+	(136.88, 53.91) --
+	(137.86, 54.12) --
+	(138.83, 54.34) --
+	(139.81, 54.57) --
+	(140.78, 54.79) --
+	(141.76, 55.03) --
+	(142.73, 55.26) --
+	(143.71, 55.51) --
+	(144.68, 55.75) --
+	(145.66, 56.00) --
+	(146.63, 56.26) --
+	(147.61, 56.52) --
+	(148.58, 56.78) --
+	(149.56, 57.05) --
+	(150.53, 57.31) --
+	(151.51, 57.58) --
+	(152.48, 57.86) --
+	(153.46, 58.13) --
+	(154.43, 58.40) --
+	(155.41, 58.68) --
+	(156.38, 58.95) --
+	(157.36, 59.23) --
+	(158.33, 59.50) --
+	(159.31, 59.77) --
+	(160.28, 60.04) --
+	(161.26, 60.30) --
+	(162.23, 60.56) --
+	(163.21, 60.81) --
+	(164.18, 61.06) --
+	(165.16, 61.30) --
+	(166.14, 61.54) --
+	(167.11, 61.76) --
+	(168.09, 61.98) --
+	(169.06, 62.19) --
+	(170.04, 62.39) --
+	(171.01, 62.58) --
+	(171.99, 62.75) --
+	(172.96, 62.92) --
+	(173.94, 63.07) --
+	(174.91, 63.21) --
+	(175.89, 63.34) --
+	(176.86, 63.46) --
+	(177.84, 63.56) --
+	(178.81, 63.65) --
+	(179.79, 63.73) --
+	(180.76, 63.79) --
+	(181.74, 63.84) --
+	(182.71, 63.88) --
+	(183.69, 63.91) --
+	(184.66, 63.92) --
+	(185.64, 63.92) --
+	(186.61, 63.92) --
+	(187.59, 63.90) --
+	(188.56, 63.87) --
+	(189.54, 63.83) --
+	(190.51, 63.79) --
+	(191.49, 63.73) --
+	(192.46, 63.67) --
+	(193.44, 63.61) --
+	(194.41, 63.53) --
+	(195.39, 63.46) --
+	(196.37, 63.38) --
+	(197.34, 63.29) --
+	(198.32, 63.20) --
+	(199.29, 63.11) --
+	(200.27, 63.02) --
+	(201.24, 62.93) --
+	(202.22, 62.84) --
+	(203.19, 62.74) --
+	(204.17, 62.65) --
+	(205.14, 62.56) --
+	(206.12, 62.47) --
+	(207.09, 62.38) --
+	(208.07, 62.29) --
+	(209.04, 62.20) --
+	(210.02, 62.11) --
+	(210.99, 62.02) --
+	(211.97, 61.94) --
+	(212.94, 61.85) --
+	(213.92, 61.77) --
+	(214.89, 61.69) --
+	(215.87, 61.61) --
+	(216.84, 61.53) --
+	(217.82, 61.45) --
+	(218.79, 61.36) --
+	(219.77, 61.28) --
+	(220.74, 61.20) --
+	(221.72, 61.12) --
+	(222.69, 61.04) --
+	(223.67, 60.95) --
+	(224.64, 60.87) --
+	(225.62, 60.78) --
+	(226.60, 60.69) --
+	(227.57, 60.60) --
+	(228.55, 60.51) --
+	(229.52, 60.41) --
+	(230.50, 60.31) --
+	(231.47, 60.21) --
+	(232.45, 60.10) --
+	(233.42, 60.00) --
+	(234.40, 59.89) --
+	(235.37, 59.77) --
+	(236.35, 59.66) --
+	(237.32, 59.54) --
+	(238.30, 59.42) --
+	(239.27, 59.29) --
+	(240.25, 59.16) --
+	(241.22, 59.03) --
+	(242.20, 58.90) --
+	(243.17, 58.76) --
+	(244.15, 58.62) --
+	(245.12, 58.48) --
+	(246.10, 58.34) --
+	(247.07, 58.19) --
+	(248.05, 58.05) --
+	(249.02, 57.90) --
+	(250.00, 57.75) --
+	(250.97, 57.60) --
+	(251.95, 57.45) --
+	(252.92, 57.30) --
+	(253.90, 57.15) --
+	(254.87, 57.00) --
+	(255.85, 56.85) --
+	(256.83, 56.70) --
+	(257.80, 56.55) --
+	(258.78, 56.40) --
+	(259.75, 56.26) --
+	(260.73, 56.11) --
+	(261.70, 55.97) --
+	(262.68, 55.83) --
+	(263.65, 55.69) --
+	(264.63, 55.56) --
+	(265.60, 55.42) --
+	(266.58, 55.29) --
+	(267.55, 55.16) --
+	(268.53, 55.04) --
+	(269.50, 54.92) --
+	(270.48, 54.80) --
+	(271.45, 54.68) --
+	(272.43, 54.56) --
+	(273.40, 54.45) --
+	(274.38, 54.34) --
+	(275.35, 54.24) --
+	(276.33, 54.13) --
+	(277.30, 54.03) --
+	(278.28, 53.93) --
+	(279.25, 53.84) --
+	(280.23, 53.74) --
+	(281.20, 53.65) --
+	(282.18, 53.56) --
+	(283.15, 53.48) --
+	(284.13, 53.40) --
+	(285.10, 53.32) --
+	(286.08, 53.24) --
+	(287.06, 53.16) --
+	(288.03, 53.09) --
+	(289.01, 53.02) --
+	(289.98, 52.95) --
+	(290.96, 52.88) --
+	(291.93, 52.81) --
+	(292.91, 52.75) --
+	(293.88, 52.69) --
+	(294.86, 52.63) --
+	(295.83, 52.58) --
+	(296.81, 52.52) --
+	(297.78, 52.47) --
+	(298.76, 52.42) --
+	(299.73, 52.37) --
+	(300.71, 52.32) --
+	(301.68, 52.27) --
+	(302.66, 52.22) --
+	(303.63, 52.18) --
+	(304.61, 52.13) --
+	(305.58, 52.09) --
+	(306.56, 52.05) --
+	(307.53, 52.00) --
+	(308.51, 51.96) --
+	(309.48, 51.92) --
+	(310.46, 51.87) --
+	(311.43, 51.83) --
+	(312.41, 51.79) --
+	(313.38, 51.74) --
+	(314.36, 51.70) --
+	(315.33, 51.65) --
+	(316.31, 51.60) --
+	(317.29, 51.56) --
+	(318.26, 51.51) --
+	(319.24, 51.46) --
+	(320.21, 51.41) --
+	(321.19, 51.36) --
+	(322.16, 51.30) --
+	(323.14, 51.25) --
+	(324.11, 51.20) --
+	(325.09, 51.15) --
+	(325.21, 51.14);
+\definecolor[named]{fillColor}{rgb}{0.00,1.00,0.00}
+
+\draw[fill=fillColor,fill opacity=0.25,draw opacity=0.00,] ( 49.20, 49.20) --
+	( 49.20,146.82) --
+	( 50.03,142.51) --
+	( 50.85,138.39) --
+	( 51.68,134.45) --
+	( 52.51,130.69) --
+	( 53.33,127.09) --
+	( 54.16,123.65) --
+	( 54.99,120.36) --
+	( 55.81,117.22) --
+	( 56.64,114.22) --
+	( 57.47,111.35) --
+	( 58.29,108.60) --
+	( 59.12,105.98) --
+	( 59.94,103.47) --
+	( 60.77,101.08) --
+	( 61.60, 98.79) --
+	( 62.42, 96.60) --
+	( 63.25, 94.50) --
+	( 64.08, 92.50) --
+	( 64.90, 90.59) --
+	( 65.73, 88.76) --
+	( 66.56, 87.02) --
+	( 67.38, 85.35) --
+	( 68.21, 83.75) --
+	( 69.04, 82.23) --
+	( 69.86, 80.77) --
+	( 70.69, 79.37) --
+	( 71.52, 78.04) --
+	( 72.34, 76.77) --
+	( 73.17, 75.55) --
+	( 74.00, 74.39) --
+	( 74.82, 73.28) --
+	( 75.65, 72.21) --
+	( 76.47, 71.20) --
+	( 77.30, 70.22) --
+	( 78.13, 69.30) --
+	( 78.95, 68.41) --
+	( 79.78, 67.56) --
+	( 80.61, 66.75) --
+	( 81.43, 65.98) --
+	( 82.26, 65.23) --
+	( 83.09, 64.53) --
+	( 83.91, 63.85) --
+	( 84.74, 63.20) --
+	( 85.57, 62.58) --
+	( 86.39, 61.99) --
+	( 87.22, 61.43) --
+	( 88.05, 60.89) --
+	( 88.87, 60.37) --
+	( 89.70, 59.88) --
+	( 90.53, 59.41) --
+	( 91.35, 58.96) --
+	( 92.18, 58.53) --
+	( 93.01, 58.11) --
+	( 93.83, 57.72) --
+	( 94.66, 57.34) --
+	( 95.48, 56.99) --
+	( 96.31, 56.64) --
+	( 97.14, 56.31) --
+	( 97.96, 56.00) --
+	( 98.79, 55.70) --
+	( 99.62, 55.41) --
+	(100.44, 55.14) --
+	(101.27, 54.88) --
+	(102.10, 54.62) --
+	(102.92, 54.39) --
+	(103.75, 54.16) --
+	(104.58, 53.94) --
+	(105.40, 53.73) --
+	(106.23, 53.53) --
+	(107.06, 53.34) --
+	(107.88, 53.15) --
+	(108.71, 52.98) --
+	(109.54, 52.81) --
+	(110.36, 52.65) --
+	(111.19, 52.50) --
+	(112.01, 52.36) --
+	(112.84, 52.22) --
+	(113.67, 52.08) --
+	(114.49, 51.96) --
+	(115.32, 51.83) --
+	(116.15, 51.72) --
+	(116.97, 51.61) --
+	(117.80, 51.50) --
+	(118.63, 51.40) --
+	(119.45, 51.30) --
+	(120.28, 51.21) --
+	(121.11, 51.12) --
+	(121.93, 51.04) --
+	(122.76, 50.95) --
+	(123.59, 50.88) --
+	(124.41, 50.80) --
+	(125.24, 50.73) --
+	(126.07, 50.66) --
+	(126.89, 50.60) --
+	(127.72, 50.54) --
+	(128.55, 50.48) --
+	(129.37, 50.42) --
+	(130.20, 50.37) --
+	(131.02, 50.32) --
+	(131.85, 50.27) --
+	(132.68, 50.22) --
+	(133.50, 50.18) --
+	(134.33, 50.13) --
+	(135.16, 50.09) --
+	(135.98, 50.05) --
+	(136.81, 50.01) --
+	(137.64, 49.98) --
+	(138.46, 49.94) --
+	(139.29, 49.91) --
+	(140.12, 49.88) --
+	(140.94, 49.85) --
+	(141.77, 49.82) --
+	(142.60, 49.79) --
+	(143.42, 49.77) --
+	(144.25, 49.74) --
+	(145.08, 49.72) --
+	(145.90, 49.70) --
+	(146.73, 49.67) --
+	(147.55, 49.65) --
+	(148.38, 49.63) --
+	(149.21, 49.61) --
+	(150.03, 49.60) --
+	(150.86, 49.58) --
+	(151.69, 49.56) --
+	(152.51, 49.55) --
+	(153.34, 49.53) --
+	(154.17, 49.52) --
+	(154.99, 49.50) --
+	(155.82, 49.49) --
+	(156.65, 49.48) --
+	(157.47, 49.46) --
+	(158.30, 49.45) --
+	(159.13, 49.44) --
+	(159.95, 49.43) --
+	(160.78, 49.42) --
+	(161.61, 49.41) --
+	(162.43, 49.40) --
+	(163.26, 49.39) --
+	(164.09, 49.38) --
+	(164.91, 49.38) --
+	(165.74, 49.37) --
+	(166.56, 49.36) --
+	(167.39, 49.35) --
+	(168.22, 49.35) --
+	(169.04, 49.34) --
+	(169.87, 49.33) --
+	(170.70, 49.33) --
+	(171.52, 49.32) --
+	(172.35, 49.32) --
+	(173.18, 49.31) --
+	(174.00, 49.31) --
+	(174.83, 49.30) --
+	(175.66, 49.30) --
+	(176.48, 49.29) --
+	(177.31, 49.29) --
+	(178.14, 49.29) --
+	(178.96, 49.28) --
+	(179.79, 49.28) --
+	(180.62, 49.27) --
+	(181.44, 49.27) --
+	(182.27, 49.27) --
+	(183.09, 49.26) --
+	(183.92, 49.26) --
+	(184.75, 49.26) --
+	(185.57, 49.26) --
+	(186.40, 49.25) --
+	(187.23, 49.25) --
+	(188.05, 49.25) --
+	(188.88, 49.25) --
+	(189.71, 49.25) --
+	(190.53, 49.24) --
+	(191.36, 49.24) --
+	(192.19, 49.24) --
+	(193.01, 49.24) --
+	(193.84, 49.24) --
+	(194.67, 49.23) --
+	(195.49, 49.23) --
+	(196.32, 49.23) --
+	(197.15, 49.23) --
+	(197.97, 49.23) --
+	(198.80, 49.23) --
+	(199.63, 49.23) --
+	(200.45, 49.23) --
+	(201.28, 49.22) --
+	(202.10, 49.22) --
+	(202.93, 49.22) --
+	(203.76, 49.22) --
+	(204.58, 49.22) --
+	(205.41, 49.22) --
+	(206.24, 49.22) --
+	(207.06, 49.22) --
+	(207.89, 49.22) --
+	(208.72, 49.22) --
+	(209.54, 49.22) --
+	(210.37, 49.21) --
+	(211.20, 49.21) --
+	(212.02, 49.21) --
+	(212.85, 49.21) --
+	(213.68, 49.21) --
+	(214.50, 49.21) --
+	(215.33, 49.21) --
+	(216.16, 49.21) --
+	(216.98, 49.21) --
+	(217.81, 49.21) --
+	(218.63, 49.21) --
+	(219.46, 49.21) --
+	(220.29, 49.21) --
+	(221.11, 49.21) --
+	(221.94, 49.21) --
+	(222.77, 49.21) --
+	(223.59, 49.21) --
+	(224.42, 49.21) --
+	(225.25, 49.21) --
+	(226.07, 49.21) --
+	(226.90, 49.21) --
+	(227.73, 49.21) --
+	(228.55, 49.21) --
+	(229.38, 49.21) --
+	(230.21, 49.20) --
+	(231.03, 49.20) --
+	(231.86, 49.20) --
+	(232.69, 49.20) --
+	(233.51, 49.20) --
+	(234.34, 49.20) --
+	(235.17, 49.20) --
+	(235.99, 49.20) --
+	(236.82, 49.20) --
+	(237.64, 49.20) --
+	(238.47, 49.20) --
+	(239.30, 49.20) --
+	(240.12, 49.20) --
+	(240.95, 49.20) --
+	(241.78, 49.20) --
+	(242.60, 49.20) --
+	(243.43, 49.20) --
+	(244.26, 49.20) --
+	(245.08, 49.20) --
+	(245.91, 49.20) --
+	(246.74, 49.20) --
+	(247.56, 49.20) --
+	(248.39, 49.20) --
+	(249.22, 49.20) --
+	(250.04, 49.20) --
+	(250.87, 49.20) --
+	(251.70, 49.20) --
+	(252.52, 49.20) --
+	(253.35, 49.20) --
+	(254.17, 49.20) --
+	(255.00, 49.20) --
+	(255.83, 49.20) --
+	(256.65, 49.20) --
+	(257.48, 49.20) --
+	(258.31, 49.20) --
+	(259.13, 49.20) --
+	(259.96, 49.20) --
+	(260.79, 49.20) --
+	(261.61, 49.20) --
+	(262.44, 49.20) --
+	(263.27, 49.20) --
+	(264.09, 49.20) --
+	(264.92, 49.20) --
+	(265.75, 49.20) --
+	(266.57, 49.20) --
+	(267.40, 49.20) --
+	(268.23, 49.20) --
+	(269.05, 49.20) --
+	(269.88, 49.20) --
+	(270.71, 49.20) --
+	(271.53, 49.20) --
+	(272.36, 49.20) --
+	(273.18, 49.20) --
+	(274.01, 49.20) --
+	(274.84, 49.20) --
+	(275.66, 49.20) --
+	(276.49, 49.20) --
+	(277.32, 49.20) --
+	(278.14, 49.20) --
+	(278.97, 49.20) --
+	(279.80, 49.20) --
+	(280.62, 49.20) --
+	(281.45, 49.20) --
+	(282.28, 49.20) --
+	(283.10, 49.20) --
+	(283.93, 49.20) --
+	(284.76, 49.20) --
+	(285.58, 49.20) --
+	(286.41, 49.20) --
+	(287.24, 49.20) --
+	(288.06, 49.20) --
+	(288.89, 49.20) --
+	(289.71, 49.20) --
+	(290.54, 49.20) --
+	(291.37, 49.20) --
+	(292.19, 49.20) --
+	(293.02, 49.20) --
+	(293.85, 49.20) --
+	(294.67, 49.20) --
+	(295.50, 49.20) --
+	(296.33, 49.20) --
+	(297.15, 49.20) --
+	(297.98, 49.20) --
+	(298.81, 49.20) --
+	(299.63, 49.20) --
+	(300.46, 49.20) --
+	(301.29, 49.20) --
+	(302.11, 49.20) --
+	(302.94, 49.20) --
+	(303.77, 49.20) --
+	(304.59, 49.20) --
+	(305.42, 49.20) --
+	(306.25, 49.20) --
+	(307.07, 49.20) --
+	(307.90, 49.20) --
+	(308.72, 49.20) --
+	(309.55, 49.20) --
+	(310.38, 49.20) --
+	(311.20, 49.20) --
+	(312.03, 49.20) --
+	(312.86, 49.20) --
+	(313.68, 49.20) --
+	(314.51, 49.20) --
+	(315.34, 49.20) --
+	(316.16, 49.20) --
+	(316.99, 49.20) --
+	(317.82, 49.20) --
+	(318.64, 49.20) --
+	(319.47, 49.20) --
+	(320.30, 49.20) --
+	(321.12, 49.20) --
+	(321.95, 49.20) --
+	(322.78, 49.20) --
+	(323.60, 49.20) --
+	(324.43, 49.20) --
+	(325.21, 49.20) --
+	(325.21, 49.20) --
+	cycle;
+\definecolor[named]{drawColor}{rgb}{0.00,1.00,0.00}
+
+\draw[color=drawColor,line width= 0.6pt,line cap=round,line join=round,fill opacity=0.00,] ( 49.20,146.82) --
+	( 50.03,142.51) --
+	( 50.85,138.39) --
+	( 51.68,134.45) --
+	( 52.51,130.69) --
+	( 53.33,127.09) --
+	( 54.16,123.65) --
+	( 54.99,120.36) --
+	( 55.81,117.22) --
+	( 56.64,114.22) --
+	( 57.47,111.35) --
+	( 58.29,108.60) --
+	( 59.12,105.98) --
+	( 59.94,103.47) --
+	( 60.77,101.08) --
+	( 61.60, 98.79) --
+	( 62.42, 96.60) --
+	( 63.25, 94.50) --
+	( 64.08, 92.50) --
+	( 64.90, 90.59) --
+	( 65.73, 88.76) --
+	( 66.56, 87.02) --
+	( 67.38, 85.35) --
+	( 68.21, 83.75) --
+	( 69.04, 82.23) --
+	( 69.86, 80.77) --
+	( 70.69, 79.37) --
+	( 71.52, 78.04) --
+	( 72.34, 76.77) --
+	( 73.17, 75.55) --
+	( 74.00, 74.39) --
+	( 74.82, 73.28) --
+	( 75.65, 72.21) --
+	( 76.47, 71.20) --
+	( 77.30, 70.22) --
+	( 78.13, 69.30) --
+	( 78.95, 68.41) --
+	( 79.78, 67.56) --
+	( 80.61, 66.75) --
+	( 81.43, 65.98) --
+	( 82.26, 65.23) --
+	( 83.09, 64.53) --
+	( 83.91, 63.85) --
+	( 84.74, 63.20) --
+	( 85.57, 62.58) --
+	( 86.39, 61.99) --
+	( 87.22, 61.43) --
+	( 88.05, 60.89) --
+	( 88.87, 60.37) --
+	( 89.70, 59.88) --
+	( 90.53, 59.41) --
+	( 91.35, 58.96) --
+	( 92.18, 58.53) --
+	( 93.01, 58.11) --
+	( 93.83, 57.72) --
+	( 94.66, 57.34) --
+	( 95.48, 56.99) --
+	( 96.31, 56.64) --
+	( 97.14, 56.31) --
+	( 97.96, 56.00) --
+	( 98.79, 55.70) --
+	( 99.62, 55.41) --
+	(100.44, 55.14) --
+	(101.27, 54.88) --
+	(102.10, 54.62) --
+	(102.92, 54.39) --
+	(103.75, 54.16) --
+	(104.58, 53.94) --
+	(105.40, 53.73) --
+	(106.23, 53.53) --
+	(107.06, 53.34) --
+	(107.88, 53.15) --
+	(108.71, 52.98) --
+	(109.54, 52.81) --
+	(110.36, 52.65) --
+	(111.19, 52.50) --
+	(112.01, 52.36) --
+	(112.84, 52.22) --
+	(113.67, 52.08) --
+	(114.49, 51.96) --
+	(115.32, 51.83) --
+	(116.15, 51.72) --
+	(116.97, 51.61) --
+	(117.80, 51.50) --
+	(118.63, 51.40) --
+	(119.45, 51.30) --
+	(120.28, 51.21) --
+	(121.11, 51.12) --
+	(121.93, 51.04) --
+	(122.76, 50.95) --
+	(123.59, 50.88) --
+	(124.41, 50.80) --
+	(125.24, 50.73) --
+	(126.07, 50.66) --
+	(126.89, 50.60) --
+	(127.72, 50.54) --
+	(128.55, 50.48) --
+	(129.37, 50.42) --
+	(130.20, 50.37) --
+	(131.02, 50.32) --
+	(131.85, 50.27) --
+	(132.68, 50.22) --
+	(133.50, 50.18) --
+	(134.33, 50.13) --
+	(135.16, 50.09) --
+	(135.98, 50.05) --
+	(136.81, 50.01) --
+	(137.64, 49.98) --
+	(138.46, 49.94) --
+	(139.29, 49.91) --
+	(140.12, 49.88) --
+	(140.94, 49.85) --
+	(141.77, 49.82) --
+	(142.60, 49.79) --
+	(143.42, 49.77) --
+	(144.25, 49.74) --
+	(145.08, 49.72) --
+	(145.90, 49.70) --
+	(146.73, 49.67) --
+	(147.55, 49.65) --
+	(148.38, 49.63) --
+	(149.21, 49.61) --
+	(150.03, 49.60) --
+	(150.86, 49.58) --
+	(151.69, 49.56) --
+	(152.51, 49.55) --
+	(153.34, 49.53) --
+	(154.17, 49.52) --
+	(154.99, 49.50) --
+	(155.82, 49.49) --
+	(156.65, 49.48) --
+	(157.47, 49.46) --
+	(158.30, 49.45) --
+	(159.13, 49.44) --
+	(159.95, 49.43) --
+	(160.78, 49.42) --
+	(161.61, 49.41) --
+	(162.43, 49.40) --
+	(163.26, 49.39) --
+	(164.09, 49.38) --
+	(164.91, 49.38) --
+	(165.74, 49.37) --
+	(166.56, 49.36) --
+	(167.39, 49.35) --
+	(168.22, 49.35) --
+	(169.04, 49.34) --
+	(169.87, 49.33) --
+	(170.70, 49.33) --
+	(171.52, 49.32) --
+	(172.35, 49.32) --
+	(173.18, 49.31) --
+	(174.00, 49.31) --
+	(174.83, 49.30) --
+	(175.66, 49.30) --
+	(176.48, 49.29) --
+	(177.31, 49.29) --
+	(178.14, 49.29) --
+	(178.96, 49.28) --
+	(179.79, 49.28) --
+	(180.62, 49.27) --
+	(181.44, 49.27) --
+	(182.27, 49.27) --
+	(183.09, 49.26) --
+	(183.92, 49.26) --
+	(184.75, 49.26) --
+	(185.57, 49.26) --
+	(186.40, 49.25) --
+	(187.23, 49.25) --
+	(188.05, 49.25) --
+	(188.88, 49.25) --
+	(189.71, 49.25) --
+	(190.53, 49.24) --
+	(191.36, 49.24) --
+	(192.19, 49.24) --
+	(193.01, 49.24) --
+	(193.84, 49.24) --
+	(194.67, 49.23) --
+	(195.49, 49.23) --
+	(196.32, 49.23) --
+	(197.15, 49.23) --
+	(197.97, 49.23) --
+	(198.80, 49.23) --
+	(199.63, 49.23) --
+	(200.45, 49.23) --
+	(201.28, 49.22) --
+	(202.10, 49.22) --
+	(202.93, 49.22) --
+	(203.76, 49.22) --
+	(204.58, 49.22) --
+	(205.41, 49.22) --
+	(206.24, 49.22) --
+	(207.06, 49.22) --
+	(207.89, 49.22) --
+	(208.72, 49.22) --
+	(209.54, 49.22) --
+	(210.37, 49.21) --
+	(211.20, 49.21) --
+	(212.02, 49.21) --
+	(212.85, 49.21) --
+	(213.68, 49.21) --
+	(214.50, 49.21) --
+	(215.33, 49.21) --
+	(216.16, 49.21) --
+	(216.98, 49.21) --
+	(217.81, 49.21) --
+	(218.63, 49.21) --
+	(219.46, 49.21) --
+	(220.29, 49.21) --
+	(221.11, 49.21) --
+	(221.94, 49.21) --
+	(222.77, 49.21) --
+	(223.59, 49.21) --
+	(224.42, 49.21) --
+	(225.25, 49.21) --
+	(226.07, 49.21) --
+	(226.90, 49.21) --
+	(227.73, 49.21) --
+	(228.55, 49.21) --
+	(229.38, 49.21) --
+	(230.21, 49.20) --
+	(231.03, 49.20) --
+	(231.86, 49.20) --
+	(232.69, 49.20) --
+	(233.51, 49.20) --
+	(234.34, 49.20) --
+	(235.17, 49.20) --
+	(235.99, 49.20) --
+	(236.82, 49.20) --
+	(237.64, 49.20) --
+	(238.47, 49.20) --
+	(239.30, 49.20) --
+	(240.12, 49.20) --
+	(240.95, 49.20) --
+	(241.78, 49.20) --
+	(242.60, 49.20) --
+	(243.43, 49.20) --
+	(244.26, 49.20) --
+	(245.08, 49.20) --
+	(245.91, 49.20) --
+	(246.74, 49.20) --
+	(247.56, 49.20) --
+	(248.39, 49.20) --
+	(249.22, 49.20) --
+	(250.04, 49.20) --
+	(250.87, 49.20) --
+	(251.70, 49.20) --
+	(252.52, 49.20) --
+	(253.35, 49.20) --
+	(254.17, 49.20) --
+	(255.00, 49.20) --
+	(255.83, 49.20) --
+	(256.65, 49.20) --
+	(257.48, 49.20) --
+	(258.31, 49.20) --
+	(259.13, 49.20) --
+	(259.96, 49.20) --
+	(260.79, 49.20) --
+	(261.61, 49.20) --
+	(262.44, 49.20) --
+	(263.27, 49.20) --
+	(264.09, 49.20) --
+	(264.92, 49.20) --
+	(265.75, 49.20) --
+	(266.57, 49.20) --
+	(267.40, 49.20) --
+	(268.23, 49.20) --
+	(269.05, 49.20) --
+	(269.88, 49.20) --
+	(270.71, 49.20) --
+	(271.53, 49.20) --
+	(272.36, 49.20) --
+	(273.18, 49.20) --
+	(274.01, 49.20) --
+	(274.84, 49.20) --
+	(275.66, 49.20) --
+	(276.49, 49.20) --
+	(277.32, 49.20) --
+	(278.14, 49.20) --
+	(278.97, 49.20) --
+	(279.80, 49.20) --
+	(280.62, 49.20) --
+	(281.45, 49.20) --
+	(282.28, 49.20) --
+	(283.10, 49.20) --
+	(283.93, 49.20) --
+	(284.76, 49.20) --
+	(285.58, 49.20) --
+	(286.41, 49.20) --
+	(287.24, 49.20) --
+	(288.06, 49.20) --
+	(288.89, 49.20) --
+	(289.71, 49.20) --
+	(290.54, 49.20) --
+	(291.37, 49.20) --
+	(292.19, 49.20) --
+	(293.02, 49.20) --
+	(293.85, 49.20) --
+	(294.67, 49.20) --
+	(295.50, 49.20) --
+	(296.33, 49.20) --
+	(297.15, 49.20) --
+	(297.98, 49.20) --
+	(298.81, 49.20) --
+	(299.63, 49.20) --
+	(300.46, 49.20) --
+	(301.29, 49.20) --
+	(302.11, 49.20) --
+	(302.94, 49.20) --
+	(303.77, 49.20) --
+	(304.59, 49.20) --
+	(305.42, 49.20) --
+	(306.25, 49.20) --
+	(307.07, 49.20) --
+	(307.90, 49.20) --
+	(308.72, 49.20) --
+	(309.55, 49.20) --
+	(310.38, 49.20) --
+	(311.20, 49.20) --
+	(312.03, 49.20) --
+	(312.86, 49.20) --
+	(313.68, 49.20) --
+	(314.51, 49.20) --
+	(315.34, 49.20) --
+	(316.16, 49.20) --
+	(316.99, 49.20) --
+	(317.82, 49.20) --
+	(318.64, 49.20) --
+	(319.47, 49.20) --
+	(320.30, 49.20) --
+	(321.12, 49.20) --
+	(321.95, 49.20) --
+	(322.78, 49.20) --
+	(323.60, 49.20) --
+	(324.43, 49.20) --
+	(325.21, 49.20);
+\end{scope}
+\end{tikzpicture}
+
+\end{document}
diff --git a/doc/tutorials/GeneralNotes.pdf b/doc/tutorials/GeneralNotes.pdf
new file mode 100644
index 0000000..3969938
Binary files /dev/null and b/doc/tutorials/GeneralNotes.pdf differ
diff --git a/doc/tutorials/GeneralNotes.tex b/doc/tutorials/GeneralNotes.tex
new file mode 100644
index 0000000..93d9a2d
--- /dev/null
+++ b/doc/tutorials/GeneralNotes.tex
@@ -0,0 +1,112 @@
+\documentclass[11pt]{article}
+\begin{document}
+\title{Notes Assisting BEAST Tutorials}
+\date{}
+\author{}
+\maketitle
+
+This notes have some extra details about aspects of some of the programs.
+
+\subsection*{Guess Dates}
+
+This operation attempts to guess what the dates are from information contained within the taxon names. It works by trying to
+find a numerical field within each name. If the taxon names contain more than one numerical field (such as the RSVA
+sequences in the MEP tutorial) then you can specify how to find the one that corresponds to the date of sampling. You can either
+specify the order that the date field comes (e.g., first, last or various positions in between) or specify a prefix (some
+characters that come immediately before the date field in each name). For the RSVA sequences you can select `last' from
+the drop-down menu for the order or use the prefix option and specify `\_' (underscore) as the prefix.
+
+In this dialog box, you can also get BEAUti to add a fixed value to each guessed date. In this case the value ``1900'' has
+been added to turn the dates from 2 digit years to 4 digit. Any dates in the taxon names given as ``00'' would thus become
+``1900''. Some of the sequences in the example file actually have dates after the year 2000 so selecting the will option would
+convert them correctly, adding 2000 to any date less than 09. When you press OK the dates will appear in the appropriate
+column of the main window. You can then check these and edit them manually as required. At the top of the window you
+can set the units that the dates are given in (years, months, days) and whether they are specified relative to a point in the
+past (as would be the case for years such as 1984) or backwards in time from the present (as in the case of radiocarbon
+ages).
+
+\if0 TODO: update to BEAUti 2
+\subsection*{Operators}
+Each parameter in the model has one or more ``operators'' (these are variously called moves and proposals by other MCMC
+software packages such as MrBayes and LAMARC). The operators specify how the parameters change as the MCMC runs.
+The operators tab in BEAUti has a table that lists the parameters, their operators and the tuning settings for these operators.
+In the first column are the parameter names. These will be called things like \texttt{kappa} which means the HKY model's
+kappa parameter (the transition-transversion bias). The next column has the type of operators that are acting on each
+parameter. For example, the scale operator scales the parameter up or down by a proportion, the random walk operator
+adds or subtracts an amount to the parameter and the uniform operator simply picks a new value uniformly within a range.
+Some parameters relate to the tree or to the divergence times of the nodes of the tree and these have special operators.
+
+The next column, labelled {\bf Tuning}, gives a tuning setting to the operator. Some operators don't have any tuning settings so
+have {\bf n/a} under this column. The tuning parameter will determine how large a move each operator will make which will affect
+how often that change is accepted by the MCMC which will affect the efficency of the analysis. For most operators (like
+random walk and subtree slide operators) a larger tuning parameter means larger moves. However for the scale operator a
+tuning parameter value closer to 0.0 means bigger moves. At the top of the window is an option called {\bf Auto Optimize}
+which, when selected, will automatically adjust the tuning setting as the MCMC runs to try to achieve maximum efficiency. At
+the end of the run a table of the operators, their performance and the final values of these tuning settings will be written to
+standard output. These can then be used to set the starting tuning settings in order to minimize the amount of time taken to
+reach optimum performance in subsequent runs.
+
+The next column, labelled {\bf Weight}, specifies how often each operator is applied relative to the others. Some parameters
+tend to be sampled very efficiently - an example is the kappa parameter - these parameters can have their operators downweighted
+so that they are not changed as often (this may mean weighting other operators up since the weights must be
+integers).
+\fi
+
+\subsection*{Tracer statistics}
+
+The statistics reported in Tracer for each logged quantity are:
+
+\begin{itemize}
+\item Mean - The mean value of the samples (excluding the burn-in).
+\item Stdev - The standard error of the mean. This takes into account the effective sample size so a small ESS will give a large
+standard error.
+\item Median - The median value of the samples (excluding the burn-in).
+95\% HPD Lower - The lower bound of the highest posterior density (HPD) interval. The HPD is the shortest interval that
+contains 95\% of the sampled values.
+\item 95\% HPD Upper - The upper bound of the highest posterior density (HPD) interval.
+\item Auto-Correlation Time (ACT) - The average number of states in the MCMC chain that two samples have to be separated
+by for them to be uncorrelated (i.e. independent samples from the posterior). The ACT is estimated from the samples in the
+trace (excluding the burn-in).
+\item Effective Sample Size (ESS) - The effective sample size (ESS) is the number of independent samples that the trace is
+equivalent to. This is calculated as the chain length (excluding the burn-in) divided by the ACT.
+\end{itemize}
+
+\subsection*{TreeAnnotator}
+
+The sampled trees in BEAST are written to a separate file called the `trees' file. This file is a
+standard NEXUS format file. As such it can easily be loaded into other software in order to examine the trees it contains. One
+possibility is to load the trees into a program such as PAUP* and construct a consensus tree in a similar manner to
+summarizing a set of bootstrap trees. In this case, the support values reported for the resolved nodes in the consensus tree
+will be the posterior probability of those clades.
+
+TreeAnnotator is a software program distributed with BEAST that can summarize the tree file. 
+It takes a single `target' tree and annotates it with the summarized information from the entire sample of trees.
+The summarized information includes the average node ages (along with the HPD intervals), the posterior support and the
+average rate of evolution on each branch (for models where this can vary). The program calculates these values for each
+node or clade observed in the specified `target' tree. The options in TreeAnnotator are detailed below:
+
+\begin{itemize}
+\item {\bf Burnin} - This is the number of trees in the input file that should be excluded from the summarization. This value is given
+as the number of trees rather than the number of steps in the MCMC chain. Thus for the example above, with a chain of
+1,000,000 steps, sampling every 1000 steps, there are 1000 trees in the file. To obtain a 10\% burnin, set this value to
+100.
+\item {\bf Posterior probability limit} - This is the minimum posterior probability for a node in order for TreeAnnotator to store the
+annoted information. The default is 0.5 so only nodes with this posterior probability or greater will have information
+summarized (the equivalent to the nodes in a majority-rule consensus tree). Set this value to 0.0 to summarize all nodes in
+the target tree.
+\item {\bf Target tree type} - This has two options ``Maximum clade credibility'' or ``User target tree''. For the latter option, a
+NEXUS tree file can be specified as the Target Tree File, below. For the former option, TreeAnnotator will examine every
+tree in the Input Tree File and select the tree that has the highest sum of the posterior probabilities of all its nodes.
+\item {\bf Node heights} - This option specifies what node heights (times) should be used for the output tree. If the ``Keep target
+heights'' is selected, then the node heights will be the same as the target tree. The other two options give node heights
+as an average (Mean or Median) over the sample of trees.
+\item {\bf Target Tree File} - If the ``User target tree'' option is selected then you can use ``Choose File...'' to select a NEXUS file
+containing the target tree.
+\item I{\bf nput Tree File} - Use the ``Choose File...'' button to select an input trees file. This will be the trees file produced by
+BEAST.
+\item {\bf Output File} - Select a name for the output tree file.
+\end{itemize}
+
+Once you have selected all the options, above, press the ``Run'' button. 
+
+\end{document}
diff --git a/doc/tutorials/MEPs/MEPs.bib b/doc/tutorials/MEPs/MEPs.bib
new file mode 100644
index 0000000..d724cfb
--- /dev/null
+++ b/doc/tutorials/MEPs/MEPs.bib
@@ -0,0 +1,38 @@
+ at article{Zlateva:2004uq,
+	Abstract = {Human respiratory syncytial virus (HRSV) is the most common etiological agent of acute lower respiratory tract disease in infants and can cause repeated infections throughout life. In this study, we have analyzed nucleotide sequences encompassing 629 bp at the carboxy terminus of the G glycoprotein gene for HRSV subgroup A strains isolated over 47 years, including 112 Belgian strains isolated over 19 consecutive years (1984 to 2002). By using a maximum likelihood method, we  [...]
+	Author = {Zlateva, Kalina T and Lemey, Philippe and Vandamme, Anne-Mieke and Van Ranst, Marc},
+	Date-Added = {2012-08-12 16:33:26 +1200},
+	Date-Modified = {2012-08-12 16:33:26 +1200},
+	Journal = {J Virol},
+	Journal-Full = {Journal of virology},
+	Mesh = {Belgium; Child, Preschool; Evolution, Molecular; Humans; Infant; Infant, Newborn; Molecular Sequence Data; Phylogeny; Respiratory Syncytial Virus Infections; Respiratory Syncytial Virus, Human; Selection, Genetic; Sequence Analysis, DNA; Viral Proteins},
+	Month = {May},
+	Number = {9},
+	Pages = {4675-83},
+	Pmc = {PMC387670},
+	Pmid = {15078950},
+	Pst = {ppublish},
+	Title = {Molecular evolution and circulation patterns of human respiratory syncytial virus subgroup a: positively selected sites in the attachment g glycoprotein},
+	Volume = {78},
+	Year = {2004}}
+
+ at article{Zlateva:2005qy,
+	Abstract = {Human respiratory syncytial virus (HRSV) is the most important cause of acute respiratory disease in infants. Two major subgroups (A and B) have been identified based on antigenic differences in the attachment G protein. Antigenic variation between and within the subgroups may contribute to reinfections with these viruses by evading the host immune responses. To investigate the circulation patterns and mechanisms by which HRSV-B viruses evolve, we analyzed the G protein gene [...]
+	Author = {Zlateva, Kalina T and Lemey, Philippe and Mo{\"e}s, Elien and Vandamme, Anne-Mieke and Van Ranst, Marc},
+	Date-Added = {2012-08-12 16:33:26 +1200},
+	Date-Modified = {2012-08-12 16:33:26 +1200},
+	Doi = {10.1128/JVI.79.14.9157-9167.2005},
+	Journal = {J Virol},
+	Journal-Full = {Journal of virology},
+	Mesh = {Amino Acid Sequence; Evolution, Molecular; Genetic Variation; Glycosylation; Molecular Sequence Data; Phylogeny; Respiratory Syncytial Virus, Human; Viral Envelope Proteins},
+	Month = {Jul},
+	Number = {14},
+	Pages = {9157-67},
+	Pmc = {PMC1168771},
+	Pmid = {15994810},
+	Pst = {ppublish},
+	Title = {Genetic variability and molecular evolution of the human respiratory syncytial virus subgroup B attachment G protein},
+	Volume = {79},
+	Year = {2005},
+	Bdsk-Url-1 = {http://dx.doi.org/10.1128/JVI.79.14.9157-9167.2005}}
+
diff --git a/doc/tutorials/MEPs/MEPs.tex b/doc/tutorials/MEPs/MEPs.tex
new file mode 100644
index 0000000..4f2e858
--- /dev/null
+++ b/doc/tutorials/MEPs/MEPs.tex
@@ -0,0 +1,446 @@
+\documentclass[12pt]{article}
+\usepackage{graphicx}
+\usepackage[left=3cm,top=3cm,right=3cm,bottom=3cm]{geometry}
+\usepackage{hyperref}
+\hypersetup{
+    colorlinks=true,
+    linkcolor=blue,
+    filecolor=magenta,      
+    urlcolor=cyan,
+}
+
+\newcommand{\includeimage}[2][]{%
+%HEVEA\imgsrc{#2.hevea.png}%
+%BEGIN LATEX
+\includegraphics[#1]{#2}
+%END LATEX
+}
+
+% BEAST book specific commands
+\newcommand{\BEASTVersion}{2.2.x}
+\newcommand{\TracerVersion}{1.6}
+\newcommand{\FigTreeVersion}{1.4.2}
+
+\newcommand{\chainLength}{{2,000,000}}
+\newcommand{\logEvery}{{400}}
+\newcommand{\screenEvery}{{10,000}}
+
+\newcommand{\chainLengthLong}{{10,000,000}}
+\newcommand{\logEveryLong}{{2,000}}
+\newcommand{\lowestESS}{{44}}
+
+\begin{document}
+
+\author{Alexei J Drummond, Remco Bouckaert and Walter Xie}
+
+\date{\today{}}
+
+\title{Measurably evolving populations \label{chap.MEP}}
+\maketitle
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%
+%%% EXERCISE - TIME-STAMPED DATA
+%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\section{Time-stamped data}
+
+This tutorial estimates the rate of evolution from a set of virus sequences which have been isolated at different points in time (heterochronous or time-stamped data). The data are 129 sequences from the G (attachment protein) gene of human respiratory
+syncytial virus subgroup A (RSVA) from various parts of the world with isolation dates ranging from 1956-2002 \cite{Zlateva:2004uq,Zlateva:2005qy}.
+RSVA causes infections of the lower respiratory tract causing symptoms that are often indistinguishable from the common cold. By age 3, nearly all children will be infected and a small percentage ($<3\%$) will develop more serious inflammation of the bronchioles requiring hospitalisation.
+
+The aim of this tutorial is to obtain estimates for :
+
+\begin{itemize}
+\item the rate of molecular evolution
+\item the date of the most recent common ancestor
+\item the phylogenetic relationships with measures of statistical support.
+\end{itemize}
+
+The following software will be used in this tutorial:
+
+\begin{itemize}
+\item {\bf BEAST} - this package contains the BEAST program, BEAUti, DensiTree, TreeAnnotator and other utility programs. This tutorial is written for BEAST v{\BEASTVersion}, which has support for multiple partitions. It is available for download from \\* \texttt{http://www.beast2.org}.
+\item {\bf Tracer} - this program is used to explore the output of BEAST (and other Bayesian MCMC programs). It graphically and
+quantitively summarizes the distributions of continuous parameters and provides diagnostic information. At the time of
+writing, the current version is v{\TracerVersion}. It is available for download from \texttt{http://beast.bio.ed.ac.uk/}.
+\item {\bf FigTree} - this is an application for displaying and printing molecular phylogenies, in particular those obtained using
+BEAST. At the time of writing, the current version is v{\FigTreeVersion}. It is available for download from \texttt{http://tree.bio.ed.ac.uk/}.
+\end{itemize}
+
+\subsection*{The NEXUS alignment}
+The data is in a file called \href{https://github.com/CompEvol/beast2/blob/master/examples/nexus/RSV2.nex?raw=true}{RSV2.nex}. You can find it in the {\tt examples/nexus} directory in the directory where BEAST was installed. Or click the link to download the data. After the data is opened in your web browser, right click mouse and save it as \texttt{RSV2.nex}.
+
+This file contains an alignment of 129 sequences from the G gene of RSVA virus, 629 nucleotides in length. Import this alignment into BEAUti. Because this is a protein-coding gene we are going to split the alignment into three partitions representing each of the three codon positions. To do this we will click the {\bf Split} button at the bottom of the {\bf Partitions} panel and then select the ``1 + 2 + 3 frame 3'' from the drop-down menu (Figure \ref{fig:BEAUti_split}). 
+
+\begin{figure}
+\centering	
+\includeimage[width=0.6\textwidth]{figures/BEAUti_split}
+\label{fig:BEAUti_split}
+\caption{Split the alignment}
+\end{figure}
+
+This signifies that the first full codon starts at the third nucleotide in the alignment. This will create three rows in the partitions panel. You will have to re-link the tree and clock models across the three partitions (and name them ``tree'' and ``clock'' respectively) before continuing to the next step. The partition panel should now look something like this:
+
+\begin{figure}
+\centering	
+\includeimage[width=0.8\textwidth]{figures/BEAUti_partition}
+\label{fig:BEAUti_partition}
+\caption{A screenshot of the Partitions tab in BEAUti}
+\end{figure}
+
+\subsection*{Tip dates}
+By default all the taxa are assumed to have a date of zero (i.e. the sequences are assumed to be sampled at the same time).
+In this case, the RSVA sequences have been sampled at various dates going back to the 1950s. The actual year of sampling
+is given in the name of each taxon and we could simply edit the value in the Date column of the table to reflect these.
+However, if the taxa names contain the calibration information, then a convenient way to specify the dates of the sequences
+in BEAUti is to click the checkbox {\bf Use tip dates} and then use the {\bf Guess} button at the top of the {\bf Tip Dates} panel. Clicking this will make a dialog box appear.
+
+\begin{figure}
+\centering	
+\includeimage[width=0.6\textwidth]{figures/BEAUti_GuessDates}
+\label{fig:BEAUti_GuessDates}
+\caption{Guess dates dialog}
+\end{figure}
+
+
+Select the option to {\it use everything}, choose ``after last'' from from drop-down box and type`s' into the corresponding text box. This will extract the trailing numbers from the taxon names after the last little 's', which are interpreted as the year (in this case since 1900) that the sample was isolated.
+
+%For more information about the {\bf Guess Dates} facility see the Notes.
+The dates panel should now look something like this:
+
+\begin{figure}
+\centering	
+\includeimage[width=0.8\textwidth]{figures/BEAUti_dates}
+\label{fig:BEAUti_dates}
+\caption{Dates panel}
+\end{figure}
+
+
+\subsection*{Setting the substitution model}
+We will use the HKY model with empirical base frequencies for all three partitions. To do this first link the site partitions and then choose HKY and Empirical from the Subst Model and Frequencies drop-boxes. Also check the estimate box for the Mutation Rate,which will finally trigger to check the ``Fix mean mutation rate'' box. 
+
+\begin{figure}
+\centering	
+\includeimage[width=0.8\textwidth]{figures/BEAUti_Site_Model}
+\label{fig:BEAUti_Site_Model}
+\caption{Site model}
+\end{figure}
+
+Then, hold `shift' key to select all site models on the left side, and click \textbf{OK} to clone the setting from defined site model (Figure \ref{fig:cloneFrom}). Go through each site model, as you can see, their configurations are same now. 
+
+\begin{figure}
+\centering	
+\includeimage[width=0.8\textwidth]{figures/cloneFrom}
+\caption{Clone configuration from one site model to others.}
+\label{fig:cloneFrom}
+\end{figure}
+
+
+\subsubsection{Priors }
+
+To set up the priors, select the ``Priors'' tab.
+Choose ``Coalescent Constant Population'' for the tree prior. Set the prior on the clockRate parameter to a log-normal with $M=-5$ and $S=1.25$. 
+
+\begin{figure}
+\centering	
+\includeimage[width=0.8\textwidth]{figures/BEAUti_priors}
+\label{fig:BEAUti_priors}
+\caption{Priors}
+\end{figure}
+
+
+\subsection{Setting the MCMC options}
+
+For this dataset let's initially set the chain length to \underline{\chainLength{}} as this will run 
+reasonably quickly on most modern computers. Set the sampling frequencies for the screen to
+to \underline{\screenEvery{}}, the trace log file to \underline{\logEvery{}} and the trees file to \underline{\logEvery{}}.
+
+\begin{figure}
+\centering	
+\includeimage[width=0.8\textwidth]{figures/BEAUti_mcmc}
+\label{fig:BEAUti_mcmc}
+\caption{MCMC options}
+\end{figure}
+
+
+\subsection*{Running BEAST}
+
+Save the BEAST file (e.g. \texttt{RSV2.xml}) and run it in BEAST.
+
+\begin{figure}
+\centering	
+\includeimage[width=0.7\textwidth]{figures/BEAST}
+\caption{A screenshot of BEAST.}
+\label{fig:BEAST}
+\end{figure}
+
+Now run BEAST and when it asks for an input file, provide your newly
+created XML file as input. BEAST will then run until it has finished
+reporting information to the screen. The actual results files are
+save to the disk in the same location as your input file. The output to the screen will
+look something like this: 
+
+{\tiny   
+\begin{verbatim}
+
+             BEAST v2.2.0, 2002-2014
+       Bayesian Evolutionary Analysis Sampling Trees
+                 Designed and developed by
+Remco Bouckaert, Alexei J. Drummond, Andrew Rambaut and Marc A. Suchard
+                              
+               Department of Computer Science
+                   University of Auckland
+                  remco at cs.auckland.ac.nz
+                  alexei at cs.auckland.ac.nz
+                              
+             Institute of Evolutionary Biology
+                  University of Edinburgh
+                     a.rambaut at ed.ac.uk
+                              
+              David Geffen School of Medicine
+           University of California, Los Angeles
+                     msuchard at ucla.edu
+                              
+                Downloads, Help & Resources:
+                    	http://beast2.org/
+                              
+Source code distributed under the GNU Lesser General Public License:
+             	http://github.com/CompEvol/beast2
+                              
+                     BEAST developers:
+	Alex Alekseyenko, Trevor Bedford, Erik Bloomquist, Joseph Heled, 
+	Sebastian Hoehna, Denise Kuehnert, Philippe Lemey, Wai Lok Sibon Li, 
+	Gerton Lunter, Sidney Markowitz, Vladimir Minin, Michael Defoin Platel, 
+          	Oliver Pybus, Chieh-Hsi Wu, Walter Xie
+                              
+                         Thanks to:
+    	Roald Forsberg, Beth Shapiro and Korbinian Strimmer
+
+... ...
+
+        1999000     -6131.9540        80.2        -5496.4810      -635.4730 2m3s/Msamples
+        2000000     -6142.7389        80.7        -5506.2818      -636.4570 2m3s/Msamples
+
+Operator                                                Tuning    #accept    #reject      Pr(m)  Pr(acc|m)
+ScaleOperator(treeScaler.t:tree)                        0.7224        546      71568     0.0360     0.0076 Try setting scaleFactor to about 0.85
+ScaleOperator(treeRootScaler.t:tree)                    0.6019       5076      66818     0.0360     0.0706 Try setting scaleFactor to about 0.776
+Uniform(UniformOperator.t:tree)                              -     387274     334094     0.3601     0.5369 
+SubtreeSlide(SubtreeSlide.t:tree)                       3.9556      57963     302626     0.1801     0.1607 
+Exchange(narrow.t:tree)                                      -      88179     271422     0.1801     0.2452 
+Exchange(wide.t:tree)                                        -        153      71541     0.0360     0.0021 
+WilsonBalding(WilsonBalding.t:tree)                          -        365      71560     0.0360     0.0051 
+ScaleOperator(StrictClockRateScaler.c:clock)            0.7869      17571      54573     0.0360     0.2436 
+UpDownOperator(strictClockUpDownOperator.c:clock)       0.7594        673      70876     0.0360     0.0094 Try setting scaleFactor to about 0.871
+ScaleOperator(KappaScaler.s:RSV2_1)                     0.4069        581       1743     0.0012     0.2500 
+DeltaExchangeOperator(FixMeanMutationRatesOperator)     0.3833       8247      39773     0.0240     0.1717 
+ScaleOperator(KappaScaler.s:RSV2_2)                     0.4276        583       1790     0.0012     0.2457 
+ScaleOperator(KappaScaler.s:RSV2_3)                     0.4421        589       1774     0.0012     0.2493 
+ScaleOperator(PopSizeScaler.t:tree)                     0.5907      18802      53241     0.0360     0.2610 
+
+     Tuning: The value of the operator's tuning parameter, or '-' if the operator can't be optimized.
+    #accept: The total number of times a proposal by this operator has been accepted.
+    #reject: The total number of timEnd likelihood: -6142.738945357851
+es a proposal by this operator has been rejected.
+      Pr(m): The probability this operator is chosen in a step of the MCMC (i.e. the normalized weight).
+  Pr(acc|m): The acceptance probability (#accept as a fraction of the total proposals for this operator).
+
+
+Total calculation time: 249.968 seconds
+\end{verbatim}}
+
+
+\subsection*{Analysing the BEAST output}
+
+Note that the effective sample sizes (ESSs) for many of the logged quantities are small (ESSs less than 100 will be highlighted in red by Tracer).
+This is not good. A low ESS means that the trace contains a lot of correlated samples and thus may not represent the
+posterior distribution well. In the bottom right of the window is a frequency plot of the samples which is expected given the
+low ESSs is extremely rough.
+
+If we select the tab on the right-hand-side labelled `Trace' we can view the raw trace, that is, the sampled values against the step in the MCMC chain.
+
+\begin{figure}
+\centering	
+\includeimage[width=0.8\textwidth]{figures/Tracer1}
+\label{fig:Tracer1}
+\caption{A screenshot of Tracer.}
+\end{figure}
+
+Here you can see how the samples are correlated. There are 5000 samples in the trace (we ran the MCMC for \underline{\chainLength{}}
+steps sampling every \underline{\logEvery{}}) but adjacent samples often tend to have similar values. The ESS for the absolute rate of evolution (clockRate) is about 62 so we are only getting 1 independent sample to every $81=5000/62$ actual samples). With a short run such as this one, it may also be the case that the default burn-in of 10\% of the chain length is inadequate. Not excluding enough of the start of the chain as burn-in will render estimates of ESS unreliable.
+
+The simple response to this situation is that we need to run the chain for longer. Given the lowest ESS (for the constant coalescent) is \lowestESS{}, it
+would suggest that we have to run the chain for at least 5 times the length to get reasonable ESSs that are $>$200. 
+%However it would be better to aim higher 
+So let's go for a chain length of \underline{\chainLengthLong{}} and log every \underline{\logEveryLong{}}. Go back to the {\bf MCMC} options section in BEAUti, and create a new BEAST XML file with a longer chain length. Now run BEAST and load the new log file into Tracer (you can leave the old one loaded
+for comparison). 
+
+Click on the Trace tab and look at the raw trace plot.
+
+\begin{figure}
+\centering	
+\includeimage[width=0.8\textwidth]{figures/Tracer2}
+\label{fig:Tracer2}
+\end{figure}
+
+Again we have chosen options that produce 5000 samples and with an ESS of about 342 there is still auto-correlation
+between the samples but $>$340 effectively independent samples will now provide a very good estimate of the posterior distribution.
+There are no obvious trends in the plot which would suggest that the MCMC has not yet converged, and there are no significant long range 
+fluctuations in the trace which would suggest poor mixing.
+
+As we are satisfied with the mixing we can now move on to one of the parameters of interest:
+substitution rate. Select \texttt{clockRate} in the left-hand table. This is the average substitution rate across all sites in the
+alignment. Now choose the density plot by selecting the tab labeled {\it Marginal Density}. This shows a plot of the marginal posterior probability
+density of this parameter. You should see a plot similar to this:
+
+\begin{figure}
+\centering	
+\includeimage[width=0.8\textwidth]{figures/Tracer_density}
+\label{fig:Tracer_density}
+\end{figure}
+
+As you can see the posterior probability density is roughly bell-shaped. There is some sampling noise which would be
+reduced if we ran the chain for longer or sampled more often but we already have a good estimate of the mean and HPD interval. You can overlay
+the density plots of multiple traces in order to compare them (it is up to the user to determine whether they are comparable on the the same axis or not). Select the relative substitution rates for all three codon positions in the table to the left (labelled
+\texttt{mutationRate.1}, \texttt{mutationRate.2} and \texttt{mutationRate.3}). You will now see the posterior probability densities for the relative
+substitution rate at all three codon positions overlaid:
+
+\begin{figure}
+\centering	
+\includeimage[width=0.8\textwidth]{figures/Tracer_relativeRates}
+\label{fig:Tracer_relativeRates}
+\caption{The posterior probability densities for the relative substitution rates}
+\end{figure}
+
+\subsection*{Summarizing the trees}
+
+Use the program TreeAnnotator to summarize the tree and view the results in Figtree (Figure \ref{fig:RSV2tree}).
+
+\begin{figure}
+\centering	
+\includeimage[width=\textwidth]{figures/RSV2_mcc_tree}
+\caption{The Maximum clade credibility tree for the G gene of 129 RSVA-2 viral samples. }
+\label{fig:RSV2tree}
+\end{figure}
+
+\begin{figure}
+\centering	
+\includeimage[width=\textwidth]{figures/DensiTree}
+\label{fig:DensiTree}
+\end{figure}
+
+DensiTree with clade height bars for clades with over 50\% support.
+Root canal tree represents maximum clade credibility tree.
+
+
+\subsection*{Questions}
+
+\textit{In what year did the common ancestor of all RSVA viruses sampled live? What is the
+95\% HPD?}
+
+%\framebox(420,60){}
+
+
+\subsection*{Bonus section: Bayesian Skyline plot}
+
+We can reconstruct the population history using the Bayesian Skyline plot. In order to do so,
+load the XML file into BEAUti, select the priors-tab and change the tree prior from 
+coalescent with constant population size to coalescent with Bayesian skyline.
+Note that an extra item is added to the priors called `Markov chained population sizes'
+which is a prior that ensures dependence between population sizes.
+
+\begin{figure}
+\centering	
+\includeimage[width=0.8\textwidth]{figures/BEAUti_priors2}
+\label{fig:BEAUti_priors2}
+\caption{Priors}
+\end{figure}
+
+By default the number of groups used in the skyline analysis is set to 5, To change this,
+select menu View/Show Initialization panel and a list of parameters is shown. Select
+{\tt bPopSizes.t:tree} and change the dimension to 3. Likewise, selection {\tt bGroupSizes.t:tree}
+and change its dimension to 3. The dimensions of the two parameters should be the same.
+More groups mean more population changes can be detected, but it also means more parameters
+need to be estimated and the chain runs longer. The extended Bayesian skyline plot
+automatically detects the number of changes, so it could be used as an alternative
+tree prior.
+
+\begin{figure}
+\centering	
+\includeimage[width=0.8\textwidth]{figures/BEAUti_init}
+\label{fig:BEAUti_init}
+\caption{Initialization panel}
+\end{figure}
+
+
+This analysis requires a bit longer to converge, so change the MCMC chain length to 10 million,
+and the log intervals for the trace-log and tree-log to 10 thousand. 
+Then, save the file and run BEAST.
+
+
+To plot the population history, load the log file in tracer and select the menu 
+Analysis/Bayesian Skyline Reconstruction.
+
+\begin{figure}
+\centering	
+\includeimage[scale=0.3,clip=true,trim=0 300 0 0]{figures/tracerBSP1}
+\label{fig:tracerBSP1}
+\caption{Bayesian Skyline Reconstruction}
+\end{figure}
+
+A dialog is shown where you can specify the tree file associated with the log file.
+Also, since the youngest sample is from 2002, change the entry for age of youngest
+tip to 2002.
+
+\begin{figure}
+\centering	
+\includeimage[width=0.5\textwidth]{figures/tracerBSP2}
+\label{fig:tracerBSP2}
+\end{figure}
+
+After some calculation, a graph appears showing population history where the median
+and 95\% HPD intervals are plotted. After selecting the `solid interval' checkbox, the
+graph should look something like this.
+
+\begin{figure}[h]
+\centering	
+\includeimage[width=0.5\textwidth]{figures/tracerBSP3}
+\label{fig:tracerBSP3}
+\end{figure}
+
+
+\subsection*{Questions}
+%\vspace{5 mm}
+\begin{enumerate}
+\item \textit{By what amount did the effective population size of RSVA grow from 1970 to 2002 according to the BSP?}
+ 
+%\vspace{5 mm}
+%\framebox(420,30){}
+%\vspace{5 mm}
+
+\item \textit{What are the underlying assumptions of the BSP? Are the violated by this data set?}
+ 
+%\vspace{5 mm}
+%\framebox(420,90){}
+%\vspace{5 mm}
+\end{enumerate}
+
+
+\subsection{Exercise}
+Change the Bayesian skyline prior to extended Bayesian skyline plot (EBSP) prior and run
+till convergence. EBSP produces an extra log file, called EBSP.\$(seed).log where \$(seed)
+is replaced by the seed you used to run BEAST.
+A plot can be created by running the EBSPAnalyser utility, and loading the output file
+in a spreadsheet.
+
+How many groups are indicated by the EBSP analysis?
+This is much lower than for BSP. How does this affect the population history plots?
+
+\bibliographystyle{amsplain} 
+\bibliography{MEPs}
+
+\end{document}
+
diff --git a/doc/tutorials/MEPs/MEPsv2.0.2.pdf b/doc/tutorials/MEPs/MEPsv2.0.2.pdf
new file mode 100644
index 0000000..39eabbe
Binary files /dev/null and b/doc/tutorials/MEPs/MEPsv2.0.2.pdf differ
diff --git a/doc/tutorials/MEPs/MEPsv2.2.0.pdf b/doc/tutorials/MEPs/MEPsv2.2.0.pdf
new file mode 100644
index 0000000..887c902
Binary files /dev/null and b/doc/tutorials/MEPs/MEPsv2.2.0.pdf differ
diff --git a/doc/tutorials/MEPs/figures/BEAST.png b/doc/tutorials/MEPs/figures/BEAST.png
new file mode 100644
index 0000000..2bfa65f
Binary files /dev/null and b/doc/tutorials/MEPs/figures/BEAST.png differ
diff --git a/doc/tutorials/MEPs/figures/BEAUti_GuessDates.png b/doc/tutorials/MEPs/figures/BEAUti_GuessDates.png
new file mode 100644
index 0000000..d83bfa1
Binary files /dev/null and b/doc/tutorials/MEPs/figures/BEAUti_GuessDates.png differ
diff --git a/doc/tutorials/MEPs/figures/BEAUti_Site_Model.png b/doc/tutorials/MEPs/figures/BEAUti_Site_Model.png
new file mode 100644
index 0000000..72b8895
Binary files /dev/null and b/doc/tutorials/MEPs/figures/BEAUti_Site_Model.png differ
diff --git a/doc/tutorials/MEPs/figures/BEAUti_dates.png b/doc/tutorials/MEPs/figures/BEAUti_dates.png
new file mode 100644
index 0000000..343236a
Binary files /dev/null and b/doc/tutorials/MEPs/figures/BEAUti_dates.png differ
diff --git a/doc/tutorials/MEPs/figures/BEAUti_init.png b/doc/tutorials/MEPs/figures/BEAUti_init.png
new file mode 100644
index 0000000..cb14fc7
Binary files /dev/null and b/doc/tutorials/MEPs/figures/BEAUti_init.png differ
diff --git a/doc/tutorials/MEPs/figures/BEAUti_mcmc.png b/doc/tutorials/MEPs/figures/BEAUti_mcmc.png
new file mode 100644
index 0000000..70da0bc
Binary files /dev/null and b/doc/tutorials/MEPs/figures/BEAUti_mcmc.png differ
diff --git a/doc/tutorials/MEPs/figures/BEAUti_mcmc_long.png b/doc/tutorials/MEPs/figures/BEAUti_mcmc_long.png
new file mode 100644
index 0000000..32f8514
Binary files /dev/null and b/doc/tutorials/MEPs/figures/BEAUti_mcmc_long.png differ
diff --git a/doc/tutorials/MEPs/figures/BEAUti_partition.png b/doc/tutorials/MEPs/figures/BEAUti_partition.png
new file mode 100644
index 0000000..31e9fdc
Binary files /dev/null and b/doc/tutorials/MEPs/figures/BEAUti_partition.png differ
diff --git a/doc/tutorials/MEPs/figures/BEAUti_priors.png b/doc/tutorials/MEPs/figures/BEAUti_priors.png
new file mode 100644
index 0000000..3df123b
Binary files /dev/null and b/doc/tutorials/MEPs/figures/BEAUti_priors.png differ
diff --git a/doc/tutorials/MEPs/figures/BEAUti_priors2.png b/doc/tutorials/MEPs/figures/BEAUti_priors2.png
new file mode 100644
index 0000000..77f6284
Binary files /dev/null and b/doc/tutorials/MEPs/figures/BEAUti_priors2.png differ
diff --git a/doc/tutorials/MEPs/figures/BEAUti_split.png b/doc/tutorials/MEPs/figures/BEAUti_split.png
new file mode 100644
index 0000000..f6858a3
Binary files /dev/null and b/doc/tutorials/MEPs/figures/BEAUti_split.png differ
diff --git a/doc/tutorials/MEPs/figures/DensiTree.pdf b/doc/tutorials/MEPs/figures/DensiTree.pdf
new file mode 100644
index 0000000..f5b422b
Binary files /dev/null and b/doc/tutorials/MEPs/figures/DensiTree.pdf differ
diff --git a/doc/tutorials/MEPs/figures/RSV2_mcc_tree.pdf b/doc/tutorials/MEPs/figures/RSV2_mcc_tree.pdf
new file mode 100644
index 0000000..4215c03
Binary files /dev/null and b/doc/tutorials/MEPs/figures/RSV2_mcc_tree.pdf differ
diff --git a/doc/tutorials/MEPs/figures/Tracer1.png b/doc/tutorials/MEPs/figures/Tracer1.png
new file mode 100644
index 0000000..5fb8ff1
Binary files /dev/null and b/doc/tutorials/MEPs/figures/Tracer1.png differ
diff --git a/doc/tutorials/MEPs/figures/Tracer2.png b/doc/tutorials/MEPs/figures/Tracer2.png
new file mode 100644
index 0000000..a1c1fe2
Binary files /dev/null and b/doc/tutorials/MEPs/figures/Tracer2.png differ
diff --git a/doc/tutorials/MEPs/figures/Tracer_density.png b/doc/tutorials/MEPs/figures/Tracer_density.png
new file mode 100644
index 0000000..60326dc
Binary files /dev/null and b/doc/tutorials/MEPs/figures/Tracer_density.png differ
diff --git a/doc/tutorials/MEPs/figures/Tracer_relativeRates.png b/doc/tutorials/MEPs/figures/Tracer_relativeRates.png
new file mode 100644
index 0000000..a348ff0
Binary files /dev/null and b/doc/tutorials/MEPs/figures/Tracer_relativeRates.png differ
diff --git a/doc/tutorials/MEPs/figures/cloneFrom.png b/doc/tutorials/MEPs/figures/cloneFrom.png
new file mode 100644
index 0000000..a46ed0d
Binary files /dev/null and b/doc/tutorials/MEPs/figures/cloneFrom.png differ
diff --git a/doc/tutorials/MEPs/figures/tracerBSP1.png b/doc/tutorials/MEPs/figures/tracerBSP1.png
new file mode 100644
index 0000000..df89cf0
Binary files /dev/null and b/doc/tutorials/MEPs/figures/tracerBSP1.png differ
diff --git a/doc/tutorials/MEPs/figures/tracerBSP2.png b/doc/tutorials/MEPs/figures/tracerBSP2.png
new file mode 100644
index 0000000..7e40c57
Binary files /dev/null and b/doc/tutorials/MEPs/figures/tracerBSP2.png differ
diff --git a/doc/tutorials/MEPs/figures/tracerBSP3.png b/doc/tutorials/MEPs/figures/tracerBSP3.png
new file mode 100644
index 0000000..78a4ed0
Binary files /dev/null and b/doc/tutorials/MEPs/figures/tracerBSP3.png differ
diff --git a/doc/tutorials/README.txt b/doc/tutorials/README.txt
new file mode 100644
index 0000000..f094a57
--- /dev/null
+++ b/doc/tutorials/README.txt
@@ -0,0 +1,39 @@
+********* Developer Guide to Generate Tutorials in Html ********
+
+The html version of tutorials are in the group SVN compevol/website/beast2org/tutorials. 
+Please do not check in to the Git. 
+
+To generate html: 
+1) install hevea (Homebrew => Opam => Hevea) and pdflatex; 
+
+2) make the latex version tutorial and figures ready;
+add the following new command to the top of latex:
+\newcommand{\includeimage}[2][]{%
+%HEVEA\imgsrc{#2.hevea.png}%
+%BEGIN LATEX
+\includegraphics[#1]{#2}
+%END LATEX
+}
+
+And replace all \includegraphics into \includeimage, such as 
+\begin{figure}
+\centering	
+\includeimage[width=0.6\textwidth]{figures/BEAUti_GuessDates}
+\label{fig:BEAUti_GuessDates}
+\end{figure}
+ 
+3) convert all figures to png, and add .hevea before .png, such as BEAUti_GuessDates.hevea.png
+
+4) you need to work in the Git tutorial source folder, because the script requires *.tex, *.bib 
+and style file if there is any to generate html, such as doc/tutorials/DivergenceDating;
+
+5) run script tex2html given the latex file name without extensions, 
+such as ../tex2html StarBEAST_tutorial;
+Note: if hevea is installed but not appear, run "eval `opam config env`" in command line.
+
+6) copy html to SVN compevol/website/beast2org/tutorials/DivergenceDating, and check what it looks;
+
+7) if good, then commit to SVN, otherwise edit latex or figures and then repeat 5);
+
+8) copy html or figures to the VM beast2.org to update website.
+  
\ No newline at end of file
diff --git a/doc/tutorials/STACEY/STACEY_tutorial.bib b/doc/tutorials/STACEY/STACEY_tutorial.bib
new file mode 100644
index 0000000..adc0150
--- /dev/null
+++ b/doc/tutorials/STACEY/STACEY_tutorial.bib
@@ -0,0 +1,67 @@
+ at article{Heled:2010fk,
+	Abstract = {Until recently, it has been common practice for a phylogenetic analysis to use a single gene sequence from a single individual organism as a proxy for an entire species. With technological advances, it is now becoming more common to collect data sets containing multiple gene loci and multiple individuals per species. These data sets often reveal the need to directly model intraspecies polymorphism and incomplete lineage sorting in phylogenetic estimation procedures. For a si [...]
+	Author = {Heled, Joseph and Drummond, Alexei J},
+	Date-Added = {2011-09-29 01:20:13 +0000},
+	Date-Modified = {2011-09-29 01:20:13 +0000},
+	Doi = {10.1093/molbev/msp274},
+	Journal = {Mol Biol Evol},
+	Journal-Full = {Molecular biology and evolution},
+	Mesh = {Algorithms; Bayes Theorem; Computer Simulation; Evolution, Molecular; Genes; Models, Genetic; Monte Carlo Method; Phylogeny; Species Specificity},
+	Month = {Mar},
+	Number = {3},
+	Pages = {570-80},
+	Pmc = {PMC2822290},
+	Pmid = {19906793},
+	Pst = {ppublish},
+	Title = {Bayesian inference of species trees from multilocus data},
+	Volume = {27},
+	Year = {2010},
+	Bdsk-Url-1 = {http://dx.doi.org/10.1093/molbev/msp274}}
+
+
+ at inproceedings{hohna2008clock,
+  title={Clock-constrained tree proposal operators in Bayesian phylogenetic inference},
+  author={Hohna, Sebastian and Defoin-Platel, Michael and Drummond, Alexei J},
+  booktitle={BioInformatics and BioEngineering, 2008. BIBE 2008. 8th IEEE International Conference on},
+  pages={1--7},
+  year={2008},
+  organization={IEEE}
+}
+
+ at article{jones2014stacey,
+  title={STACEY: species delimitation and phylogeny estimation under the multispecies coalescent},
+  author={Jones, Graham R},
+  journal={bioRxiv},
+  pages={010199},
+  year={2014},
+  publisher={Cold Spring Harbor Labs Journals}
+}
+
+ at article{jones2014dissect,
+  title={DISSECT: an assignment-free Bayesian discovery method for species delimitation under the multispecies coalescent},
+  author={Jones, Graham and Aydin, Zeynep and Oxelman, Bengt},
+  journal={Bioinformatics},
+  pages={btu770},
+  year={2014},
+  publisher={Oxford Univ Press}
+}
+
+ at article{olave2014upstream,
+  title={Upstream analyses create problems with DNA-based species delimitation},
+  author={Olave, Melisa and Sol{\`a}, Eduard and Knowles, L Lacey},
+  journal={Systematic biology},
+  volume={63},
+  number={2},
+  pages={263--271},
+  year={2014},
+  publisher={Oxford University Press}
+}
+
+ at article{yang2014unguided,
+  title={Unguided species delimitation using DNA sequence data from multiple loci},
+  author={Yang, Ziheng and Rannala, Bruce},
+  journal={Molecular biology and evolution},
+  pages={msu279},
+  year={2014},
+  publisher={SMBE}
+}
diff --git a/doc/tutorials/STACEY/STACEY_tutorial.tex b/doc/tutorials/STACEY/STACEY_tutorial.tex
new file mode 100644
index 0000000..efa793f
--- /dev/null
+++ b/doc/tutorials/STACEY/STACEY_tutorial.tex
@@ -0,0 +1,540 @@
+\documentclass{article}
+\usepackage{url}
+\usepackage{hyperref}
+\hypersetup{
+    colorlinks=true,
+    linkcolor=blue,
+    filecolor=magenta,      
+    urlcolor=cyan,
+}
+\usepackage{graphicx}
+
+\newcommand{\includeimage}[2][]{%
+%HEVEA\imgsrc{#2.hevea.png}%
+%BEGIN LATEX
+\includegraphics[#1]{#2}
+%END LATEX
+}
+
+% BEAST book specific commands
+\newcommand{\BEASTVersion}{2.2.x}
+\newcommand{\STACEYVersion}{1.0.x}
+\newcommand{\TracerVersion}{1.6}
+\newcommand{\FigTreeVersion}{1.4.2}
+
+\newcommand{\chainLength}{{5,000,000}}
+\newcommand{\logEvery}{{5,000}}
+\newcommand{\screenEvery}{{10,000}}
+
+
+\begin{document}
+\title{STACEY: species delimitation with BEAST {\BEASTVersion}}
+
+\author{Graham Jones, www.indriid.com\\
+Created by Walter Xie and Alexei J Drummond}
+
+\maketitle
+
+\section{Introduction}
+
+The BEAST2 package STACEY can be used for species delimitation and species tree estimation, which stands for Species Tree And Classi
cation Estimation, Yarely. It incorporates a new model for the per-branch population parameters which is simpler than the one in *BEAST, but more exible than one with equal populations in every branch. There are also new MCMC operators for the multispecies coalescent model. STACEY incorporates the `birth-death-collapse' model from DISSECT. The models are de [...]
+
+For species delimitation, the main reason for using STACEY instead of DISSECT in BEAST1 is that it converges faster. It may be a good alternative to *BEAST for species tree estimation for the same reason. It may be that the new operator works well with *BEAST (ignoring the rest of STACEY). However STACEY was developed with species delimitation in mind and so far (2014-10-20) has only been tested on species delimitation problems. A couple of reasons for not using STACEY are that it does n [...]
+
+More detials can be found from STACEY documentation available from \texttt{http://www.indriid.com/software.html}.
+
+You will need the following software at your disposal:
+
+\begin{itemize}
+
+\item {\bf BEAST} - this package contains the BEAST program, BEAUti, TreeAnnotator and other utility programs. This tutorial is written for BEAST v{\BEASTVersion}, which has support for multiple partitions. It is available for download from \texttt{http://www.beast2.org}.
+\item {\bf STACEY} - the BEAST2 package, which is installed from the Package Manager in BEAUti. This tutorial is written for STACEY v{\STACEYVersion}.
+\item {\bf Tracer} - this program is used to explore the output of BEAST (and other Bayesian MCMC programs). It graphically and
+quantitively summarizes the distributions of continuous parameters and provides diagnostic information. At the time of
+writing, the current version is v{\TracerVersion}. It is available for download from \texttt{http://beast.bio.ed.ac.uk/}.
+\item {\bf FigTree} - this is an application for displaying and printing molecular phylogenies, in particular those obtained using
+BEAST. At the time of writing, the current version is v{\FigTreeVersion}. It is available for download from \texttt{http://tree.bio.ed.ac.uk/}.
+\end{itemize}
+
+\section{*BEAST}
+
+%This tutorial will guide you through the analysis of 
+
+\subsection*{BEAUti}
+
+Run BEAUti by double clicking on its icon. 
+
+\subsubsection*{Install STACEY package}
+
+STACEY can be installed using the {\bf Package Manager} in BEAUTi. Choose File $\to$ Manage packages to install, upgrade and uninstall packages. It seems necessary to restart BEAUTi before STACEY will work with BEAUTi. 
+
+If you can't see STACEY listed in the Package Manager window, click the \textbf{Package repositories} button (which opens a dialog box) then click the \textbf{Add URL} button. Enter \texttt{http://www.indriid.com/2015/beastpackages.xml}, click \textbf{Done}, and you should see STACEY listed.
+
+\begin{figure}
+\centering
+\includeimage[scale=0.4,clip=true,trim=0 300 200 0]{figures/BEAUti_selectTemplate}
+
+\caption{\label{fig.template} Select a new template in BEAUti.}
+\end{figure}
+
+
+\def\mlstname{*BEAST}
+
+\subsubsection*{Loading the NEXUS file }
+
+%% JH
+\mlstname{} is a multi-individual, multi-locus method method. The data for each
+locus is stored as one alignment in its own NEXUS file. Taxa names in each
+alignment have to be unique, but duplicates across alignments are fine.
+%% JH
+
+To load a NEXUS format alignment, simply select the \texttt{Import
+Alignment} option from the File menu: 
+
+Select three files called \href{https://github.com/CompEvol/beast2/blob/master/examples/nexus/26.nex?raw=true}{26.nex}, \href{https://github.com/CompEvol/beast2/blob/master/examples/nexus/29.nex?raw=true}{29.nex}, \href{https://github.com/CompEvol/beast2/blob/master/examples/nexus/47.nex?raw=true}{47.nex} by holding \texttt{shift} key. 
+You can find the files in the {\tt examples/nexus} directory in the directory where BEAST was installed. 
+Or click the links to download the data. After the data is opened in your web browser each time, right click mouse and separately save them as \texttt{26.nex, 29.nex, 47.nex}.
+
+Each file contains an alignment of sequences of from an independent locus. The \texttt{26.nex} looks like this (content has been truncated):
+
+\begin{verbatim}
+#NEXUS
+[TBO26oLong]
+BEGIN DATA;
+	DIMENSIONS  NTAX =26 NCHAR=614;
+	FORMAT DATATYPE = DNA GAP = - MISSING = ?;
+	MATRIX	
+	Orthogeomys_heterodus        ATTCTAGGCAAAAAGAGCAATGC ...
+	Thomomys_bottae_awahnee_a    ????????????????????ATGCTG ...
+	Thomomys_bottae_awahnee_b    ????????????????????ATGCTG ...
+	Thomomys_bottae_xerophilus   ????????????????????ATGCTG ...
+	Thomomys_bottae_cactophilus  ????????????????AGCAATGCT ...
+
+         ... ...
+
+;
+END;
+\end{verbatim}
+
+\medskip{}
+
+Once loaded, the three partitions are displayed in the main panel.
+You can double click any alignment (partition) to show its detail.
+
+\begin{figure}
+\centering
+\includeimage[scale=0.32,clip=true,trim=0 300 0 0]{figures/BEAUti_DataPartitions}
+
+\caption{\label{fig.datapartition} Data partition panel after loading alignments.}
+\end{figure}
+
+
+For multi-locus analyses, BEAST can link or unlink substitutions models across the loci by clicking buttons on the top of {\bf Partitions} panel. The default of *BEAST is unlinking all models: substitution model, clock model, and tree models. Note that you should only unlink the tree model across data partitions that are actually genetically unlinked. For example, in most organisms all the mitochondrial genes are effectively linked due to a lack of recombination and they should be set up [...]
+
+\subsubsection*{Import trait(s) from a mapping file to fire *BEAST}
+
+%%JH
+Each taxon in a \mlstname{} analysis is associated with a species. Typically the
+species name is already embedded inside the taxon. The species name should be
+easy to extract; place it either at the beginning or the end, separated by a
+``special'' character which does not appear in names. For example,
+\texttt{aria\_334259, coast\_343436} (using an underscore) or
+\texttt{10x017b.wrussia, 2x305b.eastis} (using a dot).
+%%JH
+
+We need to tell BEAUti somehow which lineages in the alignments go with taxa in the species tree. Select the Taxon Set panel, and a list of taxa from the alignments is shown together with a default guess by BEAUti. In this case, the guess is not very good, so we want to change this. You can manually change each of the entries in the table, or press the guess button and a dialog is shown where you can choose from several ways to try to detect the taxon from the name of the lineages, or ha [...]
+
+\begin{figure}
+\centering
+\includeimage[width=\textwidth]{figures/BEAUti_Guess_Taxonsets}
+
+\caption{\label{fig.taxonset} Selecting taxon sets in BEAUti using the guess dialog from the taxon set panel.}
+\end{figure}
+
+
+Alternatively, the mapping can be read from a trait file.
+A proper trait file is tab delimited. The first row is always \texttt{traits} followed by the keyword \texttt{species} in the second column and separated by tab. The rest of the rows map each individual taxon name to a species name: the taxon name in the first column and species name in the second column separated by tab. For example:
+
+\begin{verbatim}
+traits	species
+taxon1	speciesA
+taxon2	speciesA
+taxon3	speciesB
+... ...
+\end{verbatim}
+
+
+
+\subsubsection*{Setting the substitution model}
+
+The next thing to do is to click on the {\bf Site Model} tab at the top of the
+main window. This will reveal the evolutionary model settings for
+BEAST. Exactly which options appear depend on whether the data are
+nucleotides, or amino acids, or binary data, or general data.
+The settings that will appear after loading the data set will
+be the default values so we need to make some changes. 
+
+Most of the models should be familiar to you. For this analysis, we
+will select each substitution model listed on the 
+left side in turn to make the following change: select HKY for substitution model
+and \textbf{Empirical} for the \textbf{Frequencies}. 
+\begin{figure}
+\centering
+\includeimage[width=\textwidth]{figures/BEAUti_Site_Model}
+
+\caption{\label{fig.sitemodel} Setting up substitution and site models for the gopher alignments.}
+\end{figure}
+
+
+\subsubsection*{Setting the clock model}
+
+Second, click on the {\bf Clock Models} tab at the top of the
+main window. In this analysis, we use the \textbf{Strict Clock} molecular clock model as default.
+Your model options should now look like this: 
+
+\begin{figure}
+\centering
+\includeimage[scale=0.3,clip=true,trim=0 450 0 0]{figures/BEAUti_ClockModel1}
+
+\centering
+\includeimage[scale=0.3,clip=true,trim=0 450 0 0]{figures/BEAUti_ClockModel2}
+
+\centering
+\includeimage[scale=0.3,clip=true,trim=0 450 0 0]{figures/BEAUti_ClockModel3}
+
+\caption{\label{fig.clockmodel} Setting up clock models for the gopher alignments.}
+\end{figure}
+
+
+The \textbf{Estimate} check box is unchecked for the first clock model and checked for the rest clock models, because we wish to estimate the substitution rate of each subsequent locus relative to the first locus whose rate is fixed to 1.0. 
+
+\subsubsection*{Multi Species Coalescent}
+
+The {\bf Multi Species Coalescent} panel allows settings to the multi species coalescent model to be specified for each tree. *BEAST has a different tree prior panel where users can only configure the species tree prior not gene tree priors (which are automatically specified by the multispecies coalescent). 
+Currently, three population size models are available: \textbf{Piecewise linear and constant root}, \textbf{Piecewise linear}, and \textbf{Piecewise constant}. In this analysis, we use \textbf{piecewise linear and constant root}.
+
+The \textbf{Ploidy} item determines the type of sequence (mitochondrial, nuclear, X, Y). This matters since different modes of inheritance gives rise to different effective population sizes. In this analysis, we simply use a random starting tree. 
+
+\begin{figure}
+\centering
+\includeimage[scale=0.3,clip=true,trim=0 150 0 0]{figures/BEAUti_MSP}
+
+\caption{\label{fig.MSP} Setting up multi species coalescent parameters.}
+\end{figure}
+
+
+\subsubsection*{Priors and Operators}
+
+The {\bf Priors} panel allows priors to be specified for each parameter in the model. 
+Several models are available as tree priors, however, only the Yule or the Birth-Death Model are suitable for *BEAST analyses. Leave the tree prior setting at the default \textbf{Yule model}. The {\bf Operators} panel (hidden) is used to configure technical settings that affect the efficiency of the MCMC program. We leave these two panels unchanged in this analysis.
+
+\subsubsection*{Setting the MCMC options }
+
+The next tab, {\bf MCMC}, provides more general
+settings to control the length of the MCMC and the file names. 
+
+Firstly we have the \textbf{Length of chain}. This is the number of
+steps the MCMC will make in the chain before finishing. The appropriate length of the chain depends on the size of the data set, the complexity of the
+model and the accuracy of the answer required. The default value of 10,000,000
+is entirely arbitrary and should be adjusted according to the size
+of your data set. For this data set let's set the \texttt{chain
+length} to \underline{\chainLength{}} as this will run reasonably quickly on most modern
+computers (a few minutes).
+
+The next options specify how often the parameter values in the Markov
+chain should be displayed on the screen and recorded in the log file.
+The screen output is simply for monitoring the programs progress so
+can be set to any value (although if set too small, the sheer quantity
+of information being displayed on the screen will actually slow the
+program down). For the log file, the value should be set relative
+to the total length of the chain. Sampling too often will result in
+very large files with little extra benefit in terms of the precision
+of the analysis. Sample too infrequently and the log file will not
+contain much information about the distributions of the parameters. 
+You probably want to aim to store no more than 10,000 samples so this should be
+set to no less than chain length / 10,000.
+
+For this exercise we will set the \texttt{screen log} to \underline{\screenEvery{}} and the \texttt{trace log} to \underline{\logEvery{}}. 
+Set the file name of the trace log to \texttt{gopher.log} and that of the speciesTreeLogger to \texttt{gopher.species.trees}.
+
+%If you would like to save the operator analysis into a file, you need to check  \textbf{Create operator analysis file} which will generate a file with the suffix \texttt{.ops}. 
+
+\begin{figure}
+\centering
+\includeimage[width=\textwidth]{figures/BEAUti_MCMC}
+
+\caption{\label{fig.MCMC} Setting up the MCMC paremeters.}
+\end{figure}
+
+
+If you are using windows then we suggest you add the suffix \texttt{.txt} to both of these (so,
+\texttt{gopher.log.txt} and \texttt{gopher.species.trees.txt}) so that Windows recognizes
+these as text files. 
+
+\subsubsection*{Generating the BEAST XML file }
+
+We are now ready to create the BEAST XML file. To do this, either select the {\bf File/Save} or {\bf File/Save As} option from the \textbf{File} menu. Check the default priors setting and click \textbf{Continue}. Save the file with an appropriate name (we usually end the filename with \texttt{.xml}, i.e., \texttt{gopher.xml}). We are now ready to run the file through BEAST. 
+
+\subsection*{Running BEAST }
+
+Now run BEAST and when it asks for an input file, provide your newly
+created XML file as input by click \textbf{Choose File ...}, and then click \textbf{Run}. 
+
+\begin{figure}
+\centering
+\includeimage[width=0.8\textwidth]{figures/BEAST}
+
+\caption{\label{fig.BEAST} Launching BEAST.}
+\end{figure}
+
+
+BEAST will then run until it has finished
+reporting information to the screen. The actual results files are
+saved to the disk in the same location as your input file. The output to the screen will
+look something like this: 
+
+{\tiny   
+\begin{verbatim}
+                        BEAST v2.2.0, 2002-2014
+             Bayesian Evolutionary Analysis Sampling Trees
+                       Designed and developed by
+ Remco Bouckaert, Alexei J. Drummond, Andrew Rambaut & Marc A. Suchard
+                                    
+                     Department of Computer Science
+                         University of Auckland
+                        remco at cs.auckland.ac.nz
+                        alexei at cs.auckland.ac.nz
+                                    
+                   Institute of Evolutionary Biology
+                        University of Edinburgh
+                           a.rambaut at ed.ac.uk
+                                    
+                    David Geffen School of Medicine
+                 University of California, Los Angeles
+                           msuchard at ucla.edu
+                                    
+                      Downloads, Help & Resources:
+                           http://beast2.org/
+                                    
+  Source code distributed under the GNU Lesser General Public License:
+                   http://github.com/CompEvol/beast2
+                                    
+                           BEAST developers:
+   Alex Alekseyenko, Trevor Bedford, Erik Bloomquist, Joseph Heled, 
+ Sebastian Hoehna, Denise Kuehnert, Philippe Lemey, Wai Lok Sibon Li, 
+Gerton Lunter, Sidney Markowitz, Vladimir Minin, Michael Defoin Platel, 
+                 Oliver Pybus, Chieh-Hsi Wu, Walter Xie
+                                    
+                               Thanks to:
+          Roald Forsberg\includeimage, Beth Shapiro and Korbinian Strimmer
+
+
+... ...
+
+
+        4980000     -3827.2093       279.2        -4293.2486        22.1146 24s/Msamples
+        4990000     -3842.9689       276.3        -4295.6213        17.6877 24s/Msamples
+        5000000     -3798.1962       278.2        -4280.7865        22.0904 24s/Msamples
+
+Operator                                           Tuning    #accept    #reject      Pr(m)  Pr(acc|m)
+NodeReheight(Reheight.t:Species)                        -     205317     486572     0.1386     0.2967 
+ScaleOperator(popSizeBottomScaler.t:Species)       0.1902      10224      26338     0.0074     0.2796 
+ScaleOperator(popMeanScale.t:Species)              0.4890       5795      16242     0.0044     0.2630 
+UpDownOperator(updown.all.Species)                 0.5029      38885     108717     0.0295     0.2634 
+ScaleOperator(YuleBirthRateScaler.t:Species)       0.2416       7155      15125     0.0044     0.3211 
+ScaleOperator(treeScaler.t:26)                     0.7580       8510      42962     0.0102     0.1653 
+ScaleOperator(treeRootScaler.t:26)                 0.4424      11487      39392     0.0102     0.2258 
+Uniform(UniformOperator.t:26)                           -     287517     225590     0.1024     0.5603 
+SubtreeSlide(SubtreeSlide.t:26)                    0.5560        418     256419     0.0512     0.0016 Try decreasing size to about 0.278
+Exchange(narrow.t:26)                                   -     115438     140923     0.0512     0.4503 
+Exchange(wide.t:26)                                     -       1363      49988     0.0102     0.0265 
+WilsonBalding(WilsonBalding.t:26)                       -       1882      49890     0.0102     0.0364 
+ScaleOperator(StrictClockRateScaler.c:29)          0.4744      13355      37595     0.0102     0.2621 
+ScaleOperator(treeScaler.t:29)                     0.7567       8137      42785     0.0102     0.1598 
+ScaleOperator(treeRootScaler.t:29)                 0.4101      12191      38887     0.0102     0.2387 
+Uniform(UniformOperator.t:29)                           -     296262     216280     0.1024     0.5780 
+SubtreeSlide(SubtreeSlide.t:29)                    0.5724        339     255443     0.0512     0.0013 Try decreasing size to about 0.286
+Exchange(narrow.t:29)                                   -     117912     138109     0.0512     0.4606 
+Exchange(wide.t:29)                                     -       2229      49303     0.0102     0.0433 
+WilsonBalding(WilsonBalding.t:29)                       -       2459      49001     0.0102     0.0478 
+UpDownOperator(updown.29)                          0.7793      10314      40694     0.0102     0.2022 
+ScaleOperator(StrictClockRateScaler.c:47)          0.5490      12974      38097     0.0102     0.2540 
+ScaleOperator(treeScaler.t:47)                     0.7363       8746      42523     0.0102     0.1706 
+ScaleOperator(treeRootScaler.t:47)                 0.4742       7774      43670     0.0102     0.1511 
+Uniform(UniformOperator.t:47)                           -     276942     234361     0.1024     0.5416 
+SubtreeSlide(SubtreeSlide.t:47)                    0.5044        307     255119     0.0512     0.0012 Try decreasing size to about 0.252
+Exchange(narrow.t:47)                                   -      91846     164747     0.0512     0.3579 
+Exchange(wide.t:47)                                     -        731      50281     0.0102     0.0143 
+WilsonBalding(WilsonBalding.t:47)                       -        937      50377     0.0102     0.0183 
+UpDownOperator(updown.47)                          0.7397      10853      40537     0.0102     0.2112 
+UpDownOperator(strictClockUpDownOperator.c:47)     0.7278       9987      41373     0.0102     0.1945 
+UpDownOperator(strictClockUpDownOperator.c:29)     0.7761      10040      40724     0.0102     0.1978 
+ScaleOperator(KappaScaler.s:26)                    0.3401        469       1197     0.0003     0.2815 
+ScaleOperator(KappaScaler.s:29)                    0.2955        436       1231     0.0003     0.2615 
+ScaleOperator(KappaScaler.s:47)                    0.3199        379       1298     0.0003     0.2260 
+ScaleOperator(popSizeTopScaler.t:Species)          0.1910      23665      54936     0.0157     0.3011 
+
+     Tuning: The value of the operator's tuning parameter, or '-' if the operator can't be optimized.
+    #accept: The total number of times a proposal by this operator has been accepted.
+    #reject: The total number of times a proposal by this operator has been rejected.
+      Pr(m): The probability this operator is chosen in a step of the MCMC (i.e. the normalized weight).
+  Pr(acc|m): The acceptance probability (#accept as a fraction of the total proposals for this operator).
+
+
+Total calculation time: 135.584 seconds
+End likelihood: -3798.196207797654
+\end{verbatim}}
+
+\subsection*{Analyzing the results}
+
+Run the program called {\bf Tracer} to analyze the output of BEAST. When the main
+window has opened, choose {\bf Import Trace File...} from the {\bf File} menu and select the file that
+BEAST has created called \texttt{gopher.log}.
+You should now see a window like in Figure \ref{fig.tracer1}.
+
+\begin{figure}
+\centering
+\includeimage[width=\textwidth]{figures/Tracer1}
+
+\caption{\label{fig.tracer1} Tracer with the gopher data.}
+\end{figure}
+
+
+Remember that MCMC is a stochastic algorithm so the actual numbers will not be exactly the same.
+
+On the left hand side is a list of the different quantities that BEAST has logged. There are traces for the posterior (this
+is the log of the product of the tree likelihood and the prior probabilities), and the continuous parameters. Selecting a trace
+on the left brings up analyses for this trace on the right hand side depending on tab that is selected. When first opened, the
+`posterior' trace is selected and various statistics of this trace are shown under the Estimates tab.
+In the top right of the window is a table of calculated statistics for the selected trace. 
+
+Tracer will plot a (marginal posterior) distribution for the selected parameter and also give you statistics such as the mean and median. The \texttt{95\% HPD lower} or \texttt {upper} stands for {\it highest posterior density interval} and represents the most compact interval on the selected parameter that contains 95\% of the posterior probability. It can be thought of as a Bayesian analog to a confidence interval. 
+
+Select the \texttt{treeModel.rootHeight} parameter and the next three (hold shift whilst selecting). This will show a display of the
+age of the root and the three gene trees. If you switch the tab at the top of the window to {\bf Marginal Density} then you will get a plot of the marginal posterior densities of each of these date estimates overlayed,
+as shown in Figure \ref{fig.tracer2}.
+
+\begin{figure}
+\centering
+\includeimage[width=\textwidth]{figures/Tracer2}
+
+\caption{\label{fig.tracer2} Tracer showing the root heights of the lineage trees.}
+\end{figure}
+
+
+\subsection*{Obtaining an estimate of the phylogenetic tree}
+
+BEAST also produces a sample of plausible trees. 
+These can be summarized using the program {\bf TreeAnnotator}. This will take the set of trees and identify a single tree that best represents the posterior distribution. It will then annotate this selected tree topology with the mean ages of all the
+nodes as well as the 95\% HPD interval of divergence times for each clade in the selected tree. It will also calculate the posterior clade probability for each
+node. Run the {\bf TreeAnnotator} program and set it up to look like in Figure \ref{fig.TreeAnnotator}.
+
+\begin{figure}
+\centering
+\includeimage[width=0.8\textwidth]{figures/TreeAnnotator}
+
+\caption{\label{fig.TreeAnnotator} Using TreeAnnotator to summarise the tree set.}
+\end{figure}
+
+
+The burnin is the number of trees to remove from the start of the sample. Unlike {\bf Tracer} which specifies the number of steps as a burnin, in {\bf TreeAnnotator} you need to specify the actual number of trees. For this run, we use the default setting.
+
+The {\bf Posterior probability limit} option specifies a limit such that if a node is found at less than this frequency in the sample of trees (i.e., has a posterior probability less than this limit), it will not be annotated. The default of 0.5 means that only nodes seen in the majority of trees will be annotated. Set this to zero to annotate all nodes.
+
+For {\bf Target tree type} you can either choose a specific tree from a file or ask TreeAnnotator to find a tree in your sample. The default option, {\bf Maximum clade credibility tree}, finds the tree with the highest product of the posterior probability of all its nodes.
+
+Choose {\bf Mean heights} for node heights. This sets the heights (ages) of each node in the tree to the mean height across the entire sample of trees for that clade.
+
+For the input file, select the trees file that BEAST created (by default this will be called \texttt{gopher.species.trees}) and select a file for the output (here we called it \texttt{gopher.species.tree}).
+
+Now press \texttt{Run} and wait for the program to finish.
+
+\subsection*{Viewing the Species Tree}
+
+Finally, we can look at the tree in another program called {\bf FigTree}. Run this program, and open
+the \texttt{gopher.species.tree} file by using the Open command in the File menu. The tree should appear.
+You can now try selecting some of the options in the control panel on the left. Try selecting
+{\bf Node Bars} to get node age error bars. Also turn on {\bf Branch Labels} and select {\bf posterior} to get
+it to display the posterior probability for each node. Under {\bf Appearance} you can also tell FigTree
+to colour the branches by the rate.
+You should end up with something like Figure \ref{fig.figtree}.
+
+\begin{figure}
+\centering
+\includeimage[width=\textwidth]{figures/figtree}
+
+\caption{\label{fig.figtree} Figtree representation of the species tree.}
+\end{figure}
+
+
+Alternatively, you can load the species tree set into DensiTree and set it up as follows.
+
+\begin{itemize}
+\item Set burn-in to 500. The tree should not be collapsed any more.
+\item Show a root-canal tree to guide the eye. Perhaps, the intensity of the trees is not large enough, so you might want to increase the intensity by clicking the icon in the button bar.
+\item Show clades, their mean and 95\% HPD graphically, and posterior support using text. Now, too many clades are shown, and most are not of interest. Select 'Selected only', then open the clade toolbar (menu Window/View clade toolbar), and select only highly supported clades. Also, select the clade consisting of heterodus, bottea, umbinus and townsendii, to show that heterodus is an outgroup,
+but there is some support (over 16\%) that it is not.
+\item Drag the clade monticola and idahoensis up so that the 95\% HPD bar does not overlap with the one for mazama, monticola, idahoensis and talpoidis. Increase font size of the label for better readability.
+\end{itemize}
+
+The image should look something like Figure \ref{fig.DensiTree}
+
+\begin{figure}
+\centering
+\includeimage[scale=0.4]{figures/DensiTree}
+\caption{\label{fig.DensiTree} DensiTree representation of the species tree.}
+\end{figure}
+
+Exercise: There is about 75\% support for heterodus to be an outgroup, and about 17\% for heterodus to be in a clade with bottea, umbinus and townsendii. Can you explain where the other 8\% went?
+
+
+DensiTree can be used to show the branch widths of summary 
+tree from tree annotator as population sizes. 
+%Under `Line Width' in DensiTree, choose `dmv1' for the bottom and `dmv2' for the top.
+Under `Line Width' in DensiTree, choose `BY\_METADATA\_NUMBER' for the bottom and for the top,
+and choose numbers 2 and 3 in the 'top' and 'bottom' spinner.
+Left, the bottom represents dmv1, the top dmv2 in the summary tree, which do not quite match 
+in areas with little posterior support for the clades (see Figure \ref{fig.DensiTree} to
+see which clades have little support).
+
+
+Right, the top is matched up with the bottom of the branch above, using the `Make fit to bottom'
+option for the top. This looks a bit prettier, but may not be quite accurate.
+
+\begin{figure}
+\centering
+\includeimage[scale=0.18]{figures/species_population1}
+\includeimage[scale=0.18]{figures/species_population2}
+\end{figure}
+
+Alternatively, a consensus tree can be generated by biopy (\url{http://code.google.com/p/biopy/})
+with using 1-norm left, and 2-norm right.
+
+\begin{figure}
+\centering
+\includeimage[scale=0.18]{figures/species_population4}
+\includeimage[scale=0.18]{figures/species_population5}
+\end{figure}
+
+Showing all consensus trees with population widths
+(use By Metadata Pattern, for top and bottom and use {\begin{verbatim} .*dmv=.([^,]*).*\end{verbatim}} 
+for the bottom pattern and {\begin{verbatim} .*dmv=.[^,]*,([^\}]*).*\end{verbatim}} for the top pattern.
+This gives us this visualisation:
+
+\begin{figure}
+\centering
+\includeimage[scale=0.25]{figures/species_population3}
+\end{figure}
+
+
+\subsection*{Comparing your results to the prior}
+
+Using BEAUti, set up the same analysis but under the MCMC options, select the {\bf Sample from prior only} option. This will allow you to visualize the full prior distribution in the absence of your sequence data. Summarize the trees from the full prior
+distribution and compare the summary to the posterior summary tree.
+
+
+\bibliographystyle{apalike}
+\bibliography{STACEY_tutorial}
+
+\end{document}
+
diff --git a/doc/tutorials/STARBEAST/StarBEASTTutorialv2.0.3.pdf b/doc/tutorials/STARBEAST/StarBEASTTutorialv2.0.3.pdf
new file mode 100644
index 0000000..83a32f5
Binary files /dev/null and b/doc/tutorials/STARBEAST/StarBEASTTutorialv2.0.3.pdf differ
diff --git a/doc/tutorials/STARBEAST/StarBEAST_tutorial.bib b/doc/tutorials/STARBEAST/StarBEAST_tutorial.bib
new file mode 100644
index 0000000..71b868a
--- /dev/null
+++ b/doc/tutorials/STARBEAST/StarBEAST_tutorial.bib
@@ -0,0 +1,32 @@
+ at article{Heled:2010fk,
+	Abstract = {Until recently, it has been common practice for a phylogenetic analysis to use a single gene sequence from a single individual organism as a proxy for an entire species. With technological advances, it is now becoming more common to collect data sets containing multiple gene loci and multiple individuals per species. These data sets often reveal the need to directly model intraspecies polymorphism and incomplete lineage sorting in phylogenetic estimation procedures. For a si [...]
+	Author = {Heled, Joseph and Drummond, Alexei J},
+	Date-Added = {2011-09-29 01:20:13 +0000},
+	Date-Modified = {2011-09-29 01:20:13 +0000},
+	Doi = {10.1093/molbev/msp274},
+	Journal = {Mol Biol Evol},
+	Journal-Full = {Molecular biology and evolution},
+	Mesh = {Algorithms; Bayes Theorem; Computer Simulation; Evolution, Molecular; Genes; Models, Genetic; Monte Carlo Method; Phylogeny; Species Specificity},
+	Month = {Mar},
+	Number = {3},
+	Pages = {570-80},
+	Pmc = {PMC2822290},
+	Pmid = {19906793},
+	Pst = {ppublish},
+	Title = {Bayesian inference of species trees from multilocus data},
+	Volume = {27},
+	Year = {2010},
+	Bdsk-Url-1 = {http://dx.doi.org/10.1093/molbev/msp274}}
+
+
+ at article{belfiore2008multilocus,
+	Author = {Belfiore, N.M. and Liu, L. and Moritz, C.},
+	Date-Added = {2012-04-15 21:37:34 +0000},
+	Date-Modified = {2012-04-15 21:37:34 +0000},
+	Journal = {Systematic Biology},
+	Number = {2},
+	Pages = {294},
+	Title = {{Multilocus phylogenetics of a rapid radiation in the genus Thomomys (Rodentia: Geomyidae)}},
+	Volume = {57},
+	Year = {2008}}
+
diff --git a/doc/tutorials/STARBEAST/StarBEAST_tutorial.tex b/doc/tutorials/STARBEAST/StarBEAST_tutorial.tex
new file mode 100644
index 0000000..488525d
--- /dev/null
+++ b/doc/tutorials/STARBEAST/StarBEAST_tutorial.tex
@@ -0,0 +1,534 @@
+\documentclass{article}
+\usepackage{url}
+\usepackage{hyperref}
+\hypersetup{
+    colorlinks=true,
+    linkcolor=blue,
+    filecolor=magenta,      
+    urlcolor=cyan,
+}
+\usepackage{graphicx}
+
+\newcommand{\includeimage}[2][]{%
+%HEVEA\imgsrc{#2.hevea.png}%
+%BEGIN LATEX
+\includegraphics[#1]{#2}
+%END LATEX
+}
+
+% BEAST book specific commands
+\newcommand{\BEASTVersion}{2.2.x}
+\newcommand{\TracerVersion}{1.6}
+\newcommand{\FigTreeVersion}{1.4.2}
+
+\newcommand{\chainLength}{{5,000,000}}
+\newcommand{\logEvery}{{5,000}}
+\newcommand{\screenEvery}{{10,000}}
+
+
+\begin{document}
+\title{*BEAST in BEAST {\BEASTVersion}\\
+Estimating Species Trees from Multilocus Data}
+
+\author{Joseph Heled, Remco Bouckaert, Walter Xie and Alexei J Drummond }
+
+\maketitle
+
+\section{Introduction}
+
+In this tutorial we describe a full Bayesian framework for species tree estimation. The statistical methodology described in this tutorial is known by the acronym *BEAST (pronounced "star beast") \cite{Heled:2010fk}.
+
+You will need the following software at your disposal:
+
+\begin{itemize}
+
+\item {\bf BEAST} - this package contains the BEAST program, BEAUti, TreeAnnotator and other utility programs. This tutorial is written for BEAST v{\BEASTVersion}, which has support for multiple partitions. It is available for download from \\* \texttt{http://www.beast2.org}.
+\item {\bf Tracer} - this program is used to explore the output of BEAST (and other Bayesian MCMC programs). It graphically and
+quantitively summarizes the distributions of continuous parameters and provides diagnostic information. At the time of
+writing, the current version is v{\TracerVersion}. It is available for download from \texttt{http://beast.bio.ed.ac.uk/}.
+\item {\bf FigTree} - this is an application for displaying and printing molecular phylogenies, in particular those obtained using
+BEAST. At the time of writing, the current version is v{\FigTreeVersion}. It is available for download from \texttt{http://tree.bio.ed.ac.uk/}.
+\end{itemize}
+
+\section{*BEAST}
+
+This tutorial will guide you through the analysis of three loci sampled from 26 individuals representing nine species of pocket gophers. This is a subset of previous published data \cite{belfiore2008multilocus}. The objective of this tutorial is to estimate the species tree that is most probable given the multi-individual multi-locus sequence data. The species tree has nine taxa, whereas each gene tree has 26 taxa. *BEAST 2 will co-estimate three gene trees embedded in a shared species t [...]
+
+The first step will be to convert a NEXUS file with a DATA or CHARACTERS block into a BEAST XML input file. This is done using the program BEAUti (Bayesian Evolutionary Analysis Utility). This is a user-friendly program for setting the evolutionary model and options for the MCMC analysis. The second step is to actually run BEAST using the input file that contains the data, model and settings. The final step is to explore the output of BEAST in order to diagnose problems and to summarize  [...]
+
+\subsection*{BEAUti}
+
+Run BEAUti by double clicking on its icon. 
+
+\subsubsection*{Set up BEAUti for *BEAST}
+
+*BEAST uses a different template from the standard. This means that to use BEAUti for *BEAST, the first thing to do is change the template. Choose the File/Templates/StarBeast item. When changing a template, BEAUti deletes all previously imported data and start with a new empty template. So, if you already loaded some data, a warning message pops up indicating that this data will be lost if you switch templates.
+
+\begin{figure}
+\centering
+\includeimage[scale=0.4,clip=true,trim=0 300 200 0]{figures/BEAUti_selectTemplate}
+
+\caption{\label{fig.template} Select a new template in BEAUti.}
+\end{figure}
+
+
+\def\mlstname{*BEAST}
+
+\subsubsection*{Loading the NEXUS file }
+
+%% JH
+\mlstname{} is a multi-individual, multi-locus method method. The data for each
+locus is stored as one alignment in its own NEXUS file. Taxa names in each
+alignment have to be unique, but duplicates across alignments are fine.
+%% JH
+
+To load a NEXUS format alignment, simply select the \texttt{Import
+Alignment} option from the File menu: 
+
+Select three files called \href{https://github.com/CompEvol/beast2/blob/master/examples/nexus/26.nex?raw=true}{26.nex}, \href{https://github.com/CompEvol/beast2/blob/master/examples/nexus/29.nex?raw=true}{29.nex}, \href{https://github.com/CompEvol/beast2/blob/master/examples/nexus/47.nex?raw=true}{47.nex} by holding \texttt{shift} key. 
+You can find the files in the {\tt examples/nexus} directory in the directory where BEAST was installed. 
+Or click the links to download the data. After the data is opened in your web browser each time, right click mouse and separately save them as \texttt{26.nex, 29.nex, 47.nex}.
+
+Each file contains an alignment of sequences of from an independent locus. The \texttt{26.nex} looks like this (content has been truncated):
+
+\begin{verbatim}
+#NEXUS
+[TBO26oLong]
+BEGIN DATA;
+	DIMENSIONS  NTAX =26 NCHAR=614;
+	FORMAT DATATYPE = DNA GAP = - MISSING = ?;
+	MATRIX	
+	Orthogeomys_heterodus        ATTCTAGGCAAAAAGAGCAATGC ...
+	Thomomys_bottae_awahnee_a    ????????????????????ATGCTG ...
+	Thomomys_bottae_awahnee_b    ????????????????????ATGCTG ...
+	Thomomys_bottae_xerophilus   ????????????????????ATGCTG ...
+	Thomomys_bottae_cactophilus  ????????????????AGCAATGCT ...
+
+         ... ...
+
+;
+END;
+\end{verbatim}
+
+\medskip{}
+
+Once loaded, the three partitions are displayed in the main panel.
+You can double click any alignment (partition) to show its detail.
+
+\begin{figure}
+\centering
+\includeimage[scale=0.32,clip=true,trim=0 300 0 0]{figures/BEAUti_DataPartitions}
+
+\caption{\label{fig.datapartition} Data partition panel after loading alignments.}
+\end{figure}
+
+
+For multi-locus analyses, BEAST can link or unlink substitutions models across the loci by clicking buttons on the top of {\bf Partitions} panel. The default of *BEAST is unlinking all models: substitution model, clock model, and tree models. Note that you should only unlink the tree model across data partitions that are actually genetically unlinked. For example, in most organisms all the mitochondrial genes are effectively linked due to a lack of recombination and they should be set up [...]
+
+\subsubsection*{Import trait(s) from a mapping file to fire *BEAST}
+
+%%JH
+Each taxon in a \mlstname{} analysis is associated with a species. Typically the
+species name is already embedded inside the taxon. The species name should be
+easy to extract; place it either at the beginning or the end, separated by a
+``special'' character which does not appear in names. For example,
+\texttt{aria\_334259, coast\_343436} (using an underscore) or
+\texttt{10x017b.wrussia, 2x305b.eastis} (using a dot).
+%%JH
+
+We need to tell BEAUti somehow which lineages in the alignments go with taxa in the species tree. Select the Taxon Set panel, and a list of taxa from the alignments is shown together with a default guess by BEAUti. In this case, the guess is not very good, so we want to change this. You can manually change each of the entries in the table, or press the guess button and a dialog is shown where you can choose from several ways to try to detect the taxon from the name of the lineages, or ha [...]
+
+\begin{figure}
+\centering
+\includeimage[width=\textwidth]{figures/BEAUti_Guess_Taxonsets}
+
+\caption{\label{fig.taxonset} Selecting taxon sets in BEAUti using the guess dialog from the taxon set panel.}
+\end{figure}
+
+
+Alternatively, the mapping can be read from a trait file.
+A proper trait file is tab delimited. The first row is always \texttt{traits} followed by the keyword \texttt{species} in the second column and separated by tab. The rest of the rows map each individual taxon name to a species name: the taxon name in the first column and species name in the second column separated by tab. For example:
+
+\begin{verbatim}
+traits	species
+taxon1	speciesA
+taxon2	speciesA
+taxon3	speciesB
+... ...
+\end{verbatim}
+
+
+
+\subsubsection*{Setting the substitution model}
+
+The next thing to do is to click on the {\bf Site Model} tab at the top of the
+main window. This will reveal the evolutionary model settings for
+BEAST. Exactly which options appear depend on whether the data are
+nucleotides, or amino acids, or binary data, or general data.
+The settings that will appear after loading the data set will
+be the default values so we need to make some changes. 
+
+Most of the models should be familiar to you. For this analysis, we
+will select each substitution model listed on the 
+left side in turn to make the following change: select HKY for substitution model
+and \textbf{Empirical} for the \textbf{Frequencies}. 
+\begin{figure}
+\centering
+\includeimage[width=\textwidth]{figures/BEAUti_Site_Model}
+
+\caption{\label{fig.sitemodel} Setting up substitution and site models for the gopher alignments.}
+\end{figure}
+
+
+\subsubsection*{Setting the clock model}
+
+Second, click on the {\bf Clock Models} tab at the top of the
+main window. In this analysis, we use the \textbf{Strict Clock} molecular clock model as default.
+Your model options should now look like this: 
+
+\begin{figure}
+\centering
+\includeimage[scale=0.3,clip=true,trim=0 450 0 0]{figures/BEAUti_ClockModel1}
+
+\centering
+\includeimage[scale=0.3,clip=true,trim=0 450 0 0]{figures/BEAUti_ClockModel2}
+
+\centering
+\includeimage[scale=0.3,clip=true,trim=0 450 0 0]{figures/BEAUti_ClockModel3}
+
+\caption{\label{fig.clockmodel} Setting up clock models for the gopher alignments.}
+\end{figure}
+
+
+The \textbf{Estimate} check box is unchecked for the first clock model and checked for the rest clock models, because we wish to estimate the substitution rate of each subsequent locus relative to the first locus whose rate is fixed to 1.0. 
+
+\subsubsection*{Multi Species Coalescent}
+
+The {\bf Multi Species Coalescent} panel allows settings to the multi species coalescent model to be specified for each tree. *BEAST has a different tree prior panel where users can only configure the species tree prior not gene tree priors (which are automatically specified by the multispecies coalescent). 
+Currently, three population size models are available: \textbf{Piecewise linear and constant root}, \textbf{Piecewise linear}, and \textbf{Piecewise constant}. In this analysis, we use \textbf{piecewise linear and constant root}.
+
+The \textbf{Ploidy} item determines the type of sequence (mitochondrial, nuclear, X, Y). This matters since different modes of inheritance gives rise to different effective population sizes. In this analysis, we simply use a random starting tree. 
+
+\begin{figure}
+\centering
+\includeimage[scale=0.3,clip=true,trim=0 150 0 0]{figures/BEAUti_MSP}
+
+\caption{\label{fig.MSP} Setting up multi species coalescent parameters.}
+\end{figure}
+
+
+\subsubsection*{Priors and Operators}
+
+The {\bf Priors} panel allows priors to be specified for each parameter in the model. 
+Several models are available as tree priors, however, only the Yule or the Birth-Death Model are suitable for *BEAST analyses. Leave the tree prior setting at the default \textbf{Yule model}. The {\bf Operators} panel (hidden) is used to configure technical settings that affect the efficiency of the MCMC program. We leave these two panels unchanged in this analysis.
+
+\subsubsection*{Setting the MCMC options }
+
+The next tab, {\bf MCMC}, provides more general
+settings to control the length of the MCMC and the file names. 
+
+Firstly we have the \textbf{Length of chain}. This is the number of
+steps the MCMC will make in the chain before finishing. The appropriate length of the chain depends on the size of the data set, the complexity of the
+model and the accuracy of the answer required. The default value of 10,000,000
+is entirely arbitrary and should be adjusted according to the size
+of your data set. For this data set let's set the \texttt{chain
+length} to \underline{\chainLength{}} as this will run reasonably quickly on most modern
+computers (a few minutes).
+
+The next options specify how often the parameter values in the Markov
+chain should be displayed on the screen and recorded in the log file.
+The screen output is simply for monitoring the programs progress so
+can be set to any value (although if set too small, the sheer quantity
+of information being displayed on the screen will actually slow the
+program down). For the log file, the value should be set relative
+to the total length of the chain. Sampling too often will result in
+very large files with little extra benefit in terms of the precision
+of the analysis. Sample too infrequently and the log file will not
+contain much information about the distributions of the parameters. 
+You probably want to aim to store no more than 10,000 samples so this should be
+set to no less than chain length / 10,000.
+
+For this exercise we will set the \texttt{screen log} to \underline{\screenEvery{}} and the \texttt{trace log} to \underline{\logEvery{}}. 
+Set the file name of the trace log to \texttt{gopher.log} and that of the speciesTreeLogger to \texttt{gopher.species.trees}.
+
+%If you would like to save the operator analysis into a file, you need to check  \textbf{Create operator analysis file} which will generate a file with the suffix \texttt{.ops}. 
+
+\begin{figure}
+\centering
+\includeimage[width=\textwidth]{figures/BEAUti_MCMC}
+
+\caption{\label{fig.MCMC} Setting up the MCMC paremeters.}
+\end{figure}
+
+
+If you are using windows then we suggest you add the suffix \texttt{.txt} to both of these (so,
+\texttt{gopher.log.txt} and \texttt{gopher.species.trees.txt}) so that Windows recognizes
+these as text files. 
+
+\subsubsection*{Generating the BEAST XML file }
+
+We are now ready to create the BEAST XML file. To do this, either select the {\bf File/Save} or {\bf File/Save As} option from the \textbf{File} menu. Check the default priors setting and click \textbf{Continue}. Save the file with an appropriate name (we usually end the filename with \texttt{.xml}, i.e., \texttt{gopher.xml}). We are now ready to run the file through BEAST. 
+
+\subsection*{Running BEAST }
+
+Now run BEAST and when it asks for an input file, provide your newly
+created XML file as input by click \textbf{Choose File ...}, and then click \textbf{Run}. 
+
+\begin{figure}
+\centering
+\includeimage[width=0.8\textwidth]{figures/BEAST}
+
+\caption{\label{fig.BEAST} Launching BEAST.}
+\end{figure}
+
+
+BEAST will then run until it has finished
+reporting information to the screen. The actual results files are
+saved to the disk in the same location as your input file. The output to the screen will
+look something like this: 
+
+{\tiny   
+\begin{verbatim}
+                        BEAST v2.2.0, 2002-2014
+             Bayesian Evolutionary Analysis Sampling Trees
+                       Designed and developed by
+ Remco Bouckaert, Alexei J. Drummond, Andrew Rambaut & Marc A. Suchard
+                                    
+                     Department of Computer Science
+                         University of Auckland
+                        remco at cs.auckland.ac.nz
+                        alexei at cs.auckland.ac.nz
+                                    
+                   Institute of Evolutionary Biology
+                        University of Edinburgh
+                           a.rambaut at ed.ac.uk
+                                    
+                    David Geffen School of Medicine
+                 University of California, Los Angeles
+                           msuchard at ucla.edu
+                                    
+                      Downloads, Help & Resources:
+                           http://beast2.org/
+                                    
+  Source code distributed under the GNU Lesser General Public License:
+                   http://github.com/CompEvol/beast2
+                                    
+                           BEAST developers:
+   Alex Alekseyenko, Trevor Bedford, Erik Bloomquist, Joseph Heled, 
+ Sebastian Hoehna, Denise Kuehnert, Philippe Lemey, Wai Lok Sibon Li, 
+Gerton Lunter, Sidney Markowitz, Vladimir Minin, Michael Defoin Platel, 
+                 Oliver Pybus, Chieh-Hsi Wu, Walter Xie
+                                    
+                               Thanks to:
+          Roald Forsberg\includeimage, Beth Shapiro and Korbinian Strimmer
+
+
+... ...
+
+
+        4980000     -3827.2093       279.2        -4293.2486        22.1146 24s/Msamples
+        4990000     -3842.9689       276.3        -4295.6213        17.6877 24s/Msamples
+        5000000     -3798.1962       278.2        -4280.7865        22.0904 24s/Msamples
+
+Operator                                           Tuning    #accept    #reject      Pr(m)  Pr(acc|m)
+NodeReheight(Reheight.t:Species)                        -     205317     486572     0.1386     0.2967 
+ScaleOperator(popSizeBottomScaler.t:Species)       0.1902      10224      26338     0.0074     0.2796 
+ScaleOperator(popMeanScale.t:Species)              0.4890       5795      16242     0.0044     0.2630 
+UpDownOperator(updown.all.Species)                 0.5029      38885     108717     0.0295     0.2634 
+ScaleOperator(YuleBirthRateScaler.t:Species)       0.2416       7155      15125     0.0044     0.3211 
+ScaleOperator(treeScaler.t:26)                     0.7580       8510      42962     0.0102     0.1653 
+ScaleOperator(treeRootScaler.t:26)                 0.4424      11487      39392     0.0102     0.2258 
+Uniform(UniformOperator.t:26)                           -     287517     225590     0.1024     0.5603 
+SubtreeSlide(SubtreeSlide.t:26)                    0.5560        418     256419     0.0512     0.0016 Try decreasing size to about 0.278
+Exchange(narrow.t:26)                                   -     115438     140923     0.0512     0.4503 
+Exchange(wide.t:26)                                     -       1363      49988     0.0102     0.0265 
+WilsonBalding(WilsonBalding.t:26)                       -       1882      49890     0.0102     0.0364 
+ScaleOperator(StrictClockRateScaler.c:29)          0.4744      13355      37595     0.0102     0.2621 
+ScaleOperator(treeScaler.t:29)                     0.7567       8137      42785     0.0102     0.1598 
+ScaleOperator(treeRootScaler.t:29)                 0.4101      12191      38887     0.0102     0.2387 
+Uniform(UniformOperator.t:29)                           -     296262     216280     0.1024     0.5780 
+SubtreeSlide(SubtreeSlide.t:29)                    0.5724        339     255443     0.0512     0.0013 Try decreasing size to about 0.286
+Exchange(narrow.t:29)                                   -     117912     138109     0.0512     0.4606 
+Exchange(wide.t:29)                                     -       2229      49303     0.0102     0.0433 
+WilsonBalding(WilsonBalding.t:29)                       -       2459      49001     0.0102     0.0478 
+UpDownOperator(updown.29)                          0.7793      10314      40694     0.0102     0.2022 
+ScaleOperator(StrictClockRateScaler.c:47)          0.5490      12974      38097     0.0102     0.2540 
+ScaleOperator(treeScaler.t:47)                     0.7363       8746      42523     0.0102     0.1706 
+ScaleOperator(treeRootScaler.t:47)                 0.4742       7774      43670     0.0102     0.1511 
+Uniform(UniformOperator.t:47)                           -     276942     234361     0.1024     0.5416 
+SubtreeSlide(SubtreeSlide.t:47)                    0.5044        307     255119     0.0512     0.0012 Try decreasing size to about 0.252
+Exchange(narrow.t:47)                                   -      91846     164747     0.0512     0.3579 
+Exchange(wide.t:47)                                     -        731      50281     0.0102     0.0143 
+WilsonBalding(WilsonBalding.t:47)                       -        937      50377     0.0102     0.0183 
+UpDownOperator(updown.47)                          0.7397      10853      40537     0.0102     0.2112 
+UpDownOperator(strictClockUpDownOperator.c:47)     0.7278       9987      41373     0.0102     0.1945 
+UpDownOperator(strictClockUpDownOperator.c:29)     0.7761      10040      40724     0.0102     0.1978 
+ScaleOperator(KappaScaler.s:26)                    0.3401        469       1197     0.0003     0.2815 
+ScaleOperator(KappaScaler.s:29)                    0.2955        436       1231     0.0003     0.2615 
+ScaleOperator(KappaScaler.s:47)                    0.3199        379       1298     0.0003     0.2260 
+ScaleOperator(popSizeTopScaler.t:Species)          0.1910      23665      54936     0.0157     0.3011 
+
+     Tuning: The value of the operator's tuning parameter, or '-' if the operator can't be optimized.
+    #accept: The total number of times a proposal by this operator has been accepted.
+    #reject: The total number of times a proposal by this operator has been rejected.
+      Pr(m): The probability this operator is chosen in a step of the MCMC (i.e. the normalized weight).
+  Pr(acc|m): The acceptance probability (#accept as a fraction of the total proposals for this operator).
+
+
+Total calculation time: 135.584 seconds
+End likelihood: -3798.196207797654
+\end{verbatim}}
+
+\subsection*{Analyzing the results}
+
+Run the program called {\bf Tracer} to analyze the output of BEAST. When the main
+window has opened, choose {\bf Import Trace File...} from the {\bf File} menu and select the file that
+BEAST has created called \texttt{gopher.log}.
+You should now see a window like in Figure \ref{fig.tracer1}.
+
+\begin{figure}
+\centering
+\includeimage[width=\textwidth]{figures/Tracer1}
+
+\caption{\label{fig.tracer1} Tracer with the gopher data.}
+\end{figure}
+
+
+Remember that MCMC is a stochastic algorithm so the actual numbers will not be exactly the same.
+
+On the left hand side is a list of the different quantities that BEAST has logged. There are traces for the posterior (this
+is the log of the product of the tree likelihood and the prior probabilities), and the continuous parameters. Selecting a trace
+on the left brings up analyses for this trace on the right hand side depending on tab that is selected. When first opened, the
+`posterior' trace is selected and various statistics of this trace are shown under the Estimates tab.
+In the top right of the window is a table of calculated statistics for the selected trace. 
+
+Tracer will plot a (marginal posterior) distribution for the selected parameter and also give you statistics such as the mean and median. The \texttt{95\% HPD lower} or \texttt {upper} stands for {\it highest posterior density interval} and represents the most compact interval on the selected parameter that contains 95\% of the posterior probability. It can be thought of as a Bayesian analog to a confidence interval. 
+
+Select the \texttt{treeModel.rootHeight} parameter and the next three (hold shift whilst selecting). This will show a display of the
+age of the root and the three gene trees. If you switch the tab at the top of the window to {\bf Marginal Density} then you will get a plot of the marginal posterior densities of each of these date estimates overlayed,
+as shown in Figure \ref{fig.tracer2}.
+
+\begin{figure}
+\centering
+\includeimage[width=\textwidth]{figures/Tracer2}
+
+\caption{\label{fig.tracer2} Tracer showing the root heights of the lineage trees.}
+\end{figure}
+
+
+\subsection*{Obtaining an estimate of the phylogenetic tree}
+
+BEAST also produces a sample of plausible trees. 
+These can be summarized using the program {\bf TreeAnnotator}. This will take the set of trees and identify a single tree that best represents the posterior distribution. It will then annotate this selected tree topology with the mean ages of all the
+nodes as well as the 95\% HPD interval of divergence times for each clade in the selected tree. It will also calculate the posterior clade probability for each
+node. Run the {\bf TreeAnnotator} program and set it up to look like in Figure \ref{fig.TreeAnnotator}.
+
+\begin{figure}
+\centering
+\includeimage[width=0.8\textwidth]{figures/TreeAnnotator}
+
+\caption{\label{fig.TreeAnnotator} Using TreeAnnotator to summarise the tree set.}
+\end{figure}
+
+
+The burnin is the number of trees to remove from the start of the sample. Unlike {\bf Tracer} which specifies the number of steps as a burnin, in {\bf TreeAnnotator} you need to specify the actual number of trees. For this run, we use the default setting.
+
+The {\bf Posterior probability limit} option specifies a limit such that if a node is found at less than this frequency in the sample of trees (i.e., has a posterior probability less than this limit), it will not be annotated. The default of 0.5 means that only nodes seen in the majority of trees will be annotated. Set this to zero to annotate all nodes.
+
+For {\bf Target tree type} you can either choose a specific tree from a file or ask TreeAnnotator to find a tree in your sample. The default option, {\bf Maximum clade credibility tree}, finds the tree with the highest product of the posterior probability of all its nodes.
+
+Choose {\bf Mean heights} for node heights. This sets the heights (ages) of each node in the tree to the mean height across the entire sample of trees for that clade.
+
+For the input file, select the trees file that BEAST created (by default this will be called \texttt{gopher.species.trees}) and select a file for the output (here we called it \texttt{gopher.species.tree}).
+
+Now press \texttt{Run} and wait for the program to finish.
+
+\subsection*{Viewing the Species Tree}
+
+Finally, we can look at the tree in another program called {\bf FigTree}. Run this program, and open
+the \texttt{gopher.species.tree} file by using the Open command in the File menu. The tree should appear.
+You can now try selecting some of the options in the control panel on the left. Try selecting
+{\bf Node Bars} to get node age error bars. Also turn on {\bf Branch Labels} and select {\bf posterior} to get
+it to display the posterior probability for each node. Under {\bf Appearance} you can also tell FigTree
+to colour the branches by the rate.
+You should end up with something like Figure \ref{fig.figtree}.
+
+\begin{figure}
+\centering
+\includeimage[width=\textwidth]{figures/figtree}
+
+\caption{\label{fig.figtree} Figtree representation of the species tree.}
+\end{figure}
+
+
+Alternatively, you can load the species tree set into DensiTree and set it up as follows.
+
+\begin{itemize}
+\item Set burn-in to 500. The tree should not be collapsed any more.
+\item Show a root-canal tree to guide the eye. Perhaps, the intensity of the trees is not large enough, so you might want to increase the intensity by clicking the icon in the button bar.
+\item Show clades, their mean and 95\% HPD graphically, and posterior support using text. Now, too many clades are shown, and most are not of interest. Select 'Selected only', then open the clade toolbar (menu Window/View clade toolbar), and select only highly supported clades. Also, select the clade consisting of heterodus, bottea, umbinus and townsendii, to show that heterodus is an outgroup,
+but there is some support (over 16\%) that it is not.
+\item Drag the clade monticola and idahoensis up so that the 95\% HPD bar does not overlap with the one for mazama, monticola, idahoensis and talpoidis. Increase font size of the label for better readability.
+\end{itemize}
+
+The image should look something like Figure \ref{fig.DensiTree}
+
+\begin{figure}
+\centering
+\includeimage[scale=0.4]{figures/DensiTree}
+\caption{\label{fig.DensiTree} DensiTree representation of the species tree.}
+\end{figure}
+
+Exercise: There is about 75\% support for heterodus to be an outgroup, and about 17\% for heterodus to be in a clade with bottea, umbinus and townsendii. Can you explain where the other 8\% went?
+
+
+DensiTree can be used to show the branch widths of summary 
+tree from tree annotator as population sizes. 
+%Under `Line Width' in DensiTree, choose `dmv1' for the bottom and `dmv2' for the top.
+Under `Line Width' in DensiTree, choose `BY\_METADATA\_NUMBER' for the bottom and for the top,
+and choose numbers 2 and 3 in the 'top' and 'bottom' spinner.
+Left, the bottom represents dmv1, the top dmv2 in the summary tree, which do not quite match 
+in areas with little posterior support for the clades (see Figure \ref{fig.DensiTree} to
+see which clades have little support).
+
+
+Right, the top is matched up with the bottom of the branch above, using the `Make fit to bottom'
+option for the top. This looks a bit prettier, but may not be quite accurate.
+
+\begin{figure}
+\centering
+\includeimage[scale=0.18]{figures/species_population1}
+\includeimage[scale=0.18]{figures/species_population2}
+\end{figure}
+
+Alternatively, a consensus tree can be generated by biopy (\url{http://code.google.com/p/biopy/})
+with using 1-norm left, and 2-norm right.
+
+\begin{figure}
+\centering
+\includeimage[scale=0.18]{figures/species_population4}
+\includeimage[scale=0.18]{figures/species_population5}
+\end{figure}
+
+Showing all consensus trees with population widths
+(use By Metadata Pattern, for top and bottom and use {\begin{verbatim} .*dmv=.([^,]*).*\end{verbatim}} 
+for the bottom pattern and {\begin{verbatim} .*dmv=.[^,]*,([^\}]*).*\end{verbatim}} for the top pattern.
+This gives us this visualisation:
+
+\begin{figure}
+\centering
+\includeimage[scale=0.25]{figures/species_population3}
+\end{figure}
+
+
+\subsection*{Comparing your results to the prior}
+
+Using BEAUti, set up the same analysis but under the MCMC options, select the {\bf Sample from prior only} option. This will allow you to visualize the full prior distribution in the absence of your sequence data. Summarize the trees from the full prior
+distribution and compare the summary to the posterior summary tree.
+
+
+\bibliographystyle{plain}
+\bibliography{StarBEAST_tutorial}
+
+\end{document}
+
diff --git a/doc/tutorials/STARBEAST/StarBEAST_tutorialv2.2.0.pdf b/doc/tutorials/STARBEAST/StarBEAST_tutorialv2.2.0.pdf
new file mode 100644
index 0000000..95036d8
Binary files /dev/null and b/doc/tutorials/STARBEAST/StarBEAST_tutorialv2.2.0.pdf differ
diff --git a/doc/tutorials/STARBEAST/figures/BEAST.png b/doc/tutorials/STARBEAST/figures/BEAST.png
new file mode 100644
index 0000000..cfef1e6
Binary files /dev/null and b/doc/tutorials/STARBEAST/figures/BEAST.png differ
diff --git a/doc/tutorials/STARBEAST/figures/BEAUti_ClockModel1.png b/doc/tutorials/STARBEAST/figures/BEAUti_ClockModel1.png
new file mode 100644
index 0000000..d22c502
Binary files /dev/null and b/doc/tutorials/STARBEAST/figures/BEAUti_ClockModel1.png differ
diff --git a/doc/tutorials/STARBEAST/figures/BEAUti_ClockModel2.png b/doc/tutorials/STARBEAST/figures/BEAUti_ClockModel2.png
new file mode 100644
index 0000000..823f39e
Binary files /dev/null and b/doc/tutorials/STARBEAST/figures/BEAUti_ClockModel2.png differ
diff --git a/doc/tutorials/STARBEAST/figures/BEAUti_ClockModel3.png b/doc/tutorials/STARBEAST/figures/BEAUti_ClockModel3.png
new file mode 100644
index 0000000..67c3e9a
Binary files /dev/null and b/doc/tutorials/STARBEAST/figures/BEAUti_ClockModel3.png differ
diff --git a/doc/tutorials/STARBEAST/figures/BEAUti_DataPartitions.png b/doc/tutorials/STARBEAST/figures/BEAUti_DataPartitions.png
new file mode 100644
index 0000000..5eab1c0
Binary files /dev/null and b/doc/tutorials/STARBEAST/figures/BEAUti_DataPartitions.png differ
diff --git a/doc/tutorials/STARBEAST/figures/BEAUti_Guess_Taxonsets.png b/doc/tutorials/STARBEAST/figures/BEAUti_Guess_Taxonsets.png
new file mode 100644
index 0000000..2f808b5
Binary files /dev/null and b/doc/tutorials/STARBEAST/figures/BEAUti_Guess_Taxonsets.png differ
diff --git a/doc/tutorials/STARBEAST/figures/BEAUti_MCMC.png b/doc/tutorials/STARBEAST/figures/BEAUti_MCMC.png
new file mode 100644
index 0000000..acda5a3
Binary files /dev/null and b/doc/tutorials/STARBEAST/figures/BEAUti_MCMC.png differ
diff --git a/doc/tutorials/STARBEAST/figures/BEAUti_MSP.png b/doc/tutorials/STARBEAST/figures/BEAUti_MSP.png
new file mode 100644
index 0000000..faf2c85
Binary files /dev/null and b/doc/tutorials/STARBEAST/figures/BEAUti_MSP.png differ
diff --git a/doc/tutorials/STARBEAST/figures/BEAUti_Prior.png b/doc/tutorials/STARBEAST/figures/BEAUti_Prior.png
new file mode 100644
index 0000000..350431b
Binary files /dev/null and b/doc/tutorials/STARBEAST/figures/BEAUti_Prior.png differ
diff --git a/doc/tutorials/STARBEAST/figures/BEAUti_Site_Model.png b/doc/tutorials/STARBEAST/figures/BEAUti_Site_Model.png
new file mode 100644
index 0000000..3c63b23
Binary files /dev/null and b/doc/tutorials/STARBEAST/figures/BEAUti_Site_Model.png differ
diff --git a/doc/tutorials/STARBEAST/figures/BEAUti_selectTemplate.png b/doc/tutorials/STARBEAST/figures/BEAUti_selectTemplate.png
new file mode 100644
index 0000000..aa9f2ba
Binary files /dev/null and b/doc/tutorials/STARBEAST/figures/BEAUti_selectTemplate.png differ
diff --git a/doc/tutorials/STARBEAST/figures/DensiTree.png b/doc/tutorials/STARBEAST/figures/DensiTree.png
new file mode 100644
index 0000000..977dffc
Binary files /dev/null and b/doc/tutorials/STARBEAST/figures/DensiTree.png differ
diff --git a/doc/tutorials/STARBEAST/figures/Tracer1.png b/doc/tutorials/STARBEAST/figures/Tracer1.png
new file mode 100644
index 0000000..d936238
Binary files /dev/null and b/doc/tutorials/STARBEAST/figures/Tracer1.png differ
diff --git a/doc/tutorials/STARBEAST/figures/Tracer2.png b/doc/tutorials/STARBEAST/figures/Tracer2.png
new file mode 100644
index 0000000..51cf326
Binary files /dev/null and b/doc/tutorials/STARBEAST/figures/Tracer2.png differ
diff --git a/doc/tutorials/STARBEAST/figures/TreeAnnotator.png b/doc/tutorials/STARBEAST/figures/TreeAnnotator.png
new file mode 100644
index 0000000..d309ab9
Binary files /dev/null and b/doc/tutorials/STARBEAST/figures/TreeAnnotator.png differ
diff --git a/doc/tutorials/STARBEAST/figures/cloneFrom.png b/doc/tutorials/STARBEAST/figures/cloneFrom.png
new file mode 100644
index 0000000..c553126
Binary files /dev/null and b/doc/tutorials/STARBEAST/figures/cloneFrom.png differ
diff --git a/doc/tutorials/STARBEAST/figures/figtree.png b/doc/tutorials/STARBEAST/figures/figtree.png
new file mode 100644
index 0000000..93a73e3
Binary files /dev/null and b/doc/tutorials/STARBEAST/figures/figtree.png differ
diff --git a/doc/tutorials/STARBEAST/figures/gopher.pdf b/doc/tutorials/STARBEAST/figures/gopher.pdf
new file mode 100644
index 0000000..ecae946
Binary files /dev/null and b/doc/tutorials/STARBEAST/figures/gopher.pdf differ
diff --git a/doc/tutorials/STARBEAST/figures/species_population1.pdf b/doc/tutorials/STARBEAST/figures/species_population1.pdf
new file mode 100644
index 0000000..ed691c7
Binary files /dev/null and b/doc/tutorials/STARBEAST/figures/species_population1.pdf differ
diff --git a/doc/tutorials/STARBEAST/figures/species_population2.pdf b/doc/tutorials/STARBEAST/figures/species_population2.pdf
new file mode 100644
index 0000000..bcb28e5
Binary files /dev/null and b/doc/tutorials/STARBEAST/figures/species_population2.pdf differ
diff --git a/doc/tutorials/STARBEAST/figures/species_population3.pdf b/doc/tutorials/STARBEAST/figures/species_population3.pdf
new file mode 100644
index 0000000..da1d58d
Binary files /dev/null and b/doc/tutorials/STARBEAST/figures/species_population3.pdf differ
diff --git a/doc/tutorials/STARBEAST/figures/species_population4.pdf b/doc/tutorials/STARBEAST/figures/species_population4.pdf
new file mode 100644
index 0000000..295feaa
Binary files /dev/null and b/doc/tutorials/STARBEAST/figures/species_population4.pdf differ
diff --git a/doc/tutorials/STARBEAST/figures/species_population5.pdf b/doc/tutorials/STARBEAST/figures/species_population5.pdf
new file mode 100644
index 0000000..f40c8bc
Binary files /dev/null and b/doc/tutorials/STARBEAST/figures/species_population5.pdf differ
diff --git a/doc/tutorials/tex2html.sh b/doc/tutorials/tex2html.sh
new file mode 100755
index 0000000..1c9a858
--- /dev/null
+++ b/doc/tutorials/tex2html.sh
@@ -0,0 +1,29 @@
+#!/usr/bin/env bash
+# input latex file name without extensions, not handle path
+# for example: 
+# cd doc/tutorials/STARBEAST
+# ../tex2html StarBEAST_tutorial
+
+TEX=$1
+
+if [[ $string == *"."* ]]; then
+	echo "input latex file name without extensions !"
+	exit 0
+fi
+
+# compile latex
+pdflatex $1
+bibtex $1
+pdflatex $1
+pdflatex $1
+
+# generate raw html
+hevea $1
+
+# modify html
+sed -i.bak 's/style>/style><link rel=\"stylesheet\" type=\"text\/css\" href=\"..\/..\/beast2.css\">/g' $1.html
+
+# TODO: how use parameter to replace \1 or $1?
+sed -i.bak 's/<body >/<body ><div id=\"container\">/g' $1.html
+
+sed -i.bak 's/<\/body>/<\/div><\/body>/g' $1.html
diff --git a/examples/beast2vs1/beast1/testBSP1.xml b/examples/beast2vs1/beast1/testBSP1.xml
new file mode 100644
index 0000000..dfce95e
--- /dev/null
+++ b/examples/beast2vs1/beast1/testBSP1.xml
@@ -0,0 +1,317 @@
+<?xml version="1.0" standalone="yes"?>
+<beast>
+
+    <!-- The list of taxa analyse (can also include dates/ages).                 -->
+    <!-- ntax=17                                                                 -->
+    <taxa id="taxa">
+        <taxon id="D4Brazi82">
+            <date value="1982.0" direction="forwards" units="years"/>
+        </taxon>
+        <taxon id="D4ElSal83">
+            <date value="1983.0" direction="forwards" units="years"/>
+        </taxon>
+        <taxon id="D4ElSal94">
+            <date value="1994.0" direction="forwards" units="years"/>
+        </taxon>
+        <taxon id="D4Indon76">
+            <date value="1976.0" direction="forwards" units="years"/>
+        </taxon>
+        <taxon id="D4Indon77">
+            <date value="1977.0" direction="forwards" units="years"/>
+        </taxon>
+        <taxon id="D4Mexico84">
+            <date value="1984.0" direction="forwards" units="years"/>
+        </taxon>
+        <taxon id="D4NewCal81">
+            <date value="1981.0" direction="forwards" units="years"/>
+        </taxon>
+        <taxon id="D4Philip64">
+            <date value="1964.0" direction="forwards" units="years"/>
+        </taxon>
+        <taxon id="D4Philip56">
+            <date value="1956.0" direction="forwards" units="years"/>
+        </taxon>
+        <taxon id="D4Philip84">
+            <date value="1984.0" direction="forwards" units="years"/>
+        </taxon>
+        <taxon id="D4PRico86">
+            <date value="1986.0" direction="forwards" units="years"/>
+        </taxon>
+        <taxon id="D4SLanka78">
+            <date value="1978.0" direction="forwards" units="years"/>
+        </taxon>
+        <taxon id="D4Tahiti79">
+            <date value="1979.0" direction="forwards" units="years"/>
+        </taxon>
+        <taxon id="D4Tahiti85">
+            <date value="1985.0" direction="forwards" units="years"/>
+        </taxon>
+        <taxon id="D4Thai63">
+            <date value="1963.0" direction="forwards" units="years"/>
+        </taxon>
+        <taxon id="D4Thai78">
+            <date value="1978.0" direction="forwards" units="years"/>
+        </taxon>
+        <taxon id="D4Thai84">
+            <date value="1984.0" direction="forwards" units="years"/>
+        </taxon>
+    </taxa>
+
+    <!-- The sequence alignment (each sequence refers to a taxon above).         -->
+    <!-- ntax=17 nchar=1485                                                      -->
+    <alignment id="alignment" dataType="nucleotide">
+        <sequence>
+            <taxon idref="D4Brazi82"/>
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence>
+            <taxon idref="D4ElSal83"/>
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence>
+            <taxon idref="D4ElSal94"/>
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTGGTGCTAGAACATGGAGGATGCGTCACAACCATAGCCCAGGGAAAACCAACCTTGGATTTTGAATTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGGAATGGCTGTGGCTTGCTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGATACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence>
+            <taxon idref="D4Indon76"/>
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTAAAAGAGGAACAAGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence>
+            <taxon idref="D4Indon77"/>
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTAAAAGAGGAACAAGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTAGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAACCATGGAGTT [...]
+        </sequence>
+        <sequence>
+            <taxon idref="D4Mexico84"/>
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTAGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGCTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence>
+            <taxon idref="D4NewCal81"/>
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence>
+            <taxon idref="D4Philip64"/>
+            ATGCGATGCGTGGGAGTGGGGAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATTTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCGATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAACCTTATCTCAAAGAGGAACAAGATCAACAGTACATCTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGATACATCCAACCATGGAGTG [...]
+        </sequence>
+        <sequence>
+            <taxon idref="D4Philip56"/>
+            ATGCGATGCGTGGGAGTGGGGAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATTTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCGATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAACCTTATCTCAAAGAGGAACAAGATCAACAGTACATCTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGCTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTAGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACATATCCAACCATGGAGTG [...]
+        </sequence>
+        <sequence>
+            <taxon idref="D4Philip84"/>
+            ATGCGATGCGTAGGAGTGGGGAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACTTAGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAAGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCGATATCAAACATAACCACGGCAACAAGATGCCCAACGCAAGGAGAACCTTATCTCAAAGAGGAACAAGATCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTCTCATGCTCGGGAAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATATACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAACCATGGAGTG [...]
+        </sequence>
+        <sequence>
+            <taxon idref="D4PRico86"/>
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGGGAGCCCTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATCTGGTCCAAATTGAGAACCTTGAGTACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence>
+            <taxon idref="D4SLanka78"/>
+            ATGCGATGCGTGGGAGTGGGGAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAAGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCCATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAGCCCTGTCTCAAAGAGGAACAGGATCAACAGTACATCTGCCGGAGAGACGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCCTGCTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACAGGCAACTTAGTCCGAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAACCACGGAGTG [...]
+        </sequence>
+        <sequence>
+            <taxon idref="D4Tahiti79"/>
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence>
+            <taxon idref="D4Tahiti85"/>
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTTTCAGGTGGAGCATGGGTCGATTTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATCTGGTCCAAATTGAGAACCTTGAATACACAGTGGTCATAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence>
+            <taxon idref="D4Thai63"/>
+            ATGCGATGCGTAGGAGTGGGGAACAGGGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCTCAAGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCGATATCAAACATAACCACGGCGACAAGATGTCCAACGCAAGGAGAGCCTTATCTCAAAGAGGAACAAGATCAACAGTACATCTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTACTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACAGGCAACTTGGTTCGAATTGAGAACCTTGAATACACAGTGGTTGTGACAGTCCACAACGGAGACACCCATGCAGTAGGAAATGACATATCCAACCATGGAGTG [...]
+        </sequence>
+        <sequence>
+            <taxon idref="D4Thai78"/>
+            ATGCGATGCGTAGGAGTGGGGAACAGAGACTTTGTAGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCCATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTACCTCAAAGAGGAACAAGATCAACAGTACATCTGCCGGAGAGACGTGGTAGATAGAGGGTGGGGCAACGGCTGTGGCTTGCTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACAGGCAACTTAGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCTGTAGGAAATGATACATCCAACCACGGAGTG [...]
+        </sequence>
+        <sequence>
+            <taxon idref="D4Thai84"/>
+            ATGCGATGCGTAGGAGTAGGGAACAGAGACTTTGTAGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAGGGAAAACCAACCCTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCCATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTACCTCAAAGAGGAACAAGATCAACAGTACATCTGCCGGAGAGACGTGGTAGACAGAGGGTGGGGCAACGGCTGTGGCTTGTTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACGGGCAACTTAGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCTGTAGGAAATGATACATCCAACCACGGAGTG [...]
+        </sequence>
+    </alignment>
+
+    <!-- The unique patterns for all positions                                   -->
+    <!-- npatterns=138                                                           -->
+    <patterns id="patterns" from="1">
+        <alignment idref="alignment"/>
+    </patterns>
+
+    <!-- This is a simple constant population size coalescent model              -->
+    <!-- that is used to generate an initial tree for the chain.                 -->
+    <constantSize id="initialDemo" units="years">
+        <populationSize>
+            <parameter id="initialDemo.popSize" value="100.0"/>
+        </populationSize>
+    </constantSize>
+
+    <!-- Generate a random starting tree under the coalescent process            -->
+    <coalescentTree id="startingTree">
+        <taxa idref="taxa"/>
+        <constantSize idref="initialDemo"/>
+    </coalescentTree>
+
+    <treeModel id="treeModel">
+        <coalescentTree idref="startingTree"/>
+        <rootHeight>
+            <parameter id="treeModel.rootHeight"/>
+        </rootHeight>
+        <nodeHeights internalNodes="true">
+            <parameter id="treeModel.internalNodeHeights"/>
+        </nodeHeights>
+        <nodeHeights internalNodes="true" rootNode="true">
+            <parameter id="treeModel.allInternalNodeHeights"/>
+        </nodeHeights>
+    </treeModel>
+
+    <generalizedSkyLineLikelihood id="skyline" linear="false">
+        <populationSizes>
+            <parameter id="skyline.popSize" dimension="5" value="380.0" lower="0.0" upper="38000.0"/>
+        </populationSizes>
+        <groupSizes>
+            <parameter id="skyline.groupSize" dimension="5"/>
+        </groupSizes>
+        <populationTree>
+            <treeModel idref="treeModel"/>
+        </populationTree>
+    </generalizedSkyLineLikelihood>
+
+    <exponentialMarkovLikelihood id="eml1" jeffreys="true">
+        <chainParameter>
+            <parameter idref="skyline.popSize"/>
+        </chainParameter>
+    </exponentialMarkovLikelihood>
+    
+    <!-- The strict clock (Uniform rates across branches)                        -->
+    <strictClockBranchRates id="branchRates">
+        <rate>
+            <parameter id="clock.rate" value="8.8579E-4" lower="0.0" upper="100.0"/>
+        </rate>
+    </strictClockBranchRates>
+
+    <!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+    <hkyModel id="hky">
+        <frequencies>
+            <frequencyModel dataType="nucleotide">
+                <alignment idref="alignment"/>
+                <frequencies>
+                    <parameter id="hky.frequencies" dimension="4"/>
+                </frequencies>
+            </frequencyModel>
+        </frequencies>
+        <kappa>
+            <parameter id="hky.kappa" value="21.5056" lower="0.0" upper="100.0"/>
+        </kappa>
+    </hkyModel>
+
+    <!-- site model                                                              -->
+    <siteModel id="siteModel">
+        <substitutionModel>
+            <hkyModel idref="hky"/>
+        </substitutionModel>
+        <gammaShape gammaCategories="4">
+            <parameter id="siteModel.alpha" value="5.40372E-2" lower="0.0" upper="100.0"/>
+        </gammaShape>
+    </siteModel>
+
+    <treeLikelihood id="treeLikelihood">
+        <patterns idref="patterns"/>
+        <treeModel idref="treeModel"/>
+        <siteModel idref="siteModel"/>
+        <strictClockBranchRates idref="branchRates"/>
+    </treeLikelihood>
+
+    <operators id="operators">
+        <scaleOperator scaleFactor="0.75" weight="1">
+            <parameter idref="hky.kappa"/>
+        </scaleOperator>
+        <scaleOperator scaleFactor="0.75" weight="1">
+            <parameter idref="siteModel.alpha"/>
+        </scaleOperator>
+        <scaleOperator scaleFactor="0.75" weight="3">
+            <parameter idref="clock.rate"/>
+        </scaleOperator>
+        <upDownOperator scaleFactor="0.75" weight="3">
+            <up>
+                <parameter idref="clock.rate"/>
+            </up>
+            <down>
+                <parameter idref="treeModel.allInternalNodeHeights"/>
+            </down>
+        </upDownOperator>
+        <scaleOperator scaleFactor="0.75" weight="15">
+            <parameter idref="skyline.popSize"/>
+        </scaleOperator>
+        <deltaExchange delta="1" integer="true" weight="6" autoOptimize="false">
+            <parameter idref="skyline.groupSize"/>
+        </deltaExchange>
+        <scaleOperator scaleFactor="0.75" weight="3">
+            <parameter idref="treeModel.rootHeight"/>
+        </scaleOperator>
+        <uniformOperator weight="30">
+            <parameter idref="treeModel.internalNodeHeights"/>
+        </uniformOperator>
+        <subtreeSlide size="1.0" gaussian="true" weight="15">
+            <treeModel idref="treeModel"/>
+        </subtreeSlide>
+        <narrowExchange weight="15">
+            <treeModel idref="treeModel"/>
+        </narrowExchange>
+        <wideExchange weight="3">
+            <treeModel idref="treeModel"/>
+        </wideExchange>
+        <wilsonBalding weight="3">
+            <treeModel idref="treeModel"/>
+        </wilsonBalding>
+    </operators>
+
+    <mcmc id="mcmc" chainLength="10000000" autoOptimize="true">
+        <posterior id="posterior">
+            <prior id="prior">
+                <generalizedSkyLineLikelihood idref="skyline"/>
+                <exponentialMarkovLikelihood idref="eml1"/>
+            </prior>
+            <likelihood id="likelihood">
+                <treeLikelihood idref="treeLikelihood"/>
+            </likelihood>
+        </posterior>
+        <operators idref="operators"/>
+        <log id="screenLog" logEvery="100000">
+            <column label="Posterior" dp="4" width="12">
+                <posterior idref="posterior"/>
+            </column>
+            <column label="Root Height" sf="6" width="12">
+                <parameter idref="treeModel.rootHeight"/>
+            </column>
+            <column label="L(tree)" dp="4" width="12">
+                <treeLikelihood idref="treeLikelihood"/>
+            </column>
+            <column label="L(coalecent)" dp="4" width="12">
+                <generalizedSkyLineLikelihood idref="skyline"/>
+            </column>
+        </log>
+        <log id="fileLog" logEvery="1000" fileName="testBSP.log">
+            <posterior idref="posterior"/>
+            <prior idref="prior"/>
+            <parameter idref="siteModel.alpha"/>
+            <parameter idref="clock.rate"/>
+            <parameter idref="skyline.popSize"/>
+            <parameter idref="skyline.groupSize"/>
+            <parameter idref="hky.kappa"/>
+            <parameter idref="treeModel.rootHeight"/>
+            <treeLikelihood idref="treeLikelihood"/>
+            <generalizedSkyLineLikelihood idref="skyline"/>
+            <exponentialMarkovLikelihood idref="eml1"/>
+        </log>
+        <!-- <logTree id="treeFileLog" logEvery="1000" nexusFormat="true" fileName="testBSP.trees">
+            <treeModel idref="treeModel"/>
+            <posterior idref="posterior"/>
+        </logTree> -->
+    </mcmc>
+
+    <report>
+        <property name="timer">
+            <object idref="mcmc"/>
+        </property>
+    </report>
+
+</beast>
diff --git a/examples/beast2vs1/beast1/testBSPNoClock.xml b/examples/beast2vs1/beast1/testBSPNoClock.xml
new file mode 100644
index 0000000..5fd303d
--- /dev/null
+++ b/examples/beast2vs1/beast1/testBSPNoClock.xml
@@ -0,0 +1,239 @@
+<?xml version="1.0" standalone="yes"?>
+
+<!-- Generated by BEAUTi v1.7.0 Prerelease r3910                             -->
+<!--       by Alexei J. Drummond and Andrew Rambaut                          -->
+<!--       Department of Computer Science, University of Auckland and        -->
+<!--       Institute of Evolutionary Biology, University of Edinburgh        -->
+<!--       http://beast.bio.ed.ac.uk/                                        -->
+<beast>
+
+    <!-- The list of taxa to be analysed (can also include dates/ages).          -->
+    <!-- ntax=6                                                                  -->
+    <taxa id="taxa">
+        <taxon id="human"/>
+        <taxon id="chimp"/>
+        <taxon id="bonobo"/>
+        <taxon id="gorilla"/>
+        <taxon id="orangutan"/>
+        <taxon id="siamang"/>
+    </taxa>
+
+    <!-- The sequence alignment (each sequence refers to a taxon above).         -->
+    <!-- ntax=6 nchar=768                                                        -->
+    <alignment id="alignment" dataType="nucleotide">
+        <sequence>
+            <taxon idref="human"/>
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence>
+            <taxon idref="chimp"/>
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence>
+            <taxon idref="bonobo"/>
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAGC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTTGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence>
+            <taxon idref="gorilla"/>
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTAAACATAGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA-CAACACTTAATTTCTGTAAGGACTGCAAAACCCTACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCAATGGGACTCAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAT-TCAC [...]
+        </sequence>
+        <sequence>
+            <taxon idref="orangutan"/>
+            AGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA-CAGCACTTAATTTCTGTAAGGACTGCAAAACCCCACTTTGCATCAACTGAGCGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCCTAGACCGATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAT-TGGCTTCAGTCCAAAGCCCCGGCAGGCCTTAAAGCTGCTCCTTCGAATTTGCAATTCAACATGACAA-TCAC [...]
+        </sequence>
+        <sequence>
+            <taxon idref="siamang"/>
+            AGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTAACAAAACTTAATTTCTGCAAGGGCTGCAAAACCCTACTTTGCATCAACCGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCGATGGGACTTAAACCCATAAAAATTTAGTTAACAGCTAAACACCCTAAACAACCTGGCTTCAATCTAAAGCCCCGGCAGA-GTTGAAGCTGCTTCTTTGAACTTGCAATTCAACGTGAAAAATCAC [...]
+        </sequence>
+    </alignment>
+
+    <!-- The unique patterns from 1 to end                                       -->
+    <!-- npatterns=69                                                            -->
+    <patterns id="patterns" from="1">
+        <alignment idref="alignment"/>
+    </patterns>
+
+    <!-- A prior assumption that the population size has remained constant       -->
+    <!-- throughout the time spanned by the genealogy.                           -->
+    <constantSize id="constant" units="substitutions">
+        <populationSize>
+            <parameter id="constant.popSize" value="100" lower="0.0" upper="Infinity"/>
+        </populationSize>
+    </constantSize>
+
+    <!-- Generate a random starting tree under the coalescent process            -->
+    <coalescentTree id="startingTree" rootHeight="380.0">
+        <taxa idref="taxa"/>
+        <constantSize idref="constant"/>
+    </coalescentTree>
+
+    <!-- Generate a tree model                                                   -->
+    <treeModel id="treeModel">
+        <coalescentTree idref="startingTree"/>
+        <rootHeight>
+            <parameter id="treeModel.rootHeight"/>
+        </rootHeight>
+        <nodeHeights internalNodes="true">
+            <parameter id="treeModel.internalNodeHeights"/>
+        </nodeHeights>
+        <nodeHeights internalNodes="true" rootNode="true">
+            <parameter id="treeModel.allInternalNodeHeights"/>
+        </nodeHeights>
+    </treeModel>
+
+    <generalizedSkyLineLikelihood id="skyline" linear="false">
+        <populationSizes>
+            <parameter id="skyline.popSize" dimension="3" value="380.0" lower="0.0" upper="38000.0"/>
+        </populationSizes>
+        <groupSizes>
+            <parameter id="skyline.groupSize" dimension="3"/>
+        </groupSizes>
+        <populationTree>
+            <treeModel idref="treeModel"/>
+        </populationTree>
+    </generalizedSkyLineLikelihood>
+
+    <exponentialMarkovLikelihood id="eml1" jeffreys="true">
+        <chainParameter>
+            <parameter idref="skyline.popSize"/>
+        </chainParameter>
+    </exponentialMarkovLikelihood> 
+
+    <!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+    <HKYModel id="hky">
+        <frequencies>
+            <frequencyModel dataType="nucleotide">
+                <frequencies>
+                    <parameter id="frequencies" value="0.25 0.25 0.25 0.25"/>
+                </frequencies>
+            </frequencyModel>
+        </frequencies>
+        <kappa>
+            <parameter id="kappa" value="2.0" lower="0.0" upper="Infinity"/>
+        </kappa>
+    </HKYModel>
+
+    <!-- site model                                                              -->
+    <siteModel id="siteModel">
+        <substitutionModel>
+            <HKYModel idref="hky"/>
+        </substitutionModel>
+    </siteModel>
+
+    <!-- Likelihood for tree given sequence data                                 -->
+    <treeLikelihood id="treeLikelihood" useAmbiguities="false">
+        <patterns idref="patterns"/>
+        <treeModel idref="treeModel"/>
+        <siteModel idref="siteModel"/>
+    </treeLikelihood>
+
+    <!-- Define operators                                                        -->
+    <operators id="operators">
+        <scaleOperator scaleFactor="0.75" weight="0.1">
+            <parameter idref="kappa"/>
+        </scaleOperator>
+        <deltaExchange delta="0.01" weight="0.1">
+            <parameter idref="frequencies"/>
+        </deltaExchange>
+        <subtreeSlide size="0.0077" gaussian="true" weight="15">
+            <treeModel idref="treeModel"/>
+        </subtreeSlide>
+        <narrowExchange weight="15">
+            <treeModel idref="treeModel"/>
+        </narrowExchange>
+        <wideExchange weight="3">
+            <treeModel idref="treeModel"/>
+        </wideExchange>
+        <wilsonBalding weight="3">
+            <treeModel idref="treeModel"/>
+        </wilsonBalding>
+        <scaleOperator scaleFactor="0.75" weight="3">
+            <parameter idref="treeModel.rootHeight"/>
+        </scaleOperator>
+        <uniformOperator weight="30">
+            <parameter idref="treeModel.internalNodeHeights"/>
+        </uniformOperator>
+        <scaleOperator scaleFactor="0.75" weight="15">
+            <parameter idref="skyline.popSize"/>
+        </scaleOperator>
+        <deltaExchange delta="1" integer="true" weight="3" autoOptimize="false">
+            <parameter idref="skyline.groupSize"/>
+        </deltaExchange>
+        <upDownOperator scaleFactor="0.75" weight="3">
+            <up>
+            </up>
+            <down>
+                <parameter idref="treeModel.allInternalNodeHeights"/>
+            </down>
+        </upDownOperator>
+    </operators>
+
+    <!-- Define MCMC                                                             -->
+    <mcmc id="mcmc" chainLength="10000000" autoOptimize="true">
+        <posterior id="posterior">
+            <prior id="prior">
+                <logNormalPrior id="hky.kappa.prior" mean="1.0" stdev="1.25" offset="0.0" meanInRealSpace="false">
+                    <parameter idref="kappa"/>
+                </logNormalPrior>
+                <uniformPrior id="hky.frequencies.prior" lower="0.0" upper="1.0">
+                    <parameter idref="frequencies"/>
+                </uniformPrior>
+                <generalizedSkyLineLikelihood idref="skyline"/>
+                <exponentialMarkovLikelihood idref="eml1"/> 
+            </prior>
+            <likelihood id="likelihood">
+                <treeLikelihood idref="treeLikelihood"/>
+            </likelihood>
+        </posterior>
+        <operators idref="operators"/>
+
+        <!-- write log to screen                                                     -->
+        <log id="screenLog" logEvery="100000">
+            <column label="Posterior" dp="4" width="12">
+                <posterior idref="posterior"/>
+            </column>
+            <column label="Prior" dp="4" width="12">
+                <prior idref="prior"/>
+            </column>
+            <column label="Likelihood" dp="4" width="12">
+                <likelihood idref="likelihood"/>
+            </column>
+            <column label="rootHeight" sf="6" width="12">
+                <parameter idref="treeModel.rootHeight"/>
+            </column>
+            <column label="L(coalecent)" dp="4" width="12">
+                <generalizedSkyLineLikelihood idref="skyline"/>
+            </column>
+            <parameter idref="skyline.popSize"/>            
+        </log>
+
+        <!-- write log to file                                                       -->
+        <log id="fileLog" logEvery="1000" fileName="testBSPNoClock.log" overwrite="false">
+            <posterior idref="posterior"/>
+            <prior idref="prior"/>
+            <likelihood idref="likelihood"/>
+            <parameter idref="treeModel.rootHeight"/>
+            <parameter idref="skyline.popSize"/>
+            <parameter idref="skyline.groupSize"/>
+            <parameter idref="kappa"/>
+            <parameter idref="frequencies"/>
+            <treeLikelihood idref="treeLikelihood"/>
+            <generalizedSkyLineLikelihood idref="skyline"/>
+            <exponentialMarkovLikelihood idref="eml1"/>
+            <!-- <logNormalPrior idref="hky.kappa.prior"/>
+            <uniformPrior idref="hky.frequencies.prior"/>  -->
+        </log>
+
+        <!-- write tree log to file
+          <logTree id="treeFileLog" logEvery="1000" nexusFormat="true" fileName="testBSPNoClock.trees" sortTranslationTable="true">
+              <treeModel idref="treeModel"/>
+              <posterior idref="posterior"/>
+          </logTree> -->
+    </mcmc>
+    <report>
+        <property name="timer">
+            <mcmc idref="mcmc"/>
+        </property>
+    </report>
+    <!--     <treeTraceAnalysis fileName="testCoalescentNoClock.trees"/> -->
+</beast>
diff --git a/examples/beast2vs1/beast1/testBirthDeathAsYule.xml b/examples/beast2vs1/beast1/testBirthDeathAsYule.xml
new file mode 100644
index 0000000..ba83315
--- /dev/null
+++ b/examples/beast2vs1/beast1/testBirthDeathAsYule.xml
@@ -0,0 +1,296 @@
+<?xml version="1.0" standalone="yes"?>
+<!-- $Id: testML.xml,v 1.2 2005/07/11 23:22:40 rambaut Exp $ -->
+<!-- Tests the Yule model -->
+
+<beast>
+
+    <taxa id="taxa">
+        <taxon id="tip1"/>
+        <taxon id="tip2"/>
+        <taxon id="tip3"/>
+        <taxon id="tip4"/>
+        <taxon id="tip5"/>
+        <taxon id="tip6"/>
+        <taxon id="tip7"/>
+        <taxon id="tip8"/>
+        <taxon id="tip9"/>
+        <taxon id="tip10"/>
+        <taxon id="tip11"/>
+        <taxon id="tip12"/>
+        <taxon id="tip13"/>
+        <taxon id="tip14"/>
+        <taxon id="tip15"/>
+        <taxon id="tip16"/>
+        <taxon id="tip17"/>
+        <taxon id="tip18"/>
+        <taxon id="tip19"/>
+        <taxon id="tip20"/>
+        <taxon id="tip21"/>
+        <taxon id="tip22"/>
+        <taxon id="tip23"/>
+        <taxon id="tip24"/>
+        <taxon id="tip25"/>
+        <taxon id="tip26"/>
+        <taxon id="tip27"/>
+        <taxon id="tip28"/>
+        <taxon id="tip29"/>
+        <taxon id="tip30"/>
+        <taxon id="tip31"/>
+        <taxon id="tip32"/>
+        <taxon id="tip33"/>
+        <taxon id="tip34"/>
+        <taxon id="tip35"/>
+        <taxon id="tip36"/>
+        <taxon id="tip37"/>
+        <taxon id="tip38"/>
+        <taxon id="tip39"/>
+        <taxon id="tip40"/>
+        <taxon id="tip41"/>
+        <taxon id="tip42"/>
+        <taxon id="tip43"/>
+        <taxon id="tip44"/>
+        <taxon id="tip45"/>
+        <taxon id="tip46"/>
+        <taxon id="tip47"/>
+        <taxon id="tip48"/>
+        <taxon id="tip49"/>
+        <taxon id="tip50"/>
+        <taxon id="tip51"/>
+        <taxon id="tip52"/>
+        <taxon id="tip53"/>
+        <taxon id="tip54"/>
+        <taxon id="tip55"/>
+        <taxon id="tip56"/>
+        <taxon id="tip57"/>
+        <taxon id="tip58"/>
+        <taxon id="tip59"/>
+        <taxon id="tip60"/>
+        <taxon id="tip61"/>
+        <taxon id="tip62"/>
+        <taxon id="tip63"/>
+        <taxon id="tip64"/>
+        <taxon id="tip65"/>
+        <taxon id="tip66"/>
+        <taxon id="tip67"/>
+        <taxon id="tip68"/>
+        <taxon id="tip69"/>
+        <taxon id="tip70"/>
+        <taxon id="tip71"/>
+        <taxon id="tip72"/>
+        <taxon id="tip73"/>
+        <taxon id="tip74"/>
+        <taxon id="tip75"/>
+        <taxon id="tip76"/>
+        <taxon id="tip77"/>
+        <taxon id="tip78"/>
+        <taxon id="tip79"/>
+        <taxon id="tip80"/>
+        <taxon id="tip81"/>
+        <taxon id="tip82"/>
+        <taxon id="tip83"/>
+        <taxon id="tip84"/>
+        <taxon id="tip85"/>
+        <taxon id="tip86"/>
+        <taxon id="tip87"/>
+        <taxon id="tip88"/>
+        <taxon id="tip89"/>
+        <taxon id="tip90"/>
+        <taxon id="tip91"/>
+        <taxon id="tip92"/>
+        <taxon id="tip93"/>
+        <taxon id="tip94"/>
+        <taxon id="tip95"/>
+        <taxon id="tip96"/>
+        <taxon id="tip97"/>
+        <taxon id="tip98"/>
+        <taxon id="tip99"/>
+        <taxon id="tip100"/>
+    </taxa>
+
+    <!-- This is a single tree simulated under a pure-birth process with birth rate = 1.0 -->
+    <newick id="simulatedTree">
+        (((((((tip1:0.51765537,tip2:0.51765537):1.88098913,(((((tip3:0.94723082,(((tip4:0.46306133,(tip5:0.02670646,tip6:0.02670646):0.43635488):0.08447266,tip7:0.54753399):0.21542859,tip8:0.76296258):0.18426824):0.45594776,((tip9:0.68205023,(tip10:0.59007096,tip11:0.59007096):0.09197927):0.58937991,(tip12:0.76225424,tip13:0.76225424):0.50917590):0.13174844):0.08173060,(((tip14:0.02976608,tip15:0.02976608):0.48301744,tip16:0.51278353):0.54763055,(tip17:0.19119167,tip18:0.19119167):0.8692 [...]
+    </newick>
+
+    <!-- A prior on the distribution node heights defined given                  -->
+    <!-- a Birth-Death speciation process (Gernhard 2008).                       -->
+    <birthDeathModel id="birthDeath" units="substitutions">
+        <birthMinusDeathRate>
+            <parameter id="birthDeath.birthParameter" value="1.0" lower="0.0" upper="1000000.0"/>
+        </birthMinusDeathRate>
+        <relativeDeathRate>
+            <parameter id="birthDeath.deathParameter" value="0.0" lower="0.0" upper="1.0"/>
+        </relativeDeathRate>
+        <samplingProportion>
+            <parameter id="birthDeath.samplingProportion" value="1.0"/>
+        </samplingProportion>
+    </birthDeathModel>
+
+    <treeModel id="treeModel">
+        <tree idref="simulatedTree"/>
+        <rootHeight>
+            <parameter id="treeModel.rootHeight"/>
+        </rootHeight>
+        <nodeHeights internalNodes="true">
+            <parameter id="treeModel.internalNodeHeights"/>
+        </nodeHeights>
+        <nodeHeights internalNodes="true" rootNode="true">
+            <parameter id="treeModel.allInternalNodeHeights"/>
+        </nodeHeights>
+    </treeModel>
+
+    <speciationLikelihood id="speciation">
+        <model>
+            <birthDeathModel idref="birthDeath"/>
+        </model>
+        <speciesTree>
+            <treeModel idref="treeModel"/>
+        </speciesTree>
+    </speciationLikelihood>
+
+    <operators id="operators">
+        <scaleOperator scaleFactor="0.75" weight="1">
+            <parameter idref="birthDeath.birthParameter"/>
+        </scaleOperator>
+    </operators>
+
+    <mcmc id="mcmc" chainLength="1000000" autoOptimize="true">
+        <posterior id="posterior">
+            <prior id="prior">
+                <speciationLikelihood idref="speciation"/>
+                <jeffreysPrior>
+                    <parameter idref="birthDeath.birthParameter"/>
+                </jeffreysPrior>
+            </prior>
+        </posterior>
+        <operators idref="operators"/>
+        <log id="screenLog" logEvery="10000">
+            <column label="Birth Rate" sf="6" width="12">
+                <parameter idref="birthDeath.birthParameter"/>
+            </column>
+            <column label="L(speciation)" dp="4" width="12">
+                <speciationLikelihood idref="speciation"/>
+            </column>
+            <column label="Posterior" dp="4" width="12">
+                <speciationLikelihood idref="posterior"/>
+            </column>
+
+        </log>
+        <log id="fileLog" logEvery="1000" fileName="testBirthDeathAsYule.log">
+            <posterior idref="posterior"/>
+            <speciationLikelihood idref="speciation"/>
+            <parameter idref="birthDeath.birthParameter"/>
+        </log>
+    </mcmc>
+
+    <report>
+        <property name="timer">
+            <object idref="mcmc"/>
+        </property>
+    </report>
+
+    <traceAnalysis fileName="testBirthDeathAsYule.log" burnIn="100000"/>
+
+    <!-- 100 trees simulated using Phylogen v1.2 under a pure birth (rate=1.0)
+    (((((((tip1:0.51765537,tip2:0.51765537):1.88098913,(((((tip3:0.94723082,(((tip4:0.46306133,(tip5:0.02670646,tip6:0.02670646):0.43635488):0.08447266,tip7:0.54753399):0.21542859,tip8:0.76296258):0.18426824):0.45594776,((tip9:0.68205023,(tip10:0.59007096,tip11:0.59007096):0.09197927):0.58937991,(tip12:0.76225424,tip13:0.76225424):0.50917590):0.13174844):0.08173060,(((tip14:0.02976608,tip15:0.02976608):0.48301744,tip16:0.51278353):0.54763055,(tip17:0.19119167,tip18:0.19119167):0.86922240 [...]
+    (((((tip1:0.06258297,(tip2:0.03356028,tip3:0.03356028):0.02902269):0.88135648,(tip4:0.41744471,tip5:0.41744471):0.52649474):1.16361594,(tip6:1.43868446,tip7:1.43868446):0.66887093):0.92318392,((tip8:2.38637316,((tip9:1.46346903,tip10:1.46346903):0.07265520,(((tip11:0.47565246,tip12:0.47565246):0.97463560,(tip13:1.03941131,(tip14:0.37222576,(tip15:0.25500274,tip16:0.25500274):0.11722302):0.66718554):0.41087675):0.05966020,((tip17:0.65458727,(tip18:0.06127214,tip19:0.06127214):0.593315 [...]
+    ((((tip1:1.41115570,((tip2:0.40561008,tip3:0.40561008):0.73335981,(((tip4:0.53325176,((tip5:0.08678102,tip6:0.08678102):0.18546009,tip7:0.27224112):0.26101065):0.15726662,tip8:0.69051838):0.29170322,(tip9:0.00444031,tip10:0.00444031):0.97778130):0.15674829):0.27218580):0.99277782,((tip11:1.61671662,(tip12:0.47530270,tip13:0.47530270):1.14141393):0.59593081,(((tip14:0.42039442,tip15:0.42039442):0.61070395,tip16:1.03109837):0.29326200,(((tip17:0.91202831,(tip18:0.72510672,tip19:0.72510 [...]
+    (((((tip1:0.06577873,tip2:0.06577873):1.50405931,(tip3:0.01562119,tip4:0.01562119):1.55421686):1.19715238,((((tip5:0.98902893,tip6:0.98902893):0.84097219,((tip7:0.79406881,(((tip8:0.05525541,tip9:0.05525541):0.45614195,(tip10:0.26053905,tip11:0.26053905):0.25085831):0.15285063,tip12:0.66424799):0.12982082):0.37477875,(tip13:0.55560589,(tip14:0.28331184,tip15:0.28331184):0.27229404):0.61324167):0.66115355):0.28594947,(((tip16:0.95511699,(tip17:0.36631155,tip18:0.36631155):0.58880544): [...]
+    ((((tip1:1.25174141,(tip2:0.57623339,tip3:0.57623339):0.67550802):0.99049282,(tip4:1.05907512,(tip5:0.24472833,(tip6:0.22760248,(tip7:0.12605476,tip8:0.12605476):0.10154772):0.01712584):0.81434679):1.18315911):0.21472065,((tip9:2.32932270,((tip10:2.09555471,(((tip11:1.02492964,(tip12:0.98052037,tip13:0.98052037):0.04440928):0.42972779,(((((tip14:0.07962418,tip15:0.07962418):0.07314181,tip16:0.15276599):0.02839923,(tip17:0.12790704,tip18:0.12790704):0.05325818):0.80872941,((tip19:0.40 [...]
+    ((tip1:1.22920656,tip2:1.22920656):4.37630534,((((tip3:3.01921940,tip4:3.01921940):0.34807301,(((tip5:1.55454063,((tip6:0.46981764,tip7:0.46981764):1.00376177,(tip8:0.49165726,tip9:0.49165726):0.98192215):0.08096123):1.04858303,(tip10:0.47433233,((tip11:0.02018547,tip12:0.02018547):0.24241734,tip13:0.26260281):0.21172953):2.12879133):0.60088515,(((tip14:0.15163469,tip15:0.15163469):0.26121664,tip16:0.41285133):1.87577009,(tip17:0.42485523,tip18:0.42485523):1.86376619):0.91538739):0.1 [...]
+    (((((tip1:0.93414927,tip2:0.93414927):0.03091717,((tip3:0.73413181,(tip4:0.45926857,(tip5:0.34977245,tip6:0.34977245):0.10949612):0.27486324):0.05716228,tip7:0.79129410):0.17377234):0.99562526,(tip8:1.18058372,((tip9:0.62165928,tip10:0.62165928):0.24703598,tip11:0.86869526):0.31188846):0.78010798):0.03852248,(tip12:0.10539675,tip13:0.10539675):1.89381742):2.06792462,((((tip14:0.33290625,tip15:0.33290625):1.70279670,tip16:2.03570294):0.68480492,((((((tip17:1.14502668,(tip18:0.94648695 [...]
+    ((((((tip1:0.63586998,tip2:0.63586998):0.21762347,((tip3:0.07394719,(tip4:0.06275487,tip5:0.06275487):0.01119232):0.13577819,(tip6:0.06804895,(tip7:0.00167322,tip8:0.00167322):0.06637573):0.14167643):0.64376807):0.42443800,tip9:1.27793145):1.19701695,((((tip10:0.38849163,tip11:0.38849163):0.73021150,((tip12:0.16890335,tip13:0.16890335):0.19223642,(tip14:0.29257798,tip15:0.29257798):0.06856179):0.75756335):1.07992864,((((((tip16:0.99779367,tip17:0.99779367):0.27423811,((tip18:0.802717 [...]
+    (((((((((tip1:0.18720675,(((tip2:0.04741669,tip3:0.04741669):0.06727982,tip4:0.11469650):0.05344057,tip5:0.16813707):0.01906967):0.06061697,((tip6:0.05810261,tip7:0.05810261):0.08847904,tip8:0.14658165):0.10124207):0.58656216,(tip9:0.54860711,(tip10:0.49795270,(tip11:0.20000362,tip12:0.20000362):0.29794908):0.05065441):0.28577876):0.76662040,(tip13:1.14314389,tip14:1.14314389):0.45786238):0.26191425,((((tip15:0.42917085,tip16:0.42917085):0.79675865,(tip17:0.26771212,tip18:0.26771212) [...]
+    (((((((tip1:0.05260324,tip2:0.05260324):0.30167317,tip3:0.35427642):0.22902966,((tip4:0.15642643,tip5:0.15642643):0.35506845,(tip6:0.16975379,tip7:0.16975379):0.34174109):0.07181120):1.24477541,(((((tip8:0.18184519,tip9:0.18184519):0.12435198,tip10:0.30619717):0.28940821,(tip11:0.32692504,tip12:0.32692504):0.26868033):0.54109311,(tip13:1.06693792,(tip14:1.06135845,(tip15:0.67416883,(((tip16:0.38332462,(tip17:0.29078221,(tip18:0.02835679,tip19:0.02835679):0.26242542):0.09254241):0.006 [...]
+    ((((tip1:0.44160843,tip2:0.44160843):1.27253246,(((tip3:0.07648849,tip4:0.07648849):0.33061075,((tip5:0.17783117,tip6:0.17783117):0.11840343,(tip7:0.06396770,tip8:0.06396770):0.23226690):0.11086464):1.12694502,tip9:1.53404427):0.18009663):2.31873751,((((((tip10:0.16275215,tip11:0.16275215):1.20143414,(tip12:0.53280449,(tip13:0.09347057,tip14:0.09347057):0.43933392):0.83138180):0.89914155,tip15:2.26332784):1.32005048,(((((tip16:0.30930567,tip17:0.30930567):1.47631073,((tip18:0.0219988 [...]
+    ((((((tip1:0.59587479,(tip2:0.19887352,tip3:0.19887352):0.39700127):0.55519819,(tip4:0.78842998,tip5:0.78842998):0.36264300):0.18175387,(tip6:0.70262218,((((tip7:0.26510620,(tip8:0.25849199,(tip9:0.01918268,tip10:0.01918268):0.23930931):0.00661421):0.16880274,tip11:0.43390894):0.04316902,(tip12:0.24664164,tip13:0.24664164):0.23043633):0.08833885,tip14:0.56541681):0.13720536):0.63020468):2.28737175,(tip15:0.19907761,tip16:0.19907761):3.42112100):0.08349341,((tip17:0.01622391,tip18:0.0 [...]
+    (((((tip1:0.65537286,(tip2:0.07271600,tip3:0.07271600):0.58265686):1.24264526,((((tip4:1.09951138,tip5:1.09951138):0.09545279,tip6:1.19496417):0.14473200,(tip7:1.29708338,tip8:1.29708338):0.04261279):0.20792532,((tip9:0.39969134,tip10:0.39969134):0.53970957,(((tip11:0.20570517,tip12:0.20570517):0.41590309,((tip13:0.34861970,tip14:0.34861970):0.08941579,tip15:0.43803549):0.18357277):0.20097518,tip16:0.82258344):0.11681747):0.60822058):0.35039663):0.58779097,((tip17:0.73659563,((tip18: [...]
+    ((tip1:2.95512843,((((((tip2:0.46249676,tip3:0.46249676):0.65598345,tip4:1.11848021):0.04466152,(((((tip5:0.08376503,tip6:0.08376503):0.17471361,tip7:0.25847864):0.61096573,tip8:0.86944437):0.05091429,tip9:0.92035866):0.17121935,(tip10:0.34808064,tip11:0.34808064):0.74349737):0.07156372):0.63947248,(((tip12:0.76537514,(tip13:0.38196707,tip14:0.38196707):0.38340807):0.17940187,(tip15:0.23260164,tip16:0.23260164):0.71217537):0.52911186,(tip17:0.78672838,((tip18:0.16803455,tip19:0.16803 [...]
+    ((((tip1:0.28372955,tip2:0.28372955):1.03202057,(tip3:0.19185972,(tip4:0.02070379,tip5:0.02070379):0.17115593):1.12389040):1.06227684,(tip6:1.84522414,((tip7:0.89394188,(tip8:0.23954773,(tip9:0.11623144,(tip10:0.09574842,tip11:0.09574842):0.02048302):0.12331629):0.65439415):0.83465147,((tip12:0.91008806,((tip13:0.20581245,tip14:0.20581245):0.12532520,tip15:0.33113766):0.57895041):0.66807604,tip16:1.57816410):0.15042925):0.11663079):0.53280282):2.81687135,(((((((((tip17:0.09223270,tip [...]
+    (((((tip1:1.90033531,tip2:1.90033531):1.27087891,tip3:3.17121422):0.27828026,(((tip4:0.44134617,(tip5:0.26156998,tip6:0.26156998):0.17977619):2.39744496,(((tip7:0.24484682,tip8:0.24484682):0.68843222,tip9:0.93327904):1.72294450,((tip10:0.76930809,(tip11:0.50120735,(tip12:0.20352983,tip13:0.20352983):0.29767752):0.26810074):0.26066422,((tip14:0.12257242,tip15:0.12257242):0.39826250,(tip16:0.10887480,tip17:0.10887480):0.41196012):0.50913739):1.62625122):0.18256760):0.31111145,(((tip18: [...]
+    ((tip1:3.20244491,(((((tip2:0.20834398,tip3:0.20834398):0.83276057,(tip4:0.61095405,(tip5:0.24411559,(tip6:0.17465401,tip7:0.17465401):0.06946158):0.36683846):0.43015051):1.49798703,(((((tip8:0.55869317,tip9:0.55869317):0.66264582,(((tip10:0.26693392,tip11:0.26693392):0.63801432,tip12:0.90494823):0.18312597,tip13:1.08807421):0.13326478):0.37578368,(((((tip14:0.10516453,tip15:0.10516453):0.08222294,(tip16:0.15212154,tip17:0.15212154):0.03526592):0.66079021,(tip18:0.23648405,(tip19:0.0 [...]
+    ((((((tip1:0.11604834,tip2:0.11604834):0.65077901,tip3:0.76682734):0.59540772,tip4:1.36223507):0.00026655,(tip5:1.33592749,(((tip6:0.20522141,(tip7:0.08110094,tip8:0.08110094):0.12412047):0.11043692,tip9:0.31565833):0.37006998,tip10:0.68572831):0.65019917):0.02657413):0.77975416,((((tip11:0.09337330,tip12:0.09337330):0.27286315,tip13:0.36623645):0.44632912,(tip14:0.16786289,tip15:0.16786289):0.64470267):0.97648692,tip16:1.78905249):0.35320330):0.71792853,(((((((tip17:0.01454115,tip18 [...]
+    ((tip1:0.15361214,tip2:0.15361214):5.29720925,(((((((tip3:1.53326178,(tip4:0.18970251,tip5:0.18970251):1.34355927):0.23551416,(tip6:0.15019655,tip7:0.15019655):1.61857939):0.02332044,tip8:1.79209638):0.47510767,((tip9:0.49876404,tip10:0.49876404):0.74793243,(tip11:0.87973166,tip12:0.87973166):0.36696482):1.02050757):0.45923066,((tip13:0.85654879,((((tip14:0.22494507,tip15:0.22494507):0.26124907,(tip16:0.40945053,tip17:0.40945053):0.07674360):0.01550961,(tip18:0.36332464,tip19:0.36332 [...]
+    ((((((((tip1:0.55078554,tip2:0.55078554):0.91846061,(tip3:0.60798645,tip4:0.60798645):0.86125970):0.78061318,((tip5:1.37377071,(tip6:1.13213730,(tip7:0.99376488,tip8:0.99376488):0.13837242):0.24163342):0.48801947,((tip9:0.98831081,tip10:0.98831081):0.86062598,tip11:1.84893680):0.01285338):0.38806915):0.38845825,(tip12:0.92466164,tip13:0.92466164):1.71365595):0.40146160,((tip14:1.70815325,(tip15:0.03770924,tip16:0.03770924):1.67044401):0.88577223,((tip17:0.61313105,((tip18:0.19522715, [...]
+    (((((tip1:0.36419344,tip2:0.36419344):1.21282291,(((tip3:0.18997908,tip4:0.18997908):0.96959019,((tip5:1.00312662,(tip6:0.98278999,(tip7:0.70422149,tip8:0.70422149):0.27856851):0.02033663):0.08767366,(tip9:0.61049509,((tip10:0.37094402,tip11:0.37094402):0.05608988,(tip12:0.12116814,tip13:0.12116814):0.30586576):0.18346119):0.48030519):0.06876898):0.29734659,(tip14:1.44264722,(tip15:0.70854831,(tip16:0.44478488,(tip17:0.19756842,tip18:0.19756842):0.24721646):0.26376343):0.73409891):0. [...]
+    (((((((((tip1:1.43198204,((tip2:1.26119423,tip3:1.26119423):0.13246894,tip4:1.39366317):0.03831887):0.57589221,(tip5:1.28482533,((tip6:0.85063791,tip7:0.85063791):0.04097962,tip8:0.89161754):0.39320779):0.72304893):0.05779719,((tip9:1.08563471,tip10:1.08563471):0.54748058,(tip11:1.43497276,tip12:1.43497276):0.19814253):0.43255615):0.68685627,(tip13:1.05208349,(tip14:0.61309052,tip15:0.61309052):0.43899298):1.70044422):0.19342935,(((((((((tip16:0.24927330,tip17:0.24927330):0.07162714, [...]
+    ((((tip1:2.50525141,(((tip2:0.61593127,(tip3:0.22823143,tip4:0.22823143):0.38769984):1.75906920,(((tip5:0.88829923,((tip6:0.45383596,tip7:0.45383596):0.33649683,tip8:0.79033279):0.09796643):0.98809147,(((tip9:0.87536359,(tip10:0.16929770,tip11:0.16929770):0.70606589):0.08379865,((tip12:0.10115767,tip13:0.10115767):0.33687210,tip14:0.43802977):0.52113247):0.32277846,tip15:1.28194070):0.59445000):0.15932083,(tip16:1.28995228,(((tip17:0.08835840,tip18:0.08835840):0.14782524,tip19:0.2361 [...]
+    ((((((((tip1:0.02601528,tip2:0.02601528):0.74024487,tip3:0.76626015):0.66318130,tip4:1.42944145):0.00294113,tip5:1.43238258):0.03108788,((tip6:0.11712551,tip7:0.11712551):0.86820841,tip8:0.98533392):0.47813654):2.48793554,((tip9:2.84141922,((tip10:1.44394207,(tip11:0.54496384,(tip12:0.24070168,(tip13:0.09574938,tip14:0.09574938):0.14495230):0.30426216):0.89897823):0.69619203,(((tip15:0.42630196,tip16:0.42630196):1.25800943,(((tip17:0.46899080,(tip18:0.29717207,tip19:0.29717207):0.171 [...]
+    ((((((tip1:0.06854582,tip2:0.06854582):0.96680188,(tip3:0.00328970,tip4:0.00328970):1.03205800):0.51131988,((tip5:1.14196825,(tip6:0.63570118,tip7:0.63570118):0.50626707):0.20112753,(((tip8:0.12878323,tip9:0.12878323):1.06749272,(tip10:0.12621069,(tip11:0.10225248,tip12:0.10225248):0.02395821):1.07006526):0.12125111,((tip13:0.26365662,tip14:0.26365662):0.91189504,(tip15:0.58158302,tip16:0.58158302):0.59396863):0.14197540):0.02556872):0.20357180):1.17052078,((((((tip17:0.29806852,tip1 [...]
+    ((((((tip1:1.61488199,((((tip2:0.01988268,tip3:0.01988268):0.28276300,(tip4:0.09095669,tip5:0.09095669):0.21168900):0.80277514,(tip6:0.99832582,((tip7:0.05258083,tip8:0.05258083):0.35906339,tip9:0.41164422):0.58668160):0.10709500):0.49885273,((((tip10:0.29382753,(tip11:0.20003176,tip12:0.20003176):0.09379578):0.07970476,tip13:0.37353230):0.55135536,((tip14:0.48715353,tip15:0.48715353):0.26332188,((tip16:0.40507674,tip17:0.40507674):0.27677250,(tip18:0.00584364,tip19:0.00584364):0.676 [...]
+    (((((((tip1:1.94996953,((((tip2:0.05151010,tip3:0.05151010):0.28249359,(tip4:0.19501615,tip5:0.19501615):0.13898754):0.16825747,tip6:0.50226116):1.22856402,((tip7:0.45355964,tip8:0.45355964):0.86261463,(tip9:0.02775097,tip10:0.02775097):1.28842330):0.41465092):0.21914434):0.12048244,tip11:2.07045197):0.00397325,((tip12:0.00574088,tip13:0.00574088):0.73343897,(tip14:0.36785603,tip15:0.36785603):0.37132382):1.33524537):0.14656770,((tip16:0.74915075,((tip17:0.09169173,tip18:0.09169173): [...]
+    ((((tip1:0.82686186,tip2:0.82686186):2.05169344,(tip3:0.20557261,tip4:0.20557261):2.67298269):0.09372997,(((((((((tip5:0.41164970,(tip6:0.16552162,tip7:0.16552162):0.24612808):0.55588436,(tip8:0.40584993,tip9:0.40584993):0.56168413):0.64222741,(tip10:0.03276300,tip11:0.03276300):1.57699847):0.00434995,(tip12:0.20757389,((tip13:0.03220654,tip14:0.03220654):0.08433723,tip15:0.11654377):0.09103012):1.40653753):0.19941282,((tip16:1.49125648,(((tip17:0.00699043,tip18:0.00699043):0.9974823 [...]
+    ((((((((tip1:0.60446739,tip2:0.60446739):0.44516659,(tip3:0.13052225,tip4:0.13052225):0.91911173):0.21253157,((tip5:0.26028585,tip6:0.26028585):0.57387018,tip7:0.83415604):0.42800951):0.01368237,(((tip8:0.05333185,tip9:0.05333185):0.30954790,tip10:0.36287975):0.26657391,tip11:0.62945366):0.64639425):0.32345581,(tip12:0.68699026,((tip13:0.25703287,tip14:0.25703287):0.06422949,(tip15:0.26088667,tip16:0.26088667):0.06037569):0.36572790):0.91231346):0.31646657,(tip17:0.98894215,(tip18:0. [...]
+    ((((((tip1:0.90823889,tip2:0.90823889):0.54001188,(tip3:1.00636673,(tip4:0.90301180,((tip5:0.49277544,(tip6:0.05332279,tip7:0.05332279):0.43945265):0.28018427,(((tip8:0.12077665,tip9:0.12077665):0.08489847,(tip10:0.00110340,tip11:0.00110340):0.20457172):0.18298864,tip12:0.38866377):0.38429594):0.13005209):0.10335493):0.44188404):0.78150535,(((tip13:0.64657974,tip14:0.64657974):0.52217436,(tip15:0.34298944,tip16:0.34298944):0.82576466):0.24786401,tip17:1.41661811):0.81313801):0.700260 [...]
+    ((((((tip1:1.08067608,((tip2:0.27747011,tip3:0.27747011):0.13691425,tip4:0.41438437):0.66629171):0.92484069,(((tip5:0.42345333,(tip6:0.10046482,tip7:0.10046482):0.32298851):0.00351191,tip8:0.42696524):1.26843166,(((tip9:0.07987356,tip10:0.07987356):0.00242472,tip11:0.08229828):0.84396625,((((tip12:0.27608871,tip13:0.27608871):0.18472004,tip14:0.46080875):0.05349493,(tip15:0.33307171,tip16:0.33307171):0.18123198):0.08584547,tip17:0.60014915):0.32611537):0.76913238):0.31011987):0.66637 [...]
+    (((((tip1:0.27375078,tip2:0.27375078):1.06602669,(tip3:0.09666491,(tip4:0.06946850,tip5:0.06946850):0.02719641):1.24311256):0.22366571,((tip6:0.13701630,tip7:0.13701630):0.48665905,(tip8:0.48016977,(tip9:0.09807110,tip10:0.09807110):0.38209867):0.14350557):0.93976784):0.20434237,tip11:1.76778555):1.41229963,(((tip12:0.22783852,(tip13:0.16949701,(tip14:0.07182264,tip15:0.07182264):0.09767437):0.05834150):1.59834671,(((tip16:0.33377075,(tip17:0.24941540,tip18:0.24941540):0.08435535):0. [...]
+    (((((tip1:0.36613178,(tip2:0.34802961,tip3:0.34802961):0.01810217):0.06151342,tip4:0.42764521):0.35301256,(((tip5:0.04643154,tip6:0.04643154):0.09085989,tip7:0.13729143):0.33191681,tip8:0.46920824):0.31144953):0.16282511,((tip9:0.20584822,tip10:0.20584822):0.14591026,tip11:0.35175848):0.59172440):2.88485706,(tip12:3.64567399,(((((((tip13:0.95527697,(tip14:0.25535011,tip15:0.25535011):0.69992685):0.17301702,((tip16:0.54336691,tip17:0.54336691):0.45200682,tip18:0.99537373):0.13292027): [...]
+    ((((((tip1:1.83544660,((((tip2:0.34201956,tip3:0.34201956):1.10872936,((tip4:0.25183153,(tip5:0.22581387,tip6:0.22581387):0.02601767):0.84467101,((tip7:0.59807992,(tip8:0.25369978,tip9:0.25369978):0.34438014):0.16566968,tip10:0.76374960):0.33275294):0.35424638):0.14986563,(((((((tip11:0.09212494,tip12:0.09212494):0.20331717,tip13:0.29544210):0.45456147,(((tip14:0.20379114,tip15:0.20379114):0.22202563,tip16:0.42581677):0.25629640,tip17:0.68211317):0.06789041):0.33643889,(tip18:0.44503 [...]
+    (((((((tip1:0.13453150,tip2:0.13453150):1.22333384,((tip3:0.63686895,tip4:0.63686895):0.42914009,(tip5:0.37621546,tip6:0.37621546):0.68979359):0.29185629):0.10432291,((tip7:0.49878168,tip8:0.49878168):0.11670113,tip9:0.61548281):0.84670544):0.98234248,tip10:2.44453073):0.58419704,((tip11:1.23124552,tip12:1.23124552):0.96201491,(tip13:0.71021938,(tip14:0.03836298,tip15:0.03836298):0.67185640):1.48304105):0.83546734):1.01057160,(((tip16:1.39125490,((tip17:0.19171047,(tip18:0.12005854,t [...]
+    ((((tip1:0.06019306,tip2:0.06019306):3.06349945,(((tip3:1.36182308,(((tip4:0.13091516,(tip5:0.06918287,tip6:0.06918287):0.06173229):0.10402870,tip7:0.23494387):0.45024157,tip8:0.68518543):0.67663765):0.27445221,((((tip9:0.52406788,tip10:0.52406788):0.13351631,tip11:0.65758419):0.07348108,tip12:0.73106527):0.06789446,tip13:0.79895973):0.83731556):0.38822889,(tip14:0.55031347,((tip15:0.19910479,tip16:0.19910479):0.20920944,(tip17:0.15305901,tip18:0.15305901):0.25525522):0.14199924):1.4 [...]
+    ((((tip1:1.64979577,(tip2:0.52002048,(tip3:0.15522766,tip4:0.15522766):0.36479282):1.12977529):0.00895190,(tip5:1.40725851,tip6:1.40725851):0.25148916):1.56356621,((tip7:0.88294363,tip8:0.88294363):0.03375387,((tip9:0.19343042,(tip10:0.03004789,tip11:0.03004789):0.16338253):0.25732493,tip12:0.45075536):0.46594214):2.30561638):0.01673472,((((tip13:0.93103147,(tip14:0.42725754,(tip15:0.31347537,tip16:0.31347537):0.11378217):0.50377393):1.77446365,(((((tip17:0.51686621,(tip18:0.39742947 [...]
+    (((((((tip1:0.30845976,tip2:0.30845976):1.18857384,(tip3:0.47756004,tip4:0.47756004):1.01947355):0.26959729,((((tip5:0.12859344,tip6:0.12859344):0.23059416,tip7:0.35918760):0.35974431,(tip8:0.27894926,tip9:0.27894926):0.43998265):0.71003604,tip10:1.42896795):0.33766294):0.12085032,tip11:1.88748121):0.25416636,(tip12:1.79624963,((tip13:0.92997789,tip14:0.92997789):0.51317191,((tip15:0.64356613,tip16:0.64356613):0.31810308,(tip17:0.61905336,tip18:0.61905336):0.34261584):0.48148060):0.3 [...]
+    (((tip1:0.31115818,tip2:0.31115818):4.67851555,(((tip3:3.62736678,((((tip4:0.43222857,(tip5:0.17988300,tip6:0.17988300):0.25234556):0.15082788,tip7:0.58305645):0.54541683,tip8:1.12847328):0.76083231,(tip9:0.13969278,tip10:0.13969278):1.74961281):1.73806119):0.79408526,((tip11:1.61633873,(((tip12:0.03053904,tip13:0.03053904):0.39043427,tip14:0.42097330):0.55793381,(tip15:0.44994402,tip16:0.44994402):0.52896309):0.63743162):1.61519861,((tip17:1.41194725,((tip18:0.54901648,(tip19:0.1417 [...]
+    ((((((tip1:1.38869476,((tip2:0.20791769,tip3:0.20791769):1.13511777,(tip4:0.20428705,tip5:0.20428705):1.13874841):0.04565930):0.05573106,(((tip6:0.06626749,tip7:0.06626749):0.11180019,(tip8:0.03047037,tip9:0.03047037):0.14759731):0.02221251,tip10:0.20028019):1.24414563):0.31180406,(((tip11:0.94330812,(((tip12:0.17768955,tip13:0.17768955):0.04401731,tip14:0.22170687):0.12021375,tip15:0.34192061):0.60138750):0.43756843,((tip16:0.14215016,tip17:0.14215016):1.06098509,tip18:1.20313525):0 [...]
+    ((((((tip1:0.54719067,(tip2:0.40562749,tip3:0.40562749):0.14156318):0.45248342,(tip4:0.52335429,tip5:0.52335429):0.47631979):0.19237590,(tip6:0.46904492,tip7:0.46904492):0.72300506):0.98408639,(tip8:1.86767995,(((tip9:1.17510629,(tip10:0.59202862,tip11:0.59202862):0.58307767):0.27870321,(tip12:1.35056901,tip13:1.35056901):0.10324049):0.06125426,((tip14:0.49892521,(((tip15:0.14357066,tip16:0.14357066):0.14343810,tip17:0.28700876):0.20417166,(tip18:0.42323041,((tip19:0.16937923,tip20:0 [...]
+    ((((((tip1:0.96769404,(tip2:0.15944028,(tip3:0.10133457,tip4:0.10133457):0.05810571):0.80825377):1.34832871,((tip5:0.56904745,(tip6:0.18304777,tip7:0.18304777):0.38599968):0.45509458,(tip8:0.46133327,tip9:0.46133327):0.56280875):1.29188073):0.31710517,(tip10:0.37159371,tip11:0.37159371):2.26153421):0.35100567,((((tip12:0.63446856,(tip13:0.62366056,tip14:0.62366056):0.01080799):0.49698997,tip15:1.13145852):0.29964900,tip16:1.43110752):1.30853903,((((tip17:0.68374753,tip18:0.68374753): [...]
+    ((((tip1:0.05798960,tip2:0.05798960):1.66283703,(((((tip3:0.02660513,tip4:0.02660513):0.16495681,tip5:0.19156194):0.17108345,tip6:0.36264539):0.51717758,tip7:0.87982297):0.10000348,(tip8:0.49655867,tip9:0.49655867):0.48326778):0.74100018):0.46122944,(tip10:1.79283595,((((tip11:0.03252602,tip12:0.03252602):0.36057138,tip13:0.39309740):0.52748752,((tip14:0.25205517,tip15:0.25205517):0.65075326,(tip16:0.38842940,tip17:0.38842940):0.51437902):0.01777649):0.52876854,(tip18:0.46685839,((ti [...]
+    (((tip1:2.75156450,((tip2:1.39013231,tip3:1.39013231):0.11540854,(tip4:1.43563569,(tip5:1.20609355,(tip6:0.15178776,tip7:0.15178776):1.05430579):0.22954214):0.06990516):1.24602365):0.32058528,((((((((tip8:0.27639651,tip9:0.27639651):0.84611320,(tip10:0.65767217,tip11:0.65767217):0.46483755):0.15412092,(tip12:1.27310085,(tip13:0.98257256,(((tip14:0.14428997,tip15:0.14428997):0.21303010,tip16:0.35732007):0.51938200,tip17:0.87670207):0.10587049):0.29052830):0.00352979):0.32467461,(tip18 [...]
+    (((((tip1:2.31335068,((tip2:0.04002953,tip3:0.04002953):1.87003446,(tip4:0.01263666,tip5:0.01263666):1.89742732):0.40328670):0.63609982,((tip6:1.43476009,((tip7:0.10647535,tip8:0.10647535):0.67544174,(((tip9:0.11909962,tip10:0.11909962):0.32494783,(tip11:0.27131844,tip12:0.27131844):0.17272902):0.14390850,tip13:0.58795595):0.19396114):0.65284300):0.09249949,tip14:1.52725959):1.42219090):1.20512491,(((tip15:0.16368866,tip16:0.16368866):0.61310768,tip17:0.77679634):2.50237119,(tip18:2. [...]
+    (((((((tip1:0.20078659,tip2:0.20078659):0.26582479,tip3:0.46661139):0.14839649,(tip4:0.52447128,((tip5:0.13444757,((tip6:0.05956459,tip7:0.05956459):0.00177860,tip8:0.06134319):0.07310438):0.04442835,tip9:0.17887592):0.34559536):0.09053659):1.39463305,((tip10:0.73661137,(tip11:0.57103825,((tip12:0.16145945,((tip13:0.01611662,tip14:0.01611662):0.13196468,tip15:0.14808130):0.01337814):0.35737228,tip16:0.51883173):0.05220652):0.16557312):0.14481783,((tip17:0.10794163,tip18:0.10794163):0 [...]
+    ((((((((((tip1:0.18061304,tip2:0.18061304):0.29794693,tip3:0.47855997):0.42181396,(tip4:0.64433193,(tip5:0.01120615,tip6:0.01120615):0.63312578):0.25604200):0.07134581,tip7:0.97171974):1.31077170,tip8:2.28249145):0.21912622,((((tip9:0.24587679,tip10:0.24587679):0.32828617,tip11:0.57416296):0.86990070,tip12:1.44406366):0.60463667,tip13:2.04870033):0.45291734):0.52671432,((tip14:2.30214953,(tip15:2.10792947,(tip16:1.45758152,((tip17:0.01197338,tip18:0.01197338):0.91962886,(tip19:0.8294 [...]
+    ((((tip1:1.52843738,((((tip2:0.52969217,tip3:0.52969217):0.44729900,(((tip4:0.10119057,tip5:0.10119057):0.17417431,tip6:0.27536488):0.53272963,(tip7:0.28999853,tip8:0.28999853):0.51809597):0.16889668):0.37580681,(tip9:1.07573271,tip10:1.07573271):0.27706528):0.15049171,(((tip11:0.17709541,tip12:0.17709541):0.45382595,tip13:0.63092136):0.57841349,tip14:1.20933485):0.29395485):0.02514768):0.69153643,((tip15:0.09374809,tip16:0.09374809):0.68121290,(tip17:0.16061735,tip18:0.16061735):0.6 [...]
+    ((((((tip1:0.81718206,tip2:0.81718206):0.16677046,((tip3:0.04391384,tip4:0.04391384):0.69268513,tip5:0.73659897):0.24735355):0.04183054,((tip6:0.29501915,tip7:0.29501915):0.50337601,tip8:0.79839516):0.22738791):0.15487671,tip9:1.18065977):2.87509561,(tip10:0.41742086,((tip11:0.05112553,tip12:0.05112553):0.10076094,tip13:0.15188646):0.26553440):3.63833451):0.27475715,(((((((tip14:0.22100449,tip15:0.22100449):0.31434727,(tip16:0.47330952,tip17:0.47330952):0.06204224):0.91411281,((((tip [...]
+    (((tip1:2.53579235,((((tip2:0.39644122,(tip3:0.16473055,tip4:0.16473055):0.23171067):0.76979184,(tip5:0.51382899,(tip6:0.33440232,tip7:0.33440232):0.17942667):0.65240407):0.82476568,(((tip8:0.49237990,tip9:0.49237990):1.42048740,(tip10:1.51522398,(tip11:0.57353330,tip12:0.57353330):0.94169068):0.39764333):0.02238822,(((tip13:0.42724609,tip14:0.42724609):0.97607589,tip15:1.40332198):0.47349691,(((tip16:0.53111577,tip17:0.53111577):0.13675451,((tip18:0.45293641,tip19:0.45293641):0.1030 [...]
+    ((((tip1:1.91871786,((((tip2:0.29756355,(tip3:0.19428253,tip4:0.19428253):0.10328102):0.13639259,((tip5:0.26036739,tip6:0.26036739):0.08477640,tip7:0.34514380):0.08881235):0.21447325,((tip8:0.30422831,(tip9:0.03991604,tip10:0.03991604):0.26431227):0.31099272,tip11:0.61522102):0.03320837):0.88757634,tip12:1.53600574):0.38271213):0.24409437,(tip13:1.87566948,tip14:1.87566948):0.28714275):0.29189587,tip15:2.45470810):1.11522090,(((tip16:1.64363956,(tip17:0.17061615,tip18:0.17061615):1.4 [...]
+    ((((((((tip1:0.18527126,tip2:0.18527126):0.66009569,tip3:0.84536695):0.72831154,((tip4:0.19469929,tip5:0.19469929):0.79555845,(tip6:0.81855059,((tip7:0.07624435,tip8:0.07624435):0.32957458,tip9:0.40581894):0.41273165):0.17170715):0.58342075):0.17370558,tip10:1.74738407):0.29480743,((tip11:1.12174606,(((((tip12:0.35970497,tip13:0.35970497):0.05617619,tip14:0.41588116):0.15189362,(tip15:0.11183453,tip16:0.11183453):0.45594025):0.14067364,tip17:0.70844841):0.39547253,(tip18:1.04354143,( [...]
+    (((tip1:1.82748365,(((tip2:0.42440033,tip3:0.42440033):0.76904297,(tip4:0.64576674,(tip5:0.14170313,(tip6:0.06389475,(tip7:0.03396654,tip8:0.03396654):0.02992821):0.07780838):0.50406361):0.54767656):0.57852936,(tip9:0.40389299,tip10:0.40389299):1.36807966):0.05551100):1.51671648,((tip11:0.48506212,tip12:0.48506212):0.47258091,((tip13:0.21497440,tip14:0.21497440):0.31682777,(tip15:0.15551138,tip16:0.15551138):0.37629080):0.42584085):2.38655710):1.56145918,((((((((tip17:0.57726479,(tip [...]
+    (((((tip1:1.09034753,(tip2:0.84376478,tip3:0.84376478):0.24658275):0.02091122,(((tip4:0.93134952,tip5:0.93134952):0.13692355,(tip6:0.85584450,tip7:0.85584450):0.21242857):0.03461719,((tip8:0.16454482,tip9:0.16454482):0.05481696,(tip10:0.00227284,tip11:0.00227284):0.21708894):0.88352847):0.00836849):1.77659345,((tip12:1.12238097,(((tip13:0.37419081,tip14:0.37419081):0.39030766,(tip15:0.21680045,tip16:0.21680045):0.54769802):0.30167341,(tip17:0.76675057,((tip18:0.04265785,tip19:0.04265 [...]
+    ((((tip1:2.14471388,(((tip2:0.03461456,tip3:0.03461456):0.29099178,(tip4:0.26616907,tip5:0.26616907):0.05943727):0.40350342,(tip6:0.50076199,(tip7:0.32203054,tip8:0.32203054):0.17873144):0.22834778):1.41560411):0.96281862,(((tip9:0.95590544,tip10:0.95590544):0.90680218,tip11:1.86270761):1.07924366,((tip12:0.27976322,tip13:0.27976322):1.81812716,((tip14:0.22603083,tip15:0.22603083):0.08200788,tip16:0.30803871):1.78985167):0.84406090):0.16558123):0.57266688,((((tip17:0.73164654,tip18:0 [...]
+    ((((tip1:1.77923870,((tip2:0.30884767,tip3:0.30884767):0.92692327,(tip4:0.30572534,(tip5:0.00790596,tip6:0.00790596):0.29781938):0.93004560):0.54346776):1.56404182,(((tip7:0.81217170,(tip8:0.66627669,((tip9:0.03823900,tip10:0.03823900):0.18470359,tip11:0.22294259):0.44333410):0.14589500):0.35793209,(tip12:0.42228937,tip13:0.42228937):0.74781442):2.02635401,(((((tip14:0.40610242,((tip15:0.16316652,tip16:0.16316652):0.19780064,(tip17:0.24149799,(tip18:0.03266668,tip19:0.03266668):0.208 [...]
+    (((((((tip1:1.14684629,((tip2:0.29931092,tip3:0.29931092):0.03522754,tip4:0.33453846):0.81230783):0.76196647,((tip5:0.02908421,tip6:0.02908421):1.55830121,tip7:1.58738542):0.32142735):0.06961966,(((tip8:0.03473520,tip9:0.03473520):1.20222807,(tip10:0.89554071,tip11:0.89554071):0.34142256):0.71342182,((tip12:0.13619995,tip13:0.13619995):1.24049282,tip14:1.37669277):0.57369232):0.02804732):0.40607893,(tip15:0.74825001,(tip16:0.01887178,tip17:0.01887178):0.72937822):1.63626134):0.590592 [...]
+    ((((((tip1:0.16827345,tip2:0.16827345):0.76378059,((tip3:0.03898096,tip4:0.03898096):0.36791754,tip5:0.40689850):0.52515554):1.08081603,((tip6:0.35239220,tip7:0.35239220):1.19980145,((tip8:0.03437948,tip9:0.03437948):1.31253052,((tip10:0.37942886,tip11:0.37942886):0.32921791,tip12:0.70864677):0.63826323):0.20528364):0.46067643):0.04989481,(((((((tip13:0.20624018,tip14:0.20624018):0.32127523,tip15:0.52751541):0.19186687,tip16:0.71938229):0.17255974,tip17:0.89194202):0.06300116,(tip18: [...]
+    (((((((tip1:0.24148488,tip2:0.24148488):1.89021838,tip3:2.13170326):0.11010468,((((((tip4:0.26122308,tip5:0.26122308):0.71527171,tip6:0.97649479):0.05775285,tip7:1.03424764):0.05922866,tip8:1.09347630):0.05782914,(tip9:1.06716776,(((tip10:0.47413421,tip11:0.47413421):0.30431509,(tip12:0.18334794,tip13:0.18334794):0.59510136):0.17547894,tip14:0.95392823):0.11323953):0.08413768):0.97621155,tip15:2.12751698):0.11429095):0.16584301,((((tip16:0.43222857,tip17:0.43222857):0.49976826,tip18: [...]
+    (((((tip1:0.12910748,tip2:0.12910748):0.37346077,(tip3:0.15696192,(tip4:0.13884377,tip5:0.13884377):0.01811814):0.34560633):0.08972478,tip6:0.59229302):2.26425946,(((((tip7:0.22567010,tip8:0.22567010):0.82944727,((tip9:0.35883760,tip10:0.35883760):0.10710025,(tip11:0.17237353,tip12:0.17237353):0.29356432):0.58917952):0.87984860,tip13:1.93496597):0.30651069,(((((tip14:0.33788037,tip15:0.33788037):0.23037505,tip16:0.56825542):0.60602903,(tip17:1.00754261,((tip18:0.57801008,tip19:0.5780 [...]
+    (((((((((((tip1:0.05576372,tip2:0.05576372):0.24212956,tip3:0.29789329):0.28785586,tip4:0.58574915):0.97509265,(tip5:1.48327446,tip6:1.48327446):0.07756734):0.65108716,((tip7:0.52498245,tip8:0.52498245):1.39880824,tip9:1.92379069):0.28813827):0.04404092,((tip10:0.14644194,tip11:0.14644194):1.34764838,((((((tip12:0.01972222,tip13:0.01972222):0.02083325,(tip14:0.01121688,tip15:0.01121688):0.02933860):0.44607687,tip16:0.48663235):0.19630766,tip17:0.68294001):0.16990662,tip18:0.85284662) [...]
+    (((((tip1:1.09892941,((tip2:0.05656815,tip3:0.05656815):0.41474009,tip4:0.47130823):0.62762117):1.64709663,((((tip5:0.22558451,tip6:0.22558451):0.56270742,tip7:0.78829193):0.08217478,(tip8:0.72668171,tip9:0.72668171):0.14378500):1.05289721,((((tip10:0.24596167,tip11:0.24596167):0.25350571,tip12:0.49946737):0.16644287,(tip13:0.01605082,tip14:0.01605082):0.64985943):1.07401037,((tip15:0.38614607,tip16:0.38614607):0.67441559,(tip17:0.56790781,tip18:0.56790781):0.49265385):0.67935896):0. [...]
+    ((((((tip1:0.03533077,tip2:0.03533077):1.92779970,((tip3:0.01645708,tip4:0.01645708):0.84155464,(tip5:0.52701950,(tip6:0.30371332,tip7:0.30371332):0.22330618):0.33099222):1.10511875):0.36904335,(tip8:1.82959223,((tip9:1.34587526,tip10:1.34587526):0.19689560,(((tip11:0.18601656,tip12:0.18601656):0.03889561,tip13:0.22491217):0.25601339,(tip14:0.37328386,tip15:0.37328386):0.10764170):1.06184530):0.28682137):0.50258160):0.91826510,((tip16:1.08879566,((((tip17:0.04745007,tip18:0.04745007) [...]
+    (((((tip1:1.11164761,(((tip2:0.07586670,tip3:0.07586670):1.01143074,(tip4:0.91227913,(tip5:0.09923553,tip6:0.09923553):0.81304359):0.17501831):0.01262569,((tip7:0.04934502,tip8:0.04934502):0.40163517,(tip9:0.14219666,tip10:0.14219666):0.30878353):0.64894295):0.01172447):0.40757322,(tip11:0.98469734,((tip12:0.90995216,tip13:0.90995216):0.06600666,((tip14:0.26454067,tip15:0.26454067):0.38640594,tip16:0.65094662):0.32501221):0.00873852):0.53452349):0.74686384,(tip17:2.08275080,(((tip18: [...]
+    ((((((((tip1:0.43177414,tip2:0.43177414):0.09226847,tip3:0.52404261):0.23835421,tip4:0.76239681):1.17804003,((((tip5:0.25058985,tip6:0.25058985):0.23124456,tip7:0.48183441):1.10939360,tip8:1.59122801):0.20801401,((((((tip9:0.29226303,tip10:0.29226303):0.01616192,tip11:0.30842495):0.23006439,tip12:0.53848934):0.20087576,tip13:0.73936510):0.54065037,(tip14:0.28093529,(tip15:0.27506971,tip16:0.27506971):0.00586557):0.99908018):0.27490711,(tip17:0.69195271,tip18:0.69195271):0.86296988):0 [...]
+    ((((tip1:0.09794211,tip2:0.09794211):1.31204128,((tip3:0.25319672,tip4:0.25319672):0.52473187,tip5:0.77792859):0.63205481):1.92410636,(((tip6:0.41809654,tip7:0.41809654):2.12657869,(((tip8:1.41879201,tip9:1.41879201):0.25409150,((tip10:1.32401395,(tip11:1.25974631,tip12:1.25974631):0.06426764):0.18148732,(((tip13:0.32605362,(tip14:0.07046700,tip15:0.07046700):0.25558662):0.53620434,((((tip16:0.42779231,tip17:0.42779231):0.17197704,tip18:0.59976935):0.00210238,tip19:0.60187173):0.0203 [...]
+    ((((((((tip1:0.74698091,tip2:0.74698091):0.00075984,tip3:0.74774075):1.36659372,((tip4:0.01857471,tip5:0.01857471):0.42449117,((tip6:0.36967874,tip7:0.36967874):0.00997972,tip8:0.37965846):0.06340742):1.67126858):0.13983655,(((tip9:0.33635187,tip10:0.33635187):0.74083447,(tip11:0.48891425,(tip12:0.42711997,(tip13:0.13323951,tip14:0.13323951):0.29388046):0.06179428):0.58827209):0.40802336,((tip15:0.20773864,tip16:0.20773864):1.19447160,tip17:1.40221024):0.08299947):0.76896131):0.00285 [...]
+    (((((tip1:1.89507818,((tip2:1.05355167,tip3:1.05355167):0.09397745,(((((tip4:0.13059425,tip5:0.13059425):0.22643375,tip6:0.35702801):0.07576323,tip7:0.43279123):0.18026209,tip8:0.61305332):0.32619858,tip9:0.93925190):0.20827723):0.74754906):0.49769974,((tip10:0.92175245,(tip11:0.87089014,(tip12:0.06269741,(tip13:0.05604649,tip14:0.05604649):0.00665092):0.80819273):0.05086231):0.71230841,((tip15:0.32390404,(tip16:0.03382778,tip17:0.03382778):0.29007626):0.54658890,(((tip18:0.33328104, [...]
+    ((((tip1:1.13633633,((tip2:0.24517584,tip3:0.24517584):0.74000549,tip4:0.98518133):0.15115499):0.54629898,(((tip5:0.11092615,tip6:0.11092615):0.14472294,(tip7:0.15334606,tip8:0.15334606):0.10230303):1.06863070,(tip9:1.13526344,((tip10:0.44568396,tip11:0.44568396):0.37679577,(tip12:0.47526264,tip13:0.47526264):0.34721708):0.31278372):0.18901634):0.35835552):1.60250592,(tip14:1.32089043,((tip15:0.33120680,tip16:0.33120680):0.49185085,(tip17:0.80210876,(tip18:0.72765923,((tip19:0.260779 [...]
+    ((((((((tip1:0.10616493,tip2:0.10616493):1.69174409,((tip3:0.62639737,((tip4:0.22385597,tip5:0.22385597):0.01886368,tip6:0.24271965):0.38367772):0.03722644,(tip7:0.61266088,tip8:0.61266088):0.05096292):1.13428521):0.13967824,(((tip9:0.37258601,(((tip10:0.08766365,tip11:0.08766365):0.15292597,tip12:0.24058962):0.11445117,tip13:0.35504079):0.01754522):0.07799339,tip14:0.45057940):0.41882730,(tip15:0.39289355,((tip16:0.04378128,tip17:0.04378128):0.00013733,tip18:0.04391861):0.34897494): [...]
+    (((((tip1:0.52049303,(tip2:0.24795151,tip3:0.24795151):0.27254152):0.12170529,tip4:0.64219832):2.62354410,(((tip5:1.77260184,(tip6:1.39658785,((tip7:0.72575235,(tip8:0.51327801,tip9:0.51327801):0.21247435):0.23511553,tip10:0.96086788):0.43571997):0.37601399):0.77370667,(((tip11:1.24672914,tip12:1.24672914):0.73550439,(tip13:1.90352750,tip14:1.90352750):0.07870603):0.06407142,(((tip15:0.22390604,tip16:0.22390604):0.62159133,(tip17:0.54677153,tip18:0.54677153):0.29872584):0.54859185,(t [...]
+    ((((((tip1:0.80716705,((((((((tip2:0.04750061,tip3:0.04750061):0.15034771,tip4:0.19784832):0.00249672,tip5:0.20034504):0.14825439,tip6:0.34859943):0.00361776,(tip7:0.10237122,tip8:0.10237122):0.24984598):0.18291569,(tip9:0.13795471,(tip10:0.00075722,tip11:0.00075722):0.13719749):0.39717817):0.11236811,tip12:0.64750099):0.09753132,tip13:0.74503231):0.06213474):0.39097428,(tip14:0.19631767,tip15:0.19631767):1.00182366):1.31178856,((tip16:0.20202065,tip17:0.20202065):1.62673879,((tip18: [...]
+    ((((((tip1:0.24614525,tip2:0.24614525):1.72059155,(((tip3:0.23558331,tip4:0.23558331):1.68772554,(tip5:1.82299805,tip6:1.82299805):0.10031080):0.01244116,(tip7:1.76312304,((tip8:0.16280508,tip9:0.16280508):1.57523060,(tip10:1.21227074,(tip11:0.18366575,tip12:0.18366575):1.02860498):0.52576494):0.02508736):0.17262697):0.03098679):0.93851805,(((((tip13:0.61563492,tip14:0.61563492):0.07311440,(tip15:0.68863058,(tip16:0.03709078,tip17:0.03709078):0.65153980):0.00011873):0.21970654,tip18: [...]
+    ((((((((tip1:0.06879282,tip2:0.06879282):1.13382626,((tip3:0.28726196,tip4:0.28726196):0.06693554,tip5:0.35419750):0.84842157):0.16821623,(((tip6:0.23304987,tip7:0.23304987):0.22800922,(tip8:0.32272196,tip9:0.32272196):0.13833714):0.55268145,(tip10:0.09997082,tip11:0.09997082):0.91376972):0.35709476):0.55650663,(((tip12:0.82035017,(tip13:0.64478874,tip14:0.64478874):0.17556143):0.48101234,tip15:1.30136251):0.19994974,(((tip16:0.05382395,tip17:0.05382395):0.25660467,tip18:0.31042862): [...]
+    (((((tip1:2.22470951,tip2:2.22470951):0.36323351,(((tip3:1.00750637,tip4:1.00750637):0.26206994,tip5:1.26957631):1.13347220,((tip6:0.43943572,(tip7:0.04735398,tip8:0.04735398):0.39208174):1.71418667,tip9:2.15362239):0.24942613):0.18489450):0.05104417,((tip10:0.96949601,((tip11:0.24955392,tip12:0.24955392):0.28811979,(tip13:0.24344754,tip14:0.24344754):0.29422617):0.43182230):1.23672807,(tip15:1.77286887,tip16:1.77286887):0.43335521):0.43276310):0.60622606,((tip17:0.60212207,tip18:0.6 [...]
+    ((((tip1:0.24700403,tip2:0.24700403):3.21219814,(((((tip3:0.22350264,tip4:0.22350264):0.07150698,tip5:0.29500961):0.55839562,tip6:0.85340524):0.19358635,((tip7:0.43734360,tip8:0.43734360):0.58069825,tip9:1.01804185):0.02894974):1.25264096,((((tip10:0.80742574,(tip11:0.16516876,tip12:0.16516876):0.64225698):0.71122289,((tip13:0.58920050,(tip14:0.13235569,tip15:0.13235569):0.45684481):0.57757998,((((tip16:0.06344128,tip17:0.06344128):0.01806211,tip18:0.08150339):0.20695353,tip19:0.2884 [...]
+    ((((tip1:0.43263602,((tip2:0.04770970,tip3:0.04770970):0.33194137,(tip4:0.20331359,tip5:0.20331359):0.17633748):0.05298495):1.25060034,tip6:1.68323636):1.17111397,(((((tip7:0.96471190,(tip8:0.87186193,tip9:0.87186193):0.09284997):0.52665138,((tip10:0.29900479,tip11:0.29900479):0.78325605,(tip12:0.36038852,tip13:0.36038852):0.72187233):0.40910244):0.12965429,(((tip14:1.05364466,tip15:1.05364466):0.03604126,((tip16:0.59144640,((tip17:0.28738928,tip18:0.28738928):0.20982099,(tip19:0.119 [...]
+    ((((tip1:1.89244366,(tip2:0.44527745,(tip3:0.24169469,tip4:0.24169469):0.20358276):1.44716620):0.75521672,((((tip5:0.77359557,(tip6:0.17540050,tip7:0.17540050):0.59819508):0.20336580,tip8:0.97696137):0.15937567,tip9:1.13633704):0.99016047,(tip10:1.86070204,tip11:1.86070204):0.26579547):0.52116287):1.23635763,(((((tip12:1.09582376,(tip13:0.23665118,(tip14:0.00970697,tip15:0.00970697):0.22694421):0.85917258):1.24014652,((tip16:1.30958652,(tip17:0.40323424,tip18:0.40323424):0.90635228): [...]
+    (((tip1:0.18548393,tip2:0.18548393):2.91459036,(tip3:0.85884762,((tip4:0.10185099,tip5:0.10185099):0.07893991,tip6:0.18079090):0.67805672):2.24122667):1.89065617,(((((((tip7:0.03373623,tip8:0.03373623):0.46130753,tip9:0.49504375):0.73938656,tip10:1.23443031):0.03781843,(tip11:1.12457991,tip12:1.12457991):0.14766884):0.50063777,((tip13:0.14471960,tip14:0.14471960):0.08524847,tip15:0.22996807):1.54291844):1.63866568,((((((tip16:0.67760849,tip17:0.67760849):0.43153524,(tip18:0.75616932, [...]
+    ((tip1:0.37389469,(tip2:0.11441660,tip3:0.11441660):0.25947809):3.74458301,(((((tip4:1.76798368,(((tip5:0.81738234,(tip6:0.45754480,tip7:0.45754480):0.35983753):0.10706568,tip8:0.92444801):0.18629646,(tip9:0.49227715,(tip10:0.26048231,(tip11:0.03460550,tip12:0.03460550):0.22587681):0.23179483):0.61846733):0.65723920):0.22387385,(tip13:1.67552853,(tip14:0.20395279,tip15:0.20395279):1.47157574):0.31632900):0.28136420,((tip16:0.17633629,tip17:0.17633629):1.19617701,(tip18:0.95586729,((t [...]
+    ((((tip1:0.51706648,tip2:0.51706648):0.76905131,((tip3:0.07594013,tip4:0.07594013):1.17705941,(tip5:0.07811356,tip6:0.07811356):1.17488599):0.03311825):1.39503551,((tip7:1.51248312,(tip8:0.98880291,((tip9:0.09588194,tip10:0.09588194):0.54782104,(((tip11:0.21340275,tip12:0.21340275):0.31802130,tip13:0.53142405):0.03789186,tip14:0.56931591):0.07438707):0.34509993):0.52368021):0.86906648,(tip15:2.03926849,(tip16:1.39897394,((tip17:0.61201572,tip18:0.61201572):0.74583435,tip19:1.35785007 [...]
+    (((((((((tip1:0.06638765,tip2:0.06638765):0.11360025,tip3:0.17998791):0.62995481,(tip4:0.28530264,tip5:0.28530264):0.52464008):0.42000341,tip6:1.22994614):0.01335621,tip7:1.24330235):0.11238432,((tip8:0.39194822,(tip9:0.08940792,tip10:0.08940792):0.30254030):0.51723003,(tip11:0.63165951,(tip12:0.60562563,tip13:0.60562563):0.02603388):0.27751875):0.44650841):1.25999188,(((((tip14:0.08829021,tip15:0.08829021):0.59028769,tip16:0.67857790):0.39061308,(tip17:0.77392054,tip18:0.77392054):0 [...]
+    (((tip1:0.17515373,tip2:0.17515373):2.31927180,(((((tip3:0.01475191,tip4:0.01475191):0.18014574,tip5:0.19489765):0.30843210,(tip6:0.11909771,tip7:0.11909771):0.38423204):0.57607317,tip8:1.07940292):1.24225760,((tip9:0.46095610,(tip10:0.03161573,tip11:0.03161573):0.42934036):1.56134653,tip12:2.02230263):0.29935789):0.17276502):3.59304903,((((tip13:0.93077898,tip14:0.93077898):0.66910982,(tip15:1.14284801,(tip16:0.42532396,((tip17:0.05383921,tip18:0.05383921):0.02211142,tip19:0.0759506 [...]
+    ((((((tip1:0.20842648,tip2:0.20842648):0.85679102,tip3:1.06521749):0.67810893,(tip4:0.48205090,(tip5:0.21286774,(tip6:0.07043791,tip7:0.07043791):0.14242983):0.26918316):1.26127553):1.72658777,tip8:3.46991420):0.21680117,((((tip9:0.01040554,tip10:0.01040554):0.61756325,tip11:0.62796879):1.36373162,(((tip12:1.32200193,tip13:1.32200193):0.16313839,((tip14:0.33642292,(tip15:0.06651545,(tip16:0.04213715,tip17:0.04213715):0.02437830):0.26990747):0.08915091,tip18:0.42557383):1.05956650):0. [...]
+    ((tip1:2.49284339,(((tip2:0.18224025,tip3:0.18224025):1.11187577,tip4:1.29411602):0.20507002,(tip5:1.34462857,(tip6:1.13256216,((((tip7:0.42537737,(tip8:0.09238410,tip9:0.09238410):0.33299327):0.13933873,tip10:0.56471610):0.16777205,tip11:0.73248816):0.14516973,tip12:0.87765789):0.25490427):0.21206641):0.15455747):0.99365735):0.74044478,((((tip13:2.21594977,((((tip14:0.39281988,tip15:0.39281988):0.19526744,(tip16:0.26978421,tip17:0.26978421):0.31830311):1.28221142,(tip18:1.35366178,( [...]
+    ((tip1:3.27801609,(((tip2:0.28556633,tip3:0.28556633):2.02400637,((tip4:0.98322392,tip5:0.98322392):0.52164221,(tip6:0.61390495,tip7:0.61390495):0.89096117):0.80470657):0.54753542,(((((tip8:0.14708233,tip9:0.14708233):0.52167320,((tip10:0.10296726,tip11:0.10296726):0.31086349,(tip12:0.19579124,tip13:0.19579124):0.21803951):0.25492477):0.41111279,tip14:1.07986832):0.88782549,((tip15:0.47375202,((tip16:0.08056545,tip17:0.08056545):0.15862370,tip18:0.23918915):0.23456287):1.16908503,((t [...]
+    ((((((tip1:0.22617435,tip2:0.22617435):0.18790197,tip3:0.41407633):0.52218008,((tip4:0.52169895,((tip5:0.04633188,tip6:0.04633188):0.33809042,(tip7:0.38365126,(tip8:0.30673265,tip9:0.30673265):0.07691860):0.00077105):0.13727665):0.31728745,tip10:0.83898640):0.09727001):1.57938385,(((tip11:0.50757885,(tip12:0.26709604,tip13:0.26709604):0.24048281):1.17698121,(tip14:0.33990717,tip15:0.33990717):1.34465289):0.19216895,tip16:1.87672901):0.63891125):2.09317476,((((tip17:0.99095345,(tip18: [...]
+    ((((((tip1:0.26515651,tip2:0.26515651):0.48074913,tip3:0.74590564):2.19510156,((tip4:1.98290133,((tip5:1.01981115,tip6:1.01981115):0.15235806,((((tip7:0.24931550,tip8:0.24931550):0.03998494,tip9:0.28930044):0.19931293,(tip10:0.45770764,(tip11:0.31912255,tip12:0.31912255):0.13858509):0.03090572):0.50926757,(((tip13:0.38885379,tip14:0.38885379):0.40942955,(tip15:0.10296178,tip16:0.10296178):0.69532156):0.10729647,tip17:0.90557981):0.09230113):0.17428827):0.81073213):0.30175841,(tip18:0 [...]
+    ((((((tip1:0.37262678,(tip2:0.02734804,tip3:0.02734804):0.34527874):0.03165579,tip4:0.40428257):0.15707397,tip5:0.56135654):0.42540717,(tip6:0.24986315,tip7:0.24986315):0.73690057):1.61827075,(tip8:1.95434308,((tip9:0.90240955,((tip10:0.02635002,tip11:0.02635002):0.09843445,(tip12:0.01940012,tip13:0.01940012):0.10538435):0.77762508):0.92989254,(tip14:0.15637159,(tip15:0.12377405,tip16:0.12377405):0.03259754):1.67593050):0.12204099):0.65069139):1.13504916,((((((((tip17:0.09576368,tip1 [...]
+    ((((tip1:2.41519618,(((tip2:0.54838991,tip3:0.54838991):0.04562140,tip4:0.59401131):0.33170414,(tip5:0.82353115,(tip6:0.48605108,tip7:0.48605108):0.33748007):0.10218430):1.48948073):0.16344464,((((tip8:1.05774045,(tip9:0.12564659,(tip10:0.04827666,tip11:0.04827666):0.07736993):0.93209386):0.73846900,((tip12:0.16556573,tip13:0.16556573):0.94039392,tip14:1.10595965):0.69024980):0.42177284,(((tip15:0.33839679,(tip16:0.11922336,tip17:0.11922336):0.21917343):0.92229283,(tip18:0.68253517,t [...]
+    ((((((tip1:0.91652870,tip2:0.91652870):0.06174254,tip3:0.97827125):0.72696567,(tip4:0.68016529,(tip5:0.50005221,tip6:0.50005221):0.18011308):1.02507162):0.86205542,((tip7:0.56622386,((tip8:0.39042139,tip9:0.39042139):0.06341171,tip10:0.45383310):0.11239076):0.26079082,tip11:0.82701468):1.74027765):1.12661499,((tip12:0.34900904,(tip13:0.12956572,tip14:0.12956572):0.21944332):2.01206183,(((tip15:0.08368587,tip16:0.08368587):0.70371389,tip17:0.78739977):0.35549426,(tip18:1.06837106,(tip [...]
+    (((tip1:1.38081169,((tip2:0.39063978,(tip3:0.10170746,(tip4:0.08443308,tip5:0.08443308):0.01727438):0.28893232):0.64072132,tip6:1.03136110):0.34945059):1.82813334,(tip7:1.66490173,(tip8:0.30886745,tip9:0.30886745):1.35603428):1.54404330):1.97479153,((((((((tip10:0.01769876,tip11:0.01769876):1.37953281,tip12:1.39723158):0.38926482,(tip13:0.74645233,tip14:0.74645233):1.04004407):0.56761718,((((tip15:0.71853304,tip16:0.71853304):0.01611567,(tip17:0.34946251,tip18:0.34946251):0.38518620) [...]
+    ((((((tip1:0.03962040,tip2:0.03962040):1.06282711,(((tip3:0.70041990,(tip4:0.13600945,tip5:0.13600945):0.56441045):0.10474777,(tip6:0.52131009,(tip7:0.34248376,(tip8:0.33432674,tip9:0.33432674):0.00815701):0.17882633):0.28385758):0.01855922,tip10:0.82372689):0.27872062):0.94655573,(((tip11:0.08959579,tip12:0.08959579):0.63669229,(tip13:0.59091783,(tip14:0.14885664,tip15:0.14885664):0.44206119):0.13537025):0.01069927,tip16:0.73698735):1.31201589):0.99751611,((tip17:2.55461365,(((tip18 [...]
+    ((((tip1:1.04223108,((tip2:0.21403456,(tip3:0.18419743,tip4:0.18419743):0.02983713):0.00360441,(tip5:0.20188498,tip6:0.20188498):0.01575398):0.82459211):0.12051296,tip7:1.16274405):0.71336603,((tip8:0.81236625,tip9:0.81236625):0.33537912,(((tip10:0.06382513,tip11:0.06382513):0.28770447,tip12:0.35152960):0.51910639,tip13:0.87063599):0.27710938):0.72836471):2.02094027,((((tip14:1.86136365,((tip15:0.06852770,tip16:0.06852770):0.09035826,tip17:0.15888596):1.70247769):0.42343807,(tip18:2. [...]
+    ((((((tip1:0.64863539,(tip2:0.09885597,tip3:0.09885597):0.54977942):1.32455921,((((tip4:0.40902853,tip5:0.40902853):0.29116678,(tip6:0.16688156,tip7:0.16688156):0.53331375):0.38117504,((tip8:0.63681173,tip9:0.63681173):0.36073017,((((tip10:0.16560650,tip11:0.16560650):0.24669981,tip12:0.41230631):0.14777851,tip13:0.56008482):0.26036930,(tip14:0.74293756,(tip15:0.12523890,tip16:0.12523890):0.61769867):0.07751656):0.17708778):0.08382845):0.55610919,tip17:1.63747954):0.33571506):0.68641 [...]
+    (((((tip1:0.21475315,tip2:0.21475315):0.54606795,tip3:0.76082110):1.03708196,(tip4:0.17705083,tip5:0.17705083):1.62085223):0.12464356,((((tip6:0.95986104,(tip7:0.31954336,tip8:0.31954336):0.64031768):0.33770037,tip9:1.29756141):0.11082053,(tip10:0.03583694,tip11:0.03583694):1.37254500):0.20405388,(tip12:0.67842793,tip13:0.67842793):0.93400788):0.31011081):0.84892261,(((((tip14:0.67006373,tip15:0.67006373):0.46656990,(((tip16:0.25650334,tip17:0.25650334):0.21538687,tip18:0.47189021):0 [...]
+    ((((((tip1:1.36859131,tip2:1.36859131):0.08417273,(tip3:0.52923203,tip4:0.52923203):0.92353201):0.88654912,((((tip5:0.26504278,tip6:0.26504278):0.65644908,((tip7:0.03634644,tip8:0.03634644):0.12556934,tip9:0.16191578):0.75957608):0.30553842,((tip10:0.49439216,(tip11:0.25150800,tip12:0.25150800):0.24288416):0.02922058,tip13:0.52361274):0.70341754):0.03278875,(tip14:0.85048938,tip15:0.85048938):0.40932965):1.07949412):0.02617955,((tip16:0.11182356,tip17:0.11182356):0.74025941,(((tip18: [...]
+    (((tip1:0.08711910,tip2:0.08711910):0.80019307,tip3:0.88731217):2.07711453,(((((tip4:1.95325935,(((tip5:1.31718314,(tip6:0.70926547,tip7:0.70926547):0.60791767):0.19136775,(((tip8:0.41070724,tip9:0.41070724):0.44406438,tip10:0.85477161):0.54878879,(tip11:0.52929068,(tip12:0.03765130,tip13:0.03765130):0.49163938):0.87426972):0.10499048):0.03693771,(tip14:1.11900771,((((tip15:0.15858698,tip16:0.15858698):0.19822621,tip17:0.35681319):0.04088163,((tip18:0.00010872,tip19:0.00010872):0.098 [...]
+    ((((tip1:0.84086061,tip2:0.84086061):0.15847802,(tip3:0.22231293,tip4:0.22231293):0.77702570):0.54793978,tip5:1.54727840):1.48527324,(((((((tip6:0.28698039,tip7:0.28698039):1.35471058,tip8:1.64169097):0.04031575,((tip9:0.93493533,((((tip10:0.11386228,tip11:0.11386228):0.08466935,tip12:0.19853163):0.14504790,(tip13:0.02896404,tip14:0.02896404):0.31461549):0.16575170,(((tip15:0.00104427,tip16:0.00104427):0.09434080,tip17:0.09538507):0.10117054,tip18:0.19655561):0.31277561):0.42560410): [...]
+    ((((tip1:0.82842064,(tip2:0.32188225,tip3:0.32188225):0.50653839):0.99902987,((tip4:0.17137814,tip5:0.17137814):1.35746694,(tip6:1.48807478,tip7:1.48807478):0.04077029):0.29860544):1.39654267,(((tip8:1.50805664,((tip9:0.42468739,(tip10:0.18098736,tip11:0.18098736):0.24370003):0.45774150,(tip12:0.50272608,tip13:0.50272608):0.37970281):0.62562776):0.28895736,(((((tip14:0.17477989,tip15:0.17477989):0.01618290,tip16:0.19096279):0.37759209,((tip17:0.12064219,(tip18:0.06177759,tip19:0.0617 [...]
+    -->
+</beast>
diff --git a/examples/beast2vs1/beast1/testBirthDeathModel_10taxa.xml b/examples/beast2vs1/beast1/testBirthDeathModel_10taxa.xml
new file mode 100644
index 0000000..3fc3461
--- /dev/null
+++ b/examples/beast2vs1/beast1/testBirthDeathModel_10taxa.xml
@@ -0,0 +1,111 @@
+<?xml version="1.0"?>
+<!-- $Id: testCoalescent.xml,v 1.2 2005/07/11 23:22:40 rambaut Exp $ -->
+<!-- Tests the coalescent prior -->
+
+<beast>
+
+    <taxa id="taxa1">
+        <taxon id="A"/>
+        <taxon id="B"/>
+        <taxon id="C"/>
+        <taxon id="D"/>
+        <taxon id="E"/>
+        <taxon id="F"/>
+        <taxon id="G"/>
+        <taxon id="H"/>
+        <taxon id="I"/>
+        <taxon id="J"/>
+    </taxa>
+
+    <!-- create a demographic model and intialize currentPopulationSize parameter -->
+    <constantSize id="demo1" units="years">
+        <populationSize>
+            <parameter id="demo1.pop1" value="10.0"/>
+        </populationSize>
+    </constantSize>
+
+    <!-- simulate a coalescent tree -->
+    <coalescentTree id="tree1">
+        <demographicModel idref="demo1"/>
+        <taxa idref="taxa1"/>
+    </coalescentTree>
+
+	<!-- A prior on the distribution node heights defined given                  -->
+	<!-- a Birth-Death speciation process (Gernhard 2008).                       -->
+	<birthDeathModel id="birthDeath" units="substitutions">
+		<birthMinusDeathRate>
+			<parameter id="birthDiffRate" value="2.0" lower="0.0" upper="1000000.0"/>
+		</birthMinusDeathRate>
+		<relativeDeathRate>
+			<parameter id="relativeDeathRate" value="0.5" lower="0.0" upper="100.0"/>
+		</relativeDeathRate>
+	</birthDeathModel>
+
+
+    <treeModel id="treeModel1">
+        <tree idref="tree1"/>
+        <rootHeight>
+            <parameter id="treeModel1.rootHeight"/>
+        </rootHeight>
+        <nodeHeights rootNode="false" internalNodes="true">
+            <parameter id="treeModel1.internalNodeHeights"/>
+        </nodeHeights>
+        <nodeHeights rootNode="true" internalNodes="true">
+            <parameter id="treeModel1.allNodeHeights"/>
+        </nodeHeights>
+    </treeModel>
+
+    <speciationLikelihood id="speciation">
+        <model>
+            <yuleModel idref="birthDeath"/>
+        </model>
+        <speciesTree>
+            <treeModel idref="treeModel1"/>
+        </speciesTree>
+    </speciationLikelihood>
+
+    <treeLengthStatistic name="TL" id="TL">
+        <treeModel idref="treeModel1"/>
+    </treeLengthStatistic>
+
+    <mcmc id="mcmc1" chainLength="2000000" verbose="false">
+        <speciationLikelihood idref="speciation"/>
+        <log id="logScreen2" logEvery="20000">
+            <column dp="4">
+                <likelihood idref="speciation"/>
+                <parameter idref="treeModel1.rootHeight"/>
+                <treeLengthStatistic idref="TL"/>
+            </column>
+        </log>
+        <log id="log1" logEvery="10" fileName="birthDeath10taxa.log">
+            <likelihood idref="speciation"/>
+            <parameter idref="treeModel1.rootHeight"/>
+            <treeLengthStatistic idref="TL"/>
+        </log>
+        <logTree id="logTree1" logEvery="100" nexusFormat="true" fileName="birthDeath10taxa.trees">
+            <treeModel idref="treeModel1"/>
+        </logTree>
+        <operators>
+            <subtreeSlide weight="1" gaussian="true" size="1">
+                <treeModel idref="treeModel1"/>
+            </subtreeSlide>
+        </operators>
+    </mcmc>
+
+    <report>
+        Time taken:
+        <property name="timer">
+            <mcmc idref="mcmc1"/>
+        </property>
+    </report>
+
+    <traceAnalysis fileName="birthDeath10taxa.log" burnIn="1000">
+        <!-- expectation of root height for 10 tips and lambda = 2
+        <expectation name="treeModel1.rootHeight" value="0.964484127"/> ? 0.70105 -->
+        <!-- expectation of tree length for 10 tips and lambda = 2
+        <expectation name="TL" value="4.5"/> ? 2.99054 -->
+    </traceAnalysis>
+
+</beast>
+
+
diff --git a/examples/beast2vs1/beast1/testCalibration.xml b/examples/beast2vs1/beast1/testCalibration.xml
new file mode 100644
index 0000000..049046c
--- /dev/null
+++ b/examples/beast2vs1/beast1/testCalibration.xml
@@ -0,0 +1,241 @@
+<?xml version="1.0" standalone="yes"?>
+
+<!-- Generated by BEAUTi v1.6.1                                              -->
+<!--       by Alexei J. Drummond and Andrew Rambaut                          -->
+<!--       Department of Computer Science, University of Auckland and        -->
+<!--       Institute of Evolutionary Biology, University of Edinburgh        -->
+<!--       http://beast.bio.ed.ac.uk/                                        -->
+<beast>
+
+	<!-- The list of taxa analyse (can also include dates/ages).                 -->
+	<!-- ntax=6                                                                  -->
+	<taxa id="taxa">
+		<taxon id="human"/>
+		<taxon id="chimp"/>
+		<taxon id="bonobo"/>
+		<taxon id="gorilla"/>
+		<taxon id="orangutan"/>
+		<taxon id="siamang"/>
+	</taxa>
+	<taxa id="HumanChimp">
+		<taxon idref="chimp"/>
+		<taxon idref="human"/>
+	</taxa>
+
+	<!-- The sequence alignment (each sequence refers to a taxon above).         -->
+	<!-- ntax=6 nchar=768                                                        -->
+	<alignment id="alignment" dataType="nucleotide">
+		<sequence>
+			<taxon idref="human"/>
+			AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCACCTCGGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="chimp"/>
+			AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCACCTCAGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="bonobo"/>
+			AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAGC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTTGAATTTGCAATTCAATATGAAAA-TCACCTCAGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="gorilla"/>
+			AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTAAACATAGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA-CAACACTTAATTTCTGTAAGGACTGCAAAACCCTACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCAATGGGACTCAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAT-TCACCTCGGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="orangutan"/>
+			AGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA-CAGCACTTAATTTCTGTAAGGACTGCAAAACCCCACTTTGCATCAACTGAGCGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCCTAGACCGATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAT-TGGCTTCAGTCCAAAGCCCCGGCAGGCCTTAAAGCTGCTCCTTCGAATTTGCAATTCAACATGACAA-TCACCTCAGGGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="siamang"/>
+			AGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTAACAAAACTTAATTTCTGCAAGGGCTGCAAAACCCTACTTTGCATCAACCGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCGATGGGACTTAAACCCATAAAAATTTAGTTAACAGCTAAACACCCTAAACAACCTGGCTTCAATCTAAAGCCCCGGCAGA-GTTGAAGCTGCTTCTTTGAACTTGCAATTCAACGTGAAAAATCACTTCGGAGCT [...]
+		</sequence>
+	</alignment>
+
+	<!-- The unique patterns from 1 to end                                       -->
+	<!-- npatterns=69                                                            -->
+	<patterns id="patterns" from="1">
+		<alignment idref="alignment"/>
+	</patterns>
+
+	<!-- A prior assumption that the population size has remained constant       -->
+	<!-- throughout the time spanned by the genealogy.                           -->
+	<constantSize id="constant" units="substitutions">
+		<populationSize>
+			<parameter id="constant.popSize" value="17.0" lower="0.0" upper="Infinity"/>
+		</populationSize>
+	</constantSize>
+
+	<!-- Generate a random starting tree under the coalescent process            -->
+	<coalescentTree id="startingTree">
+		<constrainedTaxa>
+			<taxa idref="taxa"/>
+			<tmrca monophyletic="false">
+				<taxa idref="HumanChimp"/>
+			</tmrca>
+		</constrainedTaxa>
+		<constantSize idref="constant"/>
+	</coalescentTree>
+
+	<!-- Generate a tree model                                                   -->
+	<treeModel id="treeModel">
+		<coalescentTree idref="startingTree"/>
+		<rootHeight>
+			<parameter id="treeModel.rootHeight"/>
+		</rootHeight>
+		<nodeHeights internalNodes="true">
+			<parameter id="treeModel.internalNodeHeights"/>
+		</nodeHeights>
+		<nodeHeights internalNodes="true" rootNode="true">
+			<parameter id="treeModel.allInternalNodeHeights"/>
+		</nodeHeights>
+	</treeModel>
+
+	<!-- Generate a coalescent likelihood                                        -->
+	<coalescentLikelihood id="coalescent">
+		<model>
+			<constantSize idref="constant"/>
+		</model>
+		<populationTree>
+			<treeModel idref="treeModel"/>
+		</populationTree>
+	</coalescentLikelihood>
+
+	<!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+	<HKYModel id="hky">
+		<frequencies>
+			<frequencyModel dataType="nucleotide">
+				<frequencies>
+					<parameter id="frequencies" value="0.25 0.25 0.25 0.25"/>
+				</frequencies>
+			</frequencyModel>
+		</frequencies>
+		<kappa>
+			<parameter id="kappa" value="2.0" lower="0.0" upper="Infinity"/>
+		</kappa>
+	</HKYModel>
+
+	<!-- site model                                                              -->
+	<siteModel id="siteModel">
+		<substitutionModel>
+			<HKYModel idref="hky"/>
+		</substitutionModel>
+	</siteModel>
+
+	<treeLikelihood id="treeLikelihood" useAmbiguities="false">
+		<patterns idref="patterns"/>
+		<treeModel idref="treeModel"/>
+		<siteModel idref="siteModel"/>
+	</treeLikelihood>
+
+	<tmrcaStatistic id="tmrca(HumanChimp)" includeStem="false">
+		<mrca>
+			<taxa idref="HumanChimp"/>
+		</mrca>
+		<treeModel idref="treeModel"/>
+	</tmrcaStatistic>
+
+	<!-- Define operators                                                        -->
+	<operators id="operators">
+		<scaleOperator scaleFactor="0.75" weight="0.1">
+			<parameter idref="kappa"/>
+		</scaleOperator>
+		<deltaExchange delta="0.01" weight="0.1">
+			<parameter idref="frequencies"/>
+		</deltaExchange>
+		<subtreeSlide size="1.7" gaussian="true" weight="15">
+			<treeModel idref="treeModel"/>
+		</subtreeSlide>
+		<narrowExchange weight="15">
+			<treeModel idref="treeModel"/>
+		</narrowExchange>
+		<wideExchange weight="3">
+			<treeModel idref="treeModel"/>
+		</wideExchange>
+		<wilsonBalding weight="3">
+			<treeModel idref="treeModel"/>
+		</wilsonBalding>
+		<scaleOperator scaleFactor="0.75" weight="3">
+			<parameter idref="treeModel.rootHeight"/>
+		</scaleOperator>
+		<uniformOperator weight="30">
+			<parameter idref="treeModel.internalNodeHeights"/>
+		</uniformOperator>
+		<scaleOperator scaleFactor="0.75" weight="3">
+			<parameter idref="constant.popSize"/>
+		</scaleOperator>
+		<upDownOperator scaleFactor="0.75" weight="3">
+			<up>				
+			</up>
+			<down>
+				<parameter idref="treeModel.allInternalNodeHeights"/>
+			</down>
+		</upDownOperator>
+	</operators>
+
+	<!-- Define MCMC                                                             -->
+	<mcmc id="mcmc" chainLength="10000000" autoOptimize="true">
+		<posterior id="posterior">
+			<prior id="prior">
+				<normalPrior mean="6.0" stdev="0.5">
+					<statistic idref="tmrca(HumanChimp)"/>
+				</normalPrior>
+				<logNormalPrior mean="1.0" stdev="1.25" offset="0.0" meanInRealSpace="false">
+					<parameter idref="kappa"/>
+				</logNormalPrior>
+                <uniformPrior lower="0.0" upper="1.0">
+					<parameter idref="frequencies"/>
+				</uniformPrior>
+				<oneOnXPrior>
+					<parameter idref="constant.popSize"/>
+				</oneOnXPrior>
+				<coalescentLikelihood idref="coalescent"/>
+			</prior>
+			<likelihood id="likelihood">
+				<treeLikelihood idref="treeLikelihood"/>
+			</likelihood>
+		</posterior>
+		<operators idref="operators"/>
+
+		<!-- write log to screen                                                     -->
+		<log id="screenLog" logEvery="100000">
+			<column label="Posterior" dp="4" width="12">
+				<posterior idref="posterior"/>
+			</column>
+			<column label="Prior" dp="4" width="12">
+				<prior idref="prior"/>
+			</column>
+			<column label="Likelihood" dp="4" width="12">
+				<likelihood idref="likelihood"/>
+			</column>
+			<column label="rootHeight" sf="6" width="12">
+				<parameter idref="treeModel.rootHeight"/>
+			</column>
+		</log>
+
+		<!-- write log to file                                                       -->
+		<log id="fileLog" logEvery="1000" fileName="testCalibration.log" overwrite="false">
+			<posterior idref="posterior"/>
+			<prior idref="prior"/>
+			<likelihood idref="likelihood"/>
+			<parameter idref="treeModel.rootHeight"/>
+			<tmrcaStatistic idref="tmrca(HumanChimp)"/>
+			<parameter idref="constant.popSize"/>
+			<parameter idref="kappa"/>
+			<parameter idref="frequencies"/>
+			<treeLikelihood idref="treeLikelihood"/>
+			<coalescentLikelihood idref="coalescent"/>
+		</log>
+
+		<!-- write tree log to file
+		<logTree id="treeFileLog" logEvery="1000" nexusFormat="true" fileName="testCalibration.trees.txt" sortTranslationTable="true">
+			<treeModel idref="treeModel"/>
+			<strictClockBranchRates idref="branchRates"/>
+			<posterior idref="posterior"/>
+		</logTree>    -->
+	</mcmc>
+	<report>
+		<property name="timer">
+			<mcmc idref="mcmc"/>
+		</property>
+	</report>
+</beast>
diff --git a/examples/beast2vs1/beast1/testCoalescent.xml b/examples/beast2vs1/beast1/testCoalescent.xml
new file mode 100644
index 0000000..4d70256
--- /dev/null
+++ b/examples/beast2vs1/beast1/testCoalescent.xml
@@ -0,0 +1,174 @@
+<?xml version="1.0"?>
+<!-- $Id: testCoalescent.xml,v 1.2 2005/07/11 23:22:40 rambaut Exp $ -->
+<!-- Tests the coalescent prior -->
+
+<beast>
+
+    <taxa id="taxa1">
+        <taxon id="A"/>
+        <taxon id="B"/>
+        <taxon id="C"/>
+        <taxon id="D"/>
+    </taxa>
+
+    <date id="date1" value="5000" units="days" direction="backwards"/>
+    <date id="date2" value="0" units="days" direction="backwards"/>
+
+    <taxa id="taxa2">
+        <taxon id="E">
+            <date idref="date1"/>
+        </taxon>
+        <taxon id="F">
+            <date idref="date1"/>
+        </taxon>
+        <taxon id="G">
+            <date idref="date2"/>
+        </taxon>
+        <taxon id="H">
+            <date idref="date2"/>
+        </taxon>
+    </taxa>
+
+    <!-- create a demographic model and intialize currentPopulationSize parameter -->
+    <constantSize id="demo1" units="years">
+        <populationSize>
+            <parameter id="demo1.pop1" value="10000.0"/>
+        </populationSize>
+    </constantSize>
+
+    <!-- simulate a coalescent tree -->
+    <coalescentTree id="tree1">
+        <constantSize idref="demo1"/>
+        <taxa idref="taxa1"/>
+    </coalescentTree>
+
+    <!-- simulate a coalescent tree -->
+    <coalescentTree id="tree2">
+        <constantSize idref="demo1"/>
+        <taxa idref="taxa2"/>
+    </coalescentTree>
+
+    <treeModel id="treeModel1">
+        <coalescentTree idref="tree1"/>
+        <rootHeight>
+            <parameter id="treeModel1.rootHeight"/>
+        </rootHeight>
+        <nodeHeights rootNode="false" internalNodes="true">
+            <parameter id="treeModel1.internalNodeHeights"/>
+        </nodeHeights>
+        <nodeHeights rootNode="true" internalNodes="true">
+            <parameter id="treeModel1.allNodeHeights"/>
+        </nodeHeights>
+    </treeModel>
+
+    <treeModel id="treeModel2">
+        <coalescentTree idref="tree2"/>
+        <rootHeight>
+            <parameter id="treeModel2.rootHeight"/>
+        </rootHeight>
+        <nodeHeights rootNode="false" internalNodes="true">
+            <parameter id="treeModel2.internalNodeHeights"/>
+        </nodeHeights>
+        <nodeHeights rootNode="true" internalNodes="true">
+            <parameter id="treeModel2.allNodeHeights"/>
+        </nodeHeights>
+    </treeModel>
+
+    <!-- create a coalescent model from a tree model and demographic model -->
+    <coalescentLikelihood id="coalescent1">
+        <model>
+            <constantSize idref="demo1"/>
+        </model>
+        <populationTree>
+            <treeModel idref="treeModel1"/>
+        </populationTree>
+    </coalescentLikelihood>
+
+    <!-- create a second coalescent model -->
+    <coalescentLikelihood id="coalescent2">
+        <model>
+            <constantSize idref="demo1"/>
+        </model>
+        <populationTree>
+            <treeModel idref="treeModel2"/>
+        </populationTree>
+    </coalescentLikelihood>
+
+    <mcmc id="mcmc1" chainLength="1000000" verbose="false">
+        <coalescentLikelihood idref="coalescent1"/>
+        <log id="logScreen2" logEvery="5000">
+            <column dp="4">
+                <coalescentLikelihood idref="coalescent1"/>
+                <parameter idref="treeModel1.rootHeight"/>
+            </column>
+        </log>
+        <log id="log1" logEvery="5" fileName="coalescentPrior.log">
+            <coalescentLikelihood idref="coalescent1"/>
+            <parameter idref="treeModel1.rootHeight"/>
+        </log>
+        <logTree id="logTree1" logEvery="100" nexusFormat="true"
+                 fileName="coalescentPrior.trees">
+            <treeModel idref="treeModel1"/>
+        </logTree>
+        <operators>
+            <subtreeSlide weight="1" gaussian="true" size="14000">
+                <treeModel idref="treeModel1"/>
+            </subtreeSlide>
+        </operators>
+    </mcmc>
+
+    <report>
+        Time taken:
+        <property name="timer">
+            <mcmc idref="mcmc1"/>
+        </property>
+    </report>
+
+    <traceAnalysis fileName="coalescentPrior.log" burnIn="1000">
+        <expectation name="treeModel1.rootHeight" value="15000"/>
+    </traceAnalysis>
+
+    <treeTraceAnalysis fileName="coalescentPrior.trees"/>
+
+
+    <mcmc id="mcmc2" chainLength="1000000" verbose="false">
+        <coalescentLikelihood idref="coalescent2"/>
+        <log id="logScreen" logEvery="5000">
+            <column dp="4">
+                <coalescentLikelihood idref="coalescent2"/>
+                <parameter idref="treeModel2.rootHeight"/>
+            </column>
+        </log>
+        <log id="log2" logEvery="5" fileName="coalescentPrior_2.log">
+            <coalescentLikelihood idref="coalescent2"/>
+            <parameter idref="treeModel2.rootHeight"/>
+        </log>
+        <logTree id="logTree2" logEvery="100" nexusFormat="true"
+                 fileName="coalescentPrior_2.trees">
+            <treeModel idref="treeModel2"/>
+        </logTree>
+        <operators>
+            <subtreeSlide weight="1" gaussian="true" size="14000">
+                <treeModel idref="treeModel2"/>
+            </subtreeSlide>
+        </operators>
+    </mcmc>
+
+    <report>
+        Time taken:
+        <property name="timer">
+            <mcmc idref="mcmc2"/>
+        </property>
+    </report>
+
+    <traceAnalysis fileName="coalescentPrior_2.log" burnIn="1000">
+        <!-- the expectation for 4 leaves with Theta=10000 and tau=5000 -->
+        <expectation name="treeModel2.rootHeight" value="19344.2178"/>
+    </traceAnalysis>
+
+    <treeTraceAnalysis fileName="coalescentPrior_2.trees"/>
+
+
+</beast>
+
+
diff --git a/examples/beast2vs1/beast1/testCoalescentNoClock.xml b/examples/beast2vs1/beast1/testCoalescentNoClock.xml
new file mode 100644
index 0000000..c919eb3
--- /dev/null
+++ b/examples/beast2vs1/beast1/testCoalescentNoClock.xml
@@ -0,0 +1,222 @@
+<?xml version="1.0" standalone="yes"?>
+
+<!-- Generated by BEAUTi v1.7.0 Prerelease r3910                             -->
+<!--       by Alexei J. Drummond and Andrew Rambaut                          -->
+<!--       Department of Computer Science, University of Auckland and        -->
+<!--       Institute of Evolutionary Biology, University of Edinburgh        -->
+<!--       http://beast.bio.ed.ac.uk/                                        -->
+<beast>
+
+	<!-- The list of taxa to be analysed (can also include dates/ages).          -->
+	<!-- ntax=6                                                                  -->
+	<taxa id="taxa">
+		<taxon id="human"/>
+		<taxon id="chimp"/>
+		<taxon id="bonobo"/>
+		<taxon id="gorilla"/>
+		<taxon id="orangutan"/>
+		<taxon id="siamang"/>
+	</taxa>
+
+	<!-- The sequence alignment (each sequence refers to a taxon above).         -->
+	<!-- ntax=6 nchar=768                                                        -->
+	<alignment id="alignment" dataType="nucleotide">
+		<sequence>
+			<taxon idref="human"/>
+			AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCACCTCGGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="chimp"/>
+			AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCACCTCAGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="bonobo"/>
+			AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAGC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTTGAATTTGCAATTCAATATGAAAA-TCACCTCAGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="gorilla"/>
+			AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTAAACATAGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA-CAACACTTAATTTCTGTAAGGACTGCAAAACCCTACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCAATGGGACTCAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAT-TCACCTCGGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="orangutan"/>
+			AGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA-CAGCACTTAATTTCTGTAAGGACTGCAAAACCCCACTTTGCATCAACTGAGCGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCCTAGACCGATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAT-TGGCTTCAGTCCAAAGCCCCGGCAGGCCTTAAAGCTGCTCCTTCGAATTTGCAATTCAACATGACAA-TCACCTCAGGGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="siamang"/>
+			AGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTAACAAAACTTAATTTCTGCAAGGGCTGCAAAACCCTACTTTGCATCAACCGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCGATGGGACTTAAACCCATAAAAATTTAGTTAACAGCTAAACACCCTAAACAACCTGGCTTCAATCTAAAGCCCCGGCAGA-GTTGAAGCTGCTTCTTTGAACTTGCAATTCAACGTGAAAAATCACTTCGGAGCT [...]
+		</sequence>
+	</alignment>
+
+	<!-- The unique patterns from 1 to end                                       -->
+	<!-- npatterns=69                                                            -->
+	<patterns id="patterns" from="1">
+		<alignment idref="alignment"/>
+	</patterns>
+
+	<!-- A prior assumption that the population size has remained constant       -->
+	<!-- throughout the time spanned by the genealogy.                           -->
+	<constantSize id="constant" units="substitutions">
+		<populationSize>
+			<parameter id="constant.popSize" value="0.077" lower="0.0" upper="Infinity"/>
+		</populationSize>
+	</constantSize>
+
+	<!-- Generate a random starting tree under the coalescent process            -->
+	<coalescentTree id="startingTree" rootHeight="0.077">
+		<taxa idref="taxa"/>
+		<constantSize idref="constant"/>
+	</coalescentTree>
+
+	<!-- Generate a tree model                                                   -->
+	<treeModel id="treeModel">
+		<coalescentTree idref="startingTree"/>
+		<rootHeight>
+			<parameter id="treeModel.rootHeight"/>
+		</rootHeight>
+		<nodeHeights internalNodes="true">
+			<parameter id="treeModel.internalNodeHeights"/>
+		</nodeHeights>
+		<nodeHeights internalNodes="true" rootNode="true">
+			<parameter id="treeModel.allInternalNodeHeights"/>
+		</nodeHeights>
+	</treeModel>
+
+	<!-- Generate a coalescent likelihood                                        -->
+	<coalescentLikelihood id="coalescent">
+		<model>
+			<constantSize idref="constant"/>
+		</model>
+		<populationTree>
+			<treeModel idref="treeModel"/>
+		</populationTree>
+	</coalescentLikelihood>
+
+	<!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+	<HKYModel id="hky">
+		<frequencies>
+			<frequencyModel dataType="nucleotide">
+				<frequencies>
+					<parameter id="frequencies" value="0.25 0.25 0.25 0.25"/>
+				</frequencies>
+			</frequencyModel>
+		</frequencies>
+		<kappa>
+			<parameter id="kappa" value="2.0" lower="0.0" upper="Infinity"/>
+		</kappa>
+	</HKYModel>
+
+	<!-- site model                                                              -->
+	<siteModel id="siteModel">
+		<substitutionModel>
+			<HKYModel idref="hky"/>
+		</substitutionModel>
+	</siteModel>
+
+	<!-- Likelihood for tree given sequence data                                 -->
+	<treeLikelihood id="treeLikelihood" useAmbiguities="false">
+		<patterns idref="patterns"/>
+		<treeModel idref="treeModel"/>
+		<siteModel idref="siteModel"/>
+	</treeLikelihood>
+
+	<!-- Define operators                                                        -->
+	<operators id="operators">
+		<scaleOperator scaleFactor="0.75" weight="0.1">
+			<parameter idref="kappa"/>
+		</scaleOperator>
+		<deltaExchange delta="0.01" weight="0.1">
+			<parameter idref="frequencies"/>
+		</deltaExchange>
+		<subtreeSlide size="0.0077" gaussian="true" weight="15">
+			<treeModel idref="treeModel"/>
+		</subtreeSlide>
+		<narrowExchange weight="15">
+			<treeModel idref="treeModel"/>
+		</narrowExchange>
+		<wideExchange weight="3">
+			<treeModel idref="treeModel"/>
+		</wideExchange>
+		<wilsonBalding weight="3">
+			<treeModel idref="treeModel"/>
+		</wilsonBalding>
+		<scaleOperator scaleFactor="0.75" weight="3">
+			<parameter idref="treeModel.rootHeight"/>
+		</scaleOperator>
+		<uniformOperator weight="30">
+			<parameter idref="treeModel.internalNodeHeights"/>
+		</uniformOperator>
+		<scaleOperator scaleFactor="0.75" weight="3">
+			<parameter idref="constant.popSize"/>
+		</scaleOperator>
+		<upDownOperator scaleFactor="0.75" weight="3">
+			<up>
+			</up>
+			<down>
+				<parameter idref="treeModel.allInternalNodeHeights"/>
+			</down>
+		</upDownOperator>
+	</operators>
+
+	<!-- Define MCMC                                                             -->
+	<mcmc id="mcmc" chainLength="10000000" autoOptimize="true">
+		<posterior id="posterior">
+			<prior id="prior">
+				<logNormalPrior mean="1.0" stdev="1.25" offset="0.0" meanInRealSpace="false">
+					<parameter idref="kappa"/>
+				</logNormalPrior>
+				<uniformPrior lower="0.0" upper="1.0">
+					<parameter idref="frequencies"/>
+				</uniformPrior>
+				<oneOnXPrior>
+					<parameter idref="constant.popSize"/>
+				</oneOnXPrior>
+				<coalescentLikelihood idref="coalescent"/>
+			</prior>
+			<likelihood id="likelihood">
+				<treeLikelihood idref="treeLikelihood"/>
+			</likelihood>
+		</posterior>
+		<operators idref="operators"/>
+
+		<!-- write log to screen                                                     -->
+		<log id="screenLog" logEvery="100000">
+			<column label="Posterior" dp="4" width="12">
+				<posterior idref="posterior"/>
+			</column>
+			<column label="Prior" dp="4" width="12">
+				<prior idref="prior"/>
+			</column>
+			<column label="Likelihood" dp="4" width="12">
+				<likelihood idref="likelihood"/>
+			</column>
+			<column label="rootHeight" sf="6" width="12">
+				<parameter idref="treeModel.rootHeight"/>
+			</column>
+		</log>
+
+		<!-- write log to file                                                       -->
+		<log id="fileLog" logEvery="1000" fileName="testCoalescentNoClock.log" overwrite="false">
+			<posterior idref="posterior"/>
+			<prior idref="prior"/>
+			<likelihood idref="likelihood"/>
+			<parameter idref="treeModel.rootHeight"/>
+			<parameter idref="constant.popSize"/>
+			<parameter idref="kappa"/>
+			<parameter idref="frequencies"/>
+			<treeLikelihood idref="treeLikelihood"/>
+			<coalescentLikelihood idref="coalescent"/>
+		</log>
+
+		<!-- write tree log to file                                                  -->
+		<logTree id="treeFileLog" logEvery="1000" nexusFormat="true" fileName="testCoalescentNoClock.trees" sortTranslationTable="true">
+			<treeModel idref="treeModel"/>
+			<posterior idref="posterior"/>
+		</logTree>
+	</mcmc>
+	<report>
+		<property name="timer">
+			<mcmc idref="mcmc"/>
+		</property>
+	</report>
+    <treeTraceAnalysis fileName="testCoalescentNoClock.trees"/>
+</beast>
diff --git a/examples/beast2vs1/beast1/testCoalescentNoClock1.xml b/examples/beast2vs1/beast1/testCoalescentNoClock1.xml
new file mode 100644
index 0000000..72cd2c0
--- /dev/null
+++ b/examples/beast2vs1/beast1/testCoalescentNoClock1.xml
@@ -0,0 +1,213 @@
+<?xml version="1.0" standalone="yes"?>
+
+<!-- Generated by BEAUTi v1.7.0 Prerelease r3910                             -->
+<!--       by Alexei J. Drummond and Andrew Rambaut                          -->
+<!--       Department of Computer Science, University of Auckland and        -->
+<!--       Institute of Evolutionary Biology, University of Edinburgh        -->
+<!--       http://beast.bio.ed.ac.uk/                                        -->
+<beast>
+
+	<!-- The list of taxa to be analysed (can also include dates/ages).          -->
+	<!-- ntax=6                                                                  -->
+	<taxa id="taxa">
+		<taxon id="human"/>
+		<taxon id="chimp"/>
+		<taxon id="bonobo"/>
+		<taxon id="gorilla"/>
+		<taxon id="orangutan"/>
+		<taxon id="siamang"/>
+	</taxa>
+
+	<!-- The sequence alignment (each sequence refers to a taxon above).         -->
+	<!-- ntax=6 nchar=768                                                        -->
+	<alignment id="alignment" dataType="nucleotide">
+		<sequence>
+			<taxon idref="human"/>
+			AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCACCTCGGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="chimp"/>
+			AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCACCTCAGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="bonobo"/>
+			AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAGC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTTGAATTTGCAATTCAATATGAAAA-TCACCTCAGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="gorilla"/>
+			AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTAAACATAGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA-CAACACTTAATTTCTGTAAGGACTGCAAAACCCTACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCAATGGGACTCAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAT-TCACCTCGGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="orangutan"/>
+			AGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA-CAGCACTTAATTTCTGTAAGGACTGCAAAACCCCACTTTGCATCAACTGAGCGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCCTAGACCGATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAT-TGGCTTCAGTCCAAAGCCCCGGCAGGCCTTAAAGCTGCTCCTTCGAATTTGCAATTCAACATGACAA-TCACCTCAGGGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="siamang"/>
+			AGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTAACAAAACTTAATTTCTGCAAGGGCTGCAAAACCCTACTTTGCATCAACCGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCGATGGGACTTAAACCCATAAAAATTTAGTTAACAGCTAAACACCCTAAACAACCTGGCTTCAATCTAAAGCCCCGGCAGA-GTTGAAGCTGCTTCTTTGAACTTGCAATTCAACGTGAAAAATCACTTCGGAGCT [...]
+		</sequence>
+	</alignment>
+
+	<!-- The unique patterns from 1 to end                                       -->
+	<!-- npatterns=69                                                            -->
+	<patterns id="patterns" from="1">
+		<alignment idref="alignment"/>
+	</patterns>
+
+	<!-- A prior assumption that the population size has remained constant       -->
+	<!-- throughout the time spanned by the genealogy.                           -->
+	<constantSize id="constant" units="substitutions">
+		<populationSize>
+			<parameter id="constant.popSize" value="0.077" lower="0.0" upper="Infinity"/>
+		</populationSize>
+	</constantSize>
+
+	<newick id="tree">
+        (siamang:0.06318470579939774,((gorilla:0.031056173315146828,((chimp:0.00982869388112981,bonobo:0.00982869388112981)
+        :0.01030402958978773,human:0.02013272347091754):0.010923449844229289):0.022256750048834654,orangutan:0.05331292336398148)
+        :0.009871782435416254);
+    </newick>
+
+	<!-- Generate a tree model                                                   -->
+	<treeModel id="treeModel">
+		<coalescentTree idref="tree"/>
+		<rootHeight>
+			<parameter id="treeModel.rootHeight"/>
+		</rootHeight>
+		<nodeHeights internalNodes="true">
+			<parameter id="treeModel.internalNodeHeights"/>
+		</nodeHeights>
+		<nodeHeights internalNodes="true" rootNode="true">
+			<parameter id="treeModel.allInternalNodeHeights"/>
+		</nodeHeights>
+	</treeModel>
+
+	<!-- Generate a coalescent likelihood                                        -->
+	<coalescentLikelihood id="coalescent">
+		<model>
+			<constantSize idref="constant"/>
+		</model>
+		<populationTree>
+			<treeModel idref="treeModel"/>
+		</populationTree>
+	</coalescentLikelihood>
+
+	<!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+	<HKYModel id="hky">
+		<frequencies>
+			<frequencyModel dataType="nucleotide">
+				<frequencies>
+					<parameter id="frequencies" value="0.25 0.25 0.25 0.25"/>
+				</frequencies>
+			</frequencyModel>
+		</frequencies>
+		<kappa>
+			<parameter id="kappa" value="2.0" lower="0.0" upper="Infinity"/>
+		</kappa>
+	</HKYModel>
+
+	<!-- site model                                                              -->
+	<siteModel id="siteModel">
+		<substitutionModel>
+			<HKYModel idref="hky"/>
+		</substitutionModel>
+	</siteModel>
+
+	<!-- Likelihood for tree given sequence data                                 -->
+	<treeLikelihood id="treeLikelihood" useAmbiguities="false">
+		<patterns idref="patterns"/>
+		<treeModel idref="treeModel"/>
+		<siteModel idref="siteModel"/>
+	</treeLikelihood>
+
+	<!-- Define operators                                                        -->
+	<operators id="operators">
+		<scaleOperator scaleFactor="0.75" weight="0.1">
+			<parameter idref="kappa"/>
+		</scaleOperator>
+		<deltaExchange delta="0.01" weight="0.1">
+			<parameter idref="frequencies"/>
+		</deltaExchange>
+		<subtreeSlide size="0.0077" gaussian="true" weight="15">
+			<treeModel idref="treeModel"/>
+		</subtreeSlide>
+		<narrowExchange weight="15">
+			<treeModel idref="treeModel"/>
+		</narrowExchange>
+		<wideExchange weight="3">
+			<treeModel idref="treeModel"/>
+		</wideExchange>
+		<wilsonBalding weight="3">
+			<treeModel idref="treeModel"/>
+		</wilsonBalding>
+		<scaleOperator scaleFactor="0.75" weight="3">
+			<parameter idref="treeModel.rootHeight"/>
+		</scaleOperator>
+		<uniformOperator weight="30">
+			<parameter idref="treeModel.internalNodeHeights"/>
+		</uniformOperator>
+		<scaleOperator scaleFactor="0.75" weight="3">
+			<parameter idref="constant.popSize"/>
+		</scaleOperator>
+	</operators>
+
+	<!-- Define MCMC                                                             -->
+	<mcmc id="mcmc" chainLength="10000000" autoOptimize="true">
+		<posterior id="posterior">
+			<prior id="prior">
+				<coalescentLikelihood idref="coalescent"/>
+			</prior>
+			<likelihood id="likelihood">
+				<treeLikelihood idref="treeLikelihood"/>
+			</likelihood>
+		</posterior>
+		<operators idref="operators"/>
+
+		<!-- write log to screen                                                     -->
+		<log id="screenLog" logEvery="100000">
+			<column label="Posterior" width="12">
+				<posterior idref="posterior"/>
+			</column>
+			<column label="Prior" width="12">
+				<prior idref="prior"/>
+			</column>
+			<column label="Likelihood" width="12">
+				<likelihood idref="likelihood"/>
+			</column>
+			<column label="rootHeight" width="12">
+				<parameter idref="treeModel.rootHeight"/>
+			</column>
+            <column label="popSize" width="12">
+            <parameter idref="constant.popSize"/>
+            </column>
+            <column label="coalescent" width="12">
+            <coalescentLikelihood idref="coalescent"/>
+            </column>
+            <parameter idref="kappa"/>
+		</log>
+
+		<!-- write log to file                                                       -->
+		<log id="fileLog" logEvery="1000" fileName="testCoalescentNoClock1.log" overwrite="false">
+			<posterior idref="posterior"/>
+			<prior idref="prior"/>
+			<likelihood idref="likelihood"/>
+			<parameter idref="treeModel.rootHeight"/>
+			<parameter idref="constant.popSize"/>
+			<parameter idref="kappa"/>
+			<parameter idref="frequencies"/>
+			<treeLikelihood idref="treeLikelihood"/>
+			<coalescentLikelihood idref="coalescent"/>
+		</log>
+
+		<!-- write tree log to file                                                  -->
+		<logTree id="treeFileLog" logEvery="1000" nexusFormat="true" fileName="testCoalescentNoClock1.trees" sortTranslationTable="true">
+			<treeModel idref="treeModel"/>
+			<posterior idref="posterior"/>
+		</logTree>
+	</mcmc>
+	<report>
+		<property name="timer">
+			<mcmc idref="mcmc"/>
+		</property>
+	</report>
+    <treeTraceAnalysis fileName="testCoalescentNoClock1.trees"/>
+</beast>
diff --git a/examples/beast2vs1/beast1/testEBSP.xml b/examples/beast2vs1/beast1/testEBSP.xml
new file mode 100644
index 0000000..328c431
--- /dev/null
+++ b/examples/beast2vs1/beast1/testEBSP.xml
@@ -0,0 +1,836 @@
+<?xml version="1.0" standalone="yes"?>
+
+<!-- Generated by BEAUTi v1.7.0 Prerelease r3910                             -->
+<!--       by Alexei J. Drummond, Andrew Rambaut and Marc A. Suchard         -->
+<!--       Department of Computer Science, University of Auckland and        -->
+<!--       Institute of Evolutionary Biology, University of Edinburgh        -->
+<!--       David Geffen School of Medicine, University of California, Los Angeles-->
+<!--       http://beast.bio.ed.ac.uk/                                        -->
+<beast>
+
+	<!-- The list of taxa to be analysed (can also include dates/ages).          -->
+	<!-- ntax=26                                                                 -->
+	<taxa id="taxa">
+		<taxon id="Orthogeomys_heterodus"/>
+		<taxon id="Thomomys_bottae_awahnee_a"/>
+		<taxon id="Thomomys_bottae_awahnee_b"/>
+		<taxon id="Thomomys_bottae_xerophilus"/>
+		<taxon id="Thomomys_bottae_cactophilus"/>
+		<taxon id="Thomomys_bottae_albatus"/>
+		<taxon id="Thomomys_bottae_ruidosae"/>
+		<taxon id="Thomomys_bottae_bottae"/>
+		<taxon id="Thomomys_bottae_alpinus"/>
+		<taxon id="Thomomys_bottae_riparius"/>
+		<taxon id="Thomomys_bottae_mewa"/>
+		<taxon id="Thomomys_bottae_saxatilis"/>
+		<taxon id="Thomomys_bottae_laticeps"/>
+		<taxon id="Thomomys_talpoides_ocius"/>
+		<taxon id="Thomomys_idahoensis_pygmaeus_a"/>
+		<taxon id="Thomomys_idahoensis_pygmaeus_b"/>
+		<taxon id="Thomomys_mazama_mazama"/>
+		<taxon id="Thomomys_mazama_nasicus"/>
+		<taxon id="Thomomys_monticola_a"/>
+		<taxon id="Thomomys_monticola_b"/>
+		<taxon id="Thomomys_talpoides_yakimensis"/>
+		<taxon id="Thomomys_talpoides_bridgeri"/>
+		<taxon id="Thomomys_townsendii_townsendii"/>
+		<taxon id="Thomomys_townsendii_relictus"/>
+		<taxon id="Thomomys_umbrinus_chihuahuae"/>
+		<taxon id="Thomomys_umbrinus_atroavarius"/>
+	</taxa>
+
+	<!-- The sequence alignment (each sequence refers to a taxon above).         -->
+	<!-- ntax=26 nchar=614                                                       -->
+	<alignment id="alignment1" dataType="nucleotide">
+		<sequence>
+			<taxon idref="Orthogeomys_heterodus"/>
+			ATTCTAGGCAAAAAG-AGCAATGCTGGAGGTATTACAATACCAGACTTCAAACTTTACTATAGAGCCATAATAACAAAAACCGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAATGGAAYAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGTCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCACCATGCACAGGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCAGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGGGAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATAGGAGAAAGACTCAATAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_awahnee_a"/>
+			????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACMCAGTCTATTCAATTATTGGKGCTGGCAAAACTGGGCAGCCMCATGCARAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAA???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_awahnee_b"/>
+			????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCM-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_xerophilus"/>
+			????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAAYTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAA???????????????????????????????????????????????????????????????????????????? [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_cactophilus"/>
+			????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAAYGTCAGACCGGAAACCGTGAAAYTGTTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAA??????????????????????????????????????????????????????????????????????????????????????? [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_albatus"/>
+			????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGATCCAGAAATAGAACCAC-ATACCTATAGTCAACTTGTATTTGATAAAGGAGCTAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCATTTCACCATGCACAAGAATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCT-------------------------------------CATAGGCACTCATAGGCACAGGCAAAAGATTCCTATACAGGAACCCAGGGTCAACAACAGATTGGAGAGAGACTCAATAAATGGGACTACCTAAAAATAAAA-GTTTCTGCAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_ruidosae"/>
+			????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCARAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAAYTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAG????????????????????????????????????????????????????????????????????????????????????? [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_bottae"/>
+			????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAAATTCCTGAACAGAATCCCAGGGTCA-CAACAGATKGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_alpinus"/>
+			????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCTATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCA????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_riparius"/>
+			????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_mewa"/>
+			????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCATTTCACCATGCACAAGAATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAA?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_saxatilis"/>
+			????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAA???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_laticeps"/>
+			????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAATTGCTACATGATAAWGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCAATAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_talpoides_ocius"/>
+			???CTAGGCAAAA-G-AGC-ATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATMCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCRACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_idahoensis_pygmaeus_a"/>
+			????????CAAAA-G-AGCAATGCTGGTGGTATYACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATMCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCRACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_idahoensis_pygmaeus_b"/>
+			????GGCGCAAAA-G-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATMCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_mazama_mazama"/>
+			ATTCTAGGCAAAAAGAAGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAAYTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_mazama_nasicus"/>
+			ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCSCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAAYTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_monticola_a"/>
+			??????????????G-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGYCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_monticola_b"/>
+			ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATYACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAWATAGAACCAC-ACAACTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAATGGAACRAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_talpoides_yakimensis"/>
+			ATTCTAGGCAAAA-G-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTKTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAAYGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAAYTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_talpoides_bridgeri"/>
+			ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATCCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCRACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_townsendii_townsendii"/>
+			ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTYGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_townsendii_relictus"/>
+			??????????????G-AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTAYTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCACTATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAATGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAATTGCTACATGATAAWGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAATGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_umbrinus_chihuahuae"/>
+			?????????????AG-AGC-ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCTTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_umbrinus_atroavarius"/>
+			ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGCATTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGKCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGYCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAAYGTCAGACCGGAAACCGTGAAATTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+	</alignment>
+
+	<!-- The sequence alignment (each sequence refers to a taxon above).         -->
+	<!-- ntax=26 nchar=601                                                       -->
+	<alignment id="alignment2" dataType="nucleotide">
+		<sequence>
+			<taxon idref="Orthogeomys_heterodus"/>
+			C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCACAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCGTTTCTGGAAAACTGAGATCTTGTTTTGACCAACAGAAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTACTGGTGATGTCTCTGTCAGGATCTAGTCCCATCCTG-AATCCATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTCAGAACTGACTGAATCAGGCCAGTGAAAGTTA-CAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATTGTGCATGGCTTCATTAGCAGGTTTACTGTGCTGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_awahnee_a"/>
+			C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_awahnee_b"/>
+			C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_xerophilus"/>
+			C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCACTAAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTRTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_cactophilus"/>
+			C-AGCTTGCTG-TCACACTACCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCACTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_albatus"/>
+			C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_ruidosae"/>
+			?????????????????????????????C-AGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_bottae"/>
+			C-AGCTTGCTG-TCACACYGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTAKGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_alpinus"/>
+			C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCC-AGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGTTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCYACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_riparius"/>
+			C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_mewa"/>
+			C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_saxatilis"/>
+			C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_laticeps"/>
+			C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_talpoides_ocius"/>
+			C-AGCTTGCTGGTCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCATATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAAWGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_idahoensis_pygmaeus_a"/>
+			C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTTTAAGTGTTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGTCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGTCCAGTGAAACTTAACAGCTACCTTGCCAATKGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGG--TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_idahoensis_pygmaeus_b"/>
+			CAAGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTGTTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGTCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGG--TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_mazama_mazama"/>
+			C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTATTGCCTGGATATAGTGTCTATAGACAGAGACAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCACATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCACCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCTGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_mazama_nasicus"/>
+			C-AGCTTGCTG-TCACAATGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTATTGCCTGGATATAGTGTCTATAGACAGAGACAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCACATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCTGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_monticola_a"/>
+			C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGACGCCKTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_monticola_b"/>
+			C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGACGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTYCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_talpoides_yakimensis"/>
+			C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGAMTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_talpoides_bridgeri"/>
+			C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_townsendii_townsendii"/>
+			C-AGCTTGCTGGTCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_townsendii_relictus"/>
+			C-AGCTTGCTGGTCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_umbrinus_chihuahuae"/>
+			C-AGCTTGCTGGTCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAAGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTGGAATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_umbrinus_atroavarius"/>
+			C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+	</alignment>
+
+	<!-- The sequence alignment (each sequence refers to a taxon above).         -->
+	<!-- ntax=26 nchar=819                                                       -->
+	<alignment id="alignment3" dataType="nucleotide">
+		<sequence>
+			<taxon idref="Orthogeomys_heterodus"/>
+			CATGATTTTGTCATGCCTTCTTAC-TGCTTATCTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGATGATTGACGCTGCTGTCAGTAGTGAGTGACACAAATTTTATTTAGTTTGGGTGTGTGCCTACCAGTATAATTGCTGGACCACGTGTAGGTCTGTATTAATCTTCTGAAGAACGGTTAGGCCATCTGTGAATTGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCACGATTTCTTTTCCA-CC-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CTAGATTTTATGGGACTCTT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_awahnee_a"/>
+			CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACARAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCYTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCAACC-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CTGGATTTTATGGGGCTCTT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_awahnee_b"/>
+			CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACASAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCYTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCAMCC-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CTGGATTTTATGGGGSTCTT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_xerophilus"/>
+			CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACAGAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCACCC-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CTGGATTTTATGGGGCTCTT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_cactophilus"/>
+			CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACAGAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTRTGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCACCC-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CTGGATTTTATGGGGCTCTT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_albatus"/>
+			CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACAGAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTGTGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCACCC-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CTGGATTTTATGGGGCTCTT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_ruidosae"/>
+			CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTYGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACASAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCACCC-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CTGGATTTTATGGGGSTCTT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_bottae"/>
+			CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTYGTTTTCACCTGTGTGTTGATTGACGCTACTGTCAGTAGTGGGTGACAGAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCYGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCAMCC-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CTGGATTTTATGGGGGTCTT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_alpinus"/>
+			CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACAGAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCYGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCAMCC-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CTGGATTTTATGGGGSTCTT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_riparius"/>
+			CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACAGAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTRTGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCACCC-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CTGGATTTTATGGGGCTCTT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_mewa"/>
+			CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACAGAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCAACC-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CTGGATTTTATGGGGCTCTT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_saxatilis"/>
+			CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACAGAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCAACC-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CTGGATTTTATGGGGSTCTT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_laticeps"/>
+			CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACASAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCYTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCAACC-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CTGGATTTTATGGGGCTCTT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_talpoides_ocius"/>
+			CATGATTTTTTCATGCTTTCTTAC-TGCTTATCTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACACTATTGTCAGTAGTGGGTGACACAAATTTCATTTAATTTGGGTGTGTGCCTACCAGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAACGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCATGATATCTTTTCCAACCCTAGATTTTTTTTT--------------------------------GCACTGTCCTTGGACTTTCTCAAGGCTAGAGCTCTACCACTTGAGCCTCAGCATCACTTCTGGCTTTTTTTTTC-TATGTATGTGGTATCAAGGAATCGAACCCGGGTCTTCGTGCATGCTAGGCAAGCACTCTACCACTAGGCCAAACTCCCAGCCCCAACCCTAGATTTTATGGGGCTCTT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_idahoensis_pygmaeus_a"/>
+			???????TTTTCATGCTTTCTTAC-TGCTTATCTGCTTGTGGGCTTTGGGTTGTTTTTACCTGTGGGTTGATTGACACTACTGTCAGTAGTGGGTGACACAAATTTCATTTAATTTGGGTGTGTGCCTACCAGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAACGGTTCGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCACGATATCTTTTCCAACCCTAGATTTTTTTTTTT---------------------------T--GCACTGTCCTTGGACTTTCTCAAGGCTAGAGCTCTACCACTTGAGCCTCAGCATCACTTCTGGCTTTTTTTTTTCTATGTATGTGGTATCAAGGAATCGAACCCGGGTCTTCGTGCATGCTAGGCAAGCACTCTACCACTAGGCCAAACTCCCAGCCCCAACCCTAGATTTTATGGGGCTCTT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_idahoensis_pygmaeus_b"/>
+			?ATGATTTTTTCATGCTTTCTTAC-TGCTTATCTGCTTGTGGGCTTTGGGTTGTTTTTACCTGTGGGTTGATTGACACTACTGTCAGTAGTGGGTGACACAAATTTCATTTAATTTGGGTGTGTGCCTACTAGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAACGGTTAGGCCATCTGTGAAATGCTATACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCACGATATCTTTTCCAACCCTAGATGTTTTTTTT-G------------------------------CACTGTCCTTGGACTTTCTCAAGGCTAGAGCTCTACCACTTGAGCCTCAGCACCACTTCTGGCTTTTTTTTTTCTACGTATGTGGTATCAAGGAATCGAACCCGGGTCTTCGTGCATGCTAGGCAAGCACTCTACCACTAGGCCAAACTCCCAGCCCCAACCCTAGATTTTATGGGGCTCTT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_mazama_mazama"/>
+			??????????????????????A---GCTTATATGCTTGTGTGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACACTACTGCCAGTAGTGGGTGACACAAATTTCATTTAATTTGGGTGTGTGCCTACCAGTATAATTGCTGGACCACATATAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCACGATATCTTTTCCAACCCTAGATTTTTTTTTTT------------------------------------------------------------------------------------------------------TTCTATGTATGTGGTACCAAGGAATCGAACCCGGGTCTTTGTGCATGCTATGCAAGCACTTTACCACTAGGCCAAACTCCCAGCCCCAACCCTAGATTTTATGGGGCTCTT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_mazama_nasicus"/>
+			??????????????GCTTTCTTACGTGCTTATATGCTTGTGTGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACACTACTGCCAGTAGTGGGTGACACAAATTTCATTTAATTTGGGTGTGTGCCTACCAGTATAATTGCTGGACCACATATAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCATGATATCTTTTCCAACCCTAGATTTTTTTTTTTGCCAGTCCTGGGCTTGAGCTCAGGGCCTGAGCACTGTCCTTGGACTTTCTCAAGGCTAGAGCTCTACCACTTGAGCTTCAGCATCACTTCTGGCTTTTTTTTTTCTATGTATGTGGTACCAAGGAATCGAACCCGGGTCTTTGTGCATGCTATGCAGGCACTCTACCACTAGGCCAAACTCCCAGCCCCAACCCTAGATTTTATGGGGCTCTT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_monticola_a"/>
+			CATGATTTTTTCATGCTTTCTTAC-TGCTTATCTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACACTACTGTCAGTAGTGGGTGACACAAATTTCATTTAATTTGAGTGTGTGCCTACCAGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAACGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCACGATATCTTTTCCAACCCTAGATTTTTTTTTTTGCCAGTCCTGGGCTTGAGCTCAGGGCCTGAACACTGTCCTTGGACTTTCTCAAGGCTAGAGCTCTACCACTTGAGCCTCAGCATCACTTCTGGCTTTTTTT-TTCTATGTATGTGGTACCAAGGAATCGAACCCGGGTCTTCGTGCATGCTAGGCAAGCACTCTACCACTAGCCCAAACTCCCAGCCCCAACCCTAGATTTTATGGGGCTCTT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_monticola_b"/>
+			CATGATTTTTTCATGCTTTCTTAC-TGCTTATCTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACACTACTGTCAGTAGTGGGTGACACAAATTTCATTTAATTTGAGTGTGTGCCTACCAGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAAYGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCACGATATCTTTTCCAACCCTAGATTTTTTTTT--GCCAGTCCTGGGCTTSAGCTCAGGGCCTGAACACTGTCCTTGGACTTTCTCAAGGCTAGAGCTKTACCACTTGAGCCTCAGCATCACTTCTGGCTTTTTTTTTTCTATGTATGTGGTACCAAGGAATCGAACCCGGGTCTTCGTGCATGCTAGGCAAGCACTCTACCACTAGCCCAAACTCCCAGCCCCAACCCTAGATTTTATGGGGCTCTT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_talpoides_yakimensis"/>
+			?????????????????TTCTTAC-TGCTTATCTGCTTGTGGGCTTTGGGCTGTTTTCACCTGTGGGTTGATTGACACTACTGTCAGTAGTGGGTGACACAAATTTCATTTAATTTGGTTGTGTGCCTACCAGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAACGGTTAGGCCATCTGTGAAGTGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCACGATATCTTTTCCAACCCTAGATTTTTTTTTTT---------------------------TTTGCACTGTCCTTGGACTTTCTCAAGGCTAGAGCTCTACCACTTGAGCCTCAGCATCACTTCTGGCTTTTTTTTTTCTATGTATGTGGTATCAAGGAATCGAACCCGGGTCTTCGTGCATGCTAGGCAAGCACTCTACCAGTAGGCCAAACTCCCAGCCCCAACCCTAGATTTTATGGGGCTCTT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_talpoides_bridgeri"/>
+			CATGATTTTTTCATGCTTTCTTAC-TGCTTATCTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACACTACTGTCAGTAGTGGGTGACACAAATTTCATTTAATTTGGTTGTGTGCCTACCAGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAACGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCACGATATCTTTTCCAACCCTAGATTTTTTTTTTT------------------------------GCACTGTCCTTGGACTTTCTCAAGGCTAGAGCTCTACCACTTGAGCCTCAGCATCACTTCTGGCTTTTTTT-TTCTATGTATGTGGTATCAAGGAATCGAACCCGGGTCTTCGTGCATGCTCGGCAAGCACTCTACCACTAGGCCAAACTCCCAGCCYCAACCCTAGATTTTATGGGGCTCTT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_townsendii_townsendii"/>
+			CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACACAAATTTCATTTAGTTTGGGTGTGTGCCTACCAGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCCTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCAACC-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CTGGATTTTATGGGGCTCTT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_townsendii_relictus"/>
+			CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACAGAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCACCC-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CTGGATTTTATGGGGCTCTT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_umbrinus_chihuahuae"/>
+			CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACAGAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTGTGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCACCC-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CTGGATTTTATGGGGCTCTT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_umbrinus_atroavarius"/>
+			CATGATTTTGTCATGYTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTYGATTGACGCTACTGTCAGTAGTGGGTGACAGAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTRTGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCACCC-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CTGGATTTTATGGGGCTCTT [...]
+		</sequence>
+	</alignment>
+
+	<!-- The unique patterns from 1 to end                                       -->
+	<!-- npatterns=144                                                           -->
+	<patterns id="26.patterns" from="1">
+		<alignment idref="alignment1"/>
+	</patterns>
+
+	<!-- The unique patterns from 1 to end                                       -->
+	<!-- npatterns=71                                                            -->
+	<patterns id="29.patterns" from="1">
+		<alignment idref="alignment2"/>
+	</patterns>
+
+	<!-- The unique patterns from 1 to end                                       -->
+	<!-- npatterns=153                                                           -->
+	<patterns id="47.patterns" from="1">
+		<alignment idref="alignment3"/>
+	</patterns>
+
+	<!-- This is a simple constant population size coalescent model              -->
+	<!-- that is used to generate an initial tree for the chain.                 -->
+	<constantSize id="initialDemo" units="substitutions">
+		<populationSize>
+			<parameter id="initialDemo.popSize" value="100.0"/>
+		</populationSize>
+	</constantSize>
+
+	<!-- Generate a random starting tree under the coalescent process            -->
+	<coalescentTree id="26.startingTree" rootHeight="0.017">
+		<taxa idref="taxa"/>
+		<constantSize idref="initialDemo"/>
+	</coalescentTree>
+
+	<!-- Generate a random starting tree under the coalescent process            -->
+	<coalescentTree id="29.startingTree" rootHeight="0.016">
+		<taxa idref="taxa"/>
+		<constantSize idref="initialDemo"/>
+	</coalescentTree>
+
+	<!-- Generate a random starting tree under the coalescent process            -->
+	<coalescentTree id="47.startingTree" rootHeight="0.017">
+		<taxa idref="taxa"/>
+		<constantSize idref="initialDemo"/>
+	</coalescentTree>
+
+	<!-- Generate a tree model                                                   -->
+	<treeModel id="26.treeModel">
+		<coalescentTree idref="26.startingTree"/>
+		<rootHeight>
+			<parameter id="26.treeModel.rootHeight"/>
+		</rootHeight>
+		<nodeHeights internalNodes="true">
+			<parameter id="26.treeModel.internalNodeHeights"/>
+		</nodeHeights>
+		<nodeHeights internalNodes="true" rootNode="true">
+			<parameter id="26.treeModel.allInternalNodeHeights"/>
+		</nodeHeights>
+	</treeModel>
+
+	<!-- Generate a tree model                                                   -->
+	<treeModel id="29.treeModel">
+		<coalescentTree idref="29.startingTree"/>
+		<rootHeight>
+			<parameter id="29.treeModel.rootHeight"/>
+		</rootHeight>
+		<nodeHeights internalNodes="true">
+			<parameter id="29.treeModel.internalNodeHeights"/>
+		</nodeHeights>
+		<nodeHeights internalNodes="true" rootNode="true">
+			<parameter id="29.treeModel.allInternalNodeHeights"/>
+		</nodeHeights>
+	</treeModel>
+
+	<!-- Generate a tree model                                                   -->
+	<treeModel id="47.treeModel">
+		<coalescentTree idref="47.startingTree"/>
+		<rootHeight>
+			<parameter id="47.treeModel.rootHeight"/>
+		</rootHeight>
+		<nodeHeights internalNodes="true">
+			<parameter id="47.treeModel.internalNodeHeights"/>
+		</nodeHeights>
+		<nodeHeights internalNodes="true" rootNode="true">
+			<parameter id="47.treeModel.allInternalNodeHeights"/>
+		</nodeHeights>
+	</treeModel>
+
+	<!-- Generate a variableDemographic for extended Bayesian skyline process    -->
+	<variableDemographic id="demographic" type="linear" useMidpoints="true">
+		<populationSizes>
+
+			<!-- popSize value = populationMean value                                    -->
+			<parameter id="demographic.popSize" value="0.017"/>
+		</populationSizes>
+		<indicators>
+			<parameter id="demographic.indicators" value="0.0"/>
+		</indicators>
+		<trees>
+			<ptree ploidy="2.0">
+				<treeModel idref="26.treeModel"/>
+			</ptree>
+			<ptree ploidy="2.0">
+				<treeModel idref="29.treeModel"/>
+			</ptree>
+			<ptree ploidy="2.0">
+				<treeModel idref="47.treeModel"/>
+			</ptree>
+		</trees>
+	</variableDemographic>
+	<coalescentLikelihood id="coalescent">
+		<model>
+			<variableDemographic idref="demographic"/>
+		</model>
+
+		<!-- Take population Tree from demographic                                   -->
+	</coalescentLikelihood>
+	<sumStatistic id="demographic.populationSizeChanges" elementwise="true">
+		<parameter idref="demographic.indicators"/>
+	</sumStatistic>
+	<exponentialDistributionModel id="demographic.populationMeanDist">
+		<mean>
+
+			<!-- prefer populationMean value = 1                                         -->
+			<parameter id="demographic.populationMean" value="0.017"/>
+		</mean>
+	</exponentialDistributionModel>
+
+	<!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+	<HKYModel id="26.hky">
+		<frequencies>
+			<frequencyModel dataType="nucleotide">
+				<frequencies>
+					<parameter id="26.frequencies" value="0.25 0.25 0.25 0.25"/>
+				</frequencies>
+			</frequencyModel>
+		</frequencies>
+		<kappa>
+			<parameter id="26.kappa" value="2.0" lower="0.0"/>
+		</kappa>
+	</HKYModel>
+
+	<!-- site model                                                              -->
+	<siteModel id="26.siteModel">
+		<substitutionModel>
+			<HKYModel idref="26.hky"/>
+		</substitutionModel>
+	</siteModel>
+
+	<!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+	<HKYModel id="29.hky">
+		<frequencies>
+			<frequencyModel dataType="nucleotide">
+				<frequencies>
+					<parameter id="29.frequencies" value="0.25 0.25 0.25 0.25"/>
+				</frequencies>
+			</frequencyModel>
+		</frequencies>
+		<kappa>
+			<parameter id="29.kappa" value="2.0" lower="0.0"/>
+		</kappa>
+	</HKYModel>
+
+	<!-- site model                                                              -->
+	<siteModel id="29.siteModel">
+		<substitutionModel>
+			<HKYModel idref="29.hky"/>
+		</substitutionModel>
+	</siteModel>
+
+	<!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+	<HKYModel id="47.hky">
+		<frequencies>
+			<frequencyModel dataType="nucleotide">
+				<frequencies>
+					<parameter id="47.frequencies" value="0.25 0.25 0.25 0.25"/>
+				</frequencies>
+			</frequencyModel>
+		</frequencies>
+		<kappa>
+			<parameter id="47.kappa" value="2.0" lower="0.0"/>
+		</kappa>
+	</HKYModel>
+
+	<!-- site model                                                              -->
+	<siteModel id="47.siteModel">
+		<substitutionModel>
+			<HKYModel idref="47.hky"/>
+		</substitutionModel>
+	</siteModel>
+
+	<!-- Likelihood for tree given sequence data                                 -->
+	<treeLikelihood id="26.treeLikelihood" useAmbiguities="false">
+		<patterns idref="26.patterns"/>
+		<treeModel idref="26.treeModel"/>
+		<siteModel idref="26.siteModel"/>
+	</treeLikelihood>
+
+	<!-- Likelihood for tree given sequence data                                 -->
+	<treeLikelihood id="29.treeLikelihood" useAmbiguities="false">
+		<patterns idref="29.patterns"/>
+		<treeModel idref="29.treeModel"/>
+		<siteModel idref="29.siteModel"/>
+	</treeLikelihood>
+
+	<!-- Likelihood for tree given sequence data                                 -->
+	<treeLikelihood id="47.treeLikelihood" useAmbiguities="false">
+		<patterns idref="47.patterns"/>
+		<treeModel idref="47.treeModel"/>
+		<siteModel idref="47.siteModel"/>
+	</treeLikelihood>
+
+	<!-- Define operators                                                        -->
+	<operators id="operators">
+		<scaleOperator scaleFactor="0.75" weight="0.1">
+			<parameter idref="26.kappa"/>
+		</scaleOperator>
+		<deltaExchange delta="0.01" weight="0.1">
+			<parameter idref="26.frequencies"/>
+		</deltaExchange>
+		<scaleOperator scaleFactor="0.75" weight="0.1">
+			<parameter idref="29.kappa"/>
+		</scaleOperator>
+		<deltaExchange delta="0.01" weight="0.1">
+			<parameter idref="29.frequencies"/>
+		</deltaExchange>
+		<scaleOperator scaleFactor="0.75" weight="0.1">
+			<parameter idref="47.kappa"/>
+		</scaleOperator>
+		<deltaExchange delta="0.01" weight="0.1">
+			<parameter idref="47.frequencies"/>
+		</deltaExchange>
+		<upDownOperator scaleFactor="0.75" weight="30">
+			<up>
+			</up>
+			<down>
+				<parameter idref="demographic.populationMean"/>
+				<parameter idref="demographic.popSize"/>
+				<parameter idref="26.treeModel.allInternalNodeHeights"/>
+				<parameter idref="29.treeModel.allInternalNodeHeights"/>
+				<parameter idref="47.treeModel.allInternalNodeHeights"/>
+			</down>
+		</upDownOperator>
+		<subtreeSlide size="0.0017" gaussian="true" weight="15">
+			<treeModel idref="26.treeModel"/>
+		</subtreeSlide>
+		<narrowExchange weight="15">
+			<treeModel idref="26.treeModel"/>
+		</narrowExchange>
+		<wideExchange weight="3">
+			<treeModel idref="26.treeModel"/>
+		</wideExchange>
+		<wilsonBalding weight="3">
+			<treeModel idref="26.treeModel"/>
+		</wilsonBalding>
+		<scaleOperator scaleFactor="0.75" weight="3">
+			<parameter idref="26.treeModel.rootHeight"/>
+		</scaleOperator>
+		<uniformOperator weight="30">
+			<parameter idref="26.treeModel.internalNodeHeights"/>
+		</uniformOperator>
+		<subtreeSlide size="0.0016" gaussian="true" weight="15">
+			<treeModel idref="29.treeModel"/>
+		</subtreeSlide>
+		<narrowExchange weight="15">
+			<treeModel idref="29.treeModel"/>
+		</narrowExchange>
+		<wideExchange weight="3">
+			<treeModel idref="29.treeModel"/>
+		</wideExchange>
+		<wilsonBalding weight="3">
+			<treeModel idref="29.treeModel"/>
+		</wilsonBalding>
+		<scaleOperator scaleFactor="0.75" weight="3">
+			<parameter idref="29.treeModel.rootHeight"/>
+		</scaleOperator>
+		<uniformOperator weight="30">
+			<parameter idref="29.treeModel.internalNodeHeights"/>
+		</uniformOperator>
+		<subtreeSlide size="0.0017" gaussian="true" weight="15">
+			<treeModel idref="47.treeModel"/>
+		</subtreeSlide>
+		<narrowExchange weight="15">
+			<treeModel idref="47.treeModel"/>
+		</narrowExchange>
+		<wideExchange weight="3">
+			<treeModel idref="47.treeModel"/>
+		</wideExchange>
+		<wilsonBalding weight="3">
+			<treeModel idref="47.treeModel"/>
+		</wilsonBalding>
+		<scaleOperator scaleFactor="0.75" weight="3">
+			<parameter idref="47.treeModel.rootHeight"/>
+		</scaleOperator>
+		<uniformOperator weight="30">
+			<parameter idref="47.treeModel.internalNodeHeights"/>
+		</uniformOperator>
+		<scaleOperator scaleFactor="0.9" weight="3">
+			<parameter idref="demographic.populationMean"/>
+		</scaleOperator>
+		<sampleNonActiveOperator weight="15">
+			<distribution>
+				<parameter idref="demographic.populationMeanDist"/>
+			</distribution>
+			<data>
+				<parameter idref="demographic.popSize"/>
+			</data>
+			<indicators>
+				<parameter idref="demographic.indicators"/>
+			</indicators>
+		</sampleNonActiveOperator>
+		<bitFlipOperator weight="30">
+			<parameter idref="demographic.indicators"/>
+		</bitFlipOperator>
+		<scaleOperator scaleFactor="0.5" weight="6">
+			<parameter idref="demographic.popSize"/>
+			<indicators pickoneprob="1.0">
+				<parameter idref="demographic.indicators"/>
+			</indicators>
+		</scaleOperator>
+	</operators>
+
+	<!-- Define MCMC                                                             -->
+	<mcmc id="mcmc" chainLength="10000000" autoOptimize="true">
+		<posterior id="posterior">
+			<prior id="prior">
+				<logNormalPrior mean="1.0" stdev="1.25" offset="0.0" meanInRealSpace="false">
+					<parameter idref="26.kappa"/>
+				</logNormalPrior>
+				<uniformPrior lower="0.0" upper="1.0">
+					<parameter idref="26.frequencies"/>
+				</uniformPrior>
+				<logNormalPrior mean="1.0" stdev="1.25" offset="0.0" meanInRealSpace="false">
+					<parameter idref="29.kappa"/>
+				</logNormalPrior>
+				<uniformPrior lower="0.0" upper="1.0">
+					<parameter idref="29.frequencies"/>
+				</uniformPrior>
+				<logNormalPrior mean="1.0" stdev="1.25" offset="0.0" meanInRealSpace="false">
+					<parameter idref="47.kappa"/>
+				</logNormalPrior>
+				<uniformPrior lower="0.0" upper="1.0">
+					<parameter idref="47.frequencies"/>
+				</uniformPrior>
+				<poissonPrior mean="0.6931471805599453" offset="0.0">
+					<statistic idref="demographic.populationSizeChanges"/>
+				</poissonPrior>
+				<oneOnXPrior>
+					<parameter idref="demographic.populationMean"/>
+				</oneOnXPrior>
+				<coalescentLikelihood idref="coalescent"/>
+				<mixedDistributionLikelihood>
+					<distribution0>
+						<exponentialDistributionModel idref="demographic.populationMeanDist"/>
+					</distribution0>
+					<distribution1>
+						<exponentialDistributionModel idref="demographic.populationMeanDist"/>
+					</distribution1>
+					<data>
+						<parameter idref="demographic.popSize"/>
+					</data>
+					<indicators>
+						<parameter idref="demographic.indicators"/>
+					</indicators>
+				</mixedDistributionLikelihood>
+			</prior>
+			<likelihood id="likelihood">
+				<treeLikelihood idref="26.treeLikelihood"/>
+				<treeLikelihood idref="29.treeLikelihood"/>
+				<treeLikelihood idref="47.treeLikelihood"/>
+			</likelihood>
+		</posterior>
+		<operators idref="operators"/>
+
+		<!-- write log to screen                                                     -->
+		<log id="screenLog" logEvery="100000">
+			<column label="Posterior" dp="4" width="12">
+				<posterior idref="posterior"/>
+			</column>
+			<column label="Prior" dp="4" width="12">
+				<prior idref="prior"/>
+			</column>
+			<column label="Likelihood" dp="4" width="12">
+				<likelihood idref="likelihood"/>
+			</column>
+			<column label="26.rootHeight" sf="6" width="12">
+				<parameter idref="26.treeModel.rootHeight"/>
+			</column>
+			<column label="29.rootHeight" sf="6" width="12">
+				<parameter idref="29.treeModel.rootHeight"/>
+			</column>
+			<column label="47.rootHeight" sf="6" width="12">
+				<parameter idref="47.treeModel.rootHeight"/>
+			</column>
+		</log>
+
+		<!-- write log to file                                                       -->
+		<log id="fileLog" logEvery="1000" fileName="testEBSP.log" overwrite="false">
+			<posterior idref="posterior"/>
+			<prior idref="prior"/>
+			<likelihood idref="likelihood"/>
+			<parameter idref="26.treeModel.rootHeight"/>
+			<parameter idref="29.treeModel.rootHeight"/>
+			<parameter idref="47.treeModel.rootHeight"/>
+			<sumStatistic idref="demographic.populationSizeChanges"/>
+			<parameter idref="demographic.populationMean"/>
+			<parameter idref="demographic.popSize"/>
+			<parameter idref="demographic.indicators"/>
+			<parameter idref="26.kappa"/>
+			<parameter idref="26.frequencies"/>
+			<parameter idref="29.kappa"/>
+			<parameter idref="29.frequencies"/>
+			<parameter idref="47.kappa"/>
+			<parameter idref="47.frequencies"/>
+			<treeLikelihood idref="26.treeLikelihood"/>
+			<treeLikelihood idref="29.treeLikelihood"/>
+			<treeLikelihood idref="47.treeLikelihood"/>
+			<coalescentLikelihood idref="coalescent"/>
+		</log>
+
+		<!-- write tree log to file
+		<logTree id="26.treeFileLog" logEvery="1000" nexusFormat="true" fileName="testEBSP.26.trees" sortTranslationTable="true">
+			<treeModel idref="26.treeModel"/>
+			<posterior idref="posterior"/>
+		</logTree>
+		<logTree id="29.treeFileLog" logEvery="1000" nexusFormat="true" fileName="testEBSP.29.trees" sortTranslationTable="true">
+			<treeModel idref="29.treeModel"/>
+			<posterior idref="posterior"/>
+		</logTree>
+		<logTree id="47.treeFileLog" logEvery="1000" nexusFormat="true" fileName="testEBSP.47.trees" sortTranslationTable="true">
+			<treeModel idref="47.treeModel"/>
+			<posterior idref="posterior"/>
+		</logTree>  -->
+	</mcmc>
+	<report>
+		<property name="timer">
+			<mcmc idref="mcmc"/>
+		</property>
+	</report>
+<!-- 	<VDAnalysis id="demographic.analysis" burnIn="0.1" useMidpoints="true">
+		<logFileName>
+			testEBSP.log
+		</logFileName>
+		<treeFileNames>
+			<treeOfLoci>
+				testEBSP.26.trees
+			</treeOfLoci>
+			<treeOfLoci>
+				testEBSP.29.trees
+			</treeOfLoci>
+			<treeOfLoci>
+				testEBSP.47.trees
+			</treeOfLoci>
+		</treeFileNames>
+		<populationModelType>
+			linear
+		</populationModelType>
+		<populationFirstColumn>
+			demographic.popSize1
+		</populationFirstColumn>
+		<indicatorsFirstColumn>
+			demographic.indicators1
+		</indicatorsFirstColumn>
+	</VDAnalysis>
+	<CSVexport fileName="testEBSP.csv" separator=",">
+		<columns>
+			<VDAnalysis idref="demographic.analysis"/>
+		</columns>
+	</CSVexport> -->
+</beast>
diff --git a/examples/beast2vs1/beast1/testExponentialGrowth.xml b/examples/beast2vs1/beast1/testExponentialGrowth.xml
new file mode 100644
index 0000000..6eb1794
--- /dev/null
+++ b/examples/beast2vs1/beast1/testExponentialGrowth.xml
@@ -0,0 +1,232 @@
+<?xml version="1.0" standalone="yes"?>
+
+<!-- Generated by BEAUTi v1.7.0 Prerelease r3910                             -->
+<!--       by Alexei J. Drummond and Andrew Rambaut                          -->
+<!--       Department of Computer Science, University of Auckland and        -->
+<!--       Institute of Evolutionary Biology, University of Edinburgh        -->
+<!--       http://beast.bio.ed.ac.uk/                                        -->
+<beast>
+
+	<!-- The list of taxa to be analysed (can also include dates/ages).          -->
+	<!-- ntax=6                                                                  -->
+	<taxa id="taxa">
+		<taxon id="human"/>
+		<taxon id="chimp"/>
+		<taxon id="bonobo"/>
+		<taxon id="gorilla"/>
+		<taxon id="orangutan"/>
+		<taxon id="siamang"/>
+	</taxa>
+
+	<!-- The sequence alignment (each sequence refers to a taxon above).         -->
+	<!-- ntax=6 nchar=768                                                        -->
+	<alignment id="alignment" dataType="nucleotide">
+		<sequence>
+			<taxon idref="human"/>
+			AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCACCTCGGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="chimp"/>
+			AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCACCTCAGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="bonobo"/>
+			AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAGC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTTGAATTTGCAATTCAATATGAAAA-TCACCTCAGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="gorilla"/>
+			AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTAAACATAGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA-CAACACTTAATTTCTGTAAGGACTGCAAAACCCTACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCAATGGGACTCAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAT-TCACCTCGGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="orangutan"/>
+			AGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA-CAGCACTTAATTTCTGTAAGGACTGCAAAACCCCACTTTGCATCAACTGAGCGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCCTAGACCGATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAT-TGGCTTCAGTCCAAAGCCCCGGCAGGCCTTAAAGCTGCTCCTTCGAATTTGCAATTCAACATGACAA-TCACCTCAGGGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="siamang"/>
+			AGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTAACAAAACTTAATTTCTGCAAGGGCTGCAAAACCCTACTTTGCATCAACCGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCGATGGGACTTAAACCCATAAAAATTTAGTTAACAGCTAAACACCCTAAACAACCTGGCTTCAATCTAAAGCCCCGGCAGA-GTTGAAGCTGCTTCTTTGAACTTGCAATTCAACGTGAAAAATCACTTCGGAGCT [...]
+		</sequence>
+	</alignment>
+
+	<!-- The unique patterns from 1 to end                                       -->
+	<!-- npatterns=69                                                            -->
+	<patterns id="patterns" from="1">
+		<alignment idref="alignment"/>
+	</patterns>
+
+    <!-- A prior assumption that the population size has grown exponentially     -->
+    <!-- throughout the time spanned by the genealogy.                           -->
+    <exponentialGrowth id="exponential" units="substitutions">
+        <populationSize>
+            <parameter id="exponential.popSize" value="0.077" lower="0.0" upper="Infinity"/>
+        </populationSize>
+        <growthRate>
+            <parameter id="exponential.growthRate" value="7.7E-5" lower="-Infinity" upper="Infinity"/>
+        </growthRate>
+    </exponentialGrowth>
+
+    <!-- Generate a random starting tree under the coalescent process            -->
+    <coalescentTree id="startingTree" rootHeight="0.077">
+        <taxa idref="taxa"/>
+        <exponentialGrowth idref="exponential"/>
+    </coalescentTree>
+
+	<!-- Generate a tree model                                                   -->
+	<treeModel id="treeModel">
+		<coalescentTree idref="startingTree"/>
+		<rootHeight>
+			<parameter id="treeModel.rootHeight"/>
+		</rootHeight>
+		<nodeHeights internalNodes="true">
+			<parameter id="treeModel.internalNodeHeights"/>
+		</nodeHeights>
+		<nodeHeights internalNodes="true" rootNode="true">
+			<parameter id="treeModel.allInternalNodeHeights"/>
+		</nodeHeights>
+	</treeModel>
+
+	<!-- Generate a coalescent likelihood                                        -->
+	<coalescentLikelihood id="coalescent">
+		<model>
+			<constantSize idref="exponential"/>
+		</model>
+		<populationTree>
+			<treeModel idref="treeModel"/>
+		</populationTree>
+	</coalescentLikelihood>
+
+	<!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+	<HKYModel id="hky">
+		<frequencies>
+			<frequencyModel dataType="nucleotide">
+				<frequencies>
+					<parameter id="frequencies" value="0.25 0.25 0.25 0.25"/>
+				</frequencies>
+			</frequencyModel>
+		</frequencies>
+		<kappa>
+			<parameter id="kappa" value="2.0" lower="0.0" upper="Infinity"/>
+		</kappa>
+	</HKYModel>
+
+	<!-- site model                                                              -->
+	<siteModel id="siteModel">
+		<substitutionModel>
+			<HKYModel idref="hky"/>
+		</substitutionModel>
+	</siteModel>
+
+	<!-- Likelihood for tree given sequence data                                 -->
+	<treeLikelihood id="treeLikelihood" useAmbiguities="false">
+		<patterns idref="patterns"/>
+		<treeModel idref="treeModel"/>
+		<siteModel idref="siteModel"/>
+	</treeLikelihood>
+
+	<!-- Define operators                                                        -->
+	<operators id="operators">
+		<scaleOperator scaleFactor="0.75" weight="0.1">
+			<parameter idref="kappa"/>
+		</scaleOperator>
+		<deltaExchange delta="0.01" weight="0.1">
+			<parameter idref="frequencies"/>
+		</deltaExchange>
+		<subtreeSlide size="0.0077" gaussian="true" weight="15">
+			<treeModel idref="treeModel"/>
+		</subtreeSlide>
+		<narrowExchange weight="15">
+			<treeModel idref="treeModel"/>
+		</narrowExchange>
+		<wideExchange weight="3">
+			<treeModel idref="treeModel"/>
+		</wideExchange>
+		<wilsonBalding weight="3">
+			<treeModel idref="treeModel"/>
+		</wilsonBalding>
+		<scaleOperator scaleFactor="0.75" weight="3">
+			<parameter idref="treeModel.rootHeight"/>
+		</scaleOperator>
+		<uniformOperator weight="30">
+			<parameter idref="treeModel.internalNodeHeights"/>
+		</uniformOperator>
+		<scaleOperator scaleFactor="0.75" weight="3">
+			<parameter idref="exponential.popSize"/>
+		</scaleOperator>
+		<randomWalkOperator windowSize="1.0" weight="3">
+			<parameter idref="exponential.growthRate"/>
+		</randomWalkOperator>
+		<upDownOperator scaleFactor="0.75" weight="3">
+			<up>
+			</up>
+			<down>
+				<parameter idref="treeModel.allInternalNodeHeights"/>
+			</down>
+		</upDownOperator>
+	</operators>
+
+	<!-- Define MCMC                                                             -->
+	<mcmc id="mcmc" chainLength="10000000" autoOptimize="true">
+		<posterior id="posterior">
+			<prior id="prior">
+				<logNormalPrior mean="1.0" stdev="1.25" offset="0.0" meanInRealSpace="false">
+					<parameter idref="kappa"/>
+				</logNormalPrior>
+				<uniformPrior lower="0.0" upper="1.0">
+					<parameter idref="frequencies"/>
+				</uniformPrior>
+				<oneOnXPrior>
+					<parameter idref="exponential.popSize"/>
+				</oneOnXPrior>
+				<laplacePrior mean="0.0010" scale="119.61481002566472">
+					<parameter idref="exponential.growthRate"/>
+				</laplacePrior>
+				<coalescentLikelihood idref="coalescent"/>
+			</prior>
+			<likelihood id="likelihood">
+				<treeLikelihood idref="treeLikelihood"/>
+			</likelihood>
+		</posterior>
+		<operators idref="operators"/>
+
+		<!-- write log to screen                                                     -->
+		<log id="screenLog" logEvery="100000">
+			<column label="Posterior" dp="4" width="12">
+				<posterior idref="posterior"/>
+			</column>
+			<column label="Prior" dp="4" width="12">
+				<prior idref="prior"/>
+			</column>
+			<column label="Likelihood" dp="4" width="12">
+				<likelihood idref="likelihood"/>
+			</column>
+			<column label="rootHeight" sf="6" width="12">
+				<parameter idref="treeModel.rootHeight"/>
+			</column>
+		</log>
+
+		<!-- write log to file                                                       -->
+		<log id="fileLog" logEvery="1000" fileName="testExponentialGrowth.log" overwrite="false">
+			<posterior idref="posterior"/>
+			<prior idref="prior"/>
+			<likelihood idref="likelihood"/>
+			<parameter idref="treeModel.rootHeight"/>
+            <parameter idref="exponential.popSize"/>
+            <parameter idref="exponential.growthRate"/>
+			<parameter idref="kappa"/>
+			<parameter idref="frequencies"/>
+			<treeLikelihood idref="treeLikelihood"/>
+			<coalescentLikelihood idref="coalescent"/>
+		</log>
+
+		<!-- write tree log to file                                                  -->
+		<logTree id="treeFileLog" logEvery="1000" nexusFormat="true" fileName="testExponentialGrowth.trees" sortTranslationTable="true">
+			<treeModel idref="treeModel"/>
+			<posterior idref="posterior"/>
+		</logTree>
+	</mcmc>
+	<report>
+		<property name="timer">
+			<mcmc idref="mcmc"/>
+		</property>
+	</report>
+    <treeTraceAnalysis fileName="testExponentialGrowth.trees"/>
+</beast>
diff --git a/examples/beast2vs1/beast1/testMCMC.xml b/examples/beast2vs1/beast1/testMCMC.xml
new file mode 100644
index 0000000..d3d5692
--- /dev/null
+++ b/examples/beast2vs1/beast1/testMCMC.xml
@@ -0,0 +1,175 @@
+<?xml version="1.0" standalone="yes"?>
+<!-- $Id: testMCMC.xml,v 1.2 2005/07/11 23:22:40 rambaut Exp $ -->
+<!-- Tests the MCMC engine -->
+
+<beast>
+
+	<!-- The list of taxa analyse (can also include dates/ages).                 -->
+	<!-- ntax=6                                                                  -->
+	<taxa id="taxa">
+		<taxon id="human"/>
+		<taxon id="chimp"/>
+		<taxon id="bonobo"/>
+		<taxon id="gorilla"/>
+		<taxon id="orangutan"/>
+		<taxon id="siamang"/>
+	</taxa>
+
+	<!-- The sequence alignment (each sequence refers to a taxon above).         -->
+	<!-- ntax=6 nchar=768                                                        -->
+	<alignment id="alignment" dataType="nucleotide">
+		<sequence>
+			<taxon idref="human"/>
+			AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCACCTCGGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="chimp"/>
+			AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCACCTCAGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="bonobo"/>
+			AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAGC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTTGAATTTGCAATTCAATATGAAAA-TCACCTCAGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="gorilla"/>
+			AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTAAACATAGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA-CAACACTTAATTTCTGTAAGGACTGCAAAACCCTACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCAATGGGACTCAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAT-TCACCTCGGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="orangutan"/>
+			AGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA-CAGCACTTAATTTCTGTAAGGACTGCAAAACCCCACTTTGCATCAACTGAGCGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCCTAGACCGATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAT-TGGCTTCAGTCCAAAGCCCCGGCAGGCCTTAAAGCTGCTCCTTCGAATTTGCAATTCAACATGACAA-TCACCTCAGGGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="siamang"/>
+			AGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTAACAAAACTTAATTTCTGCAAGGGCTGCAAAACCCTACTTTGCATCAACCGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCGATGGGACTTAAACCCATAAAAATTTAGTTAACAGCTAAACACCCTAAACAACCTGGCTTCAATCTAAAGCCCCGGCAGA-GTTGAAGCTGCTTCTTTGAACTTGCAATTCAACGTGAAAAATCACTTCGGAGCT [...]
+		</sequence>
+	</alignment>
+
+	<!-- The unique patterns for all positions                                   -->
+	<!-- npatterns=69                                                            -->
+	<patterns id="patterns" from="1">
+		<alignment idref="alignment"/>
+	</patterns>
+
+	<!-- This is a simple constant population size coalescent model              -->
+	<!-- that is used to generate an initial tree for the chain.                 -->
+	<constantSize id="initialDemo" units="substitutions">
+		<populationSize>
+			<parameter id="initialDemo.popSize" value="0.0001"/>
+		</populationSize>
+	</constantSize>
+
+	<!-- Generate a random starting tree under the coalescent process            -->
+	<coalescentTree id="startingTree">
+		<taxa idref="taxa"/>
+		<constantSize idref="initialDemo"/>
+	</coalescentTree>
+
+	<treeModel id="treeModel">
+		<coalescentTree idref="startingTree"/>
+		<rootHeight>
+			<parameter id="treeModel.rootHeight"/>
+		</rootHeight>
+		<nodeHeights internalNodes="true">
+			<parameter id="treeModel.internalNodeHeights"/>
+		</nodeHeights>
+		<nodeHeights internalNodes="true" rootNode="true">
+			<parameter id="treeModel.allInternalNodeHeights"/>
+		</nodeHeights>
+	</treeModel>
+
+	<!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+	<hkyModel id="hky">
+		<frequencies>
+			<frequencyModel dataType="nucleotide">
+				<alignment idref="alignment"/>
+				<frequencies>
+					<parameter id="hky.frequencies" dimension="4"/>
+				</frequencies>
+			</frequencyModel>
+		</frequencies>
+		<kappa>
+			<parameter id="hky.kappa" value="1.0" lower="0.0"/>
+		</kappa>
+	</hkyModel>
+
+	<!-- site model                                                              -->
+	<siteModel id="siteModel">
+		<substitutionModel>
+			<hkyModel idref="hky"/>
+		</substitutionModel>
+		<mutationRate>
+			<parameter id="siteModel.mu" value="1.0" lower="0.0"/>
+		</mutationRate>
+	</siteModel>
+
+	<treeLikelihood id="treeLikelihood">
+		<patterns idref="patterns"/>
+		<treeModel idref="treeModel"/>
+		<siteModel idref="siteModel"/>
+	</treeLikelihood>
+
+	<operators id="operators">
+		<scaleOperator scaleFactor="0.5" weight="1">
+			<parameter idref="hky.kappa"/>
+		</scaleOperator>
+		<scaleOperator scaleFactor="0.5" weight="1">
+			<parameter idref="treeModel.rootHeight"/>
+		</scaleOperator>
+		<uniformOperator weight="10">
+			<parameter idref="treeModel.internalNodeHeights"/>
+		</uniformOperator>
+		<subtreeSlide weight="5" gaussian="true" size="1.0">
+			<treeModel idref="treeModel"/>
+		</subtreeSlide>
+		<narrowExchange weight="1">
+			<treeModel idref="treeModel"/>
+		</narrowExchange>
+		<wideExchange weight="1">
+			<treeModel idref="treeModel"/>
+		</wideExchange>
+		<wilsonBalding weight="1">
+			<treeModel idref="treeModel"/>
+		</wilsonBalding>
+	</operators>
+
+	<mcmc id="mcmc" chainLength="10000000" autoOptimize="true">
+		<compoundLikelihood id="likelihood">
+			<treeLikelihood idref="treeLikelihood"/>
+		</compoundLikelihood>
+		<operators idref="operators"/>
+		<log logEvery="10000">
+			<column label="Likelihood" dp="4" width="12">
+				<compoundLikelihood idref="likelihood"/>
+			</column>
+			<column label="Root Height" sf="6" width="12">
+				<parameter idref="treeModel.rootHeight"/>
+			</column>
+			<column label="Kappa" sf="6" width="12">
+				<parameter idref="hky.kappa"/>
+			</column>
+		</log>
+		<log logEvery="1000" fileName="testMCMC.log">
+			<compoundLikelihood idref="likelihood"/>
+			<parameter idref="treeModel.rootHeight"/>
+			<parameter idref="hky.kappa"/>
+		</log>
+		<logTree  logEvery="1000" nexusFormat="true" fileName="testMCMC.trees">
+			<treeModel idref="treeModel"/>
+		</logTree>
+	</mcmc>
+
+	<report>
+		<property name="timer">
+			<object idref="mcmc"/>
+		</property>
+	</report>
+
+	<traceAnalysis fileName="testMCMC.log">
+		<expectation name="likelihood" value="-1815.75"/>
+		<expectation name="treeModel.rootHeight" value="6.42048E-2"/>
+		<expectation name="hky.kappa" value="32.8941"/>
+	</traceAnalysis>
+
+	<treeTraceAnalysis fileName="testMCMC.trees"/>
+
+</beast>
\ No newline at end of file
diff --git a/examples/beast2vs1/beast1/testMultiSubstModel.xml b/examples/beast2vs1/beast1/testMultiSubstModel.xml
new file mode 100644
index 0000000..750c957
--- /dev/null
+++ b/examples/beast2vs1/beast1/testMultiSubstModel.xml
@@ -0,0 +1,358 @@
+<?xml version="1.0" standalone="yes"?>
+
+<!-- Generated by BEAUTi v1.6.2                                              -->
+<!--       by Alexei J. Drummond and Andrew Rambaut                          -->
+<!--       Department of Computer Science, University of Auckland and        -->
+<!--       Institute of Evolutionary Biology, University of Edinburgh        -->
+<!--       http://beast.bio.ed.ac.uk/                                        -->
+<beast>
+
+	<!-- The list of taxa analyse (can also include dates/ages).                 -->
+	<!-- ntax=12                                                                 -->
+	<taxa id="taxa">
+		<taxon id="Tarsius_syrichta"/>
+		<taxon id="Lemur_catta"/>
+		<taxon id="Homo_sapiens"/>
+		<taxon id="Pan"/>
+		<taxon id="Gorilla"/>
+		<taxon id="Pongo"/>
+		<taxon id="Hylobates"/>
+		<taxon id="Macaca_fuscata"/>
+		<taxon id="M_mulatta"/>
+		<taxon id="M_fascicularis"/>
+		<taxon id="M_sylvanus"/>
+		<taxon id="Saimiri_sciureus"/>
+	</taxa>
+
+	<!-- The sequence alignment (each sequence refers to a taxon above).         -->
+	<!-- ntax=12 nchar=449                                                       -->
+	<alignment id="alignment1" dataType="nucleotide">
+		<sequence>
+			<taxon idref="Tarsius_syrichta"/>
+			AAGTTTCATTGGAGCCACCACTCTTATAATTGCCCATGGCCTCACCTCCTCCCTATTATTTTGCCTAGCAAATACAAACTACGAACGAGTCCACAGTCGAACAATAGCACTAGCCCGTGGCCTTCAAACCCTATTACCTCTTGCAGCAACATGATGACTCCTCGCCAGCTTAACCAACCTGGCCCTTCCCCCAACAATTAATTTAATCGGTGAACTGTCCGTAATAATAGCAGCATTTTCATGGTCACACCTAACTATTATCTTAGTAGGCCTTAACACCCTTATCACCGCCCTATATTCCCTATATATACTAATCATAACTCAACGAGGAAAATACACATATCATATCAACAATATCATGCCCCCTTTCACCCGAGAAAATACATTAATAATCATACACCTATTTCCCTTAATCCTACTATCTACCAACCCCAAAGTAATTATAGGAA
+		</sequence>
+		<sequence>
+			<taxon idref="Lemur_catta"/>
+			AAGCTTCATAGGAGCAACCATTCTAATAATCGCACATGGCCTTACATCATCCATATTATTCTGTCTAGCCAACTCTAACTACGAACGAATCCATAGCCGTACAATACTACTAGCACGAGGGATCCAAACCATTCTCCCTCTTATAGCCACCTGATGACTACTCGCCAGCCTAACTAACCTAGCCCTACCCACCTCTATCAATTTAATTGGCGAACTATTCGTCACTATAGCATCCTTCTCATGATCAAACATTACAATTATCTTAATAGGCTTAAATATGCTCATCACCGCTCTCTATTCCCTCTATATATTAACTACTACACAACGAGGAAAACTCACATATCATTCGCACAACCTAAACCCATCCTTTACACGAGAAAACACCCTTATATCCATACACATACTCCCCCTTCTCCTATTTACCTTAAACCCCAAAATTATTCTAGGAC
+		</sequence>
+		<sequence>
+			<taxon idref="Homo_sapiens"/>
+			AAGCTTCACCGGCGCAGTCATTCTCATAATCGCCCACGGGCTTACATCCTCATTACTATTCTGCCTAGCAAACTCAAACTACGAACGCACTCACAGTCGCATCATAATCCTCTCTCAAGGACTTCAAACTCTACTCCCACTAATAGCTTTTTGATGACTTCTAGCAAGCCTCGCTAACCTCGCCTTACCCCCCACTATTAACCTACTGGGAGAACTCTCTGTGCTAGTAACCACGTTCTCCTGATCAAATATCACTCTCCTACTTACAGGACTCAACATACTAGTCACAGCCCTATACTCCCTCTACATATTTACCACAACACAATGGGGCTCACTCACCCACCACATTAACAACATAAAACCCTCATTCACACGAGAAAACACCCTCATGTTCATACACCTATCCCCCATTCTCCTCCTATCCCTCAACCCCGACATCATTACCGGGT
+		</sequence>
+		<sequence>
+			<taxon idref="Pan"/>
+			AAGCTTCACCGGCGCAATTATCCTCATAATCGCCCACGGACTTACATCCTCATTATTATTCTGCCTAGCAAACTCAAATTATGAACGCACCCACAGTCGCATCATAATTCTCTCCCAAGGACTTCAAACTCTACTCCCACTAATAGCCTTTTGATGACTCCTAGCAAGCCTCGCTAACCTCGCCCTACCCCCTACCATTAATCTCCTAGGGGAACTCTCCGTGCTAGTAACCTCATTCTCCTGATCAAATACCACTCTCCTACTCACAGGATTCAACATACTAATCACAGCCCTGTACTCCCTCTACATGTTTACCACAACACAATGAGGCTCACTCACCCACCACATTAATAACATAAAGCCCTCATTCACACGAGAAAATACTCTCATATTTTTACACCTATCCCCCATCCTCCTTCTATCCCTCAATCCTGATATCATCACTGGAT
+		</sequence>
+		<sequence>
+			<taxon idref="Gorilla"/>
+			AAGCTTCACCGGCGCAGTTGTTCTTATAATTGCCCACGGACTTACATCATCATTATTATTCTGCCTAGCAAACTCAAACTACGAACGAACCCACAGCCGCATCATAATTCTCTCTCAAGGACTCCAAACCCTACTCCCACTAATAGCCCTTTGATGACTTCTGGCAAGCCTCGCCAACCTCGCCTTACCCCCCACCATTAACCTACTAGGAGAGCTCTCCGTACTAGTAACCACATTCTCCTGATCAAACACCACCCTTTTACTTACAGGATCTAACATACTAATTACAGCCCTGTACTCCCTTTATATATTTACCACAACACAATGAGGCCCACTCACACACCACATCACCAACATAAAACCCTCATTTACACGAGAAAACATCCTCATATTCATGCACCTATCCCCCATCCTCCTCCTATCCCTCAACCCCGATATTATCACCGGGT
+		</sequence>
+		<sequence>
+			<taxon idref="Pongo"/>
+			AAGCTTCACCGGCGCAACCACCCTCATGATTGCCCATGGACTCACATCCTCCCTACTGTTCTGCCTAGCAAACTCAAACTACGAACGAACCCACAGCCGCATCATAATCCTCTCTCAAGGCCTTCAAACTCTACTCCCCCTAATAGCCCTCTGATGACTTCTAGCAAGCCTCACTAACCTTGCCCTACCACCCACCATCAACCTTCTAGGAGAACTCTCCGTACTAATAGCCATATTCTCTTGATCTAACATCACCATCCTACTAACAGGACTCAACATACTAATCACAACCCTATACTCTCTCTATATATTCACCACAACACAACGAGGTACACCCACACACCACATCAACAACATAAAACCTTCTTTCACACGCGAAAATACCCTCATGCTCATACACCTATCCCCCATCCTCCTCTTATCCCTCAACCCCAGCATCATCGCTGGGT
+		</sequence>
+		<sequence>
+			<taxon idref="Hylobates"/>
+			AAGCTTTACAGGTGCAACCGTCCTCATAATCGCCCACGGACTAACCTCTTCCCTGCTATTCTGCCTTGCAAACTCAAACTACGAACGAACTCACAGCCGCATCATAATCCTATCTCGAGGGCTCCAAGCCTTACTCCCACTGATAGCCTTCTGATGACTCGCAGCAAGCCTCGCTAACCTCGCCCTACCCCCCACTATTAACCTCCTAGGTGAACTCTTCGTACTAATGGCCTCCTTCTCCTGGGCAAACACTACTATTACACTCACCGGGCTCAACGTACTAATCACGGCCCTATACTCCCTTTACATATTTATCATAACACAACGAGGCACACTTACACACCACATTAAAAACATAAAACCCTCACTCACACGAGAAAACATATTAATACTTATGCACCTCTTCCCCCTCCTCCTCCTAACCCTCAACCCTAACATCATTACTGGCT
+		</sequence>
+		<sequence>
+			<taxon idref="Macaca_fuscata"/>
+			AAGCTTTTCCGGCGCAACCATCCTTATGATCGCTCACGGACTCACCTCTTCCATATATTTCTGCCTAGCCAATTCAAACTATGAACGCACTCACAACCGTACCATACTACTGTCCCGAGGACTTCAAATCCTACTTCCACTAACAGCCTTTTGATGATTAACAGCAAGCCTTACTAACCTTGCCCTACCCCCCACTATCAATCTACTAGGTGAACTCTTTGTAATCGCAACCTCATTCTCCTGATCCCATATCACCATTATGCTAACAGGACTTAACATATTAATTACGGCCCTCTACTCTCTCCACATATTCACTACAACACAACGAGGAACACTCACACATCACATAATCAACATAAAGCCCCCCTTCACACGAGAAAACACATTAATATTCATACACCTCGCTCCAATTATCCTTCTATCCCTCAACCCCAACATCATCCTGGGGT
+		</sequence>
+		<sequence>
+			<taxon idref="M_mulatta"/>
+			AAGCTTTTCTGGCGCAACCATCCTCATGATTGCTCACGGACTCACCTCTTCCATATATTTCTGCCTAGCCAATTCAAACTATGAACGCACTCACAACCGTACCATACTACTGTCCCGGGGACTTCAAATCCTACTTCCACTAACAGCTTTCTGATGATTAACAGCAAGCCTTACTAACCTTGCCCTACCCCCCACTATCAACCTACTAGGTGAACTCTTTGTAATCGCGACCTCATTCTCCTGGTCCCATATCACCATTATATTAACAGGATTTAACATACTAATTACGGCCCTCTACTCCCTCCACATATTCACCACAACACAACGAGGAGCACTCACACATCACATAATCAACATAAAACCCCCCTTCACACGAGAAAACATATTAATATTCATACACCTCGCTCCAATCATCCTCCTATCTCTCAACCCCAACATCATCCTGGGGT
+		</sequence>
+		<sequence>
+			<taxon idref="M_fascicularis"/>
+			AAGCTTCTCCGGCGCAACCACCCTTATAATCGCCCACGGGCTCACCTCTTCCATGTATTTCTGCTTGGCCAATTCAAACTATGAGCGCACTCATAACCGTACCATACTACTATCCCGAGGACTTCAAATTCTACTTCCATTGACAGCCTTCTGATGACTCACAGCAAGCCTTACTAACCTTGCCCTACCCCCCACTATTAATCTACTAGGCGAACTCTTTGTAATCACAACTTCATTTTCCTGATCCCATATCACCATTGTGTTAACGGGCCTTAATATACTAATCACAGCCCTCTACTCTCTCCACATGTTCATTACAGTACAACGAGGAACACTCACACACCACATAATCAATATAAAACCCCCCTTCACACGAGAAAACATATTAATATTCATACACCTCGCTCCAATTATCCTTCTATCTCTCAACCCCAACATCATCCTGGGGT
+		</sequence>
+		<sequence>
+			<taxon idref="M_sylvanus"/>
+			AAGCTTCTCCGGTGCAACTATCCTTATAGTTGCCCATGGACTCACCTCTTCCATATACTTCTGCTTGGCCAACTCAAACTACGAACGCACCCACAGCCGCATCATACTACTATCCCGAGGACTCCAAATCCTACTCCCACTAACAGCCTTCTGATGATTCACAGCAAGCCTTACTAATCTTGCTCTACCCTCCACTATTAATCTACTGGGCGAACTCTTCGTAATCGCAACCTCATTTTCCTGATCCCACATCACCATCATACTAACAGGACTGAACATACTAATTACAGCCCTCTACTCTCTTCACATATTCACCACAACACAACGAGGAGCGCTCACACACCACATAATTAACATAAAACCACCTTTCACACGAGAAAACATATTAATACTCATACACCTCGCTCCAATTATTCTTCTATCTCTTAACCCCAACATCATTCTAGGAT
+		</sequence>
+		<sequence>
+			<taxon idref="Saimiri_sciureus"/>
+			AAGCTTCACCGGCGCAATGATCCTAATAATCGCTCACGGGTTTACTTCGTCTATGCTATTCTGCCTAGCAAACTCAAATTACGAACGAATTCACAGCCGAACAATAACATTTACTCGAGGGCTCCAAACACTATTCCCGCTTATAGGCCTCTGATGACTCCTAGCAAATCTCGCTAACCTCGCCCTACCCACAGCTATTAATCTAGTAGGAGAATTACTCACAATCGTATCTTCCTTCTCTTGATCCAACTTTACTATTATATTCACAGGACTTAATATACTAATTACAGCACTCTACTCACTTCATATGTATGCCTCTACACAGCGAGGTCCACTTACATACAGCACCAGCAATATAAAACCAATATTTACACGAGAAAATACGCTAATATTTATACATATAACACCAATCCTCCTCCTTACCTTGAGCCCCAAGGTAATTATAGGAC
+		</sequence>
+	</alignment>
+
+	<!-- The sequence alignment (each sequence refers to a taxon above).         -->
+	<!-- ntax=12 nchar=449                                                       -->
+	<alignment id="alignment2" dataType="nucleotide">
+		<sequence>
+			<taxon idref="Tarsius_syrichta"/>
+			CCATGTACTGTAAATATAGTTTAAACAAAACATTAGATTGTGAGTCTAATAATAGAAGCCCAAAGATTTCTTATTTACCAAGAAAGTA-TGCAAGAACTGCTAACTCATGCCTCCATATATAACAATGTGGCTTTCTT-ACTTTTAAAGGATAGAAGTAATCCATCGGTCTTAGGAACCGAAAA-ATTGGTGCAACTCCAAATAAAAGTAATAAATTTATTTTCATCCTCCATTTTACTATCACTTACACTCTTAATTACCCCATTTATTATTACAACAACTAAAAAATATGAAACACATGCATACCCTTACTACGTAAAAAACTCTATCGCCTGCGCATTTATAACAAGCCTAGTCCCAATGCTCATATTTCTATACACAAATCAAGAAATAATCATTTCCAACTGACATTGAATAACGATTCATACTATCAAATTATGCCTAAGCTT
+		</sequence>
+		<sequence>
+			<taxon idref="Lemur_catta"/>
+			CCACGTACTGTAAATATAGTTTAAA-AAAACACTAGATTGTGAATCCAGAAATAGAAGCTCAAAC-CTTCTTATTTACCGAGAAAGTAATGTATGAACTGCTAACTCTGCACTCCGTATATAAAAATACGGCTATCTCAACTTTTAAAGGATAGAAGTAATCCATTGGCCTTAGGAGCCAAAAA-ATTGGTGCAACTCCAAATAAAAGTAATAAATCTATTATCCTCTTTCACCCTTGTCACACTGATTATCCTAACTTTACCTATCATTATAAACGTTACAAACATATACAAAAACTACCCCTATGCACCATACGTAAAATCTTCTATTGCATGTGCCTTCATCACTAGCCTCATCCCAACTATATTATTTATCTCCTCAGGACAAGAAACAATCATTTCCAACTGACATTGAATAACAATCCAAACCCTAAAACTATCTATTAGCTT
+		</sequence>
+		<sequence>
+			<taxon idref="Homo_sapiens"/>
+			TTTCCTCTTGTAAATATAGTTTAACCAAAACATCAGATTGTGAATCTGACAACAGAGGCTTA-CGACCCCTTATTTACCGAGAAAGCT-CACAAGAACTGCTAACTCATGCCCCCATGTCTAACAACATGGCTTTCTCAACTTTTAAAGGATAACAGCTATCCATTGGTCTTAGGCCCCAAAAATTTTGGTGCAACTCCAAATAAAAGTAATAACCATGCACACTACTATAACCACCCTAACCCTGACTTCCCTAATTCCCCCCATCCTTACCACCCTCGTTAACCCTAACAAAAAAAACTCATACCCCCATTATGTAAAATCCATTGTCGCATCCACCTTTATTATCAGTCTCTTCCCCACAACAATATTCATGTGCCTAGACCAAGAAGTTATTATCTCGAACTGACACTGAGCCACAACCCAAACAACCCAGCTCTCCCTAAGCTT
+		</sequence>
+		<sequence>
+			<taxon idref="Pan"/>
+			TCACCTCCTGTAAATATAGTTTAACCAAAACATCAGATTGTGAATCTGACAACAGAGGCTCA-CGACCCCTTATTTACCGAGAAAGCT-TATAAGAACTGCTAATTCATATCCCCATGCCTGACAACATGGCTTTCTCAACTTTTAAAGGATAACAGCCATCCGTTGGTCTTAGGCCCCAAAAATTTTGGTGCAACTCCAAATAAAAGTAATAACCATGTATACTACCATAACCACCTTAACCCTAACTCCCTTAATTCTCCCCATCCTCACCACCCTCATTAACCCTAACAAAAAAAACTCATATCCCCATTATGTGAAATCCATTATCGCGTCCACCTTTATCATTAGCCTTTTCCCCACAACAATATTCATATGCCTAGACCAAGAAGCTATTATCTCAAACTGGCACTGAGCAACAACCCAAACAACCCAGCTCTCCCTAAGCTT
+		</sequence>
+		<sequence>
+			<taxon idref="Gorilla"/>
+			TCACCTCCTGTAAATATAGTTTAACCAAAACATCAGATTGTGAATCTGATAACAGAGGCTCA-CAACCCCTTATTTACCGAGAAAGCT-CGTAAGAGCTGCTAACTCATACCCCCGTGCTTGACAACATGGCTTTCTCAACTTTTAAAGGATAACAGCTATCCATTGGTCTTAGGACCCAAAAATTTTGGTGCAACTCCAAATAAAAGTAATAACTATGTACGCTACCATAACCACCTTAGCCCTAACTTCCTTAATTCCCCCTATCCTTACCACCTTCATCAATCCTAACAAAAAAAGCTCATACCCCCATTACGTAAAATCTATCGTCGCATCCACCTTTATCATCAGCCTCTTCCCCACAACAATATTTCTATGCCTAGACCAAGAAGCTATTATCTCAAGCTGACACTGAGCAACAACCCAAACAATTCAACTCTCCCTAAGCTT
+		</sequence>
+		<sequence>
+			<taxon idref="Pongo"/>
+			TCGCCTACTGTAAATATAGTTTAACCAAAACATTAGATTGTGAATCTAATAATAGGGCCCCA-CAACCCCTTATTTACCGAGAAAGCT-CACAAGAACTGCTAACTCTCACT-CCATGTGTGACAACATGGCTTTCTCAGCTTTTAAAGGATAACAGCTATCCCTTGGTCTTAGGATCCAAAAATTTTGGTGCAACTCCAAATAAAAGTAACAGCCATGTTTACCACCATAACTGCCCTCACCTTAACTTCCCTAATCCCCCCCATTACCGCTACCCTCATTAACCCCAACAAAAAAAACCCATACCCCCACTATGTAAAAACGGCCATCGCATCCGCCTTTACTATCAGCCTTATCCCAACAACAATATTTATCTGCCTAGGACAAGAAACCATCGTCACAAACTGATGCTGAACAACCACCCAGACACTACAACTCTCACTAAGCTT
+		</sequence>
+		<sequence>
+			<taxon idref="Hylobates"/>
+			TTACTCCCTGTAAACATAGTTTAATCAAAACATTAGATTGTGAATCTAACAATAGAGGCTCG-AAACCTCTTGCTTACCGAGAAAGCC-CACAAGAACTGCTAACTCACTATCCCATGTATGACAACATGGCTTTCTCAACTTTTAAAGGATAACAGCTATCCATTGGTCTTAGGACCCAAAAATTTTGGTGCAACTCCAAATAAAAGTAATAGCAATGTACACCACCATAGCCATTCTAACGCTAACCTCCCTAATTCCCCCCATTACAGCCACCCTTATTAACCCCAATAAAAAGAACTTATACCCGCACTACGTAAAAATGACCATTGCCTCTACCTTTATAATCAGCCTATTTCCCACAATAATATTCATGTGCACAGACCAAGAAACCATTATTTCAAACTGACACTGAACTGCAACCCAAACGCTAGAACTCTCCCTAAGCTT
+		</sequence>
+		<sequence>
+			<taxon idref="Macaca_fuscata"/>
+			TTACCTCCTGTAGATATAGTTTAACTAAAACACTAGATTGTGAATCTAACCATAGAGACTCA-CCACCTCTTATTTACCGAGAAAACT-CGCAAGGACTGCTAACCCATGTACCCGTACCTAAAATTACGGTTTTCTCAACTTTTAAAGGATAACAGCTATCCATTGACCTTAGGAGTCAAAAACATTGGTGCAACTCCAAATAAAAGTAATAATCATGCACACCCCCATCATTATAACAACCCTTATCTCCCTAACTCTCCCAATTTTTGCCACCCTCATCAACCCTTACAAAAAACGTCCATACCCAGATTACGTAAAAACAACCGTAATATATGCTTTCATCATCAGCCTCCCCTCAACAACTTTATTCATCTTCTCAAACCAAGAAACAACCATTTGGAGCTGACATTGAATAATGACCCAAACACTAGACCTAACGCTAAGCTT
+		</sequence>
+		<sequence>
+			<taxon idref="M_mulatta"/>
+			TTACTTCCTGTAGATATAGTTTAACTAAAACATTAGATTGTGAATCTAACCATAGAGACTTA-CCACCTCTTATTTACCGAGAAAACT-CGCGAGGACTGCTAACCCATGTATCCGTACCTAAAATTACGGTTTTCTCAACTTTTAAAGGATAACAGCTATCCATTGACCTTAGGAGTCAAAAATATTGGTGCAACTCCAAATAAAAGTAATAATCATGCACACCCCTATCATAATAACAACCCTTATCTCCCTAACTCTCCCAATTTTTGCCACCCTCATCAACCCTTACAAAAAACGTCCATACCCAGATTACGTAAAAACAACCGTAATATATGCTTTCATCATCAGCCTCCCCTCAACAACTTTATTCATCTTCTCAAACCAAGAAACAACCATTTGAAGCTGACATTGAATAATAACCCAAACACTAGACCTAACACTAAGCTT
+		</sequence>
+		<sequence>
+			<taxon idref="M_fascicularis"/>
+			TTACCTCCTGTAAATATAGTTTAACTAAAACATTAGATTGTGAATCTAACTATAGAGGCCTA-CCACTTCTTATTTACCGAGAAAACT-CGCAAGGACTGCTAATCCATGCCTCCGTACTTAAAACTACGGTTTCCTCAACTTTTAAAGGATAACAGCTATCCATTGACCTTAGGAGTCAAAAACATTGGTGCAACTCCAAATAAAAGTAATAATCATGCACACCCCCATCATAATAACAACCCTCATCTCCCTGACCCTTCCAATTTTTGCCACCCTCACCAACCCCTATAAAAAACGTTCATACCCAGACTACGTAAAAACAACCGTAATATATGCTTTTATTACCAGTCTCCCCTCAACAACCCTATTCATCCTCTCAAACCAAGAAACAACCATTTGGAGTTGACATTGAATAACAACCCAAACATTAGACCTAACACTAAGCTT
+		</sequence>
+		<sequence>
+			<taxon idref="M_sylvanus"/>
+			TTACTTCCTGTAAATATAGTTTAATTAAAACATTAGACTGTGAATCTAACTATAGAAGCTTA-CCACTTCTTATTTACCGAGAAAACT-TGCAAGGACCGCTAATCCACACCTCCGTACTTAAAACTACGGTTTTCTCAACTTTTAAAGGATAACAGCTATCCATTGGCCTTAGGAGTCAAAAATATTGGTGCAACTCCAAATAAAAGTAATAATCATGTATACCCCCATCATAATAACAACTCTCATCTCCCTAACTCTTCCAATTTTCGCTACCCTTATCAACCCCAACAAAAAACACCTATATCCAAACTACGTAAAAACAGCCGTAATATATGCTTTCATTACCAGCCTCTCTTCAACAACTTTATATATATTCTTAAACCAAGAAACAATCATCTGAAGCTGGCACTGAATAATAACCCAAACACTAAGCCTAACATTAAGCTT
+		</sequence>
+		<sequence>
+			<taxon idref="Saimiri_sciureus"/>
+			CCTCACCTTGTAATTATAGTTTAGCTAAAACATTAGATTGTGAATCTAATAATAGAAGAATA-TAACTTCTTAATTACCGAGAAAGTG-CGCAAGAACTGCTAATTCATGCTCCCAAGACTAACAACTTGGCTTCCTCAACTTTTAAAGGATAGTAGTTATCCATTGGTCTTAGGAGCCAAAAACATTGGTGCAACTCCAAATAAAAGTAATA---ATACACTTCTCCATCACTCTAATAACACTAATTAGCCTACTAGCGCCAATCCTAGCTACCCTCATTAACCCTAACAAAAGCACACTATACCCGTACTACGTAAAACTAGCCATCATCTACGCCCTCATTACCAGTACCTTATCTATAATATTCTTTATCCTTACAGGCCAAGAATCAATAATTTCAAACTGACACTGAATAACTATCCAAACCATCAAACTATCCCTAAGCTT
+		</sequence>
+	</alignment>
+
+	<!-- The unique patterns from 1 to end                                       -->
+	<!-- npatterns=227                                                           -->
+	<patterns id="firsthalf.patterns" from="1">
+		<alignment idref="alignment1"/>
+	</patterns>
+
+	<!-- The unique patterns from 1 to end                                       -->
+	<!-- npatterns=231                                                           -->
+	<patterns id="secondhalf.patterns" from="1">
+		<alignment idref="alignment2"/>
+	</patterns>
+
+	<!-- A prior assumption that the population size has remained constant       -->
+	<!-- throughout the time spanned by the genealogy.                           -->
+	<constantSize id="constant" units="substitutions">
+		<populationSize>
+			<parameter id="constant.popSize" value="0.3" lower="0.0" upper="Infinity"/>
+		</populationSize>
+	</constantSize>
+
+	<!-- Generate a random starting tree under the coalescent process            -->
+	<coalescentTree id="startingTree" rootHeight="0.3">
+		<taxa idref="taxa"/>
+		<constantSize idref="constant"/>
+	</coalescentTree>
+
+	<!-- Generate a tree model                                                   -->
+	<treeModel id="treeModel">
+		<coalescentTree idref="startingTree"/>
+		<rootHeight>
+			<parameter id="treeModel.rootHeight"/>
+		</rootHeight>
+		<nodeHeights internalNodes="true">
+			<parameter id="treeModel.internalNodeHeights"/>
+		</nodeHeights>
+		<nodeHeights internalNodes="true" rootNode="true">
+			<parameter id="treeModel.allInternalNodeHeights"/>
+		</nodeHeights>
+	</treeModel>
+
+	<!-- Generate a coalescent likelihood                                        -->
+	<coalescentLikelihood id="coalescent">
+		<model>
+			<constantSize idref="constant"/>
+		</model>
+		<populationTree>
+			<treeModel idref="treeModel"/>
+		</populationTree>
+	</coalescentLikelihood>
+
+	<!-- The strict clock (Uniform rates across branches)                        -->
+	<strictClockBranchRates id="branchRates">
+		<rate>
+			<parameter id="clock.rate" value="1.0"/>
+		</rate>
+	</strictClockBranchRates>
+
+	<!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+	<HKYModel id="firsthalf.hky">
+		<frequencies>
+			<frequencyModel dataType="nucleotide">
+				<frequencies>
+					<parameter id="firsthalf.frequencies" value="0.25 0.25 0.25 0.25"/>
+				</frequencies>
+			</frequencyModel>
+		</frequencies>
+		<kappa>
+			<parameter id="firsthalf.kappa" value="2.0" lower="0.0" upper="Infinity"/>
+		</kappa>
+	</HKYModel>
+
+	<!-- site model                                                              -->
+	<siteModel id="firsthalf.siteModel">
+		<substitutionModel>
+			<HKYModel idref="firsthalf.hky"/>
+		</substitutionModel>
+	</siteModel>
+
+	<!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+	<HKYModel id="secondhalf.hky">
+		<frequencies>
+			<frequencyModel dataType="nucleotide">
+				<frequencies>
+					<parameter id="secondhalf.frequencies" value="0.25 0.25 0.25 0.25"/>
+				</frequencies>
+			</frequencyModel>
+		</frequencies>
+		<kappa>
+			<parameter id="secondhalf.kappa" value="2.0" lower="0.0" upper="Infinity"/>
+		</kappa>
+	</HKYModel>
+
+	<!-- site model                                                              -->
+	<siteModel id="secondhalf.siteModel">
+		<substitutionModel>
+			<HKYModel idref="secondhalf.hky"/>
+		</substitutionModel>
+	</siteModel>
+	<treeLikelihood id="firsthalf.treeLikelihood" useAmbiguities="false">
+		<patterns idref="firsthalf.patterns"/>
+		<treeModel idref="treeModel"/>
+		<siteModel idref="firsthalf.siteModel"/>
+		<strictClockBranchRates idref="branchRates"/>
+	</treeLikelihood>
+	<treeLikelihood id="secondhalf.treeLikelihood" useAmbiguities="false">
+		<patterns idref="secondhalf.patterns"/>
+		<treeModel idref="treeModel"/>
+		<siteModel idref="secondhalf.siteModel"/>
+		<strictClockBranchRates idref="branchRates"/>
+	</treeLikelihood>
+
+	<!-- Define operators                                                        -->
+	<operators id="operators">
+		<scaleOperator scaleFactor="0.75" weight="0.1">
+			<parameter idref="firsthalf.kappa"/>
+		</scaleOperator>
+		<deltaExchange delta="0.01" weight="0.1">
+			<parameter idref="firsthalf.frequencies"/>
+		</deltaExchange>
+		<scaleOperator scaleFactor="0.75" weight="0.1">
+			<parameter idref="secondhalf.kappa"/>
+		</scaleOperator>
+		<deltaExchange delta="0.01" weight="0.1">
+			<parameter idref="secondhalf.frequencies"/>
+		</deltaExchange>
+		<subtreeSlide size="0.03" gaussian="true" weight="15">
+			<treeModel idref="treeModel"/>
+		</subtreeSlide>
+		<narrowExchange weight="15">
+			<treeModel idref="treeModel"/>
+		</narrowExchange>
+		<wideExchange weight="3">
+			<treeModel idref="treeModel"/>
+		</wideExchange>
+		<wilsonBalding weight="3">
+			<treeModel idref="treeModel"/>
+		</wilsonBalding>
+		<scaleOperator scaleFactor="0.75" weight="3">
+			<parameter idref="treeModel.rootHeight"/>
+		</scaleOperator>
+		<uniformOperator weight="30">
+			<parameter idref="treeModel.internalNodeHeights"/>
+		</uniformOperator>
+		<scaleOperator scaleFactor="0.75" weight="3">
+			<parameter idref="constant.popSize"/>
+		</scaleOperator>
+		<upDownOperator scaleFactor="0.75" weight="3">
+			<up>
+			</up>
+			<down>
+				<parameter idref="treeModel.allInternalNodeHeights"/>
+			</down>
+		</upDownOperator>
+	</operators>
+
+	<!-- Define MCMC                                                             -->
+	<mcmc id="mcmc" chainLength="10000000" autoOptimize="true">
+		<posterior id="posterior">
+			<prior id="prior">
+				<logNormalPrior mean="1.0" stdev="1.25" offset="0.0" meanInRealSpace="false">
+					<parameter idref="firsthalf.kappa"/>
+				</logNormalPrior>
+				<logNormalPrior mean="1.0" stdev="1.25" offset="0.0" meanInRealSpace="false">
+					<parameter idref="secondhalf.kappa"/>
+				</logNormalPrior>
+				<oneOnXPrior>
+					<parameter idref="constant.popSize"/>
+				</oneOnXPrior>
+				<coalescentLikelihood idref="coalescent"/>
+			</prior>
+			<likelihood id="likelihood">
+				<treeLikelihood idref="firsthalf.treeLikelihood"/>
+				<treeLikelihood idref="secondhalf.treeLikelihood"/>
+			</likelihood>
+		</posterior>
+		<operators idref="operators"/>
+
+		<!-- write log to screen                                                     -->
+		<log id="screenLog" logEvery="100000">
+			<column label="Posterior" dp="4" width="12">
+				<posterior idref="posterior"/>
+			</column>
+			<column label="Prior" dp="4" width="12">
+				<prior idref="prior"/>
+			</column>
+			<column label="Likelihood" dp="4" width="12">
+				<likelihood idref="likelihood"/>
+			</column>
+			<column label="rootHeight" sf="6" width="12">
+				<parameter idref="treeModel.rootHeight"/>
+			</column>
+			<column label="clock.rate" sf="6" width="12">
+				<parameter idref="clock.rate"/>
+			</column>
+		</log>
+
+		<!-- write log to file                                                       -->
+		<log id="fileLog" logEvery="1000" fileName="Primates.log" overwrite="false">
+			<posterior idref="posterior"/>
+			<prior idref="prior"/>
+			<likelihood idref="likelihood"/>
+			<parameter idref="treeModel.rootHeight"/>
+			<parameter idref="constant.popSize"/>
+			<parameter idref="firsthalf.kappa"/>
+			<parameter idref="firsthalf.frequencies"/>
+			<parameter idref="secondhalf.kappa"/>
+			<parameter idref="secondhalf.frequencies"/>
+			<parameter idref="clock.rate"/>
+			<treeLikelihood idref="firsthalf.treeLikelihood"/>
+			<treeLikelihood idref="secondhalf.treeLikelihood"/>
+			<coalescentLikelihood idref="coalescent"/>
+		</log>
+
+		<!-- write tree log to file                                                  -->
+		<logTree id="treeFileLog" logEvery="1000" nexusFormat="true" fileName="Primates.trees" sortTranslationTable="true">
+			<treeModel idref="treeModel"/>
+			<strictClockBranchRates idref="branchRates"/>
+			<posterior idref="posterior"/>
+		</logTree>
+	</mcmc>
+	<report>
+		<property name="timer">
+			<mcmc idref="mcmc"/>
+		</property>
+	</report>
+</beast>
diff --git a/examples/beast2vs1/beast1/testRandomLocalClock.xml b/examples/beast2vs1/beast1/testRandomLocalClock.xml
new file mode 100644
index 0000000..5ad8bb9
--- /dev/null
+++ b/examples/beast2vs1/beast1/testRandomLocalClock.xml
@@ -0,0 +1,274 @@
+<?xml version="1.0" standalone="yes"?>
+
+<!-- Generated by BEAUTi v1.7.0 Prerelease r3910                             -->
+<!--       by Alexei J. Drummond and Andrew Rambaut                          -->
+<!--       Department of Computer Science, University of Auckland and        -->
+<!--       Institute of Evolutionary Biology, University of Edinburgh        -->
+<!--       http://beast.bio.ed.ac.uk/                                        -->
+<beast>
+
+	<!-- The list of taxa to be analysed (can also include dates/ages).          -->
+	<!-- ntax=6                                                                  -->
+	<taxa id="taxa">
+		<taxon id="human"/>
+		<taxon id="chimp"/>
+		<taxon id="bonobo"/>
+		<taxon id="gorilla"/>
+		<taxon id="orangutan"/>
+		<taxon id="siamang"/>
+	</taxa>
+
+	<!-- The sequence alignment (each sequence refers to a taxon above).         -->
+	<!-- ntax=6 nchar=768                                                        -->
+	<alignment id="alignment" dataType="nucleotide">
+		<sequence>
+			<taxon idref="human"/>
+			AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCACCTCGGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="chimp"/>
+			AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCACCTCAGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="bonobo"/>
+			AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAGC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTTGAATTTGCAATTCAATATGAAAA-TCACCTCAGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="gorilla"/>
+			AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTAAACATAGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA-CAACACTTAATTTCTGTAAGGACTGCAAAACCCTACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCAATGGGACTCAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAT-TCACCTCGGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="orangutan"/>
+			AGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA-CAGCACTTAATTTCTGTAAGGACTGCAAAACCCCACTTTGCATCAACTGAGCGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCCTAGACCGATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAT-TGGCTTCAGTCCAAAGCCCCGGCAGGCCTTAAAGCTGCTCCTTCGAATTTGCAATTCAACATGACAA-TCACCTCAGGGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="siamang"/>
+			AGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTAACAAAACTTAATTTCTGCAAGGGCTGCAAAACCCTACTTTGCATCAACCGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCGATGGGACTTAAACCCATAAAAATTTAGTTAACAGCTAAACACCCTAAACAACCTGGCTTCAATCTAAAGCCCCGGCAGA-GTTGAAGCTGCTTCTTTGAACTTGCAATTCAACGTGAAAAATCACTTCGGAGCT [...]
+		</sequence>
+	</alignment>
+
+	<!-- The unique patterns from 1 to end                                       -->
+	<!-- npatterns=69                                                            -->
+	<patterns id="patterns" from="1">
+		<alignment idref="alignment"/>
+	</patterns>
+
+	<!-- A prior assumption that the population size has remained constant       -->
+	<!-- throughout the time spanned by the genealogy.                           -->
+	<constantSize id="constant" units="substitutions">
+		<populationSize>
+			<parameter id="constant.popSize" value="0.077" lower="0.0" upper="Infinity"/>
+		</populationSize>
+	</constantSize>
+
+	<!-- Generate a random starting tree under the coalescent process            -->
+	<coalescentTree id="startingTree" rootHeight="0.077">
+		<taxa idref="taxa"/>
+		<constantSize idref="constant"/>
+	</coalescentTree>
+
+	<!-- Generate a tree model                                                   -->
+	<treeModel id="treeModel">
+		<coalescentTree idref="startingTree"/>
+		<rootHeight>
+			<parameter id="treeModel.rootHeight"/>
+		</rootHeight>
+		<nodeHeights internalNodes="true">
+			<parameter id="treeModel.internalNodeHeights"/>
+		</nodeHeights>
+		<nodeHeights internalNodes="true" rootNode="true">
+			<parameter id="treeModel.allInternalNodeHeights"/>
+		</nodeHeights>
+	</treeModel>
+
+	<!-- Generate a coalescent likelihood                                        -->
+	<coalescentLikelihood id="coalescent">
+		<model>
+			<constantSize idref="constant"/>
+		</model>
+		<populationTree>
+			<treeModel idref="treeModel"/>
+		</populationTree>
+	</coalescentLikelihood>
+
+	<!-- The random local clock model (Drummond & Suchard, 2010)                 -->
+	<randomLocalClockModel id="branchRates" ratesAreMultipliers="false">
+		<treeModel idref="treeModel"/>
+		<rates>
+			<parameter id="localClock.relativeRates" value="1.0" lower='0.0'/>
+		</rates>
+		<rateIndicator>
+			<parameter id="localClock.changes" value="0.0" lower='0.0'/>
+		</rateIndicator>
+		<clockRate>
+			<parameter id="clock.rate" value="1.0"/>
+		</clockRate>
+	</randomLocalClockModel>
+	<sumStatistic id="rateChanges" name="rateChangeCount" elementwise="true">
+		<parameter idref="localClock.changes"/>
+	</sumStatistic>
+	<rateStatistic id="meanRate" name="meanRate" mode="mean" internal="true" external="true">
+		<treeModel idref="treeModel"/>
+		<randomLocalClockModel idref="branchRates"/>
+	</rateStatistic>
+	<rateStatistic id="coefficientOfVariation" name="coefficientOfVariation" mode="coefficientOfVariation" internal="true" external="true">
+		<treeModel idref="treeModel"/>
+		<randomLocalClockModel idref="branchRates"/>
+	</rateStatistic>
+	<rateCovarianceStatistic id="covariance" name="covariance">
+		<treeModel idref="treeModel"/>
+		<randomLocalClockModel idref="branchRates"/>
+	</rateCovarianceStatistic>
+
+	<!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+	<HKYModel id="hky">
+		<frequencies>
+			<frequencyModel dataType="nucleotide">
+				<frequencies>
+					<parameter id="frequencies" value="0.25 0.25 0.25 0.25"/>
+				</frequencies>
+			</frequencyModel>
+		</frequencies>
+		<kappa>
+			<parameter id="kappa" value="2.0" lower="0.0" upper="Infinity"/>
+		</kappa>
+	</HKYModel>
+
+	<!-- site model                                                              -->
+	<siteModel id="siteModel">
+		<substitutionModel>
+			<HKYModel idref="hky"/>
+		</substitutionModel>
+	</siteModel>
+
+	<!-- Likelihood for tree given sequence data                                 -->
+	<treeLikelihood id="treeLikelihood" useAmbiguities="false">
+		<patterns idref="patterns"/>
+		<treeModel idref="treeModel"/>
+		<siteModel idref="siteModel"/>
+		<randomLocalClockModel idref="branchRates"/>
+	</treeLikelihood>
+
+	<!-- Define operators                                                        -->
+	<operators id="operators">
+		<scaleOperator scaleFactor="0.75" weight="0.1">
+			<parameter idref="kappa"/>
+		</scaleOperator>
+		<deltaExchange delta="0.01" weight="0.1">
+			<parameter idref="frequencies"/>
+		</deltaExchange>
+		<scaleOperator scaleFactor="0.75" weight="15">
+			<parameter idref="localClock.relativeRates"/>
+		</scaleOperator>
+		<bitFlipOperator weight="15">
+			<parameter idref="localClock.changes"/>
+		</bitFlipOperator>
+		<subtreeSlide size="0.0077" gaussian="true" weight="15">
+			<treeModel idref="treeModel"/>
+		</subtreeSlide>
+		<narrowExchange weight="15">
+			<treeModel idref="treeModel"/>
+		</narrowExchange>
+		<wideExchange weight="3">
+			<treeModel idref="treeModel"/>
+		</wideExchange>
+		<wilsonBalding weight="3">
+			<treeModel idref="treeModel"/>
+		</wilsonBalding>
+		<scaleOperator scaleFactor="0.75" weight="3">
+			<parameter idref="treeModel.rootHeight"/>
+		</scaleOperator>
+		<uniformOperator weight="30">
+			<parameter idref="treeModel.internalNodeHeights"/>
+		</uniformOperator>
+		<scaleOperator scaleFactor="0.75" weight="3">
+			<parameter idref="constant.popSize"/>
+		</scaleOperator>
+		<upDownOperator scaleFactor="0.75" weight="3">
+			<up>
+			</up>
+			<down>
+				<parameter idref="treeModel.allInternalNodeHeights"/>
+			</down>
+		</upDownOperator>
+	</operators>
+
+	<!-- Define MCMC                                                             -->
+	<mcmc id="mcmc" chainLength="10000000" autoOptimize="true">
+		<posterior id="posterior">
+			<prior id="prior">
+				<logNormalPrior mean="1.0" stdev="1.25" offset="0.0" meanInRealSpace="false">
+					<parameter idref="kappa"/>
+				</logNormalPrior>
+				<uniformPrior lower="0.0" upper="1.0">
+					<parameter idref="frequencies"/>
+				</uniformPrior>
+				<!--<poissonPrior mean="0.6931471805599453" offset="0.0">
+					<statistic idref="rateChanges"/>
+				</poissonPrior> -->
+				<gammaPrior shape="0.5" scale="2.0" offset="0.0">
+					<parameter idref="localClock.relativeRates"/>
+				</gammaPrior>
+				<oneOnXPrior>
+					<parameter idref="constant.popSize"/>
+				</oneOnXPrior>
+				<coalescentLikelihood idref="coalescent"/>
+  		    </prior>
+			<likelihood id="likelihood">
+				<treeLikelihood idref="treeLikelihood"/>
+			</likelihood>
+		</posterior>
+		<operators idref="operators"/>
+
+		<!-- write log to screen                                                     -->
+		<log id="screenLog" logEvery="100000">
+			<column label="Posterior" dp="4" width="12">
+				<posterior idref="posterior"/>
+			</column>
+			<column label="Prior" dp="4" width="12">
+				<prior idref="prior"/>
+			</column>
+			<column label="Likelihood" dp="4" width="12">
+				<likelihood idref="likelihood"/>
+			</column>
+			<column label="rootHeight" sf="6" width="12">
+				<parameter idref="treeModel.rootHeight"/>
+			</column>
+			<column label="clock.rate" sf="6" width="12">
+				<parameter idref="clock.rate"/>
+			</column>
+		</log>
+
+		<!-- write log to file                                                       -->
+		<log id="fileLog" logEvery="1000" fileName="testRandomLocalClock.log" overwrite="false">
+			<posterior idref="posterior"/>
+			<prior idref="prior"/>
+			<likelihood idref="likelihood"/>
+			<parameter idref="treeModel.rootHeight"/>
+			<parameter idref="constant.popSize"/>
+			<parameter idref="kappa"/>
+			<parameter idref="frequencies"/>
+            <parameter idref="localClock.relativeRates"/>
+            <parameter idref="localClock.changes"/>
+			<parameter idref="clock.rate"/>
+			<sumStatistic idref="rateChanges"/>
+			<rateStatistic idref="meanRate"/>
+			<rateStatistic idref="coefficientOfVariation"/>
+			<rateCovarianceStatistic idref="covariance"/>
+			<treeLikelihood idref="treeLikelihood"/>
+			<coalescentLikelihood idref="coalescent"/>
+		</log>
+
+		<!-- write tree log to file                                                  -->
+		<logTree id="treeFileLog" logEvery="1000" nexusFormat="true" fileName="testRandomLocalClock.trees" sortTranslationTable="true">
+			<treeModel idref="treeModel"/>
+			<randomLocalClockModel idref="branchRates"/>
+			<posterior idref="posterior"/>
+		</logTree>
+	</mcmc>
+	<report>
+		<property name="timer">
+			<mcmc idref="mcmc"/>
+		</property>
+	</report>
+</beast>
diff --git a/examples/beast2vs1/beast1/testSRD06CP12_3.xml b/examples/beast2vs1/beast1/testSRD06CP12_3.xml
new file mode 100644
index 0000000..4e087b0
--- /dev/null
+++ b/examples/beast2vs1/beast1/testSRD06CP12_3.xml
@@ -0,0 +1,324 @@
+<?xml version="1.0" standalone="yes"?>
+
+<!-- Generated by BEAUTi v1.6.2                                              -->
+<!--       by Alexei J. Drummond and Andrew Rambaut                          -->
+<!--       Department of Computer Science, University of Auckland and        -->
+<!--       Institute of Evolutionary Biology, University of Edinburgh        -->
+<!--       http://beast.bio.ed.ac.uk/                                        -->
+<beast>
+
+	<!-- The list of taxa analyse (can also include dates/ages).                 -->
+	<!-- ntax=6                                                                  -->
+	<taxa id="taxa">
+		<taxon id="human"/>
+		<taxon id="chimp"/>
+		<taxon id="bonobo"/>
+		<taxon id="gorilla"/>
+		<taxon id="orangutan"/>
+		<taxon id="siamang"/>
+	</taxa>
+
+	<!-- The sequence alignment (each sequence refers to a taxon above).         -->
+	<!-- ntax=6 nchar=768                                                        -->
+	<alignment id="alignment" dataType="nucleotide">
+		<sequence>
+			<taxon idref="human"/>
+			AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCACCTCGGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="chimp"/>
+			AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCACCTCAGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="bonobo"/>
+			AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAGC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTTGAATTTGCAATTCAATATGAAAA-TCACCTCAGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="gorilla"/>
+			AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTAAACATAGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA-CAACACTTAATTTCTGTAAGGACTGCAAAACCCTACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCAATGGGACTCAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAT-TCACCTCGGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="orangutan"/>
+			AGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA-CAGCACTTAATTTCTGTAAGGACTGCAAAACCCCACTTTGCATCAACTGAGCGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCCTAGACCGATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAT-TGGCTTCAGTCCAAAGCCCCGGCAGGCCTTAAAGCTGCTCCTTCGAATTTGCAATTCAACATGACAA-TCACCTCAGGGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="siamang"/>
+			AGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTAACAAAACTTAATTTCTGCAAGGGCTGCAAAACCCTACTTTGCATCAACCGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCGATGGGACTTAAACCCATAAAAATTTAGTTAACAGCTAAACACCCTAAACAACCTGGCTTCAATCTAAAGCCCCGGCAGA-GTTGAAGCTGCTTCTTTGAACTTGCAATTCAACGTGAAAAATCACTTCGGAGCT [...]
+		</sequence>
+	</alignment>
+
+	<!-- The unique patterns for codon positions 1 & 2                           -->
+	<mergePatterns id="CP1+2.patterns">
+
+		<!-- The unique patterns from 1 to end every 3                               -->
+		<!-- npatterns=34                                                            -->
+		<patterns from="1" every="3">
+			<alignment idref="alignment"/>
+		</patterns>
+
+		<!-- The unique patterns from 2 to end every 3                               -->
+		<!-- npatterns=38                                                            -->
+		<patterns from="2" every="3">
+			<alignment idref="alignment"/>
+		</patterns>
+	</mergePatterns>
+
+	<!-- The unique patterns for codon positions 3                               -->
+	<mergePatterns id="CP3.patterns">
+
+		<!-- The unique patterns from 3 to end every 3                               -->
+		<!-- npatterns=37                                                            -->
+		<patterns from="3" every="3">
+			<alignment idref="alignment"/>
+		</patterns>
+	</mergePatterns>
+
+	<!-- A prior assumption that the population size has remained constant       -->
+	<!-- throughout the time spanned by the genealogy.                           -->
+	<constantSize id="constant" units="substitutions">
+		<populationSize>
+			<parameter id="constant.popSize" value="0.077" lower="0.0" upper="Infinity"/>
+		</populationSize>
+	</constantSize>
+
+	<!-- Generate a random starting tree under the coalescent process            -->
+	<coalescentTree id="startingTree" rootHeight="0.077">
+		<taxa idref="taxa"/>
+		<constantSize idref="constant"/>
+	</coalescentTree>
+
+	<!-- Generate a tree model                                                   -->
+	<treeModel id="treeModel">
+		<coalescentTree idref="startingTree"/>
+		<rootHeight>
+			<parameter id="treeModel.rootHeight"/>
+		</rootHeight>
+		<nodeHeights internalNodes="true">
+			<parameter id="treeModel.internalNodeHeights"/>
+		</nodeHeights>
+		<nodeHeights internalNodes="true" rootNode="true">
+			<parameter id="treeModel.allInternalNodeHeights"/>
+		</nodeHeights>
+	</treeModel>
+
+	<!-- Generate a coalescent likelihood                                        -->
+	<coalescentLikelihood id="coalescent">
+		<model>
+			<constantSize idref="constant"/>
+		</model>
+		<populationTree>
+			<treeModel idref="treeModel"/>
+		</populationTree>
+	</coalescentLikelihood>
+
+	<!-- The strict clock (Uniform rates across branches)                        -->
+	<strictClockBranchRates id="branchRates">
+		<rate>
+			<parameter id="clock.rate" value="1.0"/>
+		</rate>
+	</strictClockBranchRates>
+
+	<!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+	<HKYModel id="CP1+2.hky">
+		<frequencies>
+			<frequencyModel dataType="nucleotide">
+				<frequencies>
+					<parameter id="CP1+2.frequencies" value="0.25 0.25 0.25 0.25"/>
+				</frequencies>
+			</frequencyModel>
+		</frequencies>
+		<kappa>
+			<parameter id="CP1+2.kappa" value="2.0" lower="0.0" upper="Infinity"/>
+		</kappa>
+	</HKYModel>
+
+	<!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+	<HKYModel id="CP3.hky">
+		<frequencies>
+			<frequencyModel dataType="nucleotide">
+				<frequencies>
+					<parameter id="CP3.frequencies" value="0.25 0.25 0.25 0.25"/>
+				</frequencies>
+			</frequencyModel>
+		</frequencies>
+		<kappa>
+			<parameter id="CP3.kappa" value="2.0" lower="0.0" upper="Infinity"/>
+		</kappa>
+	</HKYModel>
+
+	<!-- site model                                                              -->
+	<siteModel id="CP1+2.siteModel">
+		<substitutionModel>
+			<HKYModel idref="CP1+2.hky"/>
+		</substitutionModel>
+		<relativeRate>
+			<parameter id="CP1+2.mu" value="1.0" lower="0.0" upper="Infinity"/>
+		</relativeRate>
+		<gammaShape gammaCategories="4">
+			<parameter id="CP1+2.alpha" value="0.5" lower="0.0" upper="1000.0"/>
+		</gammaShape>
+	</siteModel>
+
+	<!-- site model                                                              -->
+	<siteModel id="CP3.siteModel">
+		<substitutionModel>
+			<HKYModel idref="CP3.hky"/>
+		</substitutionModel>
+		<relativeRate>
+			<parameter id="CP3.mu" value="1.0" lower="0.0" upper="Infinity"/>
+		</relativeRate>
+		<gammaShape gammaCategories="4">
+			<parameter id="CP3.alpha" value="0.5" lower="0.0" upper="1000.0"/>
+		</gammaShape>
+	</siteModel>
+
+	<compoundParameter id="allMus">
+		<parameter idref="CP1+2.mu"/>
+		<parameter idref="CP3.mu"/>
+	</compoundParameter>
+	<treeLikelihood id="CP1+2.treeLikelihood" useAmbiguities="false">
+		<mergePatterns idref="CP1+2.patterns"/>
+		<treeModel idref="treeModel"/>
+		<siteModel idref="CP1+2.siteModel"/>
+		<strictClockBranchRates idref="branchRates"/>
+	</treeLikelihood>
+	<treeLikelihood id="CP3.treeLikelihood" useAmbiguities="false">
+		<mergePatterns idref="CP3.patterns"/>
+		<treeModel idref="treeModel"/>
+		<siteModel idref="CP3.siteModel"/>
+		<strictClockBranchRates idref="branchRates"/>
+	</treeLikelihood>
+
+	<!-- Define operators                                                        -->
+	<operators id="operators">
+		<scaleOperator scaleFactor="0.75" weight="0.1">
+			<parameter idref="CP1+2.kappa"/>
+		</scaleOperator>
+		<scaleOperator scaleFactor="0.75" weight="0.1">
+			<parameter idref="CP3.kappa"/>
+		</scaleOperator>
+		<deltaExchange delta="0.01" weight="0.1">
+			<parameter idref="CP1+2.frequencies"/>
+		</deltaExchange>
+		<deltaExchange delta="0.01" weight="0.1">
+			<parameter idref="CP3.frequencies"/>
+		</deltaExchange>
+		<scaleOperator scaleFactor="0.75" weight="0.1">
+			<parameter idref="CP1+2.alpha"/>
+		</scaleOperator>
+		<scaleOperator scaleFactor="0.75" weight="0.1">
+			<parameter idref="CP3.alpha"/>
+		</scaleOperator>
+		<deltaExchange delta="0.75" parameterWeights="512 256" weight="2">
+			<parameter idref="allMus"/>
+		</deltaExchange>
+		<subtreeSlide size="0.0077" gaussian="true" weight="15">
+			<treeModel idref="treeModel"/>
+		</subtreeSlide>
+		<narrowExchange weight="15">
+			<treeModel idref="treeModel"/>
+		</narrowExchange>
+		<wideExchange weight="3">
+			<treeModel idref="treeModel"/>
+		</wideExchange>
+		<wilsonBalding weight="3">
+			<treeModel idref="treeModel"/>
+		</wilsonBalding>
+		<scaleOperator scaleFactor="0.75" weight="3">
+			<parameter idref="treeModel.rootHeight"/>
+		</scaleOperator>
+		<uniformOperator weight="30">
+			<parameter idref="treeModel.internalNodeHeights"/>
+		</uniformOperator>
+		<scaleOperator scaleFactor="0.75" weight="3">
+			<parameter idref="constant.popSize"/>
+		</scaleOperator>
+		<upDownOperator scaleFactor="0.75" weight="3">
+			<up>
+			</up>
+			<down>
+				<parameter idref="treeModel.allInternalNodeHeights"/>
+			</down>
+		</upDownOperator>
+	</operators>
+
+	<!-- Define MCMC                                                             -->
+	<mcmc id="mcmc" chainLength="10000000" autoOptimize="true">
+		<posterior id="posterior">
+			<prior id="prior">
+				<logNormalPrior mean="1.0" stdev="1.25" offset="0.0" meanInRealSpace="false">
+					<parameter idref="CP1+2.kappa"/>
+				</logNormalPrior>
+				<logNormalPrior mean="1.0" stdev="1.25" offset="0.0" meanInRealSpace="false">
+					<parameter idref="CP3.kappa"/>
+				</logNormalPrior>
+                <oneOnXPrior>
+					<parameter idref="CP1+2.alpha"/>
+				</oneOnXPrior>
+                <oneOnXPrior>
+					<parameter idref="CP3.alpha"/>
+				</oneOnXPrior>
+				<oneOnXPrior>
+					<parameter idref="constant.popSize"/>
+				</oneOnXPrior>
+				<coalescentLikelihood idref="coalescent"/>
+			</prior>
+			<likelihood id="likelihood">
+				<treeLikelihood idref="CP1+2.treeLikelihood"/>
+				<treeLikelihood idref="CP3.treeLikelihood"/>
+			</likelihood>
+		</posterior>
+		<operators idref="operators"/>
+
+		<!-- write log to screen                                                     -->
+		<log id="screenLog" logEvery="1000000">
+			<column label="Posterior" dp="4" width="12">
+				<posterior idref="posterior"/>
+			</column>
+			<column label="Prior" dp="4" width="12">
+				<prior idref="prior"/>
+			</column>
+			<column label="Likelihood" dp="4" width="12">
+				<likelihood idref="likelihood"/>
+			</column>
+			<column label="rootHeight" sf="6" width="12">
+				<parameter idref="treeModel.rootHeight"/>
+			</column>
+			<column label="clock.rate" sf="6" width="12">
+				<parameter idref="clock.rate"/>
+			</column>
+		</log>
+
+		<!-- write log to file                                                       -->
+		<log id="fileLog" logEvery="1000" fileName="testSDR06CP12_3.log" overwrite="false">
+			<posterior idref="posterior"/>
+			<prior idref="prior"/>
+			<likelihood idref="likelihood"/>
+			<parameter idref="treeModel.rootHeight"/>
+			<parameter idref="constant.popSize"/>
+			<parameter idref="CP1+2.kappa"/>
+			<parameter idref="CP3.kappa"/>
+			<parameter idref="CP1+2.frequencies"/>
+			<parameter idref="CP3.frequencies"/>
+			<parameter idref="CP1+2.alpha"/>
+			<parameter idref="CP3.alpha"/>
+			<compoundParameter idref="allMus"/>
+			<parameter idref="clock.rate"/>
+			<treeLikelihood idref="CP1+2.treeLikelihood"/>
+			<treeLikelihood idref="CP3.treeLikelihood"/>
+			<coalescentLikelihood idref="coalescent"/>
+		</log>
+
+		<!-- write tree log to file
+		<logTree id="treeFileLog" logEvery="1000" nexusFormat="true" fileName="testSDR06CP12_3.trees" sortTranslationTable="true">
+			<treeModel idref="treeModel"/>
+			<strictClockBranchRates idref="branchRates"/>
+			<posterior idref="posterior"/>
+		</logTree>-->
+	</mcmc>
+	<report>
+		<property name="timer">
+			<mcmc idref="mcmc"/>
+		</property>
+	</report>
+</beast>
diff --git a/examples/beast2vs1/beast1/testSiteModelAlpha.xml b/examples/beast2vs1/beast1/testSiteModelAlpha.xml
new file mode 100644
index 0000000..afa273a
--- /dev/null
+++ b/examples/beast2vs1/beast1/testSiteModelAlpha.xml
@@ -0,0 +1,318 @@
+<?xml version="1.0" standalone="yes"?>
+<beast>
+
+	<taxa id="taxa">
+		<taxon id="TREESPARROW_HENAN_1_2004">
+			<date value="2004.0" direction="forwards" units="years"/>
+		</taxon>
+		<taxon id="HUMAN_VIETNAM_CL105_2005">
+			<date value="2005.0" direction="forwards" units="years"/>
+		</taxon>
+		<taxon id="TREESPARROW_HENAN_4_2004">
+			<date value="2004.0" direction="forwards" units="years"/>
+		</taxon>
+		<taxon id="CHICKEN_HEBEI_326_2005">
+			<date value="2005.0" direction="forwards" units="years"/>
+		</taxon>
+		<taxon id="CHICKEN_HONGKONG_915_1997">
+			<date value="1997.0" direction="forwards" units="years"/>
+		</taxon>
+		<taxon id="VIETNAM_3062_2004">
+			<date value="2004.0" direction="forwards" units="years"/>
+		</taxon>
+		<taxon id="GOOSE_HONGKONG_W355_1997">
+			<date value="1997.0" direction="forwards" units="years"/>
+		</taxon>
+		<taxon id="DUCK_HONGKONG_Y283_1997">
+			<date value="1997.0" direction="forwards" units="years"/>
+		</taxon>
+		<taxon id="DUCK_VIETNAM_376_2005">
+			<date value="2005.0" direction="forwards" units="years"/>
+		</taxon>
+		<taxon id="MALLARD_VIETNAM_16_2003">
+			<date value="2003.0" direction="forwards" units="years"/>
+		</taxon>
+		<taxon id="CHICKEN_THAILAND_KANCHANABURI_CK_160_2005">
+			<date value="2005.0" direction="forwards" units="years"/>
+		</taxon>
+		<taxon id="DUCK_GUANGZHOU_20_2005">
+			<date value="2005.0" direction="forwards" units="years"/>
+		</taxon>
+		<taxon id="CK_HK_WF157_2003">
+			<date value="2003.0" direction="forwards" units="years"/>
+		</taxon>
+		<taxon id="SWINE_ANHUI_2004">
+			<date value="2004.0" direction="forwards" units="years"/>
+		</taxon>
+		<taxon id="DUCK_VIETNAM_272_2005">
+			<date value="2005.0" direction="forwards" units="years"/>
+		</taxon>
+		<taxon id="HONGKONG_1997_1998">
+			<date value="1998.0" direction="forwards" units="years"/>
+		</taxon>
+		<taxon id="GOOSE_SHANTOU_2216_2005">
+			<date value="2005.0" direction="forwards" units="years"/>
+		</taxon>
+		<taxon id="TREESPARROW_HENAN_3_2004">
+			<date value="2004.0" direction="forwards" units="years"/>
+		</taxon>
+		<taxon id="PEREGRINEFALCON_HK_D0028_2004">
+			<date value="2004.0" direction="forwards" units="years"/>
+		</taxon>
+		<taxon id="TREESPARROW_HENAN_2_2004">
+			<date value="2004.0" direction="forwards" units="years"/>
+		</taxon>
+		<taxon id="HONGKONG_538_1997">
+			<date value="1997.0" direction="forwards" units="years"/>
+		</taxon>
+	</taxa>
+
+	<!-- The sequence alignment (each sequence refers to a taxon above).         -->
+	<!-- ntax=21 nchar=1698                                                      -->
+	<alignment id="alignment" dataType="nucleotide">
+		<sequence>
+			<taxon idref="TREESPARROW_HENAN_1_2004"/>
+			ATGGAGAAAATAGTGCTTCTTCGTGCAATGATCAATCTTGTTAAAAGTGATCAGATTGGCGTTGGTTACCATGCAGACTACTCGACAGAGCAGGGTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCTCAAGACATATTGGAAAAGACACACAACGGGAAGCTCTGCGACCTAGATGGAGTGAAGCCTCTAATTTTGAAAGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCAATGTGTGACGAATTCATCAATGTGCCGGAGTGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTACCCAGGGGATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAAAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCGATCATGAAGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCTGGGGAAGCCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="HUMAN_VIETNAM_CL105_2005"/>
+			ATGGAGAAAATAGTGCTTCTTTTTGCGATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGCGATCTAGATGGAGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTACTCGGAAACCCAATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGTCAATCCAGTCAATGACCTCTGTTACCCAGGGGTTTTCAATGACTATGAAGAATTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAGTCATGAAGCCTCATTAGGGGTGAGCTCAGTATGTCCATACCAGGGAAAGTCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="TREESPARROW_HENAN_4_2004"/>
+			ATGGAGAAAATAGTGCTTCTTCTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGCAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGCGATCTAGATGGAGTGAAACCTCTAATTTTAAGAGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCAATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTACCCAGGGGATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCGATCATGAAGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCAGGGGAGTCCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="CHICKEN_HEBEI_326_2005"/>
+			ATGGAGAGAATAGTGCTTCTTCTTGCAATAATCGGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCTCAAGACATACTGGAGAAGACACACAACGGGAAGCTCTGCAACCCAGATGGAGTGAAGCCTCTAATTTTGAAAGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCAATGTGTGACGAATTTATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGGCCTCTGTTACCCAGGGGATTTCAATGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCGATCATGGAGCCTCATCAGGGGTGAGCTCAGCATGTTCCTATCTGGGGAAGCCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="CHICKEN_HONGKONG_915_1997"/>
+			ATGGAGAAAATAGTGCTTCTTCTTGCAACAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAATGTTACTGTTACACATGCCCAAGACATACTGGAAAGGACACACAACGGGAAGCTCTGCGATCTAAATGGAGTGAAACCTCTCATTTTGAGGGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCTATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTATCCAGGGAATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAATCATGATGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCTTGGGAGGTCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="VIETNAM_3062_2004"/>
+			ATGGAGAAAATAGTGCTTCTTTTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGCGATCTAGATGGAGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCAATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAATCCAGTCAATGACCTCTGTTACCCAGGGGATTTCAATGACTATGAAGAATTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAGTCATGAAGCCTCATTAGGAGTGAGCTCAGCATGTCCATACCAGGGAAAGTCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="GOOSE_HONGKONG_W355_1997"/>
+			ATGGAGAAAATAGTGCTTCTTCTTGCAACAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAATGTTACTGTTACACATGCCCAAGACATACTGGAAAGGACACACAACGGGAAGCTCTGCGATCTAAATGGAGTGAAACCTCTCATTTTGAGGGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCTATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTATCCAGGGAATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAATCATGATGCCTCATCAGGGGTTAGCTCAGCATGTCCATACCTTGGGAGGTCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="DUCK_HONGKONG_Y283_1997"/>
+			ATGGAGAAAATAGTGCTTCTTCTTGCAACAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAATGTTACTGTTACACATGCCCAAGACATACTGGAAAGGACACACAACGGGAAGCTCTGCGATCTAAATGGAGTGAAACCTCTCATTTTGAGGGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCTATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTATCCAGGGAATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAATCATGATGCCTCATCAGGGGTTAGCTCAGCATGTCCATACCTTGGGAGGTCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="DUCK_VIETNAM_376_2005"/>
+			ATGGAGAAAATAGTGCTTCTTTTTGCGATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCAACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGCGATCTAGATGGAGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCAATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAATCCAGTCAATGACCTCTGTTACCCAGGGGATTTCAATGACTATGAAGAATTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAGTCATGAAGCCTCATTAGGAGTGAGCTCAGCATGTCCATACCAGGGAAATCCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="MALLARD_VIETNAM_16_2003"/>
+			ATGGAGAAAATAGTGCTTCTTTTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGCGATCTAGATGGAGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCAATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAATCCAGTCAATGACCTCTGTTACCCAGGGGATTTCAATGAATATGAAGAATTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAGTCATGAAGCCTCATTAGGGGTGAGCTCAGCATGTCCATACCAGGGAAAGTCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="CHICKEN_THAILAND_KANCHANABURI_CK_160_2005"/>
+			ATGGAGAAAATAGTGCTTCTTTTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCAACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGTGATCTAGATGGAGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTCCTTGGAAACCCAATGTGTGATGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAATCCAGCCAATGACCTCTGTTACCCAGGGGATTTCAATGACTATGAAGAATTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAGTCATGAAGCCTCATTAGGAGTGAGCTCAGCATGTCCATATCAGGGAAAGTCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="DUCK_GUANGZHOU_20_2005"/>
+			ATGGAGAAAATAGTGCTTCTTCTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAATGGGAAGCTCTGCGACCTAGATGGGGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTCCTCGGGAACCCAATGTGTGACGAATTCATCAATGTACCGGAATGGTCTTACATAGTGGAGAAGGCCAATCCAGCCAATGACCTCTGTTACCCAGGTGATTTCAACGATTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAACCATGAATCCTCATCAGGGGTGAGCTCAGCATGTCCATACCTGGGAAAGCCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="CK_HK_WF157_2003"/>
+			ATGGAGAAAATAGTGCTTCTTCTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACCCACAACGGGAAGCTCTGCGACCTAGATGGAGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTCCTCGGGAACCCAATGTGTGACGAATTCATCAATGTACCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCATCCAATGACCTCTGTTACCCAGGGGATTTCAACAATTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGCTCTTGGTCCAATCATGAAGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCTGGGAAAGCCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="SWINE_ANHUI_2004"/>
+			ATGGAGAAAATAGTGCTTCTTCTTGCAATAGTCAGTCTTGTTAAAGGTGATCAGATTTGCACTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCTCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGCGACCTAGATGGAGTGAAGCCTCTAATTTTAAGAGATTGTAGTGTAGCTGGATGGCTCCTCGGGAACCCAATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAATCCAGCCAATGACCTCTGTTACCCAGGGGATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCGATCATGAAGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCAGGGAAGGTCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="DUCK_VIETNAM_272_2005"/>
+			ATGGAGAAAATAGTGCTTCTTTTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGCGATCTAGATGGAGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTCCTTGGAAATCCAATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAATCCAGTCAATGACCTCTGTTACCCAGGGGATTTCAATGACTATGAAGAATTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGCCCAGTCATGAAGCCTCATTAGGGGTGAGCTCAGCATGTCCATACCAGGGAAGGTCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="HONGKONG_1997_1998"/>
+			------------------------------------------------GACCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGATACAATAATGGAAAAGAATGTTACTGTTACACATGCCCAAGACATACTGGAAAGGACACACGACGGGAAGCTCTGCGATCTAAATGGAGTGAAACCTCTCATTTTGAGGGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCTATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTATCCAGGGAATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAATCATGATGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCTTGGGAGGTCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="GOOSE_SHANTOU_2216_2005"/>
+			ATGGAGAAAATAGTGCTTCTTCTTGCAATAATCAGCCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAATGGGAAGCTCTGCGACTTAGATGGGGTGAAGCCTCTAATTTTGAGAGACTGTAGTGTAGCTGGATGGCTCCTCGGGAACCCAATGTGTGACGAATTCATCAATGTACCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTACCCAGGTGATTTCAACGATTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAATCATGAAGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCTGGGAAAGCCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="TREESPARROW_HENAN_3_2004"/>
+			ATGGAGAAAATAGTGCTTCTTCTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACTATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGCGATCTAGATGGAGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCAATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTACCCAGGGGATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCGGATCATCCCCAAAAGTTCTTGGTCCAATCATGATGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCAGGGGAAGCCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="PEREGRINEFALCON_HK_D0028_2004"/>
+			ATGGAGAAAATAGTGCTTCTTCTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAATGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAATGGGAAGCTCTGTGACCTAGATGGGGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTCGCTGGATGGCTCCTCGGGAACCCAATGTGTGACGAATTCATCAATGTACCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTACCCAGGTGATTTCAACGATTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAATCATGAAGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCTGGGAAAGCCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="TREESPARROW_HENAN_2_2004"/>
+			ATGGAGAAAATAGTGCTTCTTCTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCTCAAGACATATTGGAAAAGACACACAACGGGAAGCTCTGCGACCTAGATGGAGTGAAGCCTCTAATTTTGAAAGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCAATGTGTGACGAATTCATCAATGTGCCGGAGTGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTACCCAGGGGATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAAAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCGATCATGAAGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCTGGGGAAGCCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="HONGKONG_538_1997"/>
+			------------------------------------------------GATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAATGTTACTGTTACACATGCCCAAGACATACTGGAAAGGACACACAACGGGAAGCTCTGCGATCTAAATGGAGTGAAACCTCTCATTTTGAGGGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCTATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTATCCAGGGAATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAATCATGATGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCTTGGGAGGTCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+	</alignment>
+    
+    <patterns id="patterns" from="1">
+        <alignment idref="alignment"/>
+    </patterns>
+
+    <!-- A prior assumption that the population size has remained constant       -->
+    <!-- throughout the time spanned by the genealogy.                           -->
+    <constantSize id="constant" units="years">
+        <populationSize>
+            <parameter id="constant.popSize" value="380.0" lower="0.0" upper="38000.0"/>
+        </populationSize>
+    </constantSize>
+
+    <!-- Generate a random starting tree under the coalescent process            -->
+    <coalescentTree id="startingTree">
+        <taxa idref="taxa"/>
+        <constantSize idref="constant"/>
+    </coalescentTree>
+
+    <treeModel id="treeModel">
+        <coalescentTree idref="startingTree"/>
+        <rootHeight>
+            <parameter id="treeModel.rootHeight"/>
+        </rootHeight>
+        <nodeHeights internalNodes="true">
+            <parameter id="treeModel.internalNodeHeights"/>
+        </nodeHeights>
+        <nodeHeights internalNodes="true" rootNode="true">
+            <parameter id="treeModel.allInternalNodeHeights"/>
+        </nodeHeights>
+    </treeModel>
+
+    <coalescentLikelihood id="coalescent">
+        <model>
+            <constantSize idref="constant"/>
+        </model>
+        <populationTree>
+            <treeModel idref="treeModel"/>
+        </populationTree>
+    </coalescentLikelihood>
+
+    <!-- The strict clock (Uniform rates across branches)                        -->
+    <strictClockBranchRates id="branchRates">
+        <rate>
+            <parameter id="clock.rate" value="4.0E-4" lower="0.0" upper="100.0"/>
+        </rate>
+    </strictClockBranchRates>
+
+
+    <!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+    <hkyModel id="hky">
+        <frequencies>
+            <frequencyModel dataType="nucleotide">
+                <alignment idref="alignment"/>
+                <frequencies>
+                    <parameter id="hky.frequencies" dimension="4"/>
+                </frequencies>
+            </frequencyModel>
+        </frequencies>
+        <kappa>
+            <parameter id="hky.kappa" value="2.0" lower="0.0" upper="100.0"/>
+        </kappa>
+    </hkyModel>
+
+    <!-- site model                                                              -->
+    <siteModel id="siteModel">
+        <substitutionModel>
+            <hkyModel idref="hky"/>
+        </substitutionModel>
+        <gammaShape gammaCategories="4">
+            <parameter id="siteModel.alpha" value="0.05" lower="0.0" upper="100.0"/>
+        </gammaShape>
+    </siteModel>
+
+    <treeLikelihood id="treeLikelihood">
+        <patterns idref="patterns"/>
+        <treeModel idref="treeModel"/>
+        <siteModel idref="siteModel"/>
+        <strictClockBranchRates idref="branchRates"/>
+    </treeLikelihood>
+
+    <operators id="operators">
+        <scaleOperator scaleFactor="0.75" weight="1">
+            <parameter idref="hky.kappa"/>
+        </scaleOperator>
+        <scaleOperator scaleFactor="0.75" weight="1">
+            <parameter idref="siteModel.alpha"/>
+        </scaleOperator>
+        <scaleOperator scaleFactor="0.75" weight="3">
+            <parameter idref="clock.rate"/>
+        </scaleOperator>
+        <upDownOperator scaleFactor="0.75" weight="3">
+            <up>
+                <parameter idref="clock.rate"/>
+            </up>
+            <down>
+                <parameter idref="treeModel.allInternalNodeHeights"/>
+            </down>
+        </upDownOperator>
+        <scaleOperator scaleFactor="0.75" weight="3">
+            <parameter idref="constant.popSize"/>
+        </scaleOperator>
+        <scaleOperator scaleFactor="0.75" weight="3">
+            <parameter idref="treeModel.rootHeight"/>
+        </scaleOperator>
+        <uniformOperator weight="30">
+            <parameter idref="treeModel.internalNodeHeights"/>
+        </uniformOperator>
+        <subtreeSlide size="1.0" gaussian="true" weight="15">
+            <treeModel idref="treeModel"/>
+        </subtreeSlide>
+        <narrowExchange weight="15">
+            <treeModel idref="treeModel"/>
+        </narrowExchange>
+        <wideExchange weight="3">
+            <treeModel idref="treeModel"/>
+        </wideExchange>
+        <wilsonBalding weight="3">
+            <treeModel idref="treeModel"/>
+        </wilsonBalding>
+    </operators>
+
+    <mcmc id="mcmc" chainLength="2000000" autoOptimize="true">
+        <posterior id="posterior">            
+                <coalescentLikelihood idref="coalescent"/>                       
+                <treeLikelihood idref="treeLikelihood"/>
+        </posterior>
+        <operators idref="operators"/>
+        <log id="screenLog" logEvery="10000">
+            <column label="Posterior" dp="4" width="12">
+                <posterior idref="posterior"/>
+            </column>
+            <column label="Root Height" sf="6" width="12">
+                <parameter idref="treeModel.rootHeight"/>
+            </column>
+            <column label="L(tree)" dp="4" width="12">
+                <treeLikelihood idref="treeLikelihood"/>
+            </column>
+            <column label="L(coalecent)" dp="4" width="12">
+                <coalescentLikelihood idref="coalescent"/>
+            </column>
+        </log>
+        <log id="fileLog" logEvery="500" fileName="testSiteModelAlpha.log">
+            <posterior idref="posterior"/>
+            <parameter idref="clock.rate"/>
+            <parameter idref="constant.popSize"/>
+            <parameter idref="hky.kappa"/>
+            <parameter idref="siteModel.alpha"/>
+            <parameter idref="treeModel.rootHeight"/>
+            <treeLikelihood idref="treeLikelihood"/>
+            <coalescentLikelihood idref="coalescent"/>
+        </log>
+    </mcmc>
+
+    <report>
+        <property name="timer">
+            <object idref="mcmc"/>
+        </property>
+    </report>
+
+</beast>
diff --git a/examples/beast2vs1/beast1/testStarBEASTConstant.xml b/examples/beast2vs1/beast1/testStarBEASTConstant.xml
new file mode 100644
index 0000000..e1502ea
--- /dev/null
+++ b/examples/beast2vs1/beast1/testStarBEASTConstant.xml
@@ -0,0 +1,707 @@
+<?xml version="1.0" standalone="yes"?>
+
+<!-- Generated by BEAUTi v1.6.1                                              -->
+<!--       by Alexei J. Drummond and Andrew Rambaut                          -->
+<!--       Department of Computer Science, University of Auckland and        -->
+<!--       Institute of Evolutionary Biology, University of Edinburgh        -->
+<!--       http://beast.bio.ed.ac.uk/                                        -->
+<beast>
+
+	<!-- The list of taxa analyse (can also include dates/ages).                 -->
+	<!-- ntax=26                                                                 -->
+	<taxa id="taxa">
+		<taxon id="Orthogeomys_heterodus"/>
+		<taxon id="Thomomys_bottae_awahnee_a"/>
+		<taxon id="Thomomys_bottae_awahnee_b"/>
+		<taxon id="Thomomys_bottae_xerophilus"/>
+		<taxon id="Thomomys_bottae_cactophilus"/>
+		<taxon id="Thomomys_bottae_albatus"/>
+		<taxon id="Thomomys_bottae_ruidosae"/>
+		<taxon id="Thomomys_bottae_bottae"/>
+		<taxon id="Thomomys_bottae_alpinus"/>
+		<taxon id="Thomomys_bottae_riparius"/>
+		<taxon id="Thomomys_bottae_mewa"/>
+		<taxon id="Thomomys_bottae_saxatilis"/>
+		<taxon id="Thomomys_bottae_laticeps"/>
+		<taxon id="Thomomys_talpoides_ocius"/>
+		<taxon id="Thomomys_idahoensis_pygmaeus_a"/>
+		<taxon id="Thomomys_idahoensis_pygmaeus_b"/>
+		<taxon id="Thomomys_mazama_mazama"/>
+		<taxon id="Thomomys_mazama_nasicus"/>
+		<taxon id="Thomomys_monticola_a"/>
+		<taxon id="Thomomys_monticola_b"/>
+		<taxon id="Thomomys_talpoides_yakimensis"/>
+		<taxon id="Thomomys_talpoides_bridgeri"/>
+		<taxon id="Thomomys_townsendii_townsendii"/>
+		<taxon id="Thomomys_townsendii_relictus"/>
+		<taxon id="Thomomys_umbrinus_chihuahuae"/>
+		<taxon id="Thomomys_umbrinus_atroavarius"/>
+	</taxa>
+
+	<!-- The sequence alignment (each sequence refers to a taxon above).         -->
+	<!-- ntax=26 nchar=614                                                       -->
+	<alignment id="alignment1" dataType="nucleotide">
+		<sequence>
+			<taxon idref="Orthogeomys_heterodus"/>
+			ATTCTAGGCAAAAAG-AGCAATGCTGGAGGTATTACAATACCAGACTTCAAACTTTACTATAGAGCCATAATAACAAAAACCGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAATGGAAYAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGTCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCACCATGCACAGGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCAGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGGGAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATAGGAGAAAGACTCAATAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_awahnee_a"/>
+			????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACMCAGTCTATTCAATTATTGGKGCTGGCAAAACTGGGCAGCCMCATGCARAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAA???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_awahnee_b"/>
+			????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCM-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_xerophilus"/>
+			????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAAYTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAA???????????????????????????????????????????????????????????????????????????? [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_cactophilus"/>
+			????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAAYGTCAGACCGGAAACCGTGAAAYTGTTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAA??????????????????????????????????????????????????????????????????????????????????????? [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_albatus"/>
+			????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGATCCAGAAATAGAACCAC-ATACCTATAGTCAACTTGTATTTGATAAAGGAGCTAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCATTTCACCATGCACAAGAATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCT-------------------------------------CATAGGCACTCATAGGCACAGGCAAAAGATTCCTATACAGGAACCCAGGGTCAACAACAGATTGGAGAGAGACTCAATAAATGGGACTACCTAAAAATAAAA-GTTTCTGCAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_ruidosae"/>
+			????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCARAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAAYTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAG????????????????????????????????????????????????????????????????????????????????????? [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_bottae"/>
+			????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAAATTCCTGAACAGAATCCCAGGGTCA-CAACAGATKGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_alpinus"/>
+			????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCTATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCA????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_riparius"/>
+			????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_mewa"/>
+			????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCATTTCACCATGCACAAGAATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAA?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_saxatilis"/>
+			????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAA???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_laticeps"/>
+			????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAATTGCTACATGATAAWGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCAATAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_talpoides_ocius"/>
+			???CTAGGCAAAA-G-AGC-ATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATMCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCRACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_idahoensis_pygmaeus_a"/>
+			????????CAAAA-G-AGCAATGCTGGTGGTATYACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATMCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCRACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_idahoensis_pygmaeus_b"/>
+			????GGCGCAAAA-G-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATMCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_mazama_mazama"/>
+			ATTCTAGGCAAAAAGAAGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAAYTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_mazama_nasicus"/>
+			ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCSCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAAYTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_monticola_a"/>
+			??????????????G-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGYCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_monticola_b"/>
+			ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATYACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAWATAGAACCAC-ACAACTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAATGGAACRAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_talpoides_yakimensis"/>
+			ATTCTAGGCAAAA-G-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTKTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAAYGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAAYTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_talpoides_bridgeri"/>
+			ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATCCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCRACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_townsendii_townsendii"/>
+			ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTYGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_townsendii_relictus"/>
+			??????????????G-AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTAYTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCACTATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAATGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAATTGCTACATGATAAWGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAATGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_umbrinus_chihuahuae"/>
+			?????????????AG-AGC-ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCTTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_umbrinus_atroavarius"/>
+			ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGCATTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGKCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGYCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAAYGTCAGACCGGAAACCGTGAAATTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+	</alignment>
+
+	<!-- The sequence alignment (each sequence refers to a taxon above).         -->
+	<!-- ntax=26 nchar=601                                                       -->
+	<alignment id="alignment2" dataType="nucleotide">
+		<sequence>
+			<taxon idref="Orthogeomys_heterodus"/>
+			C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCACAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCGTTTCTGGAAAACTGAGATCTTGTTTTGACCAACAGAAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTACTGGTGATGTCTCTGTCAGGATCTAGTCCCATCCTG-AATCCATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTCAGAACTGACTGAATCAGGCCAGTGAAAGTTA-CAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATTGTGCATGGCTTCATTAGCAGGTTTACTGTGCTGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_awahnee_a"/>
+			C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_awahnee_b"/>
+			C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_xerophilus"/>
+			C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCACTAAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTRTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_cactophilus"/>
+			C-AGCTTGCTG-TCACACTACCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCACTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_albatus"/>
+			C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_ruidosae"/>
+			?????????????????????????????C-AGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_bottae"/>
+			C-AGCTTGCTG-TCACACYGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTAKGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_alpinus"/>
+			C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCC-AGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGTTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCYACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_riparius"/>
+			C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_mewa"/>
+			C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_saxatilis"/>
+			C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_laticeps"/>
+			C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_talpoides_ocius"/>
+			C-AGCTTGCTGGTCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCATATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAAWGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_idahoensis_pygmaeus_a"/>
+			C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTTTAAGTGTTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGTCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGTCCAGTGAAACTTAACAGCTACCTTGCCAATKGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGG--TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_idahoensis_pygmaeus_b"/>
+			CAAGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTGTTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGTCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGG--TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_mazama_mazama"/>
+			C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTATTGCCTGGATATAGTGTCTATAGACAGAGACAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCACATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCACCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCTGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_mazama_nasicus"/>
+			C-AGCTTGCTG-TCACAATGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTATTGCCTGGATATAGTGTCTATAGACAGAGACAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCACATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCTGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_monticola_a"/>
+			C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGACGCCKTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_monticola_b"/>
+			C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGACGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTYCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_talpoides_yakimensis"/>
+			C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGAMTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_talpoides_bridgeri"/>
+			C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_townsendii_townsendii"/>
+			C-AGCTTGCTGGTCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_townsendii_relictus"/>
+			C-AGCTTGCTGGTCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_umbrinus_chihuahuae"/>
+			C-AGCTTGCTGGTCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAAGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTGGAATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_umbrinus_atroavarius"/>
+			C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+	</alignment>
+
+	<!-- The unique patterns from 1 to end                                       -->
+	<!-- npatterns=144                                                           -->
+	<patterns id="26.patterns" from="1">
+		<alignment idref="alignment1"/>
+	</patterns>
+
+	<!-- The unique patterns from 1 to end                                       -->
+	<!-- npatterns=71                                                            -->
+	<patterns id="29.patterns" from="1">
+		<alignment idref="alignment2"/>
+	</patterns>
+
+	<!-- A prior assumption that the population size has remained constant       -->
+
+	<!-- throughout the time spanned by the genealogy.                           -->
+	<constantSize id="constant" units="substitutions">
+		<populationSize>
+			<parameter id="constant.popSize" value="0.016" lower="0.0" upper="Infinity"/>
+		</populationSize>
+	</constantSize>
+
+	<!-- Generate a random starting tree under the coalescent process            -->
+	<coalescentTree id="26.startingTree" rootHeight="0.017">
+		<taxa idref="taxa"/>
+		<constantSize idref="constant"/>
+	</coalescentTree>
+
+	<!-- Generate a random starting tree under the coalescent process            -->
+	<coalescentTree id="29.startingTree" rootHeight="0.016">
+		<taxa idref="taxa"/>
+		<constantSize idref="constant"/>
+	</coalescentTree>
+
+	<!-- Generate a tree model                                                   -->
+	<treeModel id="26.treeModel">
+		<coalescentTree idref="26.startingTree"/>
+		<rootHeight>
+			<parameter id="26.treeModel.rootHeight"/>
+		</rootHeight>
+		<nodeHeights internalNodes="true">
+			<parameter id="26.treeModel.internalNodeHeights"/>
+		</nodeHeights>
+		<nodeHeights internalNodes="true" rootNode="true">
+			<parameter id="26.treeModel.allInternalNodeHeights"/>
+		</nodeHeights>
+	</treeModel>
+
+	<!-- Generate a tree model                                                   -->
+	<treeModel id="29.treeModel">
+		<coalescentTree idref="29.startingTree"/>
+		<rootHeight>
+			<parameter id="29.treeModel.rootHeight"/>
+		</rootHeight>
+		<nodeHeights internalNodes="true">
+			<parameter id="29.treeModel.internalNodeHeights"/>
+		</nodeHeights>
+		<nodeHeights internalNodes="true" rootNode="true">
+			<parameter id="29.treeModel.allInternalNodeHeights"/>
+		</nodeHeights>
+	</treeModel>
+
+	<!-- The strict clock (Uniform rates across branches)                        -->
+	<strictClockBranchRates id="26.branchRates">
+		<rate>
+			<parameter id="26.clock.rate" value="1.0"/>
+		</rate>
+	</strictClockBranchRates>
+
+	<!-- The strict clock (Uniform rates across branches)                        -->
+	<strictClockBranchRates id="29.branchRates">
+		<rate>
+			<parameter id="29.clock.rate" value="1.0"/>
+		</rate>
+	</strictClockBranchRates>
+
+	<!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+	<HKYModel id="26.hky">
+		<frequencies>
+			<frequencyModel dataType="nucleotide">
+				<alignment idref="alignment1"/>
+				<frequencies>
+					<parameter id="26.frequencies" dimension="4"/>
+				</frequencies>
+			</frequencyModel>
+		</frequencies>
+		<kappa>
+			<parameter id="26.kappa" value="2.0" lower="0.0" upper="Infinity"/>
+		</kappa>
+	</HKYModel>
+
+	<!-- site model                                                              -->
+	<siteModel id="26.siteModel">
+		<substitutionModel>
+			<HKYModel idref="26.hky"/>
+		</substitutionModel>
+	</siteModel>
+
+	<!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+	<HKYModel id="29.hky">
+		<frequencies>
+			<frequencyModel dataType="nucleotide">
+				<alignment idref="alignment2"/>
+				<frequencies>
+					<parameter id="29.frequencies" dimension="4"/>
+				</frequencies>
+			</frequencyModel>
+		</frequencies>
+		<kappa>
+			<parameter id="29.kappa" value="2.0" lower="0.0" upper="Infinity"/>
+		</kappa>
+	</HKYModel>
+
+	<!-- site model                                                              -->
+	<siteModel id="29.siteModel">
+		<substitutionModel>
+			<HKYModel idref="29.hky"/>
+		</substitutionModel>
+	</siteModel>
+	<treeLikelihood id="26.treeLikelihood" useAmbiguities="false">
+		<patterns idref="26.patterns"/>
+		<treeModel idref="26.treeModel"/>
+		<siteModel idref="26.siteModel"/>
+		<strictClockBranchRates idref="26.branchRates"/>
+	</treeLikelihood>
+	<treeLikelihood id="29.treeLikelihood" useAmbiguities="false">
+		<patterns idref="29.patterns"/>
+		<treeModel idref="29.treeModel"/>
+		<siteModel idref="29.siteModel"/>
+		<strictClockBranchRates idref="29.branchRates"/>
+	</treeLikelihood>
+
+	<!-- Species definition: binds taxa, species and gene trees                  -->
+	<species id="species">
+		<sp id="Orthogeomys_heterodus_species">
+			<taxon idref="Orthogeomys_heterodus"/>
+		</sp>
+		<sp id="Thomomys_bottae">
+			<taxon idref="Thomomys_bottae_awahnee_a"/>
+			<taxon idref="Thomomys_bottae_awahnee_b"/>
+			<taxon idref="Thomomys_bottae_xerophilus"/>
+			<taxon idref="Thomomys_bottae_cactophilus"/>
+			<taxon idref="Thomomys_bottae_albatus"/>
+			<taxon idref="Thomomys_bottae_ruidosae"/>
+			<taxon idref="Thomomys_bottae_bottae"/>
+			<taxon idref="Thomomys_bottae_alpinus"/>
+			<taxon idref="Thomomys_bottae_riparius"/>
+			<taxon idref="Thomomys_bottae_mewa"/>
+			<taxon idref="Thomomys_bottae_saxatilis"/>
+			<taxon idref="Thomomys_bottae_laticeps"/>
+		</sp>
+		<sp id="Thomomys_talpoides">
+			<taxon idref="Thomomys_talpoides_ocius"/>
+			<taxon idref="Thomomys_talpoides_yakimensis"/>
+			<taxon idref="Thomomys_talpoides_bridgeri"/>
+		</sp>
+		<sp id="Thomomys_idahoensis">
+			<taxon idref="Thomomys_idahoensis_pygmaeus_a"/>
+			<taxon idref="Thomomys_idahoensis_pygmaeus_b"/>
+		</sp>
+		<sp id="Thomomys_mazama">
+			<taxon idref="Thomomys_mazama_mazama"/>
+			<taxon idref="Thomomys_mazama_nasicus"/>
+		</sp>
+		<sp id="Thomomys_monticola">
+			<taxon idref="Thomomys_monticola_a"/>
+			<taxon idref="Thomomys_monticola_b"/>
+		</sp>
+		<sp id="Thomomys_townsendii">
+			<taxon idref="Thomomys_townsendii_townsendii"/>
+			<taxon idref="Thomomys_townsendii_relictus"/>
+		</sp>
+		<sp id="Thomomys_umbrinus">
+			<taxon idref="Thomomys_umbrinus_chihuahuae"/>
+			<taxon idref="Thomomys_umbrinus_atroavarius"/>
+		</sp>
+
+		<!-- Collection of Gene Trees                                                -->
+		<geneTrees id="geneTrees">
+			<treeModel idref="26.treeModel"/>
+			<treeModel idref="29.treeModel"/>
+		</geneTrees>
+	</species>
+
+	<!-- Species Tree: Provides Per branch demographic function                  -->
+	<speciesTree id="sptree" constantPopulation="true">
+		<species idref="species"/>
+		<sppSplitPopulations value="0.016">
+			<parameter id="speciesTree.splitPopSize"/>
+		</sppSplitPopulations>
+	</speciesTree>
+
+	<!-- Species Tree: tree prior                                                -->
+
+	<!-- Species Tree: Yule Model                                                -->
+	<yuleModel id="yule" units="substitutions">
+		<birthRate>
+			<parameter id="species.yule.birthRate" value="1.0" lower="0.0" upper="Infinity"/>
+		</birthRate>
+	</yuleModel>
+
+	<!-- Species Tree: Likelihood of species tree                                -->
+
+	<!-- Species Tree: Yule Model                                                -->
+	<speciationLikelihood id="speciation.likelihood">
+		<model>
+			<yuleModel idref="yule"/>
+		</model>
+		<speciesTree>
+			<speciesTree idref="sptree"/>
+		</speciesTree>
+	</speciationLikelihood>
+
+	<!-- Species Tree: tmrcaStatistic                                            -->
+	<tmrcaStatistic id="speciesTree.rootHeight" name="speciesTree.rootHeight">
+		<speciesTree idref="sptree"/>
+		<mrca>
+			<taxa>
+				<sp idref="Orthogeomys_heterodus_species"/>
+				<sp idref="Thomomys_bottae"/>
+				<sp idref="Thomomys_talpoides"/>
+				<sp idref="Thomomys_idahoensis"/>
+				<sp idref="Thomomys_mazama"/>
+				<sp idref="Thomomys_monticola"/>
+				<sp idref="Thomomys_townsendii"/>
+				<sp idref="Thomomys_umbrinus"/>
+			</taxa>
+		</mrca>
+	</tmrcaStatistic>
+
+	<!-- Species Tree: Coalescent likelihood for gene trees under species tree   -->
+	<speciesCoalescent id="species.coalescent">
+		<species idref="species"/>
+		<speciesTree idref="sptree"/>
+	</speciesCoalescent>
+
+	<!-- Species tree prior: gama2 + gamma4                                      -->
+	<mixedDistributionLikelihood id="species.popSizesLikelihood">
+		<distribution0>
+			<gammaDistributionModel>
+				<shape>
+					2
+				</shape>
+				<scale>
+					<parameter id="species.popMean" value="0.016" lower="0.0" upper="Infinity"/>
+				</scale>
+			</gammaDistributionModel>
+		</distribution0>
+		<distribution1>
+			<gammaDistributionModel>
+				<shape>
+					4
+				</shape>
+				<scale>
+					<parameter idref="species.popMean"/>
+				</scale>
+			</gammaDistributionModel>
+		</distribution1>
+		<data>
+			<parameter idref="speciesTree.splitPopSize"/>
+		</data>
+		<indicators>
+			<parameter value="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"/>
+		</indicators>
+	</mixedDistributionLikelihood>
+
+	<!-- Define operators                                                        -->
+	<operators id="operators">
+		<scaleOperator scaleFactor="0.75" weight="0.1">
+			<parameter idref="26.kappa"/>
+		</scaleOperator>
+		<scaleOperator scaleFactor="0.75" weight="0.1">
+			<parameter idref="29.kappa"/>
+		</scaleOperator>
+		<upDownOperator scaleFactor="0.75" weight="30">
+			<up>
+				<parameter idref="species.yule.birthRate"/>
+			</up>
+			<down>
+				<speciesTree idref="sptree"/>
+				<parameter idref="species.popMean"/>
+				<parameter idref="speciesTree.splitPopSize"/>
+				<parameter idref="26.treeModel.allInternalNodeHeights"/>
+				<parameter idref="29.treeModel.allInternalNodeHeights"/>
+			</down>
+		</upDownOperator>
+		<subtreeSlide size="0.0017000000000000001" gaussian="true" weight="15">
+			<treeModel idref="26.treeModel"/>
+		</subtreeSlide>
+		<narrowExchange weight="15">
+			<treeModel idref="26.treeModel"/>
+		</narrowExchange>
+		<wideExchange weight="3">
+			<treeModel idref="26.treeModel"/>
+		</wideExchange>
+		<wilsonBalding weight="3">
+			<treeModel idref="26.treeModel"/>
+		</wilsonBalding>
+		<scaleOperator scaleFactor="0.75" weight="3">
+			<parameter idref="26.treeModel.rootHeight"/>
+		</scaleOperator>
+		<uniformOperator weight="30">
+			<parameter idref="26.treeModel.internalNodeHeights"/>
+		</uniformOperator>
+		<subtreeSlide size="0.0016" gaussian="true" weight="15">
+			<treeModel idref="29.treeModel"/>
+		</subtreeSlide>
+		<narrowExchange weight="15">
+			<treeModel idref="29.treeModel"/>
+		</narrowExchange>
+		<wideExchange weight="3">
+			<treeModel idref="29.treeModel"/>
+		</wideExchange>
+		<wilsonBalding weight="3">
+			<treeModel idref="29.treeModel"/>
+		</wilsonBalding>
+		<scaleOperator scaleFactor="0.75" weight="3">
+			<parameter idref="29.treeModel.rootHeight"/>
+		</scaleOperator>
+		<uniformOperator weight="30">
+			<parameter idref="29.treeModel.internalNodeHeights"/>
+		</uniformOperator>
+		<upDownOperator scaleFactor="0.75" weight="3">
+			<up>
+			</up>
+			<down>
+				<parameter idref="26.treeModel.allInternalNodeHeights"/>
+			</down>
+		</upDownOperator>
+		<upDownOperator scaleFactor="0.75" weight="3">
+			<up>
+			</up>
+			<down>
+				<parameter idref="29.treeModel.allInternalNodeHeights"/>
+			</down>
+		</upDownOperator>
+		<scaleOperator scaleFactor="0.9" weight="5">
+			<parameter idref="species.popMean"/>
+		</scaleOperator>
+		<scaleOperator scaleFactor="0.75" weight="3">
+			<parameter idref="species.yule.birthRate"/>
+		</scaleOperator>
+		<scaleOperator scaleFactor="0.5" weight="94">
+			<parameter idref="speciesTree.splitPopSize"/>
+		</scaleOperator>
+		<nodeReHeight weight="94">
+			<species idref="species"/>
+			<speciesTree idref="sptree"/>
+		</nodeReHeight>
+	</operators>
+
+	<!-- Define MCMC                                                             -->
+	<mcmc id="mcmc" chainLength="10000000" autoOptimize="true">
+		<posterior id="posterior">
+			<prior id="prior">
+				<speciesCoalescent idref="species.coalescent"/>
+				<mixedDistributionLikelihood idref="species.popSizesLikelihood"/>
+				<speciationLikelihood idref="speciation.likelihood"/>
+				<logNormalPrior mean="1.0" stdev="1.25" offset="0.0" meanInRealSpace="false">
+					<parameter idref="26.kappa"/>
+				</logNormalPrior>
+				<logNormalPrior mean="1.0" stdev="1.25" offset="0.0" meanInRealSpace="false">
+					<parameter idref="29.kappa"/>
+				</logNormalPrior>
+				<oneOnXPrior>
+					<parameter idref="species.popMean"/>
+				</oneOnXPrior>
+				<oneOnXPrior>
+					<parameter idref="species.yule.birthRate"/>
+				</oneOnXPrior>
+			</prior>
+			<likelihood id="likelihood">
+				<treeLikelihood idref="26.treeLikelihood"/>
+				<treeLikelihood idref="29.treeLikelihood"/>
+			</likelihood>
+		</posterior>
+		<operators idref="operators"/>
+
+		<!-- write log to screen                                                     -->
+		<log id="screenLog" logEvery="1000">
+			<column label="Posterior" dp="4" width="12">
+				<posterior idref="posterior"/>
+			</column>
+			<column label="Prior" dp="4" width="12">
+				<prior idref="prior"/>
+			</column>
+			<column label="Likelihood" dp="4" width="12">
+				<likelihood idref="likelihood"/>
+			</column>
+			<column label="PopMean" dp="4" width="12">
+				<parameter idref="species.popMean"/>
+			</column>
+			<column label="26.rootHeight" sf="6" width="12">
+				<parameter idref="26.treeModel.rootHeight"/>
+			</column>
+			<column label="29.rootHeight" sf="6" width="12">
+				<parameter idref="29.treeModel.rootHeight"/>
+			</column>
+			<column label="26.clock.rate" sf="6" width="12">
+				<parameter idref="26.clock.rate"/>
+			</column>
+			<column label="29.clock.rate" sf="6" width="12">
+				<parameter idref="29.clock.rate"/>
+			</column>
+		</log>
+
+		<!-- write log to file                                                       -->
+		<log id="fileLog" logEvery="1000" fileName="StarBEASTLog.log" overwrite="false">
+			<posterior idref="posterior"/>
+			<prior idref="prior"/>
+			<likelihood idref="likelihood"/>
+			<speciesCoalescent idref="species.coalescent"/>
+			<mixedDistributionLikelihood idref="species.popSizesLikelihood"/>
+			<speciationLikelihood idref="speciation.likelihood"/>
+			<parameter idref="species.popMean"/>
+			<parameter idref="speciesTree.splitPopSize"/>
+			<parameter idref="species.yule.birthRate"/>
+			<tmrcaStatistic idref="speciesTree.rootHeight"/>
+			<parameter idref="26.treeModel.rootHeight"/>
+			<parameter idref="29.treeModel.rootHeight"/>
+			<parameter idref="26.kappa"/>
+			<parameter idref="29.kappa"/>
+			<parameter idref="26.clock.rate"/>
+			<parameter idref="29.clock.rate"/>
+			<treeLikelihood idref="26.treeLikelihood"/>
+			<treeLikelihood idref="29.treeLikelihood"/>
+		</log>
+
+		<!-- write tree log to file                                                  -->
+		<logTree id="species.treeFileLog" logEvery="1000" nexusFormat="true" fileName="StarBEASTLog.species.trees" sortTranslationTable="true">
+			<speciesTree idref="sptree"/>
+			<posterior idref="posterior"/>
+		</logTree>
+		<logTree id="26.treeFileLog" logEvery="1000" nexusFormat="true" fileName="StarBEASTLog.26.trees" sortTranslationTable="true">
+			<treeModel idref="26.treeModel"/>
+			<strictClockBranchRates idref="26.branchRates"/>
+			<posterior idref="posterior"/>
+		</logTree>
+		<logTree id="29.treeFileLog" logEvery="1000" nexusFormat="true" fileName="StarBEASTLog.29.trees" sortTranslationTable="true">
+			<treeModel idref="29.treeModel"/>
+			<strictClockBranchRates idref="29.branchRates"/>
+			<posterior idref="posterior"/>
+		</logTree>
+	</mcmc>
+	<report>
+		<property name="timer">
+			<mcmc idref="mcmc"/>
+		</property>
+	</report>
+</beast>
diff --git a/examples/beast2vs1/beast1/testStarBEASTLinear.xml b/examples/beast2vs1/beast1/testStarBEASTLinear.xml
new file mode 100644
index 0000000..1ab6bd1
--- /dev/null
+++ b/examples/beast2vs1/beast1/testStarBEASTLinear.xml
@@ -0,0 +1,707 @@
+<?xml version="1.0" standalone="yes"?>
+
+<!-- Generated by BEAUTi v1.6.1                                              -->
+<!--       by Alexei J. Drummond and Andrew Rambaut                          -->
+<!--       Department of Computer Science, University of Auckland and        -->
+<!--       Institute of Evolutionary Biology, University of Edinburgh        -->
+<!--       http://beast.bio.ed.ac.uk/                                        -->
+<beast>
+
+	<!-- The list of taxa analyse (can also include dates/ages).                 -->
+	<!-- ntax=26                                                                 -->
+	<taxa id="taxa">
+		<taxon id="Orthogeomys_heterodus"/>
+		<taxon id="Thomomys_bottae_awahnee_a"/>
+		<taxon id="Thomomys_bottae_awahnee_b"/>
+		<taxon id="Thomomys_bottae_xerophilus"/>
+		<taxon id="Thomomys_bottae_cactophilus"/>
+		<taxon id="Thomomys_bottae_albatus"/>
+		<taxon id="Thomomys_bottae_ruidosae"/>
+		<taxon id="Thomomys_bottae_bottae"/>
+		<taxon id="Thomomys_bottae_alpinus"/>
+		<taxon id="Thomomys_bottae_riparius"/>
+		<taxon id="Thomomys_bottae_mewa"/>
+		<taxon id="Thomomys_bottae_saxatilis"/>
+		<taxon id="Thomomys_bottae_laticeps"/>
+		<taxon id="Thomomys_talpoides_ocius"/>
+		<taxon id="Thomomys_idahoensis_pygmaeus_a"/>
+		<taxon id="Thomomys_idahoensis_pygmaeus_b"/>
+		<taxon id="Thomomys_mazama_mazama"/>
+		<taxon id="Thomomys_mazama_nasicus"/>
+		<taxon id="Thomomys_monticola_a"/>
+		<taxon id="Thomomys_monticola_b"/>
+		<taxon id="Thomomys_talpoides_yakimensis"/>
+		<taxon id="Thomomys_talpoides_bridgeri"/>
+		<taxon id="Thomomys_townsendii_townsendii"/>
+		<taxon id="Thomomys_townsendii_relictus"/>
+		<taxon id="Thomomys_umbrinus_chihuahuae"/>
+		<taxon id="Thomomys_umbrinus_atroavarius"/>
+	</taxa>
+
+	<!-- The sequence alignment (each sequence refers to a taxon above).         -->
+	<!-- ntax=26 nchar=614                                                       -->
+	<alignment id="alignment1" dataType="nucleotide">
+		<sequence>
+			<taxon idref="Orthogeomys_heterodus"/>
+			ATTCTAGGCAAAAAG-AGCAATGCTGGAGGTATTACAATACCAGACTTCAAACTTTACTATAGAGCCATAATAACAAAAACCGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAATGGAAYAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGTCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCACCATGCACAGGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCAGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGGGAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATAGGAGAAAGACTCAATAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_awahnee_a"/>
+			????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACMCAGTCTATTCAATTATTGGKGCTGGCAAAACTGGGCAGCCMCATGCARAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAA???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_awahnee_b"/>
+			????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCM-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_xerophilus"/>
+			????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAAYTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAA???????????????????????????????????????????????????????????????????????????? [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_cactophilus"/>
+			????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAAYGTCAGACCGGAAACCGTGAAAYTGTTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAA??????????????????????????????????????????????????????????????????????????????????????? [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_albatus"/>
+			????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGATCCAGAAATAGAACCAC-ATACCTATAGTCAACTTGTATTTGATAAAGGAGCTAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCATTTCACCATGCACAAGAATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCT-------------------------------------CATAGGCACTCATAGGCACAGGCAAAAGATTCCTATACAGGAACCCAGGGTCAACAACAGATTGGAGAGAGACTCAATAAATGGGACTACCTAAAAATAAAA-GTTTCTGCAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_ruidosae"/>
+			????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCARAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAAYTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAG????????????????????????????????????????????????????????????????????????????????????? [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_bottae"/>
+			????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAAATTCCTGAACAGAATCCCAGGGTCA-CAACAGATKGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_alpinus"/>
+			????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCTATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCA????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_riparius"/>
+			????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_mewa"/>
+			????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCATTTCACCATGCACAAGAATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAA?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_saxatilis"/>
+			????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAA???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_laticeps"/>
+			????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAATTGCTACATGATAAWGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCAATAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_talpoides_ocius"/>
+			???CTAGGCAAAA-G-AGC-ATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATMCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCRACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_idahoensis_pygmaeus_a"/>
+			????????CAAAA-G-AGCAATGCTGGTGGTATYACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATMCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCRACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_idahoensis_pygmaeus_b"/>
+			????GGCGCAAAA-G-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATMCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_mazama_mazama"/>
+			ATTCTAGGCAAAAAGAAGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAAYTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_mazama_nasicus"/>
+			ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCSCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAAYTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_monticola_a"/>
+			??????????????G-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGYCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_monticola_b"/>
+			ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATYACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAWATAGAACCAC-ACAACTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAATGGAACRAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_talpoides_yakimensis"/>
+			ATTCTAGGCAAAA-G-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTKTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAAYGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAAYTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_talpoides_bridgeri"/>
+			ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATCCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCRACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_townsendii_townsendii"/>
+			ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTYGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_townsendii_relictus"/>
+			??????????????G-AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTAYTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCACTATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAATGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAATTGCTACATGATAAWGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAATGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_umbrinus_chihuahuae"/>
+			?????????????AG-AGC-ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCTTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_umbrinus_atroavarius"/>
+			ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGCATTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGKCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGYCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAAYGTCAGACCGGAAACCGTGAAATTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+	</alignment>
+
+	<!-- The sequence alignment (each sequence refers to a taxon above).         -->
+	<!-- ntax=26 nchar=601                                                       -->
+	<alignment id="alignment2" dataType="nucleotide">
+		<sequence>
+			<taxon idref="Orthogeomys_heterodus"/>
+			C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCACAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCGTTTCTGGAAAACTGAGATCTTGTTTTGACCAACAGAAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTACTGGTGATGTCTCTGTCAGGATCTAGTCCCATCCTG-AATCCATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTCAGAACTGACTGAATCAGGCCAGTGAAAGTTA-CAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATTGTGCATGGCTTCATTAGCAGGTTTACTGTGCTGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_awahnee_a"/>
+			C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_awahnee_b"/>
+			C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_xerophilus"/>
+			C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCACTAAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTRTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_cactophilus"/>
+			C-AGCTTGCTG-TCACACTACCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCACTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_albatus"/>
+			C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_ruidosae"/>
+			?????????????????????????????C-AGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_bottae"/>
+			C-AGCTTGCTG-TCACACYGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTAKGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_alpinus"/>
+			C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCC-AGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGTTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCYACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_riparius"/>
+			C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_mewa"/>
+			C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_saxatilis"/>
+			C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_laticeps"/>
+			C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_talpoides_ocius"/>
+			C-AGCTTGCTGGTCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCATATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAAWGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_idahoensis_pygmaeus_a"/>
+			C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTTTAAGTGTTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGTCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGTCCAGTGAAACTTAACAGCTACCTTGCCAATKGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGG--TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_idahoensis_pygmaeus_b"/>
+			CAAGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTGTTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGTCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGG--TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_mazama_mazama"/>
+			C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTATTGCCTGGATATAGTGTCTATAGACAGAGACAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCACATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCACCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCTGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_mazama_nasicus"/>
+			C-AGCTTGCTG-TCACAATGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTATTGCCTGGATATAGTGTCTATAGACAGAGACAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCACATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCTGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_monticola_a"/>
+			C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGACGCCKTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_monticola_b"/>
+			C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGACGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTYCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_talpoides_yakimensis"/>
+			C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGAMTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_talpoides_bridgeri"/>
+			C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_townsendii_townsendii"/>
+			C-AGCTTGCTGGTCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_townsendii_relictus"/>
+			C-AGCTTGCTGGTCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_umbrinus_chihuahuae"/>
+			C-AGCTTGCTGGTCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAAGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTGGAATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_umbrinus_atroavarius"/>
+			C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+	</alignment>
+
+	<!-- The unique patterns from 1 to end                                       -->
+	<!-- npatterns=144                                                           -->
+	<patterns id="26.patterns" from="1">
+		<alignment idref="alignment1"/>
+	</patterns>
+
+	<!-- The unique patterns from 1 to end                                       -->
+	<!-- npatterns=71                                                            -->
+	<patterns id="29.patterns" from="1">
+		<alignment idref="alignment2"/>
+	</patterns>
+
+	<!-- A prior assumption that the population size has remained constant       -->
+
+	<!-- throughout the time spanned by the genealogy.                           -->
+	<constantSize id="constant" units="substitutions">
+		<populationSize>
+			<parameter id="constant.popSize" value="0.016" lower="0.0" upper="Infinity"/>
+		</populationSize>
+	</constantSize>
+
+	<!-- Generate a random starting tree under the coalescent process            -->
+	<coalescentTree id="26.startingTree" rootHeight="0.017">
+		<taxa idref="taxa"/>
+		<constantSize idref="constant"/>
+	</coalescentTree>
+
+	<!-- Generate a random starting tree under the coalescent process            -->
+	<coalescentTree id="29.startingTree" rootHeight="0.016">
+		<taxa idref="taxa"/>
+		<constantSize idref="constant"/>
+	</coalescentTree>
+
+	<!-- Generate a tree model                                                   -->
+	<treeModel id="26.treeModel">
+		<coalescentTree idref="26.startingTree"/>
+		<rootHeight>
+			<parameter id="26.treeModel.rootHeight"/>
+		</rootHeight>
+		<nodeHeights internalNodes="true">
+			<parameter id="26.treeModel.internalNodeHeights"/>
+		</nodeHeights>
+		<nodeHeights internalNodes="true" rootNode="true">
+			<parameter id="26.treeModel.allInternalNodeHeights"/>
+		</nodeHeights>
+	</treeModel>
+
+	<!-- Generate a tree model                                                   -->
+	<treeModel id="29.treeModel">
+		<coalescentTree idref="29.startingTree"/>
+		<rootHeight>
+			<parameter id="29.treeModel.rootHeight"/>
+		</rootHeight>
+		<nodeHeights internalNodes="true">
+			<parameter id="29.treeModel.internalNodeHeights"/>
+		</nodeHeights>
+		<nodeHeights internalNodes="true" rootNode="true">
+			<parameter id="29.treeModel.allInternalNodeHeights"/>
+		</nodeHeights>
+	</treeModel>
+
+	<!-- The strict clock (Uniform rates across branches)                        -->
+	<strictClockBranchRates id="26.branchRates">
+		<rate>
+			<parameter id="26.clock.rate" value="1.0"/>
+		</rate>
+	</strictClockBranchRates>
+
+	<!-- The strict clock (Uniform rates across branches)                        -->
+	<strictClockBranchRates id="29.branchRates">
+		<rate>
+			<parameter id="29.clock.rate" value="1.0"/>
+		</rate>
+	</strictClockBranchRates>
+
+	<!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+	<HKYModel id="26.hky">
+		<frequencies>
+			<frequencyModel dataType="nucleotide">
+				<alignment idref="alignment1"/>
+				<frequencies>
+					<parameter id="26.frequencies" dimension="4"/>
+				</frequencies>
+			</frequencyModel>
+		</frequencies>
+		<kappa>
+			<parameter id="26.kappa" value="2.0" lower="0.0" upper="Infinity"/>
+		</kappa>
+	</HKYModel>
+
+	<!-- site model                                                              -->
+	<siteModel id="26.siteModel">
+		<substitutionModel>
+			<HKYModel idref="26.hky"/>
+		</substitutionModel>
+	</siteModel>
+
+	<!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+	<HKYModel id="29.hky">
+		<frequencies>
+			<frequencyModel dataType="nucleotide">
+				<alignment idref="alignment2"/>
+				<frequencies>
+					<parameter id="29.frequencies" dimension="4"/>
+				</frequencies>
+			</frequencyModel>
+		</frequencies>
+		<kappa>
+			<parameter id="29.kappa" value="2.0" lower="0.0" upper="Infinity"/>
+		</kappa>
+	</HKYModel>
+
+	<!-- site model                                                              -->
+	<siteModel id="29.siteModel">
+		<substitutionModel>
+			<HKYModel idref="29.hky"/>
+		</substitutionModel>
+	</siteModel>
+	<treeLikelihood id="26.treeLikelihood" useAmbiguities="false">
+		<patterns idref="26.patterns"/>
+		<treeModel idref="26.treeModel"/>
+		<siteModel idref="26.siteModel"/>
+		<strictClockBranchRates idref="26.branchRates"/>
+	</treeLikelihood>
+	<treeLikelihood id="29.treeLikelihood" useAmbiguities="false">
+		<patterns idref="29.patterns"/>
+		<treeModel idref="29.treeModel"/>
+		<siteModel idref="29.siteModel"/>
+		<strictClockBranchRates idref="29.branchRates"/>
+	</treeLikelihood>
+
+	<!-- Species definition: binds taxa, species and gene trees                  -->
+	<species id="species">
+		<sp id="Orthogeomys_heterodus_species">
+			<taxon idref="Orthogeomys_heterodus"/>
+		</sp>
+		<sp id="Thomomys_bottae">
+			<taxon idref="Thomomys_bottae_awahnee_a"/>
+			<taxon idref="Thomomys_bottae_awahnee_b"/>
+			<taxon idref="Thomomys_bottae_xerophilus"/>
+			<taxon idref="Thomomys_bottae_cactophilus"/>
+			<taxon idref="Thomomys_bottae_albatus"/>
+			<taxon idref="Thomomys_bottae_ruidosae"/>
+			<taxon idref="Thomomys_bottae_bottae"/>
+			<taxon idref="Thomomys_bottae_alpinus"/>
+			<taxon idref="Thomomys_bottae_riparius"/>
+			<taxon idref="Thomomys_bottae_mewa"/>
+			<taxon idref="Thomomys_bottae_saxatilis"/>
+			<taxon idref="Thomomys_bottae_laticeps"/>
+		</sp>
+		<sp id="Thomomys_talpoides">
+			<taxon idref="Thomomys_talpoides_ocius"/>
+			<taxon idref="Thomomys_talpoides_yakimensis"/>
+			<taxon idref="Thomomys_talpoides_bridgeri"/>
+		</sp>
+		<sp id="Thomomys_idahoensis">
+			<taxon idref="Thomomys_idahoensis_pygmaeus_a"/>
+			<taxon idref="Thomomys_idahoensis_pygmaeus_b"/>
+		</sp>
+		<sp id="Thomomys_mazama">
+			<taxon idref="Thomomys_mazama_mazama"/>
+			<taxon idref="Thomomys_mazama_nasicus"/>
+		</sp>
+		<sp id="Thomomys_monticola">
+			<taxon idref="Thomomys_monticola_a"/>
+			<taxon idref="Thomomys_monticola_b"/>
+		</sp>
+		<sp id="Thomomys_townsendii">
+			<taxon idref="Thomomys_townsendii_townsendii"/>
+			<taxon idref="Thomomys_townsendii_relictus"/>
+		</sp>
+		<sp id="Thomomys_umbrinus">
+			<taxon idref="Thomomys_umbrinus_chihuahuae"/>
+			<taxon idref="Thomomys_umbrinus_atroavarius"/>
+		</sp>
+
+		<!-- Collection of Gene Trees                                                -->
+		<geneTrees id="geneTrees">
+			<treeModel idref="26.treeModel"/>
+			<treeModel idref="29.treeModel"/>
+		</geneTrees>
+	</species>
+
+	<!-- Species Tree: Provides Per branch demographic function                  -->
+	<speciesTree id="sptree">
+		<species idref="species"/>
+		<sppSplitPopulations value="0.016">
+			<parameter id="speciesTree.splitPopSize"/>
+		</sppSplitPopulations>
+	</speciesTree>
+
+	<!-- Species Tree: tree prior                                                -->
+
+	<!-- Species Tree: Yule Model                                                -->
+	<yuleModel id="yule" units="substitutions">
+		<birthRate>
+			<parameter id="species.yule.birthRate" value="1.0" lower="0.0" upper="Infinity"/>
+		</birthRate>
+	</yuleModel>
+
+	<!-- Species Tree: Likelihood of species tree                                -->
+
+	<!-- Species Tree: Yule Model                                                -->
+	<speciationLikelihood id="speciation.likelihood">
+		<model>
+			<yuleModel idref="yule"/>
+		</model>
+		<speciesTree>
+			<speciesTree idref="sptree"/>
+		</speciesTree>
+	</speciationLikelihood>
+
+	<!-- Species Tree: tmrcaStatistic                                            -->
+	<tmrcaStatistic id="speciesTree.rootHeight" name="speciesTree.rootHeight">
+		<speciesTree idref="sptree"/>
+		<mrca>
+			<taxa>
+				<sp idref="Orthogeomys_heterodus_species"/>
+				<sp idref="Thomomys_bottae"/>
+				<sp idref="Thomomys_talpoides"/>
+				<sp idref="Thomomys_idahoensis"/>
+				<sp idref="Thomomys_mazama"/>
+				<sp idref="Thomomys_monticola"/>
+				<sp idref="Thomomys_townsendii"/>
+				<sp idref="Thomomys_umbrinus"/>
+			</taxa>
+		</mrca>
+	</tmrcaStatistic>
+
+	<!-- Species Tree: Coalescent likelihood for gene trees under species tree   -->
+	<speciesCoalescent id="species.coalescent">
+		<species idref="species"/>
+		<speciesTree idref="sptree"/>
+	</speciesCoalescent>
+
+	<!-- Species tree prior: gama2 + gamma4                                      -->
+	<mixedDistributionLikelihood id="species.popSizesLikelihood">
+		<distribution0>
+			<gammaDistributionModel>
+				<shape>
+					2
+				</shape>
+				<scale>
+					<parameter id="species.popMean" value="0.016" lower="0.0" upper="Infinity"/>
+				</scale>
+			</gammaDistributionModel>
+		</distribution0>
+		<distribution1>
+			<gammaDistributionModel>
+				<shape>
+					4
+				</shape>
+				<scale>
+					<parameter idref="species.popMean"/>
+				</scale>
+			</gammaDistributionModel>
+		</distribution1>
+		<data>
+			<parameter idref="speciesTree.splitPopSize"/>
+		</data>
+		<indicators>
+			<parameter value="1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"/>
+		</indicators>
+	</mixedDistributionLikelihood>
+
+	<!-- Define operators                                                        -->
+	<operators id="operators">
+		<scaleOperator scaleFactor="0.75" weight="0.1">
+			<parameter idref="26.kappa"/>
+		</scaleOperator>
+		<scaleOperator scaleFactor="0.75" weight="0.1">
+			<parameter idref="29.kappa"/>
+		</scaleOperator>
+		<upDownOperator scaleFactor="0.75" weight="30">
+			<up>
+				<parameter idref="species.yule.birthRate"/>
+			</up>
+			<down>
+				<speciesTree idref="sptree"/>
+				<parameter idref="species.popMean"/>
+				<parameter idref="speciesTree.splitPopSize"/>
+				<parameter idref="26.treeModel.allInternalNodeHeights"/>
+				<parameter idref="29.treeModel.allInternalNodeHeights"/>
+			</down>
+		</upDownOperator>
+		<subtreeSlide size="0.0017000000000000001" gaussian="true" weight="15">
+			<treeModel idref="26.treeModel"/>
+		</subtreeSlide>
+		<narrowExchange weight="15">
+			<treeModel idref="26.treeModel"/>
+		</narrowExchange>
+		<wideExchange weight="3">
+			<treeModel idref="26.treeModel"/>
+		</wideExchange>
+		<wilsonBalding weight="3">
+			<treeModel idref="26.treeModel"/>
+		</wilsonBalding>
+		<scaleOperator scaleFactor="0.75" weight="3">
+			<parameter idref="26.treeModel.rootHeight"/>
+		</scaleOperator>
+		<uniformOperator weight="30">
+			<parameter idref="26.treeModel.internalNodeHeights"/>
+		</uniformOperator>
+		<subtreeSlide size="0.0016" gaussian="true" weight="15">
+			<treeModel idref="29.treeModel"/>
+		</subtreeSlide>
+		<narrowExchange weight="15">
+			<treeModel idref="29.treeModel"/>
+		</narrowExchange>
+		<wideExchange weight="3">
+			<treeModel idref="29.treeModel"/>
+		</wideExchange>
+		<wilsonBalding weight="3">
+			<treeModel idref="29.treeModel"/>
+		</wilsonBalding>
+		<scaleOperator scaleFactor="0.75" weight="3">
+			<parameter idref="29.treeModel.rootHeight"/>
+		</scaleOperator>
+		<uniformOperator weight="30">
+			<parameter idref="29.treeModel.internalNodeHeights"/>
+		</uniformOperator>
+		<upDownOperator scaleFactor="0.75" weight="3">
+			<up>
+			</up>
+			<down>
+				<parameter idref="26.treeModel.allInternalNodeHeights"/>
+			</down>
+		</upDownOperator>
+		<upDownOperator scaleFactor="0.75" weight="3">
+			<up>
+			</up>
+			<down>
+				<parameter idref="29.treeModel.allInternalNodeHeights"/>
+			</down>
+		</upDownOperator>
+		<scaleOperator scaleFactor="0.9" weight="5">
+			<parameter idref="species.popMean"/>
+		</scaleOperator>
+		<scaleOperator scaleFactor="0.75" weight="3">
+			<parameter idref="species.yule.birthRate"/>
+		</scaleOperator>
+		<scaleOperator scaleFactor="0.5" weight="94">
+			<parameter idref="speciesTree.splitPopSize"/>
+		</scaleOperator>
+		<nodeReHeight weight="94">
+			<species idref="species"/>
+			<speciesTree idref="sptree"/>
+		</nodeReHeight>
+	</operators>
+
+	<!-- Define MCMC                                                             -->
+	<mcmc id="mcmc" chainLength="10000000" autoOptimize="true">
+		<posterior id="posterior">
+			<prior id="prior">
+				<speciesCoalescent idref="species.coalescent"/>
+				<mixedDistributionLikelihood idref="species.popSizesLikelihood"/>
+				<speciationLikelihood idref="speciation.likelihood"/>
+				<logNormalPrior mean="1.0" stdev="1.25" offset="0.0" meanInRealSpace="false">
+					<parameter idref="26.kappa"/>
+				</logNormalPrior>
+				<logNormalPrior mean="1.0" stdev="1.25" offset="0.0" meanInRealSpace="false">
+					<parameter idref="29.kappa"/>
+				</logNormalPrior>
+				<oneOnXPrior>
+					<parameter idref="species.popMean"/>
+				</oneOnXPrior>
+				<oneOnXPrior>
+					<parameter idref="species.yule.birthRate"/>
+				</oneOnXPrior>
+			</prior>
+			<likelihood id="likelihood">
+				<treeLikelihood idref="26.treeLikelihood"/>
+				<treeLikelihood idref="29.treeLikelihood"/>
+			</likelihood>
+		</posterior>
+		<operators idref="operators"/>
+
+		<!-- write log to screen                                                     -->
+		<log id="screenLog" logEvery="1000">
+			<column label="Posterior" dp="4" width="12">
+				<posterior idref="posterior"/>
+			</column>
+			<column label="Prior" dp="4" width="12">
+				<prior idref="prior"/>
+			</column>
+			<column label="Likelihood" dp="4" width="12">
+				<likelihood idref="likelihood"/>
+			</column>
+			<column label="PopMean" dp="4" width="12">
+				<parameter idref="species.popMean"/>
+			</column>
+			<column label="26.rootHeight" sf="6" width="12">
+				<parameter idref="26.treeModel.rootHeight"/>
+			</column>
+			<column label="29.rootHeight" sf="6" width="12">
+				<parameter idref="29.treeModel.rootHeight"/>
+			</column>
+			<column label="26.clock.rate" sf="6" width="12">
+				<parameter idref="26.clock.rate"/>
+			</column>
+			<column label="29.clock.rate" sf="6" width="12">
+				<parameter idref="29.clock.rate"/>
+			</column>
+		</log>
+
+		<!-- write log to file                                                       -->
+		<log id="fileLog" logEvery="1000" fileName="StarBEASTLog.log" overwrite="false">
+			<posterior idref="posterior"/>
+			<prior idref="prior"/>
+			<likelihood idref="likelihood"/>
+			<speciesCoalescent idref="species.coalescent"/>
+			<mixedDistributionLikelihood idref="species.popSizesLikelihood"/>
+			<speciationLikelihood idref="speciation.likelihood"/>
+			<parameter idref="species.popMean"/>
+			<parameter idref="speciesTree.splitPopSize"/>
+			<parameter idref="species.yule.birthRate"/>
+			<tmrcaStatistic idref="speciesTree.rootHeight"/>
+			<parameter idref="26.treeModel.rootHeight"/>
+			<parameter idref="29.treeModel.rootHeight"/>
+			<parameter idref="26.kappa"/>
+			<parameter idref="29.kappa"/>
+			<parameter idref="26.clock.rate"/>
+			<parameter idref="29.clock.rate"/>
+			<treeLikelihood idref="26.treeLikelihood"/>
+			<treeLikelihood idref="29.treeLikelihood"/>
+		</log>
+
+		<!-- write tree log to file                                                  -->
+		<logTree id="species.treeFileLog" logEvery="1000" nexusFormat="true" fileName="StarBEASTLog.species.trees" sortTranslationTable="true">
+			<speciesTree idref="sptree"/>
+			<posterior idref="posterior"/>
+		</logTree>
+		<logTree id="26.treeFileLog" logEvery="1000" nexusFormat="true" fileName="StarBEASTLog.26.trees" sortTranslationTable="true">
+			<treeModel idref="26.treeModel"/>
+			<strictClockBranchRates idref="26.branchRates"/>
+			<posterior idref="posterior"/>
+		</logTree>
+		<logTree id="29.treeFileLog" logEvery="1000" nexusFormat="true" fileName="StarBEASTLog.29.trees" sortTranslationTable="true">
+			<treeModel idref="29.treeModel"/>
+			<strictClockBranchRates idref="29.branchRates"/>
+			<posterior idref="posterior"/>
+		</logTree>
+	</mcmc>
+	<report>
+		<property name="timer">
+			<mcmc idref="mcmc"/>
+		</property>
+	</report>
+</beast>
diff --git a/examples/beast2vs1/beast1/testStarBEASTLinearConstRoot.xml b/examples/beast2vs1/beast1/testStarBEASTLinearConstRoot.xml
new file mode 100644
index 0000000..bd51427
--- /dev/null
+++ b/examples/beast2vs1/beast1/testStarBEASTLinearConstRoot.xml
@@ -0,0 +1,707 @@
+<?xml version="1.0" standalone="yes"?>
+
+<!-- Generated by BEAUTi v1.6.1                                              -->
+<!--       by Alexei J. Drummond and Andrew Rambaut                          -->
+<!--       Department of Computer Science, University of Auckland and        -->
+<!--       Institute of Evolutionary Biology, University of Edinburgh        -->
+<!--       http://beast.bio.ed.ac.uk/                                        -->
+<beast>
+
+	<!-- The list of taxa analyse (can also include dates/ages).                 -->
+	<!-- ntax=26                                                                 -->
+	<taxa id="taxa">
+		<taxon id="Orthogeomys_heterodus"/>
+		<taxon id="Thomomys_bottae_awahnee_a"/>
+		<taxon id="Thomomys_bottae_awahnee_b"/>
+		<taxon id="Thomomys_bottae_xerophilus"/>
+		<taxon id="Thomomys_bottae_cactophilus"/>
+		<taxon id="Thomomys_bottae_albatus"/>
+		<taxon id="Thomomys_bottae_ruidosae"/>
+		<taxon id="Thomomys_bottae_bottae"/>
+		<taxon id="Thomomys_bottae_alpinus"/>
+		<taxon id="Thomomys_bottae_riparius"/>
+		<taxon id="Thomomys_bottae_mewa"/>
+		<taxon id="Thomomys_bottae_saxatilis"/>
+		<taxon id="Thomomys_bottae_laticeps"/>
+		<taxon id="Thomomys_talpoides_ocius"/>
+		<taxon id="Thomomys_idahoensis_pygmaeus_a"/>
+		<taxon id="Thomomys_idahoensis_pygmaeus_b"/>
+		<taxon id="Thomomys_mazama_mazama"/>
+		<taxon id="Thomomys_mazama_nasicus"/>
+		<taxon id="Thomomys_monticola_a"/>
+		<taxon id="Thomomys_monticola_b"/>
+		<taxon id="Thomomys_talpoides_yakimensis"/>
+		<taxon id="Thomomys_talpoides_bridgeri"/>
+		<taxon id="Thomomys_townsendii_townsendii"/>
+		<taxon id="Thomomys_townsendii_relictus"/>
+		<taxon id="Thomomys_umbrinus_chihuahuae"/>
+		<taxon id="Thomomys_umbrinus_atroavarius"/>
+	</taxa>
+
+	<!-- The sequence alignment (each sequence refers to a taxon above).         -->
+	<!-- ntax=26 nchar=614                                                       -->
+	<alignment id="alignment1" dataType="nucleotide">
+		<sequence>
+			<taxon idref="Orthogeomys_heterodus"/>
+			ATTCTAGGCAAAAAG-AGCAATGCTGGAGGTATTACAATACCAGACTTCAAACTTTACTATAGAGCCATAATAACAAAAACCGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAATGGAAYAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGTCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCACCATGCACAGGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCAGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGGGAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATAGGAGAAAGACTCAATAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_awahnee_a"/>
+			????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACMCAGTCTATTCAATTATTGGKGCTGGCAAAACTGGGCAGCCMCATGCARAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAA???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_awahnee_b"/>
+			????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCM-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_xerophilus"/>
+			????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAAYTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAA???????????????????????????????????????????????????????????????????????????? [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_cactophilus"/>
+			????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAAYGTCAGACCGGAAACCGTGAAAYTGTTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAA??????????????????????????????????????????????????????????????????????????????????????? [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_albatus"/>
+			????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGATCCAGAAATAGAACCAC-ATACCTATAGTCAACTTGTATTTGATAAAGGAGCTAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCATTTCACCATGCACAAGAATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCT-------------------------------------CATAGGCACTCATAGGCACAGGCAAAAGATTCCTATACAGGAACCCAGGGTCAACAACAGATTGGAGAGAGACTCAATAAATGGGACTACCTAAAAATAAAA-GTTTCTGCAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_ruidosae"/>
+			????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCARAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAAYTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAG????????????????????????????????????????????????????????????????????????????????????? [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_bottae"/>
+			????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAAATTCCTGAACAGAATCCCAGGGTCA-CAACAGATKGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_alpinus"/>
+			????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCTATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCA????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_riparius"/>
+			????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_mewa"/>
+			????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCATTTCACCATGCACAAGAATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAA?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_saxatilis"/>
+			????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAA???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_laticeps"/>
+			????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAATTGCTACATGATAAWGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCAATAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_talpoides_ocius"/>
+			???CTAGGCAAAA-G-AGC-ATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATMCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCRACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_idahoensis_pygmaeus_a"/>
+			????????CAAAA-G-AGCAATGCTGGTGGTATYACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATMCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCRACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_idahoensis_pygmaeus_b"/>
+			????GGCGCAAAA-G-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATMCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_mazama_mazama"/>
+			ATTCTAGGCAAAAAGAAGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAAYTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_mazama_nasicus"/>
+			ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCSCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAAYTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_monticola_a"/>
+			??????????????G-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGYCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_monticola_b"/>
+			ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATYACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAWATAGAACCAC-ACAACTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAATGGAACRAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_talpoides_yakimensis"/>
+			ATTCTAGGCAAAA-G-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTKTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAAYGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAAYTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_talpoides_bridgeri"/>
+			ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATCCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCRACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_townsendii_townsendii"/>
+			ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTYGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_townsendii_relictus"/>
+			??????????????G-AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTAYTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCACTATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAATGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAATTGCTACATGATAAWGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAATGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_umbrinus_chihuahuae"/>
+			?????????????AG-AGC-ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCTTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_umbrinus_atroavarius"/>
+			ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGCATTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGKCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGYCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAAYGTCAGACCGGAAACCGTGAAATTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAGTTTCTGTAC [...]
+		</sequence>
+	</alignment>
+
+	<!-- The sequence alignment (each sequence refers to a taxon above).         -->
+	<!-- ntax=26 nchar=601                                                       -->
+	<alignment id="alignment2" dataType="nucleotide">
+		<sequence>
+			<taxon idref="Orthogeomys_heterodus"/>
+			C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCACAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCGTTTCTGGAAAACTGAGATCTTGTTTTGACCAACAGAAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTACTGGTGATGTCTCTGTCAGGATCTAGTCCCATCCTG-AATCCATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTCAGAACTGACTGAATCAGGCCAGTGAAAGTTA-CAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATTGTGCATGGCTTCATTAGCAGGTTTACTGTGCTGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_awahnee_a"/>
+			C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_awahnee_b"/>
+			C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_xerophilus"/>
+			C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCACTAAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTRTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_cactophilus"/>
+			C-AGCTTGCTG-TCACACTACCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCACTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_albatus"/>
+			C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_ruidosae"/>
+			?????????????????????????????C-AGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_bottae"/>
+			C-AGCTTGCTG-TCACACYGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTAKGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_alpinus"/>
+			C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCC-AGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGTTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCYACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_riparius"/>
+			C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_mewa"/>
+			C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_saxatilis"/>
+			C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_bottae_laticeps"/>
+			C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_talpoides_ocius"/>
+			C-AGCTTGCTGGTCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCATATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAAWGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_idahoensis_pygmaeus_a"/>
+			C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTTTAAGTGTTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGTCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGTCCAGTGAAACTTAACAGCTACCTTGCCAATKGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGG--TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_idahoensis_pygmaeus_b"/>
+			CAAGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTGTTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGTCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGG--TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_mazama_mazama"/>
+			C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTATTGCCTGGATATAGTGTCTATAGACAGAGACAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCACATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCACCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCTGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_mazama_nasicus"/>
+			C-AGCTTGCTG-TCACAATGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTATTGCCTGGATATAGTGTCTATAGACAGAGACAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCACATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCTGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_monticola_a"/>
+			C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGACGCCKTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_monticola_b"/>
+			C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGACGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTYCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_talpoides_yakimensis"/>
+			C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGAMTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_talpoides_bridgeri"/>
+			C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_townsendii_townsendii"/>
+			C-AGCTTGCTGGTCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_townsendii_relictus"/>
+			C-AGCTTGCTGGTCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_umbrinus_chihuahuae"/>
+			C-AGCTTGCTGGTCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAAGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTGGAATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thomomys_umbrinus_atroavarius"/>
+			C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATCCAAACCTAA [...]
+		</sequence>
+	</alignment>
+
+	<!-- The unique patterns from 1 to end                                       -->
+	<!-- npatterns=144                                                           -->
+	<patterns id="26.patterns" from="1">
+		<alignment idref="alignment1"/>
+	</patterns>
+
+	<!-- The unique patterns from 1 to end                                       -->
+	<!-- npatterns=71                                                            -->
+	<patterns id="29.patterns" from="1">
+		<alignment idref="alignment2"/>
+	</patterns>
+
+	<!-- A prior assumption that the population size has remained constant       -->
+
+	<!-- throughout the time spanned by the genealogy.                           -->
+	<constantSize id="constant" units="substitutions">
+		<populationSize>
+			<parameter id="constant.popSize" value="0.016" lower="0.0" upper="Infinity"/>
+		</populationSize>
+	</constantSize>
+
+	<!-- Generate a random starting tree under the coalescent process            -->
+	<coalescentTree id="26.startingTree" rootHeight="0.017">
+		<taxa idref="taxa"/>
+		<constantSize idref="constant"/>
+	</coalescentTree>
+
+	<!-- Generate a random starting tree under the coalescent process            -->
+	<coalescentTree id="29.startingTree" rootHeight="0.016">
+		<taxa idref="taxa"/>
+		<constantSize idref="constant"/>
+	</coalescentTree>
+
+	<!-- Generate a tree model                                                   -->
+	<treeModel id="26.treeModel">
+		<coalescentTree idref="26.startingTree"/>
+		<rootHeight>
+			<parameter id="26.treeModel.rootHeight"/>
+		</rootHeight>
+		<nodeHeights internalNodes="true">
+			<parameter id="26.treeModel.internalNodeHeights"/>
+		</nodeHeights>
+		<nodeHeights internalNodes="true" rootNode="true">
+			<parameter id="26.treeModel.allInternalNodeHeights"/>
+		</nodeHeights>
+	</treeModel>
+
+	<!-- Generate a tree model                                                   -->
+	<treeModel id="29.treeModel">
+		<coalescentTree idref="29.startingTree"/>
+		<rootHeight>
+			<parameter id="29.treeModel.rootHeight"/>
+		</rootHeight>
+		<nodeHeights internalNodes="true">
+			<parameter id="29.treeModel.internalNodeHeights"/>
+		</nodeHeights>
+		<nodeHeights internalNodes="true" rootNode="true">
+			<parameter id="29.treeModel.allInternalNodeHeights"/>
+		</nodeHeights>
+	</treeModel>
+
+	<!-- The strict clock (Uniform rates across branches)                        -->
+	<strictClockBranchRates id="26.branchRates">
+		<rate>
+			<parameter id="26.clock.rate" value="1.0"/>
+		</rate>
+	</strictClockBranchRates>
+
+	<!-- The strict clock (Uniform rates across branches)                        -->
+	<strictClockBranchRates id="29.branchRates">
+		<rate>
+			<parameter id="29.clock.rate" value="1.0"/>
+		</rate>
+	</strictClockBranchRates>
+
+	<!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+	<HKYModel id="26.hky">
+		<frequencies>
+			<frequencyModel dataType="nucleotide">
+				<alignment idref="alignment1"/>
+				<frequencies>
+					<parameter id="26.frequencies" dimension="4"/>
+				</frequencies>
+			</frequencyModel>
+		</frequencies>
+		<kappa>
+			<parameter id="26.kappa" value="2.0" lower="0.0" upper="Infinity"/>
+		</kappa>
+	</HKYModel>
+
+	<!-- site model                                                              -->
+	<siteModel id="26.siteModel">
+		<substitutionModel>
+			<HKYModel idref="26.hky"/>
+		</substitutionModel>
+	</siteModel>
+
+	<!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+	<HKYModel id="29.hky">
+		<frequencies>
+			<frequencyModel dataType="nucleotide">
+				<alignment idref="alignment2"/>
+				<frequencies>
+					<parameter id="29.frequencies" dimension="4"/>
+				</frequencies>
+			</frequencyModel>
+		</frequencies>
+		<kappa>
+			<parameter id="29.kappa" value="2.0" lower="0.0" upper="Infinity"/>
+		</kappa>
+	</HKYModel>
+
+	<!-- site model                                                              -->
+	<siteModel id="29.siteModel">
+		<substitutionModel>
+			<HKYModel idref="29.hky"/>
+		</substitutionModel>
+	</siteModel>
+	<treeLikelihood id="26.treeLikelihood" useAmbiguities="false">
+		<patterns idref="26.patterns"/>
+		<treeModel idref="26.treeModel"/>
+		<siteModel idref="26.siteModel"/>
+		<strictClockBranchRates idref="26.branchRates"/>
+	</treeLikelihood>
+	<treeLikelihood id="29.treeLikelihood" useAmbiguities="false">
+		<patterns idref="29.patterns"/>
+		<treeModel idref="29.treeModel"/>
+		<siteModel idref="29.siteModel"/>
+		<strictClockBranchRates idref="29.branchRates"/>
+	</treeLikelihood>
+
+	<!-- Species definition: binds taxa, species and gene trees                  -->
+	<species id="species">
+		<sp id="Orthogeomys_heterodus_species">
+			<taxon idref="Orthogeomys_heterodus"/>
+		</sp>
+		<sp id="Thomomys_bottae">
+			<taxon idref="Thomomys_bottae_awahnee_a"/>
+			<taxon idref="Thomomys_bottae_awahnee_b"/>
+			<taxon idref="Thomomys_bottae_xerophilus"/>
+			<taxon idref="Thomomys_bottae_cactophilus"/>
+			<taxon idref="Thomomys_bottae_albatus"/>
+			<taxon idref="Thomomys_bottae_ruidosae"/>
+			<taxon idref="Thomomys_bottae_bottae"/>
+			<taxon idref="Thomomys_bottae_alpinus"/>
+			<taxon idref="Thomomys_bottae_riparius"/>
+			<taxon idref="Thomomys_bottae_mewa"/>
+			<taxon idref="Thomomys_bottae_saxatilis"/>
+			<taxon idref="Thomomys_bottae_laticeps"/>
+		</sp>
+		<sp id="Thomomys_talpoides">
+			<taxon idref="Thomomys_talpoides_ocius"/>
+			<taxon idref="Thomomys_talpoides_yakimensis"/>
+			<taxon idref="Thomomys_talpoides_bridgeri"/>
+		</sp>
+		<sp id="Thomomys_idahoensis">
+			<taxon idref="Thomomys_idahoensis_pygmaeus_a"/>
+			<taxon idref="Thomomys_idahoensis_pygmaeus_b"/>
+		</sp>
+		<sp id="Thomomys_mazama">
+			<taxon idref="Thomomys_mazama_mazama"/>
+			<taxon idref="Thomomys_mazama_nasicus"/>
+		</sp>
+		<sp id="Thomomys_monticola">
+			<taxon idref="Thomomys_monticola_a"/>
+			<taxon idref="Thomomys_monticola_b"/>
+		</sp>
+		<sp id="Thomomys_townsendii">
+			<taxon idref="Thomomys_townsendii_townsendii"/>
+			<taxon idref="Thomomys_townsendii_relictus"/>
+		</sp>
+		<sp id="Thomomys_umbrinus">
+			<taxon idref="Thomomys_umbrinus_chihuahuae"/>
+			<taxon idref="Thomomys_umbrinus_atroavarius"/>
+		</sp>
+
+		<!-- Collection of Gene Trees                                                -->
+		<geneTrees id="geneTrees">
+			<treeModel idref="26.treeModel"/>
+			<treeModel idref="29.treeModel"/>
+		</geneTrees>
+	</species>
+
+	<!-- Species Tree: Provides Per branch demographic function                  -->
+	<speciesTree id="sptree" constantRoot="true">
+		<species idref="species"/>
+		<sppSplitPopulations value="0.016">
+			<parameter id="speciesTree.splitPopSize"/>
+		</sppSplitPopulations>
+	</speciesTree>
+
+	<!-- Species Tree: tree prior                                                -->
+
+	<!-- Species Tree: Yule Model                                                -->
+	<yuleModel id="yule" units="substitutions">
+		<birthRate>
+			<parameter id="species.yule.birthRate" value="1.0" lower="0.0" upper="Infinity"/>
+		</birthRate>
+	</yuleModel>
+
+	<!-- Species Tree: Likelihood of species tree                                -->
+
+	<!-- Species Tree: Yule Model                                                -->
+	<speciationLikelihood id="speciation.likelihood">
+		<model>
+			<yuleModel idref="yule"/>
+		</model>
+		<speciesTree>
+			<speciesTree idref="sptree"/>
+		</speciesTree>
+	</speciationLikelihood>
+
+	<!-- Species Tree: tmrcaStatistic                                            -->
+	<tmrcaStatistic id="speciesTree.rootHeight" name="speciesTree.rootHeight">
+		<speciesTree idref="sptree"/>
+		<mrca>
+			<taxa>
+				<sp idref="Orthogeomys_heterodus_species"/>
+				<sp idref="Thomomys_bottae"/>
+				<sp idref="Thomomys_talpoides"/>
+				<sp idref="Thomomys_idahoensis"/>
+				<sp idref="Thomomys_mazama"/>
+				<sp idref="Thomomys_monticola"/>
+				<sp idref="Thomomys_townsendii"/>
+				<sp idref="Thomomys_umbrinus"/>
+			</taxa>
+		</mrca>
+	</tmrcaStatistic>
+
+	<!-- Species Tree: Coalescent likelihood for gene trees under species tree   -->
+	<speciesCoalescent id="species.coalescent">
+		<species idref="species"/>
+		<speciesTree idref="sptree"/>
+	</speciesCoalescent>
+
+	<!-- Species tree prior: gama2 + gamma4                                      -->
+	<mixedDistributionLikelihood id="species.popSizesLikelihood">
+		<distribution0>
+			<gammaDistributionModel>
+				<shape>
+					2
+				</shape>
+				<scale>
+					<parameter id="species.popMean" value="0.016" lower="0.0" upper="Infinity"/>
+				</scale>
+			</gammaDistributionModel>
+		</distribution0>
+		<distribution1>
+			<gammaDistributionModel>
+				<shape>
+					4
+				</shape>
+				<scale>
+					<parameter idref="species.popMean"/>
+				</scale>
+			</gammaDistributionModel>
+		</distribution1>
+		<data>
+			<parameter idref="speciesTree.splitPopSize"/>
+		</data>
+		<indicators>
+			<parameter value="1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0"/>
+		</indicators>
+	</mixedDistributionLikelihood>
+
+	<!-- Define operators                                                        -->
+	<operators id="operators">
+		<scaleOperator scaleFactor="0.75" weight="0.1">
+			<parameter idref="26.kappa"/>
+		</scaleOperator>
+		<scaleOperator scaleFactor="0.75" weight="0.1">
+			<parameter idref="29.kappa"/>
+		</scaleOperator>
+		<upDownOperator scaleFactor="0.75" weight="30">
+			<up>
+				<parameter idref="species.yule.birthRate"/>
+			</up>
+			<down>
+				<speciesTree idref="sptree"/>
+				<parameter idref="species.popMean"/>
+				<parameter idref="speciesTree.splitPopSize"/>
+				<parameter idref="26.treeModel.allInternalNodeHeights"/>
+				<parameter idref="29.treeModel.allInternalNodeHeights"/>
+			</down>
+		</upDownOperator>
+		<subtreeSlide size="0.0017000000000000001" gaussian="true" weight="15">
+			<treeModel idref="26.treeModel"/>
+		</subtreeSlide>
+		<narrowExchange weight="15">
+			<treeModel idref="26.treeModel"/>
+		</narrowExchange>
+		<wideExchange weight="3">
+			<treeModel idref="26.treeModel"/>
+		</wideExchange>
+		<wilsonBalding weight="3">
+			<treeModel idref="26.treeModel"/>
+		</wilsonBalding>
+		<scaleOperator scaleFactor="0.75" weight="3">
+			<parameter idref="26.treeModel.rootHeight"/>
+		</scaleOperator>
+		<uniformOperator weight="30">
+			<parameter idref="26.treeModel.internalNodeHeights"/>
+		</uniformOperator>
+		<subtreeSlide size="0.0016" gaussian="true" weight="15">
+			<treeModel idref="29.treeModel"/>
+		</subtreeSlide>
+		<narrowExchange weight="15">
+			<treeModel idref="29.treeModel"/>
+		</narrowExchange>
+		<wideExchange weight="3">
+			<treeModel idref="29.treeModel"/>
+		</wideExchange>
+		<wilsonBalding weight="3">
+			<treeModel idref="29.treeModel"/>
+		</wilsonBalding>
+		<scaleOperator scaleFactor="0.75" weight="3">
+			<parameter idref="29.treeModel.rootHeight"/>
+		</scaleOperator>
+		<uniformOperator weight="30">
+			<parameter idref="29.treeModel.internalNodeHeights"/>
+		</uniformOperator>
+		<upDownOperator scaleFactor="0.75" weight="3">
+			<up>
+			</up>
+			<down>
+				<parameter idref="26.treeModel.allInternalNodeHeights"/>
+			</down>
+		</upDownOperator>
+		<upDownOperator scaleFactor="0.75" weight="3">
+			<up>
+			</up>
+			<down>
+				<parameter idref="29.treeModel.allInternalNodeHeights"/>
+			</down>
+		</upDownOperator>
+		<scaleOperator scaleFactor="0.9" weight="5">
+			<parameter idref="species.popMean"/>
+		</scaleOperator>
+		<scaleOperator scaleFactor="0.75" weight="3">
+			<parameter idref="species.yule.birthRate"/>
+		</scaleOperator>
+		<scaleOperator scaleFactor="0.5" weight="94">
+			<parameter idref="speciesTree.splitPopSize"/>
+		</scaleOperator>
+		<nodeReHeight weight="94">
+			<species idref="species"/>
+			<speciesTree idref="sptree"/>
+		</nodeReHeight>
+	</operators>
+
+	<!-- Define MCMC                                                             -->
+	<mcmc id="mcmc" chainLength="10000000" autoOptimize="true">
+		<posterior id="posterior">
+			<prior id="prior">
+				<speciesCoalescent idref="species.coalescent"/>
+				<mixedDistributionLikelihood idref="species.popSizesLikelihood"/>
+				<speciationLikelihood idref="speciation.likelihood"/>
+				<logNormalPrior mean="1.0" stdev="1.25" offset="0.0" meanInRealSpace="false">
+					<parameter idref="26.kappa"/>
+				</logNormalPrior>
+				<logNormalPrior mean="1.0" stdev="1.25" offset="0.0" meanInRealSpace="false">
+					<parameter idref="29.kappa"/>
+				</logNormalPrior>
+				<oneOnXPrior>
+					<parameter idref="species.popMean"/>
+				</oneOnXPrior>
+				<oneOnXPrior>
+					<parameter idref="species.yule.birthRate"/>
+				</oneOnXPrior>
+			</prior>
+			<likelihood id="likelihood">
+				<treeLikelihood idref="26.treeLikelihood"/>
+				<treeLikelihood idref="29.treeLikelihood"/>
+			</likelihood>
+		</posterior>
+		<operators idref="operators"/>
+
+		<!-- write log to screen                                                     -->
+		<log id="screenLog" logEvery="1000">
+			<column label="Posterior" dp="4" width="12">
+				<posterior idref="posterior"/>
+			</column>
+			<column label="Prior" dp="4" width="12">
+				<prior idref="prior"/>
+			</column>
+			<column label="Likelihood" dp="4" width="12">
+				<likelihood idref="likelihood"/>
+			</column>
+			<column label="PopMean" dp="4" width="12">
+				<parameter idref="species.popMean"/>
+			</column>
+			<column label="26.rootHeight" sf="6" width="12">
+				<parameter idref="26.treeModel.rootHeight"/>
+			</column>
+			<column label="29.rootHeight" sf="6" width="12">
+				<parameter idref="29.treeModel.rootHeight"/>
+			</column>
+			<column label="26.clock.rate" sf="6" width="12">
+				<parameter idref="26.clock.rate"/>
+			</column>
+			<column label="29.clock.rate" sf="6" width="12">
+				<parameter idref="29.clock.rate"/>
+			</column>
+		</log>
+
+		<!-- write log to file                                                       -->
+		<log id="fileLog" logEvery="1000" fileName="StarBEASTLog.log" overwrite="false">
+			<posterior idref="posterior"/>
+			<prior idref="prior"/>
+			<likelihood idref="likelihood"/>
+			<speciesCoalescent idref="species.coalescent"/>
+			<mixedDistributionLikelihood idref="species.popSizesLikelihood"/>
+			<speciationLikelihood idref="speciation.likelihood"/>
+			<parameter idref="species.popMean"/>
+			<parameter idref="speciesTree.splitPopSize"/>
+			<parameter idref="species.yule.birthRate"/>
+			<tmrcaStatistic idref="speciesTree.rootHeight"/>
+			<parameter idref="26.treeModel.rootHeight"/>
+			<parameter idref="29.treeModel.rootHeight"/>
+			<parameter idref="26.kappa"/>
+			<parameter idref="29.kappa"/>
+			<parameter idref="26.clock.rate"/>
+			<parameter idref="29.clock.rate"/>
+			<treeLikelihood idref="26.treeLikelihood"/>
+			<treeLikelihood idref="29.treeLikelihood"/>
+		</log>
+
+		<!-- write tree log to file                                                  -->
+		<logTree id="species.treeFileLog" logEvery="1000" nexusFormat="true" fileName="StarBEASTLog.species.trees" sortTranslationTable="true">
+			<speciesTree idref="sptree"/>
+			<posterior idref="posterior"/>
+		</logTree>
+		<logTree id="26.treeFileLog" logEvery="1000" nexusFormat="true" fileName="StarBEASTLog.26.trees" sortTranslationTable="true">
+			<treeModel idref="26.treeModel"/>
+			<strictClockBranchRates idref="26.branchRates"/>
+			<posterior idref="posterior"/>
+		</logTree>
+		<logTree id="29.treeFileLog" logEvery="1000" nexusFormat="true" fileName="StarBEASTLog.29.trees" sortTranslationTable="true">
+			<treeModel idref="29.treeModel"/>
+			<strictClockBranchRates idref="29.branchRates"/>
+			<posterior idref="posterior"/>
+		</logTree>
+	</mcmc>
+	<report>
+		<property name="timer">
+			<mcmc idref="mcmc"/>
+		</property>
+	</report>
+</beast>
diff --git a/examples/beast2vs1/beast1/testStrictClockNoDate.xml b/examples/beast2vs1/beast1/testStrictClockNoDate.xml
new file mode 100644
index 0000000..7767331
--- /dev/null
+++ b/examples/beast2vs1/beast1/testStrictClockNoDate.xml
@@ -0,0 +1,234 @@
+<?xml version="1.0" standalone="yes"?>
+
+<!-- Generated by BEAUTi v1.7.0 Prerelease r3910                             -->
+<!--       by Alexei J. Drummond and Andrew Rambaut                          -->
+<!--       Department of Computer Science, University of Auckland and        -->
+<!--       Institute of Evolutionary Biology, University of Edinburgh        -->
+<!--       http://beast.bio.ed.ac.uk/                                        -->
+<beast>
+
+	<!-- The list of taxa to be analysed (can also include dates/ages).          -->
+	<!-- ntax=6                                                                  -->
+	<taxa id="taxa">
+		<taxon id="human"/>
+		<taxon id="chimp"/>
+		<taxon id="bonobo"/>
+		<taxon id="gorilla"/>
+		<taxon id="orangutan"/>
+		<taxon id="siamang"/>
+	</taxa>
+
+	<!-- The sequence alignment (each sequence refers to a taxon above).         -->
+	<!-- ntax=6 nchar=768                                                        -->
+	<alignment id="alignment" dataType="nucleotide">
+		<sequence>
+			<taxon idref="human"/>
+			AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCACCTCGGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="chimp"/>
+			AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCACCTCAGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="bonobo"/>
+			AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAGC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTTGAATTTGCAATTCAATATGAAAA-TCACCTCAGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="gorilla"/>
+			AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTAAACATAGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA-CAACACTTAATTTCTGTAAGGACTGCAAAACCCTACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCAATGGGACTCAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAT-TCACCTCGGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="orangutan"/>
+			AGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA-CAGCACTTAATTTCTGTAAGGACTGCAAAACCCCACTTTGCATCAACTGAGCGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCCTAGACCGATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAT-TGGCTTCAGTCCAAAGCCCCGGCAGGCCTTAAAGCTGCTCCTTCGAATTTGCAATTCAACATGACAA-TCACCTCAGGGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="siamang"/>
+			AGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTAACAAAACTTAATTTCTGCAAGGGCTGCAAAACCCTACTTTGCATCAACCGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCGATGGGACTTAAACCCATAAAAATTTAGTTAACAGCTAAACACCCTAAACAACCTGGCTTCAATCTAAAGCCCCGGCAGA-GTTGAAGCTGCTTCTTTGAACTTGCAATTCAACGTGAAAAATCACTTCGGAGCT [...]
+		</sequence>
+	</alignment>
+
+	<!-- The unique patterns from 1 to end                                       -->
+	<!-- npatterns=69                                                            -->
+	<patterns id="patterns" from="1">
+		<alignment idref="alignment"/>
+	</patterns>
+
+	<!-- A prior assumption that the population size has remained constant       -->
+	<!-- throughout the time spanned by the genealogy.                           -->
+	<constantSize id="constant" units="substitutions">
+		<populationSize>
+			<parameter id="constant.popSize" value="0.077" lower="0.0" upper="Infinity"/>
+		</populationSize>
+	</constantSize>
+
+	<!-- Generate a random starting tree under the coalescent process            -->
+	<coalescentTree id="startingTree" rootHeight="0.077">
+		<taxa idref="taxa"/>
+		<constantSize idref="constant"/>
+	</coalescentTree>
+
+	<!-- Generate a tree model                                                   -->
+	<treeModel id="treeModel">
+		<coalescentTree idref="startingTree"/>
+		<rootHeight>
+			<parameter id="treeModel.rootHeight"/>
+		</rootHeight>
+		<nodeHeights internalNodes="true">
+			<parameter id="treeModel.internalNodeHeights"/>
+		</nodeHeights>
+		<nodeHeights internalNodes="true" rootNode="true">
+			<parameter id="treeModel.allInternalNodeHeights"/>
+		</nodeHeights>
+	</treeModel>
+
+	<!-- Generate a coalescent likelihood                                        -->
+	<coalescentLikelihood id="coalescent">
+		<model>
+			<constantSize idref="constant"/>
+		</model>
+		<populationTree>
+			<treeModel idref="treeModel"/>
+		</populationTree>
+	</coalescentLikelihood>
+
+	<!-- The strict clock (Uniform rates across branches)                        -->
+	<strictClockBranchRates id="branchRates">
+		<rate>
+			<parameter id="clock.rate" value="1.0"/>
+		</rate>
+	</strictClockBranchRates>
+
+	<!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+	<HKYModel id="hky">
+		<frequencies>
+			<frequencyModel dataType="nucleotide">
+				<frequencies>
+					<parameter id="frequencies" value="0.25 0.25 0.25 0.25"/>
+				</frequencies>
+			</frequencyModel>
+		</frequencies>
+		<kappa>
+			<parameter id="kappa" value="2.0" lower="0.0" upper="Infinity"/>
+		</kappa>
+	</HKYModel>
+
+	<!-- site model                                                              -->
+	<siteModel id="siteModel">
+		<substitutionModel>
+			<HKYModel idref="hky"/>
+		</substitutionModel>
+	</siteModel>
+
+	<!-- Likelihood for tree given sequence data                                 -->
+	<treeLikelihood id="treeLikelihood" useAmbiguities="false">
+		<patterns idref="patterns"/>
+		<treeModel idref="treeModel"/>
+		<siteModel idref="siteModel"/>
+		<strictClockBranchRates idref="branchRates"/>
+	</treeLikelihood>
+
+	<!-- Define operators                                                        -->
+	<operators id="operators">
+		<scaleOperator scaleFactor="0.75" weight="0.1">
+			<parameter idref="kappa"/>
+		</scaleOperator>
+		<deltaExchange delta="0.01" weight="0.1">
+			<parameter idref="frequencies"/>
+		</deltaExchange>
+		<subtreeSlide size="0.0077" gaussian="true" weight="15">
+			<treeModel idref="treeModel"/>
+		</subtreeSlide>
+		<narrowExchange weight="15">
+			<treeModel idref="treeModel"/>
+		</narrowExchange>
+		<wideExchange weight="3">
+			<treeModel idref="treeModel"/>
+		</wideExchange>
+		<wilsonBalding weight="3">
+			<treeModel idref="treeModel"/>
+		</wilsonBalding>
+		<scaleOperator scaleFactor="0.75" weight="3">
+			<parameter idref="treeModel.rootHeight"/>
+		</scaleOperator>
+		<uniformOperator weight="30">
+			<parameter idref="treeModel.internalNodeHeights"/>
+		</uniformOperator>
+		<scaleOperator scaleFactor="0.75" weight="3">
+			<parameter idref="constant.popSize"/>
+		</scaleOperator>
+		<upDownOperator scaleFactor="0.75" weight="3">
+			<up>
+			</up>
+			<down>
+				<parameter idref="treeModel.allInternalNodeHeights"/>
+			</down>
+		</upDownOperator>
+	</operators>
+
+	<!-- Define MCMC                                                             -->
+	<mcmc id="mcmc" chainLength="10000000" autoOptimize="true">
+		<posterior id="posterior">
+			<prior id="prior">
+				<logNormalPrior mean="1.0" stdev="1.25" offset="0.0" meanInRealSpace="false">
+					<parameter idref="kappa"/>
+				</logNormalPrior>
+				<uniformPrior lower="0.0" upper="1.0">
+					<parameter idref="frequencies"/>
+				</uniformPrior>
+				<oneOnXPrior>
+					<parameter idref="constant.popSize"/>
+				</oneOnXPrior>
+				<coalescentLikelihood idref="coalescent"/>
+			</prior>
+			<likelihood id="likelihood">
+				<treeLikelihood idref="treeLikelihood"/>
+			</likelihood>
+		</posterior>
+		<operators idref="operators"/>
+
+		<!-- write log to screen                                                     -->
+		<log id="screenLog" logEvery="1000">
+			<column label="Posterior" dp="4" width="12">
+				<posterior idref="posterior"/>
+			</column>
+			<column label="Prior" dp="4" width="12">
+				<prior idref="prior"/>
+			</column>
+			<column label="Likelihood" dp="4" width="12">
+				<likelihood idref="likelihood"/>
+			</column>
+			<column label="rootHeight" sf="6" width="12">
+				<parameter idref="treeModel.rootHeight"/>
+			</column>
+			<column label="clock.rate" sf="6" width="12">
+				<parameter idref="clock.rate"/>
+			</column>
+		</log>
+
+		<!-- write log to file                                                       -->
+		<log id="fileLog" logEvery="1000" fileName="testStrictClockNoDate.log" overwrite="false">
+			<posterior idref="posterior"/>
+			<prior idref="prior"/>
+			<likelihood idref="likelihood"/>
+			<parameter idref="treeModel.rootHeight"/>
+			<parameter idref="constant.popSize"/>
+			<parameter idref="kappa"/>
+			<parameter idref="frequencies"/>
+			<parameter idref="clock.rate"/>
+			<treeLikelihood idref="treeLikelihood"/>
+			<coalescentLikelihood idref="coalescent"/>
+		</log>
+
+		<!-- write tree log to file                                                  -->
+		<logTree id="treeFileLog" logEvery="1000" nexusFormat="true" fileName="testStrictClockNoDate.trees" sortTranslationTable="true">
+			<treeModel idref="treeModel"/>
+			<strictClockBranchRates idref="branchRates"/>
+			<posterior idref="posterior"/>
+		</logTree>
+	</mcmc>
+	<report>
+		<property name="timer">
+			<mcmc idref="mcmc"/>
+		</property>
+	</report>
+</beast>
diff --git a/examples/beast2vs1/beast1/testStrictClockNoDate2.xml b/examples/beast2vs1/beast1/testStrictClockNoDate2.xml
new file mode 100644
index 0000000..400b285
--- /dev/null
+++ b/examples/beast2vs1/beast1/testStrictClockNoDate2.xml
@@ -0,0 +1,228 @@
+<?xml version="1.0" standalone="yes"?>
+
+<!-- Generated by BEAUTi v1.7.0 Prerelease r3910                             -->
+<!--       by Alexei J. Drummond and Andrew Rambaut                          -->
+<!--       Department of Computer Science, University of Auckland and        -->
+<!--       Institute of Evolutionary Biology, University of Edinburgh        -->
+<!--       http://beast.bio.ed.ac.uk/                                        -->
+<beast>
+
+	<!-- The list of taxa to be analysed (can also include dates/ages).          -->
+	<!-- ntax=6                                                                  -->
+	<taxa id="taxa">
+		<taxon id="human"/>
+		<taxon id="chimp"/>
+		<taxon id="bonobo"/>
+		<taxon id="gorilla"/>
+		<taxon id="orangutan"/>
+		<taxon id="siamang"/>
+	</taxa>
+
+	<!-- The sequence alignment (each sequence refers to a taxon above).         -->
+	<!-- ntax=6 nchar=768                                                        -->
+	<alignment id="alignment" dataType="nucleotide">
+		<sequence>
+			<taxon idref="human"/>
+			AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCACCTCGGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="chimp"/>
+			AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCACCTCAGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="bonobo"/>
+			AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAGC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTTGAATTTGCAATTCAATATGAAAA-TCACCTCAGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="gorilla"/>
+			AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTAAACATAGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA-CAACACTTAATTTCTGTAAGGACTGCAAAACCCTACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCAATGGGACTCAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAT-TCACCTCGGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="orangutan"/>
+			AGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA-CAGCACTTAATTTCTGTAAGGACTGCAAAACCCCACTTTGCATCAACTGAGCGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCCTAGACCGATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAT-TGGCTTCAGTCCAAAGCCCCGGCAGGCCTTAAAGCTGCTCCTTCGAATTTGCAATTCAACATGACAA-TCACCTCAGGGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="siamang"/>
+			AGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTAACAAAACTTAATTTCTGCAAGGGCTGCAAAACCCTACTTTGCATCAACCGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCGATGGGACTTAAACCCATAAAAATTTAGTTAACAGCTAAACACCCTAAACAACCTGGCTTCAATCTAAAGCCCCGGCAGA-GTTGAAGCTGCTTCTTTGAACTTGCAATTCAACGTGAAAAATCACTTCGGAGCT [...]
+		</sequence>
+	</alignment>
+
+	<!-- The unique patterns from 1 to end                                       -->
+	<!-- npatterns=69                                                            -->
+	<patterns id="patterns" from="1">
+		<alignment idref="alignment"/>
+	</patterns>
+
+	<!-- A prior assumption that the population size has remained constant       -->
+	<!-- throughout the time spanned by the genealogy.                           -->
+	<constantSize id="constant" units="substitutions">
+		<populationSize>
+			<parameter id="constant.popSize" value="0.077" lower="0.0" upper="Infinity"/>
+		</populationSize>
+	</constantSize>
+
+	<!-- Generate a random starting tree under the coalescent process            -->
+	<coalescentTree id="startingTree" rootHeight="0.077">
+		<taxa idref="taxa"/>
+		<constantSize idref="constant"/>
+	</coalescentTree>
+
+	<!-- Generate a tree model                                                   -->
+	<treeModel id="treeModel">
+		<coalescentTree idref="startingTree"/>
+		<rootHeight>
+			<parameter id="treeModel.rootHeight"/>
+		</rootHeight>
+		<nodeHeights internalNodes="true">
+			<parameter id="treeModel.internalNodeHeights"/>
+		</nodeHeights>
+		<nodeHeights internalNodes="true" rootNode="true">
+			<parameter id="treeModel.allInternalNodeHeights"/>
+		</nodeHeights>
+	</treeModel>
+
+	<!-- Generate a coalescent likelihood                                        -->
+	<coalescentLikelihood id="coalescent">
+		<model>
+			<constantSize idref="constant"/>
+		</model>
+		<populationTree>
+			<treeModel idref="treeModel"/>
+		</populationTree>
+	</coalescentLikelihood>
+
+	<!-- The strict clock (Uniform rates across branches)                        -->
+	<strictClockBranchRates id="branchRates">
+		<rate>
+			<parameter id="clock.rate" value="1.0"/>
+		</rate>
+	</strictClockBranchRates>
+
+	<!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+	<HKYModel id="hky">
+		<frequencies>
+			<frequencyModel dataType="nucleotide">
+				<alignment idref="alignment"/>
+				<frequencies>
+					<parameter id="frequencies" dimension="4"/>
+				</frequencies>
+			</frequencyModel>
+		</frequencies>
+		<kappa>
+			<parameter id="kappa" value="2.0" lower="0.0" upper="Infinity"/>
+		</kappa>
+	</HKYModel>
+
+	<!-- site model                                                              -->
+	<siteModel id="siteModel">
+		<substitutionModel>
+			<HKYModel idref="hky"/>
+		</substitutionModel>
+	</siteModel>
+
+	<!-- Likelihood for tree given sequence data                                 -->
+	<treeLikelihood id="treeLikelihood" useAmbiguities="false">
+		<patterns idref="patterns"/>
+		<treeModel idref="treeModel"/>
+		<siteModel idref="siteModel"/>
+		<strictClockBranchRates idref="branchRates"/>
+	</treeLikelihood>
+
+	<!-- Define operators                                                        -->
+	<operators id="operators">
+		<scaleOperator scaleFactor="0.75" weight="0.1">
+			<parameter idref="kappa"/>
+		</scaleOperator>
+		<subtreeSlide size="0.0077" gaussian="true" weight="15">
+			<treeModel idref="treeModel"/>
+		</subtreeSlide>
+		<narrowExchange weight="15">
+			<treeModel idref="treeModel"/>
+		</narrowExchange>
+		<wideExchange weight="3">
+			<treeModel idref="treeModel"/>
+		</wideExchange>
+		<wilsonBalding weight="3">
+			<treeModel idref="treeModel"/>
+		</wilsonBalding>
+		<scaleOperator scaleFactor="0.75" weight="3">
+			<parameter idref="treeModel.rootHeight"/>
+		</scaleOperator>
+		<uniformOperator weight="30">
+			<parameter idref="treeModel.internalNodeHeights"/>
+		</uniformOperator>
+		<scaleOperator scaleFactor="0.75" weight="3">
+			<parameter idref="constant.popSize"/>
+		</scaleOperator>
+		<upDownOperator scaleFactor="0.75" weight="3">
+			<up>
+			</up>
+			<down>
+				<parameter idref="treeModel.allInternalNodeHeights"/>
+			</down>
+		</upDownOperator>
+	</operators>
+
+	<!-- Define MCMC                                                             -->
+	<mcmc id="mcmc" chainLength="10000000" autoOptimize="true">
+		<posterior id="posterior">
+			<prior id="prior">
+				<logNormalPrior mean="1.0" stdev="1.25" offset="0.0" meanInRealSpace="false">
+					<parameter idref="kappa"/>
+				</logNormalPrior>
+				<oneOnXPrior>
+					<parameter idref="constant.popSize"/>
+				</oneOnXPrior>
+				<coalescentLikelihood idref="coalescent"/>
+			</prior>
+			<likelihood id="likelihood">
+				<treeLikelihood idref="treeLikelihood"/>
+			</likelihood>
+		</posterior>
+		<operators idref="operators"/>
+
+		<!-- write log to screen                                                     -->
+		<log id="screenLog" logEvery="1000">
+			<column label="Posterior" dp="4" width="12">
+				<posterior idref="posterior"/>
+			</column>
+			<column label="Prior" dp="4" width="12">
+				<prior idref="prior"/>
+			</column>
+			<column label="Likelihood" dp="4" width="12">
+				<likelihood idref="likelihood"/>
+			</column>
+			<column label="rootHeight" sf="6" width="12">
+				<parameter idref="treeModel.rootHeight"/>
+			</column>
+			<column label="clock.rate" sf="6" width="12">
+				<parameter idref="clock.rate"/>
+			</column>
+		</log>
+
+		<!-- write log to file                                                       -->
+		<log id="fileLog" logEvery="1000" fileName="testStrictClockNoDate2.log" overwrite="false">
+			<posterior idref="posterior"/>
+			<prior idref="prior"/>
+			<likelihood idref="likelihood"/>
+			<parameter idref="treeModel.rootHeight"/>
+			<parameter idref="constant.popSize"/>
+			<parameter idref="kappa"/>
+			<parameter idref="clock.rate"/>
+			<treeLikelihood idref="treeLikelihood"/>
+			<coalescentLikelihood idref="coalescent"/>
+		</log>
+
+		<!-- write tree log to file                                                  -->
+		<logTree id="treeFileLog" logEvery="1000" nexusFormat="true" fileName="testStrictClockNoDate2.trees" sortTranslationTable="true">
+			<treeModel idref="treeModel"/>
+			<strictClockBranchRates idref="branchRates"/>
+			<posterior idref="posterior"/>
+		</logTree>
+	</mcmc>
+	<report>
+		<property name="timer">
+			<mcmc idref="mcmc"/>
+		</property>
+	</report>
+</beast>
diff --git a/examples/beast2vs1/beast1/testStrictClockTipDatesSampling.xml b/examples/beast2vs1/beast1/testStrictClockTipDatesSampling.xml
new file mode 100644
index 0000000..ab5fb5f
--- /dev/null
+++ b/examples/beast2vs1/beast1/testStrictClockTipDatesSampling.xml
@@ -0,0 +1,372 @@
+<?xml version="1.0" standalone="yes"?>
+
+<!-- Generated by BEAUTi v1.6.2                                              -->
+<!--       by Alexei J. Drummond and Andrew Rambaut                          -->
+<!--       Department of Computer Science, University of Auckland and        -->
+<!--       Institute of Evolutionary Biology, University of Edinburgh        -->
+<!--       http://beast.bio.ed.ac.uk/                                        -->
+<beast>
+
+	<!-- The list of taxa analyse (can also include dates/ages).                 -->
+	<!-- ntax=21                                                                 -->
+	<taxa id="taxa">
+		<taxon id="TREESPARROW_HENAN_1_2004">
+			<date value="2004.0" direction="forwards" units="years"/>
+		</taxon>
+		<taxon id="HUMAN_VIETNAM_CL105_2005">
+			<date value="2005.0" direction="forwards" units="years"/>
+		</taxon>
+		<taxon id="TREESPARROW_HENAN_4_2004">
+			<date value="2004.0" direction="forwards" units="years"/>
+		</taxon>
+		<taxon id="CHICKEN_HEBEI_326_2005">
+			<date value="2005.0" direction="forwards" units="years"/>
+		</taxon>
+		<taxon id="CHICKEN_HONGKONG_915_1997">
+			<date value="1997.0" direction="forwards" units="years"/>
+		</taxon>
+		<taxon id="VIETNAM_3062_2004">
+			<date value="2004.0" direction="forwards" units="years"/>
+		</taxon>
+		<taxon id="GOOSE_HONGKONG_W355_1997">
+			<date value="1997.0" direction="forwards" units="years"/>
+		</taxon>
+		<taxon id="DUCK_HONGKONG_Y283_1997">
+			<date value="1997.0" direction="forwards" units="years"/>
+		</taxon>
+		<taxon id="DUCK_VIETNAM_376_2005">
+			<date value="2005.0" direction="forwards" units="years"/>
+		</taxon>
+		<taxon id="MALLARD_VIETNAM_16_2003">
+			<date value="2003.0" direction="forwards" units="years"/>
+		</taxon>
+		<taxon id="CHICKEN_THAILAND_KANCHANABURI_CK_160_2005">
+			<date value="2005.0" direction="forwards" units="years"/>
+		</taxon>
+		<taxon id="DUCK_GUANGZHOU_20_2005">
+			<date value="2005.0" direction="forwards" units="years"/>
+		</taxon>
+		<taxon id="CK_HK_WF157_2003">
+			<date value="2003.0" direction="forwards" units="years"/>
+		</taxon>
+		<taxon id="SWINE_ANHUI_2004">
+			<date value="2004.0" direction="forwards" units="years"/>
+		</taxon>
+		<taxon id="DUCK_VIETNAM_272_2005">
+			<date value="2005.0" direction="forwards" units="years"/>
+		</taxon>
+		<taxon id="HONGKONG_1997_1998">
+			<date value="1998.0" direction="forwards" units="years"/>
+		</taxon>
+		<taxon id="GOOSE_SHANTOU_2216_2005">
+			<date value="2005.0" direction="forwards" units="years"/>
+		</taxon>
+		<taxon id="TREESPARROW_HENAN_3_2004">
+			<date value="2004.0" direction="forwards" units="years"/>
+		</taxon>
+		<taxon id="PEREGRINEFALCON_HK_D0028_2004">
+			<date value="2004.0" direction="forwards" units="years"/>
+		</taxon>
+		<taxon id="TREESPARROW_HENAN_2_2004">
+			<date value="2004.0" direction="forwards" units="years"/>
+		</taxon>
+		<taxon id="HONGKONG_538_1997">
+			<date value="1997.0" direction="forwards" units="years"/>
+		</taxon>
+	</taxa>
+
+	<!-- The sequence alignment (each sequence refers to a taxon above).         -->
+	<!-- ntax=21 nchar=1698                                                      -->
+	<alignment id="alignment" dataType="nucleotide">
+		<sequence>
+			<taxon idref="TREESPARROW_HENAN_1_2004"/>
+			ATGGAGAAAATAGTGCTTCTTCGTGCAATGATCAATCTTGTTAAAAGTGATCAGATTGGCGTTGGTTACCATGCAGACTACTCGACAGAGCAGGGTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCTCAAGACATATTGGAAAAGACACACAACGGGAAGCTCTGCGACCTAGATGGAGTGAAGCCTCTAATTTTGAAAGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCAATGTGTGACGAATTCATCAATGTGCCGGAGTGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTACCCAGGGGATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAAAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCGATCATGAAGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCTGGGGAAGCCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="HUMAN_VIETNAM_CL105_2005"/>
+			ATGGAGAAAATAGTGCTTCTTTTTGCGATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGCGATCTAGATGGAGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTACTCGGAAACCCAATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGTCAATCCAGTCAATGACCTCTGTTACCCAGGGGTTTTCAATGACTATGAAGAATTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAGTCATGAAGCCTCATTAGGGGTGAGCTCAGTATGTCCATACCAGGGAAAGTCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="TREESPARROW_HENAN_4_2004"/>
+			ATGGAGAAAATAGTGCTTCTTCTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGCAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGCGATCTAGATGGAGTGAAACCTCTAATTTTAAGAGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCAATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTACCCAGGGGATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCGATCATGAAGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCAGGGGAGTCCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="CHICKEN_HEBEI_326_2005"/>
+			ATGGAGAGAATAGTGCTTCTTCTTGCAATAATCGGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCTCAAGACATACTGGAGAAGACACACAACGGGAAGCTCTGCAACCCAGATGGAGTGAAGCCTCTAATTTTGAAAGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCAATGTGTGACGAATTTATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGGCCTCTGTTACCCAGGGGATTTCAATGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCGATCATGGAGCCTCATCAGGGGTGAGCTCAGCATGTTCCTATCTGGGGAAGCCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="CHICKEN_HONGKONG_915_1997"/>
+			ATGGAGAAAATAGTGCTTCTTCTTGCAACAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAATGTTACTGTTACACATGCCCAAGACATACTGGAAAGGACACACAACGGGAAGCTCTGCGATCTAAATGGAGTGAAACCTCTCATTTTGAGGGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCTATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTATCCAGGGAATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAATCATGATGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCTTGGGAGGTCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="VIETNAM_3062_2004"/>
+			ATGGAGAAAATAGTGCTTCTTTTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGCGATCTAGATGGAGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCAATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAATCCAGTCAATGACCTCTGTTACCCAGGGGATTTCAATGACTATGAAGAATTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAGTCATGAAGCCTCATTAGGAGTGAGCTCAGCATGTCCATACCAGGGAAAGTCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="GOOSE_HONGKONG_W355_1997"/>
+			ATGGAGAAAATAGTGCTTCTTCTTGCAACAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAATGTTACTGTTACACATGCCCAAGACATACTGGAAAGGACACACAACGGGAAGCTCTGCGATCTAAATGGAGTGAAACCTCTCATTTTGAGGGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCTATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTATCCAGGGAATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAATCATGATGCCTCATCAGGGGTTAGCTCAGCATGTCCATACCTTGGGAGGTCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="DUCK_HONGKONG_Y283_1997"/>
+			ATGGAGAAAATAGTGCTTCTTCTTGCAACAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAATGTTACTGTTACACATGCCCAAGACATACTGGAAAGGACACACAACGGGAAGCTCTGCGATCTAAATGGAGTGAAACCTCTCATTTTGAGGGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCTATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTATCCAGGGAATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAATCATGATGCCTCATCAGGGGTTAGCTCAGCATGTCCATACCTTGGGAGGTCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="DUCK_VIETNAM_376_2005"/>
+			ATGGAGAAAATAGTGCTTCTTTTTGCGATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCAACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGCGATCTAGATGGAGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCAATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAATCCAGTCAATGACCTCTGTTACCCAGGGGATTTCAATGACTATGAAGAATTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAGTCATGAAGCCTCATTAGGAGTGAGCTCAGCATGTCCATACCAGGGAAATCCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="MALLARD_VIETNAM_16_2003"/>
+			ATGGAGAAAATAGTGCTTCTTTTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGCGATCTAGATGGAGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCAATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAATCCAGTCAATGACCTCTGTTACCCAGGGGATTTCAATGAATATGAAGAATTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAGTCATGAAGCCTCATTAGGGGTGAGCTCAGCATGTCCATACCAGGGAAAGTCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="CHICKEN_THAILAND_KANCHANABURI_CK_160_2005"/>
+			ATGGAGAAAATAGTGCTTCTTTTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCAACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGTGATCTAGATGGAGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTCCTTGGAAACCCAATGTGTGATGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAATCCAGCCAATGACCTCTGTTACCCAGGGGATTTCAATGACTATGAAGAATTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAGTCATGAAGCCTCATTAGGAGTGAGCTCAGCATGTCCATATCAGGGAAAGTCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="DUCK_GUANGZHOU_20_2005"/>
+			ATGGAGAAAATAGTGCTTCTTCTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAATGGGAAGCTCTGCGACCTAGATGGGGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTCCTCGGGAACCCAATGTGTGACGAATTCATCAATGTACCGGAATGGTCTTACATAGTGGAGAAGGCCAATCCAGCCAATGACCTCTGTTACCCAGGTGATTTCAACGATTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAACCATGAATCCTCATCAGGGGTGAGCTCAGCATGTCCATACCTGGGAAAGCCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="CK_HK_WF157_2003"/>
+			ATGGAGAAAATAGTGCTTCTTCTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACCCACAACGGGAAGCTCTGCGACCTAGATGGAGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTCCTCGGGAACCCAATGTGTGACGAATTCATCAATGTACCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCATCCAATGACCTCTGTTACCCAGGGGATTTCAACAATTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGCTCTTGGTCCAATCATGAAGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCTGGGAAAGCCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="SWINE_ANHUI_2004"/>
+			ATGGAGAAAATAGTGCTTCTTCTTGCAATAGTCAGTCTTGTTAAAGGTGATCAGATTTGCACTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCTCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGCGACCTAGATGGAGTGAAGCCTCTAATTTTAAGAGATTGTAGTGTAGCTGGATGGCTCCTCGGGAACCCAATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAATCCAGCCAATGACCTCTGTTACCCAGGGGATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCGATCATGAAGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCAGGGAAGGTCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="DUCK_VIETNAM_272_2005"/>
+			ATGGAGAAAATAGTGCTTCTTTTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGCGATCTAGATGGAGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTCCTTGGAAATCCAATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAATCCAGTCAATGACCTCTGTTACCCAGGGGATTTCAATGACTATGAAGAATTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGCCCAGTCATGAAGCCTCATTAGGGGTGAGCTCAGCATGTCCATACCAGGGAAGGTCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="HONGKONG_1997_1998"/>
+			------------------------------------------------GACCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGATACAATAATGGAAAAGAATGTTACTGTTACACATGCCCAAGACATACTGGAAAGGACACACGACGGGAAGCTCTGCGATCTAAATGGAGTGAAACCTCTCATTTTGAGGGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCTATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTATCCAGGGAATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAATCATGATGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCTTGGGAGGTCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="GOOSE_SHANTOU_2216_2005"/>
+			ATGGAGAAAATAGTGCTTCTTCTTGCAATAATCAGCCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAATGGGAAGCTCTGCGACTTAGATGGGGTGAAGCCTCTAATTTTGAGAGACTGTAGTGTAGCTGGATGGCTCCTCGGGAACCCAATGTGTGACGAATTCATCAATGTACCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTACCCAGGTGATTTCAACGATTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAATCATGAAGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCTGGGAAAGCCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="TREESPARROW_HENAN_3_2004"/>
+			ATGGAGAAAATAGTGCTTCTTCTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACTATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGCGATCTAGATGGAGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCAATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTACCCAGGGGATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCGGATCATCCCCAAAAGTTCTTGGTCCAATCATGATGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCAGGGGAAGCCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="PEREGRINEFALCON_HK_D0028_2004"/>
+			ATGGAGAAAATAGTGCTTCTTCTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAATGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAATGGGAAGCTCTGTGACCTAGATGGGGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTCGCTGGATGGCTCCTCGGGAACCCAATGTGTGACGAATTCATCAATGTACCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTACCCAGGTGATTTCAACGATTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAATCATGAAGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCTGGGAAAGCCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="TREESPARROW_HENAN_2_2004"/>
+			ATGGAGAAAATAGTGCTTCTTCTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCTCAAGACATATTGGAAAAGACACACAACGGGAAGCTCTGCGACCTAGATGGAGTGAAGCCTCTAATTTTGAAAGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCAATGTGTGACGAATTCATCAATGTGCCGGAGTGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTACCCAGGGGATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAAAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCGATCATGAAGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCTGGGGAAGCCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="HONGKONG_538_1997"/>
+			------------------------------------------------GATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAATGTTACTGTTACACATGCCCAAGACATACTGGAAAGGACACACAACGGGAAGCTCTGCGATCTAAATGGAGTGAAACCTCTCATTTTGAGGGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCTATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTATCCAGGGAATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAATCATGATGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCTTGGGAGGTCCTCCTTTTTCAGAAATGTG [...]
+		</sequence>
+	</alignment>
+
+	<!-- The unique patterns from 1 to end                                       -->
+	<!-- npatterns=217                                                           -->
+	<patterns id="patterns" from="1">
+		<alignment idref="alignment"/>
+	</patterns>
+
+	<!-- A prior assumption that the population size has remained constant       -->
+	<!-- throughout the time spanned by the genealogy.                           -->
+	<constantSize id="constant" units="years">
+		<populationSize>
+			<parameter id="constant.popSize" value="80.0" lower="0.0" upper="Infinity"/>
+		</populationSize>
+	</constantSize>
+
+	<!-- Generate a random starting tree under the coalescent process            -->
+	<coalescentTree id="startingTree">
+		<taxa idref="taxa"/>
+		<constantSize idref="constant"/>
+	</coalescentTree>
+
+	<!-- Generate a tree model                                                   -->
+	<treeModel id="treeModel">
+		<coalescentTree idref="startingTree"/>
+		<rootHeight>
+			<parameter id="treeModel.rootHeight"/>
+		</rootHeight>
+		<nodeHeights internalNodes="true">
+			<parameter id="treeModel.internalNodeHeights"/>
+		</nodeHeights>
+		<nodeHeights internalNodes="true" rootNode="true">
+			<parameter id="treeModel.allInternalNodeHeights"/>
+		</nodeHeights>
+
+		<!-- START Tip date sampling                                                 -->
+		<leafHeight taxon="TREESPARROW_HENAN_1_2004">
+			<parameter id="age(TREESPARROW_HENAN_1_2004)"/>
+		</leafHeight>
+		<leafHeight taxon="CHICKEN_HONGKONG_915_1997">
+			<parameter id="age(CHICKEN_HONGKONG_915_1997)"/>
+		</leafHeight>
+
+		<!-- END Tip date sampling                                                   -->
+	</treeModel>
+
+	<!-- Generate a coalescent likelihood                                        -->
+	<coalescentLikelihood id="coalescent">
+		<model>
+			<constantSize idref="constant"/>
+		</model>
+		<populationTree>
+			<treeModel idref="treeModel"/>
+		</populationTree>
+	</coalescentLikelihood>
+
+	<!-- The strict clock (Uniform rates across branches)                        -->
+	<strictClockBranchRates id="branchRates">
+		<rate>
+			<parameter id="clock.rate" value="4.0E-4" lower="0.0" upper="100.0"/>
+		</rate>
+	</strictClockBranchRates>
+
+	<!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+	<HKYModel id="hky">
+		<frequencies>
+			<frequencyModel dataType="nucleotide">
+				<frequencies>
+					<parameter id="frequencies" value="0.25 0.25 0.25 0.25"/>
+				</frequencies>
+			</frequencyModel>
+		</frequencies>
+		<kappa>
+			<parameter id="kappa" value="2.0" lower="0.0" upper="Infinity"/>
+		</kappa>
+	</HKYModel>
+
+	<!-- site model                                                              -->
+	<siteModel id="siteModel">
+		<substitutionModel>
+			<HKYModel idref="hky"/>
+		</substitutionModel>
+	</siteModel>
+	<treeLikelihood id="treeLikelihood" useAmbiguities="false">
+		<patterns idref="patterns"/>
+		<treeModel idref="treeModel"/>
+		<siteModel idref="siteModel"/>
+		<strictClockBranchRates idref="branchRates"/>
+	</treeLikelihood>
+
+	<!-- Define operators                                                        -->
+	<operators id="operators">
+		<scaleOperator scaleFactor="0.75" weight="0.1">
+			<parameter idref="kappa"/>
+		</scaleOperator>
+		<deltaExchange delta="0.01" weight="0.1">
+			<parameter idref="frequencies"/>
+		</deltaExchange>
+		<scaleOperator scaleFactor="0.75" weight="3">
+			<parameter idref="clock.rate"/>
+		</scaleOperator>
+		<subtreeSlide size="8.0" gaussian="true" weight="15">
+			<treeModel idref="treeModel"/>
+		</subtreeSlide>
+		<narrowExchange weight="15">
+			<treeModel idref="treeModel"/>
+		</narrowExchange>
+		<wideExchange weight="3">
+			<treeModel idref="treeModel"/>
+		</wideExchange>
+		<wilsonBalding weight="3">
+			<treeModel idref="treeModel"/>
+		</wilsonBalding>
+		<scaleOperator scaleFactor="0.75" weight="3">
+			<parameter idref="treeModel.rootHeight"/>
+		</scaleOperator>
+		<uniformOperator weight="30">
+			<parameter idref="treeModel.internalNodeHeights"/>
+		</uniformOperator>
+		<scaleOperator scaleFactor="0.75" weight="3">
+			<parameter idref="constant.popSize"/>
+		</scaleOperator>
+		<upDownOperator scaleFactor="0.75" weight="3">
+			<up>
+				<parameter idref="clock.rate"/>
+			</up>
+			<down>
+				<parameter idref="treeModel.allInternalNodeHeights"/>
+			</down>
+		</upDownOperator>
+		<randomWalkOperator windowSize="1.0" weight="1">
+			<parameter idref="age(TREESPARROW_HENAN_1_2004)"/>
+		</randomWalkOperator>
+		<randomWalkOperator windowSize="1.0" weight="1">
+			<parameter idref="age(CHICKEN_HONGKONG_915_1997)"/>
+		</randomWalkOperator>
+	</operators>
+
+	<!-- Define MCMC                                                             -->
+	<mcmc id="mcmc" chainLength="10000000" autoOptimize="true">
+		<posterior id="posterior">
+			<prior id="prior">
+				<logNormalPrior mean="1.0" stdev="1.25" offset="0.0" meanInRealSpace="false">
+					<parameter idref="kappa"/>
+				</logNormalPrior>
+				<oneOnXPrior>
+					<parameter idref="constant.popSize"/>
+				</oneOnXPrior>
+				<coalescentLikelihood idref="coalescent"/>
+			</prior>
+			<likelihood id="likelihood">
+				<treeLikelihood idref="treeLikelihood"/>
+			</likelihood>
+		</posterior>
+		<operators idref="operators"/>
+
+		<!-- write log to screen                                                     -->
+		<log id="screenLog" logEvery="100000">
+			<column label="Posterior" dp="4" width="12">
+				<posterior idref="posterior"/>
+			</column>
+			<column label="Prior" dp="4" width="12">
+				<prior idref="prior"/>
+			</column>
+			<column label="Likelihood" dp="4" width="12">
+				<likelihood idref="likelihood"/>
+			</column>
+			<column label="rootHeight" sf="6" width="12">
+				<parameter idref="treeModel.rootHeight"/>
+			</column>
+			<column label="clock.rate" sf="6" width="12">
+				<parameter idref="clock.rate"/>
+			</column>
+		</log>
+
+		<!-- write log to file                                                       -->
+		<log id="fileLog" logEvery="10000" fileName="FluTipSmapling.log" overwrite="false">
+			<posterior idref="posterior"/>
+			<prior idref="prior"/>
+			<likelihood idref="likelihood"/>
+			<parameter idref="treeModel.rootHeight"/>
+			<parameter idref="constant.popSize"/>
+			<parameter idref="kappa"/>
+			<parameter idref="frequencies"/>
+			<parameter idref="clock.rate"/>
+
+			<!-- START Tip date sampling                                                 -->
+			<parameter idref="age(TREESPARROW_HENAN_1_2004)"/>
+			<parameter idref="age(CHICKEN_HONGKONG_915_1997)"/>
+
+			<!-- END Tip date sampling                                                   -->
+			<treeLikelihood idref="treeLikelihood"/>
+			<coalescentLikelihood idref="coalescent"/>
+		</log>
+
+		<!-- write tree log to file
+		<logTree id="treeFileLog" logEvery="10000" nexusFormat="true" fileName="FluTipSmapling.trees" sortTranslationTable="true">
+			<treeModel idref="treeModel"/>
+			<strictClockBranchRates idref="branchRates"/>
+			<posterior idref="posterior"/>
+		</logTree>-->
+	</mcmc>
+	<report>
+		<property name="timer">
+			<mcmc idref="mcmc"/>
+		</property>
+	</report>
+</beast>
diff --git a/examples/beast2vs1/beast1/testStrictClockTipTime.xml b/examples/beast2vs1/beast1/testStrictClockTipTime.xml
new file mode 100644
index 0000000..764e82f
--- /dev/null
+++ b/examples/beast2vs1/beast1/testStrictClockTipTime.xml
@@ -0,0 +1,330 @@
+<?xml version="1.0" standalone="yes"?>
+
+<!-- Generated by BEAUTi v1.7.0 Prerelease r3910                             -->
+<!--       by Alexei J. Drummond and Andrew Rambaut                          -->
+<!--       Department of Computer Science, University of Auckland and        -->
+<!--       Institute of Evolutionary Biology, University of Edinburgh        -->
+<!--       http://beast.bio.ed.ac.uk/                                        -->
+<beast>
+
+    <!-- The list of taxa analyse (can also include dates/ages).                 -->
+    <!-- ntax=17                                                                 -->
+    <taxa id="taxa">
+        <taxon id="D4Brazi82">
+            <date value="1982.0" direction="forwards" units="years"/>
+        </taxon>
+        <taxon id="D4ElSal83">
+            <date value="1983.0" direction="forwards" units="years"/>
+        </taxon>
+        <taxon id="D4ElSal94">
+            <date value="1994.0" direction="forwards" units="years"/>
+        </taxon>
+        <taxon id="D4Indon76">
+            <date value="1976.0" direction="forwards" units="years"/>
+        </taxon>
+        <taxon id="D4Indon77">
+            <date value="1977.0" direction="forwards" units="years"/>
+        </taxon>
+        <taxon id="D4Mexico84">
+            <date value="1984.0" direction="forwards" units="years"/>
+        </taxon>
+        <taxon id="D4NewCal81">
+            <date value="1981.0" direction="forwards" units="years"/>
+        </taxon>
+        <taxon id="D4Philip64">
+            <date value="1964.0" direction="forwards" units="years"/>
+        </taxon>
+        <taxon id="D4Philip56">
+            <date value="1956.0" direction="forwards" units="years"/>
+        </taxon>
+        <taxon id="D4Philip84">
+            <date value="1984.0" direction="forwards" units="years"/>
+        </taxon>
+        <taxon id="D4PRico86">
+            <date value="1986.0" direction="forwards" units="years"/>
+        </taxon>
+        <taxon id="D4SLanka78">
+            <date value="1978.0" direction="forwards" units="years"/>
+        </taxon>
+        <taxon id="D4Tahiti79">
+            <date value="1979.0" direction="forwards" units="years"/>
+        </taxon>
+        <taxon id="D4Tahiti85">
+            <date value="1985.0" direction="forwards" units="years"/>
+        </taxon>
+        <taxon id="D4Thai63">
+            <date value="1963.0" direction="forwards" units="years"/>
+        </taxon>
+        <taxon id="D4Thai78">
+            <date value="1978.0" direction="forwards" units="years"/>
+        </taxon>
+        <taxon id="D4Thai84">
+            <date value="1984.0" direction="forwards" units="years"/>
+        </taxon>
+    </taxa>
+
+    <!-- The sequence alignment (each sequence refers to a taxon above).         -->
+    <!-- ntax=17 nchar=1485                                                      -->
+    <alignment id="alignment" dataType="nucleotide">
+        <sequence>
+            <taxon idref="D4Brazi82"/>
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence>
+            <taxon idref="D4ElSal83"/>
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence>
+            <taxon idref="D4ElSal94"/>
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTGGTGCTAGAACATGGAGGATGCGTCACAACCATAGCCCAGGGAAAACCAACCTTGGATTTTGAATTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGGAATGGCTGTGGCTTGCTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGATACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence>
+            <taxon idref="D4Indon76"/>
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTAAAAGAGGAACAAGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence>
+            <taxon idref="D4Indon77"/>
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTAAAAGAGGAACAAGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTAGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAACCATGGAGTT [...]
+        </sequence>
+        <sequence>
+            <taxon idref="D4Mexico84"/>
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTAGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGCTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence>
+            <taxon idref="D4NewCal81"/>
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence>
+            <taxon idref="D4Philip64"/>
+            ATGCGATGCGTGGGAGTGGGGAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATTTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCGATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAACCTTATCTCAAAGAGGAACAAGATCAACAGTACATCTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGATACATCCAACCATGGAGTG [...]
+        </sequence>
+        <sequence>
+            <taxon idref="D4Philip56"/>
+            ATGCGATGCGTGGGAGTGGGGAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATTTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCGATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAACCTTATCTCAAAGAGGAACAAGATCAACAGTACATCTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGCTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTAGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACATATCCAACCATGGAGTG [...]
+        </sequence>
+        <sequence>
+            <taxon idref="D4Philip84"/>
+            ATGCGATGCGTAGGAGTGGGGAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACTTAGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAAGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCGATATCAAACATAACCACGGCAACAAGATGCCCAACGCAAGGAGAACCTTATCTCAAAGAGGAACAAGATCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTCTCATGCTCGGGAAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATATACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAACCATGGAGTG [...]
+        </sequence>
+        <sequence>
+            <taxon idref="D4PRico86"/>
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGGGAGCCCTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATCTGGTCCAAATTGAGAACCTTGAGTACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence>
+            <taxon idref="D4SLanka78"/>
+            ATGCGATGCGTGGGAGTGGGGAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAAGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCCATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAGCCCTGTCTCAAAGAGGAACAGGATCAACAGTACATCTGCCGGAGAGACGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCCTGCTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACAGGCAACTTAGTCCGAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAACCACGGAGTG [...]
+        </sequence>
+        <sequence>
+            <taxon idref="D4Tahiti79"/>
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence>
+            <taxon idref="D4Tahiti85"/>
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTTTCAGGTGGAGCATGGGTCGATTTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATCTGGTCCAAATTGAGAACCTTGAATACACAGTGGTCATAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence>
+            <taxon idref="D4Thai63"/>
+            ATGCGATGCGTAGGAGTGGGGAACAGGGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCTCAAGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCGATATCAAACATAACCACGGCGACAAGATGTCCAACGCAAGGAGAGCCTTATCTCAAAGAGGAACAAGATCAACAGTACATCTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTACTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACAGGCAACTTGGTTCGAATTGAGAACCTTGAATACACAGTGGTTGTGACAGTCCACAACGGAGACACCCATGCAGTAGGAAATGACATATCCAACCATGGAGTG [...]
+        </sequence>
+        <sequence>
+            <taxon idref="D4Thai78"/>
+            ATGCGATGCGTAGGAGTGGGGAACAGAGACTTTGTAGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCCATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTACCTCAAAGAGGAACAAGATCAACAGTACATCTGCCGGAGAGACGTGGTAGATAGAGGGTGGGGCAACGGCTGTGGCTTGCTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACAGGCAACTTAGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCTGTAGGAAATGATACATCCAACCACGGAGTG [...]
+        </sequence>
+        <sequence>
+            <taxon idref="D4Thai84"/>
+            ATGCGATGCGTAGGAGTAGGGAACAGAGACTTTGTAGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAGGGAAAACCAACCCTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCCATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTACCTCAAAGAGGAACAAGATCAACAGTACATCTGCCGGAGAGACGTGGTAGACAGAGGGTGGGGCAACGGCTGTGGCTTGTTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACGGGCAACTTAGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCTGTAGGAAATGATACATCCAACCACGGAGTG [...]
+        </sequence>
+    </alignment>
+
+    <!-- The unique patterns for all positions                                   -->
+    <!-- npatterns=138                                                           -->
+    <patterns id="patterns" from="1">
+        <alignment idref="alignment"/>
+    </patterns>
+
+	<!-- A prior assumption that the population size has remained constant       -->
+	<!-- throughout the time spanned by the genealogy.                           -->
+	<constantSize id="constant" units="substitutions">
+		<populationSize>
+			<parameter id="constant.popSize" value="380.0" lower="0.0" upper="38000.0"/>
+		</populationSize>
+	</constantSize>
+
+	<!-- Generate a random starting tree under the coalescent process            -->
+	<coalescentTree id="startingTree" rootHeight="380.0">
+		<taxa idref="taxa"/>
+		<constantSize idref="constant"/>
+	</coalescentTree>
+
+	<!-- Generate a tree model                                                   -->
+	<treeModel id="treeModel">
+		<coalescentTree idref="startingTree"/>
+		<rootHeight>
+			<parameter id="treeModel.rootHeight"/>
+		</rootHeight>
+		<nodeHeights internalNodes="true">
+			<parameter id="treeModel.internalNodeHeights"/>
+		</nodeHeights>
+		<nodeHeights internalNodes="true" rootNode="true">
+			<parameter id="treeModel.allInternalNodeHeights"/>
+		</nodeHeights>
+	</treeModel>
+
+	<!-- Generate a coalescent likelihood                                        -->
+	<coalescentLikelihood id="coalescent">
+		<model>
+			<constantSize idref="constant"/>
+		</model>
+		<populationTree>
+			<treeModel idref="treeModel"/>
+		</populationTree>
+	</coalescentLikelihood>
+
+	<!-- The strict clock (Uniform rates across branches)                        -->
+	<strictClockBranchRates id="branchRates">
+		<rate>
+			<parameter id="clock.rate" value="2.3E-5" lower="0.0" upper="100.0"/>
+		</rate>
+	</strictClockBranchRates>
+
+	<!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+	<HKYModel id="hky">
+		<frequencies>
+			<frequencyModel dataType="nucleotide">
+				<frequencies>
+					<parameter id="frequencies" value="0.25 0.25 0.25 0.25"/>
+				</frequencies>
+			</frequencyModel>
+		</frequencies>
+		<kappa>
+			<parameter id="kappa" value="2.0" lower="0.0" upper="Infinity"/>
+		</kappa>
+	</HKYModel>
+
+	<!-- site model                                                              -->
+	<siteModel id="siteModel">
+		<substitutionModel>
+			<HKYModel idref="hky"/>
+		</substitutionModel>
+	</siteModel>
+
+	<!-- Likelihood for tree given sequence data                                 -->
+	<treeLikelihood id="treeLikelihood" useAmbiguities="false">
+		<patterns idref="patterns"/>
+		<treeModel idref="treeModel"/>
+		<siteModel idref="siteModel"/>
+		<strictClockBranchRates idref="branchRates"/>
+	</treeLikelihood>
+
+	<!-- Define operators                                                        -->
+	<operators id="operators">
+		<scaleOperator scaleFactor="0.75" weight="0.1">
+			<parameter idref="kappa"/>
+		</scaleOperator>
+		<deltaExchange delta="0.01" weight="0.1">
+			<parameter idref="frequencies"/>
+		</deltaExchange>
+		<subtreeSlide size="0.0077" gaussian="true" weight="15">
+			<treeModel idref="treeModel"/>
+		</subtreeSlide>
+		<narrowExchange weight="15">
+			<treeModel idref="treeModel"/>
+		</narrowExchange>
+		<wideExchange weight="3">
+			<treeModel idref="treeModel"/>
+		</wideExchange>
+		<wilsonBalding weight="3">
+			<treeModel idref="treeModel"/>
+		</wilsonBalding>
+		<scaleOperator scaleFactor="0.75" weight="3">
+			<parameter idref="treeModel.rootHeight"/>
+		</scaleOperator>
+		<uniformOperator weight="30">
+			<parameter idref="treeModel.internalNodeHeights"/>
+		</uniformOperator>
+		<scaleOperator scaleFactor="0.75" weight="3">
+			<parameter idref="constant.popSize"/>
+		</scaleOperator>
+        <scaleOperator scaleFactor="0.75" weight="3">
+            <parameter idref="clock.rate"/>
+        </scaleOperator>
+		<upDownOperator scaleFactor="0.75" weight="3">
+			<up>
+                <parameter idref="clock.rate"/>
+			</up>
+			<down>
+				<parameter idref="treeModel.allInternalNodeHeights"/>
+			</down>
+		</upDownOperator>
+	</operators>
+
+	<!-- Define MCMC                                                             -->
+	<mcmc id="mcmc" chainLength="10000000" autoOptimize="true">
+		<posterior id="posterior">
+			<prior id="prior">
+				<logNormalPrior mean="1.0" stdev="1.25" offset="0.0" meanInRealSpace="false">
+					<parameter idref="kappa"/>
+				</logNormalPrior>
+				<uniformPrior lower="0.0" upper="1.0">
+					<parameter idref="frequencies"/>
+				</uniformPrior>
+				<oneOnXPrior>
+					<parameter idref="constant.popSize"/>
+				</oneOnXPrior>
+                <uniformPrior lower="0.0" upper="100.0">
+					<parameter idref="clock.rate"/>
+				</uniformPrior>
+				<coalescentLikelihood idref="coalescent"/>
+			</prior>
+			<likelihood id="likelihood">
+				<treeLikelihood idref="treeLikelihood"/>
+			</likelihood>
+		</posterior>
+		<operators idref="operators"/>
+
+		<!-- write log to screen                                                     -->
+		<log id="screenLog" logEvery="100000">
+			<column label="Posterior" dp="4" width="12">
+				<posterior idref="posterior"/>
+			</column>
+			<column label="Prior" dp="4" width="12">
+				<prior idref="prior"/>
+			</column>
+			<column label="Likelihood" dp="4" width="12">
+				<likelihood idref="likelihood"/>
+			</column>
+			<column label="rootHeight" sf="6" width="12">
+				<parameter idref="treeModel.rootHeight"/>
+			</column>
+			<column label="clock.rate" sf="6" width="12">
+				<parameter idref="clock.rate"/>
+			</column>
+		</log>
+
+		<!-- write log to file                                                       -->
+		<log id="fileLog" logEvery="1000" fileName="testStrictClockTipTime.log" overwrite="false">
+			<posterior idref="posterior"/>
+			<prior idref="prior"/>
+			<likelihood idref="likelihood"/>
+			<parameter idref="treeModel.rootHeight"/>
+			<parameter idref="constant.popSize"/>
+			<parameter idref="kappa"/>
+			<parameter idref="frequencies"/>
+			<parameter idref="clock.rate"/>
+			<treeLikelihood idref="treeLikelihood"/>
+			<coalescentLikelihood idref="coalescent"/>
+		</log>
+
+		<!-- write tree log to file
+		<logTree id="treeFileLog" logEvery="1000" nexusFormat="true" fileName="testStrictClockTipTime.trees" sortTranslationTable="true">
+			<treeModel idref="treeModel"/>
+			<strictClockBranchRates idref="branchRates"/>
+			<posterior idref="posterior"/>
+		</logTree>-->
+	</mcmc>
+	<report>
+		<property name="timer">
+			<mcmc idref="mcmc"/>
+		</property>
+	</report>
+</beast>
diff --git a/examples/beast2vs1/beast1/testUCRelaxedClockLogNormal.xml b/examples/beast2vs1/beast1/testUCRelaxedClockLogNormal.xml
new file mode 100644
index 0000000..6c6af39
--- /dev/null
+++ b/examples/beast2vs1/beast1/testUCRelaxedClockLogNormal.xml
@@ -0,0 +1,274 @@
+<?xml version="1.0" standalone="yes"?>
+
+<!-- Generated by BEAUTi v1.7.0 Prerelease r3910                             -->
+<!--       by Alexei J. Drummond and Andrew Rambaut                          -->
+<!--       Department of Computer Science, University of Auckland and        -->
+<!--       Institute of Evolutionary Biology, University of Edinburgh        -->
+<!--       http://beast.bio.ed.ac.uk/                                        -->
+<beast>
+
+	<!-- The list of taxa to be analysed (can also include dates/ages).          -->
+	<!-- ntax=6                                                                  -->
+	<taxa id="taxa">
+		<taxon id="human"/>
+		<taxon id="chimp"/>
+		<taxon id="bonobo"/>
+		<taxon id="gorilla"/>
+		<taxon id="orangutan"/>
+		<taxon id="siamang"/>
+	</taxa>
+
+	<!-- The sequence alignment (each sequence refers to a taxon above).         -->
+	<!-- ntax=6 nchar=768                                                        -->
+	<alignment id="alignment" dataType="nucleotide">
+		<sequence>
+			<taxon idref="human"/>
+			AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCACCTCGGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="chimp"/>
+			AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCACCTCAGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="bonobo"/>
+			AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAGC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTTGAATTTGCAATTCAATATGAAAA-TCACCTCAGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="gorilla"/>
+			AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTAAACATAGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA-CAACACTTAATTTCTGTAAGGACTGCAAAACCCTACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCAATGGGACTCAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAT-TCACCTCGGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="orangutan"/>
+			AGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA-CAGCACTTAATTTCTGTAAGGACTGCAAAACCCCACTTTGCATCAACTGAGCGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCCTAGACCGATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAT-TGGCTTCAGTCCAAAGCCCCGGCAGGCCTTAAAGCTGCTCCTTCGAATTTGCAATTCAACATGACAA-TCACCTCAGGGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="siamang"/>
+			AGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTAACAAAACTTAATTTCTGCAAGGGCTGCAAAACCCTACTTTGCATCAACCGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCGATGGGACTTAAACCCATAAAAATTTAGTTAACAGCTAAACACCCTAAACAACCTGGCTTCAATCTAAAGCCCCGGCAGA-GTTGAAGCTGCTTCTTTGAACTTGCAATTCAACGTGAAAAATCACTTCGGAGCT [...]
+		</sequence>
+	</alignment>
+
+	<!-- The unique patterns from 1 to end                                       -->
+	<!-- npatterns=69                                                            -->
+	<patterns id="patterns" from="1">
+		<alignment idref="alignment"/>
+	</patterns>
+
+	<!-- A prior assumption that the population size has remained constant       -->
+	<!-- throughout the time spanned by the genealogy.                           -->
+	<constantSize id="constant" units="substitutions">
+		<populationSize>
+			<parameter id="popSize" value="0.077" lower="0.0" upper="Infinity"/>
+		</populationSize>
+	</constantSize>
+
+	<newick id="startingTree">
+        (siamang:0.06318470579939774,((gorilla:0.031056173315146828,((chimp:0.00982869388112981,bonobo:0.00982869388112981)
+        :0.01030402958978773,human:0.02013272347091754):0.010923449844229289):0.022256750048834654,orangutan:0.05331292336398148)
+        :0.009871782435416254);
+    </newick>
+
+	<!-- Generate a tree model                                                   -->
+	<treeModel id="treeModel">
+		<coalescentTree idref="startingTree"/>
+		<rootHeight>
+			<parameter id="tree.height"/>
+		</rootHeight>
+		<nodeHeights internalNodes="true">
+			<parameter id="treeModel.internalNodeHeights"/>
+		</nodeHeights>
+		<nodeHeights internalNodes="true" rootNode="true">
+			<parameter id="treeModel.allInternalNodeHeights"/>
+		</nodeHeights>
+	</treeModel>
+
+	<!-- Generate a coalescent likelihood                                        -->
+	<coalescentLikelihood id="coalescent">
+		<model>
+			<constantSize idref="constant"/>
+		</model>
+		<populationTree>
+			<treeModel idref="treeModel"/>
+		</populationTree>
+	</coalescentLikelihood>
+
+	<!-- The uncorrelated relaxed clock (Drummond, Ho, Phillips & Rambaut (2006) PLoS Biology 4, e88 )-->
+	<discretizedBranchRates id="branchRates">
+		<treeModel idref="treeModel"/>
+		<distribution>
+			<logNormalDistributionModel meanInRealSpace="true">
+				<mean>
+					<parameter id="ucld.mean" value="1.0" lower="0.0" upper="Infinity"/>
+				</mean>
+				<stdev>
+					<parameter id="ucld.stdev" value="0.3333333333333333" lower="0.0" upper="Infinity"/>
+				</stdev>
+			</logNormalDistributionModel>
+		</distribution>
+		<rateCategories>
+			<parameter id="branchRates.categories" dimension="10"/>
+		</rateCategories>
+	</discretizedBranchRates>
+	<rateStatistic id="meanRate" name="meanRate" mode="mean" internal="true" external="true">
+		<treeModel idref="treeModel"/>
+		<discretizedBranchRates idref="branchRates"/>
+	</rateStatistic>
+	<rateStatistic id="coefficientOfVariation" name="coefficientOfVariation" mode="coefficientOfVariation" internal="true" external="true">
+		<treeModel idref="treeModel"/>
+		<discretizedBranchRates idref="branchRates"/>
+	</rateStatistic>
+	<rateCovarianceStatistic id="covariance" name="covariance">
+		<treeModel idref="treeModel"/>
+		<discretizedBranchRates idref="branchRates"/>
+	</rateCovarianceStatistic> 
+
+	<!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+	<HKYModel id="hky">
+		<frequencies>
+			<frequencyModel dataType="nucleotide">
+				<frequencies>
+					<parameter id="hky.frequencies" value="0.25 0.25 0.25 0.25"/>
+				</frequencies>
+			</frequencyModel>
+		</frequencies>
+		<kappa>
+			<parameter id="hky.kappa" value="2.0" lower="0.0" upper="Infinity"/>
+		</kappa>
+	</HKYModel>
+
+	<!-- site model                                                              -->
+	<siteModel id="siteModel">
+		<substitutionModel>
+			<HKYModel idref="hky"/>
+		</substitutionModel>
+	</siteModel>
+
+	<!-- Likelihood for tree given sequence data                                 -->
+	<treeLikelihood id="treeLikelihood" useAmbiguities="false">
+		<patterns idref="patterns"/>
+		<treeModel idref="treeModel"/>
+		<siteModel idref="siteModel"/>
+		<discretizedBranchRates idref="branchRates"/> 
+	</treeLikelihood>
+
+	<!-- Define operators                                                        -->
+	<operators id="operators">
+		<scaleOperator scaleFactor="0.75" weight="0.1">
+			<parameter idref="hky.kappa"/>
+		</scaleOperator>
+		<deltaExchange delta="0.01" weight="0.1">
+			<parameter idref="hky.frequencies"/>
+		</deltaExchange>
+		<subtreeSlide size="0.0077" gaussian="true" weight="15">
+			<treeModel idref="treeModel"/>
+		</subtreeSlide>
+		<narrowExchange weight="15">
+			<treeModel idref="treeModel"/>
+		</narrowExchange>
+		<wideExchange weight="3">
+			<treeModel idref="treeModel"/>
+		</wideExchange>
+		<wilsonBalding weight="3">
+			<treeModel idref="treeModel"/>
+		</wilsonBalding>
+		<scaleOperator scaleFactor="0.75" weight="3">
+			<parameter idref="tree.height"/>
+		</scaleOperator>
+		<uniformOperator weight="30">
+			<parameter idref="treeModel.internalNodeHeights"/>
+		</uniformOperator>
+		<scaleOperator scaleFactor="0.75" weight="3">
+			<parameter idref="popSize"/>
+		</scaleOperator>
+		<upDownOperator scaleFactor="0.75" weight="3">
+			<up>
+			</up>
+			<down>
+				<parameter idref="treeModel.allInternalNodeHeights"/>
+			</down>
+		</upDownOperator>
+		<scaleOperator scaleFactor="0.75" weight="3">
+			<parameter idref="ucld.stdev"/>
+		</scaleOperator> 
+		<uniformIntegerOperator weight="10">
+			<parameter idref="branchRates.categories"/>
+		</uniformIntegerOperator>
+		<swapOperator size="1" weight="10" autoOptimize="false">
+            <parameter idref="branchRates.categories"/>
+        </swapOperator>
+        <randomWalkIntegerOperator windowSize="1.0" weight="10">
+            <parameter idref="branchRates.categories"/>
+        </randomWalkIntegerOperator>		 
+	</operators>
+
+	<!-- Define MCMC                                                             -->
+	<mcmc id="mcmc" chainLength="10000000" autoOptimize="true">
+		<posterior id="posterior">
+			<prior id="prior">
+				<logNormalPrior mean="1.0" stdev="1.25" offset="0.0" meanInRealSpace="false">
+					<parameter idref="hky.kappa"/>
+				</logNormalPrior>
+				<uniformPrior lower="0.0" upper="1.0">
+					<parameter idref="hky.frequencies"/>
+				</uniformPrior>
+				<exponentialPrior mean="0.3333333333333333" offset="0.0">
+					<parameter idref="ucld.stdev"/>
+				</exponentialPrior>  
+				<oneOnXPrior>
+					<parameter idref="popSize"/>
+				</oneOnXPrior> 
+				<coalescentLikelihood idref="coalescent"/>
+			</prior>
+			<likelihood id="likelihood">
+				<treeLikelihood idref="treeLikelihood"/>
+			</likelihood>
+		</posterior>
+		<operators idref="operators"/>
+
+		<!-- write log to screen                                                     -->
+		<log id="screenLog" logEvery="100000">
+			<column label="Posterior" dp="4" width="12">
+				<posterior idref="posterior"/>
+			</column>
+			<column label="Prior" dp="4" width="12">
+				<prior idref="prior"/>
+			</column>
+			<column label="Likelihood" dp="4" width="12">
+				<likelihood idref="likelihood"/>
+			</column>
+			<column label="rootHeight" sf="6" width="12">
+				<parameter idref="tree.height"/>
+			</column>
+			
+		</log>
+
+		<!-- write log to file                                                       -->
+		<log id="fileLog" logEvery="10000" fileName="testUCRelaxedClockLogNormal.log" overwrite="false">
+			<posterior idref="posterior"/>
+			<prior idref="prior"/>
+			<treeLikelihood idref="treeLikelihood"/>
+            <coalescentLikelihood idref="coalescent"/>
+            <parameter idref="popSize"/>
+            <parameter idref="tree.height"/>
+			<parameter idref="hky.kappa"/>
+			<parameter idref="hky.frequencies"/>
+			<parameter idref="ucld.mean"/>
+			<parameter idref="ucld.stdev"/>
+			<rateStatistic idref="meanRate"/>
+			<rateStatistic idref="coefficientOfVariation"/>
+			<rateCovarianceStatistic idref="covariance"/>
+			<parameter idref="branchRates.categories"/> 
+		</log>
+
+		<!-- write tree log to file
+		<logTree id="treeFileLog" logEvery="10000" nexusFormat="true" fileName="testUCRelaxedClockLogNormal.trees" sortTranslationTable="true">
+			<treeModel idref="treeModel"/>
+			<discretizedBranchRates idref="branchRates"/> 
+			<posterior idref="posterior"/>
+		</logTree>  -->
+	</mcmc>
+	<report>
+		<property name="timer">
+			<mcmc idref="mcmc"/>
+		</property>
+	</report>
+</beast>
diff --git a/examples/beast2vs1/beast1/testYule.xml b/examples/beast2vs1/beast1/testYule.xml
new file mode 100644
index 0000000..88a3a9c
--- /dev/null
+++ b/examples/beast2vs1/beast1/testYule.xml
@@ -0,0 +1,215 @@
+<?xml version="1.0" standalone="yes"?>
+<!-- Generated by BEAUTi v1.4                                                -->
+<!--       by Alexei J. Drummond and Andrew Rambaut                          -->
+<!--       Department of Computer Science, University of Auckland and        -->
+<!--       Institute of Evolutionary Biology, University of Edinburgh        -->
+<!--       http://evolve.zoo.ox.ac.uk/beast/                                 -->
+<beast>
+
+    <!-- The list of taxa analyse (can also include dates/ages).                 -->
+    <!-- ntax=6                                                                  -->
+    <taxa id="taxa">
+        <taxon id="human"/>
+        <taxon id="chimp"/>
+        <taxon id="bonobo"/>
+        <taxon id="gorilla"/>
+        <taxon id="orangutan"/>
+        <taxon id="siamang"/>
+    </taxa>
+
+    <!-- The sequence alignment (each sequence refers to a taxon above).         -->
+    <!-- ntax=6 nchar=768                                                        -->
+    <alignment id="alignment" dataType="nucleotide">
+        <sequence>
+            <taxon idref="human"/>
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence>
+            <taxon idref="chimp"/>
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence>
+            <taxon idref="bonobo"/>
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAGC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTTGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence>
+            <taxon idref="gorilla"/>
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTAAACATAGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA-CAACACTTAATTTCTGTAAGGACTGCAAAACCCTACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCAATGGGACTCAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAT-TCAC [...]
+        </sequence>
+        <sequence>
+            <taxon idref="orangutan"/>
+            AGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA-CAGCACTTAATTTCTGTAAGGACTGCAAAACCCCACTTTGCATCAACTGAGCGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCCTAGACCGATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAT-TGGCTTCAGTCCAAAGCCCCGGCAGGCCTTAAAGCTGCTCCTTCGAATTTGCAATTCAACATGACAA-TCAC [...]
+        </sequence>
+        <sequence>
+            <taxon idref="siamang"/>
+            AGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTAACAAAACTTAATTTCTGCAAGGGCTGCAAAACCCTACTTTGCATCAACCGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCGATGGGACTTAAACCCATAAAAATTTAGTTAACAGCTAAACACCCTAAACAACCTGGCTTCAATCTAAAGCCCCGGCAGA-GTTGAAGCTGCTTCTTTGAACTTGCAATTCAACGTGAAAAATCAC [...]
+        </sequence>
+    </alignment>
+
+    <!-- The unique patterns for all positions                                   -->
+    <!-- npatterns=69                                                            -->
+    <patterns id="patterns" from="1">
+        <alignment idref="alignment"/>
+    </patterns>
+
+    <!-- This is a simple constant population size coalescent model              -->
+    <!-- that is used to generate an initial tree for the chain.                 -->
+    <constantSize id="initialDemo" units="substitutions">
+        <populationSize>
+            <parameter id="initialDemo.popSize" value="100.0"/>
+        </populationSize>
+    </constantSize>
+
+    <!-- Generate a random starting tree under the coalescent process            -->
+    <coalescentTree id="startingTree">
+        <taxa idref="taxa"/>
+        <constantSize idref="initialDemo"/>
+    </coalescentTree>
+
+    <treeModel id="treeModel">
+        <coalescentTree idref="startingTree"/>
+        <rootHeight>
+            <parameter id="treeModel.rootHeight"/>
+        </rootHeight>
+        <nodeHeights internalNodes="true">
+            <parameter id="treeModel.internalNodeHeights"/>
+        </nodeHeights>
+        <nodeHeights internalNodes="true" rootNode="true">
+            <parameter id="treeModel.allInternalNodeHeights"/>
+        </nodeHeights>
+    </treeModel>
+
+    <!-- A prior on the distribution node heights defined given                  -->
+    <!-- a Yule speciation process (a pure birth process).                       -->
+    <yuleModel id="yule" units="substitutions">
+        <birthRate>
+            <parameter id="yule.birthRate" value="1.0" lower="0.0" upper="1000000.0"/>
+        </birthRate>
+    </yuleModel>
+
+    <speciationLikelihood id="speciation">
+        <model>
+            <yuleModel idref="yule"/>
+        </model>
+        <speciesTree>
+            <treeModel idref="treeModel"/>
+        </speciesTree>
+    </speciationLikelihood>
+
+    <!-- The strict clock (Uniform rates across branches)                        -->
+    <strictClockBranchRates id="branchRates">
+        <rate>
+            <parameter id="clock.rate" value="0.0040"/>
+        </rate>
+    </strictClockBranchRates>
+
+    <!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+    <hkyModel id="hky">
+        <frequencies>
+            <frequencyModel dataType="nucleotide">
+                <alignment idref="alignment"/>
+                <frequencies>
+                    <parameter id="hky.frequencies" dimension="4"/>
+                </frequencies>
+            </frequencyModel>
+        </frequencies>
+        <kappa>
+            <parameter id="hky.kappa" value="1.0" lower="0.0" upper="100.0"/>
+        </kappa>
+    </hkyModel>
+
+    <!-- site model                                                              -->
+    <siteModel id="siteModel">
+        <substitutionModel>
+            <hkyModel idref="hky"/>
+        </substitutionModel>
+    </siteModel>
+
+    <treeLikelihood id="treeLikelihood">
+        <patterns idref="patterns"/>
+        <treeModel idref="treeModel"/>
+        <siteModel idref="siteModel"/>
+        <strictClockBranchRates idref="branchRates"/>
+    </treeLikelihood>
+
+    <operators id="operators">
+        <scaleOperator scaleFactor="0.75" weight="1">
+            <parameter idref="hky.kappa"/>
+        </scaleOperator>
+        <scaleOperator scaleFactor="0.75" weight="3">
+            <parameter idref="yule.birthRate"/>
+        </scaleOperator>
+        <scaleOperator scaleFactor="0.75" weight="3">
+            <parameter idref="treeModel.rootHeight"/>
+        </scaleOperator>
+        <uniformOperator weight="30">
+            <parameter idref="treeModel.internalNodeHeights"/>
+        </uniformOperator>
+        <subtreeSlide size="3.8" gaussian="true" weight="15">
+            <treeModel idref="treeModel"/>
+        </subtreeSlide>
+        <narrowExchange weight="15">
+            <treeModel idref="treeModel"/>
+        </narrowExchange>
+        <wideExchange weight="3">
+            <treeModel idref="treeModel"/>
+        </wideExchange>
+        <wilsonBalding weight="3">
+            <treeModel idref="treeModel"/>
+        </wilsonBalding>
+    </operators>
+
+    <mcmc id="mcmc" chainLength="1000000" autoOptimize="true">
+        <posterior id="posterior">
+            <prior id="prior">
+                <speciationLikelihood idref="speciation"/>
+            </prior>
+            <likelihood id="likelihood">
+                <treeLikelihood idref="treeLikelihood"/>
+            </likelihood>
+        </posterior>
+        <operators idref="operators"/>
+        <log id="screenLog" logEvery="10000">
+            <column label="Posterior" dp="4" width="12">
+                <posterior idref="posterior"/>
+            </column>
+            <column label="Root Height" sf="6" width="12">
+                <parameter idref="treeModel.rootHeight"/>
+            </column>
+            <column label="L(tree)" dp="4" width="12">
+                <treeLikelihood idref="treeLikelihood"/>
+            </column>
+            <column label="L(speciation)" dp="4" width="12">
+                <speciationLikelihood idref="speciation"/>
+            </column>
+        </log>
+        <log id="fileLog" logEvery="100" fileName="testYule.log">
+            <posterior idref="posterior"/>
+            <parameter idref="yule.birthRate"/>
+            <parameter idref="hky.kappa"/>
+            <parameter idref="treeModel.rootHeight"/>
+            <treeLikelihood idref="treeLikelihood"/>
+            <speciationLikelihood idref="speciation"/>
+        </log>
+        <logTree id="treeFileLog" logEvery="1000" nexusFormat="true" fileName="testYule.trees">
+            <treeModel idref="treeModel"/>
+            <posterior idref="posterior"/>
+        </logTree>
+    </mcmc>
+
+    <report>
+        <property name="timer">
+            <object idref="mcmc"/>
+        </property>
+    </report>
+
+    <traceAnalysis fileName="testYule.log" burnIn="1000"/>
+
+    <treeTraceAnalysis fileName="testYule.trees"/>
+
+    <marginalLikelihoodAnalysis fileName="testYule.log">
+        <likelihoodColumn name="treeLikelihood" harmonicOnly="false" bootstrap="true"/>
+    </marginalLikelihoodAnalysis>
+
+
+</beast>
diff --git a/examples/beast2vs1/beast1/testYuleModel_10taxa.xml b/examples/beast2vs1/beast1/testYuleModel_10taxa.xml
new file mode 100644
index 0000000..e443f16
--- /dev/null
+++ b/examples/beast2vs1/beast1/testYuleModel_10taxa.xml
@@ -0,0 +1,108 @@
+<?xml version="1.0"?>
+<!-- $Id: testCoalescent.xml,v 1.2 2005/07/11 23:22:40 rambaut Exp $ -->
+<!-- Tests the coalescent prior -->
+
+<beast>
+
+    <taxa id="taxa1">
+        <taxon id="A"/>
+        <taxon id="B"/>
+        <taxon id="C"/>
+        <taxon id="D"/>
+        <taxon id="E"/>
+        <taxon id="F"/>
+        <taxon id="G"/>
+        <taxon id="H"/>
+        <taxon id="I"/>
+        <taxon id="J"/>
+    </taxa>
+
+    <!-- create a demographic model and intialize currentPopulationSize parameter -->
+    <constantSize id="demo1" units="years">
+        <populationSize>
+            <parameter id="demo1.pop1" value="10.0"/>
+        </populationSize>
+    </constantSize>
+
+    <!-- simulate a coalescent tree -->
+    <coalescentTree id="tree1">
+        <demographicModel idref="demo1"/>
+        <taxa idref="taxa1"/>
+    </coalescentTree>
+
+    <!-- A prior on the distribution node heights defined given                  -->
+    <!-- a Yule speciation process (a pure birth process).                       -->
+    <yuleModel id="yule" units="substitutions">
+        <birthRate>
+            <parameter id="yule.birthRate" value="2.0" lower="0.0" upper="100.0"/>
+        </birthRate>
+    </yuleModel>
+
+    <treeModel id="treeModel1">
+        <tree idref="tree1"/>
+        <rootHeight>
+            <parameter id="treeModel1.rootHeight"/>
+        </rootHeight>
+        <nodeHeights rootNode="false" internalNodes="true">
+            <parameter id="treeModel1.internalNodeHeights"/>
+        </nodeHeights>
+        <nodeHeights rootNode="true" internalNodes="true">
+            <parameter id="treeModel1.allNodeHeights"/>
+        </nodeHeights>
+    </treeModel>
+
+    <speciationLikelihood id="speciation">
+        <model>
+            <yuleModel idref="yule"/>
+        </model>
+        <speciesTree>
+            <treeModel idref="treeModel1"/>
+        </speciesTree>
+    </speciationLikelihood>
+
+    <treeLengthStatistic name="TL" id="TL">
+        <treeModel idref="treeModel1"/>
+    </treeLengthStatistic>
+
+    <mcmc id="mcmc1" chainLength="2000000" verbose="false">
+        <speciationLikelihood idref="speciation"/>
+        <log id="logScreen2" logEvery="20000">
+            <column dp="4">
+                <likelihood idref="speciation"/>
+                <parameter idref="treeModel1.rootHeight"/>
+                <treeLengthStatistic idref="TL"/>
+            </column>
+        </log>
+        <log id="log1" logEvery="10" fileName="yulePrior10taxa.log">
+            <likelihood idref="speciation"/>
+            <parameter idref="treeModel1.rootHeight"/>
+            <treeLengthStatistic idref="TL"/>
+        </log>
+        <logTree id="logTree1" logEvery="100" nexusFormat="true"
+                 fileName="yulePrior10taxa.trees">
+            <treeModel idref="treeModel1"/>
+        </logTree>
+        <operators>
+            <subtreeSlide weight="1" gaussian="true" size="1">
+                <treeModel idref="treeModel1"/>
+            </subtreeSlide>
+        </operators>
+    </mcmc>
+
+    <report>
+        Time taken:
+        <property name="timer">
+            <mcmc idref="mcmc1"/>
+        </property>
+    </report>
+
+    <traceAnalysis fileName="yulePrior10taxa.log" burnIn="1000">
+        <!-- expectation of root height for 10 tips and lambda = 2 -->
+        <expectation name="treeModel1.rootHeight" value="0.964484127"/>
+        <!-- expectation of tree length for 10 tips and lambda = 2 -->
+        <expectation name="TL" value="4.5"/>
+    </traceAnalysis>
+
+</beast>
+
+
diff --git a/examples/beast2vs1/testBSP1.xml b/examples/beast2vs1/testBSP1.xml
new file mode 100644
index 0000000..092fa96
--- /dev/null
+++ b/examples/beast2vs1/testBSP1.xml
@@ -0,0 +1,197 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beast version='2.0'
+       namespace='beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood'>
+
+    <!-- 17 taxa, 1485 sites, 138 patterns -->
+    <data dataType="nucleotide" id="alignment">
+        <sequence taxon="D4Brazi82">
+
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence taxon="D4ElSal83">
+
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence taxon="D4ElSal94">
+
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTGGTGCTAGAACATGGAGGATGCGTCACAACCATAGCCCAGGGAAAACCAACCTTGGATTTTGAATTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGGAATGGCTGTGGCTTGCTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGATACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence taxon="D4Indon76">
+
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTAAAAGAGGAACAAGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence taxon="D4Indon77">
+
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTAAAAGAGGAACAAGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTAGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAACCATGGAGTT [...]
+        </sequence>
+        <sequence taxon="D4Mexico84">
+
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTAGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGCTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence taxon="D4NewCal81">
+
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence taxon="D4Philip64">
+
+            ATGCGATGCGTGGGAGTGGGGAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATTTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCGATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAACCTTATCTCAAAGAGGAACAAGATCAACAGTACATCTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGATACATCCAACCATGGAGTG [...]
+        </sequence>
+        <sequence taxon="D4Philip56">
+
+            ATGCGATGCGTGGGAGTGGGGAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATTTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCGATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAACCTTATCTCAAAGAGGAACAAGATCAACAGTACATCTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGCTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTAGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACATATCCAACCATGGAGTG [...]
+        </sequence>
+        <sequence taxon="D4Philip84">
+
+            ATGCGATGCGTAGGAGTGGGGAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACTTAGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAAGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCGATATCAAACATAACCACGGCAACAAGATGCCCAACGCAAGGAGAACCTTATCTCAAAGAGGAACAAGATCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTCTCATGCTCGGGAAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATATACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAACCATGGAGTG [...]
+        </sequence>
+        <sequence taxon="D4PRico86">
+
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGGGAGCCCTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATCTGGTCCAAATTGAGAACCTTGAGTACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence taxon="D4SLanka78">
+
+            ATGCGATGCGTGGGAGTGGGGAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAAGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCCATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAGCCCTGTCTCAAAGAGGAACAGGATCAACAGTACATCTGCCGGAGAGACGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCCTGCTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACAGGCAACTTAGTCCGAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAACCACGGAGTG [...]
+        </sequence>
+        <sequence taxon="D4Tahiti79">
+
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence taxon="D4Tahiti85">
+
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTTTCAGGTGGAGCATGGGTCGATTTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATCTGGTCCAAATTGAGAACCTTGAATACACAGTGGTCATAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence taxon="D4Thai63">
+
+            ATGCGATGCGTAGGAGTGGGGAACAGGGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCTCAAGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCGATATCAAACATAACCACGGCGACAAGATGTCCAACGCAAGGAGAGCCTTATCTCAAAGAGGAACAAGATCAACAGTACATCTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTACTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACAGGCAACTTGGTTCGAATTGAGAACCTTGAATACACAGTGGTTGTGACAGTCCACAACGGAGACACCCATGCAGTAGGAAATGACATATCCAACCATGGAGTG [...]
+        </sequence>
+        <sequence taxon="D4Thai78">
+
+            ATGCGATGCGTAGGAGTGGGGAACAGAGACTTTGTAGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCCATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTACCTCAAAGAGGAACAAGATCAACAGTACATCTGCCGGAGAGACGTGGTAGATAGAGGGTGGGGCAACGGCTGTGGCTTGCTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACAGGCAACTTAGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCTGTAGGAAATGATACATCCAACCACGGAGTG [...]
+        </sequence>
+        <sequence taxon="D4Thai84">
+
+            ATGCGATGCGTAGGAGTAGGGAACAGAGACTTTGTAGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAGGGAAAACCAACCCTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCCATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTACCTCAAAGAGGAACAAGATCAACAGTACATCTGCCGGAGAGACGTGGTAGACAGAGGGTGGGGCAACGGCTGTGGCTTGTTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACGGGCAACTTAGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCTGTAGGAAATGATACATCCAACCACGGAGTG [...]
+        </sequence>
+    </data>
+
+    <tree spec='beast.util.ClusterTree' id='tree' clusterType='upgma'>
+        <trait spec='beast.evolution.tree.TraitSet' traitname='date-forward' units='year'
+               value='
+		D4Brazi82  = 1982,
+		D4ElSal83  = 1983,
+		D4ElSal94  = 1994,
+		D4Indon76  = 1976,
+		D4Indon77  = 1977,
+		D4Mexico84 = 1984,
+		D4NewCal81 = 1981,
+		D4Philip64 = 1964,
+		D4Philip56 = 1956,
+		D4Philip84 = 1984,
+		D4PRico86  = 1986,
+		D4SLanka78 = 1978,
+		D4Tahiti79 = 1979,
+		D4Tahiti85 = 1985,
+		D4Thai63   = 1963,
+		D4Thai78   = 1978,
+		D4Thai84   = 1984'>
+		<taxa spec='beast.evolution.alignment.TaxonSet' alignment='@alignment'/>
+        </trait>
+        <taxa idref='alignment'/>
+    </tree>
+
+    <distribution spec="CompoundDistribution" id="posterior">
+        <distribution spec="CompoundDistribution" id="prior">
+<!--	
+            <distribution id="hky.kappa.prior" spec="beast.math.distributions.Prior" x="@hky.kappa">
+                <distr id="LogNormalDistributionModel" M="1.0" S="1.25" meanInRealSpace="false"
+                              spec="beast.math.distributions.LogNormalDistributionModel"/>
+            </distribution>
+            <distribution id="hky.frequencies.prior" spec="beast.math.distributions.Prior" x="@hky.frequencies">
+                <distr id="Uniform" lower="0.0" upper="1.0" spec="beast.math.distributions.Uniform"/>
+            </distribution>
+-->
+
+            <distribution spec="BayesianSkyline" id='skyline'>
+                <popSizes idref="skyline.popSize"/>
+                <groupSizes idref='skyline.groupSize'/>
+                <treeIntervals spec='TreeIntervals' id='TreeIntervals'>
+                    <tree idref="tree"/>
+                </treeIntervals>
+            </distribution>
+            
+            <distribution id='eml1' spec="beast.math.distributions.MarkovChainDistribution"
+				jeffreys="true"
+				parameter="@skyline.popSize"/>
+        </distribution>
+
+		<distribution spec='TreeLikelihood' id="likelihood">
+		    <data idref="alignment"/>
+		    <tree idref="tree"/>
+			<siteModel spec='SiteModel' id="siteModel" gammaCategoryCount="4">
+				<parameter id='siteModel.alpha' name='shape' value="5.40372E-2" lower="0.0" upper="100.0"/>
+
+				<substModel spec='HKY' id="hky">
+					<parameter name='kappa' id="hky.kappa" value="21.5056" lower="0.0" upper="100.0"/>
+					<frequencies id='freqs' spec='Frequencies' data="@alignment"/>
+				</substModel>
+			</siteModel>
+			<branchRateModel spec='beast.evolution.branchratemodel.StrictClockModel' id="branchRates">
+				<parameter name='clock.rate' id='clock.rate' value="8.8579E-4" lower="0.0" upper="100.0"/>
+			</branchRateModel>
+		</distribution>
+    </distribution>
+
+    <run spec="MCMC" id="mcmc" chainLength="5000000">
+        <state>
+			<parameter name='stateNode' id="skyline.popSize" dimension="5" value="380.0" lower="0.0" upper="38000.0"/>
+			<stateNode spec='parameter.IntegerParameter' id='skyline.groupSize' dimension="5" value="0"/>
+            <stateNode idref="hky.kappa"/>
+            <stateNode idref="tree"/>
+            <stateNode idref="clock.rate"/>
+            <stateNode idref="siteModel.alpha"/>
+        </state>
+
+        <distribution idref="posterior"/>
+        <operator id='kappaScaler' spec='ScaleOperator' scaleFactor="0.75" weight="1" parameter="@hky.kappa"/>
+        <operator id='clockRateScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3" parameter="@clock.rate"/>
+        <operator id='shapeScaler' spec='ScaleOperator' scaleFactor="0.75" weight="1" parameter="@siteModel.alpha"/>
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3" tree="@tree"/>
+        <operator spec='Uniform' weight="30" tree="@tree"/>
+        <operator spec='SubtreeSlide' weight="15" gaussian="true" tree="@tree"/>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="15" tree="@tree"/>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="3" tree="@tree"/>
+        <operator spec='WilsonBalding' weight="3" tree="@tree"/>
+        <operator spec='UpDownOperator' scaleFactor="0.75" weight="3" up="@clock.rate" down="@tree"/>
+
+        <operator id='popSizesScaler' spec='ScaleOperator' scaleFactor="0.75" weight="15" parameter="@skyline.popSize"/>
+        <operator id='groupSizesDelta' spec='DeltaExchangeOperator' delta="1" weight="6" integer="true"
+                  intparameter="@skyline.groupSize"/>
+
+        <logger logEvery="1000" fileName="test.$(seed).log">
+            <log idref="posterior"/>
+            <log idref="prior"/>
+            <log idref="siteModel.alpha"/>
+            <log idref="clock.rate"/>
+            <log idref="skyline.popSize"/>
+            <log idref="skyline.groupSize"/>
+            <log idref="hky.kappa"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree' id='treeModel.rootHeight'/>
+            <log idref="likelihood"/>
+            <log idref="skyline"/>
+            <log idref="eml1"/>
+        </logger>
+
+        <!--<logger logEvery="1000" fileName="test.$(seed).trees">-->
+			<!--<log idref="tree"/>-->
+		<!--</logger>              -->
+
+        <logger logEvery="100000">
+            <log idref="posterior"/>
+            <log idref="likelihood"/>
+            <log idref="prior"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+        </logger>
+
+    </run>
+</beast>
+
diff --git a/examples/beast2vs1/testBSPNoClock.xml b/examples/beast2vs1/testBSPNoClock.xml
new file mode 100644
index 0000000..7f62671
--- /dev/null
+++ b/examples/beast2vs1/testBSPNoClock.xml
@@ -0,0 +1,136 @@
+<beast version='2.0'
+       namespace='beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.branchratemodel:beast.evolution.likelihood:beast.core.parameter'>
+
+
+    <!-- The sequence alignment (each sequence refers to a taxon above).         -->
+    <!-- ntax=6 nchar=768                                                        -->
+    <!-- npatterns=69                                                            -->
+    <data id="alignment" dataType="nucleotide">
+        <sequence taxon="bonobo">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAGC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTTGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="chimp">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="human">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="gorilla">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTAAACATAGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA-CAACACTTAATTTCTGTAAGGACTGCAAAACCCTACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCAATGGGACTCAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAT-TCAC [...]
+        </sequence>
+        <sequence taxon="orangutan">
+            AGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA-CAGCACTTAATTTCTGTAAGGACTGCAAAACCCCACTTTGCATCAACTGAGCGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCCTAGACCGATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAT-TGGCTTCAGTCCAAAGCCCCGGCAGGCCTTAAAGCTGCTCCTTCGAATTTGCAATTCAACATGACAA-TCAC [...]
+        </sequence>
+        <sequence taxon="siamang">
+            AGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTAACAAAACTTAATTTCTGCAAGGGCTGCAAAACCCTACTTTGCATCAACCGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCGATGGGACTTAAACCCATAAAAATTTAGTTAACAGCTAAACACCCTAAACAACCTGGCTTCAATCTAAAGCCCCGGCAGA-GTTGAAGCTGCTTCTTTGAACTTGCAATTCAACGTGAAAAATCAC [...]
+        </sequence>
+    </data>
+
+    <!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+    <input spec='HKY' id="hky">
+        <parameter name='kappa' idref='hky.kappa'/>
+        <input id='freqs' name='frequencies' spec='Frequencies' frequencies='@hky.frequencies'/>
+    </input>
+
+    <!-- site model                                                              -->
+    <input spec='SiteModel' id="siteModel">
+        <!--<parameter name='mutationRate'>1.0</parameter>-->
+        <input name='substModel' idref='hky'/>
+    </input>
+
+    <input spec='TreeLikelihood' id="treeLikelihood">
+        <data idref="alignment"/>
+        <tree idref="tree"/>
+        <siteModel idref="siteModel"/>
+    </input>
+
+    <input spec='beast.util.ClusterTree' id='tree' clusterType='upgma'>
+        <taxa idref='alignment'/>
+    </input>
+
+    <parameter id="hky.kappa" value="2.0" lower="0.0"/>
+    <parameter id="hky.frequencies" value="0.25" dimension="4" lower='0.0'/>
+    <parameter id="popSizes" dimension="3" value="380.0" lower="0.0" upper="38000.0"/>
+    <input name="groupSizes" spec='IntegerParameter' id='groupSizes' dimension="3" value="0" lower='0'/>
+
+    <run spec="MCMC" id="mcmc" chainLength="10000000"> <!--autoOptimize="true"-->
+        <state>
+            <stateNode idref='hky.kappa'/>
+            <stateNode idref='hky.frequencies'/>
+            <stateNode idref='popSizes'/>
+            <stateNode idref='groupSizes'/>
+            <stateNode idref='tree'/>
+        </state>
+
+        <distribution spec="CompoundDistribution" id="posterior">
+            <distribution spec="CompoundDistribution" id="prior">
+                <distribution id="hky.kappa.prior" spec="beast.math.distributions.Prior" x="@hky.kappa">
+                    <distr id="LogNormalDistributionModel" M="1.0" S="1.25" meanInRealSpace="false"
+                           spec="beast.math.distributions.LogNormalDistributionModel"/>
+                </distribution>
+                <distribution id="hky.frequencies.prior" spec="beast.math.distributions.Prior" x="@hky.frequencies">
+                    <distr id="Uniform" lower="0.0" upper="1.0" spec="beast.math.distributions.Uniform"/>
+                </distribution>
+
+                <distribution spec="BayesianSkyline" id='skyline'>
+                    <popSizes idref="popSizes"/>
+                    <groupSizes idref='groupSizes'/>
+                    <treeIntervals spec='TreeIntervals' id='TreeIntervals'>
+                        <tree idref="tree"/>
+                    </treeIntervals>
+                </distribution>
+
+                <distribution id='eml1' spec="beast.math.distributions.MarkovChainDistribution"
+				jeffreys="true"
+				parameter="@popSizes"/>
+            </distribution>
+            <distribution id='likelihood' idref="treeLikelihood"/>
+        </distribution>
+
+        <operator id='kappaScaler' spec='ScaleOperator' scaleFactor="0.75" weight="0.1" parameter="@hky.kappa"/>
+        <operator id='frequenciesDelta' spec='DeltaExchangeOperator' delta="0.01" weight="0.1"
+                  parameter="@hky.frequencies"/>
+        <operator id='popSizesScaler' spec='ScaleOperator' scaleFactor="0.75" weight="15" parameter="@popSizes"/>
+        <operator id='groupSizesDelta' spec='DeltaExchangeOperator' delta="1" weight="3" integer="true"
+                  intparameter="@groupSizes"/>
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3" tree="@tree"/>
+        <operator spec='Uniform' weight="30" tree="@tree"/>
+        <operator spec='SubtreeSlide' weight="15" gaussian="true" size="0.0077" tree="@tree"/>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="15" tree="@tree"/>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="3" tree="@tree"/>
+        <operator spec='WilsonBalding' weight="1" tree="@tree"/>
+        <operator spec='UpDownOperator' scaleFactor="0.75" weight="3" down="@tree"/>
+
+        <logger logEvery="1000" fileName="test.$(seed).log">
+            <model idref='posterior'/>
+            <log idref="posterior"/>
+            <log idref="prior"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+            <log idref="popSizes"/>
+            <log idref="groupSizes"/>
+            <log idref="hky.kappa"/>
+            <log idref="hky.frequencies"/>
+            <log idref="likelihood"/>
+            <log idref="skyline"/>
+            <log idref="eml1"/>
+            <!--<log idref="hky.kappa.prior"/>-->
+            <!--<log idref="hky.frequencies.prior"/>-->
+        </logger>
+        <!--        <logger logEvery="1000" fileName="test.$(seed).trees">
+ <log idref="tree"/>
+</logger>           -->
+        <logger logEvery="100000">
+            <model idref='posterior'/>
+            <log idref="posterior"/>
+            <log idref="prior"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+            <log idref="popSizes"/>
+            <log idref="groupSizes"/>
+            <log idref="hky.kappa"/>
+            <log idref="hky.frequencies"/>
+            <log idref="likelihood"/>
+            <log idref="skyline"/>
+        </logger>
+    </run>
+
+</beast>
diff --git a/examples/beast2vs1/testBirthDeathAsYule.xml b/examples/beast2vs1/testBirthDeathAsYule.xml
new file mode 100644
index 0000000..647c3f8
--- /dev/null
+++ b/examples/beast2vs1/testBirthDeathAsYule.xml
@@ -0,0 +1,162 @@
+<?xml version="1.0" standalone="yes"?>
+<!-- test Yule birth model and Birth Death model per Gernhard 2008-->
+<beast version='2.0'
+       namespace='beast.evolution.speciation:beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood'>
+
+    <data id="alignment" dataType="nucleotide">
+        <sequence taxon="tip1">A</sequence>
+        <sequence taxon="tip2">A</sequence>
+        <sequence taxon="tip3">A</sequence>
+        <sequence taxon="tip4">A</sequence>
+        <sequence taxon="tip5">A</sequence>
+        <sequence taxon="tip6">A</sequence>
+        <sequence taxon="tip7">A</sequence>
+        <sequence taxon="tip8">A</sequence>
+        <sequence taxon="tip9">A</sequence>
+        <sequence taxon="tip10">A</sequence>
+        <sequence taxon="tip11">A</sequence>
+        <sequence taxon="tip12">A</sequence>
+        <sequence taxon="tip13">A</sequence>
+        <sequence taxon="tip14">A</sequence>
+        <sequence taxon="tip15">A</sequence>
+        <sequence taxon="tip16">A</sequence>
+        <sequence taxon="tip17">A</sequence>
+        <sequence taxon="tip18">A</sequence>
+        <sequence taxon="tip19">A</sequence>
+        <sequence taxon="tip20">A</sequence>
+        <sequence taxon="tip21">A</sequence>
+        <sequence taxon="tip22">A</sequence>
+        <sequence taxon="tip23">A</sequence>
+        <sequence taxon="tip24">A</sequence>
+        <sequence taxon="tip25">A</sequence>
+        <sequence taxon="tip26">A</sequence>
+        <sequence taxon="tip27">A</sequence>
+        <sequence taxon="tip28">A</sequence>
+        <sequence taxon="tip29">A</sequence>
+        <sequence taxon="tip30">A</sequence>
+        <sequence taxon="tip31">A</sequence>
+        <sequence taxon="tip32">A</sequence>
+        <sequence taxon="tip33">A</sequence>
+        <sequence taxon="tip34">A</sequence>
+        <sequence taxon="tip35">A</sequence>
+        <sequence taxon="tip36">A</sequence>
+        <sequence taxon="tip37">A</sequence>
+        <sequence taxon="tip38">A</sequence>
+        <sequence taxon="tip39">A</sequence>
+        <sequence taxon="tip40">A</sequence>
+        <sequence taxon="tip41">A</sequence>
+        <sequence taxon="tip42">A</sequence>
+        <sequence taxon="tip43">A</sequence>
+        <sequence taxon="tip44">A</sequence>
+        <sequence taxon="tip45">A</sequence>
+        <sequence taxon="tip46">A</sequence>
+        <sequence taxon="tip47">A</sequence>
+        <sequence taxon="tip48">A</sequence>
+        <sequence taxon="tip49">A</sequence>
+        <sequence taxon="tip50">A</sequence>
+        <sequence taxon="tip51">A</sequence>
+        <sequence taxon="tip52">A</sequence>
+        <sequence taxon="tip53">A</sequence>
+        <sequence taxon="tip54">A</sequence>
+        <sequence taxon="tip55">A</sequence>
+        <sequence taxon="tip56">A</sequence>
+        <sequence taxon="tip57">A</sequence>
+        <sequence taxon="tip58">A</sequence>
+        <sequence taxon="tip59">A</sequence>
+        <sequence taxon="tip60">A</sequence>
+        <sequence taxon="tip61">A</sequence>
+        <sequence taxon="tip62">A</sequence>
+        <sequence taxon="tip63">A</sequence>
+        <sequence taxon="tip64">A</sequence>
+        <sequence taxon="tip65">A</sequence>
+        <sequence taxon="tip66">A</sequence>
+        <sequence taxon="tip67">A</sequence>
+        <sequence taxon="tip68">A</sequence>
+        <sequence taxon="tip69">A</sequence>
+        <sequence taxon="tip70">A</sequence>
+        <sequence taxon="tip71">A</sequence>
+        <sequence taxon="tip72">A</sequence>
+        <sequence taxon="tip73">A</sequence>
+        <sequence taxon="tip74">A</sequence>
+        <sequence taxon="tip75">A</sequence>
+        <sequence taxon="tip76">A</sequence>
+        <sequence taxon="tip77">A</sequence>
+        <sequence taxon="tip78">A</sequence>
+        <sequence taxon="tip79">A</sequence>
+        <sequence taxon="tip80">A</sequence>
+        <sequence taxon="tip81">A</sequence>
+        <sequence taxon="tip82">A</sequence>
+        <sequence taxon="tip83">A</sequence>
+        <sequence taxon="tip84">A</sequence>
+        <sequence taxon="tip85">A</sequence>
+        <sequence taxon="tip86">A</sequence>
+        <sequence taxon="tip87">A</sequence>
+        <sequence taxon="tip88">A</sequence>
+        <sequence taxon="tip89">A</sequence>
+        <sequence taxon="tip90">A</sequence>
+        <sequence taxon="tip91">A</sequence>
+        <sequence taxon="tip92">A</sequence>
+        <sequence taxon="tip93">A</sequence>
+        <sequence taxon="tip94">A</sequence>
+        <sequence taxon="tip95">A</sequence>
+        <sequence taxon="tip96">A</sequence>
+        <sequence taxon="tip97">A</sequence>
+        <sequence taxon="tip98">A</sequence>
+        <sequence taxon="tip99">A</sequence>
+        <sequence taxon="tip100">A</sequence>
+    </data>
+
+    <tree spec='beast.util.TreeParser' id='tree' IsLabelledNewick='true' newick=
+            '(((((((tip1:0.51765537,tip2:0.51765537):1.88098913,(((((tip3:0.94723082,(((tip4:0.46306133,(tip5:0.02670646,tip6:0.02670646):0.43635488):0.08447266,tip7:0.54753399):0.21542859,tip8:0.76296258):0.18426824):0.45594776,((tip9:0.68205023,(tip10:0.59007096,tip11:0.59007096):0.09197927):0.58937991,(tip12:0.76225424,tip13:0.76225424):0.50917590):0.13174844):0.08173060,(((tip14:0.02976608,tip15:0.02976608):0.48301744,tip16:0.51278353):0.54763055,(tip17:0.19119167,tip18:0.19119167):0 [...]
+          taxa='@alignment'/>
+
+    <!-- A prior on the distribution node heights defined given                  -->
+    <!-- a Yule speciation process (a pure birth process).                       -->
+    <input spec='BirthDeathGernhard08Model' id="birthDeath">
+        <birthDiffRate idref="birthRate"/>
+        <relativeDeathRate idref='relativeDeathRate'/>
+        <sampleProbability idref="sampleProbability"/>
+        <tree idref='tree'/>
+    </input>
+
+    <parameter id="birthRate" value="1.0" lower="0.0" upper="1000000.0"/>
+    <parameter id='relativeDeathRate' value='0.0' lower="0.0" upper="1.0"/>
+    <parameter id="sampleProbability" value="1.0"/>
+
+    <run spec='MCMC' chainLength="1000000">
+        <state>
+            <stateNode idref='birthRate'/>
+            <stateNode idref='tree'/>
+        </state>
+
+        <distribution spec="CompoundDistribution" id="posterior">
+            <distribution id="birthDeath.prior" idref='birthDeath'/>
+            <distribution id="birthRate.prior" spec="beast.math.distributions.Prior" x="@birthRate">
+                <distr id="OneOnX" offset="0.0" spec="beast.math.distributions.OneOnX"/>
+            </distribution>
+        </distribution>
+
+        <operator id='birthScaler' spec='ScaleOperator' scaleFactor="0.75" weight="1" parameter="@birthRate"/>
+
+        <logger logEvery="1000" fileName="test.$(seed).log">
+            <model idref='posterior'/>
+            <log idref="posterior"/>
+            <log idref='birthDeath'/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+            <log idref='birthRate'/>
+            <log idref='relativeDeathRate'/>
+            <log idref='sampleProbability'/>
+        </logger>
+
+        <logger logEvery="100000">
+            <model idref='posterior'/>
+            <log idref="posterior"/>
+            <log idref='birthDeath'/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+            <log idref='birthRate'/>
+            <log idref='relativeDeathRate'/>
+            <log idref='sampleProbability'/>
+        </logger>
+    </run>
+
+</beast>
diff --git a/examples/beast2vs1/testBirthDeathModel_10taxa.xml b/examples/beast2vs1/testBirthDeathModel_10taxa.xml
new file mode 100644
index 0000000..c7b7b8f
--- /dev/null
+++ b/examples/beast2vs1/testBirthDeathModel_10taxa.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0" standalone="yes"?>
+<!-- test Yule birth model and Birth Death model per Gernhard 2008-->
+<beast version='2.0'
+       namespace='beast.evolution.speciation:beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood'>
+
+    <data id="alignment" dataType="nucleotide">
+        <sequence taxon="A">A</sequence>
+        <sequence taxon="B">A</sequence>
+        <sequence taxon="C">A</sequence>
+        <sequence taxon="D">A</sequence>
+        <sequence taxon="E">A</sequence>
+        <sequence taxon="F">A</sequence>
+        <sequence taxon="G">A</sequence>
+        <sequence taxon="H">A</sequence>
+        <sequence taxon="I">A</sequence>
+        <sequence taxon="J">A</sequence>
+    </data>
+
+    <input spec='beast.util.ClusterTree' id='tree' clusterType='upgma'>
+        <taxa idref='alignment'/>
+    </input>
+
+    <!-- A prior on the distribution node heights defined given                  -->
+    <!-- a Yule speciation process (a pure birth process).                       -->
+    <input spec='BirthDeathGernhard08Model' id="birthDeath">
+        <birthDiffRate idref="birthRate"/>
+        <relativeDeathRate idref='relativeDeathRate'/>
+        <tree idref='tree'/>
+    </input>
+
+    <parameter id="birthRate" value="2.0" lower="0.0" upper="1000000.0"/>
+    <parameter id='relativeDeathRate' value='0.5' lower="0.0" upper="100.0"/>
+
+    <run spec='MCMC' chainLength="2000000">
+        <state>
+            <stateNode idref='birthRate'/>
+            <stateNode idref='tree'/>
+        </state>
+
+        <distribution id="birthDeath.prior" idref='birthDeath'/>
+
+        <operator spec='SubtreeSlide' weight="1" gaussian="true" size="1.0" tree="@tree"/>
+
+        <logger logEvery="10" fileName="test.$(seed).log">
+            <log idref='birthDeath'/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+            <log idref='birthRate'/>
+            <log idref='relativeDeathRate'/>
+        </logger>
+
+        <logger logEvery="20000">
+            <log idref='birthDeath'/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+            <log idref='birthRate'/>
+            <log idref='relativeDeathRate'/>
+        </logger>
+    </run>
+
+</beast>
diff --git a/examples/beast2vs1/testCalibration.xml b/examples/beast2vs1/testCalibration.xml
new file mode 100644
index 0000000..8614ce9
--- /dev/null
+++ b/examples/beast2vs1/testCalibration.xml
@@ -0,0 +1,124 @@
+<beast version='2.0'
+       namespace='beast.evolution.alignment:beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood'>
+
+
+    <!-- The sequence alignment                                                  -->
+    <!-- ntax=6 nchar=768                                                        -->
+    <!-- npatterns=69                                                            -->
+    <data id="alignment" dataType="nucleotide">
+        <sequence taxon="human">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="chimp">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="bonobo">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAGC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTTGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="gorilla">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTAAACATAGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA-CAACACTTAATTTCTGTAAGGACTGCAAAACCCTACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCAATGGGACTCAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAT-TCAC [...]
+        </sequence>
+        <sequence taxon="orangutan">
+            AGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA-CAGCACTTAATTTCTGTAAGGACTGCAAAACCCCACTTTGCATCAACTGAGCGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCCTAGACCGATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAT-TGGCTTCAGTCCAAAGCCCCGGCAGGCCTTAAAGCTGCTCCTTCGAATTTGCAATTCAACATGACAA-TCAC [...]
+        </sequence>
+        <sequence taxon="siamang">
+            AGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTAACAAAACTTAATTTCTGCAAGGGCTGCAAAACCCTACTTTGCATCAACCGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCGATGGGACTTAAACCCATAAAAATTTAGTTAACAGCTAAACACCCTAAACAACCTGGCTTCAATCTAAAGCCCCGGCAGA-GTTGAAGCTGCTTCTTTGAACTTGCAATTCAACGTGAAAAATCAC [...]
+        </sequence>
+    </data>
+
+
+    <run spec="MCMC" id="mcmc" chainLength="10000000"> <!--autoOptimize="true"-->
+        <init spec='beast.evolution.tree.RandomTree' id='randomTree' initial='@tree' taxa='@alignment'>
+            <populationModel spec='ConstantPopulation' popSize='@popSize'/>
+        </init>
+
+        <state>
+            <stateNode spec='parameter.RealParameter' id="hky.kappa" value="2.0" lower="0.0"/>
+            <stateNode spec='parameter.RealParameter' id="hky.frequencies" value="0.25" dimension="4" lower='0.0'/>
+            <stateNode spec='parameter.RealParameter' id="popSize" value="17" lower="0.0"/>
+            <stateNode spec='beast.evolution.tree.Tree' id='tree'/>
+        </state>
+
+        <distribution spec='CompoundDistribution' id='posterior'>
+            <distribution spec='CompoundDistribution' id='prior'>
+                <distribution id="hky.kappa.prior" spec="beast.math.distributions.Prior" x="@hky.kappa">
+                    <distr id="LogNormalDistributionModel" M="1.0" S="1.25" meanInRealSpace="false"
+                                  spec="beast.math.distributions.LogNormalDistributionModel"/>
+                </distribution>
+                <distribution id="hky.frequencies.prior" spec="beast.math.distributions.Prior" x="@hky.frequencies">
+                    <distr id="Uniform" lower="0.0" upper="1.0" spec="beast.math.distributions.Uniform"/>
+                </distribution>
+                <distribution id="popSize.prior" spec="beast.math.distributions.Prior" x="@popSize">
+                    <distr id="OneOnX" offset="0.0" spec="beast.math.distributions.OneOnX"/>
+                </distribution>
+
+                <distribution spec='beast.math.distributions.MRCAPrior' tree='@tree' id='HumanChimpMRCA'>
+                    <taxonset spec='TaxonSet' id='human,chimp'>
+                        <taxon spec='Taxon' id='human'/>
+                        <taxon spec='Taxon' id='chimp'/>
+                    </taxonset>
+                    <distr spec='beast.math.distributions.Normal' mean='6.0' sigma='0.5'/>
+                </distribution>
+
+                <distribution id="coalescent" spec="Coalescent">
+                    <treeIntervals spec='TreeIntervals' id='TreeIntervals'>
+                        <tree idref="tree"/>
+                    </treeIntervals>
+                    <populationModel spec="ConstantPopulation" id='ConstantPopulation'>
+                        <parameter name="popSize" idref="popSize"/>
+                    </populationModel>
+                </distribution>
+            </distribution>
+
+            <distribution spec='TreeLikelihood' id="likelihood" data='@alignment' tree='@tree'>
+                <siteModel id="siteModel" spec='SiteModel'>
+                    <substModel spec='HKY' id="hky">
+                        <parameter name='kappa' idref='hky.kappa'/>
+                        <frequencies id='freqs' spec='Frequencies' frequencies='@hky.frequencies'/>
+                    </substModel>
+                </siteModel>
+            </distribution>
+        </distribution>
+
+        <operator id='kappaScaler' spec='ScaleOperator' scaleFactor="0.75" weight="0.1" parameter="@hky.kappa"/>
+        <operator id='frequenciesDelta' spec='DeltaExchangeOperator' delta="0.01" weight="0.1"
+                  parameter="@hky.frequencies"/>
+        <operator id='popSizeScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3" parameter="@popSize"/>
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3" tree="@tree"/>
+        <operator spec='Uniform' weight="30" tree="@tree"/>
+        <operator spec='SubtreeSlide' weight="15" gaussian="true" size="1.7" tree="@tree"/>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="15" tree="@tree"/>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="3" tree="@tree"/>
+        <operator spec='WilsonBalding' weight="1" tree="@tree"/>
+        <operator spec='UpDownOperator' scaleFactor="0.75" weight="3" down="@tree"/>
+
+        <logger logEvery="1000" fileName="test.$(seed).log">
+            <model idref='posterior'/>
+            <log idref="posterior"/>
+            <log idref="prior"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+            <log idref='HumanChimpMRCA'/>
+            <log idref="popSize"/>
+            <log idref="hky.kappa"/>
+            <log idref="hky.frequencies"/>
+            <log idref="likelihood"/>
+            <log idref="coalescent"/>
+        </logger>
+        <logger logEvery="1000" fileName="test.$(seed).trees">
+            <log idref="tree"/>
+        </logger>
+        <logger logEvery="100000">
+            <model idref='posterior'/>
+            <log idref="posterior"/>
+            <log idref="prior"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+            <log idref='HumanChimpMRCA'/>
+            <log idref="popSize"/>
+            <log idref="hky.kappa"/>
+            <log idref="hky.frequencies"/>
+            <log idref="likelihood"/>
+            <log idref="coalescent"/>
+        </logger>
+    </run>
+
+</beast>
diff --git a/examples/beast2vs1/testCalibrationMono.xml b/examples/beast2vs1/testCalibrationMono.xml
new file mode 100644
index 0000000..bafe532
--- /dev/null
+++ b/examples/beast2vs1/testCalibrationMono.xml
@@ -0,0 +1,128 @@
+<beast version='2.0'
+       namespace='beast.evolution.alignment:beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood'>
+
+
+    <!-- The sequence alignment                                                  -->
+    <!-- ntax=6 nchar=768                                                        -->
+    <!-- npatterns=69                                                            -->
+    <data id="alignment" dataType="nucleotide">
+        <sequence taxon="human">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="chimp">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="bonobo">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAGC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTTGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="gorilla">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTAAACATAGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA-CAACACTTAATTTCTGTAAGGACTGCAAAACCCTACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCAATGGGACTCAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAT-TCAC [...]
+        </sequence>
+        <sequence taxon="orangutan">
+            AGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA-CAGCACTTAATTTCTGTAAGGACTGCAAAACCCCACTTTGCATCAACTGAGCGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCCTAGACCGATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAT-TGGCTTCAGTCCAAAGCCCCGGCAGGCCTTAAAGCTGCTCCTTCGAATTTGCAATTCAACATGACAA-TCAC [...]
+        </sequence>
+        <sequence taxon="siamang">
+            AGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTAACAAAACTTAATTTCTGCAAGGGCTGCAAAACCCTACTTTGCATCAACCGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCGATGGGACTTAAACCCATAAAAATTTAGTTAACAGCTAAACACCCTAAACAACCTGGCTTCAATCTAAAGCCCCGGCAGA-GTTGAAGCTGCTTCTTTGAACTTGCAATTCAACGTGAAAAATCAC [...]
+        </sequence>
+    </data>
+
+
+    <run spec="MCMC" id="mcmc" chainLength="10000000"> <!--autoOptimize="true"-->
+        <init spec='beast.evolution.tree.RandomTree' id='randomTree' initial='@tree' taxa='@alignment'>
+            <populationModel spec='ConstantPopulation' popSize='@popSize'/>
+        </init>
+
+        <state>
+            <stateNode spec='parameter.RealParameter' id="hky.kappa" value="2.0" lower="0.0"/>
+            <stateNode spec='parameter.RealParameter' id="hky.frequencies" value="0.25" dimension="4" lower='0.0'/>
+            <stateNode spec='parameter.RealParameter' id="popSize" value="17" lower="0.0"/>
+            <stateNode spec='beast.evolution.tree.Tree' id='tree'/>
+        </state>
+
+        <distribution spec='CompoundDistribution' id='posterior'>
+            <distribution spec='CompoundDistribution' id='prior'>
+                <distribution id="hky.kappa.prior" spec="beast.math.distributions.Prior" x="@hky.kappa">
+                    <distr id="LogNormalDistributionModel" M="1.0" S="1.25" meanInRealSpace="false"
+                                  spec="beast.math.distributions.LogNormalDistributionModel"/>
+                </distribution>
+                <distribution id="hky.frequencies.prior" spec="beast.math.distributions.Prior" x="@hky.frequencies">
+                    <distr id="Uniform" lower="0.0" upper="1.0" spec="beast.math.distributions.Uniform"/>
+                </distribution>
+                <distribution id="popSize.prior" spec="beast.math.distributions.Prior" x="@popSize">
+                    <distr id="OneOnX" offset="0.0" spec="beast.math.distributions.OneOnX"/>
+                </distribution>
+
+                <distribution spec='beast.math.distributions.MRCAPrior' tree='@tree' id='mrcaPrior2' taxonset='@human,chimp' monophyletic='true'>
+                    <distr spec='beast.math.distributions.Normal'>
+                        <parameter name='mean' value='6.0'/>
+                        <parameter name='sigma' value='0.5'/>
+                    </distr>
+                </distribution>
+
+                <distribution id="coalescent" spec="Coalescent">
+                    <treeIntervals spec='TreeIntervals' id='TreeIntervals'>
+                        <tree idref="tree"/>
+                    </treeIntervals>
+                    <populationModel spec="ConstantPopulation" id='ConstantPopulation'>
+                        <parameter name="popSize" idref="popSize"/>
+                    </populationModel>
+                </distribution>
+            </distribution>
+
+            <distribution spec='TreeLikelihood' id="likelihood" data='@alignment' tree='@tree'>
+                <siteModel id="siteModel" spec='SiteModel'>
+                    <substModel spec='HKY' id="hky">
+                        <parameter name='kappa' idref='hky.kappa'/>
+                        <frequencies id='freqs' spec='Frequencies' frequencies='@hky.frequencies'/>
+                    </substModel>
+                </siteModel>
+            </distribution>
+        </distribution>
+
+        <operator id='kappaScaler' spec='ScaleOperator' scaleFactor="0.75" weight="0.1" parameter="@hky.kappa"/>
+        <operator id='frequenciesDelta' spec='DeltaExchangeOperator' delta="0.01" weight="0.1"
+                  parameter="@hky.frequencies"/>
+        <operator id='popSizeScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3" parameter="@popSize"/>
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3" tree="@tree"/>
+        <operator spec='Uniform' weight="30" tree="@tree"/>
+        <operator spec='SubtreeSlide' weight="15" gaussian="true" size="1.7" tree="@tree"/>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="15" tree="@tree"/>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="3" tree="@tree"/>
+        <operator spec='WilsonBalding' weight="1" tree="@tree"/>
+        <operator spec='UpDownOperator' scaleFactor="0.75" weight="3" down="@tree"/>
+
+        <logger logEvery="1000" fileName="test.$(seed).log">
+            <model idref='posterior'/>
+            <log idref="posterior"/>
+            <log idref="prior"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+            <log spec='beast.math.distributions.MRCAPrior' tree='@tree' id='HumanChimpMRCA'>
+                <taxonset spec='TaxonSet' id='human,chimp'>
+                    <taxon spec='Taxon' id='human'/>
+                    <taxon spec='Taxon' id='chimp'/>
+                </taxonset>
+            </log>
+            <log idref="popSize"/>
+            <log idref="hky.kappa"/>
+            <log idref="hky.frequencies"/>
+            <log idref="likelihood"/>
+            <log idref="coalescent"/>
+        </logger>
+        <logger logEvery="1000" fileName="test.$(seed).trees">
+            <log idref="tree"/>
+        </logger>
+        <logger logEvery="100000">
+            <model idref='posterior'/>
+            <log idref="posterior"/>
+            <log idref="prior"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+            <log idref='HumanChimpMRCA'/>
+            <log idref="popSize"/>
+            <log idref="hky.kappa"/>
+            <log idref="hky.frequencies"/>
+            <log idref="likelihood"/>
+            <log idref="coalescent"/>
+        </logger>
+    </run>
+
+</beast>
diff --git a/examples/beast2vs1/testCoalescent2.xml b/examples/beast2vs1/testCoalescent2.xml
new file mode 100644
index 0000000..4ce5f70
--- /dev/null
+++ b/examples/beast2vs1/testCoalescent2.xml
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><beast namespace="beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood" version="2.0">
+
+
+    <data dataType="nucleotide" id="alignment" name="taxa">
+                            <sequence taxon="human" totalcount="4">
+                                
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+                                    </sequence>
+                            <sequence taxon="chimp" totalcount="4">
+                                
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+                                    </sequence>
+                            <sequence taxon="bonobo" totalcount="4">
+                                
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAGC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTTGAATTTGCAATTCAATATGAAAA-TCAC [...]
+                                    </sequence>
+                            <sequence taxon="gorilla" totalcount="4">
+                                
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTAAACATAGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA-CAACACTTAATTTCTGTAAGGACTGCAAAACCCTACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCAATGGGACTCAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAT-TCAC [...]
+                                    </sequence>
+                            <sequence taxon="orangutan" totalcount="4">
+                                
+            AGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA-CAGCACTTAATTTCTGTAAGGACTGCAAAACCCCACTTTGCATCAACTGAGCGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCCTAGACCGATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAT-TGGCTTCAGTCCAAAGCCCCGGCAGGCCTTAAAGCTGCTCCTTCGAATTTGCAATTCAACATGACAA-TCAC [...]
+                                    </sequence>
+                            <sequence taxon="siamang" totalcount="4">
+                                
+            AGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTAACAAAACTTAATTTCTGCAAGGGCTGCAAAACCCTACTTTGCATCAACCGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCGATGGGACTTAAACCCATAAAAATTTAGTTAACAGCTAAACACCCTAAACAACCTGGCTTCAATCTAAAGCCCCGGCAGA-GTTGAAGCTGCTTCTTTGAACTTGCAATTCAACGTGAAAAATCAC [...]
+                                    </sequence>
+                        </data>
+
+
+    
+
+
+    <distribution id="posterior" name="posterior" spec="Posterior">
+        <distribution name="prior" spec="Prior">
+            <distr id="coalescent" spec="Coalescent">
+                <populationModel id="ConstantPopulation" spec="ConstantPopulation">
+                    <parameter dimension="1" estimate="true" id="popSize" lower="0.0" name="popSize" value="0.077"/>
+                </populationModel>
+                <treeIntervals id="TreeIntervals" spec="TreeIntervals">
+                    <tree clusterType="upgma" estimate="true" id="tree" nodetype="beast.evolution.tree.Node" spec="beast.util.ClusterTree">
+                        <taxa idref="alignment"/>
+                    </tree>
+                </treeIntervals>
+            </distr>
+        </distribution>
+        <distribution name="likelihood" spec="Likelihood">
+            <distribution data="@alignment" id="treeLikelihood" spec="TreeLikelihood" tree="@tree" useAmbiguities="false">
+                <siteModel gammaCategoryCount="0" id="siteModel" spec="SiteModel">
+                    <substModel id="hky" spec="HKY">
+                        <parameter dimension="1" estimate="true" id="hky.kappa" lower="0.0" name="kappa" value="2.0"/>
+                        <frequencies data="@alignment" estimate="true" id="freqs" spec="Frequencies"/>
+                    </substModel>
+                </siteModel>
+            </distribution>
+        </distribution>
+    </distribution>
+
+
+    
+<run chainLength="1000000" id="mcmc" preBurnin="0" spec="MCMC2" storeEvery="-1">
+    <posterior idref="posterior"/>
+
+    <operator degreesOfFreedom="1" id="kappaScaler" parameter="@hky.kappa" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.75" spec="ScaleOperator" weight="0.1"/>
+<!--
+    <operator autoOptimize="true" delta="0.01" id="frequenciesDelta" integer="false" parameter="@hky.frequencies" spec="DeltaExchangeOperator" weight="0.1">
+        <parameter dimension="4" estimate="true" id="hky.frequencies" value="0.25"/>
+    </operator>
+-->
+    <operator degreesOfFreedom="1" id="popSizeScaler" parameter="@popSize" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.75" spec="ScaleOperator" weight="3.0"/>
+    <operator degreesOfFreedom="1" id="treeScaler" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.75" spec="ScaleOperator" tree="@tree" weight="3.0"/>
+    <operator spec="Uniform" tree="@tree" weight="30.0"/>
+    <operator gaussian="true" size="0.0077" spec="SubtreeSlide" tree="@tree" weight="15.0"/>
+    <operator id="narrow" isNarrow="true" spec="Exchange" tree="@tree" weight="15.0"/>
+    <operator id="wide" isNarrow="false" spec="Exchange" tree="@tree" weight="3.0"/>
+    <operator spec="WilsonBalding" tree="@tree" weight="1.0"/>
+
+    <logger fileName="test2.$(seed).log" logEvery="1000" mode="autodetect" model="@posterior">
+        <log idref="coalescent"/>
+        <log idref="treeLikelihood"/>
+        <log spec="beast.evolution.tree.TreeHeightLogger" tree="@tree"/>
+        <log idref="popSize"/>
+        <log idref="hky.kappa"/>
+        <log idref="posterior"/>
+    </logger>
+    <!--
+    <logger fileName="test2.$(seed).trees" logEvery="1000" mode="autodetect">
+        <log idref="tree"/>
+    </logger>
+    -->
+    <logger logEvery="10000" mode="autodetect" model="@posterior">
+        <log idref="coalescent"/>
+        <log idref="treeLikelihood"/>
+        <log spec="beast.evolution.tree.TreeHeightLogger" tree="@tree"/>
+        <log idref="popSize"/>
+        <log idref="hky.kappa"/>
+        <log idref="posterior"/>
+    </logger>
+
+</run>
+
+</beast>
diff --git a/examples/beast2vs1/testCoalescentNoClock.xml b/examples/beast2vs1/testCoalescentNoClock.xml
new file mode 100644
index 0000000..2817ac2
--- /dev/null
+++ b/examples/beast2vs1/testCoalescentNoClock.xml
@@ -0,0 +1,128 @@
+<beast version='2.0'
+       namespace='beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood'>
+    <!-- equivalent to testCoalescentNoClock.xml in BEAST 1          -->
+
+    <!-- The sequence alignment (each sequence refers to a taxon above).         -->
+    <!-- ntax=6 nchar=768                                                        -->
+    <!-- npatterns=69                                                            -->
+    <data id="alignment" dataType="nucleotide">
+        <sequence taxon="human">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="chimp">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="bonobo">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAGC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTTGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="gorilla">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTAAACATAGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA-CAACACTTAATTTCTGTAAGGACTGCAAAACCCTACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCAATGGGACTCAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAT-TCAC [...]
+        </sequence>
+        <sequence taxon="orangutan">
+            AGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA-CAGCACTTAATTTCTGTAAGGACTGCAAAACCCCACTTTGCATCAACTGAGCGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCCTAGACCGATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAT-TGGCTTCAGTCCAAAGCCCCGGCAGGCCTTAAAGCTGCTCCTTCGAATTTGCAATTCAACATGACAA-TCAC [...]
+        </sequence>
+        <sequence taxon="siamang">
+            AGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTAACAAAACTTAATTTCTGCAAGGGCTGCAAAACCCTACTTTGCATCAACCGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCGATGGGACTTAAACCCATAAAAATTTAGTTAACAGCTAAACACCCTAAACAACCTGGCTTCAATCTAAAGCCCCGGCAGA-GTTGAAGCTGCTTCTTTGAACTTGCAATTCAACGTGAAAAATCAC [...]
+        </sequence>
+    </data>
+
+    <!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+    <input spec='HKY' id="hky">
+        <parameter name='kappa' idref='hky.kappa'/>
+        <input id='freqs' name='frequencies' spec='Frequencies' frequencies='@hky.frequencies'/>
+    </input>
+
+    <!-- site model                                                              -->
+    <input spec='SiteModel' id="siteModel">
+        <!--<parameter name='mutationRate'>1.0</parameter>-->
+        <substModel idref='hky'/>
+    </input>
+
+    <input spec='TreeLikelihood' id="treeLikelihood">
+        <data idref="alignment"/>
+        <tree idref="tree"/>
+        <siteModel idref="siteModel"/>
+    </input>
+
+   <input spec='beast.util.ClusterTree' id='tree' clusterType='upgma'>
+        <!--trait idref='rateCategories'/-->
+        <taxa idref='alignment'/>
+    </input>
+
+    <parameter id="hky.kappa" value="2.0" lower="0.0"/>
+    <parameter id="hky.frequencies" value="0.25" dimension="4"/>
+    <parameter id="popSize" value="0.077" lower="0.0"/>
+
+    <run spec="MCMC" id="mcmc" chainLength="10000000"> <!--autoOptimize="true"-->
+        <state>
+            <input name='stateNode' idref='hky.kappa'/>
+            <input name='stateNode' idref='hky.frequencies'/>
+            <input name='stateNode' idref='popSize'/>
+            <input name='stateNode' idref='tree'/>
+        </state>
+
+        <distribution spec="CompoundDistribution" id="posterior">
+            <distribution spec="CompoundDistribution" id="prior">
+                <distribution id="hky.kappa.prior" spec="beast.math.distributions.Prior" x="@hky.kappa">
+                    <distr id="LogNormalDistributionModel" M="1.0" S="1.25" meanInRealSpace="false"
+                                  spec="beast.math.distributions.LogNormalDistributionModel"/>
+                </distribution>
+                <distribution id="hky.frequencies.prior" spec="beast.math.distributions.Prior" x="@hky.frequencies">
+                    <distr id="Uniform" lower="0.0" upper="1.0" spec="beast.math.distributions.Uniform"/>
+                </distribution>
+                <distribution id="popSize.prior" spec="beast.math.distributions.Prior" x="@popSize">
+                    <distr id="OneOnX" offset="0.0" spec="beast.math.distributions.OneOnX"/>
+                </distribution>
+
+                <distribution id="coalescent" spec="Coalescent">
+                    <treeIntervals spec='TreeIntervals' id='TreeIntervals'>
+                        <tree idref="tree"/>
+                    </treeIntervals>
+                    <populationModel spec="ConstantPopulation" id='ConstantPopulation'>
+                        <parameter name="popSize" idref="popSize"/>
+                    </populationModel>
+                </distribution>
+            </distribution>
+            <distribution id='likelihood' idref="treeLikelihood"/>
+        </distribution>
+
+        <operator id='kappaScaler' spec='ScaleOperator' scaleFactor="0.75" weight="0.1" parameter="@hky.kappa"/>
+        <operator id='frequenciesDelta' spec='DeltaExchangeOperator' delta="0.01" weight="0.1"
+                  parameter="@hky.frequencies"/>
+        <operator id='popSizeScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3" parameter="@popSize"/>
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3" tree="@tree"/>
+        <operator spec='Uniform' weight="30" tree="@tree"/>
+        <operator spec='SubtreeSlide' weight="15" gaussian="true" size="0.0077" tree="@tree"/>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="15" tree="@tree"/>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="3" tree="@tree"/>
+        <operator spec='WilsonBalding' weight="1" tree="@tree"/>
+        <operator spec='UpDownOperator' scaleFactor="0.75" weight="3" down="@tree"/>
+
+        <logger logEvery="1000" fileName="test.$(seed).log">
+            <model idref='posterior'/>
+            <log idref="posterior"/>
+            <log idref="prior"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+            <log idref="popSize"/>
+            <log idref="hky.kappa"/>
+            <log idref="hky.frequencies"/>
+            <log idref="likelihood"/>
+            <log idref="coalescent"/>
+        </logger>
+<!--         <logger logEvery="1000" fileName="test.$(seed).trees">
+            <log idref="tree"/>
+        </logger>       -->
+        <logger logEvery="100000">
+            <model idref='posterior'/>
+            <log idref="posterior"/>
+            <log idref="prior"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+            <log idref="popSize"/>
+            <log idref="hky.kappa"/>
+            <log idref="hky.frequencies"/>
+            <log idref="likelihood"/>
+            <log idref="coalescent"/>
+        </logger>
+    </run>
+
+</beast>
diff --git a/examples/beast2vs1/testCoalescentNoClock1.xml b/examples/beast2vs1/testCoalescentNoClock1.xml
new file mode 100644
index 0000000..26c60b8
--- /dev/null
+++ b/examples/beast2vs1/testCoalescentNoClock1.xml
@@ -0,0 +1,117 @@
+<beast version='2.0'
+       namespace='beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood'>
+    <!-- equivalent to testCoalescentNoClock1.xml in BEAST 1          -->
+
+    <!-- The sequence alignment (each sequence refers to a taxon above).         -->
+    <!-- ntax=6 nchar=768                                                        -->
+    <!-- npatterns=69                                                            -->
+    <data id="alignment" dataType="nucleotide">
+        <sequence taxon="human">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="chimp">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="bonobo">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAGC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTTGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="gorilla">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTAAACATAGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA-CAACACTTAATTTCTGTAAGGACTGCAAAACCCTACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCAATGGGACTCAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAT-TCAC [...]
+        </sequence>
+        <sequence taxon="orangutan">
+            AGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA-CAGCACTTAATTTCTGTAAGGACTGCAAAACCCCACTTTGCATCAACTGAGCGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCCTAGACCGATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAT-TGGCTTCAGTCCAAAGCCCCGGCAGGCCTTAAAGCTGCTCCTTCGAATTTGCAATTCAACATGACAA-TCAC [...]
+        </sequence>
+        <sequence taxon="siamang">
+            AGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTAACAAAACTTAATTTCTGCAAGGGCTGCAAAACCCTACTTTGCATCAACCGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCGATGGGACTTAAACCCATAAAAATTTAGTTAACAGCTAAACACCCTAAACAACCTGGCTTCAATCTAAAGCCCCGGCAGA-GTTGAAGCTGCTTCTTTGAACTTGCAATTCAACGTGAAAAATCAC [...]
+        </sequence>
+    </data>
+
+    <!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+    <input spec='HKY' id="hky">
+        <parameter name='kappa' idref='hky.kappa'/>
+        <input id='freqs' name='frequencies' spec='Frequencies' frequencies='@hky.frequencies'/>
+    </input>
+
+    <!-- site model                                                              -->
+    <input spec='SiteModel' id="siteModel">
+        <!--<parameter name='mutationRate'>1.0</parameter>-->
+        <substModel idref='hky'/>
+    </input>
+
+    <input spec='TreeLikelihood' id="treeLikelihood">
+        <data idref="alignment"/>
+        <tree idref="tree"/>
+        <siteModel idref="siteModel"/>
+    </input>
+
+
+    <tree spec='beast.util.TreeParser' id='tree' IsLabelledNewick='true' newick=
+            '(siamang:0.06318470579939774,((gorilla:0.031056173315146828,((chimp:0.00982869388112981,bonobo:0.00982869388112981)
+        :0.01030402958978773,human:0.02013272347091754):0.010923449844229289):0.022256750048834654,orangutan:0.05331292336398148)
+        :0.009871782435416254);'
+          taxa='@alignment'/>
+
+
+    <parameter id="hky.kappa" value="2.0" lower="0.0"/>
+    <parameter id="hky.frequencies" value="0.25" dimension="4"/>
+    <parameter id="popSize" value="0.077" lower="0.0"/>
+
+
+    <run spec="MCMC" id="mcmc" chainLength="20000000"> <!--autoOptimize="true"-->
+        <state>
+            <stateNode idref='hky.kappa'/>
+            <stateNode idref='hky.frequencies'/>
+            <stateNode idref='popSize'/>
+            <stateNode idref='tree'/>
+        </state>
+
+        <distribution spec="CompoundDistribution" id="posterior">
+            <distribution id="coalescent" spec="Coalescent">
+                <treeIntervals spec='TreeIntervals' id='TreeIntervals'>
+                    <tree idref="tree"/>
+                </treeIntervals>
+                <populationModel spec="ConstantPopulation" id='ConstantPopulation'>
+                    <popSize idref="popSize"/>
+                </populationModel>
+            </distribution>
+            <distribution id='likelihood' idref="treeLikelihood"/>
+        </distribution>
+
+        <operator id='kappaScaler' spec='ScaleOperator' scaleFactor="0.75" weight="0.1" parameter="@hky.kappa"/>
+        <operator id='frequenciesDelta' spec='DeltaExchangeOperator' delta="0.01" weight="0.1"
+                  parameter="@hky.frequencies"/>
+        <operator id='popSizeScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3" parameter="@popSize"/>
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3" tree="@tree"/>
+        <operator spec='Uniform' weight="30" tree="@tree"/>
+        <operator spec='SubtreeSlide' weight="15" gaussian="true" size="0.0077" tree="@tree"/>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="15" tree="@tree"/>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="3" tree="@tree"/>
+        <operator spec='WilsonBalding' weight="1" tree="@tree"/>
+
+
+        <logger logEvery="1000" fileName="test.$(seed).log">
+            <model idref='posterior'/>
+            <log idref="posterior"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+            <log idref="popSize"/>
+            <log idref="hky.kappa"/>
+            <log idref="hky.frequencies"/>
+            <log idref="likelihood"/>
+            <log idref="coalescent"/>
+        </logger>
+        <!--         <logger logEvery="1000" fileName="test.$(seed).trees">
+        <log idref="tree"/>
+    </logger>    -->
+        <logger logEvery="100000">
+            <model idref='posterior'/>
+            <log idref="posterior"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+            <log idref="popSize"/>
+            <log idref="hky.kappa"/>
+            <log idref="hky.frequencies"/>
+            <log idref="likelihood"/>
+            <log idref="coalescent"/>
+        </logger>
+    </run>
+
+</beast>
diff --git a/examples/beast2vs1/testCoalescentTipDates.xml b/examples/beast2vs1/testCoalescentTipDates.xml
new file mode 100644
index 0000000..169ee72
--- /dev/null
+++ b/examples/beast2vs1/testCoalescentTipDates.xml
@@ -0,0 +1,70 @@
+<beast version='2.0'
+       namespace='beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood'>
+
+    <data id="alignment" dataType="nucleotide">
+        <sequence taxon="A">
+            A
+        </sequence>
+        <sequence taxon="B">
+            A
+        </sequence>
+        <sequence taxon="C">
+            A
+        </sequence>
+        <sequence taxon="D">
+            A
+        </sequence>
+    </data>
+
+   <tree spec='beast.util.ClusterTree' id='tree' clusterType='upgma'>
+        <trait spec='beast.evolution.tree.TraitSet' traitname='date-forward' units='day'
+               value='
+		A  = 5000,
+		B  = 5000,
+		C  = 0,
+		D  = 0'>
+			<taxa spec='beast.evolution.alignment.TaxonSet' alignment='@alignment'/>
+        </trait>
+        <taxa idref='alignment'/>
+    </tree>
+
+    <parameter id="popSize" value="10000" lower="0.0"/>
+
+    <run spec="MCMC" id="mcmc" chainLength="1000000"> <!--autoOptimize="true"-->
+        <state>
+            <stateNode idref='tree'/>
+        </state>
+
+        <distribution spec="CompoundDistribution" id="posterior">
+            <distribution id="coalescent" spec="Coalescent">
+                <treeIntervals spec='TreeIntervals' id='TreeIntervals'>
+                     <tree idref="tree"/>
+                </treeIntervals>
+                <populationModel spec="ConstantPopulation" id='ConstantPopulation'>
+                    <popSize idref="popSize"/>
+                </populationModel>
+            </distribution>
+        </distribution>
+
+        <operator spec='SubtreeSlide' weight="15" gaussian="true" size="14000" tree="@tree"/>
+
+        <logger logEvery="5" fileName="test.$(seed).log">
+   	        <model idref='posterior'/>
+            <log idref="coalescent"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+            <log idref="popSize"/>
+            <log idref="posterior"/>
+        </logger>
+<!--        <logger logEvery="100" fileName="test.$(seed).trees">
+            <log idref="tree"/>
+        </logger>  -->
+        <logger logEvery="5000">
+	        <model idref='posterior'/>
+            <log idref="coalescent"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+            <log idref="popSize"/>
+            <log idref="posterior"/>
+        </logger>
+    </run>
+
+</beast>
diff --git a/examples/beast2vs1/testCoalescentTipDates1.xml b/examples/beast2vs1/testCoalescentTipDates1.xml
new file mode 100644
index 0000000..568488f
--- /dev/null
+++ b/examples/beast2vs1/testCoalescentTipDates1.xml
@@ -0,0 +1,70 @@
+<beast version='2.0'
+       namespace='beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood'>
+
+    <data id="alignment" dataType="nucleotide">
+        <sequence taxon="A">
+            A
+        </sequence>
+        <sequence taxon="B">
+            A
+        </sequence>
+        <sequence taxon="C">
+            A
+        </sequence>
+        <sequence taxon="D">
+            A
+        </sequence>
+    </data>
+
+   <tree spec='beast.util.ClusterTree' id='tree' clusterType='upgma'>
+        <trait spec='beast.evolution.tree.TraitSet' traitname='date-forward' units='day'
+               value='
+		A  = 0,
+		B  = 0,
+		C  = 0,
+		D  = 0'>
+		<taxa spec='beast.evolution.alignment.TaxonSet' alignment='@alignment'/>
+        </trait>
+		<taxa idref='alignment'/>
+    </tree>
+
+    <parameter id="popSize" value="10000" lower="0.0"/>
+
+    <run spec="MCMC" id="mcmc" chainLength="1000000"> <!--autoOptimize="true"-->
+        <state>
+            <stateNode idref='tree'/>
+        </state>
+
+        <distribution spec="CompoundDistribution" id="posterior">
+            <distribution id="coalescent" spec="Coalescent">
+                <treeIntervals spec='TreeIntervals' id='TreeIntervals'>
+                     <tree idref="tree"/>
+                </treeIntervals>
+                <populationModel spec="ConstantPopulation" id='ConstantPopulation'>
+                    <popSize idref="popSize"/>
+                </populationModel>
+            </distribution>
+        </distribution>
+
+        <operator spec='SubtreeSlide' weight="15" gaussian="true" size="14000" tree="@tree"/>
+
+        <logger logEvery="5" fileName="test.$(seed).log">
+   	        <model idref='posterior'/>
+            <log idref="coalescent"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+            <log idref="popSize"/>
+            <log idref="posterior"/>
+        </logger>
+<!--        <logger logEvery="100" fileName="test.$(seed).trees">
+            <log idref="tree"/>
+        </logger>  -->
+        <logger logEvery="5000">
+	        <model idref='posterior'/>
+            <log idref="coalescent"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+            <log idref="popSize"/>
+            <log idref="posterior"/>
+        </logger>
+    </run>
+
+</beast>
diff --git a/examples/beast2vs1/testCoalescentTipDatesSampling.xml b/examples/beast2vs1/testCoalescentTipDatesSampling.xml
new file mode 100644
index 0000000..387797c
--- /dev/null
+++ b/examples/beast2vs1/testCoalescentTipDatesSampling.xml
@@ -0,0 +1,101 @@
+<beast version='2.0'
+       namespace='beast.math:beast.evolution.alignment:beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood'>
+
+    <data id="alignment" dataType="nucleotide">
+        <sequence taxon="A">
+            A
+        </sequence>
+        <sequence taxon="B">
+            A
+        </sequence>
+        <sequence taxon="C">
+            A
+        </sequence>
+        <sequence taxon="D">
+            A
+        </sequence>
+    </data>
+
+   <tree spec='beast.util.ClusterTree' id='tree' clusterType='upgma'>
+        <trait spec='beast.evolution.tree.TraitSet' traitname='date-backward' units='day'
+               value='
+		A  = 5000,
+		B  = 5000,
+		C  = 5000,
+		D  = 5000'>
+			<taxa spec='beast.evolution.alignment.TaxonSet' alignment='@alignment'/>
+        </trait>
+		<taxa idref='alignment'/>
+    </tree>
+
+    <parameter id="popSize" value="1000000" lower="0.0"/>
+
+    <run spec="MCMC" id="mcmc" chainLength="10000000"> <!--autoOptimize="true"-->
+        <state>
+            <stateNode idref='tree'/>
+        </state>
+
+        <distribution spec="CompoundDistribution" id="posterior">
+            <distribution id="coalescent" spec="Coalescent">
+                <treeIntervals spec='TreeIntervals' id='TreeIntervals'>
+                     <tree idref="tree"/>
+                </treeIntervals>
+                <populationModel spec="ConstantPopulation" id='ConstantPopulation'>
+                    <popSize idref="popSize"/>
+                </populationModel>
+            </distribution>
+
+            <distribution id="tipDateA" monophyletic="false" spec="distributions.MRCAPrior" tipsonly="true" tree="@tree">
+                <taxonset id="TaxonSetA" spec="TaxonSet">
+                    <taxon id="A" spec="Taxon"/>
+                </taxonset>
+                <distr id="Uniform0" lower="4999" offset="0.0" spec="distributions.Uniform" upper="5001"/>
+            </distribution>
+
+            <distribution id="tipDateB" monophyletic="false" spec="distributions.MRCAPrior" tipsonly="true" tree="@tree">
+                <taxonset id="TaxonSetB" spec="TaxonSet">
+                    <taxon id="B" spec="Taxon"/>
+                </taxonset>
+                <distr id="Noraml0" offset="0.0" spec="distributions.Normal" mean="5000" sigma="1"/>
+            </distribution>
+
+            <distribution id="rootHeight" monophyletic="false" spec="distributions.MRCAPrior" tipsonly="false" tree="@tree">
+                <taxonset id="TaxonSetAll" spec="TaxonSet" alignment="@alignment"/>
+                <distr id="Noraml1" offset="0.0" spec="distributions.Normal" mean="20000" sigma="1"/>
+            </distribution>
+
+            <!--<distribution id="tipDateD" monophyletic="false" spec="distributions.MRCAPrior" tipsonly="true" tree="@tree">-->
+                <!--<taxonset id="TaxonSetD" spec="TaxonSet">-->
+                    <!--<taxon id="D" spec="Taxon"/>-->
+                <!--</taxonset>-->
+            <!--</distribution>-->
+        </distribution>
+
+        <operator spec='SubtreeSlide' weight="15" gaussian="true" size="14000" tree="@tree"/>
+        <operator id="TipDatesRandomWalkerA" windowSize="1" spec="TipDatesRandomWalker" taxonset="@TaxonSetA" tree="@tree" weight="1.0"/>
+        <operator id="TipDatesRandomWalkerB" windowSize="1" spec="TipDatesRandomWalker" taxonset="@TaxonSetB" tree="@tree" weight="1.0"/>
+
+        <logger logEvery="1000" fileName="test.$(seed).log">
+   	        <model idref='posterior'/>
+            <log idref="posterior"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+            <log idref="coalescent"/>
+            <log idref="popSize"/>
+            <log idref='tipDateA'/>
+			<log idref='tipDateB'/>
+            <log idref='rootHeight'/>
+        </logger>
+<!--        <logger logEvery="100" fileName="test.$(seed).trees">
+            <log idref="tree"/>
+        </logger>  -->
+        <logger logEvery="10000">
+	        <model idref='posterior'/>
+            <log idref="posterior"/>
+            <log idref="coalescent"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+            <log idref='rootHeight'/>
+            <log idref="popSize"/>
+        </logger>
+    </run>
+
+</beast>
diff --git a/examples/beast2vs1/testEBSP.xml b/examples/beast2vs1/testEBSP.xml
new file mode 100644
index 0000000..9667706
--- /dev/null
+++ b/examples/beast2vs1/testEBSP.xml
@@ -0,0 +1,317 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<beast namespace="beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood:beast.core.parameter:beast.math.distributions"
+       version="2.0">
+
+
+    <data dataType="nucleotide" id="alignment.26" name="taxa">
+        <sequence id="seq_Orthogeomys_heterodus" taxon="Orthogeomys_heterodus" totalcount="4"
+                  value="ATTCTAGGCAAAAAG-AGCAATGCTGGAGGTATTACAATACCAGACTTCAAACTTTACTATAGAGCCATAATAACAAAAACCGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAATGGAAYAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGTCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCACCATGCACAGGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCAGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGGGAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATAGGAGAAAGACTCAATAAATGGGACTACC [...]
+        <sequence id="seq_Thomomys_bottae_awahnee_a" taxon="Thomomys_bottae_awahnee_a" totalcount="4"
+                  value="????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACMCAGTCTATTCAATTATTGGKGCTGGCAAAACTGGGCAGCCMCATGCARAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAA?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+        <sequence id="seq_Thomomys_bottae_awahnee_b" taxon="Thomomys_bottae_awahnee_b" totalcount="4"
+                  value="????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCM-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACC [...]
+        <sequence id="seq_Thomomys_bottae_xerophilus" taxon="Thomomys_bottae_xerophilus" totalcount="4"
+                  value="????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAAYTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAA?????????????????????????????????????????????????????? [...]
+        <sequence id="seq_Thomomys_bottae_cactophilus" taxon="Thomomys_bottae_cactophilus" totalcount="4"
+                  value="????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAAYGTCAGACCGGAAACCGTGAAAYTGTTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAA????????????????????????????????????????????????????????????????? [...]
+        <sequence id="seq_Thomomys_bottae_albatus" taxon="Thomomys_bottae_albatus" totalcount="4"
+                  value="????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGATCCAGAAATAGAACCAC-ATACCTATAGTCAACTTGTATTTGATAAAGGAGCTAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCATTTCACCATGCACAAGAATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCT-------------------------------------CATAGGCACTCATAGGCACAGGCAAAAGATTCCTATACAGGAACCCAGGGTCAACAACAGATTGGAGAGAGACTCAATAAATGGGACTACC [...]
+        <sequence id="seq_Thomomys_bottae_ruidosae" taxon="Thomomys_bottae_ruidosae" totalcount="4"
+                  value="????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCARAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAAYTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAG??????????????????????????????????????????????????????????????? [...]
+        <sequence id="seq_Thomomys_bottae_bottae" taxon="Thomomys_bottae_bottae" totalcount="4"
+                  value="????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAAATTCCTGAACAGAATCCCAGGGTCA-CAACAGATKGGAGAGAGACTCGATAAATGGGACTACC [...]
+        <sequence id="seq_Thomomys_bottae_alpinus" taxon="Thomomys_bottae_alpinus" totalcount="4"
+                  value="????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCTATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCA??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+        <sequence id="seq_Thomomys_bottae_riparius" taxon="Thomomys_bottae_riparius" totalcount="4"
+                  value="????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACC [...]
+        <sequence id="seq_Thomomys_bottae_mewa" taxon="Thomomys_bottae_mewa" totalcount="4"
+                  value="????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCATTTCACCATGCACAAGAATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAA???????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+        <sequence id="seq_Thomomys_bottae_saxatilis" taxon="Thomomys_bottae_saxatilis" totalcount="4"
+                  value="????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAA?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+        <sequence id="seq_Thomomys_bottae_laticeps" taxon="Thomomys_bottae_laticeps" totalcount="4"
+                  value="????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAATTGCTACATGATAAWGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCAATAAATGGGACTACC [...]
+        <sequence id="seq_Thomomys_talpoides_ocius" taxon="Thomomys_talpoides_ocius" totalcount="4"
+                  value="???CTAGGCAAAA-G-AGC-ATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATMCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCRACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACC [...]
+        <sequence id="seq_Thomomys_idahoensis_pygmaeus_a" taxon="Thomomys_idahoensis_pygmaeus_a" totalcount="4"
+                  value="????????CAAAA-G-AGCAATGCTGGTGGTATYACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATMCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCRACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACC [...]
+        <sequence id="seq_Thomomys_idahoensis_pygmaeus_b" taxon="Thomomys_idahoensis_pygmaeus_b" totalcount="4"
+                  value="????GGCGCAAAA-G-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATMCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACC [...]
+        <sequence id="seq_Thomomys_mazama_mazama" taxon="Thomomys_mazama_mazama" totalcount="4"
+                  value="ATTCTAGGCAAAAAGAAGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAAYTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACC [...]
+        <sequence id="seq_Thomomys_mazama_nasicus" taxon="Thomomys_mazama_nasicus" totalcount="4"
+                  value="ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCSCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAAYTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACC [...]
+        <sequence id="seq_Thomomys_monticola_a" taxon="Thomomys_monticola_a" totalcount="4"
+                  value="??????????????G-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGYCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACC [...]
+        <sequence id="seq_Thomomys_monticola_b" taxon="Thomomys_monticola_b" totalcount="4"
+                  value="ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATYACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAWATAGAACCAC-ACAACTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAATGGAACRAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACC [...]
+        <sequence id="seq_Thomomys_talpoides_yakimensis" taxon="Thomomys_talpoides_yakimensis" totalcount="4"
+                  value="ATTCTAGGCAAAA-G-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTKTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAAYGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAAYTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACC [...]
+        <sequence id="seq_Thomomys_talpoides_bridgeri" taxon="Thomomys_talpoides_bridgeri" totalcount="4"
+                  value="ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATCCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCRACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACC [...]
+        <sequence id="seq_Thomomys_townsendii_townsendii" taxon="Thomomys_townsendii_townsendii" totalcount="4"
+                  value="ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTYGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACC [...]
+        <sequence id="seq_Thomomys_townsendii_relictus" taxon="Thomomys_townsendii_relictus" totalcount="4"
+                  value="??????????????G-AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTAYTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCACTATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAATGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAATTGCTACATGATAAWGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACC [...]
+        <sequence id="seq_Thomomys_umbrinus_chihuahuae" taxon="Thomomys_umbrinus_chihuahuae" totalcount="4"
+                  value="?????????????AG-AGC-ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCTTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACC [...]
+        <sequence id="seq_Thomomys_umbrinus_atroavarius" taxon="Thomomys_umbrinus_atroavarius" totalcount="4"
+                  value="ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGCATTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGKCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGYCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAAYGTCAGACCGGAAACCGTGAAATTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACC [...]
+    </data>
+    <data dataType="nucleotide" id="alignment.29" name="taxa">
+        <sequence id="seq_Orthogeomys_heterodus1" taxon="Orthogeomys_heterodus" totalcount="4"
+                  value="C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCACAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCGTTTCTGGAAAACTGAGATCTTGTTTTGACCAACAGAAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTACTGGTGATGTCTCTGTCAGGATCTAGTCCCATCCTG-AATCCATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTCAGAACTGACTGAATCAGGCCAGTGAAAGTTA-CAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATTGTGCATGGCTTCATTAGCAGGTTTACTGTGCTGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTT [...]
+        <sequence id="seq_Thomomys_bottae_awahnee_a1" taxon="Thomomys_bottae_awahnee_a" totalcount="4"
+                  value="C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTT [...]
+        <sequence id="seq_Thomomys_bottae_awahnee_b1" taxon="Thomomys_bottae_awahnee_b" totalcount="4"
+                  value="C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTT [...]
+        <sequence id="seq_Thomomys_bottae_xerophilus1" taxon="Thomomys_bottae_xerophilus" totalcount="4"
+                  value="C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCACTAAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTRTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTT [...]
+        <sequence id="seq_Thomomys_bottae_cactophilus1" taxon="Thomomys_bottae_cactophilus" totalcount="4"
+                  value="C-AGCTTGCTG-TCACACTACCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCACTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTT [...]
+        <sequence id="seq_Thomomys_bottae_albatus1" taxon="Thomomys_bottae_albatus" totalcount="4"
+                  value="C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTT [...]
+        <sequence id="seq_Thomomys_bottae_ruidosae1" taxon="Thomomys_bottae_ruidosae" totalcount="4"
+                  value="?????????????????????????????C-AGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTT [...]
+        <sequence id="seq_Thomomys_bottae_bottae1" taxon="Thomomys_bottae_bottae" totalcount="4"
+                  value="C-AGCTTGCTG-TCACACYGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTAKGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTT [...]
+        <sequence id="seq_Thomomys_bottae_alpinus1" taxon="Thomomys_bottae_alpinus" totalcount="4"
+                  value="C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCC-AGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGTTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCYACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTT [...]
+        <sequence id="seq_Thomomys_bottae_riparius1" taxon="Thomomys_bottae_riparius" totalcount="4"
+                  value="C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTT [...]
+        <sequence id="seq_Thomomys_bottae_mewa1" taxon="Thomomys_bottae_mewa" totalcount="4"
+                  value="C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTT [...]
+        <sequence id="seq_Thomomys_bottae_saxatilis1" taxon="Thomomys_bottae_saxatilis" totalcount="4"
+                  value="C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTT [...]
+        <sequence id="seq_Thomomys_bottae_laticeps1" taxon="Thomomys_bottae_laticeps" totalcount="4"
+                  value="C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTT [...]
+        <sequence id="seq_Thomomys_talpoides_ocius1" taxon="Thomomys_talpoides_ocius" totalcount="4"
+                  value="C-AGCTTGCTGGTCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCATATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAAWGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTT [...]
+        <sequence id="seq_Thomomys_idahoensis_pygmaeus_a1" taxon="Thomomys_idahoensis_pygmaeus_a" totalcount="4"
+                  value="C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTTTAAGTGTTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGTCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGTCCAGTGAAACTTAACAGCTACCTTGCCAATKGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGG--TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTT [...]
+        <sequence id="seq_Thomomys_idahoensis_pygmaeus_b1" taxon="Thomomys_idahoensis_pygmaeus_b" totalcount="4"
+                  value="CAAGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTGTTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGTCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGG--TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTT [...]
+        <sequence id="seq_Thomomys_mazama_mazama1" taxon="Thomomys_mazama_mazama" totalcount="4"
+                  value="C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTATTGCCTGGATATAGTGTCTATAGACAGAGACAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCACATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCACCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCTGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTT [...]
+        <sequence id="seq_Thomomys_mazama_nasicus1" taxon="Thomomys_mazama_nasicus" totalcount="4"
+                  value="C-AGCTTGCTG-TCACAATGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTATTGCCTGGATATAGTGTCTATAGACAGAGACAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCACATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCTGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTT [...]
+        <sequence id="seq_Thomomys_monticola_a1" taxon="Thomomys_monticola_a" totalcount="4"
+                  value="C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGACGCCKTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTT [...]
+        <sequence id="seq_Thomomys_monticola_b1" taxon="Thomomys_monticola_b" totalcount="4"
+                  value="C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGACGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTYCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTT [...]
+        <sequence id="seq_Thomomys_talpoides_yakimensis1" taxon="Thomomys_talpoides_yakimensis" totalcount="4"
+                  value="C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGAMTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTT [...]
+        <sequence id="seq_Thomomys_talpoides_bridgeri1" taxon="Thomomys_talpoides_bridgeri" totalcount="4"
+                  value="C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTT [...]
+        <sequence id="seq_Thomomys_townsendii_townsendii1" taxon="Thomomys_townsendii_townsendii" totalcount="4"
+                  value="C-AGCTTGCTGGTCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTT [...]
+        <sequence id="seq_Thomomys_townsendii_relictus1" taxon="Thomomys_townsendii_relictus" totalcount="4"
+                  value="C-AGCTTGCTGGTCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTT [...]
+        <sequence id="seq_Thomomys_umbrinus_chihuahuae1" taxon="Thomomys_umbrinus_chihuahuae" totalcount="4"
+                  value="C-AGCTTGCTGGTCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAAGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTGGAATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTT [...]
+        <sequence id="seq_Thomomys_umbrinus_atroavarius1" taxon="Thomomys_umbrinus_atroavarius" totalcount="4"
+                  value="C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTT [...]
+    </data>
+    <data dataType="nucleotide" id="alignment.47" name="taxa">
+        <sequence id="seq_Orthogeomys_heterodus2" taxon="Orthogeomys_heterodus" totalcount="4"
+                  value="CATGATTTTGTCATGCCTTCTTAC-TGCTTATCTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGATGATTGACGCTGCTGTCAGTAGTGAGTGACACAAATTTTATTTAGTTTGGGTGTGTGCCTACCAGTATAATTGCTGGACCACGTGTAGGTCTGTATTAATCTTCTGAAGAACGGTTAGGCCATCTGTGAATTGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCACGATTTCTTTTCCA-CC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+        <sequence id="seq_Thomomys_bottae_awahnee_a2" taxon="Thomomys_bottae_awahnee_a" totalcount="4"
+                  value="CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACARAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCYTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCAACC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+        <sequence id="seq_Thomomys_bottae_awahnee_b2" taxon="Thomomys_bottae_awahnee_b" totalcount="4"
+                  value="CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACASAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCYTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCAMCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+        <sequence id="seq_Thomomys_bottae_xerophilus2" taxon="Thomomys_bottae_xerophilus" totalcount="4"
+                  value="CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACAGAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCACCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+        <sequence id="seq_Thomomys_bottae_cactophilus2" taxon="Thomomys_bottae_cactophilus" totalcount="4"
+                  value="CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACAGAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTRTGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCACCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+        <sequence id="seq_Thomomys_bottae_albatus2" taxon="Thomomys_bottae_albatus" totalcount="4"
+                  value="CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACAGAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTGTGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCACCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+        <sequence id="seq_Thomomys_bottae_ruidosae2" taxon="Thomomys_bottae_ruidosae" totalcount="4"
+                  value="CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTYGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACASAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCACCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+        <sequence id="seq_Thomomys_bottae_bottae2" taxon="Thomomys_bottae_bottae" totalcount="4"
+                  value="CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTYGTTTTCACCTGTGTGTTGATTGACGCTACTGTCAGTAGTGGGTGACAGAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCYGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCAMCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+        <sequence id="seq_Thomomys_bottae_alpinus2" taxon="Thomomys_bottae_alpinus" totalcount="4"
+                  value="CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACAGAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCYGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCAMCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+        <sequence id="seq_Thomomys_bottae_riparius2" taxon="Thomomys_bottae_riparius" totalcount="4"
+                  value="CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACAGAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTRTGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCACCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+        <sequence id="seq_Thomomys_bottae_mewa2" taxon="Thomomys_bottae_mewa" totalcount="4"
+                  value="CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACAGAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCAACC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+        <sequence id="seq_Thomomys_bottae_saxatilis2" taxon="Thomomys_bottae_saxatilis" totalcount="4"
+                  value="CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACAGAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCAACC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+        <sequence id="seq_Thomomys_bottae_laticeps2" taxon="Thomomys_bottae_laticeps" totalcount="4"
+                  value="CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACASAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCYTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCAACC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+        <sequence id="seq_Thomomys_talpoides_ocius2" taxon="Thomomys_talpoides_ocius" totalcount="4"
+                  value="CATGATTTTTTCATGCTTTCTTAC-TGCTTATCTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACACTATTGTCAGTAGTGGGTGACACAAATTTCATTTAATTTGGGTGTGTGCCTACCAGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAACGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCATGATATCTTTTCCAACCCTAGATTTTTTTTT--------------------------------GCACTGTCCTTGGACTTTCTCAAGGCTAGAGCTCTACCACTTGAGCCTCAGCATCACTTCTGGCTTTTTTTTTC-TATGTATGTGGTATCAAGGAATCGAACCCGGGTCTTCGTGCATGCTAGGCAAGCACTCTACCACTAGGCCAAACTCCCAGCCCCAA [...]
+        <sequence id="seq_Thomomys_idahoensis_pygmaeus_a2" taxon="Thomomys_idahoensis_pygmaeus_a" totalcount="4"
+                  value="???????TTTTCATGCTTTCTTAC-TGCTTATCTGCTTGTGGGCTTTGGGTTGTTTTTACCTGTGGGTTGATTGACACTACTGTCAGTAGTGGGTGACACAAATTTCATTTAATTTGGGTGTGTGCCTACCAGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAACGGTTCGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCACGATATCTTTTCCAACCCTAGATTTTTTTTTTT---------------------------T--GCACTGTCCTTGGACTTTCTCAAGGCTAGAGCTCTACCACTTGAGCCTCAGCATCACTTCTGGCTTTTTTTTTTCTATGTATGTGGTATCAAGGAATCGAACCCGGGTCTTCGTGCATGCTAGGCAAGCACTCTACCACTAGGCCAAACTCCCAGCCCCAA [...]
+        <sequence id="seq_Thomomys_idahoensis_pygmaeus_b2" taxon="Thomomys_idahoensis_pygmaeus_b" totalcount="4"
+                  value="?ATGATTTTTTCATGCTTTCTTAC-TGCTTATCTGCTTGTGGGCTTTGGGTTGTTTTTACCTGTGGGTTGATTGACACTACTGTCAGTAGTGGGTGACACAAATTTCATTTAATTTGGGTGTGTGCCTACTAGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAACGGTTAGGCCATCTGTGAAATGCTATACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCACGATATCTTTTCCAACCCTAGATGTTTTTTTT-G------------------------------CACTGTCCTTGGACTTTCTCAAGGCTAGAGCTCTACCACTTGAGCCTCAGCACCACTTCTGGCTTTTTTTTTTCTACGTATGTGGTATCAAGGAATCGAACCCGGGTCTTCGTGCATGCTAGGCAAGCACTCTACCACTAGGCCAAACTCCCAGCCCCAA [...]
+        <sequence id="seq_Thomomys_mazama_mazama2" taxon="Thomomys_mazama_mazama" totalcount="4"
+                  value="??????????????????????A---GCTTATATGCTTGTGTGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACACTACTGCCAGTAGTGGGTGACACAAATTTCATTTAATTTGGGTGTGTGCCTACCAGTATAATTGCTGGACCACATATAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCACGATATCTTTTCCAACCCTAGATTTTTTTTTTT------------------------------------------------------------------------------------------------------TTCTATGTATGTGGTACCAAGGAATCGAACCCGGGTCTTTGTGCATGCTATGCAAGCACTTTACCACTAGGCCAAACTCCCAGCCCCAA [...]
+        <sequence id="seq_Thomomys_mazama_nasicus2" taxon="Thomomys_mazama_nasicus" totalcount="4"
+                  value="??????????????GCTTTCTTACGTGCTTATATGCTTGTGTGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACACTACTGCCAGTAGTGGGTGACACAAATTTCATTTAATTTGGGTGTGTGCCTACCAGTATAATTGCTGGACCACATATAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCATGATATCTTTTCCAACCCTAGATTTTTTTTTTTGCCAGTCCTGGGCTTGAGCTCAGGGCCTGAGCACTGTCCTTGGACTTTCTCAAGGCTAGAGCTCTACCACTTGAGCTTCAGCATCACTTCTGGCTTTTTTTTTTCTATGTATGTGGTACCAAGGAATCGAACCCGGGTCTTTGTGCATGCTATGCAGGCACTCTACCACTAGGCCAAACTCCCAGCCCCAA [...]
+        <sequence id="seq_Thomomys_monticola_a2" taxon="Thomomys_monticola_a" totalcount="4"
+                  value="CATGATTTTTTCATGCTTTCTTAC-TGCTTATCTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACACTACTGTCAGTAGTGGGTGACACAAATTTCATTTAATTTGAGTGTGTGCCTACCAGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAACGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCACGATATCTTTTCCAACCCTAGATTTTTTTTTTTGCCAGTCCTGGGCTTGAGCTCAGGGCCTGAACACTGTCCTTGGACTTTCTCAAGGCTAGAGCTCTACCACTTGAGCCTCAGCATCACTTCTGGCTTTTTTT-TTCTATGTATGTGGTACCAAGGAATCGAACCCGGGTCTTCGTGCATGCTAGGCAAGCACTCTACCACTAGCCCAAACTCCCAGCCCCAA [...]
+        <sequence id="seq_Thomomys_monticola_b2" taxon="Thomomys_monticola_b" totalcount="4"
+                  value="CATGATTTTTTCATGCTTTCTTAC-TGCTTATCTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACACTACTGTCAGTAGTGGGTGACACAAATTTCATTTAATTTGAGTGTGTGCCTACCAGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAAYGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCACGATATCTTTTCCAACCCTAGATTTTTTTTT--GCCAGTCCTGGGCTTSAGCTCAGGGCCTGAACACTGTCCTTGGACTTTCTCAAGGCTAGAGCTKTACCACTTGAGCCTCAGCATCACTTCTGGCTTTTTTTTTTCTATGTATGTGGTACCAAGGAATCGAACCCGGGTCTTCGTGCATGCTAGGCAAGCACTCTACCACTAGCCCAAACTCCCAGCCCCAA [...]
+        <sequence id="seq_Thomomys_talpoides_yakimensis2" taxon="Thomomys_talpoides_yakimensis" totalcount="4"
+                  value="?????????????????TTCTTAC-TGCTTATCTGCTTGTGGGCTTTGGGCTGTTTTCACCTGTGGGTTGATTGACACTACTGTCAGTAGTGGGTGACACAAATTTCATTTAATTTGGTTGTGTGCCTACCAGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAACGGTTAGGCCATCTGTGAAGTGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCACGATATCTTTTCCAACCCTAGATTTTTTTTTTT---------------------------TTTGCACTGTCCTTGGACTTTCTCAAGGCTAGAGCTCTACCACTTGAGCCTCAGCATCACTTCTGGCTTTTTTTTTTCTATGTATGTGGTATCAAGGAATCGAACCCGGGTCTTCGTGCATGCTAGGCAAGCACTCTACCAGTAGGCCAAACTCCCAGCCCCAA [...]
+        <sequence id="seq_Thomomys_talpoides_bridgeri2" taxon="Thomomys_talpoides_bridgeri" totalcount="4"
+                  value="CATGATTTTTTCATGCTTTCTTAC-TGCTTATCTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACACTACTGTCAGTAGTGGGTGACACAAATTTCATTTAATTTGGTTGTGTGCCTACCAGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAACGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCACGATATCTTTTCCAACCCTAGATTTTTTTTTTT------------------------------GCACTGTCCTTGGACTTTCTCAAGGCTAGAGCTCTACCACTTGAGCCTCAGCATCACTTCTGGCTTTTTTT-TTCTATGTATGTGGTATCAAGGAATCGAACCCGGGTCTTCGTGCATGCTCGGCAAGCACTCTACCACTAGGCCAAACTCCCAGCCYCAA [...]
+        <sequence id="seq_Thomomys_townsendii_townsendii2" taxon="Thomomys_townsendii_townsendii" totalcount="4"
+                  value="CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACACAAATTTCATTTAGTTTGGGTGTGTGCCTACCAGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCCTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCAACC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+        <sequence id="seq_Thomomys_townsendii_relictus2" taxon="Thomomys_townsendii_relictus" totalcount="4"
+                  value="CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACAGAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCACCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+        <sequence id="seq_Thomomys_umbrinus_chihuahuae2" taxon="Thomomys_umbrinus_chihuahuae" totalcount="4"
+                  value="CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACAGAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTGTGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCACCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+        <sequence id="seq_Thomomys_umbrinus_atroavarius2" taxon="Thomomys_umbrinus_atroavarius" totalcount="4"
+                  value="CATGATTTTGTCATGYTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTYGATTGACGCTACTGTCAGTAGTGGGTGACAGAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTRTGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCACCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+    </data>
+
+    <plate spec='Plate' var='n' range='.26,.29,.47'>
+        <!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+        <input spec='HKY' id='hky$(n)' kappa='@hky.kappa$(n)'>
+            <frequencies spec='Frequencies' frequencies='@hky.frequencies$(n)'/>
+        </input>
+
+        <!-- site model                                                              -->
+        <input spec='SiteModel' id="siteModel$(n)" substModel='@hky$(n)'/>
+
+        <tree spec='beast.util.ClusterTree' id='tree$(n)' clusterType='upgma' taxa='@alignment$(n)'/>
+
+        <input spec='TreeLikelihood' id="treeLikelihood$(n)"
+               data="@alignment$(n)"
+               tree="@tree$(n)"
+               siteModel="@siteModel$(n)"/>
+
+        <parameter id="hky.kappa$(n)" value="2.0" lower="0.0"/>
+        <parameter id="hky.frequencies$(n)" value="0.25" dimension="4"/>
+    </plate>
+
+    <parameter id="popSizes" value="0.017" lower="0.0"/>
+    <input name="indicators" spec='BooleanParameter' id='indicators' value="false"/>
+    <parameter id="populationMean" value="0.017" lower="0.0"/>
+
+    <run spec="MCMC" id="mcmc" chainLength="10000000"> <!--autoOptimize="true"-->
+        <state>
+            <plate spec='Plate' var='n' range='.26,.29,.47'>
+                <stateNode idref='hky.kappa$(n)'/>
+                <stateNode idref='hky.frequencies$(n)'/>
+                <stateNode idref='tree$(n)'/>
+            </plate>
+            <stateNode idref='popSizes'/>
+            <stateNode idref='indicators'/>
+            <stateNode idref='populationMean'/>
+        </state>
+
+        <distribution id="posterior" spec="CompoundDistribution">
+            <distribution id="prior" spec="CompoundDistribution">
+                <distribution spec="Prior" x="@populationMean">
+                    <distr offset="0.0" spec="OneOnX"/>
+                </distribution>
+                <distribution spec="Prior">
+                    <x arg="@indicators" id="indsSun" spec="Sum"/>
+                    <distr offset="0.0" spec="Poisson">
+                        <parameter dimension="1" estimate="true" lower="0.0" name="lambda" upper="0.0" value="0.6931471805599453"/>
+                    </distr>
+                </distribution>
+                <distribution id="populationMeanPrior" spec="Prior" x="@popSizes">
+                    <distr id="popPriorDist" mean="@populationMean" offset="0.0" spec="Exponential"/>
+                </distribution>
+
+                <distribution id="coalescent" spec="CompoundDistribution">
+                    <distribution id="Coal.26" spec="Coalescent" treeIntervals="@TreeIntervals.26">
+                        <populationModel id="scaledDemo4" spec="beast.evolution.tree.coalescent.ScaledPopulationFunction">
+                            <population id="demographic" populationIndicators="@indicators" populationSizes="@popSizes"
+                                        spec="beast.evolution.tree.coalescent.CompoundPopulationFunction" type="linear"
+                                        useIntervalsMiddle="false">
+                                <plate spec='Plate' var='n' range='.26,.29,.47'>
+                                    <itree id="TreeIntervals$(n)" spec="TreeIntervals" tree="@tree$(n)"/>
+                                </plate>
+                            </population>
+                            <parameter dimension="1" estimate="true" lower="0.0" name="factor" upper="0.0" value="3"/>
+                        </populationModel>
+                    </distribution>
+
+                    <distribution id="Coal.29" populationModel="@scaledDemo4" spec="Coalescent" treeIntervals="@TreeIntervals.29"/>
+                    <distribution id="Coal.47" populationModel="@scaledDemo4" spec="Coalescent" treeIntervals="@TreeIntervals.47"/>
+                </distribution>
+
+                <plate spec='Plate' var='n' range='.26,.29,.47'>
+                    <distribution spec="Prior" x="@hky.kappa$(n)">
+                        <distr M="1.0" S="1.25" meanInRealSpace="false" spec="LogNormalDistributionModel"/>
+                    </distribution>
+                    <distribution spec="Prior" x="@hky.frequencies$(n)">
+                        <distr lower="0.0" upper="1.0" spec="beast.math.distributions.Uniform"/>
+                    </distribution>
+                </plate>
+            </distribution>
+
+            <distribution id="likelihood" spec="CompoundDistribution">
+                <plate spec='Plate' var='n' range='.26,.29,.47'>
+                    <distribution idref="treeLikelihood$(n)"/>
+                </plate>
+            </distribution>
+        </distribution>
+
+
+        <operator id="bitflip" parameter="@indicators" spec="BitFlipOperator" uniform="true" weight="30.0"/>
+        <operator dist="@popPriorDist" indicators="@indicators" spec="beast.evolution.tree.coalescent.SampleOffValues"
+                  values="@popSizes" weight="15.0"/>
+        <operator degreesOfFreedom="1" indicator="@indicators" parameter="@popSizes" scaleAll="false"
+                  scaleAllIndependently="false" scaleFactor="0.5" spec="ScaleOperator" weight="6.0"/>
+        <operator spec='ScaleOperator' scaleFactor="0.9" weight="3" parameter="@populationMean"/>
+        <operator scaleFactor="0.7" spec="UpDownOperator" weight="30.0">
+            <down idref="popSizes"/>
+            <down idref="populationMean"/>
+            <plate spec='Plate' var='n' range='.26,.29,.47'>
+                <down idref="tree$(n)"/>
+            </plate>
+        </operator>
+
+        <plate spec='Plate' var='n' range='.26,.29,.47'>
+            <operator spec='ScaleOperator' scaleFactor="0.75" weight="0.1" parameter="@hky.kappa$(n)"/>
+            <operator spec='DeltaExchangeOperator' delta="0.01" weight="0.1" parameter="@hky.frequencies$(n)"/>
+            <operator spec='ScaleOperator' scaleFactor="0.75" weight="3" tree="@tree$(n)"/>
+            <operator spec='Uniform' weight="30" tree="@tree$(n)"/>
+            <operator spec='SubtreeSlide' weight="15" gaussian="true" size="0.0077" tree="@tree$(n)"/>
+            <operator spec='Exchange' isNarrow='true' weight="15" tree="@tree$(n)"/>
+            <operator spec='Exchange' isNarrow='false' weight="3" tree="@tree$(n)"/>
+            <operator spec='WilsonBalding' weight="1" tree="@tree$(n)"/>
+            <operator spec='UpDownOperator' scaleFactor="0.75" weight="3" down="@tree$(n)"/>
+        </plate>
+
+        <logger logEvery="100000" mode="autodetect">
+            <log idref="posterior"/>
+            <log idref="prior"/>
+            <log idref="likelihood"/>
+            <log idref="populationMean"/>
+            <log spec="Sum" arg="@indicators"/>
+            <log idref="indicators"/>
+            <plate spec='Plate' var='n' range='.26,.29,.47'>
+                <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree$(n)'/>
+                <log idref="hky.kappa$(n)"/>
+                <log idref="hky.frequencies$(n)"/>
+                <log idref="treeLikelihood$(n)"/>
+            </plate>
+            <log idref="coalescent"/>
+            <log idref="popSizes"/>
+        </logger>
+
+        <logger fileName="test.$(seed).log" logEvery="1000" mode="autodetect" model="@posterior">
+            <log idref="posterior"/>
+            <log idref="prior"/>
+            <log idref="likelihood"/>
+            <log idref="populationMean"/>
+            <log spec="Sum" arg="@indicators"/>
+            <log idref="indicators"/>
+            <plate spec='Plate' var='n' range='.26,.29,.47'>
+                <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree$(n)'/>
+                <log idref="hky.kappa$(n)"/>
+                <log idref="hky.frequencies$(n)"/>
+                <log idref="treeLikelihood$(n)"/>
+            </plate>
+            <log idref="coalescent"/>
+            <log idref="popSizes"/>
+        </logger>
+    </run>
+
+</beast>
diff --git a/examples/beast2vs1/testExponentialGrowth.xml b/examples/beast2vs1/testExponentialGrowth.xml
new file mode 100644
index 0000000..00ccde6
--- /dev/null
+++ b/examples/beast2vs1/testExponentialGrowth.xml
@@ -0,0 +1,147 @@
+<beast version='2.0'
+       namespace='beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood'>
+
+
+    <!-- The sequence alignment (each sequence refers to a taxon above).         -->
+    <!-- ntax=6 nchar=768                                                        -->
+    <!-- npatterns=69                                                            -->
+    <data id="alignment" dataType="nucleotide">
+        <sequence taxon="human">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="chimp">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="bonobo">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAGC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTTGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="gorilla">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTAAACATAGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA-CAACACTTAATTTCTGTAAGGACTGCAAAACCCTACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCAATGGGACTCAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAT-TCAC [...]
+        </sequence>
+        <sequence taxon="orangutan">
+            AGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA-CAGCACTTAATTTCTGTAAGGACTGCAAAACCCCACTTTGCATCAACTGAGCGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCCTAGACCGATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAT-TGGCTTCAGTCCAAAGCCCCGGCAGGCCTTAAAGCTGCTCCTTCGAATTTGCAATTCAACATGACAA-TCAC [...]
+        </sequence>
+        <sequence taxon="siamang">
+            AGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTAACAAAACTTAATTTCTGCAAGGGCTGCAAAACCCTACTTTGCATCAACCGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCGATGGGACTTAAACCCATAAAAATTTAGTTAACAGCTAAACACCCTAAACAACCTGGCTTCAATCTAAAGCCCCGGCAGA-GTTGAAGCTGCTTCTTTGAACTTGCAATTCAACGTGAAAAATCAC [...]
+        </sequence>
+    </data>
+
+    <!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+    <input spec='HKY' id="hky">
+        <parameter name='kappa' idref='hky.kappa'/>
+        <input id='freqs' name='frequencies' spec='Frequencies' frequencies='@hky.frequencies'/>
+    </input>
+
+    <!-- site model                                                              -->
+    <input spec='SiteModel' id="siteModel">
+        <!--<parameter name='mutationRate'>1.0</parameter>-->
+        <substModel idref='hky'/>
+    </input>
+
+    <input spec='TreeLikelihood' id="treeLikelihood">
+        <data idref="alignment"/>
+        <tree idref="tree"/>
+        <siteModel idref="siteModel"/>
+    </input>
+
+
+    <input spec='beast.util.ClusterTree' id='tree' clusterType='upgma'>
+        <taxa idref='alignment'/>
+    </input>
+
+    <parameter id="hky.kappa" value="2.0" lower="0.0"/>
+    <parameter id="hky.frequencies" value="0.25" dimension="4" lower='0.0'/>
+    <parameter id="popSize" value="0.077" lower="0.0"/>
+    <parameter id="growthRate" value="7.7E-5"/>
+
+
+    <run spec="MCMC" id="mcmc" chainLength="10000000"> <!--autoOptimize="true"-->
+        <state>
+            <!--
+                        <tree spec='util.TreeParser' id='tree'>
+                            <input name='newick'>((5:0.04847887618847128,(3:0.03189934232093919,((2:0.011076861832266626,1:0.011076861832266626):0.009810542752873795,4:0.02088740458514042):0.011011937735798769):0.01657953386753209):0.017232517763959114,6:0.06571139395243039);</input>
+                           <input name='taxa' idref='alignment'/>
+                        </tree>
+            -->
+            <input name='stateNode' idref='hky.kappa'/>
+            <input name='stateNode' idref='hky.frequencies'/>
+            <input name='stateNode' idref='popSize'/>
+            <input name='stateNode' idref='growthRate'/>
+            <input name='stateNode' idref='tree'/>
+        </state>
+
+        <distribution spec="CompoundDistribution" id="posterior">
+            <distribution spec="CompoundDistribution" id="prior">
+                <distribution id="hky.kappa.prior" spec="beast.math.distributions.Prior" x="@hky.kappa">
+                    <distr id="LogNormalDistributionModel" M="1.0" S="1.25" meanInRealSpace="false"
+                                  spec="beast.math.distributions.LogNormalDistributionModel"/>
+                </distribution>
+                <distribution id="hky.frequencies.prior" spec="beast.math.distributions.Prior" x="@hky.frequencies">
+                    <distr id="Uniform" lower="0.0" upper="1.0" spec="beast.math.distributions.Uniform"/>
+                </distribution>
+                <distribution id="popSize.prior" spec="beast.math.distributions.Prior" x="@popSize">
+                    <distr id="OneOnX" offset="0.0" spec="beast.math.distributions.OneOnX"/>
+                </distribution>
+
+                <distribution id="growthRate.prior" spec="beast.math.distributions.Prior" x="@growthRate">
+                    <distr id="LaplaceDistribution" mu="0.001" scale="119.61481002566472"
+                                  spec="beast.math.distributions.LaplaceDistribution"/>
+                </distribution>
+
+                <distribution id="coalescent" spec="Coalescent">
+                    <treeIntervals spec='TreeIntervals' id='TreeIntervals'>
+                        <tree idref="tree"/>
+                    </treeIntervals>
+                    <populationModel spec="ExponentialGrowth">
+                        <parameter name="popSize" idref="popSize"/>
+                        <parameter name="growthRate" idref="growthRate"/>
+                    </populationModel>
+                </distribution>
+            </distribution>
+            <distribution id='likelihood' idref="treeLikelihood"/>
+        </distribution>
+
+        <operator id='kappaScaler' spec='ScaleOperator' scaleFactor="0.75" weight="0.1" parameter="@hky.kappa"/>
+        <operator id='frequenciesDelta' spec='DeltaExchangeOperator' delta="0.01" weight="0.1"
+                  parameter="@hky.frequencies"/>
+        <operator id='popSizeScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3" parameter="@popSize"/>
+        <operator id='growthRateRandomWalk' spec='RealRandomWalkOperator' windowSize="1.0" weight="3"
+                  parameter="@growthRate"/>
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3" tree="@tree"/>
+        <operator spec='Uniform' weight="30" tree="@tree"/>
+        <operator spec='SubtreeSlide' weight="15" gaussian="true" size="0.0077" tree="@tree"/>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="15" tree="@tree"/>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="3" tree="@tree"/>
+        <operator spec='WilsonBalding' weight="1" tree="@tree"/>
+        <operator spec='UpDownOperator' scaleFactor="0.75" weight="3" down="@tree"/>
+
+        <logger logEvery="1000" fileName="test.$(seed).log">
+            <model idref='posterior'/>
+            <log idref="posterior"/>
+            <log idref="prior"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+            <log idref="popSize"/>
+            <log idref="growthRate"/>
+            <log idref="hky.kappa"/>
+            <log idref="hky.frequencies"/>
+            <log idref="likelihood"/>
+            <log idref="coalescent"/>
+        </logger>
+        <!--        <logger logEvery="1000" fileName="test.$(seed).trees">
+ <log idref="tree"/>
+</logger>           -->
+        <logger logEvery="100000">
+            <model idref='posterior'/>
+            <log idref="posterior"/>
+            <log idref="prior"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+            <log idref="popSize"/>
+            <log idref="growthRate"/>
+            <log idref="hky.kappa"/>
+            <log idref="hky.frequencies"/>
+            <log idref="likelihood"/>
+            <log idref="coalescent"/>
+        </logger>
+    </run>
+
+</beast>
diff --git a/examples/beast2vs1/testHKY.xml b/examples/beast2vs1/testHKY.xml
new file mode 100644
index 0000000..3e95df0
--- /dev/null
+++ b/examples/beast2vs1/testHKY.xml
@@ -0,0 +1,89 @@
+<beast version='2.0'
+       namespace='beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood'>
+
+    <!-- same as testMCMC.xml in BEAST 1                                         -->
+    <!-- The sequence alignment                                                  -->
+    <!-- ntax=6 nchar=768                                                        -->
+    <!-- npatterns=69                                                            -->
+    <data id="alignment" dataType="nucleotide">
+        <sequence taxon="human">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="chimp">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="bonobo">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAGC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTTGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="gorilla">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTAAACATAGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA-CAACACTTAATTTCTGTAAGGACTGCAAAACCCTACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCAATGGGACTCAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAT-TCAC [...]
+        </sequence>
+        <sequence taxon="orangutan">
+            AGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA-CAGCACTTAATTTCTGTAAGGACTGCAAAACCCCACTTTGCATCAACTGAGCGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCCTAGACCGATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAT-TGGCTTCAGTCCAAAGCCCCGGCAGGCCTTAAAGCTGCTCCTTCGAATTTGCAATTCAACATGACAA-TCAC [...]
+        </sequence>
+        <sequence taxon="siamang">
+            AGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTAACAAAACTTAATTTCTGCAAGGGCTGCAAAACCCTACTTTGCATCAACCGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCGATGGGACTTAAACCCATAAAAATTTAGTTAACAGCTAAACACCCTAAACAACCTGGCTTCAATCTAAAGCCCCGGCAGA-GTTGAAGCTGCTTCTTTGAACTTGCAATTCAACGTGAAAAATCAC [...]
+        </sequence>
+    </data>
+
+    <!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+    <input spec='HKY' id='hky'>
+        <kappa idref='hky.kappa'/>
+        <frequencies id='freqs' spec='Frequencies'>
+            <data idref='alignment'/>
+        </frequencies>
+    </input>
+
+    <!-- site model                                                              -->
+    <input spec='SiteModel' id="siteModel">
+        <substModel idref='hky'/>
+    </input>
+
+    <input spec='TreeLikelihood' id="treeLikelihood">
+        <data idref="alignment"/>
+        <tree idref="tree"/>
+        <siteModel idref="siteModel"/>
+    </input>
+
+    <parameter id="hky.kappa" value="1.0" lower="0.0"/>
+
+    <tree spec='beast.util.ClusterTree' id='tree' clusterType='upgma'>
+        <taxa idref='alignment'/>
+    </tree>
+
+
+    <run spec="MCMC" id="mcmc" chainLength="10000000">
+        <state>
+            <stateNode idref="hky.kappa"/>
+            <stateNode idref="tree"/>
+        </state>
+
+        <distribution id='likelihood' idref="treeLikelihood"/>
+
+        <operator id='kappaScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" parameter="@hky.kappa"/>
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" tree="@tree"/>
+        <operator spec='Uniform' weight="10" tree="@tree"/>
+        <operator spec='SubtreeSlide' weight="5" gaussian="true" size="1.0" tree="@tree"/>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="1" tree="@tree"/>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="1" tree="@tree"/>
+        <operator spec='WilsonBalding' weight="1" tree="@tree"/>
+
+        <logger logEvery="1000" fileName="test.$(seed).log">
+	        <model idref='likelihood'/>
+            <log idref="likelihood"/>
+            <log idref='hky.kappa'/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+        </logger>
+<!--         <logger logEvery="1000" fileName="test.$(seed).trees">
+            <log idref="tree"/>
+        </logger>       -->
+        <logger logEvery="10000">
+	        <model idref='likelihood'/>
+            <log idref="likelihood"/>
+    	    <ESS spec='ESS' name='log' arg="@likelihood"/>
+            <log idref='hky.kappa'/>
+    	    <ESS spec='ESS' name='log' arg="@hky.kappa"/>
+        </logger>
+    </run>
+
+</beast>
diff --git a/examples/beast2vs1/testMultiSubstModel.xml b/examples/beast2vs1/testMultiSubstModel.xml
new file mode 100644
index 0000000..6f9e881
--- /dev/null
+++ b/examples/beast2vs1/testMultiSubstModel.xml
@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><beast namespace="beast.core:beast.evolution.alignment:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood" version="2.0">
+
+
+    <data dataType="nucleotide" filter="1-449" id="firsthalf" name="alignment" spec="FilteredAlignment" strip="false">
+                    <data idref="Primates"/>
+                </data>
+<data dataType="nucleotide" id="Primates" strip="false">
+                        <sequence id="seq_Tarsius_syrichta" taxon="Tarsius_syrichta" totalcount="4" value="AAGTTTCATTGGAGCCACCACTCTTATAATTGCCCATGGCCTCACCTCCTCCCTATTATTTTGCCTAGCAAATACAAACTACGAACGAGTCCACAGTCGAACAATAGCACTAGCCCGTGGCCTTCAAACCCTATTACCTCTTGCAGCAACATGATGACTCCTCGCCAGCTTAACCAACCTGGCCCTTCCCCCAACAATTAATTTAATCGGTGAACTGTCCGTAATAATAGCAGCATTTTCATGGTCACACCTAACTATTATCTTAGTAGGCCTTAACACCCTTATCACCGCCCTATATTCCCTATATATACTAATCATAACTCAACGAGGAAAATACACATATCATATCAACAATATCATGCCCCCTTTCACCCGAGAAAATACA [...]
+                        <sequence id="seq_Lemur_catta" taxon="Lemur_catta" totalcount="4" value="AAGCTTCATAGGAGCAACCATTCTAATAATCGCACATGGCCTTACATCATCCATATTATTCTGTCTAGCCAACTCTAACTACGAACGAATCCATAGCCGTACAATACTACTAGCACGAGGGATCCAAACCATTCTCCCTCTTATAGCCACCTGATGACTACTCGCCAGCCTAACTAACCTAGCCCTACCCACCTCTATCAATTTAATTGGCGAACTATTCGTCACTATAGCATCCTTCTCATGATCAAACATTACAATTATCTTAATAGGCTTAAATATGCTCATCACCGCTCTCTATTCCCTCTATATATTAACTACTACACAACGAGGAAAACTCACATATCATTCGCACAACCTAAACCCATCCTTTACACGAGAAAACACCCTTATATCCA [...]
+                        <sequence id="seq_Homo_sapiens" taxon="Homo_sapiens" totalcount="4" value="AAGCTTCACCGGCGCAGTCATTCTCATAATCGCCCACGGGCTTACATCCTCATTACTATTCTGCCTAGCAAACTCAAACTACGAACGCACTCACAGTCGCATCATAATCCTCTCTCAAGGACTTCAAACTCTACTCCCACTAATAGCTTTTTGATGACTTCTAGCAAGCCTCGCTAACCTCGCCTTACCCCCCACTATTAACCTACTGGGAGAACTCTCTGTGCTAGTAACCACGTTCTCCTGATCAAATATCACTCTCCTACTTACAGGACTCAACATACTAGTCACAGCCCTATACTCCCTCTACATATTTACCACAACACAATGGGGCTCACTCACCCACCACATTAACAACATAAAACCCTCATTCACACGAGAAAACACCCTCATGTT [...]
+                        <sequence id="seq_Pan" taxon="Pan" totalcount="4" value="AAGCTTCACCGGCGCAATTATCCTCATAATCGCCCACGGACTTACATCCTCATTATTATTCTGCCTAGCAAACTCAAATTATGAACGCACCCACAGTCGCATCATAATTCTCTCCCAAGGACTTCAAACTCTACTCCCACTAATAGCCTTTTGATGACTCCTAGCAAGCCTCGCTAACCTCGCCCTACCCCCTACCATTAATCTCCTAGGGGAACTCTCCGTGCTAGTAACCTCATTCTCCTGATCAAATACCACTCTCCTACTCACAGGATTCAACATACTAATCACAGCCCTGTACTCCCTCTACATGTTTACCACAACACAATGAGGCTCACTCACCCACCACATTAATAACATAAAGCCCTCATTCACACGAGAAAATACTCTCATATTTTTACACCTATCCCCCAT [...]
+                        <sequence id="seq_Gorilla" taxon="Gorilla" totalcount="4" value="AAGCTTCACCGGCGCAGTTGTTCTTATAATTGCCCACGGACTTACATCATCATTATTATTCTGCCTAGCAAACTCAAACTACGAACGAACCCACAGCCGCATCATAATTCTCTCTCAAGGACTCCAAACCCTACTCCCACTAATAGCCCTTTGATGACTTCTGGCAAGCCTCGCCAACCTCGCCTTACCCCCCACCATTAACCTACTAGGAGAGCTCTCCGTACTAGTAACCACATTCTCCTGATCAAACACCACCCTTTTACTTACAGGATCTAACATACTAATTACAGCCCTGTACTCCCTTTATATATTTACCACAACACAATGAGGCCCACTCACACACCACATCACCAACATAAAACCCTCATTTACACGAGAAAACATCCTCATATTCATGCACCTA [...]
+                        <sequence id="seq_Pongo" taxon="Pongo" totalcount="4" value="AAGCTTCACCGGCGCAACCACCCTCATGATTGCCCATGGACTCACATCCTCCCTACTGTTCTGCCTAGCAAACTCAAACTACGAACGAACCCACAGCCGCATCATAATCCTCTCTCAAGGCCTTCAAACTCTACTCCCCCTAATAGCCCTCTGATGACTTCTAGCAAGCCTCACTAACCTTGCCCTACCACCCACCATCAACCTTCTAGGAGAACTCTCCGTACTAATAGCCATATTCTCTTGATCTAACATCACCATCCTACTAACAGGACTCAACATACTAATCACAACCCTATACTCTCTCTATATATTCACCACAACACAACGAGGTACACCCACACACCACATCAACAACATAAAACCTTCTTTCACACGCGAAAATACCCTCATGCTCATACACCTATCCC [...]
+                        <sequence id="seq_Hylobates" taxon="Hylobates" totalcount="4" value="AAGCTTTACAGGTGCAACCGTCCTCATAATCGCCCACGGACTAACCTCTTCCCTGCTATTCTGCCTTGCAAACTCAAACTACGAACGAACTCACAGCCGCATCATAATCCTATCTCGAGGGCTCCAAGCCTTACTCCCACTGATAGCCTTCTGATGACTCGCAGCAAGCCTCGCTAACCTCGCCCTACCCCCCACTATTAACCTCCTAGGTGAACTCTTCGTACTAATGGCCTCCTTCTCCTGGGCAAACACTACTATTACACTCACCGGGCTCAACGTACTAATCACGGCCCTATACTCCCTTTACATATTTATCATAACACAACGAGGCACACTTACACACCACATTAAAAACATAAAACCCTCACTCACACGAGAAAACATATTAATACTTATGCA [...]
+                        <sequence id="seq_Macaca_fuscata" taxon="Macaca_fuscata" totalcount="4" value="AAGCTTTTCCGGCGCAACCATCCTTATGATCGCTCACGGACTCACCTCTTCCATATATTTCTGCCTAGCCAATTCAAACTATGAACGCACTCACAACCGTACCATACTACTGTCCCGAGGACTTCAAATCCTACTTCCACTAACAGCCTTTTGATGATTAACAGCAAGCCTTACTAACCTTGCCCTACCCCCCACTATCAATCTACTAGGTGAACTCTTTGTAATCGCAACCTCATTCTCCTGATCCCATATCACCATTATGCTAACAGGACTTAACATATTAATTACGGCCCTCTACTCTCTCCACATATTCACTACAACACAACGAGGAACACTCACACATCACATAATCAACATAAAGCCCCCCTTCACACGAGAAAACACATTAA [...]
+                        <sequence id="seq_M_mulatta" taxon="M_mulatta" totalcount="4" value="AAGCTTTTCTGGCGCAACCATCCTCATGATTGCTCACGGACTCACCTCTTCCATATATTTCTGCCTAGCCAATTCAAACTATGAACGCACTCACAACCGTACCATACTACTGTCCCGGGGACTTCAAATCCTACTTCCACTAACAGCTTTCTGATGATTAACAGCAAGCCTTACTAACCTTGCCCTACCCCCCACTATCAACCTACTAGGTGAACTCTTTGTAATCGCGACCTCATTCTCCTGGTCCCATATCACCATTATATTAACAGGATTTAACATACTAATTACGGCCCTCTACTCCCTCCACATATTCACCACAACACAACGAGGAGCACTCACACATCACATAATCAACATAAAACCCCCCTTCACACGAGAAAACATATTAATATTCATACA [...]
+                        <sequence id="seq_M_fascicularis" taxon="M_fascicularis" totalcount="4" value="AAGCTTCTCCGGCGCAACCACCCTTATAATCGCCCACGGGCTCACCTCTTCCATGTATTTCTGCTTGGCCAATTCAAACTATGAGCGCACTCATAACCGTACCATACTACTATCCCGAGGACTTCAAATTCTACTTCCATTGACAGCCTTCTGATGACTCACAGCAAGCCTTACTAACCTTGCCCTACCCCCCACTATTAATCTACTAGGCGAACTCTTTGTAATCACAACTTCATTTTCCTGATCCCATATCACCATTGTGTTAACGGGCCTTAATATACTAATCACAGCCCTCTACTCTCTCCACATGTTCATTACAGTACAACGAGGAACACTCACACACCACATAATCAATATAAAACCCCCCTTCACACGAGAAAACATATTAA [...]
+                        <sequence id="seq_M_sylvanus" taxon="M_sylvanus" totalcount="4" value="AAGCTTCTCCGGTGCAACTATCCTTATAGTTGCCCATGGACTCACCTCTTCCATATACTTCTGCTTGGCCAACTCAAACTACGAACGCACCCACAGCCGCATCATACTACTATCCCGAGGACTCCAAATCCTACTCCCACTAACAGCCTTCTGATGATTCACAGCAAGCCTTACTAATCTTGCTCTACCCTCCACTATTAATCTACTGGGCGAACTCTTCGTAATCGCAACCTCATTTTCCTGATCCCACATCACCATCATACTAACAGGACTGAACATACTAATTACAGCCCTCTACTCTCTTCACATATTCACCACAACACAACGAGGAGCGCTCACACACCACATAATTAACATAAAACCACCTTTCACACGAGAAAACATATTAATACTCATA [...]
+                        <sequence id="seq_Saimiri_sciureus" taxon="Saimiri_sciureus" totalcount="4" value="AAGCTTCACCGGCGCAATGATCCTAATAATCGCTCACGGGTTTACTTCGTCTATGCTATTCTGCCTAGCAAACTCAAATTACGAACGAATTCACAGCCGAACAATAACATTTACTCGAGGGCTCCAAACACTATTCCCGCTTATAGGCCTCTGATGACTCCTAGCAAATCTCGCTAACCTCGCCCTACCCACAGCTATTAATCTAGTAGGAGAATTACTCACAATCGTATCTTCCTTCTCTTGATCCAACTTTACTATTATATTCACAGGACTTAATATACTAATTACAGCACTCTACTCACTTCATATGTATGCCTCTACACAGCGAGGTCCACTTACATACAGCACCAGCAATATAAAACCAATATTTACACGAGAAAATACG [...]
+                    </data>
+<data data="@Primates" dataType="nucleotide" filter="450-898" id="secondhalf" spec="FilteredAlignment" strip="false"/>
+
+
+    <distribution id="posterior" spec="util.CompoundDistribution" useThreads="false">
+        <distribution id="prior" spec="util.CompoundDistribution" useThreads="false">
+            <distribution id="CoalescentConstant.firsthalf" spec="Coalescent">
+                <populationModel id="ConstantPopulation.firsthalf" spec="ConstantPopulation">
+                    <parameter dimension="1" estimate="true" id="popSize.firsthalf" name="popSize" value="1"/>
+                </populationModel>
+                <treeIntervals id="TreeIntervals.firsthalf" spec="TreeIntervals" tree="@Tree.firsthalf"/>
+            </distribution>
+            <distribution id="KappaPrior.firsthalf" spec="beast.math.distributions.Prior" x="@kappa.firsthalf">
+                    <distr id="LogNormalDistributionModel.firsthalf" M="1.0" S="1.25" meanInRealSpace="false" spec="beast.math.distributions.LogNormalDistributionModel"/>
+                </distribution>
+            <distribution id="KappaPrior.secondhalf" spec="beast.math.distributions.Prior" x="@kappa.secondhalf">
+                    <distr id="LogNormalDistributionModel.secondhalf" M="1.0" S="1.25" meanInRealSpace="false" spec="beast.math.distributions.LogNormalDistributionModel"/>
+                </distribution>
+            <distribution id="popSize.prior" spec="beast.math.distributions.Prior" x="@popSize.firsthalf">
+                    <distr id="OneOnX" offset="0.0" spec="beast.math.distributions.OneOnX"/>
+                </distribution>
+        </distribution>
+        <distribution id="likelihood" spec="util.CompoundDistribution" useThreads="false">
+            <distribution data="@firsthalf" id="treeLikelihood.firsthalf" spec="TreeLikelihood" tree="@Tree.firsthalf" useAmbiguities="false">
+                <siteModel gammaCategoryCount="0" id="SiteModel.firsthalf" spec="SiteModel">
+                    <parameter dimension="1" estimate="false" id="mutationRate.firsthalf" name="mutationRate" value="1.0"/>
+                    <parameter dimension="1" estimate="false" id="gammaShape.firsthalf" name="shape" value="1.0"/>
+                    <parameter dimension="1" estimate="false" id="proportionInvariant.firsthalf" name="proportionInvariant" value="0.0"/>
+                    <substModel id="hky.firsthalf" kappa="@kappa.firsthalf" spec="HKY">
+                        <frequencies estimate="true" frequencies="@freqParameter.firsthalf" id="estimatedFreqs.firsthalf" spec="Frequencies"/>
+                    </substModel>
+                </siteModel>
+                <branchRateModel clock.rate="@clockRate.firsthalf" id="StrictClock.firsthalf" spec="beast.evolution.branchratemodel.StrictClockModel"/>
+            </distribution>
+            <distribution branchRateModel="@StrictClock.firsthalf" id="treeLikelihood.secondhalf" spec="TreeLikelihood" tree="@Tree.firsthalf" useAmbiguities="false">
+                <data idref="secondhalf"/>
+                <siteModel gammaCategoryCount="0" id="SiteModel.secondhalf" spec="SiteModel">
+                    <parameter dimension="1" estimate="false" id="mutationRate.secondhalf" name="mutationRate" value="1.0"/>
+                    <parameter dimension="1" estimate="false" id="gammaShape.secondhalf" name="shape" value="1.0"/>
+                    <parameter dimension="1" estimate="false" id="proportionInvariant.secondhalf" name="proportionInvariant" value="0.0"/>
+                    <substModel id="hky.secondhalf" kappa="@kappa.secondhalf" spec="HKY">
+                        <frequencies estimate="true" frequencies="@freqParameter.secondhalf" id="estimatedFreqs.secondhalf" spec="Frequencies"/>
+                    </substModel>
+                </siteModel>
+            </distribution>
+        </distribution>
+    </distribution>
+
+<parameter dimension="1" id="clockRate.firsthalf" value="1.0"/>
+    
+<run chainLength="10000000" id="mcmc" preBurnin="0" sampleFromPrior="false" spec="MCMC" storeEvery="-1">
+    <state id="state" storeEvery="100000">
+        <tree estimate="true" id="Tree.firsthalf" name="stateNode">
+            <taxonset id="TaxonSet.firsthalf" spec="TaxonSet">
+                <data idref="firsthalf" name="alignment"/>
+            </taxonset>
+        </tree>
+        <stateNode idref='popSize.firsthalf'/>
+        <parameter dimension="1" estimate="true" id="kappa.firsthalf" lower="0.0" name="stateNode" value="1.0"/>
+        <parameter dimension="4" estimate="true" id="freqParameter.firsthalf" lower="0.0" name="stateNode" upper="1.0" value="0.25"/>
+        <parameter dimension="1" estimate="true" id="kappa.secondhalf" lower="0.0" name="stateNode" value="1.0"/>
+        <parameter dimension="4" estimate="true" id="freqParameter.secondhalf" lower="0.0" name="stateNode" upper="1.0" value="0.25"/>
+    </state>
+
+    <distribution idref="posterior"/>
+
+    <operator degreesOfFreedom="1" id="treeScaler.firsthalf" optimise="true" rootOnly="false" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.75" spec="ScaleOperator" tree="@Tree.firsthalf" weight="3.0"/>
+
+    <operator id="UniformOperator.firsthalf" spec="Uniform" tree="@Tree.firsthalf" weight="30.0"/>
+
+    <operator gaussian="true" id="SubtreeSlide.firsthalf" optimise="true" size="0.03" spec="SubtreeSlide" tree="@Tree.firsthalf" weight="15.0"/>
+
+    <operator id="narrow.firsthalf" isNarrow="true" spec="Exchange" tree="@Tree.firsthalf" weight="15.0"/>
+
+    <operator id="wide.firsthalf" isNarrow="false" spec="Exchange" tree="@Tree.firsthalf" weight="3.0"/>
+
+    <operator id="WilsonBalding.firsthalf" spec="WilsonBalding" tree="@Tree.firsthalf" weight="3.0"/>
+
+    <operator spec='UpDownOperator' scaleFactor="0.75" weight="3" down="@Tree.firsthalf"/>
+
+    <operator degreesOfFreedom="1" id="KappaScaler.firsthalf" optimise="true" parameter="@kappa.firsthalf" rootOnly="false" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.75" spec="ScaleOperator" weight="1.0"/>
+
+    <operator autoOptimize="true" delta="0.01" id="FrequenciesExchanger.firsthalf" integer="false" spec="DeltaExchangeOperator" weight="0.1">
+        <parameter idref="freqParameter.firsthalf"/>
+    </operator>
+
+    <operator degreesOfFreedom="1" id="KappaScaler.secondhalf" optimise="true" parameter="@kappa.secondhalf" rootOnly="false" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.75" spec="ScaleOperator" weight="1.0"/>
+
+    <operator autoOptimize="true" delta="0.01" id="FrequenciesExchanger.secondhalf" integer="false" spec="DeltaExchangeOperator" weight="0.1">
+        <parameter idref="freqParameter.secondhalf"/>
+    </operator>
+
+    <operator id='popSizeScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3" parameter="@popSize.firsthalf"/>
+
+    <logger fileName="test.$(seed).log" id="tracelog" logEvery="1000" mode="autodetect" model="@posterior">
+        <distribution idref="posterior" name="log"/>
+        <distribution idref="likelihood" name="log"/>
+        <distribution idref="prior" name="log"/>
+        <log id="TreeHeight.firsthalf" spec="beast.evolution.tree.TreeHeightLogger" tree="@Tree.firsthalf"/>
+        <parameter idref="clockRate.firsthalf" name="log"/>
+        <parameter idref="kappa.firsthalf" name="log"/>
+        <parameter idref="freqParameter.firsthalf" name="log"/>
+        <parameter idref="kappa.secondhalf" name="log"/>
+        <parameter idref="freqParameter.secondhalf" name="log"/>
+        <distribution idref="treeLikelihood.firsthalf" name="log"/>
+        <distribution idref="treeLikelihood.secondhalf" name="log"/>
+        <distribution idref="CoalescentConstant.firsthalf" name="log"/>
+        <parameter idref="popSize.firsthalf" name="log"/>
+    </logger>
+
+    <logger id="screenlog" logEvery="10000" mode="autodetect">
+        <distribution idref="posterior" name="log"/>
+        <log arg="@posterior" id="ESS.0" spec="util.ESS"/>
+        <distribution idref="likelihood" name="log"/>
+        <distribution idref="prior" name="log"/>
+    </logger>
+
+    <tree estimate="false" id="RandomTree.firsthalf" initial="@Tree.firsthalf" name="init" populationModel="@ConstantPopulation.firsthalf" spec="beast.evolution.tree.RandomTree" taxa="@firsthalf"/>
+
+</run>
+
+</beast>
\ No newline at end of file
diff --git a/examples/beast2vs1/testRandomLocalClock.xml b/examples/beast2vs1/testRandomLocalClock.xml
new file mode 100644
index 0000000..624b447
--- /dev/null
+++ b/examples/beast2vs1/testRandomLocalClock.xml
@@ -0,0 +1,148 @@
+<beast version='2.0'
+       namespace='beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.branchratemodel:beast.evolution.likelihood:beast.core.parameter'>
+
+
+    <!-- The sequence alignment (each sequence refers to a taxon above).         -->
+    <!-- ntax=6 nchar=768                                                        -->
+    <!-- npatterns=69                                                            -->
+    <data id="alignment" dataType="nucleotide">
+        <sequence taxon="human">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="chimp">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="bonobo">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAGC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTTGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="gorilla">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTAAACATAGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA-CAACACTTAATTTCTGTAAGGACTGCAAAACCCTACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCAATGGGACTCAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAT-TCAC [...]
+        </sequence>
+        <sequence taxon="orangutan">
+            AGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA-CAGCACTTAATTTCTGTAAGGACTGCAAAACCCCACTTTGCATCAACTGAGCGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCCTAGACCGATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAT-TGGCTTCAGTCCAAAGCCCCGGCAGGCCTTAAAGCTGCTCCTTCGAATTTGCAATTCAACATGACAA-TCAC [...]
+        </sequence>
+        <sequence taxon="siamang">
+            AGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTAACAAAACTTAATTTCTGCAAGGGCTGCAAAACCCTACTTTGCATCAACCGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCGATGGGACTTAAACCCATAAAAATTTAGTTAACAGCTAAACACCCTAAACAACCTGGCTTCAATCTAAAGCCCCGGCAGA-GTTGAAGCTGCTTCTTTGAACTTGCAATTCAACGTGAAAAATCAC [...]
+        </sequence>
+    </data>
+
+    <!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+    <input spec='HKY' id="hky">
+        <parameter name='kappa' idref='hky.kappa'/>
+        <input id='freqs' name='frequencies' spec='Frequencies' frequencies='@hky.frequencies'/>
+    </input>
+
+    <!-- site model                                                              -->
+    <input spec='SiteModel' id="siteModel">
+        <!--<parameter name='mutationRate'>1.0</parameter>-->
+        <substModel idref='hky'/>
+    </input>
+
+    <input spec='beast.util.ClusterTree' id='tree' clusterType='upgma'>
+        <taxa idref='alignment'/>
+    </input>
+
+    <input spec='RandomLocalClockModel' id="branchRates" ratesAreMultipliers="false">
+        <!--<parameter name='mutationRate'>1.0</parameter>-->
+        <parameter name='rates' id='rates' value="1.0" lower='0.0'/>
+        <input name="indicators" spec='BooleanParameter' id='indicators' value="false"/>
+        <tree idref="tree"/>
+    </input>
+
+    <input spec='TreeLikelihood' id="treeLikelihood">
+        <data idref="alignment"/>
+        <tree idref="tree"/>
+        <siteModel idref="siteModel"/>
+        <branchRateModel idref="branchRates"/>
+    </input>
+
+    <parameter id="hky.kappa" value="2.0" lower="0.0"/>
+    <parameter id="hky.frequencies" value="0.25" dimension="4" lower='0.0'/>
+    <parameter id="popSize" value="0.077" lower="0.0"/>
+
+    <run spec="MCMC" id="mcmc" chainLength="10000000"> <!--autoOptimize="true"-->
+        <state>
+            <stateNode idref='hky.kappa'/>
+            <stateNode idref='hky.frequencies'/>
+            <stateNode idref='popSize'/>
+            <stateNode idref='tree'/>
+            <stateNode idref='rates'/>
+            <stateNode idref='indicators'/>
+        </state>
+
+        <distribution spec="CompoundDistribution" id="posterior">
+            <distribution spec="CompoundDistribution" id="prior">
+                <distribution id="hky.kappa.prior" spec="beast.math.distributions.Prior" x="@hky.kappa">
+                    <distr id="LogNormalDistributionModel" M="1.0" S="1.25" meanInRealSpace="false"
+                                  spec="beast.math.distributions.LogNormalDistributionModel"/>
+                </distribution>
+                <distribution id="hky.frequencies.prior" spec="beast.math.distributions.Prior" x="@hky.frequencies">
+                    <distr id="Uniform" lower="0.0" upper="1.0" spec="beast.math.distributions.Uniform"/>
+                </distribution>
+                <distribution id="popSize.prior" spec="beast.math.distributions.Prior" x="@popSize">
+                    <distr id="OneOnX" offset="0.0" spec="beast.math.distributions.OneOnX"/>
+                </distribution>
+                <distribution id="rates.prior" spec="beast.math.distributions.Prior" x="@rates">
+                    <distr id="Gamma" alpha="0.5" beta="2.0" spec="beast.math.distributions.Gamma"/>
+                </distribution>
+                <!--<distribution id="indicators.prior" spec="beast.math.distributions.Prior" x="@indicators">
+                    <distribution id="Poisson" lambda="0.6931471805599453" spec="beast.math.distributions.Poisson"/>
+                </distribution>-->
+
+                <distribution id="coalescent" spec="Coalescent">
+                    <treeIntervals spec='TreeIntervals' id='TreeIntervals'>
+                        <tree idref="tree"/>
+                    </treeIntervals>
+                    <populationModel spec="ConstantPopulation" id='ConstantPopulation'>
+                        <popSize idref="popSize"/>
+                    </populationModel>
+                </distribution>
+            </distribution>
+            <distribution id='likelihood' idref="treeLikelihood"/>
+        </distribution>
+
+        <operator id="indicatorsBitFlip" spec="BitFlipOperator" weight="15" parameter="@indicators"/>
+        <operator id='rateScaler' spec='ScaleOperator' scaleFactor="0.75" weight="15" parameter="@rates"/>
+
+        <operator id='kappaScaler' spec='ScaleOperator' scaleFactor="0.75" weight="0.1" parameter="@hky.kappa"/>
+        <operator id='frequenciesDelta' spec='DeltaExchangeOperator' delta="0.01" weight="0.1"
+                  parameter="@hky.frequencies"/>
+        <operator id='popSizeScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3" parameter="@popSize"/>
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3" tree="@tree"/>
+        <operator spec='Uniform' weight="30" tree="@tree"/>
+        <operator spec='SubtreeSlide' weight="15" gaussian="true" size="0.0077" tree="@tree"/>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="15" tree="@tree"/>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="3" tree="@tree"/>
+        <operator spec='WilsonBalding' weight="1" tree="@tree"/>
+        <operator spec='UpDownOperator' scaleFactor="0.75" weight="3" down="@tree"/>
+
+        <logger logEvery="1000" fileName="test.$(seed).log">
+            <model idref='posterior'/>
+            <log idref="posterior"/>
+            <log idref="prior"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+            <log idref="popSize"/>
+            <log idref="hky.kappa"/>
+            <log idref="hky.frequencies"/>
+            <log idref="likelihood"/>
+            <log idref="coalescent"/>
+            <log idref="rates"/>
+            <log idref="indicators"/>
+        </logger>
+        <!--         <logger logEvery="1000" fileName="test.$(seed).trees">
+                    <log idref="tree"/>
+                </logger>       -->
+        <logger logEvery="100000">
+            <model idref='posterior'/>
+            <log idref="posterior"/>
+            <log idref="prior"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+            <log idref="popSize"/>
+            <log idref="hky.kappa"/>
+            <log idref="hky.frequencies"/>
+            <log idref="likelihood"/>
+            <log idref="coalescent"/>
+        </logger>
+    </run>
+
+</beast>
diff --git a/examples/beast2vs1/testSRD06CP12_3.xml b/examples/beast2vs1/testSRD06CP12_3.xml
new file mode 100644
index 0000000..9859cfd
--- /dev/null
+++ b/examples/beast2vs1/testSRD06CP12_3.xml
@@ -0,0 +1,171 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<beast namespace="beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood:beast.evolution.branchratemodel"
+       version="2.0">
+    <!-- SRD06 model: split sequences in first together with seconds and thirds of all sites -->
+    <data id="alignment" dataType="nucleotide">
+        <sequence taxon="human">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="chimp">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="bonobo">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAGC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTTGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="gorilla">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTAAACATAGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA-CAACACTTAATTTCTGTAAGGACTGCAAAACCCTACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCAATGGGACTCAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAT-TCAC [...]
+        </sequence>
+        <sequence taxon="orangutan">
+            AGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA-CAGCACTTAATTTCTGTAAGGACTGCAAAACCCCACTTTGCATCAACTGAGCGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCCTAGACCGATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAT-TGGCTTCAGTCCAAAGCCCCGGCAGGCCTTAAAGCTGCTCCTTCGAATTTGCAATTCAACATGACAA-TCAC [...]
+        </sequence>
+        <sequence taxon="siamang">
+            AGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTAACAAAACTTAATTTCTGCAAGGGCTGCAAAACCCTACTTTGCATCAACCGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCGATGGGACTTAAACCCATAAAAATTTAGTTAACAGCTAAACACCCTAAACAACCTGGCTTCAATCTAAAGCCCCGGCAGA-GTTGAAGCTGCTTCTTTGAACTTGCAATTCAACGTGAAAAATCAC [...]
+        </sequence>
+    </data>
+
+    <data data="@alignment" dataType="nucleotide" filter="1::3,2::3" id="CP12" name="taxa"
+          spec="beast.evolution.alignment.FilteredAlignment"/>
+    <data data="@alignment" dataType="nucleotide" filter="3::3" id="CP3" name="taxa"
+          spec="beast.evolution.alignment.FilteredAlignment"/>
+
+    <siteModel gammaCategoryCount="4" id="CP12.siteModel" spec="SiteModel">
+        <parameter dimension="1" id="CP12.mutationRate" name="mutationRate" value="1.0" lower="0.0"/>
+        <parameter dimension="1" id="CP12.gammaShape" name="shape" value="0.5" lower="0.0" upper="1000.0"/>
+        <substModel id="CP12.hky" kappa="@CP12.hky.kappa" spec="HKY">
+            <frequencies frequencies="@CP12.frequencies" id="CP12.freqs" spec="Frequencies"/>
+        </substModel>
+    </siteModel>
+
+    <siteModel gammaCategoryCount="4" id="CP3.siteModel" spec="SiteModel">
+        <parameter dimension="1" id="CP3.mutationRate" name="mutationRate" value="1.0" lower="0.0"/>
+        <parameter dimension="1" id="CP3.gammaShape" name="shape" value="0.5" lower="0.0" upper="1000.0"/>
+        <substModel id="CP3.hky" kappa="@CP3.hky.kappa" spec="HKY">
+            <frequencies frequencies="@CP3.frequencies" id="CP3.freqs" spec="Frequencies"/>
+        </substModel>
+    </siteModel>
+
+    <input spec='StrictClockModel' id="branchRates">
+        <parameter name='clock.rate' id='clockRate' value="1.0"/>
+    </input>
+
+    <input spec='beast.util.ClusterTree' id='tree' clusterType='upgma'>
+        <!--trait idref='rateCategories'/-->
+        <taxa idref='alignment'/>
+    </input>
+
+    <input spec='TreeLikelihood' id="CP12.treeLikelihood">
+        <data idref="CP12"/>
+        <tree idref="tree"/>
+        <siteModel idref="CP12.siteModel"/>
+        <branchRateModel idref="branchRates"/>
+    </input>
+
+    <input spec='TreeLikelihood' id="CP3.treeLikelihood">
+        <data idref="CP3"/>
+        <tree idref="tree"/>
+        <siteModel idref="CP3.siteModel"/>
+        <branchRateModel idref="branchRates"/>
+    </input>
+
+    <parameter id="CP12.hky.kappa" value="2.0" lower="0.0"/>
+    <parameter id="CP3.hky.kappa" value="2.0" lower="0.0"/>
+    <parameter id="CP12.frequencies" value="0.25" dimension="4" lower="0.0" upper="1.0"/>
+    <parameter id="CP3.frequencies" value="0.25" dimension="4" lower="0.0" upper="1.0"/>
+    <parameter id="popSize" value="0.077" lower="0.0"/>
+
+    <run spec="MCMC" id="mcmc" chainLength="10000000"> <!--autoOptimize="true"-->
+
+        <distribution spec="CompoundDistribution" id="posterior">
+            <distribution spec="CompoundDistribution" id="prior">
+                <distribution id="CP12.hky.kappa.prior" spec="beast.math.distributions.Prior" x="@CP12.hky.kappa">
+                    <distr id="CP12.LogNormalDistributionModel" M="1.0" S="1.25" meanInRealSpace="false"
+                           spec="beast.math.distributions.LogNormalDistributionModel"/>
+                </distribution>
+                <distribution id="CP12.gammaShape.prior" spec="beast.math.distributions.Prior" x="@CP12.gammaShape">
+                    <distr id="CP12.gammaShape.OneOnX" offset="0.0" spec="beast.math.distributions.OneOnX"/>
+                </distribution>
+                <distribution id="CP3.hky.kappa.prior" spec="beast.math.distributions.Prior" x="@CP3.hky.kappa">
+                    <distr id="CP3.LogNormalDistributionModel" M="1.0" S="1.25" meanInRealSpace="false"
+                           spec="beast.math.distributions.LogNormalDistributionModel"/>
+                </distribution>
+                <distribution id="CP3.gammaShape.prior" spec="beast.math.distributions.Prior" x="@CP3.gammaShape">
+                    <distr id="CP3.gammaShape.OneOnX" offset="0.0" spec="beast.math.distributions.OneOnX"/>
+                </distribution>
+                <distribution id="popSize.prior" spec="beast.math.distributions.Prior" x="@popSize">
+                    <distr id="OneOnX" offset="0.0" spec="beast.math.distributions.OneOnX"/>
+                </distribution>
+
+                <distribution id="coalescent" spec="Coalescent">
+                    <treeIntervals spec='TreeIntervals' id='TreeIntervals'>
+                        <tree idref="tree"/>
+                    </treeIntervals>
+                    <populationModel spec="ConstantPopulation">
+                        <popSize idref="popSize"/>
+                    </populationModel>
+                </distribution>
+            </distribution>
+            <distribution spec="CompoundDistribution" id='likelihood'>
+                <distribution idref="CP12.treeLikelihood"/>
+                <distribution idref="CP3.treeLikelihood"/>
+            </distribution>
+        </distribution>
+
+        <operator id='compMuDelta' spec='DeltaExchangeOperator' delta="0.75" weightvector="512 256" weight="2">
+            <parameter idref="CP12.mutationRate"/>
+            <parameter idref="CP3.mutationRate"/>
+        </operator>
+
+        <operator id='CP12kappaScaler' spec='ScaleOperator' scaleFactor="0.75" weight="0.1"
+                  parameter="@CP12.hky.kappa"/>
+        <operator id='CP12frequenciesDelta' spec='DeltaExchangeOperator' delta="0.01" weight="0.1"
+                  parameter="@CP12.frequencies"/>
+        <operator id='CP3kappaScaler' spec='ScaleOperator' scaleFactor="0.75" weight="0.1" parameter="@CP3.hky.kappa"/>
+        <operator id='CP3frequenciesDelta' spec='DeltaExchangeOperator' delta="0.01" weight="0.1"
+                  parameter="@CP3.frequencies"/>
+        <operator id='CP12alphaScaler' spec='ScaleOperator' scaleFactor="0.75" weight="0.1"
+                  parameter="@CP12.gammaShape"/>
+        <operator id='CP3alphaScaler' spec='ScaleOperator' scaleFactor="0.75" weight="0.1" parameter="@CP3.gammaShape"/>
+        <operator id='popSizeScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3" parameter="@popSize"/>
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3" tree="@tree"/>
+        <operator spec='Uniform' weight="30" tree="@tree"/>
+        <operator spec='SubtreeSlide' weight="15" gaussian="true" size="0.0077" tree="@tree"/>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="15" tree="@tree"/>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="3" tree="@tree"/>
+        <operator spec='WilsonBalding' weight="1" tree="@tree"/>
+        <operator spec='UpDownOperator' scaleFactor="0.75" weight="3" down="@tree"/>
+
+        <logger logEvery="1000" fileName="test.$(seed).log">
+            <model idref='posterior'/>
+            <log idref="posterior"/>
+            <log idref="prior"/>
+            <log idref="likelihood"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+            <log idref="popSize"/>
+            <log idref="CP12.hky.kappa"/>
+            <log idref="CP3.hky.kappa"/>
+            <log idref="CP12.frequencies"/>
+            <log idref="CP3.frequencies"/>
+            <log idref="CP12.gammaShape"/>
+            <log idref="CP3.gammaShape"/>
+            <log idref="CP12.mutationRate"/>
+            <log idref="CP3.mutationRate"/>
+            <log idref="clockRate"/>
+            <log idref="CP12.treeLikelihood"/>
+            <log idref="CP3.treeLikelihood"/>
+            <log idref="coalescent"/>
+        </logger>
+        <!--         <logger logEvery="1000" fileName="test.$(seed).trees">
+    <log idref="tree"/>
+</logger>        -->
+        <logger logEvery="100000">
+            <model idref='posterior'/>
+            <log idref="posterior"/>
+            <log idref="prior"/>
+            <log idref="likelihood"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+            <log idref="popSize"/>
+            <log idref="coalescent"/>
+        </logger>
+    </run>
+
+</beast>
diff --git a/examples/beast2vs1/testSiteModelAlpha.xml b/examples/beast2vs1/testSiteModelAlpha.xml
new file mode 100644
index 0000000..f426828
--- /dev/null
+++ b/examples/beast2vs1/testSiteModelAlpha.xml
@@ -0,0 +1,197 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beast version='2.0'
+       namespace='beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood:beast.evolution.branchratemodel'>
+
+    <!-- 17 taxa, 1485 sites, 138 patterns -->
+    <data dataType="nucleotide" id="alignment">
+        <sequence taxon="TREESPARROW_HENAN_1_2004">
+            ATGGAGAAAATAGTGCTTCTTCGTGCAATGATCAATCTTGTTAAAAGTGATCAGATTGGCGTTGGTTACCATGCAGACTACTCGACAGAGCAGGGTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCTCAAGACATATTGGAAAAGACACACAACGGGAAGCTCTGCGACCTAGATGGAGTGAAGCCTCTAATTTTGAAAGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCAATGTGTGACGAATTCATCAATGTGCCGGAGTGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTACCCAGGGGATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAAAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCGATCATGAAGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCTGGGGAAGCCCTCCTTTTTC [...]
+        </sequence>
+        <sequence taxon="HUMAN_VIETNAM_CL105_2005">
+            ATGGAGAAAATAGTGCTTCTTTTTGCGATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGCGATCTAGATGGAGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTACTCGGAAACCCAATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGTCAATCCAGTCAATGACCTCTGTTACCCAGGGGTTTTCAATGACTATGAAGAATTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAGTCATGAAGCCTCATTAGGGGTGAGCTCAGTATGTCCATACCAGGGAAAGTCCTCCTTTTTC [...]
+        </sequence>
+        <sequence taxon="TREESPARROW_HENAN_4_2004">
+            ATGGAGAAAATAGTGCTTCTTCTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGCAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGCGATCTAGATGGAGTGAAACCTCTAATTTTAAGAGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCAATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTACCCAGGGGATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCGATCATGAAGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCAGGGGAGTCCCTCCTTTTTC [...]
+        </sequence>
+        <sequence taxon="CHICKEN_HEBEI_326_2005">
+            ATGGAGAGAATAGTGCTTCTTCTTGCAATAATCGGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCTCAAGACATACTGGAGAAGACACACAACGGGAAGCTCTGCAACCCAGATGGAGTGAAGCCTCTAATTTTGAAAGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCAATGTGTGACGAATTTATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGGCCTCTGTTACCCAGGGGATTTCAATGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCGATCATGGAGCCTCATCAGGGGTGAGCTCAGCATGTTCCTATCTGGGGAAGCCCTCCTTTTTC [...]
+        </sequence>
+        <sequence taxon="CHICKEN_HONGKONG_915_1997">
+            ATGGAGAAAATAGTGCTTCTTCTTGCAACAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAATGTTACTGTTACACATGCCCAAGACATACTGGAAAGGACACACAACGGGAAGCTCTGCGATCTAAATGGAGTGAAACCTCTCATTTTGAGGGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCTATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTATCCAGGGAATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAATCATGATGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCTTGGGAGGTCCTCCTTTTTC [...]
+        </sequence>
+        <sequence taxon="VIETNAM_3062_2004">
+            ATGGAGAAAATAGTGCTTCTTTTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGCGATCTAGATGGAGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCAATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAATCCAGTCAATGACCTCTGTTACCCAGGGGATTTCAATGACTATGAAGAATTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAGTCATGAAGCCTCATTAGGAGTGAGCTCAGCATGTCCATACCAGGGAAAGTCCTCCTTTTTC [...]
+        </sequence>
+        <sequence taxon="GOOSE_HONGKONG_W355_1997">
+            ATGGAGAAAATAGTGCTTCTTCTTGCAACAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAATGTTACTGTTACACATGCCCAAGACATACTGGAAAGGACACACAACGGGAAGCTCTGCGATCTAAATGGAGTGAAACCTCTCATTTTGAGGGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCTATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTATCCAGGGAATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAATCATGATGCCTCATCAGGGGTTAGCTCAGCATGTCCATACCTTGGGAGGTCCTCCTTTTTC [...]
+        </sequence>
+        <sequence taxon="DUCK_HONGKONG_Y283_1997">
+            ATGGAGAAAATAGTGCTTCTTCTTGCAACAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAATGTTACTGTTACACATGCCCAAGACATACTGGAAAGGACACACAACGGGAAGCTCTGCGATCTAAATGGAGTGAAACCTCTCATTTTGAGGGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCTATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTATCCAGGGAATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAATCATGATGCCTCATCAGGGGTTAGCTCAGCATGTCCATACCTTGGGAGGTCCTCCTTTTTC [...]
+        </sequence>
+        <sequence taxon="DUCK_VIETNAM_376_2005">
+            ATGGAGAAAATAGTGCTTCTTTTTGCGATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCAACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGCGATCTAGATGGAGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCAATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAATCCAGTCAATGACCTCTGTTACCCAGGGGATTTCAATGACTATGAAGAATTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAGTCATGAAGCCTCATTAGGAGTGAGCTCAGCATGTCCATACCAGGGAAATCCCTCCTTTTTC [...]
+        </sequence>
+        <sequence taxon="MALLARD_VIETNAM_16_2003">
+            ATGGAGAAAATAGTGCTTCTTTTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGCGATCTAGATGGAGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCAATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAATCCAGTCAATGACCTCTGTTACCCAGGGGATTTCAATGAATATGAAGAATTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAGTCATGAAGCCTCATTAGGGGTGAGCTCAGCATGTCCATACCAGGGAAAGTCCTCCTTTTTC [...]
+        </sequence>
+        <sequence taxon="CHICKEN_THAILAND_KANCHANABURI_CK_160_2005">
+            ATGGAGAAAATAGTGCTTCTTTTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCAACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGTGATCTAGATGGAGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTCCTTGGAAACCCAATGTGTGATGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAATCCAGCCAATGACCTCTGTTACCCAGGGGATTTCAATGACTATGAAGAATTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAGTCATGAAGCCTCATTAGGAGTGAGCTCAGCATGTCCATATCAGGGAAAGTCCTCCTTTTTC [...]
+        </sequence>
+        <sequence taxon="DUCK_GUANGZHOU_20_2005">
+            ATGGAGAAAATAGTGCTTCTTCTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAATGGGAAGCTCTGCGACCTAGATGGGGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTCCTCGGGAACCCAATGTGTGACGAATTCATCAATGTACCGGAATGGTCTTACATAGTGGAGAAGGCCAATCCAGCCAATGACCTCTGTTACCCAGGTGATTTCAACGATTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAACCATGAATCCTCATCAGGGGTGAGCTCAGCATGTCCATACCTGGGAAAGCCCTCCTTTTTC [...]
+        </sequence>
+        <sequence taxon="CK_HK_WF157_2003">
+            ATGGAGAAAATAGTGCTTCTTCTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACCCACAACGGGAAGCTCTGCGACCTAGATGGAGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTCCTCGGGAACCCAATGTGTGACGAATTCATCAATGTACCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCATCCAATGACCTCTGTTACCCAGGGGATTTCAACAATTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGCTCTTGGTCCAATCATGAAGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCTGGGAAAGCCCTCCTTTTTC [...]
+        </sequence>
+        <sequence taxon="SWINE_ANHUI_2004">
+            ATGGAGAAAATAGTGCTTCTTCTTGCAATAGTCAGTCTTGTTAAAGGTGATCAGATTTGCACTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCTCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGCGACCTAGATGGAGTGAAGCCTCTAATTTTAAGAGATTGTAGTGTAGCTGGATGGCTCCTCGGGAACCCAATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAATCCAGCCAATGACCTCTGTTACCCAGGGGATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCGATCATGAAGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCAGGGAAGGTCCTCCTTTTTC [...]
+        </sequence>
+        <sequence taxon="DUCK_VIETNAM_272_2005">
+            ATGGAGAAAATAGTGCTTCTTTTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGCGATCTAGATGGAGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTCCTTGGAAATCCAATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAATCCAGTCAATGACCTCTGTTACCCAGGGGATTTCAATGACTATGAAGAATTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGCCCAGTCATGAAGCCTCATTAGGGGTGAGCTCAGCATGTCCATACCAGGGAAGGTCCTCCTTTTTC [...]
+        </sequence>
+        <sequence taxon="HONGKONG_1997_1998">
+            ------------------------------------------------GACCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGATACAATAATGGAAAAGAATGTTACTGTTACACATGCCCAAGACATACTGGAAAGGACACACGACGGGAAGCTCTGCGATCTAAATGGAGTGAAACCTCTCATTTTGAGGGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCTATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTATCCAGGGAATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAATCATGATGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCTTGGGAGGTCCTCCTTTTTC [...]
+        </sequence>
+        <sequence taxon="GOOSE_SHANTOU_2216_2005">
+            ATGGAGAAAATAGTGCTTCTTCTTGCAATAATCAGCCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAATGGGAAGCTCTGCGACTTAGATGGGGTGAAGCCTCTAATTTTGAGAGACTGTAGTGTAGCTGGATGGCTCCTCGGGAACCCAATGTGTGACGAATTCATCAATGTACCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTACCCAGGTGATTTCAACGATTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAATCATGAAGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCTGGGAAAGCCCTCCTTTTTC [...]
+        </sequence>
+        <sequence taxon="TREESPARROW_HENAN_3_2004">
+            ATGGAGAAAATAGTGCTTCTTCTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACTATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGCGATCTAGATGGAGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCAATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTACCCAGGGGATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCGGATCATCCCCAAAAGTTCTTGGTCCAATCATGATGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCAGGGGAAGCCCTCCTTTTTC [...]
+        </sequence>
+        <sequence taxon="PEREGRINEFALCON_HK_D0028_2004">
+            ATGGAGAAAATAGTGCTTCTTCTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAATGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAATGGGAAGCTCTGTGACCTAGATGGGGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTCGCTGGATGGCTCCTCGGGAACCCAATGTGTGACGAATTCATCAATGTACCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTACCCAGGTGATTTCAACGATTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAATCATGAAGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCTGGGAAAGCCCTCCTTTTTC [...]
+        </sequence>
+        <sequence taxon="TREESPARROW_HENAN_2_2004">
+            ATGGAGAAAATAGTGCTTCTTCTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCTCAAGACATATTGGAAAAGACACACAACGGGAAGCTCTGCGACCTAGATGGAGTGAAGCCTCTAATTTTGAAAGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCAATGTGTGACGAATTCATCAATGTGCCGGAGTGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTACCCAGGGGATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAAAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCGATCATGAAGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCTGGGGAAGCCCTCCTTTTTC [...]
+        </sequence>
+        <sequence taxon="HONGKONG_538_1997">
+            ------------------------------------------------GATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAATGTTACTGTTACACATGCCCAAGACATACTGGAAAGGACACACAACGGGAAGCTCTGCGATCTAAATGGAGTGAAACCTCTCATTTTGAGGGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCTATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTATCCAGGGAATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAATCATGATGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCTTGGGAGGTCCTCCTTTTTC [...]
+        </sequence>
+
+    </data>
+
+    <tree spec='beast.util.ClusterTree' id='tree' clusterType='upgma'>
+        <trait spec='beast.evolution.tree.TraitSet' traitname='date-forward' units='year'
+               value='
+		TREESPARROW_HENAN_1_2004=2004.0,
+		HUMAN_VIETNAM_CL105_2005=2005.0,
+		TREESPARROW_HENAN_4_2004=2004.0,
+		CHICKEN_HEBEI_326_2005=2005.0,
+		CHICKEN_HONGKONG_915_1997=1997.0,
+		VIETNAM_3062_2004=2004.0,
+		GOOSE_HONGKONG_W355_1997=1997.0,
+		DUCK_HONGKONG_Y283_1997=1997.0,
+		DUCK_VIETNAM_376_2005=2005.0,
+		MALLARD_VIETNAM_16_2003=2003.0,
+		CHICKEN_THAILAND_KANCHANABURI_CK_160_2005=2005.0,
+		DUCK_GUANGZHOU_20_2005=2005.0,
+		CK_HK_WF157_2003=2003.0,
+		SWINE_ANHUI_2004=2004.0,
+		DUCK_VIETNAM_272_2005=2005.0,
+		HONGKONG_1997_1998=1998.0,
+		GOOSE_SHANTOU_2216_2005=2005.0,
+		TREESPARROW_HENAN_3_2004=2004.0,
+		PEREGRINEFALCON_HK_D0028_2004=2004.0,
+		TREESPARROW_HENAN_2_2004=2004.0,
+		HONGKONG_538_1997=1997.0'>
+		<taxa spec='beast.evolution.alignment.TaxonSet' alignment='@alignment'/>
+        </trait>
+        <taxa idref='alignment'/>
+    </tree>
+
+    <siteModel spec='SiteModel' id="siteModel" gammaCategoryCount="4">
+        <parameter id='siteModel.alpha' name='shape' value="0.05" lower="0.0" upper="100.0"/>
+
+        <substModel spec='HKY' id="hky">
+            <parameter name='kappa' id="hky.kappa" value="2.0" lower="0.0" upper="100.0"/>
+            <frequencies id='freqs' spec='Frequencies' data="@alignment"/>
+        </substModel>
+    </siteModel>
+
+    <input spec='StrictClockModel' id="branchRates">
+        <parameter name='clock.rate' id='clockRate' value="4.0E-4"/>
+    </input>
+
+    <input spec='TreeLikelihood' id="treeLikelihood">
+        <data idref="alignment"/>
+        <tree idref="tree"/>
+        <siteModel idref="siteModel"/>
+        <branchRateModel idref="branchRates"/>
+    </input>
+
+    <parameter id="popSize" value="380.0" lower="0.0" upper="38000.0"/>
+
+    <run spec="MCMC" id="mcmc" chainLength="5000000"> <!--autoOptimize="true"-->
+        <state>
+            <stateNode idref='hky.kappa'/>
+            <stateNode idref='popSize'/>
+            <stateNode idref='siteModel.alpha'/>
+            <stateNode idref='tree'/>
+            <input name='stateNode' idref="clockRate"/>
+        </state>
+
+        <distribution spec="CompoundDistribution" id="posterior">
+            <!--<distribution spec="CompoundDistribution" id="prior">-->
+                <!--<distribution id="hky.kappa.prior" spec="beast.math.distributions.Prior" x="@hky.kappa">-->
+                <!--<distr id="LogNormalDistributionModel" M="1.0" S="1.25" meanInRealSpace="false" spec="beast.math.distributions.LogNormalDistributionModel"/>-->
+                <!--</distribution>-->
+                <!--<distribution id="hky.frequencies.prior" spec="beast.math.distributions.Prior" x="@hky.frequencies">-->
+                <!--<distr id="Uniform" lower="0.0" upper="1.0" spec="beast.math.distributions.Uniform"/>-->
+                <!--</distribution>-->
+                <!--<distribution id="popSize.prior" spec="beast.math.distributions.Prior" x="@popSize">-->
+                <!--<distr id="OneOnX" offset="0.0" spec="beast.math.distributions.OneOnX"/>-->
+                <!--</distribution>-->
+
+                <distribution id="coalescent" spec="Coalescent">
+                    <treeIntervals spec='TreeIntervals' id='TreeIntervals'>
+                        <tree idref="tree"/>
+                    </treeIntervals>
+                    <populationModel spec="ConstantPopulation">
+                        <popSize idref="popSize"/>
+                    </populationModel>
+                </distribution>
+            <!--</distribution>-->
+            <distribution id='likelihood' idref="treeLikelihood"/>
+        </distribution>
+
+        <operator id='kappaScaler' spec='ScaleOperator' scaleFactor="0.75" weight="1" parameter="@hky.kappa"/>
+        <operator id='shapeScaler' spec='ScaleOperator' scaleFactor="0.75" weight="1" parameter="@siteModel.alpha"/>
+        <operator id='clockRateScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" parameter="@clockRate"/>
+        <operator id='popSizeScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3" parameter="@popSize"/>
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3" tree="@tree"/>
+        <operator spec='Uniform' weight="30" tree="@tree"/>
+        <operator spec='SubtreeSlide' weight="15" gaussian="true" size="0.0077" tree="@tree"/>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="15" tree="@tree"/>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="3" tree="@tree"/>
+        <operator spec='WilsonBalding' weight="1" tree="@tree"/>
+        <operator spec='UpDownOperator' scaleFactor="0.75" weight="3" up="@clockRate" down="@tree"/>
+
+        <logger logEvery="500" fileName="test.$(seed).log">
+            <model idref='posterior'/>
+            <log idref="posterior"/>
+            <!--<log idref="prior"/>-->
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+            <log idref="popSize"/>
+            <log idref="hky.kappa"/>
+            <log idref="siteModel.alpha"/>
+            <log idref="clockRate"/>
+            <log idref="likelihood"/>
+            <log idref="coalescent"/>
+        </logger>
+        <!--         <logger logEvery="1000" fileName="test.$(seed).trees">
+    <log idref="tree"/>
+</logger>        -->
+        <logger logEvery="50000">
+            <model idref='posterior'/>
+            <log idref="posterior"/>
+            <!--<log idref="prior"/>-->
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+            <log idref="popSize"/>
+            <log idref="hky.kappa"/>
+            <log idref="siteModel.alpha"/>
+            <log idref="likelihood"/>
+            <log idref="coalescent"/>
+        </logger>
+    </run>
+
+</beast>
diff --git a/examples/beast2vs1/testStarBEAST.xml b/examples/beast2vs1/testStarBEAST.xml
new file mode 100644
index 0000000..5366296
--- /dev/null
+++ b/examples/beast2vs1/testStarBEAST.xml
@@ -0,0 +1,473 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<beast namespace="beast.evolution.speciation:beast.evolution.alignment:beast.core:beast.math:beast.evolution:beast.evolution.tree:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood"
+       version="2.0">
+
+    <data dataType="nucleotide" id="26" name="taxa">
+        <sequence taxon="Orthogeomys_heterodus">
+            ATTCTAGGCAAAAAG-AGCAATGCTGGAGGTATTACAATACCAGACTTCAAACTTTACTATAGAGCCATAATAACAAAAACCGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAATGGAAYAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGTCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCACCATGCACAGGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCAGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGGGAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATAGGAGAAAGACTCAATAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_albatus">
+            ????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGATCCAGAAATAGAACCAC-ATACCTATAGTCAACTTGTATTTGATAAAGGAGCTAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCATTTCACCATGCACAAGAATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCT-------------------------------------CATAGGCACTCATAGGCACAGGCAAAAGATTCCTATACAGGAACCCAGGGTCAACAACAGATTGGAGAGAGACTCAATAAATGGGACTACCTAAAAATAAAA-G [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_alpinus">
+            ????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCTATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCA???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_awahnee_a">
+            ????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACMCAGTCTATTCAATTATTGGKGCTGGCAAAACTGGGCAGCCMCATGCARAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAA??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_awahnee_b">
+            ????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCM-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_bottae">
+            ????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAAATTCCTGAACAGAATCCCAGGGTCA-CAACAGATKGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_cactophilus">
+            ????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAAYGTCAGACCGGAAACCGTGAAAYTGTTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAA?????????????????????????????????????????????????????????????????????????????? [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_laticeps">
+            ????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAATTGCTACATGATAAWGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCAATAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_mewa">
+            ????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCATTTCACCATGCACAAGAATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAA????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_riparius">
+            ????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_ruidosae">
+            ????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCARAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAAYTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAG???????????????????????????????????????????????????????????????????????????? [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_saxatilis">
+            ????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAA??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_xerophilus">
+            ????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAAYTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAA??????????????????????????????????????????????????????????????????? [...]
+        </sequence>
+        <sequence taxon="Thomomys_idahoensis_pygmaeus_a">
+            ????????CAAAA-G-AGCAATGCTGGTGGTATYACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATMCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCRACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_idahoensis_pygmaeus_b">
+            ????GGCGCAAAA-G-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATMCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_mazama_mazama">
+            ATTCTAGGCAAAAAGAAGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAAYTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_mazama_nasicus">
+            ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCSCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAAYTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_monticola_a">
+            ??????????????G-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGYCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_monticola_b">
+            ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATYACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAWATAGAACCAC-ACAACTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAATGGAACRAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_talpoides_bridgeri">
+            ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATCCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCRACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_talpoides_ocius">
+            ???CTAGGCAAAA-G-AGC-ATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATMCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCRACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_talpoides_yakimensis">
+            ATTCTAGGCAAAA-G-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTKTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAAYGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAAYTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_townsendii_relictus">
+            ??????????????G-AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTAYTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCACTATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAATGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAATTGCTACATGATAAWGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAATG [...]
+        </sequence>
+        <sequence taxon="Thomomys_townsendii_townsendii">
+            ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTYGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_umbrinus_atroavarius">
+            ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGCATTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGKCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGYCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAAYGTCAGACCGGAAACCGTGAAATTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_umbrinus_chihuahuae">
+            ?????????????AG-AGC-ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCTTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+    </data>
+
+    <data dataType="nucleotide" id="29" name="taxa">
+
+        <sequence taxon="Orthogeomys_heterodus">
+            C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCACAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCGTTTCTGGAAAACTGAGATCTTGTTTTGACCAACAGAAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTACTGGTGATGTCTCTGTCAGGATCTAGTCCCATCCTG-AATCCATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTCAGAACTGACTGAATCAGGCCAGTGAAAGTTA-CAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATTGTGCATGGCTTCATTAGCAGGTTTACTGTGCTGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_albatus">
+            C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_alpinus">
+            C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCC-AGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGTTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCYACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_awahnee_a">
+            C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_awahnee_b">
+            C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_bottae">
+            C-AGCTTGCTG-TCACACYGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTAKGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_cactophilus">
+            C-AGCTTGCTG-TCACACTACCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCACTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_laticeps">
+            C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_mewa">
+            C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_riparius">
+            C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_ruidosae">
+            ?????????????????????????????C-AGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_saxatilis">
+            C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_xerophilus">
+            C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCACTAAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTRTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_idahoensis_pygmaeus_a">
+            C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTTTAAGTGTTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGTCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGTCCAGTGAAACTTAACAGCTACCTTGCCAATKGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGG--TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_idahoensis_pygmaeus_b">
+            CAAGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTGTTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGTCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGG--TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_mazama_mazama">
+            C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTATTGCCTGGATATAGTGTCTATAGACAGAGACAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCACATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCACCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCTGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_mazama_nasicus">
+            C-AGCTTGCTG-TCACAATGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTATTGCCTGGATATAGTGTCTATAGACAGAGACAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCACATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCTGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_monticola_a">
+            C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGACGCCKTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_monticola_b">
+            C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGACGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTYCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_talpoides_bridgeri">
+            C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_talpoides_ocius">
+            C-AGCTTGCTGGTCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCATATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAAWGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_talpoides_yakimensis">
+            C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGAMTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_townsendii_relictus">
+            C-AGCTTGCTGGTCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_townsendii_townsendii">
+            C-AGCTTGCTGGTCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_umbrinus_atroavarius">
+            C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_umbrinus_chihuahuae">
+            C-AGCTTGCTGGTCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAAGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTGGAATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+    </data>
+
+    <taxonset spec='TaxonSet' id='lineagetaxa'>
+        <taxon idref='Orthogeomys_heterodus'/>
+        <taxon idref='Thomomys_bottae_albatus'/>
+        <taxon idref='Thomomys_bottae_alpinus'/>
+        <taxon idref='Thomomys_bottae_awahnee_a'/>
+        <taxon idref='Thomomys_bottae_awahnee_b'/>
+        <taxon idref='Thomomys_bottae_bottae'/>
+        <taxon idref='Thomomys_bottae_cactophilus'/>
+        <taxon idref='Thomomys_bottae_laticeps'/>
+        <taxon idref='Thomomys_bottae_mewa'/>
+        <taxon idref='Thomomys_bottae_riparius'/>
+        <taxon idref='Thomomys_bottae_ruidosae'/>
+        <taxon idref='Thomomys_bottae_saxatilis'/>
+        <taxon idref='Thomomys_bottae_xerophilus'/>
+        <taxon idref='Thomomys_idahoensis_pygmaeus_a'/>
+        <taxon idref='Thomomys_idahoensis_pygmaeus_b'/>
+        <taxon idref='Thomomys_mazama_mazama'/>
+        <taxon idref='Thomomys_mazama_nasicus'/>
+        <taxon idref='Thomomys_monticola_a'/>
+        <taxon idref='Thomomys_monticola_b'/>
+        <taxon idref='Thomomys_talpoides_bridgeri'/>
+        <taxon idref='Thomomys_talpoides_ocius'/>
+        <taxon idref='Thomomys_talpoides_yakimensis'/>
+        <taxon idref='Thomomys_townsendii_relictus'/>
+        <taxon idref='Thomomys_townsendii_townsendii'/>
+        <taxon idref='Thomomys_umbrinus_atroavarius'/>
+        <taxon idref='Thomomys_umbrinus_chihuahuae'/>
+    </taxonset>
+
+    <taxonset spec='TaxonSet' id='taxonsuperset'>
+        <taxon spec='TaxonSet' id='Orthogeomys_heterodus_species'>
+            <taxon spec='Taxon' id='Orthogeomys_heterodus'/>
+        </taxon>
+        <taxon spec='TaxonSet' id='Thomomys_bottae'>
+            <taxon spec='Taxon' id='Thomomys_bottae_awahnee_a'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_awahnee_b'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_xerophilus'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_cactophilus'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_albatus'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_ruidosae'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_bottae'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_alpinus'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_riparius'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_mewa'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_saxatilis'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_laticeps'/>
+        </taxon>
+        <taxon spec='TaxonSet' id='Thomomys_idahoensis'>
+            <taxon spec='Taxon' id='Thomomys_idahoensis_pygmaeus_a'/>
+            <taxon spec='Taxon' id='Thomomys_idahoensis_pygmaeus_b'/>
+        </taxon>
+        <taxon spec='TaxonSet' id='Thomomys_mazama'>
+            <taxon spec='Taxon' id='Thomomys_mazama_mazama'/>
+            <taxon spec='Taxon' id='Thomomys_mazama_nasicus'/>
+        </taxon>
+        <taxon spec='TaxonSet' id='Thomomys_monticola'>
+            <taxon spec='Taxon' id='Thomomys_monticola_a'/>
+            <taxon spec='Taxon' id='Thomomys_monticola_b'/>
+        </taxon>
+        <taxon spec='TaxonSet' id='Thomomys_talpoides'>
+            <taxon spec='Taxon' id='Thomomys_talpoides_yakimensis'/>
+            <taxon spec='Taxon' id='Thomomys_talpoides_bridgeri'/>
+            <taxon spec='Taxon' id='Thomomys_talpoides_ocius'/>
+        </taxon>
+        <taxon spec='TaxonSet' id='Thomomys_townsendii'>
+            <taxon spec='Taxon' id='Thomomys_townsendii_townsendii'/>
+            <taxon spec='Taxon' id='Thomomys_townsendii_relictus'/>
+        </taxon>
+        <taxon spec='TaxonSet' id='Thomomys_umbrinus'>
+            <taxon spec='Taxon' id='Thomomys_umbrinus_chihuahuae'/>
+            <taxon spec='Taxon' id='Thomomys_umbrinus_atroavarius'/>
+        </taxon>
+    </taxonset>
+
+    <distribution id="posterior" spec="util.CompoundDistribution">
+        <distribution id="prior" spec="util.CompoundDistribution">
+
+            <distribution id="speciesCoalescent" spec="util.CompoundDistribution">
+                <!-- gene tree priors -->
+                <distribution id='tree.prior.29' spec='GeneTreeForSpeciesTreeDistribution' tree='@tree29'
+                              speciesTree='@speciesTree' speciesTreePrior='@SpeciesTreePopSizePrior'/>
+                <distribution id='tree.prior.26' spec='GeneTreeForSpeciesTreeDistribution' tree='@tree26'
+                              speciesTree='@speciesTree' speciesTreePrior='@SpeciesTreePopSizePrior'/>
+
+                <!-- species tree priors -->
+                <distribution id='SpeciesTreePopSizePrior' spec='SpeciesTreePrior' tree='@speciesTree'
+                              popFunction='constant' taxonset='@taxonsuperset'>
+                    <bottomPopSize spec='parameter.RealParameter' id='popSize' value='1'/>
+                    <parameter name='gammaParameter' id='popMean' value='0.004'/>
+                </distribution>
+            </distribution>
+
+            <distribution id="SpeciesTreeDivergenceTimesPrior" spec="speciation.YuleModel" tree='@speciesTree'>
+                <birthDiffRate spec='parameter.RealParameter' id="birthRate" value='213.2021' lower='0' upper='10000'/>
+            </distribution>
+            <!--
+                        <distribution id="SpeciesTreeDivergenceTimesPrior" spec="speciation.BirthDeathGernhard08Model" tree='@speciesTree'>
+                            <birthDiffRate spec='parameter.RealParameter' id="birthRate" value='1' lower='0' upper='10000' />
+                            <relativeDeathRate spec='parameter.RealParameter' id="relativeDeathRate" value='0.5' lower='0' upper='1' />
+                        </distribution>
+            -->
+            <!-- hyper priors for assorted parameters -->
+            <distribution id='birthRatePrior' spec='distributions.Prior' x='@birthRate'>
+                <distr id='OneOnX' spec='distributions.OneOnX'/>
+            </distribution>
+            <!--
+                        <distribution id='relativeDeathRatePrior' spec='distributions.Prior' x='@relativeDeathRate'>
+                            <distribution id="UniformRelDeathRate" spec='distributions.Uniform' lower='0' upper='1'/>
+                        </distribution>
+            -->
+            <distribution id="popMean.prior26" spec="beast.math.distributions.Prior" x="@popMean" distr='@OneOnX'/>
+            <distribution id="kappa.prior26" spec="beast.math.distributions.Prior" x="@hky.kappa26">
+                <distr id='logNormal' spec='beast.math.distributions.LogNormalDistributionModel' M="1.0" S="1.25"
+                       offset="0.0" meanInRealSpace="false"/>
+            </distribution>
+            <distribution id="kappa.prior29" spec="beast.math.distributions.Prior" x="@hky.kappa29" distr='@logNormal'/>
+
+        </distribution>
+        <distribution id="likelihood" spec="util.CompoundDistribution">
+            <distribution data="@26" id="treelikelihood.26" spec="TreeLikelihood" tree="@tree26" useAmbiguities="false">
+                <siteModel gammaCategoryCount="1" id="siteModel26" mutationRate="@mutationRate"
+                           proportionInvariant="@proportionInvariant" shape="@gammaShape" spec="SiteModel">
+                    <substModel id="hky26" kappa="@hky.kappa26" spec="HKY">
+                        <frequencies id="freqs26" spec="Frequencies" estimate='true' data='@26'/>
+                    </substModel>
+                </siteModel>
+                <branchRateModel clock.rate="@clockRate" id="StrictClockModel26"
+                                 spec="beast.evolution.branchratemodel.StrictClockModel"/>
+            </distribution>
+            <distribution data="@29" id="treelikelihood.29" spec="TreeLikelihood" tree="@tree29" useAmbiguities="false">
+                <siteModel gammaCategoryCount="1" id="siteModel29" mutationRate="@mutationRate"
+                           proportionInvariant="@proportionInvariant" shape="@gammaShape" spec="SiteModel">
+                    <substModel id="hky29" kappa="@hky.kappa29" spec="HKY">
+                        <frequencies id="freqs29" spec="Frequencies" estimate='true' data='@29'/>
+                    </substModel>
+                </siteModel>
+                <branchRateModel clock.rate="@clockRate" id="StrictClockModel29"
+                                 spec="beast.evolution.branchratemodel.StrictClockModel"/>
+            </distribution>
+        </distribution>
+    </distribution>
+
+    <tree spec='RandomTree' id='randomSpeciesTree' initial='@speciesTree'
+          taxonset='@taxonsuperset'>
+        <populationModel spec='ConstantPopulation'>
+            <popSize spec='parameter.RealParameter' value='1'/>
+        </populationModel>
+    </tree>
+
+
+    <tree spec='beast.util.TreeParser' id='newickSpeciesTree'
+          newick='(Orthogeomys_heterodus_species:0.02065265792151943,(((Thomomys_talpoides:0.0013609706233106656,Thomomys_mazama:0.0013609706233106656):6.032405317365711E-4,(Thomomys_idahoensis:0.0019116640088644983,Thomomys_monticola:0.0019116640088644983):5.254714618273845E-5):0.01135560317788915,(Thomomys_umbrinus:0.001060205025110908,(Thomomys_townsendii:2.1835631905959876E-4,Thomomys_bottae:2.1835631905959876E-4):8.418487060513092E-4):0.01225960930782548):0.007332843588583044);'
+          initial='@speciesTree' threshold='1e-12' taxonset='@taxonsuperset'/>
+
+
+    <tree spec='beast.util.TreeParser' id='newickGeneTree1'
+          newick='((((Thomomys_idahoensis_pygmaeus_a:4.790629004925939E-4,Thomomys_idahoensis_pygmaeus_b:4.790629004925939E-4):0.002807766516703272,(Thomomys_monticola_a:3.1053813362974055E-5,Thomomys_monticola_b:3.1053813362974055E-5):0.0032557756038328915):1.3936218139959985E-4,((Thomomys_talpoides_yakimensis:0.001392151582227928,(Thomomys_talpoides_bridgeri:4.271344427331326E-4,Thomomys_talpoides_ocius:4.271344427331326E-4):9.650171394947955E-4):2.3416363608392133E-4,(Thomomys_mazama_ [...]
+          initial='@tree26' taxonset='@lineagetaxa' threshold='1e-12'/>
+
+    <tree spec='beast.util.TreeParser' id='newickGeneTree2'
+          newick='(Orthogeomys_heterodus:0.02555754747205849,((Thomomys_mazama_nasicus:0.001146519512253189,Thomomys_mazama_mazama:0.001146519512253189):0.01169723135080885,((Thomomys_talpoides_ocius:0.00703974619989265,(((Thomomys_talpoides_yakimensis:0.0014682135377831343,(Thomomys_monticola_a:3.1427207759506006E-5,Thomomys_monticola_b:3.1427207759506006E-5):0.0014367863300236282):3.5111237723683074E-4,(Thomomys_idahoensis_pygmaeus_a:2.52563963076903E-4,Thomomys_idahoensis_pygmaeus_b:2 [...]
+          initial='@tree29' taxonset='@lineagetaxa' threshold='1e-12'/>
+
+    <tree spec='RandomGeneTree' id='randomGeneTree1'
+          initial='@tree26' speciesTree='@speciesTree' taxa='@26'>
+        <populationModel spec='ConstantPopulation'>
+            <popSize spec='parameter.RealParameter' value='1'/>
+        </populationModel>
+    </tree>
+
+    <tree spec='RandomGeneTree' id='randomGeneTree2'
+          initial='@tree29' speciesTree='@speciesTree' taxa='@29'>
+        <populationModel spec='ConstantPopulation'>
+            <popSize spec='parameter.RealParameter' value='1'/>
+        </populationModel>
+    </tree>
+
+    <run chainLength="10000000" id="mcmc" preBurnin="0" spec="MCMC">
+        <!--init idref='randomSpeciesTree'/-->
+        <init idref='newickSpeciesTree'/>
+        <!--init idref='newickGeneTree1'/>
+       <init idref='newickGeneTree2'/-->
+
+        <init idref='randomGeneTree1'/>
+        <init idref='randomGeneTree2'/>
+
+
+        <distribution idref="posterior"/>
+
+        <state id="State0" storeEvery="100000">
+            <!--parameter dimension="1" estimate="false" id="popSize" name="stateNode" value="1.0"/-->
+            <parameter dimension="1" estimate="false" id="mutationRate" name="stateNode" value="1.0"/>
+            <parameter dimension="1" estimate="false" id="clockRate" name="stateNode" value="1.0"/>
+            <parameter dimension="1" estimate="false" id="hky.kappa26" lower="0.0" name="stateNode" value="1.0"/>
+            <parameter dimension="1" estimate="false" id="hky.kappa29" lower="0.0" name="stateNode" value="1.0"/>
+
+            <stateNode idref='popSize'/>
+            <stateNode idref='popMean'/>
+
+            <tree estimate="true" id="tree26" name="stateNode"/>
+            <tree estimate="true" id="tree29" name="stateNode"/>
+            <tree estimate="true" id="speciesTree" name="stateNode"/>
+
+            <stateNode idref="birthRate"/>
+            <!--stateNode idref="relativeDeathRate"/-->
+            <parameter dimension="1" estimate="false" id="gammaShape" name="stateNode" value="1.0"/>
+            <parameter dimension="1" estimate="false" id="proportionInvariant" lower="0.0" name="stateNode" upper="1.0"
+                       value="0.0"/>
+        </state>
+
+        <operator degreesOfFreedom="1" id="popSizeScaler" scaleAll="false" scaleAllIndependently="false"
+                  scaleFactor="0.5" spec="ScaleOperator" parameter="@popSize" weight="5.0"/>
+        <operator degreesOfFreedom="1" id="birthRateScaler" scaleFactor="0.5" spec="ScaleOperator"
+                  parameter="@birthRate" weight="3"/>
+        <!--operator degreesOfFreedom="1" id="relDeathRateScaler" scaleFactor="0.5" spec="ScaleOperator" parameter="@relativeDeathRate" weight="1.0"/-->
+        <operator degreesOfFreedom="1" id="psiScaler" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.5"
+                  spec="ScaleOperator" parameter="@popMean" weight="94"/>
+        <operator degreesOfFreedom="1" id="kappa26Scaler" scaleAll="false" scaleAllIndependently="false"
+                  scaleFactor="0.35" spec="ScaleOperator" parameter="@hky.kappa26" weight="0.1"/>
+        <operator degreesOfFreedom="1" id="kappa29Scaler" scaleAll="false" scaleAllIndependently="false"
+                  scaleFactor="0.35" spec="ScaleOperator" parameter="@hky.kappa29" weight="0.1"/>
+
+        <operator gaussian="true" id="SubtreeSlide26" size="0.003" spec="SubtreeSlide" tree="@tree26" weight="15.0"/>
+        <operator degreesOfFreedom="1" id="treeScaler26" scaleAll="false" scaleAllIndependently="false"
+                  scaleFactor="0.85" spec="ScaleOperator" tree="@tree26" weight="6.0"/>
+        <operator id="wide26" isNarrow="false" spec="Exchange" tree="@tree26" weight="1.0"/>
+        <operator id="narrow26" isNarrow="true" spec="Exchange" tree="@tree26" weight="15"/>
+        <operator id="WilsonBalding26" spec="WilsonBalding" tree="@tree26" weight="3"/>
+        <!--
+        -->
+        <operator id="Uniform26" spec="Uniform" tree="@tree26" weight="30.0"/>
+
+        <operator gaussian="true" id="SubtreeSlide29" size="0.002" spec="SubtreeSlide" tree="@tree29" weight="15.0"/>
+        <operator degreesOfFreedom="1" id="treeScaler29" scaleAll="false" scaleAllIndependently="false"
+                  scaleFactor="0.85" spec="ScaleOperator" tree="@tree29" weight="6.0"/>
+        <operator id="wide29" isNarrow="false" spec="Exchange" tree="@tree29" weight="1.0"/>
+        <operator id="narrow29" isNarrow="true" spec="Exchange" tree="@tree29" weight="15"/>
+        <operator id="WilsonBalding29" spec="WilsonBalding" tree="@tree29" weight="3"/>
+        <!--
+        -->
+        <operator id="Uniform29" spec="Uniform" tree="@tree29" weight="30.0"/>
+
+        <operator spec='UpDownOperator' scaleFactor="0.75" weight="30">
+            <up idref="birthRate"/>
+            <down idref="popSize"/>
+            <down idref="popMean"/>
+            <down idref="speciesTree"/>
+            <down idref="tree26"/>
+            <down idref="tree29"/>
+        </operator>
+
+        <!--
+            <operator id="wideSP" isNarrow="false" spec="Exchange" tree="@speciesTree" weight="1.0"/>
+            <operator gaussian="true" id="SubtreeSlideSP" size="0.003" spec="SubtreeSlide" tree="@speciesTree" weight="15.0"/>
+            <operator degreesOfFreedom="1" id="treeScalerSP" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.85" spec="ScaleOperator" tree="@speciesTree" weight="6.0"/>
+            <operator id="UniformSP" spec="Uniform" tree="@speciesTree" weight="30.0"/>
+        -->
+
+        <operator id="Reheight" spec="NodeReheight" tree="@speciesTree" weight="94" taxonset='@taxonsuperset'>
+            <genetree idref='tree26'/>
+            <genetree idref='tree29'/>
+        </operator>
+
+        <logger fileName="test.$(seed).log" id="Logger0" logEvery="1000" mode="autodetect" model="@posterior">
+            <log idref="posterior"/>
+            <log idref="prior"/>
+            <log idref="speciesCoalescent"/>
+            <log idref="SpeciesTreePopSizePrior"/>
+            <log idref="tree.prior.26"/>
+            <log idref="tree.prior.29"/>
+            <log idref="SpeciesTreeDivergenceTimesPrior"/>
+            <log idref="likelihood"/>
+            <log idref="popMean"/>
+            <log idref="birthRate"/>
+            <!--log idref="relativeDeathRate"/-->
+            <log idref="hky.kappa26"/>
+            <log idref="hky.kappa29"/>
+            <log idref="popSize"/>
+            <log id="TreeHeightSP" spec="beast.evolution.tree.TreeHeightLogger" tree="@speciesTree"/>
+            <log id="TreeHeight26" spec="beast.evolution.tree.TreeHeightLogger" tree="@tree26"/>
+            <log id="TreeHeight29" spec="beast.evolution.tree.TreeHeightLogger" tree="@tree29"/>
+        </logger>
+
+        <logger fileName="test.$(seed).sp.trees" id="Logger4" logEvery="1000" mode="tree">
+            <log spec='SpeciesTreeLogger' popSize='@popSize' tree="@speciesTree"/>
+        </logger>
+
+        <logger fileName="test.$(seed).26.trees" id="Logger2" logEvery="1000" mode="autodetect">
+            <log idref="tree26"/>
+        </logger>
+
+        <logger fileName="test.$(seed).29.trees" id="Logger3" logEvery="1000" mode="autodetect">
+            <log idref="tree29"/>
+        </logger>
+
+        <logger id="Logger1" logEvery="100000" mode="autodetect">
+            <log idref="posterior"/>
+            <log spec='ESS' arg='@posterior'/>
+            <log idref="prior"/>
+            <log spec='ESS' arg='@prior'/>
+        </logger>
+
+    </run>
+
+
+</beast>
diff --git a/examples/beast2vs1/testStarBEASTConstant.xml b/examples/beast2vs1/testStarBEASTConstant.xml
new file mode 100644
index 0000000..1180780
--- /dev/null
+++ b/examples/beast2vs1/testStarBEASTConstant.xml
@@ -0,0 +1,482 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<beast
+        namespace="beast.evolution.speciation:beast.evolution.alignment:beast.core:beast.math:beast.evolution:beast.evolution.tree:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood"
+        version="2.0">
+
+
+    <data dataType="nucleotide" id="26" name="taxa">
+        <sequence taxon="Orthogeomys_heterodus">
+            ATTCTAGGCAAAAAG-AGCAATGCTGGAGGTATTACAATACCAGACTTCAAACTTTACTATAGAGCCATAATAACAAAAACCGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAATGGAAYAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGTCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCACCATGCACAGGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCAGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGGGAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATAGGAGAAAGACTCAATAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_albatus">
+            ????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGATCCAGAAATAGAACCAC-ATACCTATAGTCAACTTGTATTTGATAAAGGAGCTAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCATTTCACCATGCACAAGAATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCT-------------------------------------CATAGGCACTCATAGGCACAGGCAAAAGATTCCTATACAGGAACCCAGGGTCAACAACAGATTGGAGAGAGACTCAATAAATGGGACTACCTAAAAATAAAA-G [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_alpinus">
+            ????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCTATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCA???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_awahnee_a">
+            ????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACMCAGTCTATTCAATTATTGGKGCTGGCAAAACTGGGCAGCCMCATGCARAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAA??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_awahnee_b">
+            ????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCM-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_bottae">
+            ????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAAATTCCTGAACAGAATCCCAGGGTCA-CAACAGATKGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_cactophilus">
+            ????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAAYGTCAGACCGGAAACCGTGAAAYTGTTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAA?????????????????????????????????????????????????????????????????????????????? [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_laticeps">
+            ????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAATTGCTACATGATAAWGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCAATAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_mewa">
+            ????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCATTTCACCATGCACAAGAATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAA????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_riparius">
+            ????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_ruidosae">
+            ????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCARAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAAYTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAG???????????????????????????????????????????????????????????????????????????? [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_saxatilis">
+            ????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAA??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_xerophilus">
+            ????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAAYTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAA??????????????????????????????????????????????????????????????????? [...]
+        </sequence>
+        <sequence taxon="Thomomys_idahoensis_pygmaeus_a">
+            ????????CAAAA-G-AGCAATGCTGGTGGTATYACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATMCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCRACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_idahoensis_pygmaeus_b">
+            ????GGCGCAAAA-G-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATMCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_mazama_mazama">
+            ATTCTAGGCAAAAAGAAGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAAYTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_mazama_nasicus">
+            ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCSCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAAYTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_monticola_a">
+            ??????????????G-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGYCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_monticola_b">
+            ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATYACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAWATAGAACCAC-ACAACTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAATGGAACRAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_talpoides_bridgeri">
+            ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATCCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCRACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_talpoides_ocius">
+            ???CTAGGCAAAA-G-AGC-ATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATMCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCRACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_talpoides_yakimensis">
+            ATTCTAGGCAAAA-G-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTKTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAAYGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAAYTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_townsendii_relictus">
+            ??????????????G-AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTAYTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCACTATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAATGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAATTGCTACATGATAAWGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAATG [...]
+        </sequence>
+        <sequence taxon="Thomomys_townsendii_townsendii">
+            ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTYGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_umbrinus_atroavarius">
+            ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGCATTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGKCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGYCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAAYGTCAGACCGGAAACCGTGAAATTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_umbrinus_chihuahuae">
+            ?????????????AG-AGC-ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCTTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+    </data>
+
+    <data dataType="nucleotide" id="29" name="taxa">
+
+        <sequence taxon="Orthogeomys_heterodus">
+            C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCACAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCGTTTCTGGAAAACTGAGATCTTGTTTTGACCAACAGAAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTACTGGTGATGTCTCTGTCAGGATCTAGTCCCATCCTG-AATCCATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTCAGAACTGACTGAATCAGGCCAGTGAAAGTTA-CAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATTGTGCATGGCTTCATTAGCAGGTTTACTGTGCTGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_albatus">
+            C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_alpinus">
+            C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCC-AGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGTTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCYACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_awahnee_a">
+            C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_awahnee_b">
+            C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_bottae">
+            C-AGCTTGCTG-TCACACYGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTAKGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_cactophilus">
+            C-AGCTTGCTG-TCACACTACCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCACTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_laticeps">
+            C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_mewa">
+            C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_riparius">
+            C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_ruidosae">
+            ?????????????????????????????C-AGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_saxatilis">
+            C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_xerophilus">
+            C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCACTAAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTRTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_idahoensis_pygmaeus_a">
+            C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTTTAAGTGTTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGTCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGTCCAGTGAAACTTAACAGCTACCTTGCCAATKGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGG--TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_idahoensis_pygmaeus_b">
+            CAAGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTGTTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGTCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGG--TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_mazama_mazama">
+            C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTATTGCCTGGATATAGTGTCTATAGACAGAGACAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCACATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCACCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCTGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_mazama_nasicus">
+            C-AGCTTGCTG-TCACAATGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTATTGCCTGGATATAGTGTCTATAGACAGAGACAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCACATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCTGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_monticola_a">
+            C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGACGCCKTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_monticola_b">
+            C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGACGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTYCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_talpoides_bridgeri">
+            C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_talpoides_ocius">
+            C-AGCTTGCTGGTCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCATATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAAWGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_talpoides_yakimensis">
+            C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGAMTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_townsendii_relictus">
+            C-AGCTTGCTGGTCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_townsendii_townsendii">
+            C-AGCTTGCTGGTCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_umbrinus_atroavarius">
+            C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_umbrinus_chihuahuae">
+            C-AGCTTGCTGGTCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAAGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTGGAATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+    </data>
+
+    <taxonset spec='TaxonSet' id='lineagetaxa'>
+        <taxon idref='Orthogeomys_heterodus'/>
+        <taxon idref='Thomomys_bottae_albatus'/>
+        <taxon idref='Thomomys_bottae_alpinus'/>
+        <taxon idref='Thomomys_bottae_awahnee_a'/>
+        <taxon idref='Thomomys_bottae_awahnee_b'/>
+        <taxon idref='Thomomys_bottae_bottae'/>
+        <taxon idref='Thomomys_bottae_cactophilus'/>
+        <taxon idref='Thomomys_bottae_laticeps'/>
+        <taxon idref='Thomomys_bottae_mewa'/>
+        <taxon idref='Thomomys_bottae_riparius'/>
+        <taxon idref='Thomomys_bottae_ruidosae'/>
+        <taxon idref='Thomomys_bottae_saxatilis'/>
+        <taxon idref='Thomomys_bottae_xerophilus'/>
+        <taxon idref='Thomomys_idahoensis_pygmaeus_a'/>
+        <taxon idref='Thomomys_idahoensis_pygmaeus_b'/>
+        <taxon idref='Thomomys_mazama_mazama'/>
+        <taxon idref='Thomomys_mazama_nasicus'/>
+        <taxon idref='Thomomys_monticola_a'/>
+        <taxon idref='Thomomys_monticola_b'/>
+        <taxon idref='Thomomys_talpoides_bridgeri'/>
+        <taxon idref='Thomomys_talpoides_ocius'/>
+        <taxon idref='Thomomys_talpoides_yakimensis'/>
+        <taxon idref='Thomomys_townsendii_relictus'/>
+        <taxon idref='Thomomys_townsendii_townsendii'/>
+        <taxon idref='Thomomys_umbrinus_atroavarius'/>
+        <taxon idref='Thomomys_umbrinus_chihuahuae'/>
+    </taxonset>
+
+    <taxonset spec='TaxonSet' id='taxonsuperset'>
+        <taxon spec='TaxonSet' id='Orthogeomys_heterodus_species'>
+            <taxon spec='Taxon' id='Orthogeomys_heterodus'/>
+        </taxon>
+        <taxon spec='TaxonSet' id='Thomomys_bottae'>
+            <taxon spec='Taxon' id='Thomomys_bottae_awahnee_a'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_awahnee_b'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_xerophilus'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_cactophilus'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_albatus'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_ruidosae'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_bottae'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_alpinus'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_riparius'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_mewa'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_saxatilis'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_laticeps'/>
+        </taxon>
+        <taxon spec='TaxonSet' id='Thomomys_idahoensis'>
+            <taxon spec='Taxon' id='Thomomys_idahoensis_pygmaeus_a'/>
+            <taxon spec='Taxon' id='Thomomys_idahoensis_pygmaeus_b'/>
+        </taxon>
+        <taxon spec='TaxonSet' id='Thomomys_mazama'>
+            <taxon spec='Taxon' id='Thomomys_mazama_mazama'/>
+            <taxon spec='Taxon' id='Thomomys_mazama_nasicus'/>
+        </taxon>
+        <taxon spec='TaxonSet' id='Thomomys_monticola'>
+            <taxon spec='Taxon' id='Thomomys_monticola_a'/>
+            <taxon spec='Taxon' id='Thomomys_monticola_b'/>
+        </taxon>
+        <taxon spec='TaxonSet' id='Thomomys_talpoides'>
+            <taxon spec='Taxon' id='Thomomys_talpoides_yakimensis'/>
+            <taxon spec='Taxon' id='Thomomys_talpoides_bridgeri'/>
+            <taxon spec='Taxon' id='Thomomys_talpoides_ocius'/>
+        </taxon>
+        <taxon spec='TaxonSet' id='Thomomys_townsendii'>
+            <taxon spec='Taxon' id='Thomomys_townsendii_townsendii'/>
+            <taxon spec='Taxon' id='Thomomys_townsendii_relictus'/>
+        </taxon>
+        <taxon spec='TaxonSet' id='Thomomys_umbrinus'>
+            <taxon spec='Taxon' id='Thomomys_umbrinus_chihuahuae'/>
+            <taxon spec='Taxon' id='Thomomys_umbrinus_atroavarius'/>
+        </taxon>
+    </taxonset>
+
+    <distribution id="posterior" spec="util.CompoundDistribution">
+        <distribution id="prior" spec="util.CompoundDistribution">
+
+            <distribution id="speciesCoalescent" spec="util.CompoundDistribution">
+                <!-- gene tree priors -->
+                <distribution id="genetree.priors" spec="util.CompoundDistribution">
+                    <distribution id='tree.prior.29' spec='GeneTreeForSpeciesTreeDistribution' tree='@tree29'
+                                  speciesTree='@speciesTree'
+                                  speciesTreePrior='@SpeciesTreePopSizePrior'/>
+                    <distribution id='tree.prior.26' spec='GeneTreeForSpeciesTreeDistribution' tree='@tree26'
+                                  speciesTree='@speciesTree'
+                                  speciesTreePrior='@SpeciesTreePopSizePrior'/>
+                </distribution>
+
+                <!-- species tree priors -->
+                <distribution id='SpeciesTreePopSizePrior' spec='SpeciesTreePrior' tree='@speciesTree'
+                              popFunction='constant'
+                              taxonset='@taxonsuperset'>
+                    <bottomPopSize spec='parameter.RealParameter' id='popSize' value='1'/>
+                    <parameter name='gammaParameter' id='popMean' value='0.004'/>
+                </distribution>
+            </distribution>
+
+            <distribution id="SpeciesTreeDivergenceTimesPrior" spec="speciation.YuleModel" tree='@speciesTree'>
+                <birthDiffRate spec='parameter.RealParameter' id="birthRate" value='213.2021' lower='0' upper='10000'/>
+            </distribution>
+
+            <!-- hyper priors for assorted parameters -->
+            <distribution id='birthRatePrior' spec='distributions.Prior' x='@birthRate'>
+                <distr id='OneOnX' spec='distributions.OneOnX'/>
+            </distribution>
+
+            <distribution id="popMean.prior26" spec="beast.math.distributions.Prior" x="@popMean" distr='@OneOnX'/>
+
+            <distribution id="kappa.prior26" spec="beast.math.distributions.Prior" x="@hky.kappa26">
+                <distr id='logNormal' spec='beast.math.distributions.LogNormalDistributionModel' M="1.0" S="1.25"
+                       offset="0.0"
+                       meanInRealSpace="false"/>
+            </distribution>
+
+            <distribution id="kappa.prior29" spec="beast.math.distributions.Prior" x="@hky.kappa29" distr='@logNormal'/>
+
+        </distribution>
+        <distribution id="likelihood" spec="util.CompoundDistribution">
+            <distribution data="@26" id="treelikelihood.26" spec="TreeLikelihood" tree="@tree26" useAmbiguities="false">
+                <siteModel gammaCategoryCount="1" id="siteModel26" mutationRate="@mutationRate"
+                           proportionInvariant="@proportionInvariant"
+                           shape="@gammaShape" spec="SiteModel">
+                    <substModel id="hky26" kappa="@hky.kappa26" spec="HKY">
+                        <frequencies id="freqs26" spec="Frequencies" estimate='true' data='@26'/>
+                    </substModel>
+                </siteModel>
+                <branchRateModel clock.rate="@clockRate" id="StrictClockModel26"
+                                 spec="beast.evolution.branchratemodel.StrictClockModel"/>
+            </distribution>
+            <distribution data="@29" id="treelikelihood.29" spec="TreeLikelihood" tree="@tree29" useAmbiguities="false">
+                <siteModel gammaCategoryCount="1" id="siteModel29" mutationRate="@mutationRate"
+                           proportionInvariant="@proportionInvariant"
+                           shape="@gammaShape" spec="SiteModel">
+                    <substModel id="hky29" kappa="@hky.kappa29" spec="HKY">
+                        <frequencies id="freqs29" spec="Frequencies" estimate='true' data='@29'/>
+                    </substModel>
+                </siteModel>
+                <branchRateModel clock.rate="@clockRate" id="StrictClockModel29"
+                                 spec="beast.evolution.branchratemodel.StrictClockModel"/>
+            </distribution>
+        </distribution>
+    </distribution>
+
+    <tree spec='RandomTree' id='randomSpeciesTree' initial='@speciesTree' taxonset='@taxonsuperset'>
+        <populationModel spec='ConstantPopulation'>
+            <popSize spec='parameter.RealParameter' value='1'/>
+        </populationModel>
+    </tree>
+
+
+    <tree spec='beast.util.TreeParser' id='newickSpeciesTree' IsLabelledNewick='true'
+          newick='(Orthogeomys_heterodus_species:0.02065265792151943,(((Thomomys_talpoides:0.0013609706233106656,Thomomys_mazama:0.0013609706233106656):6.032405317365711E-4,(Thomomys_idahoensis:0.0019116640088644983,Thomomys_monticola:0.0019116640088644983):5.254714618273845E-5):0.01135560317788915,(Thomomys_umbrinus:0.001060205025110908,(Thomomys_townsendii:2.1835631905959876E-4,Thomomys_bottae:2.1835631905959876E-4):8.418487060513092E-4):0.01225960930782548):0.007332843588583044);'
+          initial='@speciesTree' threshold='1e-12' taxonset='@taxonsuperset'/>
+
+
+    <tree spec='beast.util.TreeParser' id='newickGeneTree1' IsLabelledNewick='true' 
+          newick='((((Thomomys_idahoensis_pygmaeus_a:4.790629004925939E-4,Thomomys_idahoensis_pygmaeus_b:4.790629004925939E-4):0.002807766516703272,(Thomomys_monticola_a:3.1053813362974055E-5,Thomomys_monticola_b:3.1053813362974055E-5):0.0032557756038328915):1.3936218139959985E-4,((Thomomys_talpoides_yakimensis:0.001392151582227928,(Thomomys_talpoides_bridgeri:4.271344427331326E-4,Thomomys_talpoides_ocius:4.271344427331326E-4):9.650171394947955E-4):2.3416363608392133E-4,(Thomomys_mazama_ [...]
+          initial='@tree26' taxonset='@lineagetaxa' threshold='1e-12'/>
+
+    <tree spec='beast.util.TreeParser' id='newickGeneTree2' IsLabelledNewick='true' 
+          newick='(Orthogeomys_heterodus:0.02555754747205849,((Thomomys_mazama_nasicus:0.001146519512253189,Thomomys_mazama_mazama:0.001146519512253189):0.01169723135080885,((Thomomys_talpoides_ocius:0.00703974619989265,(((Thomomys_talpoides_yakimensis:0.0014682135377831343,(Thomomys_monticola_a:3.1427207759506006E-5,Thomomys_monticola_b:3.1427207759506006E-5):0.0014367863300236282):3.5111237723683074E-4,(Thomomys_idahoensis_pygmaeus_a:2.52563963076903E-4,Thomomys_idahoensis_pygmaeus_b:2 [...]
+          initial='@tree29' taxonset='@lineagetaxa' threshold='1e-12'/>
+
+    <tree spec='RandomGeneTree' id='randomGeneTree1' initial='@tree26' speciesTree='@speciesTree' taxa='@26'>
+        <populationModel spec='ConstantPopulation'>
+            <popSize spec='parameter.RealParameter' value='1'/>
+        </populationModel>
+    </tree>
+
+    <tree spec='RandomGeneTree' id='randomGeneTree2' initial='@tree29' speciesTree='@speciesTree' taxa='@29'>
+        <populationModel spec='ConstantPopulation'>
+            <popSize spec='parameter.RealParameter' value='1'/>
+        </populationModel>
+    </tree>
+
+    <run chainLength="10000000" id="mcmc" preBurnin="0" spec="MCMC">
+        <!--init idref='randomSpeciesTree'/ -->
+        <init idref='newickSpeciesTree'/>
+        <!--init idref='newickGeneTree1'/> <init idref='newickGeneTree2'/ -->
+
+        <init idref='randomGeneTree1'/>
+        <init idref='randomGeneTree2'/>
+
+
+        <distribution idref="posterior"/>
+
+        <state id="State0" storeEvery="100000">
+            <!--parameter dimension="1" estimate="false" id="popSize" name="stateNode" value="1.0"/ -->
+            <parameter dimension="1" estimate="false" id="mutationRate" name="stateNode" value="1.0"/>
+            <parameter dimension="1" estimate="false" id="clockRate" name="stateNode" value="1.0"/>
+            <parameter dimension="1" estimate="true" id="hky.kappa26" lower="0.0" name="stateNode" value="1.0"/>
+            <parameter dimension="1" estimate="true" id="hky.kappa29" lower="0.0" name="stateNode" value="1.0"/>
+
+            <stateNode idref='popSize'/>
+            <stateNode idref='popMean'/>
+
+            <tree estimate="true" id="tree26" name="stateNode"/>
+            <tree estimate="true" id="tree29" name="stateNode"/>
+            <tree estimate="true" id="speciesTree" name="stateNode"/>
+
+            <stateNode idref="birthRate"/>
+            <!--stateNode idref="relativeDeathRate"/ -->
+            <parameter dimension="1" estimate="false" id="gammaShape" name="stateNode" value="1.0"/>
+            <parameter dimension="1" estimate="false" id="proportionInvariant" lower="0.0" name="stateNode" upper="1.0"
+                       value="0.0"/>
+        </state>
+
+
+
+        <operator degreesOfFreedom="5" id="popSizeScaler" scaleAll="false" scaleAllIndependently="false"
+                  scaleFactor="0.9"
+                  spec="ScaleOperator" parameter="@popSize" weight="5.0"/>
+        <operator degreesOfFreedom="3" id="birthRateScaler" scaleFactor="0.75" spec="ScaleOperator"
+                  parameter="@birthRate"
+                  weight="3"/>
+        <!--operator degreesOfFreedom="1" id="relDeathRateScaler" scaleFactor="0.5" spec="ScaleOperator" parameter="@relativeDeathRate"
+              weight="1.0"/ -->
+        <operator degreesOfFreedom="1" id="psiScaler" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.5"
+                  spec="ScaleOperator" parameter="@popMean" weight="94"/>
+        <operator degreesOfFreedom="1" id="kappa26Scaler" scaleAll="false" scaleAllIndependently="false"
+                  scaleFactor="0.75"
+                  spec="ScaleOperator" parameter="@hky.kappa26" weight="0.1"/>
+        <operator degreesOfFreedom="1" id="kappa29Scaler" scaleAll="false" scaleAllIndependently="false"
+                  scaleFactor="0.75"
+                  spec="ScaleOperator" parameter="@hky.kappa29" weight="0.1"/>
+
+        <operator degreesOfFreedom="3" id="treeScaler26" scaleFactor="0.75" spec="ScaleOperator" tree="@tree26"  weight="3"/>
+        <operator gaussian="true" id="SubtreeSlide26" size="0.003" spec="SubtreeSlide" tree="@tree26" weight="15.0"/>
+        <operator id="wide26" isNarrow="false" spec="Exchange" tree="@tree26" weight="1.0"/>
+        <operator id="narrow26" isNarrow="true" spec="Exchange" tree="@tree26" weight="15"/>
+        <operator id="WilsonBalding26" spec="WilsonBalding" tree="@tree26" weight="3"/>
+        <!-- -->
+        <operator id="Uniform26" spec="Uniform" tree="@tree26" weight="30.0"/>
+
+        <operator degreesOfFreedom="3" id="treeScaler29" scaleFactor="0.75" spec="ScaleOperator" tree="@tree29"  weight="3"/>
+        <operator gaussian="true" id="SubtreeSlide29" size="0.002" spec="SubtreeSlide" tree="@tree29" weight="15.0"/>
+        <operator id="wide29" isNarrow="false" spec="Exchange" tree="@tree29" weight="1.0"/>
+        <operator id="narrow29" isNarrow="true" spec="Exchange" tree="@tree29" weight="15"/>
+        <operator id="WilsonBalding29" spec="WilsonBalding" tree="@tree29" weight="3"/>
+        <!-- -->
+        <operator id="Uniform29" spec="Uniform" tree="@tree29" weight="30.0"/>
+
+        <operator spec='UpDownOperator' scaleFactor="0.75" weight="30">
+            <up idref="birthRate"/>
+            <down idref="popSize"/>
+            <down idref="popMean"/>
+            <down idref="speciesTree"/>
+            <down idref="tree26"/>
+            <down idref="tree29"/>
+        </operator>
+
+
+        <!-- <operator id="wideSP" isNarrow="false" spec="Exchange" tree="@speciesTree" weight="1.0"/> <operator gaussian="true"
+              id="SubtreeSlideSP" size="0.003" spec="SubtreeSlide" tree="@speciesTree" weight="15.0"/> <operator degreesOfFreedom="1" id="treeScalerSP"
+              scaleAll="false" scaleAllIndependently="false" scaleFactor="0.85" spec="ScaleOperator" tree="@speciesTree" weight="6.0"/>
+              <operator id="UniformSP" spec="Uniform" tree="@speciesTree" weight="30.0"/> -->
+
+        <operator id="Reheight" spec="NodeReheight" tree="@speciesTree" weight="94" taxonset='@taxonsuperset'>
+            <genetree idref='tree26'/>
+            <genetree idref='tree29'/>
+        </operator>
+
+        <logger fileName="test.$(seed).log" id="Logger0" logEvery="1000" mode="autodetect" model="@posterior">
+            <log idref="posterior"/>
+            <log idref="prior"/>
+            <log idref="speciesCoalescent"/>
+            <log idref="genetree.priors"/>
+            <log idref="SpeciesTreePopSizePrior"/>
+            <log idref="tree.prior.26"/>
+            <log idref="tree.prior.29"/>
+            <log idref="SpeciesTreeDivergenceTimesPrior"/>
+            <log idref="likelihood"/>
+            <log idref="popMean"/>
+            <log idref="birthRate"/>
+            <!--log idref="relativeDeathRate"/ -->
+            <log idref="hky.kappa26"/>
+            <log idref="hky.kappa29"/>
+            <log idref="popSize"/>
+            <log id="TreeHeightSP" spec="beast.evolution.tree.TreeHeightLogger" tree="@speciesTree"/>
+            <log id="TreeHeight26" spec="beast.evolution.tree.TreeHeightLogger" tree="@tree26"/>
+            <log id="TreeHeight29" spec="beast.evolution.tree.TreeHeightLogger" tree="@tree29"/>
+            <log idref="treelikelihood.26"/>
+            <log idref="treelikelihood.29"/>
+        </logger>
+
+        <logger fileName="test.$(seed).sp.trees" id="Logger4" logEvery="1000" mode="tree">
+            <log spec='SpeciesTreeLogger' popSize='@popSize' tree="@speciesTree">
+                <treetop spec='TreeTopFinder' id='treeTopFinder'>
+                    <tree idref='tree26'/>
+                    <tree idref='tree29'/>
+                </treetop>
+            </log>
+        </logger>
+
+        <logger fileName="test.$(seed).26.trees" id="Logger2" logEvery="1000" mode="autodetect">
+            <log idref="tree26"/>
+        </logger>
+
+        <logger fileName="test.$(seed).29.trees" id="Logger3" logEvery="1000" mode="autodetect">
+            <log idref="tree29"/>
+        </logger>
+
+        <logger id="Logger1" logEvery="100000" mode="autodetect">
+            <log idref="posterior"/>
+            <log spec='ESS' arg='@posterior'/>
+            <log idref="prior"/>
+            <log spec='ESS' arg='@prior'/>
+        </logger>
+
+    </run>
+
+
+</beast>
diff --git a/examples/beast2vs1/testStarBEASTLinear.xml b/examples/beast2vs1/testStarBEASTLinear.xml
new file mode 100644
index 0000000..401f0ee
--- /dev/null
+++ b/examples/beast2vs1/testStarBEASTLinear.xml
@@ -0,0 +1,491 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<beast
+        namespace="beast.evolution.operators:beast.evolution.speciation:beast.evolution.alignment:beast.core:beast.math:beast.evolution:beast.evolution.tree:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood"
+        version="2.0">
+
+
+    <data dataType="nucleotide" id="26" name="taxa">
+        <sequence taxon="Orthogeomys_heterodus">
+            ATTCTAGGCAAAAAG-AGCAATGCTGGAGGTATTACAATACCAGACTTCAAACTTTACTATAGAGCCATAATAACAAAAACCGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAATGGAAYAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGTCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCACCATGCACAGGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCAGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGGGAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATAGGAGAAAGACTCAATAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_albatus">
+            ????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGATCCAGAAATAGAACCAC-ATACCTATAGTCAACTTGTATTTGATAAAGGAGCTAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCATTTCACCATGCACAAGAATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCT-------------------------------------CATAGGCACTCATAGGCACAGGCAAAAGATTCCTATACAGGAACCCAGGGTCAACAACAGATTGGAGAGAGACTCAATAAATGGGACTACCTAAAAATAAAA-G [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_alpinus">
+            ????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCTATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCA???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_awahnee_a">
+            ????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACMCAGTCTATTCAATTATTGGKGCTGGCAAAACTGGGCAGCCMCATGCARAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAA??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_awahnee_b">
+            ????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCM-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_bottae">
+            ????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAAATTCCTGAACAGAATCCCAGGGTCA-CAACAGATKGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_cactophilus">
+            ????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAAYGTCAGACCGGAAACCGTGAAAYTGTTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAA?????????????????????????????????????????????????????????????????????????????? [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_laticeps">
+            ????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAATTGCTACATGATAAWGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCAATAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_mewa">
+            ????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCATTTCACCATGCACAAGAATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAA????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_riparius">
+            ????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_ruidosae">
+            ????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCARAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAAYTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAG???????????????????????????????????????????????????????????????????????????? [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_saxatilis">
+            ????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAA??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_xerophilus">
+            ????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAAYTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAA??????????????????????????????????????????????????????????????????? [...]
+        </sequence>
+        <sequence taxon="Thomomys_idahoensis_pygmaeus_a">
+            ????????CAAAA-G-AGCAATGCTGGTGGTATYACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATMCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCRACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_idahoensis_pygmaeus_b">
+            ????GGCGCAAAA-G-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATMCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_mazama_mazama">
+            ATTCTAGGCAAAAAGAAGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAAYTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_mazama_nasicus">
+            ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCSCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAAYTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_monticola_a">
+            ??????????????G-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGYCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_monticola_b">
+            ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATYACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAWATAGAACCAC-ACAACTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAATGGAACRAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_talpoides_bridgeri">
+            ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATCCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCRACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_talpoides_ocius">
+            ???CTAGGCAAAA-G-AGC-ATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATMCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCRACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_talpoides_yakimensis">
+            ATTCTAGGCAAAA-G-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTKTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAAYGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAAYTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_townsendii_relictus">
+            ??????????????G-AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTAYTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCACTATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAATGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAATTGCTACATGATAAWGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAATG [...]
+        </sequence>
+        <sequence taxon="Thomomys_townsendii_townsendii">
+            ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTYGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_umbrinus_atroavarius">
+            ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGCATTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGKCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGYCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAAYGTCAGACCGGAAACCGTGAAATTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_umbrinus_chihuahuae">
+            ?????????????AG-AGC-ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCTTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+    </data>
+
+    <data dataType="nucleotide" id="29" name="taxa">
+
+        <sequence taxon="Orthogeomys_heterodus">
+            C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCACAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCGTTTCTGGAAAACTGAGATCTTGTTTTGACCAACAGAAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTACTGGTGATGTCTCTGTCAGGATCTAGTCCCATCCTG-AATCCATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTCAGAACTGACTGAATCAGGCCAGTGAAAGTTA-CAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATTGTGCATGGCTTCATTAGCAGGTTTACTGTGCTGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_albatus">
+            C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_alpinus">
+            C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCC-AGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGTTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCYACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_awahnee_a">
+            C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_awahnee_b">
+            C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_bottae">
+            C-AGCTTGCTG-TCACACYGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTAKGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_cactophilus">
+            C-AGCTTGCTG-TCACACTACCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCACTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_laticeps">
+            C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_mewa">
+            C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_riparius">
+            C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_ruidosae">
+            ?????????????????????????????C-AGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_saxatilis">
+            C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_xerophilus">
+            C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCACTAAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTRTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_idahoensis_pygmaeus_a">
+            C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTTTAAGTGTTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGTCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGTCCAGTGAAACTTAACAGCTACCTTGCCAATKGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGG--TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_idahoensis_pygmaeus_b">
+            CAAGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTGTTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGTCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGG--TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_mazama_mazama">
+            C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTATTGCCTGGATATAGTGTCTATAGACAGAGACAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCACATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCACCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCTGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_mazama_nasicus">
+            C-AGCTTGCTG-TCACAATGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTATTGCCTGGATATAGTGTCTATAGACAGAGACAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCACATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCTGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_monticola_a">
+            C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGACGCCKTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_monticola_b">
+            C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGACGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTYCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_talpoides_bridgeri">
+            C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_talpoides_ocius">
+            C-AGCTTGCTGGTCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCATATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAAWGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_talpoides_yakimensis">
+            C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGAMTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_townsendii_relictus">
+            C-AGCTTGCTGGTCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_townsendii_townsendii">
+            C-AGCTTGCTGGTCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_umbrinus_atroavarius">
+            C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_umbrinus_chihuahuae">
+            C-AGCTTGCTGGTCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAAGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTGGAATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+    </data>
+
+    <taxonset spec='TaxonSet' id='lineagetaxa'>
+        <taxon idref='Orthogeomys_heterodus'/>
+        <taxon idref='Thomomys_bottae_albatus'/>
+        <taxon idref='Thomomys_bottae_alpinus'/>
+        <taxon idref='Thomomys_bottae_awahnee_a'/>
+        <taxon idref='Thomomys_bottae_awahnee_b'/>
+        <taxon idref='Thomomys_bottae_bottae'/>
+        <taxon idref='Thomomys_bottae_cactophilus'/>
+        <taxon idref='Thomomys_bottae_laticeps'/>
+        <taxon idref='Thomomys_bottae_mewa'/>
+        <taxon idref='Thomomys_bottae_riparius'/>
+        <taxon idref='Thomomys_bottae_ruidosae'/>
+        <taxon idref='Thomomys_bottae_saxatilis'/>
+        <taxon idref='Thomomys_bottae_xerophilus'/>
+        <taxon idref='Thomomys_idahoensis_pygmaeus_a'/>
+        <taxon idref='Thomomys_idahoensis_pygmaeus_b'/>
+        <taxon idref='Thomomys_mazama_mazama'/>
+        <taxon idref='Thomomys_mazama_nasicus'/>
+        <taxon idref='Thomomys_monticola_a'/>
+        <taxon idref='Thomomys_monticola_b'/>
+        <taxon idref='Thomomys_talpoides_bridgeri'/>
+        <taxon idref='Thomomys_talpoides_ocius'/>
+        <taxon idref='Thomomys_talpoides_yakimensis'/>
+        <taxon idref='Thomomys_townsendii_relictus'/>
+        <taxon idref='Thomomys_townsendii_townsendii'/>
+        <taxon idref='Thomomys_umbrinus_atroavarius'/>
+        <taxon idref='Thomomys_umbrinus_chihuahuae'/>
+    </taxonset>
+
+    <taxonset spec='TaxonSet' id='taxonsuperset'>
+        <taxon spec='TaxonSet' id='Orthogeomys_heterodus_species'>
+            <taxon spec='Taxon' id='Orthogeomys_heterodus'/>
+        </taxon>
+        <taxon spec='TaxonSet' id='Thomomys_bottae'>
+            <taxon spec='Taxon' id='Thomomys_bottae_awahnee_a'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_awahnee_b'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_xerophilus'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_cactophilus'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_albatus'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_ruidosae'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_bottae'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_alpinus'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_riparius'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_mewa'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_saxatilis'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_laticeps'/>
+        </taxon>
+        <taxon spec='TaxonSet' id='Thomomys_idahoensis'>
+            <taxon spec='Taxon' id='Thomomys_idahoensis_pygmaeus_a'/>
+            <taxon spec='Taxon' id='Thomomys_idahoensis_pygmaeus_b'/>
+        </taxon>
+        <taxon spec='TaxonSet' id='Thomomys_mazama'>
+            <taxon spec='Taxon' id='Thomomys_mazama_mazama'/>
+            <taxon spec='Taxon' id='Thomomys_mazama_nasicus'/>
+        </taxon>
+        <taxon spec='TaxonSet' id='Thomomys_monticola'>
+            <taxon spec='Taxon' id='Thomomys_monticola_a'/>
+            <taxon spec='Taxon' id='Thomomys_monticola_b'/>
+        </taxon>
+        <taxon spec='TaxonSet' id='Thomomys_talpoides'>
+            <taxon spec='Taxon' id='Thomomys_talpoides_yakimensis'/>
+            <taxon spec='Taxon' id='Thomomys_talpoides_bridgeri'/>
+            <taxon spec='Taxon' id='Thomomys_talpoides_ocius'/>
+        </taxon>
+        <taxon spec='TaxonSet' id='Thomomys_townsendii'>
+            <taxon spec='Taxon' id='Thomomys_townsendii_townsendii'/>
+            <taxon spec='Taxon' id='Thomomys_townsendii_relictus'/>
+        </taxon>
+        <taxon spec='TaxonSet' id='Thomomys_umbrinus'>
+            <taxon spec='Taxon' id='Thomomys_umbrinus_chihuahuae'/>
+            <taxon spec='Taxon' id='Thomomys_umbrinus_atroavarius'/>
+        </taxon>
+    </taxonset>
+
+    <distribution id="posterior" spec="util.CompoundDistribution">
+        <distribution id="prior" spec="util.CompoundDistribution">
+
+            <distribution id="speciesCoalescent" spec="util.CompoundDistribution">
+                <!-- gene tree priors -->
+                <distribution id="genetree.priors" spec="util.CompoundDistribution">
+                    <distribution id='tree.prior.29' spec='GeneTreeForSpeciesTreeDistribution' tree='@tree29'
+                                  speciesTree='@speciesTree'
+                                  speciesTreePrior='@SpeciesTreePopSizePrior'>
+                        <treetop spec='TreeTopFinder' id='treeTopFinder'>
+                            <tree idref='tree29'/>
+                            <tree idref='tree26'/>
+                        </treetop>
+                    </distribution>
+                    <distribution id='tree.prior.26' spec='GeneTreeForSpeciesTreeDistribution' tree='@tree26'
+                                  speciesTree='@speciesTree'
+                                  speciesTreePrior='@SpeciesTreePopSizePrior' treetop='@treeTopFinder'/>
+                </distribution>
+
+                <!-- species tree priors -->
+                <distribution id='SpeciesTreePopSizePrior' spec='SpeciesTreePrior' tree='@speciesTree'
+                              popFunction='linear'
+                              taxonset='@taxonsuperset'>
+                    <bottomPopSize spec='parameter.RealParameter' id='popSize' value='1'/>
+                    <topPopSize spec='parameter.RealParameter' id='popSizeTop' value='1'/>
+                    <parameter name='gammaParameter' id='popMean' value='0.004'/>
+                </distribution>
+            </distribution>
+
+            <distribution id="SpeciesTreeDivergenceTimesPrior" spec="speciation.YuleModel" tree='@speciesTree'>
+                <birthDiffRate spec='parameter.RealParameter' id="birthRate" value='213.2021' lower='0' upper='10000'/>
+            </distribution>
+
+            <!-- hyper priors for assorted parameters -->
+            <distribution id='birthRatePrior' spec='distributions.Prior' x='@birthRate'>
+                <distr id='OneOnX' spec='distributions.OneOnX'/>
+            </distribution>
+
+            <distribution id="popMean.prior26" spec="beast.math.distributions.Prior" x="@popMean" distr='@OneOnX'/>
+
+            <distribution id="kappa.prior26" spec="beast.math.distributions.Prior" x="@hky.kappa26">
+                <distr id='logNormal' spec='beast.math.distributions.LogNormalDistributionModel' M="1.0" S="1.25"
+                       offset="0.0"
+                       meanInRealSpace="false"/>
+            </distribution>
+
+            <distribution id="kappa.prior29" spec="beast.math.distributions.Prior" x="@hky.kappa29" distr='@logNormal'/>
+
+        </distribution>
+        <distribution id="likelihood" spec="util.CompoundDistribution">
+            <distribution data="@26" id="treelikelihood.26" spec="TreeLikelihood" tree="@tree26" useAmbiguities="false">
+                <siteModel gammaCategoryCount="1" id="siteModel26" mutationRate="@mutationRate"
+                           proportionInvariant="@proportionInvariant"
+                           shape="@gammaShape" spec="SiteModel">
+                    <substModel id="hky26" kappa="@hky.kappa26" spec="HKY">
+                        <frequencies id="freqs26" spec="Frequencies" estimate='true' data='@26'/>
+                    </substModel>
+                </siteModel>
+                <branchRateModel clock.rate="@clockRate" id="StrictClockModel26"
+                                 spec="beast.evolution.branchratemodel.StrictClockModel"/>
+            </distribution>
+            <distribution data="@29" id="treelikelihood.29" spec="TreeLikelihood" tree="@tree29" useAmbiguities="false">
+                <siteModel gammaCategoryCount="1" id="siteModel29" mutationRate="@mutationRate"
+                           proportionInvariant="@proportionInvariant"
+                           shape="@gammaShape" spec="SiteModel">
+                    <substModel id="hky29" kappa="@hky.kappa29" spec="HKY">
+                        <frequencies id="freqs29" spec="Frequencies" estimate='true' data='@29'/>
+                    </substModel>
+                </siteModel>
+                <branchRateModel clock.rate="@clockRate" id="StrictClockModel29"
+                                 spec="beast.evolution.branchratemodel.StrictClockModel"/>
+            </distribution>
+        </distribution>
+    </distribution>
+
+    <tree spec='RandomTree' id='randomSpeciesTree' initial='@speciesTree' taxonset='@taxonsuperset'>
+        <populationModel spec='ConstantPopulation'>
+            <popSize spec='parameter.RealParameter' value='1'/>
+        </populationModel>
+    </tree>
+
+
+    <tree spec='beast.util.TreeParser' id='newickSpeciesTree' IsLabelledNewick='true' 
+          newick='(Orthogeomys_heterodus_species:0.02065265792151943,(((Thomomys_talpoides:0.0013609706233106656,Thomomys_mazama:0.0013609706233106656):6.032405317365711E-4,(Thomomys_idahoensis:0.0019116640088644983,Thomomys_monticola:0.0019116640088644983):5.254714618273845E-5):0.01135560317788915,(Thomomys_umbrinus:0.001060205025110908,(Thomomys_townsendii:2.1835631905959876E-4,Thomomys_bottae:2.1835631905959876E-4):8.418487060513092E-4):0.01225960930782548):0.007332843588583044);'
+          initial='@speciesTree' threshold='1e-12' taxonset='@taxonsuperset'/>
+
+
+    <tree spec='beast.util.TreeParser' id='newickGeneTree1' IsLabelledNewick='true' 
+          newick='((((Thomomys_idahoensis_pygmaeus_a:4.790629004925939E-4,Thomomys_idahoensis_pygmaeus_b:4.790629004925939E-4):0.002807766516703272,(Thomomys_monticola_a:3.1053813362974055E-5,Thomomys_monticola_b:3.1053813362974055E-5):0.0032557756038328915):1.3936218139959985E-4,((Thomomys_talpoides_yakimensis:0.001392151582227928,(Thomomys_talpoides_bridgeri:4.271344427331326E-4,Thomomys_talpoides_ocius:4.271344427331326E-4):9.650171394947955E-4):2.3416363608392133E-4,(Thomomys_mazama_ [...]
+          initial='@tree26' taxonset='@lineagetaxa' threshold='1e-12'/>
+
+    <tree spec='beast.util.TreeParser' id='newickGeneTree2' IsLabelledNewick='true' 
+          newick='(Orthogeomys_heterodus:0.02555754747205849,((Thomomys_mazama_nasicus:0.001146519512253189,Thomomys_mazama_mazama:0.001146519512253189):0.01169723135080885,((Thomomys_talpoides_ocius:0.00703974619989265,(((Thomomys_talpoides_yakimensis:0.0014682135377831343,(Thomomys_monticola_a:3.1427207759506006E-5,Thomomys_monticola_b:3.1427207759506006E-5):0.0014367863300236282):3.5111237723683074E-4,(Thomomys_idahoensis_pygmaeus_a:2.52563963076903E-4,Thomomys_idahoensis_pygmaeus_b:2 [...]
+          initial='@tree29' taxonset='@lineagetaxa' threshold='1e-12'/>
+
+    <tree spec='RandomGeneTree' id='randomGeneTree1' initial='@tree26' speciesTree='@speciesTree' taxa='@26'>
+        <populationModel spec='ConstantPopulation'>
+            <popSize spec='parameter.RealParameter' value='1'/>
+        </populationModel>
+    </tree>
+
+    <tree spec='RandomGeneTree' id='randomGeneTree2' initial='@tree29' speciesTree='@speciesTree' taxa='@29'>
+        <populationModel spec='ConstantPopulation'>
+            <popSize spec='parameter.RealParameter' value='1'/>
+        </populationModel>
+    </tree>
+
+    <run chainLength="10000000" id="mcmc" preBurnin="0" spec="MCMC">
+        <!--init idref='randomSpeciesTree'/ -->
+        <init idref='newickSpeciesTree'/>
+        <!--init idref='newickGeneTree1'/> <init idref='newickGeneTree2'/ -->
+
+        <init idref='randomGeneTree1'/>
+        <init idref='randomGeneTree2'/>
+
+
+        <distribution idref="posterior"/>
+
+        <state id="State0" storeEvery="100000">
+            <!--parameter dimension="1" estimate="false" id="popSize" name="stateNode" value="1.0"/ -->
+            <parameter dimension="1" estimate="false" id="mutationRate" name="stateNode" value="1.0"/>
+            <parameter dimension="1" estimate="false" id="clockRate" name="stateNode" value="1.0"/>
+            <parameter dimension="1" estimate="true" id="hky.kappa26" lower="0.0" name="stateNode" value="1.0"/>
+            <parameter dimension="1" estimate="true" id="hky.kappa29" lower="0.0" name="stateNode" value="1.0"/>
+
+            <stateNode idref='popSize'/>
+            <stateNode idref='popSizeTop'/>
+            <stateNode idref='popMean'/>
+
+            <tree estimate="true" id="tree26" name="stateNode"/>
+            <tree estimate="true" id="tree29" name="stateNode"/>
+            <tree estimate="true" id="speciesTree" name="stateNode"/>
+
+            <stateNode idref="birthRate"/>
+            <!--stateNode idref="relativeDeathRate"/ -->
+            <parameter dimension="1" estimate="false" id="gammaShape" name="stateNode" value="1.0"/>
+            <parameter dimension="1" estimate="false" id="proportionInvariant" lower="0.0" name="stateNode" upper="1.0"
+                       value="0.0"/>
+        </state>
+
+        <operator degreesOfFreedom="1" id="popSizeScaler" scaleAll="false" scaleAllIndependently="false"
+                  scaleFactor="0.5"
+                  spec="ScaleOperator" parameter="@popSize" weight="5.0"/>
+        <operator degreesOfFreedom="1" id="popSizeTopScaler" scaleAll="false" scaleAllIndependently="false"
+                  scaleFactor="0.5" spec="ScaleOperator" parameter="@popSizeTop" weight="5.0"/>
+        <operator degreesOfFreedom="1" id="birthRateScaler" scaleFactor="0.5" spec="ScaleOperator"
+                  parameter="@birthRate"
+                  weight="3"/>
+        <!--operator degreesOfFreedom="1" id="relDeathRateScaler" scaleFactor="0.5" spec="ScaleOperator" parameter="@relativeDeathRate"
+              weight="1.0"/ -->
+        <operator degreesOfFreedom="1" id="psiScaler" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.5"
+                  spec="ScaleOperator" parameter="@popMean" weight="94"/>
+        <operator degreesOfFreedom="1" id="kappa26Scaler" scaleAll="false" scaleAllIndependently="false"
+                  scaleFactor="0.35"
+                  spec="ScaleOperator" parameter="@hky.kappa26" weight="0.1"/>
+        <operator degreesOfFreedom="1" id="kappa29Scaler" scaleAll="false" scaleAllIndependently="false"
+                  scaleFactor="0.35"
+                  spec="ScaleOperator" parameter="@hky.kappa29" weight="0.1"/>
+
+        <operator gaussian="true" id="SubtreeSlide26" size="0.003" spec="SubtreeSlide" tree="@tree26" weight="15.0"/>
+        <operator degreesOfFreedom="1" id="treeScaler26" scaleAll="false" scaleAllIndependently="false"
+                  scaleFactor="0.85"
+                  spec="ScaleOperator" tree="@tree26" weight="6.0"/>
+        <operator id="wide26" isNarrow="false" spec="Exchange" tree="@tree26" weight="1.0"/>
+        <operator id="narrow26" isNarrow="true" spec="Exchange" tree="@tree26" weight="15"/>
+        <operator id="WilsonBalding26" spec="WilsonBalding" tree="@tree26" weight="3"/>
+        <!-- -->
+        <operator id="Uniform26" spec="Uniform" tree="@tree26" weight="30.0"/>
+
+        <operator gaussian="true" id="SubtreeSlide29" size="0.002" spec="SubtreeSlide" tree="@tree29" weight="15.0"/>
+        <operator degreesOfFreedom="1" id="treeScaler29" scaleAll="false" scaleAllIndependently="false"
+                  scaleFactor="0.85"
+                  spec="ScaleOperator" tree="@tree29" weight="6.0"/>
+        <operator id="wide29" isNarrow="false" spec="Exchange" tree="@tree29" weight="1.0"/>
+        <operator id="narrow29" isNarrow="true" spec="Exchange" tree="@tree29" weight="15"/>
+        <operator id="WilsonBalding29" spec="WilsonBalding" tree="@tree29" weight="3"/>
+        <!-- -->
+        <operator id="Uniform29" spec="Uniform" tree="@tree29" weight="30.0"/>
+
+        <operator spec='UpDownOperator' scaleFactor="0.75" weight="30">
+            <up idref="birthRate"/>
+            <down idref="popSize"/>
+            <down idref="popSizeTop"/>
+            <down idref="popMean"/>
+            <down idref="speciesTree"/>
+            <down idref="tree26"/>
+            <down idref="tree29"/>
+        </operator>
+
+        <!-- <operator id="wideSP" isNarrow="false" spec="Exchange" tree="@speciesTree" weight="1.0"/> <operator gaussian="true"
+              id="SubtreeSlideSP" size="0.003" spec="SubtreeSlide" tree="@speciesTree" weight="15.0"/> <operator degreesOfFreedom="1" id="treeScalerSP"
+              scaleAll="false" scaleAllIndependently="false" scaleFactor="0.85" spec="ScaleOperator" tree="@speciesTree" weight="6.0"/>
+              <operator id="UniformSP" spec="Uniform" tree="@speciesTree" weight="30.0"/> -->
+
+        <operator id="Reheight" spec="NodeReheight" tree="@speciesTree" weight="94" taxonset='@taxonsuperset'>
+            <genetree idref='tree26'/>
+            <genetree idref='tree29'/>
+        </operator>
+
+        <logger fileName="test.$(seed).log" id="Logger0" logEvery="1000" mode="autodetect" model="@posterior">
+            <log idref="posterior"/>
+            <log idref="prior"/>
+            <log idref="speciesCoalescent"/>
+            <log idref="genetree.priors"/>
+            <log idref="SpeciesTreePopSizePrior"/>
+            <log idref="tree.prior.26"/>
+            <log idref="tree.prior.29"/>
+            <log idref="SpeciesTreeDivergenceTimesPrior"/>
+            <log idref="likelihood"/>
+            <log idref="popMean"/>
+            <log idref="birthRate"/>
+            <!--log idref="relativeDeathRate"/ -->
+            <log idref="hky.kappa26"/>
+            <log idref="hky.kappa29"/>
+            <log idref="popSize"/>
+            <log idref="popSizeTop"/>
+            <log id="TreeHeightSP" spec="beast.evolution.tree.TreeHeightLogger" tree="@speciesTree"/>
+            <log id="TreeHeight26" spec="beast.evolution.tree.TreeHeightLogger" tree="@tree26"/>
+            <log id="TreeHeight29" spec="beast.evolution.tree.TreeHeightLogger" tree="@tree29"/>
+            <log idref="treelikelihood.26"/>
+            <log idref="treelikelihood.29"/>
+        </logger>
+
+        <logger fileName="test.$(seed).sp.trees" id="Logger4" logEvery="1000" mode="tree">
+            <log spec='SpeciesTreeLogger' popSize='@popSize' popSizeTop="@popSizeTop" tree="@speciesTree"
+                 speciesTreePrior='@SpeciesTreePopSizePrior' treetop="@treeTopFinder">
+            </log>
+        </logger>
+
+        <logger fileName="test.$(seed).26.trees" id="Logger2" logEvery="1000" mode="autodetect">
+            <log idref="tree26"/>
+        </logger>
+
+        <logger fileName="test.$(seed).29.trees" id="Logger3" logEvery="1000" mode="autodetect">
+            <log idref="tree29"/>
+        </logger>
+
+        <logger id="Logger1" logEvery="100000" mode="autodetect">
+            <log idref="posterior"/>
+            <log spec='ESS' arg='@posterior'/>
+            <log idref="prior"/>
+            <log spec='ESS' arg='@prior'/>
+        </logger>
+
+    </run>
+
+
+</beast>
diff --git a/examples/beast2vs1/testStarBEASTLinearConstRoot.xml b/examples/beast2vs1/testStarBEASTLinearConstRoot.xml
new file mode 100644
index 0000000..0adcc8b
--- /dev/null
+++ b/examples/beast2vs1/testStarBEASTLinearConstRoot.xml
@@ -0,0 +1,490 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<beast
+        namespace="beast.evolution.operators:beast.evolution.speciation:beast.evolution.alignment:beast.core:beast.math:beast.evolution:beast.evolution.tree:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood"
+        version="2.0">
+
+
+    <data dataType="nucleotide" id="26" name="taxa">
+        <sequence taxon="Orthogeomys_heterodus">
+            ATTCTAGGCAAAAAG-AGCAATGCTGGAGGTATTACAATACCAGACTTCAAACTTTACTATAGAGCCATAATAACAAAAACCGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAATGGAAYAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGTCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCACCATGCACAGGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCAGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGGGAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATAGGAGAAAGACTCAATAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_albatus">
+            ????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGATCCAGAAATAGAACCAC-ATACCTATAGTCAACTTGTATTTGATAAAGGAGCTAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCATTTCACCATGCACAAGAATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCT-------------------------------------CATAGGCACTCATAGGCACAGGCAAAAGATTCCTATACAGGAACCCAGGGTCAACAACAGATTGGAGAGAGACTCAATAAATGGGACTACCTAAAAATAAAA-G [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_alpinus">
+            ????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCTATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCA???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_awahnee_a">
+            ????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACMCAGTCTATTCAATTATTGGKGCTGGCAAAACTGGGCAGCCMCATGCARAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAA??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_awahnee_b">
+            ????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCM-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_bottae">
+            ????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAAATTCCTGAACAGAATCCCAGGGTCA-CAACAGATKGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_cactophilus">
+            ????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAAYGTCAGACCGGAAACCGTGAAAYTGTTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAA?????????????????????????????????????????????????????????????????????????????? [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_laticeps">
+            ????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAATTGCTACATGATAAWGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCAATAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_mewa">
+            ????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCATTTCACCATGCACAAGAATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAA????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_riparius">
+            ????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_ruidosae">
+            ????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCARAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAAYTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAG???????????????????????????????????????????????????????????????????????????? [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_saxatilis">
+            ????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAA??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_xerophilus">
+            ????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAAYTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAA??????????????????????????????????????????????????????????????????? [...]
+        </sequence>
+        <sequence taxon="Thomomys_idahoensis_pygmaeus_a">
+            ????????CAAAA-G-AGCAATGCTGGTGGTATYACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATMCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCRACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_idahoensis_pygmaeus_b">
+            ????GGCGCAAAA-G-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATMCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_mazama_mazama">
+            ATTCTAGGCAAAAAGAAGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAAYTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_mazama_nasicus">
+            ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCSCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAAYTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_monticola_a">
+            ??????????????G-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGYCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_monticola_b">
+            ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATYACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAWATAGAACCAC-ACAACTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAATGGAACRAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_talpoides_bridgeri">
+            ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATCCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCRACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_talpoides_ocius">
+            ???CTAGGCAAAA-G-AGC-ATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATMCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCRACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_talpoides_yakimensis">
+            ATTCTAGGCAAAA-G-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTKTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAAYGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAAYTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_townsendii_relictus">
+            ??????????????G-AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTAYTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCACTATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAATGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAATTGCTACATGATAAWGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAATG [...]
+        </sequence>
+        <sequence taxon="Thomomys_townsendii_townsendii">
+            ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTYGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_umbrinus_atroavarius">
+            ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGCATTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGKCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGYCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAAYGTCAGACCGGAAACCGTGAAATTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+        <sequence taxon="Thomomys_umbrinus_chihuahuae">
+            ?????????????AG-AGC-ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCTTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGACTACCTAAAAATAAAAAG [...]
+        </sequence>
+    </data>
+
+    <data dataType="nucleotide" id="29" name="taxa">
+
+        <sequence taxon="Orthogeomys_heterodus">
+            C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCACAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCGTTTCTGGAAAACTGAGATCTTGTTTTGACCAACAGAAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTACTGGTGATGTCTCTGTCAGGATCTAGTCCCATCCTG-AATCCATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTCAGAACTGACTGAATCAGGCCAGTGAAAGTTA-CAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATTGTGCATGGCTTCATTAGCAGGTTTACTGTGCTGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_albatus">
+            C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_alpinus">
+            C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCC-AGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGTTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCYACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_awahnee_a">
+            C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_awahnee_b">
+            C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_bottae">
+            C-AGCTTGCTG-TCACACYGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTAKGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_cactophilus">
+            C-AGCTTGCTG-TCACACTACCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCACTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_laticeps">
+            C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_mewa">
+            C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_riparius">
+            C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_ruidosae">
+            ?????????????????????????????C-AGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_saxatilis">
+            C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_bottae_xerophilus">
+            C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCACTAAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTRTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_idahoensis_pygmaeus_a">
+            C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTTTAAGTGTTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGTCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGTCCAGTGAAACTTAACAGCTACCTTGCCAATKGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGG--TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_idahoensis_pygmaeus_b">
+            CAAGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTGTTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGTCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGG--TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_mazama_mazama">
+            C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTATTGCCTGGATATAGTGTCTATAGACAGAGACAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCACATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCACCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCTGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_mazama_nasicus">
+            C-AGCTTGCTG-TCACAATGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTATTGCCTGGATATAGTGTCTATAGACAGAGACAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCACATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCTGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_monticola_a">
+            C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGACGCCKTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_monticola_b">
+            C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGACGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTYCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_talpoides_bridgeri">
+            C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_talpoides_ocius">
+            C-AGCTTGCTGGTCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCATATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAAWGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_talpoides_yakimensis">
+            C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGAMTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTACTGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_townsendii_relictus">
+            C-AGCTTGCTGGTCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_townsendii_townsendii">
+            C-AGCTTGCTGGTCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_umbrinus_atroavarius">
+            C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+        <sequence taxon="Thomomys_umbrinus_chihuahuae">
+            C-AGCTTGCTGGTCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAAGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTGGAATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAATGGAGAGCATC [...]
+        </sequence>
+    </data>
+
+    <taxonset spec='TaxonSet' id='lineagetaxa'>
+        <taxon idref='Orthogeomys_heterodus'/>
+        <taxon idref='Thomomys_bottae_albatus'/>
+        <taxon idref='Thomomys_bottae_alpinus'/>
+        <taxon idref='Thomomys_bottae_awahnee_a'/>
+        <taxon idref='Thomomys_bottae_awahnee_b'/>
+        <taxon idref='Thomomys_bottae_bottae'/>
+        <taxon idref='Thomomys_bottae_cactophilus'/>
+        <taxon idref='Thomomys_bottae_laticeps'/>
+        <taxon idref='Thomomys_bottae_mewa'/>
+        <taxon idref='Thomomys_bottae_riparius'/>
+        <taxon idref='Thomomys_bottae_ruidosae'/>
+        <taxon idref='Thomomys_bottae_saxatilis'/>
+        <taxon idref='Thomomys_bottae_xerophilus'/>
+        <taxon idref='Thomomys_idahoensis_pygmaeus_a'/>
+        <taxon idref='Thomomys_idahoensis_pygmaeus_b'/>
+        <taxon idref='Thomomys_mazama_mazama'/>
+        <taxon idref='Thomomys_mazama_nasicus'/>
+        <taxon idref='Thomomys_monticola_a'/>
+        <taxon idref='Thomomys_monticola_b'/>
+        <taxon idref='Thomomys_talpoides_bridgeri'/>
+        <taxon idref='Thomomys_talpoides_ocius'/>
+        <taxon idref='Thomomys_talpoides_yakimensis'/>
+        <taxon idref='Thomomys_townsendii_relictus'/>
+        <taxon idref='Thomomys_townsendii_townsendii'/>
+        <taxon idref='Thomomys_umbrinus_atroavarius'/>
+        <taxon idref='Thomomys_umbrinus_chihuahuae'/>
+    </taxonset>
+
+    <taxonset spec='TaxonSet' id='taxonsuperset'>
+        <taxon spec='TaxonSet' id='Orthogeomys_heterodus_species'>
+            <taxon spec='Taxon' id='Orthogeomys_heterodus'/>
+        </taxon>
+        <taxon spec='TaxonSet' id='Thomomys_bottae'>
+            <taxon spec='Taxon' id='Thomomys_bottae_awahnee_a'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_awahnee_b'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_xerophilus'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_cactophilus'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_albatus'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_ruidosae'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_bottae'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_alpinus'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_riparius'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_mewa'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_saxatilis'/>
+            <taxon spec='Taxon' id='Thomomys_bottae_laticeps'/>
+        </taxon>
+        <taxon spec='TaxonSet' id='Thomomys_idahoensis'>
+            <taxon spec='Taxon' id='Thomomys_idahoensis_pygmaeus_a'/>
+            <taxon spec='Taxon' id='Thomomys_idahoensis_pygmaeus_b'/>
+        </taxon>
+        <taxon spec='TaxonSet' id='Thomomys_mazama'>
+            <taxon spec='Taxon' id='Thomomys_mazama_mazama'/>
+            <taxon spec='Taxon' id='Thomomys_mazama_nasicus'/>
+        </taxon>
+        <taxon spec='TaxonSet' id='Thomomys_monticola'>
+            <taxon spec='Taxon' id='Thomomys_monticola_a'/>
+            <taxon spec='Taxon' id='Thomomys_monticola_b'/>
+        </taxon>
+        <taxon spec='TaxonSet' id='Thomomys_talpoides'>
+            <taxon spec='Taxon' id='Thomomys_talpoides_yakimensis'/>
+            <taxon spec='Taxon' id='Thomomys_talpoides_bridgeri'/>
+            <taxon spec='Taxon' id='Thomomys_talpoides_ocius'/>
+        </taxon>
+        <taxon spec='TaxonSet' id='Thomomys_townsendii'>
+            <taxon spec='Taxon' id='Thomomys_townsendii_townsendii'/>
+            <taxon spec='Taxon' id='Thomomys_townsendii_relictus'/>
+        </taxon>
+        <taxon spec='TaxonSet' id='Thomomys_umbrinus'>
+            <taxon spec='Taxon' id='Thomomys_umbrinus_chihuahuae'/>
+            <taxon spec='Taxon' id='Thomomys_umbrinus_atroavarius'/>
+        </taxon>
+    </taxonset>
+
+    <distribution id="posterior" spec="util.CompoundDistribution">
+        <distribution id="prior" spec="util.CompoundDistribution">
+
+            <distribution id="speciesCoalescent" spec="util.CompoundDistribution">
+                <!-- gene tree priors -->
+                <distribution id="genetree.priors" spec="util.CompoundDistribution">
+                    <distribution id='tree.prior.29' spec='GeneTreeForSpeciesTreeDistribution' tree='@tree29'
+                                  speciesTree='@speciesTree'
+                                  speciesTreePrior='@SpeciesTreePopSizePrior'/>
+                    <distribution id='tree.prior.26' spec='GeneTreeForSpeciesTreeDistribution' tree='@tree26'
+                                  speciesTree='@speciesTree'
+                                  speciesTreePrior='@SpeciesTreePopSizePrior'/>
+                </distribution>
+
+                <!-- species tree priors -->
+                <distribution id='SpeciesTreePopSizePrior' spec='SpeciesTreePrior' tree='@speciesTree'
+                              popFunction='linear_with_constant_root'
+                              taxonset='@taxonsuperset'>
+                    <bottomPopSize spec='parameter.RealParameter' id='popSize' value='1'/>
+                    <topPopSize spec='parameter.RealParameter' id='popSizeTop' value='1'/>
+                    <parameter name='gammaParameter' id='popMean' value='0.004'/>
+                </distribution>
+            </distribution>
+
+            <distribution id="SpeciesTreeDivergenceTimesPrior" spec="speciation.YuleModel" tree='@speciesTree'>
+                <birthDiffRate spec='parameter.RealParameter' id="birthRate" value='213.2021' lower='0' upper='10000'/>
+            </distribution>
+
+            <!-- hyper priors for assorted parameters -->
+            <distribution id='birthRatePrior' spec='distributions.Prior' x='@birthRate'>
+                <distr id='OneOnX' spec='distributions.OneOnX'/>
+            </distribution>
+
+            <distribution id="popMean.prior26" spec="beast.math.distributions.Prior" x="@popMean" distr='@OneOnX'/>
+
+            <distribution id="kappa.prior26" spec="beast.math.distributions.Prior" x="@hky.kappa26">
+                <distr id='logNormal' spec='beast.math.distributions.LogNormalDistributionModel' M="1.0" S="1.25"
+                       offset="0.0"
+                       meanInRealSpace="false"/>
+            </distribution>
+
+            <distribution id="kappa.prior29" spec="beast.math.distributions.Prior" x="@hky.kappa29" distr='@logNormal'/>
+
+        </distribution>
+        <distribution id="likelihood" spec="util.CompoundDistribution">
+            <distribution data="@26" id="treelikelihood.26" spec="TreeLikelihood" tree="@tree26" useAmbiguities="false">
+                <siteModel gammaCategoryCount="1" id="siteModel26" mutationRate="@mutationRate"
+                           proportionInvariant="@proportionInvariant"
+                           shape="@gammaShape" spec="SiteModel">
+                    <substModel id="hky26" kappa="@hky.kappa26" spec="HKY">
+                        <frequencies id="freqs26" spec="Frequencies" estimate='true' data='@26'/>
+                    </substModel>
+                </siteModel>
+                <branchRateModel clock.rate="@clockRate" id="StrictClockModel26"
+                                 spec="beast.evolution.branchratemodel.StrictClockModel"/>
+            </distribution>
+            <distribution data="@29" id="treelikelihood.29" spec="TreeLikelihood" tree="@tree29" useAmbiguities="false">
+                <siteModel gammaCategoryCount="1" id="siteModel29" mutationRate="@mutationRate"
+                           proportionInvariant="@proportionInvariant"
+                           shape="@gammaShape" spec="SiteModel">
+                    <substModel id="hky29" kappa="@hky.kappa29" spec="HKY">
+                        <frequencies id="freqs29" spec="Frequencies" estimate='true' data='@29'/>
+                    </substModel>
+                </siteModel>
+                <branchRateModel clock.rate="@clockRate" id="StrictClockModel29"
+                                 spec="beast.evolution.branchratemodel.StrictClockModel"/>
+            </distribution>
+        </distribution>
+    </distribution>
+
+    <tree spec='RandomTree' id='randomSpeciesTree' initial='@speciesTree' taxonset='@taxonsuperset'>
+        <populationModel spec='ConstantPopulation'>
+            <popSize spec='parameter.RealParameter' value='1'/>
+        </populationModel>
+    </tree>
+
+
+    <tree spec='beast.util.TreeParser' id='newickSpeciesTree' IsLabelledNewick='true' 
+          newick='(Orthogeomys_heterodus_species:0.02065265792151943,(((Thomomys_talpoides:0.0013609706233106656,Thomomys_mazama:0.0013609706233106656):6.032405317365711E-4,(Thomomys_idahoensis:0.0019116640088644983,Thomomys_monticola:0.0019116640088644983):5.254714618273845E-5):0.01135560317788915,(Thomomys_umbrinus:0.001060205025110908,(Thomomys_townsendii:2.1835631905959876E-4,Thomomys_bottae:2.1835631905959876E-4):8.418487060513092E-4):0.01225960930782548):0.007332843588583044);'
+          initial='@speciesTree' threshold='1e-12' taxonset='@taxonsuperset'/>
+
+
+    <tree spec='beast.util.TreeParser' id='newickGeneTree1' IsLabelledNewick='true' 
+          newick='((((Thomomys_idahoensis_pygmaeus_a:4.790629004925939E-4,Thomomys_idahoensis_pygmaeus_b:4.790629004925939E-4):0.002807766516703272,(Thomomys_monticola_a:3.1053813362974055E-5,Thomomys_monticola_b:3.1053813362974055E-5):0.0032557756038328915):1.3936218139959985E-4,((Thomomys_talpoides_yakimensis:0.001392151582227928,(Thomomys_talpoides_bridgeri:4.271344427331326E-4,Thomomys_talpoides_ocius:4.271344427331326E-4):9.650171394947955E-4):2.3416363608392133E-4,(Thomomys_mazama_ [...]
+          initial='@tree26' taxonset='@lineagetaxa' threshold='1e-12'/>
+
+    <tree spec='beast.util.TreeParser' id='newickGeneTree2' IsLabelledNewick='true' 
+          newick='(Orthogeomys_heterodus:0.02555754747205849,((Thomomys_mazama_nasicus:0.001146519512253189,Thomomys_mazama_mazama:0.001146519512253189):0.01169723135080885,((Thomomys_talpoides_ocius:0.00703974619989265,(((Thomomys_talpoides_yakimensis:0.0014682135377831343,(Thomomys_monticola_a:3.1427207759506006E-5,Thomomys_monticola_b:3.1427207759506006E-5):0.0014367863300236282):3.5111237723683074E-4,(Thomomys_idahoensis_pygmaeus_a:2.52563963076903E-4,Thomomys_idahoensis_pygmaeus_b:2 [...]
+          initial='@tree29' taxonset='@lineagetaxa' threshold='1e-12'/>
+
+    <tree spec='RandomGeneTree' id='randomGeneTree1' initial='@tree26' speciesTree='@speciesTree' taxa='@26'>
+        <populationModel spec='ConstantPopulation'>
+            <popSize spec='parameter.RealParameter' value='1'/>
+        </populationModel>
+    </tree>
+
+    <tree spec='RandomGeneTree' id='randomGeneTree2' initial='@tree29' speciesTree='@speciesTree' taxa='@29'>
+        <populationModel spec='ConstantPopulation'>
+            <popSize spec='parameter.RealParameter' value='1'/>
+        </populationModel>
+    </tree>
+
+    <run chainLength="10000000" id="mcmc" preBurnin="0" spec="MCMC">
+        <!--init idref='randomSpeciesTree'/ -->
+        <init idref='newickSpeciesTree'/>
+        <!--init idref='newickGeneTree1'/> <init idref='newickGeneTree2'/ -->
+
+        <init idref='randomGeneTree1'/>
+        <init idref='randomGeneTree2'/>
+
+
+        <distribution idref="posterior"/>
+
+        <state id="State0" storeEvery="100000">
+            <!--parameter dimension="1" estimate="false" id="popSize" name="stateNode" value="1.0"/ -->
+            <parameter dimension="1" estimate="false" id="mutationRate" name="stateNode" value="1.0"/>
+            <parameter dimension="1" estimate="false" id="clockRate" name="stateNode" value="1.0"/>
+            <parameter dimension="1" estimate="true" id="hky.kappa26" lower="0.0" name="stateNode" value="1.0"/>
+            <parameter dimension="1" estimate="true" id="hky.kappa29" lower="0.0" name="stateNode" value="1.0"/>
+
+            <stateNode idref='popSize'/>
+            <stateNode idref='popSizeTop'/>
+            <stateNode idref='popMean'/>
+
+            <tree estimate="true" id="tree26" name="stateNode"/>
+            <tree estimate="true" id="tree29" name="stateNode"/>
+            <tree estimate="true" id="speciesTree" name="stateNode"/>
+
+            <stateNode idref="birthRate"/>
+            <!--stateNode idref="relativeDeathRate"/ -->
+            <parameter dimension="1" estimate="false" id="gammaShape" name="stateNode" value="1.0"/>
+            <parameter dimension="1" estimate="false" id="proportionInvariant" lower="0.0" name="stateNode" upper="1.0"
+                       value="0.0"/>
+        </state>
+
+        <operator degreesOfFreedom="1" id="popSizeScaler" scaleAll="false" scaleAllIndependently="false"
+                  scaleFactor="0.5"
+                  spec="ScaleOperator" parameter="@popSize" weight="5.0"/>
+        <operator degreesOfFreedom="1" id="popSizeTopScaler" scaleAll="false" scaleAllIndependently="false"
+                  scaleFactor="0.5" spec="ScaleOperator" parameter="@popSizeTop" weight="5.0"/>
+        <operator degreesOfFreedom="1" id="birthRateScaler" scaleFactor="0.5" spec="ScaleOperator"
+                  parameter="@birthRate"
+                  weight="3"/>
+        <!--operator degreesOfFreedom="1" id="relDeathRateScaler" scaleFactor="0.5" spec="ScaleOperator" parameter="@relativeDeathRate"
+              weight="1.0"/ -->
+        <operator degreesOfFreedom="1" id="psiScaler" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.5"
+                  spec="ScaleOperator" parameter="@popMean" weight="94"/>
+        <operator degreesOfFreedom="1" id="kappa26Scaler" scaleAll="false" scaleAllIndependently="false"
+                  scaleFactor="0.35"
+                  spec="ScaleOperator" parameter="@hky.kappa26" weight="0.1"/>
+        <operator degreesOfFreedom="1" id="kappa29Scaler" scaleAll="false" scaleAllIndependently="false"
+                  scaleFactor="0.35"
+                  spec="ScaleOperator" parameter="@hky.kappa29" weight="0.1"/>
+
+        <operator gaussian="true" id="SubtreeSlide26" size="0.003" spec="SubtreeSlide" tree="@tree26" weight="15.0"/>
+        <operator degreesOfFreedom="1" id="treeScaler26" scaleAll="false" scaleAllIndependently="false"
+                  scaleFactor="0.85"
+                  spec="ScaleOperator" tree="@tree26" weight="6.0"/>
+        <operator id="wide26" isNarrow="false" spec="Exchange" tree="@tree26" weight="1.0"/>
+        <operator id="narrow26" isNarrow="true" spec="Exchange" tree="@tree26" weight="15"/>
+        <operator id="WilsonBalding26" spec="WilsonBalding" tree="@tree26" weight="3"/>
+        <!-- -->
+        <operator id="Uniform26" spec="Uniform" tree="@tree26" weight="30.0"/>
+
+        <operator gaussian="true" id="SubtreeSlide29" size="0.002" spec="SubtreeSlide" tree="@tree29" weight="15.0"/>
+        <operator degreesOfFreedom="1" id="treeScaler29" scaleAll="false" scaleAllIndependently="false"
+                  scaleFactor="0.85"
+                  spec="ScaleOperator" tree="@tree29" weight="6.0"/>
+        <operator id="wide29" isNarrow="false" spec="Exchange" tree="@tree29" weight="1.0"/>
+        <operator id="narrow29" isNarrow="true" spec="Exchange" tree="@tree29" weight="15"/>
+        <operator id="WilsonBalding29" spec="WilsonBalding" tree="@tree29" weight="3"/>
+        <!-- -->
+        <operator id="Uniform29" spec="Uniform" tree="@tree29" weight="30.0"/>
+
+        <operator spec='UpDownOperator' scaleFactor="0.75" weight="30">
+            <up idref="birthRate"/>
+            <down idref="popSize"/>
+            <down idref="popSizeTop"/>
+            <down idref="popMean"/>
+            <down idref="speciesTree"/>
+            <down idref="tree26"/>
+            <down idref="tree29"/>
+        </operator>
+
+        <!-- <operator id="wideSP" isNarrow="false" spec="Exchange" tree="@speciesTree" weight="1.0"/> <operator gaussian="true"
+              id="SubtreeSlideSP" size="0.003" spec="SubtreeSlide" tree="@speciesTree" weight="15.0"/> <operator degreesOfFreedom="1" id="treeScalerSP"
+              scaleAll="false" scaleAllIndependently="false" scaleFactor="0.85" spec="ScaleOperator" tree="@speciesTree" weight="6.0"/>
+              <operator id="UniformSP" spec="Uniform" tree="@speciesTree" weight="30.0"/> -->
+
+        <operator id="Reheight" spec="NodeReheight" tree="@speciesTree" weight="94" taxonset='@taxonsuperset'>
+            <genetree idref='tree26'/>
+            <genetree idref='tree29'/>
+        </operator>
+
+        <logger fileName="test.$(seed).log" id="Logger0" logEvery="1000" mode="autodetect" model="@posterior">
+            <log idref="posterior"/>
+            <log idref="prior"/>
+            <log idref="speciesCoalescent"/>
+            <log idref="genetree.priors"/>
+            <log idref="SpeciesTreePopSizePrior"/>
+            <log idref="tree.prior.26"/>
+            <log idref="tree.prior.29"/>
+            <log idref="SpeciesTreeDivergenceTimesPrior"/>
+            <log idref="likelihood"/>
+            <log idref="popMean"/>
+            <log idref="birthRate"/>
+            <!--log idref="relativeDeathRate"/ -->
+            <log idref="hky.kappa26"/>
+            <log idref="hky.kappa29"/>
+            <log idref="popSize"/>
+            <log idref="popSizeTop"/>
+            <log id="TreeHeightSP" spec="beast.evolution.tree.TreeHeightLogger" tree="@speciesTree"/>
+            <log id="TreeHeight26" spec="beast.evolution.tree.TreeHeightLogger" tree="@tree26"/>
+            <log id="TreeHeight29" spec="beast.evolution.tree.TreeHeightLogger" tree="@tree29"/>
+            <log idref="treelikelihood.26"/>
+            <log idref="treelikelihood.29"/>
+        </logger>
+
+        <logger fileName="test.$(seed).sp.trees" id="Logger4" logEvery="1000" mode="tree">
+            <log spec='SpeciesTreeLogger' popSize='@popSize' popSizeTop="@popSizeTop" tree="@speciesTree"
+                 speciesTreePrior='@SpeciesTreePopSizePrior'>
+                <treetop spec='TreeTopFinder' id='treeTopFinder'>
+                    <tree idref='tree26'/>
+                    <tree idref='tree29'/>
+                </treetop>
+            </log>
+        </logger>
+
+        <logger fileName="test.$(seed).26.trees" id="Logger2" logEvery="1000" mode="autodetect">
+            <log idref="tree26"/>
+        </logger>
+
+        <logger fileName="test.$(seed).29.trees" id="Logger3" logEvery="1000" mode="autodetect">
+            <log idref="tree29"/>
+        </logger>
+
+        <logger id="Logger1" logEvery="100000" mode="autodetect">
+            <log idref="posterior"/>
+            <log spec='ESS' arg='@posterior'/>
+            <log idref="prior"/>
+            <log spec='ESS' arg='@prior'/>
+        </logger>
+
+    </run>
+
+
+</beast>
diff --git a/examples/beast2vs1/testStarBeast2.xml b/examples/beast2vs1/testStarBeast2.xml
new file mode 100644
index 0000000..4cff0f9
--- /dev/null
+++ b/examples/beast2vs1/testStarBeast2.xml
@@ -0,0 +1,354 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><beast namespace="beast.evolution.speciation:beast.evolution.alignment:beast.core:beast.math:beast.evolution:beast.evolution.tree:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood" version="2.0">
+
+
+
+<!-- 
+same as testStarBeast.xml, but with different orderings for alignments and taxon sets
+-->
+    <data dataType="nucleotide" id="26" name="taxa">
+    <!-- this one keeps the original ordering -->
+<sequence taxon="Orthogeomys_heterodus">		ATTCTAGGCAAAAAG-AGCAATGCTGGAGGTATTACAATACCAGACTTCAAACTTTACTATAGAGCCATAATAACAAAAACCGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAATGGAAYAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGTCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCACCATGCACAGGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCAGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGGGAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATAGGAGAAAGACT [...]
+<sequence taxon="Thomomys_bottae_albatus">		????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGATCCAGAAATAGAACCAC-ATACCTATAGTCAACTTGTATTTGATAAAGGAGCTAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCATTTCACCATGCACAAGAATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCT-------------------------------------CATAGGCACTCATAGGCACAGGCAAAAGATTCCTATACAGGAACCCAGGGTCAACAACAGATTGGAGAGAGA [...]
+<sequence taxon="Thomomys_bottae_alpinus">		????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCTATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCA???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+<sequence taxon="Thomomys_bottae_awahnee_a">		????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACMCAGTCTATTCAATTATTGGKGCTGGCAAAACTGGGCAGCCMCATGCARAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAA????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+<sequence taxon="Thomomys_bottae_awahnee_b">		????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCM-CAACAGATTGGAGAGA [...]
+<sequence taxon="Thomomys_bottae_bottae">		????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAAATTCCTGAACAGAATCCCAGGGTCA-CAACAGATKGGAGAGAGAC [...]
+<sequence taxon="Thomomys_bottae_cactophilus">		????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAAYGTCAGACCGGAAACCGTGAAAYTGTTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAA?????????????????????????????????????????? [...]
+<sequence taxon="Thomomys_bottae_laticeps">		????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAATTGCTACATGATAAWGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAG [...]
+<sequence taxon="Thomomys_bottae_mewa">		????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCATTTCACCATGCACAAGAATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAA???????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+<sequence taxon="Thomomys_bottae_riparius">		????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAG [...]
+<sequence taxon="Thomomys_bottae_ruidosae">		????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCARAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAAYTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAG??????????????????????????????????????????? [...]
+<sequence taxon="Thomomys_bottae_saxatilis">		????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAA????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+<sequence taxon="Thomomys_bottae_xerophilus">		????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAAYTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAA???????????????????????????????? [...]
+<sequence taxon="Thomomys_idahoensis_pygmaeus_a">		????????CAAAA-G-AGCAATGCTGGTGGTATYACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATMCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCRACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGG [...]
+<sequence taxon="Thomomys_idahoensis_pygmaeus_b">		????GGCGCAAAA-G-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATMCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGG [...]
+<sequence taxon="Thomomys_mazama_mazama">		ATTCTAGGCAAAAAGAAGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAAYTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGAC [...]
+<sequence taxon="Thomomys_mazama_nasicus">		ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCSCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAAYTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGA [...]
+<sequence taxon="Thomomys_monticola_a">		??????????????G-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGYCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTC [...]
+<sequence taxon="Thomomys_monticola_b">		ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATYACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAWATAGAACCAC-ACAACTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAATGGAACRAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTC [...]
+<sequence taxon="Thomomys_talpoides_bridgeri">		ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATCCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCRACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGA [...]
+<sequence taxon="Thomomys_talpoides_ocius">		???CTAGGCAAAA-G-AGC-ATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATMCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCRACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAG [...]
+<sequence taxon="Thomomys_talpoides_yakimensis">		ATTCTAGGCAAAA-G-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTKTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAAYGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAAYTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGA [...]
+<sequence taxon="Thomomys_townsendii_relictus">		??????????????G-AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTAYTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCACTATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAATGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAATTGCTACATGATAAWGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAG [...]
+<sequence taxon="Thomomys_townsendii_townsendii">		ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTYGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGG [...]
+<sequence taxon="Thomomys_umbrinus_atroavarius">		ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGCATTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGKCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGYCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAAYGTCAGACCGGAAACCGTGAAATTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGA [...]
+<sequence taxon="Thomomys_umbrinus_chihuahuae">		?????????????AG-AGC-ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCTTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAG [...]
+</data>
+
+    <data dataType="nucleotide" id="29" name="taxa">
+<!-- re-ordered set -->
+<sequence taxon="Thomomys_idahoensis_pygmaeus_a">		C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTTTAAGTGTTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGTCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGTCCAGTGAAACTTAACAGCTACCTTGCCAATKGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGG--TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATA [...]
+<sequence taxon="Thomomys_idahoensis_pygmaeus_b">		CAAGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTGTTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGTCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGG--TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATA [...]
+<sequence taxon="Thomomys_mazama_mazama">		C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTATTGCCTGGATATAGTGTCTATAGACAGAGACAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCACATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCACCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCTGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCA [...]
+<sequence taxon="Thomomys_mazama_nasicus">		C-AGCTTGCTG-TCACAATGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTATTGCCTGGATATAGTGTCTATAGACAGAGACAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCACATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCTGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGC [...]
+<sequence taxon="Thomomys_monticola_a">		C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGACGCCKTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAA [...]
+<sequence taxon="Thomomys_monticola_b">		C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGACGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTYCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAA [...]
+<sequence taxon="Thomomys_talpoides_bridgeri">		C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAAT [...]
+<sequence taxon="Thomomys_talpoides_ocius">		C-AGCTTGCTGGTCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCATATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAAWGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTG [...]
+<sequence taxon="Thomomys_talpoides_yakimensis">		C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGAMTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAA [...]
+<sequence taxon="Thomomys_townsendii_relictus">		C-AGCTTGCTGGTCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAA [...]
+<sequence taxon="Thomomys_townsendii_townsendii">		C-AGCTTGCTGGTCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATA [...]
+<sequence taxon="Thomomys_umbrinus_atroavarius">		C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAA [...]
+<sequence taxon="Thomomys_umbrinus_chihuahuae">		C-AGCTTGCTGGTCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAAGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTGGAATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAA [...]
+<sequence taxon="Orthogeomys_heterodus">		C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCACAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCGTTTCTGGAAAACTGAGATCTTGTTTTGACCAACAGAAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTACTGGTGATGTCTCTGTCAGGATCTAGTCCCATCCTG-AATCCATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTCAGAACTGACTGAATCAGGCCAGTGAAAGTTA-CAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATTGTGCATGGCTTCATTAGCAGGTTTACTGTGCTGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAA [...]
+<sequence taxon="Thomomys_bottae_albatus">		C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGC [...]
+<sequence taxon="Thomomys_bottae_alpinus">		C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCC-AGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGTTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCYACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGC [...]
+<sequence taxon="Thomomys_bottae_awahnee_a">		C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTT [...]
+<sequence taxon="Thomomys_bottae_awahnee_b">		C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTT [...]
+<sequence taxon="Thomomys_bottae_bottae">		C-AGCTTGCTG-TCACACYGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTAKGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCA [...]
+<sequence taxon="Thomomys_bottae_cactophilus">		C-AGCTTGCTG-TCACACTACCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCACTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAAT [...]
+<sequence taxon="Thomomys_bottae_laticeps">		C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTG [...]
+<sequence taxon="Thomomys_bottae_mewa">		C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAA [...]
+<sequence taxon="Thomomys_bottae_riparius">		C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTG [...]
+<sequence taxon="Thomomys_bottae_ruidosae">		?????????????????????????????C-AGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTG [...]
+<sequence taxon="Thomomys_bottae_saxatilis">		C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTT [...]
+<sequence taxon="Thomomys_bottae_xerophilus">		C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCACTAAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTRTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATT [...]
+            </data>
+
+    <taxonset spec='TaxonSet' id='lineagetaxa'>
+    <!-- reverse order -->
+		<taxon idref='Thomomys_umbrinus_chihuahuae'/>        
+		<taxon idref='Thomomys_umbrinus_atroavarius'/>
+		<taxon idref='Thomomys_townsendii_townsendii'/>
+		<taxon idref='Thomomys_townsendii_relictus'/>
+		<taxon idref='Thomomys_talpoides_yakimensis'/>
+		<taxon idref='Thomomys_talpoides_ocius'/>
+		<taxon idref='Thomomys_talpoides_bridgeri'/>
+		<taxon idref='Thomomys_monticola_b'/>
+		<taxon idref='Thomomys_monticola_a'/>
+		<taxon idref='Thomomys_mazama_nasicus'/>
+		<taxon idref='Thomomys_mazama_mazama'/>
+		<taxon idref='Thomomys_idahoensis_pygmaeus_b'/>
+		<taxon idref='Thomomys_idahoensis_pygmaeus_a'/>
+		<taxon idref='Thomomys_bottae_xerophilus'/>
+		<taxon idref='Thomomys_bottae_saxatilis'/>
+		<taxon idref='Thomomys_bottae_ruidosae'/>
+		<taxon idref='Thomomys_bottae_riparius'/>
+		<taxon idref='Thomomys_bottae_mewa'/>
+		<taxon idref='Thomomys_bottae_laticeps'/>
+		<taxon idref='Thomomys_bottae_cactophilus'/>
+		<taxon idref='Thomomys_bottae_bottae'/>
+		<taxon idref='Thomomys_bottae_awahnee_b'/>
+		<taxon idref='Thomomys_bottae_awahnee_a'/>
+		<taxon idref='Thomomys_bottae_alpinus'/>
+		<taxon idref='Thomomys_bottae_albatus'/>
+		<taxon idref='Orthogeomys_heterodus'/>
+    </taxonset>   
+    
+	<taxonset spec='TaxonSet' id='taxonsuperset'>
+	<!-- re-ordered -->
+                <taxon spec='TaxonSet' id='Thomomys_mazama'>
+                    <taxon spec='Taxon' id='Thomomys_mazama_mazama'/>
+                    <taxon spec='Taxon' id='Thomomys_mazama_nasicus'/>
+                </taxon>
+                <taxon spec='TaxonSet' id='Thomomys_idahoensis'>
+                    <taxon spec='Taxon' id='Thomomys_idahoensis_pygmaeus_b'/>
+                    <taxon spec='Taxon' id='Thomomys_idahoensis_pygmaeus_a'/>
+                </taxon>
+                <taxon spec='TaxonSet' id='Thomomys_talpoides'>
+                    <taxon spec='Taxon' id='Thomomys_talpoides_yakimensis'/>
+                    <taxon spec='Taxon' id='Thomomys_talpoides_ocius'/>
+                    <taxon spec='Taxon' id='Thomomys_talpoides_bridgeri'/>
+                </taxon>
+                <taxon spec='TaxonSet' id='Orthogeomys_heterodus_species'>
+                    <taxon spec='Taxon' id='Orthogeomys_heterodus'/>
+                </taxon>
+                <taxon spec='TaxonSet' id='Thomomys_monticola'>
+                    <taxon spec='Taxon' id='Thomomys_monticola_a'/>
+                    <taxon spec='Taxon' id='Thomomys_monticola_b'/>
+                </taxon>
+                <taxon spec='TaxonSet' id='Thomomys_bottae'>
+                    <taxon spec='Taxon' id='Thomomys_bottae_ruidosae'/>
+                    <taxon spec='Taxon' id='Thomomys_bottae_awahnee_a'/>
+                    <taxon spec='Taxon' id='Thomomys_bottae_bottae'/>
+                    <taxon spec='Taxon' id='Thomomys_bottae_alpinus'/>
+                    <taxon spec='Taxon' id='Thomomys_bottae_riparius'/>
+                    <taxon spec='Taxon' id='Thomomys_bottae_awahnee_b'/>
+                    <taxon spec='Taxon' id='Thomomys_bottae_xerophilus'/>
+                    <taxon spec='Taxon' id='Thomomys_bottae_saxatilis'/>
+                    <taxon spec='Taxon' id='Thomomys_bottae_cactophilus'/>
+                    <taxon spec='Taxon' id='Thomomys_bottae_albatus'/>
+                    <taxon spec='Taxon' id='Thomomys_bottae_mewa'/>
+                    <taxon spec='Taxon' id='Thomomys_bottae_laticeps'/>
+                </taxon>
+                <taxon spec='TaxonSet' id='Thomomys_umbrinus'>
+                    <taxon spec='Taxon' id='Thomomys_umbrinus_atroavarius'/>
+                    <taxon spec='Taxon' id='Thomomys_umbrinus_chihuahuae'/>
+                </taxon>
+                <taxon spec='TaxonSet' id='Thomomys_townsendii'>
+                    <taxon spec='Taxon' id='Thomomys_townsendii_townsendii'/>
+                    <taxon spec='Taxon' id='Thomomys_townsendii_relictus'/>
+                </taxon>
+	</taxonset>
+
+    <distribution id="posterior" spec="util.CompoundDistribution">
+        <distribution id="prior" spec="util.CompoundDistribution">
+
+		    <distribution id="speciesCoalescent" spec="util.CompoundDistribution">
+		        <!-- gene tree priors -->
+		        <distribution id='tree.prior.29' spec='GeneTreeForSpeciesTreeDistribution' tree='@tree29' speciesTree='@speciesTree' speciesTreePrior='@SpeciesTreePopSizePrior'/>
+		        <distribution id='tree.prior.26' spec='GeneTreeForSpeciesTreeDistribution' tree='@tree26' speciesTree='@speciesTree' speciesTreePrior='@SpeciesTreePopSizePrior'/>
+
+		        <!-- species tree priors -->
+		        <distribution id='SpeciesTreePopSizePrior' spec='SpeciesTreePrior' tree='@speciesTree' 
+		        		popFunction='constant' taxonset='@taxonsuperset'>
+		            <bottomPopSize spec='parameter.RealParameter' id='popSize' value='1'/> 
+		            <parameter name='gammaParameter' id='popMean' value='0.004'/>
+		        </distribution>
+		    </distribution>
+
+            <distribution id="SpeciesTreeDivergenceTimesPrior" spec="speciation.YuleModel" tree='@speciesTree'>
+                <birthDiffRate spec='parameter.RealParameter' id="birthRate" value='213.2021' lower='0' upper='10000' />
+            </distribution>
+
+            <!-- hyper priors for assorted parameters -->
+            <distribution id='birthRatePrior' spec='distributions.Prior' x='@birthRate'>
+                <distr id='OneOnX' spec='distributions.OneOnX'/>
+            </distribution>
+
+            <distribution id="popMean.prior26" spec="beast.math.distributions.Prior" x="@popMean" distr='@OneOnX'/>
+
+            <distribution id="kappa.prior26" spec="beast.math.distributions.Prior" x="@hky.kappa26">
+                <distr id='logNormal' spec='beast.math.distributions.LogNormalDistributionModel' M="1.0" S="1.25" offset="0.0" meanInRealSpace="false"/>
+            </distribution>
+
+            <distribution id="kappa.prior29" spec="beast.math.distributions.Prior" x="@hky.kappa29"  distr='@logNormal'/>
+
+        </distribution>
+        <distribution id="likelihood" spec="util.CompoundDistribution">
+            <distribution data="@26" id="treelikelihood.26" spec="TreeLikelihood" tree="@tree26" useAmbiguities="false">
+                <siteModel gammaCategoryCount="1" id="siteModel26" mutationRate="@mutationRate" proportionInvariant="@proportionInvariant" shape="@gammaShape" spec="SiteModel">
+                    <substModel id="hky26" kappa="@hky.kappa26" spec="HKY">
+                        <frequencies id="freqs26" spec="Frequencies" estimate='true' data='@26'/>
+                    </substModel>
+                </siteModel>
+                <branchRateModel clock.rate="@clockRate" id="StrictClockModel26" spec="beast.evolution.branchratemodel.StrictClockModel"/>
+            </distribution>
+            <distribution data="@29" id="treelikelihood.29" spec="TreeLikelihood" tree="@tree29" useAmbiguities="false">
+                <siteModel gammaCategoryCount="1" id="siteModel29" mutationRate="@mutationRate" proportionInvariant="@proportionInvariant" shape="@gammaShape" spec="SiteModel">
+                    <substModel id="hky29" kappa="@hky.kappa29" spec="HKY">
+                        <frequencies id="freqs29" spec="Frequencies" estimate='true' data='@29'/>
+                    </substModel>
+                </siteModel>
+                <branchRateModel clock.rate="@clockRate" id="StrictClockModel29" spec="beast.evolution.branchratemodel.StrictClockModel"/>
+            </distribution>
+        </distribution>
+    </distribution>
+
+    <tree spec='RandomTree' id='randomSpeciesTree' initial='@speciesTree'
+        taxonset='@taxonsuperset'>
+        <populationModel spec='ConstantPopulation'>
+		<popSize spec='parameter.RealParameter' value='1'/>
+	</populationModel>
+    </tree>
+
+
+<tree spec='beast.util.TreeParser' id='newickSpeciesTree' IsLabelledNewick='true' newick='(Orthogeomys_heterodus_species:0.02065265792151943,(((Thomomys_talpoides:0.0013609706233106656,Thomomys_mazama:0.0013609706233106656):6.032405317365711E-4,(Thomomys_idahoensis:0.0019116640088644983,Thomomys_monticola:0.0019116640088644983):5.254714618273845E-5):0.01135560317788915,(Thomomys_umbrinus:0.001060205025110908,(Thomomys_townsendii:2.1835631905959876E-4,Thomomys_bottae:2.1835631905959876E-4 [...]
+initial='@speciesTree' threshold='1e-12' taxonset='@taxonsuperset'/>
+
+
+<tree spec='beast.util.TreeParser' id='newickGeneTree1' IsLabelledNewick='true' newick='((((Thomomys_idahoensis_pygmaeus_a:4.790629004925939E-4,Thomomys_idahoensis_pygmaeus_b:4.790629004925939E-4):0.002807766516703272,(Thomomys_monticola_a:3.1053813362974055E-5,Thomomys_monticola_b:3.1053813362974055E-5):0.0032557756038328915):1.3936218139959985E-4,((Thomomys_talpoides_yakimensis:0.001392151582227928,(Thomomys_talpoides_bridgeri:4.271344427331326E-4,Thomomys_talpoides_ocius:4.27134442733 [...]
+
+<tree spec='beast.util.TreeParser' id='newickGeneTree2' IsLabelledNewick='true' newick='(Orthogeomys_heterodus:0.02555754747205849,((Thomomys_mazama_nasicus:0.001146519512253189,Thomomys_mazama_mazama:0.001146519512253189):0.01169723135080885,((Thomomys_talpoides_ocius:0.00703974619989265,(((Thomomys_talpoides_yakimensis:0.0014682135377831343,(Thomomys_monticola_a:3.1427207759506006E-5,Thomomys_monticola_b:3.1427207759506006E-5):0.0014367863300236282):3.5111237723683074E-4,(Thomomys_idah [...]
+initial='@tree29' taxonset='@lineagetaxa' threshold='1e-12' />
+
+    <tree spec='RandomGeneTree' id='randomGeneTree1' 
+	initial='@tree26' speciesTree='@speciesTree' taxa='@26'>
+        <populationModel spec='ConstantPopulation'>
+		<popSize spec='parameter.RealParameter' value='1'/>
+	</populationModel>
+    </tree>
+    
+    <tree spec='RandomGeneTree' id='randomGeneTree2' 
+	initial='@tree29' speciesTree='@speciesTree' taxa='@29'>
+        <populationModel spec='ConstantPopulation'>
+		<popSize spec='parameter.RealParameter' value='1'/>
+	</populationModel>
+    </tree>
+
+<run chainLength="2000000" id="mcmc" preBurnin="0" spec="MCMC">
+    <!--init idref='randomSpeciesTree'/-->
+    <init idref='newickSpeciesTree'/>
+    <!--init idref='newickGeneTree1'/>
+    <init idref='newickGeneTree2'/-->
+
+    <init idref='randomGeneTree1'/>
+    <init idref='randomGeneTree2'/>
+
+
+    <distribution idref="posterior"/>
+
+    <state id="State0" storeEvery="100000">
+        <!--parameter dimension="1" estimate="false" id="popSize" name="stateNode" value="1.0"/-->
+        <parameter dimension="1" estimate="false" id="mutationRate" name="stateNode" value="1.0"/>
+        <parameter dimension="1" estimate="false" id="clockRate" name="stateNode" value="1.0"/>
+        <parameter dimension="1" estimate="true" id="hky.kappa26" lower="0.0" name="stateNode" value="1.0"/>
+        <parameter dimension="1" estimate="true" id="hky.kappa29" lower="0.0" name="stateNode" value="1.0"/>
+
+        <stateNode idref='popSize'/> 
+        <stateNode idref='popMean'/>
+
+        <tree estimate="true" id="tree26" name="stateNode"/>
+        <tree estimate="true" id="tree29" name="stateNode"/>
+        <tree estimate="true" id="speciesTree" name="stateNode"/>
+
+        <stateNode idref="birthRate"/>
+       	<!--stateNode idref="relativeDeathRate"/-->
+        <parameter dimension="1" estimate="false" id="gammaShape" name="stateNode" value="1.0"/>
+        <parameter dimension="1" estimate="false" id="proportionInvariant" lower="0.0" name="stateNode" upper="1.0" value="0.0"/>
+    </state>
+
+    <operator degreesOfFreedom="1" id="popSizeScaler" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.5" spec="ScaleOperator" parameter="@popSize" weight="5.0"/>
+    <operator degreesOfFreedom="1" id="birthRateScaler" scaleFactor="0.5" spec="ScaleOperator" parameter="@birthRate" weight="3"/>
+    <!--operator degreesOfFreedom="1" id="relDeathRateScaler" scaleFactor="0.5" spec="ScaleOperator" parameter="@relativeDeathRate" weight="1.0"/-->
+    <operator degreesOfFreedom="1" id="psiScaler" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.5" spec="ScaleOperator" parameter="@popMean" weight="94"/>
+    <operator degreesOfFreedom="1" id="kappa26Scaler" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.35" spec="ScaleOperator" parameter="@hky.kappa26" weight="0.1"/>
+    <operator degreesOfFreedom="1" id="kappa29Scaler" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.35" spec="ScaleOperator" parameter="@hky.kappa29" weight="0.1"/>
+
+    <operator gaussian="true" id="SubtreeSlide26" size="0.003" spec="SubtreeSlide" tree="@tree26" weight="15.0"/>
+    <operator degreesOfFreedom="1" id="treeScaler26" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.85" spec="ScaleOperator" tree="@tree26" weight="6.0"/>
+    <operator id="wide26" isNarrow="false" spec="Exchange" tree="@tree26" weight="1.0"/>
+    <operator id="narrow26" isNarrow="true" spec="Exchange" tree="@tree26" weight="15"/>
+    <operator id="WilsonBalding26" spec="WilsonBalding" tree="@tree26" weight="3"/>
+<!--
+-->
+    <operator id="Uniform26" spec="Uniform" tree="@tree26" weight="30.0"/>
+
+    <operator gaussian="true" id="SubtreeSlide29" size="0.002" spec="SubtreeSlide" tree="@tree29" weight="15.0"/>
+    <operator degreesOfFreedom="1" id="treeScaler29" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.85" spec="ScaleOperator" tree="@tree29" weight="6.0"/>
+    <operator id="wide29" isNarrow="false" spec="Exchange" tree="@tree29" weight="1.0"/>
+    <operator id="narrow29" isNarrow="true" spec="Exchange" tree="@tree29" weight="15"/>
+    <operator id="WilsonBalding29" spec="WilsonBalding" tree="@tree29" weight="3"/>
+<!--
+-->
+    <operator id="Uniform29" spec="Uniform" tree="@tree29" weight="30.0"/>
+
+	<operator spec='UpDownOperator' scaleFactor="0.75" weight="30">
+			<up idref="birthRate"/>
+			<down idref="popSize"/>
+			<down idref="popMean"/>
+			<down idref="speciesTree"/>
+			<down idref="tree26"/>
+			<down idref="tree29"/>
+	</operator>
+
+<!--
+    <operator id="wideSP" isNarrow="false" spec="Exchange" tree="@speciesTree" weight="1.0"/>
+    <operator gaussian="true" id="SubtreeSlideSP" size="0.003" spec="SubtreeSlide" tree="@speciesTree" weight="15.0"/>
+    <operator degreesOfFreedom="1" id="treeScalerSP" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.85" spec="ScaleOperator" tree="@speciesTree" weight="6.0"/>
+    <operator id="UniformSP" spec="Uniform" tree="@speciesTree" weight="30.0"/>
+-->
+
+    <operator id="Reheight" spec="NodeReheight" tree="@speciesTree" weight="94" taxonset='@taxonsuperset'>
+        <genetree idref='tree26'/>
+        <genetree idref='tree29'/>
+    </operator>
+
+    <logger fileName="test.$(seed).log" id="Logger0" logEvery="1000" mode="autodetect" model="@posterior">
+        <log idref="posterior"/>
+        <log idref="prior"/>
+        <log idref="speciesCoalescent"/>
+        <log idref="SpeciesTreePopSizePrior"/>
+        <log idref="tree.prior.26"/>
+        <log idref="tree.prior.29"/>
+        <log idref="SpeciesTreeDivergenceTimesPrior"/>
+        <log idref="likelihood"/>
+        <log idref="popMean"/>
+        <log idref="birthRate"/>
+        <!--log idref="relativeDeathRate"/-->
+        <log idref="hky.kappa26"/>
+        <log idref="hky.kappa29"/>
+        <log idref="popSize"/>
+        <log id="TreeHeightSP" spec="beast.evolution.tree.TreeHeightLogger" tree="@speciesTree"/>
+        <log id="TreeHeight26" spec="beast.evolution.tree.TreeHeightLogger" tree="@tree26"/>
+        <log id="TreeHeight29" spec="beast.evolution.tree.TreeHeightLogger" tree="@tree29"/>
+    </logger>
+
+    <logger fileName="z$(seed).sp.trees" id="Logger4" logEvery="1000" mode="tree">
+        <log spec='SpeciesTreeLogger' popSize='@popSize' tree="@speciesTree">
+			<treetop spec='TreeTopFinder' id='treeTopFinder'>
+				<tree idref='tree26'/>
+				<tree idref='tree29'/>
+			</treetop>
+		</log>
+    </logger>
+
+    <logger fileName="starBeast.26.trees" id="Logger2" logEvery="1000" mode="autodetect">
+        <log idref="tree26"/>
+    </logger>
+
+    <logger fileName="starBeast.29.trees" id="Logger3" logEvery="1000" mode="autodetect">
+        <log idref="tree29"/>
+    </logger>
+
+    <logger id="Logger1" logEvery="100000" mode="autodetect">
+        <log idref="posterior"/>
+        <log spec='ESS' arg='@posterior'/>
+        <log idref="prior"/>
+        <log spec='ESS' arg='@prior'/>
+    </logger>
+
+</run>
+
+
+</beast>
diff --git a/examples/beast2vs1/testStrictClock.xml b/examples/beast2vs1/testStrictClock.xml
new file mode 100644
index 0000000..df6ab57
--- /dev/null
+++ b/examples/beast2vs1/testStrictClock.xml
@@ -0,0 +1,134 @@
+<beast version='2.0'
+       namespace='beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.branchratemodel:beast.evolution.likelihood:beast.core.parameter'>
+
+    <!-- same as testStrictClockNoDate.xml in BEAST 1                            -->
+    <!-- The sequence alignment (each sequence refers to a taxon above).         -->
+    <!-- ntax=6 nchar=768                                                        -->
+    <!-- npatterns=69                                                            -->
+    <data id="alignment" dataType="nucleotide">
+        <sequence taxon="human">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="chimp">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="bonobo">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAGC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTTGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="gorilla">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTAAACATAGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA-CAACACTTAATTTCTGTAAGGACTGCAAAACCCTACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCAATGGGACTCAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAT-TCAC [...]
+        </sequence>
+        <sequence taxon="orangutan">
+            AGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA-CAGCACTTAATTTCTGTAAGGACTGCAAAACCCCACTTTGCATCAACTGAGCGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCCTAGACCGATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAT-TGGCTTCAGTCCAAAGCCCCGGCAGGCCTTAAAGCTGCTCCTTCGAATTTGCAATTCAACATGACAA-TCAC [...]
+        </sequence>
+        <sequence taxon="siamang">
+            AGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTAACAAAACTTAATTTCTGCAAGGGCTGCAAAACCCTACTTTGCATCAACCGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCGATGGGACTTAAACCCATAAAAATTTAGTTAACAGCTAAACACCCTAAACAACCTGGCTTCAATCTAAAGCCCCGGCAGA-GTTGAAGCTGCTTCTTTGAACTTGCAATTCAACGTGAAAAATCAC [...]
+        </sequence>
+    </data>
+
+    <!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+    <input spec='HKY' id="hky">
+        <parameter name='kappa' idref='hky.kappa'/>
+        <input id='freqs' name='frequencies' spec='Frequencies' frequencies='@hky.frequencies'/>
+    </input>
+
+    <!-- site model                                                              -->
+    <input spec='SiteModel' id="siteModel">
+        <!--<parameter name='mutationRate'>1.0</parameter>-->
+        <substModel idref='hky'/>
+    </input>
+
+
+    <input spec='StrictClockModel' id="branchRates">
+        <parameter name='clock.rate' id='clockRate' value="1.0"/>
+    </input>
+
+    <input spec='TreeLikelihood' id="treeLikelihood">
+        <data idref="alignment"/>
+        <tree idref="tree"/>
+        <siteModel idref="siteModel"/>
+        <branchRateModel idref="branchRates"/>
+    </input>
+
+    <input spec='beast.util.ClusterTree' id='tree' clusterType='upgma'>
+        <!--trait idref='rateCategories'/-->
+        <taxa idref='alignment'/>
+    </input>
+
+    <parameter id="hky.kappa" value="2.0" lower="0.0"/>
+    <parameter id="hky.frequencies" value="0.25" dimension="4"/>
+    <parameter id="popSize" value="0.077" lower="0.0"/>
+
+    <run spec="MCMC" id="mcmc" chainLength="10000000"> <!--autoOptimize="true"-->
+        <state>
+            <stateNode idref='hky.kappa'/>
+            <stateNode idref='popSize'/>
+            <stateNode idref='hky.frequencies'/>
+            <stateNode idref='tree'/>
+        </state>
+
+        <distribution spec="CompoundDistribution" id="posterior">
+            <distribution spec="CompoundDistribution" id="prior">
+                <distribution id="hky.kappa.prior" spec="beast.math.distributions.Prior" x="@hky.kappa">
+                    <distr id="LogNormalDistributionModel" M="1.0" S="1.25" meanInRealSpace="false" spec="beast.math.distributions.LogNormalDistributionModel"/>
+                </distribution>
+                <distribution id="hky.frequencies.prior" spec="beast.math.distributions.Prior" x="@hky.frequencies">
+                    <distr id="Uniform" lower="0.0" upper="1.0" spec="beast.math.distributions.Uniform"/>
+                </distribution>
+                <distribution id="popSize.prior" spec="beast.math.distributions.Prior" x="@popSize">
+                    <distr id="OneOnX" offset="0.0" spec="beast.math.distributions.OneOnX"/>
+                </distribution>
+
+                <distribution id="coalescent" spec="Coalescent">
+                    <treeIntervals spec='TreeIntervals' id='TreeIntervals'>
+                        <tree idref="tree"/>
+                    </treeIntervals>
+                    <populationModel spec="ConstantPopulation">
+                        <popSize idref="popSize"/>
+                    </populationModel>
+                </distribution>
+            </distribution>
+            <distribution id='likelihood' idref="treeLikelihood"/>
+        </distribution>
+
+        <operator id='kappaScaler' spec='ScaleOperator' scaleFactor="0.75" weight="0.1" parameter="@hky.kappa"/>
+        <operator id='frequenciesDelta' spec='DeltaExchangeOperator' delta="0.01" weight="0.1"
+                  parameter="@hky.frequencies"/>
+        <operator id='popSizeScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3" parameter="@popSize"/>
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3" tree="@tree"/>
+        <operator spec='Uniform' weight="30" tree="@tree"/>
+        <operator spec='SubtreeSlide' weight="15" gaussian="true" size="0.0077" tree="@tree"/>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="15" tree="@tree"/>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="3" tree="@tree"/>
+        <operator spec='WilsonBalding' weight="1" tree="@tree"/>
+        <operator spec='UpDownOperator' scaleFactor="0.75" weight="3" down="@tree"/>
+
+        <logger logEvery="1000" fileName="test.$(seed).log">
+            <model idref='posterior'/>
+            <log idref="posterior"/>
+            <log idref="prior"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+            <log idref="popSize"/>
+            <log idref="hky.kappa"/>
+            <log idref="hky.frequencies"/>
+            <log idref="clockRate"/>
+            <log idref="likelihood"/>
+            <log idref="coalescent"/>                                           
+        </logger>
+<!--         <logger logEvery="1000" fileName="test.$(seed).trees">
+            <log idref="tree"/>
+        </logger>        -->
+        <logger logEvery="10000">
+            <model idref='posterior'/>
+            <log idref="posterior"/>
+            <log idref="prior"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+            <log idref="popSize"/>
+            <log idref="hky.kappa"/>
+            <log idref="hky.frequencies"/>
+            <log idref="likelihood"/>
+            <log idref="coalescent"/>
+        </logger>
+    </run>
+
+</beast>
diff --git a/examples/beast2vs1/testStrictClock2.xml b/examples/beast2vs1/testStrictClock2.xml
new file mode 100644
index 0000000..948ecb0
--- /dev/null
+++ b/examples/beast2vs1/testStrictClock2.xml
@@ -0,0 +1,128 @@
+<beast version='2.0'
+       namespace='beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.branchratemodel:beast.evolution.likelihood:beast.core.parameter'>
+
+    <!-- same as testStrictClockNoDate2.xml in BEAST 1                            -->
+    <!-- The sequence alignment (each sequence refers to a taxon above).         -->
+    <!-- ntax=6 nchar=768                                                        -->
+    <!-- npatterns=69                                                            -->
+    <data id="alignment" dataType="nucleotide">
+        <sequence taxon="human">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="chimp">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="bonobo">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAGC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTTGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="gorilla">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTAAACATAGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA-CAACACTTAATTTCTGTAAGGACTGCAAAACCCTACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCAATGGGACTCAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAT-TCAC [...]
+        </sequence>
+        <sequence taxon="orangutan">
+            AGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA-CAGCACTTAATTTCTGTAAGGACTGCAAAACCCCACTTTGCATCAACTGAGCGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCCTAGACCGATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAT-TGGCTTCAGTCCAAAGCCCCGGCAGGCCTTAAAGCTGCTCCTTCGAATTTGCAATTCAACATGACAA-TCAC [...]
+        </sequence>
+        <sequence taxon="siamang">
+            AGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTAACAAAACTTAATTTCTGCAAGGGCTGCAAAACCCTACTTTGCATCAACCGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCGATGGGACTTAAACCCATAAAAATTTAGTTAACAGCTAAACACCCTAAACAACCTGGCTTCAATCTAAAGCCCCGGCAGA-GTTGAAGCTGCTTCTTTGAACTTGCAATTCAACGTGAAAAATCAC [...]
+        </sequence>
+    </data>
+
+    <!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+    <input spec='HKY' id="hky">
+        <parameter name='kappa' idref='hky.kappa'/>
+        <frequencies id='freqs' spec='Frequencies'>
+            <data idref='alignment'/>
+        </frequencies>
+    </input>
+
+    <!-- site model                                                              -->
+    <input spec='SiteModel' id="siteModel">
+        <!--<parameter name='mutationRate'>1.0</parameter>-->
+        <substModel idref='hky'/>
+    </input>
+
+
+    <input spec='StrictClockModel' id="branchRates">
+        <parameter name='clock.rate' id='clockRate' value="1.0"/>
+    </input>
+
+    <input spec='TreeLikelihood' id="treeLikelihood">
+        <data idref="alignment"/>
+        <tree idref="tree"/>
+        <siteModel idref="siteModel"/>
+        <branchRateModel idref="branchRates"/>
+    </input>
+
+    <input spec='beast.util.ClusterTree' id='tree' clusterType='upgma'>
+        <!--trait idref='rateCategories'/-->
+        <taxa idref='alignment'/>
+    </input>
+
+    <parameter id="hky.kappa" value="2.0" lower="0.0"/>
+    <parameter id="popSize" value="0.077" lower="0.0"/>
+
+    <run spec="MCMC" id="mcmc" chainLength="10000000"> <!--autoOptimize="true"-->
+        <state>
+            <stateNode idref='hky.kappa'/>
+            <stateNode idref='popSize'/>
+            <stateNode idref='tree'/>
+        </state>
+
+        <distribution spec="CompoundDistribution" id="posterior">
+            <distribution spec="CompoundDistribution" id="prior">
+                <distribution id="hky.kappa.prior" spec="beast.math.distributions.Prior" x="@hky.kappa">
+                    <distr id="LogNormalDistributionModel" M="1.0" S="1.25" meanInRealSpace="false"
+                                  spec="beast.math.distributions.LogNormalDistributionModel"/>
+                </distribution>
+                <distribution id="popSize.prior" spec="beast.math.distributions.Prior" x="@popSize">
+                    <distr id="OneOnX" offset="0.0" spec="beast.math.distributions.OneOnX"/>
+                </distribution>
+
+                <distribution id="coalescent" spec="Coalescent">
+                    <treeIntervals spec='TreeIntervals' id='TreeIntervals'>
+                        <tree idref="tree"/>
+                    </treeIntervals>
+                    <populationModel spec="ConstantPopulation">
+                        <popSize idref="popSize"/>
+                    </populationModel>
+                </distribution>
+            </distribution>
+            <distribution id='likelihood' idref="treeLikelihood"/>
+        </distribution>
+
+        <operator id='kappaScaler' spec='ScaleOperator' scaleFactor="0.75" weight="0.1" parameter="@hky.kappa"/>
+        <operator id='popSizeScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3" parameter="@popSize"/>
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3" tree="@tree"/>
+        <operator spec='Uniform' weight="30" tree="@tree"/>
+        <operator spec='SubtreeSlide' weight="15" gaussian="true" size="0.0077" tree="@tree"/>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="15" tree="@tree"/>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="3" tree="@tree"/>
+        <operator spec='WilsonBalding' weight="1" tree="@tree"/>
+        <operator spec='UpDownOperator' scaleFactor="0.75" weight="3" down="@tree"/>
+
+        <logger logEvery="1000" fileName="test.$(seed).log">
+            <model idref='posterior'/>
+            <log idref="posterior"/>
+            <log idref="prior"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+            <log idref="popSize"/>
+            <log idref="hky.kappa"/>
+            <log idref="clockRate"/>
+            <log idref="likelihood"/>
+            <log idref="coalescent"/>
+        </logger>
+<!--         <logger logEvery="1000" fileName="test.$(seed).trees">
+            <log idref="tree"/>
+        </logger>             -->
+        <logger logEvery="10000">
+            <model idref='posterior'/>
+            <log idref="coalescent"/>
+            <log idref="likelihood"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+            <log idref="popSize"/>
+            <log idref="hky.kappa"/>
+            <log idref="posterior"/>
+            <log idref="prior"/>
+        </logger>
+    </run>
+
+</beast>
diff --git a/examples/beast2vs1/testStrictClockTipDatesSampling.xml b/examples/beast2vs1/testStrictClockTipDatesSampling.xml
new file mode 100644
index 0000000..67107e8
--- /dev/null
+++ b/examples/beast2vs1/testStrictClockTipDatesSampling.xml
@@ -0,0 +1,227 @@
+<beast version='2.0'
+       namespace='beast.math:beast.evolution.alignment:beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.branchratemodel:beast.evolution.likelihood:beast.core.parameter'>
+
+    <!-- 17 taxa, 1485 sites, 138 patterns -->
+    <data dataType="nucleotide" id="alignment">
+        <sequence taxon="TREESPARROW_HENAN_1_2004">
+            ATGGAGAAAATAGTGCTTCTTCGTGCAATGATCAATCTTGTTAAAAGTGATCAGATTGGCGTTGGTTACCATGCAGACTACTCGACAGAGCAGGGTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCTCAAGACATATTGGAAAAGACACACAACGGGAAGCTCTGCGACCTAGATGGAGTGAAGCCTCTAATTTTGAAAGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCAATGTGTGACGAATTCATCAATGTGCCGGAGTGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTACCCAGGGGATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAAAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCGATCATGAAGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCTGGGGAAGCCCTCCTTTTTC [...]
+        </sequence>
+        <sequence taxon="HUMAN_VIETNAM_CL105_2005">
+            ATGGAGAAAATAGTGCTTCTTTTTGCGATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGCGATCTAGATGGAGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTACTCGGAAACCCAATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGTCAATCCAGTCAATGACCTCTGTTACCCAGGGGTTTTCAATGACTATGAAGAATTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAGTCATGAAGCCTCATTAGGGGTGAGCTCAGTATGTCCATACCAGGGAAAGTCCTCCTTTTTC [...]
+        </sequence>
+        <sequence taxon="TREESPARROW_HENAN_4_2004">
+            ATGGAGAAAATAGTGCTTCTTCTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGCAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGCGATCTAGATGGAGTGAAACCTCTAATTTTAAGAGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCAATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTACCCAGGGGATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCGATCATGAAGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCAGGGGAGTCCCTCCTTTTTC [...]
+        </sequence>
+        <sequence taxon="CHICKEN_HEBEI_326_2005">
+            ATGGAGAGAATAGTGCTTCTTCTTGCAATAATCGGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCTCAAGACATACTGGAGAAGACACACAACGGGAAGCTCTGCAACCCAGATGGAGTGAAGCCTCTAATTTTGAAAGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCAATGTGTGACGAATTTATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGGCCTCTGTTACCCAGGGGATTTCAATGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCGATCATGGAGCCTCATCAGGGGTGAGCTCAGCATGTTCCTATCTGGGGAAGCCCTCCTTTTTC [...]
+        </sequence>
+        <sequence taxon="CHICKEN_HONGKONG_915_1997">
+            ATGGAGAAAATAGTGCTTCTTCTTGCAACAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAATGTTACTGTTACACATGCCCAAGACATACTGGAAAGGACACACAACGGGAAGCTCTGCGATCTAAATGGAGTGAAACCTCTCATTTTGAGGGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCTATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTATCCAGGGAATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAATCATGATGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCTTGGGAGGTCCTCCTTTTTC [...]
+        </sequence>
+        <sequence taxon="VIETNAM_3062_2004">
+            ATGGAGAAAATAGTGCTTCTTTTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGCGATCTAGATGGAGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCAATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAATCCAGTCAATGACCTCTGTTACCCAGGGGATTTCAATGACTATGAAGAATTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAGTCATGAAGCCTCATTAGGAGTGAGCTCAGCATGTCCATACCAGGGAAAGTCCTCCTTTTTC [...]
+        </sequence>
+        <sequence taxon="GOOSE_HONGKONG_W355_1997">
+            ATGGAGAAAATAGTGCTTCTTCTTGCAACAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAATGTTACTGTTACACATGCCCAAGACATACTGGAAAGGACACACAACGGGAAGCTCTGCGATCTAAATGGAGTGAAACCTCTCATTTTGAGGGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCTATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTATCCAGGGAATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAATCATGATGCCTCATCAGGGGTTAGCTCAGCATGTCCATACCTTGGGAGGTCCTCCTTTTTC [...]
+        </sequence>
+        <sequence taxon="DUCK_HONGKONG_Y283_1997">
+            ATGGAGAAAATAGTGCTTCTTCTTGCAACAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAATGTTACTGTTACACATGCCCAAGACATACTGGAAAGGACACACAACGGGAAGCTCTGCGATCTAAATGGAGTGAAACCTCTCATTTTGAGGGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCTATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTATCCAGGGAATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAATCATGATGCCTCATCAGGGGTTAGCTCAGCATGTCCATACCTTGGGAGGTCCTCCTTTTTC [...]
+        </sequence>
+        <sequence taxon="DUCK_VIETNAM_376_2005">
+            ATGGAGAAAATAGTGCTTCTTTTTGCGATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCAACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGCGATCTAGATGGAGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCAATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAATCCAGTCAATGACCTCTGTTACCCAGGGGATTTCAATGACTATGAAGAATTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAGTCATGAAGCCTCATTAGGAGTGAGCTCAGCATGTCCATACCAGGGAAATCCCTCCTTTTTC [...]
+        </sequence>
+        <sequence taxon="MALLARD_VIETNAM_16_2003">
+            ATGGAGAAAATAGTGCTTCTTTTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGCGATCTAGATGGAGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCAATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAATCCAGTCAATGACCTCTGTTACCCAGGGGATTTCAATGAATATGAAGAATTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAGTCATGAAGCCTCATTAGGGGTGAGCTCAGCATGTCCATACCAGGGAAAGTCCTCCTTTTTC [...]
+        </sequence>
+        <sequence taxon="CHICKEN_THAILAND_KANCHANABURI_CK_160_2005">
+            ATGGAGAAAATAGTGCTTCTTTTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCAACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGTGATCTAGATGGAGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTCCTTGGAAACCCAATGTGTGATGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAATCCAGCCAATGACCTCTGTTACCCAGGGGATTTCAATGACTATGAAGAATTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAGTCATGAAGCCTCATTAGGAGTGAGCTCAGCATGTCCATATCAGGGAAAGTCCTCCTTTTTC [...]
+        </sequence>
+        <sequence taxon="DUCK_GUANGZHOU_20_2005">
+            ATGGAGAAAATAGTGCTTCTTCTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAATGGGAAGCTCTGCGACCTAGATGGGGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTCCTCGGGAACCCAATGTGTGACGAATTCATCAATGTACCGGAATGGTCTTACATAGTGGAGAAGGCCAATCCAGCCAATGACCTCTGTTACCCAGGTGATTTCAACGATTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAACCATGAATCCTCATCAGGGGTGAGCTCAGCATGTCCATACCTGGGAAAGCCCTCCTTTTTC [...]
+        </sequence>
+        <sequence taxon="CK_HK_WF157_2003">
+            ATGGAGAAAATAGTGCTTCTTCTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACCCACAACGGGAAGCTCTGCGACCTAGATGGAGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTCCTCGGGAACCCAATGTGTGACGAATTCATCAATGTACCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCATCCAATGACCTCTGTTACCCAGGGGATTTCAACAATTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGCTCTTGGTCCAATCATGAAGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCTGGGAAAGCCCTCCTTTTTC [...]
+        </sequence>
+        <sequence taxon="SWINE_ANHUI_2004">
+            ATGGAGAAAATAGTGCTTCTTCTTGCAATAGTCAGTCTTGTTAAAGGTGATCAGATTTGCACTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCTCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGCGACCTAGATGGAGTGAAGCCTCTAATTTTAAGAGATTGTAGTGTAGCTGGATGGCTCCTCGGGAACCCAATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAATCCAGCCAATGACCTCTGTTACCCAGGGGATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCGATCATGAAGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCAGGGAAGGTCCTCCTTTTTC [...]
+        </sequence>
+        <sequence taxon="DUCK_VIETNAM_272_2005">
+            ATGGAGAAAATAGTGCTTCTTTTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGCGATCTAGATGGAGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTCCTTGGAAATCCAATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAATCCAGTCAATGACCTCTGTTACCCAGGGGATTTCAATGACTATGAAGAATTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGCCCAGTCATGAAGCCTCATTAGGGGTGAGCTCAGCATGTCCATACCAGGGAAGGTCCTCCTTTTTC [...]
+        </sequence>
+        <sequence taxon="HONGKONG_1997_1998">
+            ------------------------------------------------GACCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGATACAATAATGGAAAAGAATGTTACTGTTACACATGCCCAAGACATACTGGAAAGGACACACGACGGGAAGCTCTGCGATCTAAATGGAGTGAAACCTCTCATTTTGAGGGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCTATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTATCCAGGGAATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAATCATGATGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCTTGGGAGGTCCTCCTTTTTC [...]
+        </sequence>
+        <sequence taxon="GOOSE_SHANTOU_2216_2005">
+            ATGGAGAAAATAGTGCTTCTTCTTGCAATAATCAGCCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAATGGGAAGCTCTGCGACTTAGATGGGGTGAAGCCTCTAATTTTGAGAGACTGTAGTGTAGCTGGATGGCTCCTCGGGAACCCAATGTGTGACGAATTCATCAATGTACCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTACCCAGGTGATTTCAACGATTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAATCATGAAGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCTGGGAAAGCCCTCCTTTTTC [...]
+        </sequence>
+        <sequence taxon="TREESPARROW_HENAN_3_2004">
+            ATGGAGAAAATAGTGCTTCTTCTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACTATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGCGATCTAGATGGAGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCAATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTACCCAGGGGATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCGGATCATCCCCAAAAGTTCTTGGTCCAATCATGATGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCAGGGGAAGCCCTCCTTTTTC [...]
+        </sequence>
+        <sequence taxon="PEREGRINEFALCON_HK_D0028_2004">
+            ATGGAGAAAATAGTGCTTCTTCTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAATGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAATGGGAAGCTCTGTGACCTAGATGGGGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTCGCTGGATGGCTCCTCGGGAACCCAATGTGTGACGAATTCATCAATGTACCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTACCCAGGTGATTTCAACGATTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAATCATGAAGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCTGGGAAAGCCCTCCTTTTTC [...]
+        </sequence>
+        <sequence taxon="TREESPARROW_HENAN_2_2004">
+            ATGGAGAAAATAGTGCTTCTTCTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCTCAAGACATATTGGAAAAGACACACAACGGGAAGCTCTGCGACCTAGATGGAGTGAAGCCTCTAATTTTGAAAGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCAATGTGTGACGAATTCATCAATGTGCCGGAGTGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTACCCAGGGGATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAAAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCGATCATGAAGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCTGGGGAAGCCCTCCTTTTTC [...]
+        </sequence>
+        <sequence taxon="HONGKONG_538_1997">
+            ------------------------------------------------GATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAATGTTACTGTTACACATGCCCAAGACATACTGGAAAGGACACACAACGGGAAGCTCTGCGATCTAAATGGAGTGAAACCTCTCATTTTGAGGGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCTATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTATCCAGGGAATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAATCATGATGCCTCATCAGGGGTGAGCTCAGCATGTCCATACCTTGGGAGGTCCTCCTTTTTC [...]
+        </sequence>
+
+    </data>
+
+    <tree spec='beast.util.ClusterTree' id='tree' clusterType='upgma'>
+        <trait spec='beast.evolution.tree.TraitSet' traitname='date-forward' units='year'
+               value='
+		TREESPARROW_HENAN_1_2004=2004.0,
+		HUMAN_VIETNAM_CL105_2005=2005.0,
+		TREESPARROW_HENAN_4_2004=2004.0,
+		CHICKEN_HEBEI_326_2005=2005.0,
+		CHICKEN_HONGKONG_915_1997=1997.0,
+		VIETNAM_3062_2004=2004.0,
+		GOOSE_HONGKONG_W355_1997=1997.0,
+		DUCK_HONGKONG_Y283_1997=1997.0,
+		DUCK_VIETNAM_376_2005=2005.0,
+		MALLARD_VIETNAM_16_2003=2003.0,
+		CHICKEN_THAILAND_KANCHANABURI_CK_160_2005=2005.0,
+		DUCK_GUANGZHOU_20_2005=2005.0,
+		CK_HK_WF157_2003=2003.0,
+		SWINE_ANHUI_2004=2004.0,
+		DUCK_VIETNAM_272_2005=2005.0,
+		HONGKONG_1997_1998=1998.0,
+		GOOSE_SHANTOU_2216_2005=2005.0,
+		TREESPARROW_HENAN_3_2004=2004.0,
+		PEREGRINEFALCON_HK_D0028_2004=2004.0,
+		TREESPARROW_HENAN_2_2004=2004.0,
+		HONGKONG_538_1997=1997.0'>
+            <taxa spec='beast.evolution.alignment.TaxonSet' alignment='@alignment'/>
+        </trait>
+        <taxa idref='alignment'/>
+    </tree>
+
+    <!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985) -->
+    <input spec='HKY' id="hky">
+        <parameter name='kappa' idref='hky.kappa'/>
+        <input id='freqs' name='frequencies' spec='Frequencies' frequencies='@hky.frequencies'/>
+    </input>
+
+    <!-- site model -->
+    <input spec='SiteModel' id="siteModel">
+        <!--<parameter name='mutationRate'>1.0</parameter> -->
+        <substModel idref='hky'/>
+    </input>
+
+    <input spec='StrictClockModel' id="branchRates">
+        <clock.rate idref='clockRate'/>
+    </input>
+
+    <input spec='TreeLikelihood' id="treeLikelihood">
+        <data idref="alignment"/>
+        <tree idref="tree"/>
+        <siteModel idref="siteModel"/>
+        <branchRateModel idref="branchRates"/>
+    </input>
+
+    <parameter id="hky.kappa" value="2.0" lower="0.0"/>
+    <parameter id="hky.frequencies" value="0.25" dimension="4"/>
+    <parameter id="popSize" value="380.0" lower="0.0" upper="38000.0"/>
+    <parameter id='clockRate' value="2.3E-5" lower="0.0" upper="100.0"/>
+
+    <distribution id="tipDateB" monophyletic="false" spec="distributions.MRCAPrior" tipsonly="true" tree="@tree">
+        <taxonset id="age(CHICKEN_HONGKONG_915_1997)" spec="TaxonSet">
+            <taxon id="CHICKEN_HONGKONG_915_1997" spec="Taxon"/>
+        </taxonset>
+    </distribution>
+
+    <run spec="MCMC" id="mcmc" chainLength="10000000"> <!--autoOptimize="true" -->
+        <state>
+            <stateNode idref='hky.kappa'/>
+            <stateNode idref='popSize'/>
+            <stateNode idref='hky.frequencies'/>
+            <stateNode idref='tree'/>
+            <stateNode idref='clockRate'/>
+        </state>
+
+        <distribution spec="CompoundDistribution" id="posterior">
+            <distribution spec="CompoundDistribution" id="prior">
+                <distribution id="hky.kappa.prior" spec="beast.math.distributions.Prior" x="@hky.kappa">
+                    <distr id="LogNormalDistributionModel" M="1.0" S="1.25" meanInRealSpace="false"
+                           spec="beast.math.distributions.LogNormalDistributionModel"/>
+                </distribution>
+                <distribution id="hky.frequencies.prior" spec="beast.math.distributions.Prior" x="@hky.frequencies">
+                    <distr id="Uniform" lower="0.0" upper="1.0" spec="beast.math.distributions.Uniform"/>
+                </distribution>
+                <distribution id="popSize.prior" spec="beast.math.distributions.Prior" x="@popSize">
+                    <distr id="OneOnX" offset="0.0" spec="beast.math.distributions.OneOnX"/>
+                </distribution>
+                <!--<distribution id="clockRate.prior" spec="beast.math.distributions.Prior" x="@clockRate">-->
+                <!--<distr id="Uniform2" lower="0.0" upper="100.0" spec="beast.math.distributions.Uniform"/>-->
+                <!--</distribution>-->
+
+                <distribution id="tipDateA" monophyletic="false" spec="distributions.MRCAPrior" tipsonly="true"
+                              tree="@tree">
+                    <taxonset id="age(TREESPARROW_HENAN_1_2004)" spec="TaxonSet">
+                        <taxon id="TREESPARROW_HENAN_1_2004" spec="Taxon"/>
+                    </taxonset>
+                    <distr id="Uniform0" offset="0.0" spec="distributions.Uniform" upper="2005"/>
+                </distribution>
+
+                <distribution id="coalescent" spec="Coalescent">
+                    <treeIntervals spec='TreeIntervals' id='TreeIntervals'>
+                        <tree idref="tree"/>
+                    </treeIntervals>
+                    <populationModel spec="ConstantPopulation">
+                        <popSize idref="popSize"/>
+                    </populationModel>
+                </distribution>
+            </distribution>
+            <distribution id='likelihood' idref="treeLikelihood"/>
+        </distribution>
+
+        <operator id="TipDatesRandomWalkerA" windowSize="1" spec="TipDatesRandomWalker"
+                  taxonset="@age(TREESPARROW_HENAN_1_2004)" tree="@tree" weight="1.0"/>
+        <operator id="TipDatesRandomWalkerB" windowSize="1" spec="TipDatesRandomWalker"
+                  taxonset="@age(CHICKEN_HONGKONG_915_1997)" tree="@tree" weight="1.0"/>
+
+        <operator id='kappaScaler' spec='ScaleOperator' scaleFactor="0.75" weight="0.1" parameter="@hky.kappa"/>
+        <operator id='frequenciesDelta' spec='DeltaExchangeOperator' delta="0.01" weight="0.1"
+                  parameter="@hky.frequencies"/>
+        <operator id='popSizeScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3" parameter="@popSize"/>
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3" tree="@tree"/>
+        <operator spec='Uniform' weight="30" tree="@tree"/>
+        <operator spec='SubtreeSlide' weight="15" gaussian="true" size="0.0077" tree="@tree"/>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="15" tree="@tree"/>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="3" tree="@tree"/>
+        <operator spec='WilsonBalding' weight="3" tree="@tree"/>
+        <operator spec='UpDownOperator' scaleFactor="0.75" weight="3" up="@clockRate" down="@tree"/>
+        <operator id='clockRateScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3" parameter="@clockRate"/>
+
+        <logger logEvery="1000" fileName="test.$(seed).log">
+            <model idref='posterior'/>
+            <log idref="posterior"/>
+            <log idref="prior"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+            <log idref="popSize"/>
+            <log idref="hky.kappa"/>
+            <log idref="hky.frequencies"/>
+            <log idref="clockRate"/>
+            <log idref="likelihood"/>
+            <log idref="coalescent"/>
+            <log idref='tipDateA'/>
+            <log idref='tipDateB'/>
+        </logger>
+        <!-- <logger logEvery="1000" fileName="test.$(seed).trees"> <log idref="tree"/> </logger> -->
+        <logger logEvery="100000">
+            <model idref='posterior'/>
+            <log idref="posterior"/>
+            <log idref="prior"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+            <log idref="popSize"/>
+            <log idref="hky.kappa"/>
+            <log idref="hky.frequencies"/>
+            <log idref="clockRate"/>
+            <log idref="likelihood"/>
+            <log idref="coalescent"/>
+        </logger>
+    </run>
+
+</beast>
diff --git a/examples/beast2vs1/testStrictClockTipTime.xml b/examples/beast2vs1/testStrictClockTipTime.xml
new file mode 100644
index 0000000..b756afa
--- /dev/null
+++ b/examples/beast2vs1/testStrictClockTipTime.xml
@@ -0,0 +1,174 @@
+<beast version='2.0'
+	namespace='beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.branchratemodel:beast.evolution.likelihood:beast.core.parameter'>
+
+	<data dataType="nucleotide" id="alignment">
+		<sequence taxon="D4Brazi82">
+			ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTTACAGCCATG [...]
+		</sequence>
+		<sequence taxon="D4ElSal83">
+			ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTTACAGCCATG [...]
+		</sequence>
+		<sequence taxon="D4ElSal94">
+			ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTGGTGCTAGAACATGGAGGATGCGTCACAACCATAGCCCAGGGAAAACCAACCTTGGATTTTGAATTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGGAATGGCTGTGGCTTGCTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGATACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTTACAGCCACG [...]
+		</sequence>
+		<sequence taxon="D4Indon76">
+			ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTAAAAGAGGAACAAGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTTACAGCCACG [...]
+		</sequence>
+		<sequence taxon="D4Indon77">
+			ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTAAAAGAGGAACAAGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTAGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAACCATGGAGTTACAGCCACG [...]
+		</sequence>
+		<sequence taxon="D4Mexico84">
+			ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTAGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGCTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTTACAGCCATG [...]
+		</sequence>
+		<sequence taxon="D4NewCal81">
+			ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTTACAGCCATG [...]
+		</sequence>
+		<sequence taxon="D4Philip64">
+			ATGCGATGCGTGGGAGTGGGGAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATTTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCGATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAACCTTATCTCAAAGAGGAACAAGATCAACAGTACATCTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGATACATCCAACCATGGAGTGACAGCCACG [...]
+		</sequence>
+		<sequence taxon="D4Philip56">
+			ATGCGATGCGTGGGAGTGGGGAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATTTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCGATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAACCTTATCTCAAAGAGGAACAAGATCAACAGTACATCTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGCTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTAGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACATATCCAACCATGGAGTGACAGCCACG [...]
+		</sequence>
+		<sequence taxon="D4Philip84">
+			ATGCGATGCGTAGGAGTGGGGAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACTTAGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAAGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCGATATCAAACATAACCACGGCAACAAGATGCCCAACGCAAGGAGAACCTTATCTCAAAGAGGAACAAGATCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTCTCATGCTCGGGAAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATATACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAACCATGGAGTGACAGCCACG [...]
+		</sequence>
+		<sequence taxon="D4PRico86">
+			ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGGGAGCCCTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATCTGGTCCAAATTGAGAACCTTGAGTACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTTACAGCCACG [...]
+		</sequence>
+		<sequence taxon="D4SLanka78">
+			ATGCGATGCGTGGGAGTGGGGAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAAGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCCATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAGCCCTGTCTCAAAGAGGAACAGGATCAACAGTACATCTGCCGGAGAGACGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCCTGCTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACAGGCAACTTAGTCCGAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAACCACGGAGTGACAGCCACG [...]
+		</sequence>
+		<sequence taxon="D4Tahiti79">
+			ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTTACAGCCACG [...]
+		</sequence>
+		<sequence taxon="D4Tahiti85">
+			ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTTTCAGGTGGAGCATGGGTCGATTTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATCTGGTCCAAATTGAGAACCTTGAATACACAGTGGTCATAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTTACAGCCACG [...]
+		</sequence>
+		<sequence taxon="D4Thai63">
+			ATGCGATGCGTAGGAGTGGGGAACAGGGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCTCAAGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCGATATCAAACATAACCACGGCGACAAGATGTCCAACGCAAGGAGAGCCTTATCTCAAAGAGGAACAAGATCAACAGTACATCTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTACTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACAGGCAACTTGGTTCGAATTGAGAACCTTGAATACACAGTGGTTGTGACAGTCCACAACGGAGACACCCATGCAGTAGGAAATGACATATCCAACCATGGAGTGACAGCCACG [...]
+		</sequence>
+		<sequence taxon="D4Thai78">
+			ATGCGATGCGTAGGAGTGGGGAACAGAGACTTTGTAGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCCATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTACCTCAAAGAGGAACAAGATCAACAGTACATCTGCCGGAGAGACGTGGTAGATAGAGGGTGGGGCAACGGCTGTGGCTTGCTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACAGGCAACTTAGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCTGTAGGAAATGATACATCCAACCACGGAGTGACAGCCACG [...]
+		</sequence>
+		<sequence taxon="D4Thai84">
+			ATGCGATGCGTAGGAGTAGGGAACAGAGACTTTGTAGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAGGGAAAACCAACCCTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCCATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTACCTCAAAGAGGAACAAGATCAACAGTACATCTGCCGGAGAGACGTGGTAGACAGAGGGTGGGGCAACGGCTGTGGCTTGTTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACGGGCAACTTAGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCTGTAGGAAATGATACATCCAACCACGGAGTGACAGCCACG [...]
+		</sequence>
+	</data>
+
+	<!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985) -->
+	<input spec='HKY' id="hky">
+		<parameter name='kappa' idref='hky.kappa' />
+		<input id='freqs' name='frequencies' spec='Frequencies' frequencies='@hky.frequencies' />
+	</input>
+
+	<!-- site model -->
+	<input spec='SiteModel' id="siteModel">
+		<!--<parameter name='mutationRate'>1.0</parameter> -->
+		<substModel idref='hky' />
+	</input>
+	
+	<input spec='StrictClockModel' id="branchRates">
+		<clock.rate idref='clockRate' />
+	</input>
+
+	<input spec='TreeLikelihood' id="treeLikelihood">
+		<data idref="alignment" />
+		<tree idref="tree" />
+		<siteModel idref="siteModel" />
+		<branchRateModel idref="branchRates" />
+	</input>
+
+	<input spec='beast.util.ClusterTree' id='tree' clusterType='upgma'>
+		<trait spec='beast.evolution.tree.TraitSet' traitname='date-forward' units='year'
+			value='
+        D4Brazi82  = 1982, D4ElSal83  = 1983, D4ElSal94  = 1994, D4Indon76  = 1976, D4Indon77  = 1977,
+        D4Mexico84  = 1984, D4NewCal81  = 1981, D4Philip64  = 1964, D4Philip56  = 1956, D4Philip84  = 1984,
+        D4PRico86  = 1986, D4SLanka78  = 1978, D4Tahiti79  = 1979, D4Tahiti85  = 1985, D4Thai63  = 1963,
+        D4Thai78  = 1978, D4Thai84 = 1984'>
+			<taxa spec='beast.evolution.alignment.TaxonSet' alignment='@alignment' />
+		</trait>
+		<taxa idref='alignment' />
+	</input>
+
+	<parameter id="hky.kappa" value="2.0" lower="0.0" />
+	<parameter id="hky.frequencies" value="0.25" dimension="4" />
+	<parameter id="popSize" value="380.0" lower="0.0" upper="38000.0" />
+	<parameter id='clockRate' value="2.3E-5" lower="0.0" upper="100.0" />
+
+	<run spec="MCMC" id="mcmc" chainLength="10000000"> <!--autoOptimize="true" -->
+		<state>
+			<stateNode idref='hky.kappa' />
+			<stateNode idref='popSize' />
+			<stateNode idref='hky.frequencies' />
+			<stateNode idref='tree' />
+			<stateNode idref='clockRate' />
+		</state>
+
+		<distribution spec="CompoundDistribution" id="posterior">
+			<distribution spec="CompoundDistribution" id="prior">
+				<distribution id="hky.kappa.prior" spec="beast.math.distributions.Prior" x="@hky.kappa">
+					<distr id="LogNormalDistributionModel" M="1.0" S="1.25" meanInRealSpace="false"
+						spec="beast.math.distributions.LogNormalDistributionModel" />
+				</distribution>
+				<distribution id="hky.frequencies.prior" spec="beast.math.distributions.Prior" x="@hky.frequencies">
+					<distr id="Uniform" lower="0.0" upper="1.0" spec="beast.math.distributions.Uniform" />
+				</distribution>
+				<distribution id="popSize.prior" spec="beast.math.distributions.Prior" x="@popSize">
+					<distr id="OneOnX" offset="0.0" spec="beast.math.distributions.OneOnX" />
+				</distribution>
+				<distribution id="clockRate.prior" spec="beast.math.distributions.Prior" x="@clockRate">
+					<distr id="Uniform2" lower="0.0" upper="100.0" spec="beast.math.distributions.Uniform" />
+				</distribution>
+
+				<distribution id="coalescent" spec="Coalescent">
+					<treeIntervals spec='TreeIntervals' id='TreeIntervals'>
+						<tree idref="tree" />
+					</treeIntervals>
+					<populationModel spec="ConstantPopulation">
+						<popSize idref="popSize" />
+					</populationModel>
+				</distribution>
+			</distribution>
+			<distribution id='likelihood' idref="treeLikelihood" />
+		</distribution>
+
+		<operator id='kappaScaler' spec='ScaleOperator' scaleFactor="0.75" weight="0.1" parameter="@hky.kappa" />
+		<operator id='frequenciesDelta' spec='DeltaExchangeOperator' delta="0.01" weight="0.1" parameter="@hky.frequencies" />
+		<operator id='popSizeScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3" parameter="@popSize" />
+		<operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3" tree="@tree" />
+		<operator spec='Uniform' weight="30" tree="@tree" />
+		<operator spec='SubtreeSlide' weight="15" gaussian="true" size="0.0077" tree="@tree" />
+		<operator id='narrow' spec='Exchange' isNarrow='true' weight="15" tree="@tree" />
+		<operator id='wide' spec='Exchange' isNarrow='false' weight="3" tree="@tree" />
+		<operator spec='WilsonBalding' weight="3" tree="@tree" />
+		<operator spec='UpDownOperator' scaleFactor="0.75" weight="3" up="@clockRate" down="@tree" />
+		<operator id='clockRateScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3" parameter="@clockRate" />
+
+		<logger logEvery="1000" fileName="test.$(seed).log">
+			<model idref='posterior' />
+			<log idref="posterior" />
+			<log idref="prior" />
+			<log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree' />
+			<log idref="popSize" />
+			<log idref="hky.kappa" />
+			<log idref="hky.frequencies" />
+			<log idref="clockRate" />
+			<log idref="likelihood" />
+			<log idref="coalescent" />
+		</logger>
+		<!-- <logger logEvery="1000" fileName="test.$(seed).trees"> <log idref="tree"/> </logger> -->
+		<logger logEvery="100000">
+			<model idref='posterior' />
+			<log idref="posterior" />
+			<log idref="prior" />
+			<log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree' />
+			<log idref="popSize" />
+			<log idref="hky.kappa" />
+			<log idref="hky.frequencies" />
+			<log idref="clockRate" />
+			<log idref="likelihood" />
+			<log idref="coalescent" />
+		</logger>
+	</run>
+
+</beast>
diff --git a/examples/beast2vs1/testTipDates.xml b/examples/beast2vs1/testTipDates.xml
new file mode 100644
index 0000000..711e024
--- /dev/null
+++ b/examples/beast2vs1/testTipDates.xml
@@ -0,0 +1,162 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beast version='2.0'
+       namespace='beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood'>
+
+    <!-- 17 taxa, 1485 sites, 138 patterns -->
+    <data dataType="nucleotide" id="alignment">
+        <sequence taxon="D4Brazi82">
+
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence taxon="D4ElSal83">
+
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence taxon="D4ElSal94">
+
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTGGTGCTAGAACATGGAGGATGCGTCACAACCATAGCCCAGGGAAAACCAACCTTGGATTTTGAATTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGGAATGGCTGTGGCTTGCTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGATACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence taxon="D4Indon76">
+
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTAAAAGAGGAACAAGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence taxon="D4Indon77">
+
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTAAAAGAGGAACAAGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTAGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAACCATGGAGTT [...]
+        </sequence>
+        <sequence taxon="D4Mexico84">
+
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTAGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGCTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence taxon="D4NewCal81">
+
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence taxon="D4Philip64">
+
+            ATGCGATGCGTGGGAGTGGGGAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATTTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCGATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAACCTTATCTCAAAGAGGAACAAGATCAACAGTACATCTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGATACATCCAACCATGGAGTG [...]
+        </sequence>
+        <sequence taxon="D4Philip56">
+
+            ATGCGATGCGTGGGAGTGGGGAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATTTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCGATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAACCTTATCTCAAAGAGGAACAAGATCAACAGTACATCTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGCTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTAGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACATATCCAACCATGGAGTG [...]
+        </sequence>
+        <sequence taxon="D4Philip84">
+
+            ATGCGATGCGTAGGAGTGGGGAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACTTAGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAAGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCGATATCAAACATAACCACGGCAACAAGATGCCCAACGCAAGGAGAACCTTATCTCAAAGAGGAACAAGATCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTCTCATGCTCGGGAAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATATACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAACCATGGAGTG [...]
+        </sequence>
+        <sequence taxon="D4PRico86">
+
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGGGAGCCCTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATCTGGTCCAAATTGAGAACCTTGAGTACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence taxon="D4SLanka78">
+
+            ATGCGATGCGTGGGAGTGGGGAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAAGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCCATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAGCCCTGTCTCAAAGAGGAACAGGATCAACAGTACATCTGCCGGAGAGACGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCCTGCTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACAGGCAACTTAGTCCGAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAACCACGGAGTG [...]
+        </sequence>
+        <sequence taxon="D4Tahiti79">
+
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence taxon="D4Tahiti85">
+
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTTTCAGGTGGAGCATGGGTCGATTTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATCTGGTCCAAATTGAGAACCTTGAATACACAGTGGTCATAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence taxon="D4Thai63">
+
+            ATGCGATGCGTAGGAGTGGGGAACAGGGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCTCAAGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCGATATCAAACATAACCACGGCGACAAGATGTCCAACGCAAGGAGAGCCTTATCTCAAAGAGGAACAAGATCAACAGTACATCTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTACTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACAGGCAACTTGGTTCGAATTGAGAACCTTGAATACACAGTGGTTGTGACAGTCCACAACGGAGACACCCATGCAGTAGGAAATGACATATCCAACCATGGAGTG [...]
+        </sequence>
+        <sequence taxon="D4Thai78">
+
+            ATGCGATGCGTAGGAGTGGGGAACAGAGACTTTGTAGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCCATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTACCTCAAAGAGGAACAAGATCAACAGTACATCTGCCGGAGAGACGTGGTAGATAGAGGGTGGGGCAACGGCTGTGGCTTGCTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACAGGCAACTTAGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCTGTAGGAAATGATACATCCAACCACGGAGTG [...]
+        </sequence>
+        <sequence taxon="D4Thai84">
+
+            ATGCGATGCGTAGGAGTAGGGAACAGAGACTTTGTAGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAGGGAAAACCAACCCTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCCATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTACCTCAAAGAGGAACAAGATCAACAGTACATCTGCCGGAGAGACGTGGTAGACAGAGGGTGGGGCAACGGCTGTGGCTTGTTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACGGGCAACTTAGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCTGTAGGAAATGATACATCCAACCACGGAGTG [...]
+        </sequence>
+    </data>
+
+
+    <!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+    <input spec='HKY' id="hky">
+        <parameter name='kappa' idref='hky.kappa'/>
+        <input id='freqs' name='frequencies' spec='Frequencies'>
+            <parameter name='frequencies' idref='hky.frequencies'/>
+        </input>
+    </input>
+
+    <!-- site model                                                              -->
+    <input spec='SiteModel' id="siteModel">
+        <input name='substModel' idref='hky'/>
+    </input>
+
+    <input spec='TreeLikelihood' id="treeLikelihood">
+        <input name='data' idref="alignment"/>
+        <input name='tree' idref="tree"/>
+        <input name='siteModel' idref="siteModel"/>
+    </input>
+
+    <parameter id="hky.kappa" value="2.0" lower="0.0"/>
+    <parameter id="hky.frequencies" value="0.25" dimension="4"/>
+
+
+    <tree spec='beast.util.ClusterTree' id='tree' clusterType='upgma'>
+        <trait spec='beast.evolution.tree.TraitSet' traitname='date-forward' units='year'
+               value='
+		D4Brazi82  = 1982,
+		D4ElSal83  = 1983,
+		D4ElSal94  = 1994,
+		D4Indon76  = 1976,
+		D4Indon77  = 1977,
+		D4Mexico84 = 1984,
+		D4NewCal81 = 1981,
+		D4Philip64 = 1964,
+		D4Philip56 = 1956,
+		D4Philip84 = 1984,
+		D4PRico86  = 1986,
+		D4SLanka78 = 1978,
+		D4Tahiti79 = 1979,
+		D4Tahiti85 = 1985,
+		D4Thai63   = 1963,
+		D4Thai78   = 1978,
+		D4Thai84   = 1984'>
+		<taxa spec='beast.evolution.alignment.TaxonSet' alignment='@alignment'/>
+        </trait>
+        <taxa idref='alignment'/>
+    </tree>
+
+
+    <run spec="MCMC" id="mcmc" chainLength="1000000"> <!--autoOptimize="true"-->
+        <state>
+            <input name='stateNode' idref="hky.kappa"/>
+            <input name='stateNode' idref='hky.frequencies'/>
+            <input name='stateNode' idref="tree"/>
+        </state>
+
+        <distribution id='likelihood' idref="treeLikelihood"/>
+
+        <operator id='kappaScaler' spec='ScaleOperator' scaleFactor="0.75" weight="0.1" parameter="@hky.kappa"/>
+        <operator id='frequenciesDelta' spec='DeltaExchangeOperator' delta="0.01" weight="0.1"
+                  parameter="@hky.frequencies"/>
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3" tree="@tree"/>
+        <operator spec='Uniform' weight="30" tree="@tree"/>
+        <operator spec='SubtreeSlide' weight="15" gaussian="true" size="38" tree="@tree"/>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="15" tree="@tree"/>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="3" tree="@tree"/>
+        <operator spec='WilsonBalding' weight="3" tree="@tree"/>
+
+        <logger logEvery="1000" fileName="test.$(seed).log">
+            <log idref="likelihood"/>
+            <log idref="hky.kappa"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+        </logger>
+        <!--         <logger logEvery="10000" fileName="test.$(seed).trees">
+<log idref="tree"/>
+</logger>              -->
+        <logger logEvery="100000">
+            <log idref="likelihood"/>
+            <log idref="hky.kappa"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+        </logger>
+
+    </run>
+</beast>
+
diff --git a/examples/beast2vs1/testUCRelaxedClockLogNormal.xml b/examples/beast2vs1/testUCRelaxedClockLogNormal.xml
new file mode 100644
index 0000000..a970a88
--- /dev/null
+++ b/examples/beast2vs1/testUCRelaxedClockLogNormal.xml
@@ -0,0 +1,148 @@
+<beast version='2.0'
+    namespace='beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.branchratemodel:beast.evolution.likelihood:beast.core.parameter'>
+
+
+    <!-- The sequence alignment (each sequence refers to a taxon above). -->
+    <!-- ntax=6 nchar=768 -->
+    <!-- npatterns=69 -->
+    <data id="alignment" dataType="nucleotide">
+        <sequence taxon="human">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="chimp">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="bonobo">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAGC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTTGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="gorilla">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTAAACATAGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA-CAACACTTAATTTCTGTAAGGACTGCAAAACCCTACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCAATGGGACTCAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAT-TCAC [...]
+        </sequence>
+        <sequence taxon="orangutan">
+            AGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA-CAGCACTTAATTTCTGTAAGGACTGCAAAACCCCACTTTGCATCAACTGAGCGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCCTAGACCGATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAT-TGGCTTCAGTCCAAAGCCCCGGCAGGCCTTAAAGCTGCTCCTTCGAATTTGCAATTCAACATGACAA-TCAC [...]
+        </sequence>
+        <sequence taxon="siamang">
+            AGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTAACAAAACTTAATTTCTGCAAGGGCTGCAAAACCCTACTTTGCATCAACCGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCGATGGGACTTAAACCCATAAAAATTTAGTTAACAGCTAAACACCCTAAACAACCTGGCTTCAATCTAAAGCCCCGGCAGA-GTTGAAGCTGCTTCTTTGAACTTGCAATTCAACGTGAAAAATCAC [...]
+        </sequence>
+    </data>
+
+    <!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985) -->
+    <input spec='HKY' id="hky">
+        <parameter name='kappa' idref='hky.kappa' />
+        <input id='freqs' name='frequencies' spec='Frequencies' frequencies='@hky.frequencies' />
+    </input>
+
+    <!-- site model -->
+    <input spec='SiteModel' id="siteModel">
+        <!--<parameter name='mutationRate'>1.0</parameter> -->
+        <substModel idref='hky' />
+    </input>
+
+
+    <input spec='UCRelaxedClockModel' id="branchRates">
+        <!-- <parameter name='mutationRate'>1.0</parameter> -->
+        <distr id='lognormal' spec="beast.math.distributions.LogNormalDistributionModel" meanInRealSpace="true">
+            <parameter name='M' id='M' value="1" lower="0.0" />
+            <parameter name='S' id='S' value="0.3333333333333333" lower="0" />
+        </distr>
+        <parameter spec='IntegerParameter' name='rateCategories' id='rateCategories' dimension="11" value="1" />
+        <tree idref="tree" />
+    </input> 
+
+    <input spec='TreeLikelihood' id="treeLikelihood">
+        <data idref="alignment" />
+        <tree idref="tree" />
+        <siteModel idref="siteModel" />
+        <branchRateModel idref="branchRates" /> 
+    </input>
+
+    <tree spec='beast.util.TreeParser' id='tree' IsLabelledNewick='true' newick=
+            '(siamang:0.06318470579939774,((gorilla:0.031056173315146828,((chimp:0.00982869388112981,bonobo:0.00982869388112981)
+        :0.01030402958978773,human:0.02013272347091754):0.010923449844229289):0.022256750048834654,orangutan:0.05331292336398148)
+        :0.009871782435416254);'
+          taxa='@alignment'/>
+
+    <parameter id="hky.kappa" value="2.0" lower="0.0" />
+    <parameter id="hky.frequencies" value="0.25" dimension="4" />
+    <parameter id="popSize" value="0.077" lower="0.0" />
+
+    <run spec="MCMC" id="mcmc" chainLength="10000000"> <!--autoOptimize="true" -->
+
+        <distribution spec="CompoundDistribution" id="posterior">
+            <distribution spec="CompoundDistribution" id="prior">
+                <distribution id="hky.kappa.prior" spec="beast.math.distributions.Prior" x="@hky.kappa">
+                    <distr id="LogNormalDistributionModel" M="1.0" S="1.25" meanInRealSpace="false"
+                        spec="beast.math.distributions.LogNormalDistributionModel" />
+                </distribution>
+                <distribution id="hky.frequencies.prior" spec="beast.math.distributions.Prior" x="@hky.frequencies">
+                    <distr id="Uniform" lower="0.0" upper="1.0" spec="beast.math.distributions.Uniform" />
+                </distribution>
+                <distribution id="popSize.prior" spec="beast.math.distributions.Prior" x="@popSize">
+                    <distr id="OneOnX" offset="0.0" spec="beast.math.distributions.OneOnX" />
+                </distribution>
+                <distribution id="S.prior" spec="beast.math.distributions.Prior" x="@S">
+                    <distr id="Exponential" mean="0.3333333333333333" spec="beast.math.distributions.Exponential" />
+                </distribution>   
+
+                <distribution id="coalescent" spec="Coalescent">
+                    <treeIntervals spec='TreeIntervals' id='TreeIntervals'>
+                        <tree idref="tree" />
+                    </treeIntervals>
+                    <populationModel spec="ConstantPopulation">
+                        <popSize idref="popSize" />
+                    </populationModel>
+                </distribution>
+            </distribution>
+            <distribution id='likelihood' idref="treeLikelihood" />
+        </distribution>
+
+        <operator id='SScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3">
+            <parameter idref="S" />
+        </operator>  
+        <operator id="CategoriesRandomWalk" spec="IntRandomWalkOperator" windowSize='1' weight="10" parameter="@rateCategories" />
+        <operator id='CategoriesSwapOperator' spec='SwapOperator' howMany="1" weight="10" intparameter='@rateCategories' />
+        <operator id='CategoriesUniform' spec='UniformOperator' weight="10" parameter='@rateCategories' /> 
+
+        <operator id='kappaScaler' spec='ScaleOperator' scaleFactor="0.75" weight="0.1" parameter="@hky.kappa" />
+        <operator id='frequenciesDelta' spec='DeltaExchangeOperator' delta="0.01" weight="0.1" parameter="@hky.frequencies" />
+        <operator id='popSizeScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3" parameter="@popSize" />
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3" tree="@tree" />
+        <operator spec='Uniform' weight="30" tree="@tree" />
+        <operator spec='SubtreeSlide' weight="15" gaussian="true" size="0.0077" tree="@tree" />
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="15" tree="@tree" />
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="3" tree="@tree" />
+        <operator spec='WilsonBalding' weight="1" tree="@tree" />
+        <operator spec='UpDownOperator' scaleFactor="0.75" weight="3" down="@tree" /> 
+
+        <logger logEvery="10000" fileName="test.$(seed).log">
+            <model idref='posterior' />
+            <log idref="posterior" />
+            <log idref="prior" />
+            <log idref="treeLikelihood" />
+            <log idref="coalescent" />
+            <log idref="popSize" />
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree' />
+            <log idref="hky.kappa" />
+            <log idref="hky.frequencies" />
+            <log idref="M" />
+            <log idref="S" />
+            <log id='rate' spec='RateStatistic' tree='@tree' branchratemodel='@branchRates'/>
+            <log idref="rateCategories" /> 
+        </logger>
+        <!-- <logger logEvery="10000" fileName="test.$(seed).trees">
+            <log idref="tree" />
+        </logger> -->
+        <logger logEvery="100000">
+            <model idref='posterior' />
+            <log idref="posterior" />
+            <log idref="coalescent" />
+            <log idref="treeLikelihood" />
+            <log idref="popSize" />
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree' />
+            <log idref="hky.kappa" />
+            <log idref="S" />
+            <log idref="rateCategories" /> 
+        </logger>
+    </run>
+
+</beast>
diff --git a/examples/beast2vs1/testYuleModel_10taxa.xml b/examples/beast2vs1/testYuleModel_10taxa.xml
new file mode 100644
index 0000000..693b754
--- /dev/null
+++ b/examples/beast2vs1/testYuleModel_10taxa.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0" standalone="yes"?>
+<!-- test Yule birth model and Birth Death model per Gernhard 2008-->
+<beast version='2.0'
+       namespace='beast.evolution.speciation:beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood'>
+
+    <data id="alignment" dataType="nucleotide">
+        <sequence taxon="A">A</sequence>
+        <sequence taxon="B">A</sequence>
+        <sequence taxon="C">A</sequence>
+        <sequence taxon="D">A</sequence>
+        <sequence taxon="E">A</sequence>
+        <sequence taxon="F">A</sequence>
+        <sequence taxon="G">A</sequence>
+        <sequence taxon="H">A</sequence>
+        <sequence taxon="I">A</sequence>
+        <sequence taxon="J">A</sequence>
+    </data>
+
+    <input spec='beast.util.ClusterTree' id='tree' clusterType='upgma'>
+        <taxa idref='alignment'/>
+    </input>
+
+    <!-- A prior on the distribution node heights defined given                  -->
+    <!-- a Yule speciation process (a pure birth process).                       -->
+    <input spec='YuleModel' id="yule">
+        <birthDiffRate idref="birthRate"/>
+        <tree idref='tree'/>
+    </input>
+
+    <parameter id="birthRate" value="2.0" lower="0.0" upper="100.0"/>
+
+    <run spec='MCMC' chainLength="2000000">
+        <state>
+            <stateNode idref='birthRate'/>
+            <stateNode idref='tree'/>
+        </state>
+
+        <distribution id="yule.prior" idref='yule'/>
+
+        <operator spec='SubtreeSlide' weight="1" gaussian="true" size="1.0" tree="@tree"/>
+
+        <logger logEvery="10" fileName="test.$(seed).log">
+            <log idref='yule'/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+            <log idref='birthRate'/>
+        </logger>
+
+        <logger logEvery="20000">
+            <log idref='yule'/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+            <log idref='birthRate'/>
+        </logger>
+    </run>
+
+</beast>
diff --git a/examples/benchmark/1/experiment.sh b/examples/benchmark/1/experiment.sh
new file mode 100644
index 0000000..00cf352
--- /dev/null
+++ b/examples/benchmark/1/experiment.sh
@@ -0,0 +1,24 @@
+echo FILE M1044 > times.dat 
+time beast testHKY1044.xml >> times.dat 2>&1
+echo FILE M1366 >> times.dat 
+time beast testHKY1366.xml >> times.dat 2>&1
+echo FILE M1510 >> times.dat 
+time beast testHKY1510.xml >> times.dat 2>&1
+echo FILE M1748 >> times.dat 
+time beast testHKY1748.xml >> times.dat 2>&1
+echo FILE M1749 >> times.dat 
+time beast testHKY1749.xml >> times.dat 2>&1
+echo FILE M1809 >> times.dat 
+time beast testHKY1809.xml >> times.dat 2>&1
+echo FILE M336 >> times.dat 
+time beast testHKY336.xml >> times.dat 2>&1
+echo FILE M3475 >> times.dat 
+time beast testHKY3475.xml >> times.dat 2>&1
+echo FILE M501 >> times.dat 
+time beast testHKY501.xml >> times.dat 2>&1
+echo FILE M520 >> times.dat 
+time beast testHKY520.xml >> times.dat 2>&1
+echo FILE M755 >> times.dat 
+time beast testHKY755.xml >> times.dat 2>&1
+echo FILE M767 >> times.dat 
+time beast testHKY767.xml >> times.dat 2>&1
diff --git a/examples/benchmark/1/testHKY1044.xml b/examples/benchmark/1/testHKY1044.xml
new file mode 100644
index 0000000..1ba481e
--- /dev/null
+++ b/examples/benchmark/1/testHKY1044.xml
@@ -0,0 +1,397 @@
+<?xml version="1.0" standalone="yes"?>
+<!-- Generated by BEAUTi v1.5beta4                                           -->
+<!--       by Alexei J. Drummond and Andrew Rambaut                          -->
+<!--       Department of Computer Science, University of Auckland and        -->
+<!--       Institute of Evolutionary Biology, University of Edinburgh        -->
+<!--       http://beast.bio.ed.ac.uk/                                        -->
+<beast>
+	
+	<!-- The list of taxa analyse (can also include dates/ages).                 -->
+	<!-- ntax=50                                                                 -->
+	<taxa id="taxa">
+		<taxon id="Hypoxylon_atroroseum_U32411"/>
+		<taxon id="Daldinia_concentrica_U32402"/>
+		<taxon id="Xylaria_hypoxylon_U20378"/>
+		<taxon id="Xylaria_curta_U32417"/>
+		<taxon id="Ophiostoma_ulmi_M83261"/>
+		<taxon id="Ophiostoma_piliferum_U20377"/>
+		<taxon id="Sordaria_fimicola_X69851"/>
+		<taxon id="Neurospora_crassa_X04971"/>
+		<taxon id="Chaetomium_globosum_U20379"/>
+		<taxon id="Cercophora_septentrionalis_U32400"/>
+		<taxon id="Gaeumannomyces_graminis_var_graminis"/>
+		<taxon id="Magnaporthe_salvinii_U78546"/>
+		<taxon id="Pyricularia_grisea_793"/>
+		<taxon id="Magnaporthe_grisea_Guy_11"/>
+		<taxon id="Hypocrea_pallida_U32408"/>
+		<taxon id="Nectria_cinnabarina_U32412"/>
+		<taxon id="Hypomyces_polyporinus_U32410"/>
+		<taxon id="Claviceps_purpurea_U44040"/>
+		<taxon id="Glomerella_cingulata_U48427"/>
+		<taxon id="Colletotrichum_gloeosporioides_U76339"/>
+		<taxon id="Microascus_trigonosporus_L36987"/>
+		<taxon id="Petriella_setifera_U32421"/>
+		<taxon id="Ceratocystis_virescens_U32419"/>
+		<taxon id="Ceratocystis_fimbriata_U32418"/>
+		<taxon id="Leucostoma_persoonii_M83259"/>
+		<taxon id="Diaporthe_phaseolorum_L36985"/>
+		<taxon id="Melanconis_marginalis_ATCC56907"/>
+		<taxon id="Gnomonia_setacea"/>
+		<taxon id="Valsa_ambiens_subsp._leucostomoides"/>
+		<taxon id="Cryptodiaporthe_corni"/>
+		<taxon id="Apiognomonia_supraseptata"/>
+		<taxon id="Amphiporthe_castanea"/>
+		<taxon id="Phomopsis_longicolla_U78778"/>
+		<taxon id="Cryphonectria_parasitica_713"/>
+		<taxon id="Endothia_gyrosa_L42443"/>
+		<taxon id="Endothia_eugeniae"/>
+		<taxon id="Plagiostoma_euphorbiae"/>
+		<taxon id="Pleuroceras_pleurostylum"/>
+		<taxon id="Gnomonia_padicola"/>
+		<taxon id="Apioplagiostoma_aceriferum"/>
+		<taxon id="Apiosporopsis_carpinea"/>
+		<taxon id="Linospora_capreae"/>
+		<taxon id="Discula_quercina"/>
+		<taxon id="Discula_campestris"/>
+		<taxon id="Discula_fraxinae"/>
+		<taxon id="Discula_destructiva_MD254"/>
+		<taxon id="Discula_sp._326"/>
+		<taxon id="Saccharomyces_cerevisiae_Z75578"/>
+		<taxon id="Candida_albicans_E15168"/>
+		<taxon id="Ambrosiozyma_platypodis_L36984"/>
+	</taxa>
+	
+	<!-- The sequence alignment (each sequence refers to a taxon above).         -->
+	<!-- ntax=50 nchar=1133                                                      -->
+	<alignment id="alignment" dataType="nucleotide">
+		<sequence>
+			<taxon idref="Hypoxylon_atroroseum_U32411"/>
+			?????????????????????????????????????????????????????????????????????????????????????AACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTTA--CGGAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCTCT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGAGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGCAGGGTCTTGGCCTGCCATGGTTACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATTCCGATAC-GGAGAGGTAGTGACGATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Daldinia_concentrica_U32402"/>
+			????????????????????????????????????????AAGTTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACTGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGTTAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAACCCCGACTCA--CGGAGGG-GTGTATTTATTAGATTAAAAACCAATGNCCTTCGGGGCTCTTT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCNGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGCAGGGTCTTGGCCTGCCATGGTTACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Xylaria_hypoxylon_U20378"/>
+			??????????????????????????????????????AAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACTTT-ATTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTCA--CGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCCTCGGGGCTTATA--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGCAGGGTCTTGGCCTGCCATGGTTTCAACGGGTAACGGAGGGTTAGGGCTCGANNCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGNAGGNGNNNAAATTACCCAATNCCGACAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Xylaria_curta_U32417"/>
+			????????????????????????????????????????????????CCATGCATGTCTAAGTATAAGCAA--TTATACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTCA--CGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCCTCGGGGCTTTCT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGCAGGGTCTTGGCCTGCCATGGTTACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Ophiostoma_ulmi_M83261"/>
+			??????????????????????????????????????????????????ATGCATGTCTAAGTATAAGCAA--TTATACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGCCCCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAACCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCCTCGGGGCTCACT--GGTGATTCATGATAACTTGTCGAATCGCACGGCCTTGCGCCGGCGATGGCTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGATCTGGGCCCGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGGCCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Ophiostoma_piliferum_U20377"/>
+			?????????????????????????????????????????????????????????TCTAAGTATAAGCAA--TTATACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGCCCCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAACCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCCTCGGNNCTCACT--GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGCNNNNNCGATGGCTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGATCTGGGCCCGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGGNNCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Sordaria_fimicola_X69851"/>
+			?????????????????????????ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTTTAAGCAA--TTAAACCGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAACCCCGACTTC--GGAAGGG-GTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGNCTTCCT--GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Neurospora_crassa_X04971"/>
+			TACCTGGTTGATTCTGCCAGTAGTCATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTTTAAGCAA--TTAAACCGCGAAACTGCGAATGGCT-CATTAAATCAGTTATAGTTTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAACCCCGACTTC--GGAAGGG-GTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTAACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Chaetomium_globosum_U20379"/>
+			??????????????????????????????????????AAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACCGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGNCCTTCGGGGCTCTCT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATNCCGACAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Cercophora_septentrionalis_U32400"/>
+			????????????????????????????????????????????????????????????????????????????????????AAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT-GCTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGNCCTTCGGGGCTCTCT--GGTGATTCATAATAACTTCTCGAATNNCANGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Gaeumannomyces_graminis_var_graminis"/>
+			?????????????????????????????????????????????????????????TATAAGTTTAAGCAA--TTATACAGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAACCCCGACTTC--GGAAGGG-GTGTATTTATTAGATTAAAANCCAATGCCCTTCGGGGCTCACT--GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAAACGCCTGAGAAACGGCGTTTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATGCCGACAC-GGCGAGGTAGTGACGAGAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Magnaporthe_salvinii_U78546"/>
+			?????????????????????????????????????????????????????????TCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAACCCCGACTTC--GGAAGGG-GTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAAACGCCTGAGAAACGGCGTTTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATGCCGACAC-GGCGAGGTAGTGACGAGAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Pyricularia_grisea_793"/>
+			?????????????????????????????????????????????????????????TCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAACCCCGACTTC--GGAAGGG-GTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAAACGCCTGAGAAACGGCGTTTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATGCCGACAC-GGCGAGGTAGTGACGAGAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Magnaporthe_grisea_Guy_11"/>
+			??????????????????TGTAGTCATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAACCCCGACTTC--GGAAGGG-GTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAAACGCCTGAGAAACGGCGTTTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATGCCGACAC-GGCGAGGTAGTGACGAGAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Hypocrea_pallida_U32408"/>
+			?????????????????????????????????????????????????????????????????????????????????GCGAAACTGCGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAATACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTTC--GGAAGGG-TTGTATTTATTAGATTAAAAACCAATGNCCTCTGGGGCTCTCT--GGTGAATCATGATAACTTGGCGAATCGACAGGCCTTGTGCCGGCGATGGCTCATTCAAATTTCTTCCCTATCAACTTTTGATGTTTGGGTATTGGCCAAACATGGTGGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Nectria_cinnabarina_U32412"/>
+			?????????????????????????????????????????????????????????????????????????????????????????????????CT-CATTATATAAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTCCGGGGCTCACT--GGTGATTCATGATAACTCCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTATTGGCCAAACATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Hypomyces_polyporinus_U32410"/>
+			????????????????????????????????????????????????????????????????????????????????????AAACTGCGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAATACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTTC--GGAAGGG-TTGTATTTATTAGATTAAAAACCAATGNCCTCTNGGGCTCTCT--GGTGAATCATGATAACTAGTCGAATCGACAGGCCTTGTGCCGGCGATGGCTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTATTGGCCAAACATGGTGGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Claviceps_purpurea_U44040"/>
+			??????????????????????????????????????????????????ATGCATGTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAATCCCGACTTA--CGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTCT-GGGCTCTCT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTAGTGGCCAAACATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Glomerella_cingulata_U48427"/>
+			????????????????????????????????????????????????????????GTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTTA--CGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGCTAGAGTAGTGTTCTAGCATGGTTACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACGATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Colletotrichum_gloeosporioides_U76339"/>
+			??????????????????????????????????????????????????ATGCATGTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTTA--CGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGCTAGAGTAGTGTTCTAGCATGGTTACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGNAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACGATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Microascus_trigonosporus_L36987"/>
+			??????????????????????????????????????AAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACCGCGAAACTGCGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAGCACGTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAACCCCGACTTC--GGAAGGG-GTGTATTTATTAGATTAAAAGCCAANGCCCTTCGGGGCTCTGT--GGTGATTCATGATAACTTTTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGCGAGGGTCTTGTCCTCGCATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-NGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Petriella_setifera_U32421"/>
+			??????????????????????????????????????AAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACCGCGAAACTGCGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAGCACATT-ACTACATGG-ATAACTGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAGCCAATGNCCTTCGGGGCTTCCT--GGTGATTCATAATAACTTTTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGCGAAGGTATTGTCTTCGCATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Ceratocystis_virescens_U32419"/>
+			????????????????????????????????????????????????????????????AAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAGCACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTCA--CGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTTTCT--GGTGATTCATGATAACTTCTCGAATCGCATGGCCTTGCGCNGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGCGAAGGTTTTGTCTTCGCATGGTTACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAGGGAGCCTGAGAAATGGCTACCACTTTTAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATNCTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Ceratocystis_fimbriata_U32418"/>
+			?????????????????????????????????????????????AAGCCATGCATGTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAGCACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGNCCTTCGGGGCTTTCT--GGTGATTCATGATAACTTCTCGAATCGCATGGCCTTGCGCNGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGCGAAGGTCTTGTCTTCGCATGGTTACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAGGGAGCCTGAGAAATGGCTACCACTTTTAAGGAAGGCAGCAGGCGCGCAATTTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Leucostoma_persoonii_M83259"/>
+			??????????????????????????????????????????????????ATGCAAGTCTAAGTTTAAGCAC--CTAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Diaporthe_phaseolorum_L36985"/>
+			????????????????????????????????????????????????????????????????????????A--TAAACGGCGAAACTNNNAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCNGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCNNGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Melanconis_marginalis_ATCC56907"/>
+			????????????????????????????????????????????????????????????????????????????????????????????????????CATTAAATCAGTTATCGTATATTTGATAGTTCCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAACCCCGACTTC--GGAAGGG-GTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCNATAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Gnomonia_setacea"/>
+			?????????????????????AGTCATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACA--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAG-TAG-GACAATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Valsa_ambiens_subsp._leucostomoides"/>
+			?????????????????TTGTAGT-ATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACC--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAG-TAGTGACAATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Cryptodiaporthe_corni"/>
+			????????????????TTGTTAGTCATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGTAAC--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAG-TAGTGACAATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Apiognomonia_supraseptata"/>
+			????????????????????????????????????????????????????????????????????????????AAACGGCGAAACTGCGAACGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACTT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCCCT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACACAATGCCGATTC-GGCGATGTAGTGACAATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Amphiporthe_castanea"/>
+			????????????????TTGNAAGTCATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACA--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Phomopsis_longicolla_U78778"/>
+			?????????????????????????????????????????????????????????TCTAAGTTTAAGCACA--TAANCGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Cryphonectria_parasitica_713"/>
+			??????????????????TGTAGTCANANGCTAGTCTCNAAGANTAAGCCATGCAAGTNTAAGTTTAAGCACC--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATANCCGTGGTAATTCNAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAG-TAGTGACAATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Endothia_gyrosa_L42443"/>
+			????????????????????????????????????????????TAAGCCATGCAAGTCTAAGTTTAAGCACC--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Endothia_eugeniae"/>
+			?????????????????TGTAAGTCATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACC--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Plagiostoma_euphorbiae"/>
+			???????????????TGTAAANCANATACGCNTGTCTNAAANTTTAACCCANGCAAGTNTAAGTTTAAGCACA--TACGCGGCGAATCTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTTC--GGAAGGA-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGAAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Pleuroceras_pleurostylum"/>
+			?????????????????TGNAANNCATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACA--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAACCCCGACTTC--GGAAGGG-GTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Gnomonia_padicola"/>
+			?????????????????TGNAAGGCATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACA--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTCC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTATCCAATCCCGACAC-GGGGAGATAGTGACAATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Apioplagiostoma_aceriferum"/>
+			????????????????TTGTAAGTCATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACA--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAACCCCGACTTC--GGAAGGG-GTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Apiosporopsis_carpinea"/>
+			?????????????????TGAAAGTCATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACA--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Linospora_capreae"/>
+			?????????????????TGGAANGCATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACA--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAACCCCGACTTC--GGAAGGG-GTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Discula_quercina"/>
+			?????????????????????????ATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACA--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAG-TAGTGACAATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Discula_campestris"/>
+			????????????????????????TATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACA--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAG-TAGTGACAATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Discula_fraxinae"/>
+			?????????????????????TAATATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACA--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAG-TAGTGACAATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Discula_destructiva_MD254"/>
+			???????????????????????TCATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACA--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Discula_sp._326"/>
+			???????????????????????T-ATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACA--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAG-TAGTGACAATAAATACTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Saccharomyces_cerevisiae_Z75578"/>
+			TATCTGGTTGATCCTGCCAGTAGTCATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA-TTTATACAGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTTCCTTTACTACATGGTATAACTGTGGTAATTCTAGAGCTAATACATGCTTAAAATCTCGACCCTTTGGAAGAG-ATGTATTTATTAGATAAAAAATCAATG-TCTTC-GGACTCTTT--GATGATTCATAATAACTTTTCGAATCGCATGGCCTTGTGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCTAATTCA-GGGAGGTAGTGACAATAAATAACGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Candida_albicans_E15168"/>
+			TATCTGGTTGATCCTGCCAGTAGTCATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA-TTTATACAGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTGTTTGGAAGGG-ATGTATTTATTAGATAAAAAATCAATG-CCTTC-GGGCTCTTT--GATGATTCATAATAACTTTTCGAATCGCATGGCCTTGTGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATTCAGGGGAGGTAGTGACAATAAATAACGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Ambrosiozyma_platypodis_L36984"/>
+			?????????????????????????????????????????????AAGCCATGCATGTCTAAGTATAAGCAA--TTATACAGTGAAACTGCGAATGGCTACATTAAATCAGTTANNGTTTATTTGATAGTTCCTTTACTACATGG-ATAACCGTGGTAATTCTTCGGCCAATACATGCTTAAAACCCCGACTCT--GGGAGGG-NNGCATTTATTAGATAAAAAATCAATGTCCTTCGGAACTTTTT--GATGATTCATAATAACTTTACGAAGCTCATGGCCTTGTGCTGGAGCTGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTTTACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCTGACACA-GGGAGGTAGTGACAATATATAACGA [...]
+		</sequence>
+	</alignment>
+
+	<!-- The unique patterns for all positions                                   -->
+	<!-- npatterns=69                                                            -->
+	<patterns id="patterns" from="1">
+		<alignment idref="alignment"/>
+	</patterns>
+
+	<!-- This is a simple constant population size coalescent model              -->
+	<!-- that is used to generate an initial tree for the chain.                 -->
+	<constantSize id="initialDemo" units="substitutions">
+		<populationSize>
+			<parameter id="initialDemo.popSize" value="0.0001"/>
+		</populationSize>
+	</constantSize>
+
+	<!-- Generate a random starting tree under the coalescent process            -->
+	<coalescentTree id="startingTree">
+		<taxa idref="taxa"/>
+		<constantSize idref="initialDemo"/>
+	</coalescentTree>
+
+	<treeModel id="treeModel">
+		<coalescentTree idref="startingTree"/>
+		<rootHeight>
+			<parameter id="treeModel.rootHeight"/>
+		</rootHeight>
+		<nodeHeights internalNodes="true">
+			<parameter id="treeModel.internalNodeHeights"/>
+		</nodeHeights>
+		<nodeHeights internalNodes="true" rootNode="true">
+			<parameter id="treeModel.allInternalNodeHeights"/>
+		</nodeHeights>
+	</treeModel>
+
+	<!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+	<hkyModel id="hky">
+		<frequencies>
+			<frequencyModel dataType="nucleotide">
+				<alignment idref="alignment"/>
+				<frequencies>
+					<parameter id="hky.frequencies" dimension="4"/>
+				</frequencies>
+			</frequencyModel>
+		</frequencies>
+		<kappa>
+			<parameter id="hky.kappa" value="1.0" lower="0.0"/>
+		</kappa>
+	</hkyModel>
+
+	<!-- site model                                                              -->
+	<siteModel id="siteModel">
+		<substitutionModel>
+			<hkyModel idref="hky"/>
+		</substitutionModel>
+        <gammaShape gammaCategories="4">
+              <parameter id="siteModel.shape" value="0.5" lower="0.0" upper="1000.0"/>
+        </gammaShape>
+        <proportionInvariant>
+                <parameter id="siteModel.pInv" value="0.5" lower="0.0" upper="1.0"/>
+        </proportionInvariant>
+		<mutationRate>
+			<parameter id="siteModel.mu" value="1.0" lower="0.0"/>
+		</mutationRate>
+	</siteModel>
+
+	<treeLikelihood id="treeLikelihood">
+		<patterns idref="patterns"/>
+		<treeModel idref="treeModel"/>
+		<siteModel idref="siteModel"/>
+	</treeLikelihood>
+
+	<operators id="operators">
+        <!-- proportions invariant -->
+        <scaleOperator scaleFactor="0.75" weight="1">
+                <parameter idref="siteModel.pInv"/>
+        </scaleOperator>
+        <!-- gamma shape parameter -->
+        <scaleOperator scaleFactor="0.75" weight="1">
+                <parameter idref="siteModel.pInv"/>
+        </scaleOperator>
+        <!-- standard operators -->
+		<scaleOperator scaleFactor="0.5" weight="1">
+			<parameter idref="hky.kappa"/>
+		</scaleOperator>
+		<scaleOperator scaleFactor="0.5" weight="1">
+			<parameter idref="treeModel.rootHeight"/>
+		</scaleOperator>
+		<uniformOperator weight="10">
+			<parameter idref="treeModel.internalNodeHeights"/>
+		</uniformOperator>
+		<subtreeSlide weight="5" gaussian="true" size="1.0">
+			<treeModel idref="treeModel"/>
+		</subtreeSlide>
+		<narrowExchange weight="1">
+			<treeModel idref="treeModel"/>
+		</narrowExchange>
+		<wideExchange weight="1">
+			<treeModel idref="treeModel"/>
+		</wideExchange>
+		<wilsonBalding weight="1">
+			<treeModel idref="treeModel"/>
+		</wilsonBalding>
+	</operators>
+
+	<mcmc id="mcmc" chainLength="1000000" autoOptimize="true" preBurnin="0">
+		<compoundLikelihood id="likelihood">
+			<treeLikelihood idref="treeLikelihood"/>
+		</compoundLikelihood>
+		<operators idref="operators"/>
+		<log logEvery="10000">
+			<column label="Likelihood" dp="4" width="12">
+				<compoundLikelihood idref="likelihood"/>
+			</column>
+			<column label="Root Height" sf="6" width="12">
+				<parameter idref="treeModel.rootHeight"/>
+			</column>
+			<column label="Kappa" sf="6" width="12">
+				<parameter idref="hky.kappa"/>
+			</column>
+		</log>
+		<log logEvery="10000" fileName="testMCMC.log">
+			<compoundLikelihood idref="likelihood"/>
+			<parameter idref="treeModel.rootHeight"/>
+			<parameter idref="hky.kappa"/>
+		</log>
+		<logTree  logEvery="10000" nexusFormat="true" fileName="testMCMC.trees">
+			<treeModel idref="treeModel"/>
+		</logTree>
+	</mcmc>
+</beast>
diff --git a/examples/benchmark/1/testHKY1366.xml b/examples/benchmark/1/testHKY1366.xml
new file mode 100644
index 0000000..4a8f4b3
--- /dev/null
+++ b/examples/benchmark/1/testHKY1366.xml
@@ -0,0 +1,352 @@
+<?xml version="1.0" standalone="yes"?>
+<!-- Generated by BEAUTi v1.5beta4                                           -->
+<!--       by Alexei J. Drummond and Andrew Rambaut                          -->
+<!--       Department of Computer Science, University of Auckland and        -->
+<!--       Institute of Evolutionary Biology, University of Edinburgh        -->
+<!--       http://beast.bio.ed.ac.uk/                                        -->
+<beast>
+	
+	<!-- The list of taxa analyse (can also include dates/ages).                 -->
+	<!-- ntax=41                                                                 -->
+	<taxa id="taxa">
+		<taxon id="Zodiomyces_vorticellarius"/>
+		<taxon id="Xylaria_hypoxylon"/>
+		<taxon id="Termitaria_snyderi"/>
+		<taxon id="Taphrina_deformans"/>
+		<taxon id="Talaromyces_flavus"/>
+		<taxon id="Stigmatomyces_limnophorae"/>
+		<taxon id="Sphaerostilbella_aureonitens"/>
+		<taxon id="Smittium_culisetae"/>
+		<taxon id="Scorias_spongiosa"/>
+		<taxon id="Pyxidiophora_SPO3"/>
+		<taxon id="Pyxidiophora_sp1"/>
+		<taxon id="Protomyces_inouyei"/>
+		<taxon id="Petriella_setifera"/>
+		<taxon id="Ophiostoma_ulmi"/>
+		<taxon id="Ophiostoma_piliferum"/>
+		<taxon id="Neurospora_crassa"/>
+		<taxon id="Neocallimastix_frontalis"/>
+		<taxon id="Mucor_mucedo"/>
+		<taxon id="Morchella_esculenta"/>
+		<taxon id="Monascus_purpureus"/>
+		<taxon id="Microascus_trigonosporus"/>
+		<taxon id="Melanospora_zamiae"/>
+		<taxon id="Melanospora_fallax"/>
+		<taxon id="Leucostoma_persoonii"/>
+		<taxon id="Laboulbeniopsis_termitarius"/>
+		<taxon id="Kathistes_calyculata"/>
+		<taxon id="Kathistes_analemmoides"/>
+		<taxon id="Hesperomyces_coccinelloides"/>
+		<taxon id="Graphium_calicioides"/>
+		<taxon id="Entomophthora_muscae"/>
+		<taxon id="Endomyces_scopularum"/>
+		<taxon id="Elaphomyces_maculatus"/>
+		<taxon id="Cladonia_subcervicornis"/>
+		<taxon id="Chytridium_confervae"/>
+		<taxon id="Ceramothyrium_linnaeae"/>
+		<taxon id="Capnodium_dermatum"/>
+		<taxon id="Capniomyces_stellatus"/>
+		<taxon id="Candida_albicans"/>
+		<taxon id="Balansia_sclerotica"/>
+		<taxon id="Ascobolus_denudatus"/>
+		<taxon id="Ambrosiozyma_platypodis"/>
+	</taxa>
+	
+	<!-- The sequence alignment (each sequence refers to a taxon above).         -->
+	<!-- ntax=41 nchar=1137                                                      -->
+	<alignment id="alignment" dataType="nucleotide">
+		<sequence>
+			<taxon idref="Zodiomyces_vorticellarius"/>
+			?????????????????????AGTCATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAAC--TATACCGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCCAAAAA-CCCCGA-CTTA---CGAAGGGGTGTGTTTATTAGATAGCAAACCAATGCCCTTTTGGGCTC??TGTGGTGATTCATGATAACTTAACGTAGCGCATGGCCTTGCGCCGGCGCAGGATCATTCAAATACCTGCCCTATCAAGTTTCGATGTGAGGGTAGTGTCCTCACATGCTTTTGACGGGTAACGGGGAATTAGGGTTCGACTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAAGTAGTGACAAGAAATAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Xylaria_hypoxylon"/>
+			????????????????????????????????TGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACTTT--ATTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGA-CTCA---CGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCCTCGGGGCTTATA--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGCAGGGTCTTGGCCTGCCATGGTTTCAACGGGTAACGGAGGGTTAGGGCTCGA??CCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAG?AGG?G???AAATTACCCAAT?CCGACAC-GGGGAGGTAGTGACAATAAATAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Termitaria_snyderi"/>
+			?????????????????????????????????????????????????????????TCTAAGTTTAAGCAA--GTATACTGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCGAAAAA-CCCCGA-CTTC---GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTTT-GGGCTCTTT--GGTGAATCATAATAACTAAACGAATCGCATGGCCTTGAGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATTGGTGAGTAGTGTTCACCAATGGTGTCGACGGGTAACGAAGAATTAGGGTTCGATCTCGGAGAGGACGCCTGAGAAACGGCGTC-ACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCAATT????????????????????????? [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Taphrina_deformans"/>
+			??????????????????????????????????????AAAGATTAAGCCATGCATGTCTAAGTATAAGCAAT--TATACAGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCT-A-ATTACTTGG-ATACCCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGA-CTTCT--GGAAGGGATGTATTTATTAGATAAAAAACCAATGNCCTTCGGG?CTCCTT--GGTGATTCATAATAACTTTACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGAGGCCTACCATGGTTTTGACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCC-GACAC-GGGGAGGTAGTGACAATAAATAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Talaromyces_flavus"/>
+			?????????????????????????ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCACTCTTTTACTGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCCT--ACTACATGG-ATACCTGTGGTAATTCTAGAGCTAATACATGCGCAAAA-CCCCGA-CTTC---GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTTCGGGGCTCCTT--GGTGAATCATAATAACTTCACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTGGCAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAGGTAGTGACAATAAATAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Stigmatomyces_limnophorae"/>
+			?????????????????????????CATATGCTTGTCTCAAAGATTAAGCCATGCATGTGTAAGTATAAGCAA-CTATACTGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATGGTACTTT--ACTACTTGG-ATATCCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CTCCAA-CTTA---CGAAGGAGTGTATTTATTAGATATTAAACCAATATTCTTCGGAATTTCT---GGTGATTCATAATAACTTTTCGCAGCGCATAGCTTCATGCTGGTGCGAGATCATTCAAATACCTGCCCTATCAAGTTTCGATGTGAGGGTAGTGTCCTCACATGCTTTTGACGGGTAACGGGGAATTAGGGTTCGACTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCTGACAC-GGGGA?GTAGTGACAAGAAATAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Sphaerostilbella_aureonitens"/>
+			??????????????????????????????????????????????????????????????????????????????????????????????TGGCT-CATTATATAAGTTATCG?TTATTTGATAATACTTT--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAA?-TCCCGA-CTTC---GGAAGGGTTGTATTTATTAGATTAAAAACCAA?CTCGTCT?GGGCTCTCT--GGTGAATCATGATAACTAGTCGAATCGACAGGCCTTGTGCCGGCGATGGCTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTATTGGCCAAACATGGTGGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Smittium_culisetae"/>
+			?????????????????????????????????????CAAAGATTAAGCCATGCATGTCTAAGTATAAACAAATTTATACAGTGAAACTGCGAATGGCT-CATTATATCAGTTATAATTTATTTGATGATACCTTTTACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCAAAAAACTCCCGA-CTTCT--GGAAGGGGGGCATTTATTAGATAAAAAACCAATGGGGGCAACCTCTTACTT-GGTGAGTCATAATAACTAAGCATATCGCATGGCCTTGTGCCGGCGAAGGATCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGTATAGAGGACTACCATGGTGGTAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACTTCTAAGGAGGGCAGCAGGCGCGCAAATTACCCAATCCTGACAC-AGGGAGGTAGTGACAATAAATAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Scorias_spongiosa"/>
+			???????????????????????????????????????????????????????????TAAGTTTAAGCAAC--TATACGGTGAAACTGCGAATGGCT-CATTAAATCAGTTATTGTTTATTTGATAGTACCCTT-AATACATGG-ATACCCGTGGTAATTCTAGAG-TAATACATGCTAAAAA-CCCCGAGTCAC----GAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTTTGGGCTT?CAT--GGTGAATCATAATAACTTAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTATCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Pyxidiophora_SPO3"/>
+			??????????????????????????????????????AAAGATTAAGCCATGCATGTCTAAGTATAAGCAACT-TATACCGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGA-CTTC---GGAAGGGGTGTATTTATTAGATAAAAAACCA--TCGTCTTCGGACTTCTT--GGTGATTCATAATAACTAAACGTAGCGCATGGCCTTGTGCTGGCGCAAAATCATTCAAATACCTGCCCTATCAAGCTTCGATGTGAGGGTAGTGTCCTCACATGCTTTTGACGGGTAACGGGGAATTAGGGTTCGACTCCGGAGAGGGAGCCTGAGAAATGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAAGAAATAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Pyxidiophora_sp1"/>
+			??????????????????????????????????TCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAACTTTATACCGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGA-CTTC---GGAAGGGGTGTATTTATTAGATAAAAAACCATCG?-TCTTCGGACTCTTT--GGTGATTCATAATAACTAAACGTAGCGCATGGCCTTGTGCTGGCGCAAAATCATTCAAATACCTGCCCTATCAAGCTTCGATGTGAGGGTAGTGTCCTCACATGCTTTTGACGGGTAACGGGGAATTAGGGTTCGACTCCGGAGAGGGAGCCTGAGAAATGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAAGAAATAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Protomyces_inouyei"/>
+			??????????????????????????????CTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAAT-TTATACAGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCCT--ACTACTTGG-ATACCCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGA-CTTCT--GGAAGGGATGTATTTATTAGATAAAAAACCAATGC??TTCGGG?CTCCTT--GGTGATTCATAATAACTTTACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGAGGCCTACCATGGTTTTGACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCC-GACAC-GGGGAGGTAGTGACAATAAATAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Petriella_setifera"/>
+			???????????????????????TCATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACCGCGAAACTGCGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAGCACATT--ACTACATGG-ATAACTGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGA-CTTC---GGAAGGGATGTATTTATTAGATTAAAAGCCAATG?CCTTCGGGGCTTCCT--GGTGATTCATAATAACTTTTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGCGAAGGTATTGTCTTCGCATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Ophiostoma_ulmi"/>
+			??????????????????????????????????????????????????ATGCATGTCTAAGTATAAGCAA--TTATACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGCCCCTT--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAA-CCCCGA-CTTC---GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCCTCGGGGCTCACT--GGTGATTCATGATAACTTGTCGAATCGCACGGCCTTGCGCCGGCGATGGCTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGATCTGGGCCCGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGGCCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTC-GGGGAGGTAGTGACAATAAATAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Ophiostoma_piliferum"/>
+			?????????????????????????????????????????????????????????TCTAAGTATAAGCAA--TTATACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGCCCCTT--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAA-CCCCGA-CTTC---GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCCTCGG??CTCACT--GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGC?????CGATGGCTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGATCTGGGCCCGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGG??CCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGC?CGCAAATTACCCAATCCCGACTC-GGGGAGGTAGTGATAATAAATAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Neurospora_crassa"/>
+			TACCTGGTTGATTCTGCCAGTAGTCATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTTTAAGCAA--TTAAACCGCGAAACTGCGAATGGCT-CATTAAATCAGTTATAGTTTATTTGATAGTACCTT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGA-CTTC---GGAAGGGGTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTAACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Neocallimastix_frontalis"/>
+			????????????????????TAGTCATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAACAATTCTATACTGTGAAACTGCGAATGGCT-CATTAAATCAGTTATAGTTTATTTGATAGTACCATT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCGTAAAAA-CCCGA-CTTCT--GGAAGGGTTGTATTTATTAGATAAAAAACCAACCTGGGCAACCAGTTTTTT-GGTGATTCATAATAACTTTTCGAATCGTATGACTTTACGTCGACGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGAGGCCTACCATGGTTTTAACGGGTAACGGAGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCTAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCTGACAC-AGGGAGGTAGTGACAATAAATAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Mucor_mucedo"/>
+			?????????????????????????????????????CAAAGATTAAGCCATGCATGTCTAAGTATAAATAAATTTATATCGTGAAACTGCGAATGGCT-CATTAAATCAGTTATGATCTACGTGACA?TATTCTTTACTACTGGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCAAAAACGCCTCGA-CTTAC--GAAGGGGTGCACTT?ATTAGATAAAG??CCAACGCTGGGTAAAACCATCCTTGGTGATTCATAATAATTTAGCGGAT-GCATGGCCTTGTGCTAGCGACGGTCCACTCGATTTTCTGCCCTATCATGGTTAGATTGTAAGATAGAGGCTTACAATGCCTACAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Morchella_esculenta"/>
+			??????????????????????????????????????AAAGATTAAGCCATGCAAGTCTAAGTATAAGCAATA-TATACAGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGA-CTTCAC-GGA?GGGGTGTATTTATTAGATAAAAAACCAATG??CCTT?CGGGCTCCTT-GGTGATTCATGATAACTTAACGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Monascus_purpureus"/>
+			??????????????????????????????????????????????????ATGCATGTCTAAGTGTAAGCAATT-TATACTGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT--ACTACATGG-ATACCTGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGA-CTTC---GGAAGGGGTGTATTTATTAGATAAAAAACCAACGCCCTTCGGGGCTCCTT--GGTGAATCATAATAACTAAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTGGCAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Microascus_trigonosporus"/>
+			????????????????????????????????TGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACCGCGAAACTGCGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAGCACGTT--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGA-CTTC---GGAAGGGGTGTATTTATTAGATTAAAAGCCAA?GCCCTTCGGGGCTCTGT--GGTGATTCATGATAACTTTTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGCGAGGGTCTTGTCCTCGCATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-?GGGAGGTAGTGACAATAAATAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Melanospora_zamiae"/>
+			?????????????????????????????????????????????????????????????AGTATAAGCAA--TTATACAGCGAAACT?CGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAGTGCCTT--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAG-CCCCGA-CTTA---CGGAGGGG?CTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCTTT--GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTAGTGGCCAAACATGGTGGCAACGGGTAACGGAGGGTTAGG?CTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTCCTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCTCAACTC-GAGGAGGTAGTGATAATAAATAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Melanospora_fallax"/>
+			??????????????????????????????????????????????????????????????GTATAAGCA---TTATACCGCGAAACTGCGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAGTACCTT--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAG-CCCCGA-CTTA---CGGAGGGGTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCTCT--GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTCTTGGCCAAACATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTC-GGGGAGGTAGTGACAATAAATAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Leucostoma_persoonii"/>
+			??????????????????????????????????????????????????ATGCAAGTCTAAGTTTAAGCAC--CTAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT---ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAA-TCCCGA-CTTC---GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Laboulbeniopsis_termitarius"/>
+			???????????????????????????????????????????????????????????????????????????TATACTGTGAAACTGGGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATGGTACCTT--ACTACATGG-ATAACCGTGGTAATTCTGGAGCTAATACATGCAAATAA-TCTCGA-CGTA---AGAAGGGATGTATTTATTAGATAAAAAACCAATGCCATTTCGGTGGTATG-TGGTGATTCATAATAACTGAACTTAGCGTATGGCCTTTGGCTGACGCAAGATCATTCAAATACCTGCCCTATCAAGTTTCGATGTGAAGGTAGTGTCCTCACATGCTTTTGACGGGTAACGGGGAATTAGGGTTCGACTCCGGAGAGGGAGCCTGAGAAATGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAT-GGGGA?GTAGTGACAAGAAATAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Kathistes_calyculata"/>
+			??????????????????????????????????????????????????ATGCATGTCTAAGTATAAGCA?--TTATACAGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCCC--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCGCAAAA-GCCCGA-CTTA---CGAAGGGCTGTATTTATTAGATAAAAAACCAATG?CCTCCGGGGCTCTTT--GGTGATTCATAATAACTTAACGAATCGCATGGCCTTGAGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATTGGTGAGTAGTGTTCACCAATGGTGTCGACGGGTAACGAAGAATTAGGGTTCGATCTCGGAGAGGACGCCTGAGAAACGGCGTACACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAAT?CCGATAC-GGGGAGGTAGTGACAATAAATAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Kathistes_analemmoides"/>
+			??????????????????????????????????????????????????ATGCATGTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCCC--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCGCAAAG-GCCCGA-CTTA---CGAAGGGC?GTATTTATTAGATAAAAAACCAATG?CCTTCGGGGCTTCTT--GGTGATTCATGATAACTTAACGAATCGCATGGCCTTGAGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATTGGTGAGTAGTGTTCACCAATGGTGTCGACGGGTAACGAAGAATTAGGGTTCGATCTCGGAGAGGACGCCTGAGAAACGGCGTACACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAAT?CCGATAC-GGGGAGGTAGTGACAATAAATAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Hesperomyces_coccinelloides"/>
+			??????????????????????????????????????AAAGATTAAGCCATGCATGTCTAAGTATAAGCATT--TATACTGTGAAACTGCGAATGGCT-CATTAAATCAGTTATTGTTTATTTGATGGTACCTTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGA-CTCA---CGAAGGGGTGTATTTATTAGAT?TC?AAACCAGTGTCCTTCGGGACTTTTT-GGTGACTCATAATAACTTAATGCAGCGCATGGCCTTGTGCCGGCGCGGGATCATTCAAATACCTGCCCTATCAAGTTTCGATGTGAGGGTAGTGTCCTCACATGCTTTTGACGGGTAACGGGGAATTAGGGTTCGACTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGCGCNGTAGTGACAAGAAATAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Graphium_calicioides"/>
+			???????????????????????TCATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAAT--CATACTGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTTT-ACC---TGG-ATNNCCGTGGTANTTCTAGAGCTAATACATGCTAAAAA-CCCCGA-CTTC---GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTTTGGG?CTCCTT--GGTGATTCATAATAACTTAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATTGTAAGATAGAGGCTTACAATGGTCTTAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATTC-GGGGAGGTAGTGACAATAAATAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Entomophthora_muscae"/>
+			?????????????????????????????????????CAAAGATTAAGCCATGCATGTCTAAGTATAAGCTAAACCTTACAGTGAAACTGCGAATGGC?-CATTAAATCAGTTATAATTTATTTGATCTTTCCTT--ACCAGT?GG-ATATCCGTGGTAATTCTAGAGCTAATACATATACGCGAAGACCCAACTTCT--GGAAGGGTTGTATTTATTAGATAAAAAACCAATGTGGGCAACCACTTTTTT-GGTGATTCATAGTAACTTTACTGATCGCAATTTATTGCGACATATCATAA??????AAATTTCTGCCCTATCAACTTTCGATGGTAAGGTAGTGGCTTACCATGGTTTTTACGGGTGACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCTGATAC-AGGGAGGTAGTGACAATAAATAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Endomyces_scopularum"/>
+			??????????????????????????????????????AAAGATTAAGCCATGCATGTCTAAGTATAAGCATT--TATACAGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTACAG?-CCCCGA-CTCA---CGAAGGGGTGTATTTATTAGATAAAAAATCAA????????????CATATT--GATGATTCATAATAACTTGTCGAACCGCATGGCTTCATGCCGGCGGTGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGAGGCCTACCATGGTTTCAACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAGCGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Elaphomyces_maculatus"/>
+			?????????????????????????????????????????????????????????TCTAAGTATAAGCAATC-TATACGGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT--GCTACATGG-ATACCTGTGGTAATTCTAGAGCTAATACATGCTGAAAA-TCCCGA-CTCC---GGAAGGGATGTATTTATTAGATAAAAAACCAATGCCCTTCGGGGCTTCTT--GGTGATTCATAATAACTGCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTGGCAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATCC-GGGGAGGTAGTGACAATAAATAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Cladonia_subcervicornis"/>
+			???????????????????????TCATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAATC-TATACGGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT--ACTACTTGG-ATACCTGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCTCGA-CTTC---GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTTCGGGGCTCCTT--GGTGATTCATAATAACTTAACGAATCGCATGGCCTTGAGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGTATAGAGGACTACCATGGTTTCTACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Chytridium_confervae"/>
+			??????????????????????????????????????AAAGATTAAGCCATGCATGTCTAAGTATAAACAAATTTGTACTGTGAAACTGCGAATGGCT-CATTAAATCAGTTATAGTTTATTTGATAATACCTT--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCAATAAAAGGCCGA-CTTCT--GGAAGGCCTGTATTTATTAGATAAAAAACCAACCCGGAAACGGTTCTTT??-GGTGATTCATAGTAACTTTTCGAATCGCATGACTTTACGTCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGAGGCCTACCATGGTTTTAACGGGTAACGGCGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCTAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCTGATTC-AGGGAGGTAGTGACAATAAATAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Ceramothyrium_linnaeae"/>
+			??????????????????????????????????????????????????ATGCATGTCTAAGTATAAGCAAT-CTATACTGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTTT-ACC---TGG-ATAACCGTGGTAATTCTAAAGCTAATACATGCTAAAAA-TCCCGA-CTTC---GGAAGGGATGTATTTATTAAATAAAAAACCAATGCCCTTCGGGGCTCCTT--GGTGAATCATAATAACTTAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAAGGTCTTGGCTTACCATGGTCTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAAAGGGAGCCTGAAAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Capnodium_dermatum"/>
+			????????????????????TAGTCATATGCTTGTCTCAAAGATTAAGCCATGCATGT-TAAGTATAAGCAAC--TATACGGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT--ACTACATGGCATAACCGTGGTAATTCTAGAGCTAATACCCGCTAAAAA-CCCCGA-CTTC---GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTTCGGGGCTCCCT--GGTGAATCATAATAACTTAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAAGATAGTGGCCTACCATGGTATCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGGACGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATTAATAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Capniomyces_stellatus"/>
+			??????????????????????????????????????AAAGATTAAGCCATGCATGTCTAAGTATAGACAAATTTATACAGTGAAACTGCGAATGGCT-CATTATATCAGCTATAATTTATTTGATGATACCTTTTACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCACTAAACACTCCGACTTCT--GGAAGGAGAGCATTTATTAGATACAAAACCAATGGGGGCAACCTCTTACTT-GGTGAATCATAATAACT?AAGCATATGCATGGCCTTGAGCCGGCGAAGGATCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGTATAGAGGACTACCATGGTGGTAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACTTCTAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCTGACAC-AGGGAGGTAGTGACAATAAATAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Candida_albicans"/>
+			??TCTGGTTGATCCTGCCAGTAGTCATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA-TTTATACAGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAA-TCCCGA-CTGTTT-GGAAGGGATGTATTTATTAGATAAAAAATCAATG?CCTTC?GGGCTCTTT--GATGATTCATAATAACTTTTCGAATCGCATGGCCTTGTGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATTCAGGGGAGGTAGTGACAATAAATAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Balansia_sclerotica"/>
+			?????????????????????????ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTGTACTGCGAAACTGCGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAGTGCCCT--ACTACTTGG-ATAACTGTGGTAATTCTAGAGCTAATACATGCTACAAA-TCCCGA-CTTC---GGAAGGGATGTATTTATTGGATTAAAAACCAATGCCCCCT?GGGCTCTCT--GGTGACTCACGATAACTGCTCGAATCGCACGGCCCTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTAGTGGCCAAACATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAAT?CCGACAC-GGGGAGGTAGTGACAATAAATAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Ascobolus_denudatus"/>
+			????????????????????????????????????????????????????GCATGTCTAAGTATAAGCAACT-TGTACAGTGAAACTGCNAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAATCCCTT--ACTACATGG-ATACCTGTGGTAATTCTAGAGCTAATACATGCTTCAAGGAGTGGC-TTTC---GTC?ACTCTGCACTTATTAGATAAAAAACCAATGCCCCTTTGGGGCTCCCT-GGTGATTCATAATAATTTAGCGGACCGCATTCCCTCGAGGAGGCGGTGGATCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAGGTAGTGACAATAAATAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Ambrosiozyma_platypodis"/>
+			?????????????????????????????????????????????AAGCCATGCATGTCTAAGTATAAGCAA--TTATACAGTGAAACTGCGAATGGCTACATTAAATCAGTTA??GTTTATTTGATAGTTCCTTT-ACTACATGG-ATAACCGTGGTAATTCTTCGGCCAATACATGCTTAAAA-CCCCGA-CTCT---GGGAGGG??GCATTTATTAGATAAAAAATCAATGTCCTTCGGAACTTTTT--GATGATTCATAATAACTTTACGAAGCTCATGGCCTTGTGCTGGAGCTGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTTTACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCTGACAC-AGGGAGGTAGTGACAATATATAA [...]
+		</sequence>
+	</alignment>
+
+	<!-- The unique patterns for all positions                                   -->
+	<!-- npatterns=69                                                            -->
+	<patterns id="patterns" from="1">
+		<alignment idref="alignment"/>
+	</patterns>
+
+	<!-- This is a simple constant population size coalescent model              -->
+	<!-- that is used to generate an initial tree for the chain.                 -->
+	<constantSize id="initialDemo" units="substitutions">
+		<populationSize>
+			<parameter id="initialDemo.popSize" value="0.0001"/>
+		</populationSize>
+	</constantSize>
+
+	<!-- Generate a random starting tree under the coalescent process            -->
+	<coalescentTree id="startingTree">
+		<taxa idref="taxa"/>
+		<constantSize idref="initialDemo"/>
+	</coalescentTree>
+
+	<treeModel id="treeModel">
+		<coalescentTree idref="startingTree"/>
+		<rootHeight>
+			<parameter id="treeModel.rootHeight"/>
+		</rootHeight>
+		<nodeHeights internalNodes="true">
+			<parameter id="treeModel.internalNodeHeights"/>
+		</nodeHeights>
+		<nodeHeights internalNodes="true" rootNode="true">
+			<parameter id="treeModel.allInternalNodeHeights"/>
+		</nodeHeights>
+	</treeModel>
+
+	<!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+	<hkyModel id="hky">
+		<frequencies>
+			<frequencyModel dataType="nucleotide">
+				<alignment idref="alignment"/>
+				<frequencies>
+					<parameter id="hky.frequencies" dimension="4"/>
+				</frequencies>
+			</frequencyModel>
+		</frequencies>
+		<kappa>
+			<parameter id="hky.kappa" value="1.0" lower="0.0"/>
+		</kappa>
+	</hkyModel>
+
+	<!-- site model                                                              -->
+	<siteModel id="siteModel">
+		<substitutionModel>
+			<hkyModel idref="hky"/>
+		</substitutionModel>
+        <gammaShape gammaCategories="4">
+              <parameter id="siteModel.shape" value="0.5" lower="0.0" upper="1000.0"/>
+        </gammaShape>
+        <proportionInvariant>
+                <parameter id="siteModel.pInv" value="0.5" lower="0.0" upper="1.0"/>
+        </proportionInvariant>
+		<mutationRate>
+			<parameter id="siteModel.mu" value="1.0" lower="0.0"/>
+		</mutationRate>
+	</siteModel>
+
+	<treeLikelihood id="treeLikelihood">
+		<patterns idref="patterns"/>
+		<treeModel idref="treeModel"/>
+		<siteModel idref="siteModel"/>
+	</treeLikelihood>
+
+	<operators id="operators">
+        <!-- proportions invariant -->
+        <scaleOperator scaleFactor="0.75" weight="1">
+                <parameter idref="siteModel.pInv"/>
+        </scaleOperator>
+        <!-- gamma shape parameter -->
+        <scaleOperator scaleFactor="0.75" weight="1">
+                <parameter idref="siteModel.pInv"/>
+        </scaleOperator>
+        <!-- standard operators -->
+		<scaleOperator scaleFactor="0.5" weight="1">
+			<parameter idref="hky.kappa"/>
+		</scaleOperator>
+		<scaleOperator scaleFactor="0.5" weight="1">
+			<parameter idref="treeModel.rootHeight"/>
+		</scaleOperator>
+		<uniformOperator weight="10">
+			<parameter idref="treeModel.internalNodeHeights"/>
+		</uniformOperator>
+		<subtreeSlide weight="5" gaussian="true" size="1.0">
+			<treeModel idref="treeModel"/>
+		</subtreeSlide>
+		<narrowExchange weight="1">
+			<treeModel idref="treeModel"/>
+		</narrowExchange>
+		<wideExchange weight="1">
+			<treeModel idref="treeModel"/>
+		</wideExchange>
+		<wilsonBalding weight="1">
+			<treeModel idref="treeModel"/>
+		</wilsonBalding>
+	</operators>
+
+	<mcmc id="mcmc" chainLength="1000000" autoOptimize="true" preBurnin="0">
+		<compoundLikelihood id="likelihood">
+			<treeLikelihood idref="treeLikelihood"/>
+		</compoundLikelihood>
+		<operators idref="operators"/>
+		<log logEvery="10000">
+			<column label="Likelihood" dp="4" width="12">
+				<compoundLikelihood idref="likelihood"/>
+			</column>
+			<column label="Root Height" sf="6" width="12">
+				<parameter idref="treeModel.rootHeight"/>
+			</column>
+			<column label="Kappa" sf="6" width="12">
+				<parameter idref="hky.kappa"/>
+			</column>
+		</log>
+		<log logEvery="10000" fileName="testMCMC.log">
+			<compoundLikelihood idref="likelihood"/>
+			<parameter idref="treeModel.rootHeight"/>
+			<parameter idref="hky.kappa"/>
+		</log>
+		<logTree  logEvery="10000" nexusFormat="true" fileName="testMCMC.trees">
+			<treeModel idref="treeModel"/>
+		</logTree>
+	</mcmc>
+</beast>
diff --git a/examples/benchmark/1/testHKY1510.xml b/examples/benchmark/1/testHKY1510.xml
new file mode 100644
index 0000000..7b5242c
--- /dev/null
+++ b/examples/benchmark/1/testHKY1510.xml
@@ -0,0 +1,327 @@
+<?xml version="1.0" standalone="yes"?>
+<!-- Generated by BEAUTi v1.5beta4                                           -->
+<!--       by Alexei J. Drummond and Andrew Rambaut                          -->
+<!--       Department of Computer Science, University of Auckland and        -->
+<!--       Institute of Evolutionary Biology, University of Edinburgh        -->
+<!--       http://beast.bio.ed.ac.uk/                                        -->
+<beast>
+	
+	<!-- The list of taxa analyse (can also include dates/ages).                 -->
+	<!-- ntax=36                                                                 -->
+	<taxa id="taxa">
+		<taxon id="Didelphis_virginiana"/>
+		<taxon id="Equus_caballus"/>
+		<taxon id="Rhinoceros_unicornis"/>
+		<taxon id="Bos_tarus"/>
+		<taxon id="Hippopotamus_amphibius"/>
+		<taxon id="Balaenoptera_physalus"/>
+		<taxon id="Physeter_macrocephalus"/>
+		<taxon id="Ursus_americanus"/>
+		<taxon id="Canis_familiaris"/>
+		<taxon id="Felis_catus"/>
+		<taxon id="Homo_sapiens"/>
+		<taxon id="Pan_troglodytes"/>
+		<taxon id="Gorilla_gorilla"/>
+		<taxon id="Pongo_pygmaeus"/>
+		<taxon id="Macaca_mulatta"/>
+		<taxon id="Callithrix_jacchus"/>
+		<taxon id="Loris_tardigradus"/>
+		<taxon id="Galago_crassicaudatus"/>
+		<taxon id="Daubentonia_madagascariensis"/>
+		<taxon id="Varecia_variegata"/>
+		<taxon id="Eulemur_mongoz"/>
+		<taxon id="Lemur_catta"/>
+		<taxon id="Hapalemur_griseus"/>
+		<taxon id="Propithecus_tattersalli"/>
+		<taxon id="Lepilemur_edwardsi"/>
+		<taxon id="Cheirogaleus_medius"/>
+		<taxon id="Mirza_coquereli"/>
+		<taxon id="Microcebus_murinus"/>
+		<taxon id="Microcebus_griseorufus"/>
+		<taxon id="Microcebus_myoxinus"/>
+		<taxon id="Microcebus_berthae"/>
+		<taxon id="Microcebus_rufus_1"/>
+		<taxon id="Microcebus_tavaratra"/>
+		<taxon id="Microcebus_rufus_2"/>
+		<taxon id="Microcebus_sambiranensis"/>
+		<taxon id="Microcebus_ravelobensis"/>
+	</taxa>
+	
+	<!-- The sequence alignment (each sequence refers to a taxon above).         -->
+	<!-- ntax=36 nchar=1812                                                      -->
+	<alignment id="alignment" dataType="nucleotide">
+		<sequence>
+			<taxon idref="Didelphis_virginiana"/>
+			CCCTATCCAATACAACTAGGTTTCCAAGACGCTACATCTCCTATTATAGAAGAACTTATATACTTTCATGATCATACATTAATAATTGTATTTCTGATCAGTTCACTAGTATTATATATTATTATTCTTATACTTACTACAAAACTTACTCACACAAGCACTATAGATGCCCAAGAAGTGGAAACAATTTGAACAATTTTACCAGCCGTAATTCTTATCCTTATTGCCCTTCCTTCCTTACGAATTCTTTACATAATAGATGAAATCTATAATCCTTATCTAACAGTTAAAGCAATGGGTCATCAATGATATTGAAGCTATGAGTTCACAGACTATGAAAATTTAATATTCGACTCATACATAATCCCAACCAAAGACCTTAGTCCTGGGCAACTTCGTTTACTAGAAGTTGATAACCGAATTGTTCTCCCAATAGAACTACCAATTCGCATGCTAATTTCATCAGAAGACGTTCTCCATGCATGAACA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Equus_caballus"/>
+			GCCTACCCCTTCCAACTAGGATTCCAAGACGCAACATCCCCTATTATAGAAGAACTCCTACACTTCCACGACCACACACTAATAATCGTATTCCTAATTAGCTCTCTAGTATTATATATTATCTCATCAATACTAACAACTAAATTAACCCATACCAGCACCATAGATGCTCAAGAAGTAGAGACAATTTGAACGATTTTACCAGCCATCATCCTTATTCTAATCGCCCTCCCATCCCTACGAATTCTATATATAATAGATGAAATCAATAATCCGTCCCTCACAGTCAAAACAATAGGCCACCAATGATACTGAAGCTACGAGTATACCGATTACGAAGACTTGACCTTTGACTCCTACATGATCCCCACATCAGACCTAAAACCAGGAGAATTACGTCTTCTAGAAGTCGACAATCGAGTGGTTCTCCCCATAGAAATAACCATCCGAATGCTAATTTCATCCGAAGACGTCCTACACTCATGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Rhinoceros_unicornis"/>
+			GCTTATCCACTTCAACTAGGATTTCAAGATGCAACATCCCCTATTATAGAAGAATTACTCCATTTCCATGACCATACACTGATAATCGTATTTTTAATTAGCTCCCTAGTGCTGTATATTATTTCACTCATGCTAACAACCAAACTAACACACACAAGCACTATAGACGCTCAAGAAGTAGAGACCATCTGAACGATTTTACCAGCTATTATCCTAATTTTAATTGCTCTCCCATCGCTACGAATCCTCTATATAATAGATGAGATTAATAATCCTTCCTTAACCATCAAAACCATAGGCCATCAGTGATACTGAAGCTACGAATATACAGATTATGAAGACCTAACCTTTGACTCCTACATAATTCCCACATCAGATCTAAAACCAGGAGAACTGCGACTTCTAGAAGTCGACAACCGAGTAGTATTACCCATAGAAATAACGATTCGAATGCTAATCTCATCCGAAGACGTTCTCCACTCATGAGCC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Bos_tarus"/>
+			GCATATCCCATACAACTAGGATTCCAAGATGCAACATCACCAATCATAGAAGAACTACTTCACTTTCATGACCACACGCTAATAATTGTCTTCTTAATTAGCTCATTAGTACTTTACATTATTTCACTAATACTAACGACAAAGCTGACCCATACAAGCACGATAGATGCACAAGAAGTAGAGACAATCTGAACCATTCTGCCCGCCATCATCTTAATTCTAATTGCTCTTCCTTCTTTACGAATTCTATACATAATAGATGAAATCAATAACCCATCTCTTACAGTAAAAACCATAGGACATCAGTGATACTGAAGCTATGAGTATACAGATTATGAGGACTTAAGCTTCGACTCCTACATAATTCCAACATCAGAATTAAAGCCAGGGGAGCTACGACTATTAGAAGTCGATAATCGAGTTGTACTACCAATAGAAATAACAATCCGAATGTTAGTCTCCTCTGAAGACGTATTACACTCATGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Hippopotamus_amphibius"/>
+			GCATATCCCCTCCAACTAGGCTTTCAAGATGCAGTATCACCCATTATAGAAGAACTACTGTATTTTCATGACCATACGCTAATAATCGTATTCCTAATCAGCTCACTAGTCCTTTACATTATTACACTAATACTGACTACCAAACTAACCCATACAAACACCATAAATGCACAAGAGGTAGAAACTGTCTGAACAATCCTACCAGCCATTATCCTTATCTTAATTGCACTGCCATCTCTGCGAATCCTCTATATAATAGACGAAATTAACAACCCCTCCCTGACCGTAAAAACTATGGGCCACCAATGATACTGAAGTTACGAATATACAGATTATGAAGACCTAAACTTTGACTCCTACATAGTCCCAACATCAGACCTAAAGCCGGGGGACCTACGACTCCTAGAAGTAGATAACCGAGTCGTCCTACCCATAGATGTAACAGTTCGAATACTAATCTCATCAGAAGACGTACTACACTCCTGAGCC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Balaenoptera_physalus"/>
+			GCATATCCATTCCAACTAGGTTTCCAAGATGCAGCATCACCCATCATAGAAGAGCTCCTACACTTTCACGATCATACACTAATAATCGTTTTTCTAATTAGCTCTTTAGTTCTCTACATTATTACCCTAATGCTTACAACCAAATTAACACATACTAGTACAATAGACGCCCAAGAAGTAGAAACTGTCTGAACTATCCTCCCAGCCATTATCTTAATTTTAATTGCCTTGCCTTCATTACGGATCCTTTACATAATAGACGAAGTCAATAACCCCTCCCTCACTGTAAAAACAATAGGTCACCAATGATATTGAAGCTATGAGTATACCGACTACGAAGACCTAAGCTTCGACTCCTATATAATCCCAACATCAGACCTAAAGCCAGGAGAACTACGATTATTAGAAGTAGATAACCGAGTTGTCTTACCTATAGAAATAACAATCCGAATATTAGTCTCATCAGAAGACGTACTCCACTCATGGGCC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Physeter_macrocephalus"/>
+			GCATACCCCCTTCAACTAGGTTTCCAAGACGCAACCTCTCCCATTATAGAGGAACTCTTACACTTTCATGATCACACCCTAATAATTGTTTTCCTAATTAGCTCTCTAGTCCTCTACATTATCACCCTAATACTAACAACCAAACTAACACATATCAACACAATAGACGCCCAAGAAGTAGAGACCATTTGAACCGTTCTCCCCGCTATCATTCTAATCCTAATCGCCCTACCATCCCTACGAATCCTCTACATAATAGACGAAATCAACAGCCCCTCTCTTACTGTAAAGACAATAGGTCACCAATGATATTGAAGCTACGAATATACCGACTACGAAGACCTGTCCTTTGACTCTTACATAATCCCAACATCGGACTTAAAACCAGGAGACCTACGACTATTAGAAGTCGACAACCGAATAGTATTGCCTATAGAAATAACAATCCGAGTCTTAGTCTCCTCCGAGGATGTCCTACACTCATGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Ursus_americanus"/>
+			GCACACCCCTTTCAAATAGGTCTTCAAGATGCAACTTCTCCTATCATAGAAGAACTCCTACATTTTCATGACCATACATTAATAATTGTATTCCTAATTAGCTCCTTAGTTCTCTATATTATTTCAACTATATTAACTACCAAATTAACACACACAAACACAATGGATGCACAAGAAGTAGAGACGGTGTGAACCATCCTGCCAGCTATAATCCTAATTCTAATCGCACTCCCATCGCTACGGATTCTCTATATAATGGATGAAATCAATAACCCCTCACTGACCGTAAAAACCATGGGCCATCAATGATATTGAAGTTACGAGTACACAGATTATGAAGATCTAAATTTTGACTCCTACATGACTCCAACACAAGAACTAAAGCCTGGAGAACTGCGGTTATTAGAAGTGGACAATCGAGTAGTACTGCCCATAGAAATAACGATCCGTATGCTAATCTCATCAGAAGATGTCTTGCACTCATGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Canis_familiaris"/>
+			GCGTACCCATTTCAACTCGGATTACAGGACGCAACCTCCCCTATTATAGAGGAGCTACTTCATTTTCATGACCATACACTAATAATTGTATTCTTAATCAGTTCTTTAGTTCTCTATATCATTTCACTAATATTGACTACAAAATTAACCCATACAAGCACAATAGACGCACAAGAAGTGGAAACAGTATGAACCATTCTACCCGCCATTATCCTAATCCTAATCGCTCTACCTTCCCTCCGAATCCTTTATATAATGGACGAAATTAATAACCCCTCTTTAACCGTGAAAACAATAGGCCACCAATGATACTGAAGCTATGAATATACTGACTATGAAGACTTAAACTTTGACTCCTACATAATCCCAACACAAGAATTAAAGCCAGGAGAACTCCGACTATTAGAAGTAGACAACCGAGTTGTCCTCCCAATAGAAATAACCATCCGAATACTTATCTCTTCAGAAGACGTTTTGCATTCATGAGCC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Felis_catus"/>
+			GCGTACCCCTTTCAACTAGGTTTCCAAGATGCTACATCCCCCATTATAGAAGAACTCCTACACTTTCACGACCACACACTAATAATTGTATTTTTAATCAGCTCTTTAGTTCTTTATATTATCTCGTTGATGCTAACAACCAAGCTCACGCACACGAGTACAATAGATGCTCAAGAAGTAGAAACCATCTGAACCATCCTACCTGCTATTATCCTGATTCTTATCGCCCTACCCTCCTTACGAATTCTCTATATAATGGATGAAATCAACAACCCCTCCCTCACAGTAAAAACCATAGGACATCAATGATATTGAAGTTATGAGTACACTGATTACGAAGACTTGAATTTTGACTCTTACATAATTCCTACCCAAGAGCTAAAACCAGGAGAACTCCGGCTATTAGAAGTTGACAACCGAGTAGTTTTACCAATAGAAATGACCATTCGCATGTTAATCTCATCAGAAGATGTGTTACACTCATGAGCC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Homo_sapiens"/>
+			GCACATGCAGCGCAAGTAGGTCTACAAGACGCTACTTCCCCTATCATAGAAGAGCTTATCACCTTTCATGATCACGCCCTCATAATCATTTTCCTTATCTGCTTCCTAGTCCTGTATGCCCTTTTCCTAACACTCACAACAAAACTAACTAATACTAACATCTCAGACGCTCAGGAAATAGAAACCGTCTGAACTATCCTGCCCGCCATCATCCTAGTCCTCATCGCCCTCCCATCCCTACGCATCCTTTACATAACAGACGAGGTCAACGATCCCTCCCTTACCATCAAATCAATTGGCCACCAATGGTACTGAACCTACGAGTACACCGACTACGGCGGACTAATCTTCAACTCCTACATACTTCCCCCATTATTCCTAGAACCAGGCGACCTGCGACTCCTTGACGTTGACAATCGAGTAGTACTCCCGATTGAAGCCCCCATTCGTATAATAATTACATCACAAGACGTCTTGCACTCATGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Pan_troglodytes"/>
+			GCACATGCAGCGCAAGTAGGTCTACAAGATGCTACTTCCCCTATCATAGAAGAACTTATTATCTTTCACGACCATGCCCTCATAATTATCTTTCTCATCTGCTTTCTAGTCCTATACGCCCTTTTCCTAACACTCACAACAAAACTAACTAATACTAGTATTTCAGACGCCCAGGAAATAGAAACCGTCTGAACTATCCTGCCCGCCATCATCCTAGTCCTTATTGCCCTACCATCCCTGCGTATCCTTTACATAACAGACGAGGTCAACGACCCCTCCTTTACTATTAAATCAATCGGCCATCAATGATATTGAACCTACGAATACACCGACTACGGCGGGCTAATCTTCAACTCCTACATACTCCCCCCATTATTTCTAGAACCAGGTGATCTACGACTCCTTGACGTTGATAACCGAGTGGTCCTCCCAGTTGAAGCCCCCGTTCGTATAATAATTACATCACAAGATGTTCTACACTCATGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Gorilla_gorilla"/>
+			GCACATGCAGCGCAAGTAGGTCTACAAGACGCTACTTCTCCTATCATAGAAGAACTAATCATCTTTCATGATCATGCCCTCATAATCATTTTTCTCATCTGCTTCTTAGTCCTGTACGCCCTTTTCCTAACACTCACAACAAAGCTAACTAACAACAACATCTCAGACGCCCAAGAAATAGAGACCATCTGAACCATCCTGCCCGCTATTATCTTAGTCCTGATCGCCCTCCCATCTCTACGAATCCTCTATATGACAGATGAAATCAATGACCCCTCCTTCACTATCAAATCAATCGGTCACCAATGATACTGAACCTACGAATACACCGACTATGGTGGATTGATCTTTAACTCCTATATACTCCCCCCATTATTCCTAGAACCAGGTGACCTACGACTCCTTGACGTCGACAACCGAGTAGTCCTTCCAGTTGAAGCCCCCGTCCGTATAATAATTACATCCCAAGATGTCTTACACTCATGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Pongo_pygmaeus"/>
+			GCGCACGCAGCACAGGTAGGTCTACAAGACGCTACCTCTCCTATCATAGAAGAATTGGTCATCTTTCACGACCACGCCCTCATAATCATCTTCCTAATCTGCTTCCTAGTCCTGTACGCCCTTTTCCTAACACTCACAACGAAACTCACCAACACTAACATCTCAGATGCCCAAGAGATAGAAACTATTTGAACTATCCTACCAGCCATCATCCTAATTCTAATCGCCCTCCCATCTCTACGCATCCTCTACTTAACAGACGAAATCAACGACCCTTCCTTCACCATTAAATCAATCGGCCATCAATGGTACTGAACCTACGAGTATACTGACTATGGCGGATTGATCTTCAACTCTTACATGCTCCCACCACTATTCCTAGAACCAGGCGACCTTCGACTCCTAGACGTCGACAATCGAGTAGTCCTCCCAGTCGAAGCCCCCGTTCGCATAATAATCACATCCCAAGACGTCTTGCACTCATGAACC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Macaca_mulatta"/>
+			GCCCACCCAGTTCAACTAAGCCTGCAAGACGCCACATCTCCTGTTATAGAGGAGTTGATTACTTTCCATGACCATGCTTTTATAGCCATATCTCTTATCAGCTTCCTAGTATTATATGCCCTGCTCTCAACGCTCACAACAAAACTAACCAACACTAGCATCACAGACGCCCAAGAAATAGAAACTATCTGAACTATCTTACCCGCAATTATCTTAATCCTAATTGCTCTCCCATCTCTACGCATCCTATACCTAACAGATGAAGTCAACGACCCATCCTTCACCATTAAATCAATCGGACACCAGTGATACTGAACCTACGAATACACAGATTACGGGGGCCTAATTTTCAACTCCTACATACTACCCCCACTATTCCTAAACCCAGGAGACCTCCGACTCCTAGAAGTTGACAATCGAGTAGTTCTTCCAATTGAAGCTCCTGTACGTATAATAATTACATCTCAAGACGTCTTACACTCATGAACC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Callithrix_jacchus"/>
+			GCAGCACCAGCCCAATTAGGCCTACAAAACGCCGCATCCCCAATCATAGAAGAACTTATTGCCTTCCATGACCATGCTCTAATAATTATCTTCTTAATTAGCTCACTAGTTCTATACATCATCTCTCTAATACTTACTACAAAACTGACACACACCAGTACCATGAACGCTCAAGAAATCGAAATGATCTGAACTATCCTACCTGCAATAATCCTCATTATAATTGCCCTTCCATCCCTACGCATTTTATATATAACAGACGAGTTTAATAAACCATATCTAACCCTTAAAGCAATCGGCCACCAATGATACTGAAGTTACGAATACTCCGACTATGAAGACTTAGCATTCGACTCCTACATTATACCAACATACTTCCTTGAACCCGGGGAATTCCGACTCCTTGAAGTAGACAACCGAACAACCTTGCCTATGGAAGCAGATATCCGTGTATTAATCTCATCACAAGACGTTTTACACTCATGAGCT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Loris_tardigradus"/>
+			GCCCATCCAGTACAATTCGGATTTCAAGACGCCGCCTCACCTATTATAGAAGAACTACTATACTTTCATGACCACACTCTCATAATTGTATTTATAATCAGCTCTCTAGTCCTATATATTATCTCCCTTATACTATCAACCGAACTTACCCATACAAGCACTATGGATGCGCAAGAAGTAGAAACAGTATGAACAATCCTGCCTGCCGTCATCCTAATTTTAATTGCCCTGCCATCCCTACGGATCCTATATATAATAGATGAAATTAATACCCCATCCCTTACCCTAAAAACAATAGGTCATCAATGATATTGAAGCTACGAATACACAGATTATGATAAACTATGCTTTGACTCCTATATAGTCCCAACCCCTGACCTAGAACCGGGGGACCTACGTCTACTTGAAGTAGATAACCGAGTTGTACTACCTACAGAAATATCTATTCGAATACTAATCTCCTCCGAAGATGTTCTCCACTCATGAACA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Galago_crassicaudatus"/>
+			GCCCACGCTGTACAATTCGGATTTCAAGACGCTGCCTCCCCTATTATAGAAGAATTATTATACTTCCATGACCACACCCTTATAATCGTATTTACAATTAGCTCCCTGGTCCTTTATATTATCTCCCTTATGTTATCGACTGAACTTACTCATACAAACACAATAGACGCCCAAGAAGTAGAGACAGTATGAACTATCCTGCCAGCTGTAATCCTCATCCTTATTGCCCTCCCATCCCTCCGAATCCTTTACATAATAGACGAAATCAACACCCCATCCTTAACCCTAAAAACAATAGGCCATCAATGATATTGAAGCTATGAGTACACAGATTATGACAACCTGTGCTTTGACTCCTACATAACCCCTACCCCTGACTTAGAACCAGGAGACCTTCGACTGTTAGAAGTGGACAACCGAGTCGTCCTACCCACAGAAATATCTATCCGAATACTAATCTCCTCTGAAGACGTACTCCACTCATGAACT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Daubentonia_madagascariensis"/>
+			GCTTACCCCGCCCAAATAGGATTCCAAGACGCCACCTCCCCTATCATAGAAGAACTTCTATATTTCCATGACCATACCTTAATAATTGTCTTTATAATTAGCTCATTAGTCCTCTATACTATCTCCCTTATACTCACAACCAGCCTTACCCATACAAACACCATAAACGCCCAAGAAGTGGAAACAGTGTGAACAATCCTCCCTGCAATTATCTGCATCCTTATTGCCCTACCATCCTTACGTATTCTCTACATAATAGATGAAATTAACAACCCTTCCCTAACCATTAAAACTATGGGCCACCAATGATACTGAACCTATGAGTATACAGATTATGAAAACATAACCTTTGATTCATACATAACCTCAACCAACGATCTCACCCCCGGAGAACTTCGACTTCTGGAAGTCGATAATCGAATAGTCCTACCTACGGAATTACCTATTCGAGTGTTAGTCTCCTCAGAAGATGTACTACACTCATGGACA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Varecia_variegata"/>
+			GCTCATCCAGTCCAACTAGGATTTCAAGACGCCGCTTCTCCTATTATAGAAGAACTCCTATATTTTCACGACCACACCCTAATAATTATATTCCTAATTAGCTCTTTAGTCCTATATATTATTTCCCTAATACTCACTACTAAACTCACACATACAAGCACTATAGATGCTCAAGAAGTAGAAACAGTATGAACAATTTTACCCGCAGCAATTCTTATTCTTATTGCCCTCCCCTCACTACGTATCCTATACATGATGGACGAAATTACTTCTCCTTCCCTTACCCTTAAAACCATAGGTCACCAATGATATTGAAGTTATGAGTATACGGATTACGAAAATTTATGCTTTGACTCATATATAACCCCCTGCTCAGACCTAAAACCCGGAGAACTTCGCTTACTTGAAGTAGATAATCGAGTCGTTCTACCCACAGAACTGTCAATCCGAACGCTAATCTCTTCAGAAGATGTATTACACTCATGAACC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eulemur_mongoz"/>
+			GCTTATCCAGTTCAACTAGGGTTCCAAGATGCTGCTTCCCCTATTATAGAAGAACTTTTATACTTCCATGACCACACCTTAATAATTATATTCCTAATTAGTTCTCTAGTCCTCTACATTATTTCCCTTATACTCACTACTGAGCTTATCCATACAAGTACTATAGACGCCCAAGAAGTAGAAACAGTATGAACTATTCTGCCCGCAGTAATTCTTATCCTTATTGCCCTCCCATCATTACGCATCCTATATATAATAGATGAAATCACCACACCCTCCTTAACTCTTAAAACTATGGGCCACCAATGATACTGAAGCTATGAGTACACGGACTATGAGAATCTGTGCTTTGACTCATACATAACTCCTCCTTCAGACCTAAAACCGGGAGAACTTCGTTTACTCGAAGTTGATAATCGAGTTGTGCTTCCAACAGAGCTACCAATCCGAATACTAATTTCCTCAGAAGATGTTTTACATTCATGAACT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Lemur_catta"/>
+			GCCTATCCAGTTCAATTAGGATTTCAAGATGCTGCTTCTCCCATTATAGAAGAACTTTTATACTTTCACGACCACACTTTAATAATTATATTCCTGATTAGTTCTCTAGTCCTTTACATTATCTCCCTTATACTCACTACTGAACTTATACATACAAACACCATAGACGCCCAAGAAGTAGAAACAGTATGAACAATCCTACCTGCAGCAATCCTCATTCTTATTGCTCTTCCATCATTACGCATTCTGTATATAATAGACGAAATTGCTACACCCTCCTTAACCCTTAAAACCATAGGTCACCAATGATACTGAAGCTACGAATACACAGATTATGAAGACTTATGTTTTGACTCGTACATAACTCCTTCCTCAGACCTTAAACCTGGAGAACTTCGCCTACTTGAAGTCGACAATCGAGTCGTACTTCCCACAGAACTAGCAGTTCGAATATTAATCTCTTCAGAAGATGTACTACACTCATGAACT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Hapalemur_griseus"/>
+			GCTTATCCAGTCCAACTAGGATTTCAAGATGCTGCTTCCCCTATTATAGAAGAACTTTTATACTTTCATGATCATACTTTAATAATTATATTCCTGATTAGTTCTCTAGTCCTTTACATTATTTCCCTCATACTTACTACTGAATTAATACATACAAATACCATAGACGCCCAAGAAGTAGAAACAGTATGAACAATCCTACCCGCAGCAATTCTCATTCTCATTGCCCTCCCATCATTACGTATCCTATATATAATAGACGAAATTACTACACCCTCATTAACCCTTAAAACTATAGGCCACCAGTGATACTGAAGCTACGAATACACAGACTATGAAAATTTATGCTTTGACTCATACATAGTTCCTTCCTCAGACCTAAAGCCTGGAGAACTTCGCCTACTTGAAGTTGATAATCGAATTGTACTTCCTACAGAATTATCAATTCGAATACTAATCTCTTCAGAAGATGTACTACACTCATGAGCC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Propithecus_tattersalli"/>
+			GCTTATCCAGTTCAATTGGGATTTCAGGATGCTGCTTCCCCCATCATGGAAGAGCTCTTATACTTTCATGATCATACTTTAATAATTGTATTCCTAATTAGTTCTCTAGTTCTCTATATCATCTCTCTAATACTCACCACCAAACTCATACACACCAGCACCATGGACGCACAAGAAGTAGAAACAGTATGAACTATCCTACCTGCAATCATTCTAATTCTTATTGCCCTCCCATCCCTACGTATCCTATACATAATGGATGAAATCACTACTCCTTCATTAACCCTTAAAACCATAGGTCATCAATGGTACTGAAGCTATGAATACACAGATTACGAAGATCTGTCTTTCGACTCATACATAGTTCCATCATCGGACCTCAAGCCCGGAGAACTTCGTCTGCTCGAAGTAGACAACCGAATTGTACTACCCACAGAACTATCAATTCGAATACTTATCTCTTCAGAAGACGTATTACACTCATGAGCC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Lepilemur_edwardsi"/>
+			GCCCACCCAGTCCAACTAGGATTTCAAGATGCCGCCTCTCCTATCATAGAAGAACTTCTATATTTCCATGACCACACTCTAATAATTGTTTTCCTCATCAGTTCCTTGGTCCTTTACATTATTTCCCTTATACTCTCTACTAAACTCACCCACACAAGTACAGTGGATGCCCAAGAAGTAGAAACAGTATGAACTATTTTGCCCGCAGTGATCCTAATTCTTATCGCCCTTCCATCTCTACGCATCCTATACATAATAGACGAAATCACTACACCCTCCTTAACCCTTAAAACAATAGGCCATCAATGATACTGAAGCTATGAATACACGGACTATGAAAATCTTTGCTTTGACTCATATATAATTCCTCTGTCAGATCTTAAACCCGGTGATCTTCGCCTACTCGAGGTTGATAACCGAGTTGCCTTACCCACAGAAATATCAATCCGAATGTTAGTATCCTCAGAAGACGTACTTCACTCATGGACC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Cheirogaleus_medius"/>
+			GCATGTCCAGTTCAACTAGGATTTCAAGACGCTGCCTCTCCTATTATAGAGGAACTTATATATTTCCATGACCATACTTTAATAATCGTCTTCCTAATTAGCTCCCTAGTCCTCTATATCATTTCCCTAATACTCACCACAGAACTTACCCACACAAACACAATAGATGCCCAAGAAGTAGAAACAGTATGAACCATCCTACCTGCAGTTATCTTAATCCTTATTGCTCTTCCATCACTACGAATTCTATATATAATAGATGAAATTACCACCCCATCTCTAACCCTAAAAACTATAGGCCATCAATGGTACTGAAGTTATGAATATACAGACTACGAAAACTTATGTTTTGATTCATATATAACGCCATCATCAGATCTCAAGCCAGGAGAACTTCGCCTACTAGAAGTTGATAACCGAGTTGTCCTACCCACAGAAATATCCATTCGTATACTCATCTCCTCAGAAGATGTACTACACTCATGAACC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Mirza_coquereli"/>
+			GCTTACCCAGCTCAGCTAGGACTCCAAGATGCCGCTTCCCCAATCATGGAAGAGCTTGCATATTTTCACGACCATACCCTAATAATTGTATTTTTAATTAGCTCCATGGTCCTATATATAATCTCTCTAATACTTACTACTGAACTTACCCACACAAGCACTATAGATGCTCAAGAAGTCGAAACAGTATGAACAATCCTACCCGCAGTTATCCTAATTTTTATTGCCCTTCCATCATTACGTATTTTATATATAATAGACGAAATTACAACGCCATCCTTAACTCTAAAAACCATAGGCCATCAATGATATTGAAGTTATGAATACACAGACTACGAAAGCCTATGCTTTGACTCTTATATGACCCCTCCACTAGAACTAGATCCAGGAGAACTTCGCCTACTAGAAGTTGATAATCGAGTAGTACTGCCTACAGAAATATCCATTCGTATACTTGTCTCTTCAGAAGATGTATTACACTCATGAACA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Microcebus_murinus"/>
+			GCCCACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATAATTGTATTTTTAATTAGCTCATTAGTTCTTTATATTATTTCCCTTATACTTACCACGGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTAGAAACAGTATGAACAATTCTACCAGCGGTTATTTTAATTCTTATTGCCCTTCCATCACTACGTATTTTATATATAATAGATGAAATTACAACTCCCACTCTGACCCTTAAGACAATAGGTCATCAATGATATTGAAGTTACGAATATACAGATTATGAAAACCTATGCTTTGACTCATACATAACCCCTCCTTTAGAACTCGATCCAGGAGAACTACGATTACTAGAAGTTGACAATCGAGTAGTATTACCAACAGAAATATCCATTCGCATACTCATCTCTTCAGAAGACGTACTACATTCATGAACT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Microcebus_griseorufus"/>
+			GCCTACCCAGCCCAATTAGGTTTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATGATTGTATTTTTAATCAGCTCATTGGTCCTTTATATTATTTCCCTTATACTTACCACAGAACTTACTCATACAAGCACTATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCCCTTCCATCATTACGCATTCTATACATAATGGATGAAATCACAACCCCCACCCTTACCCTTAAAACCATAGGTCATCAGTGATATTGAAGTTATGAATATACAGATTATGAAAGCCTATGCTTTGACTCATATATGACCCCTCCTTTAGAACTTGACCCCGGAGAATTACGATTACTAGAAGTCGATAATCGAGTAGTATTACCAACAGAAATATCTATTCGCATGCTAATCTCTTCAGAAGACGTGTTACACTCATGAACT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Microcebus_myoxinus"/>
+			GCCTACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTACATATTTTCATGATCATACCCTTATGATCGTATTCTTAATTAGCTCATTAGTTCTATATATCATTTCCCTCATGCTTACCACGGAACTCACCCATACAAGCACCATAGACGCTCAAGAAGTAGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCTCTTCCATCATTACGCATTTTATATATAATGGATGAAATTACAACTCCCTCCCTGACTCTTAAGACTATAGGTCATCAATGATATTGAAGCTATGAATACACAGACTATGAAAGCTTATGCTTTGACTCATATATAACCCCTCCATTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTGGATAATCGAGTAGTACTACCAACAGAAATATCTATTCGTATACTCATCTCTTCAGAAGACGTACTACACTCATGAACT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Microcebus_berthae"/>
+			GCCTACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCATGATCATACCCTTATGATCGTATTTTTAATTAGCTCATTAGTTCTTTATATCATTTCCCTCATGCTTACCACAGAACTCACCCATACAAGCACCATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCTCTTCCATCATTACGCATTTTATATATAATGGATGAAATTACAACTCCCTCCCTAACTCTTAAGACCATAGGTCATCAGTGATATTGAAGCTATGAATATACAGACTATGAAAGCTTATGCTTTGACTCATATATAACTCCTCCACTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTGGATAATCGAGTAGTACTACCAACAGAAATATCTATTCGCATGCTCATCTCTTCAGAAGACGTATTACATTCATGAACT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Microcebus_rufus_1"/>
+			GCCTACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCATGATCATACCCTTATGATCGTATTTTTAATTAGCTCATTAGTTCTATATATCATTTCCCTTATGCTTACCACAGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCTCTTCCATCATTACGCATTTTATATATAATGGATGAAATTACAACTCCTTCCCTAACTCTTAAGACTATAGGTCATCAGTGATATTGAAGCTATGAATATACAGATTATGAAAGCCTATGCTTTGACTCATATATAACCCCTCCATTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTGGATAACCGAGTAGTACTACCAACAGAAATATCTATTCGCATACTCATCTCTTCAGAAGACGTATTACATTCATGAACT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Microcebus_tavaratra"/>
+			GCCCACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGATCACACCCTTATAATTGTATTTTTAATTAGTTCATTAGTCCTATATATCATTTCCCTTATGCTTACCACGGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTTATTGCTCTTCCATCGTTACGCATTTTATATATAATAGATGAAATTACAACCCCTTCTCTAACTCTTAAGACTATAGGTCATCAGTGATATTGAAGCTATGAATATACAGACTATGAAAGCCTATGCTTTGACTCATATATAACCCCTCCATTAGAATTAGATCCAGGAGAACTACGATTACTAGAAGTAGATAATCGAGTAGTATTACCAACAGAAATATCTATTCGTATACTCATCTCCTCAGAAGACGTACTACACTCATGAACT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Microcebus_rufus_2"/>
+			GCCCACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATAATTGTATTCTTAATCAGCTCATTAGTTCTATATATCATTTCCCTTATACTTACTACGGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTGGAAACAGTATGAACAATCTTACCAGCAGTTATTTTAATCCTTATTGCCCTTCCATCATTACGCATTTTATACATAATGGATGAAATTACAACTCCCTCCCTAACTCTTAAGACTATAGGTCATCAATGATATTGAAGCTATGAATATACAGACTATGAAAGCCTATGCTTTGACTCATACATAACCCCTCCATTAGAGCTCGATCCAGGAGAACTACGATTACTAGAAGTGGATAACCGAGTAGTACTACCAACAGAAATATCTATTCGTATACTCATCTCTTCAGAAGACGTACTACATTCATGAACT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Microcebus_sambiranensis"/>
+			GCCTATCCAGCCCAATTAGGTTTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGATCATACCCTTATGATTGTATTTTTAATTAGCTCATTAGTCCTATACATTATTTCCCTTATGCTTACCACGGAACTTACTCATACAAGCACCATAGACGCTCAAGAAGTAGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTTATTGCCCTTCCATCACTACGCATTTTATATATAATGGATGAAATTACAACTCCCTCCCTAACTCTTAAGACTATAGGTCATCAATGATATTGAAGCTATGAATATACCGACTATGAAAGCCTATGCTTTGACTCCTACATAACCCCTCCATTAGAACTCGATCCAGGAGAACTACGATTACTAGAAGTAGATAATCGAGTAGTACTGCCAACAGAAATATCCATTCGTATACTCATCTCTTCAGAAGACGTATTACATTCATGAACT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Microcebus_ravelobensis"/>
+			GCCTGCCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTGTATATTTCCACGACCATACCCTTATAATTGTGTTTTTAATTAGCTCATTGGTCCTATATATTATTTCCCTTATACTCACCACAGAGCTCACTCATACAAGCACTATAGATGCTCAAGAAGTGGAAACTGTATGAACAATTTTGCCAGCAGTTATCTTAATTCTTATTGCCCTTCCATCATTACGCATTTTATATATAATAGATGAAATTACAACCCCGTCCCTTACTCTTAAGACTATAGGTCATCAATGATATTGAAGCTATGAATATACAGACTATGAAAACTTATGCTTTGACTCATACATGACTCCTCCATTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTCGACAATCGAGTAGTATTACCAACAGAAATATCTATCCGCATACTCATCTCTTCAGAAGACGTATTACATTCATGAACT [...]
+		</sequence>
+	</alignment>
+
+	<!-- The unique patterns for all positions                                   -->
+	<!-- npatterns=69                                                            -->
+	<patterns id="patterns" from="1">
+		<alignment idref="alignment"/>
+	</patterns>
+
+	<!-- This is a simple constant population size coalescent model              -->
+	<!-- that is used to generate an initial tree for the chain.                 -->
+	<constantSize id="initialDemo" units="substitutions">
+		<populationSize>
+			<parameter id="initialDemo.popSize" value="0.0001"/>
+		</populationSize>
+	</constantSize>
+
+	<!-- Generate a random starting tree under the coalescent process            -->
+	<coalescentTree id="startingTree">
+		<taxa idref="taxa"/>
+		<constantSize idref="initialDemo"/>
+	</coalescentTree>
+
+	<treeModel id="treeModel">
+		<coalescentTree idref="startingTree"/>
+		<rootHeight>
+			<parameter id="treeModel.rootHeight"/>
+		</rootHeight>
+		<nodeHeights internalNodes="true">
+			<parameter id="treeModel.internalNodeHeights"/>
+		</nodeHeights>
+		<nodeHeights internalNodes="true" rootNode="true">
+			<parameter id="treeModel.allInternalNodeHeights"/>
+		</nodeHeights>
+	</treeModel>
+
+	<!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+	<hkyModel id="hky">
+		<frequencies>
+			<frequencyModel dataType="nucleotide">
+				<alignment idref="alignment"/>
+				<frequencies>
+					<parameter id="hky.frequencies" dimension="4"/>
+				</frequencies>
+			</frequencyModel>
+		</frequencies>
+		<kappa>
+			<parameter id="hky.kappa" value="1.0" lower="0.0"/>
+		</kappa>
+	</hkyModel>
+
+	<!-- site model                                                              -->
+	<siteModel id="siteModel">
+		<substitutionModel>
+			<hkyModel idref="hky"/>
+		</substitutionModel>
+        <gammaShape gammaCategories="4">
+              <parameter id="siteModel.shape" value="0.5" lower="0.0" upper="1000.0"/>
+        </gammaShape>
+        <proportionInvariant>
+                <parameter id="siteModel.pInv" value="0.5" lower="0.0" upper="1.0"/>
+        </proportionInvariant>
+		<mutationRate>
+			<parameter id="siteModel.mu" value="1.0" lower="0.0"/>
+		</mutationRate>
+	</siteModel>
+
+	<treeLikelihood id="treeLikelihood">
+		<patterns idref="patterns"/>
+		<treeModel idref="treeModel"/>
+		<siteModel idref="siteModel"/>
+	</treeLikelihood>
+
+	<operators id="operators">
+        <!-- proportions invariant -->
+        <scaleOperator scaleFactor="0.75" weight="1">
+                <parameter idref="siteModel.pInv"/>
+        </scaleOperator>
+        <!-- gamma shape parameter -->
+        <scaleOperator scaleFactor="0.75" weight="1">
+                <parameter idref="siteModel.pInv"/>
+        </scaleOperator>
+        <!-- standard operators -->
+		<scaleOperator scaleFactor="0.5" weight="1">
+			<parameter idref="hky.kappa"/>
+		</scaleOperator>
+		<scaleOperator scaleFactor="0.5" weight="1">
+			<parameter idref="treeModel.rootHeight"/>
+		</scaleOperator>
+		<uniformOperator weight="10">
+			<parameter idref="treeModel.internalNodeHeights"/>
+		</uniformOperator>
+		<subtreeSlide weight="5" gaussian="true" size="1.0">
+			<treeModel idref="treeModel"/>
+		</subtreeSlide>
+		<narrowExchange weight="1">
+			<treeModel idref="treeModel"/>
+		</narrowExchange>
+		<wideExchange weight="1">
+			<treeModel idref="treeModel"/>
+		</wideExchange>
+		<wilsonBalding weight="1">
+			<treeModel idref="treeModel"/>
+		</wilsonBalding>
+	</operators>
+
+	<mcmc id="mcmc" chainLength="1000000" autoOptimize="true" preBurnin="0">
+		<compoundLikelihood id="likelihood">
+			<treeLikelihood idref="treeLikelihood"/>
+		</compoundLikelihood>
+		<operators idref="operators"/>
+		<log logEvery="10000">
+			<column label="Likelihood" dp="4" width="12">
+				<compoundLikelihood idref="likelihood"/>
+			</column>
+			<column label="Root Height" sf="6" width="12">
+				<parameter idref="treeModel.rootHeight"/>
+			</column>
+			<column label="Kappa" sf="6" width="12">
+				<parameter idref="hky.kappa"/>
+			</column>
+		</log>
+		<log logEvery="10000" fileName="testMCMC.log">
+			<compoundLikelihood idref="likelihood"/>
+			<parameter idref="treeModel.rootHeight"/>
+			<parameter idref="hky.kappa"/>
+		</log>
+		<logTree  logEvery="10000" nexusFormat="true" fileName="testMCMC.trees">
+			<treeModel idref="treeModel"/>
+		</logTree>
+	</mcmc>
+</beast>
diff --git a/examples/benchmark/1/testHKY1748.xml b/examples/benchmark/1/testHKY1748.xml
new file mode 100644
index 0000000..d17cc4c
--- /dev/null
+++ b/examples/benchmark/1/testHKY1748.xml
@@ -0,0 +1,482 @@
+<?xml version="1.0" standalone="yes"?>
+<!-- Generated by BEAUTi v1.5beta4                                           -->
+<!--       by Alexei J. Drummond and Andrew Rambaut                          -->
+<!--       Department of Computer Science, University of Auckland and        -->
+<!--       Institute of Evolutionary Biology, University of Edinburgh        -->
+<!--       http://beast.bio.ed.ac.uk/                                        -->
+<beast>
+	
+	<!-- The list of taxa analyse (can also include dates/ages).                 -->
+	<!-- ntax=67                                                                 -->
+	<taxa id="taxa">
+		<taxon id="Zea_mays"/>
+		<taxon id="Uniola_pittieri"/>
+		<taxon id="Uniola_paniculata"/>
+		<taxon id="Thellungia_advena"/>
+		<taxon id="Tetrachne_dregei"/>
+		<taxon id="Stiburus_conrathii"/>
+		<taxon id="Sporobolus_indicus"/>
+		<taxon id="Spartina_pectinata"/>
+		<taxon id="Schmidtia_pappophoroides"/>
+		<taxon id="Pogonarthria_squarrosa"/>
+		<taxon id="Pappophorum_mucronulatum"/>
+		<taxon id="Pappophorum_bicolor"/>
+		<taxon id="Neeragrostis_reptans"/>
+		<taxon id="Leptochloa_dubia"/>
+		<taxon id="Fingerhuthia_sesleriiformis"/>
+		<taxon id="Eragrostis_unioloides"/>
+		<taxon id="Eragrostis_truncata"/>
+		<taxon id="Eragrostis_trichophora"/>
+		<taxon id="Eragrostis_tremula"/>
+		<taxon id="Eragrostis_tenella"/>
+		<taxon id="Eragrostis_tef_variegata"/>
+		<taxon id="Eragrostis_secundiflora"/>
+		<taxon id="Eragrostis_schweinfurthii"/>
+		<taxon id="Eragrostis_rigidior"/>
+		<taxon id="Eragrostis_polytricha"/>
+		<taxon id="Eragrostis_pilosa_PI_221926"/>
+		<taxon id="Eragrostis_pilosa"/>
+		<taxon id="Eragrostis_patenti-pilosa"/>
+		<taxon id="Eragrostis_papposa"/>
+		<taxon id="Eragrostis_paniciformis"/>
+		<taxon id="Eragrostis_nutans"/>
+		<taxon id="Eragrostis_neesii"/>
+		<taxon id="Eragrostis_minor"/>
+		<taxon id="Eragrostis_mexicana"/>
+		<taxon id="Eragrostis_macilenta"/>
+		<taxon id="Eragrostis_lugens"/>
+		<taxon id="Eragrostis_lehmanniana"/>
+		<taxon id="Eragrostis_intermedia"/>
+		<taxon id="Eragrostis_hypnoides"/>
+		<taxon id="Eragrostis_heteromera"/>
+		<taxon id="Eragrostis_elegantissima"/>
+		<taxon id="Eragrostis_echinochloidea"/>
+		<taxon id="Eragrostis_dielsii"/>
+		<taxon id="Eragrostis_curvula"/>
+		<taxon id="Eragrostis_ciliaris"/>
+		<taxon id="Eragrostis_cilianensis"/>
+		<taxon id="Eragrostis_chapelieri"/>
+		<taxon id="Eragrostis_botryodes_2"/>
+		<taxon id="Eragrostis_botryodes_1"/>
+		<taxon id="Eragrostis_botryodes"/>
+		<taxon id="Eragrostis_bicolor"/>
+		<taxon id="Eragrostis_barrelieri"/>
+		<taxon id="Eragrostis_bahiensis"/>
+		<taxon id="Eragrostis_aspera"/>
+		<taxon id="Eragrostis_airoides"/>
+		<taxon id="Enneapogon_scopiarus"/>
+		<taxon id="Eleusine_corocana"/>
+		<taxon id="Diandrochloa_japonica"/>
+		<taxon id="Dactyloctenium_radulans"/>
+		<taxon id="Dactyloctenium_giganteum"/>
+		<taxon id="Dactyloctenium_australe"/>
+		<taxon id="Dactyloctenium_aegyptium"/>
+		<taxon id="Coelachyrum_piercei"/>
+		<taxon id="Cladoraphis_spinosa"/>
+		<taxon id="Calamovilfa_longifolia"/>
+		<taxon id="Calamovilfa_gigantea"/>
+		<taxon id="Acamptoclados_sessilispicus"/>
+	</taxa>
+	
+	<!-- The sequence alignment (each sequence refers to a taxon above).         -->
+	<!-- ntax=67 nchar=955                                                       -->
+	<alignment id="alignment" dataType="nucleotide">
+		<sequence>
+			<taxon idref="Zea_mays"/>
+			------------------------------------------------------cttggctcgacatagtctgttctattcgtcccgaaccgaattttcgctgggttgttt-----------------------------g-taagtaaagtaaatagtacacgatggagctcgagaggacagaattt-----ctttttgatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatatagaaa-----tcaaaaggttaaaataagaaaaa-gtctaattttggaagattggaaaaactttttt-----gatgaaaa-----gtctatctgaatcaattgttcatatttgatttctatag--------------------aagagtgaaatgcttt------atcgaaggaaa---------taagaaaaaa----gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Uniola_pittieri"/>
+			------------------------tccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattg-----attttttatcaagggaaaaaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtctaattttggaaaattggaaaa-ctttttt-----gattaaaa-----gtctataaRaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaatgaaggaaataaaaaaaaaaa--gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Uniola_paniculata"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgtgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattg-----attttttatcaagggaaaaaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtctaattttggaaaattggaaaa-ctttttt-----gattaaaa-----gtctataagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaatgaaggaaataaaaaaaaaa---gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thellungia_advena"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaacccaatttgcgctgagttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattg-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatatagaaa-----ttgaaaggttaaaataagaaaaa-gtctaattttggaagattggaaaa-ctttttc-----gattaaaa-----gtctatcagaatcaatcgttcatattcgatttctctag--------------------aagagcaaaatgcttt------attgaaggaaa---------taagaaaaaaa---gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Tetrachne_dregei"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagatagaattg-----attttttatcaagggaaaaaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtctaattttggaaaattggaaaa-ctttttt-----gattaaaa-----gtctagaagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaatgatggaaataaaaaaaaa----aaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Stiburus_conrathii"/>
+			---------------------------------------------------gctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgtgctgggttgtat-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattg-----attttttatcacgggaaaaaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtctaNttttggaaaattggaaaa-ctttttt-----gattaaaa-----gtctataaNaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------tttgaaggaaatgaagggaataaaaaaaaaa---gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Sporobolus_indicus"/>
+			atcgattgtggtttttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgttccgaacccaatttgcgctgagttgttt-----------------------------g-taaataaa-----tagtacacgatggagctcgagaagacagaattg-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatatagaaa-----tggaaaggttaaaataagaaaaa-gtctaattttggaagattggaaaa-ctttttc-----gattaaaa-----gtctatcagaattaatcgttcatattctatttctctag--------------------aagaggaaaatgcttt------attgaaggaaa---------taagaaaaaaa---gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Spartina_pectinata"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaacccaatttgcgcggagttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaatag-----attttttattaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatatagaaa-----ttgaat----aaaataagaaaaa-gtctaattttggaagattggaaaa-ctttttc-----ggttaaaa-----gtctatcagaatcaatcgttcatattcgatttctctag--------------------aagagcaaaatgcttt------attgaaggaaa---------taagaaaaaaa---gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Schmidtia_pappophoroides"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttacgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgaaaagacagaattg-----attttttatcaagggaaaaaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatatagaaa-----ttgaaaggttaaaataagaaaaaaggaatattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcattcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaa-----------------gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Pogonarthria_squarrosa"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----tggaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaa-----------------gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Pappophorum_mucronulatum"/>
+			TCGACTTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGCGCTAGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTG-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATATAGAAA-----TTGAAAGGTTAAAATAAGAAAAA-GTATAATTTTGGAAGATTGGAAAA--TTTTTTC----GATTAAAA-----GTCTATCAGAATCNATCGTTCATATTCGATTTCTCTAG--------------------AAGAGGAAAAAACTTT------ATTGANGGAAA---------TAAGAAAANAA---GAAAGGGTATGTTGC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Pappophorum_bicolor"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctaggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattg-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatatagaaa-----ttgaaaggttaaaataagaaaaa-gtataattttggaagattggaaaa-ttttttc-----gattaaaa-----gtctatcagaatcaatcgttcatattcgatttctctag--------------------aagaggaaaaaacttt------attgaaggaaa---------taagaaaaaaa---gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Neeragrostis_reptans"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattg-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatgcagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaataaaagtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaa-----------------gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Leptochloa_dubia"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgtttggtttgtaagtaactgggttgtttggtttg-taagtaaa-----tagtacacgatggagctcgagaagaaagaatagaatttcttttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatatagaaattaaattgaaaggttaaaataagaaaaa-gtctaattttggaagattggaaaa-cttttttt----gattaaaa-----gtctatcagaatcaatcgttcatatttgatttctctag--------------------aagaggaaaatgcttt------attgaaggaaa---------taagaaaaaaa---gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Fingerhuthia_sesleriiformis"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagatagaattg-----attttttatcaagggaaaaaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtctaattttggaaaattggaaaa-ctttttt-----gattaaaa-----gtctagaagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaatgatggaaataaaaaaaaaaa--gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_unioloides"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----aatttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaa-----------------gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_truncata"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaaa----------------gaaggggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_trichophora"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----aatttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaa-----------------gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_tremula"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaacc-aatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattg-----cttttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagagtggaaaa-cgttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaacgcttt------attgaaggaaa---------taaaaaaaaaaa--gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_tenella"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgagttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttatttttgaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgctcctattcgatttctatag--------------------aagaggaaaatgcttt------attaaaggaaa---------taaaaaaaaaaaaagaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_tef_variegata"/>
+			--------------------------------------------------------------------gtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaNgacagaattg-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatccatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaaa----------------gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_secundiflora"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaacc-aatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattg-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagagtggaaaa-cgttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttgtatag--------------------aagaggaaaacgcttt------attgaaggaaa---------tcaaaaaaaaaaaagaaggggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_schweinfurthii"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacataattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttg-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaa-----------------gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_rigidior"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----tattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaa-----------------gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_polytricha"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgttgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaaa----------------gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_pilosa_PI_221926"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattg-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatccatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaaa----------------gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_pilosa"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattg-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatccatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaaa----------------gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_patenti-pilosa"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaacc-aatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----tttttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaaaaagaaaaaagtcttattttggaagagtggaaaa-ctttttt-----tattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaacgcttt------attgaaggaaa---------tcaaaaaaaaaa--gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_papposa"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgtgctgggttgttt-----------------------------g-taagtaaa-----tagtacaggatggagctcgagaagacagaatta-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttacaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaa-----------------gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_paniciformis"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaacc-aatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagagtggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctagag--------------------aagaggaaaacgctttatttttattgaaggaaa---------taaaaaaaaaaaa-gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_nutans"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaacc-aatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagagtggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctagag--------------------aagaggaaaacgcttt------attgaaggaaa---------taaaaaaaaaaaa-gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_neesii"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattg-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----tttaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttg-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggagaatgcttt------attgaaggaaaaaaaaa-----------------gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_minor"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgttgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattagtccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaa-----------------gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_mexicana"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgttgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattagtccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaa-----------------gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_macilenta"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgttgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaaa----------------gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_lugens"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgttgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaaa----------------gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_lehmanniana"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaaaa---------------gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_intermedia"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgttgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagagga----gcttt------attgaaggaaaaaaaaaa----------------gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_hypnoides"/>
+			-------------------------ccaccattttccaaactaatgaaaatgctcttggctcgacataccctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattg-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatgcagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaataaaagtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaa-----------------gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_heteromera"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaacctaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----tagaaaggttaaaataagaaaaaagtcttattttggaagattgaaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaaa----------------gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_elegantissima"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttttttttgaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgtttatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaaa----------------gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_echinochloidea"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttaaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatatttgatttctatag--------------------aagaggaaaat-cttt------attgaaggaaaaaaaaa-----------------gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_dielsii"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaatttctt--tttttttttcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaa-----------------gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_curvula"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----tattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaa-----------------gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_ciliaris"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgagtttttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattg-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttatttttgaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgctcctattcgatttctatag--------------------aagaggaaaatgcttt------attaaaggaaa---------taaaaaaaaaa---gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_cilianensis"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----tattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaa-----------------gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_chapelieri"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----tattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaa-----------------gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_botryodes_2"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattg-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatccatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaaa----------------gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_botryodes_1"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaacc-aatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttcaaaggttaaaataagaaaaaagtcttattttggaagagtggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctagag--------------------aagaggaaaacgctttatttttattgaaggaaa---------taaaaaaaaaaaa-gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_botryodes"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaacc-aatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagagtggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctagag--------------------aagaggaaaacgctttatttttattgaaggaaa---------taaaaaaaaaaaa-gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_bicolor"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt------ttttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----tggaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaaa----------------gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_barrelieri"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttttcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattg-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----tggaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaa-----------------gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_bahiensis"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaacc-aatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattg-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtattattttggaagagtggaaaa-cgttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaacgcttt------attgaaggaaaaaaaaaaaaa-------------gaaggggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_aspera"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttttcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattg-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----tggaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaa-----------------gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_airoides"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgttgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaa--------------aaaaaaa--gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Enneapogon_scopiarus"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccaaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaatt---------ttttagcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatccttaacttaatatagaaa-----ttgaaaggttcaaataagaaaaaaggaaaattttggaagattggaaat-ct----------gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatcgttcctattcgatttctatagaagaggaaaatgcttt------attgaaggaaaaaaaaa-----------------gaaggggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eleusine_corocana"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcactgggttgttt-----------------------------gataagtaaa-----tagtacacgatggagctcgagaatacagaatagaattgattttttatcaagggaaagaatctatggttagtgaaaactaataaattaggccaactttgtaagtctatcct-----taatatagaaattaaattgaaaggttaaaataagaaaaa-gtctaattttggaagattggaaaa-cttttttttt--gattaaaa-----gtctatcagaatcaatcgttcatattcaatttctctag--------------------aagaggaaaatgcttt------attgaaggaaa---------taagaaaaaaa---gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Diandrochloa_japonica"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----aatttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaa-----------------gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Dactyloctenium_radulans"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctattctatttgtcccgaaccaaatttgcgctgggttgttt-----------------------------c-taagtaaa-----tagtacacgatggagctcgagaacacagaattg-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatatagaaa-----ttgaaaggttaaaataagaaaaa-gtctaattttggaagattgggaaa-cttttttttc--gatttaaa-----atctatcagaatcaaccgttcatattcgatttctctag--------------------aagaggaaaatgcttt------attgaaggaaa---------taagaaaaaaa---gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Dactyloctenium_giganteum"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctattctatttgtcccgaaccaaatttgcgctgggttgttt-----------------------------c-taagtaaa-----tagtacacgatggagctcgagaagacagaattg-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatatagaaa-----ttgaaaggttaaaataagaaaaa-gtctaattttggaagattgggaaa-cttttttttt-cgatttaaa-----atctatcagaatcaaccgttcatattcgatttctctag--------------------aagaggaaaatgcttt------attgaaggaaa---------taagaaaaaaa---gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Dactyloctenium_australe"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctattctatttgtcccgaaccaaatttgcgctgggttgttt-----------------------------c-taagtaaa-----tagtacacgatggagctcgagaagacagaattg-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatatagaaa-----ttgaaaggttaaaataagaaaaa-gtcgaattttggaagattgggaaa-cttttttttt-cgatttaaa-----atctatcagaatcaaccgttcatattcgatttctctag--------------------aagaggaaaatgcttt------attgaaggaaa---------taagaaaaaaa---gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Dactyloctenium_aegyptium"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccggatttgcgctgggttgttt-----------------------------c-taagtaaa-----tagtacacgatggagctcgagaagacagaattg-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatatagaaa-----ttgaaaggttaaaataagaaaaa-gtctaattttggaagattgggaaa-cttttttttc--gattaaaa-----atctatcagaatcaatcgttcatattcgatttctctag--------------------aagaggaaaatgcttt------attgaaggaaaa---ggaaataagaaaaaaa---gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Coelachyrum_piercei"/>
+			atcgattgtggattttt----ctatccatcattttccatagtaatgaaaatgttcttggctcgacatagtctgttctatttgtcccgaacctaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaggacagaattt-----cttttttctcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatatagaaa-----taaaaaggttaaaataagaaaaaagtcaaattttggaagattggaaaaactttttc-----gattaaaa-----gtctatctgaatcaatcgttcatatttgatttctatag--------------------aagagtgaaatgcttt------atcgaaggaaa---------taagaaaaaa----gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Cladoraphis_spinosa"/>
+			----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------gtNgggaaaaaaaaaaaaa-------------gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Calamovilfa_longifolia"/>
+			atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaacccaatttgcgctgagttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaatag-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatatagaaa-----ttgaat----aaaataagaaaaa-gtctaattttggaagattggaaaa-ctttttc-----gattaaaa-----gtctatcaaaatcaatcgttcatattcgatttctctag--------------------aaaagcaaaatgcttt------attgaaggaaaaa--ggaaataagaaaaaaa---gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Calamovilfa_gigantea"/>
+			-tcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaacccaatttgcgctgagttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaatag-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatatagaaa-----ttgaat----aaaataagaaaaa-gtctaattttggaagattggaaaa-ctttttc-----gattaaaa-----gtctatcaaaatcaatcgttcatattcgatttctctag--------------------aaaagcaaaatgcttt------attgaaggaaaaa--ggaaataagaaaaaaa---gaaagggtatgttgc [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Acamptoclados_sessilispicus"/>
+			atcgattgtggattttgttNgctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----cttttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----tagtactgaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttcgatag--------------------aagaggaaaatgcttt------attgaaggaaa---------taaaaaaaaaa---gaaagggtatgttgc [...]
+		</sequence>
+	</alignment>
+
+	<!-- The unique patterns for all positions                                   -->
+	<!-- npatterns=69                                                            -->
+	<patterns id="patterns" from="1">
+		<alignment idref="alignment"/>
+	</patterns>
+
+	<!-- This is a simple constant population size coalescent model              -->
+	<!-- that is used to generate an initial tree for the chain.                 -->
+	<constantSize id="initialDemo" units="substitutions">
+		<populationSize>
+			<parameter id="initialDemo.popSize" value="0.0001"/>
+		</populationSize>
+	</constantSize>
+
+	<!-- Generate a random starting tree under the coalescent process            -->
+	<coalescentTree id="startingTree">
+		<taxa idref="taxa"/>
+		<constantSize idref="initialDemo"/>
+	</coalescentTree>
+
+	<treeModel id="treeModel">
+		<coalescentTree idref="startingTree"/>
+		<rootHeight>
+			<parameter id="treeModel.rootHeight"/>
+		</rootHeight>
+		<nodeHeights internalNodes="true">
+			<parameter id="treeModel.internalNodeHeights"/>
+		</nodeHeights>
+		<nodeHeights internalNodes="true" rootNode="true">
+			<parameter id="treeModel.allInternalNodeHeights"/>
+		</nodeHeights>
+	</treeModel>
+
+	<!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+	<hkyModel id="hky">
+		<frequencies>
+			<frequencyModel dataType="nucleotide">
+				<alignment idref="alignment"/>
+				<frequencies>
+					<parameter id="hky.frequencies" dimension="4"/>
+				</frequencies>
+			</frequencyModel>
+		</frequencies>
+		<kappa>
+			<parameter id="hky.kappa" value="1.0" lower="0.0"/>
+		</kappa>
+	</hkyModel>
+
+	<!-- site model                                                              -->
+	<siteModel id="siteModel">
+		<substitutionModel>
+			<hkyModel idref="hky"/>
+		</substitutionModel>
+        <gammaShape gammaCategories="4">
+              <parameter id="siteModel.shape" value="0.5" lower="0.0" upper="1000.0"/>
+        </gammaShape>
+        <proportionInvariant>
+                <parameter id="siteModel.pInv" value="0.5" lower="0.0" upper="1.0"/>
+        </proportionInvariant>
+		<mutationRate>
+			<parameter id="siteModel.mu" value="1.0" lower="0.0"/>
+		</mutationRate>
+	</siteModel>
+
+	<treeLikelihood id="treeLikelihood">
+		<patterns idref="patterns"/>
+		<treeModel idref="treeModel"/>
+		<siteModel idref="siteModel"/>
+	</treeLikelihood>
+
+	<operators id="operators">
+        <!-- proportions invariant -->
+        <scaleOperator scaleFactor="0.75" weight="1">
+                <parameter idref="siteModel.pInv"/>
+        </scaleOperator>
+        <!-- gamma shape parameter -->
+        <scaleOperator scaleFactor="0.75" weight="1">
+                <parameter idref="siteModel.pInv"/>
+        </scaleOperator>
+        <!-- standard operators -->
+		<scaleOperator scaleFactor="0.5" weight="1">
+			<parameter idref="hky.kappa"/>
+		</scaleOperator>
+		<scaleOperator scaleFactor="0.5" weight="1">
+			<parameter idref="treeModel.rootHeight"/>
+		</scaleOperator>
+		<uniformOperator weight="10">
+			<parameter idref="treeModel.internalNodeHeights"/>
+		</uniformOperator>
+		<subtreeSlide weight="5" gaussian="true" size="1.0">
+			<treeModel idref="treeModel"/>
+		</subtreeSlide>
+		<narrowExchange weight="1">
+			<treeModel idref="treeModel"/>
+		</narrowExchange>
+		<wideExchange weight="1">
+			<treeModel idref="treeModel"/>
+		</wideExchange>
+		<wilsonBalding weight="1">
+			<treeModel idref="treeModel"/>
+		</wilsonBalding>
+	</operators>
+
+	<mcmc id="mcmc" chainLength="1000000" autoOptimize="true" preBurnin="0">
+		<compoundLikelihood id="likelihood">
+			<treeLikelihood idref="treeLikelihood"/>
+		</compoundLikelihood>
+		<operators idref="operators"/>
+		<log logEvery="10000">
+			<column label="Likelihood" dp="4" width="12">
+				<compoundLikelihood idref="likelihood"/>
+			</column>
+			<column label="Root Height" sf="6" width="12">
+				<parameter idref="treeModel.rootHeight"/>
+			</column>
+			<column label="Kappa" sf="6" width="12">
+				<parameter idref="hky.kappa"/>
+			</column>
+		</log>
+		<log logEvery="10000" fileName="testMCMC.log">
+			<compoundLikelihood idref="likelihood"/>
+			<parameter idref="treeModel.rootHeight"/>
+			<parameter idref="hky.kappa"/>
+		</log>
+		<logTree  logEvery="10000" nexusFormat="true" fileName="testMCMC.trees">
+			<treeModel idref="treeModel"/>
+		</logTree>
+	</mcmc>
+</beast>
diff --git a/examples/benchmark/1/testHKY1749.xml b/examples/benchmark/1/testHKY1749.xml
new file mode 100644
index 0000000..0ff7387
--- /dev/null
+++ b/examples/benchmark/1/testHKY1749.xml
@@ -0,0 +1,517 @@
+<?xml version="1.0" standalone="yes"?>
+<!-- Generated by BEAUTi v1.5beta4                                           -->
+<!--       by Alexei J. Drummond and Andrew Rambaut                          -->
+<!--       Department of Computer Science, University of Auckland and        -->
+<!--       Institute of Evolutionary Biology, University of Edinburgh        -->
+<!--       http://beast.bio.ed.ac.uk/                                        -->
+<beast>
+	
+	<!-- The list of taxa analyse (can also include dates/ages).                 -->
+	<!-- ntax=74                                                                 -->
+	<taxa id="taxa">
+		<taxon id="Pogonarthria_squarrosa"/>
+		<taxon id="Pappophorum_mucronulatum"/>
+		<taxon id="Pappophorum_bicolor"/>
+		<taxon id="Leptochloa_dubia_5.3"/>
+		<taxon id="Leptochloa_dubia_5.1"/>
+		<taxon id="Fingerhuthia_sesleriiformis"/>
+		<taxon id="Eragrostis_unioloides"/>
+		<taxon id="Eragrostis_truncata"/>
+		<taxon id="Eragrostis_trichophora_4.4"/>
+		<taxon id="Eragrostis_trichophora_4.2"/>
+		<taxon id="Eragrostis_tremula_7.6"/>
+		<taxon id="Eragrostis_tremula_5.3"/>
+		<taxon id="Eragrostis_tenella"/>
+		<taxon id="Eragrostis_tef_red_dabi_6.9"/>
+		<taxon id="Eragrostis_tef_red_dabi_3"/>
+		<taxon id="Eragrostis_secundiflora"/>
+		<taxon id="Eragrostis_schweinfurthii"/>
+		<taxon id="Eragrostis_rigidior"/>
+		<taxon id="Eragrostis_polytricha"/>
+		<taxon id="Eragrostis_pilosa_2.7"/>
+		<taxon id="Eragrostis_pilosa_2.6"/>
+		<taxon id="Eragrostis_patenti-pilosa"/>
+		<taxon id="Eragrostis_papposa"/>
+		<taxon id="Eragrostis_paniciformis_ETH_3_9.8"/>
+		<taxon id="Eragrostis_paniciformis_9.11"/>
+		<taxon id="Eragrostis_nutans"/>
+		<taxon id="Eragrostis_neesii"/>
+		<taxon id="Eragrostis_minor_3.4"/>
+		<taxon id="Eragrostis_minor__PI_223367_22"/>
+		<taxon id="Uniola_paniculata"/>
+		<taxon id="Thellungia_advena"/>
+		<taxon id="Tetrachne_dregei"/>
+		<taxon id="Sporobolus_indicus_6.2"/>
+		<taxon id="Sporobolus_indicus_6.1"/>
+		<taxon id="Spartina_pectinata"/>
+		<taxon id="Schmidtia_pappophoroides"/>
+		<taxon id="Eragrostis_mexicana_PI_203652_3.1"/>
+		<taxon id="Eragrostis_mexicana_PI_203652_1.1"/>
+		<taxon id="Eragrostis_macilenta_PI_194929_6"/>
+		<taxon id="Eragrostis_macilenta_PI_194929_2.4"/>
+		<taxon id="Eragrostis_lugens"/>
+		<taxon id="Eragrostis_lehmanniana"/>
+		<taxon id="Eragrostis_intermedia"/>
+		<taxon id="Eragrostis_heteromera_4.1"/>
+		<taxon id="Eragrostis_heteromera_2.9"/>
+		<taxon id="Eragrostis_elegantissima"/>
+		<taxon id="Eragrostis_echinochloidea"/>
+		<taxon id="Eragrostis_dielsii"/>
+		<taxon id="Eragrostis_curvula"/>
+		<taxon id="Eragrostis_ciliaris"/>
+		<taxon id="Eragrostis_cilianensis_PI_299912_1.4"/>
+		<taxon id="Eragrostis_cilianensis_PI_299912_1.3"/>
+		<taxon id="Eragrostis_cilianensis_eth24_6.5"/>
+		<taxon id="Eragrostis_chapelieri"/>
+		<taxon id="Eragrostis_botryodes_ETH_9_2.1"/>
+		<taxon id="Eragrostis_botryodes_ETH_13_3.5"/>
+		<taxon id="Eragrostis_bicolor21"/>
+		<taxon id="Eragrostis_bicolor_25"/>
+		<taxon id="Eragrostis_barrelieri_1.5"/>
+		<taxon id="Eragrostis_barrelieri_1.4"/>
+		<taxon id="Eragrostis_bahiensis_1.9"/>
+		<taxon id="Eragrostis_bahiensis_1.8"/>
+		<taxon id="Eragrostis_aspera"/>
+		<taxon id="Eragrostis_airoides"/>
+		<taxon id="Enneapogon_scoparius"/>
+		<taxon id="Eleusine_corocana"/>
+		<taxon id="Diandrochloa_japonica"/>
+		<taxon id="Dactyloctenium_radulans"/>
+		<taxon id="Dactyloctenium_aegypticum"/>
+		<taxon id="Coelachyrum_piercei"/>
+		<taxon id="Calamovilfa_longifolia"/>
+		<taxon id="Calamovilfa_gigantea"/>
+		<taxon id="Acamptoclados_sessilispica_1.8"/>
+		<taxon id="Acamptoclados_sessilispica_1.3"/>
+	</taxa>
+	
+	<!-- The sequence alignment (each sequence refers to a taxon above).         -->
+	<!-- ntax=74 nchar=2253                                                      -->
+	<alignment id="alignment" dataType="nucleotide">
+		<sequence>
+			<taxon idref="Pogonarthria_squarrosa"/>
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACAGTGAG----CCAAGCACAATTAGTTTACCT----CATTATTGCTACTGTTCGATGATC---------------------------------------GAACTTCTTT-----GGGTTTT-CGGTAC----TGTTCGGT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Pappophorum_mucronulatum"/>
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCTGTGAAATACGACGTGGAAACAGTGAG-------------------------------------------------------------------------------------------------------------------------------------CTCTTGTAT-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Pappophorum_bicolor"/>
+			GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAACGACAAGTACATCGCTGTGAAATACGACGTGGAAACAGTGAG-------------------------------------------------------------------------------------------------------------------------------------CTCTTGTAT-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Leptochloa_dubia_5.3"/>
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGAGGAAACCGTGAG-------------------------------------------------------------------------------------------------------------------------------------TTCATTCATTACCACTGTGTGAACTTGTTTGATTTTTCAGTACTAATCGGTCCTGAGTTTTTGACGAGGCA------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Leptochloa_dubia_5.1"/>
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATAGCCGTGAAATACGACGACGAAACCGTGAG-------------------------------------------------------------------------------------------------------------------------------------TTCATTCGTTGCCACTGTGTGAACTTGTTTGATTTTTTGGTACTAGTAATC-----GGTTCTGACGAGGCA------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Fingerhuthia_sesleriiformis"/>
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCAAGCAAGGACAAGTACGTCGCCGTGAAATACGACGCCGAAACCGTGAG----CCTAGCTAGCGCAAACTTCTTTCATTTCATTGCT---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ACTGTGTGGACTTGTTCGGTTTTTTAGTACTACAATTCGATTCT----------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_unioloides"/>
+			GGGATCGTCA-CGG?-ATGGACGTCGGCGAGTGGGATCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCAGAAACAGTGAG----CCAAGCACAATCATGTTCCTT----CATTGAC---ACTGTTCGAT-------------------------------------------GAACTTCTTT-----GGATTTT-CAGTAC----TGTTCGGT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_truncata"/>
+			GGGATCGTCA-CGGC-ATGGACGTTAGTGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACAGTGAG----CCAAGCCCAATCATTTCGCTT----CGTTGTT---ACTGTTCGAT-------------------------------------------GAACTTCTTT-----GGGTTTT-CGGTGC----TGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_trichophora_4.4"/>
+			GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATTGCCATGAAATACGATGCTGAAACAGTGAG----CCAAGCACAATCATTT-GCTT----CATTGAT---ACTGTTTGAT-------------------------------------------GAACTTCTTTT----GGATTTT-CAGTAC----TGTTCTAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_trichophora_4.2"/>
+			------------------GGACGTCAGCGAGTGGGATCCCAGCAAGGACAAGTACACCGCCATGAAATACGACGCAGAAACAGTGAG----CCAAGCACAATCATGTTCCTT----CATTGAC---ACTGTTCGAT-------------------------------------------GAACTTCTTT-----GGATTTT-CGGTAC----TGTTCGGT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_tremula_7.6"/>
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACAGTACGTGAGCCAAGCACAGTCATTTTTATT---GGATTGC-----TACCGTGTGAT-----------------------------------------GAGCTTCTTT-----GGATTTT-CAGTAC----TGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_tremula_5.3"/>
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACAGTGAG--AGCCAAGCACAATCATTTTACTT----CATTGCTAGTACTGTTTGAT-------------------------------------------GAACTTCTTTGGCTACGATTTT-CAGGCC----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_tenella"/>
+			GGGATCGTCA-CGGC-ATGGACATCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACCGTACGTGAGCCAAGCACAATCATTTTTTTTT--GGATTGAT---ATTGTGTGAT-------------------------------------------GAACTTCTTT-----GGATTTT-CAGTAC----TGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_tef_red_dabi_6.9"/>
+			GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCTGAAACGGTGAA--------------CCATTTTGCTT----CATTGCT---ACTGTTTCAT-------------------------------------------GAACTTCTTT-----GGATTTT-CAGTGC----TGTT--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_tef_red_dabi_3"/>
+			GGGATCGTCAATGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACGGTGAG----CCAAGCACAATCATTTTACTT-CGTCATTGCT---ACTGTTTGAT-------------------------------------------GAACTTCTTT-----GGATTCT-CAGTAC----TGTTTTAA----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------AT----------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_secundiflora"/>
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAATGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACAGTACGTTAG-CAAGCACAATCTTTTTTTTTTTTGGATTAC-----TACCGTGTGAC-----------------------------------------GAACTTCTTT-----GGATTTT-CTATAC----CGTGTGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CGAT--------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_schweinfurthii"/>
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCTGTGAAATACGACACGGAAAC----TGTGAGCCAATCACAAACATTTCACTA---------C-----TACCTTCTTTCATTTCATTGCTACTGTGTCTGTGT-----------------GAACTTGTTT-----TGTTTT-------------GTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_rigidior"/>
+			GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCTGAAACAGTGAG----CCAAGCTCAATCACTTGACTT----TGTTGAT---AATGTTCGAT-------------------------------------------GGACTTCTTT-----GGATTTT-CAGTAC----CGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_polytricha"/>
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACAGTGAG--AGCCAAGCACAATCATTTTACTT----CATTGCTAGTACTGTTTGAT-------------------------------------------GAACTTCTTT-----GGATTTT-CAGTAC----TGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_pilosa_2.7"/>
+			GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCTGAAACGGTGAA--------------CCATTTTACTT----CATTGCT---ACTGTTTCAT-------------------------------------------GAACTTCTTT-----GGATTTT-CAGTGC----TGTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_pilosa_2.6"/>
+			GGGATCGTCAATGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACGGTGAG----CCAAGCACAATCATTTTACTT-CGTCATTGCT---ACTGTTTGAT-------------------------------------------GAACTTCTTT-----GGATTCT-CAGTAC----TGTTTTAA----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------AT----------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_patenti-pilosa"/>
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACAGTACGTGAGCCAAGCACAGTCTTTTTTTTT---GGATGGC-----TACTGTGTGAT-----------------------------------------GAACTTCTTT-----GGATTTC-CAGTAC----CGCTCGGT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_papposa"/>
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCTGAAACAGTGAG----CCAAGCACAATCATTTTACTT----CATTGAT---ACCGTTCGGT-------------------------------------------GAACTTCTTT-----GGATTTT-CGGTGC----TGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_paniciformis_ETH_3_9.8"/>
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACAGTACGTGAGCCGAGCGCAGTCATTTTTT----AGGATCGC-----TACCGTGTGAC--------------------------------------------GTTCTTT-----GGATTTT-CTGTAC----TGTGTGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CGATTCTG----------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_paniciformis_9.11"/>
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACAGTACGTGAGCCGAGCACAGTCATTTTTT----AGGATCGC-----TACCGTGTGAC--------------------------------------------GTTCTTT-----GGATTTT-CTGTAC----TGTGTGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CGATTCTG----------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_nutans"/>
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACAGTACGTGAGCCGAGCACAGTCATATTTTT---GGGATCGACAGACTACCGTGTGAC----------------------------------------GAAAGTTCTTT-----GGATTTT-CTGTAC----AGTGTGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CGATTCTG----------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_neesii"/>
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAAC----TGTGAGCCAAGCACAATCACGTTTTTT-----ATTGC-----TACTGCGTGAT-----------------------------------------GAATTTCCTA-----GGTTGCT-CAGTAC----TGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_minor_3.4"/>
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCTGAAACAGTGAG----CCAAGCTCAATCACTTGACTT----CCTTGAT---AATGTTCGAT-------------------------------------------GGACTTCTTT-----GGATTTT-CAGTAC----CGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_minor__PI_223367_22"/>
+			---ATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACAGTGAG--AGCCAAGCACAATCATTTTACTT----CATTGCTAGTACTGTTTGAT-------------------------------------------GAACTTCTTT-----GGATTTT-CAGTAC----TGTGCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Uniola_paniculata"/>
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACAGTGAG----CCTAGCACAAACATTTTACTACTCCCTCTAATTTTAAATATCCGACGCTGTTAATTTTT-----------------------------TTCATTATTT-----TAACTAT-TTATTT----TTTTATAAATATTTATGTAAATAGCTAAATGTATAAATTAACCTTAAAATATTTTTGATGATAGATCTAATGATACTTATTTTACGTTTAAATAATTAATTATTTAAATATATATTGTTAGTTAAAATTCAATAAAAAATTTAACGGTGTCATATATTTAAAAAAGGAAGGATCGTTTCATTGCCACTGTGTGAGTAATGTTCGAT----------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thellungia_advena"/>
+			GGGATCGTGAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAGACTGTGAG-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------AGCCTTC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Tetrachne_dregei"/>
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTCAAATACGACGCCGAAACCGTGAG----CCTAGCACAACTTCTTTCATTTCATTGCGACTGTGTGGACTTGTTCGGTTT-TTTAGTACTGCACAATTCGATTC----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Sporobolus_indicus_6.2"/>
+			GGAATCGTCAACGGCAATGGACGTCAGCGAGTGGGACCCTAGCAAGGACAAGTACATCGCCGTGAAGTACGACGTGGAAACCGTGAG-------------------------------------------------------------------------------------------------------------------------------------GACCTGCATGCTAGCTTGTTTTGTT-CCACATGACTCAATTTATTCATTGCCACTGCGTCCATTCATCAGTGCCAGTGAACTATTCGATTCTGAATTTCTGACGAGGCAATAAGGG--------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Sporobolus_indicus_6.1"/>
+			GGAATCGTCAACGGCAATGGACGTCAGCGAGTGGGACCCTAGCAAGGACAAGTACATCGCCGTGAAGTACGACGTGGAAACCGTGAG-------------------------------------------------------------------------------------------------------------------------------------GACCTGCATGCTAGCTTGTTTTGTT-CCACATGACTCAATTTATTCATTGCCACTGCGTCCATTCATCAGTGCCAGTAAACTATTCGATTCTGAATTTCTGACGAAGCAATAAGGG--------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Spartina_pectinata"/>
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGAAGGGACAAGTACATCGCCGTGAAGTACGACGTGGAAACTGTGAG-------------------------------------------------------------------------------------------------------------------------------------TCTAT------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------TTTCGT [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Schmidtia_pappophoroides"/>
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCCTCAAATACGACGCCGAAACGGTACGTGAGCCAGGCACACACATTTCACCGTTTT---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------TCATAGCCACTGTACTGCTCGAT----------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_mexicana_PI_203652_3.1"/>
+			GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACAGTGAG--AGCCAAGCACAATCATTTTACTT----CATTGCTAGTACTGTTTGAT-------------------------------------------GAACTTCTTT-----GGATTTT-CAGTAC----TGTGCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_mexicana_PI_203652_1.1"/>
+			GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCTGAAACAGTGAG----CCAAGCTCAATCACTTGACTT----CGTTGAT---AATGTTCGAT-------------------------------------------GGACTTCTTT-----GGATTTT-CAGTAC----CGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_macilenta_PI_194929_6"/>
+			GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACAGTGAG--AGCCAAGCACAATCATTTTACTT----CATTGCTAGTACTGTTTGAT-------------------------------------------GAACTTCTTT-----GGCT--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_macilenta_PI_194929_2.4"/>
+			GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGATAAGTACATCGCCATGAAATACGACGCTGAAACAGTGAG----CCAAGCTCAATCACTTGACTT----TGTTGAT---AATGTTCGAT-------------------------------------------GGACTTCTTT-----GGATTTT-CAGTAC----CGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_lugens"/>
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACAGTGAG--AGCCAAGCACAATCATTTTACTT----CATTGCTAGTACTGTTTGAT-------------------------------------------GAACTTCTTT-----GGATTTT-CAGTAC----TGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_lehmanniana"/>
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACAGTGAG----CCAAGCACAATCATTTTGCTT----TATTGCT---ACTGTTTGAT------------------------------CGATGAATTTCCTGAACTTCTTT-----GGATTTG-GAGTAC----TGTTCGGT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_intermedia"/>
+			GGGATCGTCA-TGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACAGTGAG----CCAAGC-------------------------T---ACTGTTTGAT-------------------------------------------GAACTTCTTT-----GGATTTT-CAGTAT----TGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_heteromera_4.1"/>
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACAGTGAG----CCAAGCACAATCATGTTCCTT----CATTGCTATTACTGTTTGAT-------------------------------------------GAACTTCTTT-----GGATTTT-CAGTAC----TGTTCGTT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_heteromera_2.9"/>
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATATGACGCGGAAACGGTGAG----CCAAGCACAATCATTT-------------GCT---ACTGTGTG--------------------------------------------------------------ATTTT-CAGTACGTACTGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_elegantissima"/>
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATTGCCATGAAATACGACGCTGAAACAGTGAG----CCAAGCACAATCATTTCGCTT----CATTGAT---ACTGTTCGAT-------------------------------------------GAACTTCTTT-----AGATTTT-CGGTGC----TGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_echinochloidea"/>
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACAGTGAG----CCAAGCACAGTCATTTCGCTT----CACTGAT---ACTGTTGGAT-------------------------------------------GAACTTCTTT-----GGTTTT--CAGTAC----CGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_dielsii"/>
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCCGAAACCGTGAG----CTTAGCACAAACATTTACT-----AGCTAGCT---ACTAGTA-------------------------------------------------GTGCTTT-CTTT--------CAGTAC----TGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------T------------------------------------------------------------------------------ [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_curvula"/>
+			GGGATCGTCAACGGC-ATGGACGTCGGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCCGAAACAGTGAG----CCAAGCACAATCACTTTACTT----CATTGAG---ACTGTTCGAT-------------------------------------------GAACTTAATT-CTTTGGATTTT-CGGTAC----TGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_ciliaris"/>
+			GGGATCGTCA-CGGC-ATGGACGTCAGTGAGTGGGACCCCAGCAAGGACAAGTATATCGCCGTGAAATACGACGCGGAAACAGTACGTGAGCCAAGCACAATCATTTTTTTTT--GGATTGAT---ATTGTGTGAT-------------------------------------------GAACTTCTTT-----GGATTTT-CAGTAC----TGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_cilianensis_PI_299912_1.4"/>
+			GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCTGAAACAGTGAG----CCAAGCTCAATCACTTGACTT----TGTTGAT---AATGTCCGAT-------------------------------------------GGACTTCTTT-----GGATTTT-CAGTAC----CGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_cilianensis_PI_299912_1.3"/>
+			GGCATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCCGAAACAGTGAG----CCAAGCACAATCACTTTACTT----CATTGAG---ACTGTTCGAT-------------------------------------------GAACTTAATT-CTTTGGATTTT-CGGTAC----TGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_cilianensis_eth24_6.5"/>
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCTGAAACAGTGAG----CCAAGCTCAATCACTTGACTT----CGTTGAT---AATGTTCGAT-------------------------------------------GGACTTCTTT-----GGATTTT-CAGTAC----CGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_chapelieri"/>
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCTGAAACAGTGAG----CCAAGCTCAATCACTTGACTT----CGTTGAT---AATGTTCGAT-------------------------------------------GGACTTCTTT-----GGATTTT-CAGTAC----CGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_botryodes_ETH_9_2.1"/>
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACAGTACGTGAGCCGAGCACAGTCATTTTTT----AGGATCGC-----TCCCGTGTGAC-----------------------------------------GAAGTTCTTT-----GGATTTT-CTGTAC----TGTGTGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CGATTCTG----------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_botryodes_ETH_13_3.5"/>
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACAGTACGTGAGCCAAGCGCAGTCATTTTTT-----GGATTGC-----TACCGTGTGATCGAT-------------------------------------GAACTTCATT-----GGATTTTCCAGTAC----TGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_bicolor21"/>
+			GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACTCGGAAACAGTGAG----CCAAGCACAATCATTTTACTT-CTTAATTGCT---ACTGTGTGAT-------------------------------------------GAACTTATTT-----GGATTTT-CGGTAC----TGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_bicolor_25"/>
+			CGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACTCGGAAACAGTGAG----CCAAGCACAATCATTTTACTT-CTTAATTGCT---ACTGTGTGAT-------------------------------------------GAACTTATTT-----GGATTTT-CGGTAC----TGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_barrelieri_1.5"/>
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCCGAAACAGTGAG----CCAAGCACAATCACTTTACTT----CATTGAT---ACTGTTCGAT-------------------------------------------GAACTTAATT-CTTTGGATTTG-CGGTAC----TGTTCGCT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_barrelieri_1.4"/>
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCTGAAACAGTGAG----CCAAGCTCAATCACTTGACTT----TGTTGAT---AATGTTCGAT-------------------------------------------GGACTTCTTT-----GGATTTT-CAGTAC----CGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_bahiensis_1.9"/>
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAATGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACAGTACGTGAG-CAAGCACAATCTTTTTTTTT-TTGGATTAC-----TACCGTGTGAC-----------------------------------------GAACTTCTTT-----GGATTTT-CTATAC----CGTGTGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CGAT--------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_bahiensis_1.8"/>
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACAGTACGTGAGCCAAGCAGAGTCACTTTTATT---GGATTGC-----TACCGTGTGAT-----------------------------------------GAGCTTCTTT-----GGATTTT-CAGTAC----TGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_aspera"/>
+			GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCCGAAACAGTGAG----CCAAGCACAATCACTTTACTT----CATTGAT---ACTGTTCGAT-------------------------------------------GAACTTAATT-CTTTGGATTTG-CGGTAC----TGTTCGCT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eragrostis_airoides"/>
+			GGGATCGTCAATGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACAGTGAG----CCAAGCT----------------------------ACTGTTTGAT-------------------------------------------GAACTTCTTT-----GGATTTT-CAGTAC----TGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Enneapogon_scoparius"/>
+			GGGATCGTCA-CGGC-ATGGACATCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTCAAATACGACGCCGAAACCGTGAG----CCAAGCACA------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------GTCATTTCACCGTCTTTCATTGCCACTGTACTGCTC----------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eleusine_corocana"/>
+			GGAATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCTAGCAAGGACAAGTACATCGCCGTCAAATACGACGAGGAAACCGTGAG------------------------------------------------------------------------------------------------------------------------------------------------TTCTTCATCTGTTGTTGCCACCGTGTGAACTTGTTTGATTATTCAGTAGTACTACTATAGGGATTCGG--TTCTGATTATGCAACCATGCAA---------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Diandrochloa_japonica"/>
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGATCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCAGAAACAGTGAG----CCAAGCACAATCATGTTCCTT----CATTGAC---ACTGTTCG??T------------------------------------------GAACTTCTTT-----GGATTTT-CAGTAC----TGTTCGGT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Dactyloctenium_radulans"/>
+			GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAGACCGTGAG-------------------------------------------------------------------------------------------------------------------------------------CCATCTTCTTCTTTCACATTAATTGTTGCCACTGTCTCTGTGAACTTGTTTTGGTTTTTCGTTAAGTACTAATAATCGGGGTTCTGATCAAGCAAGCGTGGGA---------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Dactyloctenium_aegypticum"/>
+			GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACCGTGAG-------------------------------------------------------------------------------------------------------------------------------------CTCAT---------------------TCGTTCCCACTTTGTGAACTTGTTTGAGTTTTCAGTACTCTGTTCGATTCTGA------CAAGGCATTCGGTGCAAA---------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Coelachyrum_piercei"/>
+			GGGATCGTCAACGGC-CTGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCACCAAGTACGACGTGTCAACGGTGAG-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CTTTCAGTTTCACCAAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Calamovilfa_longifolia"/>
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACACCGCTATGAAATACGACGTGGAAACTGTGAG-------------------------------------------------------------------------------------------------------------------------------------TCTTTTTTT-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Calamovilfa_gigantea"/>
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGTCGAAACTGTGAG-------------------------------------------------------------------------------------------------------------------------------------TATATATA--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Acamptoclados_sessilispica_1.8"/>
+			GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTCAAATACGACGCGGAGACAGTACGTGAGCCAAACACAGTCATTTTTT--------GGATGGCTACCGTGTGAT-------------------------------------------GAACTTCTTT-----GGATTTC-CAATAC----TGTT------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CGAT----------------------------------------------------------------------- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Acamptoclados_sessilispica_1.3"/>
+			GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACAGTACGTGAGCCAAGCACAGCCATTTTTTTC------GGATTGCTACCGTGTGAT-------------------------------------------GAACTTCTTT-----GGATTTT-CAGTAC----TGTT------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CAAT----------------------------------------------------------------------- [...]
+		</sequence>
+	</alignment>
+
+	<!-- The unique patterns for all positions                                   -->
+	<!-- npatterns=69                                                            -->
+	<patterns id="patterns" from="1">
+		<alignment idref="alignment"/>
+	</patterns>
+
+	<!-- This is a simple constant population size coalescent model              -->
+	<!-- that is used to generate an initial tree for the chain.                 -->
+	<constantSize id="initialDemo" units="substitutions">
+		<populationSize>
+			<parameter id="initialDemo.popSize" value="0.0001"/>
+		</populationSize>
+	</constantSize>
+
+	<!-- Generate a random starting tree under the coalescent process            -->
+	<coalescentTree id="startingTree">
+		<taxa idref="taxa"/>
+		<constantSize idref="initialDemo"/>
+	</coalescentTree>
+
+	<treeModel id="treeModel">
+		<coalescentTree idref="startingTree"/>
+		<rootHeight>
+			<parameter id="treeModel.rootHeight"/>
+		</rootHeight>
+		<nodeHeights internalNodes="true">
+			<parameter id="treeModel.internalNodeHeights"/>
+		</nodeHeights>
+		<nodeHeights internalNodes="true" rootNode="true">
+			<parameter id="treeModel.allInternalNodeHeights"/>
+		</nodeHeights>
+	</treeModel>
+
+	<!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+	<hkyModel id="hky">
+		<frequencies>
+			<frequencyModel dataType="nucleotide">
+				<alignment idref="alignment"/>
+				<frequencies>
+					<parameter id="hky.frequencies" dimension="4"/>
+				</frequencies>
+			</frequencyModel>
+		</frequencies>
+		<kappa>
+			<parameter id="hky.kappa" value="1.0" lower="0.0"/>
+		</kappa>
+	</hkyModel>
+
+	<!-- site model                                                              -->
+	<siteModel id="siteModel">
+		<substitutionModel>
+			<hkyModel idref="hky"/>
+		</substitutionModel>
+        <gammaShape gammaCategories="4">
+              <parameter id="siteModel.shape" value="0.5" lower="0.0" upper="1000.0"/>
+        </gammaShape>
+        <proportionInvariant>
+                <parameter id="siteModel.pInv" value="0.5" lower="0.0" upper="1.0"/>
+        </proportionInvariant>
+		<mutationRate>
+			<parameter id="siteModel.mu" value="1.0" lower="0.0"/>
+		</mutationRate>
+	</siteModel>
+
+	<treeLikelihood id="treeLikelihood">
+		<patterns idref="patterns"/>
+		<treeModel idref="treeModel"/>
+		<siteModel idref="siteModel"/>
+	</treeLikelihood>
+
+	<operators id="operators">
+        <!-- proportions invariant -->
+        <scaleOperator scaleFactor="0.75" weight="1">
+                <parameter idref="siteModel.pInv"/>
+        </scaleOperator>
+        <!-- gamma shape parameter -->
+        <scaleOperator scaleFactor="0.75" weight="1">
+                <parameter idref="siteModel.pInv"/>
+        </scaleOperator>
+        <!-- standard operators -->
+		<scaleOperator scaleFactor="0.5" weight="1">
+			<parameter idref="hky.kappa"/>
+		</scaleOperator>
+		<scaleOperator scaleFactor="0.5" weight="1">
+			<parameter idref="treeModel.rootHeight"/>
+		</scaleOperator>
+		<uniformOperator weight="10">
+			<parameter idref="treeModel.internalNodeHeights"/>
+		</uniformOperator>
+		<subtreeSlide weight="5" gaussian="true" size="1.0">
+			<treeModel idref="treeModel"/>
+		</subtreeSlide>
+		<narrowExchange weight="1">
+			<treeModel idref="treeModel"/>
+		</narrowExchange>
+		<wideExchange weight="1">
+			<treeModel idref="treeModel"/>
+		</wideExchange>
+		<wilsonBalding weight="1">
+			<treeModel idref="treeModel"/>
+		</wilsonBalding>
+	</operators>
+
+	<mcmc id="mcmc" chainLength="1000000" autoOptimize="true" preBurnin="0">
+		<compoundLikelihood id="likelihood">
+			<treeLikelihood idref="treeLikelihood"/>
+		</compoundLikelihood>
+		<operators idref="operators"/>
+		<log logEvery="10000">
+			<column label="Likelihood" dp="4" width="12">
+				<compoundLikelihood idref="likelihood"/>
+			</column>
+			<column label="Root Height" sf="6" width="12">
+				<parameter idref="treeModel.rootHeight"/>
+			</column>
+			<column label="Kappa" sf="6" width="12">
+				<parameter idref="hky.kappa"/>
+			</column>
+		</log>
+		<log logEvery="10000" fileName="testMCMC.log">
+			<compoundLikelihood idref="likelihood"/>
+			<parameter idref="treeModel.rootHeight"/>
+			<parameter idref="hky.kappa"/>
+		</log>
+		<logTree  logEvery="10000" nexusFormat="true" fileName="testMCMC.trees">
+			<treeModel idref="treeModel"/>
+		</logTree>
+	</mcmc>
+</beast>
diff --git a/examples/benchmark/1/testHKY1809.xml b/examples/benchmark/1/testHKY1809.xml
new file mode 100644
index 0000000..b4d5204
--- /dev/null
+++ b/examples/benchmark/1/testHKY1809.xml
@@ -0,0 +1,442 @@
+<?xml version="1.0" standalone="yes"?>
+<!-- Generated by BEAUTi v1.5beta4                                           -->
+<!--       by Alexei J. Drummond and Andrew Rambaut                          -->
+<!--       Department of Computer Science, University of Auckland and        -->
+<!--       Institute of Evolutionary Biology, University of Edinburgh        -->
+<!--       http://beast.bio.ed.ac.uk/                                        -->
+<beast>
+	
+	<!-- The list of taxa analyse (can also include dates/ages).                 -->
+	<!-- ntax=59                                                                 -->
+	<taxa id="taxa">
+		<taxon id="Varecia_variegata_variegata"/>
+		<taxon id="Varecia_variegata_rubra"/>
+		<taxon id="Ursus_americanus"/>
+		<taxon id="Rhinocerus"/>
+		<taxon id="Propithecus_tattersalli"/>
+		<taxon id="Pongo_pygmaeus"/>
+		<taxon id="Physeter_macrocephalus"/>
+		<taxon id="Pan_troglodytes"/>
+		<taxon id="Mirza_coquereli"/>
+		<taxon id="Microcebus_tavaratra_69"/>
+		<taxon id="Microcebus_tavaratra_110"/>
+		<taxon id="Microcebus_sambiranensis_80"/>
+		<taxon id="Microcebus_sambiranensis_72"/>
+		<taxon id="Microcebus_ravelobensis_68"/>
+		<taxon id="Microcebus_ravelobensis_66"/>
+		<taxon id="Microcebus_myoxinus_76"/>
+		<taxon id="Microcebus_myoxinus_185"/>
+		<taxon id="Microcebus_murinus_74"/>
+		<taxon id="Microcebus_murinus_199"/>
+		<taxon id="Microcebus_murinus_153"/>
+		<taxon id="Microcebus_murinus_141"/>
+		<taxon id="Microcebus_murinus_122"/>
+		<taxon id="Microcebus_griseorufus_355"/>
+		<taxon id="Microcebus_griseorufus_351"/>
+		<taxon id="Microcebus_griseorufus_116"/>
+		<taxon id="Microcebus_griseorufus_101"/>
+		<taxon id="Microcebus_berthae_159"/>
+		<taxon id="Microcebus_berthae_148"/>
+		<taxon id="Microcebus__rufus_2.191"/>
+		<taxon id="Microcebus__rufus_2.190"/>
+		<taxon id="Microcebus__rufus_1.174"/>
+		<taxon id="Microcebus__rufus_1.171"/>
+		<taxon id="Microcebus__rufus_1.162"/>
+		<taxon id="Microcebus__rufus_1.138"/>
+		<taxon id="Macaca_mulatta"/>
+		<taxon id="Loris_tardigradus"/>
+		<taxon id="Lepilemur_ruficaudatus"/>
+		<taxon id="Lemur_catta"/>
+		<taxon id="Homo_sapiens"/>
+		<taxon id="Hippopotamus_amphibius"/>
+		<taxon id="Hapalemur_griseus"/>
+		<taxon id="Gorilla_gorilla"/>
+		<taxon id="Galago_demidoff"/>
+		<taxon id="Felis_catus"/>
+		<taxon id="Eulemur_rubriventer"/>
+		<taxon id="Eulemur_mongoz"/>
+		<taxon id="Eulemur_macaco_macaco"/>
+		<taxon id="Eulemur_macaco_flavifrons"/>
+		<taxon id="Eulemur_fulvus_rufus"/>
+		<taxon id="Eulemur_fulvus_collaris"/>
+		<taxon id="Eulemur_fulvus_albifrons"/>
+		<taxon id="Equus_caballus"/>
+		<taxon id="Didelphis_virginiana"/>
+		<taxon id="Daubentonia"/>
+		<taxon id="Cheirogaleus_major"/>
+		<taxon id="Canis_familiaris"/>
+		<taxon id="Callithrix_jacchus"/>
+		<taxon id="Bos_taurus"/>
+		<taxon id="Balaenoptera_physalus"/>
+	</taxa>
+	
+	<!-- The sequence alignment (each sequence refers to a taxon above).         -->
+	<!-- ntax=59 nchar=1824                                                      -->
+	<alignment id="alignment" dataType="nucleotide">
+		<sequence>
+			<taxon idref="Varecia_variegata_variegata"/>
+			ATGGCTCATCCAGTCCAACTAGGATTTCAAGACGCCGCTTCTCCTATTATAGAAGAACTCCTATATTTTCATGACCACACCCTAATAATTATATTTCTAATTAGCTCTTTAGTCCTATATATTATTTCCCTAATACTCACTACTAAACTCACACATACAAGCACTATAGATGCTCAAGAAGTAGAGACAGTATGAACAATTCTACCCGCAGCAATTCTCATTCTTATTGCCCTCCCCTCACTACGTATCCTATACATAATGGACGAAATTACTTCTCCTTCCCTTACCCTTAAAACCATAGGTCACCAATGATATTGAAGTTATGAATATACGGATTACGAAAATTTATGCTTTGACTCATATATAACCCCCTGCTCAGACCTAAAACCCGGAGAACTTCGCTTACTTGAAGTAGATAATCGAGTCGTTCTACCCACAGAACTATCAATCCGAACGCTAATCTCTTCAGAAGATGTATTACACTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Varecia_variegata_rubra"/>
+			ATGGCTCATCCAGTCCAACTAGGATTTCAAGACGCCGCTTCTCCTATTATAGAAGAACTCCTATATTTTCACGACCACACCCTAATAATTATATTCCTAATTAGCTCTTTAGTCCTATATATTATTTCCCTAATACTCACTACTAAACTCACACATACAAGCACTATAGATGCTCAAGAAGTAGAAACAGTATGAACAATTTTACCCGCAGCAATTCTTATTCTTATTGCCCTCCCCTCACTACGTATCCTATACATGATGGACGAAATTACTTCTCCTTCCCTTACCCTTAAAACCATAGGTCACCAATGATATTGAAGTTATGAGTATACGGATTACGAAAATTTATGCTTTGACTCATATATAACCCCCTGCTCAGACCTAAAACCCGGAGAACTTCGCTTACTTGAAGTAGATAATCGAGTCGTTCTACCCACAGAACTGTCAATCCGAACGCTAATCTCTTCAGAAGATGTATTACACTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Ursus_americanus"/>
+			ATGGCACACCCCTTTCAAATAGGTCTTCAAGATGCAACTTCTCCTATCATAGAAGAACTCCTACATTTTCATGACCATACATTAATAATTGTATTCCTAATTAGCTCCTTAGTTCTCTATATTATTTCAACTATATTAACTACCAAATTAACACACACAAACACAATGGATGCACAAGAAGTAGAGACGGTGTGAACCATCCTGCCAGCTATAATCCTAATTCTAATCGCACTCCCATCGCTACGGATTCTCTATATAATGGATGAAATCAATAACCCCTCACTGACCGTAAAAACCATGGGCCATCAATGATATTGAAGTTACGAGTACACAGATTATGAAGATCTAAATTTTGACTCCTACATGACTCCAACACAAGAACTAAAGCCTGGAGAACTGCGGTTATTAGAAGTGGACAATCGAGTAGTACTGCCCATAGAAATAACGATCCGTATGCTAATCTCATCAGAAGATGTCTTGCACTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Rhinocerus"/>
+			ATGGCTTATCCACTTCAACTAGGATTTCAAGATGCAACATCCCCTATTATAGAAGAATTACTCCATTTCCATGACCATACACTGATAATCGTATTTTTAATTAGCTCCCTAGTGCTGTATATTATTTCACTCATGCTAACAACCAAACTAACACACACAAGCACTATAGACGCTCAAGAAGTAGAGACCATCTGAACGATTTTACCAGCTATTATCCTAATTTTAATTGCTCTCCCATCGCTACGAATCCTCTATATAATAGATGAGATTAATAATCCTTCCTTAACCATCAAAACCATAGGCCATCAGTGATACTGAAGCTACGAATATACAGATTATGAAGACCTAACCTTTGACTCCTACATAATTCCCACATCAGATCTAAAACCAGGAGAACTGCGACTTCTAGAAGTCGACAACCGAGTAGTATTACCCATAGAAATAACGATTCGAATGCTAATCTCATCCGAAGACGTTCTCCACTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Propithecus_tattersalli"/>
+			ATGGCTTATCCAGTTCAATTGGGATTTCAGGATGCTGCTTCCCCCATCATGGAAGAGCTCTTATACTTTCATGATCATACTTTAATAATTGTATTCCTAATTAGTTCTCTAGTTCTCTATATCATCTCTCTAATACTCACCACCAAACTCATACACACCAGCACCATGGACGCACAAGAAGTAGAAACAGTATGAACTATCCTACCTGCAATCATTCTAATTCTTATTGCCCTCCCATCCCTACGTATCCTATACATAATGGATGAAATCACTACTCCTTCATTAACCCTTAAAACCATAGGTCATCAATGGTACTGAAGCTATGAATACACAGATTACGAAGATCTGTCTTTCGACTCATACATAGTTCCATCATCGGACCTCAAGCCCGGAGAACTTCGTCTGCTCGAAGTAGACAACCGAATTGTACTACCCACAGAACTATCAATTCGAATACTTATCTCTTCAGAAGACGTATTACACTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Pongo_pygmaeus"/>
+			ATGGCGCACGCAGCACAGGTAGGTCTACAAGACGCTACCTCTCCTATCATAGAAGAATTGGTCATCTTTCACGACCACGCCCTCATAATCATCTTCCTAATCTGCTTCCTAGTCCTGTACGCCCTTTTCCTAACACTCACAACGAAACTCACCAACACTAACATCTCAGATGCCCAAGAGATAGAAACTATTTGAACTATCCTACCAGCCATCATCCTAATTCTAATCGCCCTCCCATCTCTACGCATCCTCTACTTAACAGACGAAATCAACGACCCTTCCTTCACCATTAAATCAATCGGCCATCAATGGTACTGAACCTACGAGTATACTGACTATGGCGGATTGATCTTCAACTCTTACATGCTCCCACCACTATTCCTAGAACCAGGCGACCTTCGACTCCTAGACGTCGACAATCGAGTAGTCCTCCCAGTCGAAGCCCCCGTTCGCATAATAATCACATCCCAAGACGTCTTGCACTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Physeter_macrocephalus"/>
+			ATGGCATACCCCCTTCAACTAGGTTTCCAAGACGCAACCTCTCCCATTATAGAGGAACTCTTACACTTTCATGATCACACCCTAATAATTGTTTTCCTAATTAGCTCTCTAGTCCTCTACATTATCACCCTAATACTAACAACCAAACTAACACATATCAACACAATAGACGCCCAAGAAGTAGAGACCATTTGAACCGTTCTCCCCGCTATCATTCTAATCCTAATCGCCCTACCATCCCTACGAATCCTCTACATAATAGACGAAATCAACAGCCCCTCTCTTACTGTAAAGACAATAGGTCACCAATGATATTGAAGCTACGAATATACCGACTACGAAGACCTGTCCTTTGACTCTTACATAATCCCAACATCGGACTTAAAACCAGGAGACCTACGACTATTAGAAGTCGACAACCGAATAGTATTGCCTATAGAAATAACAATCCGAGTCTTAGTCTCCTCCGAGGATGTCCTACACTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Pan_troglodytes"/>
+			ATGGCACATGCAGCGCAAGTAGGTCTACAAGATGCTACTTCCCCTATCATAGAAGAACTTATTATCTTTCACGACCATGCCCTCATAATTATCTTTCTCATCTGCTTTCTAGTCCTATACGCCCTTTTCCTAACACTCACAACAAAACTAACTAATACTAGTATTTCAGACGCCCAGGAAATAGAAACCGTCTGAACTATCCTGCCCGCCATCATCCTAGTCCTTATTGCCCTACCATCCCTGCGTATCCTTTACATAACAGACGAGGTCAACGACCCCTCCTTTACTATTAAATCAATCGGCCATCAATGATATTGAACCTACGAATACACCGACTACGGCGGGCTAATCTTCAACTCCTACATACTCCCCCCATTATTTCTAGAACCAGGTGATCTACGACTCCTTGACGTTGATAACCGAGTGGTCCTCCCAGTTGAAGCCCCCGTTCGTATAATAATTACATCACAAGATGTTCTACACTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Mirza_coquereli"/>
+			ATGGCTTACCCAGCTCAGCTAGGACTCCAAGATGCCGCTTCCCCAATCATGGAAGAGCTTGCATATTTTCACGACCATACCCTAATAATTGTATTTTTAATTAGCTCCATGGTCCTATATATAATCTCTCTAATACTTACTACTGAACTTACCCACACAAGCACTATAGATGCTCAAGAAGTCGAAACAGTATGAACAATCCTACCCGCAGTTATCCTAATTTTTATTGCCCTTCCATCATTACGTATTTTATATATAATAGACGAAATTACAACGCCATCCTTAACTCTAAAAACCATAGGCCATCAATGATATTGAAGTTATGAATACACAGACTACGAAAGCCTATGCTTTGACTCTTATATGACCCCTCCACTAGAACTAGATCCAGGAGAACTTCGCCTACTAGAAGTTGATAATCGAGTAGTACTGCCTACAGAAATATCCATTCGTATACTTGTCTCTTCAGAAGATGTATTACACTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Microcebus_tavaratra_69"/>
+			ATGGCCCACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGATCACACCCTTATAATTGTATTTTTAATTAGTTCATTAGTCCTATATATCATTTCCCTTATGCTTACCACGGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTTATTGCTCTTCCATCGTTACGCATTTTATATATAATAGATGAAATTACAACCCCTTCTCTAACTCTTAAGACTATAGGTCATCAGTGATATTGAAGCTATGAATATACAGACTATGAAAGCCTATGCTTTGACTCATATATAACCCCTCCATTAGAATTAGATCCAGGAGAACTACGATTACTAGAAGTAGATAATCGAGTAGTATTACCAACAGAAATATCTATTCGTATACTCATCTCCTCAGAAGACGTACTACACTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Microcebus_tavaratra_110"/>
+			ATGGCCCACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGATCACACCCTTATAATTGTATTTTTAATTAGTTCATTAGTCCTATATATCATTTCCCTTATGCTTACCACGGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTTATTGCTCTTCCATCGTTACGCATTTTATATATAATAGATGAAATTACAACCCCTTCTCTAACTCTTAAGACTATAGGTCATCAGTGATATTGAAGCTATGAATACACAGACTATGAAAGCCTATGCTTTGACTCATACATAACCCCTCCATTAGAATTAGATCCAGGAGAACTACGATTACTAGAAGTAGATAATCGAGTAGTATTACCAACAGAAATATCTATTCGCATACTCATCTCCTCAGAAGACGTACTACACTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Microcebus_sambiranensis_80"/>
+			ATGGCCTATCCAGCCCAATTAGGTTTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGATCATACCCTTATGATTGTATTTTTAATTAGCTCATTAGTCCTATACATTATTTCCCTTATGCTTACCACGGAACTTACTCATACAAGCACCATAGACGCTCAAGAAGTAGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTTATTGCCCTTCCATCACTACGCATTTTATATATAATGGATGAAATTACAACTCCCTCCCTAACTCTTAAGACTATAGGTCATCAATGATATTGAAGCTATGAATATACCGACTATGAAAGCCTATGCTTTGACTCCTACATAACCCCTCCATTAGAACTCGATCCAGGAGAACTACGATTACTAGAAGTAGATAATCGAGTAGTACTGCCAACAGAAATATCCATTCGTATACTCATCTCTTCAGAAGACGTATTACATTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Microcebus_sambiranensis_72"/>
+			ATGGCCTATCCAGCCCAATTAGGTTTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGATCATACCCTTATGATTGTATTTTTAATTAGCTCATTAGTCCTATACATTATTTCCCTTATGCTTACCACGGAACTTACTCATACAAGCACCATAGACGCTCAAGAAGTAGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTTATTGCCCTTCCATCACTACGCATTTTATATATAATGGATGAAATTACAACTCCCTCCCTAACTCTTAAGACTATAGGTCATCAATGATATTGAAGCTATGAATATACCGACTATGAAAGCCTATGCTTTGACTCCTACATAACCCCTCCATTAGAACTCGATCCAGGAGAACTACGATTACTAGAAGTAGATAATCGAGTAGTACTGCCAACAGAAATATCCATTCGTATACTCATCTCTTCAGAAGACGTATTACATTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Microcebus_ravelobensis_68"/>
+			ATGGCCTACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTGTATATTTCCACGACCATACCCTTATAATTGTGTTTTTAATTAGCTCATTGGTCCTATATATTATTTCCCTTATACTTACCACAGAGCTCACTCATACAAGCACTATAGATGCTCAAGAAGTGGAAACTGTATGAACAATTTTGCCGGCAGTTATCTTAATTCTTATTGCCCTTCCATCATTACGCATTTTATATATAATAGATGAAATTACAACCCCGTCCCTTACTCTTAAGACTATAGGTCATCAATGATATTGAAGCTATGAATATACAGACTATGAAAACTTATGCTTTGACTCATACATGACTCCTCCATTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTCGACAATCGAGTAGTATTACCAACAGAAATATCTATCCGCATACTCATCTCTTCAGAAGACGTATTACATTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Microcebus_ravelobensis_66"/>
+			ATGGCCTGCCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTGTATATTTCCACGACCATACCCTTATAATTGTGTTTTTAATTAGCTCATTGGTCCTATATATTATTTCCCTTATACTCACCACAGAGCTCACTCATACAAGCACTATAGATGCTCAAGAAGTGGAAACTGTATGAACAATTTTGCCAGCAGTTATCTTAATTCTTATTGCCCTTCCATCATTACGCATTTTATATATAATAGATGAAATTACAACCCCGTCCCTTACTCTTAAGACTATAGGTCATCAATGATATTGAAGCTATGAATATACAGACTATGAAAACTTATGCTTTGACTCATACATGACTCCTCCATTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTCGACAATCGAGTAGTATTACCAACAGAAATATCTATCCGCATACTCATCTCTTCAGAAGACGTATTACATTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Microcebus_myoxinus_76"/>
+			ATGGCCTACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTACATATTTTCATGATCATACCCTTATGATCGTATTCTTAATTAGCTCATTAGTTCTATATATCATTTCCCTCATGCTTACCACGGAACTCACCCATACAAGCACCATAGACGCTCAAGAAGTAGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCTCTTCCATCATTACGCATTTTATATATAATGGATGAAATTACAACTCCCTCCCTGACTCTTAAGACTATAGGTCATCAATGATATTGAAGCTATGAATACACAGACTATGAAAGCTTATGCTTTGACTCATATATAACCCCTCCATTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTGGATAATCGAGTAGTACTACCAACAGAAATATCTATTCGTATACTCATCTCTTCAGAAGACGTACTACACTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Microcebus_myoxinus_185"/>
+			ATGGCCTACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCATGATCATACCCTTATGATCGTATTCTTAATTAGCTCATTAGTTCTATATATCATTTCCCTCATGCTTACCACGGAACTCACCCATACAAGCACCATAGACGCTCAAGAAGTAGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCTCTTCCATCATTACGCATTTTATATATAATGGATGAAATTACAACTCCCTCCCTGACTCTTAAGACTATAGGTCATCAGTGATATTGAAGCTATGAATATACAGACTATGAAAGCTTATGCTTTGACTCATATATAACCCCTCCATTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTGGATAATCGAGTAGTACTACCAACAGAAATATCTATTCGTATACTCATCTCTTCAGAAGACGTACTACACTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Microcebus_murinus_74"/>
+			ATGGCCCACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATAATTGTATTTTTAATTAGCTCATTAGTTCTTTATATTATTTCCCTTATACTTACCACGGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTAGAAACAGTATGAACAATTCTACCAGCGGTTATTTTAATTCTTATTGCCCTTCCATCACTACGTATTTTATATATAATAGATGAAATTACAACTCCCACTCTGACCCTTAAGACAATAGGTCATCAATGATATTGAAGTTACGAATATACAGATTATGAAAACCTATGCTTTGACTCATACATAACCCCTCCTTTAGAACTCGATCCAGGAGAACTACGATTACTAGAAGTTGACAATCGAGTAGTATTACCAACAGAAATATCCATTCGCATACTCATCTCTTCAGAAGACGTACTACATTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Microcebus_murinus_199"/>
+			ATGGCCCACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATAATTGTATTTTTAATTAGCTCATTAGTCCTTTATATTATTTCCCTTATGCTTACCACGGAACTCACTCATACAAGCACCATAGACGCCCAAGAAGTAGAAACAGTATGAACAATTCTACCAGCGGTTATTTTAATTCTTATTGCCCTTCCATCACTACGTATTTTATATATAATAGATGAAATTACAACTCCCACTCTGACCCTTAAAACTATAGGTCATCAATGATATTGAAGCTACGAATATACAGATTATGAAAACCTATGCTTTGACTCATACATAACCCCTCCTTTAGAACTCTATCCAGGAGAACTACGACTACTAGAAGTTGACAATCGAGTAGTACTACCAACAGAAATATCCATTCGCATACTCATCTCTTCAGAAGACGTATTACATTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Microcebus_murinus_153"/>
+			ATGGCCCACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATAATTGTATTTTTAATTAGCTCATTAGTTCTTTATATTATTTCCCTTATACTTACCACGGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTAGAAACAGTATGAACAATTCTACCAGCGGTTATTTTAATTCTTATTGCCCTTCCATCACTACGTATTTTATATATAATAGATGAAATTACAACTCCCACTCTGACCCTTAAGACAATAGGTCATCAATGATATTGAAGTTACGAATATACAGACTATGAAAACCTATGCTTTGACTCATACATAACCCCTCCTTTAGAACTCGATCCAGGAGAACTACGATTACTAGAAGTTGACAATCGAGTAGTATTACCAACAGAAATATCCATTCGCATACTCATCTCTTCAGAAGACGTACTACATTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Microcebus_murinus_141"/>
+			ATGGCCCACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATAATTGTATTTTTAATTAGCTCATTAGTCCTTTATATTATTTCCCTTATACTTACCACGGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTAGAAACAGTATGAACAATTCTACCAGCGGTTATTTTAATTCTTATTGCCCTTCCATCACTACGTATTTTATATATAATAGATGAAATTACAACTCCCACTCTGACCCTTAAGACAATAGGTCATCAATGATATTGAAGCTACGAATATACAGATTATGAAAACCTATGCTTTGACTCATATATAACCCCTCCTTTAGAACTCGATCCAGGAGAACTACGATTACTAGAAGTTGACAATCGAGTAGTATTACCAACAGAAATATCCATTCGCATACTCATCTCTTCAGAAGACGTACTACATTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Microcebus_murinus_122"/>
+			ATGGCCCACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATAATTGTATTTTTAATTAGCTCATTAGTCCTTTATATTATTTCCCTTATGCTTACCACGGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTAGAAACAGTATGAACAATTCTACCAGCGGTTATTTTAATTCTTATTGCCCTTCCATCACTACGTATTTTATATATAATAGATGAAATTACAACTCCCACTCTGACCCTTAAAACTATAGGTCATCAATGATATTGAAGCTACGAATATACAGATTATGAAAACCTATGCTTTGACTCATATATAACCCCTCCTTTAGAACTCGATCCAGGAGAACTACGACTACTAGAAGTTGACAATCGAGTAGTATTACCAACAGAAATATCCATTCGCATACTCATCTCTTCAGAAGACGTACTACATTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Microcebus_griseorufus_355"/>
+			ATGGCCTACCCAGCCCAATTAGGTTTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATGATTGTATTTTTAATCAGCTCATTGGTCCTTTATATTATTTCCCTTATACTTACCACAGAACTTACTCATACAAGCACTATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCCCTTCCATCATTACGCATTCTATACATAATGGATGAAATCACAACCCCCACCCTTACCCTTAAAACCATAGGTCATCAGTGATATTGAAGTTATGAATATACAGATTATGAAAGCCTATGCTTTGACTCATATATGACCCCTCCTTTAGAACTTGACCCCGGAGAATTACGATTACTAGAAGTCGATAATCGAGTAGTATTACCAACAGAAATATCTATTCGCATGCTAATCTCTTCAGAAGACGTGTTACACTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Microcebus_griseorufus_351"/>
+			ATGGCCTACCCAGCCCAATTAGGTTTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATGATTGTATTTTTAATCAGCTCATTGGTCCTTTATATTATTTCCCTTATACTTACCACAGAACTTACTCATACAAGCACTATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCCCTTCCATCATTACGCATTCTATACATAATGGATGAAATCACAACCCCCACCCTTACCCTTAAAACCATAGGTCATCAGTGATATTGAAGTTATGAATATACAGATTATGAAAGCCTATGCTTTGACTCATATATGACCCCTCCTTTAGAACTTGACCCCGGAGAATTACGATTACTAGAAGTCGATAATCGAGTAGTATTACCAACAGAAATATCTATTCGCATGCTAATCTCTTCAGAAGACGTGTTACACTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Microcebus_griseorufus_116"/>
+			ATGGCCTACCCAGCCCAATTAGGTTTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATGATTGTATTTTTAATCAGCTCATTGGTCCTTTATATTATTTCCCTTATACTTACCACAGAACTTACTCATACAAGCACTATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCCCTTCCATCATTACGCATTCTATACATAATGGATGAAATCACAACCCCCACCCTTACCCTTAAAACCATAGGTCATCAGTGATATTGAAGTTATGAATATACAGATTATGAAAGCCTATGCTTTGACTCATATATGACCCCTCCTTTAGAACTTGACCCCGGAGAATTACGATTACTAGAAGTCGATAATCGAGTAGTATTACCAACAGAAATATCTATTCGCATGCTAATCTCTTCAGAAGACGTGTTACACTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Microcebus_griseorufus_101"/>
+			ATGGCCTACCCAGCCCAATTAGGTTTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATGATTGTATTTTTAATCAGCTCATTGGTCCTTTATATTATTTCCCTTATACTTACCACAGAACTTACTCATACAAGCACTATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCCCTTCCATCATTACGCATTCTATACATAATGGATGAAATCACAACCCCCACCCTTACCCTTAAAACCATAGGTCATCAGTGATATTGAAGTTATGAATATACAGATTATGAAAGCCTATGCTTTGACTCATATATGACCCCTCCTTTAGAACTTGACCCCGGAGAATTACGATTACTAGAAGTCGATAATCGAGTAGTATTACCAACAGAAATATCTATTCGCATGCTAATCTCTTCAGAAGACGTGTTACACTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Microcebus_berthae_159"/>
+			ATGGCCTACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCATGATCATACCCTTATGATCGTATTTTTAATTAGCTCATTAGTTCTTTATATCATTTCCCTCATGCTTACCACAGAACTCACCCATACAAGCACCATAGACGCTCAAGAAGTGGAA?CAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCTCTTCCATCATTACGCATTTTATATATAATGGATGAAATTACAACTCCCTCCCTAACTCTTAAGACCATAGGTCATCAGTGATATTGAAGCTATGAATATACAGACTATGAAAGCTTATGCTTTGACTCATATATAACTCCTCCACTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTGGATAATCGAGTAGTACTACCAACAGAAATATCTATTCGCATGCTCATCTCTTCAGAAGACGTATTACATTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Microcebus_berthae_148"/>
+			ATGGCCTACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCATGATCATACCCTTATGATCGTATTTTTAATTAGCTCATTAGTTCTTTATATCATTTCCCTCATGCTTACCACAGAACTCACCCATACAAGCACCATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCTCTTCCATCATTACGCATTTTATATATAATGGATGAAATTACAACTCCCTCCCTAACTCTTAAGACCATAGGTCATCAGTGATATTGAAGCTATGAATATACAGACTATGAAAGCTTATGCTTTGACTCATATATAACTCCTCCACTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTGGATAATCGAGTAGTACTACCAACAGAAATATCTATTCGCATGCTCATCTCTTCAGAAGACGTATTACATTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Microcebus__rufus_2.191"/>
+			ATGGCCCACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATAATTGTATTCTTAATCAGCTCATTAGTTCTATATATCATTTCCCTTATACTTACTACGGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTGGAAACAGTATGAACAATCTTACCAGCAGTTATTTTAATCCTTATTGCCCTTCCATCATTACGCATTTTATACATAATGGATGAAATTACAACTCCCTCCCTAACTCTTAAGACTATAGGTCATCAATGATATTGAAGCTATGAATATACAGACTATGAAAGCCTATGCTTTGACTCATACATAACCCCTCCATTAGAGCTCGATCCAGGAGAACTACGATTACTAGAAGTGGATAACCGAGTAGTACTACCAACAGAAATATCTATTCGTATACTCATCTCTTCAGAAGACGTACTACATTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Microcebus__rufus_2.190"/>
+			ATGGCCCACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATAATTGTATTCTTAATCAGCTCATTAGTTCTATATATCATTTCCCTTATACTTACTACGGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTGGAAACAGTATGAACAATCTTACCAGCAGTTATTTTAATCCTTATTGCCCTTCCATCATTACGCATTTTATACATAATGGATGAAATTACAACTCCCTCCCTAACTCTTAAGACTATAGGTCATCAATGATATTGAAGCTATGAATATACAGACTATGAAAGCCTATGCTTTGACTCATACATAACCCCTCCATTAGAGCTCGATCCAGGAGAACTACGATTACTAGAAGTGGATAACCGAGTAGTACTACCAACAGAAATATCTATTCGTATACTCATCTCTTCAGAAGACGTACTACATTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Microcebus__rufus_1.174"/>
+			ATGGCCTACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCATGATCATACCCTTATGATCGTATTTTTAATTAGCTCATTAGTTCTATATATCATTTCCCTTATGCTTACCACAGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCTCTTCCATCATTACGCATTTTATATATAATGGATGAAATTACAACTCCCTCCCTAACTCTTAAGACTATAGGTCATCAGTGATATTGAAGCTATGAATATACAGATTATGAAAGCCTATGCTTTGACTCATATATAACCCCTCCATTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTGGATAACCGAGTAGTACTACCAACAGAAATATCTATTCGCATACTCATCTCTTCAGAAGACGTATTACATTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Microcebus__rufus_1.171"/>
+			ATGGCCTACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCATGATCATACCCTTATGATCGTATTTTTAATTAGCTCATTAGTTCTATATATCATTTCCCTTATGCTTACCACAGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCTCTTCCATCATTACGCATTTTATATATAATGGATGAAATTACAACTCCCTCCCTAACTCTTAAGACTATAGGTCATCAGTGATATTGAAGCTATGAATATACAGATTATGAAAGCCTATGCTTTGACTCATATATAACCCCTCCATTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTGGATAACCGAGTAGTACTACCAACAGAAATATCTATTCGCATACTCATCTCTTCAGAAGACGTATTACATTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Microcebus__rufus_1.162"/>
+			ATGGCCTACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCATGATCATACCCTTATGATCGTATTTTTAATTAGCTCATTAGTTCTATATATCATTTCCCTTATGCTTACCACAGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCTCTTCCATCATTACGCATTTTATATATAATGGATGAAATTACAACTCCTTCCCTAACTCTTAAGACTATAGGTCATCAGTGATATTGAAGCTATGAATATACAGATTATGAAAGCCTATGCTTTGACTCATATATAACCCCTCCATTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTGGATAACCGAGTAGTACTACCAACAGAAATATCTATTCGCATACTCATCTCTTCAGAAGACGTATTACATTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Microcebus__rufus_1.138"/>
+			ATGGCCTACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCATGATCATACCCTTATGATCGTATTTTTAATTAGCTCATTAGTTCTATATATCATTTCCCTTATGCTTACCACAGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCTCTTCCATCATTACGCATTTTATATATAATGGATGAAATTACAACTCCCTCCCTAACTCTTAAGACTATAGGTCATCAGTGATATTGAAGCTATGAATATACAGATTATGAAAGCCTATGCTTTGACTCATATATAACCCCTCCATTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTGGATAACCGAGTAGTACTACCAACAGAAATATCTATTCGCATACTCATCTCTTCAGAAGACGTATTACATTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Macaca_mulatta"/>
+			ATGGCCCACCCAGTTCAACTAAGCCTGCAAGACGCCACATCTCCTGTTATAGAGGAGTTGATTACTTTCCATGACCATGCTTTTATAGCCATATCTCTTATCAGCTTCCTAGTATTATATGCCCTGCTCTCAACGCTCACAACAAAACTAACCAACACTAGCATCACAGACGCCCAAGAAATAGAAACTATCTGAACTATCTTACCCGCAATTATCTTAATCCTAATTGCTCTCCCATCTCTACGCATCCTATACCTAACAGATGAAGTCAACGACCCATCCTTCACCATTAAATCAATCGGACACCAGTGATACTGAACCTACGAATACACAGATTACGGGGGCCTAATTTTCAACTCCTACATACTACCCCCACTATTCCTAAACCCAGGAGACCTCCGACTCCTAGAAGTTGACAATCGAGTAGTTCTTCCAATTGAAGCTCCTGTACGTATAATAATTACATCTCAAGACGTCTTACACTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Loris_tardigradus"/>
+			ATGGCCCATCCAGTACAATTCGGATTTCAAGACGCCGCCTCACCTATTATAGAAGAACTACTATACTTTCATGACCACACTCTCATAATTGTATTTATAATCAGCTCTCTAGTCCTATATATTATCTCCCTTATACTATCAACCGAACTTACCCATACAAGCACTATGGATGCGCAAGAAGTAGAAACAGTATGAACAATCCTGCCTGCCGTCATCCTAATTTTAATTGCCCTGCCATCCCTACGGATCCTATATATAATAGATGAAATTAATACCCCATCCCTTACCCTAAAAACAATAGGTCATCAATGATATTGAAGCTACGAATACACAGATTATGATAAACTATGCTTTGACTCCTATATAGTCCCAACCCCTGACCTAGAACCGGGGGACCTACGTCTACTTGAAGTAGATAACCGAGTTGTACTACCTACAGAAATATCTATTCGAATACTAATCTCCTCCGAAGATGTTCTCCACTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Lepilemur_ruficaudatus"/>
+			ATGGCCCACCCAGTCCAACTAGGATTTCAAGATGCCGCCTCTCCTATCATAGAAGAACTTCTATATTTCCATGACCACACTCTAATAATTGTTTTCCTCATCAGTTCCTTGGTCCTTTACATTATTTCCCTTATACTCTCTACTAAACTCACCCACACAAGTACAGTGGATGCCCAAGAAGTAGAAACAGTATGAACTATTTTGCCCGCAGTGATCCTAATTCTTATCGCCCTTCCATCTCTACGCATCCTATACATAATAGACGAAATCACTACACCCTCCTTAACCCTTAAAACAATAGGCCATCAATGATACTGAAGCTATGAATACACGGACTATGAAAATCTTTGCTTTGACTCATATATAATTCCTCTGTCAGATCTTAAACCCGGTGATCTTCGCCTACTCGAGGTTGATAACCGAGTTGCCTTACCCACAGAAATATCAATCCGAATGTTAGTATCCTCAGAAGACGTACTTCACTCATGG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Lemur_catta"/>
+			ATGGCCTATCCAGTTCAATTAGGATTTCAAGATGCTGCTTCTCCCATTATAGAAGAACTTTTATACTTTCACGACCACACTTTAATAATTATATTCCTGATTAGTTCTCTAGTCCTTTACATTATCTCCCTTATACTCACTACTGAACTTATACATACAAACACCATAGACGCCCAAGAAGTAGAAACAGTATGAACAATCCTACCTGCAGCAATCCTCATTCTTATTGCTCTTCCATCATTACGCATTCTGTATATAATAGACGAAATTGCTACACCCTCCTTAACCCTTAAAACCATAGGTCACCAATGATACTGAAGCTACGAATACACAGATTATGAAGACTTATGTTTTGACTCGTACATAACTCCTTCCTCAGACCTTAAACCTGGAGAACTTCGCCTACTTGAAGTCGACAATCGAGTCGTACTTCCCACAGAACTAGCAGTTCGAATATTAATCTCTTCAGAAGATGTACTACACTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Homo_sapiens"/>
+			ATGGCACATGCAGCGCAAGTAGGTCTACAAGACGCTACTTCCCCTATCATAGAAGAGCTTATCACCTTTCATGATCACGCCCTCATAATCATTTTCCTTATCTGCTTCCTAGTCCTGTATGCCCTTTTCCTAACACTCACAACAAAACTAACTAATACTAACATCTCAGACGCTCAGGAAATAGAAACCGTCTGAACTATCCTGCCCGCCATCATCCTAGTCCTCATCGCCCTCCCATCCCTACGCATCCTTTACATAACAGACGAGGTCAACGATCCCTCCCTTACCATCAAATCAATTGGCCACCAATGGTACTGAACCTACGAGTACACCGACTACGGCGGACTAATCTTCAACTCCTACATACTTCCCCCATTATTCCTAGAACCAGGCGACCTGCGACTCCTTGACGTTGACAATCGAGTAGTACTCCCGATTGAAGCCCCCATTCGTATAATAATTACATCACAAGACGTCTTGCACTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Hippopotamus_amphibius"/>
+			ATGGCATATCCCCTCCAACTAGGCTTTCAAGATGCAGTATCACCCATTATAGAAGAACTACTGTATTTTCATGACCATACGCTAATAATCGTATTCCTAATCAGCTCACTAGTCCTTTACATTATTACACTAATACTGACTACCAAACTAACCCATACAAACACCATAAATGCACAAGAGGTAGAAACTGTCTGAACAATCCTACCAGCCATTATCCTTATCTTAATTGCACTGCCATCTCTGCGAATCCTCTATATAATAGACGAAATTAACAACCCCTCCCTGACCGTAAAAACTATGGGCCACCAATGATACTGAAGTTACGAATATACAGATTATGAAGACCTAAACTTTGACTCCTACATAGTCCCAACATCAGACCTAAAGCCGGGGGACCTACGACTCCTAGAAGTAGATAACCGAGTCGTCCTACCCATAGATGTAACAGTTCGAATACTAATCTCATCAGAAGACGTACTACACTCCTGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Hapalemur_griseus"/>
+			ATGGCTTATCCAGTCCAACTAGGATTTCAAGATGCTGCTTCCCCTATTATAGAAGAACTTTTATACTTTCATGATCATACTTTAATAATTATATTCCTGATTAGTTCTCTAGTCCTTTACATTATTTCCCTCATACTTACTACTGAATTAATACATACAAATACCATAGACGCCCAAGAAGTAGAAACAGTATGAACAATCCTACCCGCAGCAATTCTCATTCTCATTGCCCTCCCATCATTACGTATCCTATATATAATAGACGAAATTACTACACCCTCATTAACCCTTAAAACTATAGGCCACCAGTGATACTGAAGCTACGAATACACAGACTATGAAAATTTATGCTTTGACTCATACATAGTTCCTTCCTCAGACCTAAAGCCTGGAGAACTTCGCCTACTTGAAGTTGATAATCGAATTGTACTTCCTACAGAATTATCAATTCGAATACTAATCTCTTCAGAAGATGTACTACACTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Gorilla_gorilla"/>
+			ATGGCACATGCAGCGCAAGTAGGTCTACAAGACGCTACTTCTCCTATCATAGAAGAACTAATCATCTTTCATGATCATGCCCTCATAATCATTTTTCTCATCTGCTTCTTAGTCCTGTACGCCCTTTTCCTAACACTCACAACAAAGCTAACTAACAACAACATCTCAGACGCCCAAGAAATAGAGACCATCTGAACCATCCTGCCCGCTATTATCTTAGTCCTGATCGCCCTCCCATCTCTACGAATCCTCTATATGACAGATGAAATCAATGACCCCTCCTTCACTATCAAATCAATCGGTCACCAATGATACTGAACCTACGAATACACCGACTATGGTGGATTGATCTTTAACTCCTATATACTCCCCCCATTATTCCTAGAACCAGGTGACCTACGACTCCTTGACGTCGACAACCGAGTAGTCCTTCCAGTTGAAGCCCCCGTCCGTATAATAATTACATCCCAAGATGTCTTACACTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Galago_demidoff"/>
+			ATGGCCCACGCTGTACAATTCGGATTTCAAGACGCTGCCTCCCCTATTATAGAAGAATTATTATACTTCCATGACCACACCCTTATAATCGTATTTACAATTAGCTCCCTGGTCCTTTATATTATCTCCCTTATGTTATCGACTGAACTTACTCATACAAACACAATAGACGCCCAAGAAGTAGAGACAGTATGAACTATCCTGCCAGCTGTAATCCTCATCCTTATTGCCCTCCCATCCCTCCGAATCCTTTACATAATAGACGAAATCAACACCCCATCCTTAACCCTAAAAACAATAGGCCATCAATGATATTGAAGCTATGAGTACACAGATTATGACAACCTGTGCTTTGACTCCTACATAACCCCTACCCCTGACTTAGAACCAGGAGACCTTCGACTGTTAGAAGTGGACAACCGAGTCGTCCTACCCACAGAAATATCTATCCGAATACTAATCTCCTCTGAAGACGTACTCCACTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Felis_catus"/>
+			ATGGCGTACCCCTTTCAACTAGGTTTCCAAGATGCTACATCCCCCATTATAGAAGAACTCCTACACTTTCACGACCACACACTAATAATTGTATTTTTAATCAGCTCTTTAGTTCTTTATATTATCTCGTTGATGCTAACAACCAAGCTCACGCACACGAGTACAATAGATGCTCAAGAAGTAGAAACCATCTGAACCATCCTACCTGCTATTATCCTGATTCTTATCGCCCTACCCTCCTTACGAATTCTCTATATAATGGATGAAATCAACAACCCCTCCCTCACAGTAAAAACCATAGGACATCAATGATATTGAAGTTATGAGTACACTGATTACGAAGACTTGAATTTTGACTCTTACATAATTCCTACCCAAGAGCTAAAACCAGGAGAACTCCGGCTATTAGAAGTTGACAACCGAGTAGTTTTACCAATAGAAATGACCATTCGCATGTTAATCTCATCAGAAGATGTGTTACACTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eulemur_rubriventer"/>
+			ATGGCTTATCCAGTTCAACTAGGGTTTCAAGATGCTGCTTCCCCCATTATAGAAGAACTCTTATATTTTCACGACCACACTCTGATAATTATATTCCTAATCAGTTCCCTAGTCCTCTATATTATTTCCCTCATGCTTACTACTGAGCTTATCCATACAAGTACTATAGATGCTCAAGAAGTAGAAACAGTATGAACTATTCTGCCCGCAGTAATCCTCATCCTTATCGCCCTTCCATCATTACGCATCCTATATATAATAGATGAAATCACCACACCCTCCTTAACTCTTAAAACTATGGGCCACCAATGATACTGAAGCTATGAGTATACGGACTATGAAAATCTGTGCTTTGATTCATACATGACTCCTCCCTCAGACCTAAAACCGGGGGAACTTCGTCTACTTGAAGTTGATAATCGAGTTGTACTTCCAACAGAATTACCAATCCGAATACTTATTTCCTCAGAAGATGTTTTACACTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eulemur_mongoz"/>
+			ATGGCTTATCCAGTTCAACTAGGGTTCCAAGATGCTGCTTCCCCTATTATAGAAGAACTTTTATACTTCCATGACCACACCTTAATAATTATATTCCTAATTAGTTCTCTAGTCCTCTACATTATTTCCCTTATACTCACTACTGAGCTTATCCATACAAGTACTATAGACGCCCAAGAAGTAGAAACAGTATGAACTATTCTGCCCGCAGTAATTCTTATCCTTATTGCCCTCCCATCATTACGCATCCTATATATAATAGATGAAATCACCACACCCTCCTTAACTCTTAAAACTATGGGCCACCAATGATACTGAAGCTATGAGTACACGGACTATGAGAATCTGTGCTTTGACTCATACATAACTCCTCCTTCAGACCTAAAACCGGGAGAACTTCGTTTACTCGAAGTTGATAATCGAGTTGTGCTTCCAACAGAGCTACCAATCCGAATACTAATTTCCTCAGAAGATGTTTTACATTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eulemur_macaco_macaco"/>
+			ATGGCTTATCCAGTTCAACTAGGATTTCAAGATGCTGCTTCCCCCATTATAGAAGAACTTTTATATTTTCATGACCACACTCTAATAATTATATTCCTAATTAGTTCTTTAGTCCTCTATATTATTTCCCTCATACTTACTACTGAGCTCATCCATACAAGTACCATAGATGCCCAAGAAGTAGAAACAGTATGAACTATTCTGCCCGCAGTAATTCTTATCCTTATTGCCCTTCCATCACTACGCATCCTATATATAATAGATGAAATTTCCACACCCTCCTTAACTCTTAAAACTATAGGCCACCAGTGATACTGAAGCTATGAATATACGGACTATGAGAATCTGTGCTTTGACTCATATATGACTCCACCCTCAGACCTAAAACCGGGAGAACTTCGCCTACTTGAAGTCGATAATCGAGTTGTGCTTCCAACAGAGTTACCAATCCGAATACTAATTTCCTCAGAAGATGTCTTACACTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eulemur_macaco_flavifrons"/>
+			ATGGCTTATCCAGTTCAACTAGGATTTCAAGATGCTGCTTCCCCCATTATAGAAGAACTTTTATATTTTCATGACCACACTCTAATAATTATATTCCTAATTAGCTCTTTAGTCCTCTATATTATTTCCCTCATACTTACTACTGAGCTCATCCATACAAGTACCATAGATGCCCAAGAAGTAGAAACAGTATGAACTATTCTGCCCGCAGTAATTCTCATCCTTATTGCCCTCCCATCACTACGCATCCTATATATAATAGATGAAATTTCCACACCCTCCTTAACTCTTAAAACTATGGGCCACCAATGATACTGAAGCTATGAATATACGGATTATGAGAATCTGTGCTTTGACTCATATATGACTCCACCCTCAGACCTAAAACCAGGGGAACTTCGTCTACTCGAAGTCGATAATCGAGTTGTGCTTCCAACAGAATTGCCAATCCGAATACTAATTTCATCAGAAGATGTTTTACACTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eulemur_fulvus_rufus"/>
+			ATGGCTTATCCAGTTCAACTAGGGTTCCAAGACGCTGCTTCCCCCATTATAGAAGAACTTTTATACTTTCACGACCACACTCTAATAATTATATTCCTAATCAGTTCTCTAGTCCTCTATATTATTTCCCTTATACTTACTACTGAGCTCATTCATACAAGCACCATAGATGCCCAAGAAGTAGAAACAGTATGAACTATTCTGCCCGCAGTGATTCTCATCCTCATTGCCCTTCCATCATTACGCATCCTATACATAATAGATGAGATTACCACACCTTCCTTAACTCTTAAAACTATGGGCCACCAATGATACTGAAGCTATGAATATACGGATTATGAAAATCTGTGCTTTGACTCATACATAACTCCTCCCTCAGACCTAAAACCGGGAGAACTTCGTCTACTTGAAGTTGATAATCGAGTTGTACTTCCAACAGAATTACCAATCCGAATACTAATCTCCTCAGAAGATGTTCTACACTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eulemur_fulvus_collaris"/>
+			ATGGCTTATCCAGTTCAACTAGGGTTCCAAGATGCTGCTTCCCCTATTATAGAAGAACTTTTATACTTTCACGACCACACTCTAATAATTATGTTCCTAATCAGCTCTCTAGTCCTCTATATTATTTCCCTTATACTTACTACTGAACTCATTCATACAAGTACTATAGATGCCCAAGAAGTAGAAACAGTATGAACTATTCTGCCCGCAGTGATCCTAATCCTTATTGCCCTTCCATCATTACGCATCCTATACATAATAGATGAAATCACCACACCTTCCTTAACTCTTAAAACTATGGGCCACCAATGATACTGAAGCTATGAATATACGGATTATGAAAATCTGTGCTTTGACTCATACATGACTCCTCCCTCAGACCTAAAACCGGGAGAACTTCGTCTACTTGAAGTTGATAACCGAGTTGTGCTTCCAACAGAATTACCAATCCGAATACTAATTTCCTCAGAAGATGTTTTACACTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eulemur_fulvus_albifrons"/>
+			ATGGCTTATCCAGTTCAACTAGGGTTCCAAGATGCTGCTTCCCCCATCATAGAAGAACTTCTATACTTTCACGACCACACTCTAATAATTATATTCCTAATCAGTTCTCTAGTCCTCTATATTATTTCCCTTATACTTACTACTGAGCTCATTCATACAAGTACCATAGATGCCCAAGAAGTAGAAACAGTATGAACTATTCTGCCCGCAGTGATTCTCATCCTTATTGCCCTTCCATCATTACGCATCCTATACATAATAGATGAGATCACCACACCTTCCTTAACTCTTAAAACTATGGGCCACCAATGATACTGAAGCTATGAGTATACGGATTATGAAAATCTGTGCTTTGACTCATACATAACTCCTCCCTCAGACCTAAAACCGGGAGAACTTCGTCTACTTGAAGTTGATAACCGAGTTGTACTTCCAACAGAATTACCAATCCGAATACTAATTTCCTCAGAAGATGTTCTACACTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Equus_caballus"/>
+			ATGGCCTACCCCTTCCAACTAGGATTCCAAGACGCAACATCCCCTATTATAGAAGAACTCCTACACTTCCACGACCACACACTAATAATCGTATTCCTAATTAGCTCTCTAGTATTATATATTATCTCATCAATACTAACAACTAAATTAACCCATACCAGCACCATAGATGCTCAAGAAGTAGAGACAATTTGAACGATTTTACCAGCCATCATCCTTATTCTAATCGCCCTCCCATCCCTACGAATTCTATATATAATAGATGAAATCAATAATCCGTCCCTCACAGTCAAAACAATAGGCCACCAATGATACTGAAGCTACGAGTATACCGATTACGAAGACTTGACCTTTGACTCCTACATGATCCCCACATCAGACCTAAAACCAGGAGAATTACGTCTTCTAGAAGTCGACAATCGAGTGGTTCTCCCCATAGAAATAACCATCCGAATGCTAATTTCATCCGAAGACGTCCTACACTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Didelphis_virginiana"/>
+			ATGCCCTATCCAATACAACTAGGTTTCCAAGACGCTACATCTCCTATTATAGAAGAACTTATATACTTTCATGATCATACATTAATAATTGTATTTCTGATCAGTTCACTAGTATTATATATTATTATTCTTATACTTACTACAAAACTTACTCACACAAGCACTATAGATGCCCAAGAAGTGGAAACAATTTGAACAATTTTACCAGCCGTAATTCTTATCCTTATTGCCCTTCCTTCCTTACGAATTCTTTACATAATAGATGAAATCTATAATCCTTATCTAACAGTTAAAGCAATGGGTCATCAATGATATTGAAGCTATGAGTTCACAGACTATGAAAATTTAATATTCGACTCATACATAATCCCAACCAAAGACCTTAGTCCTGGGCAACTTCGTTTACTAGAAGTTGATAACCGAATTGTTCTCCCAATAGAACTACCAATTCGCATGCTAATTTCATCAGAAGACGTTCTCCATGCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Daubentonia"/>
+			atggcttaccccgcccaaataggattccaagacgccacctcccctatcatagaagaacttctatatttccatgaccataccttaataattgtctttataattagctcattagtcctctatactatctcccttatactcacaaccagccttacccatacaaacaccataaacgcccaagaagtggaaacagtgtgaacaatcctccctgcaattatctgcatccttattgccctaccatccttacgtattctctacataatagatgaaattaacaacccttccctaaccattaaaactatgggccaccaatgatactgaacctatgagtatacagattatgaaaacataacctttgattcatacataacctcaaccaacgatctcacccccggagaacttcgacttctggaagtcgataatcgaatagtcctacctacggaattacctattcgagtgttagtctcctcagaagatgtactacactcatgg [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Cheirogaleus_major"/>
+			ATGGCATGTCCAGTTCAACTAGGATTTCAAGACGCTGCCTCTCCTATTATAGAGGAACTTATATATTTCCATGACCATACTTTAATAATCGTCTTCCTAATTAGCTCCCTAGTCCTCTATATCATTTCCCTAATACTCACCACAGAACTTACCCACACAAACACAATAGATGCCCAAGAAGTAGAAACAGTATGAACCATCCTACCTGCAGTTATCTTAATCCTTATTGCTCTTCCATCACTACGAATTCTATATATAATAGATGAAATTACCACCCCATCTCTAACCCTAAAAACTATAGGCCATCAATGGTACTGAAGTTATGAATATACAGACTACGAAAACTTATGTTTTGATTCATATATAACGCCATCATCAGATCTCAAGCCAGGAGAACTTCGCCTACTAGAAGTTGATAACCGAGTTGTCCTACCCACAGAAATATCCATTCGTATACTCATCTCCTCAGAAGATGTACTACACTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Canis_familiaris"/>
+			ATGGCGTACCCATTTCAACTCGGATTACAGGACGCAACCTCCCCTATTATAGAGGAGCTACTTCATTTTCATGACCATACACTAATAATTGTATTCTTAATCAGTTCTTTAGTTCTCTATATCATTTCACTAATATTGACTACAAAATTAACCCATACAAGCACAATAGACGCACAAGAAGTGGAAACAGTATGAACCATTCTACCCGCCATTATCCTAATCCTAATCGCTCTACCTTCCCTCCGAATCCTTTATATAATGGACGAAATTAATAACCCCTCTTTAACCGTGAAAACAATAGGCCACCAATGATACTGAAGCTATGAATATACTGACTATGAAGACTTAAACTTTGACTCCTACATAATCCCAACACAAGAATTAAAGCCAGGAGAACTCCGACTATTAGAAGTAGACAACCGAGTTGTCCTCCCAATAGAAATAACCATCCGAATACTTATCTCTTCAGAAGACGTTTTGCATTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Callithrix_jacchus"/>
+			ATGGCAGCACCAGCCCAATTAGGCCTACAAAACGCCGCATCCCCAATCATAGAAGAACTTATTGCCTTCCATGACCATGCTCTAATAATTATCTTCTTAATTAGCTCACTAGTTCTATACATCATCTCTCTAATACTTACTACAAAACTGACACACACCAGTACCATGAACGCTCAAGAAATCGAAATGATCTGAACTATCCTACCTGCAATAATCCTCATTATAATTGCCCTTCCATCCCTACGCATTTTATATATAACAGACGAGTTTAATAAACCATATCTAACCCTTAAAGCAATCGGCCACCAATGATACTGAAGTTACGAATACTCCGACTATGAAGACTTAGCATTCGACTCCTACATTATACCAACATACTTCCTTGAACCCGGGGAATTCCGACTCCTTGAAGTAGACAACCGAACAACCTTGCCTATGGAAGCAGATATCCGTGTATTAATCTCATCACAAGACGTTTTACACTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Bos_taurus"/>
+			ATGGCATATCCCATACAACTAGGATTCCAAGATGCAACATCACCAATCATAGAAGAACTACTTCACTTTCATGACCACACGCTAATAATTGTCTTCTTAATTAGCTCATTAGTACTTTACATTATTTCACTAATACTAACGACAAAGCTGACCCATACAAGCACGATAGATGCACAAGAAGTAGAGACAATCTGAACCATTCTGCCCGCCATCATCTTAATTCTAATTGCTCTTCCTTCTTTACGAATTCTATACATAATAGATGAAATCAATAACCCATCTCTTACAGTAAAAACCATAGGACATCAGTGATACTGAAGCTATGAGTATACAGATTATGAGGACTTAAGCTTCGACTCCTACATAATTCCAACATCAGAATTAAAGCCAGGGGAGCTACGACTATTAGAAGTCGATAATCGAGTTGTACTACCAATAGAAATAACAATCCGAATGTTAGTCTCCTCTGAAGACGTATTACACTCATGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Balaenoptera_physalus"/>
+			ATGGCATATCCATTCCAACTAGGTTTCCAAGATGCAGCATCACCCATCATAGAAGAGCTCCTACACTTTCACGATCATACACTAATAATCGTTTTTCTAATTAGCTCTTTAGTTCTCTACATTATTACCCTAATGCTTACAACCAAATTAACACATACTAGTACAATAGACGCCCAAGAAGTAGAAACTGTCTGAACTATCCTCCCAGCCATTATCTTAATTTTAATTGCCTTGCCTTCATTACGGATCCTTTACATAATAGACGAAGTCAATAACCCCTCCCTCACTGTAAAAACAATAGGTCACCAATGATATTGAAGCTATGAGTATACCGACTACGAAGACCTAAGCTTCGACTCCTATATAATCCCAACATCAGACCTAAAGCCAGGAGAACTACGATTATTAGAAGTAGATAACCGAGTTGTCTTACCTATAGAAATAACAATCCGAATATTAGTCTCATCAGAAGACGTACTCCACTCATGG [...]
+		</sequence>
+	</alignment>
+
+	<!-- The unique patterns for all positions                                   -->
+	<!-- npatterns=69                                                            -->
+	<patterns id="patterns" from="1">
+		<alignment idref="alignment"/>
+	</patterns>
+
+	<!-- This is a simple constant population size coalescent model              -->
+	<!-- that is used to generate an initial tree for the chain.                 -->
+	<constantSize id="initialDemo" units="substitutions">
+		<populationSize>
+			<parameter id="initialDemo.popSize" value="0.0001"/>
+		</populationSize>
+	</constantSize>
+
+	<!-- Generate a random starting tree under the coalescent process            -->
+	<coalescentTree id="startingTree">
+		<taxa idref="taxa"/>
+		<constantSize idref="initialDemo"/>
+	</coalescentTree>
+
+	<treeModel id="treeModel">
+		<coalescentTree idref="startingTree"/>
+		<rootHeight>
+			<parameter id="treeModel.rootHeight"/>
+		</rootHeight>
+		<nodeHeights internalNodes="true">
+			<parameter id="treeModel.internalNodeHeights"/>
+		</nodeHeights>
+		<nodeHeights internalNodes="true" rootNode="true">
+			<parameter id="treeModel.allInternalNodeHeights"/>
+		</nodeHeights>
+	</treeModel>
+
+	<!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+	<hkyModel id="hky">
+		<frequencies>
+			<frequencyModel dataType="nucleotide">
+				<alignment idref="alignment"/>
+				<frequencies>
+					<parameter id="hky.frequencies" dimension="4"/>
+				</frequencies>
+			</frequencyModel>
+		</frequencies>
+		<kappa>
+			<parameter id="hky.kappa" value="1.0" lower="0.0"/>
+		</kappa>
+	</hkyModel>
+
+	<!-- site model                                                              -->
+	<siteModel id="siteModel">
+		<substitutionModel>
+			<hkyModel idref="hky"/>
+		</substitutionModel>
+        <gammaShape gammaCategories="4">
+              <parameter id="siteModel.shape" value="0.5" lower="0.0" upper="1000.0"/>
+        </gammaShape>
+        <proportionInvariant>
+                <parameter id="siteModel.pInv" value="0.5" lower="0.0" upper="1.0"/>
+        </proportionInvariant>
+		<mutationRate>
+			<parameter id="siteModel.mu" value="1.0" lower="0.0"/>
+		</mutationRate>
+	</siteModel>
+
+	<treeLikelihood id="treeLikelihood">
+		<patterns idref="patterns"/>
+		<treeModel idref="treeModel"/>
+		<siteModel idref="siteModel"/>
+	</treeLikelihood>
+
+	<operators id="operators">
+        <!-- proportions invariant -->
+        <scaleOperator scaleFactor="0.75" weight="1">
+                <parameter idref="siteModel.pInv"/>
+        </scaleOperator>
+        <!-- gamma shape parameter -->
+        <scaleOperator scaleFactor="0.75" weight="1">
+                <parameter idref="siteModel.pInv"/>
+        </scaleOperator>
+        <!-- standard operators -->
+		<scaleOperator scaleFactor="0.5" weight="1">
+			<parameter idref="hky.kappa"/>
+		</scaleOperator>
+		<scaleOperator scaleFactor="0.5" weight="1">
+			<parameter idref="treeModel.rootHeight"/>
+		</scaleOperator>
+		<uniformOperator weight="10">
+			<parameter idref="treeModel.internalNodeHeights"/>
+		</uniformOperator>
+		<subtreeSlide weight="5" gaussian="true" size="1.0">
+			<treeModel idref="treeModel"/>
+		</subtreeSlide>
+		<narrowExchange weight="1">
+			<treeModel idref="treeModel"/>
+		</narrowExchange>
+		<wideExchange weight="1">
+			<treeModel idref="treeModel"/>
+		</wideExchange>
+		<wilsonBalding weight="1">
+			<treeModel idref="treeModel"/>
+		</wilsonBalding>
+	</operators>
+
+	<mcmc id="mcmc" chainLength="1000000" autoOptimize="true" preBurnin="0">
+		<compoundLikelihood id="likelihood">
+			<treeLikelihood idref="treeLikelihood"/>
+		</compoundLikelihood>
+		<operators idref="operators"/>
+		<log logEvery="10000">
+			<column label="Likelihood" dp="4" width="12">
+				<compoundLikelihood idref="likelihood"/>
+			</column>
+			<column label="Root Height" sf="6" width="12">
+				<parameter idref="treeModel.rootHeight"/>
+			</column>
+			<column label="Kappa" sf="6" width="12">
+				<parameter idref="hky.kappa"/>
+			</column>
+		</log>
+		<log logEvery="10000" fileName="testMCMC.log">
+			<compoundLikelihood idref="likelihood"/>
+			<parameter idref="treeModel.rootHeight"/>
+			<parameter idref="hky.kappa"/>
+		</log>
+		<logTree  logEvery="10000" nexusFormat="true" fileName="testMCMC.trees">
+			<treeModel idref="treeModel"/>
+		</logTree>
+	</mcmc>
+</beast>
diff --git a/examples/benchmark/1/testHKY336.xml b/examples/benchmark/1/testHKY336.xml
new file mode 100644
index 0000000..fa35245
--- /dev/null
+++ b/examples/benchmark/1/testHKY336.xml
@@ -0,0 +1,282 @@
+<?xml version="1.0" standalone="yes"?>
+<!-- Generated by BEAUTi v1.5beta4                                           -->
+<!--       by Alexei J. Drummond and Andrew Rambaut                          -->
+<!--       Department of Computer Science, University of Auckland and        -->
+<!--       Institute of Evolutionary Biology, University of Edinburgh        -->
+<!--       http://beast.bio.ed.ac.uk/                                        -->
+<beast>
+	
+	<!-- The list of taxa analyse (can also include dates/ages).                 -->
+	<!-- ntax=27                                                                 -->
+	<taxa id="taxa">
+		<taxon id="Oryctolagus_cuniculus"/>
+		<taxon id="Homo_sapiens"/>
+		<taxon id="Rattus_norvegicus"/>
+		<taxon id="Mus_musculus"/>
+		<taxon id="Gallus_gallus"/>
+		<taxon id="Turdus_migratorius"/>
+		<taxon id="Alligator_mississippiensis"/>
+		<taxon id="Sceloporus_undulatus"/>
+		<taxon id="Heterodon_platyrhinos"/>
+		<taxon id="Trachemys_scripta"/>
+		<taxon id="Typhlonectes_natans"/>
+		<taxon id="Hypogeophis_rostratus"/>
+		<taxon id="Grandisonia_alternans"/>
+		<taxon id="Ichthyophis_bannanicus"/>
+		<taxon id="Plethodon_yonhalossee"/>
+		<taxon id="Ambystoma_mexicanum"/>
+		<taxon id="Amphiuma_tridactylum"/>
+		<taxon id="Siren_intermedia"/>
+		<taxon id="Gastrophryne_carolinensis"/>
+		<taxon id="Hyla_cinerea"/>
+		<taxon id="Bufo_valliceps"/>
+		<taxon id="Eleutherodactylus_cuneatus"/>
+		<taxon id="Nesomantis_thomasseti"/>
+		<taxon id="Scaphiopus_holbrooki"/>
+		<taxon id="Xenopus_laevis"/>
+		<taxon id="Discoglossus_pictus"/>
+		<taxon id="Latimeria_chalumnae"/>
+	</taxa>
+	
+	<!-- The sequence alignment (each sequence refers to a taxon above).         -->
+	<!-- ntax=27 nchar=1949                                                      -->
+	<alignment id="alignment" dataType="nucleotide">
+		<sequence>
+			<taxon idref="Oryctolagus_cuniculus"/>
+			UACCUGGUUGAUCCUGCCAGUAGCAUAUGCUUGUCUCAAAGAUUAAGCCAUGCAUGUCUAAGUACGCACGGCCGGUACAGUGAAACUGCGAAUGGCUCAUUAAAUCAGUUAUGGUUCCUUUGGUCGCUCGCUCCUCUCCUACUUGGAUAACUGUGGUAAUUCUAGAGCUAAUACAUGCCGACGG?CGCUGACUCCC?UUUGUG????UGGGAUGCGUGCAUUUAUCAGAUCAAAACCAACCCGGUCAGCCUCCCCGCCGGCCGGGGGGGUGGGGCGGCG?????????????????????????????????????????????????????????????????????GCUUUGGUGACUCUAGAUAACCUCGGGCCGAUCGCA?GCCCUCCGUGGCGGCGACGACCCAUUCGAACGUCUGCCCUAUCAACUUUCGAUGGUAGUCGCCGUGCCUACCAUGGUGACCACGGGUGACGGGGAAUCAGGGUU [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Homo_sapiens"/>
+			UACCUGGUUGAUCCUGCCAGUAGCAUAUGCUUGUCUCAAAGAUUAAGCCAUGCAUGUCUAAGUACGCACGGCCGGUACAGUGAAACUGCGAAUGGCUCAUUAAAUCAGUUAUGGUUCCUUUGGUCGCUCGCUCCUCUCCUACUUGGAUAACUGUGGUAAUUCUAGAGCUAAUACAUGCCGACGGGCGCUGACCCCC?UUCGCGGG??GGGGAUGCGUGCAUUUAUCAGAUCAAAACCAACCCGGUCAGCCCCUCUCCGGCCCCGGCCGGGGGGCGGGCCGCGGCG???????????????????????????????????????????????????????????????GCUUUGGUGACUCUAGAUAACCUCGGGCCGAUCGCACGCCCCCCGUGGCGGCGACGACCCAUUCGAACGUCUGCCCUAUCAACUUUCGAUGGUAGUCGCCGUGCCUACCAUGGUGACCACGGGUGACGGGGAAUCAGGGUU [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Rattus_norvegicus"/>
+			UACCUGGUUGAUCCUGCCAGUAGCAUAUGCUUGUCUCAAAGAUUAAGCCAUGCAUGUCUAAGUACGCACGGCCGGUACAGUGAAACUGCGAAUGGCUCAUUAAAUCAGUUAUGGUUCCUUUGGUCGCUCGCUCCUCUCCUACUUGGAUAACUGUGGUAAUUCUAGAGCUAAUACAUGCCGACGGGCGCUGACCCCCCUUCCCGUGGGGGGAACGCGUGCAUUUAUCAGAUCAAAACCAACCCGGUCAGCCCCCUCCCGGCUCCGGCCGGGGGUCGGGCGCCCGGCG??????????????????????????????????????????????????????????????GCUUUGGUGACUCUAGAUAACCUCGGGCCGAUCGCACGU?CCCCGUGGCGGCGACGACCCAUUCGAACGUCUGCCCUAUCAACUUUCGAUGGUAGUCGCCGUGCCUACCAUGGUGACCACGGGUGACGGGGAAUCAGGGUU [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Mus_musculus"/>
+			UACCUGGUUGAUCCUGCCAGUAGCAUAUGCUUGUCUCAAAGAUUAAGCCAUGCAUGUCUAAGUACGCACGGCCGGUACAGUGAAACUGCGAAUGGCUCAUUAAAUCAGUUAUGGUUCCUUUGGUCGCUCGCUCCUCUCCUACUUGGAUAACUGUGGUAAUUCUAGAGCUAAUACAUGCCGACGGGCGCUGACCCCCCUUCCCGGGG?GGGGAUGCGUGCAUUUAUCAGAUCAAAACCAACCCGGUGAGCUCCCUCCCGGCUCCGGCCGGGGGUCGGGCGCCGGCG???????????????????????????????????????????????????????????????GCUU?GGUGACUCUAGAUAACCUCGGGCCGAUCGCACGCCCCCCGUGGCGGCGACGACCCAUUCGAACGUCUGCCCUAUCAACUUUCGAUGGUAGUCGCCGUGCCUACCAUGGUGACCACGGGUGACGGGGAAUCAGGGUU [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Gallus_gallus"/>
+			??CC?GGUUGAUCCUGCCAGUAGCA???GCU?GUCUCAAAGAUUAAGCCAUGCAUGUCUAAGUACACACGGGCGGUACAGUGAAACUGCGAAUGGC?????AAAUCAGUUAUGG?????????UCGCUCCCCUCCC????ACUUGGAUAACUGU?G????UCU?GAGCUAAU?CAUGCCGACGAGCGCCGACCUCC???????????GGG?ACG?G??CAUUUAUCAGACCAAAACCAACGG?C?CGCCC??????????????????????????????????????????????????????????????????????????????????????????????????G???UGG??ACUCUAGAUAACCUCGAGCCGAUCGCA?GC?CCC??UGGCGGCGACGACCCAUU??AAUGUC??CCCUAUCAACUU?CGAUGGUACUGUCUGUGCCUACCAUGGUG???ACGGGUAACGGG?AAUCAGGGUU [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Turdus_migratorius"/>
+			??CCUGGUUGAUCCUGCCAGUAGCAU??GCUUGUCUCAAAGAUUAAGCCAUGCAUGUCUAAGUACACACGGGCGGUACAGUGAAACUGCGAAUGGC????UAAAUCAGUUAUGGU??CUU??GUCGCUCCUCUCCCGC?UCCUUGGAUAACUGUGGU???UCUAGAGCUAAU?CAUGCCGACGAGCGCCGACCUCC???????????GGGGACGCGUGCAUUUAUCAGACCAAAACCAACGG????GCCC???A??????????????????????????????????????????????????????????????????????????????????????????????GCU?UGGUGACUCUAGAUAACCUCGAGCCGAUCGCA?GC?CCCCGCGGCGGCGACGACCCAUUCGAAUG????CCCUAUCAACUU?CGAUGGUACUGUCUGUGCCUACCAUGGUGACCACGGGUGACGGG?AAUCAGG??U [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Alligator_mississippiensis"/>
+			??CCUGGUUGAUCCUGCCAGUAGCAUA?GCUUGUCUCAAAGAUUAAGCCAUGCAUGUCUAAGUACACACGGCCGGUACAGUGAAACUGCGAAUGGCUCAUUAAAUCAGUUAUGGUUCCUU??GUCGCUCCAACCGU???UACUUGGAUAACUGUGGU??UUCUA?AGCUAAUACAUGCCGACGAGCGCUGACCU?C???????????GGGGAU?CGUG?AUUUAUCAGACCAAAACCAACGGGCUCGCCCGGCC??????????????????????????????????????????????????????????????????????????????????????????????GCU?UGGUGACUCUAGAUAACC?CGGGCCGAUCGCA?GC?CC?CGUGGCGGCGACGACGCAUUCGAAUGUCU?CCCUAUCAACUUUC?AUGGUACUUUCUGUGCCUACCAUGGUGACC?CGGGUA?CGGGGA?UCA?GGUU [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Sceloporus_undulatus"/>
+			????????????????????????????GC??GUCUCAAAGAUUAAGCCAUGCAUGUCUAAGUACACACGGGCGUUA?AGUGAAACUGCGAAUGGCU???UAAAUCAGUUAUGGU??CU???GUCGCUCCCCC??U???UCCUUGGAUAACUGUGGU???UCUAGAGCUAAUACAUGCCAACGAGCGCUGACCUCC???????????GGGGAUGCGUGCAUUUAUCAGACCAAAACCAACGGGCUCGCCC??CC??????????????????????????????????????????????????????????????????????????????????????????????GCU?UGGU?ACUCUAGAUAACCUCGGGCCGAUCGCA?GCC?C?CGUGGCGGCGACGACGCAUUCGAAUGUCU?CCCUAUCAACUUUCGAUGGUACUUUCUGCGCCUACCAUGGUGACC?CGGGUA??GGGGAAUCAGGGUU [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Heterodon_platyrhinos"/>
+			??CCU?GUUGAUCCUGCCAG?AGCA???GCU?GUCUCAAAGAUUAAGCCAUGCAUGUCUAAGUACACACGGGCGUGACAGUGAAACUGCGAAUGGC????UAAAUCAGUUAUGG???CU???GUCGCUCCCACCGU???UACUCGGAUAACUGUGG????UCUAGAGCUAAUACAUGCCGACGAGCGCUGACCUCC???????????GGGGAUGCGUGCAUUUAUCAGACCAAAACCAACGGGCU??CCCGGCC??????????????????????????????????????????????????????????????????????????????????????????????GCU?UGGUGACUCUAGAUAACCUCGGGCCGAUCGCA?GCCCCCCGUGGCGGCGACGACGCAUUCGAACGUCUGCCCUAUCAACUUUCGAUGGUACUUUCUGUGCCUACCAUGGUGACCACGGGUAACGGGGAAUCAGGGUU [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trachemys_scripta"/>
+			??CCUGGUUGAUCCUGCCAGUAGCAUA?GCUUGUCUCAAAGAUUAAGCCAUGCAUGUCUAAGUACACACGGCCGGUACAGUGAAACUGCGAAUGGC???UUAAAUCAGUUAUGGU??CUU??GUCGCUCC?ACCCU???UACUUGGAUAACUGUGGU???UCU?GAGCU?AU?CAUGCCGACGAGCGCUGACCUCC???????????GGG?AUGCGUGCAUUUAUCAGACCAAAACCAACGGGCUCGCCCGGCC??????????????????????????????????????????????????????????????????????????????????????????????GCU?UGGUGACUCUAGAUAACCUCGGGC?GAUCGCA?GCCCCCCGUGGCGGCGACGAUGCAUUCGAAUGUCU?CCCUAUCAACUUUCGAUGGUACUUCCUGUGCCUACCAUGGUGACCACGGGUAACGGGGAAUCAGGGUU [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Typhlonectes_natans"/>
+			????UGGUUGAUCCUGCCAGUAGCA???GCUUGUCUCAAAGAUUAAGCCAUGCACGUGUAAGUACACACGGCCGGUACAGUGAAACUGCGAAUGGCU???UAAAUCAGUUAUGGU??CUU??AUCGCUCCAUCC??????ACUUGGAUAACUGUGGU???UCU?GAGCU?AU?CAUGCCGACGAGCGCUGACCUCC???????????CGG??UGCGUGCAUUUAUCAGACCA?AACCAAUGG?CUCGCCC??CC??????????????????????????????????????????????????????????????????????????????????????????????GC???GGU?ACUCUAGAUAACCUCGGGC?GAUCGCA?GUCCCCCGUGACGGCGACGAUGCAUUCGGAUGUCU?CCCUAUCAACUUUCGAUGGUACUUUCCG?GCCUACCAUGGUGACCACGGGUAACGGGG?AUCAGG?UU [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Hypogeophis_rostratus"/>
+			??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????AUCGCUC?AUCUCGU??UACUUGGAUAACUGUGGU?AUUCU?GAGCU?AUACAUGCCGACGAGCGCU?ACCUCC???????????CGGGAUG?GUGCAUUUAUCAGACC??AACCAAUGGGCUCGCC???C???????????????????????????????????????????????????????????????????????????????????????????????GCU??GGU?ACUCUAGAUAACCUCGGGCCGAUCGCACGUC?CCCGUGACGGCGACGAUACA???????????????????????????????????????????????????????????????????????????????? [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Grandisonia_alternans"/>
+			??CCU?GUU?AUCCU?CCAG?AGCA???GCU?GUCUCAAAGAUUAAGCCAUGCACGUGUAAGUACACACGGCCGGUACAGUGAAACUGCGA???????????????????????????????AUCGCUCCAUC?CGU??UACUUGGAUAACUGUGGU?AUUCU??A?CU?AUACAUGCCGACGAGCGCU?ACCUCC???????????CGGGAUG?GUGCAUUUAUCAGACC??AACCAAUGGGCUCGCC???CC??????????????????????????????????????????????????????????????????????????????????????????????GC???GGU?ACUCU?GAUAACCUCGGGC??AU?GCACGUC?C??GUGACGGCGACGAUACAUUCGGAUGUC?GCCCUAUC?ACUUUCG?UGGU?CUUUCUGCGCCUACCAUGGUGAC?ACGGGUAACGGGGAAUC?GGGUU [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Ichthyophis_bannanicus"/>
+			???????????????????????????????????UCAA?GA???AGCCAUGCACGUGUAAGUACACACGGCCGGUACAGUGAAACUGCGAAUGGC????UAAAUCAGUUAU?G????????AUCGCUC?AUCCGU????ACUUGGAUAACUGUGGU???UCU?GAGCU?AU?C?UGCCGACGAGCGCU?ACCCCC???????????CGG?AUGCGUGC?UUUAUC?GACCAAAACCAAUGGGCU?GCC???C???????????????????????????????????????????????????????????????????????????????????????????????GC???GGUGACUCUAGAUAACCUCGGGC?GAUCGCACGUC?CGCGUGACGGCGACGAUACAUUCGGAUGUCUGCCCUAUC?ACUUUCGAUGGUACUUUCU??GCCUACCAUGGUGAC?ACGGGUAACGGGGAAUCAGGG?? [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Plethodon_yonhalossee"/>
+			?????GGUU?AUCCUGCCAG?AGCA???GCUUGUCUCAAAGAUUAAGCCAUGCACGUGUAAGUACGCACGGCCGGUACAGUGAAACUGCGAAUGGCU??UUAAAUCAGUUA??????CUU??AUCGCUCCAU???U???UACUUGGAUAACUGUGGU?AUUC??GAGCU?AUACAUGCCGA?GAGCGCU?ACCUUCAC?????????CGGGAUG?GUGCAUUUAUCAGACC??AACCAAUCGGG?GCCC?CCU?G??????????????????????????????????????????????????????????????????????????????????????????????CUUUGGU?ACUCUAGAUAACCU?GGG?U?AUCGCA?GUC?CCCGUGACGGCG???????????????????????????????????????????????????????????????????????????GGGAA??AGGG?? [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Ambystoma_mexicanum"/>
+			????UGGUUGAUCCUGCCAGUAGCA???GCUUGUCUC?AAGAUUAAGCCAUGC?CGUGUAAGUACACACGGCCGGUAC?GUGAAACUGCGAAUGGCU??UUAAAUC?CUUAUGGU??CUUU?AUCGCUCCAUCUGU???UACUUGGAUAACUGUGGU?AUUCUAGAGCUAAUACAUGCCGACGAGCGCUGACCUCC???????????CGGGAUGCGUGCAUUUAUCAGACCAAGACCAAUGGGCUCGCCCGGCC??????????????????????????????????????????????????????????????????????????????????????????????GC???GGUGACUCUAGAUAACCUCGGGCCGAUCGCA?GUCCCCCGUGACGGCGACGAUGCAUUCGGAUGUCUGCCCUAUCAACUUUCGAUGGUACUUUCUGUGCCUACCAUGGUGACCACGGGU??CGGGGAAUCAGGGUU [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Amphiuma_tridactylum"/>
+			??CCU?GUUGAUCCUGCCAG?AGCA???GCUUGUCUCAAAGAUUAAGCCAUGCACGUGUAAGUACACACGGCCGGUACAGUGAAACUGCGAA????????UAAAUCAGUUAU??????????AUCGCUCCAUCU?U???UACUUGGAUAACUGU?GUUAUUCUU?AGCUAAUACAUGCCGACGAGCGCUGACCUCC???????????CGGGAUG?GUGCAUUUAUC?GACCAAAACCAAUGGGCUCGCC???CC??????????????????????????????????????????????????????????????????????????????????????????????GC???GGU?ACUCUAGAUAACCUCGGGC?GAUCGCA?G?C?CCCGUGACGGCGACGA???????????????????????????????????????????????????????????????????????????????????? [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Siren_intermedia"/>
+			??CCUGGUUGAUCCUGCCAGUAGCA???GCUUGUCUCAAAGAUUAAGCCAUGCACGUGUAAGUACACACGGCCGGUACAGUGAAACUGCGAAUGGCU?A?UAAAUCAGUUAUGGU??CUU??AUCGCU???CC?GU???UACUUGGAUAACUGUGGU?AUUCU?GAGCUAAUACAUGCCGACGAGCGCUGACCUC????????????CGGGAUGCGUGCAUUUAUCAGACCAAGACCAAUGGGC?CGCC????CC?????????????????????????????????????????????????????????????????????????????????????????????GCU??GGU?ACUCUAGAUAACCUCGGGCC?AUCGCACGUCCCCCGUGACGGCGACGAUGCAUUCGGAUGUCUGCCCUAUCAACUUUCGAUGGUACUUUCUGUGCCUACCAUGGUGACCACGGGUAACGGGGAAUCAGG?UU [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Gastrophryne_carolinensis"/>
+			???CUGGUUGAUCCUGCCAGUAGC????GCUUGUCUCAAAGAUUAAGCCAUGC?CGUGUAAGUACACACGGAC?GUACAGUGAAACUGCGAAUGGC???UUAAAUCAGUUAUGG???CUU??AUCGCUCCCAU???U??UACUUGGAUAACUGUGGUAAUUCU?GAGCU?AUACAUGCCGA?GAGCGCUGACCCCC???????????AGG?AUGCGUGCAUUUAUCAGACCAAAACCAAUCGGGGGC?C??G?GUC???G?CCC????CCC??G????????????????????????????????????????????????????????????????????????????UUUGGCGACUCUAGAUAACCUCGGGC?GAUCGCA?GUC?CCCGUGACGGCGACGAUACUUUCGGAUGUCUGCCCUAUC?ACUUUC?AU?GUUCUUUCU?CGC?UACCAU?GUGACCACGGGU?A?GGG??AUCAGG??U [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Hyla_cinerea"/>
+			??CCUGGUUGAUCCUGCCAGUAGCA?A??C?UGUCUCAAAGAUUAAGCCAUGCACGUGUAAGUACACACGGCCGGUACAGUGAAACUGCGAAUGGCU??U?AAAUCAGUUAU?????CU???AUCGCUCCAACC??????CCUUGGAUAACUGU?GU?AUUCU??AGCU?AUACAUGCCGACGAGCGCUGACCACC???????????AGGGACGCGUGCAUUUAUCAGACCAAAACCAAUCGGGGGCCCGGG?GCGGCGG?GGCGGAGGGG?GGCUCU?AAAAGCC??????C?C???C??GCUCUCCC??G?C??????????????????????????????????GCCUUGGCGACUCUAGAUAACCUCGGGCCGAUCGCACGUC?CCCGUGACGGCGACGACGCAUUCGGAUGUCUGCCCUAUCAACUUUCGAUGGUACUUUCUGCGCCUACCAUGGUGACCACGGGUAACGGG?AAUC?GGGU? [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Bufo_valliceps"/>
+			?????????????????????????????????????????????AGCCAUGCACGUGUAAGUACGCACGGCCGGUACAGUGAAACUGCGAAUGGC??????????????????????????AUCGCUCCAACCGU???UACUUGGAUAACUGUGGUAAUUCUAGAGCUAAUACAUGCCGACGAGCGCUGACCCCC???????????AGGGAUGCGUGCAUUUAUCAGACCAAAACCAAUCGGGG???GGGCGC?CGGG?C??GG??U?GGGGGUGGUCU?GGCCUCCC??C?CAGCC?C??C?GCUCUCCC??G?C???????????????????????????????GCUUUGGUGACUCUAGAUAACCUCGGGCCGAUCGCACGUC?CCCGUGACGGCGACGAUCCAUUCGGAUGUCUGCCCUAUCAACUUUCGAUGGUACUUUCUGCGCCUACCAUGGUGACCACGGGUAACGGGGAAUCAGGGUU [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eleutherodactylus_cuneatus"/>
+			??CCUGGUUGAUCCUGCCAGUAGCA???GCUUGUCUCAAAGAUUAAGCCAUGCACGUGUAAGUACACACGGCCGGUACAGUGAAACUGCGAAUGGC????UAAAUCAGUUAUGG???CUU??AUCGCUCCAACCG?????AC?????????????????????????????????????????????????????????????????AGGGAUG?GUGCAUUUAU?AGACCAAAACC??U?GGGU?U?GC?????GGGGC??AAGGG?????G?U?CUCCCCGGGA???G?GCCCGG???G??GG?CCG?????CC????G???????????????????????????GCCUUGGCGACUCUAGAUAACCUCGGGC??AUCGCACGUC?CCCGUGACGGCGACGAUCCAUUCGGACGUCUGCCCUAUCAACUUUCGAUGGUACUUUCUGCGCCUACCAUGGUGACCACGGG??ACGGGGAAUCAGGG?U [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Nesomantis_thomasseti"/>
+			??CCU?GUU?AUCCUGCCAGUAGCU???GCUUGUCUC?AAGAUUAAGCCAUGCACGUGUGAGU?CGCACGGCCGGUAC?GUGAAACUGCGAAUGGC???UUAAAUCAGUUAU?G???CUU??AUCGCUCCAUCC??????AC?????????????????????????????????????????????????????????????????AGGGAUGCGUGCAUUUAU?AGACCAAAACCAAU?GGG?????????????????GGGUUUG??GG?G??GGGGGGGGGGGGUCGCGU?AG?C???????CC???G?CC??UCCUCCCG?GCCC?C?GUCCC?UCCC????CGCCU?GGU?ACUCUAGAUAACCUCGGG???AUCGCACGUC?CCCGUGACGGCGACGAUACAUUCGGAUGUCUGCCCUAUCAACUUUCGAUGGU?CUUUCUGCGCCUACCAUGGUGACCACGGGUAACGGGGAAUCAGGGUU [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Scaphiopus_holbrooki"/>
+			??????GUU?AU??UGC?AG??G?????GCUUGUCUC?????UU?AGCCAUGCACGUGUAAGUACACACGGCCGGUACAGUGAAACUGCGAAUGGC???UUAAAUCAGUUAU?G???CUU??AUCGCUC?AUC??U????ACUUGGAUAA?????????????????????????????????????????????????????????AGG?AUGCGUGCAUUUAUCAGACCAAAACCAAUCGGGUGGC?C?CCCCUCCC??CC?????????????????????????????????????????????????????????????????????????????????????GCU??GGU?ACUCUAGAUAACCUCGGGCCGAUCGCA??UC?CCCGUGACGGCGACGAUA??UUUGGAUGUCUGCCCUAU??ACUUUCGAU?GU?CUUUCUGUGCCUACCUUGGUGACCACGGGUU??GGG??AU??GG?UU [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Xenopus_laevis"/>
+			UACCUGGUUGAUCCUGCCAGUAGCAUAUGCUUGUCUCAAAGAUUAAGCCAUGCACGUGUAAGUACGCACGGCCGGUACAGUGAAACUGCGAAUGGCUCAUUAAAUCAGUUAUGGUUCCUUUGAUCGCUCCAUCUGU???UACUUGGAUAACUGUGGUAAUUCUAGAGCUAAUACAUGCCGACGAGCGCUGACCCCC???????????AGGGAUGCGUGCAUUUAUCAGACCAAAACCAAUCCGGGGCCCCCGCGCCCCGGCC??????????????????????????????????????????????????????????????????????????????????????GCUUUGGUGACUCUAGAUAACCUCGGGCCGAUCGCACGUC?CCCGUGACGGCGACGAUACAUUCGGAUGUCUGCCCUAUCAACUUUCGAUGGUACUUUCUGCGCCUACCAUGGUGACCACGGGUAACGGGGAAUCAGGGUU [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Discoglossus_pictus"/>
+			????UGGUUGAUCCUGCCAGUAGCAUA??C?UGUCUCAAAGAUUAAG?CAUGCACGUGUAAGUACACACGGCCGGUACAGUGAAACUGCGAAUGGCU????AAAUCAGUUAUGGU??CU???AUCGCUCCAUCUGU???UACUUGGAUAACUGUGGU?AUUCU?GAGCUAAUACAUGCCGACGAGCGCUGACCC??????????????GG?AUGCGUGCAUUUAUCAGACCAAAACCAAUGGGCACUCGUGCC??G?C??????????????????????????????????????????????????????????????????????????????????????????GCUUUGGU?ACUCUAGAUAACCUCGGGC?GAUCGCACGUC?CCCGUGACGGCGACGAUACAUU?????????????????????????????????????????????????????????????????????????????? [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Latimeria_chalumnae"/>
+			UACCUGGUUGAUCCUGCCAGUAGCAUAUGCUUGUCUCAAAGAUUAAGCCAUGCAUGUCUAAGUACAAACGGUGCGUACAGUGAAACUGCGAAUGGCUCAUUAAAUCAGUUAUGGUUCCUUUGAUCGCUCCAAC?GU???UACUCGGAUAACUGUGGUAAUUCUAGAGCUAAUACAUGCCGACGAGCGCUGACCUUC???????????GGGGAUGCGUGCAUUUAUCAGACCAAAACCAAUCCGGGUCCGCCCGGCC????????????????????????????????????????????????????????????????????????????????????????????GCUUUGGUGACUCUAGAUAACCUCGGGCCGAUCGCACGUC?CUCGUGGCGGCGACGAUUCCUUCGAAUGUCUGCCCUAUCAACUUUCGAUGGUACUUUCUGUGCCUACCAUGGUGACCACGGGUAACGGGGAAUCAGGGUU [...]
+		</sequence>
+	</alignment>
+
+	<!-- The unique patterns for all positions                                   -->
+	<!-- npatterns=69                                                            -->
+	<patterns id="patterns" from="1">
+		<alignment idref="alignment"/>
+	</patterns>
+
+	<!-- This is a simple constant population size coalescent model              -->
+	<!-- that is used to generate an initial tree for the chain.                 -->
+	<constantSize id="initialDemo" units="substitutions">
+		<populationSize>
+			<parameter id="initialDemo.popSize" value="0.0001"/>
+		</populationSize>
+	</constantSize>
+
+	<!-- Generate a random starting tree under the coalescent process            -->
+	<coalescentTree id="startingTree">
+		<taxa idref="taxa"/>
+		<constantSize idref="initialDemo"/>
+	</coalescentTree>
+
+	<treeModel id="treeModel">
+		<coalescentTree idref="startingTree"/>
+		<rootHeight>
+			<parameter id="treeModel.rootHeight"/>
+		</rootHeight>
+		<nodeHeights internalNodes="true">
+			<parameter id="treeModel.internalNodeHeights"/>
+		</nodeHeights>
+		<nodeHeights internalNodes="true" rootNode="true">
+			<parameter id="treeModel.allInternalNodeHeights"/>
+		</nodeHeights>
+	</treeModel>
+
+	<!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+	<hkyModel id="hky">
+		<frequencies>
+			<frequencyModel dataType="nucleotide">
+				<alignment idref="alignment"/>
+				<frequencies>
+					<parameter id="hky.frequencies" dimension="4"/>
+				</frequencies>
+			</frequencyModel>
+		</frequencies>
+		<kappa>
+			<parameter id="hky.kappa" value="1.0" lower="0.0"/>
+		</kappa>
+	</hkyModel>
+
+	<!-- site model                                                              -->
+	<siteModel id="siteModel">
+		<substitutionModel>
+			<hkyModel idref="hky"/>
+		</substitutionModel>
+        <gammaShape gammaCategories="4">
+              <parameter id="siteModel.shape" value="0.5" lower="0.0" upper="1000.0"/>
+        </gammaShape>
+        <proportionInvariant>
+                <parameter id="siteModel.pInv" value="0.5" lower="0.0" upper="1.0"/>
+        </proportionInvariant>
+		<mutationRate>
+			<parameter id="siteModel.mu" value="1.0" lower="0.0"/>
+		</mutationRate>
+	</siteModel>
+
+	<treeLikelihood id="treeLikelihood">
+		<patterns idref="patterns"/>
+		<treeModel idref="treeModel"/>
+		<siteModel idref="siteModel"/>
+	</treeLikelihood>
+
+	<operators id="operators">
+        <!-- proportions invariant -->
+        <scaleOperator scaleFactor="0.75" weight="1">
+                <parameter idref="siteModel.pInv"/>
+        </scaleOperator>
+        <!-- gamma shape parameter -->
+        <scaleOperator scaleFactor="0.75" weight="1">
+                <parameter idref="siteModel.pInv"/>
+        </scaleOperator>
+        <!-- standard operators -->
+		<scaleOperator scaleFactor="0.5" weight="1">
+			<parameter idref="hky.kappa"/>
+		</scaleOperator>
+		<scaleOperator scaleFactor="0.5" weight="1">
+			<parameter idref="treeModel.rootHeight"/>
+		</scaleOperator>
+		<uniformOperator weight="10">
+			<parameter idref="treeModel.internalNodeHeights"/>
+		</uniformOperator>
+		<subtreeSlide weight="5" gaussian="true" size="1.0">
+			<treeModel idref="treeModel"/>
+		</subtreeSlide>
+		<narrowExchange weight="1">
+			<treeModel idref="treeModel"/>
+		</narrowExchange>
+		<wideExchange weight="1">
+			<treeModel idref="treeModel"/>
+		</wideExchange>
+		<wilsonBalding weight="1">
+			<treeModel idref="treeModel"/>
+		</wilsonBalding>
+	</operators>
+
+	<mcmc id="mcmc" chainLength="1000000" autoOptimize="true" preBurnin="0">
+		<compoundLikelihood id="likelihood">
+			<treeLikelihood idref="treeLikelihood"/>
+		</compoundLikelihood>
+		<operators idref="operators"/>
+		<log logEvery="10000">
+			<column label="Likelihood" dp="4" width="12">
+				<compoundLikelihood idref="likelihood"/>
+			</column>
+			<column label="Root Height" sf="6" width="12">
+				<parameter idref="treeModel.rootHeight"/>
+			</column>
+			<column label="Kappa" sf="6" width="12">
+				<parameter idref="hky.kappa"/>
+			</column>
+		</log>
+		<log logEvery="10000" fileName="testMCMC.log">
+			<compoundLikelihood idref="likelihood"/>
+			<parameter idref="treeModel.rootHeight"/>
+			<parameter idref="hky.kappa"/>
+		</log>
+		<logTree  logEvery="10000" nexusFormat="true" fileName="testMCMC.trees">
+			<treeModel idref="treeModel"/>
+		</logTree>
+	</mcmc>
+</beast>
diff --git a/examples/benchmark/1/testHKY3475.xml b/examples/benchmark/1/testHKY3475.xml
new file mode 100644
index 0000000..fdad723
--- /dev/null
+++ b/examples/benchmark/1/testHKY3475.xml
@@ -0,0 +1,397 @@
+<?xml version="1.0" standalone="yes"?>
+<!-- Generated by BEAUTi v1.5beta4                                           -->
+<!--       by Alexei J. Drummond and Andrew Rambaut                          -->
+<!--       Department of Computer Science, University of Auckland and        -->
+<!--       Institute of Evolutionary Biology, University of Edinburgh        -->
+<!--       http://beast.bio.ed.ac.uk/                                        -->
+<beast>
+	
+	<!-- The list of taxa analyse (can also include dates/ages).                 -->
+	<!-- ntax=50                                                                 -->
+	<taxa id="taxa">
+		<taxon id="Vila_semistalachtis"/>
+		<taxon id="Vanessa_atalanta"/>
+		<taxon id="Tisiphone_abeona"/>
+		<taxon id="Taygetis_sp._RB294"/>
+		<taxon id="Siproeta_stelenes"/>
+		<taxon id="Prepona_sp._RB256"/>
+		<taxon id="Podotricha_telesiphe"/>
+		<taxon id="Pieris_rapae"/>
+		<taxon id="Phyciodes_tharos"/>
+		<taxon id="Philaethria_dido"/>
+		<taxon id="Panacea_divalis"/>
+		<taxon id="Opsiphanes_cassina"/>
+		<taxon id="Oleria_aquata"/>
+		<taxon id="Neruda_metharme"/>
+		<taxon id="Morpho_helenor"/>
+		<taxon id="Memphis_sp._RB226"/>
+		<taxon id="Megisto_cymela"/>
+		<taxon id="Mechanitis_polymnia"/>
+		<taxon id="Marpesia_orsilochus"/>
+		<taxon id="Limenitis_arthemis"/>
+		<taxon id="Libytheana_carinenta"/>
+		<taxon id="Laparus_doris"/>
+		<taxon id="Hypolimnas_bolina"/>
+		<taxon id="Hypna_clytemnestra"/>
+		<taxon id="Heliconius_erato"/>
+		<taxon id="Hamadryas_chloe"/>
+		<taxon id="Haetera_piera"/>
+		<taxon id="Euptoieta_claudia"/>
+		<taxon id="Euphydryas_phaeton"/>
+		<taxon id="Eueides_vibilia"/>
+		<taxon id="Eresia_nauplius"/>
+		<taxon id="Dryas_iulia"/>
+		<taxon id="Dryadula_phaetusa"/>
+		<taxon id="Doxocopa_sp._RB273"/>
+		<taxon id="Dione_juno"/>
+		<taxon id="Diaethria_clymena"/>
+		<taxon id="Colobura_dirce"/>
+		<taxon id="Cercyonis_pegala"/>
+		<taxon id="Ceratinia_nise"/>
+		<taxon id="Catonephele_acontius"/>
+		<taxon id="Caligo_idomeneus"/>
+		<taxon id="Boloria_bellona"/>
+		<taxon id="Biblis_hyperia"/>
+		<taxon id="Batesia_hypochlora"/>
+		<taxon id="Asterocampa_clyton"/>
+		<taxon id="Antirrhea_sp."/>
+		<taxon id="Anthocharis_midea"/>
+		<taxon id="Actinote_stratonice"/>
+		<taxon id="Actinote_genitrix"/>
+		<taxon id="Acraea_andromacha"/>
+	</taxa>
+	
+	<!-- The sequence alignment (each sequence refers to a taxon above).         -->
+	<!-- ntax=50 nchar=378                                                       -->
+	<alignment id="alignment" dataType="nucleotide">
+		<sequence>
+			<taxon idref="Vila_semistalachtis"/>
+			ctGCATAGtTAAGAcCtGCtGGATGAGGCTGCCCAgTTTCCGCTCCGTGGGTGACGCGCTAAAAGAtCGcTTCgacgGGGCaTCCCGAGTCAtGAtGCCCAATACGGAAGTAGAAgCACCCGTGCAGCGGAACGACGCAGCGCCT---CACAGGGTTCCAAGAAAAGATCGGTACAGATTCCAGCTCCGGCCGCACAATCCCGACCACAAGACGCCCGGCGTCAAgGACcTAGTGTACCTAGAATCATCGCCAGGCTTCTGTGAAAAGAACCCAAGGCTGGGCATTCCCGGTACACACGGGCgTgCCTGCaACgACACGAgTATCgGCGTCCACgGCTGTgACCTTATGTgTTGCGGGCGCGGCTATCGGACCgaaac
+		</sequence>
+		<sequence>
+			<taxon idref="Vanessa_atalanta"/>
+			ctgtactgttaagacttgttggatgaggctgcccagttttcgctccgtgggtGACgCGTTAAAAGATCgCTTCGATGGAGCATCgCGGGTCATGATgCCTAATACAGAAATCGAAGCGCCCGTACAgCGAAATGACGCAGCgCCT---CATAGAGTTCCAAGAAGAGATCGGTACAGATTCCAGCTTCGgCCGCACAATCCGGATCAtAAAACACCGGGAGCaAAAGACCTAGTCTACCTTGAATCATCACCGGGTTTTTGTGAAAAGAACCCGAGGCTGGGCATTCCCGGCACGcacgggcgtgcctgcaacgatacgagcatcggcgtcgacggctgcgacctcatgtgttgcggtcgtggttaccggaccgaaac
+		</sequence>
+		<sequence>
+			<taxon idref="Tisiphone_abeona"/>
+			ctgcacagtgaagacgtgctGGATGAGGCTGCCGAGTTTTCGCTCTGTAGGCGATGCTTTAAAAGATGGCTTCGACGGAGCATCGCGGGTCATGATGCCCAACACGGAGGTGGAAGCGCCGcTTCAGCGGAACGACGCCGCCCCG---CACCGAGTCCCGCGACGAGACCGATACAGGTTTCAACTCCGGCCGCACAATCCCGATCACAAAACACCCGGGGTCAAGGACCTAGTATACCTGGAATCATCGCCGGGTTTCTGCGAAAAGAACCCGAGGCTGGGCATTCCCGGTACGCACGGGCGTGCCTGCAACGATACGAGTATCGGCGTCGACGGCTGCGACCTCATGTGCTGCGGCCGCGGGTACCGGACCGAgAC
+		</sequence>
+		<sequence>
+			<taxon idref="Taygetis_sp._RB294"/>
+			ctgcactgtcaagacatgctggatgagattgtcgacgtttagatctgtgggagatgcttcgatagatggcttcgatggagcatcacgcgtcatgatgcccaacacagaggtagaagtgccggcTCAAAGAaATgACGcGGCTCCT---CATAGAGTACCACGAaGAgACCGaTaTaGGTTTCAACTCAGGCCGcACAATCCtgACCACAAAacACccGGggtCAaGGATTtGgTaTACCTGGAACCATCGCCAGgTTTCTgCGAAAAGAACCCACGGcTGGcCATTtCCGGCACGCACGGaCGTgCCTGcaACGACACAAGTATCGGCGTCGACGGCTGTGaCCTCATGTTCTgCGGTCgtgggtacaggaccgagac
+		</sequence>
+		<sequence>
+			<taxon idref="Siproeta_stelenes"/>
+			ctgcaccgttaagacctgctggatgaggctgcctagttttcgctccgtgggcGATGCTCTAAAGGATCGCTTCGATGGGGCATCGCGGGTAATGATGCCCAATACAGAAATCGAAGCTCCCGTGCAGCGAAACGAGGCAGCTCCT---CACAGAGTACCACGAAGAGATCGGTACAGATTCCAACTTAGGCCACACAATCCCGATCATAAAACACCGGGGACCACAGACCTAGTGTACCTAGAATCATCGCCGGACTTCTGTGAAAAGCACCCGAGACTGGGCATTCCCGGCACGcacgggcgtgcctgcaacgatacgagcatcggcgtcgacggttgcgaccttatgtgctgcggccgtggttaccgcaccgagac
+		</sequence>
+		<sequence>
+			<taxon idref="Prepona_sp._RB256"/>
+			ctgcactgtcaagacttgctggatgagactacccactttccggtcggtaggaGACGCgTtGAAAGATCGATTCGaCGGGGCGTCGAGAGTGATGATGCCCAATACGGtAGTGGAAGCGCCgGTGCAGcGAAACGATgCAGcCCCt---CACAGAGTCCCACGAaGAGATCGATATAGATTTCAAcTCCTGCCGCACAATCCCGATCACAAAACACCCGGGGTCAAGgACCTAGTGTACCTAGAATCGTCATCCGGTTTCTGTGAAAAGAATCCGAGACTGGGCATTCCCGGCACGcacggccgtgcctgcaacgatacgagcatcgacggtgtcgactgcgacctgatgtactacggtcgtgggtaccggactgagac
+		</sequence>
+		<sequence>
+			<taxon idref="Podotricha_telesiphe"/>
+			CTGCACAGTCAAGACCTGTTGGATGAGGCTTCCCAGTTTTAGATCAGTGGGAGACGCTTTGAAAGACCGTTTCGATGGAGCATCGCGGGTCATGATGCCCAACACGGAAGTTGAAGTGTCTGTTCAGAGGAATGACGCAGCTGCG---CACAGAGTTCCTCGAAGAGACCGGTACAAGTTTCAATTCCGACCACACAACCCAGACCATAAAACACCTAGTATACGGGATTTAGTTTACCTAGAACCATCGCCAGGTTTCTGCGAGAAGAATCCGAGAGTGGGCATTCCCGGCACGCACGGGCGTGCCTGCAACGATACCAGCATCGGCGTCGACGGCTGTGATCTCATGTGTTGCGGCCGCGGATACCGGACCgagac
+		</sequence>
+		<sequence>
+			<taxon idref="Pieris_rapae"/>
+			ctgcacggttaagacctgttggatgcgactaccaagtttccgttcggtcggCGACTCATTGAAAGACCGCTTCGACGGGGcATCGCGAGTGATGGTGTCTAACACGGACCTCGAaACGCCAGTACAACGAAACGACGCAGCCCCA---CACAGGGTGCCTCGCAGgGATCGATACAGATTCCAACTGCGTCCGCACAAcCCCGATCATAAATCACCGGGAGTCAAAGACCTCGTCTACTTGGAATCGTCGCCTGGTTTCTGCGAAAAGAATCCACGTTTGGGTATACCCGGCACCCACGGGCGTACTTGCAACGATACTAGTATCGGAGTGGACGGcTGCgAcCtCATGTgCTGCGGcCgCGGTTAcCGGactgagac
+		</sequence>
+		<sequence>
+			<taxon idref="Phyciodes_tharos"/>
+			ctgcactgtCaagacatGctGgAtgAGGcTGCCAAATTCTCGCtCCgTGGGTGAtgcACtTAAagATcGCTTtGAtGGGGCTTCTCGGGTCATGATGCCtAgCACAGAGAGTGACATGCCCTTACGACAGCGTAACGATGCAGCACCGCACAGAGTTCCTCGACGAGATCGTTACAGATTACaGCTCCGTCCTCTCaaTCCTGACCATAAAGCACCGGGAACTAAAGACCTAgTCTATCTGGAACCATCGCCAGGTTTCTGTGAAAAGAACACaAgGCTGGGGATTCCtGGCACCCACgGGCGTaCTTGCaATGACaCGAGTATCgGCGTCgACGGCTGCGACCTCATGTGTTGCGGCCgAGGTTaCCGGACgAACaC
+		</sequence>
+		<sequence>
+			<taxon idref="Philaethria_dido"/>
+			ctgcgctgtcaagacctgttggatgaggcTTCcCAGTTTTAGATCCGTGGGAGGAGCTTTGAAGGACCGCTTCGACGGAGCTTCGCGGGTCATGATGTCCAATACGGAAGTTGAAGTGCCTGTTCAGAGGAATGACGCAGCTGCG---CATAGAGTTCCTCGAAGAGATAGGTACAAGTTCCAACTCCgACCACATAATCCAGATCATAAAACACCTGGTGTCAAGGATTTAGTGTaCTTAGAACCATCACCGGGTtTCTGCGAGAAAAAcCCgAGGCTGGGCATTCCCGGCACGcACGGGCGTgcCTGCAACGATACTAGCATTGCCGTTGACGGCTgcGATCTCATGTGTTtcGGCCgCGGcTACCGGAcTGAGAC
+		</sequence>
+		<sequence>
+			<taxon idref="Panacea_divalis"/>
+			ctgcaccgtaaagacctgctggatgaggCTGCCCAGTTTCCGcTCCGTGGGTGATGCGTTGAAAGATCGcTTCGATGGGGCGTCGCGGGTCATGATGCCCAATACTGAAGTCGAGGCACCCGTGCAGCGGAACGACGCAGCGCCT---CACAGGGTTCCAAGAAGAGATCGGTACCGATTCCAACTTCGGCCACATAATCCCGATCACAAAACGCCTGGGGTCAAGGACCTAGTGTACCTAGAATCATCGcCGGGcTTCTGTGAAAAGAACCCGaGACTGGGcATTCCCGGTACGCACGGACGTGcTTGcAACGATACGAGTATCGGCGTCGACGGCTGTGACCTCATGTGTTGcGGGCGCGGTTACCGGACCGAGAc
+		</sequence>
+		<sequence>
+			<taxon idref="Opsiphanes_cassina"/>
+			???ttctgccaagacttgctggatgagactgccgagtgttcgatctgtaggtGATGCCTTGATAGACGGTTTCGTTGGAGCTTCGCGGGTCATGAAGCCCATCACGGAGGTAGAGGCCCCAATACACCGGACTGACGCCCCTCTT---CACAGAGTTCCGCGCCGGGATCTCTTCAGGTTCCAACTTCGGcCACACAAtCCCGAaCACAAAGCACCCGGGGTCAAGGACCTAGTATACTTAGAATCATCGCCGGGTTCCTGTGAAAAGAAGCCCAGGCTGGGCATTCCCGGTACGcacgggcgtatgtgcaacgacactagcatcggtgtcgtcggctgcgatctcatgtacttcgaccgaggataccggaccgagac
+		</sequence>
+		<sequence>
+			<taxon idref="Oleria_aquata"/>
+			ctgcacagtgaagacttgctggatgaggctaccgagtttccgttctgtgggcGATGCTCTAAAAGacCGCTTCGAcGGTGTTTCACGGgTAATGaTGCCCaACAcAGAAGTAGAAGCGCCGGtACAGCGtAATGACGCGGCACcC---CACAGAGTTCCACGAAGAGATCGATACAGATTTCAACTTCGGCCTCATAATCCTGACCATAAGACACCTGGTGTAAAAGATCTGGTATATCTGGAATCATCACCGGGTTTCTCCGAaAAGAACCCAAGGCTGGGCATTCCCGGTACGcacggacgtgcctgcaacgatactagtatcggcgtggacggctgcgacctcatgtgttgcggccgaggttaccgtacagagac
+		</sequence>
+		<sequence>
+			<taxon idref="Neruda_metharme"/>
+			TTGTACAGTCAAGacaTGCTGgATGAGGCTCCCCAATTTTAGATCCGTGGGGGACGCCTTAAAGGACCGCTTTGATGGAGCATCGCGGGTCATGATGCCTAaTGCGGAAgTTGAAgTGCCTGTTCAGCGGAACGATGCCGCTGCG---CACAGAACTCCTCgAAGAGATCGATACAACTTCCAaCTTCGACCACaCaATCCTGATCACaaaaCaCCCGGTGTCaAGGATTTAGTTTACCTAgAACCATCACCTGGTTTCTGCGAGAAGAACCCGAGGCTAGGTATtCCCGGCACGCACGGGCGTGCCTGCAACGACACCaGCATCgGCGTCGAcGGCtGCgATCTCATgTgTTGCGGCCgCGGATACCGGACTGAAat
+		</sequence>
+		<sequence>
+			<taxon idref="Morpho_helenor"/>
+			ctgctccgccaagacgtgctggatgcggttaccgagttttcggtctgtaggaGACGCCTTGAAAGATGGCTTCGATGGGGCGTCACGGGTCATGCTGCCGAACACTGAGGTGGAAGTGCCAGTGCAGCGGAATGACGCCGCTCCC---CACAGAGTACCCCGACGAGACCGGTACAGATTCCAACTTCGGCCGCATAATCCTGATCACAAATCACCTGGGGTCAAAGACCTAGTATACTTAGAATCGTCGCCGGGTTTCTGTGAAAAGAATCCCAGACTGGGCATTCCTGGTACGcacgggcgtgcctgcaacgacacgagtatcggcgtcgacggctgcgaactcatgtgctgcggccgcggataccggaccgagac
+		</sequence>
+		<sequence>
+			<taxon idref="Memphis_sp._RB226"/>
+			CTGCACGGTCAAAAcTTGCTGGATgagGCTACCGACTTTCCGATCCGTTGGGGaCCCCTtgAAAGATCGCTTTGACGGAGCGTCGAGGGTGATGATGCCCAATGTAgAAGTGGAAACACCAgCGATGCGTAACGACgCACTTCCT---CaCAGAgTCCCGCGACGGGATCGgtATCGATTTCAACTTAGGCCACACAAcCCTGATCACAAGACACCCGGGGTGAAGGACCTAGTCTACTTGGAATCGTCGCCGGGTTTCTGCGAAAAGAATCCCAGGCTGGGCATTCCCGGCACGCACGGGCGTACCTGCAACGATACGAGTATTGGTGTCGACGGTTGCGACCTCATGTGCTGCGGCCGCGGGTACCGCACCGAGAC
+		</sequence>
+		<sequence>
+			<taxon idref="Megisto_cymela"/>
+			CTGTACGGTCAAGACgTGCTGGATGAgGCTGCCAACTTTCCGGTCTGTGGGAGACGCCTTAAAAGACgGCTTtGACGGAGCATCACGAGTCATGATGCCCAATACCGAgGTTGAAGTACCAGCTCAGAGGAATGATGCTGCTCCG---CACAGAGTCCCGCGACGAGACCGATACAGATTTaAACTCCGGCCGCACAATCCTGACCACAAAACACCTGGGGTCAAGGACCTAGTATACtTGGAACCATCGCCGGGTTTCTGCgAAAAGAACCCGCGGCTGGGTATTCCCGGTACGCACGGGCGTgCCTGCAACGATACCAgTaTCGGCgTCgACGGTTGCgACCtCATGTGCTGCGGCCGAGGTTACCGGACCGAGAC
+		</sequence>
+		<sequence>
+			<taxon idref="Mechanitis_polymnia"/>
+			??gcacagtgaaaacttgttggatgaggctacccagttttcgatctgtaggcGATGCCCTAAAAGATCGATTCGAcGGCGCTTCACGGGTAATGATGCCCAACACAGAAGTAGAAGTGGCGGCACAACGGAACGACGCAGcGCCT---CACAGAGTTCCACGACGAgAtaGATaCAGATTtCAGCTTCGGCCTCATAATCCTGACCACAaGAcATCTgGAGTAAAAGACCtGGTATTCCTGGAaTcATCACCGGGTTTCTGCGAaAAgaACCcaaGGTtGGGCATTCCTGGTACTcacggacgtaactgcaacgacaccagcatcgtcgtggacggctgcgacctcatgtgttgcgcccgcggttaccggacggatac
+		</sequence>
+		<sequence>
+			<taxon idref="Marpesia_orsilochus"/>
+			CTGCACGGtCAAGAcTTGCTGGATGAGGCTGCCTAgTTTTCGCTCTGTCGGCGATGCTTTAAAAGATCGCTTCGATGGGGCATCGCGGGTCATGATGCCTAATACAGAAATCGAAGCGCCCGTACAGAGAAATGACGCGGCGCCT---CATAGGGTGCCACGAAgAGATCGGTACAGATTCCAACTACGACCGCACAATCCCGATCACAAAACACCCGGGGTCAAGGACCTAGTCTACCTAGAACCATCGCCGGGATTCTGCGAAAAGAAcCCGAGACTGGGCATTCCCGGTACGCATGGGCGTACCTGCAACGATACGAGCATAGgCgTCgATGGCTGTGACCTCATGTgCTgCGGcCGCGGCTACCGGACTGAgAC
+		</sequence>
+		<sequence>
+			<taxon idref="Limenitis_arthemis"/>
+			ctgcaccgtgaagacctgctggatgaggttacccagtttccgatccgtgggaGACTCGCTGAAGGATCGCTTCGACGGGGCATCGCGGGTCATGATGCCTAATACGGAAATTGAAGTTCCTGTTCAACGAAATGATGCAGCAGCT---CCCAGAGTTTCGCGAAGGGATCGATATAAATTCCAGCTTAGACCGCACAACCCCGATCACAAAACACCCGGGTTCAAGGATTTAGTGTACCTCGAATCTTCACCGGGTTTCTGCGAAAAGAACCCTCGGGTGGGGATTCCCGGCACGcacgggcgtgcctgcaacgatacaagcatcggtgtcgacggctgcgacctcatgtgctgcggccgcgggtatcggaccgagac
+		</sequence>
+		<sequence>
+			<taxon idref="Libytheana_carinenta"/>
+			ctgcactgtgaagacttgctggatgaggctgccgagtttccgctctgtgggtGACGCGttGAAGGACCGCTTCGACGGTGCCTCACGaGTCATGATGCCCAaCACCGATCTCGAGGCGCCCGTgCAGCGAAACGAAGCGGCgcCC---CACAGAGTGCCGTGGAGAGATCGATTCAGGTTCCAAATCCGGCCACACAATcCCGATCACAAGACACATGGAGTCAAGGATCTGGTGTACTTAGAGTCTTCgCCGGGCTTCTgCGAGAAGaATCCCCGgCTGGGCAtcCCCGGTAcGcacggtcgcacctgcaatgacaccagcattggggtcgaaggctgcgacctcatgtgctacgcccgcgggtacaggaccgagac
+		</sequence>
+		<sequence>
+			<taxon idref="Laparus_doris"/>
+			????????????????????GGATGAGGcTCCCCAGtTTcaGATCcGTGGGGGACGCCTTAAAGGATCGCTTCGATGGAGCATCGCGGGTCATGATGCCTAATACAGAAGTTGAAGTACCTGTTCAGAGGAACGACGCAGcTGCg---CATAGaGTTCCtCGAAGAGATCGGTATAAGTTCCAACTCCGACCgcACAATCCCGATCATAaAACACCTGGtGTCAAGGATTTaGTTTACCTAGaACCATCACCGGTTTTCTGcgagAagAACCCgAGGCTGGACATTCCCgGCACGTACgGGcgTgCCTgCAACGAtACTAGCATTGGCGacgaaggctgcgatCtCatgtgttccggccgcg????????????????
+		</sequence>
+		<sequence>
+			<taxon idref="Hypolimnas_bolina"/>
+			CtGtAcTgTTAaGAcTTGCTGGATGAGGCTTcCaAGTTTCCGCTCCGtGGTcGATGCGTTAAaAGATCGATTCGATGGTGCGTCGCGGGTCATGATGCCCAAcAcGgAAATCGAAGCGACTGTaCAGCGAAGCGACGGAGCGCCA---CACAGAGTTCCACGAAGAGATCgGtaCAGGTTCCAGCTCAGACCgCACAATCCCGaTCATAaAACACCGGGATCTAAaGaCCTAGTGTaCCTCGAATCATCgcCGGgTtTCTgTgAAAAgAaCCcGAGGcTggGCATTCCCGGCACGCACGGGCGTgTCTcCCTCGAtgCGAGCATCGGTGTCGGcGGCTGCGATCTCATGTgCTGCGGCCGTGGCTACAGGACCGAGAC
+		</sequence>
+		<sequence>
+			<taxon idref="Hypna_clytemnestra"/>
+			CTGCaCTGTCaAAAcTTGCTGGATGAgACTACCAACTTTCCGGTCTGTAGGCGACGCTTTAAAAGATCGCTTCGACGGGGCGTCGAgaGTGATGATGCCCAATACGGAgGTAgAAgCACCAGCGCAACGCAATGACGCTGCTCCT---CATCgAATCCCAAGACGAAATCGATATAGATTTCaACTTCGGCCGCACAATCCCGATCACAAAACACCTGGGGTCAAgGACCTAgTATACTTAGAATCaTCACCCgGCTTCTGTgAAAAgAATCCgAGGcTGGGCATTCCCGGCACgCaCGGGcGTACCTGCAACGATACGAGCATCGGCGTCGATGGTTGCGACCTCATGTGCTGCGGGCGCGGGTACCGGACGGAAAC
+		</sequence>
+		<sequence>
+			<taxon idref="Heliconius_erato"/>
+			????????tcaagacctgttggatgaggctccccagttttagatctgtcgggGACGCCTTAAaGGATCGcTTtGATGGAGCCTCGCGAGTCATGATGCCTAATACGGAAGTtGAaGTGcCTGTTCAGAGGAACGACGCAGCTGCG---CACAGAGTTCCTCGAAGAGACCGGTACAAGTTCCAACTGCGACCCCACAATCCCGATCATAAAACACCTGGTGCCAAGGATTTGGTTTACCTAGAACCATCACCGGGCTTCTGCGAgAAGAACCCGAGGCTGGGCATTcCCGGCACGcacgggcgtgcctgcaacgatactagcatcggcgtcgacggctgcgatctcatgtgttgcggccgcggataccggaccgaaac
+		</sequence>
+		<sequence>
+			<taxon idref="Hamadryas_chloe"/>
+			CTGCACCGTAAAgacctgctggatgaggctgcccagtttccgctccgtgggtGATGcatTAAaaGATCGcttCGATGGGGCgTCGcGGGTCATGATGCCCAATaCAGAAgTCGAAGtaCCCGTGCAGCGAAACGAcGCAGCgCCT---CACAGgGTTCCAaGAAGAGATCGGTACAGATTCCAACTTAGGCCgCACAATCCCgATCAcAAaACACCTgGGgtCAaGGAtCTAGTGTACCTaGAATCATCGcCGGGcTTCTGTGAAAAGAaCCCgAGgCTaGGCATTCCCGGtACgcacgggcgtgcctgcaacgatacgagtatcggtgtcgacggctgcgatcttatgtgttgcgggcgcggatatcgaaccgagac
+		</sequence>
+		<sequence>
+			<taxon idref="Haetera_piera"/>
+			ctgcctcgtgaagacgtgctggatgaggctgccgactttccgatctgtaggcGACgCctTAAAGGATgGCTTCGACGGtGCTTCGCGGGTCATGATGCCCAtCACGGAGGTAGAAGCaCCGGTGcAGAGGAaCGATGCCGCTCCG---CACAGAGTCCCGCGACGAGACCGATACAGATTTCAACTTCGGcCCCACAATCCTGACCATAAAACGCCTGGTGTCAAGGACCTAGTGTACTTGGAATCATCACcGGGGTTCTGTGAAAAGAATCCCAGACTGGgCATTCACGGTACgcacgggcgtgcctgcaacgatactagtatcggcgtcgacggctgcgacctcatgtgctgcggccgcgggtaccggaccgagac
+		</sequence>
+		<sequence>
+			<taxon idref="Euptoieta_claudia"/>
+			????accGtAAAGAcCTGCTGGATGAGGCTGCCAAGTTTCCGATCTGTGGGAGATGCATTGAAAGATCGCTTCGATGGAGCTTCTCGAGTAATGATGCCAAATACAG---TCGAAGTTCCTGTTCCACGTAATGATGCAGCGGCC---CATAGAGTACCTCGGAGGGATCGGTATAAATTTCAACTTAGACCACATAATCCTGATCACAAAACACCTGGAGTCAAGGATCTAGTGTACTTGGAATCATCACCGGGTTTCTGCGAAAAGAACCCAAGGCTGGGCATTCCCGGCACGCACGGGCGTGCCTGCAATGATACTAGCATTGGTGTCGACGGCTGCGATCTTATGTGTTGCGGCCGCGGCTTCCGGACCGAGAC
+		</sequence>
+		<sequence>
+			<taxon idref="Euphydryas_phaeton"/>
+			ctgtacTGTcAAGActTGcTGGATGAGGcTACCAAGTTTTCGCTCCGTGGGCGATGCACTTAAAGATCGCTTCGATGGAGCATCGCGGGTCATGATGCCAAATTCAGAAAGTGACATGCCCTTGCGACAGCGAAACGATGCAGCGCCTCACAGGGTTCCACGTAGAGATCGTTATAGGTTCCAACTCCGTCCACACAATCCCGATCATAAAACACCAGGTACCAaGGaCCTAGTATaTCTAGAACCATCGCCGGGTTTCTGTGAAAAGAACACAAGGCTGGGCATTCCTGGCACGCATGGGCGTGCTTGCAACGACACGAGCATTGGTGtTGGAGGCTgCGATCTTATGTGTTGtGGCCgtGGgTACCgGACCgaGAC
+		</sequence>
+		<sequence>
+			<taxon idref="Eueides_vibilia"/>
+			CTGCACAgtCAAGAcTtGTTGGATGAGGCTTCCCAGCTTTAGGTCCGTAGGGGACGCCTTGAAGGATCGCTTTGATGGAGCCTCAAGGGTTATGATGCCTAATACGGAAGTTGAAGTGCCTGTCCAGAGGAATGACGCTGCTGCG---CACAGAGTTCCTCGAAGAGATCGGTATAAaTTCCAACTTCGACCACATAACCCTGATCATAAAACACCTAGTGCCAAGGATTTGGTTTACTTAgAACCATCaCCGGGTTTCTGCGAGAAAAACCCGAGGCTgGGCATTCCCGGCACGCACGGGCGTgCCTGCAACGATACTAGCATCGGCGTTGACGGCTGCgATCTCATGTgTTGCGGCCGCGGATACCGGAcCGAgAC
+		</sequence>
+		<sequence>
+			<taxon idref="Eresia_nauplius"/>
+			CTGCACGTtCAAGAcATGCTGGATGAGGCtGCCGAgTTTTCGCTCCGTGGGTGATGCACTTAAAGATCGTTTcGACGGGGCTTCACGGGTCATGATGCCAAGCACAGAGACTGACATGCCCTTACGaCAGCGAAACGATGCAGCACCGCACAGAGTTCCACGACGAGATCGTTACAGATTACAACTCCGTCCTCTCAATCCTGATCATaAAGCACCGGGCACAaAAGACCTAGTCTATCTAGAACCATCGCCAGGTTTCTGTGAAAGGAACACAAGACTGGGGATTCCTGGCACGCACGGGCGTACTTGTAACGACaCgAgTaTCGGTGTCgATGGATGCgACCTCATgTgTTGCgGcCGTGGGTaCCGGACCgATAC
+		</sequence>
+		<sequence>
+			<taxon idref="Dryas_iulia"/>
+			ctgcacagttaagacctgttggatgagacttcccagttttagatctgtgggagacgctttgaaagatcgtttcgatggagcctcacgagtcatgatgcccaacacggaagttgaagtgcctgttcagaggaacgatgcggctgcg---cacagagttcctcgaagagatcggtacaagttccaactccgaccgcataatcctgatcacaaaacaccaggtgtcaaagatttagtatacctagaaccatcaccgggcttctgtgagaagaacccgaggctgggcattcccggcacgcacgggcgtgcctgcaacgatactagcatcggcgtcgacggctgcgacctcatgtgttgcggccgcggataccgcaccgagac
+		</sequence>
+		<sequence>
+			<taxon idref="Dryadula_phaetusa"/>
+			CTGCACAGTCAAGAcCTGCTGGATGAGGCTTcCCAGTTTTAGATCTGTGGGAGATGCTTTgAAGGACCGCTTTGATGGAGCATCGCGAGTCATGATGCCCAATACGGAAGTTGAGGTGCCTGTACAAAGGAATGACGCAGCTGCG---CACAGAGTTCCTCGAAGAGATCGGTACAAGTTCCAACTCCGACCGCACAATCCTGATCATAAAACACCTGGTGTGAAAGATCTAgTTTACCTAGAACCATCaCCGGGTTTCTGCGAAAAGAaCCCGAGGCTGGGCATTCCCGGCACGCACGGGCGTGCCTGCAACGATACTAGCATCGGCGTtGACGGCTGCCACCTCATGTGTTGCGGcCGCGGATACCGGACCGAaAC
+		</sequence>
+		<sequence>
+			<taxon idref="Doxocopa_sp._RB273"/>
+			ctgtactgtgaagacctgttggatgaggctcccaagtttccgctctgtgggtGATTcATTAAAAGATCGTTTCGACGGGGCATCGCGGGTTATGATGCCTAATACAGAAGTCGAAGCACCCGTACAGCGAAATGACGCAGCGCCT---CACAGGGTTCCAAGAAGAGATCGATACAGGTTTCAACTTCGACCGCACAATCCCGATCATAAAACACCCGGGGCCAAAGACCTAGTGTACCTAGAATCATCGCCGGGTTTCTGTGAAAAGAACCCGAGACTGGGCATTCCCGGGACGcacgggcgtgcctgcaacgatacgagcatcggcgtcgacggttgcgatctcatgtgttgcggccgcggttaccgaaccgagac
+		</sequence>
+		<sequence>
+			<taxon idref="Dione_juno"/>
+			ctGcACAGTCAAGAcTTGCTGGATGAGGCTTCCCAATTTTAGATCAGTGGGAGACGCCCTGAAGGATCGCTTCGACGGAGCCTCGCGGGTCATGATGCCTAATACGGAAGTTGAAGTACCTGTTCAAAGGAATGACGCAGcTGCG---CACAGAGTTCCTAGAAGAGATCGATATAAGTTCCAACTCCGTCCACACAACCCTGATCATAAAACACCTAGTGTCAAAGATTTGGTATACCTAGAACCATCACCGGGTTTCTGCGAGAAGAACCCGAGGCTGGGCATTCCCGGCACGCACGGGCGTGCCTGCAACGATACTAGCATCGGCGTCGACGGCTGCGATCTCATGTGTTtCGGCCGCGGATACAGGACCGAGAc
+		</sequence>
+		<sequence>
+			<taxon idref="Diaethria_clymena"/>
+			CTGTACTGTAAAGACCTGCTGGATGAGGCTGCCTAGTTTCCGGTCAGTGGGTGATGCATTAAAAGATCGCTTTGATGGGGCGTCGCGGGTCATGATGCCCAAcACAGAAGTTGAAGCACCAGTGCAGCGAAACGACGCAGCACCT---CACAGGGTTCCAAGAAGAGATCGGTATAGGTTTCAACTAAGACCGCACAATCCCGACCACAAgACTCCTGGaGTCAAAGACCTGGTGTACCTAGAACcATCACCAGGCTTTTGTGAAAAAAACCAGAGGCTGGGCATTCCCGGTACACACGGGCGTTCCTGCAACGATACGAGTATGGGCGTCGAAGGCTGTGACCTCATGTGtTGCGGGCGCGGCTTCCGGACCGAAaC
+		</sequence>
+		<sequence>
+			<taxon idref="Colobura_dirce"/>
+			ctGTActgTTAaGAcTTGCTGGATGAGATTACCCAGTTTTCGTTCTGTGGGTGATGCGTTAAAAGATCGTTTTGATGGAGCGTCACGGGTCATGATGCCTAATACAGAAATTGAAGCACCCGTACAACGAAATGACGCAGCGCCT---CACAGAGTTCCACGAAGAGATCGGTACAGATTTCAACTTCGACCCCACAATCCTGATCATAAAACACCGGGGGCTAAAGAcCTAGTGTACCTaGAATCATCACCGGGTTTTTGtGATAAGAACCCGAGGCTGGGCATCCCCgGTACACACgGGCgTgCCTGCAACGACACAAGCATCggCGTCGACGGcTgTgACCTTATGTgTTGCGGCCGTGGTTACCgAACCgAaaC
+		</sequence>
+		<sequence>
+			<taxon idref="Cercyonis_pegala"/>
+			ctgcacggtgaagacgtgctggatgaggctgCCGACGTTCCGGTCTGTAGGCGATGCCCTAAAGGATGGCTTCGACGGAGCGTCGCGGGTCATGATGCCCAATACAGAGGTGGaAGCGCCGGCTCAGCGGAACGATGCCGCTCCG---CACAGAGTGTCGCGACGAGACCGGTACAGATTTCAaCTCCGGcCGcACAaTCCTGACCACAAAACGCCTGGgGTCAaGGACCTAGTATACCTGGAATCCTCGcCGGgTTTCTGCGAAAAGAACCCtCGGCTGGGCATTCCCGGTACGCACGGgCGTgCCTGCAACGACACGAgTATCGGCGTCGACGGCTGCGAcCTCATGTGCTGCGGCCGCGGCTACCggaccgagac
+		</sequence>
+		<sequence>
+			<taxon idref="Ceratinia_nise"/>
+			ctgcacagtgaaaacttgctggatgaggctaccaagttttcgctctgtgggtGATGCCCCAAAAGACCTTATTGACGGCGCCTCACGGGTGATGATGCCCAACACAGAAGTAGAAGCGCCGGTACAGCGGAATGACGCAGCAAAC---CACAGAGTTCCACGAAGAGATCGATACAGATTTCAACTTCGGCCTCATAATTCCGACCACAAGACCCCTGGGGTAAAAGACCTGGTATACCTAGAATCGTCCCCAGGTTTCTGTGAAAAAAACCCTAGGTTGGGCATTCCCGGCACGcacggacgtgcttgcaccgacacgagtatcggcgtagacggctgcgacctcatgtgttgcgtccgcggttaccggacggagac
+		</sequence>
+		<sequence>
+			<taxon idref="Catonephele_acontius"/>
+			TtGcACAgtAAAGAcCTGCTGGATGAGGCTGCCCAGTTTCCGCTCCGTGGGTGATGCATTGAAAGATCGTTTCGACGGGGCATCGCGGGTCATGATGCCTAACACGGAAATCGAAGCACCCGTGCAGCGAAACGACGCAGCGCCT---CACAGGGTGCCAAAAAGAGATCGGTACAGGTTCCAGCTTAgACCGCACAATCCCGATCACAAAACACCCGGGGTTAAAGACCTAgTTTACCTAgAATCATCGCCGGGCTTCTGTGAAAAGAACCCGAGGCTGGGCATTCCCGGTACGCACGGGCGTgCCTGCAACGATACgAgTATCgGCGTCgACGGCTGCgACCTCaTGTgTTGCGGGCGCGGCTACCGGACCGAgAC
+		</sequence>
+		<sequence>
+			<taxon idref="Caligo_idomeneus"/>
+			?????ctgttaagacttgttggatgagactgccgagttttcgatccgtgggcGATGCTTTGAAAGATAGTTTTGATGGAGCGTCGCGGGTAATGATGCCCAATACGGACGTAGAGGCTCCAGTACAAAGAAATGATGCAGCTCCT---CACAGGCTTCCACGAGGAGACCGTTACAGATTCCAACTTCGGCCGCACAACCCTGACCACAAAGCACCCGGGGTCAAAGACTTAGTATACTTAGAATCATCTCCGGGTTTCTGTGAAAAAAATCCGAGGCTAGGCATCCCCGGTACAcacgggcgtgcctgcaacgacactagcatcggtgttgatggctgcgagctcatgtgctgcggccgtggttaccggaccgagac
+		</sequence>
+		<sequence>
+			<taxon idref="Boloria_bellona"/>
+			ctgtacagttAAGACATGCTGGATGAGGCTACCAAGTTTCCGATCTGTGGGAGATGCATTAAAGGACCGCTTTGATGGAGCTTCGCGGGTTATGATACCTAACACAGAAGTCGAAGCTCCTATACCACGTAACGATGCAGCAGCT---CACAGAGTTCCCCGAAGGGATCGGTACAAATTTCAACTTCGACCGCATAATCCTGACCATAAAACACCAGGGGTCAAGGATCTAGTATaCCTCGAATCATCGCCGGGTTTCTGTGAAAAGAACCCGAGGCTGGGCATTCCCGGCACGCACGGGCGTGCCTGcAATGATACTAGCATtGGCGTCGACGGGTGCGATCTCATGTGTtGTGGCCgCgGcTaCCGGACTGAGAC
+		</sequence>
+		<sequence>
+			<taxon idref="Biblis_hyperia"/>
+			CTGCaCAgTtAAGAcTTGCtGGATgAgGTTGCCGAGTTTCCGCTCCGTGGGTGATGCGCTAAAAGAtCGCttcGacggGGCgTCTCGAGTCATgATGcCcAaTACgGAaaTaGAAGcACCcGTgCAGAGaAACGaCGCAGCgcCT---CACAGaGTTCCaaGAAGAGATCGGTAcAGaTTCCAGCTCCGgCCgCACAATCCtGAcCACAAGACgCCcGGgGTCAAGGAcCTAGTGTACCTAGAATCATCgCCAGGTTTCTGTGAAAAGAACCCgAGGCTGGGCATTCCCGGtACGCACGGtCGTGCCTGCAACGAcACGAGTATCGGCGTCGACGGCTGtGACCTCATGTGcTGCGGGCGCGGcTACaGaACCGAGAC
+		</sequence>
+		<sequence>
+			<taxon idref="Batesia_hypochlora"/>
+			ctgCACCGtAAAGACcTGCTGGATGATGCTGCCCAATTTCCGCTCCGTGGGTGATGCGTTGAAAGATCGCTTTGATGGGGCGTCGCGTGTCATGATGCCCAATACTGAACTCGAGGCATCCGTGCAGCGGAACGACGCATCGCCT---CAGAGGGTTCCAAAAAAAGATCGGTACCGATTTCAACTTCGGCCATACAATCCCGATCACAAAACACCTGGGGTCAAGGACCTAGTGTACCTAGAATCATCGCCAGGCTTCTGTGAAAAGAACCcGAGACTGGGCATTCCCGGTACACACGGACGTGCCTGCAACGATACGAGTgTCgGCgTCGACGGCTGTgACCTCATGTGTtGCGGGCgCgGTTACCgGACCgAgAc
+		</sequence>
+		<sequence>
+			<taxon idref="Asterocampa_clyton"/>
+			ctgtactgtaaagacctgttGGatGAGGCTccCAAGTTTTCGCTCCGTGGGTGATGCATTAAAAGATCGCTTCGATGGGGcATCGCGAGTCATGATGCCTAATACAGAaGTCGAAGCACCCGTGCAGCGTAACGACGCAGtGTCT---CACAGAGTTCCAAGAAGAGATCGGTACAGATTCCAaCTACGCCCGCACAATCCCGATCATAAAACACCCGGGGTCAAGGACCTAGTGTaCCTAGAaTCATCGCCGGGCTTCTGTGAAAaGAACCCgaGACTGGGCATtCCCgGCACGCACGGGCGTGCCTGCAtCGATACGAgTATCGGTGTAGGCGGCTGCGATCTTATGTgTTGTGGCCtCGGTTACCGcacggagac
+		</sequence>
+		<sequence>
+			<taxon idref="Antirrhea_sp."/>
+			ctgctccgtgaagacgtgctggatgaggctgccgagttttcggtctgtgggcGACGCTTTGAAGGACGGCTTCGATGGGGCGTCGCGGGTCATGATGCCCAACACAGAGGTTGAAGTGCCAGTCCTGCGAAACGATGCGGCTCCT---CACAGAGTCCCGCGGCGAGACCGTTACAGATTCCAACTTCGGCCGCACAATCCTGACCACAAATCACCGGGGGTCAAGGACCTAGTATACTTAGAATCATCGCCGGGTTTCTGTGAAAAGAATCCAAGGCTGGGCATTCCCGGTACGcacgggcgtgcctgcaacgatacgagtatcggtgtcgacggctgcgagctcatgtgctgcggccgcggataccgcacggagac
+		</sequence>
+		<sequence>
+			<taxon idref="Anthocharis_midea"/>
+			tggaACAGTGAAGACtTGCTGGATGcGGCTGCCCAgTTTTCGTTCTGTTGGCGATGCGCTaAAAGACCGCTTTGACGGGGCaTCCCGAGTGATGATGTCTAACaCGGACCTCGAAACGCCAGTACAGAGGAACGACGCAGCGCCA---CACaGAGTACCGCGAAgGGATCGATACAgATTCCAaTTGCGGCCGCACAACCCCGATCATAAGTCGCCGGGAACCAAAGACCTCGTGTACCTGGAATCATCACCGGGTTTCTGCGAAAAGAACCCGAGGCTGGGCATTTCCGGCACGCACGGGCGCACCTGCAACGATACgAGTATCGGAGTCGACGGCTGCGACCTCTTGTGTTGCGGACGCGGATATCgGACTGAAAC
+		</sequence>
+		<sequence>
+			<taxon idref="Actinote_stratonice"/>
+			CTGCACAgttAAgAcCTGTTGGaTgAGGtTGccTAGTTTCCGCTCAGTGGGAGATATCTTGAAAGACCGCTTTGATGGAGcATCGCGAGTAAAGATGCCGAATACGGAGGTTGATGTACCTGTTCAAAGGAACGACGCAGCAGCC---CACCGAATTCCTCGAAAgGACCGTTACAAATTCCAACTAGGTCCATATAaTCCAGAACATAAGACACCTGGATTCAAAGATTtAGTGTACCTGGATCCATCACCTGGCTTCTGCAACAAGAACACGAAGCTTGGCATTCCTGGCACTAAGGGGCGTgCCTGTAACGATACTAGCATCGGTGTTGATGGtTGCGATCTTATGTGTTGcGGtCGCGGaTaCCgAACTGAGAC
+		</sequence>
+		<sequence>
+			<taxon idref="Actinote_genitrix"/>
+			CtGCACAGTtAAGAccTGTtGGATGAGGTTGCCTAgTTTCCGCTCAGTGGGAGATATCTTGAAAGACCGCTTCGATGGAGCATCGCGAGTAAAGATGCCGAATACGGAGGTTGACGTACCTGTTCAAAGGAACGACGCAGCAGCC---CACCGAATCCCTCGAAAAGACCGTTACAAATTTCAACTAGGTCCATATAATCCAGAACATAAGACACCTGGATTCAAAGATTTAGTGTACCTGGATCCATCACCTGGCTTCTGCAACAAGAACACGAAGCTTGGCATTCCTGGTACTAAGGGGCGCGCCTGTAACGATACTAGCATCGGTGTTGATGGTTGTGATCTAATGTGTTGCGGTCGCGGATACCGAACTGAGAC
+		</sequence>
+		<sequence>
+			<taxon idref="Acraea_andromacha"/>
+			ctgtacagtaAAGAcaTGtTGGaTGAGGCTGCCTAGTTTCCGTTCTGTGGGAGACGCTTtGAAAGATCGCTTCGATGGAGcATCTCGAGTAATGATGCCGAACACGGAAGTTGAAGTACCTGTACAAAGGAACGACGCGGCAGCC---CACCGAGTTCCTCGGAGGGATCGCTATAAATTCCAACTAAGGCCACATAATCCAGATCACAAAACACCTGGACTCAAAGATTTAGTGTATCTAGAACCATCACCAGGCTTCTGCGAGAAGAACCCGAGGCTTGGCATTCCCGGAACACACGGGCGTGCCTGCAACGATACTAGCATCGGaGTCGATGGTTGCGATCTCATGTGCTGTGGCCGTAGGTaCCGGACTGAgAC
+		</sequence>
+	</alignment>
+
+	<!-- The unique patterns for all positions                                   -->
+	<!-- npatterns=69                                                            -->
+	<patterns id="patterns" from="1">
+		<alignment idref="alignment"/>
+	</patterns>
+
+	<!-- This is a simple constant population size coalescent model              -->
+	<!-- that is used to generate an initial tree for the chain.                 -->
+	<constantSize id="initialDemo" units="substitutions">
+		<populationSize>
+			<parameter id="initialDemo.popSize" value="0.0001"/>
+		</populationSize>
+	</constantSize>
+
+	<!-- Generate a random starting tree under the coalescent process            -->
+	<coalescentTree id="startingTree">
+		<taxa idref="taxa"/>
+		<constantSize idref="initialDemo"/>
+	</coalescentTree>
+
+	<treeModel id="treeModel">
+		<coalescentTree idref="startingTree"/>
+		<rootHeight>
+			<parameter id="treeModel.rootHeight"/>
+		</rootHeight>
+		<nodeHeights internalNodes="true">
+			<parameter id="treeModel.internalNodeHeights"/>
+		</nodeHeights>
+		<nodeHeights internalNodes="true" rootNode="true">
+			<parameter id="treeModel.allInternalNodeHeights"/>
+		</nodeHeights>
+	</treeModel>
+
+	<!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+	<hkyModel id="hky">
+		<frequencies>
+			<frequencyModel dataType="nucleotide">
+				<alignment idref="alignment"/>
+				<frequencies>
+					<parameter id="hky.frequencies" dimension="4"/>
+				</frequencies>
+			</frequencyModel>
+		</frequencies>
+		<kappa>
+			<parameter id="hky.kappa" value="1.0" lower="0.0"/>
+		</kappa>
+	</hkyModel>
+
+	<!-- site model                                                              -->
+	<siteModel id="siteModel">
+		<substitutionModel>
+			<hkyModel idref="hky"/>
+		</substitutionModel>
+        <gammaShape gammaCategories="4">
+              <parameter id="siteModel.shape" value="0.5" lower="0.0" upper="1000.0"/>
+        </gammaShape>
+        <proportionInvariant>
+                <parameter id="siteModel.pInv" value="0.5" lower="0.0" upper="1.0"/>
+        </proportionInvariant>
+		<mutationRate>
+			<parameter id="siteModel.mu" value="1.0" lower="0.0"/>
+		</mutationRate>
+	</siteModel>
+
+	<treeLikelihood id="treeLikelihood">
+		<patterns idref="patterns"/>
+		<treeModel idref="treeModel"/>
+		<siteModel idref="siteModel"/>
+	</treeLikelihood>
+
+	<operators id="operators">
+        <!-- proportions invariant -->
+        <scaleOperator scaleFactor="0.75" weight="1">
+                <parameter idref="siteModel.pInv"/>
+        </scaleOperator>
+        <!-- gamma shape parameter -->
+        <scaleOperator scaleFactor="0.75" weight="1">
+                <parameter idref="siteModel.pInv"/>
+        </scaleOperator>
+        <!-- standard operators -->
+		<scaleOperator scaleFactor="0.5" weight="1">
+			<parameter idref="hky.kappa"/>
+		</scaleOperator>
+		<scaleOperator scaleFactor="0.5" weight="1">
+			<parameter idref="treeModel.rootHeight"/>
+		</scaleOperator>
+		<uniformOperator weight="10">
+			<parameter idref="treeModel.internalNodeHeights"/>
+		</uniformOperator>
+		<subtreeSlide weight="5" gaussian="true" size="1.0">
+			<treeModel idref="treeModel"/>
+		</subtreeSlide>
+		<narrowExchange weight="1">
+			<treeModel idref="treeModel"/>
+		</narrowExchange>
+		<wideExchange weight="1">
+			<treeModel idref="treeModel"/>
+		</wideExchange>
+		<wilsonBalding weight="1">
+			<treeModel idref="treeModel"/>
+		</wilsonBalding>
+	</operators>
+
+	<mcmc id="mcmc" chainLength="1000000" autoOptimize="true" preBurnin="0">
+		<compoundLikelihood id="likelihood">
+			<treeLikelihood idref="treeLikelihood"/>
+		</compoundLikelihood>
+		<operators idref="operators"/>
+		<log logEvery="10000">
+			<column label="Likelihood" dp="4" width="12">
+				<compoundLikelihood idref="likelihood"/>
+			</column>
+			<column label="Root Height" sf="6" width="12">
+				<parameter idref="treeModel.rootHeight"/>
+			</column>
+			<column label="Kappa" sf="6" width="12">
+				<parameter idref="hky.kappa"/>
+			</column>
+		</log>
+		<log logEvery="10000" fileName="testMCMC.log">
+			<compoundLikelihood idref="likelihood"/>
+			<parameter idref="treeModel.rootHeight"/>
+			<parameter idref="hky.kappa"/>
+		</log>
+		<logTree  logEvery="10000" nexusFormat="true" fileName="testMCMC.trees">
+			<treeModel idref="treeModel"/>
+		</logTree>
+	</mcmc>
+</beast>
diff --git a/examples/benchmark/1/testHKY501.xml b/examples/benchmark/1/testHKY501.xml
new file mode 100644
index 0000000..338691b
--- /dev/null
+++ b/examples/benchmark/1/testHKY501.xml
@@ -0,0 +1,292 @@
+<?xml version="1.0" standalone="yes"?>
+<!-- Generated by BEAUTi v1.5beta4                                           -->
+<!--       by Alexei J. Drummond and Andrew Rambaut                          -->
+<!--       Department of Computer Science, University of Auckland and        -->
+<!--       Institute of Evolutionary Biology, University of Edinburgh        -->
+<!--       http://beast.bio.ed.ac.uk/                                        -->
+<beast>
+	
+	<!-- The list of taxa analyse (can also include dates/ages).                 -->
+	<!-- ntax=29                                                                 -->
+	<taxa id="taxa">
+		<taxon id="Xenopus_laevis"/>
+		<taxon id="Tenebrio_molitor"/>
+		<taxon id="Strongylocentrotus_purpuratus"/>
+		<taxon id="Scypha_ciliata"/>
+		<taxon id="Saccoglossus_kowalevskii"/>
+		<taxon id="Saccharomyces_cerevisiae"/>
+		<taxon id="Priapulus_caudatus"/>
+		<taxon id="Placopecten_magellanicus"/>
+		<taxon id="Pellioditis_typica"/>
+		<taxon id="Opisthorchis_viverrini"/>
+		<taxon id="Nematodirus_battus"/>
+		<taxon id="Mnemiopsis_leidyi"/>
+		<taxon id="Limicolaria_kambeul"/>
+		<taxon id="Lepidodermella_squamata"/>
+		<taxon id="Lanice_conchilega"/>
+		<taxon id="Homo_sapiens"/>
+		<taxon id="Haemonchus_placei"/>
+		<taxon id="Eurypelma_californica"/>
+		<taxon id="Eisenia_foetida"/>
+		<taxon id="Caenorhabditis_elegans"/>
+		<taxon id="Artemia_salina"/>
+		<taxon id="Anthopleura_kurogane"/>
+		<taxon id="Anemonia_sulcata"/>
+		<taxon id="Acanthopleura_japonica"/>
+		<taxon id="Moniliformis_moniliformis"/>
+		<taxon id="Centrorhynchus_conspectus"/>
+		<taxon id="Neoechinorhynchus_pseudemydis"/>
+		<taxon id="Philodina_acuticornis"/>
+		<taxon id="Brachionus_plicatilis"/>
+	</taxa>
+	
+	<!-- The sequence alignment (each sequence refers to a taxon above).         -->
+	<!-- ntax=29 nchar=2520                                                      -->
+	<alignment id="alignment" dataType="nucleotide">
+		<sequence>
+			<taxon idref="Xenopus_laevis"/>
+			AAAGATTAAGCCATGCA-CGTGTA-AGTACGC--ACG--------GCCGGT-AC-----------AG-T-G-AAACTGCGAA-TGGCTCATTAAAT-CAGTTAT--GGTTCCTTTGATCG-CTCC----------------ATCT-GT-TACTTGG-ATAACTGTGGTAAT-TCTAGAGCTAATACATGCCG----ACGA-GCGCTG-ACCC----CCA-------GGGA--TGCGT-GCATTTATCAGACCA----AAACC-AATCCGGGGC-------------CCCCGC----------------------------------GCCCCGG----CCG-CTTT-GGT-GA-CTCTAGATAACCTCGG-G--CCGA-T-CGCA--CGTC--CCCGT-GACGGCG-ACG-ATACATTC--GGATGTCTG-CCCTATC-AACTTTC-GATGGTACTTT--CTGCGCCTACCATGGT-GACCACGGGTAAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Tenebrio_molitor"/>
+			AAAGATTAAGCCATGCA-TGTCTC-AGTACAA--GCC---------GAATT-AA-----------GG-T-G-AAACCGCGAA-AGGCTCATTAAAT-CAGTTAT--GGTTCCTTAGATCG-TACC----------------CACA-TT-TACTTGG-ATAACTGTGGTAAT-TCTAGAGCTAATACATGCAA---ACAGA-GCTCCA-ACCG---GAAA-------CGGA-AGGAGC-GCTTTTATTAGATCA----AAACC-AATCGGTGGCGG--------------TCT--------------------------------CCGTCATCG--T-ACA-ACTT-GGT-GA-CTCTGAATAACTTTAC-G--CTGA-T-CGCA--CGGT--CTTGC-ACCGGCG-ACG-CATCTTTC--AAATGTCTG-CCTTATC-AACTGTC-GATGGTAGGTT--CTGCGCCTACCATGGT-TGTAACGGGTAAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Strongylocentrotus_purpuratus"/>
+			AAAGATTAAGCCATGCA-TGTGTT-AGTACAA--GCT---------TGTAT--CA----------AG-C-G-AAACTGCGGA-TGGCTCATTAAAT-CAGTCAT--GGTTCCTTGGAACG-AGTT------------------GC-CC-TACATGG-ATAACTGTGGTAAT-TCTAGAGCTAATACATGCTA----CCAA-GCGCCG-ACC----TCTT--------GGA-AGGCGT-GCTTTTATTAGGAACAA--AGACC-AAGC---------------------CTAG-------------------------------------CCCG--C-TTT-CGTT-GGT-GAACTCTGGATAACTTAG-----CAGA-T-CGCA--CGGT-CATCGC-ACCGGCG-ACAGAAACCATC--AAACGTCTG-CCCTATC-AACTTTC-GATGGTACGTT--ATGCGCCTACCATGGT-CGTAACGGGTAAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Scypha_ciliata"/>
+			AAAGATTAAGCCATGCA-TGTCTA-AGTATAA--GCG-------TTCTTAT-AC-----------TG-T-G-AAACTGCGAA-TGGCTCATTAAAT-CAGTTAT--AGTTTATTTGATGT-TGAC------------------TT-AC-TACTTGG-ATAACCGTGGTAAT-TCTAGAGCTAATACATGCGT----TAAA-GTCCTG-ACC---TCTCGG-------GGA-AGGGAT-GTATTTATTAGATCCA---AAACC-GATGCAGTC----------------GAAA-------------------------------------GGCTGG--TT---ATT-GGT-GA-TTCATGATAACTGAA-----CGG?-T-CGCA--TGGT--CTTGC-GCCGGCG-ATG-ACTCATAC--AAATATCTG-CCCTATC-AACTTTC-GATGGTAAGGT--AGTGGCTTACCATGGT-TGCAACGGGTAAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Saccoglossus_kowalevskii"/>
+			AAAGATTAAGCCATGCA-TGTCTA-AGTA-CGA-GCC---------TCGGT-ACAC---------GG-T-G-AAACTGCGAA-TGGCTCATTAAAT-CAGTTAT--GGTTCCTTTGATCG-TTAC------------------CC-CT-TACTTGG-ATAACTGTGGCAAT-TCTAGAGCTAATACATGCCT--ACCTCG-GCGCTG-ACC---TCGCG--------GGA--TGC-T-GCTTTTATTAGGACCA---AGACC-GACCCGGTGTCCTGCCTCCT-----TCGC--------------------------GGGTGGTGGGCCCGG----TCC-TCCT-GGC-GAACTCTGGATAACTTGG-----CGGA-T-CG-A--CGGC-CTCTGC-G--GGCG-ACG--AACTTTC--GAGTGTCTG-CCCTATC-AACTTTC-GACGGTACGTT--ATGCGCCTACCGTGGT-GGCAACGGGTAAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Saccharomyces_cerevisiae"/>
+			AAAGATTAAGCCATGCA-TGTCTA-AGTA-TAA-GCA--------ATTTAT-AC-----------AG-T-G-AAACTGCGAA-TGGCTCATTAAAT-CAGTTAT--CGTTTATTTGATAG-TTCC-----------------TTT-AC-TACATGGTATAACCGTGGTAAT-TCTAGAGCTAATACATGCTT-----AAA-ATCTCG-ACC----CTTT--------GGA-AGAGAT-GTATTTATTAGATAAA---AAATC-AATGTC-------------------TTC----------------------------------------GGAC---T--CTTT-GAT-GA-TTCATAATAACTTTT-----CGAA-T-CGCA--TGGC--CTTGT-GCTGGCG-ATG-GTTCATTC--AAATTTCTG-CCCTATC-AACTTTC-GATGGTAGGAT--AGTGGCCTACCATGGT-TTCAACGGGTAAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Priapulus_caudatus"/>
+			AAAGATTAAGCCATGCA-TGTCTA-AGTA-CAG-ACG---------GATAC-AA-----------AG-T-G-AAACCGCGAA-TGGCTCATTAAAT-CAGTTAT--GGTTCCTTAGATCT-TACT------------------AT-CC-TACTTGG-ATAACTGTGGTAAT-TCTAGAGCTAATACATGCAA----TCAG-GCTCCG-ACC----TTACG-------GGA--CGAGC-GCTTTTATTAGACCA-----AACC-AATCGGGT-----------------TTCG------------------------------------GCCCG---TTC--TTTT-GGT-GA-CTCTGGATAACCTTGC-G--CTGA-T-CGCA--CGGT--CTCGC-ACCGGCG-ACG-TATCTTTC--AAATGTCTG-CCTTATC-AACTTTC-GATGGTAGATT--ATGTGCCTACCATGGT-CGTAACGGGTAAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Placopecten_magellanicus"/>
+			AAAGATTAAGCCATGCA-TGTCTA-AGTACAT--ACT---------TTTTG-AT-----------GG-T-G-AAACCGCGAA-TGGCTCATTAAAT-CAGTTAT--GGTTCCTTAGATCG-TACG------------------AT-CC-TACTTGG-ATAACTGTGGCAAT-TCTAGAGCTAATACATGCAA----AAAG-GCACCG-ACT-----CAC--------GGA--GGTGC-GATTTTATCAGTCCA----AAACC-AATCGGTC-----------------GCAA------------------------------------GGCCG---TCA--CTCT-GGT-GA-ATCTGGATAACTTTGT-G--CTGA-T-CGCA--CGGC-CCTAGT-GCCGGCG-ACG-TATCTTTC--AAATGTCTG-ACCTATC-AACTTTC-GATGGTACGTG--CTATGCCTACCATGGT-TGTAACGGGTAAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Pellioditis_typica"/>
+			?????????????????-??????--?????---?--------------??-??--------------??G-AAACTGCGAA-CGGCTCATTAGAG-C--TTAT-ACTAAGCTAGCA-CC-----------------------TG-CC-TTTTAGG-ATATCTTCGACAAA-T-TGAAGCTAATACATGCAA----CCAT-GGCTCC--T------TCG---------G---GGGTC-GCA-ATATTAGAAC------TACC-AGT----------------------------------------------------------------TTA---CTG--GATA-GTT-GA-CTTTAATTATCGTAGA-AA-TCGG-C-AGCG--TGAG--CTC--------CG-ATG-GGTGCAAG--TTATGTACG-CCCTATC-ACCCA---GCAGGCTGTTT--AACCGACAGCCAGGGG-TATAACGGGTAAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Opisthorchis_viverrini"/>
+			AGAGATTAAGCCATGCA-TGTCTA-AGTACAA--ACC---------TTCAA-AC-----------GG-T-G-AAACCGCGAA-TGGCTCATTAAAT-CAGCTAT--GGTTCCTTGGATCG-TACA-------------------T-AC-TACATGG-ATAACTGTATTAAT-TCTAGAGCTAATACATGCCA----CTAT-GCCCTG-ACCC---GCAA-------GGGA-ACGGGT-GGATTTATTAGAACA----GAACC-AACCGGCGGTGAC------------TTCGGTT----------------------------GCCGTCGTTGCA-TTC---TGT-GAT-GA-CTCTGGATAACTTTA-----CTGA-T-CGCAGTCGGC--CTTGT-GTCGGCG-ACG-G-TCTTTC--AAATGTCTG-CCCTATC-AATTTTC-GATGGTAGGTG--ACCTGCCTACCATGGT-GATAACGGGTAAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Nematodirus_battus"/>
+			AAAGATTAAGCCATGCA-TGTCG--AGTT-CA--TCT-----------TTG-AG-----------A----G-AAACTGCGAA-CGGCTCATTAGAG-CAGATGT--CATTTATTCGGAAA-----------------------AT-CC-TTTTTGG-ATAACTGCGGCAAT-TCTGGAGCTAATACATGCGT----TTAG-GCCCTG-AC-----TTTT---------GA-AAGGGT-GCAATTATTAGAGCA-----AATC-AATCTCC------------------TTCG-------------------------------------GGTG----CT--GTTT-GCT-GA-CTCTGAATAATGCAG-----CATA-T-CGG---CGG---CTTGA--CCGCTG-ATA-ATCCGAAA--AAGTGTCTG-CCCTATC-AACCT---GATGGTAGTCT--ATTAGTCTACCATGGT-TATTACGGGTAAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Mnemiopsis_leidyi"/>
+			AAAGATTAAGCCATGCA-TGTCTA-AGTA-TAA-ACT---------TTTAT-AC-----------TG-T-G-AAACTGCGAA-TGGCTCATTA?AT-CAGTTAT--CGTCTATTTGATTG-TGCC-----------------CTT-AC-TACATGG-ATAACCGTAGTAAT-TCTAGAGCTAATACATGCGA-----AAA-GTCCCG-ACT-----TCT--------GGA-AGGGAT-GTATTTATTAGATTAA---AAACC-AATGCGTT-----------------TAAC-------------------------------------GACGC---TT---TTC-GGT-GA-TTCATAATAACTGTT-----?GAA-T-CGCA--TGGC-CCTCGT-GCCGGCG-ATG-TTTCATTC--GAGTTTCTG-CCCTATC-AACTTTC-GATGGTAAGGT--ATTGGCTTACCATGGT-GACAACGGGTAAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Limicolaria_kambeul"/>
+			AAAGATTAAGCCATGCA-TGTCTA-AGTT-CAC-ACT---------GTCTC-AC-----------GG-T-G-AAACCGCGAA-TGGCTCATTAAAT-CAGTCGA--GGTTCCTTAGATGA-CACG------------------AT-CC-TACTTGG-ATAACTGTGGCAAT-TCTAGAGCTAATACATGCTT---ACCAA-GCTCCG-ACC----CTCGC-------GGA-AAGAGC-GCTTTTATTAGTTCA----AAACC-AATCGTCGTTGCCC----------TTCAGC------------------------------GGGCGCGGCGT--CC---AACT-GGT-GA-CTCTGGATAACTTTGT-G--CTGA-T-CGCA--TGGCCTTCTGT-GCCGGCG-ACG-CATCTTTC--AAATGTCTG-CCCTATC-AAATGTC-GATGGTACGTG--ACATGCCTACCATGTT-TGTAACGGGTAAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Lepidodermella_squamata"/>
+			AAAGATTAAGCCATGCA-TGTCTA-AGTA-CAC-ACT---------ACGGC-AA-----------AG-T-G-AAACTGCGAA-CGGCTCATTAAAT-CAGTTAT--GGTTTATTAGATCG-TGC-------------------CT-AT-CACGTGG-ATAACTGTGGTAAT-TCTAGAGCTAATACATGCAA-----CTA-GCCCTG-ACT-----TAC--------GGA--GGGGC-GCTTTTATTAGATCA----AAATC-AATCGGC------------------TTCG-------------------------------------GCCG---TTT--TTGT-GAT-GA-CTCTGGATAACTTT-T-G--CCGA-C-CGCA--TGGC--CTTGG-CCTGGCG-GCG-TATCTTTC--AAATGTCTG-CCCTATC-AACTTTC-GATGGTAGGTG--ACATGCCTACCATGGT-TGTAACGGGTAAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Lanice_conchilega"/>
+			TAAGATTAAGCCATGCA-TGTCTA-AGTA-CGA-ACT---------CTAAGCAC-----------AG-T-G-AAACCGCGAA-TGGCTCATTAAAC-CAGTTAA--TATTTCTTAGATCG-TCCG------------------AT-CC-TACTTGG-ATAACTGTGGTAAT-TCTAGAGCTAATACATGCAA----CAAA-GCCCCG-A?C?---C?CGT------CGGG-AGGGGC-GCTTTTATTAGATCA----AAACC-AGACGG??G----------------TTCGC----------------------------------CTCTGGT--CGG--CTTT-GGT-GA-CTCTGAGTAACTTATT-G--CGGA-T-CGCA--TGGC--CTCGT-GCCGGCG-ACG-TATCTTTG--AAGTGTCTG-CCCTATC-AACTATC-GTATGTGAGCG--CCTTGCCCACATAGGT-TATAACGGGTAAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Homo_sapiens"/>
+			AAAGATTAAGCCATGCA-TGTCTA-AGTACGC--ACG--------GCCGGT-AC-----------AG-T-G-AAACTGCGAA-TGGCTCATTAAAT-CAGTTAT--GGTTCCTTTGGTCG-CTCGCT-------------CCTCT-CC-CACTTGG-ATAACTGTGGTAAT-TCTAGAGCTAATACATGCCG----ACGG-GCGCTG-ACCCCC-TTCGC--GGGGGGGA--TGCGT-GCATTTATCAGATCA----AAACC-AACCCGGTCAGCCCCTCTCCGGC--CCCG----------------------GCCGGGGGGCGGGCGCCGG----CGG-CTTT-GGT-GA-CTCTAGATAACCTCGG-G--CCGA-T-CGCA--CGCC-CCCCGT-GGCGGCG-ACG-ACCCATTC--GAACGTCTG-CCCTATC-AACTTTC-GATGGTAGTCG--CCGTGCCTACCATGGT-GACCACGGGTGAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Haemonchus_placei"/>
+			AAAGATTAAGCCATGCA-TGTCG--AGTT-CA--TCT-----------TTG-A------------AG-A-G-AAACTGCGAA-CGGCTCATTAGAG-CAGATGT--CATTTATTCGGAAC-GT-----------------------CC--TTTTGG-ATAACTGCGGTAAT-TCTGGAGCTAATACATGCAA----ATAA-ACCCTG-AC-----TTTT---------GA-AAGGGT-GCAATTATTAGAGCA-----AATC-AATCACT------------------TTCG-------------------------------------GGTG----CA--GTTT-GCT-GA-CTCTGAATAACGCAG-----CATA-T-CGG---CGG---CTTGT--TCGCCG-ATA-TTCCGAAA--AAGTGTCTG-CCCTATC-AACCT---GATGGTAGTCT--ATTAGTCTACCATGGT-TATTACGGGTAAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eurypelma_californica"/>
+			AAAGATTAAGCCATGCA-TGTCTA-AGTACAT--GCC---------TCCTT-AA-----------GG-C-G-AAACCGCGAA-TGGCTCATTAAAT-CAGTTAT--GGTTCCTTAGATCG-TACC------------------TT-AC-TACTTGG-ATAACTGTGGTAAT-TCTAGAGCTAATACATGCAT----CAGA-GCTCCG-ACCC----TCTG------GGGA--CGAGC-GCTTTTATTAGACCA----AAACC-AATCGGA-----------------CTCGT-------------------------------------TCCGT---ATC-CCAT-GGT-GA-CTCTGTATAACTTTGG-G--CTGA-T-CGCA--CGGG--CTTGT-CCCGGCG-ACG-CATCTTTC--AAGTGTCTG-CCTTATC-AACTGTC-GATGGTAGGCTT-ATGCGCCTACCATGGT-C-TAACGGGTAAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eisenia_foetida"/>
+			AAAGATTAAGCCATGCA-TGTCTA-AGCA-CAA-ACC---------TTTAC-AC-----------GG-T-G-AAGCTGCGAA-TGGCTCATTAGGC-CACCCAT--GATTTCTTAGATCG-TACA------------------AT-CC-TACTTGG-ATAACTGCGGTAAT-TCTGGAGCTAATACATGCCA----CAAA-GCTCCG-ACCC---TTATG-------GGA-AAGAGC-GCGTTTATTAGGTCA----AAACC-AATCGGGTC----------------CTCGC----------------------------------GGCCCGT--AA---CTCT-GAT-GA-CTCTGGATAACTTCGA-G--CTGA-T-CGCA--TGGC--CTCGT-GCCGGCG-ACG-TATCTTTC--AAGTGTGTG-CCCTATC-AACTTTC-GATGGTACGTG--ATATGCCTACCATGGT-AGTAACGGGTAAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Caenorhabditis_elegans"/>
+			AAAGATTAAGCCATGCA-TGCTTT---GATT----CA------------TC-AA--------------T-G-AAATT-GCGTACGGCTCATTAGAG-CAGATAT--CACCTTATCCGGG--ATCC-----------------GGATCCTCATATGG-ATAACTGCGGAAAT-ACTGGAGCTAATACATGCAA-----CTA-TACCCC-AAC-----GCAAG-------G--CGGGGT-GCAATTATTAGAACA-----GACC-AAACGTT------------------TTCG--------------------------------------GACG----TT-GTTT-GTT-GA-CTCTGAATAAAGCAG-----TTTA-C-TGT---CAGT---TTCG-ACTGACT-CTA-TCCGGAAA--GGGTGTCTG-CCCTTTC-AACTA---GATGGTAGTTT--ATTGGACTACCATGGT-TGTTACGGGTAAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Artemia_salina"/>
+			AAAGATTAAGCCATGCA-TGTCTA-AGTACAA--GCC---------CCCAG-TG-----------GG-C-G-AAACCGCGAA-TGGCTCAATAAAT-CAGTTAT--GGTTCCTTAGATCG-TACT----------------ATAT-CC-TACTTGG-ATAACTGTGGTAAT-TCTAGAGCTAATACATGCAC----AATA-GCCCCA-ACT----TCAC--------GGA-AGGGGT-GCTTTTATTAGATCA----AGACC-AATCGGG----------------GCTTCGG------------------------------------CTCG-----TC-TCTT-GGT-GA-CTCTGAATAACTATAG----CCGA-T-CGCA--CGGT--CTCGC-ACCGGCG-ACG-TGTCTTTC--AAATGTCTG-CCTTATC-AACTTTC-GATGGTAGGCT--ATGCGCCTACCATGGT-TGCAACGGGTAAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Anthopleura_kurogane"/>
+			AAAGATTAAGCCATGCA-TGTCTA-AGTATAA--GCA---------CTTGT-AC-----------TG-T-G-AAACTGCGAA-TGGCTCATTAAAT-CAGTTAT--CGTTTATTTGATTG-TACG-----------------TTT-AC-TACTTGG-ATAACCGTGGTAAT-TCTAGAGCTAATACATGCGA-----AAA-GTCCCG-ACT-----TCT--------GGA-AGGGAT-GTATTTATTAGATTCA---AAACC-AATGCGGGT----------------TCC-------------------------------------GCCCGG---TG--TGTT-GGT-GA-TTCATAGTAACTGTT-----CGAA-T-CGCA--GGGC--CTTGGCGCTGGCGGATG-TTTCATTC--AAATTTCTG-CCCTATC-AACTGTC-GATGGTAAGGT--ATTGGCTTACCATGGT-TACAACGGGTGAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Anemonia_sulcata"/>
+			AAAGATTAAGCCATGCA-TGTCTA-AGTATAA--GCA---------CTTGT-AC-----------TG-T-G-AAACTGCGAA-TGGCTCATTAAAT-CAGTTAT--CGTTTATTTGATTG-TACG-----------------TTT-AC-TACTTGG-ATAACCGTGGTAAT-TCTAGAGCTAATACATGCGA-----AGA-GTCCCG-ACT-----TCT--------GGA-AGGGAT-GTATTTATTAGATTCA---AAACC-AATGCGGGT----------------TCT-------------------------------------GCCCGG---TG--CTTT-GGT-GA-TTCATAGTAACTGAT-----CGAA-T-CGCA--TGGC--CTTGC-GCTGGCG-ATG-TTTCATTC--AAATTTCTG-CCCTATC-AACTGTC-GATGGTAAGGT--GTTGGCTTACCATGGT-TACAACGGGTGAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Acanthopleura_japonica"/>
+			AAAGATTAAGCCATGCA-TGTCTA-AGTACAG--ACT---------TTCAC-AT-----------AG-T-G-AAACCGCAAA-TGGCTCATTAAAT-CAGTTAT--GATTTCTTAGATCG-TACA------------------CT-CC-TACTTGG-ATAACTGTGGTAAT-TCTAGAGCTAATACATGACG----TTCA-GCTCCG-ACCTT---TTTGC----AGGGA--AGAGC-GCTTTTATTAGATCA----AGATC-AATCGGGC-----------------CTCG------------------------------------GCCCGT--CC---TGTT-GGT-GA-TTCTGAATAACTTTGT-G--CTGA-T-CGCA--TGGC--CACGC-GCCGGCG-ACG-TATCTTTC--AAGTGTCTG-CCCTATC-AACTTTC-GATGGTACGTG--ATATGCCTACCATGGT-TGTAACGGGTAAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Moniliformis_moniliformis"/>
+			AAAGATTAAGCCATGCA-TGCGTA-AGTACAT--ACT----------TTTT-ATG----------GT-G-T-AAACCGCGAA-TGGCTCATTACAT-CAGTTGT--GGTTCATTAGATCA-TATG---------------------TT-TAAATGG-ATAACTGTGGCAAA-TCTAGAGCTAATACATGTTT----ACAA-GCTCCG-ACT-----TCT--------GGA-AAGAGC-GCTTTTGTTAGATCA-----AACC-AATGATTTC----------------ATCC-----------------------------------GAAATCA--CT---TAAT-GCT-GA-GTCTGAATAAATTTG-----CAGA-T-TGCA-GCGGT-CTTCGT-ACCGGCG-ACG-TATCTTTC--AAGTGTCTG-CCCTATC-AACTGGC-GATGGTAGTTT--ATGTGCCTACCATGGT-TGTAACGGGTAAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Centrorhynchus_conspectus"/>
+			------------ATGCA-TGCGTA-AGTGAAT--ACT----------AGCA-AC-----------GG-T-GAAAACCGCGAA-TGGCTCATTAAAT-CAGTTGC--ATTTTACGGTAACT-TGCAG-----------------------TTCGTGG-ATAACTGTGGAAAA-CCTAGAGCTAATACATGCAC-----AAA-GTCCTG-ACT-----TC---------GGC-AGGGAC-GCATTTATCAGATCA----AAGCC-AACTTTTCC---------------GGT-------------------------------------GAACAGCCGGT---TAAT-GAT-GA-CTCTGGGTAATTATT-----TTGA-T-CGCA-TTGCT-ACGTGA-ACAGGCG-ACG-GTGACTTC--AAACGCCTG-ACCTATC-AACTTGT-GTTGGCAGTTG--ATGTTACTACCCCGGT-TGTTACGGGTGAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Neoechinorhynchus_pseudemydis"/>
+			------------ATGCA-TGCGTA-AGTGCAT--ACT----------TTAT-AT-----------GG-T-TAAAACCGCGAA-TGGCTCATTAAAT-AAGTCTT--GGTTTATTAGATCA-TGCGG--------------------AT-CATATGG-ATAACTGTGGAAAA-TCTAGAGCTAATACATGCCA-----CGA-ATGCTT-CGT-----CTT--------ACGAAGAAGT-GCTTTTATTAGATCA----AAGCC-AATGACTTC---------------CTTC------------------------------------GGGT?GTCAAACG-TTGT-GCT-GA-TTCTGAGTAAAGTAA--G--CTGA-T-TGCA-TTGCC-GTTTAG-GCAGGCG-ACG-TGTCTTTC--AAGTGTCTT-ACCTATC-AACTATC-GTTGGTAGTTG--ATATGACTACCATGGT-AATAACGGGTAAC [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Philodina_acuticornis"/>
+			????????????ATGCA-TGTCTA-AGTATGA--ACT---------GGTTT-AA-----------GG-T-G-AAACTGCGTA-CGGCTCATTACAT-CAGCTATA-ACTTTCTTTGATCA-TAA-------------------AT-TC-TAAATGGAATAACCGAGGAAAA-GCCTGGGCTAATACATGCG------AAA-ATTCCG-GTA-----GCA--------ATATCGGAAT-GCTTTTATTAGATCA----AAACC-TTCTAGTTCT-------------TTAACC-----------------------------------GGAACTG--TT---TGTT-GGT-GA-CTCTAAATAACTTTGT-G--TTGA-T-CGTA--TGAC-CTTTGT-GTCGACG-ACA-TATCTTTC--AAGTGTCTG-ACTTATC-AACTTTA-GACGGTACATT--ATATGTCTACCGTGGT-TGTAACGAGTA-C [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Brachionus_plicatilis"/>
+			????????????ATGCA-TGTCTA-AGTA-CAT-ACC---------TTAGC-AC-----------GG-T-G-AAACCGCGAA-TGGCTCATTAAAT-CAGTTAT--GGTTCCTTAGATCG-TTC-------------------AT-AC-TACATGG-ATAACTGTGGTAAT-TCTAGAGCTAATACATGCAA-----AAA-GCTCCG-ACC-----GTATG------GGA--AGAGC-GCTTTTATTAGACCA----AAACC-AATGGGGTC-----------------GCAA----------------------------------GATCCC---TTT--GTAT-GGT-GA-CTCTGGATAACTTTGT-G--CTGA-T-CGCA--TGGC--CTAGA-GCCGGCG-ACG-TATCTTTC--AAGTGTCTG-CCCTATC-AACTTTC-GATGGTAAGCG--ATTTGCCTACCATGGT-TGTAACGGGTAAC [...]
+		</sequence>
+	</alignment>
+
+	<!-- The unique patterns for all positions                                   -->
+	<!-- npatterns=69                                                            -->
+	<patterns id="patterns" from="1">
+		<alignment idref="alignment"/>
+	</patterns>
+
+	<!-- This is a simple constant population size coalescent model              -->
+	<!-- that is used to generate an initial tree for the chain.                 -->
+	<constantSize id="initialDemo" units="substitutions">
+		<populationSize>
+			<parameter id="initialDemo.popSize" value="0.0001"/>
+		</populationSize>
+	</constantSize>
+
+	<!-- Generate a random starting tree under the coalescent process            -->
+	<coalescentTree id="startingTree">
+		<taxa idref="taxa"/>
+		<constantSize idref="initialDemo"/>
+	</coalescentTree>
+
+	<treeModel id="treeModel">
+		<coalescentTree idref="startingTree"/>
+		<rootHeight>
+			<parameter id="treeModel.rootHeight"/>
+		</rootHeight>
+		<nodeHeights internalNodes="true">
+			<parameter id="treeModel.internalNodeHeights"/>
+		</nodeHeights>
+		<nodeHeights internalNodes="true" rootNode="true">
+			<parameter id="treeModel.allInternalNodeHeights"/>
+		</nodeHeights>
+	</treeModel>
+
+	<!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+	<hkyModel id="hky">
+		<frequencies>
+			<frequencyModel dataType="nucleotide">
+				<alignment idref="alignment"/>
+				<frequencies>
+					<parameter id="hky.frequencies" dimension="4"/>
+				</frequencies>
+			</frequencyModel>
+		</frequencies>
+		<kappa>
+			<parameter id="hky.kappa" value="1.0" lower="0.0"/>
+		</kappa>
+	</hkyModel>
+
+	<!-- site model                                                              -->
+	<siteModel id="siteModel">
+		<substitutionModel>
+			<hkyModel idref="hky"/>
+		</substitutionModel>
+        <gammaShape gammaCategories="4">
+              <parameter id="siteModel.shape" value="0.5" lower="0.0" upper="1000.0"/>
+        </gammaShape>
+        <proportionInvariant>
+                <parameter id="siteModel.pInv" value="0.5" lower="0.0" upper="1.0"/>
+        </proportionInvariant>
+		<mutationRate>
+			<parameter id="siteModel.mu" value="1.0" lower="0.0"/>
+		</mutationRate>
+	</siteModel>
+
+	<treeLikelihood id="treeLikelihood">
+		<patterns idref="patterns"/>
+		<treeModel idref="treeModel"/>
+		<siteModel idref="siteModel"/>
+	</treeLikelihood>
+
+	<operators id="operators">
+        <!-- proportions invariant -->
+        <scaleOperator scaleFactor="0.75" weight="1">
+                <parameter idref="siteModel.pInv"/>
+        </scaleOperator>
+        <!-- gamma shape parameter -->
+        <scaleOperator scaleFactor="0.75" weight="1">
+                <parameter idref="siteModel.pInv"/>
+        </scaleOperator>
+        <!-- standard operators -->
+		<scaleOperator scaleFactor="0.5" weight="1">
+			<parameter idref="hky.kappa"/>
+		</scaleOperator>
+		<scaleOperator scaleFactor="0.5" weight="1">
+			<parameter idref="treeModel.rootHeight"/>
+		</scaleOperator>
+		<uniformOperator weight="10">
+			<parameter idref="treeModel.internalNodeHeights"/>
+		</uniformOperator>
+		<subtreeSlide weight="5" gaussian="true" size="1.0">
+			<treeModel idref="treeModel"/>
+		</subtreeSlide>
+		<narrowExchange weight="1">
+			<treeModel idref="treeModel"/>
+		</narrowExchange>
+		<wideExchange weight="1">
+			<treeModel idref="treeModel"/>
+		</wideExchange>
+		<wilsonBalding weight="1">
+			<treeModel idref="treeModel"/>
+		</wilsonBalding>
+	</operators>
+
+	<mcmc id="mcmc" chainLength="1000000" autoOptimize="true" preBurnin="0">
+		<compoundLikelihood id="likelihood">
+			<treeLikelihood idref="treeLikelihood"/>
+		</compoundLikelihood>
+		<operators idref="operators"/>
+		<log logEvery="10000">
+			<column label="Likelihood" dp="4" width="12">
+				<compoundLikelihood idref="likelihood"/>
+			</column>
+			<column label="Root Height" sf="6" width="12">
+				<parameter idref="treeModel.rootHeight"/>
+			</column>
+			<column label="Kappa" sf="6" width="12">
+				<parameter idref="hky.kappa"/>
+			</column>
+		</log>
+		<log logEvery="10000" fileName="testMCMC.log">
+			<compoundLikelihood idref="likelihood"/>
+			<parameter idref="treeModel.rootHeight"/>
+			<parameter idref="hky.kappa"/>
+		</log>
+		<logTree  logEvery="10000" nexusFormat="true" fileName="testMCMC.trees">
+			<treeModel idref="treeModel"/>
+		</logTree>
+	</mcmc>
+</beast>
diff --git a/examples/benchmark/1/testHKY520.xml b/examples/benchmark/1/testHKY520.xml
new file mode 100644
index 0000000..00eef6b
--- /dev/null
+++ b/examples/benchmark/1/testHKY520.xml
@@ -0,0 +1,482 @@
+<?xml version="1.0" standalone="yes"?>
+<!-- Generated by BEAUTi v1.5beta4                                           -->
+<!--       by Alexei J. Drummond and Andrew Rambaut                          -->
+<!--       Department of Computer Science, University of Auckland and        -->
+<!--       Institute of Evolutionary Biology, University of Edinburgh        -->
+<!--       http://beast.bio.ed.ac.uk/                                        -->
+<beast>
+	
+	<!-- The list of taxa analyse (can also include dates/ages).                 -->
+	<!-- ntax=67                                                                 -->
+	<taxa id="taxa">
+		<taxon id="Albertiniella_polyporicola"/>
+		<taxon id="Cryptendoxyla_hypophloia"/>
+		<taxon id="Cephalotheca_sulfurea"/>
+		<taxon id="Podospora_anserina"/>
+		<taxon id="Chaetomium_elatum"/>
+		<taxon id="Neurospora_crassa"/>
+		<taxon id="Sordaria_fimicola"/>
+		<taxon id="Thielavia_terrestris"/>
+		<taxon id="Aporothielavia_leptoderma"/>
+		<taxon id="Chaetomium_globosum"/>
+		<taxon id="Cercophora_septentrionalis"/>
+		<taxon id="Ophiostoma_stenoceras"/>
+		<taxon id="Sporothrix_schenckii"/>
+		<taxon id="Fragosphaeria_purpurea"/>
+		<taxon id="Ophiostoma_ulmi"/>
+		<taxon id="Pidoplitchkoviella_terricola"/>
+		<taxon id="Daldinia_concentrica"/>
+		<taxon id="Diatrype_disciformis"/>
+		<taxon id="Xylaria_curta"/>
+		<taxon id="Hypoxylon_atroroseum"/>
+		<taxon id="Diaporthe_phaseolorum"/>
+		<taxon id="Leucostoma_persoonii"/>
+		<taxon id="Cryphonectria_parasitica"/>
+		<taxon id="Microascus_trigonosporus"/>
+		<taxon id="Ceratocystis_fimbriata"/>
+		<taxon id="Bulbithecium_hyalosporum"/>
+		<taxon id="Leucosphaerina_indica"/>
+		<taxon id="Nigrosabulum_globosum"/>
+		<taxon id="Hapsidospora_irregularis"/>
+		<taxon id="Emericellopsis_terricola"/>
+		<taxon id="Cordyceps_capitata"/>
+		<taxon id="Claviceps_paspali"/>
+		<taxon id="Epichloe_typhina"/>
+		<taxon id="Hypocrea_schweinitzii"/>
+		<taxon id="Hypomyces_polyporinus"/>
+		<taxon id="Nectria_haematococca"/>
+		<taxon id="Pseudeurotium_zonatum_ATCC62440"/>
+		<taxon id="Pseudeurotium_zonatum_CBS329_36"/>
+		<taxon id="Connersia_rilstonii"/>
+		<taxon id="Leuconeurospora_pulcherrima"/>
+		<taxon id="Pleuroascus_nicholsonii"/>
+		<taxon id="Dothidea_insculpta"/>
+		<taxon id="Aureobasidium_pullulans"/>
+		<taxon id="Blumeria_graminis"/>
+		<taxon id="Sclerotinia_sclerotiorum"/>
+		<taxon id="Cudonia_confusa"/>
+		<taxon id="Spathularia_flavida"/>
+		<taxon id="Peziza_badia"/>
+		<taxon id="Inermisia_aggregata"/>
+		<taxon id="Morchella_esculenta"/>
+		<taxon id="Tuber_rapaeodorum"/>
+		<taxon id="Onygena_equina"/>
+		<taxon id="Blastomyces_dermititidis"/>
+		<taxon id="Penicillium_notatum"/>
+		<taxon id="Eurotium_rubrum"/>
+		<taxon id="Aspergillus_fumigatus"/>
+		<taxon id="Fonsecaea_pedrosoi"/>
+		<taxon id="Phialophora_verrucosa"/>
+		<taxon id="Exophiala_jeanselmei"/>
+		<taxon id="Candida_albicans"/>
+		<taxon id="Saccharomyces_cereviseae"/>
+		<taxon id="Candida_tropicalis"/>
+		<taxon id="Protomyces_inouyei"/>
+		<taxon id="Taphrina_deformans"/>
+		<taxon id="Filobasidiella_neoformans"/>
+		<taxon id="Spongipellis_unicolor"/>
+		<taxon id="Athelia_bombacina"/>
+	</taxa>
+	
+	<!-- The sequence alignment (each sequence refers to a taxon above).         -->
+	<!-- ntax=67 nchar=1098                                                      -->
+	<alignment id="alignment" dataType="nucleotide">
+		<sequence>
+			<taxon idref="Albertiniella_polyporicola"/>
+			ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGCATAAGCAA--TTATACCGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-CCTACATGG-ATACCTGTGGTAATTCTAGAGCTAATACATGCGAAAAAGCCCCAACTTC--GGGAGGGGTGTGTTTATTAGATTAAAAACCAATGCCCCTCGGGGCTCCTT-GGTGATTCATAATAACTTCTCGAATCGCACGGCCTTGTGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTAGGTCTTGGCCAGCCGTGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATCG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Cryptendoxyla_hypophloia"/>
+			???????????????????????CCATGCATGTCTAAGTATAAGCAA--TTATACGGCGAAACTGCGAATGGCTCATTAAATCAG-TAT-GTTTATTTGATAGCACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCAACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCCTCGGGGCTCCTT-GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGCGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCTGACACAGGGAGGTAGTGACAATACATACTGGTACAGGGCTCTTTTGGGTCTTGTAACCG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Cephalotheca_sulfurea"/>
+			????????????????????????????????????????TAAGCAA--TTATACGGCGAAACTGCGAATGGCTCATTAAATCAGTTATTGTTTATTTGATAGCACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCCTCGGGGCTTTCT-GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGCGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACGTCCAAGGAAGGCAGCAGGCGCGCAAATTAACCAATCCCGACTCGGGGAGTTAGTGACAATACATACTGATACAGGGCTCTTTTGGGTCTTGTAATCG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Podospora_anserina"/>
+			ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATATTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCAAAAAA-TCCCGACTTC--GGAAGGGATGTGTTTATTAGATTAAAAACCAATGCCCTCCGGGGCTCACT-GGTGATTCATAATAACCTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCATGGTGACAACGGGTAACGGGGAGTTAGGGCTCGACTCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Chaetomium_elatum"/>
+			?????????????????????????ATGCATGTCTAAGTATAAGCAA--TTATACCGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCTCT-GGTGATTCATAATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTCGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Neurospora_crassa"/>
+			ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTTTAAGCAA--TTAAACCGCGAAACTGCGAATGGCTCATTAAATCAGTTATAGTTTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTC--GGAAGGGGTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTAACT-GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Sordaria_fimicola"/>
+			ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTTTAAGCAA--TTAAACCGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTC--GGAAGGGGTGTATTTATTAGATTAAAAACCAATGCCCTTCGGG?CTTCCT-GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Thielavia_terrestris"/>
+			?????????????????????????ATGCATGTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCTCATTAAATCAGTTATCG?TTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCCTCGGGGCTCTCT-GGTGATTCATAATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTCACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTCGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Aporothielavia_leptoderma"/>
+			ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCTCT-GGTGATTCATAATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGATCTTTCGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Chaetomium_globosum"/>
+			?????????????AAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACCGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATG?CCTTCGGGGCTCTCT-GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAAT?CCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTCGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Cercophora_septentrionalis"/>
+			???????????????????????????????????????????????????????????AAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-GCTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATG?CCTTCGGGGCTCTCT-GGTGATTCATAATAACTTCTCGAAT??CA?GGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTCGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Ophiostoma_stenoceras"/>
+			?????????????????????????ATGCATGTCTAAGTATAAGCAA--TTATACCGCGAAACTGCGAATGGCTCATTAAACCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAA-CCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCCCT-GGTGATTCATAATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Sporothrix_schenckii"/>
+			???????????????????????????????GTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAA-CCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCCCT-GGTGATTCATAATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Fragosphaeria_purpurea"/>
+			???????????????????????????????????????????????????????????AAACTGCGAATGGCTCATTAAATCAGTTATCGTCTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAA-CCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCTCCGGGGCTCCCT-GGTGATTCATAATAACTGCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACGCGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Ophiostoma_ulmi"/>
+			?????????????????????????ATGCATGTCTAAGTATAAGCAA--TTATACGGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGCCCCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAA-CCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCCTCGGGGCTCACT-GGTGATTCATGATAACTTGTCGAATCGCACGGCCTTGCGCCGGCGATGGCTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGATCTGGGCCCGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGGCCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTCGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Pidoplitchkoviella_terricola"/>
+			???????????????????????????????????????????GCAA--TTATACAGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCAACTCA--CGAAGGGGTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCTTT-GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGCAGGGTCTTGGCCTGCCATGGTTACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTCGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Daldinia_concentrica"/>
+			??????????????AAG-TTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACTGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGTTAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTCA--CGGAGGGGTGTATTTATTAGATTAAAAACCAATG?CCTTCGGGGCTCTTT-GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGC?GGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGCAGGGTCTTGGCCTGCCATGGTTACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Diatrype_disciformis"/>
+			?????????????????????????????ATGTCTAAGTATAAGCAA--TTATACCGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTA--CGGAGGGATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCCTT-GGTGATTCATAATAACAACTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGCAGGGTCTTGGCCTGCCATGGTTACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTATCCAATCCCGATTCGGGGAGATAGTGACGATAAATACTGATACAGGGCTCTTTCGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Xylaria_curta"/>
+			???????????????????????CCATGCATGTCTAAGTATAAGCAA--TTATACGGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTCA--CGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCCTCGGGGCTTTCT-GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGCAGGGTCTTGGCCTGCCATGGTTACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Hypoxylon_atroroseum"/>
+			????????????????????????????????????????????????????????????AACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTA--CGGAGGGATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCTCT-GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGAGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGCAGGGTCTTGGCCTGCCATGGTTACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATTCCGATACGGAGAGGTAGTGACGATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Diaporthe_phaseolorum"/>
+			?????????????????????????????????????????????????ATAAACGGCGAAACT???AATGGCTCATTAAATCAGTTATCGTATATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT-GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGC?GGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCC??GGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTCGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Leucostoma_persoonii"/>
+			?????????????????????????ATGCAAGTCTAAGTTTAAGCAC--CTAAACGGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT-GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Cryphonectria_parasitica"/>
+			???????????????????TAAGCCATGCAAGTCTAAGTTTAAGCAC--CTAAACGGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT-GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Microascus_trigonosporus"/>
+			?????????????AAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACCGCGAAACTGCGAATGGCTCATTATATAAGTTATCGTTTATTTGATAGCACGTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTC--GGAAGGGGTGTATTTATTAGATTAAAAGCCAA?GCCCTTCGGGGCTCTGT-GGTGATTCATGATAACTTTTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGCGAGGGTCTTGTCCTCGCATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC?GGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTAGGGTCTTGTAATCG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Ceratocystis_fimbriata"/>
+			????????????????????AAGCCATGCATGTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCTCATTATATAAGTTATCGTTTATTTGATAGCACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATG?CCTTCGGGGCTTTCT-GGTGATTCATGATAACTTCTCGAATCGCATGGCCTTGCGC?GGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGCGAAGGTCTTGTCTTCGCATGGTTACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAGGGAGCCTGAGAAATGGCTACCACTTTTAAGGAAGGCAGCAGGCGCGCAATTTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTATGGGTCTTGTAATCG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Bulbithecium_hyalosporum"/>
+			????????????????????????????????????????????????????????????AACTGCGAATGGCTCATTATATAAGTTATCGTTTATTTGATAGCACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCACAAAA-TCCCGACTCA--CGAAGGGATGTATTTATTAGATACAAAACCAATGCCCTCCGGGGCTCACT-GGTGATTCATGATAACTTCGCGAATCGCACAGCCTTGCGCTGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTATTGGCCAAACATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTATTGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Leucosphaerina_indica"/>
+			????????????????????????????????????????????????????????????AACTGCGAATGGCTCATTATATAAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTC--GGAAGGGGTGTATTTATTAGATTAAAAACCAATG-CCTTCGGGGCTCCTT-GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTATTGGCCAAACATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Nigrosabulum_globosum"/>
+			??????????????????????????????????????????????A--TTATACAGCGAAACTGCGAATGGCTCATTATATAAGTTATCGTTTATTTGATAGCACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAG-TCCCGACTTC--GGAAGGGATGTATTTATTAGATACAAAACCAATG-CCTCCGGGGCTCAAT-GGTGATTCATGATAACTTCGCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGATATGGGCCAAACATGGTGGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTCGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTATTGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Hapsidospora_irregularis"/>
+			??????????????????????????????????????????????A--TTATACAGCGAAACTGCGAATGGCTCATTATATAAGTTATCGTTTATTTGATAGCACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAG-TCCCGACTTC--GGAAGGGATGTATTTATTAGATACAAAACCAATG-CCTCCGGGGCTCAAT-GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTATTGGCCAAACATGGTGGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTCGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTATTGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Emericellopsis_terricola"/>
+			?????????????????????????ATGCATGTCTAAGTATAAGCAA--TTATACGGCGAAACTGCGAATGGCTCATTATATAAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTC--GGAAGGGGTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCCTT-GGTGATTCATGATAACTTCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTATTGGCCAAACATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTCGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTAGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Cordyceps_capitata"/>
+			?????????????????????????ATGCATGTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCTCATTATATAAGTTATCGTTTATTTGATGGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCTCTGGG-CTCTCT-GGTGATTCATGATAACTTCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTAGTGGCCAAACATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Claviceps_paspali"/>
+			?????????????AAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCTCATTATATAAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAA-TCCCGACTCC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCCCGTGGGCTCGCT-GGTGAATCATGATAACTTCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTAGTGGCCAAACATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACCCGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Epichloe_typhina"/>
+			???????????????????????????????????????????????????????????AAACTGCGAATGGCTCATTATATAAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCCCTGGGGCTCTCT-GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTAGTGGCCAAACATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATTCGGGGAGGTAGTGACAATAAATACCGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Hypocrea_schweinitzii"/>
+			?????????????AAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACCGCGAAACTGCGAATGGCTCATTATATAAGTTATCGTTTATTTGATAATACTTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATCCCGCTCGGGGCTCTCT-GGTGAATCATAATAACTAGTCGAATCGACAGGCCTTGTGCCGGCGATGGCTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTATTGGCCAAACATGGTGGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATCG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Hypomyces_polyporinus"/>
+			???????????????????????????????????????????????????????????AAACTGCGAATGGCTCATTATATAAGTTATCGTTTATTTGATAATACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTC--GGAAGGGTTGTATTTATTAGATTAAAAACCAATG-CCTCTGGG-CTCTCT-GGTGAATCATGATAACTAGTCGAATCGACAGGCCTTGTGCCGGCGATGGCTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTATTGGCCAAACATGGTGGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGAGACAATAAATACTGATACAGGGCTCTTTCGGGTCTTGTAATCG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Nectria_haematococca"/>
+			?????????TCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCTCATTATATAAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATG?CCTCCGGGGCTCACT-GGTGATTCATGATAACTCCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTATTGGCCAAACATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTCGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Pseudeurotium_zonatum_ATCC62440"/>
+			ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA-TCTATACAGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGATAATACATGCTAAAAA-CCTCGACTTC--GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTTCGGGGCTCCTT-GGTGATTCATGATAACTTAACGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Pseudeurotium_zonatum_CBS329_36"/>
+			?????????????????????????????????????????????????????????????????CGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCTCGACTTC--GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTTCGGGGCTCCTT-GGTGATTCATGATAACTTAACGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Connersia_rilstonii"/>
+			ATATGCTTGTCTCAAAGATCAAGCCATGCATGTCTAAGTATAAGCAA-TCTATACGGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTC--GGGAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTCCGGGGCTCCTT-GGTGATTCATGATAACTCGACGGATCGCATGGCCTTGTGCCGGCGATGGATCTTTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATATAGGGCTCTTTTGAGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Leuconeurospora_pulcherrima"/>
+			ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA-TCTATACAGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTC--GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCTCTTCGGGGCTCCTT-GGTGATTCATGATAACTTAACGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Pleuroascus_nicholsonii"/>
+			??????????????????????????????????????????????????????????GAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTC--GGAAGGGGTGTATTTATTAGATTAAAAACCAATG-CCTTCGGGGCTCCTT-GGTGATTCATGATAACTTATCGGATCGCATGGCCTTGTGCCGGCGATGGATTCTTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATATAGGGCTCTTTTGAGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Dothidea_insculpta"/>
+			????????????????????????CATGCATGTCTAAGTATAAGCAA--CTATACGGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTC--GGAAGGGGTGTATTTATTAGATAAAAAACCAGCGCCCTTCGGGGCTCCTT-GGTGATTCATAATAACTTAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTATCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTAGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Aureobasidium_pullulans"/>
+			ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--CTATACGGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCAACTTC--GGAAGGGGTGTATTTATTAGATAAAAAACCAACGCCCTTCGGGGCTCCTT-GGTGATTCATAATAACTAAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTATCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Blumeria_graminis"/>
+			????????????????????????????????????????????CAA-TTTATACCGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAG-CCCCGACTTC--GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTCCGGGGCTCCTT-GGTGATTCATAATAACTTAACGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGTATATGGGACTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Sclerotinia_sclerotiorum"/>
+			ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--CTATACTGTGAAACTGCGAAT?GCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCTCGACTTC--GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTTCGGG-CTCCCT-GGTGATTCATAATAACTTAACGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGG?ATTAGGGTTCTATTCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGAGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Cudonia_confusa"/>
+			??????????????????????????????????TAAGTATAAGCAAA-CTATACCGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACTTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTC--GGAAGG-GTGTATTTATTAGATAAAAAACCAATGCCCTTCGG??CTCCCT-GGTGATTCATAATAACTTAACGAATCGCATGGCCTTGCGC-GGTGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCC?GACACGGGGAGGTAGTTACAATAAATACAGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Spathularia_flavida"/>
+			???????????????????????????????GCTTAAGTATAAGCAAA-CTATACCGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACTTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTT--GGAAGGGGTGTATTTATTAGATAAAAAACCAATG?CCTTCGGGGCTCCCT-GGTGATTCATAATAACTTAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Peziza_badia"/>
+			????????????????????????????????????????????????????????????????????????CTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTCACGGAAGGGGTGTATTTATTAGATAAAAAACCAATG-CCTTCGGGCCTCCT--GGTGATTCATGATAACTTAACGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACG-GGAGGTAGTGACAATAAATACTAATACAGGGGTTTTATGCCTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Inermisia_aggregata"/>
+			????????????????????????????????TCTAAGTATAAGCAA-TCTATACAGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACCTCT-GGAAGGGATGTATTTATTAGATAAAAAACCAATG-CCTTCGGG-CTCCCT-GGTGATTCATGATAACTTTACGAATCGCATGGCCTTGTGC-GGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGC-CTTTCGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Morchella_esculenta"/>
+			?????????????????????????????????????????????AA-TATATACAGTGAAACTGCGAATGGCTCATTAAAT??GTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTAA-CGGAGGGGTGTATTTATTAGATAAAAAACCAATG?CCTTCGGG-CTCCTT-GGTGATTCATGATAACTTAACGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Tuber_rapaeodorum"/>
+			?????????????????????????ATGCATGTCTAAGTATAAGCAA-TCTATACAGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTTTGCTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACCCCT-GGAAGGGATGTATTTATTAGATAAAAAACCAATG-GCTTCGGC-CTCCCT-GGTGATTCATGATAACTTAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Onygena_equina"/>
+			?????????TCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA-CTTGTACGGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTTTTCCACATGG-ATACCCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCTCGACTTC--GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTTCGGGGCTCCTT-GGTGATTCATAATAACTTTTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTGGCAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATCCGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTCGGGTCTTGTAATCG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Blastomyces_dermititidis"/>
+			ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAATCTTATACGGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATACCCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCTCGACTTC--GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTTCGGGGCTCCTT-GGTGATTCATAATAACTTATCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTGGCAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTCGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Penicillium_notatum"/>
+			ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAACTTTGTACTGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATACCTGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTCA-GGAAGGGGTGTATTTATTAGATAAAAAACCAACGCCCTTCGGGGCTCCTT-GGTGAATCATAATAACTTAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTGGCAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATACGGGGAGGTAGTGACAATAAATACTGATACGGGGCTCTTTTGGGTCTCGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Eurotium_rubrum"/>
+			????????????????????????CATGCATGTCTAAGTATAAGCAC-TTTATACTGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATACCTGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCTCGACTTC--GGAAGGGGTGTATTTATTAGATAAAAAACCAACGCCCTTCGGGGCTCCTT-GGTGAATCATAATAACTAAGCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTGGCAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACGGGGCTCTTTTGGGTCTCGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Aspergillus_fumigatus"/>
+			ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA-TTTATACGGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATACCTGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCTCGACTTC--GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTTCGGGGCTCCTT-GGTGAATCATAATAACTTAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTGGCAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACGGGGCTCTTTTGGGTCTCGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Fonsecaea_pedrosoi"/>
+			????????????????????????????????TCTAAGTATAGGCAC--TCATACTGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT---TACCTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCAACTTC--GGGAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTCTGGGGCTCCTT-GGTGATTCATAATAACTTAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATTGTAGGATAGAGGCCTACAATGGTCTTAACGGGTAACGGGGAATTAGGGTTCGACTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATGCTAATTCAGCGAGGTAGTGACAATAAATACTGATACGGGGCTCTTTCGGGTCTCGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Phialophora_verrucosa"/>
+			????????????????????????????????????????TAGGCAA--TCATACTGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT---TACCTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTA--GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTCT?GGGCTCCTT-GGTGATTCATAATAACTTAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAATTTTCGATGGTAGAGTAGTGGTCTACCATGATCTTAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATGCTAATTCAGCGAGGTAGTGACAATAAATACTGATACGGGGCTCTTTCGGGTCTCGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Exophiala_jeanselmei"/>
+			???????????????????????????????????????????GCAA--TCATACTGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTTCCTT---TACCTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAC??-CCCCGACTTC--GGGAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTTCGGGGCTCCTT-GGTGATTCATAATAACTTAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCACCTTTCGATTGTAAGATAGAGGCTTACAATGGGAGCAACGGGTAACGGGGAATAAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATACGGGGAGGTAGTGACAATAAATACTGATACGGGGCTCTTTCGGGTCTCGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Candida_albicans"/>
+			ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA-TTTATACAGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAA-TCCCGACTGTTTGGAAGGGATGTATTTATTAGATAAAAAATCAATG-CCTTCGGG-CTCTTT-GATGATTCATAATAACTTTTCGAATCGCATGGCCTTGTGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATAACGATACAGGGCCCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Saccharomyces_cereviseae"/>
+			ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA-TTTATACAGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTTCCTTTACTACATGGTATAACTGTGGTAATTCTAGAGCTAATACATGCTTAAAA-TCTCGACCCTTTGGAAGAGATGTATTTATTAGATAAAAAATCAATG-TCTTCGGA-CTCTTT-GATGATTCATAATAACTTTTCGAATCGCATGGCCTTGTGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCTAATTCAGGGAGGTAGTGACAATAAATAACGATACAGGGCCCATTCGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Candida_tropicalis"/>
+			ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA-TTTATACAGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAA-TCCCGACTGTTTGGAAGGGATGTATTTATTAGATAAAAAATCAATG-TCTTCGGA-CTCTTT-GATGATTCATAATAACTTTTCGAATCGCATGGCCTTGTGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATAACGATACAGGGCCCTTTCGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Protomyces_inouyei"/>
+			?????CTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA-TTTATACAGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCCT-ACTACTTGG-ATACCCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTCT-GGAAGGGATGTATTTATTAGATAAAAAACCAATG--CTTCGGG-CTCCTT-GGTGATTCATAATAACTTTACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGAGGCCTACCATGGTTTTGACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCC-GACACGGGGAGGTAGTGACAATAAATAACAATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Taphrina_deformans"/>
+			??????????CTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACAGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTA-ATTACTTGG-ATACCCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTCT-GGAAGGGATGTATTTATTAGATAAAAAACCAATG-CCTTCGGG-CTCCTT-GGTGATTCATAATAACTTTACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATATTGGCCTACCATGGTTTTGACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCC-GACACGGGGAGGTAGTGACAATAAATAACAATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Filobasidiella_neoformans"/>
+			????GCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAACGAATTCATACTGTGAAACTGCGAATGGCTCATTAAATCAGTTATAGTTTATTTGATGGTATCTT-GCTACATGG-ATAACTGTGGTAATTCTAGAGCTAATACATGCTGAAAAGCCCCGACTTCT-GGAAGGGGTGTATTTATTAGATAAAAAACCAATGGGTTTCGGCCCTCTAT-GGTGAATCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGCTTCATTCAAATATCTGCCCTATCAACTTTCGATGGTAGGATAGAGGCCTACCATGGTATCAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATAACAATACAGGGCTCTTTTGGGCCTTGTAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Spongipellis_unicolor"/>
+			?????????????AAAGATTAAGCCATGCATGTCTAAGTATAAACAAGTTTGTACTGTGAAACTGCGAATGGCTCATTAAATCAGTTATAGTTTATTTGATGGTGCTTT-GCTACATGG-ATAACTGTGGTAATTCTAGAGCTAATACATGCAATCAAGCCCTGACTTCT-GGAAGGGGTGTATTTATTAGATAAAAAACCAACGCGGCTCGCCGCTCCATTGGTGAATCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGCTTCATTCAAATATCTGCCCTATCAACTTTCGATGGTAGGATAGAGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATAACAATATAGGGCTCTTTCGGGTCTT?TAATTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Athelia_bombacina"/>
+			ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAACAAATTTGTACTGTGAAACTGCGAATGGCTCATTAAATCAGTTATAGTTTATTTGATGATACCTT-ACTACATGG-ATAACTGTGGTAATTCTAGAGCTAATACATGCATTAAAGCCCCGACTTCT-GGGAGGGGTGTATTTATTAGATAAAAAACCAACGCGGCTCGCCGCTCCYTTGGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCCGGCGATGCTTCATTCAAATATCTGCCCTATCAACTTTCGATGGTAGGATAGAGGCCTACCATGGTTTCAACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATAACAATATAGGGCTCTTTCGGGTCTTATAATTG [...]
+		</sequence>
+	</alignment>
+
+	<!-- The unique patterns for all positions                                   -->
+	<!-- npatterns=69                                                            -->
+	<patterns id="patterns" from="1">
+		<alignment idref="alignment"/>
+	</patterns>
+
+	<!-- This is a simple constant population size coalescent model              -->
+	<!-- that is used to generate an initial tree for the chain.                 -->
+	<constantSize id="initialDemo" units="substitutions">
+		<populationSize>
+			<parameter id="initialDemo.popSize" value="0.0001"/>
+		</populationSize>
+	</constantSize>
+
+	<!-- Generate a random starting tree under the coalescent process            -->
+	<coalescentTree id="startingTree">
+		<taxa idref="taxa"/>
+		<constantSize idref="initialDemo"/>
+	</coalescentTree>
+
+	<treeModel id="treeModel">
+		<coalescentTree idref="startingTree"/>
+		<rootHeight>
+			<parameter id="treeModel.rootHeight"/>
+		</rootHeight>
+		<nodeHeights internalNodes="true">
+			<parameter id="treeModel.internalNodeHeights"/>
+		</nodeHeights>
+		<nodeHeights internalNodes="true" rootNode="true">
+			<parameter id="treeModel.allInternalNodeHeights"/>
+		</nodeHeights>
+	</treeModel>
+
+	<!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+	<hkyModel id="hky">
+		<frequencies>
+			<frequencyModel dataType="nucleotide">
+				<alignment idref="alignment"/>
+				<frequencies>
+					<parameter id="hky.frequencies" dimension="4"/>
+				</frequencies>
+			</frequencyModel>
+		</frequencies>
+		<kappa>
+			<parameter id="hky.kappa" value="1.0" lower="0.0"/>
+		</kappa>
+	</hkyModel>
+
+	<!-- site model                                                              -->
+	<siteModel id="siteModel">
+		<substitutionModel>
+			<hkyModel idref="hky"/>
+		</substitutionModel>
+        <gammaShape gammaCategories="4">
+              <parameter id="siteModel.shape" value="0.5" lower="0.0" upper="1000.0"/>
+        </gammaShape>
+        <proportionInvariant>
+                <parameter id="siteModel.pInv" value="0.5" lower="0.0" upper="1.0"/>
+        </proportionInvariant>
+		<mutationRate>
+			<parameter id="siteModel.mu" value="1.0" lower="0.0"/>
+		</mutationRate>
+	</siteModel>
+
+	<treeLikelihood id="treeLikelihood">
+		<patterns idref="patterns"/>
+		<treeModel idref="treeModel"/>
+		<siteModel idref="siteModel"/>
+	</treeLikelihood>
+
+	<operators id="operators">
+        <!-- proportions invariant -->
+        <scaleOperator scaleFactor="0.75" weight="1">
+                <parameter idref="siteModel.pInv"/>
+        </scaleOperator>
+        <!-- gamma shape parameter -->
+        <scaleOperator scaleFactor="0.75" weight="1">
+                <parameter idref="siteModel.pInv"/>
+        </scaleOperator>
+        <!-- standard operators -->
+		<scaleOperator scaleFactor="0.5" weight="1">
+			<parameter idref="hky.kappa"/>
+		</scaleOperator>
+		<scaleOperator scaleFactor="0.5" weight="1">
+			<parameter idref="treeModel.rootHeight"/>
+		</scaleOperator>
+		<uniformOperator weight="10">
+			<parameter idref="treeModel.internalNodeHeights"/>
+		</uniformOperator>
+		<subtreeSlide weight="5" gaussian="true" size="1.0">
+			<treeModel idref="treeModel"/>
+		</subtreeSlide>
+		<narrowExchange weight="1">
+			<treeModel idref="treeModel"/>
+		</narrowExchange>
+		<wideExchange weight="1">
+			<treeModel idref="treeModel"/>
+		</wideExchange>
+		<wilsonBalding weight="1">
+			<treeModel idref="treeModel"/>
+		</wilsonBalding>
+	</operators>
+
+	<mcmc id="mcmc" chainLength="1000000" autoOptimize="true" preBurnin="0">
+		<compoundLikelihood id="likelihood">
+			<treeLikelihood idref="treeLikelihood"/>
+		</compoundLikelihood>
+		<operators idref="operators"/>
+		<log logEvery="10000">
+			<column label="Likelihood" dp="4" width="12">
+				<compoundLikelihood idref="likelihood"/>
+			</column>
+			<column label="Root Height" sf="6" width="12">
+				<parameter idref="treeModel.rootHeight"/>
+			</column>
+			<column label="Kappa" sf="6" width="12">
+				<parameter idref="hky.kappa"/>
+			</column>
+		</log>
+		<log logEvery="10000" fileName="testMCMC.log">
+			<compoundLikelihood idref="likelihood"/>
+			<parameter idref="treeModel.rootHeight"/>
+			<parameter idref="hky.kappa"/>
+		</log>
+		<logTree  logEvery="10000" nexusFormat="true" fileName="testMCMC.trees">
+			<treeModel idref="treeModel"/>
+		</logTree>
+	</mcmc>
+</beast>
diff --git a/examples/benchmark/1/testHKY755.xml b/examples/benchmark/1/testHKY755.xml
new file mode 100644
index 0000000..3cd4e05
--- /dev/null
+++ b/examples/benchmark/1/testHKY755.xml
@@ -0,0 +1,467 @@
+<?xml version="1.0" standalone="yes"?>
+<!-- Generated by BEAUTi v1.5beta4                                           -->
+<!--       by Alexei J. Drummond and Andrew Rambaut                          -->
+<!--       Department of Computer Science, University of Auckland and        -->
+<!--       Institute of Evolutionary Biology, University of Edinburgh        -->
+<!--       http://beast.bio.ed.ac.uk/                                        -->
+<beast>
+	
+	<!-- The list of taxa analyse (can also include dates/ages).                 -->
+	<!-- ntax=64                                                                 -->
+	<taxa id="taxa">
+		<taxon id="Sphaerostilbella_aureonitens"/>
+		<taxon id="Selinia_pulchra"/>
+		<taxon id="Roumergueriella_rufula"/>
+		<taxon id="Plectosphaerella_cucumerina"/>
+		<taxon id="Peethambara_sundara"/>
+		<taxon id="Ochronectria_calami_2"/>
+		<taxon id="Ochronectria_calami_1"/>
+		<taxon id="Nigrosabulum_globosum"/>
+		<taxon id="Neotyphodium_coenophialum"/>
+		<taxon id="Nectriopsis_violacea"/>
+		<taxon id="Nectriopsis_sporangiicola"/>
+		<taxon id="Nectria_zonata"/>
+		<taxon id="Nectria_sesquicilli"/>
+		<taxon id="Nectria_radicicola"/>
+		<taxon id="Nectria_pseudotrichia"/>
+		<taxon id="Nectria_pityrodes2"/>
+		<taxon id="Nectria_pityrodes1"/>
+		<taxon id="Nectria_grammicospora"/>
+		<taxon id="Nectria_cinnabarina_2"/>
+		<taxon id="Nectria_cinnabarina_1"/>
+		<taxon id="Myrothecium_inundatum"/>
+		<taxon id="Mycoarachis_inversa"/>
+		<taxon id="Leucosphaerina_indica"/>
+		<taxon id="Leuconectria_clusiae"/>
+		<taxon id="Kallichroma_tethys_2"/>
+		<taxon id="Kallichroma_tethys_1"/>
+		<taxon id="Kallichroma_glabrum"/>
+		<taxon id="Hypomyces_australis"/>
+		<taxon id="Hypomyces_aurantius"/>
+		<taxon id="Hypocrea_schweintzii"/>
+		<taxon id="Hypocrea_pallida"/>
+		<taxon id="Hypocrea_lutea"/>
+		<taxon id="Hydropisphaera_peziza_2"/>
+		<taxon id="Hydropisphaera_peziza_1"/>
+		<taxon id="Hydropisphaera_erubescens_4"/>
+		<taxon id="Hydropisphaera_erubescens_3"/>
+		<taxon id="Hydropisphaera_erubescens_2"/>
+		<taxon id="Hydropisphaera_erubescens_1"/>
+		<taxon id="Heleococcum_japonicum"/>
+		<taxon id="Hapsidospora_irregularis"/>
+		<taxon id="Geosmithia_putterillii"/>
+		<taxon id="Geosmithia_lavendula"/>
+		<taxon id="Epichloe_typhina"/>
+		<taxon id="Emericellopsis_terricola"/>
+		<taxon id="Didymostilbe_echinofibrosa"/>
+		<taxon id="Cylindrocladium_floridanum"/>
+		<taxon id="Cordyceps_capitata"/>
+		<taxon id="Cordycepioideus_bisporus"/>
+		<taxon id="Clonostachys_rosea"/>
+		<taxon id="Ceratocystis_fimbriata"/>
+		<taxon id="Calonectria_morganii"/>
+		<taxon id="Bulbithecium_hyalosporum"/>
+		<taxon id="Bionectria_ochroleuca"/>
+		<taxon id="Bionectria_cf._aureofulva_2"/>
+		<taxon id="Bionectria_cf._aureofulva_1"/>
+		<taxon id="Balansia_obtecta"/>
+		<taxon id="Albosynnema_elegans"/>
+		<taxon id="Acremonium_alternatum"/>
+		<taxon id="Viridispora_diparietospora_2"/>
+		<taxon id="Viridispora_diparietospora_1"/>
+		<taxon id="Verticillium_dahliae"/>
+		<taxon id="Stanjemonium_grisellum"/>
+		<taxon id="Stanjemonium_fuscescens"/>
+		<taxon id="Sphaerostilbella_berkeleyana"/>
+	</taxa>
+	
+	<!-- The sequence alignment (each sequence refers to a taxon above).         -->
+	<!-- ntax=64 nchar=1008                                                      -->
+	<alignment id="alignment" dataType="nucleotide">
+		<sequence>
+			<taxon idref="Sphaerostilbella_aureonitens"/>
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCTCGCGCGG-----GAGTTGTAATTTGTAGAGGATGCTTTTGGTGA-GGCGCCGCC-GAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGCTGGCCGCCGAGCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATATGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAACA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCGTGACCAGACTTGGGCTTGG-CGAAT-CATC-AGGG-TTCTCCCTGGTGCACTTTGCCTCGCTCAGGCCAGCATCAGTTCGCCGCGGGGGACAAAGGCTTCGGGAATGTGGCTC---TCC--GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Selinia_pulchra"/>
+			CCTCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCCA-----GGCCCGAGTTGTAATTTGCAGAGGATGTTTCTGGCGC-GGTGCCTTCCGAGTTCCCTTGGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGCCGCCAAGCCTATGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCTAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGCC-GG-TTGATCATCCGCCG--TTCTCGGTGGTGCACTCTG-CCGGCTCAGGCCAGCATCAGTTTGGCCCGGGGGATAAAGGCGTCGGGAATGTGGCTCCCTCC--GGGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Roumergueriella_rufula"/>
+			CCTCAGTAACGGCGAG-TGAAGCGG-CAGCAG-CTCAAATTTGAAATCT-GGCCTA-----GGGGCCCGAGTTGTAATTTGCAGAGGATGTTTCTGGCGA-GGCGCCTTCCGAGTTCCCT-GGAACGGGACGCCGTAGAGGGTGAGAGCCCCGTACGGTTGGACGCTAAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCTAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGGC-GG-TCGATCACCCGCCG--TTCTCGGCG---CACTCGG-CCGGCCCAGGCCAGCATCAGTTTGGCCCGGGGGACAAAGGCGCCGGGAACGTGGCTCCC-----GGGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Plectosphaerella_cucumerina"/>
+			CCTCAGTAACGGCGAG-TGAAGCGG-CACCAG-CTCAAATTTGAAATCT-GGCTCCTTC--GGGGTCCGAGTTGTAATTTGTAGAGGATGCGTCGGGTACGGGTCCCTACCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTAGGATACCCAGCCCATGTG-ACGC-TCCCTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAACGGGAGGTATACTCCTTCCAAAGCTAAATACCGGCTGGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTCAAACA-GCACGTGAAATTG-TTAAAAGGGAAGCACTCGCTACCAGACTTGGGTTTGG-AGGTTCAACCGGGGC-CACGCCCCGGGG-ATTCCG-CCAGCTCAGGCCAGCATCAGCTTTCCGTCGGGGGCAAAGACGTCGGGAATGTGGCTCCCCCTCGGGGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Peethambara_sundara"/>
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGTCCCCA----GGGCCCGAGTTGTAATTTGCAGAGGATGCTTTGGGCGC-GGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCACAGAGGGTGAGAGCCCCGTCTGGTCGGACACCAAGCCTGTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTTAAACA-GCACGTGAAATTG-TTGAAAGGGAAGCGTTCATGACCAGACTTGG-CCCGG-TTGATCATCCAGCG--TTCTCGCTGGTGCACTCTG-CCGGTCCAGGCCAGCATCAGTTCGCCACGGGGGATAAAGGCGGCGGGAATGTGGCTCCCCC----GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Ochronectria_calami_2"/>
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGC-TCTC----GGGCCCGAGTTGTAATTTGAAGAGGATGTTTCTGGCAA-GGTACCTTCTGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTAGTTGGTCGCCGCGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGCC-GG-TTGATCATCCATCG--TTCTCGGTGGTGCACTCTG-CCGGTCCAGGCCAGCATCAGTTTGCCCCGGGGGATAAAGGCTTCGGGAATGTGGCTCCCT----AGGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Ochronectria_calami_1"/>
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGC-TCTC----GGGCCCGAGTTGTAATTTGAAGAGGATGTTTCTGGCAA-GGTACCTTCTGAGTTCTCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTAGTTGGTCGCCGCGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGCC-GG-TTGATCATCCATCG--TTCTCGGTGGTGCACTCTG-CCGGTCCAGGCCAGCATCAGTTTGCCCTGGGGGATAAAGGCTTCGGGAATGTGGCTCCCT----AGGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Nigrosabulum_globosum"/>
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCCA-----GGCCCGAGTTGTAATTTGCAGAGGATGCTTCTGGCGA-CGCGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCCGGTCGTGCGCCTAGCCTGTGTGAA-GC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-CTGAAAGGGAAGCGCTTATGACCAGACTTGGGCCCGG-TGAATCA-CCAGCG--TTCTCGCTGGTGCACTTTG-CCGGCCCAGGCCAGCATCAGTTCGTGCCGGGGGATAAAGGCTTCGGGAATGTAGCTCCCTC----GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Neotyphodium_coenophialum"/>
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCCC---GGGGCCCGAGTTGTAATTTGCAGAGGATGCTTTTGGCGA-GGCGCCTTCCGAGTTCCCT-GGAACGGGACGCCACAGAGGGTGAGAGCCCCGTCTGGTTGGATGCCGAGCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAAATAGTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGCCCGG-TGAAT-CATCCAGCG-TTCTCGCCGGTGCACTTTGCCGGGCTCAGGCCAGCATCAGTTCGCCCTGGGGGAGAAAGGCTCTGGGAATGTGGCTCC-TCC---GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Nectriopsis_violacea"/>
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCA------GGCCCGAGTTGTAATTTGTAGAGGATGTTTCTGACGA-GGTACCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGTCGCCAAGTCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATATAGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCATATGACCAGACTTGGCC-AGG-TTAATCATCCATCG--TTCTCGGTGGTGCACTTTG-CCTGGCCAGGCCAGCATCAGTTCGCCTTGGGGGATAAAGACTTCGGGAATGTGGCTCCTTC----GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Nectriopsis_sporangiicola"/>
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCA-------GGCCGAGTTGTAATTTGTAGAGGATGTTTCTGACGA-GGTACCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGTCGCCAAGTCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATACGTCTTCTAAAGCTAAATATAGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCACATGACCAGACTTGGGT-GGG-TTGATCATCCGTCG--TTCTCGGCGGTGCACTCTG-CCCGACCAGGCCAGCATCAGTTCGCTGCGGGGGATAAAGACGTCGGGAATGTGGCTCC-TCC---GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Nectria_zonata"/>
+			CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCA------GAGCCGAGTTGTAATTTGTAGAGGATGTTTCTGGAGA-GGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTG--CGCTATGCCTATGTGAAA-C-TCCTTCAACGCGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGTGGTGTACGCCATCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAA-GAGGGTTAAACA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACCTGGGCC-GG-TTGATCATCCGCCG--TTCTCGGTGGTGCACTCTG-CCGGCCCAGGCCAGCATCGGTCTGGCGCGGGGGTCAAAGGTTCCGGGAATGTGGCTCCCCCC--GGGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Nectria_sesquicilli"/>
+			CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCGCAA-------GCCCGAGTTGTAATTTGTAGAGGATGTTTCTGGCGA-CGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGTTGCCTAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGTTTATGACCAGACTTGAGC-AGG-TTGATCATCCGTGG--TTCTCCGCGGTGCACTCTG-CCTGTTCAGGCCAGCATCAGTTTGGTTCGGGGGATAAAGGCTTCGGGAATGTAGCTCCCTC----GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Nectria_radicicola"/>
+			CCCTAGTAACGGCGAG-TGAAGCGG--AACAG-CTCAAATTTGAAATCT-GGCCTTC-----GGGTCCGAGTTGTAATTTGTAGAGGATGCTTTGGGTGA-GGTACCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTTGGATACCGATCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGCTTGG-TTGATCATCCAGGG--TTCTCCCTGGTGCACTCTT-CCAGCTCAGGCCAGCATCAGTTCGCTGTGGGGGATAAAGGCTTCGGGAATGTGGCTCC-TCC---GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Nectria_pseudotrichia"/>
+			CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCTCGT----GGTCCGAGTTGTAATTTGTAGAGGATGCTTTGGGTTA-GGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTTGGACACCGAGCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTGTGACCAGACTTGGGCCCGG-TCAATCATCCAGGG--TTCTCCCTGGTGCACTTTT-CCGGCTCAGGCCAGCATCAGTTTGTCGCGGGGGATAAAGACGTTGGGAATGTGGCTCCCCC----GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Nectria_pityrodes2"/>
+			CCCTAGTAACGGCGAG-TGAAGCGG-CAACAGGCTCAAATTTGAAATCT-GGCCCTA------GGCCCGAGTTGTAATTTGTAGAGGATGTTTCTGGCGA-AGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGATGCCTAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGGTTATGACCAGACTTGGAC-AGG-TTGATCATCCACGG--TTCTCTGTGGTGCACTCTG-CCTGTCCAGGCCAGCATCAGTTCGCTTCGGGGGATAAAGACTTTGGGAATGTGGCTCCCTC----GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Nectria_pityrodes1"/>
+			CCCTAGTAACGGCGAG-TGAAGCGGGCAACAG-CTCAAATTTGAAATCT-GGCCCTA------GGCCCGAGTTGTAATTTGTAGAGGATGTTTCTGGCGA-AGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGATGCCTAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGGTTATGACCAGACTTGGAC-AGG-TTGATCATCCACGG--TTCTCTGTGGTGCACTCTG-CCTGTTCAGGCCAGCATCAGTTCGCTTCGGGGGATAAAGGCTTTGGGAATGTGGCTCCCTC----GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Nectria_grammicospora"/>
+			CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCGCAA-------GCCCGAGTTGTAATTTGTAGAGGATGTTTCTGGCGA-CGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGATGCCTAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCGTTCATGACCAGACTTGGGC-AGG-TTGATCATCCGTGG--TTCTCCGCGGTGCACTCTG-CCTGCCCAGGCCAGCATCAGTTCGCCCCGGGGGATAAAGGTTTCGGGAATGTGGCTCCCTC----GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Nectria_cinnabarina_2"/>
+			CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCTTGT----GGTCCGAGTTGTAATTTGTAGAGGATGCTTTTGGTGA-GGTACCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTTGGATACCGATCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTGTGACCAGACTTGGGCTTGG-TTAATCATCCAGGG--TTCTCCCTGGTGCACTTGG-CCAGCCCAGGCCAGCATCAGTTTGTCGCGGGGGATAAAGGCGTTGGGAATGTGGCTCCCTC----GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Nectria_cinnabarina_1"/>
+			CCCAAGTAACGGCGATGTGAATCGG-CAACAG-CTCAAATTTGAAATCTAGGCCCTTGT----GGTCCGAGTTGTAATTTGTAGAGGATGCTTTTGGTGA-GGTAC-TTCCGA-TTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTTGGATACCGATCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTA-TTTGGG-AATGCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGTTGATCGAAAGATGAAAAGCACTTTGAAAAGAGGGT-AAATA-GTACGTGAAATTGGTTGAAAGGGAAGCGCTTGTGACCAGACTTGGGCTTGG-TTAATCATCCAGGG--TTCTCCCTGGTGCACTTGG-CCAGCCCAGGCCAGCATCAGTTTGTCGCGGGGGATAAAGGCGTTGGGAATGTGGCTCCCCC----GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Myrothecium_inundatum"/>
+			CCTCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCA------GGCCCGAGTTGTAATTTGCAGAGGATGCTTTTGGTGA-GGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTCGGACACCGAGCCTCTGT-AAAGCCTCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTTAAATA-GCACGTGAAATTG-TTGAAAGGGAAGCGTTTATGACCAGACTTGG-CCCGG-TTGATCATCCAGCG--TTCTCGCTGGTGCACTCTG-CCGGTCCAGGCCAGCATCAGTTCGTCGCGGGGGACAAAGGCTTCGGGAATGTGGCTCC-TCC---GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Mycoarachis_inversa"/>
+			CCTCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GCCCCCC------GGCCCGAGTTGTAATTTGCAGAGGATGCTTCTGGCGA-CGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCCGGTTGTGCGCCTAGCCTCTGTGAA-GC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-CTGAAAGGGAAGCGCTTCTGACCAGACTTGGGCCCGG-TGAATCATCCAGCG--TTCTCGCTGGTGCACTTTG-CCGCCC-AGGCCAGCATCAGTTCGCGCCGGGGGATAAAGGCTTCGGGAATGTAGCTCCCTC----GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Leucosphaerina_indica"/>
+			CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAAGCT-GGCTCTC-----GGGCCCGCATTGTAATTTGCAGAGGATGCTTCTGGCGA-CGCGCCTTCCGAGTTTCCCTGGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCCGGTCGTGCGCCTAGCCTCTGTGAA-GT-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGCT-GGCTCGATCATCCGGCG--TTCTCGCCGGTGCACTCGGGCCG-CTCAGGCCAGCATCAGCTTCCGCCGGGGGATAAAGGCGGCGGGAATGTGGCTCCCTC----GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Leuconectria_clusiae"/>
+			CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCTC-----GGGTCCGAGTTGTAATTTGTAGAGGATGCTTTGGGTGC-GGTACCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTTGGATACCAATCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTATGACCAGACTTGGGCTTGG-TTGATCATCCTGGG--TTTTCCCTGGTGCACTCTT-CCAGTTCAGGCCAGCATCAGTTTGTTTCGGGGGATAAAGGCTTCGGGAATGTGGCTCCCTC----GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Kallichroma_tethys_2"/>
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAAAAG-CTCAAATTTGAAATCT-GGCCCCCCC---GGGCCCGAGTTGTAATTTGCAGAGGATGTTTCTGGCGC-GGCGCCAGCCGAGT-CCCTTGGAACAGGGCGCCACAGAGGGTGAGAGCCCCGTATGGCTGCGCGCTAAGCCTTTGTGAAA-C-TCCCTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAGCGGGAGGTGTACGTCTTCCAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCACTCATGACCAGACTTGGGCCCGG-CGGATCATCCAGCG--TTCTCGCTGGTGCACTTCACCGGGCTCAGGCCAGCATCAGTCCGCGCCGGGGGAAAAAGGCTTCGGGAATGTGGCTCCCCC----GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Kallichroma_tethys_1"/>
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAAAAG-CTCAAATTTGAAATCT-GGCCCCCCC---GGGCCCGAGTTGTAATTTGCAGAGGATGTTTCTGGCGC-GGCGCCAGCCGAGT-CCCTTGGAACAGGGCGCCACAGAGGGTGAGAGCCCCGTATGGCTGCGCGCTAAGCCTTTGTGAAA-C-TCCCTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAGCGGGAGGTGTACGTCTTCCAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCACTCATGACCAGACTTGGGCCCGG-CGGATCATCCAGCG--TTCTCGCTGGTGCACTTCACCGGGCTCAGGCCAGCATCAGTCCGCGCCGGGGGAAAAAGGCTTCGGGAATGTGGCTCCCCC----GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Kallichroma_glabrum"/>
+			CCTCAGTAACGGCGAG-TGAAGCGG-CAAAAG-CTCAAATTTGAAATCT-GGCCCCCA-----GGCCCGAGTTGTAATTTGCAGAGGATGTTTCTGGCGC-GGCGCCTTCCGAGT-CCCTTGGAACAGGGCGCCATAGAGGGTGAGAGCCCCGTATGGTTGCGCGCTAAGCCTGTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCACTTATGACCAGACTTGGGCTCGGGCGAATCATCCAGCG--TTCTCGCTGGTGCACTTCTCCGGGCTCAGGCCAGCATCAGTCTGCTCCGGGGGATAAAGGCTTCGGGAATGTGGCTCC-TCC---GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Hypomyces_australis"/>
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GCC--TAGGG-----CCCGAGTTGTAATTTGCAGAGGATGCTTTT-GCGA--GCGCCGCCCGAGTTCCCT-GGAACGGGACGCCGCAGAGGGTGAGAGCCCCGTCTG-CTGGACGCCGAGCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATATGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAACA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGCTTGG-CGGAT-CAGC---TG-TTCTC-CGGGTGCACTTCGCC-CGCCCAGGCCAGCATCAGCTCGCCCCGGGGGACAAAGGCTTCGGGAATGTGGCTC---TCC--GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Hypomyces_aurantius"/>
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCTAGGG----CCCTGAGTTGTAATTTGCAGAGGATGCTTTTGGCAA-GGCGCCGCCCGAGTTCCCT-GGAACGGGACGCCGCAGAGGGTGAGAGCCCCGTCTGGCTGGACGCCGAGCCTTTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAACA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGCTTGG-CGGATGCAGC---TG-TTCTCGCCGGTGCACTTCGCCTCGCCCAGGCCAGCATCAGTTCGCCCCGGGGGACAAAAGCTTCGGGAATGTGGCTC---TCC--GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Hypocrea_schweintzii"/>
+			CCCCGATAACGGCGAG-TGAAGCG--CAACAG-CTCAAATTTG?AACTC-GGCCCTTTTG-GG--TCCGAGTTGTAATTTGTAGAGGATG?TTTTGGCAA-GGTGCCGCCCGAGTTCCCT-GGAACGGGACGCCACAGAGGGTGAGAGCCCCGTCTGGCTGGCCACCGAGCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATATGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACCTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTGTGACCAGACTTGGGCGCGG-CGGAT-CATCCGGGG-TTCTCCCCGGTGCACTTCGCCGTGTCCAGGCCAGCATCAGTTCGTCGCGGGGGAAAAAGGCTTCGGGAACGTGGCTCCCCT----GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Hypocrea_pallida"/>
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCTAGCCGG----CGAGTTGTAATTTGCAGAGGATGCTTTTGGTGA-GGCGCCGGCCGAGTTCCCT-GGAACGGGATGCCACAGCGGGTGAGAGCCCCGTCTGCCTGGACGCCGAACCTATGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATATGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGCTTGG-CGGAT-CATC--GCG-TTCTCGCCGTTGCACTCTGCCTCGTCCAGGCCAGCATCAGTTCGTCCCGGGGGATAAAGGCGTCGGGAATGTGGCTCC--TAC--GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Hypocrea_lutea"/>
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCCCGGG----TCCGAGTTGTAATTTGTAGAGGATGCTTTTGGTGA-GGTGCCGCCCGAGTTCCCT-GGAACGGGACGCCACAGAGGGTGAGAGCCCCGTCTGGCTGGCCACCGAGCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATATGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACCTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTGTGACCAGACTTGGGCGCGG-CGGAT-CATCCGGGG-TTCTCTCCGGTGCACTTCGCCGCGTTCAGGCCAGCATCAGTTCGTCGCGGGGGATAAAGGCTTCGGGAACGTGGCTC---TCC--GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Hydropisphaera_peziza_2"/>
+			?????????????????????????????????????????TGAAATCT-GGCCCTA------GGCCCGAGTTGTAATTTGCAGAGGATGTTTCTGGCGA-GGTGCCTTCCGAGTGCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGTCGCTAAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGCC-GG-TTGATCATCCGCCG--TTCTCGGCGGTGCACTCTG-CCGGCTCAGGCCAGCATCAGTTTGGTCCGGGGGATAAAGGTGTAGGGAATGTGGCTCCCCCC---GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Hydropisphaera_peziza_1"/>
+			CCTCAGTAACGGCGAGGTGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCTA------GGCCCGAGTTGTAATTTGCAGAGGATGTTTCTGGCGA-GGTGCCTTCCGAGTGCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGTCGCTAAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGCC-GG-TTGATCATCCGCCG--TTCTCGGCGGTGCACTCTG-CCGGCTCAGGCCAGCATCAGTTTGGTCCGGGGGATAAAGGTGTAGGGAATGTGGCTCCCCCC--GGGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Hydropisphaera_erubescens_4"/>
+			CCTTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCTCT------GGCCCGAGTTGTAATTTGCAGAGGATGTTTCTGGCGA-GGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGTCGCTAAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCTAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTATGACCAGACTTGGGCC-GG-TTGATCATCCATCG--TTCTCGGTGGTGCACTCTG-CCGGTTCAGGCCAGCATCAGTTTGGCTTGGGGGATAAAGGCTTCGGGAATGTGGCTCCCTCC--GGGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Hydropisphaera_erubescens_3"/>
+			CCTCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCTTCT-----GGCCCGAGTTGTAATTTGCAGAGGATGTTTCTGGCGA-GGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGTCGCTAAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCTAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTATGACCAGACTTGGACC-GG-TTGATCATCCATCG--TTCTCGGTGGTGCACTCTG-CCGGTTCAGGCCAGCATCAGTTTGGCCCGGGGGATAAAGGCTTCGGGAATGTGGCTCCCCAC--GGGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Hydropisphaera_erubescens_2"/>
+			CCTTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCTTT------GGCCCGAGTTGTAATTTGCAGAGGATGTTTCTGGCGA-GGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGTCGCTAAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCTAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTATGACCAGACTTGGACC-GG-TTGATCATCCATCG--TTCTCGGTGGTGCACTCTG-CCGGTTCAGGCCAGCATCAGTTTGGCTCGGGGGATAAAGGTTTCGGGAATGTGGCTCCCCAC--GGGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Hydropisphaera_erubescens_1"/>
+			CCTTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCTTCT-----GGCCCGAGTTGTAATTTGCAGAGGATGTTTCTGGCGA-GGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGTCGCTAAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGGGAATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCTAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGACC-GG-TTGATCATCCATCG--TTCTCGGTGGTGCACTCTG-CCGGTTCAGGCCAGCATCAGTTTGGCCCGGGGGATAAAGGTTTCGGGAATGTGGCTCCCCAC--GGGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Heleococcum_japonicum"/>
+			CCTCAGTAACGGCGAG-TGAAGCGG-CAACAG-TTCAAATTTGAAATCT-GGCCCCA------GGCCCGAGTTGTAATTTGAAGAGGATGTTTCTGGCGA-GGTGCCTTCCGAGTGCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGTCGCTAAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGCC-GG-TTGATCATCCGCCG--TTCTCGGCGGTGCACTCTG-CCGGCTCAGGCCAGCATCAGTTTGGTCCGGGGGATAAAGGCGTAGGGAATGTGGCTCCCCCC--GGGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Hapsidospora_irregularis"/>
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCCC-----GGCCCGAGTTGTAATTTGCAGAGGATGCTTCTGGCGA-CGCGCCTTCCGAGTTCCCT-GGAACGGGACGCCACAGAGGGTGAGAGCCCCGTCCGGTCGTGCGCCTAGCCTGTGTGAA-GC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-CTGAAAGGGAAGCGCTTATGACCAGACTTGGGCCCGG-TGAATCA-CCAGCG--TTCTCGCTGGTGCACTTTG-CCGGCCCAGGCCAGCATCAGTTCGCGCCGGGGGATAAAGGCTTCGGGAATGTAGCTCCCTC----GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Geosmithia_putterillii"/>
+			CCTTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCCA-----GGCCCGAGTTGTAATTTGTAGAGGATGCTTCTGGCGA-CGCGACTTCCGAGTTCCCT-GGAACGGGACGCCAAAGAGGGTGAGAGCCCCGTCCGGCCGTTCGCCTAGCCTATGTGAA-GC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-CTGAAAGGGAAGCGCTTATGACCAGACTTGGGCTAGG-TGAATCATCCGGCG--TTCTCGCCGGTGCACTTTG-CCTGTCCAGGCCAGCATCAGTTCGCTTCGGGGGATAAAGGCTTCGGGAATGTAGCTCCTCC----GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Geosmithia_lavendula"/>
+			CCTCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCCA-----GGCCCGAGTTGTAATTTGTAGAGGATGATTCTGGCGA-CGCGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCCGGTCGTGCGCCTAGCCTCTGTGAAT-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAAAA-GTACGTGAAATTG-CTGAAAGGGAAGCGCTTATGACCAGACTTGGGCGTGG-TGAATCATCCGGCG--TTCTCGCCGGTGCACTTTG-CCTGTCCAGGCCAGCATCAGTTCTCCCCGGGGGATAAAGGCTTCGGGAATGTAGCTCCTTC----GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Epichloe_typhina"/>
+			CCCCAGTAACGGCGAG-TGAAGCGG-AAACAG-CTCAAATTTGAAATCT-GGCCCCCA----GGGCCCGAGTTGTAATTTGTAGAGGATGCTTTGGG-GA-GGCGCCTTCCGAGTTCCCT-GGAACGGGACGCCACAGAGGGTGAGAGCCCCGTCTGGTTGGATGCCGAGCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATCCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGCCCGG-TGAAT-CATCCAGCGGTTCTCGCTGGTGCACTTTGCCGGGCTCAGGCCAGCATCAGTTCGCCCCGGGGGACAAAGGCTCTGGGAATGTGGCTCC-TCC---GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Emericellopsis_terricola"/>
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCTCGT------GCCCGAGTTGTAATTTGTAGAGGATGCTTTTGGCGA-CGCGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCCGGTCGTGCGCCTAGCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-CTGAAAGGGAAGCGCTTATGACCAGACTTGGGCGCGG-CGGATCATCCGGCG--TTCTCGCCGGTGCACTCCA-CCGCCCCAGGCCAGCATCAGTTCGCGCCGGGGGACAAAGGCTTCGGGAATGTGGCTCCCTC----GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Didymostilbe_echinofibrosa"/>
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCA------GGCCCGAGTTGTAATTTGCAGAGGATGCTTTGGGCGC-GGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTCGGACACCAAGCCTATGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATATGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTTAAACA-GCACGTGAAATTG-TTGAAAGGGAAGCGTTCATGACCAGACTTGG-CCCGG-TTGATCATCCAGCG--TTCTCGCTGGTGCACTCTG-CCGGTCCAGGCCAGCATCAGTTCGCCGCGGGGGATAAAGGTTTCGGGAATGTGGCTCC-TC-----GGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Cylindrocladium_floridanum"/>
+			CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCTC-----GGGTCCGAGTTGTAATTTGTAGAGGATGCTTTGGGTGA-GGTACCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTTGGATACCGATCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTATGACCAGACTTGGGCTTGG-TTGATCATCCTGGG--TTCTCCCTGGTGCACTCTT-CCAGTTCAGGCCAGCATCAGTTCGCTGCGGGGGATAAAAGCTTTAGGAATGTGGCTCCCTC----GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Cordyceps_capitata"/>
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAACGG-CTCAAATTTGAAATCT-GGCCCCCA----GGGCCCGAGTTGTAATTTGCAGAGGATGCTTTTGGCGC-GGCGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTCGGACGCCAAGCCAGTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAACGGGAGGTATATGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAACA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTGCGACCAGACTTGGGCCCGG-TGAAT-CATCCAGCG-TTCTCGCTGGTGCACTTCGCCGGGCTCAGGCCAGCATCAGTTCGCCGCGGGGGACAAAAGCTTCGGGAACGTGGCTCCCTC----GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Cordycepioideus_bisporus"/>
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCCCCGCGGGGCCCGAGTTGTAATTTGCAGAGGATGCTTTTGGCGC-GGCGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTCGGACGCCCAGCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATATGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAACA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCGTGACCAGACTTGGGCGCGG-CGGAT-CATC-GGCG-TTCTCGCCGGTGCACTCCGCCGGGCCCAGGCCAGCATCGGTTCGCGGCGGGGGACAAAGGCGTCGGGAACGTGGCTCCCCT----GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Clonostachys_rosea"/>
+			CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCGCACAC--------GGAGTTGTAATTTGTAGAGGATGTTTCTGGCGA-CGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGATGCCTAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCGTTCATGACCAGACTTGGGC-AGG-TTGATCATCCGTGG--TTCTCCGCGGTGCACTCTG-CCTGCCCAGGCCAGCATCAGTTCGCCCCGGGGGATAAAGGCTTTGGGAATGTGGCTCCCTC----GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Ceratocystis_fimbriata"/>
+			CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCTACATTCCGTAGTCCGAGTTGTAATTTGTAGAGGATGCTTTGGGTGA-GGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGACACCAAACCTCTGT-ATAGC-TCCTTCAACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATATCTCTTCTAAAGCTAAATATAGGCTAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTTAAACA-GCACGTGAAATTG-TTGAAAGGGAAGCGCCTATGACCAGACTTGTTTCTGG-CAGTTTCGTTAGC-C-CTCGGGCTGATTTACTCTGTCCAGTACAGGCCAGCATCAGTTTGCTGTCGGGGAGAAAGGCTCTGGGAACGTAGCTCCCCCCTGGGGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Calonectria_morganii"/>
+			CCCTAGTAACGGCGAG-TGAAGCGG-AAACAG-CTCAAATTTGAAATCT-GGCCCTC-----GGGTCCGAGTTGTAATTTGTAGAGGATGCTTTGGGTGA-GGTACCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTTGGATACCGATCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTATGACCAGACTTGGGCTTGG-TTGATCATCCTGGG--TTCTCCCTGGTGCACTCTT-CCAGTTCAGGCCAGCATCAGTTCGCTGCGGGGGATAAAAGCTTTAGGAATGTGGCTCCCTC----GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Bulbithecium_hyalosporum"/>
+			??????????????????????????????????????????????????????????????????????GTTGTAATTTGCAGAGGATGCTTCTGGCGA-CGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCCGGTCGCGCACCTAGCCTCTGTGAA-GC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-CTGAAAGGGAAGCGCTTATGACCAGACTTGGGCC-GG-TGAATCATCCGTCG--TTCTCGGCGGTGCACTTTG-CCGGCTCAGGCCAGCATCAGTTCGCCTCGGGGGATAAAGGCTTCGGGAAAGTAGCTCCCTC----GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Bionectria_ochroleuca"/>
+			CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCGCACAC--------GGAGTTGTAATTTGTAGAGGATGTTTCTGGCGA-CGCGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGCGGGTGAGAGCCCCGTACGGTTGGATGCCTAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCGTTCATGACCAGACTTGGGC-AGG-TTGATCATCCGTGG--TTCTCCGCGGTGCACTCTG-CCTGCCCAGGCCAGCATCAGTTCGCCCCGGGGGATAAAGGCTTTGGGAATGTGGCTCCCTC----GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Bionectria_cf._aureofulva_2"/>
+			CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCGCAA-------GCCCGAGTTGTAATTTGTAGAGGATGTTTCTGGCGA-CGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGATGCCTAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCGTTCATGACCAGACTTGGGC-AGG-TTGATCAGCCGGGG--TTCTCCGCGGTGCACTCTG-CCTGCCCAGGCCAGCATCAGTTCGCCCCGGGGGATAAAGGTTTCGGGAATGTGGCTCC-TCC---GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Bionectria_cf._aureofulva_1"/>
+			CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCGCAA-------GCCCGAGTTGTAATTTGTAGAGGATGTTTCTGGCGA-CGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGATGCCTAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCGTTCATGACCAGACTTGGGC-AGG-TTGATCATCCGTGG--TTCTCCGCGGTGCACTCTG-CCTGCCCAGGCCAGCATCAGTTCGCCCCGGGGGATAAAGGTTTCGGGAATGTGGCTCC-TCCC--GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Balansia_obtecta"/>
+			CCCCAGTAACGGCGAG-TGAAGCGG--AACAG-TTCAAATTTGAAATCT-GGCCCCCTTGGGGGGCCCGAGTTGTAATTTGAAGAGGATGCTTTGGGCGA-GGCGCCTTCCGAGTTCCCT-GGAACGGGACGCCACAGAGGGTGAGAGCCCCGTCTGGTCGGACGCCGAGCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAACA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTACGACCAGACTTGGGCCCGG-CGAAT-CATCCGGCG-TTCTCGCCGGTGCACTTCGCCGGGCTCAGGCCAGCATCAGTTCGCGCCGGGGGACAAAGGCTCGGGGAATGTAGCTCCCCC----GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Albosynnema_elegans"/>
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCCC-----GGCCCGAGTTGTAATTTGCAGAGGATGCTTTGGGCGC-GGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCACAGAGGGTGAGAGCCCCGTCTGGTCGGCCACCAAGCCTGTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATATGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTTAAACA-GCACGTGAAATTG-TTGAAAGGGAAGCGTTCATGACCAGACTTGG-CCCGG-CTGATCATCCAGCG--TTCTCGCTGGTGCACTCTG-CCGGTCCAGGCCAGCATCAGTTCGCCACGGGGGATAAAGGTTTCGGGAATGTGGCTCC-TC-----GGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Acremonium_alternatum"/>
+			CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCTCAC-----GGTCCGAATTGTAATTTGTAGAGGATGTTTCTGGCGA-CGTGTCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCCGGTCGTACACCTAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-CTGAAAGGGAAGCGCTTATGACCAGACTTGGGCTCGG-TGAATCATCCGGCG--TTCTCGCCGGTGCACTTTG-CCGTCCCAGGCCAGCATCAGTTCGCGCCGGGGGATAAAGGTTTCGGGAATGTAGCTCCCTC----GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Viridispora_diparietospora_2"/>
+			CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCTC-----GGGTCCGAGTTGTAATTTGTAGAGGATGCTTTGGGTGC-GG-GCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTTGGACGCCAATCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTGTGACCAGACTTGGGCTTGG-TTGATCATCCAGGG--TTCTCCCCGGTGCACTCTT-CCAGTCCAGGCCAGCATCAGTTCGCCGCGGGGGACAAAAGCTTCGGGAATGTGGCTCCCTC----GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Viridispora_diparietospora_1"/>
+			CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCTC-----GGGTCCGAGTTGTAATTTGTAGAGGATGCTTTGGGTGC-GGGGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTTGGACGCCAATCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATCCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTGTGACCAGACTTGGGCTTGG-TTGATCATCCAGGG--TTCTCCCCGGTGCACTCTT-CCAGCCCAGGCCAGCATCAGTTCGCCGCGGGGGACAAAAGCTTCGGGAATGTGGCTCCCTC----GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Verticillium_dahliae"/>
+			CCTTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCTCCTTC--GGGGTCCGAGTTGTAATTTGTAGAGGATGCTTCGAGTTATGGTTCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTAGGAAACCATGCTCATGTG-AAGC-TCCCTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACTCCTTCCAAGGCTAAATACCGGTTAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTCAAACA-GCACGTGAAATTG-TTAAAAGGGAAGCGCTCGCTACCAGACGTGGGTTCGG-TGGTTCAACCAGGTC-CATGACCTGGGGCACTCCG-CCGGCCCAGGCCAGCATCAG-TTTCCGTCGGGGGCAAAGGCGTCGGGAATGTGGCTCTCCTTCGGGGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Stanjemonium_grisellum"/>
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCTTGT------GCCCGAGTTGTAATTTGTAGAGGATGCTTCTGGCGA-CGCGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCCGGTCGTGCGCCTAGCCTCTGTGAA-GC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-CTGAAAGGGAAGCGCTTATGACCAGACTTGGGCGCGG-CGGATCATCCGGCG--TTCTCGCCGGTGCACTCCA-CCGCCCCAGGCCAGCATCAGCTCGCGCCGGGGGACAAAGGCTTCGGGAATGTGGCTCCCTC----GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Stanjemonium_fuscescens"/>
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCTTGT------GCCCGAGTTGTAATTTGTAGAGGATGCTTCTGGCGA-CGCGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCCGGTCGTGCGCCTAGCCTCTGTGAA-GC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-CTGAAAGGGAAGCGCTTATGACCAGACTTGGGCGCGG-CGGATCATCCGGCG--TTCTCGCCGGTGCACTCCA-CCGCCCCAGGCCAGCATCAGCTCGCGCCGGGGGACAAAGGCTTCGGGAATGTGGCTCCCTC----GGGAGTG [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Sphaerostilbella_berkeleyana"/>
+			GCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCTCGCGG----CCCGAGTTGTAATTTGTAGAGGATGCTTTTGGTGA-GGCGCCGCCTGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGCTGGCCGCCGAGCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATATGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAACA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCGTGACCAGACTTGGGCTTGG-CGAAT-CATCCAGGG-TTCTCCCTGGTGCACTTTGCCTCGTCCAGGCCAGCATCAGTTCGCCGCGGGGGATAAAGACGTCGGGAACGTGGCTCCC-TC---GGGAGTG [...]
+		</sequence>
+	</alignment>
+
+	<!-- The unique patterns for all positions                                   -->
+	<!-- npatterns=69                                                            -->
+	<patterns id="patterns" from="1">
+		<alignment idref="alignment"/>
+	</patterns>
+
+	<!-- This is a simple constant population size coalescent model              -->
+	<!-- that is used to generate an initial tree for the chain.                 -->
+	<constantSize id="initialDemo" units="substitutions">
+		<populationSize>
+			<parameter id="initialDemo.popSize" value="0.0001"/>
+		</populationSize>
+	</constantSize>
+
+	<!-- Generate a random starting tree under the coalescent process            -->
+	<coalescentTree id="startingTree">
+		<taxa idref="taxa"/>
+		<constantSize idref="initialDemo"/>
+	</coalescentTree>
+
+	<treeModel id="treeModel">
+		<coalescentTree idref="startingTree"/>
+		<rootHeight>
+			<parameter id="treeModel.rootHeight"/>
+		</rootHeight>
+		<nodeHeights internalNodes="true">
+			<parameter id="treeModel.internalNodeHeights"/>
+		</nodeHeights>
+		<nodeHeights internalNodes="true" rootNode="true">
+			<parameter id="treeModel.allInternalNodeHeights"/>
+		</nodeHeights>
+	</treeModel>
+
+	<!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+	<hkyModel id="hky">
+		<frequencies>
+			<frequencyModel dataType="nucleotide">
+				<alignment idref="alignment"/>
+				<frequencies>
+					<parameter id="hky.frequencies" dimension="4"/>
+				</frequencies>
+			</frequencyModel>
+		</frequencies>
+		<kappa>
+			<parameter id="hky.kappa" value="1.0" lower="0.0"/>
+		</kappa>
+	</hkyModel>
+
+	<!-- site model                                                              -->
+	<siteModel id="siteModel">
+		<substitutionModel>
+			<hkyModel idref="hky"/>
+		</substitutionModel>
+        <gammaShape gammaCategories="4">
+              <parameter id="siteModel.shape" value="0.5" lower="0.0" upper="1000.0"/>
+        </gammaShape>
+        <proportionInvariant>
+                <parameter id="siteModel.pInv" value="0.5" lower="0.0" upper="1.0"/>
+        </proportionInvariant>
+		<mutationRate>
+			<parameter id="siteModel.mu" value="1.0" lower="0.0"/>
+		</mutationRate>
+	</siteModel>
+
+	<treeLikelihood id="treeLikelihood">
+		<patterns idref="patterns"/>
+		<treeModel idref="treeModel"/>
+		<siteModel idref="siteModel"/>
+	</treeLikelihood>
+
+	<operators id="operators">
+        <!-- proportions invariant -->
+        <scaleOperator scaleFactor="0.75" weight="1">
+                <parameter idref="siteModel.pInv"/>
+        </scaleOperator>
+        <!-- gamma shape parameter -->
+        <scaleOperator scaleFactor="0.75" weight="1">
+                <parameter idref="siteModel.pInv"/>
+        </scaleOperator>
+        <!-- standard operators -->
+		<scaleOperator scaleFactor="0.5" weight="1">
+			<parameter idref="hky.kappa"/>
+		</scaleOperator>
+		<scaleOperator scaleFactor="0.5" weight="1">
+			<parameter idref="treeModel.rootHeight"/>
+		</scaleOperator>
+		<uniformOperator weight="10">
+			<parameter idref="treeModel.internalNodeHeights"/>
+		</uniformOperator>
+		<subtreeSlide weight="5" gaussian="true" size="1.0">
+			<treeModel idref="treeModel"/>
+		</subtreeSlide>
+		<narrowExchange weight="1">
+			<treeModel idref="treeModel"/>
+		</narrowExchange>
+		<wideExchange weight="1">
+			<treeModel idref="treeModel"/>
+		</wideExchange>
+		<wilsonBalding weight="1">
+			<treeModel idref="treeModel"/>
+		</wilsonBalding>
+	</operators>
+
+	<mcmc id="mcmc" chainLength="1000000" autoOptimize="true" preBurnin="0">
+		<compoundLikelihood id="likelihood">
+			<treeLikelihood idref="treeLikelihood"/>
+		</compoundLikelihood>
+		<operators idref="operators"/>
+		<log logEvery="10000">
+			<column label="Likelihood" dp="4" width="12">
+				<compoundLikelihood idref="likelihood"/>
+			</column>
+			<column label="Root Height" sf="6" width="12">
+				<parameter idref="treeModel.rootHeight"/>
+			</column>
+			<column label="Kappa" sf="6" width="12">
+				<parameter idref="hky.kappa"/>
+			</column>
+		</log>
+		<log logEvery="10000" fileName="testMCMC.log">
+			<compoundLikelihood idref="likelihood"/>
+			<parameter idref="treeModel.rootHeight"/>
+			<parameter idref="hky.kappa"/>
+		</log>
+		<logTree  logEvery="10000" nexusFormat="true" fileName="testMCMC.trees">
+			<treeModel idref="treeModel"/>
+		</logTree>
+	</mcmc>
+</beast>
diff --git a/examples/benchmark/1/testHKY767.xml b/examples/benchmark/1/testHKY767.xml
new file mode 100644
index 0000000..6a74449
--- /dev/null
+++ b/examples/benchmark/1/testHKY767.xml
@@ -0,0 +1,502 @@
+<?xml version="1.0" standalone="yes"?>
+<!-- Generated by BEAUTi v1.5beta4                                           -->
+<!--       by Alexei J. Drummond and Andrew Rambaut                          -->
+<!--       Department of Computer Science, University of Auckland and        -->
+<!--       Institute of Evolutionary Biology, University of Edinburgh        -->
+<!--       http://beast.bio.ed.ac.uk/                                        -->
+<beast>
+	
+	<!-- The list of taxa analyse (can also include dates/ages).                 -->
+	<!-- ntax=71                                                                 -->
+	<taxa id="taxa">
+		<taxon id="Trebouxia_from_OC1_barbata"/>
+		<taxon id="Trebouxia_from_LP1_barbata"/>
+		<taxon id="Trebouxia_from_T3_lucida"/>
+		<taxon id="Trebouxia_from_L20a_lucida"/>
+		<taxon id="Trebouxia_from_DP2_lucida"/>
+		<taxon id="Trebouxia_from_SG1_lucida"/>
+		<taxon id="Trebouxia_from_SG1_lupina"/>
+		<taxon id="Trebouxia_from_TB2_barbata"/>
+		<taxon id="Trebouxia_from_TB1_barbata"/>
+		<taxon id="Trebouxia_from_CP2_rugosa"/>
+		<taxon id="Trebouxia_from_CP1_rugosa"/>
+		<taxon id="Trebouxia_from_ST1_barbata"/>
+		<taxon id="Trebouxia_from_ST1_lucida"/>
+		<taxon id="Trebouxia_from_EP1_lucida"/>
+		<taxon id="Trebouxia_from_TC1_barbata"/>
+		<taxon id="Trebouxia_from_B1_gracilis"/>
+		<taxon id="Trebouxia_from_K148_gracilis"/>
+		<taxon id="Trebouxia_from_K141_gracilis"/>
+		<taxon id="Trebouxia_from_T23b_lupina"/>
+		<taxon id="Trebouxia_from_T23a_lupina"/>
+		<taxon id="Trebouxia_from_CL1_rugosa"/>
+		<taxon id="Trebouxia_from_V1_rugosa"/>
+		<taxon id="Trebouxia_from_TC1_lupina"/>
+		<taxon id="Trebouxia_from_ST2_lupina"/>
+		<taxon id="Trebouxia_from_MV1_lupina"/>
+		<taxon id="Trebouxia_from_KM2_lupina"/>
+		<taxon id="Trebouxia_from_CL1_lupina"/>
+		<taxon id="Trebouxia_from_SH1_lupina"/>
+		<taxon id="Trebouxia_from_L22b_lupina"/>
+		<taxon id="Trebouxia_from_DP1_lupina"/>
+		<taxon id="Trebouxia_from_TB1_lupina"/>
+		<taxon id="Trebouxia_from_T4_lupina"/>
+		<taxon id="Trebouxia_from_AP1_lupina"/>
+		<taxon id="Trebouxia_from_CT3_lucida"/>
+		<taxon id="Trebouxia_from_CT2_barbata"/>
+		<taxon id="Trebouxia_from_K1_gracilis"/>
+		<taxon id="Trebouxia_jamesii_Z68701"/>
+		<taxon id="Trebouxia_jamesii_AF128270"/>
+		<taxon id="Trebouxia_from_P_furfuracea"/>
+		<taxon id="Trebouxia_jamesii_Z68700"/>
+		<taxon id="Trebouxia_jamesii_Z68699"/>
+		<taxon id="Trebouxia_from_IT2_vulpina"/>
+		<taxon id="Trebouxia_from_IT1_vulpina"/>
+		<taxon id="Trebouxia_from_AV3_vulpina"/>
+		<taxon id="Trebouxia_from_AV2_vulpina"/>
+		<taxon id="Trebouxia_jamesii_AJ249571"/>
+		<taxon id="Trebouxia_from_P_concosians"/>
+		<taxon id="Trebouxia_from_P_cladonia"/>
+		<taxon id="T_rebouxia_jamesii_AF128271"/>
+		<taxon id="T_rebouxia_galapagensis_AJ249567"/>
+		<taxon id="Trebouxia_higgensiae_AJ249574"/>
+		<taxon id="Trebouxia_usneae_AJ249573"/>
+		<taxon id="Trebouxia_corticola"/>
+		<taxon id="Trebouxia_usneae_Z68702"/>
+		<taxon id="Trebouxia_impressa_AJ249570"/>
+		<taxon id="Trebouxia_impressa_AJ249576"/>
+		<taxon id="Trebouxia_flava"/>
+		<taxon id="Trebouxia_potteri"/>
+		<taxon id="Trebouxia_from_U_arizonica"/>
+		<taxon id="Trebouxia_gelatinosa_Z68698"/>
+		<taxon id="Trebouxia_gelatinosa_Z68697"/>
+		<taxon id="Trebouxia_gelatinosa_AJ249575"/>
+		<taxon id="Trebouxia_gelatinosa_AJ249568"/>
+		<taxon id="Trebouxia_gigantea"/>
+		<taxon id="Trebouxia_gigantea_AJ249577"/>
+		<taxon id="Trebouxia_showmanii"/>
+		<taxon id="Trebouxia_asymmetrica_AJ249581"/>
+		<taxon id="Trebouxia_sp_AJ249572"/>
+		<taxon id="Trebouxia_arboricola_AJ249564"/>
+		<taxon id="Trebouxia_arboricola_AJ249481"/>
+		<taxon id="Trebouxia_arboricola_Z68703"/>
+	</taxa>
+	
+	<!-- The sequence alignment (each sequence refers to a taxon above).         -->
+	<!-- ntax=71 nchar=1082                                                      -->
+	<alignment id="alignment" dataType="nucleotide">
+		<sequence>
+			<taxon idref="Trebouxia_from_OC1_barbata"/>
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_LP1_barbata"/>
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAACT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_T3_lucida"/>
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_L20a_lucida"/>
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_DP2_lucida"/>
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_SG1_lucida"/>
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_SG1_lupina"/>
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_TB2_barbata"/>
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_TB1_barbata"/>
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_CP2_rugosa"/>
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGACTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_CP1_rugosa"/>
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGCTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_ST1_barbata"/>
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAACTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACC-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-T-TA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_ST1_lucida"/>
+			AAGGATCATTGAATC-TATCGTA-CCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAACTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACC-AG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-T-TA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_EP1_lucida"/>
+			AAGGATCATTGAATC-TATCGTA-CCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAACTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACC-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-T-TA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_TC1_barbata"/>
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCcCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_B1_gracilis"/>
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_K148_gracilis"/>
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGa-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_K141_gracilis"/>
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_T23b_lupina"/>
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_T23a_lupina"/>
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-cTTACTTATGCCTTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_CL1_rugosa"/>
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_V1_rugosa"/>
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_TC1_lupina"/>
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTtGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_ST2_lupina"/>
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_MV1_lupina"/>
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_KM2_lupina"/>
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_CL1_lupina"/>
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_SH1_lupina"/>
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGCTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_L22b_lupina"/>
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGCTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_DP1_lupina"/>
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGCTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_TB1_lupina"/>
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGCTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATC-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_T4_lupina"/>
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGCTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATC-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_AP1_lupina"/>
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGCTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATC-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_CT3_lucida"/>
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGCTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATC-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACa-C---TT--C----AAA-G-TA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_CT2_barbata"/>
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGCTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATC-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_K1_gracilis"/>
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGCTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATC-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_jamesii_Z68701"/>
+			AAGGATCATTGAATC-TATCGTG-CAAACACCGAGAA-CCTACTTATGCCCTCTA--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ACAAG-C-G--GCAGCTCCCTTCAAGCAG-CTG-CC-ATTG-T-GA--GTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAACATCAATT-GGGG-CCTTTCTGTCTTTTAGGCGGTGA-GG-TCT-ACC-GG-TTGTGAGGGGTGGCTTTCAA-CAAC---CT--C----AAA---T- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_jamesii_AF128270"/>
+			NNNNNNNNNNNAATC-TATCGTG-TAAACACCGAGAA-CCTACTTATGCCCTCTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ACAAG-C-G--GCAGTTCCCCTTGAGGAGTCT--CC-TTTG-T-GA--GTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAATATCAATT-GGGG-CCTTTCTGCCTTTTGGGCGGTCA-GG-TCT-ACC-GG-TTGTGAGGGGTGGCTTTCAA-CAAT---CT--C----AAAAG-TA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_P_furfuracea"/>
+			AAGGATCATTGAATC-TATCGTG-CAAACACCGAGAA-CcTACTtATGCCCTCTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ACAAG-C-G--GTAGCTCCcCTTGGGGAg-TTG-CC-TTTG-T-GA--GTGCGC--agGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAATATCAATT-GGGG-CCTGTCTGCCTTTTAGGCgGTCA-GG-TCT-ACC-GG-TTGTGAGGGGTGGCTTTCAA-CAAC---CT--C----AAAA-CTA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_jamesii_Z68700"/>
+			AAGGATCATTGAATC-TATCGTG-CAAACACCGAGAA-CCTACTTATGCCCTCTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ACAAG-C-G--GTACGTCCCCTTGGGGAG-TTG-CC-TTTG-T-GA--GTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAATATCAATT-GGGG-CCTGTCTGCCTTTTAGGCGGTCA-GG-TCT-ACC-GG-TTGTGAGGGGTGGCTTTCAA-CAAC---CT--C----AAAA-CTA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_jamesii_Z68699"/>
+			AAGGATCATTGAATC-TATCGTG-CAAACACCGAGAA-CCTACTTATGCCCTCTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ACAAG-C-G--GTAGCTCCCCTTGGG-AG-TTG-CC-TTTG-T-GA--GTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAATATCAATT-GGGGTCCTGTCTGCCTTTTAGGCGGTCA-GG-TCT-ACC-GG-TTGTGAGGGGTGGCTTTCAA-CAAC---CT--C----AAAA-CTA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_IT2_vulpina"/>
+			AAGGATCATTGAATC-TATCGTG-CAAACACCGTGAA-CCTACTTATGCCcTCTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ACAAG-C-G--GCAGCTCCCCTCAAGGAG-TTG-CC-TTTG-T-GA--GTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTtGACTGGGCGGGTCCAAAATCAATT-GGGG-CCTTTCTGCCTTTTGGGCGGTAA-GG-TCT-ACC-GG-TTGTGAGGGGTGGCTTTCAA-CAAC---CT--C----AAAAG-TA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_IT1_vulpina"/>
+			AAGGATCATTGAATC-TATCGTG-CAAACACCGTGAA-CCTACTTATGCCcTCTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ACAAG-C-G--GCAGCTCCCCTCAAGGAG-TTG-CC-TTTG-T-GA--GTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTtGACTGGGCGGGTCCAAAATCAATT-GGGG-CCTTTCTGCCTTTTGGGCGGTAA-GG-TCT-ACC-GG-TTGTGAGGGGTGGCTTTCAA-CAAC---CT--C----AAAAG-TA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_AV3_vulpina"/>
+			AAGGATCATTGAATC-TATCGTG-CAAACACCGTGAA-CCTACTTATGCCCTCTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ACAAG-C-G--GCAGCTCCCCTCAAGGAG-TTG-CC-TTTG-T-GA--GTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAAAATCAATT-GGGG-CCTTTCTGCCTTTTGGGCGGTAA-GG-TCT-ACC-GG-TTGTGAGGGGTGGCTTTCAA-CAAC---CT--C----AAAAG-TA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_AV2_vulpina"/>
+			AAGGATCATTGAATC-TATCGTG-CAAACACCGTGAA-CCTACTTATGCCCTCTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ACAAG-C-G--GCAGCTCCCCTCAAGGAG-TTG-CC-TTTG-T-GA--GTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAAAATCAATT-GGGG-CCTTTCTGCCTTTTGGGCGGTAA-GG-TCT-ACC-GG-TTGTGAGGGGTGGCTTTCAA-CAAC---CT--C----AAAAG-TA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_jamesii_AJ249571"/>
+			AAGGATCATTGAATC-TATCGTG-CAAACACCGTGAA-CTTACTTATGCCCTCTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------AT--GAT-G-GGCAGCTCCCTTCAAGGAG-TTG-CC-TTTG-T-GA--GTGCGC--AGGTCAGGGGTTGG---CTCCTTTTGG-TGTCAATTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACC-GG-TTGTGAGGGGTGGCTTTCAA-CAAC---TC--C----AAAA-C-A [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_P_concosians"/>
+			AAGGATCAtTGAATC-TATCGTG-CAAACACCGTGAA-CTTaCTTATGCCcTCTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------AT--GAT-G--GCAGCTCCCTTCAAGGAG-TTG-CC-TTTG-T-GA--GTGCGC--AGGTCAGGGGTTGG---CTCCTTTTGG-TGTCAATTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTAAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCTTTCAA-CAAC---TT--C----AAAA-C-A [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_P_cladonia"/>
+			AAGGATCATtGAATC-TATCGTG-CAAACACCGTGAA-CttACTTATGCCcTCTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------AT--GAT-G--GCAGCTCCCTTCAAGGAG-TTG-CC-TTTG-T-GA--GTGCGC--AGGTCAGGGGTTGT---CTCCTTTTGG-TGTCAATTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTCGCCTTTCAGGC-TTAAAGG-TTT-ACC-GG-TTGTGAGGGGTGGCTTTCAA-CAAC---TT--C----AAAA-C-A [...]
+		</sequence>
+		<sequence>
+			<taxon idref="T_rebouxia_jamesii_AF128271"/>
+			NNNNNNNNNNNAATC-TATCGTG-CACACACCGAGAA-CCTACTTATGCCCTCTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATCAG-C-G--GCAGCTCTTTTCAAG-AG-TTG-CC-TTTG-T-GA--GTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGATTGGGCGGGTCCAACATCAATT-GGGA-CCTTTCTGCCTGTTAGGCGGTAA-GG-TCT-GCC-GG-TTGTGAGGGGTGGCTTTCAA-CAAC---CA--C----AAA--C-A [...]
+		</sequence>
+		<sequence>
+			<taxon idref="T_rebouxia_galapagensis_AJ249567"/>
+			AAGGATCATTGAATC-TATCGTG-CCAACACCGCGAA-CTTTCTAATGCCCTC-CTG-T---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CAT--GTTAGC-----CTTTTGAAAAAAGGCTTGACTGT--G---GCAGGTGCGT-AAGG-CAGGGGCTGGCA--TC-TTATGG-TGTCGGTTAGCCTGTCTGGGCGGGTCCAATATCAATTGGGGG-CCTCTTGGCC--ACTGG--GTAAGGGGACT-GCCCGA-TTGTGAGGGGTGGCT-GT---CAA--TCCACACT--CAACA-CAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_higgensiae_AJ249574"/>
+			NNNNNNNNNNNNNNN-NNNNNNG-NCAACACCGCGNA-CTTTCTAATGCCCTC-CTG-T---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CAT--GTTAGC-----CTTTTGAAAAAAGGCTTGACTGT--G---GCAGGTGCGT-AAGG-CAGGGGCTGGCA--TC-TTATGG-TGTCGGTTAGCCTGTCTGGGCGGGTCCAATATCAATTGGGGG-CCTCTTG-CCC-ACTGG-GGTAAGGGGACTTGCCCGA-TTGTNAGGGGTGGCT-GT---CAA--TCCACACT--CAACA-CAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_usneae_AJ249573"/>
+			AAGGATCATTGAATC-TATCGTN-CCAACACCGNNNA-CTTACTGATGCCCTCT-TGCTA---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------AA--GACAGT-----CTTCCAACAAAAGACTTGTC--TT-G---GTAAGTGCGT--AGGTCAGGGGCCGGCA--TC-TTATGG-TGTCGGTTAGCCTGACTGGGCGGGTCCAATACCAATCCGGGG-CCCTTTA-CCTTACAAG---TGAAGGGACT-GCCTGGGTTGTGAGGGGTGGCT-GTTT--AA--CCC--ACTTGCAAT--CAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_corticola"/>
+			AAGGATCATTGAATC-TATCGTG-CCAACACCGCNAA-CTTACTGATGCCCTCT-TGCTA---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------AA--GACAGT-----CTTCCAACAAAAGACTTGTC--TT-G---GTAAGTGCGT--AGGTCAGGGGCCGGCA--TC-TTATGG-TGTCGGTTAGCCTGACTGGGCGGGTCCAATACCAATCCGGGG-CCCTTTA-CCTTACAGG---TGAAGGGACT-GCCTGGGTTGTGAGGGGTGGCT-GTTT--AA--CCC--ACTTGCAAT--CAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_usneae_Z68702"/>
+			AAGGATCATTGAATC-TATCGTG-CCAACACCGCGAA-CTTACTTATGCCCTC-CTGTTA--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------TAG--G-CATG-----CT-----CAAAAGGC--GT--GCC-TA-GATGGGTGCGT-AASS-CAGGGGCAGGCA--TC-TTATGG-TGTCAGTTAGCCTGGCTGGGCGGGTCCAACACCAATC-GGGG-CCTTTTG-CCTTTCAGG---CAAAGGGACTCGCTCGG-TTGTGAGGGGTGGCT-GTTT--AA--CTT--ACTTCCAAT--CAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_impressa_AJ249570"/>
+			AAGGATCATTGAATC-TATCGTG-CCCACACCGTGAA-CC-ATTTATGCCCTTTCTG-AA---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------AG--G-CAG------CTCTTGA-AAGGG-A--GTTTGCC-GATTGAAA--GCGC--AGGTCAGGGGCCG-CAGCTC--TTTGGCTGTCGGTTGACTTGACTGGGCGGGTCCAATACCAGTT-GGGTTCCTCT-TGCCTT---GGC-TTG-AGGTTC---CT-GG-CTGTGAGGGGTGGCTTG-----AAA-AAC--TCTT--AA--GCAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_impressa_AJ249576"/>
+			AAGGATCATTGAATC-TATCGTG-CCCACACCGTGAA-CC-ATTTATGCCCTTTCTG-AA---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------AG--G-CAG------CTCTTGA-AAGGG-A--GTTTGCC-GATTGAAA--GCGC--AGGTCAGGGGCCG-CARCTC--TTTGGCTGTCGGTTGACTTGACTGGGCGGGTCCAATACCAGTT-GGGTTCCTCT-TGCCTT---GGC-TTG-AGGTTC---CT-GG-CTGTGAGGGGTGGCTTG-----AAA-AAC--TCTT--AA--GCAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_flava"/>
+			AAGGATCATTGAATC-TATCGTG-CCCACACCGTGAA-CC-ATTGATGCCCTTTCTG-AA---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------AG--G-CAG------CTCCTGA-AAGGG-A--GTTTGCT-GATTGAAA--GCGC--AGGTCAGGGGCCG-CAGCTC--TTTGGCTGTCGGTTGACTTGGCTGGGCGGGTCCAATACCAGTT-GGGTTCCTCT-TGCCTT---GGC-TTG-aGGTTC---CT-GG-CTGTGAGGGGTGGCTTG-----AAA-AAC--TCTT--AA--GCA- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_potteri"/>
+			AAGGATCATTGAATC-TATCGTG-cCCACACCGTGAA-Cc-AttTATGCCCTTTCTG-AA---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------AG--G-CAG------CTCCTGA-AAGGG-A--GTTTGCC-GATTGAAA--GCGC--AGGTCAGGGGCTG-CAGCTC--TTTGGCTGTCAGTTGACTTGGCTGGGCGGGTCCAATACCAGTT-GGGTTCCTCT-TGCCTT---GGC-TTG-AGGTTC---CT-GG-CTGTGAGGGGTGGCTTG-----AAA-CAC--TCTT--AA--GCAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_from_U_arizonica"/>
+			AAGGATCATTGAATC-TATcGTG-CCCACACCGTGAA-CC-ATTTATGCCCTCTCTG-AA---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------AG--G-CAA------TTGCTGA-AAGGC-A--A-TTGCC-GAGTGAGA--GCGC--AGGTCAGGGGCTG-CAGCTC--TTTGGCTGTCAGTTGACTTGGCTGGGCGGGTCCGATACCAGTT-GGGTTCCTCT-TGCCTTT--GGC-TTG-AGGTTG---CC-AG-CTGTGAGGGGTGGCTTG-----AAA-AAC--TTTT--AA--GCGA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_gelatinosa_Z68698"/>
+			AAGGATCATTGAATC-TATCGTA-CCAACACCGCGAA-CC-ATTGATGTCCTCTC---AATTTACCCAGCAGGGTGCCGCGATACGTGCCGCT-----------------------------------------------------------------------------------------------------------TAATGGCATTGCCCATAAAGGGGTCCACGATACGTGCTGCAGCATTGCCTATAAAGGGGCCCGCGATACGTGCCT-----G--GACATT-G-AG-T-TT-A-AAGGGTA--AACTGCT-GGT-GAGA--GCGC--AGGTCAGGGGCTG-CAGCTC--TTTGGCTGT-AGTTGACTTGGCTGGGCGGGTCCAATACCAATT-GGGTTCCTCTCCTGTTTC--GGTTA-G-AGGTT---ACTCAG-CTGTGAGGGGTGACTTG------ACCAAC--AATT--AA--GC-- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_gelatinosa_Z68697"/>
+			AAGGATCATTGAATCGTATCGTATCCCACACCGCGAA-CC-ATTGATGTCCTCTC---AATTTACCCAGCAGGGTGCCGCGATACGTGCTGTT------------------------------------------------------------------------------------------------------------AATGGCATTGCCTAAAAAGGGGTCCACGATACGTGCTACGGCATTGAGTTTAAAGGGGCCCGCGATACGTGCCT----AG--G-CATT-G-AG-T-TT-A-AAGGGTA--ACCTGCT-GGT-GAGA--GCGC--AGGTCAGGGGCTG-CAGCTC--TTTGGCTGT-AGTTGACTTGGCTGGGCGGGTCCAATACCAATT-GGGTTCCTCTTCGCCTTT--GGCTAAG-AGGCT---ACTCAG-CTGTGAGGGGTGACTTG------ATCAAC--TATT--AA--GC-- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_gelatinosa_AJ249575"/>
+			AAGGATCATTGAATC-TATCGTN-CCCACACCGCGAA-CC-ATTTATGTCCTCTC---AATTTACCCAGCAGGGTGCCGCGATACGTGCTGTT-------------------------------------ACTGCATTGCCCATAAAGGGGTCCAATTTACCC----------AGC--AGGGTGCC-GCGATACGTGCTGTTACTGCATTGCCCATAAAGGGGTCCACGATACGTGCTGTAGCATTGTCCATAAAGGGGCCCGCGATACGTGCCT----AG--G-CATT-G-AG-T-TT-A-AANNTTA--AACTGCT-GGT-GAGA--GCGC--AGGTCAGGGGCTG-CAGCTC--TTTGGCTGT-AGTTGACTTGGCTGGGCGGGTCCAATACCAGTG-GGGTTCCTCTTTGCTTTT--GGCTTAG-AGGTT---ACTCAG-CTGTGAGGGGTGACTTG------ACCAAC--TATT--AA--GC-- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_gelatinosa_AJ249568"/>
+			AAGGATCATTGAATC-TATCGTA-CCCACACCGCGAA-CC-ATTAATGTCCTCTCTGGAATTTACCCAGCAGGGTGCCGCGATACGTGCTGTTGATAATTTACCCAGCAGGGCCGCGATACGTGCTGTTGATGGCATTGCCCAAAAAGGGGTCCACGATACGTGCTGTAGCATTGCGAAAGGGGCCCACGATACGTGCT---TCGGCATTGCCTAAAAAGGGGTCCACGATACGTGCTACAGCATTGAGTTTAAAGGGGCCCGCGATACGTGCCTGAAGAG--G-C-GT---TT-TACT---AAGGGTA--AACTGCT-GGT-GAGA--GCGC--AGGTCAGGGACTG-CAGCTC--TTTGGCTGT-AGTTGACTTGGCTGGGCGGGTCCAATACCAATT-GGGTTCCTCTTTGCCTTT--GGCTGAG-AGGCT---ACTCAG-CTGTGAGGGGTGACTTG------ACCAAC--TGTT--AA--GC-- [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_gigantea"/>
+			aAGGATCATTGAATC-TATCGTG-CCCACACTGCGAAAAT-ACTTATGCCCTT-CTGGAG--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------TAG--G-CAG----A-CTTT----------ATTGTTTGCT-CTTCG-G-TTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTtGACTGGGCGGGTCCAATACCAGCC-GGACTCACCT-TGCCTTCTAGGC-TTG-GGGTTCT-GCC-GG-TTGTGAGGGGTGGCT-GTTT--AACCCAC--TTT---AA--GCAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_gigantea_AJ249577"/>
+			NNNNNNNNNNNNNNNNNNNNNNN-NCCACACTGCGAAA-T-ACTTATGCCCTT-CTGGAG--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------TAG--G-CAG----A-CTTT----------ATTGTTTGCT-CTTCG-G-TTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAATACCAGCC-GGACTCACCT-TGCCTTCTAGGC-TTG-GGGTTCT-GCC-GG-TTGTGAGGGGTGGCT-GTTT--AACCCAC--TTTT--AA--GCAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_showmanii"/>
+			AAGGATCATTGAATC-TATCGTG-CCCACACCGCGAAAAT-ACTTATGCCCTT-CTGGAA--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CAA--G-CAA----A-CTCA----------ACAGTTTGTT-CTTC-AG-TTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAATACCAGTC-GGATTCACCT-TGCCTTATAGGC-TAG-GGGTTCT-GCC-GG-CTGTGAGGGGTGGCT-GCTC--AACTCAC--TCT---AA--GCAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_asymmetrica_AJ249581"/>
+			AAGGATCATTGAATC-TATCGTG-CCCACACCGCGAAACT-ACTTATGCCCTT-CTGGAA--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CCG--G-CAA----A-CTTT----------ATTGTTTGCC-CTTC-AG-TTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAACACCAGCC-GGACTCACCT-TGCCTTTTGGGC-TTG-GGGTTCT-GCC-GG-CTGTGAGGGGTGGCT-GTTT--AACCCAC--TTTT--AA--GCAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_sp_AJ249572"/>
+			AAGGATCATTGAATC-TATCGTG-CCCACACCGCGAA-CTTACTTATGCCCTT-CTGGAA--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CAG--G-CAG----A-CTTT----------GTTGTTTGCC-CTTC-AG-TTGCGT--AGGTCAGGGGTTGG---CTCCTTTTGG-TGTCAGTTCACTTGACTGGGCGGGTCCAACACCAGCC-GGATTCACCT-TGCCTTCTAGGC-TTG-GGGTTCT-GCC-GG-CTGTGAGGGGTGGCT-GTTT--AACTCAC--ATT---AA--GCAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_arboricola_AJ249564"/>
+			AAGGATCATTGAATC-TATCGTG-CCCACACCGCGAAAAT-ACTTATGCCCTT-CTGGGG-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------TCAG----CAA--G---CTTT----------ACTGCTTGCT-CTTC-AG-TTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAACACCAGCC-GGATTCACCT-TGTCT-CT-GGC-AAG-GGGTTCT-GCC-GA-CTGTGAGGGGTGGCT-GTTT--AACTCAC--TTT---AA--GCAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_arboricola_AJ249481"/>
+			AAGGATCATTGAATC-TATCGTG-CCCACACCGCGAAAAT-ACTTATGCCCTT-CTGGGG-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------TCAG----CAA--G---CTTT----------ACTGTTTGCT-CTTC-AG-TTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAACACCAGCC-GGATTCACCT-TGTCT--TGGGC-AAG-GGGTTCT-GCC-GG-CTGTGAGGGGTGGCT-GTTT--AACTCAC--TTT---AA--GCAA [...]
+		</sequence>
+		<sequence>
+			<taxon idref="Trebouxia_arboricola_Z68703"/>
+			AAGGATCATTGAATC-TATCGTG-CCCACACCGCGAAAAT-ACTTATGCCCTT-CTGGGG-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------TCAG----CAA--G---CTTT----------ACTGTTTGCT-CTTC-AG-TTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAACACCAGCC-GGATTCACCT-TGTCT-CT-GGC-AAG-GGGTTCT-GCC-GG-CTGTGAGGGGTGGCT-GTTT--AACTCAC--TTT---AA--GCAA [...]
+		</sequence>
+	</alignment>
+
+	<!-- The unique patterns for all positions                                   -->
+	<!-- npatterns=69                                                            -->
+	<patterns id="patterns" from="1">
+		<alignment idref="alignment"/>
+	</patterns>
+
+	<!-- This is a simple constant population size coalescent model              -->
+	<!-- that is used to generate an initial tree for the chain.                 -->
+	<constantSize id="initialDemo" units="substitutions">
+		<populationSize>
+			<parameter id="initialDemo.popSize" value="0.0001"/>
+		</populationSize>
+	</constantSize>
+
+	<!-- Generate a random starting tree under the coalescent process            -->
+	<coalescentTree id="startingTree">
+		<taxa idref="taxa"/>
+		<constantSize idref="initialDemo"/>
+	</coalescentTree>
+
+	<treeModel id="treeModel">
+		<coalescentTree idref="startingTree"/>
+		<rootHeight>
+			<parameter id="treeModel.rootHeight"/>
+		</rootHeight>
+		<nodeHeights internalNodes="true">
+			<parameter id="treeModel.internalNodeHeights"/>
+		</nodeHeights>
+		<nodeHeights internalNodes="true" rootNode="true">
+			<parameter id="treeModel.allInternalNodeHeights"/>
+		</nodeHeights>
+	</treeModel>
+
+	<!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+	<hkyModel id="hky">
+		<frequencies>
+			<frequencyModel dataType="nucleotide">
+				<alignment idref="alignment"/>
+				<frequencies>
+					<parameter id="hky.frequencies" dimension="4"/>
+				</frequencies>
+			</frequencyModel>
+		</frequencies>
+		<kappa>
+			<parameter id="hky.kappa" value="1.0" lower="0.0"/>
+		</kappa>
+	</hkyModel>
+
+	<!-- site model                                                              -->
+	<siteModel id="siteModel">
+		<substitutionModel>
+			<hkyModel idref="hky"/>
+		</substitutionModel>
+        <gammaShape gammaCategories="4">
+              <parameter id="siteModel.shape" value="0.5" lower="0.0" upper="1000.0"/>
+        </gammaShape>
+        <proportionInvariant>
+                <parameter id="siteModel.pInv" value="0.5" lower="0.0" upper="1.0"/>
+        </proportionInvariant>
+		<mutationRate>
+			<parameter id="siteModel.mu" value="1.0" lower="0.0"/>
+		</mutationRate>
+	</siteModel>
+
+	<treeLikelihood id="treeLikelihood">
+		<patterns idref="patterns"/>
+		<treeModel idref="treeModel"/>
+		<siteModel idref="siteModel"/>
+	</treeLikelihood>
+
+	<operators id="operators">
+        <!-- proportions invariant -->
+        <scaleOperator scaleFactor="0.75" weight="1">
+                <parameter idref="siteModel.pInv"/>
+        </scaleOperator>
+        <!-- gamma shape parameter -->
+        <scaleOperator scaleFactor="0.75" weight="1">
+                <parameter idref="siteModel.pInv"/>
+        </scaleOperator>
+        <!-- standard operators -->
+		<scaleOperator scaleFactor="0.5" weight="1">
+			<parameter idref="hky.kappa"/>
+		</scaleOperator>
+		<scaleOperator scaleFactor="0.5" weight="1">
+			<parameter idref="treeModel.rootHeight"/>
+		</scaleOperator>
+		<uniformOperator weight="10">
+			<parameter idref="treeModel.internalNodeHeights"/>
+		</uniformOperator>
+		<subtreeSlide weight="5" gaussian="true" size="1.0">
+			<treeModel idref="treeModel"/>
+		</subtreeSlide>
+		<narrowExchange weight="1">
+			<treeModel idref="treeModel"/>
+		</narrowExchange>
+		<wideExchange weight="1">
+			<treeModel idref="treeModel"/>
+		</wideExchange>
+		<wilsonBalding weight="1">
+			<treeModel idref="treeModel"/>
+		</wilsonBalding>
+	</operators>
+
+	<mcmc id="mcmc" chainLength="1000000" autoOptimize="true" preBurnin="0">
+		<compoundLikelihood id="likelihood">
+			<treeLikelihood idref="treeLikelihood"/>
+		</compoundLikelihood>
+		<operators idref="operators"/>
+		<log logEvery="10000">
+			<column label="Likelihood" dp="4" width="12">
+				<compoundLikelihood idref="likelihood"/>
+			</column>
+			<column label="Root Height" sf="6" width="12">
+				<parameter idref="treeModel.rootHeight"/>
+			</column>
+			<column label="Kappa" sf="6" width="12">
+				<parameter idref="hky.kappa"/>
+			</column>
+		</log>
+		<log logEvery="10000" fileName="testMCMC.log">
+			<compoundLikelihood idref="likelihood"/>
+			<parameter idref="treeModel.rootHeight"/>
+			<parameter idref="hky.kappa"/>
+		</log>
+		<logTree  logEvery="10000" nexusFormat="true" fileName="testMCMC.trees">
+			<treeModel idref="treeModel"/>
+		</logTree>
+	</mcmc>
+</beast>
diff --git a/examples/benchmark/II/experiment.sh b/examples/benchmark/II/experiment.sh
new file mode 100644
index 0000000..41d80d6
--- /dev/null
+++ b/examples/benchmark/II/experiment.sh
@@ -0,0 +1,24 @@
+echo FILE M1044 > times.dat 
+time beastII -overwrite  testHKY1044.xml >> times.dat 2>&1
+echo FILE M1366 >> times.dat 
+time beastII -overwrite  testHKY1366.xml >> times.dat 2>&1
+echo FILE M1510 >> times.dat 
+time beastII -overwrite  testHKY1510.xml >> times.dat 2>&1
+echo FILE M1748 >> times.dat 
+time beastII -overwrite  testHKY1748.xml >> times.dat 2>&1
+echo FILE M1749 >> times.dat 
+time beastII -overwrite  testHKY1749.xml >> times.dat 2>&1
+echo FILE M1809 >> times.dat 
+time beastII -overwrite  testHKY1809.xml >> times.dat 2>&1
+echo FILE M336 >> times.dat 
+time beastII -overwrite  testHKY336.xml >> times.dat 2>&1
+echo FILE M3475 >> times.dat 
+time beastII -overwrite  testHKY3475.xml >> times.dat 2>&1
+echo FILE M501 >> times.dat 
+time beastII -overwrite  testHKY501.xml >> times.dat 2>&1
+echo FILE M520 >> times.dat 
+time beastII -overwrite  testHKY520.xml >> times.dat 2>&1
+echo FILE M755 >> times.dat 
+time beastII -overwrite  testHKY755.xml >> times.dat 2>&1
+echo FILE M767 >> times.dat 
+time beastII -overwrite  testHKY767.xml >> times.dat 2>&1
diff --git a/examples/benchmark/II/testHKY1044.xml b/examples/benchmark/II/testHKY1044.xml
new file mode 100644
index 0000000..57b0bd5
--- /dev/null
+++ b/examples/benchmark/II/testHKY1044.xml
@@ -0,0 +1,283 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beast xmlns="http://www.w3.org/TR/xhtml1/strict" version="2.0" namespace="beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood">
+<data dataType="nucleotide" id="alignment">
+<sequence taxon="Hypoxylon_atroroseum_U32411">
+			
+			?????????????????????????????????????????????????????????????????????????????????????AACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTTA--CGGAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCTCT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGAGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGCAGGGTCTTGGCCTGCCATGGTTACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATTCCGATAC-GGAGAGGTAGTGACGATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Daldinia_concentrica_U32402">
+			
+			????????????????????????????????????????AAGTTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACTGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGTTAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAACCCCGACTCA--CGGAGGG-GTGTATTTATTAGATTAAAAACCAATGNCCTTCGGGGCTCTTT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCNGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGCAGGGTCTTGGCCTGCCATGGTTACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Xylaria_hypoxylon_U20378">
+			
+			??????????????????????????????????????AAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACTTT-ATTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTCA--CGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCCTCGGGGCTTATA--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGCAGGGTCTTGGCCTGCCATGGTTTCAACGGGTAACGGAGGGTTAGGGCTCGANNCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGNAGGNGNNNAAATTACCCAATNCCGACAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Xylaria_curta_U32417">
+			
+			????????????????????????????????????????????????CCATGCATGTCTAAGTATAAGCAA--TTATACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTCA--CGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCCTCGGGGCTTTCT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGCAGGGTCTTGGCCTGCCATGGTTACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Ophiostoma_ulmi_M83261">
+			
+			??????????????????????????????????????????????????ATGCATGTCTAAGTATAAGCAA--TTATACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGCCCCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAACCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCCTCGGGGCTCACT--GGTGATTCATGATAACTTGTCGAATCGCACGGCCTTGCGCCGGCGATGGCTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGATCTGGGCCCGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGGCCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Ophiostoma_piliferum_U20377">
+			
+			?????????????????????????????????????????????????????????TCTAAGTATAAGCAA--TTATACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGCCCCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAACCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCCTCGGNNCTCACT--GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGCNNNNNCGATGGCTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGATCTGGGCCCGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGGNNCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Sordaria_fimicola_X69851">
+			
+			?????????????????????????ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTTTAAGCAA--TTAAACCGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAACCCCGACTTC--GGAAGGG-GTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGNCTTCCT--GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Neurospora_crassa_X04971">
+			
+			TACCTGGTTGATTCTGCCAGTAGTCATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTTTAAGCAA--TTAAACCGCGAAACTGCGAATGGCT-CATTAAATCAGTTATAGTTTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAACCCCGACTTC--GGAAGGG-GTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTAACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Chaetomium_globosum_U20379">
+			
+			??????????????????????????????????????AAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACCGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGNCCTTCGGGGCTCTCT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATNCCGACAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Cercophora_septentrionalis_U32400">
+			
+			????????????????????????????????????????????????????????????????????????????????????AAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT-GCTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGNCCTTCGGGGCTCTCT--GGTGATTCATAATAACTTCTCGAATNNCANGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Gaeumannomyces_graminis_var_graminis">
+			
+			?????????????????????????????????????????????????????????TATAAGTTTAAGCAA--TTATACAGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAACCCCGACTTC--GGAAGGG-GTGTATTTATTAGATTAAAANCCAATGCCCTTCGGGGCTCACT--GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAAACGCCTGAGAAACGGCGTTTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATGCCGACAC-GGCGAGGTAGTGACGAGAAATACTGA [...]
+		</sequence>
+<sequence taxon="Magnaporthe_salvinii_U78546">
+			
+			?????????????????????????????????????????????????????????TCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAACCCCGACTTC--GGAAGGG-GTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAAACGCCTGAGAAACGGCGTTTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATGCCGACAC-GGCGAGGTAGTGACGAGAAATACTGA [...]
+		</sequence>
+<sequence taxon="Pyricularia_grisea_793">
+			
+			?????????????????????????????????????????????????????????TCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAACCCCGACTTC--GGAAGGG-GTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAAACGCCTGAGAAACGGCGTTTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATGCCGACAC-GGCGAGGTAGTGACGAGAAATACTGA [...]
+		</sequence>
+<sequence taxon="Magnaporthe_grisea_Guy_11">
+			
+			??????????????????TGTAGTCATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAACCCCGACTTC--GGAAGGG-GTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAAACGCCTGAGAAACGGCGTTTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATGCCGACAC-GGCGAGGTAGTGACGAGAAATACTGA [...]
+		</sequence>
+<sequence taxon="Hypocrea_pallida_U32408">
+			
+			?????????????????????????????????????????????????????????????????????????????????GCGAAACTGCGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAATACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTTC--GGAAGGG-TTGTATTTATTAGATTAAAAACCAATGNCCTCTGGGGCTCTCT--GGTGAATCATGATAACTTGGCGAATCGACAGGCCTTGTGCCGGCGATGGCTCATTCAAATTTCTTCCCTATCAACTTTTGATGTTTGGGTATTGGCCAAACATGGTGGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Nectria_cinnabarina_U32412">
+			
+			?????????????????????????????????????????????????????????????????????????????????????????????????CT-CATTATATAAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTCCGGGGCTCACT--GGTGATTCATGATAACTCCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTATTGGCCAAACATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Hypomyces_polyporinus_U32410">
+			
+			????????????????????????????????????????????????????????????????????????????????????AAACTGCGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAATACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTTC--GGAAGGG-TTGTATTTATTAGATTAAAAACCAATGNCCTCTNGGGCTCTCT--GGTGAATCATGATAACTAGTCGAATCGACAGGCCTTGTGCCGGCGATGGCTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTATTGGCCAAACATGGTGGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Claviceps_purpurea_U44040">
+			
+			??????????????????????????????????????????????????ATGCATGTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAATCCCGACTTA--CGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTCT-GGGCTCTCT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTAGTGGCCAAACATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Glomerella_cingulata_U48427">
+			
+			????????????????????????????????????????????????????????GTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTTA--CGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGCTAGAGTAGTGTTCTAGCATGGTTACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACGATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Colletotrichum_gloeosporioides_U76339">
+			
+			??????????????????????????????????????????????????ATGCATGTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTTA--CGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGCTAGAGTAGTGTTCTAGCATGGTTACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGNAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACGATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Microascus_trigonosporus_L36987">
+			
+			??????????????????????????????????????AAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACCGCGAAACTGCGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAGCACGTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAACCCCGACTTC--GGAAGGG-GTGTATTTATTAGATTAAAAGCCAANGCCCTTCGGGGCTCTGT--GGTGATTCATGATAACTTTTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGCGAGGGTCTTGTCCTCGCATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-NGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Petriella_setifera_U32421">
+			
+			??????????????????????????????????????AAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACCGCGAAACTGCGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAGCACATT-ACTACATGG-ATAACTGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAGCCAATGNCCTTCGGGGCTTCCT--GGTGATTCATAATAACTTTTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGCGAAGGTATTGTCTTCGCATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Ceratocystis_virescens_U32419">
+			
+			????????????????????????????????????????????????????????????AAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAGCACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTCA--CGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTTTCT--GGTGATTCATGATAACTTCTCGAATCGCATGGCCTTGCGCNGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGCGAAGGTTTTGTCTTCGCATGGTTACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAGGGAGCCTGAGAAATGGCTACCACTTTTAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATNCTGA [...]
+		</sequence>
+<sequence taxon="Ceratocystis_fimbriata_U32418">
+			
+			?????????????????????????????????????????????AAGCCATGCATGTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAGCACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGNCCTTCGGGGCTTTCT--GGTGATTCATGATAACTTCTCGAATCGCATGGCCTTGCGCNGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGCGAAGGTCTTGTCTTCGCATGGTTACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAGGGAGCCTGAGAAATGGCTACCACTTTTAAGGAAGGCAGCAGGCGCGCAATTTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Leucostoma_persoonii_M83259">
+			
+			??????????????????????????????????????????????????ATGCAAGTCTAAGTTTAAGCAC--CTAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Diaporthe_phaseolorum_L36985">
+			
+			????????????????????????????????????????????????????????????????????????A--TAAACGGCGAAACTNNNAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCNGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCNNGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Melanconis_marginalis_ATCC56907">
+			
+			????????????????????????????????????????????????????????????????????????????????????????????????????CATTAAATCAGTTATCGTATATTTGATAGTTCCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAACCCCGACTTC--GGAAGGG-GTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCNATAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Gnomonia_setacea">
+			
+			?????????????????????AGTCATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACA--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAG-TAG-GACAATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Valsa_ambiens_subsp._leucostomoides">
+			
+			?????????????????TTGTAGT-ATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACC--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAG-TAGTGACAATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Cryptodiaporthe_corni">
+			
+			????????????????TTGTTAGTCATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGTAAC--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAG-TAGTGACAATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Apiognomonia_supraseptata">
+			
+			????????????????????????????????????????????????????????????????????????????AAACGGCGAAACTGCGAACGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACTT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCCCT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACACAATGCCGATTC-GGCGATGTAGTGACAATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Amphiporthe_castanea">
+			
+			????????????????TTGNAAGTCATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACA--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Phomopsis_longicolla_U78778">
+			
+			?????????????????????????????????????????????????????????TCTAAGTTTAAGCACA--TAANCGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Cryphonectria_parasitica_713">
+			
+			??????????????????TGTAGTCANANGCTAGTCTCNAAGANTAAGCCATGCAAGTNTAAGTTTAAGCACC--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATANCCGTGGTAATTCNAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAG-TAGTGACAATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Endothia_gyrosa_L42443">
+			
+			????????????????????????????????????????????TAAGCCATGCAAGTCTAAGTTTAAGCACC--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Endothia_eugeniae">
+			
+			?????????????????TGTAAGTCATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACC--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Plagiostoma_euphorbiae">
+			
+			???????????????TGTAAANCANATACGCNTGTCTNAAANTTTAACCCANGCAAGTNTAAGTTTAAGCACA--TACGCGGCGAATCTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTTC--GGAAGGA-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGAAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Pleuroceras_pleurostylum">
+			
+			?????????????????TGNAANNCATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACA--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAACCCCGACTTC--GGAAGGG-GTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Gnomonia_padicola">
+			
+			?????????????????TGNAAGGCATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACA--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTCC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTATCCAATCCCGACAC-GGGGAGATAGTGACAATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Apioplagiostoma_aceriferum">
+			
+			????????????????TTGTAAGTCATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACA--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAACCCCGACTTC--GGAAGGG-GTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Apiosporopsis_carpinea">
+			
+			?????????????????TGAAAGTCATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACA--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Linospora_capreae">
+			
+			?????????????????TGGAANGCATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACA--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAACCCCGACTTC--GGAAGGG-GTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Discula_quercina">
+			
+			?????????????????????????ATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACA--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAG-TAGTGACAATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Discula_campestris">
+			
+			????????????????????????TATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACA--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAG-TAGTGACAATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Discula_fraxinae">
+			
+			?????????????????????TAATATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACA--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAG-TAGTGACAATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Discula_destructiva_MD254">
+			
+			???????????????????????TCATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACA--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAGGTAGTGACAATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Discula_sp._326">
+			
+			???????????????????????T-ATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACA--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAG-TAGTGACAATAAATACTGA [...]
+		</sequence>
+<sequence taxon="Saccharomyces_cerevisiae_Z75578">
+			
+			TATCTGGTTGATCCTGCCAGTAGTCATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA-TTTATACAGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTTCCTTTACTACATGGTATAACTGTGGTAATTCTAGAGCTAATACATGCTTAAAATCTCGACCCTTTGGAAGAG-ATGTATTTATTAGATAAAAAATCAATG-TCTTC-GGACTCTTT--GATGATTCATAATAACTTTTCGAATCGCATGGCCTTGTGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCTAATTCA-GGGAGGTAGTGACAATAAATAACGA [...]
+		</sequence>
+<sequence taxon="Candida_albicans_E15168">
+			
+			TATCTGGTTGATCCTGCCAGTAGTCATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA-TTTATACAGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTGTTTGGAAGGG-ATGTATTTATTAGATAAAAAATCAATG-CCTTC-GGGCTCTTT--GATGATTCATAATAACTTTTCGAATCGCATGGCCTTGTGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATTCAGGGGAGGTAGTGACAATAAATAACGA [...]
+		</sequence>
+<sequence taxon="Ambrosiozyma_platypodis_L36984">
+			
+			?????????????????????????????????????????????AAGCCATGCATGTCTAAGTATAAGCAA--TTATACAGTGAAACTGCGAATGGCTACATTAAATCAGTTANNGTTTATTTGATAGTTCCTTTACTACATGG-ATAACCGTGGTAATTCTTCGGCCAATACATGCTTAAAACCCCGACTCT--GGGAGGG-NNGCATTTATTAGATAAAAAATCAATGTCCTTCGGAACTTTTT--GATGATTCATAATAACTTTACGAAGCTCATGGCCTTGTGCTGGAGCTGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTTTACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCTGACACA-GGGAGGTAGTGACAATATATAACGA [...]
+		</sequence>
+</data>
+    <!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+    <input spec='HKY' id='hky'>
+        <kappa idref='hky.kappa'/>
+        <frequencies id='freqs' spec='Frequencies'>
+            <data idref='alignment'/>
+        </frequencies>
+    </input>
+
+    <!-- site model                                                              -->
+    <input spec='SiteModel' id="siteModel" gammaCategoryCount='1'>
+        <!--
+            <parameter name='shape' id='shape' value='0.5'/>
+            <parameter name='proportionInvariant' id='propInvar' value='0.2'/>
+        -->
+        <substModel idref='hky'/>
+    </input>
+
+    <input spec='TreeLikelihood' id="treeLikelihood">
+        <data idref="alignment"/>
+        <tree idref="tree"/>
+        <siteModel idref="siteModel"/>
+    </input>
+
+    <parameter id="hky.kappa" value="1.0" lower="0.0"/>
+
+    <tree id='tree'/>
+
+    <tree spec='beast.util.ClusterTree' id='upgmatree' clusterType='upgma' initial='@tree'>
+        <taxa idref='alignment'/>
+    </tree>
+    <tree spec='beast.evolution.tree.RandomTree' id='coalescentSimulator' initial='@tree' taxa='@alignment'>
+        <populationModel spec='ConstantPopulation'>
+            <popSize spec='parameter.RealParameter' value='1'/>
+        </populationModel>
+    </tree>
+
+
+    <run spec="MCMC" id="mcmc" chainLength="5000000" preBurnin="0">
+
+        <init idref='coalescentSimulator'/>
+        <distribution spec='CompoundDistribution' id='posterior'>
+<!--
+	make it comparable to the files in the BEAST 1 directory, that do not use a prior either
+            <distribution spec='beast.math.distributions.Prior' x='@hky.kappa'>
+                <distr spec='beast.math.distributions.OneOnX'/>
+            </distribution>
+-->
+            <distribution id='likelihood' idref="treeLikelihood"/>
+        </distribution>
+
+        <operator id='kappaScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" parameter="@hky.kappa"/>
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" tree="@tree"/>
+
+        <operator spec='SubtreeSlide' weight="5" gaussian="true" size="1.0" tree="@tree"/>
+
+        <operator spec='Uniform' weight="10" tree="@tree"/>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="1" tree="@tree"/>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="1" tree="@tree"/>
+        <operator spec='WilsonBalding' weight="1" tree="@tree"/>
+
+        <logger logEvery="10000" fileName="test.log">
+            <model idref='likelihood'/>
+            <log idref="likelihood"/>
+            <log idref='hky.kappa'/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+        </logger>
+        <logger logEvery="10000" fileName="test.trees">
+            <log idref="tree"/>
+        </logger>
+        <logger logEvery="10000">
+            <model idref='likelihood'/>
+            <log idref="likelihood"/>
+            <ESS spec='ESS' name='log' arg="@likelihood"/>
+            <log idref='hky.kappa'/>
+            <ESS spec='ESS' name='log' arg="@hky.kappa"/>
+        </logger>
+    </run>
+</beast>
+
diff --git a/examples/benchmark/II/testHKY1366.xml b/examples/benchmark/II/testHKY1366.xml
new file mode 100644
index 0000000..93ce819
--- /dev/null
+++ b/examples/benchmark/II/testHKY1366.xml
@@ -0,0 +1,247 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beast xmlns="http://www.w3.org/TR/xhtml1/strict" version="2.0" namespace="beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood">
+<data dataType="nucleotide" id="alignment">
+<sequence taxon="Zodiomyces_vorticellarius">
+			
+			?????????????????????AGTCATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAAC--TATACCGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCCAAAAA-CCCCGA-CTTA---CGAAGGGGTGTGTTTATTAGATAGCAAACCAATGCCCTTTTGGGCTC??TGTGGTGATTCATGATAACTTAACGTAGCGCATGGCCTTGCGCCGGCGCAGGATCATTCAAATACCTGCCCTATCAAGTTTCGATGTGAGGGTAGTGTCCTCACATGCTTTTGACGGGTAACGGGGAATTAGGGTTCGACTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAAGTAGTGACAAGAAATAC [...]
+		</sequence>
+<sequence taxon="Xylaria_hypoxylon">
+			
+			????????????????????????????????TGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACTTT--ATTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGA-CTCA---CGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCCTCGGGGCTTATA--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGCAGGGTCTTGGCCTGCCATGGTTTCAACGGGTAACGGAGGGTTAGGGCTCGA??CCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAG?AGG?G???AAATTACCCAAT?CCGACAC-GGGGAGGTAGTGACAATAAATAC [...]
+		</sequence>
+<sequence taxon="Termitaria_snyderi">
+			
+			?????????????????????????????????????????????????????????TCTAAGTTTAAGCAA--GTATACTGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCGAAAAA-CCCCGA-CTTC---GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTTT-GGGCTCTTT--GGTGAATCATAATAACTAAACGAATCGCATGGCCTTGAGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATTGGTGAGTAGTGTTCACCAATGGTGTCGACGGGTAACGAAGAATTAGGGTTCGATCTCGGAGAGGACGCCTGAGAAACGGCGTC-ACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCAATT????????????????????????? [...]
+		</sequence>
+<sequence taxon="Taphrina_deformans">
+			
+			??????????????????????????????????????AAAGATTAAGCCATGCATGTCTAAGTATAAGCAAT--TATACAGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCT-A-ATTACTTGG-ATACCCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGA-CTTCT--GGAAGGGATGTATTTATTAGATAAAAAACCAATGNCCTTCGGG?CTCCTT--GGTGATTCATAATAACTTTACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGAGGCCTACCATGGTTTTGACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCC-GACAC-GGGGAGGTAGTGACAATAAATAA [...]
+		</sequence>
+<sequence taxon="Talaromyces_flavus">
+			
+			?????????????????????????ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCACTCTTTTACTGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCCT--ACTACATGG-ATACCTGTGGTAATTCTAGAGCTAATACATGCGCAAAA-CCCCGA-CTTC---GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTTCGGGGCTCCTT--GGTGAATCATAATAACTTCACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTGGCAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAGGTAGTGACAATAAATAC [...]
+		</sequence>
+<sequence taxon="Stigmatomyces_limnophorae">
+			
+			?????????????????????????CATATGCTTGTCTCAAAGATTAAGCCATGCATGTGTAAGTATAAGCAA-CTATACTGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATGGTACTTT--ACTACTTGG-ATATCCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CTCCAA-CTTA---CGAAGGAGTGTATTTATTAGATATTAAACCAATATTCTTCGGAATTTCT---GGTGATTCATAATAACTTTTCGCAGCGCATAGCTTCATGCTGGTGCGAGATCATTCAAATACCTGCCCTATCAAGTTTCGATGTGAGGGTAGTGTCCTCACATGCTTTTGACGGGTAACGGGGAATTAGGGTTCGACTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCTGACAC-GGGGA?GTAGTGACAAGAAATAC [...]
+		</sequence>
+<sequence taxon="Sphaerostilbella_aureonitens">
+			
+			??????????????????????????????????????????????????????????????????????????????????????????????TGGCT-CATTATATAAGTTATCG?TTATTTGATAATACTTT--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAA?-TCCCGA-CTTC---GGAAGGGTTGTATTTATTAGATTAAAAACCAA?CTCGTCT?GGGCTCTCT--GGTGAATCATGATAACTAGTCGAATCGACAGGCCTTGTGCCGGCGATGGCTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTATTGGCCAAACATGGTGGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATAC [...]
+		</sequence>
+<sequence taxon="Smittium_culisetae">
+			
+			?????????????????????????????????????CAAAGATTAAGCCATGCATGTCTAAGTATAAACAAATTTATACAGTGAAACTGCGAATGGCT-CATTATATCAGTTATAATTTATTTGATGATACCTTTTACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCAAAAAACTCCCGA-CTTCT--GGAAGGGGGGCATTTATTAGATAAAAAACCAATGGGGGCAACCTCTTACTT-GGTGAGTCATAATAACTAAGCATATCGCATGGCCTTGTGCCGGCGAAGGATCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGTATAGAGGACTACCATGGTGGTAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACTTCTAAGGAGGGCAGCAGGCGCGCAAATTACCCAATCCTGACAC-AGGGAGGTAGTGACAATAAATAA [...]
+		</sequence>
+<sequence taxon="Scorias_spongiosa">
+			
+			???????????????????????????????????????????????????????????TAAGTTTAAGCAAC--TATACGGTGAAACTGCGAATGGCT-CATTAAATCAGTTATTGTTTATTTGATAGTACCCTT-AATACATGG-ATACCCGTGGTAATTCTAGAG-TAATACATGCTAAAAA-CCCCGAGTCAC----GAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTTTGGGCTT?CAT--GGTGAATCATAATAACTTAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTATCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATAC [...]
+		</sequence>
+<sequence taxon="Pyxidiophora_SPO3">
+			
+			??????????????????????????????????????AAAGATTAAGCCATGCATGTCTAAGTATAAGCAACT-TATACCGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGA-CTTC---GGAAGGGGTGTATTTATTAGATAAAAAACCA--TCGTCTTCGGACTTCTT--GGTGATTCATAATAACTAAACGTAGCGCATGGCCTTGTGCTGGCGCAAAATCATTCAAATACCTGCCCTATCAAGCTTCGATGTGAGGGTAGTGTCCTCACATGCTTTTGACGGGTAACGGGGAATTAGGGTTCGACTCCGGAGAGGGAGCCTGAGAAATGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAAGAAATAC [...]
+		</sequence>
+<sequence taxon="Pyxidiophora_sp1">
+			
+			??????????????????????????????????TCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAACTTTATACCGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGA-CTTC---GGAAGGGGTGTATTTATTAGATAAAAAACCATCG?-TCTTCGGACTCTTT--GGTGATTCATAATAACTAAACGTAGCGCATGGCCTTGTGCTGGCGCAAAATCATTCAAATACCTGCCCTATCAAGCTTCGATGTGAGGGTAGTGTCCTCACATGCTTTTGACGGGTAACGGGGAATTAGGGTTCGACTCCGGAGAGGGAGCCTGAGAAATGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAAGAAATAC [...]
+		</sequence>
+<sequence taxon="Protomyces_inouyei">
+			
+			??????????????????????????????CTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAAT-TTATACAGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCCT--ACTACTTGG-ATACCCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGA-CTTCT--GGAAGGGATGTATTTATTAGATAAAAAACCAATGC??TTCGGG?CTCCTT--GGTGATTCATAATAACTTTACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGAGGCCTACCATGGTTTTGACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCC-GACAC-GGGGAGGTAGTGACAATAAATAA [...]
+		</sequence>
+<sequence taxon="Petriella_setifera">
+			
+			???????????????????????TCATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACCGCGAAACTGCGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAGCACATT--ACTACATGG-ATAACTGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGA-CTTC---GGAAGGGATGTATTTATTAGATTAAAAGCCAATG?CCTTCGGGGCTTCCT--GGTGATTCATAATAACTTTTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGCGAAGGTATTGTCTTCGCATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATAC [...]
+		</sequence>
+<sequence taxon="Ophiostoma_ulmi">
+			
+			??????????????????????????????????????????????????ATGCATGTCTAAGTATAAGCAA--TTATACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGCCCCTT--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAA-CCCCGA-CTTC---GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCCTCGGGGCTCACT--GGTGATTCATGATAACTTGTCGAATCGCACGGCCTTGCGCCGGCGATGGCTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGATCTGGGCCCGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGGCCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTC-GGGGAGGTAGTGACAATAAATAC [...]
+		</sequence>
+<sequence taxon="Ophiostoma_piliferum">
+			
+			?????????????????????????????????????????????????????????TCTAAGTATAAGCAA--TTATACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGCCCCTT--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAA-CCCCGA-CTTC---GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCCTCGG??CTCACT--GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGC?????CGATGGCTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGATCTGGGCCCGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGG??CCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGC?CGCAAATTACCCAATCCCGACTC-GGGGAGGTAGTGATAATAAATAC [...]
+		</sequence>
+<sequence taxon="Neurospora_crassa">
+			
+			TACCTGGTTGATTCTGCCAGTAGTCATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTTTAAGCAA--TTAAACCGCGAAACTGCGAATGGCT-CATTAAATCAGTTATAGTTTATTTGATAGTACCTT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGA-CTTC---GGAAGGGGTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTAACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATAC [...]
+		</sequence>
+<sequence taxon="Neocallimastix_frontalis">
+			
+			????????????????????TAGTCATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAACAATTCTATACTGTGAAACTGCGAATGGCT-CATTAAATCAGTTATAGTTTATTTGATAGTACCATT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCGTAAAAA-CCCGA-CTTCT--GGAAGGGTTGTATTTATTAGATAAAAAACCAACCTGGGCAACCAGTTTTTT-GGTGATTCATAATAACTTTTCGAATCGTATGACTTTACGTCGACGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGAGGCCTACCATGGTTTTAACGGGTAACGGAGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCTAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCTGACAC-AGGGAGGTAGTGACAATAAATAA [...]
+		</sequence>
+<sequence taxon="Mucor_mucedo">
+			
+			?????????????????????????????????????CAAAGATTAAGCCATGCATGTCTAAGTATAAATAAATTTATATCGTGAAACTGCGAATGGCT-CATTAAATCAGTTATGATCTACGTGACA?TATTCTTTACTACTGGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCAAAAACGCCTCGA-CTTAC--GAAGGGGTGCACTT?ATTAGATAAAG??CCAACGCTGGGTAAAACCATCCTTGGTGATTCATAATAATTTAGCGGAT-GCATGGCCTTGTGCTAGCGACGGTCCACTCGATTTTCTGCCCTATCATGGTTAGATTGTAAGATAGAGGCTTACAATGCCTACAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATAA [...]
+		</sequence>
+<sequence taxon="Morchella_esculenta">
+			
+			??????????????????????????????????????AAAGATTAAGCCATGCAAGTCTAAGTATAAGCAATA-TATACAGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGA-CTTCAC-GGA?GGGGTGTATTTATTAGATAAAAAACCAATG??CCTT?CGGGCTCCTT-GGTGATTCATGATAACTTAACGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATAC [...]
+		</sequence>
+<sequence taxon="Monascus_purpureus">
+			
+			??????????????????????????????????????????????????ATGCATGTCTAAGTGTAAGCAATT-TATACTGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT--ACTACATGG-ATACCTGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGA-CTTC---GGAAGGGGTGTATTTATTAGATAAAAAACCAACGCCCTTCGGGGCTCCTT--GGTGAATCATAATAACTAAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTGGCAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATAC [...]
+		</sequence>
+<sequence taxon="Microascus_trigonosporus">
+			
+			????????????????????????????????TGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACCGCGAAACTGCGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAGCACGTT--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGA-CTTC---GGAAGGGGTGTATTTATTAGATTAAAAGCCAA?GCCCTTCGGGGCTCTGT--GGTGATTCATGATAACTTTTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGCGAGGGTCTTGTCCTCGCATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-?GGGAGGTAGTGACAATAAATAC [...]
+		</sequence>
+<sequence taxon="Melanospora_zamiae">
+			
+			?????????????????????????????????????????????????????????????AGTATAAGCAA--TTATACAGCGAAACT?CGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAGTGCCTT--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAG-CCCCGA-CTTA---CGGAGGGG?CTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCTTT--GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTAGTGGCCAAACATGGTGGCAACGGGTAACGGAGGGTTAGG?CTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTCCTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCTCAACTC-GAGGAGGTAGTGATAATAAATAC [...]
+		</sequence>
+<sequence taxon="Melanospora_fallax">
+			
+			??????????????????????????????????????????????????????????????GTATAAGCA---TTATACCGCGAAACTGCGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAGTACCTT--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAG-CCCCGA-CTTA---CGGAGGGGTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCTCT--GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTCTTGGCCAAACATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTC-GGGGAGGTAGTGACAATAAATAC [...]
+		</sequence>
+<sequence taxon="Leucostoma_persoonii">
+			
+			??????????????????????????????????????????????????ATGCAAGTCTAAGTTTAAGCAC--CTAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT---ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAA-TCCCGA-CTTC---GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATAC [...]
+		</sequence>
+<sequence taxon="Laboulbeniopsis_termitarius">
+			
+			???????????????????????????????????????????????????????????????????????????TATACTGTGAAACTGGGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATGGTACCTT--ACTACATGG-ATAACCGTGGTAATTCTGGAGCTAATACATGCAAATAA-TCTCGA-CGTA---AGAAGGGATGTATTTATTAGATAAAAAACCAATGCCATTTCGGTGGTATG-TGGTGATTCATAATAACTGAACTTAGCGTATGGCCTTTGGCTGACGCAAGATCATTCAAATACCTGCCCTATCAAGTTTCGATGTGAAGGTAGTGTCCTCACATGCTTTTGACGGGTAACGGGGAATTAGGGTTCGACTCCGGAGAGGGAGCCTGAGAAATGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAT-GGGGA?GTAGTGACAAGAAATAC [...]
+		</sequence>
+<sequence taxon="Kathistes_calyculata">
+			
+			??????????????????????????????????????????????????ATGCATGTCTAAGTATAAGCA?--TTATACAGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCCC--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCGCAAAA-GCCCGA-CTTA---CGAAGGGCTGTATTTATTAGATAAAAAACCAATG?CCTCCGGGGCTCTTT--GGTGATTCATAATAACTTAACGAATCGCATGGCCTTGAGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATTGGTGAGTAGTGTTCACCAATGGTGTCGACGGGTAACGAAGAATTAGGGTTCGATCTCGGAGAGGACGCCTGAGAAACGGCGTACACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAAT?CCGATAC-GGGGAGGTAGTGACAATAAATAC [...]
+		</sequence>
+<sequence taxon="Kathistes_analemmoides">
+			
+			??????????????????????????????????????????????????ATGCATGTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCCC--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCGCAAAG-GCCCGA-CTTA---CGAAGGGC?GTATTTATTAGATAAAAAACCAATG?CCTTCGGGGCTTCTT--GGTGATTCATGATAACTTAACGAATCGCATGGCCTTGAGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATTGGTGAGTAGTGTTCACCAATGGTGTCGACGGGTAACGAAGAATTAGGGTTCGATCTCGGAGAGGACGCCTGAGAAACGGCGTACACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAAT?CCGATAC-GGGGAGGTAGTGACAATAAATAC [...]
+		</sequence>
+<sequence taxon="Hesperomyces_coccinelloides">
+			
+			??????????????????????????????????????AAAGATTAAGCCATGCATGTCTAAGTATAAGCATT--TATACTGTGAAACTGCGAATGGCT-CATTAAATCAGTTATTGTTTATTTGATGGTACCTTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGA-CTCA---CGAAGGGGTGTATTTATTAGAT?TC?AAACCAGTGTCCTTCGGGACTTTTT-GGTGACTCATAATAACTTAATGCAGCGCATGGCCTTGTGCCGGCGCGGGATCATTCAAATACCTGCCCTATCAAGTTTCGATGTGAGGGTAGTGTCCTCACATGCTTTTGACGGGTAACGGGGAATTAGGGTTCGACTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGCGCNGTAGTGACAAGAAATAC [...]
+		</sequence>
+<sequence taxon="Graphium_calicioides">
+			
+			???????????????????????TCATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAAT--CATACTGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTTT-ACC---TGG-ATNNCCGTGGTANTTCTAGAGCTAATACATGCTAAAAA-CCCCGA-CTTC---GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTTTGGG?CTCCTT--GGTGATTCATAATAACTTAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATTGTAAGATAGAGGCTTACAATGGTCTTAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATTC-GGGGAGGTAGTGACAATAAATAC [...]
+		</sequence>
+<sequence taxon="Entomophthora_muscae">
+			
+			?????????????????????????????????????CAAAGATTAAGCCATGCATGTCTAAGTATAAGCTAAACCTTACAGTGAAACTGCGAATGGC?-CATTAAATCAGTTATAATTTATTTGATCTTTCCTT--ACCAGT?GG-ATATCCGTGGTAATTCTAGAGCTAATACATATACGCGAAGACCCAACTTCT--GGAAGGGTTGTATTTATTAGATAAAAAACCAATGTGGGCAACCACTTTTTT-GGTGATTCATAGTAACTTTACTGATCGCAATTTATTGCGACATATCATAA??????AAATTTCTGCCCTATCAACTTTCGATGGTAAGGTAGTGGCTTACCATGGTTTTTACGGGTGACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCTGATAC-AGGGAGGTAGTGACAATAAATAA [...]
+		</sequence>
+<sequence taxon="Endomyces_scopularum">
+			
+			??????????????????????????????????????AAAGATTAAGCCATGCATGTCTAAGTATAAGCATT--TATACAGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTACAG?-CCCCGA-CTCA---CGAAGGGGTGTATTTATTAGATAAAAAATCAA????????????CATATT--GATGATTCATAATAACTTGTCGAACCGCATGGCTTCATGCCGGCGGTGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGAGGCCTACCATGGTTTCAACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAGCGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATAA [...]
+		</sequence>
+<sequence taxon="Elaphomyces_maculatus">
+			
+			?????????????????????????????????????????????????????????TCTAAGTATAAGCAATC-TATACGGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT--GCTACATGG-ATACCTGTGGTAATTCTAGAGCTAATACATGCTGAAAA-TCCCGA-CTCC---GGAAGGGATGTATTTATTAGATAAAAAACCAATGCCCTTCGGGGCTTCTT--GGTGATTCATAATAACTGCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTGGCAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATCC-GGGGAGGTAGTGACAATAAATAC [...]
+		</sequence>
+<sequence taxon="Cladonia_subcervicornis">
+			
+			???????????????????????TCATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAATC-TATACGGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT--ACTACTTGG-ATACCTGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCTCGA-CTTC---GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTTCGGGGCTCCTT--GGTGATTCATAATAACTTAACGAATCGCATGGCCTTGAGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGTATAGAGGACTACCATGGTTTCTACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATAC [...]
+		</sequence>
+<sequence taxon="Chytridium_confervae">
+			
+			??????????????????????????????????????AAAGATTAAGCCATGCATGTCTAAGTATAAACAAATTTGTACTGTGAAACTGCGAATGGCT-CATTAAATCAGTTATAGTTTATTTGATAATACCTT--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCAATAAAAGGCCGA-CTTCT--GGAAGGCCTGTATTTATTAGATAAAAAACCAACCCGGAAACGGTTCTTT??-GGTGATTCATAGTAACTTTTCGAATCGCATGACTTTACGTCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGAGGCCTACCATGGTTTTAACGGGTAACGGCGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCTAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCTGATTC-AGGGAGGTAGTGACAATAAATAA [...]
+		</sequence>
+<sequence taxon="Ceramothyrium_linnaeae">
+			
+			??????????????????????????????????????????????????ATGCATGTCTAAGTATAAGCAAT-CTATACTGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTTT-ACC---TGG-ATAACCGTGGTAATTCTAAAGCTAATACATGCTAAAAA-TCCCGA-CTTC---GGAAGGGATGTATTTATTAAATAAAAAACCAATGCCCTTCGGGGCTCCTT--GGTGAATCATAATAACTTAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAAGGTCTTGGCTTACCATGGTCTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAAAGGGAGCCTGAAAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATAAATAC [...]
+		</sequence>
+<sequence taxon="Capnodium_dermatum">
+			
+			????????????????????TAGTCATATGCTTGTCTCAAAGATTAAGCCATGCATGT-TAAGTATAAGCAAC--TATACGGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT--ACTACATGGCATAACCGTGGTAATTCTAGAGCTAATACCCGCTAAAAA-CCCCGA-CTTC---GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTTCGGGGCTCCCT--GGTGAATCATAATAACTTAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAAGATAGTGGCCTACCATGGTATCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGGACGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTGACAATTAATAC [...]
+		</sequence>
+<sequence taxon="Capniomyces_stellatus">
+			
+			??????????????????????????????????????AAAGATTAAGCCATGCATGTCTAAGTATAGACAAATTTATACAGTGAAACTGCGAATGGCT-CATTATATCAGCTATAATTTATTTGATGATACCTTTTACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCACTAAACACTCCGACTTCT--GGAAGGAGAGCATTTATTAGATACAAAACCAATGGGGGCAACCTCTTACTT-GGTGAATCATAATAACT?AAGCATATGCATGGCCTTGAGCCGGCGAAGGATCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGTATAGAGGACTACCATGGTGGTAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACTTCTAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCTGACAC-AGGGAGGTAGTGACAATAAATAA [...]
+		</sequence>
+<sequence taxon="Candida_albicans">
+			
+			??TCTGGTTGATCCTGCCAGTAGTCATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA-TTTATACAGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAA-TCCCGA-CTGTTT-GGAAGGGATGTATTTATTAGATAAAAAATCAATG?CCTTC?GGGCTCTTT--GATGATTCATAATAACTTTTCGAATCGCATGGCCTTGTGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATTCAGGGGAGGTAGTGACAATAAATAA [...]
+		</sequence>
+<sequence taxon="Balansia_sclerotica">
+			
+			?????????????????????????ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTGTACTGCGAAACTGCGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAGTGCCCT--ACTACTTGG-ATAACTGTGGTAATTCTAGAGCTAATACATGCTACAAA-TCCCGA-CTTC---GGAAGGGATGTATTTATTGGATTAAAAACCAATGCCCCCT?GGGCTCTCT--GGTGACTCACGATAACTGCTCGAATCGCACGGCCCTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTAGTGGCCAAACATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAAT?CCGACAC-GGGGAGGTAGTGACAATAAATAC [...]
+		</sequence>
+<sequence taxon="Ascobolus_denudatus">
+			
+			????????????????????????????????????????????????????GCATGTCTAAGTATAAGCAACT-TGTACAGTGAAACTGCNAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAATCCCTT--ACTACATGG-ATACCTGTGGTAATTCTAGAGCTAATACATGCTTCAAGGAGTGGC-TTTC---GTC?ACTCTGCACTTATTAGATAAAAAACCAATGCCCCTTTGGGGCTCCCT-GGTGATTCATAATAATTTAGCGGACCGCATTCCCTCGAGGAGGCGGTGGATCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAGGTAGTGACAATAAATAC [...]
+		</sequence>
+<sequence taxon="Ambrosiozyma_platypodis">
+			
+			?????????????????????????????????????????????AAGCCATGCATGTCTAAGTATAAGCAA--TTATACAGTGAAACTGCGAATGGCTACATTAAATCAGTTA??GTTTATTTGATAGTTCCTTT-ACTACATGG-ATAACCGTGGTAATTCTTCGGCCAATACATGCTTAAAA-CCCCGA-CTCT---GGGAGGG??GCATTTATTAGATAAAAAATCAATGTCCTTCGGAACTTTTT--GATGATTCATAATAACTTTACGAAGCTCATGGCCTTGTGCTGGAGCTGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTTTACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCTGACAC-AGGGAGGTAGTGACAATATATAA [...]
+		</sequence>
+</data>
+    <!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+    <input spec='HKY' id='hky'>
+        <kappa idref='hky.kappa'/>
+        <frequencies id='freqs' spec='Frequencies'>
+            <data idref='alignment'/>
+        </frequencies>
+    </input>
+
+    <!-- site model                                                              -->
+    <input spec='SiteModel' id="siteModel" gammaCategoryCount='1'>
+        <!--
+            <parameter name='shape' id='shape' value='0.5'/>
+            <parameter name='proportionInvariant' id='propInvar' value='0.2'/>
+        -->
+        <substModel idref='hky'/>
+    </input>
+
+    <input spec='TreeLikelihood' id="treeLikelihood">
+        <data idref="alignment"/>
+        <tree idref="tree"/>
+        <siteModel idref="siteModel"/>
+    </input>
+
+    <parameter id="hky.kappa" value="1.0" lower="0.0"/>
+
+    <tree id='tree'/>
+
+    <tree spec='beast.util.ClusterTree' id='upgmatree' clusterType='upgma' initial='@tree'>
+        <taxa idref='alignment'/>
+    </tree>
+    <tree spec='beast.evolution.tree.RandomTree' id='coalescentSimulator' initial='@tree' taxa='@alignment'>
+        <populationModel spec='ConstantPopulation'>
+            <popSize spec='parameter.RealParameter' value='1'/>
+        </populationModel>
+    </tree>
+
+
+    <run spec="MCMC" id="mcmc" chainLength="5000000" preBurnin="0">
+
+        <init idref='coalescentSimulator'/>
+        <distribution spec='CompoundDistribution' id='posterior'>
+<!--
+	make it comparable to the files in the BEAST 1 directory, that do not use a prior either
+            <distribution spec='beast.math.distributions.Prior' x='@hky.kappa'>
+                <distr spec='beast.math.distributions.OneOnX'/>
+            </distribution>
+-->
+            <distribution id='likelihood' idref="treeLikelihood"/>
+        </distribution>
+
+        <operator id='kappaScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" parameter="@hky.kappa"/>
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" tree="@tree"/>
+
+        <operator spec='SubtreeSlide' weight="5" gaussian="true" size="1.0" tree="@tree"/>
+
+        <operator spec='Uniform' weight="10" tree="@tree"/>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="1" tree="@tree"/>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="1" tree="@tree"/>
+        <operator spec='WilsonBalding' weight="1" tree="@tree"/>
+
+        <logger logEvery="10000" fileName="test.log">
+            <model idref='likelihood'/>
+            <log idref="likelihood"/>
+            <log idref='hky.kappa'/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+        </logger>
+        <logger logEvery="10000" fileName="test.trees">
+            <log idref="tree"/>
+        </logger>
+        <logger logEvery="10000">
+            <model idref='likelihood'/>
+            <log idref="likelihood"/>
+            <ESS spec='ESS' name='log' arg="@likelihood"/>
+            <log idref='hky.kappa'/>
+            <ESS spec='ESS' name='log' arg="@hky.kappa"/>
+        </logger>
+    </run>
+</beast>
+
diff --git a/examples/benchmark/II/testHKY1510.xml b/examples/benchmark/II/testHKY1510.xml
new file mode 100644
index 0000000..975ec27
--- /dev/null
+++ b/examples/benchmark/II/testHKY1510.xml
@@ -0,0 +1,227 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beast xmlns="http://www.w3.org/TR/xhtml1/strict" version="2.0" namespace="beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood">
+<data dataType="nucleotide" id="alignment">
+<sequence taxon="Didelphis_virginiana">
+			
+			CCCTATCCAATACAACTAGGTTTCCAAGACGCTACATCTCCTATTATAGAAGAACTTATATACTTTCATGATCATACATTAATAATTGTATTTCTGATCAGTTCACTAGTATTATATATTATTATTCTTATACTTACTACAAAACTTACTCACACAAGCACTATAGATGCCCAAGAAGTGGAAACAATTTGAACAATTTTACCAGCCGTAATTCTTATCCTTATTGCCCTTCCTTCCTTACGAATTCTTTACATAATAGATGAAATCTATAATCCTTATCTAACAGTTAAAGCAATGGGTCATCAATGATATTGAAGCTATGAGTTCACAGACTATGAAAATTTAATATTCGACTCATACATAATCCCAACCAAAGACCTTAGTCCTGGGCAACTTCGTTTACTAGAAGTTGATAACCGAATTGTTCTCCCAATAGAACTACCAATTCGCATGCTAATTTCATCAGAAGACGTTCTCCATGCATGAACA [...]
+		</sequence>
+<sequence taxon="Equus_caballus">
+			
+			GCCTACCCCTTCCAACTAGGATTCCAAGACGCAACATCCCCTATTATAGAAGAACTCCTACACTTCCACGACCACACACTAATAATCGTATTCCTAATTAGCTCTCTAGTATTATATATTATCTCATCAATACTAACAACTAAATTAACCCATACCAGCACCATAGATGCTCAAGAAGTAGAGACAATTTGAACGATTTTACCAGCCATCATCCTTATTCTAATCGCCCTCCCATCCCTACGAATTCTATATATAATAGATGAAATCAATAATCCGTCCCTCACAGTCAAAACAATAGGCCACCAATGATACTGAAGCTACGAGTATACCGATTACGAAGACTTGACCTTTGACTCCTACATGATCCCCACATCAGACCTAAAACCAGGAGAATTACGTCTTCTAGAAGTCGACAATCGAGTGGTTCTCCCCATAGAAATAACCATCCGAATGCTAATTTCATCCGAAGACGTCCTACACTCATGAGCT [...]
+		</sequence>
+<sequence taxon="Rhinoceros_unicornis">
+			
+			GCTTATCCACTTCAACTAGGATTTCAAGATGCAACATCCCCTATTATAGAAGAATTACTCCATTTCCATGACCATACACTGATAATCGTATTTTTAATTAGCTCCCTAGTGCTGTATATTATTTCACTCATGCTAACAACCAAACTAACACACACAAGCACTATAGACGCTCAAGAAGTAGAGACCATCTGAACGATTTTACCAGCTATTATCCTAATTTTAATTGCTCTCCCATCGCTACGAATCCTCTATATAATAGATGAGATTAATAATCCTTCCTTAACCATCAAAACCATAGGCCATCAGTGATACTGAAGCTACGAATATACAGATTATGAAGACCTAACCTTTGACTCCTACATAATTCCCACATCAGATCTAAAACCAGGAGAACTGCGACTTCTAGAAGTCGACAACCGAGTAGTATTACCCATAGAAATAACGATTCGAATGCTAATCTCATCCGAAGACGTTCTCCACTCATGAGCC [...]
+		</sequence>
+<sequence taxon="Bos_tarus">
+			
+			GCATATCCCATACAACTAGGATTCCAAGATGCAACATCACCAATCATAGAAGAACTACTTCACTTTCATGACCACACGCTAATAATTGTCTTCTTAATTAGCTCATTAGTACTTTACATTATTTCACTAATACTAACGACAAAGCTGACCCATACAAGCACGATAGATGCACAAGAAGTAGAGACAATCTGAACCATTCTGCCCGCCATCATCTTAATTCTAATTGCTCTTCCTTCTTTACGAATTCTATACATAATAGATGAAATCAATAACCCATCTCTTACAGTAAAAACCATAGGACATCAGTGATACTGAAGCTATGAGTATACAGATTATGAGGACTTAAGCTTCGACTCCTACATAATTCCAACATCAGAATTAAAGCCAGGGGAGCTACGACTATTAGAAGTCGATAATCGAGTTGTACTACCAATAGAAATAACAATCCGAATGTTAGTCTCCTCTGAAGACGTATTACACTCATGAGCT [...]
+		</sequence>
+<sequence taxon="Hippopotamus_amphibius">
+			
+			GCATATCCCCTCCAACTAGGCTTTCAAGATGCAGTATCACCCATTATAGAAGAACTACTGTATTTTCATGACCATACGCTAATAATCGTATTCCTAATCAGCTCACTAGTCCTTTACATTATTACACTAATACTGACTACCAAACTAACCCATACAAACACCATAAATGCACAAGAGGTAGAAACTGTCTGAACAATCCTACCAGCCATTATCCTTATCTTAATTGCACTGCCATCTCTGCGAATCCTCTATATAATAGACGAAATTAACAACCCCTCCCTGACCGTAAAAACTATGGGCCACCAATGATACTGAAGTTACGAATATACAGATTATGAAGACCTAAACTTTGACTCCTACATAGTCCCAACATCAGACCTAAAGCCGGGGGACCTACGACTCCTAGAAGTAGATAACCGAGTCGTCCTACCCATAGATGTAACAGTTCGAATACTAATCTCATCAGAAGACGTACTACACTCCTGAGCC [...]
+		</sequence>
+<sequence taxon="Balaenoptera_physalus">
+			
+			GCATATCCATTCCAACTAGGTTTCCAAGATGCAGCATCACCCATCATAGAAGAGCTCCTACACTTTCACGATCATACACTAATAATCGTTTTTCTAATTAGCTCTTTAGTTCTCTACATTATTACCCTAATGCTTACAACCAAATTAACACATACTAGTACAATAGACGCCCAAGAAGTAGAAACTGTCTGAACTATCCTCCCAGCCATTATCTTAATTTTAATTGCCTTGCCTTCATTACGGATCCTTTACATAATAGACGAAGTCAATAACCCCTCCCTCACTGTAAAAACAATAGGTCACCAATGATATTGAAGCTATGAGTATACCGACTACGAAGACCTAAGCTTCGACTCCTATATAATCCCAACATCAGACCTAAAGCCAGGAGAACTACGATTATTAGAAGTAGATAACCGAGTTGTCTTACCTATAGAAATAACAATCCGAATATTAGTCTCATCAGAAGACGTACTCCACTCATGGGCC [...]
+		</sequence>
+<sequence taxon="Physeter_macrocephalus">
+			
+			GCATACCCCCTTCAACTAGGTTTCCAAGACGCAACCTCTCCCATTATAGAGGAACTCTTACACTTTCATGATCACACCCTAATAATTGTTTTCCTAATTAGCTCTCTAGTCCTCTACATTATCACCCTAATACTAACAACCAAACTAACACATATCAACACAATAGACGCCCAAGAAGTAGAGACCATTTGAACCGTTCTCCCCGCTATCATTCTAATCCTAATCGCCCTACCATCCCTACGAATCCTCTACATAATAGACGAAATCAACAGCCCCTCTCTTACTGTAAAGACAATAGGTCACCAATGATATTGAAGCTACGAATATACCGACTACGAAGACCTGTCCTTTGACTCTTACATAATCCCAACATCGGACTTAAAACCAGGAGACCTACGACTATTAGAAGTCGACAACCGAATAGTATTGCCTATAGAAATAACAATCCGAGTCTTAGTCTCCTCCGAGGATGTCCTACACTCATGAGCT [...]
+		</sequence>
+<sequence taxon="Ursus_americanus">
+			
+			GCACACCCCTTTCAAATAGGTCTTCAAGATGCAACTTCTCCTATCATAGAAGAACTCCTACATTTTCATGACCATACATTAATAATTGTATTCCTAATTAGCTCCTTAGTTCTCTATATTATTTCAACTATATTAACTACCAAATTAACACACACAAACACAATGGATGCACAAGAAGTAGAGACGGTGTGAACCATCCTGCCAGCTATAATCCTAATTCTAATCGCACTCCCATCGCTACGGATTCTCTATATAATGGATGAAATCAATAACCCCTCACTGACCGTAAAAACCATGGGCCATCAATGATATTGAAGTTACGAGTACACAGATTATGAAGATCTAAATTTTGACTCCTACATGACTCCAACACAAGAACTAAAGCCTGGAGAACTGCGGTTATTAGAAGTGGACAATCGAGTAGTACTGCCCATAGAAATAACGATCCGTATGCTAATCTCATCAGAAGATGTCTTGCACTCATGAGCT [...]
+		</sequence>
+<sequence taxon="Canis_familiaris">
+			
+			GCGTACCCATTTCAACTCGGATTACAGGACGCAACCTCCCCTATTATAGAGGAGCTACTTCATTTTCATGACCATACACTAATAATTGTATTCTTAATCAGTTCTTTAGTTCTCTATATCATTTCACTAATATTGACTACAAAATTAACCCATACAAGCACAATAGACGCACAAGAAGTGGAAACAGTATGAACCATTCTACCCGCCATTATCCTAATCCTAATCGCTCTACCTTCCCTCCGAATCCTTTATATAATGGACGAAATTAATAACCCCTCTTTAACCGTGAAAACAATAGGCCACCAATGATACTGAAGCTATGAATATACTGACTATGAAGACTTAAACTTTGACTCCTACATAATCCCAACACAAGAATTAAAGCCAGGAGAACTCCGACTATTAGAAGTAGACAACCGAGTTGTCCTCCCAATAGAAATAACCATCCGAATACTTATCTCTTCAGAAGACGTTTTGCATTCATGAGCC [...]
+		</sequence>
+<sequence taxon="Felis_catus">
+			
+			GCGTACCCCTTTCAACTAGGTTTCCAAGATGCTACATCCCCCATTATAGAAGAACTCCTACACTTTCACGACCACACACTAATAATTGTATTTTTAATCAGCTCTTTAGTTCTTTATATTATCTCGTTGATGCTAACAACCAAGCTCACGCACACGAGTACAATAGATGCTCAAGAAGTAGAAACCATCTGAACCATCCTACCTGCTATTATCCTGATTCTTATCGCCCTACCCTCCTTACGAATTCTCTATATAATGGATGAAATCAACAACCCCTCCCTCACAGTAAAAACCATAGGACATCAATGATATTGAAGTTATGAGTACACTGATTACGAAGACTTGAATTTTGACTCTTACATAATTCCTACCCAAGAGCTAAAACCAGGAGAACTCCGGCTATTAGAAGTTGACAACCGAGTAGTTTTACCAATAGAAATGACCATTCGCATGTTAATCTCATCAGAAGATGTGTTACACTCATGAGCC [...]
+		</sequence>
+<sequence taxon="Homo_sapiens">
+			
+			GCACATGCAGCGCAAGTAGGTCTACAAGACGCTACTTCCCCTATCATAGAAGAGCTTATCACCTTTCATGATCACGCCCTCATAATCATTTTCCTTATCTGCTTCCTAGTCCTGTATGCCCTTTTCCTAACACTCACAACAAAACTAACTAATACTAACATCTCAGACGCTCAGGAAATAGAAACCGTCTGAACTATCCTGCCCGCCATCATCCTAGTCCTCATCGCCCTCCCATCCCTACGCATCCTTTACATAACAGACGAGGTCAACGATCCCTCCCTTACCATCAAATCAATTGGCCACCAATGGTACTGAACCTACGAGTACACCGACTACGGCGGACTAATCTTCAACTCCTACATACTTCCCCCATTATTCCTAGAACCAGGCGACCTGCGACTCCTTGACGTTGACAATCGAGTAGTACTCCCGATTGAAGCCCCCATTCGTATAATAATTACATCACAAGACGTCTTGCACTCATGAGCT [...]
+		</sequence>
+<sequence taxon="Pan_troglodytes">
+			
+			GCACATGCAGCGCAAGTAGGTCTACAAGATGCTACTTCCCCTATCATAGAAGAACTTATTATCTTTCACGACCATGCCCTCATAATTATCTTTCTCATCTGCTTTCTAGTCCTATACGCCCTTTTCCTAACACTCACAACAAAACTAACTAATACTAGTATTTCAGACGCCCAGGAAATAGAAACCGTCTGAACTATCCTGCCCGCCATCATCCTAGTCCTTATTGCCCTACCATCCCTGCGTATCCTTTACATAACAGACGAGGTCAACGACCCCTCCTTTACTATTAAATCAATCGGCCATCAATGATATTGAACCTACGAATACACCGACTACGGCGGGCTAATCTTCAACTCCTACATACTCCCCCCATTATTTCTAGAACCAGGTGATCTACGACTCCTTGACGTTGATAACCGAGTGGTCCTCCCAGTTGAAGCCCCCGTTCGTATAATAATTACATCACAAGATGTTCTACACTCATGAGCT [...]
+		</sequence>
+<sequence taxon="Gorilla_gorilla">
+			
+			GCACATGCAGCGCAAGTAGGTCTACAAGACGCTACTTCTCCTATCATAGAAGAACTAATCATCTTTCATGATCATGCCCTCATAATCATTTTTCTCATCTGCTTCTTAGTCCTGTACGCCCTTTTCCTAACACTCACAACAAAGCTAACTAACAACAACATCTCAGACGCCCAAGAAATAGAGACCATCTGAACCATCCTGCCCGCTATTATCTTAGTCCTGATCGCCCTCCCATCTCTACGAATCCTCTATATGACAGATGAAATCAATGACCCCTCCTTCACTATCAAATCAATCGGTCACCAATGATACTGAACCTACGAATACACCGACTATGGTGGATTGATCTTTAACTCCTATATACTCCCCCCATTATTCCTAGAACCAGGTGACCTACGACTCCTTGACGTCGACAACCGAGTAGTCCTTCCAGTTGAAGCCCCCGTCCGTATAATAATTACATCCCAAGATGTCTTACACTCATGAGCT [...]
+		</sequence>
+<sequence taxon="Pongo_pygmaeus">
+			
+			GCGCACGCAGCACAGGTAGGTCTACAAGACGCTACCTCTCCTATCATAGAAGAATTGGTCATCTTTCACGACCACGCCCTCATAATCATCTTCCTAATCTGCTTCCTAGTCCTGTACGCCCTTTTCCTAACACTCACAACGAAACTCACCAACACTAACATCTCAGATGCCCAAGAGATAGAAACTATTTGAACTATCCTACCAGCCATCATCCTAATTCTAATCGCCCTCCCATCTCTACGCATCCTCTACTTAACAGACGAAATCAACGACCCTTCCTTCACCATTAAATCAATCGGCCATCAATGGTACTGAACCTACGAGTATACTGACTATGGCGGATTGATCTTCAACTCTTACATGCTCCCACCACTATTCCTAGAACCAGGCGACCTTCGACTCCTAGACGTCGACAATCGAGTAGTCCTCCCAGTCGAAGCCCCCGTTCGCATAATAATCACATCCCAAGACGTCTTGCACTCATGAACC [...]
+		</sequence>
+<sequence taxon="Macaca_mulatta">
+			
+			GCCCACCCAGTTCAACTAAGCCTGCAAGACGCCACATCTCCTGTTATAGAGGAGTTGATTACTTTCCATGACCATGCTTTTATAGCCATATCTCTTATCAGCTTCCTAGTATTATATGCCCTGCTCTCAACGCTCACAACAAAACTAACCAACACTAGCATCACAGACGCCCAAGAAATAGAAACTATCTGAACTATCTTACCCGCAATTATCTTAATCCTAATTGCTCTCCCATCTCTACGCATCCTATACCTAACAGATGAAGTCAACGACCCATCCTTCACCATTAAATCAATCGGACACCAGTGATACTGAACCTACGAATACACAGATTACGGGGGCCTAATTTTCAACTCCTACATACTACCCCCACTATTCCTAAACCCAGGAGACCTCCGACTCCTAGAAGTTGACAATCGAGTAGTTCTTCCAATTGAAGCTCCTGTACGTATAATAATTACATCTCAAGACGTCTTACACTCATGAACC [...]
+		</sequence>
+<sequence taxon="Callithrix_jacchus">
+			
+			GCAGCACCAGCCCAATTAGGCCTACAAAACGCCGCATCCCCAATCATAGAAGAACTTATTGCCTTCCATGACCATGCTCTAATAATTATCTTCTTAATTAGCTCACTAGTTCTATACATCATCTCTCTAATACTTACTACAAAACTGACACACACCAGTACCATGAACGCTCAAGAAATCGAAATGATCTGAACTATCCTACCTGCAATAATCCTCATTATAATTGCCCTTCCATCCCTACGCATTTTATATATAACAGACGAGTTTAATAAACCATATCTAACCCTTAAAGCAATCGGCCACCAATGATACTGAAGTTACGAATACTCCGACTATGAAGACTTAGCATTCGACTCCTACATTATACCAACATACTTCCTTGAACCCGGGGAATTCCGACTCCTTGAAGTAGACAACCGAACAACCTTGCCTATGGAAGCAGATATCCGTGTATTAATCTCATCACAAGACGTTTTACACTCATGAGCT [...]
+		</sequence>
+<sequence taxon="Loris_tardigradus">
+			
+			GCCCATCCAGTACAATTCGGATTTCAAGACGCCGCCTCACCTATTATAGAAGAACTACTATACTTTCATGACCACACTCTCATAATTGTATTTATAATCAGCTCTCTAGTCCTATATATTATCTCCCTTATACTATCAACCGAACTTACCCATACAAGCACTATGGATGCGCAAGAAGTAGAAACAGTATGAACAATCCTGCCTGCCGTCATCCTAATTTTAATTGCCCTGCCATCCCTACGGATCCTATATATAATAGATGAAATTAATACCCCATCCCTTACCCTAAAAACAATAGGTCATCAATGATATTGAAGCTACGAATACACAGATTATGATAAACTATGCTTTGACTCCTATATAGTCCCAACCCCTGACCTAGAACCGGGGGACCTACGTCTACTTGAAGTAGATAACCGAGTTGTACTACCTACAGAAATATCTATTCGAATACTAATCTCCTCCGAAGATGTTCTCCACTCATGAACA [...]
+		</sequence>
+<sequence taxon="Galago_crassicaudatus">
+			
+			GCCCACGCTGTACAATTCGGATTTCAAGACGCTGCCTCCCCTATTATAGAAGAATTATTATACTTCCATGACCACACCCTTATAATCGTATTTACAATTAGCTCCCTGGTCCTTTATATTATCTCCCTTATGTTATCGACTGAACTTACTCATACAAACACAATAGACGCCCAAGAAGTAGAGACAGTATGAACTATCCTGCCAGCTGTAATCCTCATCCTTATTGCCCTCCCATCCCTCCGAATCCTTTACATAATAGACGAAATCAACACCCCATCCTTAACCCTAAAAACAATAGGCCATCAATGATATTGAAGCTATGAGTACACAGATTATGACAACCTGTGCTTTGACTCCTACATAACCCCTACCCCTGACTTAGAACCAGGAGACCTTCGACTGTTAGAAGTGGACAACCGAGTCGTCCTACCCACAGAAATATCTATCCGAATACTAATCTCCTCTGAAGACGTACTCCACTCATGAACT [...]
+		</sequence>
+<sequence taxon="Daubentonia_madagascariensis">
+			
+			GCTTACCCCGCCCAAATAGGATTCCAAGACGCCACCTCCCCTATCATAGAAGAACTTCTATATTTCCATGACCATACCTTAATAATTGTCTTTATAATTAGCTCATTAGTCCTCTATACTATCTCCCTTATACTCACAACCAGCCTTACCCATACAAACACCATAAACGCCCAAGAAGTGGAAACAGTGTGAACAATCCTCCCTGCAATTATCTGCATCCTTATTGCCCTACCATCCTTACGTATTCTCTACATAATAGATGAAATTAACAACCCTTCCCTAACCATTAAAACTATGGGCCACCAATGATACTGAACCTATGAGTATACAGATTATGAAAACATAACCTTTGATTCATACATAACCTCAACCAACGATCTCACCCCCGGAGAACTTCGACTTCTGGAAGTCGATAATCGAATAGTCCTACCTACGGAATTACCTATTCGAGTGTTAGTCTCCTCAGAAGATGTACTACACTCATGGACA [...]
+		</sequence>
+<sequence taxon="Varecia_variegata">
+			
+			GCTCATCCAGTCCAACTAGGATTTCAAGACGCCGCTTCTCCTATTATAGAAGAACTCCTATATTTTCACGACCACACCCTAATAATTATATTCCTAATTAGCTCTTTAGTCCTATATATTATTTCCCTAATACTCACTACTAAACTCACACATACAAGCACTATAGATGCTCAAGAAGTAGAAACAGTATGAACAATTTTACCCGCAGCAATTCTTATTCTTATTGCCCTCCCCTCACTACGTATCCTATACATGATGGACGAAATTACTTCTCCTTCCCTTACCCTTAAAACCATAGGTCACCAATGATATTGAAGTTATGAGTATACGGATTACGAAAATTTATGCTTTGACTCATATATAACCCCCTGCTCAGACCTAAAACCCGGAGAACTTCGCTTACTTGAAGTAGATAATCGAGTCGTTCTACCCACAGAACTGTCAATCCGAACGCTAATCTCTTCAGAAGATGTATTACACTCATGAACC [...]
+		</sequence>
+<sequence taxon="Eulemur_mongoz">
+			
+			GCTTATCCAGTTCAACTAGGGTTCCAAGATGCTGCTTCCCCTATTATAGAAGAACTTTTATACTTCCATGACCACACCTTAATAATTATATTCCTAATTAGTTCTCTAGTCCTCTACATTATTTCCCTTATACTCACTACTGAGCTTATCCATACAAGTACTATAGACGCCCAAGAAGTAGAAACAGTATGAACTATTCTGCCCGCAGTAATTCTTATCCTTATTGCCCTCCCATCATTACGCATCCTATATATAATAGATGAAATCACCACACCCTCCTTAACTCTTAAAACTATGGGCCACCAATGATACTGAAGCTATGAGTACACGGACTATGAGAATCTGTGCTTTGACTCATACATAACTCCTCCTTCAGACCTAAAACCGGGAGAACTTCGTTTACTCGAAGTTGATAATCGAGTTGTGCTTCCAACAGAGCTACCAATCCGAATACTAATTTCCTCAGAAGATGTTTTACATTCATGAACT [...]
+		</sequence>
+<sequence taxon="Lemur_catta">
+			
+			GCCTATCCAGTTCAATTAGGATTTCAAGATGCTGCTTCTCCCATTATAGAAGAACTTTTATACTTTCACGACCACACTTTAATAATTATATTCCTGATTAGTTCTCTAGTCCTTTACATTATCTCCCTTATACTCACTACTGAACTTATACATACAAACACCATAGACGCCCAAGAAGTAGAAACAGTATGAACAATCCTACCTGCAGCAATCCTCATTCTTATTGCTCTTCCATCATTACGCATTCTGTATATAATAGACGAAATTGCTACACCCTCCTTAACCCTTAAAACCATAGGTCACCAATGATACTGAAGCTACGAATACACAGATTATGAAGACTTATGTTTTGACTCGTACATAACTCCTTCCTCAGACCTTAAACCTGGAGAACTTCGCCTACTTGAAGTCGACAATCGAGTCGTACTTCCCACAGAACTAGCAGTTCGAATATTAATCTCTTCAGAAGATGTACTACACTCATGAACT [...]
+		</sequence>
+<sequence taxon="Hapalemur_griseus">
+			
+			GCTTATCCAGTCCAACTAGGATTTCAAGATGCTGCTTCCCCTATTATAGAAGAACTTTTATACTTTCATGATCATACTTTAATAATTATATTCCTGATTAGTTCTCTAGTCCTTTACATTATTTCCCTCATACTTACTACTGAATTAATACATACAAATACCATAGACGCCCAAGAAGTAGAAACAGTATGAACAATCCTACCCGCAGCAATTCTCATTCTCATTGCCCTCCCATCATTACGTATCCTATATATAATAGACGAAATTACTACACCCTCATTAACCCTTAAAACTATAGGCCACCAGTGATACTGAAGCTACGAATACACAGACTATGAAAATTTATGCTTTGACTCATACATAGTTCCTTCCTCAGACCTAAAGCCTGGAGAACTTCGCCTACTTGAAGTTGATAATCGAATTGTACTTCCTACAGAATTATCAATTCGAATACTAATCTCTTCAGAAGATGTACTACACTCATGAGCC [...]
+		</sequence>
+<sequence taxon="Propithecus_tattersalli">
+			
+			GCTTATCCAGTTCAATTGGGATTTCAGGATGCTGCTTCCCCCATCATGGAAGAGCTCTTATACTTTCATGATCATACTTTAATAATTGTATTCCTAATTAGTTCTCTAGTTCTCTATATCATCTCTCTAATACTCACCACCAAACTCATACACACCAGCACCATGGACGCACAAGAAGTAGAAACAGTATGAACTATCCTACCTGCAATCATTCTAATTCTTATTGCCCTCCCATCCCTACGTATCCTATACATAATGGATGAAATCACTACTCCTTCATTAACCCTTAAAACCATAGGTCATCAATGGTACTGAAGCTATGAATACACAGATTACGAAGATCTGTCTTTCGACTCATACATAGTTCCATCATCGGACCTCAAGCCCGGAGAACTTCGTCTGCTCGAAGTAGACAACCGAATTGTACTACCCACAGAACTATCAATTCGAATACTTATCTCTTCAGAAGACGTATTACACTCATGAGCC [...]
+		</sequence>
+<sequence taxon="Lepilemur_edwardsi">
+			
+			GCCCACCCAGTCCAACTAGGATTTCAAGATGCCGCCTCTCCTATCATAGAAGAACTTCTATATTTCCATGACCACACTCTAATAATTGTTTTCCTCATCAGTTCCTTGGTCCTTTACATTATTTCCCTTATACTCTCTACTAAACTCACCCACACAAGTACAGTGGATGCCCAAGAAGTAGAAACAGTATGAACTATTTTGCCCGCAGTGATCCTAATTCTTATCGCCCTTCCATCTCTACGCATCCTATACATAATAGACGAAATCACTACACCCTCCTTAACCCTTAAAACAATAGGCCATCAATGATACTGAAGCTATGAATACACGGACTATGAAAATCTTTGCTTTGACTCATATATAATTCCTCTGTCAGATCTTAAACCCGGTGATCTTCGCCTACTCGAGGTTGATAACCGAGTTGCCTTACCCACAGAAATATCAATCCGAATGTTAGTATCCTCAGAAGACGTACTTCACTCATGGACC [...]
+		</sequence>
+<sequence taxon="Cheirogaleus_medius">
+			
+			GCATGTCCAGTTCAACTAGGATTTCAAGACGCTGCCTCTCCTATTATAGAGGAACTTATATATTTCCATGACCATACTTTAATAATCGTCTTCCTAATTAGCTCCCTAGTCCTCTATATCATTTCCCTAATACTCACCACAGAACTTACCCACACAAACACAATAGATGCCCAAGAAGTAGAAACAGTATGAACCATCCTACCTGCAGTTATCTTAATCCTTATTGCTCTTCCATCACTACGAATTCTATATATAATAGATGAAATTACCACCCCATCTCTAACCCTAAAAACTATAGGCCATCAATGGTACTGAAGTTATGAATATACAGACTACGAAAACTTATGTTTTGATTCATATATAACGCCATCATCAGATCTCAAGCCAGGAGAACTTCGCCTACTAGAAGTTGATAACCGAGTTGTCCTACCCACAGAAATATCCATTCGTATACTCATCTCCTCAGAAGATGTACTACACTCATGAACC [...]
+		</sequence>
+<sequence taxon="Mirza_coquereli">
+			
+			GCTTACCCAGCTCAGCTAGGACTCCAAGATGCCGCTTCCCCAATCATGGAAGAGCTTGCATATTTTCACGACCATACCCTAATAATTGTATTTTTAATTAGCTCCATGGTCCTATATATAATCTCTCTAATACTTACTACTGAACTTACCCACACAAGCACTATAGATGCTCAAGAAGTCGAAACAGTATGAACAATCCTACCCGCAGTTATCCTAATTTTTATTGCCCTTCCATCATTACGTATTTTATATATAATAGACGAAATTACAACGCCATCCTTAACTCTAAAAACCATAGGCCATCAATGATATTGAAGTTATGAATACACAGACTACGAAAGCCTATGCTTTGACTCTTATATGACCCCTCCACTAGAACTAGATCCAGGAGAACTTCGCCTACTAGAAGTTGATAATCGAGTAGTACTGCCTACAGAAATATCCATTCGTATACTTGTCTCTTCAGAAGATGTATTACACTCATGAACA [...]
+		</sequence>
+<sequence taxon="Microcebus_murinus">
+			
+			GCCCACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATAATTGTATTTTTAATTAGCTCATTAGTTCTTTATATTATTTCCCTTATACTTACCACGGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTAGAAACAGTATGAACAATTCTACCAGCGGTTATTTTAATTCTTATTGCCCTTCCATCACTACGTATTTTATATATAATAGATGAAATTACAACTCCCACTCTGACCCTTAAGACAATAGGTCATCAATGATATTGAAGTTACGAATATACAGATTATGAAAACCTATGCTTTGACTCATACATAACCCCTCCTTTAGAACTCGATCCAGGAGAACTACGATTACTAGAAGTTGACAATCGAGTAGTATTACCAACAGAAATATCCATTCGCATACTCATCTCTTCAGAAGACGTACTACATTCATGAACT [...]
+		</sequence>
+<sequence taxon="Microcebus_griseorufus">
+			
+			GCCTACCCAGCCCAATTAGGTTTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATGATTGTATTTTTAATCAGCTCATTGGTCCTTTATATTATTTCCCTTATACTTACCACAGAACTTACTCATACAAGCACTATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCCCTTCCATCATTACGCATTCTATACATAATGGATGAAATCACAACCCCCACCCTTACCCTTAAAACCATAGGTCATCAGTGATATTGAAGTTATGAATATACAGATTATGAAAGCCTATGCTTTGACTCATATATGACCCCTCCTTTAGAACTTGACCCCGGAGAATTACGATTACTAGAAGTCGATAATCGAGTAGTATTACCAACAGAAATATCTATTCGCATGCTAATCTCTTCAGAAGACGTGTTACACTCATGAACT [...]
+		</sequence>
+<sequence taxon="Microcebus_myoxinus">
+			
+			GCCTACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTACATATTTTCATGATCATACCCTTATGATCGTATTCTTAATTAGCTCATTAGTTCTATATATCATTTCCCTCATGCTTACCACGGAACTCACCCATACAAGCACCATAGACGCTCAAGAAGTAGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCTCTTCCATCATTACGCATTTTATATATAATGGATGAAATTACAACTCCCTCCCTGACTCTTAAGACTATAGGTCATCAATGATATTGAAGCTATGAATACACAGACTATGAAAGCTTATGCTTTGACTCATATATAACCCCTCCATTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTGGATAATCGAGTAGTACTACCAACAGAAATATCTATTCGTATACTCATCTCTTCAGAAGACGTACTACACTCATGAACT [...]
+		</sequence>
+<sequence taxon="Microcebus_berthae">
+			
+			GCCTACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCATGATCATACCCTTATGATCGTATTTTTAATTAGCTCATTAGTTCTTTATATCATTTCCCTCATGCTTACCACAGAACTCACCCATACAAGCACCATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCTCTTCCATCATTACGCATTTTATATATAATGGATGAAATTACAACTCCCTCCCTAACTCTTAAGACCATAGGTCATCAGTGATATTGAAGCTATGAATATACAGACTATGAAAGCTTATGCTTTGACTCATATATAACTCCTCCACTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTGGATAATCGAGTAGTACTACCAACAGAAATATCTATTCGCATGCTCATCTCTTCAGAAGACGTATTACATTCATGAACT [...]
+		</sequence>
+<sequence taxon="Microcebus_rufus_1">
+			
+			GCCTACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCATGATCATACCCTTATGATCGTATTTTTAATTAGCTCATTAGTTCTATATATCATTTCCCTTATGCTTACCACAGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCTCTTCCATCATTACGCATTTTATATATAATGGATGAAATTACAACTCCTTCCCTAACTCTTAAGACTATAGGTCATCAGTGATATTGAAGCTATGAATATACAGATTATGAAAGCCTATGCTTTGACTCATATATAACCCCTCCATTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTGGATAACCGAGTAGTACTACCAACAGAAATATCTATTCGCATACTCATCTCTTCAGAAGACGTATTACATTCATGAACT [...]
+		</sequence>
+<sequence taxon="Microcebus_tavaratra">
+			
+			GCCCACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGATCACACCCTTATAATTGTATTTTTAATTAGTTCATTAGTCCTATATATCATTTCCCTTATGCTTACCACGGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTTATTGCTCTTCCATCGTTACGCATTTTATATATAATAGATGAAATTACAACCCCTTCTCTAACTCTTAAGACTATAGGTCATCAGTGATATTGAAGCTATGAATATACAGACTATGAAAGCCTATGCTTTGACTCATATATAACCCCTCCATTAGAATTAGATCCAGGAGAACTACGATTACTAGAAGTAGATAATCGAGTAGTATTACCAACAGAAATATCTATTCGTATACTCATCTCCTCAGAAGACGTACTACACTCATGAACT [...]
+		</sequence>
+<sequence taxon="Microcebus_rufus_2">
+			
+			GCCCACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATAATTGTATTCTTAATCAGCTCATTAGTTCTATATATCATTTCCCTTATACTTACTACGGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTGGAAACAGTATGAACAATCTTACCAGCAGTTATTTTAATCCTTATTGCCCTTCCATCATTACGCATTTTATACATAATGGATGAAATTACAACTCCCTCCCTAACTCTTAAGACTATAGGTCATCAATGATATTGAAGCTATGAATATACAGACTATGAAAGCCTATGCTTTGACTCATACATAACCCCTCCATTAGAGCTCGATCCAGGAGAACTACGATTACTAGAAGTGGATAACCGAGTAGTACTACCAACAGAAATATCTATTCGTATACTCATCTCTTCAGAAGACGTACTACATTCATGAACT [...]
+		</sequence>
+<sequence taxon="Microcebus_sambiranensis">
+			
+			GCCTATCCAGCCCAATTAGGTTTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGATCATACCCTTATGATTGTATTTTTAATTAGCTCATTAGTCCTATACATTATTTCCCTTATGCTTACCACGGAACTTACTCATACAAGCACCATAGACGCTCAAGAAGTAGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTTATTGCCCTTCCATCACTACGCATTTTATATATAATGGATGAAATTACAACTCCCTCCCTAACTCTTAAGACTATAGGTCATCAATGATATTGAAGCTATGAATATACCGACTATGAAAGCCTATGCTTTGACTCCTACATAACCCCTCCATTAGAACTCGATCCAGGAGAACTACGATTACTAGAAGTAGATAATCGAGTAGTACTGCCAACAGAAATATCCATTCGTATACTCATCTCTTCAGAAGACGTATTACATTCATGAACT [...]
+		</sequence>
+<sequence taxon="Microcebus_ravelobensis">
+			
+			GCCTGCCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTGTATATTTCCACGACCATACCCTTATAATTGTGTTTTTAATTAGCTCATTGGTCCTATATATTATTTCCCTTATACTCACCACAGAGCTCACTCATACAAGCACTATAGATGCTCAAGAAGTGGAAACTGTATGAACAATTTTGCCAGCAGTTATCTTAATTCTTATTGCCCTTCCATCATTACGCATTTTATATATAATAGATGAAATTACAACCCCGTCCCTTACTCTTAAGACTATAGGTCATCAATGATATTGAAGCTATGAATATACAGACTATGAAAACTTATGCTTTGACTCATACATGACTCCTCCATTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTCGACAATCGAGTAGTATTACCAACAGAAATATCTATCCGCATACTCATCTCTTCAGAAGACGTATTACATTCATGAACT [...]
+		</sequence>
+</data>
+    <!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+    <input spec='HKY' id='hky'>
+        <kappa idref='hky.kappa'/>
+        <frequencies id='freqs' spec='Frequencies'>
+            <data idref='alignment'/>
+        </frequencies>
+    </input>
+
+    <!-- site model                                                              -->
+    <input spec='SiteModel' id="siteModel" gammaCategoryCount='1'>
+        <!--
+            <parameter name='shape' id='shape' value='0.5'/>
+            <parameter name='proportionInvariant' id='propInvar' value='0.2'/>
+        -->
+        <substModel idref='hky'/>
+    </input>
+
+    <input spec='TreeLikelihood' id="treeLikelihood">
+        <data idref="alignment"/>
+        <tree idref="tree"/>
+        <siteModel idref="siteModel"/>
+    </input>
+
+    <parameter id="hky.kappa" value="1.0" lower="0.0"/>
+
+    <tree id='tree'/>
+
+    <tree spec='beast.util.ClusterTree' id='upgmatree' clusterType='upgma' initial='@tree'>
+        <taxa idref='alignment'/>
+    </tree>
+    <tree spec='beast.evolution.tree.RandomTree' id='coalescentSimulator' initial='@tree' taxa='@alignment'>
+        <populationModel spec='ConstantPopulation'>
+            <popSize spec='parameter.RealParameter' value='1'/>
+        </populationModel>
+    </tree>
+
+
+    <run spec="MCMC" id="mcmc" chainLength="5000000" preBurnin="0">
+
+        <init idref='coalescentSimulator'/>
+        <distribution spec='CompoundDistribution' id='posterior'>
+<!--
+	make it comparable to the files in the BEAST 1 directory, that do not use a prior either
+            <distribution spec='beast.math.distributions.Prior' x='@hky.kappa'>
+                <distr spec='beast.math.distributions.OneOnX'/>
+            </distribution>
+-->
+            <distribution id='likelihood' idref="treeLikelihood"/>
+        </distribution>
+
+        <operator id='kappaScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" parameter="@hky.kappa"/>
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" tree="@tree"/>
+
+        <operator spec='SubtreeSlide' weight="5" gaussian="true" size="1.0" tree="@tree"/>
+
+        <operator spec='Uniform' weight="10" tree="@tree"/>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="1" tree="@tree"/>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="1" tree="@tree"/>
+        <operator spec='WilsonBalding' weight="1" tree="@tree"/>
+
+        <logger logEvery="10000" fileName="test.log">
+            <model idref='likelihood'/>
+            <log idref="likelihood"/>
+            <log idref='hky.kappa'/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+        </logger>
+        <logger logEvery="10000" fileName="test.trees">
+            <log idref="tree"/>
+        </logger>
+        <logger logEvery="10000">
+            <model idref='likelihood'/>
+            <log idref="likelihood"/>
+            <ESS spec='ESS' name='log' arg="@likelihood"/>
+            <log idref='hky.kappa'/>
+            <ESS spec='ESS' name='log' arg="@hky.kappa"/>
+        </logger>
+    </run>
+</beast>
+
diff --git a/examples/benchmark/II/testHKY1748.xml b/examples/benchmark/II/testHKY1748.xml
new file mode 100644
index 0000000..ac475b8
--- /dev/null
+++ b/examples/benchmark/II/testHKY1748.xml
@@ -0,0 +1,351 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beast xmlns="http://www.w3.org/TR/xhtml1/strict" version="2.0" namespace="beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood">
+<data dataType="nucleotide" id="alignment">
+<sequence taxon="Zea_mays">
+			
+			------------------------------------------------------CTTGGCTCGACATAGTCTGTTCTATTCGTCCCGAACCGAATTTTCGCTGGGTTGTTT-----------------------------G-TAAGTAAAGTAAATAGTACACGATGGAGCTCGAGAGGACAGAATTT-----CTTTTTGATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATATAGAAA-----TCAAAAGGTTAAAATAAGAAAAA-GTCTAATTTTGGAAGATTGGAAAAACTTTTTT-----GATGAAAA-----GTCTATCTGAATCAATTGTTCATATTTGATTTCTATAG--------------------AAGAGTGAAATGCTTT------ATCGAAGGAAA---------TAAGAAAAAA----GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Uniola_pittieri">
+			
+			------------------------TCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGCGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTG-----ATTTTTTATCAAGGGAAAAAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TTGAAAGGTTAAAATAAGAAAAAAGTCTAATTTTGGAAAATTGGAAAA-CTTTTTT-----GATTAAAA-----GTCTATAARAATCAATCGTTCATATTCGATTTCTATAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAATGAAGGAAATAAAAAAAAAAA--GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Uniola_paniculata">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGTGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTG-----ATTTTTTATCAAGGGAAAAAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TTGAAAGGTTAAAATAAGAAAAAAGTCTAATTTTGGAAAATTGGAAAA-CTTTTTT-----GATTAAAA-----GTCTATAAGAATCAATCGTTCATATTCGATTTCTATAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAATGAAGGAAATAAAAAAAAAA---GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Thellungia_advena">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCCAATTTGCGCTGAGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTG-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATATAGAAA-----TTGAAAGGTTAAAATAAGAAAAA-GTCTAATTTTGGAAGATTGGAAAA-CTTTTTC-----GATTAAAA-----GTCTATCAGAATCAATCGTTCATATTCGATTTCTCTAG--------------------AAGAGCAAAATGCTTT------ATTGAAGGAAA---------TAAGAAAAAAA---GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Tetrachne_dregei">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGCGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGATAGAATTG-----ATTTTTTATCAAGGGAAAAAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TTGAAAGGTTAAAATAAGAAAAAAGTCTAATTTTGGAAAATTGGAAAA-CTTTTTT-----GATTAAAA-----GTCTAGAAGAATCAATCGTTCATATTCGATTTCTATAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAATGATGGAAATAAAAAAAAA----AAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Stiburus_conrathii">
+			
+			---------------------------------------------------GCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGTGCTGGGTTGTAT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTG-----ATTTTTTATCACGGGAAAAAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TTGAAAGGTTAAAATAAGAAAAAAGTCTANTTTTGGAAAATTGGAAAA-CTTTTTT-----GATTAAAA-----GTCTATAANAATCAATCGTTCATATTCGATTTCTATAG--------------------AAGAGGAAAATGCTTT------TTTGAAGGAAATGAAGGGAATAAAAAAAAAA---GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Sporobolus_indicus">
+			
+			ATCGATTGTGGTTTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTTCCGAACCCAATTTGCGCTGAGTTGTTT-----------------------------G-TAAATAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTG-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATATAGAAA-----TGGAAAGGTTAAAATAAGAAAAA-GTCTAATTTTGGAAGATTGGAAAA-CTTTTTC-----GATTAAAA-----GTCTATCAGAATTAATCGTTCATATTCTATTTCTCTAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAA---------TAAGAAAAAAA---GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Spartina_pectinata">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCCAATTTGCGCGGAGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATAG-----ATTTTTTATTAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATATAGAAA-----TTGAAT----AAAATAAGAAAAA-GTCTAATTTTGGAAGATTGGAAAA-CTTTTTC-----GGTTAAAA-----GTCTATCAGAATCAATCGTTCATATTCGATTTCTCTAG--------------------AAGAGCAAAATGCTTT------ATTGAAGGAAA---------TAAGAAAAAAA---GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Schmidtia_pappophoroides">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTACGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAAAAGACAGAATTG-----ATTTTTTATCAAGGGAAAAAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATATAGAAA-----TTGAAAGGTTAAAATAAGAAAAAAGGAATATTTTGGAAGATTGGAAAA-CTTTTTT-----GATTAAAA-----GTCTATGAGAATCAATCATTCATATTCGATTTCTATAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAAAAAAAA-----------------GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Pogonarthria_squarrosa">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGCGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTT-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TGGAAAGGTTAAAATAAGAAAAAAGTCTTATTTTGGAAGATTGGAAAA-CTTTTTT-----GATTAAAA-----GTCTATGAGAATCAATCGTTCATATTCGATTTCTATAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAAAAAAAA-----------------GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Pappophorum_mucronulatum">
+			
+			TCGACTTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGCGCTAGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTG-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATATAGAAA-----TTGAAAGGTTAAAATAAGAAAAA-GTATAATTTTGGAAGATTGGAAAA--TTTTTTC----GATTAAAA-----GTCTATCAGAATCNATCGTTCATATTCGATTTCTCTAG--------------------AAGAGGAAAAAACTTT------ATTGANGGAAA---------TAAGAAAANAA---GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Pappophorum_bicolor">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGCGCTAGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTG-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATATAGAAA-----TTGAAAGGTTAAAATAAGAAAAA-GTATAATTTTGGAAGATTGGAAAA-TTTTTTC-----GATTAAAA-----GTCTATCAGAATCAATCGTTCATATTCGATTTCTCTAG--------------------AAGAGGAAAAAACTTT------ATTGAAGGAAA---------TAAGAAAAAAA---GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Neeragrostis_reptans">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGCGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTG-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATGCAGAAA-----TTGAAAGGTTAAAATAAGAAAAAAGTCTTATTTTGGAAGATTGGAAAA-CTTTTTT-----GATTAAAATAAAAGTCTATGAGAATCAATCGTTCATATTCGATTTCTATAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAAAAAAAA-----------------GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Leptochloa_dubia">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGCGCTGGGTTGTTTGGTTTGTAAGTAACTGGGTTGTTTGGTTTG-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGAAAGAATAGAATTTCTTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATATAGAAATTAAATTGAAAGGTTAAAATAAGAAAAA-GTCTAATTTTGGAAGATTGGAAAA-CTTTTTTT----GATTAAAA-----GTCTATCAGAATCAATCGTTCATATTTGATTTCTCTAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAA---------TAAGAAAAAAA---GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Fingerhuthia_sesleriiformis">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGCGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGATAGAATTG-----ATTTTTTATCAAGGGAAAAAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TTGAAAGGTTAAAATAAGAAAAAAGTCTAATTTTGGAAAATTGGAAAA-CTTTTTT-----GATTAAAA-----GTCTAGAAGAATCAATCGTTCATATTCGATTTCTATAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAATGATGGAAATAAAAAAAAAAA--GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Eragrostis_unioloides">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGCGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTT-----AATTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TTGAAAGGTTAAAATAAGAAAAAAGTCTTATTTTGGAAGATTGGAAAA-CTTTTTT-----GATTAAAA-----GTCTATGAGAATCAATCGTTCATATTCGATTTCTATAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAAAAAAAA-----------------GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Eragrostis_truncata">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGCGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTT-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TTGAAAGGTTAAAATAAGAAAAAAGTCTTATTTTGGAAGATTGGAAAA-CTTTTTT-----GATTAAAA-----GTCTATGAGAATCAATCGTTCATATTCGATTTCTATAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAAAAAAAAA----------------GAAGGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Eragrostis_trichophora">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGCGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTT-----AATTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TTGAAAGGTTAAAATAAGAAAAAAGTCTTATTTTGGAAGATTGGAAAA-CTTTTTT-----GATTAAAA-----GTCTATGAGAATCAATCGTTCATATTCGATTTCTATAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAAAAAAAA-----------------GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Eragrostis_tremula">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACC-AATTTGCGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTG-----CTTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TTGAAAGGTTAAAATAAGAAAAAAGTCTTATTTTGGAAGAGTGGAAAA-CGTTTTT-----GATTAAAA-----GTCTATGAGAATCAATCGTTCATATTCGATTTCTATAG--------------------AAGAGGAAAACGCTTT------ATTGAAGGAAA---------TAAAAAAAAAAA--GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Eragrostis_tenella">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGCGCTGAGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTT-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TTGAAAGGTTAAAATAAGAAAAAAGTCTTATTTTTGAAGATTGGAAAA-CTTTTTT-----GATTAAAA-----GTCTATGAGAATCAATCGCTCCTATTCGATTTCTATAG--------------------AAGAGGAAAATGCTTT------ATTAAAGGAAA---------TAAAAAAAAAAAAAGAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Eragrostis_tef_variegata">
+			
+			--------------------------------------------------------------------GTCTGTTCTATTTGTCCCGAACCGAATTTGCGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGANGACAGAATTG-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TTGAAAGGTTAAAATAAGAAAAAAGTCTTATTTTGGAAGATTGGAAAA-CTTTTTT-----GATTAAAA-----GTCTATGAGAATCCATCGTTCATATTCGATTTCTATAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAAAAAAAAA----------------GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Eragrostis_secundiflora">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACC-AATTTGCGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTG-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TTGAAAGGTTAAAATAAGAAAAAAGTCTTATTTTGGAAGAGTGGAAAA-CGTTTTT-----GATTAAAA-----GTCTATGAGAATCAATCGTTCATATTCGATTTGTATAG--------------------AAGAGGAAAACGCTTT------ATTGAAGGAAA---------TCAAAAAAAAAAAAGAAGGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Eragrostis_schweinfurthii">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGCGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACATAATTT-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TTGAAAGGTTAAAATAAGAAAAAAGTCTTATTTTGGAAGATTGGAAAA-CTTTTTG-----GATTAAAA-----GTCTATGAGAATCAATCGTTCATATTCGATTTCTATAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAAAAAAAA-----------------GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Eragrostis_rigidior">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGCGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTT-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TTGAAAGGTTAAAATAAGAAAAAAGTCTTATTTTGGAAGATTGGAAAA-CTTTTTT-----TATTAAAA-----GTCTATGAGAATCAATCGTTCATATTCGATTTCTATAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAAAAAAAA-----------------GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Eragrostis_polytricha">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGCGTTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTT-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TTGAAAGGTTAAAATAAGAAAAAAGTCTTATTTTGGAAGATTGGAAAA-CTTTTTT-----GATTAAAA-----GTCTATGAGAATCAATCGTTCATATTCGATTTCTATAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAAAAAAAAA----------------GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Eragrostis_pilosa_PI_221926">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGCGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTG-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TTGAAAGGTTAAAATAAGAAAAAAGTCTTATTTTGGAAGATTGGAAAA-CTTTTTT-----GATTAAAA-----GTCTATGAGAATCCATCGTTCATATTCGATTTCTATAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAAAAAAAAA----------------GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Eragrostis_pilosa">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGCGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTG-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TTGAAAGGTTAAAATAAGAAAAAAGTCTTATTTTGGAAGATTGGAAAA-CTTTTTT-----GATTAAAA-----GTCTATGAGAATCCATCGTTCATATTCGATTTCTATAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAAAAAAAAA----------------GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Eragrostis_patenti-pilosa">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACC-AATTTGCGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTT-----TTTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TTGAAAGGTTAAAAAAAGAAAAAAGTCTTATTTTGGAAGAGTGGAAAA-CTTTTTT-----TATTAAAA-----GTCTATGAGAATCAATCGTTCATATTCGATTTCTATAG--------------------AAGAGGAAAACGCTTT------ATTGAAGGAAA---------TCAAAAAAAAAA--GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Eragrostis_papposa">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGTGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACAGGATGGAGCTCGAGAAGACAGAATTA-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TTGAAAGGTTACAATAAGAAAAAAGTCTTATTTTGGAAGATTGGAAAA-CTTTTTT-----GATTAAAA-----GTCTATGAGAATCAATCGTTCATATTCGATTTCTATAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAAAAAAAA-----------------GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Eragrostis_paniciformis">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACC-AATTTGCGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTT-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TTGAAAGGTTAAAATAAGAAAAAAGTCTTATTTTGGAAGAGTGGAAAA-CTTTTTT-----GATTAAAA-----GTCTATGAGAATCAATCGTTCATATTCGATTTCTAGAG--------------------AAGAGGAAAACGCTTTATTTTTATTGAAGGAAA---------TAAAAAAAAAAAA-GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Eragrostis_nutans">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACC-AATTTGCGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTT-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TTGAAAGGTTAAAATAAGAAAAAAGTCTTATTTTGGAAGAGTGGAAAA-CTTTTTT-----GATTAAAA-----GTCTATGAGAATCAATCGTTCATATTCGATTTCTAGAG--------------------AAGAGGAAAACGCTTT------ATTGAAGGAAA---------TAAAAAAAAAAAA-GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Eragrostis_neesii">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGCGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTG-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TTTAAAGGTTAAAATAAGAAAAAAGTCTTATTTTGGAAGATTGGAAAA-CTTTTTG-----GATTAAAA-----GTCTATGAGAATCAATCGTTCATATTCGATTTCTATAG--------------------AAGAGGAGAATGCTTT------ATTGAAGGAAAAAAAAA-----------------GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Eragrostis_minor">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGCGTTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTT-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGTCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TTGAAAGGTTAAAATAAGAAAAAAGTCTTATTTTGGAAGATTGGAAAA-CTTTTTT-----GATTAAAA-----GTCTATGAGAATCAATCGTTCATATTCGATTTCTATAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAAAAAAAA-----------------GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Eragrostis_mexicana">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGCGTTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTT-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGTCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TTGAAAGGTTAAAATAAGAAAAAAGTCTTATTTTGGAAGATTGGAAAA-CTTTTTT-----GATTAAAA-----GTCTATGAGAATCAATCGTTCATATTCGATTTCTATAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAAAAAAAA-----------------GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Eragrostis_macilenta">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGCGTTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTT-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TTGAAAGGTTAAAATAAGAAAAAAGTCTTATTTTGGAAGATTGGAAAA-CTTTTTT-----GATTAAAA-----GTCTATGAGAATCAATCGTTCATATTCGATTTCTATAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAAAAAAAAA----------------GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Eragrostis_lugens">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGCGTTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTT-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TTGAAAGGTTAAAATAAGAAAAAAGTCTTATTTTGGAAGATTGGAAAA-CTTTTTT-----GATTAAAA-----GTCTATGAGAATCAATCGTTCATATTCGATTTCTATAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAAAAAAAAA----------------GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Eragrostis_lehmanniana">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGCGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTT-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TTGAAAGGTTAAAATAAGAAAAAAGTCTTATTTTGGAAGATTGGAAAA-CTTTTTT-----GATTAAAA-----GTCTATGAGAATCAATCGTTCATATTCGATTTCTATAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAAAAAAAAAA---------------GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Eragrostis_intermedia">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGCGTTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTT-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TTGAAAGGTTAAAATAAGAAAAAAGTCTTATTTTGGAAGATTGGAAAA-CTTTTTT-----GATTAAAA-----GTCTATGAGAATCAATCGTTCATATTCGATTTCTATAG--------------------AAGAGGA----GCTTT------ATTGAAGGAAAAAAAAAA----------------GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Eragrostis_hypnoides">
+			
+			-------------------------CCACCATTTTCCAAACTAATGAAAATGCTCTTGGCTCGACATACCCTGTTCTATTTGTCCCGAACCGAATTTGCGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTG-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATGCAGAAA-----TTGAAAGGTTAAAATAAGAAAAAAGTCTTATTTTGGAAGATTGGAAAA-CTTTTTT-----GATTAAAATAAAAGTCTATGAGAATCAATCGTTCATATTCGATTTCTATAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAAAAAAAA-----------------GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Eragrostis_heteromera">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCTAATTTGCGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTT-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TAGAAAGGTTAAAATAAGAAAAAAGTCTTATTTTGGAAGATTGAAAAA-CTTTTTT-----GATTAAAA-----GTCTATGAGAATCAATCGTTCATATTCGATTTCTATAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAAAAAAAAA----------------GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Eragrostis_elegantissima">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGCGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTT-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TTGAAAGGTTAAAATAAGAAAAAAGTCTTTTTTTTGAAGATTGGAAAA-CTTTTTT-----GATTAAAA-----GTCTATGAGAATCAATCGTTTATATTCGATTTCTATAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAAAAAAAAA----------------GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Eragrostis_echinochloidea">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGCGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTT-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TTAAAAGGTTAAAATAAGAAAAAAGTCTTATTTTGGAAGATTGGAAAA-CTTTTTT-----GATTAAAA-----GTCTATGAGAATCAATCGTTCATATTTGATTTCTATAG--------------------AAGAGGAAAAT-CTTT------ATTGAAGGAAAAAAAAA-----------------GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Eragrostis_dielsii">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGCGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTTCTT--TTTTTTTTTCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TTGAAAGGTTAAAATAAGAAAAAAGTCTTATTTTGGAAGATTGGAAAA-CTTTTTT-----GATTAAAA-----GTCTATGAGAATCAATCGTTCATATTCGATTTCTATAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAAAAAAAA-----------------GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Eragrostis_curvula">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGCGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTT-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TTGAAAGGTTAAAATAAGAAAAAAGTCTTATTTTGGAAGATTGGAAAA-CTTTTTT-----TATTAAAA-----GTCTATGAGAATCAATCGTTCATATTCGATTTCTATAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAAAAAAAA-----------------GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Eragrostis_ciliaris">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGCGCTGAGTTTTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTG-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TTGAAAGGTTAAAATAAGAAAAAAGTCTTATTTTTGAAGATTGGAAAA-CTTTTTT-----GATTAAAA-----GTCTATGAGAATCAATCGCTCCTATTCGATTTCTATAG--------------------AAGAGGAAAATGCTTT------ATTAAAGGAAA---------TAAAAAAAAAA---GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Eragrostis_cilianensis">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGCGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTT-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TTGAAAGGTTAAAATAAGAAAAAAGTCTTATTTTGGAAGATTGGAAAA-CTTTTTT-----TATTAAAA-----GTCTATGAGAATCAATCGTTCATATTCGATTTCTATAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAAAAAAAA-----------------GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Eragrostis_chapelieri">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGCGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTT-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TTGAAAGGTTAAAATAAGAAAAAAGTCTTATTTTGGAAGATTGGAAAA-CTTTTTT-----TATTAAAA-----GTCTATGAGAATCAATCGTTCATATTCGATTTCTATAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAAAAAAAA-----------------GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Eragrostis_botryodes_2">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGCGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTG-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TTGAAAGGTTAAAATAAGAAAAAAGTCTTATTTTGGAAGATTGGAAAA-CTTTTTT-----GATTAAAA-----GTCTATGAGAATCCATCGTTCATATTCGATTTCTATAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAAAAAAAAA----------------GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Eragrostis_botryodes_1">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACC-AATTTGCGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTT-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TTCAAAGGTTAAAATAAGAAAAAAGTCTTATTTTGGAAGAGTGGAAAA-CTTTTTT-----GATTAAAA-----GTCTATGAGAATCAATCGTTCATATTCGATTTCTAGAG--------------------AAGAGGAAAACGCTTTATTTTTATTGAAGGAAA---------TAAAAAAAAAAAA-GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Eragrostis_botryodes">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACC-AATTTGCGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTT-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TTGAAAGGTTAAAATAAGAAAAAAGTCTTATTTTGGAAGAGTGGAAAA-CTTTTTT-----GATTAAAA-----GTCTATGAGAATCAATCGTTCATATTCGATTTCTAGAG--------------------AAGAGGAAAACGCTTTATTTTTATTGAAGGAAA---------TAAAAAAAAAAAA-GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Eragrostis_bicolor">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGCGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTT------TTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TGGAAAGGTTAAAATAAGAAAAAAGTCTTATTTTGGAAGATTGGAAAA-CTTTTTT-----GATTAAAA-----GTCTATGAGAATCAATCGTTCATATTCGATTTCTATAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAAAAAAAAA----------------GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Eragrostis_barrelieri">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTTTCCCGAACCGAATTTGCGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTG-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TGGAAAGGTTAAAATAAGAAAAAAGTCTTATTTTGGAAGATTGGAAAA-CTTTTTT-----GATTAAAA-----GTCTATGAGAATCAATCGTTCATATTCGATTTCTATAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAAAAAAAA-----------------GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Eragrostis_bahiensis">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACC-AATTTGCGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTG-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TTGAAAGGTTAAAATAAGAAAAAAGTATTATTTTGGAAGAGTGGAAAA-CGTTTTT-----GATTAAAA-----GTCTATGAGAATCAATCGTTCATATTCGATTTCTATAG--------------------AAGAGGAAAACGCTTT------ATTGAAGGAAAAAAAAAAAAA-------------GAAGGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Eragrostis_aspera">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTTTCCCGAACCGAATTTGCGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTG-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TGGAAAGGTTAAAATAAGAAAAAAGTCTTATTTTGGAAGATTGGAAAA-CTTTTTT-----GATTAAAA-----GTCTATGAGAATCAATCGTTCATATTCGATTTCTATAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAAAAAAAA-----------------GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Eragrostis_airoides">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGCGTTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTT-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TTGAAAGGTTAAAATAAGAAAAAAGTCTTATTTTGGAAGATTGGAAAA-CTTTTTT-----GATTAAAA-----GTCTATGAGAATCAATCGTTCATATTCGATTTCTATAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAA--------------AAAAAAA--GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Enneapogon_scopiarus">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCAAATTTGCGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATT---------TTTTAGCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCTTAACTTAATATAGAAA-----TTGAAAGGTTCAAATAAGAAAAAAGGAAAATTTTGGAAGATTGGAAAT-CT----------GATTAAAA-----GTCTATGAGAATCAATCGTTCATATTCGATTTCTATCGTTCCTATTCGATTTCTATAGAAGAGGAAAATGCTTT------ATTGAAGGAAAAAAAAA-----------------GAAGGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Eleusine_corocana">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGCACTGGGTTGTTT-----------------------------GATAAGTAAA-----TAGTACACGATGGAGCTCGAGAATACAGAATAGAATTGATTTTTTATCAAGGGAAAGAATCTATGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTAAGTCTATCCT-----TAATATAGAAATTAAATTGAAAGGTTAAAATAAGAAAAA-GTCTAATTTTGGAAGATTGGAAAA-CTTTTTTTTT--GATTAAAA-----GTCTATCAGAATCAATCGTTCATATTCAATTTCTCTAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAA---------TAAGAAAAAAA---GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Diandrochloa_japonica">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGCGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTT-----AATTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATACAGAAA-----TTGAAAGGTTAAAATAAGAAAAAAGTCTTATTTTGGAAGATTGGAAAA-CTTTTTT-----GATTAAAA-----GTCTATGAGAATCAATCGTTCATATTCGATTTCTATAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAAAAAAAA-----------------GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Dactyloctenium_radulans">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTATTCTATTTGTCCCGAACCAAATTTGCGCTGGGTTGTTT-----------------------------C-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAACACAGAATTG-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATATAGAAA-----TTGAAAGGTTAAAATAAGAAAAA-GTCTAATTTTGGAAGATTGGGAAA-CTTTTTTTTC--GATTTAAA-----ATCTATCAGAATCAACCGTTCATATTCGATTTCTCTAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAA---------TAAGAAAAAAA---GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Dactyloctenium_giganteum">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTATTCTATTTGTCCCGAACCAAATTTGCGCTGGGTTGTTT-----------------------------C-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTG-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATATAGAAA-----TTGAAAGGTTAAAATAAGAAAAA-GTCTAATTTTGGAAGATTGGGAAA-CTTTTTTTTT-CGATTTAAA-----ATCTATCAGAATCAACCGTTCATATTCGATTTCTCTAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAA---------TAAGAAAAAAA---GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Dactyloctenium_australe">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTATTCTATTTGTCCCGAACCAAATTTGCGCTGGGTTGTTT-----------------------------C-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTG-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATATAGAAA-----TTGAAAGGTTAAAATAAGAAAAA-GTCGAATTTTGGAAGATTGGGAAA-CTTTTTTTTT-CGATTTAAA-----ATCTATCAGAATCAACCGTTCATATTCGATTTCTCTAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAA---------TAAGAAAAAAA---GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Dactyloctenium_aegyptium">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGGATTTGCGCTGGGTTGTTT-----------------------------C-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTG-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATATAGAAA-----TTGAAAGGTTAAAATAAGAAAAA-GTCTAATTTTGGAAGATTGGGAAA-CTTTTTTTTC--GATTAAAA-----ATCTATCAGAATCAATCGTTCATATTCGATTTCTCTAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAAA---GGAAATAAGAAAAAAA---GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Coelachyrum_piercei">
+			
+			ATCGATTGTGGATTTTT----CTATCCATCATTTTCCATAGTAATGAAAATGTTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCTAATTTGCGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAGGACAGAATTT-----CTTTTTTCTCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATATAGAAA-----TAAAAAGGTTAAAATAAGAAAAAAGTCAAATTTTGGAAGATTGGAAAAACTTTTTC-----GATTAAAA-----GTCTATCTGAATCAATCGTTCATATTTGATTTCTATAG--------------------AAGAGTGAAATGCTTT------ATCGAAGGAAA---------TAAGAAAAAA----GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Cladoraphis_spinosa">
+			
+			----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------GTNGGGAAAAAAAAAAAAA-------------GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Calamovilfa_longifolia">
+			
+			ATCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCCAATTTGCGCTGAGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATAG-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATATAGAAA-----TTGAAT----AAAATAAGAAAAA-GTCTAATTTTGGAAGATTGGAAAA-CTTTTTC-----GATTAAAA-----GTCTATCAAAATCAATCGTTCATATTCGATTTCTCTAG--------------------AAAAGCAAAATGCTTT------ATTGAAGGAAAAA--GGAAATAAGAAAAAAA---GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Calamovilfa_gigantea">
+			
+			-TCGATTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCCAATTTGCGCTGAGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATAG-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATATAGAAA-----TTGAAT----AAAATAAGAAAAA-GTCTAATTTTGGAAGATTGGAAAA-CTTTTTC-----GATTAAAA-----GTCTATCAAAATCAATCGTTCATATTCGATTTCTCTAG--------------------AAAAGCAAAATGCTTT------ATTGAAGGAAAAA--GGAAATAAGAAAAAAA---GAAAGGGTATGTTGC [...]
+		</sequence>
+<sequence taxon="Acamptoclados_sessilispicus">
+			
+			ATCGATTGTGGATTTTGTTNGCTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGCGCTGGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTT-----CTTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAGTACTGAAA-----TTGAAAGGTTAAAATAAGAAAAAAGTCTTATTTTGGAAGATTGGAAAA-CTTTTTT-----GATTAAAA-----GTCTATGAGAATCAATCGTTCATATTCGATTTCGATAG--------------------AAGAGGAAAATGCTTT------ATTGAAGGAAA---------TAAAAAAAAAA---GAAAGGGTATGTTGC [...]
+		</sequence>
+</data>
+    <!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+    <input spec='HKY' id='hky'>
+        <kappa idref='hky.kappa'/>
+        <frequencies id='freqs' spec='Frequencies'>
+            <data idref='alignment'/>
+        </frequencies>
+    </input>
+
+    <!-- site model                                                              -->
+    <input spec='SiteModel' id="siteModel" gammaCategoryCount='1'>
+        <!--
+            <parameter name='shape' id='shape' value='0.5'/>
+            <parameter name='proportionInvariant' id='propInvar' value='0.2'/>
+        -->
+        <substModel idref='hky'/>
+    </input>
+
+    <input spec='TreeLikelihood' id="treeLikelihood">
+        <data idref="alignment"/>
+        <tree idref="tree"/>
+        <siteModel idref="siteModel"/>
+    </input>
+
+    <parameter id="hky.kappa" value="1.0" lower="0.0"/>
+
+    <tree id='tree'/>
+
+    <tree spec='beast.util.ClusterTree' id='upgmatree' clusterType='upgma' initial='@tree'>
+        <taxa idref='alignment'/>
+    </tree>
+    <tree spec='beast.evolution.tree.RandomTree' id='coalescentSimulator' initial='@tree' taxa='@alignment'>
+        <populationModel spec='ConstantPopulation'>
+            <popSize spec='parameter.RealParameter' value='1'/>
+        </populationModel>
+    </tree>
+
+
+    <run spec="MCMC" id="mcmc" chainLength="5000000" preBurnin="0">
+
+        <init idref='coalescentSimulator'/>
+        <distribution spec='CompoundDistribution' id='posterior'>
+<!--
+	make it comparable to the files in the BEAST 1 directory, that do not use a prior either
+            <distribution spec='beast.math.distributions.Prior' x='@hky.kappa'>
+                <distr spec='beast.math.distributions.OneOnX'/>
+            </distribution>
+-->
+            <distribution id='likelihood' idref="treeLikelihood"/>
+        </distribution>
+
+        <operator id='kappaScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" parameter="@hky.kappa"/>
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" tree="@tree"/>
+
+        <operator spec='SubtreeSlide' weight="5" gaussian="true" size="1.0" tree="@tree"/>
+
+        <operator spec='Uniform' weight="10" tree="@tree"/>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="1" tree="@tree"/>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="1" tree="@tree"/>
+        <operator spec='WilsonBalding' weight="1" tree="@tree"/>
+
+        <logger logEvery="10000" fileName="test.log">
+            <model idref='likelihood'/>
+            <log idref="likelihood"/>
+            <log idref='hky.kappa'/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+        </logger>
+        <logger logEvery="10000" fileName="test.trees">
+            <log idref="tree"/>
+        </logger>
+        <logger logEvery="10000">
+            <model idref='likelihood'/>
+            <log idref="likelihood"/>
+            <ESS spec='ESS' name='log' arg="@likelihood"/>
+            <log idref='hky.kappa'/>
+            <ESS spec='ESS' name='log' arg="@hky.kappa"/>
+        </logger>
+    </run>
+</beast>
+
diff --git a/examples/benchmark/II/testHKY1749.xml b/examples/benchmark/II/testHKY1749.xml
new file mode 100644
index 0000000..41c93c4
--- /dev/null
+++ b/examples/benchmark/II/testHKY1749.xml
@@ -0,0 +1,379 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beast xmlns="http://www.w3.org/TR/xhtml1/strict" version="2.0" namespace="beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood">
+<data dataType="nucleotide" id="alignment">
+<sequence taxon="Pogonarthria_squarrosa">
+			
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACAGTGAG----CCAAGCACAATTAGTTTACCT----CATTATTGCTACTGTTCGATGATC---------------------------------------GAACTTCTTT-----GGGTTTT-CGGTAC----TGTTCGGT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Pappophorum_mucronulatum">
+			
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCTGTGAAATACGACGTGGAAACAGTGAG-------------------------------------------------------------------------------------------------------------------------------------CTCTTGTAT-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Pappophorum_bicolor">
+			
+			GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAACGACAAGTACATCGCTGTGAAATACGACGTGGAAACAGTGAG-------------------------------------------------------------------------------------------------------------------------------------CTCTTGTAT-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Leptochloa_dubia_5.3">
+			
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGAGGAAACCGTGAG-------------------------------------------------------------------------------------------------------------------------------------TTCATTCATTACCACTGTGTGAACTTGTTTGATTTTTCAGTACTAATCGGTCCTGAGTTTTTGACGAGGCA------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ [...]
+		</sequence>
+<sequence taxon="Leptochloa_dubia_5.1">
+			
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATAGCCGTGAAATACGACGACGAAACCGTGAG-------------------------------------------------------------------------------------------------------------------------------------TTCATTCGTTGCCACTGTGTGAACTTGTTTGATTTTTTGGTACTAGTAATC-----GGTTCTGACGAGGCA------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ [...]
+		</sequence>
+<sequence taxon="Fingerhuthia_sesleriiformis">
+			
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCAAGCAAGGACAAGTACGTCGCCGTGAAATACGACGCCGAAACCGTGAG----CCTAGCTAGCGCAAACTTCTTTCATTTCATTGCT---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ACTGTGTGGACTTGTTCGGTTTTTTAGTACTACAATTCGATTCT----------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_unioloides">
+			
+			GGGATCGTCA-CGG?-ATGGACGTCGGCGAGTGGGATCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCAGAAACAGTGAG----CCAAGCACAATCATGTTCCTT----CATTGAC---ACTGTTCGAT-------------------------------------------GAACTTCTTT-----GGATTTT-CAGTAC----TGTTCGGT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_truncata">
+			
+			GGGATCGTCA-CGGC-ATGGACGTTAGTGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACAGTGAG----CCAAGCCCAATCATTTCGCTT----CGTTGTT---ACTGTTCGAT-------------------------------------------GAACTTCTTT-----GGGTTTT-CGGTGC----TGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_trichophora_4.4">
+			
+			GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATTGCCATGAAATACGATGCTGAAACAGTGAG----CCAAGCACAATCATTT-GCTT----CATTGAT---ACTGTTTGAT-------------------------------------------GAACTTCTTTT----GGATTTT-CAGTAC----TGTTCTAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_trichophora_4.2">
+			
+			------------------GGACGTCAGCGAGTGGGATCCCAGCAAGGACAAGTACACCGCCATGAAATACGACGCAGAAACAGTGAG----CCAAGCACAATCATGTTCCTT----CATTGAC---ACTGTTCGAT-------------------------------------------GAACTTCTTT-----GGATTTT-CGGTAC----TGTTCGGT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_tremula_7.6">
+			
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACAGTACGTGAGCCAAGCACAGTCATTTTTATT---GGATTGC-----TACCGTGTGAT-----------------------------------------GAGCTTCTTT-----GGATTTT-CAGTAC----TGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_tremula_5.3">
+			
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACAGTGAG--AGCCAAGCACAATCATTTTACTT----CATTGCTAGTACTGTTTGAT-------------------------------------------GAACTTCTTTGGCTACGATTTT-CAGGCC----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_tenella">
+			
+			GGGATCGTCA-CGGC-ATGGACATCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACCGTACGTGAGCCAAGCACAATCATTTTTTTTT--GGATTGAT---ATTGTGTGAT-------------------------------------------GAACTTCTTT-----GGATTTT-CAGTAC----TGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_tef_red_dabi_6.9">
+			
+			GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCTGAAACGGTGAA--------------CCATTTTGCTT----CATTGCT---ACTGTTTCAT-------------------------------------------GAACTTCTTT-----GGATTTT-CAGTGC----TGTT--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_tef_red_dabi_3">
+			
+			GGGATCGTCAATGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACGGTGAG----CCAAGCACAATCATTTTACTT-CGTCATTGCT---ACTGTTTGAT-------------------------------------------GAACTTCTTT-----GGATTCT-CAGTAC----TGTTTTAA----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------AT----------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_secundiflora">
+			
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAATGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACAGTACGTTAG-CAAGCACAATCTTTTTTTTTTTTGGATTAC-----TACCGTGTGAC-----------------------------------------GAACTTCTTT-----GGATTTT-CTATAC----CGTGTGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CGAT--------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_schweinfurthii">
+			
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCTGTGAAATACGACACGGAAAC----TGTGAGCCAATCACAAACATTTCACTA---------C-----TACCTTCTTTCATTTCATTGCTACTGTGTCTGTGT-----------------GAACTTGTTT-----TGTTTT-------------GTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_rigidior">
+			
+			GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCTGAAACAGTGAG----CCAAGCTCAATCACTTGACTT----TGTTGAT---AATGTTCGAT-------------------------------------------GGACTTCTTT-----GGATTTT-CAGTAC----CGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_polytricha">
+			
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACAGTGAG--AGCCAAGCACAATCATTTTACTT----CATTGCTAGTACTGTTTGAT-------------------------------------------GAACTTCTTT-----GGATTTT-CAGTAC----TGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_pilosa_2.7">
+			
+			GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCTGAAACGGTGAA--------------CCATTTTACTT----CATTGCT---ACTGTTTCAT-------------------------------------------GAACTTCTTT-----GGATTTT-CAGTGC----TGTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_pilosa_2.6">
+			
+			GGGATCGTCAATGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACGGTGAG----CCAAGCACAATCATTTTACTT-CGTCATTGCT---ACTGTTTGAT-------------------------------------------GAACTTCTTT-----GGATTCT-CAGTAC----TGTTTTAA----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------AT----------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_patenti-pilosa">
+			
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACAGTACGTGAGCCAAGCACAGTCTTTTTTTTT---GGATGGC-----TACTGTGTGAT-----------------------------------------GAACTTCTTT-----GGATTTC-CAGTAC----CGCTCGGT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_papposa">
+			
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCTGAAACAGTGAG----CCAAGCACAATCATTTTACTT----CATTGAT---ACCGTTCGGT-------------------------------------------GAACTTCTTT-----GGATTTT-CGGTGC----TGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_paniciformis_ETH_3_9.8">
+			
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACAGTACGTGAGCCGAGCGCAGTCATTTTTT----AGGATCGC-----TACCGTGTGAC--------------------------------------------GTTCTTT-----GGATTTT-CTGTAC----TGTGTGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CGATTCTG----------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_paniciformis_9.11">
+			
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACAGTACGTGAGCCGAGCACAGTCATTTTTT----AGGATCGC-----TACCGTGTGAC--------------------------------------------GTTCTTT-----GGATTTT-CTGTAC----TGTGTGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CGATTCTG----------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_nutans">
+			
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACAGTACGTGAGCCGAGCACAGTCATATTTTT---GGGATCGACAGACTACCGTGTGAC----------------------------------------GAAAGTTCTTT-----GGATTTT-CTGTAC----AGTGTGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CGATTCTG----------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_neesii">
+			
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAAC----TGTGAGCCAAGCACAATCACGTTTTTT-----ATTGC-----TACTGCGTGAT-----------------------------------------GAATTTCCTA-----GGTTGCT-CAGTAC----TGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_minor_3.4">
+			
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCTGAAACAGTGAG----CCAAGCTCAATCACTTGACTT----CCTTGAT---AATGTTCGAT-------------------------------------------GGACTTCTTT-----GGATTTT-CAGTAC----CGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_minor__PI_223367_22">
+			
+			---ATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACAGTGAG--AGCCAAGCACAATCATTTTACTT----CATTGCTAGTACTGTTTGAT-------------------------------------------GAACTTCTTT-----GGATTTT-CAGTAC----TGTGCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Uniola_paniculata">
+			
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACAGTGAG----CCTAGCACAAACATTTTACTACTCCCTCTAATTTTAAATATCCGACGCTGTTAATTTTT-----------------------------TTCATTATTT-----TAACTAT-TTATTT----TTTTATAAATATTTATGTAAATAGCTAAATGTATAAATTAACCTTAAAATATTTTTGATGATAGATCTAATGATACTTATTTTACGTTTAAATAATTAATTATTTAAATATATATTGTTAGTTAAAATTCAATAAAAAATTTAACGGTGTCATATATTTAAAAAAGGAAGGATCGTTTCATTGCCACTGTGTGAGTAATGTTCGAT----------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Thellungia_advena">
+			
+			GGGATCGTGAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAGACTGTGAG-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------AGCCTTC [...]
+		</sequence>
+<sequence taxon="Tetrachne_dregei">
+			
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTCAAATACGACGCCGAAACCGTGAG----CCTAGCACAACTTCTTTCATTTCATTGCGACTGTGTGGACTTGTTCGGTTT-TTTAGTACTGCACAATTCGATTC----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Sporobolus_indicus_6.2">
+			
+			GGAATCGTCAACGGCAATGGACGTCAGCGAGTGGGACCCTAGCAAGGACAAGTACATCGCCGTGAAGTACGACGTGGAAACCGTGAG-------------------------------------------------------------------------------------------------------------------------------------GACCTGCATGCTAGCTTGTTTTGTT-CCACATGACTCAATTTATTCATTGCCACTGCGTCCATTCATCAGTGCCAGTGAACTATTCGATTCTGAATTTCTGACGAGGCAATAAGGG--------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Sporobolus_indicus_6.1">
+			
+			GGAATCGTCAACGGCAATGGACGTCAGCGAGTGGGACCCTAGCAAGGACAAGTACATCGCCGTGAAGTACGACGTGGAAACCGTGAG-------------------------------------------------------------------------------------------------------------------------------------GACCTGCATGCTAGCTTGTTTTGTT-CCACATGACTCAATTTATTCATTGCCACTGCGTCCATTCATCAGTGCCAGTAAACTATTCGATTCTGAATTTCTGACGAAGCAATAAGGG--------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Spartina_pectinata">
+			
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGAAGGGACAAGTACATCGCCGTGAAGTACGACGTGGAAACTGTGAG-------------------------------------------------------------------------------------------------------------------------------------TCTAT------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------TTTCGT [...]
+		</sequence>
+<sequence taxon="Schmidtia_pappophoroides">
+			
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCCTCAAATACGACGCCGAAACGGTACGTGAGCCAGGCACACACATTTCACCGTTTT---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------TCATAGCCACTGTACTGCTCGAT----------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_mexicana_PI_203652_3.1">
+			
+			GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACAGTGAG--AGCCAAGCACAATCATTTTACTT----CATTGCTAGTACTGTTTGAT-------------------------------------------GAACTTCTTT-----GGATTTT-CAGTAC----TGTGCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_mexicana_PI_203652_1.1">
+			
+			GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCTGAAACAGTGAG----CCAAGCTCAATCACTTGACTT----CGTTGAT---AATGTTCGAT-------------------------------------------GGACTTCTTT-----GGATTTT-CAGTAC----CGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_macilenta_PI_194929_6">
+			
+			GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACAGTGAG--AGCCAAGCACAATCATTTTACTT----CATTGCTAGTACTGTTTGAT-------------------------------------------GAACTTCTTT-----GGCT--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_macilenta_PI_194929_2.4">
+			
+			GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGATAAGTACATCGCCATGAAATACGACGCTGAAACAGTGAG----CCAAGCTCAATCACTTGACTT----TGTTGAT---AATGTTCGAT-------------------------------------------GGACTTCTTT-----GGATTTT-CAGTAC----CGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_lugens">
+			
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACAGTGAG--AGCCAAGCACAATCATTTTACTT----CATTGCTAGTACTGTTTGAT-------------------------------------------GAACTTCTTT-----GGATTTT-CAGTAC----TGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_lehmanniana">
+			
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACAGTGAG----CCAAGCACAATCATTTTGCTT----TATTGCT---ACTGTTTGAT------------------------------CGATGAATTTCCTGAACTTCTTT-----GGATTTG-GAGTAC----TGTTCGGT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_intermedia">
+			
+			GGGATCGTCA-TGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACAGTGAG----CCAAGC-------------------------T---ACTGTTTGAT-------------------------------------------GAACTTCTTT-----GGATTTT-CAGTAT----TGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_heteromera_4.1">
+			
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACAGTGAG----CCAAGCACAATCATGTTCCTT----CATTGCTATTACTGTTTGAT-------------------------------------------GAACTTCTTT-----GGATTTT-CAGTAC----TGTTCGTT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_heteromera_2.9">
+			
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATATGACGCGGAAACGGTGAG----CCAAGCACAATCATTT-------------GCT---ACTGTGTG--------------------------------------------------------------ATTTT-CAGTACGTACTGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_elegantissima">
+			
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATTGCCATGAAATACGACGCTGAAACAGTGAG----CCAAGCACAATCATTTCGCTT----CATTGAT---ACTGTTCGAT-------------------------------------------GAACTTCTTT-----AGATTTT-CGGTGC----TGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_echinochloidea">
+			
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACAGTGAG----CCAAGCACAGTCATTTCGCTT----CACTGAT---ACTGTTGGAT-------------------------------------------GAACTTCTTT-----GGTTTT--CAGTAC----CGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_dielsii">
+			
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCCGAAACCGTGAG----CTTAGCACAAACATTTACT-----AGCTAGCT---ACTAGTA-------------------------------------------------GTGCTTT-CTTT--------CAGTAC----TGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------T------------------------------------------------------------------------------ [...]
+		</sequence>
+<sequence taxon="Eragrostis_curvula">
+			
+			GGGATCGTCAACGGC-ATGGACGTCGGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCCGAAACAGTGAG----CCAAGCACAATCACTTTACTT----CATTGAG---ACTGTTCGAT-------------------------------------------GAACTTAATT-CTTTGGATTTT-CGGTAC----TGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_ciliaris">
+			
+			GGGATCGTCA-CGGC-ATGGACGTCAGTGAGTGGGACCCCAGCAAGGACAAGTATATCGCCGTGAAATACGACGCGGAAACAGTACGTGAGCCAAGCACAATCATTTTTTTTT--GGATTGAT---ATTGTGTGAT-------------------------------------------GAACTTCTTT-----GGATTTT-CAGTAC----TGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_cilianensis_PI_299912_1.4">
+			
+			GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCTGAAACAGTGAG----CCAAGCTCAATCACTTGACTT----TGTTGAT---AATGTCCGAT-------------------------------------------GGACTTCTTT-----GGATTTT-CAGTAC----CGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_cilianensis_PI_299912_1.3">
+			
+			GGCATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCCGAAACAGTGAG----CCAAGCACAATCACTTTACTT----CATTGAG---ACTGTTCGAT-------------------------------------------GAACTTAATT-CTTTGGATTTT-CGGTAC----TGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_cilianensis_eth24_6.5">
+			
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCTGAAACAGTGAG----CCAAGCTCAATCACTTGACTT----CGTTGAT---AATGTTCGAT-------------------------------------------GGACTTCTTT-----GGATTTT-CAGTAC----CGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_chapelieri">
+			
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCTGAAACAGTGAG----CCAAGCTCAATCACTTGACTT----CGTTGAT---AATGTTCGAT-------------------------------------------GGACTTCTTT-----GGATTTT-CAGTAC----CGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_botryodes_ETH_9_2.1">
+			
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACAGTACGTGAGCCGAGCACAGTCATTTTTT----AGGATCGC-----TCCCGTGTGAC-----------------------------------------GAAGTTCTTT-----GGATTTT-CTGTAC----TGTGTGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CGATTCTG----------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_botryodes_ETH_13_3.5">
+			
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACAGTACGTGAGCCAAGCGCAGTCATTTTTT-----GGATTGC-----TACCGTGTGATCGAT-------------------------------------GAACTTCATT-----GGATTTTCCAGTAC----TGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_bicolor21">
+			
+			GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACTCGGAAACAGTGAG----CCAAGCACAATCATTTTACTT-CTTAATTGCT---ACTGTGTGAT-------------------------------------------GAACTTATTT-----GGATTTT-CGGTAC----TGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_bicolor_25">
+			
+			CGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACTCGGAAACAGTGAG----CCAAGCACAATCATTTTACTT-CTTAATTGCT---ACTGTGTGAT-------------------------------------------GAACTTATTT-----GGATTTT-CGGTAC----TGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_barrelieri_1.5">
+			
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCCGAAACAGTGAG----CCAAGCACAATCACTTTACTT----CATTGAT---ACTGTTCGAT-------------------------------------------GAACTTAATT-CTTTGGATTTG-CGGTAC----TGTTCGCT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_barrelieri_1.4">
+			
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCTGAAACAGTGAG----CCAAGCTCAATCACTTGACTT----TGTTGAT---AATGTTCGAT-------------------------------------------GGACTTCTTT-----GGATTTT-CAGTAC----CGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_bahiensis_1.9">
+			
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAATGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACAGTACGTGAG-CAAGCACAATCTTTTTTTTT-TTGGATTAC-----TACCGTGTGAC-----------------------------------------GAACTTCTTT-----GGATTTT-CTATAC----CGTGTGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CGAT--------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_bahiensis_1.8">
+			
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACAGTACGTGAGCCAAGCAGAGTCACTTTTATT---GGATTGC-----TACCGTGTGAT-----------------------------------------GAGCTTCTTT-----GGATTTT-CAGTAC----TGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_aspera">
+			
+			GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCCGAAACAGTGAG----CCAAGCACAATCACTTTACTT----CATTGAT---ACTGTTCGAT-------------------------------------------GAACTTAATT-CTTTGGATTTG-CGGTAC----TGTTCGCT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eragrostis_airoides">
+			
+			GGGATCGTCAATGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACAGTGAG----CCAAGCT----------------------------ACTGTTTGAT-------------------------------------------GAACTTCTTT-----GGATTTT-CAGTAC----TGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Enneapogon_scoparius">
+			
+			GGGATCGTCA-CGGC-ATGGACATCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTCAAATACGACGCCGAAACCGTGAG----CCAAGCACA------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------GTCATTTCACCGTCTTTCATTGCCACTGTACTGCTC----------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Eleusine_corocana">
+			
+			GGAATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCTAGCAAGGACAAGTACATCGCCGTCAAATACGACGAGGAAACCGTGAG------------------------------------------------------------------------------------------------------------------------------------------------TTCTTCATCTGTTGTTGCCACCGTGTGAACTTGTTTGATTATTCAGTAGTACTACTATAGGGATTCGG--TTCTGATTATGCAACCATGCAA---------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Diandrochloa_japonica">
+			
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGATCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCAGAAACAGTGAG----CCAAGCACAATCATGTTCCTT----CATTGAC---ACTGTTCG??T------------------------------------------GAACTTCTTT-----GGATTTT-CAGTAC----TGTTCGGT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Dactyloctenium_radulans">
+			
+			GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAGACCGTGAG-------------------------------------------------------------------------------------------------------------------------------------CCATCTTCTTCTTTCACATTAATTGTTGCCACTGTCTCTGTGAACTTGTTTTGGTTTTTCGTTAAGTACTAATAATCGGGGTTCTGATCAAGCAAGCGTGGGA---------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Dactyloctenium_aegypticum">
+			
+			GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACCGTGAG-------------------------------------------------------------------------------------------------------------------------------------CTCAT---------------------TCGTTCCCACTTTGTGAACTTGTTTGAGTTTTCAGTACTCTGTTCGATTCTGA------CAAGGCATTCGGTGCAAA---------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Coelachyrum_piercei">
+			
+			GGGATCGTCAACGGC-CTGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCACCAAGTACGACGTGTCAACGGTGAG-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CTTTCAGTTTCACCAAA [...]
+		</sequence>
+<sequence taxon="Calamovilfa_longifolia">
+			
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACACCGCTATGAAATACGACGTGGAAACTGTGAG-------------------------------------------------------------------------------------------------------------------------------------TCTTTTTTT-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Calamovilfa_gigantea">
+			
+			GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGTCGAAACTGTGAG-------------------------------------------------------------------------------------------------------------------------------------TATATATA--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Acamptoclados_sessilispica_1.8">
+			
+			GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTCAAATACGACGCGGAGACAGTACGTGAGCCAAACACAGTCATTTTTT--------GGATGGCTACCGTGTGAT-------------------------------------------GAACTTCTTT-----GGATTTC-CAATAC----TGTT------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CGAT----------------------------------------------------------------------- [...]
+		</sequence>
+<sequence taxon="Acamptoclados_sessilispica_1.3">
+			
+			GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACAGTACGTGAGCCAAGCACAGCCATTTTTTTC------GGATTGCTACCGTGTGAT-------------------------------------------GAACTTCTTT-----GGATTTT-CAGTAC----TGTT------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CAAT----------------------------------------------------------------------- [...]
+		</sequence>
+</data>
+    <!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+    <input spec='HKY' id='hky'>
+        <kappa idref='hky.kappa'/>
+        <frequencies id='freqs' spec='Frequencies'>
+            <data idref='alignment'/>
+        </frequencies>
+    </input>
+
+    <!-- site model                                                              -->
+    <input spec='SiteModel' id="siteModel" gammaCategoryCount='1'>
+        <!--
+            <parameter name='shape' id='shape' value='0.5'/>
+            <parameter name='proportionInvariant' id='propInvar' value='0.2'/>
+        -->
+        <substModel idref='hky'/>
+    </input>
+
+    <input spec='TreeLikelihood' id="treeLikelihood">
+        <data idref="alignment"/>
+        <tree idref="tree"/>
+        <siteModel idref="siteModel"/>
+    </input>
+
+    <parameter id="hky.kappa" value="1.0" lower="0.0"/>
+
+    <tree id='tree'/>
+
+    <tree spec='beast.util.ClusterTree' id='upgmatree' clusterType='upgma' initial='@tree'>
+        <taxa idref='alignment'/>
+    </tree>
+    <tree spec='beast.evolution.tree.RandomTree' id='coalescentSimulator' initial='@tree' taxa='@alignment'>
+        <populationModel spec='ConstantPopulation'>
+            <popSize spec='parameter.RealParameter' value='1'/>
+        </populationModel>
+    </tree>
+
+
+    <run spec="MCMC" id="mcmc" chainLength="5000000" preBurnin="0">
+
+        <init idref='coalescentSimulator'/>
+        <distribution spec='CompoundDistribution' id='posterior'>
+<!--
+	make it comparable to the files in the BEAST 1 directory, that do not use a prior either
+            <distribution spec='beast.math.distributions.Prior' x='@hky.kappa'>
+                <distr spec='beast.math.distributions.OneOnX'/>
+            </distribution>
+-->
+            <distribution id='likelihood' idref="treeLikelihood"/>
+        </distribution>
+
+        <operator id='kappaScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" parameter="@hky.kappa"/>
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" tree="@tree"/>
+
+        <operator spec='SubtreeSlide' weight="5" gaussian="true" size="1.0" tree="@tree"/>
+
+        <operator spec='Uniform' weight="10" tree="@tree"/>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="1" tree="@tree"/>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="1" tree="@tree"/>
+        <operator spec='WilsonBalding' weight="1" tree="@tree"/>
+
+        <logger logEvery="10000" fileName="test.log">
+            <model idref='likelihood'/>
+            <log idref="likelihood"/>
+            <log idref='hky.kappa'/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+        </logger>
+        <logger logEvery="10000" fileName="test.trees">
+            <log idref="tree"/>
+        </logger>
+        <logger logEvery="10000">
+            <model idref='likelihood'/>
+            <log idref="likelihood"/>
+            <ESS spec='ESS' name='log' arg="@likelihood"/>
+            <log idref='hky.kappa'/>
+            <ESS spec='ESS' name='log' arg="@hky.kappa"/>
+        </logger>
+    </run>
+</beast>
+
diff --git a/examples/benchmark/II/testHKY1809.xml b/examples/benchmark/II/testHKY1809.xml
new file mode 100644
index 0000000..0f578be
--- /dev/null
+++ b/examples/benchmark/II/testHKY1809.xml
@@ -0,0 +1,319 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beast xmlns="http://www.w3.org/TR/xhtml1/strict" version="2.0" namespace="beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood">
+<data dataType="nucleotide" id="alignment">
+<sequence taxon="Varecia_variegata_variegata">
+			
+			ATGGCTCATCCAGTCCAACTAGGATTTCAAGACGCCGCTTCTCCTATTATAGAAGAACTCCTATATTTTCATGACCACACCCTAATAATTATATTTCTAATTAGCTCTTTAGTCCTATATATTATTTCCCTAATACTCACTACTAAACTCACACATACAAGCACTATAGATGCTCAAGAAGTAGAGACAGTATGAACAATTCTACCCGCAGCAATTCTCATTCTTATTGCCCTCCCCTCACTACGTATCCTATACATAATGGACGAAATTACTTCTCCTTCCCTTACCCTTAAAACCATAGGTCACCAATGATATTGAAGTTATGAATATACGGATTACGAAAATTTATGCTTTGACTCATATATAACCCCCTGCTCAGACCTAAAACCCGGAGAACTTCGCTTACTTGAAGTAGATAATCGAGTCGTTCTACCCACAGAACTATCAATCCGAACGCTAATCTCTTCAGAAGATGTATTACACTCATGA [...]
+		</sequence>
+<sequence taxon="Varecia_variegata_rubra">
+			
+			ATGGCTCATCCAGTCCAACTAGGATTTCAAGACGCCGCTTCTCCTATTATAGAAGAACTCCTATATTTTCACGACCACACCCTAATAATTATATTCCTAATTAGCTCTTTAGTCCTATATATTATTTCCCTAATACTCACTACTAAACTCACACATACAAGCACTATAGATGCTCAAGAAGTAGAAACAGTATGAACAATTTTACCCGCAGCAATTCTTATTCTTATTGCCCTCCCCTCACTACGTATCCTATACATGATGGACGAAATTACTTCTCCTTCCCTTACCCTTAAAACCATAGGTCACCAATGATATTGAAGTTATGAGTATACGGATTACGAAAATTTATGCTTTGACTCATATATAACCCCCTGCTCAGACCTAAAACCCGGAGAACTTCGCTTACTTGAAGTAGATAATCGAGTCGTTCTACCCACAGAACTGTCAATCCGAACGCTAATCTCTTCAGAAGATGTATTACACTCATGA [...]
+		</sequence>
+<sequence taxon="Ursus_americanus">
+			
+			ATGGCACACCCCTTTCAAATAGGTCTTCAAGATGCAACTTCTCCTATCATAGAAGAACTCCTACATTTTCATGACCATACATTAATAATTGTATTCCTAATTAGCTCCTTAGTTCTCTATATTATTTCAACTATATTAACTACCAAATTAACACACACAAACACAATGGATGCACAAGAAGTAGAGACGGTGTGAACCATCCTGCCAGCTATAATCCTAATTCTAATCGCACTCCCATCGCTACGGATTCTCTATATAATGGATGAAATCAATAACCCCTCACTGACCGTAAAAACCATGGGCCATCAATGATATTGAAGTTACGAGTACACAGATTATGAAGATCTAAATTTTGACTCCTACATGACTCCAACACAAGAACTAAAGCCTGGAGAACTGCGGTTATTAGAAGTGGACAATCGAGTAGTACTGCCCATAGAAATAACGATCCGTATGCTAATCTCATCAGAAGATGTCTTGCACTCATGA [...]
+		</sequence>
+<sequence taxon="Rhinocerus">
+			
+			ATGGCTTATCCACTTCAACTAGGATTTCAAGATGCAACATCCCCTATTATAGAAGAATTACTCCATTTCCATGACCATACACTGATAATCGTATTTTTAATTAGCTCCCTAGTGCTGTATATTATTTCACTCATGCTAACAACCAAACTAACACACACAAGCACTATAGACGCTCAAGAAGTAGAGACCATCTGAACGATTTTACCAGCTATTATCCTAATTTTAATTGCTCTCCCATCGCTACGAATCCTCTATATAATAGATGAGATTAATAATCCTTCCTTAACCATCAAAACCATAGGCCATCAGTGATACTGAAGCTACGAATATACAGATTATGAAGACCTAACCTTTGACTCCTACATAATTCCCACATCAGATCTAAAACCAGGAGAACTGCGACTTCTAGAAGTCGACAACCGAGTAGTATTACCCATAGAAATAACGATTCGAATGCTAATCTCATCCGAAGACGTTCTCCACTCATGA [...]
+		</sequence>
+<sequence taxon="Propithecus_tattersalli">
+			
+			ATGGCTTATCCAGTTCAATTGGGATTTCAGGATGCTGCTTCCCCCATCATGGAAGAGCTCTTATACTTTCATGATCATACTTTAATAATTGTATTCCTAATTAGTTCTCTAGTTCTCTATATCATCTCTCTAATACTCACCACCAAACTCATACACACCAGCACCATGGACGCACAAGAAGTAGAAACAGTATGAACTATCCTACCTGCAATCATTCTAATTCTTATTGCCCTCCCATCCCTACGTATCCTATACATAATGGATGAAATCACTACTCCTTCATTAACCCTTAAAACCATAGGTCATCAATGGTACTGAAGCTATGAATACACAGATTACGAAGATCTGTCTTTCGACTCATACATAGTTCCATCATCGGACCTCAAGCCCGGAGAACTTCGTCTGCTCGAAGTAGACAACCGAATTGTACTACCCACAGAACTATCAATTCGAATACTTATCTCTTCAGAAGACGTATTACACTCATGA [...]
+		</sequence>
+<sequence taxon="Pongo_pygmaeus">
+			
+			ATGGCGCACGCAGCACAGGTAGGTCTACAAGACGCTACCTCTCCTATCATAGAAGAATTGGTCATCTTTCACGACCACGCCCTCATAATCATCTTCCTAATCTGCTTCCTAGTCCTGTACGCCCTTTTCCTAACACTCACAACGAAACTCACCAACACTAACATCTCAGATGCCCAAGAGATAGAAACTATTTGAACTATCCTACCAGCCATCATCCTAATTCTAATCGCCCTCCCATCTCTACGCATCCTCTACTTAACAGACGAAATCAACGACCCTTCCTTCACCATTAAATCAATCGGCCATCAATGGTACTGAACCTACGAGTATACTGACTATGGCGGATTGATCTTCAACTCTTACATGCTCCCACCACTATTCCTAGAACCAGGCGACCTTCGACTCCTAGACGTCGACAATCGAGTAGTCCTCCCAGTCGAAGCCCCCGTTCGCATAATAATCACATCCCAAGACGTCTTGCACTCATGA [...]
+		</sequence>
+<sequence taxon="Physeter_macrocephalus">
+			
+			ATGGCATACCCCCTTCAACTAGGTTTCCAAGACGCAACCTCTCCCATTATAGAGGAACTCTTACACTTTCATGATCACACCCTAATAATTGTTTTCCTAATTAGCTCTCTAGTCCTCTACATTATCACCCTAATACTAACAACCAAACTAACACATATCAACACAATAGACGCCCAAGAAGTAGAGACCATTTGAACCGTTCTCCCCGCTATCATTCTAATCCTAATCGCCCTACCATCCCTACGAATCCTCTACATAATAGACGAAATCAACAGCCCCTCTCTTACTGTAAAGACAATAGGTCACCAATGATATTGAAGCTACGAATATACCGACTACGAAGACCTGTCCTTTGACTCTTACATAATCCCAACATCGGACTTAAAACCAGGAGACCTACGACTATTAGAAGTCGACAACCGAATAGTATTGCCTATAGAAATAACAATCCGAGTCTTAGTCTCCTCCGAGGATGTCCTACACTCATGA [...]
+		</sequence>
+<sequence taxon="Pan_troglodytes">
+			
+			ATGGCACATGCAGCGCAAGTAGGTCTACAAGATGCTACTTCCCCTATCATAGAAGAACTTATTATCTTTCACGACCATGCCCTCATAATTATCTTTCTCATCTGCTTTCTAGTCCTATACGCCCTTTTCCTAACACTCACAACAAAACTAACTAATACTAGTATTTCAGACGCCCAGGAAATAGAAACCGTCTGAACTATCCTGCCCGCCATCATCCTAGTCCTTATTGCCCTACCATCCCTGCGTATCCTTTACATAACAGACGAGGTCAACGACCCCTCCTTTACTATTAAATCAATCGGCCATCAATGATATTGAACCTACGAATACACCGACTACGGCGGGCTAATCTTCAACTCCTACATACTCCCCCCATTATTTCTAGAACCAGGTGATCTACGACTCCTTGACGTTGATAACCGAGTGGTCCTCCCAGTTGAAGCCCCCGTTCGTATAATAATTACATCACAAGATGTTCTACACTCATGA [...]
+		</sequence>
+<sequence taxon="Mirza_coquereli">
+			
+			ATGGCTTACCCAGCTCAGCTAGGACTCCAAGATGCCGCTTCCCCAATCATGGAAGAGCTTGCATATTTTCACGACCATACCCTAATAATTGTATTTTTAATTAGCTCCATGGTCCTATATATAATCTCTCTAATACTTACTACTGAACTTACCCACACAAGCACTATAGATGCTCAAGAAGTCGAAACAGTATGAACAATCCTACCCGCAGTTATCCTAATTTTTATTGCCCTTCCATCATTACGTATTTTATATATAATAGACGAAATTACAACGCCATCCTTAACTCTAAAAACCATAGGCCATCAATGATATTGAAGTTATGAATACACAGACTACGAAAGCCTATGCTTTGACTCTTATATGACCCCTCCACTAGAACTAGATCCAGGAGAACTTCGCCTACTAGAAGTTGATAATCGAGTAGTACTGCCTACAGAAATATCCATTCGTATACTTGTCTCTTCAGAAGATGTATTACACTCATGA [...]
+		</sequence>
+<sequence taxon="Microcebus_tavaratra_69">
+			
+			ATGGCCCACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGATCACACCCTTATAATTGTATTTTTAATTAGTTCATTAGTCCTATATATCATTTCCCTTATGCTTACCACGGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTTATTGCTCTTCCATCGTTACGCATTTTATATATAATAGATGAAATTACAACCCCTTCTCTAACTCTTAAGACTATAGGTCATCAGTGATATTGAAGCTATGAATATACAGACTATGAAAGCCTATGCTTTGACTCATATATAACCCCTCCATTAGAATTAGATCCAGGAGAACTACGATTACTAGAAGTAGATAATCGAGTAGTATTACCAACAGAAATATCTATTCGTATACTCATCTCCTCAGAAGACGTACTACACTCATGA [...]
+		</sequence>
+<sequence taxon="Microcebus_tavaratra_110">
+			
+			ATGGCCCACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGATCACACCCTTATAATTGTATTTTTAATTAGTTCATTAGTCCTATATATCATTTCCCTTATGCTTACCACGGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTTATTGCTCTTCCATCGTTACGCATTTTATATATAATAGATGAAATTACAACCCCTTCTCTAACTCTTAAGACTATAGGTCATCAGTGATATTGAAGCTATGAATACACAGACTATGAAAGCCTATGCTTTGACTCATACATAACCCCTCCATTAGAATTAGATCCAGGAGAACTACGATTACTAGAAGTAGATAATCGAGTAGTATTACCAACAGAAATATCTATTCGCATACTCATCTCCTCAGAAGACGTACTACACTCATGA [...]
+		</sequence>
+<sequence taxon="Microcebus_sambiranensis_80">
+			
+			ATGGCCTATCCAGCCCAATTAGGTTTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGATCATACCCTTATGATTGTATTTTTAATTAGCTCATTAGTCCTATACATTATTTCCCTTATGCTTACCACGGAACTTACTCATACAAGCACCATAGACGCTCAAGAAGTAGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTTATTGCCCTTCCATCACTACGCATTTTATATATAATGGATGAAATTACAACTCCCTCCCTAACTCTTAAGACTATAGGTCATCAATGATATTGAAGCTATGAATATACCGACTATGAAAGCCTATGCTTTGACTCCTACATAACCCCTCCATTAGAACTCGATCCAGGAGAACTACGATTACTAGAAGTAGATAATCGAGTAGTACTGCCAACAGAAATATCCATTCGTATACTCATCTCTTCAGAAGACGTATTACATTCATGA [...]
+		</sequence>
+<sequence taxon="Microcebus_sambiranensis_72">
+			
+			ATGGCCTATCCAGCCCAATTAGGTTTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGATCATACCCTTATGATTGTATTTTTAATTAGCTCATTAGTCCTATACATTATTTCCCTTATGCTTACCACGGAACTTACTCATACAAGCACCATAGACGCTCAAGAAGTAGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTTATTGCCCTTCCATCACTACGCATTTTATATATAATGGATGAAATTACAACTCCCTCCCTAACTCTTAAGACTATAGGTCATCAATGATATTGAAGCTATGAATATACCGACTATGAAAGCCTATGCTTTGACTCCTACATAACCCCTCCATTAGAACTCGATCCAGGAGAACTACGATTACTAGAAGTAGATAATCGAGTAGTACTGCCAACAGAAATATCCATTCGTATACTCATCTCTTCAGAAGACGTATTACATTCATGA [...]
+		</sequence>
+<sequence taxon="Microcebus_ravelobensis_68">
+			
+			ATGGCCTACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTGTATATTTCCACGACCATACCCTTATAATTGTGTTTTTAATTAGCTCATTGGTCCTATATATTATTTCCCTTATACTTACCACAGAGCTCACTCATACAAGCACTATAGATGCTCAAGAAGTGGAAACTGTATGAACAATTTTGCCGGCAGTTATCTTAATTCTTATTGCCCTTCCATCATTACGCATTTTATATATAATAGATGAAATTACAACCCCGTCCCTTACTCTTAAGACTATAGGTCATCAATGATATTGAAGCTATGAATATACAGACTATGAAAACTTATGCTTTGACTCATACATGACTCCTCCATTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTCGACAATCGAGTAGTATTACCAACAGAAATATCTATCCGCATACTCATCTCTTCAGAAGACGTATTACATTCATGA [...]
+		</sequence>
+<sequence taxon="Microcebus_ravelobensis_66">
+			
+			ATGGCCTGCCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTGTATATTTCCACGACCATACCCTTATAATTGTGTTTTTAATTAGCTCATTGGTCCTATATATTATTTCCCTTATACTCACCACAGAGCTCACTCATACAAGCACTATAGATGCTCAAGAAGTGGAAACTGTATGAACAATTTTGCCAGCAGTTATCTTAATTCTTATTGCCCTTCCATCATTACGCATTTTATATATAATAGATGAAATTACAACCCCGTCCCTTACTCTTAAGACTATAGGTCATCAATGATATTGAAGCTATGAATATACAGACTATGAAAACTTATGCTTTGACTCATACATGACTCCTCCATTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTCGACAATCGAGTAGTATTACCAACAGAAATATCTATCCGCATACTCATCTCTTCAGAAGACGTATTACATTCATGA [...]
+		</sequence>
+<sequence taxon="Microcebus_myoxinus_76">
+			
+			ATGGCCTACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTACATATTTTCATGATCATACCCTTATGATCGTATTCTTAATTAGCTCATTAGTTCTATATATCATTTCCCTCATGCTTACCACGGAACTCACCCATACAAGCACCATAGACGCTCAAGAAGTAGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCTCTTCCATCATTACGCATTTTATATATAATGGATGAAATTACAACTCCCTCCCTGACTCTTAAGACTATAGGTCATCAATGATATTGAAGCTATGAATACACAGACTATGAAAGCTTATGCTTTGACTCATATATAACCCCTCCATTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTGGATAATCGAGTAGTACTACCAACAGAAATATCTATTCGTATACTCATCTCTTCAGAAGACGTACTACACTCATGA [...]
+		</sequence>
+<sequence taxon="Microcebus_myoxinus_185">
+			
+			ATGGCCTACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCATGATCATACCCTTATGATCGTATTCTTAATTAGCTCATTAGTTCTATATATCATTTCCCTCATGCTTACCACGGAACTCACCCATACAAGCACCATAGACGCTCAAGAAGTAGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCTCTTCCATCATTACGCATTTTATATATAATGGATGAAATTACAACTCCCTCCCTGACTCTTAAGACTATAGGTCATCAGTGATATTGAAGCTATGAATATACAGACTATGAAAGCTTATGCTTTGACTCATATATAACCCCTCCATTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTGGATAATCGAGTAGTACTACCAACAGAAATATCTATTCGTATACTCATCTCTTCAGAAGACGTACTACACTCATGA [...]
+		</sequence>
+<sequence taxon="Microcebus_murinus_74">
+			
+			ATGGCCCACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATAATTGTATTTTTAATTAGCTCATTAGTTCTTTATATTATTTCCCTTATACTTACCACGGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTAGAAACAGTATGAACAATTCTACCAGCGGTTATTTTAATTCTTATTGCCCTTCCATCACTACGTATTTTATATATAATAGATGAAATTACAACTCCCACTCTGACCCTTAAGACAATAGGTCATCAATGATATTGAAGTTACGAATATACAGATTATGAAAACCTATGCTTTGACTCATACATAACCCCTCCTTTAGAACTCGATCCAGGAGAACTACGATTACTAGAAGTTGACAATCGAGTAGTATTACCAACAGAAATATCCATTCGCATACTCATCTCTTCAGAAGACGTACTACATTCATGA [...]
+		</sequence>
+<sequence taxon="Microcebus_murinus_199">
+			
+			ATGGCCCACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATAATTGTATTTTTAATTAGCTCATTAGTCCTTTATATTATTTCCCTTATGCTTACCACGGAACTCACTCATACAAGCACCATAGACGCCCAAGAAGTAGAAACAGTATGAACAATTCTACCAGCGGTTATTTTAATTCTTATTGCCCTTCCATCACTACGTATTTTATATATAATAGATGAAATTACAACTCCCACTCTGACCCTTAAAACTATAGGTCATCAATGATATTGAAGCTACGAATATACAGATTATGAAAACCTATGCTTTGACTCATACATAACCCCTCCTTTAGAACTCTATCCAGGAGAACTACGACTACTAGAAGTTGACAATCGAGTAGTACTACCAACAGAAATATCCATTCGCATACTCATCTCTTCAGAAGACGTATTACATTCATGA [...]
+		</sequence>
+<sequence taxon="Microcebus_murinus_153">
+			
+			ATGGCCCACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATAATTGTATTTTTAATTAGCTCATTAGTTCTTTATATTATTTCCCTTATACTTACCACGGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTAGAAACAGTATGAACAATTCTACCAGCGGTTATTTTAATTCTTATTGCCCTTCCATCACTACGTATTTTATATATAATAGATGAAATTACAACTCCCACTCTGACCCTTAAGACAATAGGTCATCAATGATATTGAAGTTACGAATATACAGACTATGAAAACCTATGCTTTGACTCATACATAACCCCTCCTTTAGAACTCGATCCAGGAGAACTACGATTACTAGAAGTTGACAATCGAGTAGTATTACCAACAGAAATATCCATTCGCATACTCATCTCTTCAGAAGACGTACTACATTCATGA [...]
+		</sequence>
+<sequence taxon="Microcebus_murinus_141">
+			
+			ATGGCCCACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATAATTGTATTTTTAATTAGCTCATTAGTCCTTTATATTATTTCCCTTATACTTACCACGGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTAGAAACAGTATGAACAATTCTACCAGCGGTTATTTTAATTCTTATTGCCCTTCCATCACTACGTATTTTATATATAATAGATGAAATTACAACTCCCACTCTGACCCTTAAGACAATAGGTCATCAATGATATTGAAGCTACGAATATACAGATTATGAAAACCTATGCTTTGACTCATATATAACCCCTCCTTTAGAACTCGATCCAGGAGAACTACGATTACTAGAAGTTGACAATCGAGTAGTATTACCAACAGAAATATCCATTCGCATACTCATCTCTTCAGAAGACGTACTACATTCATGA [...]
+		</sequence>
+<sequence taxon="Microcebus_murinus_122">
+			
+			ATGGCCCACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATAATTGTATTTTTAATTAGCTCATTAGTCCTTTATATTATTTCCCTTATGCTTACCACGGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTAGAAACAGTATGAACAATTCTACCAGCGGTTATTTTAATTCTTATTGCCCTTCCATCACTACGTATTTTATATATAATAGATGAAATTACAACTCCCACTCTGACCCTTAAAACTATAGGTCATCAATGATATTGAAGCTACGAATATACAGATTATGAAAACCTATGCTTTGACTCATATATAACCCCTCCTTTAGAACTCGATCCAGGAGAACTACGACTACTAGAAGTTGACAATCGAGTAGTATTACCAACAGAAATATCCATTCGCATACTCATCTCTTCAGAAGACGTACTACATTCATGA [...]
+		</sequence>
+<sequence taxon="Microcebus_griseorufus_355">
+			
+			ATGGCCTACCCAGCCCAATTAGGTTTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATGATTGTATTTTTAATCAGCTCATTGGTCCTTTATATTATTTCCCTTATACTTACCACAGAACTTACTCATACAAGCACTATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCCCTTCCATCATTACGCATTCTATACATAATGGATGAAATCACAACCCCCACCCTTACCCTTAAAACCATAGGTCATCAGTGATATTGAAGTTATGAATATACAGATTATGAAAGCCTATGCTTTGACTCATATATGACCCCTCCTTTAGAACTTGACCCCGGAGAATTACGATTACTAGAAGTCGATAATCGAGTAGTATTACCAACAGAAATATCTATTCGCATGCTAATCTCTTCAGAAGACGTGTTACACTCATGA [...]
+		</sequence>
+<sequence taxon="Microcebus_griseorufus_351">
+			
+			ATGGCCTACCCAGCCCAATTAGGTTTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATGATTGTATTTTTAATCAGCTCATTGGTCCTTTATATTATTTCCCTTATACTTACCACAGAACTTACTCATACAAGCACTATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCCCTTCCATCATTACGCATTCTATACATAATGGATGAAATCACAACCCCCACCCTTACCCTTAAAACCATAGGTCATCAGTGATATTGAAGTTATGAATATACAGATTATGAAAGCCTATGCTTTGACTCATATATGACCCCTCCTTTAGAACTTGACCCCGGAGAATTACGATTACTAGAAGTCGATAATCGAGTAGTATTACCAACAGAAATATCTATTCGCATGCTAATCTCTTCAGAAGACGTGTTACACTCATGA [...]
+		</sequence>
+<sequence taxon="Microcebus_griseorufus_116">
+			
+			ATGGCCTACCCAGCCCAATTAGGTTTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATGATTGTATTTTTAATCAGCTCATTGGTCCTTTATATTATTTCCCTTATACTTACCACAGAACTTACTCATACAAGCACTATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCCCTTCCATCATTACGCATTCTATACATAATGGATGAAATCACAACCCCCACCCTTACCCTTAAAACCATAGGTCATCAGTGATATTGAAGTTATGAATATACAGATTATGAAAGCCTATGCTTTGACTCATATATGACCCCTCCTTTAGAACTTGACCCCGGAGAATTACGATTACTAGAAGTCGATAATCGAGTAGTATTACCAACAGAAATATCTATTCGCATGCTAATCTCTTCAGAAGACGTGTTACACTCATGA [...]
+		</sequence>
+<sequence taxon="Microcebus_griseorufus_101">
+			
+			ATGGCCTACCCAGCCCAATTAGGTTTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATGATTGTATTTTTAATCAGCTCATTGGTCCTTTATATTATTTCCCTTATACTTACCACAGAACTTACTCATACAAGCACTATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCCCTTCCATCATTACGCATTCTATACATAATGGATGAAATCACAACCCCCACCCTTACCCTTAAAACCATAGGTCATCAGTGATATTGAAGTTATGAATATACAGATTATGAAAGCCTATGCTTTGACTCATATATGACCCCTCCTTTAGAACTTGACCCCGGAGAATTACGATTACTAGAAGTCGATAATCGAGTAGTATTACCAACAGAAATATCTATTCGCATGCTAATCTCTTCAGAAGACGTGTTACACTCATGA [...]
+		</sequence>
+<sequence taxon="Microcebus_berthae_159">
+			
+			ATGGCCTACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCATGATCATACCCTTATGATCGTATTTTTAATTAGCTCATTAGTTCTTTATATCATTTCCCTCATGCTTACCACAGAACTCACCCATACAAGCACCATAGACGCTCAAGAAGTGGAA?CAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCTCTTCCATCATTACGCATTTTATATATAATGGATGAAATTACAACTCCCTCCCTAACTCTTAAGACCATAGGTCATCAGTGATATTGAAGCTATGAATATACAGACTATGAAAGCTTATGCTTTGACTCATATATAACTCCTCCACTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTGGATAATCGAGTAGTACTACCAACAGAAATATCTATTCGCATGCTCATCTCTTCAGAAGACGTATTACATTCATGA [...]
+		</sequence>
+<sequence taxon="Microcebus_berthae_148">
+			
+			ATGGCCTACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCATGATCATACCCTTATGATCGTATTTTTAATTAGCTCATTAGTTCTTTATATCATTTCCCTCATGCTTACCACAGAACTCACCCATACAAGCACCATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCTCTTCCATCATTACGCATTTTATATATAATGGATGAAATTACAACTCCCTCCCTAACTCTTAAGACCATAGGTCATCAGTGATATTGAAGCTATGAATATACAGACTATGAAAGCTTATGCTTTGACTCATATATAACTCCTCCACTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTGGATAATCGAGTAGTACTACCAACAGAAATATCTATTCGCATGCTCATCTCTTCAGAAGACGTATTACATTCATGA [...]
+		</sequence>
+<sequence taxon="Microcebus__rufus_2.191">
+			
+			ATGGCCCACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATAATTGTATTCTTAATCAGCTCATTAGTTCTATATATCATTTCCCTTATACTTACTACGGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTGGAAACAGTATGAACAATCTTACCAGCAGTTATTTTAATCCTTATTGCCCTTCCATCATTACGCATTTTATACATAATGGATGAAATTACAACTCCCTCCCTAACTCTTAAGACTATAGGTCATCAATGATATTGAAGCTATGAATATACAGACTATGAAAGCCTATGCTTTGACTCATACATAACCCCTCCATTAGAGCTCGATCCAGGAGAACTACGATTACTAGAAGTGGATAACCGAGTAGTACTACCAACAGAAATATCTATTCGTATACTCATCTCTTCAGAAGACGTACTACATTCATGA [...]
+		</sequence>
+<sequence taxon="Microcebus__rufus_2.190">
+			
+			ATGGCCCACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATAATTGTATTCTTAATCAGCTCATTAGTTCTATATATCATTTCCCTTATACTTACTACGGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTGGAAACAGTATGAACAATCTTACCAGCAGTTATTTTAATCCTTATTGCCCTTCCATCATTACGCATTTTATACATAATGGATGAAATTACAACTCCCTCCCTAACTCTTAAGACTATAGGTCATCAATGATATTGAAGCTATGAATATACAGACTATGAAAGCCTATGCTTTGACTCATACATAACCCCTCCATTAGAGCTCGATCCAGGAGAACTACGATTACTAGAAGTGGATAACCGAGTAGTACTACCAACAGAAATATCTATTCGTATACTCATCTCTTCAGAAGACGTACTACATTCATGA [...]
+		</sequence>
+<sequence taxon="Microcebus__rufus_1.174">
+			
+			ATGGCCTACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCATGATCATACCCTTATGATCGTATTTTTAATTAGCTCATTAGTTCTATATATCATTTCCCTTATGCTTACCACAGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCTCTTCCATCATTACGCATTTTATATATAATGGATGAAATTACAACTCCCTCCCTAACTCTTAAGACTATAGGTCATCAGTGATATTGAAGCTATGAATATACAGATTATGAAAGCCTATGCTTTGACTCATATATAACCCCTCCATTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTGGATAACCGAGTAGTACTACCAACAGAAATATCTATTCGCATACTCATCTCTTCAGAAGACGTATTACATTCATGA [...]
+		</sequence>
+<sequence taxon="Microcebus__rufus_1.171">
+			
+			ATGGCCTACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCATGATCATACCCTTATGATCGTATTTTTAATTAGCTCATTAGTTCTATATATCATTTCCCTTATGCTTACCACAGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCTCTTCCATCATTACGCATTTTATATATAATGGATGAAATTACAACTCCCTCCCTAACTCTTAAGACTATAGGTCATCAGTGATATTGAAGCTATGAATATACAGATTATGAAAGCCTATGCTTTGACTCATATATAACCCCTCCATTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTGGATAACCGAGTAGTACTACCAACAGAAATATCTATTCGCATACTCATCTCTTCAGAAGACGTATTACATTCATGA [...]
+		</sequence>
+<sequence taxon="Microcebus__rufus_1.162">
+			
+			ATGGCCTACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCATGATCATACCCTTATGATCGTATTTTTAATTAGCTCATTAGTTCTATATATCATTTCCCTTATGCTTACCACAGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCTCTTCCATCATTACGCATTTTATATATAATGGATGAAATTACAACTCCTTCCCTAACTCTTAAGACTATAGGTCATCAGTGATATTGAAGCTATGAATATACAGATTATGAAAGCCTATGCTTTGACTCATATATAACCCCTCCATTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTGGATAACCGAGTAGTACTACCAACAGAAATATCTATTCGCATACTCATCTCTTCAGAAGACGTATTACATTCATGA [...]
+		</sequence>
+<sequence taxon="Microcebus__rufus_1.138">
+			
+			ATGGCCTACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCATGATCATACCCTTATGATCGTATTTTTAATTAGCTCATTAGTTCTATATATCATTTCCCTTATGCTTACCACAGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCTCTTCCATCATTACGCATTTTATATATAATGGATGAAATTACAACTCCCTCCCTAACTCTTAAGACTATAGGTCATCAGTGATATTGAAGCTATGAATATACAGATTATGAAAGCCTATGCTTTGACTCATATATAACCCCTCCATTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTGGATAACCGAGTAGTACTACCAACAGAAATATCTATTCGCATACTCATCTCTTCAGAAGACGTATTACATTCATGA [...]
+		</sequence>
+<sequence taxon="Macaca_mulatta">
+			
+			ATGGCCCACCCAGTTCAACTAAGCCTGCAAGACGCCACATCTCCTGTTATAGAGGAGTTGATTACTTTCCATGACCATGCTTTTATAGCCATATCTCTTATCAGCTTCCTAGTATTATATGCCCTGCTCTCAACGCTCACAACAAAACTAACCAACACTAGCATCACAGACGCCCAAGAAATAGAAACTATCTGAACTATCTTACCCGCAATTATCTTAATCCTAATTGCTCTCCCATCTCTACGCATCCTATACCTAACAGATGAAGTCAACGACCCATCCTTCACCATTAAATCAATCGGACACCAGTGATACTGAACCTACGAATACACAGATTACGGGGGCCTAATTTTCAACTCCTACATACTACCCCCACTATTCCTAAACCCAGGAGACCTCCGACTCCTAGAAGTTGACAATCGAGTAGTTCTTCCAATTGAAGCTCCTGTACGTATAATAATTACATCTCAAGACGTCTTACACTCATGA [...]
+		</sequence>
+<sequence taxon="Loris_tardigradus">
+			
+			ATGGCCCATCCAGTACAATTCGGATTTCAAGACGCCGCCTCACCTATTATAGAAGAACTACTATACTTTCATGACCACACTCTCATAATTGTATTTATAATCAGCTCTCTAGTCCTATATATTATCTCCCTTATACTATCAACCGAACTTACCCATACAAGCACTATGGATGCGCAAGAAGTAGAAACAGTATGAACAATCCTGCCTGCCGTCATCCTAATTTTAATTGCCCTGCCATCCCTACGGATCCTATATATAATAGATGAAATTAATACCCCATCCCTTACCCTAAAAACAATAGGTCATCAATGATATTGAAGCTACGAATACACAGATTATGATAAACTATGCTTTGACTCCTATATAGTCCCAACCCCTGACCTAGAACCGGGGGACCTACGTCTACTTGAAGTAGATAACCGAGTTGTACTACCTACAGAAATATCTATTCGAATACTAATCTCCTCCGAAGATGTTCTCCACTCATGA [...]
+		</sequence>
+<sequence taxon="Lepilemur_ruficaudatus">
+			
+			ATGGCCCACCCAGTCCAACTAGGATTTCAAGATGCCGCCTCTCCTATCATAGAAGAACTTCTATATTTCCATGACCACACTCTAATAATTGTTTTCCTCATCAGTTCCTTGGTCCTTTACATTATTTCCCTTATACTCTCTACTAAACTCACCCACACAAGTACAGTGGATGCCCAAGAAGTAGAAACAGTATGAACTATTTTGCCCGCAGTGATCCTAATTCTTATCGCCCTTCCATCTCTACGCATCCTATACATAATAGACGAAATCACTACACCCTCCTTAACCCTTAAAACAATAGGCCATCAATGATACTGAAGCTATGAATACACGGACTATGAAAATCTTTGCTTTGACTCATATATAATTCCTCTGTCAGATCTTAAACCCGGTGATCTTCGCCTACTCGAGGTTGATAACCGAGTTGCCTTACCCACAGAAATATCAATCCGAATGTTAGTATCCTCAGAAGACGTACTTCACTCATGG [...]
+		</sequence>
+<sequence taxon="Lemur_catta">
+			
+			ATGGCCTATCCAGTTCAATTAGGATTTCAAGATGCTGCTTCTCCCATTATAGAAGAACTTTTATACTTTCACGACCACACTTTAATAATTATATTCCTGATTAGTTCTCTAGTCCTTTACATTATCTCCCTTATACTCACTACTGAACTTATACATACAAACACCATAGACGCCCAAGAAGTAGAAACAGTATGAACAATCCTACCTGCAGCAATCCTCATTCTTATTGCTCTTCCATCATTACGCATTCTGTATATAATAGACGAAATTGCTACACCCTCCTTAACCCTTAAAACCATAGGTCACCAATGATACTGAAGCTACGAATACACAGATTATGAAGACTTATGTTTTGACTCGTACATAACTCCTTCCTCAGACCTTAAACCTGGAGAACTTCGCCTACTTGAAGTCGACAATCGAGTCGTACTTCCCACAGAACTAGCAGTTCGAATATTAATCTCTTCAGAAGATGTACTACACTCATGA [...]
+		</sequence>
+<sequence taxon="Homo_sapiens">
+			
+			ATGGCACATGCAGCGCAAGTAGGTCTACAAGACGCTACTTCCCCTATCATAGAAGAGCTTATCACCTTTCATGATCACGCCCTCATAATCATTTTCCTTATCTGCTTCCTAGTCCTGTATGCCCTTTTCCTAACACTCACAACAAAACTAACTAATACTAACATCTCAGACGCTCAGGAAATAGAAACCGTCTGAACTATCCTGCCCGCCATCATCCTAGTCCTCATCGCCCTCCCATCCCTACGCATCCTTTACATAACAGACGAGGTCAACGATCCCTCCCTTACCATCAAATCAATTGGCCACCAATGGTACTGAACCTACGAGTACACCGACTACGGCGGACTAATCTTCAACTCCTACATACTTCCCCCATTATTCCTAGAACCAGGCGACCTGCGACTCCTTGACGTTGACAATCGAGTAGTACTCCCGATTGAAGCCCCCATTCGTATAATAATTACATCACAAGACGTCTTGCACTCATGA [...]
+		</sequence>
+<sequence taxon="Hippopotamus_amphibius">
+			
+			ATGGCATATCCCCTCCAACTAGGCTTTCAAGATGCAGTATCACCCATTATAGAAGAACTACTGTATTTTCATGACCATACGCTAATAATCGTATTCCTAATCAGCTCACTAGTCCTTTACATTATTACACTAATACTGACTACCAAACTAACCCATACAAACACCATAAATGCACAAGAGGTAGAAACTGTCTGAACAATCCTACCAGCCATTATCCTTATCTTAATTGCACTGCCATCTCTGCGAATCCTCTATATAATAGACGAAATTAACAACCCCTCCCTGACCGTAAAAACTATGGGCCACCAATGATACTGAAGTTACGAATATACAGATTATGAAGACCTAAACTTTGACTCCTACATAGTCCCAACATCAGACCTAAAGCCGGGGGACCTACGACTCCTAGAAGTAGATAACCGAGTCGTCCTACCCATAGATGTAACAGTTCGAATACTAATCTCATCAGAAGACGTACTACACTCCTGA [...]
+		</sequence>
+<sequence taxon="Hapalemur_griseus">
+			
+			ATGGCTTATCCAGTCCAACTAGGATTTCAAGATGCTGCTTCCCCTATTATAGAAGAACTTTTATACTTTCATGATCATACTTTAATAATTATATTCCTGATTAGTTCTCTAGTCCTTTACATTATTTCCCTCATACTTACTACTGAATTAATACATACAAATACCATAGACGCCCAAGAAGTAGAAACAGTATGAACAATCCTACCCGCAGCAATTCTCATTCTCATTGCCCTCCCATCATTACGTATCCTATATATAATAGACGAAATTACTACACCCTCATTAACCCTTAAAACTATAGGCCACCAGTGATACTGAAGCTACGAATACACAGACTATGAAAATTTATGCTTTGACTCATACATAGTTCCTTCCTCAGACCTAAAGCCTGGAGAACTTCGCCTACTTGAAGTTGATAATCGAATTGTACTTCCTACAGAATTATCAATTCGAATACTAATCTCTTCAGAAGATGTACTACACTCATGA [...]
+		</sequence>
+<sequence taxon="Gorilla_gorilla">
+			
+			ATGGCACATGCAGCGCAAGTAGGTCTACAAGACGCTACTTCTCCTATCATAGAAGAACTAATCATCTTTCATGATCATGCCCTCATAATCATTTTTCTCATCTGCTTCTTAGTCCTGTACGCCCTTTTCCTAACACTCACAACAAAGCTAACTAACAACAACATCTCAGACGCCCAAGAAATAGAGACCATCTGAACCATCCTGCCCGCTATTATCTTAGTCCTGATCGCCCTCCCATCTCTACGAATCCTCTATATGACAGATGAAATCAATGACCCCTCCTTCACTATCAAATCAATCGGTCACCAATGATACTGAACCTACGAATACACCGACTATGGTGGATTGATCTTTAACTCCTATATACTCCCCCCATTATTCCTAGAACCAGGTGACCTACGACTCCTTGACGTCGACAACCGAGTAGTCCTTCCAGTTGAAGCCCCCGTCCGTATAATAATTACATCCCAAGATGTCTTACACTCATGA [...]
+		</sequence>
+<sequence taxon="Galago_demidoff">
+			
+			ATGGCCCACGCTGTACAATTCGGATTTCAAGACGCTGCCTCCCCTATTATAGAAGAATTATTATACTTCCATGACCACACCCTTATAATCGTATTTACAATTAGCTCCCTGGTCCTTTATATTATCTCCCTTATGTTATCGACTGAACTTACTCATACAAACACAATAGACGCCCAAGAAGTAGAGACAGTATGAACTATCCTGCCAGCTGTAATCCTCATCCTTATTGCCCTCCCATCCCTCCGAATCCTTTACATAATAGACGAAATCAACACCCCATCCTTAACCCTAAAAACAATAGGCCATCAATGATATTGAAGCTATGAGTACACAGATTATGACAACCTGTGCTTTGACTCCTACATAACCCCTACCCCTGACTTAGAACCAGGAGACCTTCGACTGTTAGAAGTGGACAACCGAGTCGTCCTACCCACAGAAATATCTATCCGAATACTAATCTCCTCTGAAGACGTACTCCACTCATGA [...]
+		</sequence>
+<sequence taxon="Felis_catus">
+			
+			ATGGCGTACCCCTTTCAACTAGGTTTCCAAGATGCTACATCCCCCATTATAGAAGAACTCCTACACTTTCACGACCACACACTAATAATTGTATTTTTAATCAGCTCTTTAGTTCTTTATATTATCTCGTTGATGCTAACAACCAAGCTCACGCACACGAGTACAATAGATGCTCAAGAAGTAGAAACCATCTGAACCATCCTACCTGCTATTATCCTGATTCTTATCGCCCTACCCTCCTTACGAATTCTCTATATAATGGATGAAATCAACAACCCCTCCCTCACAGTAAAAACCATAGGACATCAATGATATTGAAGTTATGAGTACACTGATTACGAAGACTTGAATTTTGACTCTTACATAATTCCTACCCAAGAGCTAAAACCAGGAGAACTCCGGCTATTAGAAGTTGACAACCGAGTAGTTTTACCAATAGAAATGACCATTCGCATGTTAATCTCATCAGAAGATGTGTTACACTCATGA [...]
+		</sequence>
+<sequence taxon="Eulemur_rubriventer">
+			
+			ATGGCTTATCCAGTTCAACTAGGGTTTCAAGATGCTGCTTCCCCCATTATAGAAGAACTCTTATATTTTCACGACCACACTCTGATAATTATATTCCTAATCAGTTCCCTAGTCCTCTATATTATTTCCCTCATGCTTACTACTGAGCTTATCCATACAAGTACTATAGATGCTCAAGAAGTAGAAACAGTATGAACTATTCTGCCCGCAGTAATCCTCATCCTTATCGCCCTTCCATCATTACGCATCCTATATATAATAGATGAAATCACCACACCCTCCTTAACTCTTAAAACTATGGGCCACCAATGATACTGAAGCTATGAGTATACGGACTATGAAAATCTGTGCTTTGATTCATACATGACTCCTCCCTCAGACCTAAAACCGGGGGAACTTCGTCTACTTGAAGTTGATAATCGAGTTGTACTTCCAACAGAATTACCAATCCGAATACTTATTTCCTCAGAAGATGTTTTACACTCATGA [...]
+		</sequence>
+<sequence taxon="Eulemur_mongoz">
+			
+			ATGGCTTATCCAGTTCAACTAGGGTTCCAAGATGCTGCTTCCCCTATTATAGAAGAACTTTTATACTTCCATGACCACACCTTAATAATTATATTCCTAATTAGTTCTCTAGTCCTCTACATTATTTCCCTTATACTCACTACTGAGCTTATCCATACAAGTACTATAGACGCCCAAGAAGTAGAAACAGTATGAACTATTCTGCCCGCAGTAATTCTTATCCTTATTGCCCTCCCATCATTACGCATCCTATATATAATAGATGAAATCACCACACCCTCCTTAACTCTTAAAACTATGGGCCACCAATGATACTGAAGCTATGAGTACACGGACTATGAGAATCTGTGCTTTGACTCATACATAACTCCTCCTTCAGACCTAAAACCGGGAGAACTTCGTTTACTCGAAGTTGATAATCGAGTTGTGCTTCCAACAGAGCTACCAATCCGAATACTAATTTCCTCAGAAGATGTTTTACATTCATGA [...]
+		</sequence>
+<sequence taxon="Eulemur_macaco_macaco">
+			
+			ATGGCTTATCCAGTTCAACTAGGATTTCAAGATGCTGCTTCCCCCATTATAGAAGAACTTTTATATTTTCATGACCACACTCTAATAATTATATTCCTAATTAGTTCTTTAGTCCTCTATATTATTTCCCTCATACTTACTACTGAGCTCATCCATACAAGTACCATAGATGCCCAAGAAGTAGAAACAGTATGAACTATTCTGCCCGCAGTAATTCTTATCCTTATTGCCCTTCCATCACTACGCATCCTATATATAATAGATGAAATTTCCACACCCTCCTTAACTCTTAAAACTATAGGCCACCAGTGATACTGAAGCTATGAATATACGGACTATGAGAATCTGTGCTTTGACTCATATATGACTCCACCCTCAGACCTAAAACCGGGAGAACTTCGCCTACTTGAAGTCGATAATCGAGTTGTGCTTCCAACAGAGTTACCAATCCGAATACTAATTTCCTCAGAAGATGTCTTACACTCATGA [...]
+		</sequence>
+<sequence taxon="Eulemur_macaco_flavifrons">
+			
+			ATGGCTTATCCAGTTCAACTAGGATTTCAAGATGCTGCTTCCCCCATTATAGAAGAACTTTTATATTTTCATGACCACACTCTAATAATTATATTCCTAATTAGCTCTTTAGTCCTCTATATTATTTCCCTCATACTTACTACTGAGCTCATCCATACAAGTACCATAGATGCCCAAGAAGTAGAAACAGTATGAACTATTCTGCCCGCAGTAATTCTCATCCTTATTGCCCTCCCATCACTACGCATCCTATATATAATAGATGAAATTTCCACACCCTCCTTAACTCTTAAAACTATGGGCCACCAATGATACTGAAGCTATGAATATACGGATTATGAGAATCTGTGCTTTGACTCATATATGACTCCACCCTCAGACCTAAAACCAGGGGAACTTCGTCTACTCGAAGTCGATAATCGAGTTGTGCTTCCAACAGAATTGCCAATCCGAATACTAATTTCATCAGAAGATGTTTTACACTCATGA [...]
+		</sequence>
+<sequence taxon="Eulemur_fulvus_rufus">
+			
+			ATGGCTTATCCAGTTCAACTAGGGTTCCAAGACGCTGCTTCCCCCATTATAGAAGAACTTTTATACTTTCACGACCACACTCTAATAATTATATTCCTAATCAGTTCTCTAGTCCTCTATATTATTTCCCTTATACTTACTACTGAGCTCATTCATACAAGCACCATAGATGCCCAAGAAGTAGAAACAGTATGAACTATTCTGCCCGCAGTGATTCTCATCCTCATTGCCCTTCCATCATTACGCATCCTATACATAATAGATGAGATTACCACACCTTCCTTAACTCTTAAAACTATGGGCCACCAATGATACTGAAGCTATGAATATACGGATTATGAAAATCTGTGCTTTGACTCATACATAACTCCTCCCTCAGACCTAAAACCGGGAGAACTTCGTCTACTTGAAGTTGATAATCGAGTTGTACTTCCAACAGAATTACCAATCCGAATACTAATCTCCTCAGAAGATGTTCTACACTCATGA [...]
+		</sequence>
+<sequence taxon="Eulemur_fulvus_collaris">
+			
+			ATGGCTTATCCAGTTCAACTAGGGTTCCAAGATGCTGCTTCCCCTATTATAGAAGAACTTTTATACTTTCACGACCACACTCTAATAATTATGTTCCTAATCAGCTCTCTAGTCCTCTATATTATTTCCCTTATACTTACTACTGAACTCATTCATACAAGTACTATAGATGCCCAAGAAGTAGAAACAGTATGAACTATTCTGCCCGCAGTGATCCTAATCCTTATTGCCCTTCCATCATTACGCATCCTATACATAATAGATGAAATCACCACACCTTCCTTAACTCTTAAAACTATGGGCCACCAATGATACTGAAGCTATGAATATACGGATTATGAAAATCTGTGCTTTGACTCATACATGACTCCTCCCTCAGACCTAAAACCGGGAGAACTTCGTCTACTTGAAGTTGATAACCGAGTTGTGCTTCCAACAGAATTACCAATCCGAATACTAATTTCCTCAGAAGATGTTTTACACTCATGA [...]
+		</sequence>
+<sequence taxon="Eulemur_fulvus_albifrons">
+			
+			ATGGCTTATCCAGTTCAACTAGGGTTCCAAGATGCTGCTTCCCCCATCATAGAAGAACTTCTATACTTTCACGACCACACTCTAATAATTATATTCCTAATCAGTTCTCTAGTCCTCTATATTATTTCCCTTATACTTACTACTGAGCTCATTCATACAAGTACCATAGATGCCCAAGAAGTAGAAACAGTATGAACTATTCTGCCCGCAGTGATTCTCATCCTTATTGCCCTTCCATCATTACGCATCCTATACATAATAGATGAGATCACCACACCTTCCTTAACTCTTAAAACTATGGGCCACCAATGATACTGAAGCTATGAGTATACGGATTATGAAAATCTGTGCTTTGACTCATACATAACTCCTCCCTCAGACCTAAAACCGGGAGAACTTCGTCTACTTGAAGTTGATAACCGAGTTGTACTTCCAACAGAATTACCAATCCGAATACTAATTTCCTCAGAAGATGTTCTACACTCATGA [...]
+		</sequence>
+<sequence taxon="Equus_caballus">
+			
+			ATGGCCTACCCCTTCCAACTAGGATTCCAAGACGCAACATCCCCTATTATAGAAGAACTCCTACACTTCCACGACCACACACTAATAATCGTATTCCTAATTAGCTCTCTAGTATTATATATTATCTCATCAATACTAACAACTAAATTAACCCATACCAGCACCATAGATGCTCAAGAAGTAGAGACAATTTGAACGATTTTACCAGCCATCATCCTTATTCTAATCGCCCTCCCATCCCTACGAATTCTATATATAATAGATGAAATCAATAATCCGTCCCTCACAGTCAAAACAATAGGCCACCAATGATACTGAAGCTACGAGTATACCGATTACGAAGACTTGACCTTTGACTCCTACATGATCCCCACATCAGACCTAAAACCAGGAGAATTACGTCTTCTAGAAGTCGACAATCGAGTGGTTCTCCCCATAGAAATAACCATCCGAATGCTAATTTCATCCGAAGACGTCCTACACTCATGA [...]
+		</sequence>
+<sequence taxon="Didelphis_virginiana">
+			
+			ATGCCCTATCCAATACAACTAGGTTTCCAAGACGCTACATCTCCTATTATAGAAGAACTTATATACTTTCATGATCATACATTAATAATTGTATTTCTGATCAGTTCACTAGTATTATATATTATTATTCTTATACTTACTACAAAACTTACTCACACAAGCACTATAGATGCCCAAGAAGTGGAAACAATTTGAACAATTTTACCAGCCGTAATTCTTATCCTTATTGCCCTTCCTTCCTTACGAATTCTTTACATAATAGATGAAATCTATAATCCTTATCTAACAGTTAAAGCAATGGGTCATCAATGATATTGAAGCTATGAGTTCACAGACTATGAAAATTTAATATTCGACTCATACATAATCCCAACCAAAGACCTTAGTCCTGGGCAACTTCGTTTACTAGAAGTTGATAACCGAATTGTTCTCCCAATAGAACTACCAATTCGCATGCTAATTTCATCAGAAGACGTTCTCCATGCATGA [...]
+		</sequence>
+<sequence taxon="Daubentonia">
+			
+			ATGGCTTACCCCGCCCAAATAGGATTCCAAGACGCCACCTCCCCTATCATAGAAGAACTTCTATATTTCCATGACCATACCTTAATAATTGTCTTTATAATTAGCTCATTAGTCCTCTATACTATCTCCCTTATACTCACAACCAGCCTTACCCATACAAACACCATAAACGCCCAAGAAGTGGAAACAGTGTGAACAATCCTCCCTGCAATTATCTGCATCCTTATTGCCCTACCATCCTTACGTATTCTCTACATAATAGATGAAATTAACAACCCTTCCCTAACCATTAAAACTATGGGCCACCAATGATACTGAACCTATGAGTATACAGATTATGAAAACATAACCTTTGATTCATACATAACCTCAACCAACGATCTCACCCCCGGAGAACTTCGACTTCTGGAAGTCGATAATCGAATAGTCCTACCTACGGAATTACCTATTCGAGTGTTAGTCTCCTCAGAAGATGTACTACACTCATGG [...]
+		</sequence>
+<sequence taxon="Cheirogaleus_major">
+			
+			ATGGCATGTCCAGTTCAACTAGGATTTCAAGACGCTGCCTCTCCTATTATAGAGGAACTTATATATTTCCATGACCATACTTTAATAATCGTCTTCCTAATTAGCTCCCTAGTCCTCTATATCATTTCCCTAATACTCACCACAGAACTTACCCACACAAACACAATAGATGCCCAAGAAGTAGAAACAGTATGAACCATCCTACCTGCAGTTATCTTAATCCTTATTGCTCTTCCATCACTACGAATTCTATATATAATAGATGAAATTACCACCCCATCTCTAACCCTAAAAACTATAGGCCATCAATGGTACTGAAGTTATGAATATACAGACTACGAAAACTTATGTTTTGATTCATATATAACGCCATCATCAGATCTCAAGCCAGGAGAACTTCGCCTACTAGAAGTTGATAACCGAGTTGTCCTACCCACAGAAATATCCATTCGTATACTCATCTCCTCAGAAGATGTACTACACTCATGA [...]
+		</sequence>
+<sequence taxon="Canis_familiaris">
+			
+			ATGGCGTACCCATTTCAACTCGGATTACAGGACGCAACCTCCCCTATTATAGAGGAGCTACTTCATTTTCATGACCATACACTAATAATTGTATTCTTAATCAGTTCTTTAGTTCTCTATATCATTTCACTAATATTGACTACAAAATTAACCCATACAAGCACAATAGACGCACAAGAAGTGGAAACAGTATGAACCATTCTACCCGCCATTATCCTAATCCTAATCGCTCTACCTTCCCTCCGAATCCTTTATATAATGGACGAAATTAATAACCCCTCTTTAACCGTGAAAACAATAGGCCACCAATGATACTGAAGCTATGAATATACTGACTATGAAGACTTAAACTTTGACTCCTACATAATCCCAACACAAGAATTAAAGCCAGGAGAACTCCGACTATTAGAAGTAGACAACCGAGTTGTCCTCCCAATAGAAATAACCATCCGAATACTTATCTCTTCAGAAGACGTTTTGCATTCATGA [...]
+		</sequence>
+<sequence taxon="Callithrix_jacchus">
+			
+			ATGGCAGCACCAGCCCAATTAGGCCTACAAAACGCCGCATCCCCAATCATAGAAGAACTTATTGCCTTCCATGACCATGCTCTAATAATTATCTTCTTAATTAGCTCACTAGTTCTATACATCATCTCTCTAATACTTACTACAAAACTGACACACACCAGTACCATGAACGCTCAAGAAATCGAAATGATCTGAACTATCCTACCTGCAATAATCCTCATTATAATTGCCCTTCCATCCCTACGCATTTTATATATAACAGACGAGTTTAATAAACCATATCTAACCCTTAAAGCAATCGGCCACCAATGATACTGAAGTTACGAATACTCCGACTATGAAGACTTAGCATTCGACTCCTACATTATACCAACATACTTCCTTGAACCCGGGGAATTCCGACTCCTTGAAGTAGACAACCGAACAACCTTGCCTATGGAAGCAGATATCCGTGTATTAATCTCATCACAAGACGTTTTACACTCATGA [...]
+		</sequence>
+<sequence taxon="Bos_taurus">
+			
+			ATGGCATATCCCATACAACTAGGATTCCAAGATGCAACATCACCAATCATAGAAGAACTACTTCACTTTCATGACCACACGCTAATAATTGTCTTCTTAATTAGCTCATTAGTACTTTACATTATTTCACTAATACTAACGACAAAGCTGACCCATACAAGCACGATAGATGCACAAGAAGTAGAGACAATCTGAACCATTCTGCCCGCCATCATCTTAATTCTAATTGCTCTTCCTTCTTTACGAATTCTATACATAATAGATGAAATCAATAACCCATCTCTTACAGTAAAAACCATAGGACATCAGTGATACTGAAGCTATGAGTATACAGATTATGAGGACTTAAGCTTCGACTCCTACATAATTCCAACATCAGAATTAAAGCCAGGGGAGCTACGACTATTAGAAGTCGATAATCGAGTTGTACTACCAATAGAAATAACAATCCGAATGTTAGTCTCCTCTGAAGACGTATTACACTCATGA [...]
+		</sequence>
+<sequence taxon="Balaenoptera_physalus">
+			
+			ATGGCATATCCATTCCAACTAGGTTTCCAAGATGCAGCATCACCCATCATAGAAGAGCTCCTACACTTTCACGATCATACACTAATAATCGTTTTTCTAATTAGCTCTTTAGTTCTCTACATTATTACCCTAATGCTTACAACCAAATTAACACATACTAGTACAATAGACGCCCAAGAAGTAGAAACTGTCTGAACTATCCTCCCAGCCATTATCTTAATTTTAATTGCCTTGCCTTCATTACGGATCCTTTACATAATAGACGAAGTCAATAACCCCTCCCTCACTGTAAAAACAATAGGTCACCAATGATATTGAAGCTATGAGTATACCGACTACGAAGACCTAAGCTTCGACTCCTATATAATCCCAACATCAGACCTAAAGCCAGGAGAACTACGATTATTAGAAGTAGATAACCGAGTTGTCTTACCTATAGAAATAACAATCCGAATATTAGTCTCATCAGAAGACGTACTCCACTCATGG [...]
+		</sequence>
+</data>
+    <!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+    <input spec='HKY' id='hky'>
+        <kappa idref='hky.kappa'/>
+        <frequencies id='freqs' spec='Frequencies'>
+            <data idref='alignment'/>
+        </frequencies>
+    </input>
+
+    <!-- site model                                                              -->
+    <input spec='SiteModel' id="siteModel" gammaCategoryCount='1'>
+        <!--
+            <parameter name='shape' id='shape' value='0.5'/>
+            <parameter name='proportionInvariant' id='propInvar' value='0.2'/>
+        -->
+        <substModel idref='hky'/>
+    </input>
+
+    <input spec='TreeLikelihood' id="treeLikelihood">
+        <data idref="alignment"/>
+        <tree idref="tree"/>
+        <siteModel idref="siteModel"/>
+    </input>
+
+    <parameter id="hky.kappa" value="1.0" lower="0.0"/>
+
+    <tree id='tree'/>
+
+    <tree spec='beast.util.ClusterTree' id='upgmatree' clusterType='upgma' initial='@tree'>
+        <taxa idref='alignment'/>
+    </tree>
+    <tree spec='beast.evolution.tree.RandomTree' id='coalescentSimulator' initial='@tree' taxa='@alignment'>
+        <populationModel spec='ConstantPopulation'>
+            <popSize spec='parameter.RealParameter' value='1'/>
+        </populationModel>
+    </tree>
+
+
+    <run spec="MCMC" id="mcmc" chainLength="5000000" preBurnin="0">
+
+        <init idref='coalescentSimulator'/>
+        <distribution spec='CompoundDistribution' id='posterior'>
+<!--
+	make it comparable to the files in the BEAST 1 directory, that do not use a prior either
+            <distribution spec='beast.math.distributions.Prior' x='@hky.kappa'>
+                <distr spec='beast.math.distributions.OneOnX'/>
+            </distribution>
+-->
+            <distribution id='likelihood' idref="treeLikelihood"/>
+        </distribution>
+
+        <operator id='kappaScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" parameter="@hky.kappa"/>
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" tree="@tree"/>
+
+        <operator spec='SubtreeSlide' weight="5" gaussian="true" size="1.0" tree="@tree"/>
+
+        <operator spec='Uniform' weight="10" tree="@tree"/>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="1" tree="@tree"/>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="1" tree="@tree"/>
+        <operator spec='WilsonBalding' weight="1" tree="@tree"/>
+
+        <logger logEvery="10000" fileName="test.log">
+            <model idref='likelihood'/>
+            <log idref="likelihood"/>
+            <log idref='hky.kappa'/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+        </logger>
+        <logger logEvery="10000" fileName="test.trees">
+            <log idref="tree"/>
+        </logger>
+        <logger logEvery="10000">
+            <model idref='likelihood'/>
+            <log idref="likelihood"/>
+            <ESS spec='ESS' name='log' arg="@likelihood"/>
+            <log idref='hky.kappa'/>
+            <ESS spec='ESS' name='log' arg="@hky.kappa"/>
+        </logger>
+    </run>
+</beast>
+
diff --git a/examples/benchmark/II/testHKY336.xml b/examples/benchmark/II/testHKY336.xml
new file mode 100644
index 0000000..a1d66c4
--- /dev/null
+++ b/examples/benchmark/II/testHKY336.xml
@@ -0,0 +1,191 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beast xmlns="http://www.w3.org/TR/xhtml1/strict" version="2.0" namespace="beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood">
+<data dataType="nucleotide" id="alignment">
+<sequence taxon="Oryctolagus_cuniculus">
+			
+			UACCUGGUUGAUCCUGCCAGUAGCAUAUGCUUGUCUCAAAGAUUAAGCCAUGCAUGUCUAAGUACGCACGGCCGGUACAGUGAAACUGCGAAUGGCUCAUUAAAUCAGUUAUGGUUCCUUUGGUCGCUCGCUCCUCUCCUACUUGGAUAACUGUGGUAAUUCUAGAGCUAAUACAUGCCGACGG?CGCUGACUCCC?UUUGUG????UGGGAUGCGUGCAUUUAUCAGAUCAAAACCAACCCGGUCAGCCUCCCCGCCGGCCGGGGGGGUGGGGCGGCG?????????????????????????????????????????????????????????????????????GCUUUGGUGACUCUAGAUAACCUCGGGCCGAUCGCA?GCCCUCCGUGGCGGCGACGACCCAUUCGAACGUCUGCCCUAUCAACUUUCGAUGGUAGUCGCCGUGCCUACCAUGGUGACCACGGGUGACGGGGAAUCAGGGUU [...]
+		</sequence>
+<sequence taxon="Homo_sapiens">
+			
+			UACCUGGUUGAUCCUGCCAGUAGCAUAUGCUUGUCUCAAAGAUUAAGCCAUGCAUGUCUAAGUACGCACGGCCGGUACAGUGAAACUGCGAAUGGCUCAUUAAAUCAGUUAUGGUUCCUUUGGUCGCUCGCUCCUCUCCUACUUGGAUAACUGUGGUAAUUCUAGAGCUAAUACAUGCCGACGGGCGCUGACCCCC?UUCGCGGG??GGGGAUGCGUGCAUUUAUCAGAUCAAAACCAACCCGGUCAGCCCCUCUCCGGCCCCGGCCGGGGGGCGGGCCGCGGCG???????????????????????????????????????????????????????????????GCUUUGGUGACUCUAGAUAACCUCGGGCCGAUCGCACGCCCCCCGUGGCGGCGACGACCCAUUCGAACGUCUGCCCUAUCAACUUUCGAUGGUAGUCGCCGUGCCUACCAUGGUGACCACGGGUGACGGGGAAUCAGGGUU [...]
+		</sequence>
+<sequence taxon="Rattus_norvegicus">
+			
+			UACCUGGUUGAUCCUGCCAGUAGCAUAUGCUUGUCUCAAAGAUUAAGCCAUGCAUGUCUAAGUACGCACGGCCGGUACAGUGAAACUGCGAAUGGCUCAUUAAAUCAGUUAUGGUUCCUUUGGUCGCUCGCUCCUCUCCUACUUGGAUAACUGUGGUAAUUCUAGAGCUAAUACAUGCCGACGGGCGCUGACCCCCCUUCCCGUGGGGGGAACGCGUGCAUUUAUCAGAUCAAAACCAACCCGGUCAGCCCCCUCCCGGCUCCGGCCGGGGGUCGGGCGCCCGGCG??????????????????????????????????????????????????????????????GCUUUGGUGACUCUAGAUAACCUCGGGCCGAUCGCACGU?CCCCGUGGCGGCGACGACCCAUUCGAACGUCUGCCCUAUCAACUUUCGAUGGUAGUCGCCGUGCCUACCAUGGUGACCACGGGUGACGGGGAAUCAGGGUU [...]
+		</sequence>
+<sequence taxon="Mus_musculus">
+			
+			UACCUGGUUGAUCCUGCCAGUAGCAUAUGCUUGUCUCAAAGAUUAAGCCAUGCAUGUCUAAGUACGCACGGCCGGUACAGUGAAACUGCGAAUGGCUCAUUAAAUCAGUUAUGGUUCCUUUGGUCGCUCGCUCCUCUCCUACUUGGAUAACUGUGGUAAUUCUAGAGCUAAUACAUGCCGACGGGCGCUGACCCCCCUUCCCGGGG?GGGGAUGCGUGCAUUUAUCAGAUCAAAACCAACCCGGUGAGCUCCCUCCCGGCUCCGGCCGGGGGUCGGGCGCCGGCG???????????????????????????????????????????????????????????????GCUU?GGUGACUCUAGAUAACCUCGGGCCGAUCGCACGCCCCCCGUGGCGGCGACGACCCAUUCGAACGUCUGCCCUAUCAACUUUCGAUGGUAGUCGCCGUGCCUACCAUGGUGACCACGGGUGACGGGGAAUCAGGGUU [...]
+		</sequence>
+<sequence taxon="Gallus_gallus">
+			
+			??CC?GGUUGAUCCUGCCAGUAGCA???GCU?GUCUCAAAGAUUAAGCCAUGCAUGUCUAAGUACACACGGGCGGUACAGUGAAACUGCGAAUGGC?????AAAUCAGUUAUGG?????????UCGCUCCCCUCCC????ACUUGGAUAACUGU?G????UCU?GAGCUAAU?CAUGCCGACGAGCGCCGACCUCC???????????GGG?ACG?G??CAUUUAUCAGACCAAAACCAACGG?C?CGCCC??????????????????????????????????????????????????????????????????????????????????????????????????G???UGG??ACUCUAGAUAACCUCGAGCCGAUCGCA?GC?CCC??UGGCGGCGACGACCCAUU??AAUGUC??CCCUAUCAACUU?CGAUGGUACUGUCUGUGCCUACCAUGGUG???ACGGGUAACGGG?AAUCAGGGUU [...]
+		</sequence>
+<sequence taxon="Turdus_migratorius">
+			
+			??CCUGGUUGAUCCUGCCAGUAGCAU??GCUUGUCUCAAAGAUUAAGCCAUGCAUGUCUAAGUACACACGGGCGGUACAGUGAAACUGCGAAUGGC????UAAAUCAGUUAUGGU??CUU??GUCGCUCCUCUCCCGC?UCCUUGGAUAACUGUGGU???UCUAGAGCUAAU?CAUGCCGACGAGCGCCGACCUCC???????????GGGGACGCGUGCAUUUAUCAGACCAAAACCAACGG????GCCC???A??????????????????????????????????????????????????????????????????????????????????????????????GCU?UGGUGACUCUAGAUAACCUCGAGCCGAUCGCA?GC?CCCCGCGGCGGCGACGACCCAUUCGAAUG????CCCUAUCAACUU?CGAUGGUACUGUCUGUGCCUACCAUGGUGACCACGGGUGACGGG?AAUCAGG??U [...]
+		</sequence>
+<sequence taxon="Alligator_mississippiensis">
+			
+			??CCUGGUUGAUCCUGCCAGUAGCAUA?GCUUGUCUCAAAGAUUAAGCCAUGCAUGUCUAAGUACACACGGCCGGUACAGUGAAACUGCGAAUGGCUCAUUAAAUCAGUUAUGGUUCCUU??GUCGCUCCAACCGU???UACUUGGAUAACUGUGGU??UUCUA?AGCUAAUACAUGCCGACGAGCGCUGACCU?C???????????GGGGAU?CGUG?AUUUAUCAGACCAAAACCAACGGGCUCGCCCGGCC??????????????????????????????????????????????????????????????????????????????????????????????GCU?UGGUGACUCUAGAUAACC?CGGGCCGAUCGCA?GC?CC?CGUGGCGGCGACGACGCAUUCGAAUGUCU?CCCUAUCAACUUUC?AUGGUACUUUCUGUGCCUACCAUGGUGACC?CGGGUA?CGGGGA?UCA?GGUU [...]
+		</sequence>
+<sequence taxon="Sceloporus_undulatus">
+			
+			????????????????????????????GC??GUCUCAAAGAUUAAGCCAUGCAUGUCUAAGUACACACGGGCGUUA?AGUGAAACUGCGAAUGGCU???UAAAUCAGUUAUGGU??CU???GUCGCUCCCCC??U???UCCUUGGAUAACUGUGGU???UCUAGAGCUAAUACAUGCCAACGAGCGCUGACCUCC???????????GGGGAUGCGUGCAUUUAUCAGACCAAAACCAACGGGCUCGCCC??CC??????????????????????????????????????????????????????????????????????????????????????????????GCU?UGGU?ACUCUAGAUAACCUCGGGCCGAUCGCA?GCC?C?CGUGGCGGCGACGACGCAUUCGAAUGUCU?CCCUAUCAACUUUCGAUGGUACUUUCUGCGCCUACCAUGGUGACC?CGGGUA??GGGGAAUCAGGGUU [...]
+		</sequence>
+<sequence taxon="Heterodon_platyrhinos">
+			
+			??CCU?GUUGAUCCUGCCAG?AGCA???GCU?GUCUCAAAGAUUAAGCCAUGCAUGUCUAAGUACACACGGGCGUGACAGUGAAACUGCGAAUGGC????UAAAUCAGUUAUGG???CU???GUCGCUCCCACCGU???UACUCGGAUAACUGUGG????UCUAGAGCUAAUACAUGCCGACGAGCGCUGACCUCC???????????GGGGAUGCGUGCAUUUAUCAGACCAAAACCAACGGGCU??CCCGGCC??????????????????????????????????????????????????????????????????????????????????????????????GCU?UGGUGACUCUAGAUAACCUCGGGCCGAUCGCA?GCCCCCCGUGGCGGCGACGACGCAUUCGAACGUCUGCCCUAUCAACUUUCGAUGGUACUUUCUGUGCCUACCAUGGUGACCACGGGUAACGGGGAAUCAGGGUU [...]
+		</sequence>
+<sequence taxon="Trachemys_scripta">
+			
+			??CCUGGUUGAUCCUGCCAGUAGCAUA?GCUUGUCUCAAAGAUUAAGCCAUGCAUGUCUAAGUACACACGGCCGGUACAGUGAAACUGCGAAUGGC???UUAAAUCAGUUAUGGU??CUU??GUCGCUCC?ACCCU???UACUUGGAUAACUGUGGU???UCU?GAGCU?AU?CAUGCCGACGAGCGCUGACCUCC???????????GGG?AUGCGUGCAUUUAUCAGACCAAAACCAACGGGCUCGCCCGGCC??????????????????????????????????????????????????????????????????????????????????????????????GCU?UGGUGACUCUAGAUAACCUCGGGC?GAUCGCA?GCCCCCCGUGGCGGCGACGAUGCAUUCGAAUGUCU?CCCUAUCAACUUUCGAUGGUACUUCCUGUGCCUACCAUGGUGACCACGGGUAACGGGGAAUCAGGGUU [...]
+		</sequence>
+<sequence taxon="Typhlonectes_natans">
+			
+			????UGGUUGAUCCUGCCAGUAGCA???GCUUGUCUCAAAGAUUAAGCCAUGCACGUGUAAGUACACACGGCCGGUACAGUGAAACUGCGAAUGGCU???UAAAUCAGUUAUGGU??CUU??AUCGCUCCAUCC??????ACUUGGAUAACUGUGGU???UCU?GAGCU?AU?CAUGCCGACGAGCGCUGACCUCC???????????CGG??UGCGUGCAUUUAUCAGACCA?AACCAAUGG?CUCGCCC??CC??????????????????????????????????????????????????????????????????????????????????????????????GC???GGU?ACUCUAGAUAACCUCGGGC?GAUCGCA?GUCCCCCGUGACGGCGACGAUGCAUUCGGAUGUCU?CCCUAUCAACUUUCGAUGGUACUUUCCG?GCCUACCAUGGUGACCACGGGUAACGGGG?AUCAGG?UU [...]
+		</sequence>
+<sequence taxon="Hypogeophis_rostratus">
+			
+			??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????AUCGCUC?AUCUCGU??UACUUGGAUAACUGUGGU?AUUCU?GAGCU?AUACAUGCCGACGAGCGCU?ACCUCC???????????CGGGAUG?GUGCAUUUAUCAGACC??AACCAAUGGGCUCGCC???C???????????????????????????????????????????????????????????????????????????????????????????????GCU??GGU?ACUCUAGAUAACCUCGGGCCGAUCGCACGUC?CCCGUGACGGCGACGAUACA???????????????????????????????????????????????????????????????????????????????? [...]
+		</sequence>
+<sequence taxon="Grandisonia_alternans">
+			
+			??CCU?GUU?AUCCU?CCAG?AGCA???GCU?GUCUCAAAGAUUAAGCCAUGCACGUGUAAGUACACACGGCCGGUACAGUGAAACUGCGA???????????????????????????????AUCGCUCCAUC?CGU??UACUUGGAUAACUGUGGU?AUUCU??A?CU?AUACAUGCCGACGAGCGCU?ACCUCC???????????CGGGAUG?GUGCAUUUAUCAGACC??AACCAAUGGGCUCGCC???CC??????????????????????????????????????????????????????????????????????????????????????????????GC???GGU?ACUCU?GAUAACCUCGGGC??AU?GCACGUC?C??GUGACGGCGACGAUACAUUCGGAUGUC?GCCCUAUC?ACUUUCG?UGGU?CUUUCUGCGCCUACCAUGGUGAC?ACGGGUAACGGGGAAUC?GGGUU [...]
+		</sequence>
+<sequence taxon="Ichthyophis_bannanicus">
+			
+			???????????????????????????????????UCAA?GA???AGCCAUGCACGUGUAAGUACACACGGCCGGUACAGUGAAACUGCGAAUGGC????UAAAUCAGUUAU?G????????AUCGCUC?AUCCGU????ACUUGGAUAACUGUGGU???UCU?GAGCU?AU?C?UGCCGACGAGCGCU?ACCCCC???????????CGG?AUGCGUGC?UUUAUC?GACCAAAACCAAUGGGCU?GCC???C???????????????????????????????????????????????????????????????????????????????????????????????GC???GGUGACUCUAGAUAACCUCGGGC?GAUCGCACGUC?CGCGUGACGGCGACGAUACAUUCGGAUGUCUGCCCUAUC?ACUUUCGAUGGUACUUUCU??GCCUACCAUGGUGAC?ACGGGUAACGGGGAAUCAGGG?? [...]
+		</sequence>
+<sequence taxon="Plethodon_yonhalossee">
+			
+			?????GGUU?AUCCUGCCAG?AGCA???GCUUGUCUCAAAGAUUAAGCCAUGCACGUGUAAGUACGCACGGCCGGUACAGUGAAACUGCGAAUGGCU??UUAAAUCAGUUA??????CUU??AUCGCUCCAU???U???UACUUGGAUAACUGUGGU?AUUC??GAGCU?AUACAUGCCGA?GAGCGCU?ACCUUCAC?????????CGGGAUG?GUGCAUUUAUCAGACC??AACCAAUCGGG?GCCC?CCU?G??????????????????????????????????????????????????????????????????????????????????????????????CUUUGGU?ACUCUAGAUAACCU?GGG?U?AUCGCA?GUC?CCCGUGACGGCG???????????????????????????????????????????????????????????????????????????GGGAA??AGGG?? [...]
+		</sequence>
+<sequence taxon="Ambystoma_mexicanum">
+			
+			????UGGUUGAUCCUGCCAGUAGCA???GCUUGUCUC?AAGAUUAAGCCAUGC?CGUGUAAGUACACACGGCCGGUAC?GUGAAACUGCGAAUGGCU??UUAAAUC?CUUAUGGU??CUUU?AUCGCUCCAUCUGU???UACUUGGAUAACUGUGGU?AUUCUAGAGCUAAUACAUGCCGACGAGCGCUGACCUCC???????????CGGGAUGCGUGCAUUUAUCAGACCAAGACCAAUGGGCUCGCCCGGCC??????????????????????????????????????????????????????????????????????????????????????????????GC???GGUGACUCUAGAUAACCUCGGGCCGAUCGCA?GUCCCCCGUGACGGCGACGAUGCAUUCGGAUGUCUGCCCUAUCAACUUUCGAUGGUACUUUCUGUGCCUACCAUGGUGACCACGGGU??CGGGGAAUCAGGGUU [...]
+		</sequence>
+<sequence taxon="Amphiuma_tridactylum">
+			
+			??CCU?GUUGAUCCUGCCAG?AGCA???GCUUGUCUCAAAGAUUAAGCCAUGCACGUGUAAGUACACACGGCCGGUACAGUGAAACUGCGAA????????UAAAUCAGUUAU??????????AUCGCUCCAUCU?U???UACUUGGAUAACUGU?GUUAUUCUU?AGCUAAUACAUGCCGACGAGCGCUGACCUCC???????????CGGGAUG?GUGCAUUUAUC?GACCAAAACCAAUGGGCUCGCC???CC??????????????????????????????????????????????????????????????????????????????????????????????GC???GGU?ACUCUAGAUAACCUCGGGC?GAUCGCA?G?C?CCCGUGACGGCGACGA???????????????????????????????????????????????????????????????????????????????????? [...]
+		</sequence>
+<sequence taxon="Siren_intermedia">
+			
+			??CCUGGUUGAUCCUGCCAGUAGCA???GCUUGUCUCAAAGAUUAAGCCAUGCACGUGUAAGUACACACGGCCGGUACAGUGAAACUGCGAAUGGCU?A?UAAAUCAGUUAUGGU??CUU??AUCGCU???CC?GU???UACUUGGAUAACUGUGGU?AUUCU?GAGCUAAUACAUGCCGACGAGCGCUGACCUC????????????CGGGAUGCGUGCAUUUAUCAGACCAAGACCAAUGGGC?CGCC????CC?????????????????????????????????????????????????????????????????????????????????????????????GCU??GGU?ACUCUAGAUAACCUCGGGCC?AUCGCACGUCCCCCGUGACGGCGACGAUGCAUUCGGAUGUCUGCCCUAUCAACUUUCGAUGGUACUUUCUGUGCCUACCAUGGUGACCACGGGUAACGGGGAAUCAGG?UU [...]
+		</sequence>
+<sequence taxon="Gastrophryne_carolinensis">
+			
+			???CUGGUUGAUCCUGCCAGUAGC????GCUUGUCUCAAAGAUUAAGCCAUGC?CGUGUAAGUACACACGGAC?GUACAGUGAAACUGCGAAUGGC???UUAAAUCAGUUAUGG???CUU??AUCGCUCCCAU???U??UACUUGGAUAACUGUGGUAAUUCU?GAGCU?AUACAUGCCGA?GAGCGCUGACCCCC???????????AGG?AUGCGUGCAUUUAUCAGACCAAAACCAAUCGGGGGC?C??G?GUC???G?CCC????CCC??G????????????????????????????????????????????????????????????????????????????UUUGGCGACUCUAGAUAACCUCGGGC?GAUCGCA?GUC?CCCGUGACGGCGACGAUACUUUCGGAUGUCUGCCCUAUC?ACUUUC?AU?GUUCUUUCU?CGC?UACCAU?GUGACCACGGGU?A?GGG??AUCAGG??U [...]
+		</sequence>
+<sequence taxon="Hyla_cinerea">
+			
+			??CCUGGUUGAUCCUGCCAGUAGCA?A??C?UGUCUCAAAGAUUAAGCCAUGCACGUGUAAGUACACACGGCCGGUACAGUGAAACUGCGAAUGGCU??U?AAAUCAGUUAU?????CU???AUCGCUCCAACC??????CCUUGGAUAACUGU?GU?AUUCU??AGCU?AUACAUGCCGACGAGCGCUGACCACC???????????AGGGACGCGUGCAUUUAUCAGACCAAAACCAAUCGGGGGCCCGGG?GCGGCGG?GGCGGAGGGG?GGCUCU?AAAAGCC??????C?C???C??GCUCUCCC??G?C??????????????????????????????????GCCUUGGCGACUCUAGAUAACCUCGGGCCGAUCGCACGUC?CCCGUGACGGCGACGACGCAUUCGGAUGUCUGCCCUAUCAACUUUCGAUGGUACUUUCUGCGCCUACCAUGGUGACCACGGGUAACGGG?AAUC?GGGU? [...]
+		</sequence>
+<sequence taxon="Bufo_valliceps">
+			
+			?????????????????????????????????????????????AGCCAUGCACGUGUAAGUACGCACGGCCGGUACAGUGAAACUGCGAAUGGC??????????????????????????AUCGCUCCAACCGU???UACUUGGAUAACUGUGGUAAUUCUAGAGCUAAUACAUGCCGACGAGCGCUGACCCCC???????????AGGGAUGCGUGCAUUUAUCAGACCAAAACCAAUCGGGG???GGGCGC?CGGG?C??GG??U?GGGGGUGGUCU?GGCCUCCC??C?CAGCC?C??C?GCUCUCCC??G?C???????????????????????????????GCUUUGGUGACUCUAGAUAACCUCGGGCCGAUCGCACGUC?CCCGUGACGGCGACGAUCCAUUCGGAUGUCUGCCCUAUCAACUUUCGAUGGUACUUUCUGCGCCUACCAUGGUGACCACGGGUAACGGGGAAUCAGGGUU [...]
+		</sequence>
+<sequence taxon="Eleutherodactylus_cuneatus">
+			
+			??CCUGGUUGAUCCUGCCAGUAGCA???GCUUGUCUCAAAGAUUAAGCCAUGCACGUGUAAGUACACACGGCCGGUACAGUGAAACUGCGAAUGGC????UAAAUCAGUUAUGG???CUU??AUCGCUCCAACCG?????AC?????????????????????????????????????????????????????????????????AGGGAUG?GUGCAUUUAU?AGACCAAAACC??U?GGGU?U?GC?????GGGGC??AAGGG?????G?U?CUCCCCGGGA???G?GCCCGG???G??GG?CCG?????CC????G???????????????????????????GCCUUGGCGACUCUAGAUAACCUCGGGC??AUCGCACGUC?CCCGUGACGGCGACGAUCCAUUCGGACGUCUGCCCUAUCAACUUUCGAUGGUACUUUCUGCGCCUACCAUGGUGACCACGGG??ACGGGGAAUCAGGG?U [...]
+		</sequence>
+<sequence taxon="Nesomantis_thomasseti">
+			
+			??CCU?GUU?AUCCUGCCAGUAGCU???GCUUGUCUC?AAGAUUAAGCCAUGCACGUGUGAGU?CGCACGGCCGGUAC?GUGAAACUGCGAAUGGC???UUAAAUCAGUUAU?G???CUU??AUCGCUCCAUCC??????AC?????????????????????????????????????????????????????????????????AGGGAUGCGUGCAUUUAU?AGACCAAAACCAAU?GGG?????????????????GGGUUUG??GG?G??GGGGGGGGGGGGUCGCGU?AG?C???????CC???G?CC??UCCUCCCG?GCCC?C?GUCCC?UCCC????CGCCU?GGU?ACUCUAGAUAACCUCGGG???AUCGCACGUC?CCCGUGACGGCGACGAUACAUUCGGAUGUCUGCCCUAUCAACUUUCGAUGGU?CUUUCUGCGCCUACCAUGGUGACCACGGGUAACGGGGAAUCAGGGUU [...]
+		</sequence>
+<sequence taxon="Scaphiopus_holbrooki">
+			
+			??????GUU?AU??UGC?AG??G?????GCUUGUCUC?????UU?AGCCAUGCACGUGUAAGUACACACGGCCGGUACAGUGAAACUGCGAAUGGC???UUAAAUCAGUUAU?G???CUU??AUCGCUC?AUC??U????ACUUGGAUAA?????????????????????????????????????????????????????????AGG?AUGCGUGCAUUUAUCAGACCAAAACCAAUCGGGUGGC?C?CCCCUCCC??CC?????????????????????????????????????????????????????????????????????????????????????GCU??GGU?ACUCUAGAUAACCUCGGGCCGAUCGCA??UC?CCCGUGACGGCGACGAUA??UUUGGAUGUCUGCCCUAU??ACUUUCGAU?GU?CUUUCUGUGCCUACCUUGGUGACCACGGGUU??GGG??AU??GG?UU [...]
+		</sequence>
+<sequence taxon="Xenopus_laevis">
+			
+			UACCUGGUUGAUCCUGCCAGUAGCAUAUGCUUGUCUCAAAGAUUAAGCCAUGCACGUGUAAGUACGCACGGCCGGUACAGUGAAACUGCGAAUGGCUCAUUAAAUCAGUUAUGGUUCCUUUGAUCGCUCCAUCUGU???UACUUGGAUAACUGUGGUAAUUCUAGAGCUAAUACAUGCCGACGAGCGCUGACCCCC???????????AGGGAUGCGUGCAUUUAUCAGACCAAAACCAAUCCGGGGCCCCCGCGCCCCGGCC??????????????????????????????????????????????????????????????????????????????????????GCUUUGGUGACUCUAGAUAACCUCGGGCCGAUCGCACGUC?CCCGUGACGGCGACGAUACAUUCGGAUGUCUGCCCUAUCAACUUUCGAUGGUACUUUCUGCGCCUACCAUGGUGACCACGGGUAACGGGGAAUCAGGGUU [...]
+		</sequence>
+<sequence taxon="Discoglossus_pictus">
+			
+			????UGGUUGAUCCUGCCAGUAGCAUA??C?UGUCUCAAAGAUUAAG?CAUGCACGUGUAAGUACACACGGCCGGUACAGUGAAACUGCGAAUGGCU????AAAUCAGUUAUGGU??CU???AUCGCUCCAUCUGU???UACUUGGAUAACUGUGGU?AUUCU?GAGCUAAUACAUGCCGACGAGCGCUGACCC??????????????GG?AUGCGUGCAUUUAUCAGACCAAAACCAAUGGGCACUCGUGCC??G?C??????????????????????????????????????????????????????????????????????????????????????????GCUUUGGU?ACUCUAGAUAACCUCGGGC?GAUCGCACGUC?CCCGUGACGGCGACGAUACAUU?????????????????????????????????????????????????????????????????????????????? [...]
+		</sequence>
+<sequence taxon="Latimeria_chalumnae">
+			
+			UACCUGGUUGAUCCUGCCAGUAGCAUAUGCUUGUCUCAAAGAUUAAGCCAUGCAUGUCUAAGUACAAACGGUGCGUACAGUGAAACUGCGAAUGGCUCAUUAAAUCAGUUAUGGUUCCUUUGAUCGCUCCAAC?GU???UACUCGGAUAACUGUGGUAAUUCUAGAGCUAAUACAUGCCGACGAGCGCUGACCUUC???????????GGGGAUGCGUGCAUUUAUCAGACCAAAACCAAUCCGGGUCCGCCCGGCC????????????????????????????????????????????????????????????????????????????????????????????GCUUUGGUGACUCUAGAUAACCUCGGGCCGAUCGCACGUC?CUCGUGGCGGCGACGAUUCCUUCGAAUGUCUGCCCUAUCAACUUUCGAUGGUACUUUCUGUGCCUACCAUGGUGACCACGGGUAACGGGGAAUCAGGGUU [...]
+		</sequence>
+</data>
+    <!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+    <input spec='HKY' id='hky'>
+        <kappa idref='hky.kappa'/>
+        <frequencies id='freqs' spec='Frequencies'>
+            <data idref='alignment'/>
+        </frequencies>
+    </input>
+
+    <!-- site model                                                              -->
+    <input spec='SiteModel' id="siteModel" gammaCategoryCount='1'>
+        <!--
+            <parameter name='shape' id='shape' value='0.5'/>
+            <parameter name='proportionInvariant' id='propInvar' value='0.2'/>
+        -->
+        <substModel idref='hky'/>
+    </input>
+
+    <input spec='TreeLikelihood' id="treeLikelihood">
+        <data idref="alignment"/>
+        <tree idref="tree"/>
+        <siteModel idref="siteModel"/>
+    </input>
+
+    <parameter id="hky.kappa" value="1.0" lower="0.0"/>
+
+    <tree id='tree'/>
+
+    <tree spec='beast.util.ClusterTree' id='upgmatree' clusterType='upgma' initial='@tree'>
+        <taxa idref='alignment'/>
+    </tree>
+    <tree spec='beast.evolution.tree.RandomTree' id='coalescentSimulator' initial='@tree' taxa='@alignment'>
+        <populationModel spec='ConstantPopulation'>
+            <popSize spec='parameter.RealParameter' value='1'/>
+        </populationModel>
+    </tree>
+
+
+    <run spec="MCMC" id="mcmc" chainLength="5000000" preBurnin="0">
+
+        <init idref='coalescentSimulator'/>
+        <distribution spec='CompoundDistribution' id='posterior'>
+<!--
+	make it comparable to the files in the BEAST 1 directory, that do not use a prior either
+            <distribution spec='beast.math.distributions.Prior' x='@hky.kappa'>
+                <distr spec='beast.math.distributions.OneOnX'/>
+            </distribution>
+-->
+            <distribution id='likelihood' idref="treeLikelihood"/>
+        </distribution>
+
+        <operator id='kappaScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" parameter="@hky.kappa"/>
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" tree="@tree"/>
+
+        <operator spec='SubtreeSlide' weight="5" gaussian="true" size="1.0" tree="@tree"/>
+
+        <operator spec='Uniform' weight="10" tree="@tree"/>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="1" tree="@tree"/>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="1" tree="@tree"/>
+        <operator spec='WilsonBalding' weight="1" tree="@tree"/>
+
+        <logger logEvery="10000" fileName="test.log">
+            <model idref='likelihood'/>
+            <log idref="likelihood"/>
+            <log idref='hky.kappa'/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+        </logger>
+        <logger logEvery="10000" fileName="test.trees">
+            <log idref="tree"/>
+        </logger>
+        <logger logEvery="10000">
+            <model idref='likelihood'/>
+            <log idref="likelihood"/>
+            <ESS spec='ESS' name='log' arg="@likelihood"/>
+            <log idref='hky.kappa'/>
+            <ESS spec='ESS' name='log' arg="@hky.kappa"/>
+        </logger>
+    </run>
+</beast>
+
diff --git a/examples/benchmark/II/testHKY3475.xml b/examples/benchmark/II/testHKY3475.xml
new file mode 100644
index 0000000..e58728c
--- /dev/null
+++ b/examples/benchmark/II/testHKY3475.xml
@@ -0,0 +1,283 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beast xmlns="http://www.w3.org/TR/xhtml1/strict" version="2.0" namespace="beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood">
+<data dataType="nucleotide" id="alignment">
+<sequence taxon="Vila_semistalachtis">
+			
+			CTGCATAGTTAAGACCTGCTGGATGAGGCTGCCCAGTTTCCGCTCCGTGGGTGACGCGCTAAAAGATCGCTTCGACGGGGCATCCCGAGTCATGATGCCCAATACGGAAGTAGAAGCACCCGTGCAGCGGAACGACGCAGCGCCT---CACAGGGTTCCAAGAAAAGATCGGTACAGATTCCAGCTCCGGCCGCACAATCCCGACCACAAGACGCCCGGCGTCAAGGACCTAGTGTACCTAGAATCATCGCCAGGCTTCTGTGAAAAGAACCCAAGGCTGGGCATTCCCGGTACACACGGGCGTGCCTGCAACGACACGAGTATCGGCGTCCACGGCTGTGACCTTATGTGTTGCGGGCGCGGCTATCGGACCGAAAC
+		</sequence>
+<sequence taxon="Vanessa_atalanta">
+			
+			CTGTACTGTTAAGACTTGTTGGATGAGGCTGCCCAGTTTTCGCTCCGTGGGTGACGCGTTAAAAGATCGCTTCGATGGAGCATCGCGGGTCATGATGCCTAATACAGAAATCGAAGCGCCCGTACAGCGAAATGACGCAGCGCCT---CATAGAGTTCCAAGAAGAGATCGGTACAGATTCCAGCTTCGGCCGCACAATCCGGATCATAAAACACCGGGAGCAAAAGACCTAGTCTACCTTGAATCATCACCGGGTTTTTGTGAAAAGAACCCGAGGCTGGGCATTCCCGGCACGCACGGGCGTGCCTGCAACGATACGAGCATCGGCGTCGACGGCTGCGACCTCATGTGTTGCGGTCGTGGTTACCGGACCGAAAC
+		</sequence>
+<sequence taxon="Tisiphone_abeona">
+			
+			CTGCACAGTGAAGACGTGCTGGATGAGGCTGCCGAGTTTTCGCTCTGTAGGCGATGCTTTAAAAGATGGCTTCGACGGAGCATCGCGGGTCATGATGCCCAACACGGAGGTGGAAGCGCCGCTTCAGCGGAACGACGCCGCCCCG---CACCGAGTCCCGCGACGAGACCGATACAGGTTTCAACTCCGGCCGCACAATCCCGATCACAAAACACCCGGGGTCAAGGACCTAGTATACCTGGAATCATCGCCGGGTTTCTGCGAAAAGAACCCGAGGCTGGGCATTCCCGGTACGCACGGGCGTGCCTGCAACGATACGAGTATCGGCGTCGACGGCTGCGACCTCATGTGCTGCGGCCGCGGGTACCGGACCGAGAC
+		</sequence>
+<sequence taxon="Taygetis_sp._RB294">
+			
+			CTGCACTGTCAAGACATGCTGGATGAGATTGTCGACGTTTAGATCTGTGGGAGATGCTTCGATAGATGGCTTCGATGGAGCATCACGCGTCATGATGCCCAACACAGAGGTAGAAGTGCCGGCTCAAAGAAATGACGCGGCTCCT---CATAGAGTACCACGAAGAGACCGATATAGGTTTCAACTCAGGCCGCACAATCCTGACCACAAAACACCCGGGGTCAAGGATTTGGTATACCTGGAACCATCGCCAGGTTTCTGCGAAAAGAACCCACGGCTGGCCATTTCCGGCACGCACGGACGTGCCTGCAACGACACAAGTATCGGCGTCGACGGCTGTGACCTCATGTTCTGCGGTCGTGGGTACAGGACCGAGAC
+		</sequence>
+<sequence taxon="Siproeta_stelenes">
+			
+			CTGCACCGTTAAGACCTGCTGGATGAGGCTGCCTAGTTTTCGCTCCGTGGGCGATGCTCTAAAGGATCGCTTCGATGGGGCATCGCGGGTAATGATGCCCAATACAGAAATCGAAGCTCCCGTGCAGCGAAACGAGGCAGCTCCT---CACAGAGTACCACGAAGAGATCGGTACAGATTCCAACTTAGGCCACACAATCCCGATCATAAAACACCGGGGACCACAGACCTAGTGTACCTAGAATCATCGCCGGACTTCTGTGAAAAGCACCCGAGACTGGGCATTCCCGGCACGCACGGGCGTGCCTGCAACGATACGAGCATCGGCGTCGACGGTTGCGACCTTATGTGCTGCGGCCGTGGTTACCGCACCGAGAC
+		</sequence>
+<sequence taxon="Prepona_sp._RB256">
+			
+			CTGCACTGTCAAGACTTGCTGGATGAGACTACCCACTTTCCGGTCGGTAGGAGACGCGTTGAAAGATCGATTCGACGGGGCGTCGAGAGTGATGATGCCCAATACGGTAGTGGAAGCGCCGGTGCAGCGAAACGATGCAGCCCCT---CACAGAGTCCCACGAAGAGATCGATATAGATTTCAACTCCTGCCGCACAATCCCGATCACAAAACACCCGGGGTCAAGGACCTAGTGTACCTAGAATCGTCATCCGGTTTCTGTGAAAAGAATCCGAGACTGGGCATTCCCGGCACGCACGGCCGTGCCTGCAACGATACGAGCATCGACGGTGTCGACTGCGACCTGATGTACTACGGTCGTGGGTACCGGACTGAGAC
+		</sequence>
+<sequence taxon="Podotricha_telesiphe">
+			
+			CTGCACAGTCAAGACCTGTTGGATGAGGCTTCCCAGTTTTAGATCAGTGGGAGACGCTTTGAAAGACCGTTTCGATGGAGCATCGCGGGTCATGATGCCCAACACGGAAGTTGAAGTGTCTGTTCAGAGGAATGACGCAGCTGCG---CACAGAGTTCCTCGAAGAGACCGGTACAAGTTTCAATTCCGACCACACAACCCAGACCATAAAACACCTAGTATACGGGATTTAGTTTACCTAGAACCATCGCCAGGTTTCTGCGAGAAGAATCCGAGAGTGGGCATTCCCGGCACGCACGGGCGTGCCTGCAACGATACCAGCATCGGCGTCGACGGCTGTGATCTCATGTGTTGCGGCCGCGGATACCGGACCGAGAC
+		</sequence>
+<sequence taxon="Pieris_rapae">
+			
+			CTGCACGGTTAAGACCTGTTGGATGCGACTACCAAGTTTCCGTTCGGTCGGCGACTCATTGAAAGACCGCTTCGACGGGGCATCGCGAGTGATGGTGTCTAACACGGACCTCGAAACGCCAGTACAACGAAACGACGCAGCCCCA---CACAGGGTGCCTCGCAGGGATCGATACAGATTCCAACTGCGTCCGCACAACCCCGATCATAAATCACCGGGAGTCAAAGACCTCGTCTACTTGGAATCGTCGCCTGGTTTCTGCGAAAAGAATCCACGTTTGGGTATACCCGGCACCCACGGGCGTACTTGCAACGATACTAGTATCGGAGTGGACGGCTGCGACCTCATGTGCTGCGGCCGCGGTTACCGGACTGAGAC
+		</sequence>
+<sequence taxon="Phyciodes_tharos">
+			
+			CTGCACTGTCAAGACATGCTGGATGAGGCTGCCAAATTCTCGCTCCGTGGGTGATGCACTTAAAGATCGCTTTGATGGGGCTTCTCGGGTCATGATGCCTAGCACAGAGAGTGACATGCCCTTACGACAGCGTAACGATGCAGCACCGCACAGAGTTCCTCGACGAGATCGTTACAGATTACAGCTCCGTCCTCTCAATCCTGACCATAAAGCACCGGGAACTAAAGACCTAGTCTATCTGGAACCATCGCCAGGTTTCTGTGAAAAGAACACAAGGCTGGGGATTCCTGGCACCCACGGGCGTACTTGCAATGACACGAGTATCGGCGTCGACGGCTGCGACCTCATGTGTTGCGGCCGAGGTTACCGGACGAACAC
+		</sequence>
+<sequence taxon="Philaethria_dido">
+			
+			CTGCGCTGTCAAGACCTGTTGGATGAGGCTTCCCAGTTTTAGATCCGTGGGAGGAGCTTTGAAGGACCGCTTCGACGGAGCTTCGCGGGTCATGATGTCCAATACGGAAGTTGAAGTGCCTGTTCAGAGGAATGACGCAGCTGCG---CATAGAGTTCCTCGAAGAGATAGGTACAAGTTCCAACTCCGACCACATAATCCAGATCATAAAACACCTGGTGTCAAGGATTTAGTGTACTTAGAACCATCACCGGGTTTCTGCGAGAAAAACCCGAGGCTGGGCATTCCCGGCACGCACGGGCGTGCCTGCAACGATACTAGCATTGCCGTTGACGGCTGCGATCTCATGTGTTTCGGCCGCGGCTACCGGACTGAGAC
+		</sequence>
+<sequence taxon="Panacea_divalis">
+			
+			CTGCACCGTAAAGACCTGCTGGATGAGGCTGCCCAGTTTCCGCTCCGTGGGTGATGCGTTGAAAGATCGCTTCGATGGGGCGTCGCGGGTCATGATGCCCAATACTGAAGTCGAGGCACCCGTGCAGCGGAACGACGCAGCGCCT---CACAGGGTTCCAAGAAGAGATCGGTACCGATTCCAACTTCGGCCACATAATCCCGATCACAAAACGCCTGGGGTCAAGGACCTAGTGTACCTAGAATCATCGCCGGGCTTCTGTGAAAAGAACCCGAGACTGGGCATTCCCGGTACGCACGGACGTGCTTGCAACGATACGAGTATCGGCGTCGACGGCTGTGACCTCATGTGTTGCGGGCGCGGTTACCGGACCGAGAC
+		</sequence>
+<sequence taxon="Opsiphanes_cassina">
+			
+			???TTCTGCCAAGACTTGCTGGATGAGACTGCCGAGTGTTCGATCTGTAGGTGATGCCTTGATAGACGGTTTCGTTGGAGCTTCGCGGGTCATGAAGCCCATCACGGAGGTAGAGGCCCCAATACACCGGACTGACGCCCCTCTT---CACAGAGTTCCGCGCCGGGATCTCTTCAGGTTCCAACTTCGGCCACACAATCCCGAACACAAAGCACCCGGGGTCAAGGACCTAGTATACTTAGAATCATCGCCGGGTTCCTGTGAAAAGAAGCCCAGGCTGGGCATTCCCGGTACGCACGGGCGTATGTGCAACGACACTAGCATCGGTGTCGTCGGCTGCGATCTCATGTACTTCGACCGAGGATACCGGACCGAGAC
+		</sequence>
+<sequence taxon="Oleria_aquata">
+			
+			CTGCACAGTGAAGACTTGCTGGATGAGGCTACCGAGTTTCCGTTCTGTGGGCGATGCTCTAAAAGACCGCTTCGACGGTGTTTCACGGGTAATGATGCCCAACACAGAAGTAGAAGCGCCGGTACAGCGTAATGACGCGGCACCC---CACAGAGTTCCACGAAGAGATCGATACAGATTTCAACTTCGGCCTCATAATCCTGACCATAAGACACCTGGTGTAAAAGATCTGGTATATCTGGAATCATCACCGGGTTTCTCCGAAAAGAACCCAAGGCTGGGCATTCCCGGTACGCACGGACGTGCCTGCAACGATACTAGTATCGGCGTGGACGGCTGCGACCTCATGTGTTGCGGCCGAGGTTACCGTACAGAGAC
+		</sequence>
+<sequence taxon="Neruda_metharme">
+			
+			TTGTACAGTCAAGACATGCTGGATGAGGCTCCCCAATTTTAGATCCGTGGGGGACGCCTTAAAGGACCGCTTTGATGGAGCATCGCGGGTCATGATGCCTAATGCGGAAGTTGAAGTGCCTGTTCAGCGGAACGATGCCGCTGCG---CACAGAACTCCTCGAAGAGATCGATACAACTTCCAACTTCGACCACACAATCCTGATCACAAAACACCCGGTGTCAAGGATTTAGTTTACCTAGAACCATCACCTGGTTTCTGCGAGAAGAACCCGAGGCTAGGTATTCCCGGCACGCACGGGCGTGCCTGCAACGACACCAGCATCGGCGTCGACGGCTGCGATCTCATGTGTTGCGGCCGCGGATACCGGACTGAAAT
+		</sequence>
+<sequence taxon="Morpho_helenor">
+			
+			CTGCTCCGCCAAGACGTGCTGGATGCGGTTACCGAGTTTTCGGTCTGTAGGAGACGCCTTGAAAGATGGCTTCGATGGGGCGTCACGGGTCATGCTGCCGAACACTGAGGTGGAAGTGCCAGTGCAGCGGAATGACGCCGCTCCC---CACAGAGTACCCCGACGAGACCGGTACAGATTCCAACTTCGGCCGCATAATCCTGATCACAAATCACCTGGGGTCAAAGACCTAGTATACTTAGAATCGTCGCCGGGTTTCTGTGAAAAGAATCCCAGACTGGGCATTCCTGGTACGCACGGGCGTGCCTGCAACGACACGAGTATCGGCGTCGACGGCTGCGAACTCATGTGCTGCGGCCGCGGATACCGGACCGAGAC
+		</sequence>
+<sequence taxon="Memphis_sp._RB226">
+			
+			CTGCACGGTCAAAACTTGCTGGATGAGGCTACCGACTTTCCGATCCGTTGGGGACCCCTTGAAAGATCGCTTTGACGGAGCGTCGAGGGTGATGATGCCCAATGTAGAAGTGGAAACACCAGCGATGCGTAACGACGCACTTCCT---CACAGAGTCCCGCGACGGGATCGGTATCGATTTCAACTTAGGCCACACAACCCTGATCACAAGACACCCGGGGTGAAGGACCTAGTCTACTTGGAATCGTCGCCGGGTTTCTGCGAAAAGAATCCCAGGCTGGGCATTCCCGGCACGCACGGGCGTACCTGCAACGATACGAGTATTGGTGTCGACGGTTGCGACCTCATGTGCTGCGGCCGCGGGTACCGCACCGAGAC
+		</sequence>
+<sequence taxon="Megisto_cymela">
+			
+			CTGTACGGTCAAGACGTGCTGGATGAGGCTGCCAACTTTCCGGTCTGTGGGAGACGCCTTAAAAGACGGCTTTGACGGAGCATCACGAGTCATGATGCCCAATACCGAGGTTGAAGTACCAGCTCAGAGGAATGATGCTGCTCCG---CACAGAGTCCCGCGACGAGACCGATACAGATTTAAACTCCGGCCGCACAATCCTGACCACAAAACACCTGGGGTCAAGGACCTAGTATACTTGGAACCATCGCCGGGTTTCTGCGAAAAGAACCCGCGGCTGGGTATTCCCGGTACGCACGGGCGTGCCTGCAACGATACCAGTATCGGCGTCGACGGTTGCGACCTCATGTGCTGCGGCCGAGGTTACCGGACCGAGAC
+		</sequence>
+<sequence taxon="Mechanitis_polymnia">
+			
+			??GCACAGTGAAAACTTGTTGGATGAGGCTACCCAGTTTTCGATCTGTAGGCGATGCCCTAAAAGATCGATTCGACGGCGCTTCACGGGTAATGATGCCCAACACAGAAGTAGAAGTGGCGGCACAACGGAACGACGCAGCGCCT---CACAGAGTTCCACGACGAGATAGATACAGATTTCAGCTTCGGCCTCATAATCCTGACCACAAGACATCTGGAGTAAAAGACCTGGTATTCCTGGAATCATCACCGGGTTTCTGCGAAAAGAACCCAAGGTTGGGCATTCCTGGTACTCACGGACGTAACTGCAACGACACCAGCATCGTCGTGGACGGCTGCGACCTCATGTGTTGCGCCCGCGGTTACCGGACGGATAC
+		</sequence>
+<sequence taxon="Marpesia_orsilochus">
+			
+			CTGCACGGTCAAGACTTGCTGGATGAGGCTGCCTAGTTTTCGCTCTGTCGGCGATGCTTTAAAAGATCGCTTCGATGGGGCATCGCGGGTCATGATGCCTAATACAGAAATCGAAGCGCCCGTACAGAGAAATGACGCGGCGCCT---CATAGGGTGCCACGAAGAGATCGGTACAGATTCCAACTACGACCGCACAATCCCGATCACAAAACACCCGGGGTCAAGGACCTAGTCTACCTAGAACCATCGCCGGGATTCTGCGAAAAGAACCCGAGACTGGGCATTCCCGGTACGCATGGGCGTACCTGCAACGATACGAGCATAGGCGTCGATGGCTGTGACCTCATGTGCTGCGGCCGCGGCTACCGGACTGAGAC
+		</sequence>
+<sequence taxon="Limenitis_arthemis">
+			
+			CTGCACCGTGAAGACCTGCTGGATGAGGTTACCCAGTTTCCGATCCGTGGGAGACTCGCTGAAGGATCGCTTCGACGGGGCATCGCGGGTCATGATGCCTAATACGGAAATTGAAGTTCCTGTTCAACGAAATGATGCAGCAGCT---CCCAGAGTTTCGCGAAGGGATCGATATAAATTCCAGCTTAGACCGCACAACCCCGATCACAAAACACCCGGGTTCAAGGATTTAGTGTACCTCGAATCTTCACCGGGTTTCTGCGAAAAGAACCCTCGGGTGGGGATTCCCGGCACGCACGGGCGTGCCTGCAACGATACAAGCATCGGTGTCGACGGCTGCGACCTCATGTGCTGCGGCCGCGGGTATCGGACCGAGAC
+		</sequence>
+<sequence taxon="Libytheana_carinenta">
+			
+			CTGCACTGTGAAGACTTGCTGGATGAGGCTGCCGAGTTTCCGCTCTGTGGGTGACGCGTTGAAGGACCGCTTCGACGGTGCCTCACGAGTCATGATGCCCAACACCGATCTCGAGGCGCCCGTGCAGCGAAACGAAGCGGCGCCC---CACAGAGTGCCGTGGAGAGATCGATTCAGGTTCCAAATCCGGCCACACAATCCCGATCACAAGACACATGGAGTCAAGGATCTGGTGTACTTAGAGTCTTCGCCGGGCTTCTGCGAGAAGAATCCCCGGCTGGGCATCCCCGGTACGCACGGTCGCACCTGCAATGACACCAGCATTGGGGTCGAAGGCTGCGACCTCATGTGCTACGCCCGCGGGTACAGGACCGAGAC
+		</sequence>
+<sequence taxon="Laparus_doris">
+			
+			????????????????????GGATGAGGCTCCCCAGTTTCAGATCCGTGGGGGACGCCTTAAAGGATCGCTTCGATGGAGCATCGCGGGTCATGATGCCTAATACAGAAGTTGAAGTACCTGTTCAGAGGAACGACGCAGCTGCG---CATAGAGTTCCTCGAAGAGATCGGTATAAGTTCCAACTCCGACCGCACAATCCCGATCATAAAACACCTGGTGTCAAGGATTTAGTTTACCTAGAACCATCACCGGTTTTCTGCGAGAAGAACCCGAGGCTGGACATTCCCGGCACGTACGGGCGTGCCTGCAACGATACTAGCATTGGCGACGAAGGCTGCGATCTCATGTGTTCCGGCCGCG????????????????
+		</sequence>
+<sequence taxon="Hypolimnas_bolina">
+			
+			CTGTACTGTTAAGACTTGCTGGATGAGGCTTCCAAGTTTCCGCTCCGTGGTCGATGCGTTAAAAGATCGATTCGATGGTGCGTCGCGGGTCATGATGCCCAACACGGAAATCGAAGCGACTGTACAGCGAAGCGACGGAGCGCCA---CACAGAGTTCCACGAAGAGATCGGTACAGGTTCCAGCTCAGACCGCACAATCCCGATCATAAAACACCGGGATCTAAAGACCTAGTGTACCTCGAATCATCGCCGGGTTTCTGTGAAAAGAACCCGAGGCTGGGCATTCCCGGCACGCACGGGCGTGTCTCCCTCGATGCGAGCATCGGTGTCGGCGGCTGCGATCTCATGTGCTGCGGCCGTGGCTACAGGACCGAGAC
+		</sequence>
+<sequence taxon="Hypna_clytemnestra">
+			
+			CTGCACTGTCAAAACTTGCTGGATGAGACTACCAACTTTCCGGTCTGTAGGCGACGCTTTAAAAGATCGCTTCGACGGGGCGTCGAGAGTGATGATGCCCAATACGGAGGTAGAAGCACCAGCGCAACGCAATGACGCTGCTCCT---CATCGAATCCCAAGACGAAATCGATATAGATTTCAACTTCGGCCGCACAATCCCGATCACAAAACACCTGGGGTCAAGGACCTAGTATACTTAGAATCATCACCCGGCTTCTGTGAAAAGAATCCGAGGCTGGGCATTCCCGGCACGCACGGGCGTACCTGCAACGATACGAGCATCGGCGTCGATGGTTGCGACCTCATGTGCTGCGGGCGCGGGTACCGGACGGAAAC
+		</sequence>
+<sequence taxon="Heliconius_erato">
+			
+			????????TCAAGACCTGTTGGATGAGGCTCCCCAGTTTTAGATCTGTCGGGGACGCCTTAAAGGATCGCTTTGATGGAGCCTCGCGAGTCATGATGCCTAATACGGAAGTTGAAGTGCCTGTTCAGAGGAACGACGCAGCTGCG---CACAGAGTTCCTCGAAGAGACCGGTACAAGTTCCAACTGCGACCCCACAATCCCGATCATAAAACACCTGGTGCCAAGGATTTGGTTTACCTAGAACCATCACCGGGCTTCTGCGAGAAGAACCCGAGGCTGGGCATTCCCGGCACGCACGGGCGTGCCTGCAACGATACTAGCATCGGCGTCGACGGCTGCGATCTCATGTGTTGCGGCCGCGGATACCGGACCGAAAC
+		</sequence>
+<sequence taxon="Hamadryas_chloe">
+			
+			CTGCACCGTAAAGACCTGCTGGATGAGGCTGCCCAGTTTCCGCTCCGTGGGTGATGCATTAAAAGATCGCTTCGATGGGGCGTCGCGGGTCATGATGCCCAATACAGAAGTCGAAGTACCCGTGCAGCGAAACGACGCAGCGCCT---CACAGGGTTCCAAGAAGAGATCGGTACAGATTCCAACTTAGGCCGCACAATCCCGATCACAAAACACCTGGGGTCAAGGATCTAGTGTACCTAGAATCATCGCCGGGCTTCTGTGAAAAGAACCCGAGGCTAGGCATTCCCGGTACGCACGGGCGTGCCTGCAACGATACGAGTATCGGTGTCGACGGCTGCGATCTTATGTGTTGCGGGCGCGGATATCGAACCGAGAC
+		</sequence>
+<sequence taxon="Haetera_piera">
+			
+			CTGCCTCGTGAAGACGTGCTGGATGAGGCTGCCGACTTTCCGATCTGTAGGCGACGCCTTAAAGGATGGCTTCGACGGTGCTTCGCGGGTCATGATGCCCATCACGGAGGTAGAAGCACCGGTGCAGAGGAACGATGCCGCTCCG---CACAGAGTCCCGCGACGAGACCGATACAGATTTCAACTTCGGCCCCACAATCCTGACCATAAAACGCCTGGTGTCAAGGACCTAGTGTACTTGGAATCATCACCGGGGTTCTGTGAAAAGAATCCCAGACTGGGCATTCACGGTACGCACGGGCGTGCCTGCAACGATACTAGTATCGGCGTCGACGGCTGCGACCTCATGTGCTGCGGCCGCGGGTACCGGACCGAGAC
+		</sequence>
+<sequence taxon="Euptoieta_claudia">
+			
+			????ACCGTAAAGACCTGCTGGATGAGGCTGCCAAGTTTCCGATCTGTGGGAGATGCATTGAAAGATCGCTTCGATGGAGCTTCTCGAGTAATGATGCCAAATACAG---TCGAAGTTCCTGTTCCACGTAATGATGCAGCGGCC---CATAGAGTACCTCGGAGGGATCGGTATAAATTTCAACTTAGACCACATAATCCTGATCACAAAACACCTGGAGTCAAGGATCTAGTGTACTTGGAATCATCACCGGGTTTCTGCGAAAAGAACCCAAGGCTGGGCATTCCCGGCACGCACGGGCGTGCCTGCAATGATACTAGCATTGGTGTCGACGGCTGCGATCTTATGTGTTGCGGCCGCGGCTTCCGGACCGAGAC
+		</sequence>
+<sequence taxon="Euphydryas_phaeton">
+			
+			CTGTACTGTCAAGACTTGCTGGATGAGGCTACCAAGTTTTCGCTCCGTGGGCGATGCACTTAAAGATCGCTTCGATGGAGCATCGCGGGTCATGATGCCAAATTCAGAAAGTGACATGCCCTTGCGACAGCGAAACGATGCAGCGCCTCACAGGGTTCCACGTAGAGATCGTTATAGGTTCCAACTCCGTCCACACAATCCCGATCATAAAACACCAGGTACCAAGGACCTAGTATATCTAGAACCATCGCCGGGTTTCTGTGAAAAGAACACAAGGCTGGGCATTCCTGGCACGCATGGGCGTGCTTGCAACGACACGAGCATTGGTGTTGGAGGCTGCGATCTTATGTGTTGTGGCCGTGGGTACCGGACCGAGAC
+		</sequence>
+<sequence taxon="Eueides_vibilia">
+			
+			CTGCACAGTCAAGACTTGTTGGATGAGGCTTCCCAGCTTTAGGTCCGTAGGGGACGCCTTGAAGGATCGCTTTGATGGAGCCTCAAGGGTTATGATGCCTAATACGGAAGTTGAAGTGCCTGTCCAGAGGAATGACGCTGCTGCG---CACAGAGTTCCTCGAAGAGATCGGTATAAATTCCAACTTCGACCACATAACCCTGATCATAAAACACCTAGTGCCAAGGATTTGGTTTACTTAGAACCATCACCGGGTTTCTGCGAGAAAAACCCGAGGCTGGGCATTCCCGGCACGCACGGGCGTGCCTGCAACGATACTAGCATCGGCGTTGACGGCTGCGATCTCATGTGTTGCGGCCGCGGATACCGGACCGAGAC
+		</sequence>
+<sequence taxon="Eresia_nauplius">
+			
+			CTGCACGTTCAAGACATGCTGGATGAGGCTGCCGAGTTTTCGCTCCGTGGGTGATGCACTTAAAGATCGTTTCGACGGGGCTTCACGGGTCATGATGCCAAGCACAGAGACTGACATGCCCTTACGACAGCGAAACGATGCAGCACCGCACAGAGTTCCACGACGAGATCGTTACAGATTACAACTCCGTCCTCTCAATCCTGATCATAAAGCACCGGGCACAAAAGACCTAGTCTATCTAGAACCATCGCCAGGTTTCTGTGAAAGGAACACAAGACTGGGGATTCCTGGCACGCACGGGCGTACTTGTAACGACACGAGTATCGGTGTCGATGGATGCGACCTCATGTGTTGCGGCCGTGGGTACCGGACCGATAC
+		</sequence>
+<sequence taxon="Dryas_iulia">
+			
+			CTGCACAGTTAAGACCTGTTGGATGAGACTTCCCAGTTTTAGATCTGTGGGAGACGCTTTGAAAGATCGTTTCGATGGAGCCTCACGAGTCATGATGCCCAACACGGAAGTTGAAGTGCCTGTTCAGAGGAACGATGCGGCTGCG---CACAGAGTTCCTCGAAGAGATCGGTACAAGTTCCAACTCCGACCGCATAATCCTGATCACAAAACACCAGGTGTCAAAGATTTAGTATACCTAGAACCATCACCGGGCTTCTGTGAGAAGAACCCGAGGCTGGGCATTCCCGGCACGCACGGGCGTGCCTGCAACGATACTAGCATCGGCGTCGACGGCTGCGACCTCATGTGTTGCGGCCGCGGATACCGCACCGAGAC
+		</sequence>
+<sequence taxon="Dryadula_phaetusa">
+			
+			CTGCACAGTCAAGACCTGCTGGATGAGGCTTCCCAGTTTTAGATCTGTGGGAGATGCTTTGAAGGACCGCTTTGATGGAGCATCGCGAGTCATGATGCCCAATACGGAAGTTGAGGTGCCTGTACAAAGGAATGACGCAGCTGCG---CACAGAGTTCCTCGAAGAGATCGGTACAAGTTCCAACTCCGACCGCACAATCCTGATCATAAAACACCTGGTGTGAAAGATCTAGTTTACCTAGAACCATCACCGGGTTTCTGCGAAAAGAACCCGAGGCTGGGCATTCCCGGCACGCACGGGCGTGCCTGCAACGATACTAGCATCGGCGTTGACGGCTGCCACCTCATGTGTTGCGGCCGCGGATACCGGACCGAAAC
+		</sequence>
+<sequence taxon="Doxocopa_sp._RB273">
+			
+			CTGTACTGTGAAGACCTGTTGGATGAGGCTCCCAAGTTTCCGCTCTGTGGGTGATTCATTAAAAGATCGTTTCGACGGGGCATCGCGGGTTATGATGCCTAATACAGAAGTCGAAGCACCCGTACAGCGAAATGACGCAGCGCCT---CACAGGGTTCCAAGAAGAGATCGATACAGGTTTCAACTTCGACCGCACAATCCCGATCATAAAACACCCGGGGCCAAAGACCTAGTGTACCTAGAATCATCGCCGGGTTTCTGTGAAAAGAACCCGAGACTGGGCATTCCCGGGACGCACGGGCGTGCCTGCAACGATACGAGCATCGGCGTCGACGGTTGCGATCTCATGTGTTGCGGCCGCGGTTACCGAACCGAGAC
+		</sequence>
+<sequence taxon="Dione_juno">
+			
+			CTGCACAGTCAAGACTTGCTGGATGAGGCTTCCCAATTTTAGATCAGTGGGAGACGCCCTGAAGGATCGCTTCGACGGAGCCTCGCGGGTCATGATGCCTAATACGGAAGTTGAAGTACCTGTTCAAAGGAATGACGCAGCTGCG---CACAGAGTTCCTAGAAGAGATCGATATAAGTTCCAACTCCGTCCACACAACCCTGATCATAAAACACCTAGTGTCAAAGATTTGGTATACCTAGAACCATCACCGGGTTTCTGCGAGAAGAACCCGAGGCTGGGCATTCCCGGCACGCACGGGCGTGCCTGCAACGATACTAGCATCGGCGTCGACGGCTGCGATCTCATGTGTTTCGGCCGCGGATACAGGACCGAGAC
+		</sequence>
+<sequence taxon="Diaethria_clymena">
+			
+			CTGTACTGTAAAGACCTGCTGGATGAGGCTGCCTAGTTTCCGGTCAGTGGGTGATGCATTAAAAGATCGCTTTGATGGGGCGTCGCGGGTCATGATGCCCAACACAGAAGTTGAAGCACCAGTGCAGCGAAACGACGCAGCACCT---CACAGGGTTCCAAGAAGAGATCGGTATAGGTTTCAACTAAGACCGCACAATCCCGACCACAAGACTCCTGGAGTCAAAGACCTGGTGTACCTAGAACCATCACCAGGCTTTTGTGAAAAAAACCAGAGGCTGGGCATTCCCGGTACACACGGGCGTTCCTGCAACGATACGAGTATGGGCGTCGAAGGCTGTGACCTCATGTGTTGCGGGCGCGGCTTCCGGACCGAAAC
+		</sequence>
+<sequence taxon="Colobura_dirce">
+			
+			CTGTACTGTTAAGACTTGCTGGATGAGATTACCCAGTTTTCGTTCTGTGGGTGATGCGTTAAAAGATCGTTTTGATGGAGCGTCACGGGTCATGATGCCTAATACAGAAATTGAAGCACCCGTACAACGAAATGACGCAGCGCCT---CACAGAGTTCCACGAAGAGATCGGTACAGATTTCAACTTCGACCCCACAATCCTGATCATAAAACACCGGGGGCTAAAGACCTAGTGTACCTAGAATCATCACCGGGTTTTTGTGATAAGAACCCGAGGCTGGGCATCCCCGGTACACACGGGCGTGCCTGCAACGACACAAGCATCGGCGTCGACGGCTGTGACCTTATGTGTTGCGGCCGTGGTTACCGAACCGAAAC
+		</sequence>
+<sequence taxon="Cercyonis_pegala">
+			
+			CTGCACGGTGAAGACGTGCTGGATGAGGCTGCCGACGTTCCGGTCTGTAGGCGATGCCCTAAAGGATGGCTTCGACGGAGCGTCGCGGGTCATGATGCCCAATACAGAGGTGGAAGCGCCGGCTCAGCGGAACGATGCCGCTCCG---CACAGAGTGTCGCGACGAGACCGGTACAGATTTCAACTCCGGCCGCACAATCCTGACCACAAAACGCCTGGGGTCAAGGACCTAGTATACCTGGAATCCTCGCCGGGTTTCTGCGAAAAGAACCCTCGGCTGGGCATTCCCGGTACGCACGGGCGTGCCTGCAACGACACGAGTATCGGCGTCGACGGCTGCGACCTCATGTGCTGCGGCCGCGGCTACCGGACCGAGAC
+		</sequence>
+<sequence taxon="Ceratinia_nise">
+			
+			CTGCACAGTGAAAACTTGCTGGATGAGGCTACCAAGTTTTCGCTCTGTGGGTGATGCCCCAAAAGACCTTATTGACGGCGCCTCACGGGTGATGATGCCCAACACAGAAGTAGAAGCGCCGGTACAGCGGAATGACGCAGCAAAC---CACAGAGTTCCACGAAGAGATCGATACAGATTTCAACTTCGGCCTCATAATTCCGACCACAAGACCCCTGGGGTAAAAGACCTGGTATACCTAGAATCGTCCCCAGGTTTCTGTGAAAAAAACCCTAGGTTGGGCATTCCCGGCACGCACGGACGTGCTTGCACCGACACGAGTATCGGCGTAGACGGCTGCGACCTCATGTGTTGCGTCCGCGGTTACCGGACGGAGAC
+		</sequence>
+<sequence taxon="Catonephele_acontius">
+			
+			TTGCACAGTAAAGACCTGCTGGATGAGGCTGCCCAGTTTCCGCTCCGTGGGTGATGCATTGAAAGATCGTTTCGACGGGGCATCGCGGGTCATGATGCCTAACACGGAAATCGAAGCACCCGTGCAGCGAAACGACGCAGCGCCT---CACAGGGTGCCAAAAAGAGATCGGTACAGGTTCCAGCTTAGACCGCACAATCCCGATCACAAAACACCCGGGGTTAAAGACCTAGTTTACCTAGAATCATCGCCGGGCTTCTGTGAAAAGAACCCGAGGCTGGGCATTCCCGGTACGCACGGGCGTGCCTGCAACGATACGAGTATCGGCGTCGACGGCTGCGACCTCATGTGTTGCGGGCGCGGCTACCGGACCGAGAC
+		</sequence>
+<sequence taxon="Caligo_idomeneus">
+			
+			?????CTGTTAAGACTTGTTGGATGAGACTGCCGAGTTTTCGATCCGTGGGCGATGCTTTGAAAGATAGTTTTGATGGAGCGTCGCGGGTAATGATGCCCAATACGGACGTAGAGGCTCCAGTACAAAGAAATGATGCAGCTCCT---CACAGGCTTCCACGAGGAGACCGTTACAGATTCCAACTTCGGCCGCACAACCCTGACCACAAAGCACCCGGGGTCAAAGACTTAGTATACTTAGAATCATCTCCGGGTTTCTGTGAAAAAAATCCGAGGCTAGGCATCCCCGGTACACACGGGCGTGCCTGCAACGACACTAGCATCGGTGTTGATGGCTGCGAGCTCATGTGCTGCGGCCGTGGTTACCGGACCGAGAC
+		</sequence>
+<sequence taxon="Boloria_bellona">
+			
+			CTGTACAGTTAAGACATGCTGGATGAGGCTACCAAGTTTCCGATCTGTGGGAGATGCATTAAAGGACCGCTTTGATGGAGCTTCGCGGGTTATGATACCTAACACAGAAGTCGAAGCTCCTATACCACGTAACGATGCAGCAGCT---CACAGAGTTCCCCGAAGGGATCGGTACAAATTTCAACTTCGACCGCATAATCCTGACCATAAAACACCAGGGGTCAAGGATCTAGTATACCTCGAATCATCGCCGGGTTTCTGTGAAAAGAACCCGAGGCTGGGCATTCCCGGCACGCACGGGCGTGCCTGCAATGATACTAGCATTGGCGTCGACGGGTGCGATCTCATGTGTTGTGGCCGCGGCTACCGGACTGAGAC
+		</sequence>
+<sequence taxon="Biblis_hyperia">
+			
+			CTGCACAGTTAAGACTTGCTGGATGAGGTTGCCGAGTTTCCGCTCCGTGGGTGATGCGCTAAAAGATCGCTTCGACGGGGCGTCTCGAGTCATGATGCCCAATACGGAAATAGAAGCACCCGTGCAGAGAAACGACGCAGCGCCT---CACAGAGTTCCAAGAAGAGATCGGTACAGATTCCAGCTCCGGCCGCACAATCCTGACCACAAGACGCCCGGGGTCAAGGACCTAGTGTACCTAGAATCATCGCCAGGTTTCTGTGAAAAGAACCCGAGGCTGGGCATTCCCGGTACGCACGGTCGTGCCTGCAACGACACGAGTATCGGCGTCGACGGCTGTGACCTCATGTGCTGCGGGCGCGGCTACAGAACCGAGAC
+		</sequence>
+<sequence taxon="Batesia_hypochlora">
+			
+			CTGCACCGTAAAGACCTGCTGGATGATGCTGCCCAATTTCCGCTCCGTGGGTGATGCGTTGAAAGATCGCTTTGATGGGGCGTCGCGTGTCATGATGCCCAATACTGAACTCGAGGCATCCGTGCAGCGGAACGACGCATCGCCT---CAGAGGGTTCCAAAAAAAGATCGGTACCGATTTCAACTTCGGCCATACAATCCCGATCACAAAACACCTGGGGTCAAGGACCTAGTGTACCTAGAATCATCGCCAGGCTTCTGTGAAAAGAACCCGAGACTGGGCATTCCCGGTACACACGGACGTGCCTGCAACGATACGAGTGTCGGCGTCGACGGCTGTGACCTCATGTGTTGCGGGCGCGGTTACCGGACCGAGAC
+		</sequence>
+<sequence taxon="Asterocampa_clyton">
+			
+			CTGTACTGTAAAGACCTGTTGGATGAGGCTCCCAAGTTTTCGCTCCGTGGGTGATGCATTAAAAGATCGCTTCGATGGGGCATCGCGAGTCATGATGCCTAATACAGAAGTCGAAGCACCCGTGCAGCGTAACGACGCAGTGTCT---CACAGAGTTCCAAGAAGAGATCGGTACAGATTCCAACTACGCCCGCACAATCCCGATCATAAAACACCCGGGGTCAAGGACCTAGTGTACCTAGAATCATCGCCGGGCTTCTGTGAAAAGAACCCGAGACTGGGCATTCCCGGCACGCACGGGCGTGCCTGCATCGATACGAGTATCGGTGTAGGCGGCTGCGATCTTATGTGTTGTGGCCTCGGTTACCGCACGGAGAC
+		</sequence>
+<sequence taxon="Antirrhea_sp.">
+			
+			CTGCTCCGTGAAGACGTGCTGGATGAGGCTGCCGAGTTTTCGGTCTGTGGGCGACGCTTTGAAGGACGGCTTCGATGGGGCGTCGCGGGTCATGATGCCCAACACAGAGGTTGAAGTGCCAGTCCTGCGAAACGATGCGGCTCCT---CACAGAGTCCCGCGGCGAGACCGTTACAGATTCCAACTTCGGCCGCACAATCCTGACCACAAATCACCGGGGGTCAAGGACCTAGTATACTTAGAATCATCGCCGGGTTTCTGTGAAAAGAATCCAAGGCTGGGCATTCCCGGTACGCACGGGCGTGCCTGCAACGATACGAGTATCGGTGTCGACGGCTGCGAGCTCATGTGCTGCGGCCGCGGATACCGCACGGAGAC
+		</sequence>
+<sequence taxon="Anthocharis_midea">
+			
+			TGGAACAGTGAAGACTTGCTGGATGCGGCTGCCCAGTTTTCGTTCTGTTGGCGATGCGCTAAAAGACCGCTTTGACGGGGCATCCCGAGTGATGATGTCTAACACGGACCTCGAAACGCCAGTACAGAGGAACGACGCAGCGCCA---CACAGAGTACCGCGAAGGGATCGATACAGATTCCAATTGCGGCCGCACAACCCCGATCATAAGTCGCCGGGAACCAAAGACCTCGTGTACCTGGAATCATCACCGGGTTTCTGCGAAAAGAACCCGAGGCTGGGCATTTCCGGCACGCACGGGCGCACCTGCAACGATACGAGTATCGGAGTCGACGGCTGCGACCTCTTGTGTTGCGGACGCGGATATCGGACTGAAAC
+		</sequence>
+<sequence taxon="Actinote_stratonice">
+			
+			CTGCACAGTTAAGACCTGTTGGATGAGGTTGCCTAGTTTCCGCTCAGTGGGAGATATCTTGAAAGACCGCTTTGATGGAGCATCGCGAGTAAAGATGCCGAATACGGAGGTTGATGTACCTGTTCAAAGGAACGACGCAGCAGCC---CACCGAATTCCTCGAAAGGACCGTTACAAATTCCAACTAGGTCCATATAATCCAGAACATAAGACACCTGGATTCAAAGATTTAGTGTACCTGGATCCATCACCTGGCTTCTGCAACAAGAACACGAAGCTTGGCATTCCTGGCACTAAGGGGCGTGCCTGTAACGATACTAGCATCGGTGTTGATGGTTGCGATCTTATGTGTTGCGGTCGCGGATACCGAACTGAGAC
+		</sequence>
+<sequence taxon="Actinote_genitrix">
+			
+			CTGCACAGTTAAGACCTGTTGGATGAGGTTGCCTAGTTTCCGCTCAGTGGGAGATATCTTGAAAGACCGCTTCGATGGAGCATCGCGAGTAAAGATGCCGAATACGGAGGTTGACGTACCTGTTCAAAGGAACGACGCAGCAGCC---CACCGAATCCCTCGAAAAGACCGTTACAAATTTCAACTAGGTCCATATAATCCAGAACATAAGACACCTGGATTCAAAGATTTAGTGTACCTGGATCCATCACCTGGCTTCTGCAACAAGAACACGAAGCTTGGCATTCCTGGTACTAAGGGGCGCGCCTGTAACGATACTAGCATCGGTGTTGATGGTTGTGATCTAATGTGTTGCGGTCGCGGATACCGAACTGAGAC
+		</sequence>
+<sequence taxon="Acraea_andromacha">
+			
+			CTGTACAGTAAAGACATGTTGGATGAGGCTGCCTAGTTTCCGTTCTGTGGGAGACGCTTTGAAAGATCGCTTCGATGGAGCATCTCGAGTAATGATGCCGAACACGGAAGTTGAAGTACCTGTACAAAGGAACGACGCGGCAGCC---CACCGAGTTCCTCGGAGGGATCGCTATAAATTCCAACTAAGGCCACATAATCCAGATCACAAAACACCTGGACTCAAAGATTTAGTGTATCTAGAACCATCACCAGGCTTCTGCGAGAAGAACCCGAGGCTTGGCATTCCCGGAACACACGGGCGTGCCTGCAACGATACTAGCATCGGAGTCGATGGTTGCGATCTCATGTGCTGTGGCCGTAGGTACCGGACTGAGAC
+		</sequence>
+</data>
+    <!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+    <input spec='HKY' id='hky'>
+        <kappa idref='hky.kappa'/>
+        <frequencies id='freqs' spec='Frequencies'>
+            <data idref='alignment'/>
+        </frequencies>
+    </input>
+
+    <!-- site model                                                              -->
+    <input spec='SiteModel' id="siteModel" gammaCategoryCount='1'>
+        <!--
+            <parameter name='shape' id='shape' value='0.5'/>
+            <parameter name='proportionInvariant' id='propInvar' value='0.2'/>
+        -->
+        <substModel idref='hky'/>
+    </input>
+
+    <input spec='TreeLikelihood' id="treeLikelihood">
+        <data idref="alignment"/>
+        <tree idref="tree"/>
+        <siteModel idref="siteModel"/>
+    </input>
+
+    <parameter id="hky.kappa" value="1.0" lower="0.0"/>
+
+    <tree id='tree'/>
+
+    <tree spec='beast.util.ClusterTree' id='upgmatree' clusterType='upgma' initial='@tree'>
+        <taxa idref='alignment'/>
+    </tree>
+    <tree spec='beast.evolution.tree.RandomTree' id='coalescentSimulator' initial='@tree' taxa='@alignment'>
+        <populationModel spec='ConstantPopulation'>
+            <popSize spec='parameter.RealParameter' value='1'/>
+        </populationModel>
+    </tree>
+
+
+    <run spec="MCMC" id="mcmc" chainLength="5000000" preBurnin="0">
+
+        <init idref='coalescentSimulator'/>
+        <distribution spec='CompoundDistribution' id='posterior'>
+<!--
+	make it comparable to the files in the BEAST 1 directory, that do not use a prior either
+            <distribution spec='beast.math.distributions.Prior' x='@hky.kappa'>
+                <distr spec='beast.math.distributions.OneOnX'/>
+            </distribution>
+-->
+            <distribution id='likelihood' idref="treeLikelihood"/>
+        </distribution>
+
+        <operator id='kappaScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" parameter="@hky.kappa"/>
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" tree="@tree"/>
+
+        <operator spec='SubtreeSlide' weight="5" gaussian="true" size="1.0" tree="@tree"/>
+
+        <operator spec='Uniform' weight="10" tree="@tree"/>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="1" tree="@tree"/>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="1" tree="@tree"/>
+        <operator spec='WilsonBalding' weight="1" tree="@tree"/>
+
+        <logger logEvery="10000" fileName="test.log">
+            <model idref='likelihood'/>
+            <log idref="likelihood"/>
+            <log idref='hky.kappa'/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+        </logger>
+        <logger logEvery="10000" fileName="test.trees">
+            <log idref="tree"/>
+        </logger>
+        <logger logEvery="10000">
+            <model idref='likelihood'/>
+            <log idref="likelihood"/>
+            <ESS spec='ESS' name='log' arg="@likelihood"/>
+            <log idref='hky.kappa'/>
+            <ESS spec='ESS' name='log' arg="@hky.kappa"/>
+        </logger>
+    </run>
+</beast>
+
diff --git a/examples/benchmark/II/testHKY501.xml b/examples/benchmark/II/testHKY501.xml
new file mode 100644
index 0000000..717a2aa
--- /dev/null
+++ b/examples/benchmark/II/testHKY501.xml
@@ -0,0 +1,199 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beast xmlns="http://www.w3.org/TR/xhtml1/strict" version="2.0" namespace="beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood">
+<data dataType="nucleotide" id="alignment">
+<sequence taxon="Xenopus_laevis">
+			
+			AAAGATTAAGCCATGCA-CGTGTA-AGTACGC--ACG--------GCCGGT-AC-----------AG-T-G-AAACTGCGAA-TGGCTCATTAAAT-CAGTTAT--GGTTCCTTTGATCG-CTCC----------------ATCT-GT-TACTTGG-ATAACTGTGGTAAT-TCTAGAGCTAATACATGCCG----ACGA-GCGCTG-ACCC----CCA-------GGGA--TGCGT-GCATTTATCAGACCA----AAACC-AATCCGGGGC-------------CCCCGC----------------------------------GCCCCGG----CCG-CTTT-GGT-GA-CTCTAGATAACCTCGG-G--CCGA-T-CGCA--CGTC--CCCGT-GACGGCG-ACG-ATACATTC--GGATGTCTG-CCCTATC-AACTTTC-GATGGTACTTT--CTGCGCCTACCATGGT-GACCACGGGTAAC [...]
+		</sequence>
+<sequence taxon="Tenebrio_molitor">
+			
+			AAAGATTAAGCCATGCA-TGTCTC-AGTACAA--GCC---------GAATT-AA-----------GG-T-G-AAACCGCGAA-AGGCTCATTAAAT-CAGTTAT--GGTTCCTTAGATCG-TACC----------------CACA-TT-TACTTGG-ATAACTGTGGTAAT-TCTAGAGCTAATACATGCAA---ACAGA-GCTCCA-ACCG---GAAA-------CGGA-AGGAGC-GCTTTTATTAGATCA----AAACC-AATCGGTGGCGG--------------TCT--------------------------------CCGTCATCG--T-ACA-ACTT-GGT-GA-CTCTGAATAACTTTAC-G--CTGA-T-CGCA--CGGT--CTTGC-ACCGGCG-ACG-CATCTTTC--AAATGTCTG-CCTTATC-AACTGTC-GATGGTAGGTT--CTGCGCCTACCATGGT-TGTAACGGGTAAC [...]
+		</sequence>
+<sequence taxon="Strongylocentrotus_purpuratus">
+			
+			AAAGATTAAGCCATGCA-TGTGTT-AGTACAA--GCT---------TGTAT--CA----------AG-C-G-AAACTGCGGA-TGGCTCATTAAAT-CAGTCAT--GGTTCCTTGGAACG-AGTT------------------GC-CC-TACATGG-ATAACTGTGGTAAT-TCTAGAGCTAATACATGCTA----CCAA-GCGCCG-ACC----TCTT--------GGA-AGGCGT-GCTTTTATTAGGAACAA--AGACC-AAGC---------------------CTAG-------------------------------------CCCG--C-TTT-CGTT-GGT-GAACTCTGGATAACTTAG-----CAGA-T-CGCA--CGGT-CATCGC-ACCGGCG-ACAGAAACCATC--AAACGTCTG-CCCTATC-AACTTTC-GATGGTACGTT--ATGCGCCTACCATGGT-CGTAACGGGTAAC [...]
+		</sequence>
+<sequence taxon="Scypha_ciliata">
+			
+			AAAGATTAAGCCATGCA-TGTCTA-AGTATAA--GCG-------TTCTTAT-AC-----------TG-T-G-AAACTGCGAA-TGGCTCATTAAAT-CAGTTAT--AGTTTATTTGATGT-TGAC------------------TT-AC-TACTTGG-ATAACCGTGGTAAT-TCTAGAGCTAATACATGCGT----TAAA-GTCCTG-ACC---TCTCGG-------GGA-AGGGAT-GTATTTATTAGATCCA---AAACC-GATGCAGTC----------------GAAA-------------------------------------GGCTGG--TT---ATT-GGT-GA-TTCATGATAACTGAA-----CGG?-T-CGCA--TGGT--CTTGC-GCCGGCG-ATG-ACTCATAC--AAATATCTG-CCCTATC-AACTTTC-GATGGTAAGGT--AGTGGCTTACCATGGT-TGCAACGGGTAAC [...]
+		</sequence>
+<sequence taxon="Saccoglossus_kowalevskii">
+			
+			AAAGATTAAGCCATGCA-TGTCTA-AGTA-CGA-GCC---------TCGGT-ACAC---------GG-T-G-AAACTGCGAA-TGGCTCATTAAAT-CAGTTAT--GGTTCCTTTGATCG-TTAC------------------CC-CT-TACTTGG-ATAACTGTGGCAAT-TCTAGAGCTAATACATGCCT--ACCTCG-GCGCTG-ACC---TCGCG--------GGA--TGC-T-GCTTTTATTAGGACCA---AGACC-GACCCGGTGTCCTGCCTCCT-----TCGC--------------------------GGGTGGTGGGCCCGG----TCC-TCCT-GGC-GAACTCTGGATAACTTGG-----CGGA-T-CG-A--CGGC-CTCTGC-G--GGCG-ACG--AACTTTC--GAGTGTCTG-CCCTATC-AACTTTC-GACGGTACGTT--ATGCGCCTACCGTGGT-GGCAACGGGTAAC [...]
+		</sequence>
+<sequence taxon="Saccharomyces_cerevisiae">
+			
+			AAAGATTAAGCCATGCA-TGTCTA-AGTA-TAA-GCA--------ATTTAT-AC-----------AG-T-G-AAACTGCGAA-TGGCTCATTAAAT-CAGTTAT--CGTTTATTTGATAG-TTCC-----------------TTT-AC-TACATGGTATAACCGTGGTAAT-TCTAGAGCTAATACATGCTT-----AAA-ATCTCG-ACC----CTTT--------GGA-AGAGAT-GTATTTATTAGATAAA---AAATC-AATGTC-------------------TTC----------------------------------------GGAC---T--CTTT-GAT-GA-TTCATAATAACTTTT-----CGAA-T-CGCA--TGGC--CTTGT-GCTGGCG-ATG-GTTCATTC--AAATTTCTG-CCCTATC-AACTTTC-GATGGTAGGAT--AGTGGCCTACCATGGT-TTCAACGGGTAAC [...]
+		</sequence>
+<sequence taxon="Priapulus_caudatus">
+			
+			AAAGATTAAGCCATGCA-TGTCTA-AGTA-CAG-ACG---------GATAC-AA-----------AG-T-G-AAACCGCGAA-TGGCTCATTAAAT-CAGTTAT--GGTTCCTTAGATCT-TACT------------------AT-CC-TACTTGG-ATAACTGTGGTAAT-TCTAGAGCTAATACATGCAA----TCAG-GCTCCG-ACC----TTACG-------GGA--CGAGC-GCTTTTATTAGACCA-----AACC-AATCGGGT-----------------TTCG------------------------------------GCCCG---TTC--TTTT-GGT-GA-CTCTGGATAACCTTGC-G--CTGA-T-CGCA--CGGT--CTCGC-ACCGGCG-ACG-TATCTTTC--AAATGTCTG-CCTTATC-AACTTTC-GATGGTAGATT--ATGTGCCTACCATGGT-CGTAACGGGTAAC [...]
+		</sequence>
+<sequence taxon="Placopecten_magellanicus">
+			
+			AAAGATTAAGCCATGCA-TGTCTA-AGTACAT--ACT---------TTTTG-AT-----------GG-T-G-AAACCGCGAA-TGGCTCATTAAAT-CAGTTAT--GGTTCCTTAGATCG-TACG------------------AT-CC-TACTTGG-ATAACTGTGGCAAT-TCTAGAGCTAATACATGCAA----AAAG-GCACCG-ACT-----CAC--------GGA--GGTGC-GATTTTATCAGTCCA----AAACC-AATCGGTC-----------------GCAA------------------------------------GGCCG---TCA--CTCT-GGT-GA-ATCTGGATAACTTTGT-G--CTGA-T-CGCA--CGGC-CCTAGT-GCCGGCG-ACG-TATCTTTC--AAATGTCTG-ACCTATC-AACTTTC-GATGGTACGTG--CTATGCCTACCATGGT-TGTAACGGGTAAC [...]
+		</sequence>
+<sequence taxon="Pellioditis_typica">
+			
+			?????????????????-??????--?????---?--------------??-??--------------??G-AAACTGCGAA-CGGCTCATTAGAG-C--TTAT-ACTAAGCTAGCA-CC-----------------------TG-CC-TTTTAGG-ATATCTTCGACAAA-T-TGAAGCTAATACATGCAA----CCAT-GGCTCC--T------TCG---------G---GGGTC-GCA-ATATTAGAAC------TACC-AGT----------------------------------------------------------------TTA---CTG--GATA-GTT-GA-CTTTAATTATCGTAGA-AA-TCGG-C-AGCG--TGAG--CTC--------CG-ATG-GGTGCAAG--TTATGTACG-CCCTATC-ACCCA---GCAGGCTGTTT--AACCGACAGCCAGGGG-TATAACGGGTAAC [...]
+		</sequence>
+<sequence taxon="Opisthorchis_viverrini">
+			
+			AGAGATTAAGCCATGCA-TGTCTA-AGTACAA--ACC---------TTCAA-AC-----------GG-T-G-AAACCGCGAA-TGGCTCATTAAAT-CAGCTAT--GGTTCCTTGGATCG-TACA-------------------T-AC-TACATGG-ATAACTGTATTAAT-TCTAGAGCTAATACATGCCA----CTAT-GCCCTG-ACCC---GCAA-------GGGA-ACGGGT-GGATTTATTAGAACA----GAACC-AACCGGCGGTGAC------------TTCGGTT----------------------------GCCGTCGTTGCA-TTC---TGT-GAT-GA-CTCTGGATAACTTTA-----CTGA-T-CGCAGTCGGC--CTTGT-GTCGGCG-ACG-G-TCTTTC--AAATGTCTG-CCCTATC-AATTTTC-GATGGTAGGTG--ACCTGCCTACCATGGT-GATAACGGGTAAC [...]
+		</sequence>
+<sequence taxon="Nematodirus_battus">
+			
+			AAAGATTAAGCCATGCA-TGTCG--AGTT-CA--TCT-----------TTG-AG-----------A----G-AAACTGCGAA-CGGCTCATTAGAG-CAGATGT--CATTTATTCGGAAA-----------------------AT-CC-TTTTTGG-ATAACTGCGGCAAT-TCTGGAGCTAATACATGCGT----TTAG-GCCCTG-AC-----TTTT---------GA-AAGGGT-GCAATTATTAGAGCA-----AATC-AATCTCC------------------TTCG-------------------------------------GGTG----CT--GTTT-GCT-GA-CTCTGAATAATGCAG-----CATA-T-CGG---CGG---CTTGA--CCGCTG-ATA-ATCCGAAA--AAGTGTCTG-CCCTATC-AACCT---GATGGTAGTCT--ATTAGTCTACCATGGT-TATTACGGGTAAC [...]
+		</sequence>
+<sequence taxon="Mnemiopsis_leidyi">
+			
+			AAAGATTAAGCCATGCA-TGTCTA-AGTA-TAA-ACT---------TTTAT-AC-----------TG-T-G-AAACTGCGAA-TGGCTCATTA?AT-CAGTTAT--CGTCTATTTGATTG-TGCC-----------------CTT-AC-TACATGG-ATAACCGTAGTAAT-TCTAGAGCTAATACATGCGA-----AAA-GTCCCG-ACT-----TCT--------GGA-AGGGAT-GTATTTATTAGATTAA---AAACC-AATGCGTT-----------------TAAC-------------------------------------GACGC---TT---TTC-GGT-GA-TTCATAATAACTGTT-----?GAA-T-CGCA--TGGC-CCTCGT-GCCGGCG-ATG-TTTCATTC--GAGTTTCTG-CCCTATC-AACTTTC-GATGGTAAGGT--ATTGGCTTACCATGGT-GACAACGGGTAAC [...]
+		</sequence>
+<sequence taxon="Limicolaria_kambeul">
+			
+			AAAGATTAAGCCATGCA-TGTCTA-AGTT-CAC-ACT---------GTCTC-AC-----------GG-T-G-AAACCGCGAA-TGGCTCATTAAAT-CAGTCGA--GGTTCCTTAGATGA-CACG------------------AT-CC-TACTTGG-ATAACTGTGGCAAT-TCTAGAGCTAATACATGCTT---ACCAA-GCTCCG-ACC----CTCGC-------GGA-AAGAGC-GCTTTTATTAGTTCA----AAACC-AATCGTCGTTGCCC----------TTCAGC------------------------------GGGCGCGGCGT--CC---AACT-GGT-GA-CTCTGGATAACTTTGT-G--CTGA-T-CGCA--TGGCCTTCTGT-GCCGGCG-ACG-CATCTTTC--AAATGTCTG-CCCTATC-AAATGTC-GATGGTACGTG--ACATGCCTACCATGTT-TGTAACGGGTAAC [...]
+		</sequence>
+<sequence taxon="Lepidodermella_squamata">
+			
+			AAAGATTAAGCCATGCA-TGTCTA-AGTA-CAC-ACT---------ACGGC-AA-----------AG-T-G-AAACTGCGAA-CGGCTCATTAAAT-CAGTTAT--GGTTTATTAGATCG-TGC-------------------CT-AT-CACGTGG-ATAACTGTGGTAAT-TCTAGAGCTAATACATGCAA-----CTA-GCCCTG-ACT-----TAC--------GGA--GGGGC-GCTTTTATTAGATCA----AAATC-AATCGGC------------------TTCG-------------------------------------GCCG---TTT--TTGT-GAT-GA-CTCTGGATAACTTT-T-G--CCGA-C-CGCA--TGGC--CTTGG-CCTGGCG-GCG-TATCTTTC--AAATGTCTG-CCCTATC-AACTTTC-GATGGTAGGTG--ACATGCCTACCATGGT-TGTAACGGGTAAC [...]
+		</sequence>
+<sequence taxon="Lanice_conchilega">
+			
+			TAAGATTAAGCCATGCA-TGTCTA-AGTA-CGA-ACT---------CTAAGCAC-----------AG-T-G-AAACCGCGAA-TGGCTCATTAAAC-CAGTTAA--TATTTCTTAGATCG-TCCG------------------AT-CC-TACTTGG-ATAACTGTGGTAAT-TCTAGAGCTAATACATGCAA----CAAA-GCCCCG-A?C?---C?CGT------CGGG-AGGGGC-GCTTTTATTAGATCA----AAACC-AGACGG??G----------------TTCGC----------------------------------CTCTGGT--CGG--CTTT-GGT-GA-CTCTGAGTAACTTATT-G--CGGA-T-CGCA--TGGC--CTCGT-GCCGGCG-ACG-TATCTTTG--AAGTGTCTG-CCCTATC-AACTATC-GTATGTGAGCG--CCTTGCCCACATAGGT-TATAACGGGTAAC [...]
+		</sequence>
+<sequence taxon="Homo_sapiens">
+			
+			AAAGATTAAGCCATGCA-TGTCTA-AGTACGC--ACG--------GCCGGT-AC-----------AG-T-G-AAACTGCGAA-TGGCTCATTAAAT-CAGTTAT--GGTTCCTTTGGTCG-CTCGCT-------------CCTCT-CC-CACTTGG-ATAACTGTGGTAAT-TCTAGAGCTAATACATGCCG----ACGG-GCGCTG-ACCCCC-TTCGC--GGGGGGGA--TGCGT-GCATTTATCAGATCA----AAACC-AACCCGGTCAGCCCCTCTCCGGC--CCCG----------------------GCCGGGGGGCGGGCGCCGG----CGG-CTTT-GGT-GA-CTCTAGATAACCTCGG-G--CCGA-T-CGCA--CGCC-CCCCGT-GGCGGCG-ACG-ACCCATTC--GAACGTCTG-CCCTATC-AACTTTC-GATGGTAGTCG--CCGTGCCTACCATGGT-GACCACGGGTGAC [...]
+		</sequence>
+<sequence taxon="Haemonchus_placei">
+			
+			AAAGATTAAGCCATGCA-TGTCG--AGTT-CA--TCT-----------TTG-A------------AG-A-G-AAACTGCGAA-CGGCTCATTAGAG-CAGATGT--CATTTATTCGGAAC-GT-----------------------CC--TTTTGG-ATAACTGCGGTAAT-TCTGGAGCTAATACATGCAA----ATAA-ACCCTG-AC-----TTTT---------GA-AAGGGT-GCAATTATTAGAGCA-----AATC-AATCACT------------------TTCG-------------------------------------GGTG----CA--GTTT-GCT-GA-CTCTGAATAACGCAG-----CATA-T-CGG---CGG---CTTGT--TCGCCG-ATA-TTCCGAAA--AAGTGTCTG-CCCTATC-AACCT---GATGGTAGTCT--ATTAGTCTACCATGGT-TATTACGGGTAAC [...]
+		</sequence>
+<sequence taxon="Eurypelma_californica">
+			
+			AAAGATTAAGCCATGCA-TGTCTA-AGTACAT--GCC---------TCCTT-AA-----------GG-C-G-AAACCGCGAA-TGGCTCATTAAAT-CAGTTAT--GGTTCCTTAGATCG-TACC------------------TT-AC-TACTTGG-ATAACTGTGGTAAT-TCTAGAGCTAATACATGCAT----CAGA-GCTCCG-ACCC----TCTG------GGGA--CGAGC-GCTTTTATTAGACCA----AAACC-AATCGGA-----------------CTCGT-------------------------------------TCCGT---ATC-CCAT-GGT-GA-CTCTGTATAACTTTGG-G--CTGA-T-CGCA--CGGG--CTTGT-CCCGGCG-ACG-CATCTTTC--AAGTGTCTG-CCTTATC-AACTGTC-GATGGTAGGCTT-ATGCGCCTACCATGGT-C-TAACGGGTAAC [...]
+		</sequence>
+<sequence taxon="Eisenia_foetida">
+			
+			AAAGATTAAGCCATGCA-TGTCTA-AGCA-CAA-ACC---------TTTAC-AC-----------GG-T-G-AAGCTGCGAA-TGGCTCATTAGGC-CACCCAT--GATTTCTTAGATCG-TACA------------------AT-CC-TACTTGG-ATAACTGCGGTAAT-TCTGGAGCTAATACATGCCA----CAAA-GCTCCG-ACCC---TTATG-------GGA-AAGAGC-GCGTTTATTAGGTCA----AAACC-AATCGGGTC----------------CTCGC----------------------------------GGCCCGT--AA---CTCT-GAT-GA-CTCTGGATAACTTCGA-G--CTGA-T-CGCA--TGGC--CTCGT-GCCGGCG-ACG-TATCTTTC--AAGTGTGTG-CCCTATC-AACTTTC-GATGGTACGTG--ATATGCCTACCATGGT-AGTAACGGGTAAC [...]
+		</sequence>
+<sequence taxon="Caenorhabditis_elegans">
+			
+			AAAGATTAAGCCATGCA-TGCTTT---GATT----CA------------TC-AA--------------T-G-AAATT-GCGTACGGCTCATTAGAG-CAGATAT--CACCTTATCCGGG--ATCC-----------------GGATCCTCATATGG-ATAACTGCGGAAAT-ACTGGAGCTAATACATGCAA-----CTA-TACCCC-AAC-----GCAAG-------G--CGGGGT-GCAATTATTAGAACA-----GACC-AAACGTT------------------TTCG--------------------------------------GACG----TT-GTTT-GTT-GA-CTCTGAATAAAGCAG-----TTTA-C-TGT---CAGT---TTCG-ACTGACT-CTA-TCCGGAAA--GGGTGTCTG-CCCTTTC-AACTA---GATGGTAGTTT--ATTGGACTACCATGGT-TGTTACGGGTAAC [...]
+		</sequence>
+<sequence taxon="Artemia_salina">
+			
+			AAAGATTAAGCCATGCA-TGTCTA-AGTACAA--GCC---------CCCAG-TG-----------GG-C-G-AAACCGCGAA-TGGCTCAATAAAT-CAGTTAT--GGTTCCTTAGATCG-TACT----------------ATAT-CC-TACTTGG-ATAACTGTGGTAAT-TCTAGAGCTAATACATGCAC----AATA-GCCCCA-ACT----TCAC--------GGA-AGGGGT-GCTTTTATTAGATCA----AGACC-AATCGGG----------------GCTTCGG------------------------------------CTCG-----TC-TCTT-GGT-GA-CTCTGAATAACTATAG----CCGA-T-CGCA--CGGT--CTCGC-ACCGGCG-ACG-TGTCTTTC--AAATGTCTG-CCTTATC-AACTTTC-GATGGTAGGCT--ATGCGCCTACCATGGT-TGCAACGGGTAAC [...]
+		</sequence>
+<sequence taxon="Anthopleura_kurogane">
+			
+			AAAGATTAAGCCATGCA-TGTCTA-AGTATAA--GCA---------CTTGT-AC-----------TG-T-G-AAACTGCGAA-TGGCTCATTAAAT-CAGTTAT--CGTTTATTTGATTG-TACG-----------------TTT-AC-TACTTGG-ATAACCGTGGTAAT-TCTAGAGCTAATACATGCGA-----AAA-GTCCCG-ACT-----TCT--------GGA-AGGGAT-GTATTTATTAGATTCA---AAACC-AATGCGGGT----------------TCC-------------------------------------GCCCGG---TG--TGTT-GGT-GA-TTCATAGTAACTGTT-----CGAA-T-CGCA--GGGC--CTTGGCGCTGGCGGATG-TTTCATTC--AAATTTCTG-CCCTATC-AACTGTC-GATGGTAAGGT--ATTGGCTTACCATGGT-TACAACGGGTGAC [...]
+		</sequence>
+<sequence taxon="Anemonia_sulcata">
+			
+			AAAGATTAAGCCATGCA-TGTCTA-AGTATAA--GCA---------CTTGT-AC-----------TG-T-G-AAACTGCGAA-TGGCTCATTAAAT-CAGTTAT--CGTTTATTTGATTG-TACG-----------------TTT-AC-TACTTGG-ATAACCGTGGTAAT-TCTAGAGCTAATACATGCGA-----AGA-GTCCCG-ACT-----TCT--------GGA-AGGGAT-GTATTTATTAGATTCA---AAACC-AATGCGGGT----------------TCT-------------------------------------GCCCGG---TG--CTTT-GGT-GA-TTCATAGTAACTGAT-----CGAA-T-CGCA--TGGC--CTTGC-GCTGGCG-ATG-TTTCATTC--AAATTTCTG-CCCTATC-AACTGTC-GATGGTAAGGT--GTTGGCTTACCATGGT-TACAACGGGTGAC [...]
+		</sequence>
+<sequence taxon="Acanthopleura_japonica">
+			
+			AAAGATTAAGCCATGCA-TGTCTA-AGTACAG--ACT---------TTCAC-AT-----------AG-T-G-AAACCGCAAA-TGGCTCATTAAAT-CAGTTAT--GATTTCTTAGATCG-TACA------------------CT-CC-TACTTGG-ATAACTGTGGTAAT-TCTAGAGCTAATACATGACG----TTCA-GCTCCG-ACCTT---TTTGC----AGGGA--AGAGC-GCTTTTATTAGATCA----AGATC-AATCGGGC-----------------CTCG------------------------------------GCCCGT--CC---TGTT-GGT-GA-TTCTGAATAACTTTGT-G--CTGA-T-CGCA--TGGC--CACGC-GCCGGCG-ACG-TATCTTTC--AAGTGTCTG-CCCTATC-AACTTTC-GATGGTACGTG--ATATGCCTACCATGGT-TGTAACGGGTAAC [...]
+		</sequence>
+<sequence taxon="Moniliformis_moniliformis">
+			
+			AAAGATTAAGCCATGCA-TGCGTA-AGTACAT--ACT----------TTTT-ATG----------GT-G-T-AAACCGCGAA-TGGCTCATTACAT-CAGTTGT--GGTTCATTAGATCA-TATG---------------------TT-TAAATGG-ATAACTGTGGCAAA-TCTAGAGCTAATACATGTTT----ACAA-GCTCCG-ACT-----TCT--------GGA-AAGAGC-GCTTTTGTTAGATCA-----AACC-AATGATTTC----------------ATCC-----------------------------------GAAATCA--CT---TAAT-GCT-GA-GTCTGAATAAATTTG-----CAGA-T-TGCA-GCGGT-CTTCGT-ACCGGCG-ACG-TATCTTTC--AAGTGTCTG-CCCTATC-AACTGGC-GATGGTAGTTT--ATGTGCCTACCATGGT-TGTAACGGGTAAC [...]
+		</sequence>
+<sequence taxon="Centrorhynchus_conspectus">
+			
+			------------ATGCA-TGCGTA-AGTGAAT--ACT----------AGCA-AC-----------GG-T-GAAAACCGCGAA-TGGCTCATTAAAT-CAGTTGC--ATTTTACGGTAACT-TGCAG-----------------------TTCGTGG-ATAACTGTGGAAAA-CCTAGAGCTAATACATGCAC-----AAA-GTCCTG-ACT-----TC---------GGC-AGGGAC-GCATTTATCAGATCA----AAGCC-AACTTTTCC---------------GGT-------------------------------------GAACAGCCGGT---TAAT-GAT-GA-CTCTGGGTAATTATT-----TTGA-T-CGCA-TTGCT-ACGTGA-ACAGGCG-ACG-GTGACTTC--AAACGCCTG-ACCTATC-AACTTGT-GTTGGCAGTTG--ATGTTACTACCCCGGT-TGTTACGGGTGAC [...]
+		</sequence>
+<sequence taxon="Neoechinorhynchus_pseudemydis">
+			
+			------------ATGCA-TGCGTA-AGTGCAT--ACT----------TTAT-AT-----------GG-T-TAAAACCGCGAA-TGGCTCATTAAAT-AAGTCTT--GGTTTATTAGATCA-TGCGG--------------------AT-CATATGG-ATAACTGTGGAAAA-TCTAGAGCTAATACATGCCA-----CGA-ATGCTT-CGT-----CTT--------ACGAAGAAGT-GCTTTTATTAGATCA----AAGCC-AATGACTTC---------------CTTC------------------------------------GGGT?GTCAAACG-TTGT-GCT-GA-TTCTGAGTAAAGTAA--G--CTGA-T-TGCA-TTGCC-GTTTAG-GCAGGCG-ACG-TGTCTTTC--AAGTGTCTT-ACCTATC-AACTATC-GTTGGTAGTTG--ATATGACTACCATGGT-AATAACGGGTAAC [...]
+		</sequence>
+<sequence taxon="Philodina_acuticornis">
+			
+			????????????ATGCA-TGTCTA-AGTATGA--ACT---------GGTTT-AA-----------GG-T-G-AAACTGCGTA-CGGCTCATTACAT-CAGCTATA-ACTTTCTTTGATCA-TAA-------------------AT-TC-TAAATGGAATAACCGAGGAAAA-GCCTGGGCTAATACATGCG------AAA-ATTCCG-GTA-----GCA--------ATATCGGAAT-GCTTTTATTAGATCA----AAACC-TTCTAGTTCT-------------TTAACC-----------------------------------GGAACTG--TT---TGTT-GGT-GA-CTCTAAATAACTTTGT-G--TTGA-T-CGTA--TGAC-CTTTGT-GTCGACG-ACA-TATCTTTC--AAGTGTCTG-ACTTATC-AACTTTA-GACGGTACATT--ATATGTCTACCGTGGT-TGTAACGAGTA-C [...]
+		</sequence>
+<sequence taxon="Brachionus_plicatilis">
+			
+			????????????ATGCA-TGTCTA-AGTA-CAT-ACC---------TTAGC-AC-----------GG-T-G-AAACCGCGAA-TGGCTCATTAAAT-CAGTTAT--GGTTCCTTAGATCG-TTC-------------------AT-AC-TACATGG-ATAACTGTGGTAAT-TCTAGAGCTAATACATGCAA-----AAA-GCTCCG-ACC-----GTATG------GGA--AGAGC-GCTTTTATTAGACCA----AAACC-AATGGGGTC-----------------GCAA----------------------------------GATCCC---TTT--GTAT-GGT-GA-CTCTGGATAACTTTGT-G--CTGA-T-CGCA--TGGC--CTAGA-GCCGGCG-ACG-TATCTTTC--AAGTGTCTG-CCCTATC-AACTTTC-GATGGTAAGCG--ATTTGCCTACCATGGT-TGTAACGGGTAAC [...]
+		</sequence>
+</data>
+    <!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+    <input spec='HKY' id='hky'>
+        <kappa idref='hky.kappa'/>
+        <frequencies id='freqs' spec='Frequencies'>
+            <data idref='alignment'/>
+        </frequencies>
+    </input>
+
+    <!-- site model                                                              -->
+    <input spec='SiteModel' id="siteModel" gammaCategoryCount='1'>
+        <!--
+            <parameter name='shape' id='shape' value='0.5'/>
+            <parameter name='proportionInvariant' id='propInvar' value='0.2'/>
+        -->
+        <substModel idref='hky'/>
+    </input>
+
+    <input spec='TreeLikelihood' id="treeLikelihood">
+        <data idref="alignment"/>
+        <tree idref="tree"/>
+        <siteModel idref="siteModel"/>
+    </input>
+
+    <parameter id="hky.kappa" value="1.0" lower="0.0"/>
+
+    <tree id='tree'/>
+
+    <tree spec='beast.util.ClusterTree' id='upgmatree' clusterType='upgma' initial='@tree'>
+        <taxa idref='alignment'/>
+    </tree>
+    <tree spec='beast.evolution.tree.RandomTree' id='coalescentSimulator' initial='@tree' taxa='@alignment'>
+        <populationModel spec='ConstantPopulation'>
+            <popSize spec='parameter.RealParameter' value='1'/>
+        </populationModel>
+    </tree>
+
+
+    <run spec="MCMC" id="mcmc" chainLength="5000000" preBurnin="0">
+
+        <init idref='coalescentSimulator'/>
+        <distribution spec='CompoundDistribution' id='posterior'>
+<!--
+	make it comparable to the files in the BEAST 1 directory, that do not use a prior either
+            <distribution spec='beast.math.distributions.Prior' x='@hky.kappa'>
+                <distr spec='beast.math.distributions.OneOnX'/>
+            </distribution>
+-->
+            <distribution id='likelihood' idref="treeLikelihood"/>
+        </distribution>
+
+        <operator id='kappaScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" parameter="@hky.kappa"/>
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" tree="@tree"/>
+
+        <operator spec='SubtreeSlide' weight="5" gaussian="true" size="1.0" tree="@tree"/>
+
+        <operator spec='Uniform' weight="10" tree="@tree"/>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="1" tree="@tree"/>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="1" tree="@tree"/>
+        <operator spec='WilsonBalding' weight="1" tree="@tree"/>
+
+        <logger logEvery="10000" fileName="test.log">
+            <model idref='likelihood'/>
+            <log idref="likelihood"/>
+            <log idref='hky.kappa'/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+        </logger>
+        <logger logEvery="10000" fileName="test.trees">
+            <log idref="tree"/>
+        </logger>
+        <logger logEvery="10000">
+            <model idref='likelihood'/>
+            <log idref="likelihood"/>
+            <ESS spec='ESS' name='log' arg="@likelihood"/>
+            <log idref='hky.kappa'/>
+            <ESS spec='ESS' name='log' arg="@hky.kappa"/>
+        </logger>
+    </run>
+</beast>
+
diff --git a/examples/benchmark/II/testHKY520.xml b/examples/benchmark/II/testHKY520.xml
new file mode 100644
index 0000000..db96178
--- /dev/null
+++ b/examples/benchmark/II/testHKY520.xml
@@ -0,0 +1,351 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beast xmlns="http://www.w3.org/TR/xhtml1/strict" version="2.0" namespace="beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood">
+<data dataType="nucleotide" id="alignment">
+<sequence taxon="Albertiniella_polyporicola">
+			
+			ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGCATAAGCAA--TTATACCGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-CCTACATGG-ATACCTGTGGTAATTCTAGAGCTAATACATGCGAAAAAGCCCCAACTTC--GGGAGGGGTGTGTTTATTAGATTAAAAACCAATGCCCCTCGGGGCTCCTT-GGTGATTCATAATAACTTCTCGAATCGCACGGCCTTGTGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTAGGTCTTGGCCAGCCGTGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATCG [...]
+		</sequence>
+<sequence taxon="Cryptendoxyla_hypophloia">
+			
+			???????????????????????CCATGCATGTCTAAGTATAAGCAA--TTATACGGCGAAACTGCGAATGGCTCATTAAATCAG-TAT-GTTTATTTGATAGCACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCAACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCCTCGGGGCTCCTT-GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGCGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCTGACACAGGGAGGTAGTGACAATACATACTGGTACAGGGCTCTTTTGGGTCTTGTAACCG [...]
+		</sequence>
+<sequence taxon="Cephalotheca_sulfurea">
+			
+			????????????????????????????????????????TAAGCAA--TTATACGGCGAAACTGCGAATGGCTCATTAAATCAGTTATTGTTTATTTGATAGCACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCCTCGGGGCTTTCT-GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGCGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACGTCCAAGGAAGGCAGCAGGCGCGCAAATTAACCAATCCCGACTCGGGGAGTTAGTGACAATACATACTGATACAGGGCTCTTTTGGGTCTTGTAATCG [...]
+		</sequence>
+<sequence taxon="Podospora_anserina">
+			
+			ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATATTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCAAAAAA-TCCCGACTTC--GGAAGGGATGTGTTTATTAGATTAAAAACCAATGCCCTCCGGGGCTCACT-GGTGATTCATAATAACCTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCATGGTGACAACGGGTAACGGGGAGTTAGGGCTCGACTCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Chaetomium_elatum">
+			
+			?????????????????????????ATGCATGTCTAAGTATAAGCAA--TTATACCGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCTCT-GGTGATTCATAATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTCGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Neurospora_crassa">
+			
+			ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTTTAAGCAA--TTAAACCGCGAAACTGCGAATGGCTCATTAAATCAGTTATAGTTTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTC--GGAAGGGGTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTAACT-GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Sordaria_fimicola">
+			
+			ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTTTAAGCAA--TTAAACCGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTC--GGAAGGGGTGTATTTATTAGATTAAAAACCAATGCCCTTCGGG?CTTCCT-GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Thielavia_terrestris">
+			
+			?????????????????????????ATGCATGTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCTCATTAAATCAGTTATCG?TTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCCTCGGGGCTCTCT-GGTGATTCATAATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTCACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTCGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Aporothielavia_leptoderma">
+			
+			ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCTCT-GGTGATTCATAATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGATCTTTCGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Chaetomium_globosum">
+			
+			?????????????AAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACCGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATG?CCTTCGGGGCTCTCT-GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAAT?CCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTCGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Cercophora_septentrionalis">
+			
+			???????????????????????????????????????????????????????????AAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-GCTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATG?CCTTCGGGGCTCTCT-GGTGATTCATAATAACTTCTCGAAT??CA?GGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTCGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Ophiostoma_stenoceras">
+			
+			?????????????????????????ATGCATGTCTAAGTATAAGCAA--TTATACCGCGAAACTGCGAATGGCTCATTAAACCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAA-CCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCCCT-GGTGATTCATAATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Sporothrix_schenckii">
+			
+			???????????????????????????????GTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAA-CCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCCCT-GGTGATTCATAATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Fragosphaeria_purpurea">
+			
+			???????????????????????????????????????????????????????????AAACTGCGAATGGCTCATTAAATCAGTTATCGTCTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAA-CCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCTCCGGGGCTCCCT-GGTGATTCATAATAACTGCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACGCGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Ophiostoma_ulmi">
+			
+			?????????????????????????ATGCATGTCTAAGTATAAGCAA--TTATACGGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGCCCCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAA-CCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCCTCGGGGCTCACT-GGTGATTCATGATAACTTGTCGAATCGCACGGCCTTGCGCCGGCGATGGCTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGATCTGGGCCCGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGGCCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTCGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Pidoplitchkoviella_terricola">
+			
+			???????????????????????????????????????????GCAA--TTATACAGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCAACTCA--CGAAGGGGTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCTTT-GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGCAGGGTCTTGGCCTGCCATGGTTACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTCGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Daldinia_concentrica">
+			
+			??????????????AAG-TTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACTGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGTTAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTCA--CGGAGGGGTGTATTTATTAGATTAAAAACCAATG?CCTTCGGGGCTCTTT-GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGC?GGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGCAGGGTCTTGGCCTGCCATGGTTACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Diatrype_disciformis">
+			
+			?????????????????????????????ATGTCTAAGTATAAGCAA--TTATACCGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTA--CGGAGGGATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCCTT-GGTGATTCATAATAACAACTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGCAGGGTCTTGGCCTGCCATGGTTACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTATCCAATCCCGATTCGGGGAGATAGTGACGATAAATACTGATACAGGGCTCTTTCGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Xylaria_curta">
+			
+			???????????????????????CCATGCATGTCTAAGTATAAGCAA--TTATACGGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTCA--CGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCCTCGGGGCTTTCT-GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGCAGGGTCTTGGCCTGCCATGGTTACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Hypoxylon_atroroseum">
+			
+			????????????????????????????????????????????????????????????AACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTA--CGGAGGGATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCTCT-GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGAGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGCAGGGTCTTGGCCTGCCATGGTTACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATTCCGATACGGAGAGGTAGTGACGATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Diaporthe_phaseolorum">
+			
+			?????????????????????????????????????????????????ATAAACGGCGAAACT???AATGGCTCATTAAATCAGTTATCGTATATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT-GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGC?GGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCC??GGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTCGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Leucostoma_persoonii">
+			
+			?????????????????????????ATGCAAGTCTAAGTTTAAGCAC--CTAAACGGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT-GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Cryphonectria_parasitica">
+			
+			???????????????????TAAGCCATGCAAGTCTAAGTTTAAGCAC--CTAAACGGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT-GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Microascus_trigonosporus">
+			
+			?????????????AAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACCGCGAAACTGCGAATGGCTCATTATATAAGTTATCGTTTATTTGATAGCACGTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTC--GGAAGGGGTGTATTTATTAGATTAAAAGCCAA?GCCCTTCGGGGCTCTGT-GGTGATTCATGATAACTTTTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGCGAGGGTCTTGTCCTCGCATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC?GGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTAGGGTCTTGTAATCG [...]
+		</sequence>
+<sequence taxon="Ceratocystis_fimbriata">
+			
+			????????????????????AAGCCATGCATGTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCTCATTATATAAGTTATCGTTTATTTGATAGCACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATG?CCTTCGGGGCTTTCT-GGTGATTCATGATAACTTCTCGAATCGCATGGCCTTGCGC?GGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGCGAAGGTCTTGTCTTCGCATGGTTACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAGGGAGCCTGAGAAATGGCTACCACTTTTAAGGAAGGCAGCAGGCGCGCAATTTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTATGGGTCTTGTAATCG [...]
+		</sequence>
+<sequence taxon="Bulbithecium_hyalosporum">
+			
+			????????????????????????????????????????????????????????????AACTGCGAATGGCTCATTATATAAGTTATCGTTTATTTGATAGCACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCACAAAA-TCCCGACTCA--CGAAGGGATGTATTTATTAGATACAAAACCAATGCCCTCCGGGGCTCACT-GGTGATTCATGATAACTTCGCGAATCGCACAGCCTTGCGCTGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTATTGGCCAAACATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTATTGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Leucosphaerina_indica">
+			
+			????????????????????????????????????????????????????????????AACTGCGAATGGCTCATTATATAAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTC--GGAAGGGGTGTATTTATTAGATTAAAAACCAATG-CCTTCGGGGCTCCTT-GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTATTGGCCAAACATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Nigrosabulum_globosum">
+			
+			??????????????????????????????????????????????A--TTATACAGCGAAACTGCGAATGGCTCATTATATAAGTTATCGTTTATTTGATAGCACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAG-TCCCGACTTC--GGAAGGGATGTATTTATTAGATACAAAACCAATG-CCTCCGGGGCTCAAT-GGTGATTCATGATAACTTCGCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGATATGGGCCAAACATGGTGGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTCGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTATTGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Hapsidospora_irregularis">
+			
+			??????????????????????????????????????????????A--TTATACAGCGAAACTGCGAATGGCTCATTATATAAGTTATCGTTTATTTGATAGCACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAG-TCCCGACTTC--GGAAGGGATGTATTTATTAGATACAAAACCAATG-CCTCCGGGGCTCAAT-GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTATTGGCCAAACATGGTGGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTCGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTATTGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Emericellopsis_terricola">
+			
+			?????????????????????????ATGCATGTCTAAGTATAAGCAA--TTATACGGCGAAACTGCGAATGGCTCATTATATAAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTC--GGAAGGGGTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCCTT-GGTGATTCATGATAACTTCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTATTGGCCAAACATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTCGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTAGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Cordyceps_capitata">
+			
+			?????????????????????????ATGCATGTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCTCATTATATAAGTTATCGTTTATTTGATGGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCTCTGGG-CTCTCT-GGTGATTCATGATAACTTCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTAGTGGCCAAACATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Claviceps_paspali">
+			
+			?????????????AAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCTCATTATATAAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAA-TCCCGACTCC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCCCGTGGGCTCGCT-GGTGAATCATGATAACTTCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTAGTGGCCAAACATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACCCGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Epichloe_typhina">
+			
+			???????????????????????????????????????????????????????????AAACTGCGAATGGCTCATTATATAAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCCCTGGGGCTCTCT-GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTAGTGGCCAAACATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATTCGGGGAGGTAGTGACAATAAATACCGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Hypocrea_schweinitzii">
+			
+			?????????????AAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACCGCGAAACTGCGAATGGCTCATTATATAAGTTATCGTTTATTTGATAATACTTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATCCCGCTCGGGGCTCTCT-GGTGAATCATAATAACTAGTCGAATCGACAGGCCTTGTGCCGGCGATGGCTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTATTGGCCAAACATGGTGGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATCG [...]
+		</sequence>
+<sequence taxon="Hypomyces_polyporinus">
+			
+			???????????????????????????????????????????????????????????AAACTGCGAATGGCTCATTATATAAGTTATCGTTTATTTGATAATACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTC--GGAAGGGTTGTATTTATTAGATTAAAAACCAATG-CCTCTGGG-CTCTCT-GGTGAATCATGATAACTAGTCGAATCGACAGGCCTTGTGCCGGCGATGGCTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTATTGGCCAAACATGGTGGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGAGACAATAAATACTGATACAGGGCTCTTTCGGGTCTTGTAATCG [...]
+		</sequence>
+<sequence taxon="Nectria_haematococca">
+			
+			?????????TCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCTCATTATATAAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATG?CCTCCGGGGCTCACT-GGTGATTCATGATAACTCCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTATTGGCCAAACATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTCGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Pseudeurotium_zonatum_ATCC62440">
+			
+			ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA-TCTATACAGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGATAATACATGCTAAAAA-CCTCGACTTC--GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTTCGGGGCTCCTT-GGTGATTCATGATAACTTAACGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Pseudeurotium_zonatum_CBS329_36">
+			
+			?????????????????????????????????????????????????????????????????CGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCTCGACTTC--GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTTCGGGGCTCCTT-GGTGATTCATGATAACTTAACGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Connersia_rilstonii">
+			
+			ATATGCTTGTCTCAAAGATCAAGCCATGCATGTCTAAGTATAAGCAA-TCTATACGGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTC--GGGAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTCCGGGGCTCCTT-GGTGATTCATGATAACTCGACGGATCGCATGGCCTTGTGCCGGCGATGGATCTTTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATATAGGGCTCTTTTGAGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Leuconeurospora_pulcherrima">
+			
+			ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA-TCTATACAGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTC--GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCTCTTCGGGGCTCCTT-GGTGATTCATGATAACTTAACGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Pleuroascus_nicholsonii">
+			
+			??????????????????????????????????????????????????????????GAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTC--GGAAGGGGTGTATTTATTAGATTAAAAACCAATG-CCTTCGGGGCTCCTT-GGTGATTCATGATAACTTATCGGATCGCATGGCCTTGTGCCGGCGATGGATTCTTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATATAGGGCTCTTTTGAGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Dothidea_insculpta">
+			
+			????????????????????????CATGCATGTCTAAGTATAAGCAA--CTATACGGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTC--GGAAGGGGTGTATTTATTAGATAAAAAACCAGCGCCCTTCGGGGCTCCTT-GGTGATTCATAATAACTTAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTATCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTAGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Aureobasidium_pullulans">
+			
+			ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--CTATACGGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCAACTTC--GGAAGGGGTGTATTTATTAGATAAAAAACCAACGCCCTTCGGGGCTCCTT-GGTGATTCATAATAACTAAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTATCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Blumeria_graminis">
+			
+			????????????????????????????????????????????CAA-TTTATACCGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAG-CCCCGACTTC--GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTCCGGGGCTCCTT-GGTGATTCATAATAACTTAACGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGTATATGGGACTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Sclerotinia_sclerotiorum">
+			
+			ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--CTATACTGTGAAACTGCGAAT?GCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCTCGACTTC--GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTTCGGG-CTCCCT-GGTGATTCATAATAACTTAACGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGG?ATTAGGGTTCTATTCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGAGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Cudonia_confusa">
+			
+			??????????????????????????????????TAAGTATAAGCAAA-CTATACCGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACTTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTC--GGAAGG-GTGTATTTATTAGATAAAAAACCAATGCCCTTCGG??CTCCCT-GGTGATTCATAATAACTTAACGAATCGCATGGCCTTGCGC-GGTGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCC?GACACGGGGAGGTAGTTACAATAAATACAGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Spathularia_flavida">
+			
+			???????????????????????????????GCTTAAGTATAAGCAAA-CTATACCGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACTTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTT--GGAAGGGGTGTATTTATTAGATAAAAAACCAATG?CCTTCGGGGCTCCCT-GGTGATTCATAATAACTTAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Peziza_badia">
+			
+			????????????????????????????????????????????????????????????????????????CTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTCACGGAAGGGGTGTATTTATTAGATAAAAAACCAATG-CCTTCGGGCCTCCT--GGTGATTCATGATAACTTAACGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACG-GGAGGTAGTGACAATAAATACTAATACAGGGGTTTTATGCCTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Inermisia_aggregata">
+			
+			????????????????????????????????TCTAAGTATAAGCAA-TCTATACAGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACCTCT-GGAAGGGATGTATTTATTAGATAAAAAACCAATG-CCTTCGGG-CTCCCT-GGTGATTCATGATAACTTTACGAATCGCATGGCCTTGTGC-GGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGC-CTTTCGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Morchella_esculenta">
+			
+			?????????????????????????????????????????????AA-TATATACAGTGAAACTGCGAATGGCTCATTAAAT??GTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTAA-CGGAGGGGTGTATTTATTAGATAAAAAACCAATG?CCTTCGGG-CTCCTT-GGTGATTCATGATAACTTAACGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Tuber_rapaeodorum">
+			
+			?????????????????????????ATGCATGTCTAAGTATAAGCAA-TCTATACAGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTTTGCTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACCCCT-GGAAGGGATGTATTTATTAGATAAAAAACCAATG-GCTTCGGC-CTCCCT-GGTGATTCATGATAACTTAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Onygena_equina">
+			
+			?????????TCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA-CTTGTACGGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTTTTCCACATGG-ATACCCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCTCGACTTC--GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTTCGGGGCTCCTT-GGTGATTCATAATAACTTTTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTGGCAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATCCGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTCGGGTCTTGTAATCG [...]
+		</sequence>
+<sequence taxon="Blastomyces_dermititidis">
+			
+			ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAATCTTATACGGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATACCCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCTCGACTTC--GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTTCGGGGCTCCTT-GGTGATTCATAATAACTTATCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTGGCAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTCGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Penicillium_notatum">
+			
+			ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAACTTTGTACTGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATACCTGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTCA-GGAAGGGGTGTATTTATTAGATAAAAAACCAACGCCCTTCGGGGCTCCTT-GGTGAATCATAATAACTTAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTGGCAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATACGGGGAGGTAGTGACAATAAATACTGATACGGGGCTCTTTTGGGTCTCGTAATTG [...]
+		</sequence>
+<sequence taxon="Eurotium_rubrum">
+			
+			????????????????????????CATGCATGTCTAAGTATAAGCAC-TTTATACTGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATACCTGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCTCGACTTC--GGAAGGGGTGTATTTATTAGATAAAAAACCAACGCCCTTCGGGGCTCCTT-GGTGAATCATAATAACTAAGCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTGGCAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACGGGGCTCTTTTGGGTCTCGTAATTG [...]
+		</sequence>
+<sequence taxon="Aspergillus_fumigatus">
+			
+			ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA-TTTATACGGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATACCTGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCTCGACTTC--GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTTCGGGGCTCCTT-GGTGAATCATAATAACTTAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTGGCAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACGGGGCTCTTTTGGGTCTCGTAATTG [...]
+		</sequence>
+<sequence taxon="Fonsecaea_pedrosoi">
+			
+			????????????????????????????????TCTAAGTATAGGCAC--TCATACTGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT---TACCTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCAACTTC--GGGAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTCTGGGGCTCCTT-GGTGATTCATAATAACTTAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATTGTAGGATAGAGGCCTACAATGGTCTTAACGGGTAACGGGGAATTAGGGTTCGACTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATGCTAATTCAGCGAGGTAGTGACAATAAATACTGATACGGGGCTCTTTCGGGTCTCGTAATTG [...]
+		</sequence>
+<sequence taxon="Phialophora_verrucosa">
+			
+			????????????????????????????????????????TAGGCAA--TCATACTGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT---TACCTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTA--GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTCT?GGGCTCCTT-GGTGATTCATAATAACTTAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAATTTTCGATGGTAGAGTAGTGGTCTACCATGATCTTAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATGCTAATTCAGCGAGGTAGTGACAATAAATACTGATACGGGGCTCTTTCGGGTCTCGTAATTG [...]
+		</sequence>
+<sequence taxon="Exophiala_jeanselmei">
+			
+			???????????????????????????????????????????GCAA--TCATACTGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTTCCTT---TACCTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAC??-CCCCGACTTC--GGGAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTTCGGGGCTCCTT-GGTGATTCATAATAACTTAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCACCTTTCGATTGTAAGATAGAGGCTTACAATGGGAGCAACGGGTAACGGGGAATAAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATACGGGGAGGTAGTGACAATAAATACTGATACGGGGCTCTTTCGGGTCTCGTAATTG [...]
+		</sequence>
+<sequence taxon="Candida_albicans">
+			
+			ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA-TTTATACAGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAA-TCCCGACTGTTTGGAAGGGATGTATTTATTAGATAAAAAATCAATG-CCTTCGGG-CTCTTT-GATGATTCATAATAACTTTTCGAATCGCATGGCCTTGTGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATAACGATACAGGGCCCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Saccharomyces_cereviseae">
+			
+			ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA-TTTATACAGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTTCCTTTACTACATGGTATAACTGTGGTAATTCTAGAGCTAATACATGCTTAAAA-TCTCGACCCTTTGGAAGAGATGTATTTATTAGATAAAAAATCAATG-TCTTCGGA-CTCTTT-GATGATTCATAATAACTTTTCGAATCGCATGGCCTTGTGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCTAATTCAGGGAGGTAGTGACAATAAATAACGATACAGGGCCCATTCGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Candida_tropicalis">
+			
+			ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA-TTTATACAGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAA-TCCCGACTGTTTGGAAGGGATGTATTTATTAGATAAAAAATCAATG-TCTTCGGA-CTCTTT-GATGATTCATAATAACTTTTCGAATCGCATGGCCTTGTGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATAACGATACAGGGCCCTTTCGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Protomyces_inouyei">
+			
+			?????CTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA-TTTATACAGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCCT-ACTACTTGG-ATACCCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTCT-GGAAGGGATGTATTTATTAGATAAAAAACCAATG--CTTCGGG-CTCCTT-GGTGATTCATAATAACTTTACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGAGGCCTACCATGGTTTTGACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCC-GACACGGGGAGGTAGTGACAATAAATAACAATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Taphrina_deformans">
+			
+			??????????CTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACAGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTA-ATTACTTGG-ATACCCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTCT-GGAAGGGATGTATTTATTAGATAAAAAACCAATG-CCTTCGGG-CTCCTT-GGTGATTCATAATAACTTTACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATATTGGCCTACCATGGTTTTGACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCC-GACACGGGGAGGTAGTGACAATAAATAACAATACAGGGCTCTTTTGGGTCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Filobasidiella_neoformans">
+			
+			????GCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAACGAATTCATACTGTGAAACTGCGAATGGCTCATTAAATCAGTTATAGTTTATTTGATGGTATCTT-GCTACATGG-ATAACTGTGGTAATTCTAGAGCTAATACATGCTGAAAAGCCCCGACTTCT-GGAAGGGGTGTATTTATTAGATAAAAAACCAATGGGTTTCGGCCCTCTAT-GGTGAATCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGCTTCATTCAAATATCTGCCCTATCAACTTTCGATGGTAGGATAGAGGCCTACCATGGTATCAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATAACAATACAGGGCTCTTTTGGGCCTTGTAATTG [...]
+		</sequence>
+<sequence taxon="Spongipellis_unicolor">
+			
+			?????????????AAAGATTAAGCCATGCATGTCTAAGTATAAACAAGTTTGTACTGTGAAACTGCGAATGGCTCATTAAATCAGTTATAGTTTATTTGATGGTGCTTT-GCTACATGG-ATAACTGTGGTAATTCTAGAGCTAATACATGCAATCAAGCCCTGACTTCT-GGAAGGGGTGTATTTATTAGATAAAAAACCAACGCGGCTCGCCGCTCCATTGGTGAATCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGCTTCATTCAAATATCTGCCCTATCAACTTTCGATGGTAGGATAGAGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATAACAATATAGGGCTCTTTCGGGTCTT?TAATTG [...]
+		</sequence>
+<sequence taxon="Athelia_bombacina">
+			
+			ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAACAAATTTGTACTGTGAAACTGCGAATGGCTCATTAAATCAGTTATAGTTTATTTGATGATACCTT-ACTACATGG-ATAACTGTGGTAATTCTAGAGCTAATACATGCATTAAAGCCCCGACTTCT-GGGAGGGGTGTATTTATTAGATAAAAAACCAACGCGGCTCGCCGCTCCYTTGGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCCGGCGATGCTTCATTCAAATATCTGCCCTATCAACTTTCGATGGTAGGATAGAGGCCTACCATGGTTTCAACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATAACAATATAGGGCTCTTTCGGGTCTTATAATTG [...]
+		</sequence>
+</data>
+    <!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+    <input spec='HKY' id='hky'>
+        <kappa idref='hky.kappa'/>
+        <frequencies id='freqs' spec='Frequencies'>
+            <data idref='alignment'/>
+        </frequencies>
+    </input>
+
+    <!-- site model                                                              -->
+    <input spec='SiteModel' id="siteModel" gammaCategoryCount='1'>
+        <!--
+            <parameter name='shape' id='shape' value='0.5'/>
+            <parameter name='proportionInvariant' id='propInvar' value='0.2'/>
+        -->
+        <substModel idref='hky'/>
+    </input>
+
+    <input spec='TreeLikelihood' id="treeLikelihood">
+        <data idref="alignment"/>
+        <tree idref="tree"/>
+        <siteModel idref="siteModel"/>
+    </input>
+
+    <parameter id="hky.kappa" value="1.0" lower="0.0"/>
+
+    <tree id='tree'/>
+
+    <tree spec='beast.util.ClusterTree' id='upgmatree' clusterType='upgma' initial='@tree'>
+        <taxa idref='alignment'/>
+    </tree>
+    <tree spec='beast.evolution.tree.RandomTree' id='coalescentSimulator' initial='@tree' taxa='@alignment'>
+        <populationModel spec='ConstantPopulation'>
+            <popSize spec='parameter.RealParameter' value='1'/>
+        </populationModel>
+    </tree>
+
+
+    <run spec="MCMC" id="mcmc" chainLength="5000000" preBurnin="0">
+
+        <init idref='coalescentSimulator'/>
+        <distribution spec='CompoundDistribution' id='posterior'>
+<!--
+	make it comparable to the files in the BEAST 1 directory, that do not use a prior either
+            <distribution spec='beast.math.distributions.Prior' x='@hky.kappa'>
+                <distr spec='beast.math.distributions.OneOnX'/>
+            </distribution>
+-->
+            <distribution id='likelihood' idref="treeLikelihood"/>
+        </distribution>
+
+        <operator id='kappaScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" parameter="@hky.kappa"/>
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" tree="@tree"/>
+
+        <operator spec='SubtreeSlide' weight="5" gaussian="true" size="1.0" tree="@tree"/>
+
+        <operator spec='Uniform' weight="10" tree="@tree"/>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="1" tree="@tree"/>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="1" tree="@tree"/>
+        <operator spec='WilsonBalding' weight="1" tree="@tree"/>
+
+        <logger logEvery="10000" fileName="test.log">
+            <model idref='likelihood'/>
+            <log idref="likelihood"/>
+            <log idref='hky.kappa'/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+        </logger>
+        <logger logEvery="10000" fileName="test.trees">
+            <log idref="tree"/>
+        </logger>
+        <logger logEvery="10000">
+            <model idref='likelihood'/>
+            <log idref="likelihood"/>
+            <ESS spec='ESS' name='log' arg="@likelihood"/>
+            <log idref='hky.kappa'/>
+            <ESS spec='ESS' name='log' arg="@hky.kappa"/>
+        </logger>
+    </run>
+</beast>
+
diff --git a/examples/benchmark/II/testHKY755.xml b/examples/benchmark/II/testHKY755.xml
new file mode 100644
index 0000000..0378ee0
--- /dev/null
+++ b/examples/benchmark/II/testHKY755.xml
@@ -0,0 +1,339 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beast xmlns="http://www.w3.org/TR/xhtml1/strict" version="2.0" namespace="beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood">
+<data dataType="nucleotide" id="alignment">
+<sequence taxon="Sphaerostilbella_aureonitens">
+			
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCTCGCGCGG-----GAGTTGTAATTTGTAGAGGATGCTTTTGGTGA-GGCGCCGCC-GAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGCTGGCCGCCGAGCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATATGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAACA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCGTGACCAGACTTGGGCTTGG-CGAAT-CATC-AGGG-TTCTCCCTGGTGCACTTTGCCTCGCTCAGGCCAGCATCAGTTCGCCGCGGGGGACAAAGGCTTCGGGAATGTGGCTC---TCC--GGGAGTG [...]
+		</sequence>
+<sequence taxon="Selinia_pulchra">
+			
+			CCTCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCCA-----GGCCCGAGTTGTAATTTGCAGAGGATGTTTCTGGCGC-GGTGCCTTCCGAGTTCCCTTGGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGCCGCCAAGCCTATGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCTAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGCC-GG-TTGATCATCCGCCG--TTCTCGGTGGTGCACTCTG-CCGGCTCAGGCCAGCATCAGTTTGGCCCGGGGGATAAAGGCGTCGGGAATGTGGCTCCCTCC--GGGGAGTG [...]
+		</sequence>
+<sequence taxon="Roumergueriella_rufula">
+			
+			CCTCAGTAACGGCGAG-TGAAGCGG-CAGCAG-CTCAAATTTGAAATCT-GGCCTA-----GGGGCCCGAGTTGTAATTTGCAGAGGATGTTTCTGGCGA-GGCGCCTTCCGAGTTCCCT-GGAACGGGACGCCGTAGAGGGTGAGAGCCCCGTACGGTTGGACGCTAAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCTAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGGC-GG-TCGATCACCCGCCG--TTCTCGGCG---CACTCGG-CCGGCCCAGGCCAGCATCAGTTTGGCCCGGGGGACAAAGGCGCCGGGAACGTGGCTCCC-----GGGGAGTG [...]
+		</sequence>
+<sequence taxon="Plectosphaerella_cucumerina">
+			
+			CCTCAGTAACGGCGAG-TGAAGCGG-CACCAG-CTCAAATTTGAAATCT-GGCTCCTTC--GGGGTCCGAGTTGTAATTTGTAGAGGATGCGTCGGGTACGGGTCCCTACCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTAGGATACCCAGCCCATGTG-ACGC-TCCCTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAACGGGAGGTATACTCCTTCCAAAGCTAAATACCGGCTGGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTCAAACA-GCACGTGAAATTG-TTAAAAGGGAAGCACTCGCTACCAGACTTGGGTTTGG-AGGTTCAACCGGGGC-CACGCCCCGGGG-ATTCCG-CCAGCTCAGGCCAGCATCAGCTTTCCGTCGGGGGCAAAGACGTCGGGAATGTGGCTCCCCCTCGGGGGAGTG [...]
+		</sequence>
+<sequence taxon="Peethambara_sundara">
+			
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGTCCCCA----GGGCCCGAGTTGTAATTTGCAGAGGATGCTTTGGGCGC-GGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCACAGAGGGTGAGAGCCCCGTCTGGTCGGACACCAAGCCTGTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTTAAACA-GCACGTGAAATTG-TTGAAAGGGAAGCGTTCATGACCAGACTTGG-CCCGG-TTGATCATCCAGCG--TTCTCGCTGGTGCACTCTG-CCGGTCCAGGCCAGCATCAGTTCGCCACGGGGGATAAAGGCGGCGGGAATGTGGCTCCCCC----GGGAGTG [...]
+		</sequence>
+<sequence taxon="Ochronectria_calami_2">
+			
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGC-TCTC----GGGCCCGAGTTGTAATTTGAAGAGGATGTTTCTGGCAA-GGTACCTTCTGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTAGTTGGTCGCCGCGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGCC-GG-TTGATCATCCATCG--TTCTCGGTGGTGCACTCTG-CCGGTCCAGGCCAGCATCAGTTTGCCCCGGGGGATAAAGGCTTCGGGAATGTGGCTCCCT----AGGGAGTG [...]
+		</sequence>
+<sequence taxon="Ochronectria_calami_1">
+			
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGC-TCTC----GGGCCCGAGTTGTAATTTGAAGAGGATGTTTCTGGCAA-GGTACCTTCTGAGTTCTCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTAGTTGGTCGCCGCGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGCC-GG-TTGATCATCCATCG--TTCTCGGTGGTGCACTCTG-CCGGTCCAGGCCAGCATCAGTTTGCCCTGGGGGATAAAGGCTTCGGGAATGTGGCTCCCT----AGGGAGTG [...]
+		</sequence>
+<sequence taxon="Nigrosabulum_globosum">
+			
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCCA-----GGCCCGAGTTGTAATTTGCAGAGGATGCTTCTGGCGA-CGCGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCCGGTCGTGCGCCTAGCCTGTGTGAA-GC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-CTGAAAGGGAAGCGCTTATGACCAGACTTGGGCCCGG-TGAATCA-CCAGCG--TTCTCGCTGGTGCACTTTG-CCGGCCCAGGCCAGCATCAGTTCGTGCCGGGGGATAAAGGCTTCGGGAATGTAGCTCCCTC----GGGAGTG [...]
+		</sequence>
+<sequence taxon="Neotyphodium_coenophialum">
+			
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCCC---GGGGCCCGAGTTGTAATTTGCAGAGGATGCTTTTGGCGA-GGCGCCTTCCGAGTTCCCT-GGAACGGGACGCCACAGAGGGTGAGAGCCCCGTCTGGTTGGATGCCGAGCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAAATAGTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGCCCGG-TGAAT-CATCCAGCG-TTCTCGCCGGTGCACTTTGCCGGGCTCAGGCCAGCATCAGTTCGCCCTGGGGGAGAAAGGCTCTGGGAATGTGGCTCC-TCC---GGGAGTG [...]
+		</sequence>
+<sequence taxon="Nectriopsis_violacea">
+			
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCA------GGCCCGAGTTGTAATTTGTAGAGGATGTTTCTGACGA-GGTACCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGTCGCCAAGTCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATATAGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCATATGACCAGACTTGGCC-AGG-TTAATCATCCATCG--TTCTCGGTGGTGCACTTTG-CCTGGCCAGGCCAGCATCAGTTCGCCTTGGGGGATAAAGACTTCGGGAATGTGGCTCCTTC----GGGAGTG [...]
+		</sequence>
+<sequence taxon="Nectriopsis_sporangiicola">
+			
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCA-------GGCCGAGTTGTAATTTGTAGAGGATGTTTCTGACGA-GGTACCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGTCGCCAAGTCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATACGTCTTCTAAAGCTAAATATAGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCACATGACCAGACTTGGGT-GGG-TTGATCATCCGTCG--TTCTCGGCGGTGCACTCTG-CCCGACCAGGCCAGCATCAGTTCGCTGCGGGGGATAAAGACGTCGGGAATGTGGCTCC-TCC---GGGAGTG [...]
+		</sequence>
+<sequence taxon="Nectria_zonata">
+			
+			CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCA------GAGCCGAGTTGTAATTTGTAGAGGATGTTTCTGGAGA-GGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTG--CGCTATGCCTATGTGAAA-C-TCCTTCAACGCGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGTGGTGTACGCCATCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAA-GAGGGTTAAACA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACCTGGGCC-GG-TTGATCATCCGCCG--TTCTCGGTGGTGCACTCTG-CCGGCCCAGGCCAGCATCGGTCTGGCGCGGGGGTCAAAGGTTCCGGGAATGTGGCTCCCCCC--GGGGAGTG [...]
+		</sequence>
+<sequence taxon="Nectria_sesquicilli">
+			
+			CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCGCAA-------GCCCGAGTTGTAATTTGTAGAGGATGTTTCTGGCGA-CGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGTTGCCTAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGTTTATGACCAGACTTGAGC-AGG-TTGATCATCCGTGG--TTCTCCGCGGTGCACTCTG-CCTGTTCAGGCCAGCATCAGTTTGGTTCGGGGGATAAAGGCTTCGGGAATGTAGCTCCCTC----GGGAGTG [...]
+		</sequence>
+<sequence taxon="Nectria_radicicola">
+			
+			CCCTAGTAACGGCGAG-TGAAGCGG--AACAG-CTCAAATTTGAAATCT-GGCCTTC-----GGGTCCGAGTTGTAATTTGTAGAGGATGCTTTGGGTGA-GGTACCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTTGGATACCGATCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGCTTGG-TTGATCATCCAGGG--TTCTCCCTGGTGCACTCTT-CCAGCTCAGGCCAGCATCAGTTCGCTGTGGGGGATAAAGGCTTCGGGAATGTGGCTCC-TCC---GGGAGTG [...]
+		</sequence>
+<sequence taxon="Nectria_pseudotrichia">
+			
+			CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCTCGT----GGTCCGAGTTGTAATTTGTAGAGGATGCTTTGGGTTA-GGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTTGGACACCGAGCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTGTGACCAGACTTGGGCCCGG-TCAATCATCCAGGG--TTCTCCCTGGTGCACTTTT-CCGGCTCAGGCCAGCATCAGTTTGTCGCGGGGGATAAAGACGTTGGGAATGTGGCTCCCCC----GGGAGTG [...]
+		</sequence>
+<sequence taxon="Nectria_pityrodes2">
+			
+			CCCTAGTAACGGCGAG-TGAAGCGG-CAACAGGCTCAAATTTGAAATCT-GGCCCTA------GGCCCGAGTTGTAATTTGTAGAGGATGTTTCTGGCGA-AGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGATGCCTAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGGTTATGACCAGACTTGGAC-AGG-TTGATCATCCACGG--TTCTCTGTGGTGCACTCTG-CCTGTCCAGGCCAGCATCAGTTCGCTTCGGGGGATAAAGACTTTGGGAATGTGGCTCCCTC----GGGAGTG [...]
+		</sequence>
+<sequence taxon="Nectria_pityrodes1">
+			
+			CCCTAGTAACGGCGAG-TGAAGCGGGCAACAG-CTCAAATTTGAAATCT-GGCCCTA------GGCCCGAGTTGTAATTTGTAGAGGATGTTTCTGGCGA-AGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGATGCCTAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGGTTATGACCAGACTTGGAC-AGG-TTGATCATCCACGG--TTCTCTGTGGTGCACTCTG-CCTGTTCAGGCCAGCATCAGTTCGCTTCGGGGGATAAAGGCTTTGGGAATGTGGCTCCCTC----GGGAGTG [...]
+		</sequence>
+<sequence taxon="Nectria_grammicospora">
+			
+			CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCGCAA-------GCCCGAGTTGTAATTTGTAGAGGATGTTTCTGGCGA-CGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGATGCCTAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCGTTCATGACCAGACTTGGGC-AGG-TTGATCATCCGTGG--TTCTCCGCGGTGCACTCTG-CCTGCCCAGGCCAGCATCAGTTCGCCCCGGGGGATAAAGGTTTCGGGAATGTGGCTCCCTC----GGGAGTG [...]
+		</sequence>
+<sequence taxon="Nectria_cinnabarina_2">
+			
+			CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCTTGT----GGTCCGAGTTGTAATTTGTAGAGGATGCTTTTGGTGA-GGTACCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTTGGATACCGATCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTGTGACCAGACTTGGGCTTGG-TTAATCATCCAGGG--TTCTCCCTGGTGCACTTGG-CCAGCCCAGGCCAGCATCAGTTTGTCGCGGGGGATAAAGGCGTTGGGAATGTGGCTCCCTC----GGGAGTG [...]
+		</sequence>
+<sequence taxon="Nectria_cinnabarina_1">
+			
+			CCCAAGTAACGGCGATGTGAATCGG-CAACAG-CTCAAATTTGAAATCTAGGCCCTTGT----GGTCCGAGTTGTAATTTGTAGAGGATGCTTTTGGTGA-GGTAC-TTCCGA-TTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTTGGATACCGATCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTA-TTTGGG-AATGCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGTTGATCGAAAGATGAAAAGCACTTTGAAAAGAGGGT-AAATA-GTACGTGAAATTGGTTGAAAGGGAAGCGCTTGTGACCAGACTTGGGCTTGG-TTAATCATCCAGGG--TTCTCCCTGGTGCACTTGG-CCAGCCCAGGCCAGCATCAGTTTGTCGCGGGGGATAAAGGCGTTGGGAATGTGGCTCCCCC----GGGAGTG [...]
+		</sequence>
+<sequence taxon="Myrothecium_inundatum">
+			
+			CCTCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCA------GGCCCGAGTTGTAATTTGCAGAGGATGCTTTTGGTGA-GGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTCGGACACCGAGCCTCTGT-AAAGCCTCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTTAAATA-GCACGTGAAATTG-TTGAAAGGGAAGCGTTTATGACCAGACTTGG-CCCGG-TTGATCATCCAGCG--TTCTCGCTGGTGCACTCTG-CCGGTCCAGGCCAGCATCAGTTCGTCGCGGGGGACAAAGGCTTCGGGAATGTGGCTCC-TCC---GGGAGTG [...]
+		</sequence>
+<sequence taxon="Mycoarachis_inversa">
+			
+			CCTCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GCCCCCC------GGCCCGAGTTGTAATTTGCAGAGGATGCTTCTGGCGA-CGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCCGGTTGTGCGCCTAGCCTCTGTGAA-GC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-CTGAAAGGGAAGCGCTTCTGACCAGACTTGGGCCCGG-TGAATCATCCAGCG--TTCTCGCTGGTGCACTTTG-CCGCCC-AGGCCAGCATCAGTTCGCGCCGGGGGATAAAGGCTTCGGGAATGTAGCTCCCTC----GGGAGTG [...]
+		</sequence>
+<sequence taxon="Leucosphaerina_indica">
+			
+			CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAAGCT-GGCTCTC-----GGGCCCGCATTGTAATTTGCAGAGGATGCTTCTGGCGA-CGCGCCTTCCGAGTTTCCCTGGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCCGGTCGTGCGCCTAGCCTCTGTGAA-GT-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGCT-GGCTCGATCATCCGGCG--TTCTCGCCGGTGCACTCGGGCCG-CTCAGGCCAGCATCAGCTTCCGCCGGGGGATAAAGGCGGCGGGAATGTGGCTCCCTC----GGGAGTG [...]
+		</sequence>
+<sequence taxon="Leuconectria_clusiae">
+			
+			CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCTC-----GGGTCCGAGTTGTAATTTGTAGAGGATGCTTTGGGTGC-GGTACCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTTGGATACCAATCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTATGACCAGACTTGGGCTTGG-TTGATCATCCTGGG--TTTTCCCTGGTGCACTCTT-CCAGTTCAGGCCAGCATCAGTTTGTTTCGGGGGATAAAGGCTTCGGGAATGTGGCTCCCTC----GGGAGTG [...]
+		</sequence>
+<sequence taxon="Kallichroma_tethys_2">
+			
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAAAAG-CTCAAATTTGAAATCT-GGCCCCCCC---GGGCCCGAGTTGTAATTTGCAGAGGATGTTTCTGGCGC-GGCGCCAGCCGAGT-CCCTTGGAACAGGGCGCCACAGAGGGTGAGAGCCCCGTATGGCTGCGCGCTAAGCCTTTGTGAAA-C-TCCCTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAGCGGGAGGTGTACGTCTTCCAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCACTCATGACCAGACTTGGGCCCGG-CGGATCATCCAGCG--TTCTCGCTGGTGCACTTCACCGGGCTCAGGCCAGCATCAGTCCGCGCCGGGGGAAAAAGGCTTCGGGAATGTGGCTCCCCC----GGGAGTG [...]
+		</sequence>
+<sequence taxon="Kallichroma_tethys_1">
+			
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAAAAG-CTCAAATTTGAAATCT-GGCCCCCCC---GGGCCCGAGTTGTAATTTGCAGAGGATGTTTCTGGCGC-GGCGCCAGCCGAGT-CCCTTGGAACAGGGCGCCACAGAGGGTGAGAGCCCCGTATGGCTGCGCGCTAAGCCTTTGTGAAA-C-TCCCTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAGCGGGAGGTGTACGTCTTCCAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCACTCATGACCAGACTTGGGCCCGG-CGGATCATCCAGCG--TTCTCGCTGGTGCACTTCACCGGGCTCAGGCCAGCATCAGTCCGCGCCGGGGGAAAAAGGCTTCGGGAATGTGGCTCCCCC----GGGAGTG [...]
+		</sequence>
+<sequence taxon="Kallichroma_glabrum">
+			
+			CCTCAGTAACGGCGAG-TGAAGCGG-CAAAAG-CTCAAATTTGAAATCT-GGCCCCCA-----GGCCCGAGTTGTAATTTGCAGAGGATGTTTCTGGCGC-GGCGCCTTCCGAGT-CCCTTGGAACAGGGCGCCATAGAGGGTGAGAGCCCCGTATGGTTGCGCGCTAAGCCTGTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCACTTATGACCAGACTTGGGCTCGGGCGAATCATCCAGCG--TTCTCGCTGGTGCACTTCTCCGGGCTCAGGCCAGCATCAGTCTGCTCCGGGGGATAAAGGCTTCGGGAATGTGGCTCC-TCC---GGGAGTG [...]
+		</sequence>
+<sequence taxon="Hypomyces_australis">
+			
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GCC--TAGGG-----CCCGAGTTGTAATTTGCAGAGGATGCTTTT-GCGA--GCGCCGCCCGAGTTCCCT-GGAACGGGACGCCGCAGAGGGTGAGAGCCCCGTCTG-CTGGACGCCGAGCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATATGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAACA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGCTTGG-CGGAT-CAGC---TG-TTCTC-CGGGTGCACTTCGCC-CGCCCAGGCCAGCATCAGCTCGCCCCGGGGGACAAAGGCTTCGGGAATGTGGCTC---TCC--GGGAGTG [...]
+		</sequence>
+<sequence taxon="Hypomyces_aurantius">
+			
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCTAGGG----CCCTGAGTTGTAATTTGCAGAGGATGCTTTTGGCAA-GGCGCCGCCCGAGTTCCCT-GGAACGGGACGCCGCAGAGGGTGAGAGCCCCGTCTGGCTGGACGCCGAGCCTTTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAACA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGCTTGG-CGGATGCAGC---TG-TTCTCGCCGGTGCACTTCGCCTCGCCCAGGCCAGCATCAGTTCGCCCCGGGGGACAAAAGCTTCGGGAATGTGGCTC---TCC--GGGAGTG [...]
+		</sequence>
+<sequence taxon="Hypocrea_schweintzii">
+			
+			CCCCGATAACGGCGAG-TGAAGCG--CAACAG-CTCAAATTTG?AACTC-GGCCCTTTTG-GG--TCCGAGTTGTAATTTGTAGAGGATG?TTTTGGCAA-GGTGCCGCCCGAGTTCCCT-GGAACGGGACGCCACAGAGGGTGAGAGCCCCGTCTGGCTGGCCACCGAGCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATATGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACCTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTGTGACCAGACTTGGGCGCGG-CGGAT-CATCCGGGG-TTCTCCCCGGTGCACTTCGCCGTGTCCAGGCCAGCATCAGTTCGTCGCGGGGGAAAAAGGCTTCGGGAACGTGGCTCCCCT----GGGAGTG [...]
+		</sequence>
+<sequence taxon="Hypocrea_pallida">
+			
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCTAGCCGG----CGAGTTGTAATTTGCAGAGGATGCTTTTGGTGA-GGCGCCGGCCGAGTTCCCT-GGAACGGGATGCCACAGCGGGTGAGAGCCCCGTCTGCCTGGACGCCGAACCTATGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATATGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGCTTGG-CGGAT-CATC--GCG-TTCTCGCCGTTGCACTCTGCCTCGTCCAGGCCAGCATCAGTTCGTCCCGGGGGATAAAGGCGTCGGGAATGTGGCTCC--TAC--GGGAGTG [...]
+		</sequence>
+<sequence taxon="Hypocrea_lutea">
+			
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCCCGGG----TCCGAGTTGTAATTTGTAGAGGATGCTTTTGGTGA-GGTGCCGCCCGAGTTCCCT-GGAACGGGACGCCACAGAGGGTGAGAGCCCCGTCTGGCTGGCCACCGAGCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATATGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACCTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTGTGACCAGACTTGGGCGCGG-CGGAT-CATCCGGGG-TTCTCTCCGGTGCACTTCGCCGCGTTCAGGCCAGCATCAGTTCGTCGCGGGGGATAAAGGCTTCGGGAACGTGGCTC---TCC--GGGAGTG [...]
+		</sequence>
+<sequence taxon="Hydropisphaera_peziza_2">
+			
+			?????????????????????????????????????????TGAAATCT-GGCCCTA------GGCCCGAGTTGTAATTTGCAGAGGATGTTTCTGGCGA-GGTGCCTTCCGAGTGCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGTCGCTAAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGCC-GG-TTGATCATCCGCCG--TTCTCGGCGGTGCACTCTG-CCGGCTCAGGCCAGCATCAGTTTGGTCCGGGGGATAAAGGTGTAGGGAATGTGGCTCCCCCC---GGGAGTG [...]
+		</sequence>
+<sequence taxon="Hydropisphaera_peziza_1">
+			
+			CCTCAGTAACGGCGAGGTGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCTA------GGCCCGAGTTGTAATTTGCAGAGGATGTTTCTGGCGA-GGTGCCTTCCGAGTGCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGTCGCTAAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGCC-GG-TTGATCATCCGCCG--TTCTCGGCGGTGCACTCTG-CCGGCTCAGGCCAGCATCAGTTTGGTCCGGGGGATAAAGGTGTAGGGAATGTGGCTCCCCCC--GGGGAGTG [...]
+		</sequence>
+<sequence taxon="Hydropisphaera_erubescens_4">
+			
+			CCTTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCTCT------GGCCCGAGTTGTAATTTGCAGAGGATGTTTCTGGCGA-GGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGTCGCTAAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCTAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTATGACCAGACTTGGGCC-GG-TTGATCATCCATCG--TTCTCGGTGGTGCACTCTG-CCGGTTCAGGCCAGCATCAGTTTGGCTTGGGGGATAAAGGCTTCGGGAATGTGGCTCCCTCC--GGGGAGTG [...]
+		</sequence>
+<sequence taxon="Hydropisphaera_erubescens_3">
+			
+			CCTCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCTTCT-----GGCCCGAGTTGTAATTTGCAGAGGATGTTTCTGGCGA-GGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGTCGCTAAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCTAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTATGACCAGACTTGGACC-GG-TTGATCATCCATCG--TTCTCGGTGGTGCACTCTG-CCGGTTCAGGCCAGCATCAGTTTGGCCCGGGGGATAAAGGCTTCGGGAATGTGGCTCCCCAC--GGGGAGTG [...]
+		</sequence>
+<sequence taxon="Hydropisphaera_erubescens_2">
+			
+			CCTTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCTTT------GGCCCGAGTTGTAATTTGCAGAGGATGTTTCTGGCGA-GGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGTCGCTAAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCTAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTATGACCAGACTTGGACC-GG-TTGATCATCCATCG--TTCTCGGTGGTGCACTCTG-CCGGTTCAGGCCAGCATCAGTTTGGCTCGGGGGATAAAGGTTTCGGGAATGTGGCTCCCCAC--GGGGAGTG [...]
+		</sequence>
+<sequence taxon="Hydropisphaera_erubescens_1">
+			
+			CCTTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCTTCT-----GGCCCGAGTTGTAATTTGCAGAGGATGTTTCTGGCGA-GGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGTCGCTAAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGGGAATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCTAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGACC-GG-TTGATCATCCATCG--TTCTCGGTGGTGCACTCTG-CCGGTTCAGGCCAGCATCAGTTTGGCCCGGGGGATAAAGGTTTCGGGAATGTGGCTCCCCAC--GGGGAGTG [...]
+		</sequence>
+<sequence taxon="Heleococcum_japonicum">
+			
+			CCTCAGTAACGGCGAG-TGAAGCGG-CAACAG-TTCAAATTTGAAATCT-GGCCCCA------GGCCCGAGTTGTAATTTGAAGAGGATGTTTCTGGCGA-GGTGCCTTCCGAGTGCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGTCGCTAAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGCC-GG-TTGATCATCCGCCG--TTCTCGGCGGTGCACTCTG-CCGGCTCAGGCCAGCATCAGTTTGGTCCGGGGGATAAAGGCGTAGGGAATGTGGCTCCCCCC--GGGGAGTG [...]
+		</sequence>
+<sequence taxon="Hapsidospora_irregularis">
+			
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCCC-----GGCCCGAGTTGTAATTTGCAGAGGATGCTTCTGGCGA-CGCGCCTTCCGAGTTCCCT-GGAACGGGACGCCACAGAGGGTGAGAGCCCCGTCCGGTCGTGCGCCTAGCCTGTGTGAA-GC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-CTGAAAGGGAAGCGCTTATGACCAGACTTGGGCCCGG-TGAATCA-CCAGCG--TTCTCGCTGGTGCACTTTG-CCGGCCCAGGCCAGCATCAGTTCGCGCCGGGGGATAAAGGCTTCGGGAATGTAGCTCCCTC----GGGAGTG [...]
+		</sequence>
+<sequence taxon="Geosmithia_putterillii">
+			
+			CCTTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCCA-----GGCCCGAGTTGTAATTTGTAGAGGATGCTTCTGGCGA-CGCGACTTCCGAGTTCCCT-GGAACGGGACGCCAAAGAGGGTGAGAGCCCCGTCCGGCCGTTCGCCTAGCCTATGTGAA-GC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-CTGAAAGGGAAGCGCTTATGACCAGACTTGGGCTAGG-TGAATCATCCGGCG--TTCTCGCCGGTGCACTTTG-CCTGTCCAGGCCAGCATCAGTTCGCTTCGGGGGATAAAGGCTTCGGGAATGTAGCTCCTCC----GGGAGTG [...]
+		</sequence>
+<sequence taxon="Geosmithia_lavendula">
+			
+			CCTCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCCA-----GGCCCGAGTTGTAATTTGTAGAGGATGATTCTGGCGA-CGCGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCCGGTCGTGCGCCTAGCCTCTGTGAAT-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAAAA-GTACGTGAAATTG-CTGAAAGGGAAGCGCTTATGACCAGACTTGGGCGTGG-TGAATCATCCGGCG--TTCTCGCCGGTGCACTTTG-CCTGTCCAGGCCAGCATCAGTTCTCCCCGGGGGATAAAGGCTTCGGGAATGTAGCTCCTTC----GGGAGTG [...]
+		</sequence>
+<sequence taxon="Epichloe_typhina">
+			
+			CCCCAGTAACGGCGAG-TGAAGCGG-AAACAG-CTCAAATTTGAAATCT-GGCCCCCA----GGGCCCGAGTTGTAATTTGTAGAGGATGCTTTGGG-GA-GGCGCCTTCCGAGTTCCCT-GGAACGGGACGCCACAGAGGGTGAGAGCCCCGTCTGGTTGGATGCCGAGCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATCCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGCCCGG-TGAAT-CATCCAGCGGTTCTCGCTGGTGCACTTTGCCGGGCTCAGGCCAGCATCAGTTCGCCCCGGGGGACAAAGGCTCTGGGAATGTGGCTCC-TCC---GGGAGTG [...]
+		</sequence>
+<sequence taxon="Emericellopsis_terricola">
+			
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCTCGT------GCCCGAGTTGTAATTTGTAGAGGATGCTTTTGGCGA-CGCGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCCGGTCGTGCGCCTAGCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-CTGAAAGGGAAGCGCTTATGACCAGACTTGGGCGCGG-CGGATCATCCGGCG--TTCTCGCCGGTGCACTCCA-CCGCCCCAGGCCAGCATCAGTTCGCGCCGGGGGACAAAGGCTTCGGGAATGTGGCTCCCTC----GGGAGTG [...]
+		</sequence>
+<sequence taxon="Didymostilbe_echinofibrosa">
+			
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCA------GGCCCGAGTTGTAATTTGCAGAGGATGCTTTGGGCGC-GGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTCGGACACCAAGCCTATGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATATGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTTAAACA-GCACGTGAAATTG-TTGAAAGGGAAGCGTTCATGACCAGACTTGG-CCCGG-TTGATCATCCAGCG--TTCTCGCTGGTGCACTCTG-CCGGTCCAGGCCAGCATCAGTTCGCCGCGGGGGATAAAGGTTTCGGGAATGTGGCTCC-TC-----GGAGTG [...]
+		</sequence>
+<sequence taxon="Cylindrocladium_floridanum">
+			
+			CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCTC-----GGGTCCGAGTTGTAATTTGTAGAGGATGCTTTGGGTGA-GGTACCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTTGGATACCGATCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTATGACCAGACTTGGGCTTGG-TTGATCATCCTGGG--TTCTCCCTGGTGCACTCTT-CCAGTTCAGGCCAGCATCAGTTCGCTGCGGGGGATAAAAGCTTTAGGAATGTGGCTCCCTC----GGGAGTG [...]
+		</sequence>
+<sequence taxon="Cordyceps_capitata">
+			
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAACGG-CTCAAATTTGAAATCT-GGCCCCCA----GGGCCCGAGTTGTAATTTGCAGAGGATGCTTTTGGCGC-GGCGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTCGGACGCCAAGCCAGTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAACGGGAGGTATATGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAACA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTGCGACCAGACTTGGGCCCGG-TGAAT-CATCCAGCG-TTCTCGCTGGTGCACTTCGCCGGGCTCAGGCCAGCATCAGTTCGCCGCGGGGGACAAAAGCTTCGGGAACGTGGCTCCCTC----GGGAGTG [...]
+		</sequence>
+<sequence taxon="Cordycepioideus_bisporus">
+			
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCCCCGCGGGGCCCGAGTTGTAATTTGCAGAGGATGCTTTTGGCGC-GGCGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTCGGACGCCCAGCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATATGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAACA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCGTGACCAGACTTGGGCGCGG-CGGAT-CATC-GGCG-TTCTCGCCGGTGCACTCCGCCGGGCCCAGGCCAGCATCGGTTCGCGGCGGGGGACAAAGGCGTCGGGAACGTGGCTCCCCT----GGGAGTG [...]
+		</sequence>
+<sequence taxon="Clonostachys_rosea">
+			
+			CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCGCACAC--------GGAGTTGTAATTTGTAGAGGATGTTTCTGGCGA-CGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGATGCCTAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCGTTCATGACCAGACTTGGGC-AGG-TTGATCATCCGTGG--TTCTCCGCGGTGCACTCTG-CCTGCCCAGGCCAGCATCAGTTCGCCCCGGGGGATAAAGGCTTTGGGAATGTGGCTCCCTC----GGGAGTG [...]
+		</sequence>
+<sequence taxon="Ceratocystis_fimbriata">
+			
+			CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCTACATTCCGTAGTCCGAGTTGTAATTTGTAGAGGATGCTTTGGGTGA-GGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGACACCAAACCTCTGT-ATAGC-TCCTTCAACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATATCTCTTCTAAAGCTAAATATAGGCTAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTTAAACA-GCACGTGAAATTG-TTGAAAGGGAAGCGCCTATGACCAGACTTGTTTCTGG-CAGTTTCGTTAGC-C-CTCGGGCTGATTTACTCTGTCCAGTACAGGCCAGCATCAGTTTGCTGTCGGGGAGAAAGGCTCTGGGAACGTAGCTCCCCCCTGGGGGAGTG [...]
+		</sequence>
+<sequence taxon="Calonectria_morganii">
+			
+			CCCTAGTAACGGCGAG-TGAAGCGG-AAACAG-CTCAAATTTGAAATCT-GGCCCTC-----GGGTCCGAGTTGTAATTTGTAGAGGATGCTTTGGGTGA-GGTACCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTTGGATACCGATCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTATGACCAGACTTGGGCTTGG-TTGATCATCCTGGG--TTCTCCCTGGTGCACTCTT-CCAGTTCAGGCCAGCATCAGTTCGCTGCGGGGGATAAAAGCTTTAGGAATGTGGCTCCCTC----GGGAGTG [...]
+		</sequence>
+<sequence taxon="Bulbithecium_hyalosporum">
+			
+			??????????????????????????????????????????????????????????????????????GTTGTAATTTGCAGAGGATGCTTCTGGCGA-CGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCCGGTCGCGCACCTAGCCTCTGTGAA-GC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-CTGAAAGGGAAGCGCTTATGACCAGACTTGGGCC-GG-TGAATCATCCGTCG--TTCTCGGCGGTGCACTTTG-CCGGCTCAGGCCAGCATCAGTTCGCCTCGGGGGATAAAGGCTTCGGGAAAGTAGCTCCCTC----GGGAGTG [...]
+		</sequence>
+<sequence taxon="Bionectria_ochroleuca">
+			
+			CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCGCACAC--------GGAGTTGTAATTTGTAGAGGATGTTTCTGGCGA-CGCGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGCGGGTGAGAGCCCCGTACGGTTGGATGCCTAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCGTTCATGACCAGACTTGGGC-AGG-TTGATCATCCGTGG--TTCTCCGCGGTGCACTCTG-CCTGCCCAGGCCAGCATCAGTTCGCCCCGGGGGATAAAGGCTTTGGGAATGTGGCTCCCTC----GGGAGTG [...]
+		</sequence>
+<sequence taxon="Bionectria_cf._aureofulva_2">
+			
+			CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCGCAA-------GCCCGAGTTGTAATTTGTAGAGGATGTTTCTGGCGA-CGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGATGCCTAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCGTTCATGACCAGACTTGGGC-AGG-TTGATCAGCCGGGG--TTCTCCGCGGTGCACTCTG-CCTGCCCAGGCCAGCATCAGTTCGCCCCGGGGGATAAAGGTTTCGGGAATGTGGCTCC-TCC---GGGAGTG [...]
+		</sequence>
+<sequence taxon="Bionectria_cf._aureofulva_1">
+			
+			CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCGCAA-------GCCCGAGTTGTAATTTGTAGAGGATGTTTCTGGCGA-CGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGATGCCTAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCGTTCATGACCAGACTTGGGC-AGG-TTGATCATCCGTGG--TTCTCCGCGGTGCACTCTG-CCTGCCCAGGCCAGCATCAGTTCGCCCCGGGGGATAAAGGTTTCGGGAATGTGGCTCC-TCCC--GGGAGTG [...]
+		</sequence>
+<sequence taxon="Balansia_obtecta">
+			
+			CCCCAGTAACGGCGAG-TGAAGCGG--AACAG-TTCAAATTTGAAATCT-GGCCCCCTTGGGGGGCCCGAGTTGTAATTTGAAGAGGATGCTTTGGGCGA-GGCGCCTTCCGAGTTCCCT-GGAACGGGACGCCACAGAGGGTGAGAGCCCCGTCTGGTCGGACGCCGAGCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAACA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTACGACCAGACTTGGGCCCGG-CGAAT-CATCCGGCG-TTCTCGCCGGTGCACTTCGCCGGGCTCAGGCCAGCATCAGTTCGCGCCGGGGGACAAAGGCTCGGGGAATGTAGCTCCCCC----GGGAGTG [...]
+		</sequence>
+<sequence taxon="Albosynnema_elegans">
+			
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCCC-----GGCCCGAGTTGTAATTTGCAGAGGATGCTTTGGGCGC-GGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCACAGAGGGTGAGAGCCCCGTCTGGTCGGCCACCAAGCCTGTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATATGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTTAAACA-GCACGTGAAATTG-TTGAAAGGGAAGCGTTCATGACCAGACTTGG-CCCGG-CTGATCATCCAGCG--TTCTCGCTGGTGCACTCTG-CCGGTCCAGGCCAGCATCAGTTCGCCACGGGGGATAAAGGTTTCGGGAATGTGGCTCC-TC-----GGAGTG [...]
+		</sequence>
+<sequence taxon="Acremonium_alternatum">
+			
+			CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCTCAC-----GGTCCGAATTGTAATTTGTAGAGGATGTTTCTGGCGA-CGTGTCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCCGGTCGTACACCTAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-CTGAAAGGGAAGCGCTTATGACCAGACTTGGGCTCGG-TGAATCATCCGGCG--TTCTCGCCGGTGCACTTTG-CCGTCCCAGGCCAGCATCAGTTCGCGCCGGGGGATAAAGGTTTCGGGAATGTAGCTCCCTC----GGGAGTG [...]
+		</sequence>
+<sequence taxon="Viridispora_diparietospora_2">
+			
+			CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCTC-----GGGTCCGAGTTGTAATTTGTAGAGGATGCTTTGGGTGC-GG-GCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTTGGACGCCAATCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTGTGACCAGACTTGGGCTTGG-TTGATCATCCAGGG--TTCTCCCCGGTGCACTCTT-CCAGTCCAGGCCAGCATCAGTTCGCCGCGGGGGACAAAAGCTTCGGGAATGTGGCTCCCTC----GGGAGTG [...]
+		</sequence>
+<sequence taxon="Viridispora_diparietospora_1">
+			
+			CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCTC-----GGGTCCGAGTTGTAATTTGTAGAGGATGCTTTGGGTGC-GGGGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTTGGACGCCAATCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATCCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTGTGACCAGACTTGGGCTTGG-TTGATCATCCAGGG--TTCTCCCCGGTGCACTCTT-CCAGCCCAGGCCAGCATCAGTTCGCCGCGGGGGACAAAAGCTTCGGGAATGTGGCTCCCTC----GGGAGTG [...]
+		</sequence>
+<sequence taxon="Verticillium_dahliae">
+			
+			CCTTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCTCCTTC--GGGGTCCGAGTTGTAATTTGTAGAGGATGCTTCGAGTTATGGTTCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTAGGAAACCATGCTCATGTG-AAGC-TCCCTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACTCCTTCCAAGGCTAAATACCGGTTAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTCAAACA-GCACGTGAAATTG-TTAAAAGGGAAGCGCTCGCTACCAGACGTGGGTTCGG-TGGTTCAACCAGGTC-CATGACCTGGGGCACTCCG-CCGGCCCAGGCCAGCATCAG-TTTCCGTCGGGGGCAAAGGCGTCGGGAATGTGGCTCTCCTTCGGGGGAGTG [...]
+		</sequence>
+<sequence taxon="Stanjemonium_grisellum">
+			
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCTTGT------GCCCGAGTTGTAATTTGTAGAGGATGCTTCTGGCGA-CGCGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCCGGTCGTGCGCCTAGCCTCTGTGAA-GC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-CTGAAAGGGAAGCGCTTATGACCAGACTTGGGCGCGG-CGGATCATCCGGCG--TTCTCGCCGGTGCACTCCA-CCGCCCCAGGCCAGCATCAGCTCGCGCCGGGGGACAAAGGCTTCGGGAATGTGGCTCCCTC----GGGAGTG [...]
+		</sequence>
+<sequence taxon="Stanjemonium_fuscescens">
+			
+			CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCTTGT------GCCCGAGTTGTAATTTGTAGAGGATGCTTCTGGCGA-CGCGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCCGGTCGTGCGCCTAGCCTCTGTGAA-GC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-CTGAAAGGGAAGCGCTTATGACCAGACTTGGGCGCGG-CGGATCATCCGGCG--TTCTCGCCGGTGCACTCCA-CCGCCCCAGGCCAGCATCAGCTCGCGCCGGGGGACAAAGGCTTCGGGAATGTGGCTCCCTC----GGGAGTG [...]
+		</sequence>
+<sequence taxon="Sphaerostilbella_berkeleyana">
+			
+			GCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCTCGCGG----CCCGAGTTGTAATTTGTAGAGGATGCTTTTGGTGA-GGCGCCGCCTGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGCTGGCCGCCGAGCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATATGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAACA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCGTGACCAGACTTGGGCTTGG-CGAAT-CATCCAGGG-TTCTCCCTGGTGCACTTTGCCTCGTCCAGGCCAGCATCAGTTCGCCGCGGGGGATAAAGACGTCGGGAACGTGGCTCCC-TC---GGGAGTG [...]
+		</sequence>
+</data>
+    <!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+    <input spec='HKY' id='hky'>
+        <kappa idref='hky.kappa'/>
+        <frequencies id='freqs' spec='Frequencies'>
+            <data idref='alignment'/>
+        </frequencies>
+    </input>
+
+    <!-- site model                                                              -->
+    <input spec='SiteModel' id="siteModel" gammaCategoryCount='1'>
+        <!--
+            <parameter name='shape' id='shape' value='0.5'/>
+            <parameter name='proportionInvariant' id='propInvar' value='0.2'/>
+        -->
+        <substModel idref='hky'/>
+    </input>
+
+    <input spec='TreeLikelihood' id="treeLikelihood">
+        <data idref="alignment"/>
+        <tree idref="tree"/>
+        <siteModel idref="siteModel"/>
+    </input>
+
+    <parameter id="hky.kappa" value="1.0" lower="0.0"/>
+
+    <tree id='tree'/>
+
+    <tree spec='beast.util.ClusterTree' id='upgmatree' clusterType='upgma' initial='@tree'>
+        <taxa idref='alignment'/>
+    </tree>
+    <tree spec='beast.evolution.tree.RandomTree' id='coalescentSimulator' initial='@tree' taxa='@alignment'>
+        <populationModel spec='ConstantPopulation'>
+            <popSize spec='parameter.RealParameter' value='1'/>
+        </populationModel>
+    </tree>
+
+
+    <run spec="MCMC" id="mcmc" chainLength="5000000" preBurnin="0">
+
+        <init idref='coalescentSimulator'/>
+        <distribution spec='CompoundDistribution' id='posterior'>
+<!--
+	make it comparable to the files in the BEAST 1 directory, that do not use a prior either
+            <distribution spec='beast.math.distributions.Prior' x='@hky.kappa'>
+                <distr spec='beast.math.distributions.OneOnX'/>
+            </distribution>
+-->
+            <distribution id='likelihood' idref="treeLikelihood"/>
+        </distribution>
+
+        <operator id='kappaScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" parameter="@hky.kappa"/>
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" tree="@tree"/>
+
+        <operator spec='SubtreeSlide' weight="5" gaussian="true" size="1.0" tree="@tree"/>
+
+        <operator spec='Uniform' weight="10" tree="@tree"/>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="1" tree="@tree"/>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="1" tree="@tree"/>
+        <operator spec='WilsonBalding' weight="1" tree="@tree"/>
+
+        <logger logEvery="10000" fileName="test.log">
+            <model idref='likelihood'/>
+            <log idref="likelihood"/>
+            <log idref='hky.kappa'/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+        </logger>
+        <logger logEvery="10000" fileName="test.trees">
+            <log idref="tree"/>
+        </logger>
+        <logger logEvery="10000">
+            <model idref='likelihood'/>
+            <log idref="likelihood"/>
+            <ESS spec='ESS' name='log' arg="@likelihood"/>
+            <log idref='hky.kappa'/>
+            <ESS spec='ESS' name='log' arg="@hky.kappa"/>
+        </logger>
+    </run>
+</beast>
+
diff --git a/examples/benchmark/II/testHKY767.xml b/examples/benchmark/II/testHKY767.xml
new file mode 100644
index 0000000..5e45a16
--- /dev/null
+++ b/examples/benchmark/II/testHKY767.xml
@@ -0,0 +1,367 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beast xmlns="http://www.w3.org/TR/xhtml1/strict" version="2.0" namespace="beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood">
+<data dataType="nucleotide" id="alignment">
+<sequence taxon="Trebouxia_from_OC1_barbata">
+			
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_LP1_barbata">
+			
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAACT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_T3_lucida">
+			
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_L20a_lucida">
+			
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_DP2_lucida">
+			
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_SG1_lucida">
+			
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_SG1_lupina">
+			
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_TB2_barbata">
+			
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_TB1_barbata">
+			
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_CP2_rugosa">
+			
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGACTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_CP1_rugosa">
+			
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGCTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_ST1_barbata">
+			
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAACTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACC-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-T-TA [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_ST1_lucida">
+			
+			AAGGATCATTGAATC-TATCGTA-CCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAACTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACC-AG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-T-TA [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_EP1_lucida">
+			
+			AAGGATCATTGAATC-TATCGTA-CCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAACTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACC-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-T-TA [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_TC1_barbata">
+			
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_B1_gracilis">
+			
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_K148_gracilis">
+			
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_K141_gracilis">
+			
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_T23b_lupina">
+			
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_T23a_lupina">
+			
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCTTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_CL1_rugosa">
+			
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_V1_rugosa">
+			
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_TC1_lupina">
+			
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_ST2_lupina">
+			
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_MV1_lupina">
+			
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_KM2_lupina">
+			
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_CL1_lupina">
+			
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_SH1_lupina">
+			
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGCTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_L22b_lupina">
+			
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGCTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_DP1_lupina">
+			
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGCTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_TB1_lupina">
+			
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGCTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATC-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_T4_lupina">
+			
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGCTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATC-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_AP1_lupina">
+			
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGCTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATC-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_CT3_lucida">
+			
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGCTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATC-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_CT2_barbata">
+			
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGCTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATC-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_K1_gracilis">
+			
+			AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGCTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATC-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAACA-C---TT--C----AAA-G-TA [...]
+		</sequence>
+<sequence taxon="Trebouxia_jamesii_Z68701">
+			
+			AAGGATCATTGAATC-TATCGTG-CAAACACCGAGAA-CCTACTTATGCCCTCTA--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ACAAG-C-G--GCAGCTCCCTTCAAGCAG-CTG-CC-ATTG-T-GA--GTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAACATCAATT-GGGG-CCTTTCTGTCTTTTAGGCGGTGA-GG-TCT-ACC-GG-TTGTGAGGGGTGGCTTTCAA-CAAC---CT--C----AAA---T- [...]
+		</sequence>
+<sequence taxon="Trebouxia_jamesii_AF128270">
+			
+			NNNNNNNNNNNAATC-TATCGTG-TAAACACCGAGAA-CCTACTTATGCCCTCTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ACAAG-C-G--GCAGTTCCCCTTGAGGAGTCT--CC-TTTG-T-GA--GTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAATATCAATT-GGGG-CCTTTCTGCCTTTTGGGCGGTCA-GG-TCT-ACC-GG-TTGTGAGGGGTGGCTTTCAA-CAAT---CT--C----AAAAG-TA [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_P_furfuracea">
+			
+			AAGGATCATTGAATC-TATCGTG-CAAACACCGAGAA-CCTACTTATGCCCTCTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ACAAG-C-G--GTAGCTCCCCTTGGGGAG-TTG-CC-TTTG-T-GA--GTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAATATCAATT-GGGG-CCTGTCTGCCTTTTAGGCGGTCA-GG-TCT-ACC-GG-TTGTGAGGGGTGGCTTTCAA-CAAC---CT--C----AAAA-CTA [...]
+		</sequence>
+<sequence taxon="Trebouxia_jamesii_Z68700">
+			
+			AAGGATCATTGAATC-TATCGTG-CAAACACCGAGAA-CCTACTTATGCCCTCTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ACAAG-C-G--GTACGTCCCCTTGGGGAG-TTG-CC-TTTG-T-GA--GTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAATATCAATT-GGGG-CCTGTCTGCCTTTTAGGCGGTCA-GG-TCT-ACC-GG-TTGTGAGGGGTGGCTTTCAA-CAAC---CT--C----AAAA-CTA [...]
+		</sequence>
+<sequence taxon="Trebouxia_jamesii_Z68699">
+			
+			AAGGATCATTGAATC-TATCGTG-CAAACACCGAGAA-CCTACTTATGCCCTCTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ACAAG-C-G--GTAGCTCCCCTTGGG-AG-TTG-CC-TTTG-T-GA--GTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAATATCAATT-GGGGTCCTGTCTGCCTTTTAGGCGGTCA-GG-TCT-ACC-GG-TTGTGAGGGGTGGCTTTCAA-CAAC---CT--C----AAAA-CTA [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_IT2_vulpina">
+			
+			AAGGATCATTGAATC-TATCGTG-CAAACACCGTGAA-CCTACTTATGCCCTCTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ACAAG-C-G--GCAGCTCCCCTCAAGGAG-TTG-CC-TTTG-T-GA--GTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAAAATCAATT-GGGG-CCTTTCTGCCTTTTGGGCGGTAA-GG-TCT-ACC-GG-TTGTGAGGGGTGGCTTTCAA-CAAC---CT--C----AAAAG-TA [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_IT1_vulpina">
+			
+			AAGGATCATTGAATC-TATCGTG-CAAACACCGTGAA-CCTACTTATGCCCTCTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ACAAG-C-G--GCAGCTCCCCTCAAGGAG-TTG-CC-TTTG-T-GA--GTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAAAATCAATT-GGGG-CCTTTCTGCCTTTTGGGCGGTAA-GG-TCT-ACC-GG-TTGTGAGGGGTGGCTTTCAA-CAAC---CT--C----AAAAG-TA [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_AV3_vulpina">
+			
+			AAGGATCATTGAATC-TATCGTG-CAAACACCGTGAA-CCTACTTATGCCCTCTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ACAAG-C-G--GCAGCTCCCCTCAAGGAG-TTG-CC-TTTG-T-GA--GTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAAAATCAATT-GGGG-CCTTTCTGCCTTTTGGGCGGTAA-GG-TCT-ACC-GG-TTGTGAGGGGTGGCTTTCAA-CAAC---CT--C----AAAAG-TA [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_AV2_vulpina">
+			
+			AAGGATCATTGAATC-TATCGTG-CAAACACCGTGAA-CCTACTTATGCCCTCTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ACAAG-C-G--GCAGCTCCCCTCAAGGAG-TTG-CC-TTTG-T-GA--GTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAAAATCAATT-GGGG-CCTTTCTGCCTTTTGGGCGGTAA-GG-TCT-ACC-GG-TTGTGAGGGGTGGCTTTCAA-CAAC---CT--C----AAAAG-TA [...]
+		</sequence>
+<sequence taxon="Trebouxia_jamesii_AJ249571">
+			
+			AAGGATCATTGAATC-TATCGTG-CAAACACCGTGAA-CTTACTTATGCCCTCTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------AT--GAT-G-GGCAGCTCCCTTCAAGGAG-TTG-CC-TTTG-T-GA--GTGCGC--AGGTCAGGGGTTGG---CTCCTTTTGG-TGTCAATTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACC-GG-TTGTGAGGGGTGGCTTTCAA-CAAC---TC--C----AAAA-C-A [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_P_concosians">
+			
+			AAGGATCATTGAATC-TATCGTG-CAAACACCGTGAA-CTTACTTATGCCCTCTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------AT--GAT-G--GCAGCTCCCTTCAAGGAG-TTG-CC-TTTG-T-GA--GTGCGC--AGGTCAGGGGTTGG---CTCCTTTTGG-TGTCAATTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTAAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCTTTCAA-CAAC---TT--C----AAAA-C-A [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_P_cladonia">
+			
+			AAGGATCATTGAATC-TATCGTG-CAAACACCGTGAA-CTTACTTATGCCCTCTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------AT--GAT-G--GCAGCTCCCTTCAAGGAG-TTG-CC-TTTG-T-GA--GTGCGC--AGGTCAGGGGTTGT---CTCCTTTTGG-TGTCAATTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTCGCCTTTCAGGC-TTAAAGG-TTT-ACC-GG-TTGTGAGGGGTGGCTTTCAA-CAAC---TT--C----AAAA-C-A [...]
+		</sequence>
+<sequence taxon="T_rebouxia_jamesii_AF128271">
+			
+			NNNNNNNNNNNAATC-TATCGTG-CACACACCGAGAA-CCTACTTATGCCCTCTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATCAG-C-G--GCAGCTCTTTTCAAG-AG-TTG-CC-TTTG-T-GA--GTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGATTGGGCGGGTCCAACATCAATT-GGGA-CCTTTCTGCCTGTTAGGCGGTAA-GG-TCT-GCC-GG-TTGTGAGGGGTGGCTTTCAA-CAAC---CA--C----AAA--C-A [...]
+		</sequence>
+<sequence taxon="T_rebouxia_galapagensis_AJ249567">
+			
+			AAGGATCATTGAATC-TATCGTG-CCAACACCGCGAA-CTTTCTAATGCCCTC-CTG-T---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CAT--GTTAGC-----CTTTTGAAAAAAGGCTTGACTGT--G---GCAGGTGCGT-AAGG-CAGGGGCTGGCA--TC-TTATGG-TGTCGGTTAGCCTGTCTGGGCGGGTCCAATATCAATTGGGGG-CCTCTTGGCC--ACTGG--GTAAGGGGACT-GCCCGA-TTGTGAGGGGTGGCT-GT---CAA--TCCACACT--CAACA-CAA [...]
+		</sequence>
+<sequence taxon="Trebouxia_higgensiae_AJ249574">
+			
+			NNNNNNNNNNNNNNN-NNNNNNG-NCAACACCGCGNA-CTTTCTAATGCCCTC-CTG-T---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CAT--GTTAGC-----CTTTTGAAAAAAGGCTTGACTGT--G---GCAGGTGCGT-AAGG-CAGGGGCTGGCA--TC-TTATGG-TGTCGGTTAGCCTGTCTGGGCGGGTCCAATATCAATTGGGGG-CCTCTTG-CCC-ACTGG-GGTAAGGGGACTTGCCCGA-TTGTNAGGGGTGGCT-GT---CAA--TCCACACT--CAACA-CAA [...]
+		</sequence>
+<sequence taxon="Trebouxia_usneae_AJ249573">
+			
+			AAGGATCATTGAATC-TATCGTN-CCAACACCGNNNA-CTTACTGATGCCCTCT-TGCTA---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------AA--GACAGT-----CTTCCAACAAAAGACTTGTC--TT-G---GTAAGTGCGT--AGGTCAGGGGCCGGCA--TC-TTATGG-TGTCGGTTAGCCTGACTGGGCGGGTCCAATACCAATCCGGGG-CCCTTTA-CCTTACAAG---TGAAGGGACT-GCCTGGGTTGTGAGGGGTGGCT-GTTT--AA--CCC--ACTTGCAAT--CAA [...]
+		</sequence>
+<sequence taxon="Trebouxia_corticola">
+			
+			AAGGATCATTGAATC-TATCGTG-CCAACACCGCNAA-CTTACTGATGCCCTCT-TGCTA---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------AA--GACAGT-----CTTCCAACAAAAGACTTGTC--TT-G---GTAAGTGCGT--AGGTCAGGGGCCGGCA--TC-TTATGG-TGTCGGTTAGCCTGACTGGGCGGGTCCAATACCAATCCGGGG-CCCTTTA-CCTTACAGG---TGAAGGGACT-GCCTGGGTTGTGAGGGGTGGCT-GTTT--AA--CCC--ACTTGCAAT--CAA [...]
+		</sequence>
+<sequence taxon="Trebouxia_usneae_Z68702">
+			
+			AAGGATCATTGAATC-TATCGTG-CCAACACCGCGAA-CTTACTTATGCCCTC-CTGTTA--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------TAG--G-CATG-----CT-----CAAAAGGC--GT--GCC-TA-GATGGGTGCGT-AASS-CAGGGGCAGGCA--TC-TTATGG-TGTCAGTTAGCCTGGCTGGGCGGGTCCAACACCAATC-GGGG-CCTTTTG-CCTTTCAGG---CAAAGGGACTCGCTCGG-TTGTGAGGGGTGGCT-GTTT--AA--CTT--ACTTCCAAT--CAA [...]
+		</sequence>
+<sequence taxon="Trebouxia_impressa_AJ249570">
+			
+			AAGGATCATTGAATC-TATCGTG-CCCACACCGTGAA-CC-ATTTATGCCCTTTCTG-AA---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------AG--G-CAG------CTCTTGA-AAGGG-A--GTTTGCC-GATTGAAA--GCGC--AGGTCAGGGGCCG-CAGCTC--TTTGGCTGTCGGTTGACTTGACTGGGCGGGTCCAATACCAGTT-GGGTTCCTCT-TGCCTT---GGC-TTG-AGGTTC---CT-GG-CTGTGAGGGGTGGCTTG-----AAA-AAC--TCTT--AA--GCAA [...]
+		</sequence>
+<sequence taxon="Trebouxia_impressa_AJ249576">
+			
+			AAGGATCATTGAATC-TATCGTG-CCCACACCGTGAA-CC-ATTTATGCCCTTTCTG-AA---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------AG--G-CAG------CTCTTGA-AAGGG-A--GTTTGCC-GATTGAAA--GCGC--AGGTCAGGGGCCG-CARCTC--TTTGGCTGTCGGTTGACTTGACTGGGCGGGTCCAATACCAGTT-GGGTTCCTCT-TGCCTT---GGC-TTG-AGGTTC---CT-GG-CTGTGAGGGGTGGCTTG-----AAA-AAC--TCTT--AA--GCAA [...]
+		</sequence>
+<sequence taxon="Trebouxia_flava">
+			
+			AAGGATCATTGAATC-TATCGTG-CCCACACCGTGAA-CC-ATTGATGCCCTTTCTG-AA---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------AG--G-CAG------CTCCTGA-AAGGG-A--GTTTGCT-GATTGAAA--GCGC--AGGTCAGGGGCCG-CAGCTC--TTTGGCTGTCGGTTGACTTGGCTGGGCGGGTCCAATACCAGTT-GGGTTCCTCT-TGCCTT---GGC-TTG-AGGTTC---CT-GG-CTGTGAGGGGTGGCTTG-----AAA-AAC--TCTT--AA--GCA- [...]
+		</sequence>
+<sequence taxon="Trebouxia_potteri">
+			
+			AAGGATCATTGAATC-TATCGTG-CCCACACCGTGAA-CC-ATTTATGCCCTTTCTG-AA---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------AG--G-CAG------CTCCTGA-AAGGG-A--GTTTGCC-GATTGAAA--GCGC--AGGTCAGGGGCTG-CAGCTC--TTTGGCTGTCAGTTGACTTGGCTGGGCGGGTCCAATACCAGTT-GGGTTCCTCT-TGCCTT---GGC-TTG-AGGTTC---CT-GG-CTGTGAGGGGTGGCTTG-----AAA-CAC--TCTT--AA--GCAA [...]
+		</sequence>
+<sequence taxon="Trebouxia_from_U_arizonica">
+			
+			AAGGATCATTGAATC-TATCGTG-CCCACACCGTGAA-CC-ATTTATGCCCTCTCTG-AA---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------AG--G-CAA------TTGCTGA-AAGGC-A--A-TTGCC-GAGTGAGA--GCGC--AGGTCAGGGGCTG-CAGCTC--TTTGGCTGTCAGTTGACTTGGCTGGGCGGGTCCGATACCAGTT-GGGTTCCTCT-TGCCTTT--GGC-TTG-AGGTTG---CC-AG-CTGTGAGGGGTGGCTTG-----AAA-AAC--TTTT--AA--GCGA [...]
+		</sequence>
+<sequence taxon="Trebouxia_gelatinosa_Z68698">
+			
+			AAGGATCATTGAATC-TATCGTA-CCAACACCGCGAA-CC-ATTGATGTCCTCTC---AATTTACCCAGCAGGGTGCCGCGATACGTGCCGCT-----------------------------------------------------------------------------------------------------------TAATGGCATTGCCCATAAAGGGGTCCACGATACGTGCTGCAGCATTGCCTATAAAGGGGCCCGCGATACGTGCCT-----G--GACATT-G-AG-T-TT-A-AAGGGTA--AACTGCT-GGT-GAGA--GCGC--AGGTCAGGGGCTG-CAGCTC--TTTGGCTGT-AGTTGACTTGGCTGGGCGGGTCCAATACCAATT-GGGTTCCTCTCCTGTTTC--GGTTA-G-AGGTT---ACTCAG-CTGTGAGGGGTGACTTG------ACCAAC--AATT--AA--GC-- [...]
+		</sequence>
+<sequence taxon="Trebouxia_gelatinosa_Z68697">
+			
+			AAGGATCATTGAATCGTATCGTATCCCACACCGCGAA-CC-ATTGATGTCCTCTC---AATTTACCCAGCAGGGTGCCGCGATACGTGCTGTT------------------------------------------------------------------------------------------------------------AATGGCATTGCCTAAAAAGGGGTCCACGATACGTGCTACGGCATTGAGTTTAAAGGGGCCCGCGATACGTGCCT----AG--G-CATT-G-AG-T-TT-A-AAGGGTA--ACCTGCT-GGT-GAGA--GCGC--AGGTCAGGGGCTG-CAGCTC--TTTGGCTGT-AGTTGACTTGGCTGGGCGGGTCCAATACCAATT-GGGTTCCTCTTCGCCTTT--GGCTAAG-AGGCT---ACTCAG-CTGTGAGGGGTGACTTG------ATCAAC--TATT--AA--GC-- [...]
+		</sequence>
+<sequence taxon="Trebouxia_gelatinosa_AJ249575">
+			
+			AAGGATCATTGAATC-TATCGTN-CCCACACCGCGAA-CC-ATTTATGTCCTCTC---AATTTACCCAGCAGGGTGCCGCGATACGTGCTGTT-------------------------------------ACTGCATTGCCCATAAAGGGGTCCAATTTACCC----------AGC--AGGGTGCC-GCGATACGTGCTGTTACTGCATTGCCCATAAAGGGGTCCACGATACGTGCTGTAGCATTGTCCATAAAGGGGCCCGCGATACGTGCCT----AG--G-CATT-G-AG-T-TT-A-AANNTTA--AACTGCT-GGT-GAGA--GCGC--AGGTCAGGGGCTG-CAGCTC--TTTGGCTGT-AGTTGACTTGGCTGGGCGGGTCCAATACCAGTG-GGGTTCCTCTTTGCTTTT--GGCTTAG-AGGTT---ACTCAG-CTGTGAGGGGTGACTTG------ACCAAC--TATT--AA--GC-- [...]
+		</sequence>
+<sequence taxon="Trebouxia_gelatinosa_AJ249568">
+			
+			AAGGATCATTGAATC-TATCGTA-CCCACACCGCGAA-CC-ATTAATGTCCTCTCTGGAATTTACCCAGCAGGGTGCCGCGATACGTGCTGTTGATAATTTACCCAGCAGGGCCGCGATACGTGCTGTTGATGGCATTGCCCAAAAAGGGGTCCACGATACGTGCTGTAGCATTGCGAAAGGGGCCCACGATACGTGCT---TCGGCATTGCCTAAAAAGGGGTCCACGATACGTGCTACAGCATTGAGTTTAAAGGGGCCCGCGATACGTGCCTGAAGAG--G-C-GT---TT-TACT---AAGGGTA--AACTGCT-GGT-GAGA--GCGC--AGGTCAGGGACTG-CAGCTC--TTTGGCTGT-AGTTGACTTGGCTGGGCGGGTCCAATACCAATT-GGGTTCCTCTTTGCCTTT--GGCTGAG-AGGCT---ACTCAG-CTGTGAGGGGTGACTTG------ACCAAC--TGTT--AA--GC-- [...]
+		</sequence>
+<sequence taxon="Trebouxia_gigantea">
+			
+			AAGGATCATTGAATC-TATCGTG-CCCACACTGCGAAAAT-ACTTATGCCCTT-CTGGAG--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------TAG--G-CAG----A-CTTT----------ATTGTTTGCT-CTTCG-G-TTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAATACCAGCC-GGACTCACCT-TGCCTTCTAGGC-TTG-GGGTTCT-GCC-GG-TTGTGAGGGGTGGCT-GTTT--AACCCAC--TTT---AA--GCAA [...]
+		</sequence>
+<sequence taxon="Trebouxia_gigantea_AJ249577">
+			
+			NNNNNNNNNNNNNNNNNNNNNNN-NCCACACTGCGAAA-T-ACTTATGCCCTT-CTGGAG--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------TAG--G-CAG----A-CTTT----------ATTGTTTGCT-CTTCG-G-TTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAATACCAGCC-GGACTCACCT-TGCCTTCTAGGC-TTG-GGGTTCT-GCC-GG-TTGTGAGGGGTGGCT-GTTT--AACCCAC--TTTT--AA--GCAA [...]
+		</sequence>
+<sequence taxon="Trebouxia_showmanii">
+			
+			AAGGATCATTGAATC-TATCGTG-CCCACACCGCGAAAAT-ACTTATGCCCTT-CTGGAA--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CAA--G-CAA----A-CTCA----------ACAGTTTGTT-CTTC-AG-TTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAATACCAGTC-GGATTCACCT-TGCCTTATAGGC-TAG-GGGTTCT-GCC-GG-CTGTGAGGGGTGGCT-GCTC--AACTCAC--TCT---AA--GCAA [...]
+		</sequence>
+<sequence taxon="Trebouxia_asymmetrica_AJ249581">
+			
+			AAGGATCATTGAATC-TATCGTG-CCCACACCGCGAAACT-ACTTATGCCCTT-CTGGAA--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CCG--G-CAA----A-CTTT----------ATTGTTTGCC-CTTC-AG-TTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAACACCAGCC-GGACTCACCT-TGCCTTTTGGGC-TTG-GGGTTCT-GCC-GG-CTGTGAGGGGTGGCT-GTTT--AACCCAC--TTTT--AA--GCAA [...]
+		</sequence>
+<sequence taxon="Trebouxia_sp_AJ249572">
+			
+			AAGGATCATTGAATC-TATCGTG-CCCACACCGCGAA-CTTACTTATGCCCTT-CTGGAA--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CAG--G-CAG----A-CTTT----------GTTGTTTGCC-CTTC-AG-TTGCGT--AGGTCAGGGGTTGG---CTCCTTTTGG-TGTCAGTTCACTTGACTGGGCGGGTCCAACACCAGCC-GGATTCACCT-TGCCTTCTAGGC-TTG-GGGTTCT-GCC-GG-CTGTGAGGGGTGGCT-GTTT--AACTCAC--ATT---AA--GCAA [...]
+		</sequence>
+<sequence taxon="Trebouxia_arboricola_AJ249564">
+			
+			AAGGATCATTGAATC-TATCGTG-CCCACACCGCGAAAAT-ACTTATGCCCTT-CTGGGG-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------TCAG----CAA--G---CTTT----------ACTGCTTGCT-CTTC-AG-TTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAACACCAGCC-GGATTCACCT-TGTCT-CT-GGC-AAG-GGGTTCT-GCC-GA-CTGTGAGGGGTGGCT-GTTT--AACTCAC--TTT---AA--GCAA [...]
+		</sequence>
+<sequence taxon="Trebouxia_arboricola_AJ249481">
+			
+			AAGGATCATTGAATC-TATCGTG-CCCACACCGCGAAAAT-ACTTATGCCCTT-CTGGGG-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------TCAG----CAA--G---CTTT----------ACTGTTTGCT-CTTC-AG-TTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAACACCAGCC-GGATTCACCT-TGTCT--TGGGC-AAG-GGGTTCT-GCC-GG-CTGTGAGGGGTGGCT-GTTT--AACTCAC--TTT---AA--GCAA [...]
+		</sequence>
+<sequence taxon="Trebouxia_arboricola_Z68703">
+			
+			AAGGATCATTGAATC-TATCGTG-CCCACACCGCGAAAAT-ACTTATGCCCTT-CTGGGG-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------TCAG----CAA--G---CTTT----------ACTGTTTGCT-CTTC-AG-TTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAACACCAGCC-GGATTCACCT-TGTCT-CT-GGC-AAG-GGGTTCT-GCC-GG-CTGTGAGGGGTGGCT-GTTT--AACTCAC--TTT---AA--GCAA [...]
+		</sequence>
+</data>
+    <!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+    <input spec='HKY' id='hky'>
+        <kappa idref='hky.kappa'/>
+        <frequencies id='freqs' spec='Frequencies'>
+            <data idref='alignment'/>
+        </frequencies>
+    </input>
+
+    <!-- site model                                                              -->
+    <input spec='SiteModel' id="siteModel" gammaCategoryCount='1'>
+        <!--
+            <parameter name='shape' id='shape' value='0.5'/>
+            <parameter name='proportionInvariant' id='propInvar' value='0.2'/>
+        -->
+        <substModel idref='hky'/>
+    </input>
+
+    <input spec='TreeLikelihood' id="treeLikelihood">
+        <data idref="alignment"/>
+        <tree idref="tree"/>
+        <siteModel idref="siteModel"/>
+    </input>
+
+    <parameter id="hky.kappa" value="1.0" lower="0.0"/>
+
+    <tree id='tree'/>
+
+    <tree spec='beast.util.ClusterTree' id='upgmatree' clusterType='upgma' initial='@tree'>
+        <taxa idref='alignment'/>
+    </tree>
+    <tree spec='beast.evolution.tree.RandomTree' id='coalescentSimulator' initial='@tree' taxa='@alignment'>
+        <populationModel spec='ConstantPopulation'>
+            <popSize spec='parameter.RealParameter' value='1'/>
+        </populationModel>
+    </tree>
+
+
+    <run spec="MCMC" id="mcmc" chainLength="5000000" preBurnin="0">
+
+        <init idref='coalescentSimulator'/>
+        <distribution spec='CompoundDistribution' id='posterior'>
+<!--
+	make it comparable to the files in the BEAST 1 directory, that do not use a prior either
+            <distribution spec='beast.math.distributions.Prior' x='@hky.kappa'>
+                <distr spec='beast.math.distributions.OneOnX'/>
+            </distribution>
+-->
+            <distribution id='likelihood' idref="treeLikelihood"/>
+        </distribution>
+
+        <operator id='kappaScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" parameter="@hky.kappa"/>
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" tree="@tree"/>
+
+        <operator spec='SubtreeSlide' weight="5" gaussian="true" size="1.0" tree="@tree"/>
+
+        <operator spec='Uniform' weight="10" tree="@tree"/>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="1" tree="@tree"/>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="1" tree="@tree"/>
+        <operator spec='WilsonBalding' weight="1" tree="@tree"/>
+
+        <logger logEvery="10000" fileName="test.log">
+            <model idref='likelihood'/>
+            <log idref="likelihood"/>
+            <log idref='hky.kappa'/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+        </logger>
+        <logger logEvery="10000" fileName="test.trees">
+            <log idref="tree"/>
+        </logger>
+        <logger logEvery="10000">
+            <model idref='likelihood'/>
+            <log idref="likelihood"/>
+            <ESS spec='ESS' name='log' arg="@likelihood"/>
+            <log idref='hky.kappa'/>
+            <ESS spec='ESS' name='log' arg="@hky.kappa"/>
+        </logger>
+    </run>
+</beast>
+
diff --git a/examples/benchmark/mrbayes/experiment.sh b/examples/benchmark/mrbayes/experiment.sh
new file mode 100644
index 0000000..7e1cc27
--- /dev/null
+++ b/examples/benchmark/mrbayes/experiment.sh
@@ -0,0 +1,24 @@
+echo FILE M1044 > times.dat 
+time mb < run1044.nex >> times.dat 2>&1
+echo FILE M1366 >> times.dat 
+time mb < run1366.nex >> times.dat 2>&1
+echo FILE M1510 >> times.dat 
+time mb < run1510.nex >> times.dat 2>&1
+echo FILE M1748 >> times.dat 
+time mb < run1748.nex >> times.dat 2>&1
+echo FILE M1749 >> times.dat 
+time mb < run1749.nex >> times.dat 2>&1
+echo FILE M1809 >> times.dat 
+time mb < run1809.nex >> times.dat 2>&1
+echo FILE M336 >> times.dat 
+time mb < run336.nex >> times.dat 2>&1
+echo FILE M3475 >> times.dat 
+time mb < run3475.nex >> times.dat 2>&1
+echo FILE M501 >> times.dat 
+time mb < run501.nex >> times.dat 2>&1
+echo FILE M520 >> times.dat 
+time mb < run520.nex >> times.dat 2>&1
+echo FILE M755 >> times.dat 
+time mb < run755.nex >> times.dat 2>&1
+echo FILE M767 >> times.dat 
+time mb < run767.nex >> times.dat 2>&1
diff --git a/examples/benchmark/mrbayes/run1044.nex b/examples/benchmark/mrbayes/run1044.nex
new file mode 100644
index 0000000..4b90306
--- /dev/null
+++ b/examples/benchmark/mrbayes/run1044.nex
@@ -0,0 +1,6 @@
+begin mrbayes;
+   set autoclose=yes nowarn=yes;
+   execute testHKY1044.nex;
+   lset nst=2;
+   mcmc nruns=1 ngen=1000000 samplefreq=10000 file=testHKY.nex1;
+end;
diff --git a/examples/benchmark/mrbayes/run1366.nex b/examples/benchmark/mrbayes/run1366.nex
new file mode 100644
index 0000000..96124aa
--- /dev/null
+++ b/examples/benchmark/mrbayes/run1366.nex
@@ -0,0 +1,6 @@
+begin mrbayes;
+   set autoclose=yes nowarn=yes;
+   execute testHKY1366.nex;
+   lset nst=2;
+   mcmc nruns=1 ngen=1000000 samplefreq=10000 file=testHKY.nex1;
+end;
diff --git a/examples/benchmark/mrbayes/run1510.nex b/examples/benchmark/mrbayes/run1510.nex
new file mode 100644
index 0000000..2cd704c
--- /dev/null
+++ b/examples/benchmark/mrbayes/run1510.nex
@@ -0,0 +1,6 @@
+begin mrbayes;
+   set autoclose=yes nowarn=yes;
+   execute testHKY1510.nex;
+   lset nst=2;
+   mcmc nruns=1 ngen=1000000 samplefreq=10000 file=testHKY.nex1;
+end;
diff --git a/examples/benchmark/mrbayes/run1748.nex b/examples/benchmark/mrbayes/run1748.nex
new file mode 100644
index 0000000..8e50192
--- /dev/null
+++ b/examples/benchmark/mrbayes/run1748.nex
@@ -0,0 +1,6 @@
+begin mrbayes;
+   set autoclose=yes nowarn=yes;
+   execute testHKY1748.nex;
+   lset nst=2;
+   mcmc nruns=1 ngen=1000000 samplefreq=10000 file=testHKY.nex1;
+end;
diff --git a/examples/benchmark/mrbayes/run1749.nex b/examples/benchmark/mrbayes/run1749.nex
new file mode 100644
index 0000000..3ef9052
--- /dev/null
+++ b/examples/benchmark/mrbayes/run1749.nex
@@ -0,0 +1,6 @@
+begin mrbayes;
+   set autoclose=yes nowarn=yes;
+   execute testHKY1749.nex;
+   lset nst=2;
+   mcmc nruns=1 ngen=1000000 samplefreq=10000 file=testHKY.nex1;
+end;
diff --git a/examples/benchmark/mrbayes/run1809.nex b/examples/benchmark/mrbayes/run1809.nex
new file mode 100644
index 0000000..a2206d0
--- /dev/null
+++ b/examples/benchmark/mrbayes/run1809.nex
@@ -0,0 +1,6 @@
+begin mrbayes;
+   set autoclose=yes nowarn=yes;
+   execute testHKY1809.nex;
+   lset nst=2;
+   mcmc nruns=1 ngen=1000000 samplefreq=10000 file=testHKY.nex1;
+end;
diff --git a/examples/benchmark/mrbayes/run336.nex b/examples/benchmark/mrbayes/run336.nex
new file mode 100644
index 0000000..ada7ce8
--- /dev/null
+++ b/examples/benchmark/mrbayes/run336.nex
@@ -0,0 +1,6 @@
+begin mrbayes;
+   set autoclose=yes nowarn=yes;
+   execute testHKY336.nex;
+   lset nst=2;
+   mcmc nruns=1 ngen=1000000 samplefreq=10000 file=testHKY.nex1;
+end;
diff --git a/examples/benchmark/mrbayes/run3475.nex b/examples/benchmark/mrbayes/run3475.nex
new file mode 100644
index 0000000..b63a04b
--- /dev/null
+++ b/examples/benchmark/mrbayes/run3475.nex
@@ -0,0 +1,6 @@
+begin mrbayes;
+   set autoclose=yes nowarn=yes;
+   execute testHKY3475.nex;
+   lset nst=2;
+   mcmc nruns=1 ngen=1000000 samplefreq=10000 file=testHKY.nex1;
+end;
diff --git a/examples/benchmark/mrbayes/run501.nex b/examples/benchmark/mrbayes/run501.nex
new file mode 100644
index 0000000..467eaf4
--- /dev/null
+++ b/examples/benchmark/mrbayes/run501.nex
@@ -0,0 +1,6 @@
+begin mrbayes;
+   set autoclose=yes nowarn=yes;
+   execute testHKY501.nex;
+   lset nst=2;
+   mcmc nruns=1 ngen=1000000 samplefreq=10000 file=testHKY.nex1;
+end;
diff --git a/examples/benchmark/mrbayes/run520.nex b/examples/benchmark/mrbayes/run520.nex
new file mode 100644
index 0000000..4f4737d
--- /dev/null
+++ b/examples/benchmark/mrbayes/run520.nex
@@ -0,0 +1,6 @@
+begin mrbayes;
+   set autoclose=yes nowarn=yes;
+   execute testHKY520.nex;
+   lset nst=2;
+   mcmc nruns=1 ngen=1000000 samplefreq=10000 file=testHKY.nex1;
+end;
diff --git a/examples/benchmark/mrbayes/run755.nex b/examples/benchmark/mrbayes/run755.nex
new file mode 100644
index 0000000..142cc88
--- /dev/null
+++ b/examples/benchmark/mrbayes/run755.nex
@@ -0,0 +1,6 @@
+begin mrbayes;
+   set autoclose=yes nowarn=yes;
+   execute testHKY755.nex;
+   lset nst=2;
+   mcmc nruns=1 ngen=1000000 samplefreq=10000 file=testHKY.nex1;
+end;
diff --git a/examples/benchmark/mrbayes/run767.nex b/examples/benchmark/mrbayes/run767.nex
new file mode 100644
index 0000000..6d781e7
--- /dev/null
+++ b/examples/benchmark/mrbayes/run767.nex
@@ -0,0 +1,6 @@
+begin mrbayes;
+   set autoclose=yes nowarn=yes;
+   execute testHKY767.nex;
+   lset nst=2;
+   mcmc nruns=1 ngen=1000000 samplefreq=10000 file=testHKY.nex1;
+end;
diff --git a/examples/benchmark/mrbayes/testHKY1044.nex b/examples/benchmark/mrbayes/testHKY1044.nex
new file mode 100644
index 0000000..56cc6d4
--- /dev/null
+++ b/examples/benchmark/mrbayes/testHKY1044.nex
@@ -0,0 +1,67 @@
+#NEXUS
+begin data;
+	dimensions ntax=50 nchar=1133;
+	format datatype=dna missing=? gap=-;
+	matrix
+	Hypoxylon_atroroseum_U32411	?????????????????????????????????????????????????????????????????????????????????????AACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTTA--CGGAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCTCT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGAGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGCAGGGTCTTGGCCTGCCATGGTTACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATTCCGATAC- [...]
+	Daldinia_concentrica_U32402	????????????????????????????????????????AAGTTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACTGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGTTAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAACCCCGACTCA--CGGAGGG-GTGTATTTATTAGATTAAAAACCAATGNCCTTCGGGGCTCTTT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCNGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGCAGGGTCTTGGCCTGCCATGGTTACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC- [...]
+	Xylaria_hypoxylon_U20378	??????????????????????????????????????AAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACTTT-ATTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTCA--CGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCCTCGGGGCTTATA--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGCAGGGTCTTGGCCTGCCATGGTTTCAACGGGTAACGGAGGGTTAGGGCTCGANNCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGNAGGNGNNNAAATTACCCAATNCCGACAC-GGG [...]
+	Xylaria_curta_U32417	????????????????????????????????????????????????CCATGCATGTCTAAGTATAAGCAA--TTATACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTCA--CGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCCTCGGGGCTTTCT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGCAGGGTCTTGGCCTGCCATGGTTACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGG [...]
+	Ophiostoma_ulmi_M83261	??????????????????????????????????????????????????ATGCATGTCTAAGTATAAGCAA--TTATACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGCCCCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAACCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCCTCGGGGCTCACT--GGTGATTCATGATAACTTGTCGAATCGCACGGCCTTGCGCCGGCGATGGCTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGATCTGGGCCCGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGGCCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTC-GGGGA [...]
+	Ophiostoma_piliferum_U20377	?????????????????????????????????????????????????????????TCTAAGTATAAGCAA--TTATACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGCCCCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAACCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCCTCGGNNCTCACT--GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGCNNNNNCGATGGCTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGATCTGGGCCCGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGGNNCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTC- [...]
+	Sordaria_fimicola_X69851	?????????????????????????ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTTTAAGCAA--TTAAACCGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAACCCCGACTTC--GGAAGGG-GTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGNCTTCCT--GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGG [...]
+	Neurospora_crassa_X04971	TACCTGGTTGATTCTGCCAGTAGTCATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTTTAAGCAA--TTAAACCGCGAAACTGCGAATGGCT-CATTAAATCAGTTATAGTTTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAACCCCGACTTC--GGAAGGG-GTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTAACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGG [...]
+	Chaetomium_globosum_U20379	??????????????????????????????????????AAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACCGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGNCCTTCGGGGCTCTCT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATNCCGACAC-G [...]
+	Cercophora_septentrionalis_U32400	????????????????????????????????????????????????????????????????????????????????????AAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT-GCTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGNCCTTCGGGGCTCTCT--GGTGATTCATAATAACTTCTCGAATNNCANGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCC [...]
+	Gaeumannomyces_graminis_var_graminis	?????????????????????????????????????????????????????????TATAAGTTTAAGCAA--TTATACAGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAACCCCGACTTC--GGAAGGG-GTGTATTTATTAGATTAAAANCCAATGCCCTTCGGGGCTCACT--GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAAACGCCTGAGAAACGGCGTTTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAAT [...]
+	Magnaporthe_salvinii_U78546	?????????????????????????????????????????????????????????TCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAACCCCGACTTC--GGAAGGG-GTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAAACGCCTGAGAAACGGCGTTTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATGCCGACAC- [...]
+	Pyricularia_grisea_793	?????????????????????????????????????????????????????????TCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAACCCCGACTTC--GGAAGGG-GTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAAACGCCTGAGAAACGGCGTTTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATGCCGACAC-GGCGA [...]
+	Magnaporthe_grisea_Guy_11	??????????????????TGTAGTCATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAACCCCGACTTC--GGAAGGG-GTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAAACGCCTGAGAAACGGCGTTTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATGCCGACAC-GG [...]
+	Hypocrea_pallida_U32408	?????????????????????????????????????????????????????????????????????????????????GCGAAACTGCGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAATACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTTC--GGAAGGG-TTGTATTTATTAGATTAAAAACCAATGNCCTCTGGGGCTCTCT--GGTGAATCATGATAACTTGGCGAATCGACAGGCCTTGTGCCGGCGATGGCTCATTCAAATTTCTTCCCTATCAACTTTTGATGTTTGGGTATTGGCCAAACATGGTGGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGG [...]
+	Nectria_cinnabarina_U32412	?????????????????????????????????????????????????????????????????????????????????????????????????CT-CATTATATAAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTCCGGGGCTCACT--GGTGATTCATGATAACTCCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTATTGGCCAAACATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-G [...]
+	Hypomyces_polyporinus_U32410	????????????????????????????????????????????????????????????????????????????????????AAACTGCGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAATACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTTC--GGAAGGG-TTGTATTTATTAGATTAAAAACCAATGNCCTCTNGGGCTCTCT--GGTGAATCATGATAACTAGTCGAATCGACAGGCCTTGTGCCGGCGATGGCTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTATTGGCCAAACATGGTGGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC [...]
+	Claviceps_purpurea_U44040	??????????????????????????????????????????????????ATGCATGTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAATCCCGACTTA--CGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTCT-GGGCTCTCT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTAGTGGCCAAACATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTC-GG [...]
+	Glomerella_cingulata_U48427	????????????????????????????????????????????????????????GTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTTA--CGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGCTAGAGTAGTGTTCTAGCATGGTTACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC- [...]
+	Colletotrichum_gloeosporioides_U76339	??????????????????????????????????????????????????ATGCATGTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTTA--CGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGCTAGAGTAGTGTTCTAGCATGGTTACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGNAGGCGCGCAAATTACCCAA [...]
+	Microascus_trigonosporus_L36987	??????????????????????????????????????AAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACCGCGAAACTGCGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAGCACGTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAACCCCGACTTC--GGAAGGG-GTGTATTTATTAGATTAAAAGCCAANGCCCTTCGGGGCTCTGT--GGTGATTCATGATAACTTTTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGCGAGGGTCTTGTCCTCGCATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGA [...]
+	Petriella_setifera_U32421	??????????????????????????????????????AAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACCGCGAAACTGCGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAGCACATT-ACTACATGG-ATAACTGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAGCCAATGNCCTTCGGGGCTTCCT--GGTGATTCATAATAACTTTTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGCGAAGGTATTGTCTTCGCATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GG [...]
+	Ceratocystis_virescens_U32419	????????????????????????????????????????????????????????????AAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAGCACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTCA--CGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTTTCT--GGTGATTCATGATAACTTCTCGAATCGCATGGCCTTGCGCNGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGCGAAGGTTTTGTCTTCGCATGGTTACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAGGGAGCCTGAGAAATGGCTACCACTTTTAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACA [...]
+	Ceratocystis_fimbriata_U32418	?????????????????????????????????????????????AAGCCATGCATGTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAGCACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGNCCTTCGGGGCTTTCT--GGTGATTCATGATAACTTCTCGAATCGCATGGCCTTGCGCNGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGCGAAGGTCTTGTCTTCGCATGGTTACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAGGGAGCCTGAGAAATGGCTACCACTTTTAAGGAAGGCAGCAGGCGCGCAATTTACCCAATCCCGACA [...]
+	Leucostoma_persoonii_M83259	??????????????????????????????????????????????????ATGCAAGTCTAAGTTTAAGCAC--CTAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC- [...]
+	Diaporthe_phaseolorum_L36985	????????????????????????????????????????????????????????????????????????A--TAAACGGCGAAACTNNNAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCNGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCNNGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTC [...]
+	Melanconis_marginalis_ATCC56907	????????????????????????????????????????????????????????????????????????????????????????????????????CATTAAATCAGTTATCGTATATTTGATAGTTCCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAACCCCGACTTC--GGAAGGG-GTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCNA [...]
+	Gnomonia_setacea	?????????????????????AGTCATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACA--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAG-TAG- [...]
+	Valsa_ambiens_subsp._leucostomoides	?????????????????TTGTAGT-ATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACC--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATC [...]
+	Cryptodiaporthe_corni	????????????????TTGTTAGTCATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGTAAC--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAG [...]
+	Apiognomonia_supraseptata	????????????????????????????????????????????????????????????????????????????AAACGGCGAAACTGCGAACGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACTT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCCCT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACACAATGCCGATTC-GG [...]
+	Amphiporthe_castanea	????????????????TTGNAAGTCATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACA--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAGG [...]
+	Phomopsis_longicolla_U78778	?????????????????????????????????????????????????????????TCTAAGTTTAAGCACA--TAANCGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTC- [...]
+	Cryphonectria_parasitica_713	??????????????????TGTAGTCANANGCTAGTCTCNAAGANTAAGCCATGCAAGTNTAAGTTTAAGCACC--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATANCCGTGGTAATTCNAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC [...]
+	Endothia_gyrosa_L42443	????????????????????????????????????????????TAAGCCATGCAAGTCTAAGTTTAAGCACC--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGA [...]
+	Endothia_eugeniae	?????????????????TGTAAGTCATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACC--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAGGTAG [...]
+	Plagiostoma_euphorbiae	???????????????TGTAAANCANATACGCNTGTCTNAAANTTTAACCCANGCAAGTNTAAGTTTAAGCACA--TACGCGGCGAATCTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTTC--GGAAGGA-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGAAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGA [...]
+	Pleuroceras_pleurostylum	?????????????????TGNAANNCATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACA--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAACCCCGACTTC--GGAAGGG-GTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGG [...]
+	Gnomonia_padicola	?????????????????TGNAAGGCATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACA--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTCC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTATCCAATCCCGACAC-GGGGAGATAG [...]
+	Apioplagiostoma_aceriferum	????????????????TTGTAAGTCATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACA--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAACCCCGACTTC--GGAAGGG-GTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-G [...]
+	Apiosporopsis_carpinea	?????????????????TGAAAGTCATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACA--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGA [...]
+	Linospora_capreae	?????????????????TGGAANGCATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACA--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAACCCCGACTTC--GGAAGGG-GTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAGGTAG [...]
+	Discula_quercina	?????????????????????????ATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACA--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAG-TAGT [...]
+	Discula_campestris	????????????????????????TATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACA--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAG-TA [...]
+	Discula_fraxinae	?????????????????????TAATATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACA--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAG-TAGT [...]
+	Discula_destructiva_MD254	???????????????????????TCATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACA--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GG [...]
+	Discula_sp._326	???????????????????????T-ATATGCTTGTCTCAAAGATTAAGCCATGCAAGTCTAAGTTTAAGCACA--TAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTTC--GGAAGGG-ATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTATTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAG-TAGTG [...]
+	Saccharomyces_cerevisiae_Z75578	TATCTGGTTGATCCTGCCAGTAGTCATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA-TTTATACAGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTTCCTTTACTACATGGTATAACTGTGGTAATTCTAGAGCTAATACATGCTTAAAATCTCGACCCTTTGGAAGAG-ATGTATTTATTAGATAAAAAATCAATG-TCTTC-GGACTCTTT--GATGATTCATAATAACTTTTCGAATCGCATGGCCTTGTGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCTAA [...]
+	Candida_albicans_E15168	TATCTGGTTGATCCTGCCAGTAGTCATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA-TTTATACAGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAATCCCGACTGTTTGGAAGGG-ATGTATTTATTAGATAAAAAATCAATG-CCTTC-GGGCTCTTT--GATGATTCATAATAACTTTTCGAATCGCATGGCCTTGTGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATTCAGGGG [...]
+	Ambrosiozyma_platypodis_L36984	?????????????????????????????????????????????AAGCCATGCATGTCTAAGTATAAGCAA--TTATACAGTGAAACTGCGAATGGCTACATTAAATCAGTTANNGTTTATTTGATAGTTCCTTTACTACATGG-ATAACCGTGGTAATTCTTCGGCCAATACATGCTTAAAACCCCGACTCT--GGGAGGG-NNGCATTTATTAGATAAAAAATCAATGTCCTTCGGAACTTTTT--GATGATTCATAATAACTTTACGAAGCTCATGGCCTTGTGCTGGAGCTGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTTTACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCTGAC [...]
+
+;
+end;
+begin mrbayes;
+    [ HKY model, 4 gamma categories, 1 invariant site ]
+    lset nst=2;
+    lset rates=invgamma;
+    lset ngammacat=4;
+    [ strict clock model ]
+    prset brlenspr=clock:uniform;
+    mcmcp ngen=1000000 nchains=1 printfreq=10000;
+end;
diff --git a/examples/benchmark/mrbayes/testHKY1366.nex b/examples/benchmark/mrbayes/testHKY1366.nex
new file mode 100644
index 0000000..7af63a6
--- /dev/null
+++ b/examples/benchmark/mrbayes/testHKY1366.nex
@@ -0,0 +1,58 @@
+#NEXUS
+begin data;
+	dimensions ntax=41 nchar=1137;
+	format datatype=dna missing=? gap=-;
+	matrix
+	Zodiomyces_vorticellarius	?????????????????????AGTCATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAAC--TATACCGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCCAAAAA-CCCCGA-CTTA---CGAAGGGGTGTGTTTATTAGATAGCAAACCAATGCCCTTTTGGGCTC??TGTGGTGATTCATGATAACTTAACGTAGCGCATGGCCTTGCGCCGGCGCAGGATCATTCAAATACCTGCCCTATCAAGTTTCGATGTGAGGGTAGTGTCCTCACATGCTTTTGACGGGTAACGGGGAATTAGGGTTCGACTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC [...]
+	Xylaria_hypoxylon	????????????????????????????????TGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACTTT--ATTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGA-CTCA---CGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCCTCGGGGCTTATA--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGCAGGGTCTTGGCCTGCCATGGTTTCAACGGGTAACGGAGGGTTAGGGCTCGA??CCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAG?AGG?G???AAATTACCCAAT?CCGACAC-GGGGAGG [...]
+	Termitaria_snyderi	?????????????????????????????????????????????????????????TCTAAGTTTAAGCAA--GTATACTGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCGAAAAA-CCCCGA-CTTC---GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTTT-GGGCTCTTT--GGTGAATCATAATAACTAAACGAATCGCATGGCCTTGAGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATTGGTGAGTAGTGTTCACCAATGGTGTCGACGGGTAACGAAGAATTAGGGTTCGATCTCGGAGAGGACGCCTGAGAAACGGCGTC-ACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCAATT???????? [...]
+	Taphrina_deformans	??????????????????????????????????????AAAGATTAAGCCATGCATGTCTAAGTATAAGCAAT--TATACAGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCT-A-ATTACTTGG-ATACCCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGA-CTTCT--GGAAGGGATGTATTTATTAGATAAAAAACCAATGNCCTTCGGG?CTCCTT--GGTGATTCATAATAACTTTACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGAGGCCTACCATGGTTTTGACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCC-GACAC-GGGGAG [...]
+	Talaromyces_flavus	?????????????????????????ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCACTCTTTTACTGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCCT--ACTACATGG-ATACCTGTGGTAATTCTAGAGCTAATACATGCGCAAAA-CCCCGA-CTTC---GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTTCGGGGCTCCTT--GGTGAATCATAATAACTTCACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTGGCAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGAG [...]
+	Stigmatomyces_limnophorae	?????????????????????????CATATGCTTGTCTCAAAGATTAAGCCATGCATGTGTAAGTATAAGCAA-CTATACTGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATGGTACTTT--ACTACTTGG-ATATCCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CTCCAA-CTTA---CGAAGGAGTGTATTTATTAGATATTAAACCAATATTCTTCGGAATTTCT---GGTGATTCATAATAACTTTTCGCAGCGCATAGCTTCATGCTGGTGCGAGATCATTCAAATACCTGCCCTATCAAGTTTCGATGTGAGGGTAGTGTCCTCACATGCTTTTGACGGGTAACGGGGAATTAGGGTTCGACTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCTGACAC [...]
+	Sphaerostilbella_aureonitens	??????????????????????????????????????????????????????????????????????????????????????????????TGGCT-CATTATATAAGTTATCG?TTATTTGATAATACTTT--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAA?-TCCCGA-CTTC---GGAAGGGTTGTATTTATTAGATTAAAAACCAA?CTCGTCT?GGGCTCTCT--GGTGAATCATGATAACTAGTCGAATCGACAGGCCTTGTGCCGGCGATGGCTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTATTGGCCAAACATGGTGGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGA [...]
+	Smittium_culisetae	?????????????????????????????????????CAAAGATTAAGCCATGCATGTCTAAGTATAAACAAATTTATACAGTGAAACTGCGAATGGCT-CATTATATCAGTTATAATTTATTTGATGATACCTTTTACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCAAAAAACTCCCGA-CTTCT--GGAAGGGGGGCATTTATTAGATAAAAAACCAATGGGGGCAACCTCTTACTT-GGTGAGTCATAATAACTAAGCATATCGCATGGCCTTGTGCCGGCGAAGGATCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGTATAGAGGACTACCATGGTGGTAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACTTCTAAGGAGGGCAGCAGGCGCGCAAATTACCCAATCCTGACAC-AGGGAG [...]
+	Scorias_spongiosa	???????????????????????????????????????????????????????????TAAGTTTAAGCAAC--TATACGGTGAAACTGCGAATGGCT-CATTAAATCAGTTATTGTTTATTTGATAGTACCCTT-AATACATGG-ATACCCGTGGTAATTCTAGAG-TAATACATGCTAAAAA-CCCCGAGTCAC----GAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTTTGGGCTT?CAT--GGTGAATCATAATAACTTAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTATCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGG [...]
+	Pyxidiophora_SPO3	??????????????????????????????????????AAAGATTAAGCCATGCATGTCTAAGTATAAGCAACT-TATACCGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGA-CTTC---GGAAGGGGTGTATTTATTAGATAAAAAACCA--TCGTCTTCGGACTTCTT--GGTGATTCATAATAACTAAACGTAGCGCATGGCCTTGTGCTGGCGCAAAATCATTCAAATACCTGCCCTATCAAGCTTCGATGTGAGGGTAGTGTCCTCACATGCTTTTGACGGGTAACGGGGAATTAGGGTTCGACTCCGGAGAGGGAGCCTGAGAAATGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGG [...]
+	Pyxidiophora_sp1	??????????????????????????????????TCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAACTTTATACCGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGA-CTTC---GGAAGGGGTGTATTTATTAGATAAAAAACCATCG?-TCTTCGGACTCTTT--GGTGATTCATAATAACTAAACGTAGCGCATGGCCTTGTGCTGGCGCAAAATCATTCAAATACCTGCCCTATCAAGCTTCGATGTGAGGGTAGTGTCCTCACATGCTTTTGACGGGTAACGGGGAATTAGGGTTCGACTCCGGAGAGGGAGCCTGAGAAATGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGT [...]
+	Protomyces_inouyei	??????????????????????????????CTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAAT-TTATACAGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCCT--ACTACTTGG-ATACCCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGA-CTTCT--GGAAGGGATGTATTTATTAGATAAAAAACCAATGC??TTCGGG?CTCCTT--GGTGATTCATAATAACTTTACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGAGGCCTACCATGGTTTTGACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCC-GACAC-GGGGAG [...]
+	Petriella_setifera	???????????????????????TCATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACCGCGAAACTGCGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAGCACATT--ACTACATGG-ATAACTGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGA-CTTC---GGAAGGGATGTATTTATTAGATTAAAAGCCAATG?CCTTCGGGGCTTCCT--GGTGATTCATAATAACTTTTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGCGAAGGTATTGTCTTCGCATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAG [...]
+	Ophiostoma_ulmi	??????????????????????????????????????????????????ATGCATGTCTAAGTATAAGCAA--TTATACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGCCCCTT--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAA-CCCCGA-CTTC---GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCCTCGGGGCTCACT--GGTGATTCATGATAACTTGTCGAATCGCACGGCCTTGCGCCGGCGATGGCTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGATCTGGGCCCGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGGCCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTC-GGGGAGGTA [...]
+	Ophiostoma_piliferum	?????????????????????????????????????????????????????????TCTAAGTATAAGCAA--TTATACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGCCCCTT--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAA-CCCCGA-CTTC---GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCCTCGG??CTCACT--GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGC?????CGATGGCTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGATCTGGGCCCGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGG??CCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGC?CGCAAATTACCCAATCCCGACTC-GGGG [...]
+	Neurospora_crassa	TACCTGGTTGATTCTGCCAGTAGTCATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTTTAAGCAA--TTAAACCGCGAAACTGCGAATGGCT-CATTAAATCAGTTATAGTTTATTTGATAGTACCTT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGA-CTTC---GGAAGGGGTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTAACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGG [...]
+	Neocallimastix_frontalis	????????????????????TAGTCATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAACAATTCTATACTGTGAAACTGCGAATGGCT-CATTAAATCAGTTATAGTTTATTTGATAGTACCATT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCGTAAAAA-CCCGA-CTTCT--GGAAGGGTTGTATTTATTAGATAAAAAACCAACCTGGGCAACCAGTTTTTT-GGTGATTCATAATAACTTTTCGAATCGTATGACTTTACGTCGACGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGAGGCCTACCATGGTTTTAACGGGTAACGGAGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCTAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCTGACAC- [...]
+	Mucor_mucedo	?????????????????????????????????????CAAAGATTAAGCCATGCATGTCTAAGTATAAATAAATTTATATCGTGAAACTGCGAATGGCT-CATTAAATCAGTTATGATCTACGTGACA?TATTCTTTACTACTGGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCAAAAACGCCTCGA-CTTAC--GAAGGGGTGCACTT?ATTAGATAAAG??CCAACGCTGGGTAAAACCATCCTTGGTGATTCATAATAATTTAGCGGAT-GCATGGCCTTGTGCTAGCGACGGTCCACTCGATTTTCTGCCCTATCATGGTTAGATTGTAAGATAGAGGCTTACAATGCCTACAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAGGTAGTG [...]
+	Morchella_esculenta	??????????????????????????????????????AAAGATTAAGCCATGCAAGTCTAAGTATAAGCAATA-TATACAGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGA-CTTCAC-GGA?GGGGTGTATTTATTAGATAAAAAACCAATG??CCTT?CGGGCTCCTT-GGTGATTCATGATAACTTAACGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGA [...]
+	Monascus_purpureus	??????????????????????????????????????????????????ATGCATGTCTAAGTGTAAGCAATT-TATACTGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT--ACTACATGG-ATACCTGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGA-CTTC---GGAAGGGGTGTATTTATTAGATAAAAAACCAACGCCCTTCGGGGCTCCTT--GGTGAATCATAATAACTAAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTGGCAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAG [...]
+	Microascus_trigonosporus	????????????????????????????????TGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACCGCGAAACTGCGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAGCACGTT--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGA-CTTC---GGAAGGGGTGTATTTATTAGATTAAAAGCCAA?GCCCTTCGGGGCTCTGT--GGTGATTCATGATAACTTTTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGCGAGGGTCTTGTCCTCGCATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC- [...]
+	Melanospora_zamiae	?????????????????????????????????????????????????????????????AGTATAAGCAA--TTATACAGCGAAACT?CGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAGTGCCTT--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAG-CCCCGA-CTTA---CGGAGGGG?CTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCTTT--GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTAGTGGCCAAACATGGTGGCAACGGGTAACGGAGGGTTAGG?CTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTCCTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCTCAACTC-GAGGAG [...]
+	Melanospora_fallax	??????????????????????????????????????????????????????????????GTATAAGCA---TTATACCGCGAAACTGCGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAGTACCTT--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAG-CCCCGA-CTTA---CGGAGGGGTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCTCT--GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTCTTGGCCAAACATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTC-GGGGAG [...]
+	Leucostoma_persoonii	??????????????????????????????????????????????????ATGCAAGTCTAAGTTTAAGCAC--CTAAACGGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTATATTTGATAGTACCT---ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAA-TCCCGA-CTTC---GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT--GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGG [...]
+	Laboulbeniopsis_termitarius	???????????????????????????????????????????????????????????????????????????TATACTGTGAAACTGGGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATGGTACCTT--ACTACATGG-ATAACCGTGGTAATTCTGGAGCTAATACATGCAAATAA-TCTCGA-CGTA---AGAAGGGATGTATTTATTAGATAAAAAACCAATGCCATTTCGGTGGTATG-TGGTGATTCATAATAACTGAACTTAGCGTATGGCCTTTGGCTGACGCAAGATCATTCAAATACCTGCCCTATCAAGTTTCGATGTGAAGGTAGTGTCCTCACATGCTTTTGACGGGTAACGGGGAATTAGGGTTCGACTCCGGAGAGGGAGCCTGAGAAATGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGAC [...]
+	Kathistes_calyculata	??????????????????????????????????????????????????ATGCATGTCTAAGTATAAGCA?--TTATACAGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCCC--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCGCAAAA-GCCCGA-CTTA---CGAAGGGCTGTATTTATTAGATAAAAAACCAATG?CCTCCGGGGCTCTTT--GGTGATTCATAATAACTTAACGAATCGCATGGCCTTGAGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATTGGTGAGTAGTGTTCACCAATGGTGTCGACGGGTAACGAAGAATTAGGGTTCGATCTCGGAGAGGACGCCTGAGAAACGGCGTACACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAAT?CCGATAC-GGGG [...]
+	Kathistes_analemmoides	??????????????????????????????????????????????????ATGCATGTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCCC--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCGCAAAG-GCCCGA-CTTA---CGAAGGGC?GTATTTATTAGATAAAAAACCAATG?CCTTCGGGGCTTCTT--GGTGATTCATGATAACTTAACGAATCGCATGGCCTTGAGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATTGGTGAGTAGTGTTCACCAATGGTGTCGACGGGTAACGAAGAATTAGGGTTCGATCTCGGAGAGGACGCCTGAGAAACGGCGTACACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAAT?CCGATAC-GG [...]
+	Hesperomyces_coccinelloides	??????????????????????????????????????AAAGATTAAGCCATGCATGTCTAAGTATAAGCATT--TATACTGTGAAACTGCGAATGGCT-CATTAAATCAGTTATTGTTTATTTGATGGTACCTTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGA-CTCA---CGAAGGGGTGTATTTATTAGAT?TC?AAACCAGTGTCCTTCGGGACTTTTT-GGTGACTCATAATAACTTAATGCAGCGCATGGCCTTGTGCCGGCGCGGGATCATTCAAATACCTGCCCTATCAAGTTTCGATGTGAGGGTAGTGTCCTCACATGCTTTTGACGGGTAACGGGGAATTAGGGTTCGACTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGAC [...]
+	Graphium_calicioides	???????????????????????TCATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAAT--CATACTGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTTT-ACC---TGG-ATNNCCGTGGTANTTCTAGAGCTAATACATGCTAAAAA-CCCCGA-CTTC---GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTTTGGG?CTCCTT--GGTGATTCATAATAACTTAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATTGTAAGATAGAGGCTTACAATGGTCTTAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATTC-GGGG [...]
+	Entomophthora_muscae	?????????????????????????????????????CAAAGATTAAGCCATGCATGTCTAAGTATAAGCTAAACCTTACAGTGAAACTGCGAATGGC?-CATTAAATCAGTTATAATTTATTTGATCTTTCCTT--ACCAGT?GG-ATATCCGTGGTAATTCTAGAGCTAATACATATACGCGAAGACCCAACTTCT--GGAAGGGTTGTATTTATTAGATAAAAAACCAATGTGGGCAACCACTTTTTT-GGTGATTCATAGTAACTTTACTGATCGCAATTTATTGCGACATATCATAA??????AAATTTCTGCCCTATCAACTTTCGATGGTAAGGTAGTGGCTTACCATGGTTTTTACGGGTGACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCTGATAC-AGGG [...]
+	Endomyces_scopularum	??????????????????????????????????????AAAGATTAAGCCATGCATGTCTAAGTATAAGCATT--TATACAGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTACAG?-CCCCGA-CTCA---CGAAGGGGTGTATTTATTAGATAAAAAATCAA????????????CATATT--GATGATTCATAATAACTTGTCGAACCGCATGGCTTCATGCCGGCGGTGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGAGGCCTACCATGGTTTCAACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAGCGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGG [...]
+	Elaphomyces_maculatus	?????????????????????????????????????????????????????????TCTAAGTATAAGCAATC-TATACGGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT--GCTACATGG-ATACCTGTGGTAATTCTAGAGCTAATACATGCTGAAAA-TCCCGA-CTCC---GGAAGGGATGTATTTATTAGATAAAAAACCAATGCCCTTCGGGGCTTCTT--GGTGATTCATAATAACTGCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTGGCAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATCC-GGG [...]
+	Cladonia_subcervicornis	???????????????????????TCATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAATC-TATACGGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT--ACTACTTGG-ATACCTGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCTCGA-CTTC---GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTTCGGGGCTCCTT--GGTGATTCATAATAACTTAACGAATCGCATGGCCTTGAGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGTATAGAGGACTACCATGGTTTCTACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-G [...]
+	Chytridium_confervae	??????????????????????????????????????AAAGATTAAGCCATGCATGTCTAAGTATAAACAAATTTGTACTGTGAAACTGCGAATGGCT-CATTAAATCAGTTATAGTTTATTTGATAATACCTT--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCAATAAAAGGCCGA-CTTCT--GGAAGGCCTGTATTTATTAGATAAAAAACCAACCCGGAAACGGTTCTTT??-GGTGATTCATAGTAACTTTTCGAATCGCATGACTTTACGTCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGAGGCCTACCATGGTTTTAACGGGTAACGGCGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCTAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCTGATTC-AGGG [...]
+	Ceramothyrium_linnaeae	??????????????????????????????????????????????????ATGCATGTCTAAGTATAAGCAAT-CTATACTGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTTT-ACC---TGG-ATAACCGTGGTAATTCTAAAGCTAATACATGCTAAAAA-TCCCGA-CTTC---GGAAGGGATGTATTTATTAAATAAAAAACCAATGCCCTTCGGGGCTCCTT--GGTGAATCATAATAACTTAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAAGGTCTTGGCTTACCATGGTCTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAAAGGGAGCCTGAAAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GG [...]
+	Capnodium_dermatum	????????????????????TAGTCATATGCTTGTCTCAAAGATTAAGCCATGCATGT-TAAGTATAAGCAAC--TATACGGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT--ACTACATGGCATAACCGTGGTAATTCTAGAGCTAATACCCGCTAAAAA-CCCCGA-CTTC---GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTTCGGGGCTCCCT--GGTGAATCATAATAACTTAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAAGATAGTGGCCTACCATGGTATCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGGACGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC-GGGGAG [...]
+	Capniomyces_stellatus	??????????????????????????????????????AAAGATTAAGCCATGCATGTCTAAGTATAGACAAATTTATACAGTGAAACTGCGAATGGCT-CATTATATCAGCTATAATTTATTTGATGATACCTTTTACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCACTAAACACTCCGACTTCT--GGAAGGAGAGCATTTATTAGATACAAAACCAATGGGGGCAACCTCTTACTT-GGTGAATCATAATAACT?AAGCATATGCATGGCCTTGAGCCGGCGAAGGATCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGTATAGAGGACTACCATGGTGGTAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACTTCTAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCTGACAC-AGG [...]
+	Candida_albicans	??TCTGGTTGATCCTGCCAGTAGTCATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA-TTTATACAGTGAAACTGCGAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAGTACCTT--ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAA-TCCCGA-CTGTTT-GGAAGGGATGTATTTATTAGATAAAAAATCAATG?CCTTC?GGGCTCTTT--GATGATTCATAATAACTTTTCGAATCGCATGGCCTTGTGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATTCAGGGGAGGT [...]
+	Balansia_sclerotica	?????????????????????????ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTGTACTGCGAAACTGCGAATGGCT-CATTATATAAGTTATCGTTTATTTGATAGTGCCCT--ACTACTTGG-ATAACTGTGGTAATTCTAGAGCTAATACATGCTACAAA-TCCCGA-CTTC---GGAAGGGATGTATTTATTGGATTAAAAACCAATGCCCCCT?GGGCTCTCT--GGTGACTCACGATAACTGCTCGAATCGCACGGCCCTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTAGTGGCCAAACATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAAT?CCGACAC-GGGGA [...]
+	Ascobolus_denudatus	????????????????????????????????????????????????????GCATGTCTAAGTATAAGCAACT-TGTACAGTGAAACTGCNAATGGCT-CATTAAATCAGTTATCGTTTATTTGATAATCCCTT--ACTACATGG-ATACCTGTGGTAATTCTAGAGCTAATACATGCTTCAAGGAGTGGC-TTTC---GTC?ACTCTGCACTTATTAGATAAAAAACCAATGCCCCTTTGGGGCTCCCT-GGTGATTCATAATAATTTAGCGGACCGCATTCCCTCGAGGAGGCGGTGGATCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATAC-GGGGA [...]
+	Ambrosiozyma_platypodis	?????????????????????????????????????????????AAGCCATGCATGTCTAAGTATAAGCAA--TTATACAGTGAAACTGCGAATGGCTACATTAAATCAGTTA??GTTTATTTGATAGTTCCTTT-ACTACATGG-ATAACCGTGGTAATTCTTCGGCCAATACATGCTTAAAA-CCCCGA-CTCT---GGGAGGG??GCATTTATTAGATAAAAAATCAATGTCCTTCGGAACTTTTT--GATGATTCATAATAACTTTACGAAGCTCATGGCCTTGTGCTGGAGCTGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTTTACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCTGACAC-A [...]
+
+;
+end;
+begin mrbayes;
+    [ HKY model, 4 gamma categories, 1 invariant site ]
+    lset nst=2;
+    lset rates=invgamma;
+    lset ngammacat=4;
+    [ strict clock model ]
+    prset brlenspr=clock:uniform;
+    mcmcp ngen=1000000 nchains=1 printfreq=10000;
+end;
diff --git a/examples/benchmark/mrbayes/testHKY1510.nex b/examples/benchmark/mrbayes/testHKY1510.nex
new file mode 100644
index 0000000..47bf6fe
--- /dev/null
+++ b/examples/benchmark/mrbayes/testHKY1510.nex
@@ -0,0 +1,53 @@
+#NEXUS
+begin data;
+	dimensions ntax=36 nchar=1812;
+	format datatype=dna missing=? gap=-;
+	matrix
+	Didelphis_virginiana	CCCTATCCAATACAACTAGGTTTCCAAGACGCTACATCTCCTATTATAGAAGAACTTATATACTTTCATGATCATACATTAATAATTGTATTTCTGATCAGTTCACTAGTATTATATATTATTATTCTTATACTTACTACAAAACTTACTCACACAAGCACTATAGATGCCCAAGAAGTGGAAACAATTTGAACAATTTTACCAGCCGTAATTCTTATCCTTATTGCCCTTCCTTCCTTACGAATTCTTTACATAATAGATGAAATCTATAATCCTTATCTAACAGTTAAAGCAATGGGTCATCAATGATATTGAAGCTATGAGTTCACAGACTATGAAAATTTAATATTCGACTCATACATAATCCCAACCAAAGACCTTAGTCCTGGGCAACTTCGTTTACTAGAAGTTGATAACCGAATTGTTCTCCCAATAGAACTACCAATTCGCATGCTAATTTCATCAGAAGA [...]
+	Equus_caballus	GCCTACCCCTTCCAACTAGGATTCCAAGACGCAACATCCCCTATTATAGAAGAACTCCTACACTTCCACGACCACACACTAATAATCGTATTCCTAATTAGCTCTCTAGTATTATATATTATCTCATCAATACTAACAACTAAATTAACCCATACCAGCACCATAGATGCTCAAGAAGTAGAGACAATTTGAACGATTTTACCAGCCATCATCCTTATTCTAATCGCCCTCCCATCCCTACGAATTCTATATATAATAGATGAAATCAATAATCCGTCCCTCACAGTCAAAACAATAGGCCACCAATGATACTGAAGCTACGAGTATACCGATTACGAAGACTTGACCTTTGACTCCTACATGATCCCCACATCAGACCTAAAACCAGGAGAATTACGTCTTCTAGAAGTCGACAATCGAGTGGTTCTCCCCATAGAAATAACCATCCGAATGCTAATTTCATCCGAAGACGTCCT [...]
+	Rhinoceros_unicornis	GCTTATCCACTTCAACTAGGATTTCAAGATGCAACATCCCCTATTATAGAAGAATTACTCCATTTCCATGACCATACACTGATAATCGTATTTTTAATTAGCTCCCTAGTGCTGTATATTATTTCACTCATGCTAACAACCAAACTAACACACACAAGCACTATAGACGCTCAAGAAGTAGAGACCATCTGAACGATTTTACCAGCTATTATCCTAATTTTAATTGCTCTCCCATCGCTACGAATCCTCTATATAATAGATGAGATTAATAATCCTTCCTTAACCATCAAAACCATAGGCCATCAGTGATACTGAAGCTACGAATATACAGATTATGAAGACCTAACCTTTGACTCCTACATAATTCCCACATCAGATCTAAAACCAGGAGAACTGCGACTTCTAGAAGTCGACAACCGAGTAGTATTACCCATAGAAATAACGATTCGAATGCTAATCTCATCCGAAGA [...]
+	Bos_tarus	GCATATCCCATACAACTAGGATTCCAAGATGCAACATCACCAATCATAGAAGAACTACTTCACTTTCATGACCACACGCTAATAATTGTCTTCTTAATTAGCTCATTAGTACTTTACATTATTTCACTAATACTAACGACAAAGCTGACCCATACAAGCACGATAGATGCACAAGAAGTAGAGACAATCTGAACCATTCTGCCCGCCATCATCTTAATTCTAATTGCTCTTCCTTCTTTACGAATTCTATACATAATAGATGAAATCAATAACCCATCTCTTACAGTAAAAACCATAGGACATCAGTGATACTGAAGCTATGAGTATACAGATTATGAGGACTTAAGCTTCGACTCCTACATAATTCCAACATCAGAATTAAAGCCAGGGGAGCTACGACTATTAGAAGTCGATAATCGAGTTGTACTACCAATAGAAATAACAATCCGAATGTTAGTCTCCTCTGAAGACGTATTACACT [...]
+	Hippopotamus_amphibius	GCATATCCCCTCCAACTAGGCTTTCAAGATGCAGTATCACCCATTATAGAAGAACTACTGTATTTTCATGACCATACGCTAATAATCGTATTCCTAATCAGCTCACTAGTCCTTTACATTATTACACTAATACTGACTACCAAACTAACCCATACAAACACCATAAATGCACAAGAGGTAGAAACTGTCTGAACAATCCTACCAGCCATTATCCTTATCTTAATTGCACTGCCATCTCTGCGAATCCTCTATATAATAGACGAAATTAACAACCCCTCCCTGACCGTAAAAACTATGGGCCACCAATGATACTGAAGTTACGAATATACAGATTATGAAGACCTAAACTTTGACTCCTACATAGTCCCAACATCAGACCTAAAGCCGGGGGACCTACGACTCCTAGAAGTAGATAACCGAGTCGTCCTACCCATAGATGTAACAGTTCGAATACTAATCTCATCAGAA [...]
+	Balaenoptera_physalus	GCATATCCATTCCAACTAGGTTTCCAAGATGCAGCATCACCCATCATAGAAGAGCTCCTACACTTTCACGATCATACACTAATAATCGTTTTTCTAATTAGCTCTTTAGTTCTCTACATTATTACCCTAATGCTTACAACCAAATTAACACATACTAGTACAATAGACGCCCAAGAAGTAGAAACTGTCTGAACTATCCTCCCAGCCATTATCTTAATTTTAATTGCCTTGCCTTCATTACGGATCCTTTACATAATAGACGAAGTCAATAACCCCTCCCTCACTGTAAAAACAATAGGTCACCAATGATATTGAAGCTATGAGTATACCGACTACGAAGACCTAAGCTTCGACTCCTATATAATCCCAACATCAGACCTAAAGCCAGGAGAACTACGATTATTAGAAGTAGATAACCGAGTTGTCTTACCTATAGAAATAACAATCCGAATATTAGTCTCATCAGAAG [...]
+	Physeter_macrocephalus	GCATACCCCCTTCAACTAGGTTTCCAAGACGCAACCTCTCCCATTATAGAGGAACTCTTACACTTTCATGATCACACCCTAATAATTGTTTTCCTAATTAGCTCTCTAGTCCTCTACATTATCACCCTAATACTAACAACCAAACTAACACATATCAACACAATAGACGCCCAAGAAGTAGAGACCATTTGAACCGTTCTCCCCGCTATCATTCTAATCCTAATCGCCCTACCATCCCTACGAATCCTCTACATAATAGACGAAATCAACAGCCCCTCTCTTACTGTAAAGACAATAGGTCACCAATGATATTGAAGCTACGAATATACCGACTACGAAGACCTGTCCTTTGACTCTTACATAATCCCAACATCGGACTTAAAACCAGGAGACCTACGACTATTAGAAGTCGACAACCGAATAGTATTGCCTATAGAAATAACAATCCGAGTCTTAGTCTCCTCCGAG [...]
+	Ursus_americanus	GCACACCCCTTTCAAATAGGTCTTCAAGATGCAACTTCTCCTATCATAGAAGAACTCCTACATTTTCATGACCATACATTAATAATTGTATTCCTAATTAGCTCCTTAGTTCTCTATATTATTTCAACTATATTAACTACCAAATTAACACACACAAACACAATGGATGCACAAGAAGTAGAGACGGTGTGAACCATCCTGCCAGCTATAATCCTAATTCTAATCGCACTCCCATCGCTACGGATTCTCTATATAATGGATGAAATCAATAACCCCTCACTGACCGTAAAAACCATGGGCCATCAATGATATTGAAGTTACGAGTACACAGATTATGAAGATCTAAATTTTGACTCCTACATGACTCCAACACAAGAACTAAAGCCTGGAGAACTGCGGTTATTAGAAGTGGACAATCGAGTAGTACTGCCCATAGAAATAACGATCCGTATGCTAATCTCATCAGAAGATGTC [...]
+	Canis_familiaris	GCGTACCCATTTCAACTCGGATTACAGGACGCAACCTCCCCTATTATAGAGGAGCTACTTCATTTTCATGACCATACACTAATAATTGTATTCTTAATCAGTTCTTTAGTTCTCTATATCATTTCACTAATATTGACTACAAAATTAACCCATACAAGCACAATAGACGCACAAGAAGTGGAAACAGTATGAACCATTCTACCCGCCATTATCCTAATCCTAATCGCTCTACCTTCCCTCCGAATCCTTTATATAATGGACGAAATTAATAACCCCTCTTTAACCGTGAAAACAATAGGCCACCAATGATACTGAAGCTATGAATATACTGACTATGAAGACTTAAACTTTGACTCCTACATAATCCCAACACAAGAATTAAAGCCAGGAGAACTCCGACTATTAGAAGTAGACAACCGAGTTGTCCTCCCAATAGAAATAACCATCCGAATACTTATCTCTTCAGAAGACGTT [...]
+	Felis_catus	GCGTACCCCTTTCAACTAGGTTTCCAAGATGCTACATCCCCCATTATAGAAGAACTCCTACACTTTCACGACCACACACTAATAATTGTATTTTTAATCAGCTCTTTAGTTCTTTATATTATCTCGTTGATGCTAACAACCAAGCTCACGCACACGAGTACAATAGATGCTCAAGAAGTAGAAACCATCTGAACCATCCTACCTGCTATTATCCTGATTCTTATCGCCCTACCCTCCTTACGAATTCTCTATATAATGGATGAAATCAACAACCCCTCCCTCACAGTAAAAACCATAGGACATCAATGATATTGAAGTTATGAGTACACTGATTACGAAGACTTGAATTTTGACTCTTACATAATTCCTACCCAAGAGCTAAAACCAGGAGAACTCCGGCTATTAGAAGTTGACAACCGAGTAGTTTTACCAATAGAAATGACCATTCGCATGTTAATCTCATCAGAAGATGTGTTACA [...]
+	Homo_sapiens	GCACATGCAGCGCAAGTAGGTCTACAAGACGCTACTTCCCCTATCATAGAAGAGCTTATCACCTTTCATGATCACGCCCTCATAATCATTTTCCTTATCTGCTTCCTAGTCCTGTATGCCCTTTTCCTAACACTCACAACAAAACTAACTAATACTAACATCTCAGACGCTCAGGAAATAGAAACCGTCTGAACTATCCTGCCCGCCATCATCCTAGTCCTCATCGCCCTCCCATCCCTACGCATCCTTTACATAACAGACGAGGTCAACGATCCCTCCCTTACCATCAAATCAATTGGCCACCAATGGTACTGAACCTACGAGTACACCGACTACGGCGGACTAATCTTCAACTCCTACATACTTCCCCCATTATTCCTAGAACCAGGCGACCTGCGACTCCTTGACGTTGACAATCGAGTAGTACTCCCGATTGAAGCCCCCATTCGTATAATAATTACATCACAAGACGTCTTGC [...]
+	Pan_troglodytes	GCACATGCAGCGCAAGTAGGTCTACAAGATGCTACTTCCCCTATCATAGAAGAACTTATTATCTTTCACGACCATGCCCTCATAATTATCTTTCTCATCTGCTTTCTAGTCCTATACGCCCTTTTCCTAACACTCACAACAAAACTAACTAATACTAGTATTTCAGACGCCCAGGAAATAGAAACCGTCTGAACTATCCTGCCCGCCATCATCCTAGTCCTTATTGCCCTACCATCCCTGCGTATCCTTTACATAACAGACGAGGTCAACGACCCCTCCTTTACTATTAAATCAATCGGCCATCAATGATATTGAACCTACGAATACACCGACTACGGCGGGCTAATCTTCAACTCCTACATACTCCCCCCATTATTTCTAGAACCAGGTGATCTACGACTCCTTGACGTTGATAACCGAGTGGTCCTCCCAGTTGAAGCCCCCGTTCGTATAATAATTACATCACAAGATGTTC [...]
+	Gorilla_gorilla	GCACATGCAGCGCAAGTAGGTCTACAAGACGCTACTTCTCCTATCATAGAAGAACTAATCATCTTTCATGATCATGCCCTCATAATCATTTTTCTCATCTGCTTCTTAGTCCTGTACGCCCTTTTCCTAACACTCACAACAAAGCTAACTAACAACAACATCTCAGACGCCCAAGAAATAGAGACCATCTGAACCATCCTGCCCGCTATTATCTTAGTCCTGATCGCCCTCCCATCTCTACGAATCCTCTATATGACAGATGAAATCAATGACCCCTCCTTCACTATCAAATCAATCGGTCACCAATGATACTGAACCTACGAATACACCGACTATGGTGGATTGATCTTTAACTCCTATATACTCCCCCCATTATTCCTAGAACCAGGTGACCTACGACTCCTTGACGTCGACAACCGAGTAGTCCTTCCAGTTGAAGCCCCCGTCCGTATAATAATTACATCCCAAGATGTCT [...]
+	Pongo_pygmaeus	GCGCACGCAGCACAGGTAGGTCTACAAGACGCTACCTCTCCTATCATAGAAGAATTGGTCATCTTTCACGACCACGCCCTCATAATCATCTTCCTAATCTGCTTCCTAGTCCTGTACGCCCTTTTCCTAACACTCACAACGAAACTCACCAACACTAACATCTCAGATGCCCAAGAGATAGAAACTATTTGAACTATCCTACCAGCCATCATCCTAATTCTAATCGCCCTCCCATCTCTACGCATCCTCTACTTAACAGACGAAATCAACGACCCTTCCTTCACCATTAAATCAATCGGCCATCAATGGTACTGAACCTACGAGTATACTGACTATGGCGGATTGATCTTCAACTCTTACATGCTCCCACCACTATTCCTAGAACCAGGCGACCTTCGACTCCTAGACGTCGACAATCGAGTAGTCCTCCCAGTCGAAGCCCCCGTTCGCATAATAATCACATCCCAAGACGTCTT [...]
+	Macaca_mulatta	GCCCACCCAGTTCAACTAAGCCTGCAAGACGCCACATCTCCTGTTATAGAGGAGTTGATTACTTTCCATGACCATGCTTTTATAGCCATATCTCTTATCAGCTTCCTAGTATTATATGCCCTGCTCTCAACGCTCACAACAAAACTAACCAACACTAGCATCACAGACGCCCAAGAAATAGAAACTATCTGAACTATCTTACCCGCAATTATCTTAATCCTAATTGCTCTCCCATCTCTACGCATCCTATACCTAACAGATGAAGTCAACGACCCATCCTTCACCATTAAATCAATCGGACACCAGTGATACTGAACCTACGAATACACAGATTACGGGGGCCTAATTTTCAACTCCTACATACTACCCCCACTATTCCTAAACCCAGGAGACCTCCGACTCCTAGAAGTTGACAATCGAGTAGTTCTTCCAATTGAAGCTCCTGTACGTATAATAATTACATCTCAAGACGTCTT [...]
+	Callithrix_jacchus	GCAGCACCAGCCCAATTAGGCCTACAAAACGCCGCATCCCCAATCATAGAAGAACTTATTGCCTTCCATGACCATGCTCTAATAATTATCTTCTTAATTAGCTCACTAGTTCTATACATCATCTCTCTAATACTTACTACAAAACTGACACACACCAGTACCATGAACGCTCAAGAAATCGAAATGATCTGAACTATCCTACCTGCAATAATCCTCATTATAATTGCCCTTCCATCCCTACGCATTTTATATATAACAGACGAGTTTAATAAACCATATCTAACCCTTAAAGCAATCGGCCACCAATGATACTGAAGTTACGAATACTCCGACTATGAAGACTTAGCATTCGACTCCTACATTATACCAACATACTTCCTTGAACCCGGGGAATTCCGACTCCTTGAAGTAGACAACCGAACAACCTTGCCTATGGAAGCAGATATCCGTGTATTAATCTCATCACAAGACG [...]
+	Loris_tardigradus	GCCCATCCAGTACAATTCGGATTTCAAGACGCCGCCTCACCTATTATAGAAGAACTACTATACTTTCATGACCACACTCTCATAATTGTATTTATAATCAGCTCTCTAGTCCTATATATTATCTCCCTTATACTATCAACCGAACTTACCCATACAAGCACTATGGATGCGCAAGAAGTAGAAACAGTATGAACAATCCTGCCTGCCGTCATCCTAATTTTAATTGCCCTGCCATCCCTACGGATCCTATATATAATAGATGAAATTAATACCCCATCCCTTACCCTAAAAACAATAGGTCATCAATGATATTGAAGCTACGAATACACAGATTATGATAAACTATGCTTTGACTCCTATATAGTCCCAACCCCTGACCTAGAACCGGGGGACCTACGTCTACTTGAAGTAGATAACCGAGTTGTACTACCTACAGAAATATCTATTCGAATACTAATCTCCTCCGAAGATGT [...]
+	Galago_crassicaudatus	GCCCACGCTGTACAATTCGGATTTCAAGACGCTGCCTCCCCTATTATAGAAGAATTATTATACTTCCATGACCACACCCTTATAATCGTATTTACAATTAGCTCCCTGGTCCTTTATATTATCTCCCTTATGTTATCGACTGAACTTACTCATACAAACACAATAGACGCCCAAGAAGTAGAGACAGTATGAACTATCCTGCCAGCTGTAATCCTCATCCTTATTGCCCTCCCATCCCTCCGAATCCTTTACATAATAGACGAAATCAACACCCCATCCTTAACCCTAAAAACAATAGGCCATCAATGATATTGAAGCTATGAGTACACAGATTATGACAACCTGTGCTTTGACTCCTACATAACCCCTACCCCTGACTTAGAACCAGGAGACCTTCGACTGTTAGAAGTGGACAACCGAGTCGTCCTACCCACAGAAATATCTATCCGAATACTAATCTCCTCTGAAG [...]
+	Daubentonia_madagascariensis	GCTTACCCCGCCCAAATAGGATTCCAAGACGCCACCTCCCCTATCATAGAAGAACTTCTATATTTCCATGACCATACCTTAATAATTGTCTTTATAATTAGCTCATTAGTCCTCTATACTATCTCCCTTATACTCACAACCAGCCTTACCCATACAAACACCATAAACGCCCAAGAAGTGGAAACAGTGTGAACAATCCTCCCTGCAATTATCTGCATCCTTATTGCCCTACCATCCTTACGTATTCTCTACATAATAGATGAAATTAACAACCCTTCCCTAACCATTAAAACTATGGGCCACCAATGATACTGAACCTATGAGTATACAGATTATGAAAACATAACCTTTGATTCATACATAACCTCAACCAACGATCTCACCCCCGGAGAACTTCGACTTCTGGAAGTCGATAATCGAATAGTCCTACCTACGGAATTACCTATTCGAGTGTTAGTCTCC [...]
+	Varecia_variegata	GCTCATCCAGTCCAACTAGGATTTCAAGACGCCGCTTCTCCTATTATAGAAGAACTCCTATATTTTCACGACCACACCCTAATAATTATATTCCTAATTAGCTCTTTAGTCCTATATATTATTTCCCTAATACTCACTACTAAACTCACACATACAAGCACTATAGATGCTCAAGAAGTAGAAACAGTATGAACAATTTTACCCGCAGCAATTCTTATTCTTATTGCCCTCCCCTCACTACGTATCCTATACATGATGGACGAAATTACTTCTCCTTCCCTTACCCTTAAAACCATAGGTCACCAATGATATTGAAGTTATGAGTATACGGATTACGAAAATTTATGCTTTGACTCATATATAACCCCCTGCTCAGACCTAAAACCCGGAGAACTTCGCTTACTTGAAGTAGATAATCGAGTCGTTCTACCCACAGAACTGTCAATCCGAACGCTAATCTCTTCAGAAGATGT [...]
+	Eulemur_mongoz	GCTTATCCAGTTCAACTAGGGTTCCAAGATGCTGCTTCCCCTATTATAGAAGAACTTTTATACTTCCATGACCACACCTTAATAATTATATTCCTAATTAGTTCTCTAGTCCTCTACATTATTTCCCTTATACTCACTACTGAGCTTATCCATACAAGTACTATAGACGCCCAAGAAGTAGAAACAGTATGAACTATTCTGCCCGCAGTAATTCTTATCCTTATTGCCCTCCCATCATTACGCATCCTATATATAATAGATGAAATCACCACACCCTCCTTAACTCTTAAAACTATGGGCCACCAATGATACTGAAGCTATGAGTACACGGACTATGAGAATCTGTGCTTTGACTCATACATAACTCCTCCTTCAGACCTAAAACCGGGAGAACTTCGTTTACTCGAAGTTGATAATCGAGTTGTGCTTCCAACAGAGCTACCAATCCGAATACTAATTTCCTCAGAAGATGTTTT [...]
+	Lemur_catta	GCCTATCCAGTTCAATTAGGATTTCAAGATGCTGCTTCTCCCATTATAGAAGAACTTTTATACTTTCACGACCACACTTTAATAATTATATTCCTGATTAGTTCTCTAGTCCTTTACATTATCTCCCTTATACTCACTACTGAACTTATACATACAAACACCATAGACGCCCAAGAAGTAGAAACAGTATGAACAATCCTACCTGCAGCAATCCTCATTCTTATTGCTCTTCCATCATTACGCATTCTGTATATAATAGACGAAATTGCTACACCCTCCTTAACCCTTAAAACCATAGGTCACCAATGATACTGAAGCTACGAATACACAGATTATGAAGACTTATGTTTTGACTCGTACATAACTCCTTCCTCAGACCTTAAACCTGGAGAACTTCGCCTACTTGAAGTCGACAATCGAGTCGTACTTCCCACAGAACTAGCAGTTCGAATATTAATCTCTTCAGAAGATGTACTACA [...]
+	Hapalemur_griseus	GCTTATCCAGTCCAACTAGGATTTCAAGATGCTGCTTCCCCTATTATAGAAGAACTTTTATACTTTCATGATCATACTTTAATAATTATATTCCTGATTAGTTCTCTAGTCCTTTACATTATTTCCCTCATACTTACTACTGAATTAATACATACAAATACCATAGACGCCCAAGAAGTAGAAACAGTATGAACAATCCTACCCGCAGCAATTCTCATTCTCATTGCCCTCCCATCATTACGTATCCTATATATAATAGACGAAATTACTACACCCTCATTAACCCTTAAAACTATAGGCCACCAGTGATACTGAAGCTACGAATACACAGACTATGAAAATTTATGCTTTGACTCATACATAGTTCCTTCCTCAGACCTAAAGCCTGGAGAACTTCGCCTACTTGAAGTTGATAATCGAATTGTACTTCCTACAGAATTATCAATTCGAATACTAATCTCTTCAGAAGATGT [...]
+	Propithecus_tattersalli	GCTTATCCAGTTCAATTGGGATTTCAGGATGCTGCTTCCCCCATCATGGAAGAGCTCTTATACTTTCATGATCATACTTTAATAATTGTATTCCTAATTAGTTCTCTAGTTCTCTATATCATCTCTCTAATACTCACCACCAAACTCATACACACCAGCACCATGGACGCACAAGAAGTAGAAACAGTATGAACTATCCTACCTGCAATCATTCTAATTCTTATTGCCCTCCCATCCCTACGTATCCTATACATAATGGATGAAATCACTACTCCTTCATTAACCCTTAAAACCATAGGTCATCAATGGTACTGAAGCTATGAATACACAGATTACGAAGATCTGTCTTTCGACTCATACATAGTTCCATCATCGGACCTCAAGCCCGGAGAACTTCGTCTGCTCGAAGTAGACAACCGAATTGTACTACCCACAGAACTATCAATTCGAATACTTATCTCTTCAGA [...]
+	Lepilemur_edwardsi	GCCCACCCAGTCCAACTAGGATTTCAAGATGCCGCCTCTCCTATCATAGAAGAACTTCTATATTTCCATGACCACACTCTAATAATTGTTTTCCTCATCAGTTCCTTGGTCCTTTACATTATTTCCCTTATACTCTCTACTAAACTCACCCACACAAGTACAGTGGATGCCCAAGAAGTAGAAACAGTATGAACTATTTTGCCCGCAGTGATCCTAATTCTTATCGCCCTTCCATCTCTACGCATCCTATACATAATAGACGAAATCACTACACCCTCCTTAACCCTTAAAACAATAGGCCATCAATGATACTGAAGCTATGAATACACGGACTATGAAAATCTTTGCTTTGACTCATATATAATTCCTCTGTCAGATCTTAAACCCGGTGATCTTCGCCTACTCGAGGTTGATAACCGAGTTGCCTTACCCACAGAAATATCAATCCGAATGTTAGTATCCTCAGAAGACG [...]
+	Cheirogaleus_medius	GCATGTCCAGTTCAACTAGGATTTCAAGACGCTGCCTCTCCTATTATAGAGGAACTTATATATTTCCATGACCATACTTTAATAATCGTCTTCCTAATTAGCTCCCTAGTCCTCTATATCATTTCCCTAATACTCACCACAGAACTTACCCACACAAACACAATAGATGCCCAAGAAGTAGAAACAGTATGAACCATCCTACCTGCAGTTATCTTAATCCTTATTGCTCTTCCATCACTACGAATTCTATATATAATAGATGAAATTACCACCCCATCTCTAACCCTAAAAACTATAGGCCATCAATGGTACTGAAGTTATGAATATACAGACTACGAAAACTTATGTTTTGATTCATATATAACGCCATCATCAGATCTCAAGCCAGGAGAACTTCGCCTACTAGAAGTTGATAACCGAGTTGTCCTACCCACAGAAATATCCATTCGTATACTCATCTCCTCAGAAGAT [...]
+	Mirza_coquereli	GCTTACCCAGCTCAGCTAGGACTCCAAGATGCCGCTTCCCCAATCATGGAAGAGCTTGCATATTTTCACGACCATACCCTAATAATTGTATTTTTAATTAGCTCCATGGTCCTATATATAATCTCTCTAATACTTACTACTGAACTTACCCACACAAGCACTATAGATGCTCAAGAAGTCGAAACAGTATGAACAATCCTACCCGCAGTTATCCTAATTTTTATTGCCCTTCCATCATTACGTATTTTATATATAATAGACGAAATTACAACGCCATCCTTAACTCTAAAAACCATAGGCCATCAATGATATTGAAGTTATGAATACACAGACTACGAAAGCCTATGCTTTGACTCTTATATGACCCCTCCACTAGAACTAGATCCAGGAGAACTTCGCCTACTAGAAGTTGATAATCGAGTAGTACTGCCTACAGAAATATCCATTCGTATACTTGTCTCTTCAGAAGATGTAT [...]
+	Microcebus_murinus	GCCCACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATAATTGTATTTTTAATTAGCTCATTAGTTCTTTATATTATTTCCCTTATACTTACCACGGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTAGAAACAGTATGAACAATTCTACCAGCGGTTATTTTAATTCTTATTGCCCTTCCATCACTACGTATTTTATATATAATAGATGAAATTACAACTCCCACTCTGACCCTTAAGACAATAGGTCATCAATGATATTGAAGTTACGAATATACAGATTATGAAAACCTATGCTTTGACTCATACATAACCCCTCCTTTAGAACTCGATCCAGGAGAACTACGATTACTAGAAGTTGACAATCGAGTAGTATTACCAACAGAAATATCCATTCGCATACTCATCTCTTCAGAAGACG [...]
+	Microcebus_griseorufus	GCCTACCCAGCCCAATTAGGTTTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATGATTGTATTTTTAATCAGCTCATTGGTCCTTTATATTATTTCCCTTATACTTACCACAGAACTTACTCATACAAGCACTATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCCCTTCCATCATTACGCATTCTATACATAATGGATGAAATCACAACCCCCACCCTTACCCTTAAAACCATAGGTCATCAGTGATATTGAAGTTATGAATATACAGATTATGAAAGCCTATGCTTTGACTCATATATGACCCCTCCTTTAGAACTTGACCCCGGAGAATTACGATTACTAGAAGTCGATAATCGAGTAGTATTACCAACAGAAATATCTATTCGCATGCTAATCTCTTCAGAA [...]
+	Microcebus_myoxinus	GCCTACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTACATATTTTCATGATCATACCCTTATGATCGTATTCTTAATTAGCTCATTAGTTCTATATATCATTTCCCTCATGCTTACCACGGAACTCACCCATACAAGCACCATAGACGCTCAAGAAGTAGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCTCTTCCATCATTACGCATTTTATATATAATGGATGAAATTACAACTCCCTCCCTGACTCTTAAGACTATAGGTCATCAATGATATTGAAGCTATGAATACACAGACTATGAAAGCTTATGCTTTGACTCATATATAACCCCTCCATTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTGGATAATCGAGTAGTACTACCAACAGAAATATCTATTCGTATACTCATCTCTTCAGAAGAC [...]
+	Microcebus_berthae	GCCTACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCATGATCATACCCTTATGATCGTATTTTTAATTAGCTCATTAGTTCTTTATATCATTTCCCTCATGCTTACCACAGAACTCACCCATACAAGCACCATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCTCTTCCATCATTACGCATTTTATATATAATGGATGAAATTACAACTCCCTCCCTAACTCTTAAGACCATAGGTCATCAGTGATATTGAAGCTATGAATATACAGACTATGAAAGCTTATGCTTTGACTCATATATAACTCCTCCACTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTGGATAATCGAGTAGTACTACCAACAGAAATATCTATTCGCATGCTCATCTCTTCAGAAGACG [...]
+	Microcebus_rufus_1	GCCTACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCATGATCATACCCTTATGATCGTATTTTTAATTAGCTCATTAGTTCTATATATCATTTCCCTTATGCTTACCACAGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCTCTTCCATCATTACGCATTTTATATATAATGGATGAAATTACAACTCCTTCCCTAACTCTTAAGACTATAGGTCATCAGTGATATTGAAGCTATGAATATACAGATTATGAAAGCCTATGCTTTGACTCATATATAACCCCTCCATTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTGGATAACCGAGTAGTACTACCAACAGAAATATCTATTCGCATACTCATCTCTTCAGAAGACG [...]
+	Microcebus_tavaratra	GCCCACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGATCACACCCTTATAATTGTATTTTTAATTAGTTCATTAGTCCTATATATCATTTCCCTTATGCTTACCACGGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTTATTGCTCTTCCATCGTTACGCATTTTATATATAATAGATGAAATTACAACCCCTTCTCTAACTCTTAAGACTATAGGTCATCAGTGATATTGAAGCTATGAATATACAGACTATGAAAGCCTATGCTTTGACTCATATATAACCCCTCCATTAGAATTAGATCCAGGAGAACTACGATTACTAGAAGTAGATAATCGAGTAGTATTACCAACAGAAATATCTATTCGTATACTCATCTCCTCAGAAGA [...]
+	Microcebus_rufus_2	GCCCACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATAATTGTATTCTTAATCAGCTCATTAGTTCTATATATCATTTCCCTTATACTTACTACGGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTGGAAACAGTATGAACAATCTTACCAGCAGTTATTTTAATCCTTATTGCCCTTCCATCATTACGCATTTTATACATAATGGATGAAATTACAACTCCCTCCCTAACTCTTAAGACTATAGGTCATCAATGATATTGAAGCTATGAATATACAGACTATGAAAGCCTATGCTTTGACTCATACATAACCCCTCCATTAGAGCTCGATCCAGGAGAACTACGATTACTAGAAGTGGATAACCGAGTAGTACTACCAACAGAAATATCTATTCGTATACTCATCTCTTCAGAAGACG [...]
+	Microcebus_sambiranensis	GCCTATCCAGCCCAATTAGGTTTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGATCATACCCTTATGATTGTATTTTTAATTAGCTCATTAGTCCTATACATTATTTCCCTTATGCTTACCACGGAACTTACTCATACAAGCACCATAGACGCTCAAGAAGTAGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTTATTGCCCTTCCATCACTACGCATTTTATATATAATGGATGAAATTACAACTCCCTCCCTAACTCTTAAGACTATAGGTCATCAATGATATTGAAGCTATGAATATACCGACTATGAAAGCCTATGCTTTGACTCCTACATAACCCCTCCATTAGAACTCGATCCAGGAGAACTACGATTACTAGAAGTAGATAATCGAGTAGTACTGCCAACAGAAATATCCATTCGTATACTCATCTCTTCAG [...]
+	Microcebus_ravelobensis	GCCTGCCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTGTATATTTCCACGACCATACCCTTATAATTGTGTTTTTAATTAGCTCATTGGTCCTATATATTATTTCCCTTATACTCACCACAGAGCTCACTCATACAAGCACTATAGATGCTCAAGAAGTGGAAACTGTATGAACAATTTTGCCAGCAGTTATCTTAATTCTTATTGCCCTTCCATCATTACGCATTTTATATATAATAGATGAAATTACAACCCCGTCCCTTACTCTTAAGACTATAGGTCATCAATGATATTGAAGCTATGAATATACAGACTATGAAAACTTATGCTTTGACTCATACATGACTCCTCCATTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTCGACAATCGAGTAGTATTACCAACAGAAATATCTATCCGCATACTCATCTCTTCAGA [...]
+
+;
+end;
+begin mrbayes;
+    [ HKY model, 4 gamma categories, 1 invariant site ]
+    lset nst=2;
+    lset rates=invgamma;
+    lset ngammacat=4;
+    [ strict clock model ]
+    prset brlenspr=clock:uniform;
+    mcmcp ngen=1000000 nchains=1 printfreq=10000;
+end;
diff --git a/examples/benchmark/mrbayes/testHKY1748.nex b/examples/benchmark/mrbayes/testHKY1748.nex
new file mode 100644
index 0000000..7c2257d
--- /dev/null
+++ b/examples/benchmark/mrbayes/testHKY1748.nex
@@ -0,0 +1,84 @@
+#NEXUS
+begin data;
+	dimensions ntax=67 nchar=955;
+	format datatype=dna missing=? gap=-;
+	matrix
+	Zea_mays	------------------------------------------------------cttggctcgacatagtctgttctattcgtcccgaaccgaattttcgctgggttgttt-----------------------------g-taagtaaagtaaatagtacacgatggagctcgagaggacagaattt-----ctttttgatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatatagaaa-----tcaaaaggttaaaataagaaaaa-gtctaattttggaagattggaaaaactttttt-----gatgaaaa-----gtctatctgaatcaattgttcatatttgatttctatag--------------------aagagtgaaatgcttt------atcgaaggaaa---------taagaaaaaa----gaaagggt [...]
+	Uniola_pittieri	------------------------tccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattg-----attttttatcaagggaaaaaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtctaattttggaaaattggaaaa-ctttttt-----gattaaaa-----gtctataaRaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaatgaaggaaataaaaaaaaaaa--g [...]
+	Uniola_paniculata	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgtgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattg-----attttttatcaagggaaaaaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtctaattttggaaaattggaaaa-ctttttt-----gattaaaa-----gtctataagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaatgaaggaaataaaaaaaaaa-- [...]
+	Thellungia_advena	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaacccaatttgcgctgagttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattg-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatatagaaa-----ttgaaaggttaaaataagaaaaa-gtctaattttggaagattggaaaa-ctttttc-----gattaaaa-----gtctatcagaatcaatcgttcatattcgatttctctag--------------------aagagcaaaatgcttt------attgaaggaaa---------taagaaaaaaa-- [...]
+	Tetrachne_dregei	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagatagaattg-----attttttatcaagggaaaaaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtctaattttggaaaattggaaaa-ctttttt-----gattaaaa-----gtctagaagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaatgatggaaataaaaaaaaa---- [...]
+	Stiburus_conrathii	---------------------------------------------------gctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgtgctgggttgtat-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattg-----attttttatcacgggaaaaaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtctaNttttggaaaattggaaaa-ctttttt-----gattaaaa-----gtctataaNaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------tttgaaggaaatgaagggaataaaaaaaaaa- [...]
+	Sporobolus_indicus	atcgattgtggtttttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgttccgaacccaatttgcgctgagttgttt-----------------------------g-taaataaa-----tagtacacgatggagctcgagaagacagaattg-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatatagaaa-----tggaaaggttaaaataagaaaaa-gtctaattttggaagattggaaaa-ctttttc-----gattaaaa-----gtctatcagaattaatcgttcatattctatttctctag--------------------aagaggaaaatgcttt------attgaaggaaa---------taagaaaaaaa- [...]
+	Spartina_pectinata	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaacccaatttgcgcggagttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaatag-----attttttattaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatatagaaa-----ttgaat----aaaataagaaaaa-gtctaattttggaagattggaaaa-ctttttc-----ggttaaaa-----gtctatcagaatcaatcgttcatattcgatttctctag--------------------aagagcaaaatgcttt------attgaaggaaa---------taagaaaaaaa- [...]
+	Schmidtia_pappophoroides	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttacgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgaaaagacagaattg-----attttttatcaagggaaaaaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatatagaaa-----ttgaaaggttaaaataagaaaaaaggaatattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcattcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaa--------- [...]
+	Pogonarthria_squarrosa	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----tggaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaa----------- [...]
+	Pappophorum_mucronulatum	TCGACTTGTGGATTTTG----CTATCCACCATTTTCCATAGTAATGAAAATGCTCTTGGCTCGACATAGTCTGTTCTATTTGTCCCGAACCGAATTTGCGCTAGGTTGTTT-----------------------------G-TAAGTAAA-----TAGTACACGATGGAGCTCGAGAAGACAGAATTG-----ATTTTTTATCAAGGGAAAGAATCTAGGGTTAGTGAAAACTAATAAATTAGGCCAACTTTGTCAGTCTATCCT-----TAATATAGAAA-----TTGAAAGGTTAAAATAAGAAAAA-GTATAATTTTGGAAGATTGGAAAA--TTTTTTC----GATTAAAA-----GTCTATCAGAATCNATCGTTCATATTCGATTTCTCTAG--------------------AAGAGGAAAAAACTTT------ATTGANGGAAA---------TAAGAA [...]
+	Pappophorum_bicolor	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctaggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattg-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatatagaaa-----ttgaaaggttaaaataagaaaaa-gtataattttggaagattggaaaa-ttttttc-----gattaaaa-----gtctatcagaatcaatcgttcatattcgatttctctag--------------------aagaggaaaaaacttt------attgaaggaaa---------taagaaaaaaa [...]
+	Neeragrostis_reptans	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattg-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatgcagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaataaaagtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaa------------- [...]
+	Leptochloa_dubia	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgtttggtttgtaagtaactgggttgtttggtttg-taagtaaa-----tagtacacgatggagctcgagaagaaagaatagaatttcttttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatatagaaattaaattgaaaggttaaaataagaaaaa-gtctaattttggaagattggaaaa-cttttttt----gattaaaa-----gtctatcagaatcaatcgttcatatttgatttctctag--------------------aagaggaaaatgcttt------attgaaggaaa---------taagaaaaaaa--- [...]
+	Fingerhuthia_sesleriiformis	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagatagaattg-----attttttatcaagggaaaaaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtctaattttggaaaattggaaaa-ctttttt-----gattaaaa-----gtctagaagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaatgatggaaataa [...]
+	Eragrostis_unioloides	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----aatttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaa------------ [...]
+	Eragrostis_truncata	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaaa------------- [...]
+	Eragrostis_trichophora	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----aatttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaa----------- [...]
+	Eragrostis_tremula	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaacc-aatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattg-----cttttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagagtggaaaa-cgttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaacgcttt------attgaaggaaa---------taaaaaaaaaaa [...]
+	Eragrostis_tenella	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgagttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttatttttgaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgctcctattcgatttctatag--------------------aagaggaaaatgcttt------attaaaggaaa---------taaaaaaaaaaa [...]
+	Eragrostis_tef_variegata	--------------------------------------------------------------------gtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaNgacagaattg-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatccatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaaa-------- [...]
+	Eragrostis_secundiflora	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaacc-aatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattg-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagagtggaaaa-cgttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttgtatag--------------------aagaggaaaacgcttt------attgaaggaaa---------tcaaaaa [...]
+	Eragrostis_schweinfurthii	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacataattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttg-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaa-------- [...]
+	Eragrostis_rigidior	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----tattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaa-------------- [...]
+	Eragrostis_polytricha	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgttgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaaa----------- [...]
+	Eragrostis_pilosa_PI_221926	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattg-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatccatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaaa----- [...]
+	Eragrostis_pilosa	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattg-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatccatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaaa--------------- [...]
+	Eragrostis_patenti-pilosa	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaacc-aatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----tttttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaaaaagaaaaaagtcttattttggaagagtggaaaa-ctttttt-----tattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaacgcttt------attgaaggaaa---------tcaaa [...]
+	Eragrostis_papposa	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgtgctgggttgttt-----------------------------g-taagtaaa-----tagtacaggatggagctcgagaagacagaatta-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttacaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaa--------------- [...]
+	Eragrostis_paniciformis	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaacc-aatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagagtggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctagag--------------------aagaggaaaacgctttatttttattgaaggaaa---------taaaaaa [...]
+	Eragrostis_nutans	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaacc-aatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagagtggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctagag--------------------aagaggaaaacgcttt------attgaaggaaa---------taaaaaaaaaaaa [...]
+	Eragrostis_neesii	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattg-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----tttaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttg-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggagaatgcttt------attgaaggaaaaaaaaa---------------- [...]
+	Eragrostis_minor	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgttgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattagtccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaa----------------- [...]
+	Eragrostis_mexicana	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgttgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattagtccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaa-------------- [...]
+	Eragrostis_macilenta	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgttgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaaa------------ [...]
+	Eragrostis_lugens	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgttgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaaa--------------- [...]
+	Eragrostis_lehmanniana	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaaaa--------- [...]
+	Eragrostis_intermedia	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgttgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagagga----gcttt------attgaaggaaaaaaaaaa----------- [...]
+	Eragrostis_hypnoides	-------------------------ccaccattttccaaactaatgaaaatgctcttggctcgacataccctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattg-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatgcagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaataaaagtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaa------------- [...]
+	Eragrostis_heteromera	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaacctaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----tagaaaggttaaaataagaaaaaagtcttattttggaagattgaaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaaa----------- [...]
+	Eragrostis_elegantissima	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttttttttgaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgtttatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaaa-------- [...]
+	Eragrostis_echinochloidea	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttaaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatatttgatttctatag--------------------aagaggaaaat-cttt------attgaaggaaaaaaaaa-------- [...]
+	Eragrostis_dielsii	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaatttctt--tttttttttcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaa--------------- [...]
+	Eragrostis_curvula	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----tattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaa--------------- [...]
+	Eragrostis_ciliaris	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgagtttttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattg-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttatttttgaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgctcctattcgatttctatag--------------------aagaggaaaatgcttt------attaaaggaaa---------taaaaaaaaaa [...]
+	Eragrostis_cilianensis	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----tattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaa----------- [...]
+	Eragrostis_chapelieri	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----tattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaa------------ [...]
+	Eragrostis_botryodes_2	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattg-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatccatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaaa---------- [...]
+	Eragrostis_botryodes_1	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaacc-aatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttcaaaggttaaaataagaaaaaagtcttattttggaagagtggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctagag--------------------aagaggaaaacgctttatttttattgaaggaaa---------taaaaaaa [...]
+	Eragrostis_botryodes	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaacc-aatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagagtggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctagag--------------------aagaggaaaacgctttatttttattgaaggaaa---------taaaaaaaaa [...]
+	Eragrostis_bicolor	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt------ttttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----tggaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaaa-------------- [...]
+	Eragrostis_barrelieri	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttttcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattg-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----tggaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaa------------ [...]
+	Eragrostis_bahiensis	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaacc-aatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattg-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtattattttggaagagtggaaaa-cgttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaacgcttt------attgaaggaaaaaaaaaaaaa--------- [...]
+	Eragrostis_aspera	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttttcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattg-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----tggaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaa---------------- [...]
+	Eragrostis_airoides	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgttgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaa--------------aaaaaa [...]
+	Enneapogon_scopiarus	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccaaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaatt---------ttttagcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatccttaacttaatatagaaa-----ttgaaaggttcaaataagaaaaaaggaaaattttggaagattggaaat-ct----------gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatcgttcctattcgatttctatagaagaggaaaatgcttt------attgaaggaaaaaaaaa------------- [...]
+	Eleusine_corocana	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcactgggttgttt-----------------------------gataagtaaa-----tagtacacgatggagctcgagaatacagaatagaattgattttttatcaagggaaagaatctatggttagtgaaaactaataaattaggccaactttgtaagtctatcct-----taatatagaaattaaattgaaaggttaaaataagaaaaa-gtctaattttggaagattggaaaa-cttttttttt--gattaaaa-----gtctatcagaatcaatcgttcatattcaatttctctag--------------------aagaggaaaatgcttt------attgaaggaaa---------taagaaaaaaa-- [...]
+	Diandrochloa_japonica	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----aatttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatacagaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttctatag--------------------aagaggaaaatgcttt------attgaaggaaaaaaaaa------------ [...]
+	Dactyloctenium_radulans	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctattctatttgtcccgaaccaaatttgcgctgggttgttt-----------------------------c-taagtaaa-----tagtacacgatggagctcgagaacacagaattg-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatatagaaa-----ttgaaaggttaaaataagaaaaa-gtctaattttggaagattgggaaa-cttttttttc--gatttaaa-----atctatcagaatcaaccgttcatattcgatttctctag--------------------aagaggaaaatgcttt------attgaaggaaa---------taagaaa [...]
+	Dactyloctenium_giganteum	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctattctatttgtcccgaaccaaatttgcgctgggttgttt-----------------------------c-taagtaaa-----tagtacacgatggagctcgagaagacagaattg-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatatagaaa-----ttgaaaggttaaaataagaaaaa-gtctaattttggaagattgggaaa-cttttttttt-cgatttaaa-----atctatcagaatcaaccgttcatattcgatttctctag--------------------aagaggaaaatgcttt------attgaaggaaa---------taagaa [...]
+	Dactyloctenium_australe	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctattctatttgtcccgaaccaaatttgcgctgggttgttt-----------------------------c-taagtaaa-----tagtacacgatggagctcgagaagacagaattg-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatatagaaa-----ttgaaaggttaaaataagaaaaa-gtcgaattttggaagattgggaaa-cttttttttt-cgatttaaa-----atctatcagaatcaaccgttcatattcgatttctctag--------------------aagaggaaaatgcttt------attgaaggaaa---------taagaaa [...]
+	Dactyloctenium_aegyptium	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccggatttgcgctgggttgttt-----------------------------c-taagtaaa-----tagtacacgatggagctcgagaagacagaattg-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatatagaaa-----ttgaaaggttaaaataagaaaaa-gtctaattttggaagattgggaaa-cttttttttc--gattaaaa-----atctatcagaatcaatcgttcatattcgatttctctag--------------------aagaggaaaatgcttt------attgaaggaaaa---ggaaataagaa [...]
+	Coelachyrum_piercei	atcgattgtggattttt----ctatccatcattttccatagtaatgaaaatgttcttggctcgacatagtctgttctatttgtcccgaacctaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaggacagaattt-----cttttttctcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatatagaaa-----taaaaaggttaaaataagaaaaaagtcaaattttggaagattggaaaaactttttc-----gattaaaa-----gtctatctgaatcaatcgttcatatttgatttctatag--------------------aagagtgaaatgcttt------atcgaaggaaa---------taagaaaaaa- [...]
+	Cladoraphis_spinosa	----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------gtNgggaaaaaaaaaaaaa---------- [...]
+	Calamovilfa_longifolia	atcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaacccaatttgcgctgagttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaatag-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatatagaaa-----ttgaat----aaaataagaaaaa-gtctaattttggaagattggaaaa-ctttttc-----gattaaaa-----gtctatcaaaatcaatcgttcatattcgatttctctag--------------------aaaagcaaaatgcttt------attgaaggaaaaa--ggaaataagaaaa [...]
+	Calamovilfa_gigantea	-tcgattgtggattttg----ctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaacccaatttgcgctgagttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaatag-----attttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----taatatagaaa-----ttgaat----aaaataagaaaaa-gtctaattttggaagattggaaaa-ctttttc-----gattaaaa-----gtctatcaaaatcaatcgttcatattcgatttctctag--------------------aaaagcaaaatgcttt------attgaaggaaaaa--ggaaataagaaaaaa [...]
+	Acamptoclados_sessilispicus	atcgattgtggattttgttNgctatccaccattttccatagtaatgaaaatgctcttggctcgacatagtctgttctatttgtcccgaaccgaatttgcgctgggttgttt-----------------------------g-taagtaaa-----tagtacacgatggagctcgagaagacagaattt-----cttttttatcaagggaaagaatctagggttagtgaaaactaataaattaggccaactttgtcagtctatcct-----tagtactgaaa-----ttgaaaggttaaaataagaaaaaagtcttattttggaagattggaaaa-ctttttt-----gattaaaa-----gtctatgagaatcaatcgttcatattcgatttcgatag--------------------aagaggaaaatgcttt------attgaaggaaa---------taa [...]
+
+;
+end;
+begin mrbayes;
+    [ HKY model, 4 gamma categories, 1 invariant site ]
+    lset nst=2;
+    lset rates=invgamma;
+    lset ngammacat=4;
+    [ strict clock model ]
+    prset brlenspr=clock:uniform;
+    mcmcp ngen=1000000 nchains=1 printfreq=10000;
+end;
diff --git a/examples/benchmark/mrbayes/testHKY1749.nex b/examples/benchmark/mrbayes/testHKY1749.nex
new file mode 100644
index 0000000..878e80b
--- /dev/null
+++ b/examples/benchmark/mrbayes/testHKY1749.nex
@@ -0,0 +1,91 @@
+#NEXUS
+begin data;
+	dimensions ntax=74 nchar=2253;
+	format datatype=dna missing=? gap=-;
+	matrix
+	Pogonarthria_squarrosa	GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACAGTGAG----CCAAGCACAATTAGTTTACCT----CATTATTGCTACTGTTCGATGATC---------------------------------------GAACTTCTTT-----GGGTTTT-CGGTAC----TGTTCGGT-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Pappophorum_mucronulatum	GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCTGTGAAATACGACGTGGAAACAGTGAG-------------------------------------------------------------------------------------------------------------------------------------CTCTTGTAT--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Pappophorum_bicolor	GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAACGACAAGTACATCGCTGTGAAATACGACGTGGAAACAGTGAG-------------------------------------------------------------------------------------------------------------------------------------CTCTTGTAT-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Leptochloa_dubia_5.3	GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGAGGAAACCGTGAG-------------------------------------------------------------------------------------------------------------------------------------TTCATTCATTACCACTGTGTGAACTTGTTTGATTTTTCAGTACTAATCGGTCCTGAGTTTTTGACGAGGCA----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Leptochloa_dubia_5.1	GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATAGCCGTGAAATACGACGACGAAACCGTGAG-------------------------------------------------------------------------------------------------------------------------------------TTCATTCGTTGCCACTGTGTGAACTTGTTTGATTTTTTGGTACTAGTAATC-----GGTTCTGACGAGGCA----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Fingerhuthia_sesleriiformis	GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCAAGCAAGGACAAGTACGTCGCCGTGAAATACGACGCCGAAACCGTGAG----CCTAGCTAGCGCAAACTTCTTTCATTTCATTGCT---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ACTGTGTGGACTTGTTCGGTTTTTTAGTACTACAATTCGATTCT--------------------------------------------- [...]
+	Eragrostis_unioloides	GGGATCGTCA-CGG?-ATGGACGTCGGCGAGTGGGATCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCAGAAACAGTGAG----CCAAGCACAATCATGTTCCTT----CATTGAC---ACTGTTCGAT-------------------------------------------GAACTTCTTT-----GGATTTT-CAGTAC----TGTTCGGT--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Eragrostis_truncata	GGGATCGTCA-CGGC-ATGGACGTTAGTGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACAGTGAG----CCAAGCCCAATCATTTCGCTT----CGTTGTT---ACTGTTCGAT-------------------------------------------GAACTTCTTT-----GGGTTTT-CGGTGC----TGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Eragrostis_trichophora_4.4	GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATTGCCATGAAATACGATGCTGAAACAGTGAG----CCAAGCACAATCATTT-GCTT----CATTGAT---ACTGTTTGAT-------------------------------------------GAACTTCTTTT----GGATTTT-CAGTAC----TGTTCTAT---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Eragrostis_trichophora_4.2	------------------GGACGTCAGCGAGTGGGATCCCAGCAAGGACAAGTACACCGCCATGAAATACGACGCAGAAACAGTGAG----CCAAGCACAATCATGTTCCTT----CATTGAC---ACTGTTCGAT-------------------------------------------GAACTTCTTT-----GGATTTT-CGGTAC----TGTTCGGT---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Eragrostis_tremula_7.6	GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACAGTACGTGAGCCAAGCACAGTCATTTTTATT---GGATTGC-----TACCGTGTGAT-----------------------------------------GAGCTTCTTT-----GGATTTT-CAGTAC----TGTTCGAT-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Eragrostis_tremula_5.3	GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACAGTGAG--AGCCAAGCACAATCATTTTACTT----CATTGCTAGTACTGTTTGAT-------------------------------------------GAACTTCTTTGGCTACGATTTT-CAGGCC-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Eragrostis_tenella	GGGATCGTCA-CGGC-ATGGACATCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACCGTACGTGAGCCAAGCACAATCATTTTTTTTT--GGATTGAT---ATTGTGTGAT-------------------------------------------GAACTTCTTT-----GGATTTT-CAGTAC----TGTTCGAT------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ [...]
+	Eragrostis_tef_red_dabi_6.9	GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCTGAAACGGTGAA--------------CCATTTTGCTT----CATTGCT---ACTGTTTCAT-------------------------------------------GAACTTCTTT-----GGATTTT-CAGTGC----TGTT------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Eragrostis_tef_red_dabi_3	GGGATCGTCAATGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACGGTGAG----CCAAGCACAATCATTTTACTT-CGTCATTGCT---ACTGTTTGAT-------------------------------------------GAACTTCTTT-----GGATTCT-CAGTAC----TGTTTTAA----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------AT----------------------------------------------------- [...]
+	Eragrostis_secundiflora	GGGATCGTCA-CGGC-ATGGACGTCAGCGAATGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACAGTACGTTAG-CAAGCACAATCTTTTTTTTTTTTGGATTAC-----TACCGTGTGAC-----------------------------------------GAACTTCTTT-----GGATTTT-CTATAC----CGTGTGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CGAT----------------------------------------------------- [...]
+	Eragrostis_schweinfurthii	GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCTGTGAAATACGACACGGAAAC----TGTGAGCCAATCACAAACATTTCACTA---------C-----TACCTTCTTTCATTTCATTGCTACTGTGTCTGTGT-----------------GAACTTGTTT-----TGTTTT-------------GTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Eragrostis_rigidior	GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCTGAAACAGTGAG----CCAAGCTCAATCACTTGACTT----TGTTGAT---AATGTTCGAT-------------------------------------------GGACTTCTTT-----GGATTTT-CAGTAC----CGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Eragrostis_polytricha	GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACAGTGAG--AGCCAAGCACAATCATTTTACTT----CATTGCTAGTACTGTTTGAT-------------------------------------------GAACTTCTTT-----GGATTTT-CAGTAC----TGTTCGAT--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Eragrostis_pilosa_2.7	GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCTGAAACGGTGAA--------------CCATTTTACTT----CATTGCT---ACTGTTTCAT-------------------------------------------GAACTTCTTT-----GGATTTT-CAGTGC----TGTC------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Eragrostis_pilosa_2.6	GGGATCGTCAATGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACGGTGAG----CCAAGCACAATCATTTTACTT-CGTCATTGCT---ACTGTTTGAT-------------------------------------------GAACTTCTTT-----GGATTCT-CAGTAC----TGTTTTAA----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------AT--------------------------------------------------------- [...]
+	Eragrostis_patenti-pilosa	GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACAGTACGTGAGCCAAGCACAGTCTTTTTTTTT---GGATGGC-----TACTGTGTGAT-----------------------------------------GAACTTCTTT-----GGATTTC-CAGTAC----CGCTCGGT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Eragrostis_papposa	GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCTGAAACAGTGAG----CCAAGCACAATCATTTTACTT----CATTGAT---ACCGTTCGGT-------------------------------------------GAACTTCTTT-----GGATTTT-CGGTGC----TGTTCGAT------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ [...]
+	Eragrostis_paniciformis_ETH_3_9.8	GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACAGTACGTGAGCCGAGCGCAGTCATTTTTT----AGGATCGC-----TACCGTGTGAC--------------------------------------------GTTCTTT-----GGATTTT-CTGTAC----TGTGTGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CGATTCTG--------------------------------------- [...]
+	Eragrostis_paniciformis_9.11	GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACAGTACGTGAGCCGAGCACAGTCATTTTTT----AGGATCGC-----TACCGTGTGAC--------------------------------------------GTTCTTT-----GGATTTT-CTGTAC----TGTGTGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CGATTCTG-------------------------------------------- [...]
+	Eragrostis_nutans	GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACAGTACGTGAGCCGAGCACAGTCATATTTTT---GGGATCGACAGACTACCGTGTGAC----------------------------------------GAAAGTTCTTT-----GGATTTT-CTGTAC----AGTGTGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CGATTCTG------------------------------------------------------- [...]
+	Eragrostis_neesii	GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAAC----TGTGAGCCAAGCACAATCACGTTTTTT-----ATTGC-----TACTGCGTGAT-----------------------------------------GAATTTCCTA-----GGTTGCT-CAGTAC----TGTTCGAT------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Eragrostis_minor_3.4	GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCTGAAACAGTGAG----CCAAGCTCAATCACTTGACTT----CCTTGAT---AATGTTCGAT-------------------------------------------GGACTTCTTT-----GGATTTT-CAGTAC----CGTTCGAT---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Eragrostis_minor__PI_223367_22	---ATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACAGTGAG--AGCCAAGCACAATCATTTTACTT----CATTGCTAGTACTGTTTGAT-------------------------------------------GAACTTCTTT-----GGATTTT-CAGTAC----TGTGCGAT------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ [...]
+	Uniola_paniculata	GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACAGTGAG----CCTAGCACAAACATTTTACTACTCCCTCTAATTTTAAATATCCGACGCTGTTAATTTTT-----------------------------TTCATTATTT-----TAACTAT-TTATTT----TTTTATAAATATTTATGTAAATAGCTAAATGTATAAATTAACCTTAAAATATTTTTGATGATAGATCTAATGATACTTATTTTACGTTTAAATAATTAATTATTTAAATATATATTGTTAGTTAAAATTCAATAAAAAATTTAACGGTGTCATATATTTAAAAAAGGAAGGATCGTTTCATTGCCACTGTGTGAGTAATGTTCGAT------------------------------------------------------- [...]
+	Thellungia_advena	GGGATCGTGAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAGACTGTGAG-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Tetrachne_dregei	GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTCAAATACGACGCCGAAACCGTGAG----CCTAGCACAACTTCTTTCATTTCATTGCGACTGTGTGGACTTGTTCGGTTT-TTTAGTACTGCACAATTCGATTC-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Sporobolus_indicus_6.2	GGAATCGTCAACGGCAATGGACGTCAGCGAGTGGGACCCTAGCAAGGACAAGTACATCGCCGTGAAGTACGACGTGGAAACCGTGAG-------------------------------------------------------------------------------------------------------------------------------------GACCTGCATGCTAGCTTGTTTTGTT-CCACATGACTCAATTTATTCATTGCCACTGCGTCCATTCATCAGTGCCAGTGAACTATTCGATTCTGAATTTCTGACGAGGCAATAAGGG------------------------------------------------------------------------------------------------------------------------------------ [...]
+	Sporobolus_indicus_6.1	GGAATCGTCAACGGCAATGGACGTCAGCGAGTGGGACCCTAGCAAGGACAAGTACATCGCCGTGAAGTACGACGTGGAAACCGTGAG-------------------------------------------------------------------------------------------------------------------------------------GACCTGCATGCTAGCTTGTTTTGTT-CCACATGACTCAATTTATTCATTGCCACTGCGTCCATTCATCAGTGCCAGTAAACTATTCGATTCTGAATTTCTGACGAAGCAATAAGGG------------------------------------------------------------------------------------------------------------------------------------ [...]
+	Spartina_pectinata	GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGAAGGGACAAGTACATCGCCGTGAAGTACGACGTGGAAACTGTGAG-------------------------------------------------------------------------------------------------------------------------------------TCTAT------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Schmidtia_pappophoroides	GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCCTCAAATACGACGCCGAAACGGTACGTGAGCCAGGCACACACATTTCACCGTTTT---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------TCATAGCCACTGTACTGCTCGAT------------------------------------------------ [...]
+	Eragrostis_mexicana_PI_203652_3.1	GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACAGTGAG--AGCCAAGCACAATCATTTTACTT----CATTGCTAGTACTGTTTGAT-------------------------------------------GAACTTCTTT-----GGATTTT-CAGTAC----TGTGCGAT--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Eragrostis_mexicana_PI_203652_1.1	GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCTGAAACAGTGAG----CCAAGCTCAATCACTTGACTT----CGTTGAT---AATGTTCGAT-------------------------------------------GGACTTCTTT-----GGATTTT-CAGTAC----CGTTCGAT--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Eragrostis_macilenta_PI_194929_6	GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACAGTGAG--AGCCAAGCACAATCATTTTACTT----CATTGCTAGTACTGTTTGAT-------------------------------------------GAACTTCTTT-----GGCT-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Eragrostis_macilenta_PI_194929_2.4	GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGATAAGTACATCGCCATGAAATACGACGCTGAAACAGTGAG----CCAAGCTCAATCACTTGACTT----TGTTGAT---AATGTTCGAT-------------------------------------------GGACTTCTTT-----GGATTTT-CAGTAC----CGTTCGAT-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Eragrostis_lugens	GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACAGTGAG--AGCCAAGCACAATCATTTTACTT----CATTGCTAGTACTGTTTGAT-------------------------------------------GAACTTCTTT-----GGATTTT-CAGTAC----TGTTCGAT------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Eragrostis_lehmanniana	GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACAGTGAG----CCAAGCACAATCATTTTGCTT----TATTGCT---ACTGTTTGAT------------------------------CGATGAATTTCCTGAACTTCTTT-----GGATTTG-GAGTAC----TGTTCGGT-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Eragrostis_intermedia	GGGATCGTCA-TGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACAGTGAG----CCAAGC-------------------------T---ACTGTTTGAT-------------------------------------------GAACTTCTTT-----GGATTTT-CAGTAT----TGTTCGAT--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Eragrostis_heteromera_4.1	GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACAGTGAG----CCAAGCACAATCATGTTCCTT----CATTGCTATTACTGTTTGAT-------------------------------------------GAACTTCTTT-----GGATTTT-CAGTAC----TGTTCGTT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Eragrostis_heteromera_2.9	GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATATGACGCGGAAACGGTGAG----CCAAGCACAATCATTT-------------GCT---ACTGTGTG--------------------------------------------------------------ATTTT-CAGTACGTACTGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Eragrostis_elegantissima	GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATTGCCATGAAATACGACGCTGAAACAGTGAG----CCAAGCACAATCATTTCGCTT----CATTGAT---ACTGTTCGAT-------------------------------------------GAACTTCTTT-----AGATTTT-CGGTGC----TGTTCGAT------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ [...]
+	Eragrostis_echinochloidea	GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACAGTGAG----CCAAGCACAGTCATTTCGCTT----CACTGAT---ACTGTTGGAT-------------------------------------------GAACTTCTTT-----GGTTTT--CAGTAC----CGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Eragrostis_dielsii	GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCCGAAACCGTGAG----CTTAGCACAAACATTTACT-----AGCTAGCT---ACTAGTA-------------------------------------------------GTGCTTT-CTTT--------CAGTAC----TGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------T------------------------------------------------------------- [...]
+	Eragrostis_curvula	GGGATCGTCAACGGC-ATGGACGTCGGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCCGAAACAGTGAG----CCAAGCACAATCACTTTACTT----CATTGAG---ACTGTTCGAT-------------------------------------------GAACTTAATT-CTTTGGATTTT-CGGTAC----TGTTCGAT------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ [...]
+	Eragrostis_ciliaris	GGGATCGTCA-CGGC-ATGGACGTCAGTGAGTGGGACCCCAGCAAGGACAAGTATATCGCCGTGAAATACGACGCGGAAACAGTACGTGAGCCAAGCACAATCATTTTTTTTT--GGATTGAT---ATTGTGTGAT-------------------------------------------GAACTTCTTT-----GGATTTT-CAGTAC----TGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Eragrostis_cilianensis_PI_299912_1.4	GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCTGAAACAGTGAG----CCAAGCTCAATCACTTGACTT----TGTTGAT---AATGTCCGAT-------------------------------------------GGACTTCTTT-----GGATTTT-CAGTAC----CGTTCGAT------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ [...]
+	Eragrostis_cilianensis_PI_299912_1.3	GGCATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCCGAAACAGTGAG----CCAAGCACAATCACTTTACTT----CATTGAG---ACTGTTCGAT-------------------------------------------GAACTTAATT-CTTTGGATTTT-CGGTAC----TGTTCGAT------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ [...]
+	Eragrostis_cilianensis_eth24_6.5	GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCTGAAACAGTGAG----CCAAGCTCAATCACTTGACTT----CGTTGAT---AATGTTCGAT-------------------------------------------GGACTTCTTT-----GGATTTT-CAGTAC----CGTTCGAT---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Eragrostis_chapelieri	GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCTGAAACAGTGAG----CCAAGCTCAATCACTTGACTT----CGTTGAT---AATGTTCGAT-------------------------------------------GGACTTCTTT-----GGATTTT-CAGTAC----CGTTCGAT--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Eragrostis_botryodes_ETH_9_2.1	GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACAGTACGTGAGCCGAGCACAGTCATTTTTT----AGGATCGC-----TCCCGTGTGAC-----------------------------------------GAAGTTCTTT-----GGATTTT-CTGTAC----TGTGTGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CGATTCTG------------------------------------------ [...]
+	Eragrostis_botryodes_ETH_13_3.5	GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACAGTACGTGAGCCAAGCGCAGTCATTTTTT-----GGATTGC-----TACCGTGTGATCGAT-------------------------------------GAACTTCATT-----GGATTTTCCAGTAC----TGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Eragrostis_bicolor21	GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACTCGGAAACAGTGAG----CCAAGCACAATCATTTTACTT-CTTAATTGCT---ACTGTGTGAT-------------------------------------------GAACTTATTT-----GGATTTT-CGGTAC----TGTTCGAT---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Eragrostis_bicolor_25	CGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACTCGGAAACAGTGAG----CCAAGCACAATCATTTTACTT-CTTAATTGCT---ACTGTGTGAT-------------------------------------------GAACTTATTT-----GGATTTT-CGGTAC----TGTTCGAT--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Eragrostis_barrelieri_1.5	GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCCGAAACAGTGAG----CCAAGCACAATCACTTTACTT----CATTGAT---ACTGTTCGAT-------------------------------------------GAACTTAATT-CTTTGGATTTG-CGGTAC----TGTTCGCT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Eragrostis_barrelieri_1.4	GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCTGAAACAGTGAG----CCAAGCTCAATCACTTGACTT----TGTTGAT---AATGTTCGAT-------------------------------------------GGACTTCTTT-----GGATTTT-CAGTAC----CGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Eragrostis_bahiensis_1.9	GGGATCGTCA-CGGC-ATGGACGTCAGCGAATGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACAGTACGTGAG-CAAGCACAATCTTTTTTTTT-TTGGATTAC-----TACCGTGTGAC-----------------------------------------GAACTTCTTT-----GGATTTT-CTATAC----CGTGTGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CGAT---------------------------------------------------- [...]
+	Eragrostis_bahiensis_1.8	GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACAGTACGTGAGCCAAGCAGAGTCACTTTTATT---GGATTGC-----TACCGTGTGAT-----------------------------------------GAGCTTCTTT-----GGATTTT-CAGTAC----TGTTCGAT------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ [...]
+	Eragrostis_aspera	GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCCGAAACAGTGAG----CCAAGCACAATCACTTTACTT----CATTGAT---ACTGTTCGAT-------------------------------------------GAACTTAATT-CTTTGGATTTG-CGGTAC----TGTTCGCT------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Eragrostis_airoides	GGGATCGTCAATGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCGGAAACAGTGAG----CCAAGCT----------------------------ACTGTTTGAT-------------------------------------------GAACTTCTTT-----GGATTTT-CAGTAC----TGTTCGAT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Enneapogon_scoparius	GGGATCGTCA-CGGC-ATGGACATCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTCAAATACGACGCCGAAACCGTGAG----CCAAGCACA------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------GTCATTTCACCGTCTTTCATTGCCACTGTACTGCTC---------------------------------------------------- [...]
+	Eleusine_corocana	GGAATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCTAGCAAGGACAAGTACATCGCCGTCAAATACGACGAGGAAACCGTGAG------------------------------------------------------------------------------------------------------------------------------------------------TTCTTCATCTGTTGTTGCCACCGTGTGAACTTGTTTGATTATTCAGTAGTACTACTATAGGGATTCGG--TTCTGATTATGCAACCATGCAA------------------------------------------------------------------------------------------------------------------------------------------------------ [...]
+	Diandrochloa_japonica	GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGATCCCAGCAAGGACAAGTACATCGCCATGAAATACGACGCAGAAACAGTGAG----CCAAGCACAATCATGTTCCTT----CATTGAC---ACTGTTCG??T------------------------------------------GAACTTCTTT-----GGATTTT-CAGTAC----TGTTCGGT--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Dactyloctenium_radulans	GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAGACCGTGAG-------------------------------------------------------------------------------------------------------------------------------------CCATCTTCTTCTTTCACATTAATTGTTGCCACTGTCTCTGTGAACTTGTTTTGGTTTTTCGTTAAGTACTAATAATCGGGGTTCTGATCAAGCAAGCGTGGGA------------------------------------------------------------------------------------------------------------------------------------------------ [...]
+	Dactyloctenium_aegypticum	GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACCGTGAG-------------------------------------------------------------------------------------------------------------------------------------CTCAT---------------------TCGTTCCCACTTTGTGAACTTGTTTGAGTTTTCAGTACTCTGTTCGATTCTGA------CAAGGCATTCGGTGCAAA---------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Coelachyrum_piercei	GGGATCGTCAACGGC-CTGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCACCAAGTACGACGTGTCAACGGTGAG------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ [...]
+	Calamovilfa_longifolia	GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACACCGCTATGAAATACGACGTGGAAACTGTGAG-------------------------------------------------------------------------------------------------------------------------------------TCTTTTTTT----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Calamovilfa_gigantea	GGGATCGTCA-CGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGTCGAAACTGTGAG-------------------------------------------------------------------------------------------------------------------------------------TATATATA-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+	Acamptoclados_sessilispica_1.8	GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTCAAATACGACGCGGAGACAGTACGTGAGCCAAACACAGTCATTTTTT--------GGATGGCTACCGTGTGAT-------------------------------------------GAACTTCTTT-----GGATTTC-CAATAC----TGTT------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CGAT------------------------------------------ [...]
+	Acamptoclados_sessilispica_1.3	GGGATCGTCAACGGC-ATGGACGTCAGCGAGTGGGACCCCAGCAAGGACAAGTACATCGCCGTGAAATACGACGCGGAAACAGTACGTGAGCCAAGCACAGCCATTTTTTTC------GGATTGCTACCGTGTGAT-------------------------------------------GAACTTCTTT-----GGATTTT-CAGTAC----TGTT------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CAAT------------------------------------------ [...]
+
+;
+end;
+begin mrbayes;
+    [ HKY model, 4 gamma categories, 1 invariant site ]
+    lset nst=2;
+    lset rates=invgamma;
+    lset ngammacat=4;
+    [ strict clock model ]
+    prset brlenspr=clock:uniform;
+    mcmcp ngen=1000000 nchains=1 printfreq=10000;
+end;
diff --git a/examples/benchmark/mrbayes/testHKY1809.nex b/examples/benchmark/mrbayes/testHKY1809.nex
new file mode 100644
index 0000000..3310056
--- /dev/null
+++ b/examples/benchmark/mrbayes/testHKY1809.nex
@@ -0,0 +1,76 @@
+#NEXUS
+begin data;
+	dimensions ntax=59 nchar=1824;
+	format datatype=dna missing=? gap=-;
+	matrix
+	Varecia_variegata_variegata	ATGGCTCATCCAGTCCAACTAGGATTTCAAGACGCCGCTTCTCCTATTATAGAAGAACTCCTATATTTTCATGACCACACCCTAATAATTATATTTCTAATTAGCTCTTTAGTCCTATATATTATTTCCCTAATACTCACTACTAAACTCACACATACAAGCACTATAGATGCTCAAGAAGTAGAGACAGTATGAACAATTCTACCCGCAGCAATTCTCATTCTTATTGCCCTCCCCTCACTACGTATCCTATACATAATGGACGAAATTACTTCTCCTTCCCTTACCCTTAAAACCATAGGTCACCAATGATATTGAAGTTATGAATATACGGATTACGAAAATTTATGCTTTGACTCATATATAACCCCCTGCTCAGACCTAAAACCCGGAGAACTTCGCTTACTTGAAGTAGATAATCGAGTCGTTCTACCCACAGAACTATCAATCCGAACGCTAATCT [...]
+	Varecia_variegata_rubra	ATGGCTCATCCAGTCCAACTAGGATTTCAAGACGCCGCTTCTCCTATTATAGAAGAACTCCTATATTTTCACGACCACACCCTAATAATTATATTCCTAATTAGCTCTTTAGTCCTATATATTATTTCCCTAATACTCACTACTAAACTCACACATACAAGCACTATAGATGCTCAAGAAGTAGAAACAGTATGAACAATTTTACCCGCAGCAATTCTTATTCTTATTGCCCTCCCCTCACTACGTATCCTATACATGATGGACGAAATTACTTCTCCTTCCCTTACCCTTAAAACCATAGGTCACCAATGATATTGAAGTTATGAGTATACGGATTACGAAAATTTATGCTTTGACTCATATATAACCCCCTGCTCAGACCTAAAACCCGGAGAACTTCGCTTACTTGAAGTAGATAATCGAGTCGTTCTACCCACAGAACTGTCAATCCGAACGCTAATCTCTTC [...]
+	Ursus_americanus	ATGGCACACCCCTTTCAAATAGGTCTTCAAGATGCAACTTCTCCTATCATAGAAGAACTCCTACATTTTCATGACCATACATTAATAATTGTATTCCTAATTAGCTCCTTAGTTCTCTATATTATTTCAACTATATTAACTACCAAATTAACACACACAAACACAATGGATGCACAAGAAGTAGAGACGGTGTGAACCATCCTGCCAGCTATAATCCTAATTCTAATCGCACTCCCATCGCTACGGATTCTCTATATAATGGATGAAATCAATAACCCCTCACTGACCGTAAAAACCATGGGCCATCAATGATATTGAAGTTACGAGTACACAGATTATGAAGATCTAAATTTTGACTCCTACATGACTCCAACACAAGAACTAAAGCCTGGAGAACTGCGGTTATTAGAAGTGGACAATCGAGTAGTACTGCCCATAGAAATAACGATCCGTATGCTAATCTCATCAGAAGAT [...]
+	Rhinocerus	ATGGCTTATCCACTTCAACTAGGATTTCAAGATGCAACATCCCCTATTATAGAAGAATTACTCCATTTCCATGACCATACACTGATAATCGTATTTTTAATTAGCTCCCTAGTGCTGTATATTATTTCACTCATGCTAACAACCAAACTAACACACACAAGCACTATAGACGCTCAAGAAGTAGAGACCATCTGAACGATTTTACCAGCTATTATCCTAATTTTAATTGCTCTCCCATCGCTACGAATCCTCTATATAATAGATGAGATTAATAATCCTTCCTTAACCATCAAAACCATAGGCCATCAGTGATACTGAAGCTACGAATATACAGATTATGAAGACCTAACCTTTGACTCCTACATAATTCCCACATCAGATCTAAAACCAGGAGAACTGCGACTTCTAGAAGTCGACAACCGAGTAGTATTACCCATAGAAATAACGATTCGAATGCTAATCTCATCCGAAGACGTTCTC [...]
+	Propithecus_tattersalli	ATGGCTTATCCAGTTCAATTGGGATTTCAGGATGCTGCTTCCCCCATCATGGAAGAGCTCTTATACTTTCATGATCATACTTTAATAATTGTATTCCTAATTAGTTCTCTAGTTCTCTATATCATCTCTCTAATACTCACCACCAAACTCATACACACCAGCACCATGGACGCACAAGAAGTAGAAACAGTATGAACTATCCTACCTGCAATCATTCTAATTCTTATTGCCCTCCCATCCCTACGTATCCTATACATAATGGATGAAATCACTACTCCTTCATTAACCCTTAAAACCATAGGTCATCAATGGTACTGAAGCTATGAATACACAGATTACGAAGATCTGTCTTTCGACTCATACATAGTTCCATCATCGGACCTCAAGCCCGGAGAACTTCGTCTGCTCGAAGTAGACAACCGAATTGTACTACCCACAGAACTATCAATTCGAATACTTATCTCTTC [...]
+	Pongo_pygmaeus	ATGGCGCACGCAGCACAGGTAGGTCTACAAGACGCTACCTCTCCTATCATAGAAGAATTGGTCATCTTTCACGACCACGCCCTCATAATCATCTTCCTAATCTGCTTCCTAGTCCTGTACGCCCTTTTCCTAACACTCACAACGAAACTCACCAACACTAACATCTCAGATGCCCAAGAGATAGAAACTATTTGAACTATCCTACCAGCCATCATCCTAATTCTAATCGCCCTCCCATCTCTACGCATCCTCTACTTAACAGACGAAATCAACGACCCTTCCTTCACCATTAAATCAATCGGCCATCAATGGTACTGAACCTACGAGTATACTGACTATGGCGGATTGATCTTCAACTCTTACATGCTCCCACCACTATTCCTAGAACCAGGCGACCTTCGACTCCTAGACGTCGACAATCGAGTAGTCCTCCCAGTCGAAGCCCCCGTTCGCATAATAATCACATCCCAAGACGT [...]
+	Physeter_macrocephalus	ATGGCATACCCCCTTCAACTAGGTTTCCAAGACGCAACCTCTCCCATTATAGAGGAACTCTTACACTTTCATGATCACACCCTAATAATTGTTTTCCTAATTAGCTCTCTAGTCCTCTACATTATCACCCTAATACTAACAACCAAACTAACACATATCAACACAATAGACGCCCAAGAAGTAGAGACCATTTGAACCGTTCTCCCCGCTATCATTCTAATCCTAATCGCCCTACCATCCCTACGAATCCTCTACATAATAGACGAAATCAACAGCCCCTCTCTTACTGTAAAGACAATAGGTCACCAATGATATTGAAGCTACGAATATACCGACTACGAAGACCTGTCCTTTGACTCTTACATAATCCCAACATCGGACTTAAAACCAGGAGACCTACGACTATTAGAAGTCGACAACCGAATAGTATTGCCTATAGAAATAACAATCCGAGTCTTAGTCTCCTCC [...]
+	Pan_troglodytes	ATGGCACATGCAGCGCAAGTAGGTCTACAAGATGCTACTTCCCCTATCATAGAAGAACTTATTATCTTTCACGACCATGCCCTCATAATTATCTTTCTCATCTGCTTTCTAGTCCTATACGCCCTTTTCCTAACACTCACAACAAAACTAACTAATACTAGTATTTCAGACGCCCAGGAAATAGAAACCGTCTGAACTATCCTGCCCGCCATCATCCTAGTCCTTATTGCCCTACCATCCCTGCGTATCCTTTACATAACAGACGAGGTCAACGACCCCTCCTTTACTATTAAATCAATCGGCCATCAATGATATTGAACCTACGAATACACCGACTACGGCGGGCTAATCTTCAACTCCTACATACTCCCCCCATTATTTCTAGAACCAGGTGATCTACGACTCCTTGACGTTGATAACCGAGTGGTCCTCCCAGTTGAAGCCCCCGTTCGTATAATAATTACATCACAAGATG [...]
+	Mirza_coquereli	ATGGCTTACCCAGCTCAGCTAGGACTCCAAGATGCCGCTTCCCCAATCATGGAAGAGCTTGCATATTTTCACGACCATACCCTAATAATTGTATTTTTAATTAGCTCCATGGTCCTATATATAATCTCTCTAATACTTACTACTGAACTTACCCACACAAGCACTATAGATGCTCAAGAAGTCGAAACAGTATGAACAATCCTACCCGCAGTTATCCTAATTTTTATTGCCCTTCCATCATTACGTATTTTATATATAATAGACGAAATTACAACGCCATCCTTAACTCTAAAAACCATAGGCCATCAATGATATTGAAGTTATGAATACACAGACTACGAAAGCCTATGCTTTGACTCTTATATGACCCCTCCACTAGAACTAGATCCAGGAGAACTTCGCCTACTAGAAGTTGATAATCGAGTAGTACTGCCTACAGAAATATCCATTCGTATACTTGTCTCTTCAGAAGATG [...]
+	Microcebus_tavaratra_69	ATGGCCCACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGATCACACCCTTATAATTGTATTTTTAATTAGTTCATTAGTCCTATATATCATTTCCCTTATGCTTACCACGGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTTATTGCTCTTCCATCGTTACGCATTTTATATATAATAGATGAAATTACAACCCCTTCTCTAACTCTTAAGACTATAGGTCATCAGTGATATTGAAGCTATGAATATACAGACTATGAAAGCCTATGCTTTGACTCATATATAACCCCTCCATTAGAATTAGATCCAGGAGAACTACGATTACTAGAAGTAGATAATCGAGTAGTATTACCAACAGAAATATCTATTCGTATACTCATCTCCTC [...]
+	Microcebus_tavaratra_110	ATGGCCCACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGATCACACCCTTATAATTGTATTTTTAATTAGTTCATTAGTCCTATATATCATTTCCCTTATGCTTACCACGGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTTATTGCTCTTCCATCGTTACGCATTTTATATATAATAGATGAAATTACAACCCCTTCTCTAACTCTTAAGACTATAGGTCATCAGTGATATTGAAGCTATGAATACACAGACTATGAAAGCCTATGCTTTGACTCATACATAACCCCTCCATTAGAATTAGATCCAGGAGAACTACGATTACTAGAAGTAGATAATCGAGTAGTATTACCAACAGAAATATCTATTCGCATACTCATCTCCT [...]
+	Microcebus_sambiranensis_80	ATGGCCTATCCAGCCCAATTAGGTTTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGATCATACCCTTATGATTGTATTTTTAATTAGCTCATTAGTCCTATACATTATTTCCCTTATGCTTACCACGGAACTTACTCATACAAGCACCATAGACGCTCAAGAAGTAGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTTATTGCCCTTCCATCACTACGCATTTTATATATAATGGATGAAATTACAACTCCCTCCCTAACTCTTAAGACTATAGGTCATCAATGATATTGAAGCTATGAATATACCGACTATGAAAGCCTATGCTTTGACTCCTACATAACCCCTCCATTAGAACTCGATCCAGGAGAACTACGATTACTAGAAGTAGATAATCGAGTAGTACTGCCAACAGAAATATCCATTCGTATACTCATCT [...]
+	Microcebus_sambiranensis_72	ATGGCCTATCCAGCCCAATTAGGTTTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGATCATACCCTTATGATTGTATTTTTAATTAGCTCATTAGTCCTATACATTATTTCCCTTATGCTTACCACGGAACTTACTCATACAAGCACCATAGACGCTCAAGAAGTAGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTTATTGCCCTTCCATCACTACGCATTTTATATATAATGGATGAAATTACAACTCCCTCCCTAACTCTTAAGACTATAGGTCATCAATGATATTGAAGCTATGAATATACCGACTATGAAAGCCTATGCTTTGACTCCTACATAACCCCTCCATTAGAACTCGATCCAGGAGAACTACGATTACTAGAAGTAGATAATCGAGTAGTACTGCCAACAGAAATATCCATTCGTATACTCATCT [...]
+	Microcebus_ravelobensis_68	ATGGCCTACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTGTATATTTCCACGACCATACCCTTATAATTGTGTTTTTAATTAGCTCATTGGTCCTATATATTATTTCCCTTATACTTACCACAGAGCTCACTCATACAAGCACTATAGATGCTCAAGAAGTGGAAACTGTATGAACAATTTTGCCGGCAGTTATCTTAATTCTTATTGCCCTTCCATCATTACGCATTTTATATATAATAGATGAAATTACAACCCCGTCCCTTACTCTTAAGACTATAGGTCATCAATGATATTGAAGCTATGAATATACAGACTATGAAAACTTATGCTTTGACTCATACATGACTCCTCCATTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTCGACAATCGAGTAGTATTACCAACAGAAATATCTATCCGCATACTCATCTC [...]
+	Microcebus_ravelobensis_66	ATGGCCTGCCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTGTATATTTCCACGACCATACCCTTATAATTGTGTTTTTAATTAGCTCATTGGTCCTATATATTATTTCCCTTATACTCACCACAGAGCTCACTCATACAAGCACTATAGATGCTCAAGAAGTGGAAACTGTATGAACAATTTTGCCAGCAGTTATCTTAATTCTTATTGCCCTTCCATCATTACGCATTTTATATATAATAGATGAAATTACAACCCCGTCCCTTACTCTTAAGACTATAGGTCATCAATGATATTGAAGCTATGAATATACAGACTATGAAAACTTATGCTTTGACTCATACATGACTCCTCCATTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTCGACAATCGAGTAGTATTACCAACAGAAATATCTATCCGCATACTCATCTC [...]
+	Microcebus_myoxinus_76	ATGGCCTACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTACATATTTTCATGATCATACCCTTATGATCGTATTCTTAATTAGCTCATTAGTTCTATATATCATTTCCCTCATGCTTACCACGGAACTCACCCATACAAGCACCATAGACGCTCAAGAAGTAGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCTCTTCCATCATTACGCATTTTATATATAATGGATGAAATTACAACTCCCTCCCTGACTCTTAAGACTATAGGTCATCAATGATATTGAAGCTATGAATACACAGACTATGAAAGCTTATGCTTTGACTCATATATAACCCCTCCATTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTGGATAATCGAGTAGTACTACCAACAGAAATATCTATTCGTATACTCATCTCTTCA [...]
+	Microcebus_myoxinus_185	ATGGCCTACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCATGATCATACCCTTATGATCGTATTCTTAATTAGCTCATTAGTTCTATATATCATTTCCCTCATGCTTACCACGGAACTCACCCATACAAGCACCATAGACGCTCAAGAAGTAGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCTCTTCCATCATTACGCATTTTATATATAATGGATGAAATTACAACTCCCTCCCTGACTCTTAAGACTATAGGTCATCAGTGATATTGAAGCTATGAATATACAGACTATGAAAGCTTATGCTTTGACTCATATATAACCCCTCCATTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTGGATAATCGAGTAGTACTACCAACAGAAATATCTATTCGTATACTCATCTCTTC [...]
+	Microcebus_murinus_74	ATGGCCCACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATAATTGTATTTTTAATTAGCTCATTAGTTCTTTATATTATTTCCCTTATACTTACCACGGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTAGAAACAGTATGAACAATTCTACCAGCGGTTATTTTAATTCTTATTGCCCTTCCATCACTACGTATTTTATATATAATAGATGAAATTACAACTCCCACTCTGACCCTTAAGACAATAGGTCATCAATGATATTGAAGTTACGAATATACAGATTATGAAAACCTATGCTTTGACTCATACATAACCCCTCCTTTAGAACTCGATCCAGGAGAACTACGATTACTAGAAGTTGACAATCGAGTAGTATTACCAACAGAAATATCCATTCGCATACTCATCTCTTCAG [...]
+	Microcebus_murinus_199	ATGGCCCACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATAATTGTATTTTTAATTAGCTCATTAGTCCTTTATATTATTTCCCTTATGCTTACCACGGAACTCACTCATACAAGCACCATAGACGCCCAAGAAGTAGAAACAGTATGAACAATTCTACCAGCGGTTATTTTAATTCTTATTGCCCTTCCATCACTACGTATTTTATATATAATAGATGAAATTACAACTCCCACTCTGACCCTTAAAACTATAGGTCATCAATGATATTGAAGCTACGAATATACAGATTATGAAAACCTATGCTTTGACTCATACATAACCCCTCCTTTAGAACTCTATCCAGGAGAACTACGACTACTAGAAGTTGACAATCGAGTAGTACTACCAACAGAAATATCCATTCGCATACTCATCTCTTCA [...]
+	Microcebus_murinus_153	ATGGCCCACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATAATTGTATTTTTAATTAGCTCATTAGTTCTTTATATTATTTCCCTTATACTTACCACGGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTAGAAACAGTATGAACAATTCTACCAGCGGTTATTTTAATTCTTATTGCCCTTCCATCACTACGTATTTTATATATAATAGATGAAATTACAACTCCCACTCTGACCCTTAAGACAATAGGTCATCAATGATATTGAAGTTACGAATATACAGACTATGAAAACCTATGCTTTGACTCATACATAACCCCTCCTTTAGAACTCGATCCAGGAGAACTACGATTACTAGAAGTTGACAATCGAGTAGTATTACCAACAGAAATATCCATTCGCATACTCATCTCTTCA [...]
+	Microcebus_murinus_141	ATGGCCCACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATAATTGTATTTTTAATTAGCTCATTAGTCCTTTATATTATTTCCCTTATACTTACCACGGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTAGAAACAGTATGAACAATTCTACCAGCGGTTATTTTAATTCTTATTGCCCTTCCATCACTACGTATTTTATATATAATAGATGAAATTACAACTCCCACTCTGACCCTTAAGACAATAGGTCATCAATGATATTGAAGCTACGAATATACAGATTATGAAAACCTATGCTTTGACTCATATATAACCCCTCCTTTAGAACTCGATCCAGGAGAACTACGATTACTAGAAGTTGACAATCGAGTAGTATTACCAACAGAAATATCCATTCGCATACTCATCTCTTCA [...]
+	Microcebus_murinus_122	ATGGCCCACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATAATTGTATTTTTAATTAGCTCATTAGTCCTTTATATTATTTCCCTTATGCTTACCACGGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTAGAAACAGTATGAACAATTCTACCAGCGGTTATTTTAATTCTTATTGCCCTTCCATCACTACGTATTTTATATATAATAGATGAAATTACAACTCCCACTCTGACCCTTAAAACTATAGGTCATCAATGATATTGAAGCTACGAATATACAGATTATGAAAACCTATGCTTTGACTCATATATAACCCCTCCTTTAGAACTCGATCCAGGAGAACTACGACTACTAGAAGTTGACAATCGAGTAGTATTACCAACAGAAATATCCATTCGCATACTCATCTCTTCA [...]
+	Microcebus_griseorufus_355	ATGGCCTACCCAGCCCAATTAGGTTTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATGATTGTATTTTTAATCAGCTCATTGGTCCTTTATATTATTTCCCTTATACTTACCACAGAACTTACTCATACAAGCACTATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCCCTTCCATCATTACGCATTCTATACATAATGGATGAAATCACAACCCCCACCCTTACCCTTAAAACCATAGGTCATCAGTGATATTGAAGTTATGAATATACAGATTATGAAAGCCTATGCTTTGACTCATATATGACCCCTCCTTTAGAACTTGACCCCGGAGAATTACGATTACTAGAAGTCGATAATCGAGTAGTATTACCAACAGAAATATCTATTCGCATGCTAATCTC [...]
+	Microcebus_griseorufus_351	ATGGCCTACCCAGCCCAATTAGGTTTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATGATTGTATTTTTAATCAGCTCATTGGTCCTTTATATTATTTCCCTTATACTTACCACAGAACTTACTCATACAAGCACTATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCCCTTCCATCATTACGCATTCTATACATAATGGATGAAATCACAACCCCCACCCTTACCCTTAAAACCATAGGTCATCAGTGATATTGAAGTTATGAATATACAGATTATGAAAGCCTATGCTTTGACTCATATATGACCCCTCCTTTAGAACTTGACCCCGGAGAATTACGATTACTAGAAGTCGATAATCGAGTAGTATTACCAACAGAAATATCTATTCGCATGCTAATCTC [...]
+	Microcebus_griseorufus_116	ATGGCCTACCCAGCCCAATTAGGTTTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATGATTGTATTTTTAATCAGCTCATTGGTCCTTTATATTATTTCCCTTATACTTACCACAGAACTTACTCATACAAGCACTATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCCCTTCCATCATTACGCATTCTATACATAATGGATGAAATCACAACCCCCACCCTTACCCTTAAAACCATAGGTCATCAGTGATATTGAAGTTATGAATATACAGATTATGAAAGCCTATGCTTTGACTCATATATGACCCCTCCTTTAGAACTTGACCCCGGAGAATTACGATTACTAGAAGTCGATAATCGAGTAGTATTACCAACAGAAATATCTATTCGCATGCTAATCTC [...]
+	Microcebus_griseorufus_101	ATGGCCTACCCAGCCCAATTAGGTTTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATGATTGTATTTTTAATCAGCTCATTGGTCCTTTATATTATTTCCCTTATACTTACCACAGAACTTACTCATACAAGCACTATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCCCTTCCATCATTACGCATTCTATACATAATGGATGAAATCACAACCCCCACCCTTACCCTTAAAACCATAGGTCATCAGTGATATTGAAGTTATGAATATACAGATTATGAAAGCCTATGCTTTGACTCATATATGACCCCTCCTTTAGAACTTGACCCCGGAGAATTACGATTACTAGAAGTCGATAATCGAGTAGTATTACCAACAGAAATATCTATTCGCATGCTAATCTC [...]
+	Microcebus_berthae_159	ATGGCCTACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCATGATCATACCCTTATGATCGTATTTTTAATTAGCTCATTAGTTCTTTATATCATTTCCCTCATGCTTACCACAGAACTCACCCATACAAGCACCATAGACGCTCAAGAAGTGGAA?CAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCTCTTCCATCATTACGCATTTTATATATAATGGATGAAATTACAACTCCCTCCCTAACTCTTAAGACCATAGGTCATCAGTGATATTGAAGCTATGAATATACAGACTATGAAAGCTTATGCTTTGACTCATATATAACTCCTCCACTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTGGATAATCGAGTAGTACTACCAACAGAAATATCTATTCGCATGCTCATCTCTTCA [...]
+	Microcebus_berthae_148	ATGGCCTACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCATGATCATACCCTTATGATCGTATTTTTAATTAGCTCATTAGTTCTTTATATCATTTCCCTCATGCTTACCACAGAACTCACCCATACAAGCACCATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCTCTTCCATCATTACGCATTTTATATATAATGGATGAAATTACAACTCCCTCCCTAACTCTTAAGACCATAGGTCATCAGTGATATTGAAGCTATGAATATACAGACTATGAAAGCTTATGCTTTGACTCATATATAACTCCTCCACTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTGGATAATCGAGTAGTACTACCAACAGAAATATCTATTCGCATGCTCATCTCTTCA [...]
+	Microcebus__rufus_2.191	ATGGCCCACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATAATTGTATTCTTAATCAGCTCATTAGTTCTATATATCATTTCCCTTATACTTACTACGGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTGGAAACAGTATGAACAATCTTACCAGCAGTTATTTTAATCCTTATTGCCCTTCCATCATTACGCATTTTATACATAATGGATGAAATTACAACTCCCTCCCTAACTCTTAAGACTATAGGTCATCAATGATATTGAAGCTATGAATATACAGACTATGAAAGCCTATGCTTTGACTCATACATAACCCCTCCATTAGAGCTCGATCCAGGAGAACTACGATTACTAGAAGTGGATAACCGAGTAGTACTACCAACAGAAATATCTATTCGTATACTCATCTCTTC [...]
+	Microcebus__rufus_2.190	ATGGCCCACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCACGACCATACCCTTATAATTGTATTCTTAATCAGCTCATTAGTTCTATATATCATTTCCCTTATACTTACTACGGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTGGAAACAGTATGAACAATCTTACCAGCAGTTATTTTAATCCTTATTGCCCTTCCATCATTACGCATTTTATACATAATGGATGAAATTACAACTCCCTCCCTAACTCTTAAGACTATAGGTCATCAATGATATTGAAGCTATGAATATACAGACTATGAAAGCCTATGCTTTGACTCATACATAACCCCTCCATTAGAGCTCGATCCAGGAGAACTACGATTACTAGAAGTGGATAACCGAGTAGTACTACCAACAGAAATATCTATTCGTATACTCATCTCTTC [...]
+	Microcebus__rufus_1.174	ATGGCCTACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCATGATCATACCCTTATGATCGTATTTTTAATTAGCTCATTAGTTCTATATATCATTTCCCTTATGCTTACCACAGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCTCTTCCATCATTACGCATTTTATATATAATGGATGAAATTACAACTCCCTCCCTAACTCTTAAGACTATAGGTCATCAGTGATATTGAAGCTATGAATATACAGATTATGAAAGCCTATGCTTTGACTCATATATAACCCCTCCATTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTGGATAACCGAGTAGTACTACCAACAGAAATATCTATTCGCATACTCATCTCTTC [...]
+	Microcebus__rufus_1.171	ATGGCCTACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCATGATCATACCCTTATGATCGTATTTTTAATTAGCTCATTAGTTCTATATATCATTTCCCTTATGCTTACCACAGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCTCTTCCATCATTACGCATTTTATATATAATGGATGAAATTACAACTCCCTCCCTAACTCTTAAGACTATAGGTCATCAGTGATATTGAAGCTATGAATATACAGATTATGAAAGCCTATGCTTTGACTCATATATAACCCCTCCATTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTGGATAACCGAGTAGTACTACCAACAGAAATATCTATTCGCATACTCATCTCTTC [...]
+	Microcebus__rufus_1.162	ATGGCCTACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCATGATCATACCCTTATGATCGTATTTTTAATTAGCTCATTAGTTCTATATATCATTTCCCTTATGCTTACCACAGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCTCTTCCATCATTACGCATTTTATATATAATGGATGAAATTACAACTCCTTCCCTAACTCTTAAGACTATAGGTCATCAGTGATATTGAAGCTATGAATATACAGATTATGAAAGCCTATGCTTTGACTCATATATAACCCCTCCATTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTGGATAACCGAGTAGTACTACCAACAGAAATATCTATTCGCATACTCATCTCTTC [...]
+	Microcebus__rufus_1.138	ATGGCCTACCCAGCCCAATTAGGATTCCAAGACGCCGCTTCCCCAATCATGGAAGAACTTATATATTTTCATGATCATACCCTTATGATCGTATTTTTAATTAGCTCATTAGTTCTATATATCATTTCCCTTATGCTTACCACAGAACTCACTCATACAAGCACCATAGACGCTCAAGAAGTGGAAACAGTATGAACAATTTTACCAGCAGTTATTTTAATTCTCATTGCTCTTCCATCATTACGCATTTTATATATAATGGATGAAATTACAACTCCCTCCCTAACTCTTAAGACTATAGGTCATCAGTGATATTGAAGCTATGAATATACAGATTATGAAAGCCTATGCTTTGACTCATATATAACCCCTCCATTAGAACTTGATCCAGGAGAACTACGATTACTAGAAGTGGATAACCGAGTAGTACTACCAACAGAAATATCTATTCGCATACTCATCTCTTC [...]
+	Macaca_mulatta	ATGGCCCACCCAGTTCAACTAAGCCTGCAAGACGCCACATCTCCTGTTATAGAGGAGTTGATTACTTTCCATGACCATGCTTTTATAGCCATATCTCTTATCAGCTTCCTAGTATTATATGCCCTGCTCTCAACGCTCACAACAAAACTAACCAACACTAGCATCACAGACGCCCAAGAAATAGAAACTATCTGAACTATCTTACCCGCAATTATCTTAATCCTAATTGCTCTCCCATCTCTACGCATCCTATACCTAACAGATGAAGTCAACGACCCATCCTTCACCATTAAATCAATCGGACACCAGTGATACTGAACCTACGAATACACAGATTACGGGGGCCTAATTTTCAACTCCTACATACTACCCCCACTATTCCTAAACCCAGGAGACCTCCGACTCCTAGAAGTTGACAATCGAGTAGTTCTTCCAATTGAAGCTCCTGTACGTATAATAATTACATCTCAAGACGT [...]
+	Loris_tardigradus	ATGGCCCATCCAGTACAATTCGGATTTCAAGACGCCGCCTCACCTATTATAGAAGAACTACTATACTTTCATGACCACACTCTCATAATTGTATTTATAATCAGCTCTCTAGTCCTATATATTATCTCCCTTATACTATCAACCGAACTTACCCATACAAGCACTATGGATGCGCAAGAAGTAGAAACAGTATGAACAATCCTGCCTGCCGTCATCCTAATTTTAATTGCCCTGCCATCCCTACGGATCCTATATATAATAGATGAAATTAATACCCCATCCCTTACCCTAAAAACAATAGGTCATCAATGATATTGAAGCTACGAATACACAGATTATGATAAACTATGCTTTGACTCCTATATAGTCCCAACCCCTGACCTAGAACCGGGGGACCTACGTCTACTTGAAGTAGATAACCGAGTTGTACTACCTACAGAAATATCTATTCGAATACTAATCTCCTCCGAAGA [...]
+	Lepilemur_ruficaudatus	ATGGCCCACCCAGTCCAACTAGGATTTCAAGATGCCGCCTCTCCTATCATAGAAGAACTTCTATATTTCCATGACCACACTCTAATAATTGTTTTCCTCATCAGTTCCTTGGTCCTTTACATTATTTCCCTTATACTCTCTACTAAACTCACCCACACAAGTACAGTGGATGCCCAAGAAGTAGAAACAGTATGAACTATTTTGCCCGCAGTGATCCTAATTCTTATCGCCCTTCCATCTCTACGCATCCTATACATAATAGACGAAATCACTACACCCTCCTTAACCCTTAAAACAATAGGCCATCAATGATACTGAAGCTATGAATACACGGACTATGAAAATCTTTGCTTTGACTCATATATAATTCCTCTGTCAGATCTTAAACCCGGTGATCTTCGCCTACTCGAGGTTGATAACCGAGTTGCCTTACCCACAGAAATATCAATCCGAATGTTAGTATCCTCA [...]
+	Lemur_catta	ATGGCCTATCCAGTTCAATTAGGATTTCAAGATGCTGCTTCTCCCATTATAGAAGAACTTTTATACTTTCACGACCACACTTTAATAATTATATTCCTGATTAGTTCTCTAGTCCTTTACATTATCTCCCTTATACTCACTACTGAACTTATACATACAAACACCATAGACGCCCAAGAAGTAGAAACAGTATGAACAATCCTACCTGCAGCAATCCTCATTCTTATTGCTCTTCCATCATTACGCATTCTGTATATAATAGACGAAATTGCTACACCCTCCTTAACCCTTAAAACCATAGGTCACCAATGATACTGAAGCTACGAATACACAGATTATGAAGACTTATGTTTTGACTCGTACATAACTCCTTCCTCAGACCTTAAACCTGGAGAACTTCGCCTACTTGAAGTCGACAATCGAGTCGTACTTCCCACAGAACTAGCAGTTCGAATATTAATCTCTTCAGAAGATGTACT [...]
+	Homo_sapiens	ATGGCACATGCAGCGCAAGTAGGTCTACAAGACGCTACTTCCCCTATCATAGAAGAGCTTATCACCTTTCATGATCACGCCCTCATAATCATTTTCCTTATCTGCTTCCTAGTCCTGTATGCCCTTTTCCTAACACTCACAACAAAACTAACTAATACTAACATCTCAGACGCTCAGGAAATAGAAACCGTCTGAACTATCCTGCCCGCCATCATCCTAGTCCTCATCGCCCTCCCATCCCTACGCATCCTTTACATAACAGACGAGGTCAACGATCCCTCCCTTACCATCAAATCAATTGGCCACCAATGGTACTGAACCTACGAGTACACCGACTACGGCGGACTAATCTTCAACTCCTACATACTTCCCCCATTATTCCTAGAACCAGGCGACCTGCGACTCCTTGACGTTGACAATCGAGTAGTACTCCCGATTGAAGCCCCCATTCGTATAATAATTACATCACAAGACGTCT [...]
+	Hippopotamus_amphibius	ATGGCATATCCCCTCCAACTAGGCTTTCAAGATGCAGTATCACCCATTATAGAAGAACTACTGTATTTTCATGACCATACGCTAATAATCGTATTCCTAATCAGCTCACTAGTCCTTTACATTATTACACTAATACTGACTACCAAACTAACCCATACAAACACCATAAATGCACAAGAGGTAGAAACTGTCTGAACAATCCTACCAGCCATTATCCTTATCTTAATTGCACTGCCATCTCTGCGAATCCTCTATATAATAGACGAAATTAACAACCCCTCCCTGACCGTAAAAACTATGGGCCACCAATGATACTGAAGTTACGAATATACAGATTATGAAGACCTAAACTTTGACTCCTACATAGTCCCAACATCAGACCTAAAGCCGGGGGACCTACGACTCCTAGAAGTAGATAACCGAGTCGTCCTACCCATAGATGTAACAGTTCGAATACTAATCTCATCA [...]
+	Hapalemur_griseus	ATGGCTTATCCAGTCCAACTAGGATTTCAAGATGCTGCTTCCCCTATTATAGAAGAACTTTTATACTTTCATGATCATACTTTAATAATTATATTCCTGATTAGTTCTCTAGTCCTTTACATTATTTCCCTCATACTTACTACTGAATTAATACATACAAATACCATAGACGCCCAAGAAGTAGAAACAGTATGAACAATCCTACCCGCAGCAATTCTCATTCTCATTGCCCTCCCATCATTACGTATCCTATATATAATAGACGAAATTACTACACCCTCATTAACCCTTAAAACTATAGGCCACCAGTGATACTGAAGCTACGAATACACAGACTATGAAAATTTATGCTTTGACTCATACATAGTTCCTTCCTCAGACCTAAAGCCTGGAGAACTTCGCCTACTTGAAGTTGATAATCGAATTGTACTTCCTACAGAATTATCAATTCGAATACTAATCTCTTCAGAAGA [...]
+	Gorilla_gorilla	ATGGCACATGCAGCGCAAGTAGGTCTACAAGACGCTACTTCTCCTATCATAGAAGAACTAATCATCTTTCATGATCATGCCCTCATAATCATTTTTCTCATCTGCTTCTTAGTCCTGTACGCCCTTTTCCTAACACTCACAACAAAGCTAACTAACAACAACATCTCAGACGCCCAAGAAATAGAGACCATCTGAACCATCCTGCCCGCTATTATCTTAGTCCTGATCGCCCTCCCATCTCTACGAATCCTCTATATGACAGATGAAATCAATGACCCCTCCTTCACTATCAAATCAATCGGTCACCAATGATACTGAACCTACGAATACACCGACTATGGTGGATTGATCTTTAACTCCTATATACTCCCCCCATTATTCCTAGAACCAGGTGACCTACGACTCCTTGACGTCGACAACCGAGTAGTCCTTCCAGTTGAAGCCCCCGTCCGTATAATAATTACATCCCAAGATG [...]
+	Galago_demidoff	ATGGCCCACGCTGTACAATTCGGATTTCAAGACGCTGCCTCCCCTATTATAGAAGAATTATTATACTTCCATGACCACACCCTTATAATCGTATTTACAATTAGCTCCCTGGTCCTTTATATTATCTCCCTTATGTTATCGACTGAACTTACTCATACAAACACAATAGACGCCCAAGAAGTAGAGACAGTATGAACTATCCTGCCAGCTGTAATCCTCATCCTTATTGCCCTCCCATCCCTCCGAATCCTTTACATAATAGACGAAATCAACACCCCATCCTTAACCCTAAAAACAATAGGCCATCAATGATATTGAAGCTATGAGTACACAGATTATGACAACCTGTGCTTTGACTCCTACATAACCCCTACCCCTGACTTAGAACCAGGAGACCTTCGACTGTTAGAAGTGGACAACCGAGTCGTCCTACCCACAGAAATATCTATCCGAATACTAATCTCCTCTGAAGACG [...]
+	Felis_catus	ATGGCGTACCCCTTTCAACTAGGTTTCCAAGATGCTACATCCCCCATTATAGAAGAACTCCTACACTTTCACGACCACACACTAATAATTGTATTTTTAATCAGCTCTTTAGTTCTTTATATTATCTCGTTGATGCTAACAACCAAGCTCACGCACACGAGTACAATAGATGCTCAAGAAGTAGAAACCATCTGAACCATCCTACCTGCTATTATCCTGATTCTTATCGCCCTACCCTCCTTACGAATTCTCTATATAATGGATGAAATCAACAACCCCTCCCTCACAGTAAAAACCATAGGACATCAATGATATTGAAGTTATGAGTACACTGATTACGAAGACTTGAATTTTGACTCTTACATAATTCCTACCCAAGAGCTAAAACCAGGAGAACTCCGGCTATTAGAAGTTGACAACCGAGTAGTTTTACCAATAGAAATGACCATTCGCATGTTAATCTCATCAGAAGATGTGTT [...]
+	Eulemur_rubriventer	ATGGCTTATCCAGTTCAACTAGGGTTTCAAGATGCTGCTTCCCCCATTATAGAAGAACTCTTATATTTTCACGACCACACTCTGATAATTATATTCCTAATCAGTTCCCTAGTCCTCTATATTATTTCCCTCATGCTTACTACTGAGCTTATCCATACAAGTACTATAGATGCTCAAGAAGTAGAAACAGTATGAACTATTCTGCCCGCAGTAATCCTCATCCTTATCGCCCTTCCATCATTACGCATCCTATATATAATAGATGAAATCACCACACCCTCCTTAACTCTTAAAACTATGGGCCACCAATGATACTGAAGCTATGAGTATACGGACTATGAAAATCTGTGCTTTGATTCATACATGACTCCTCCCTCAGACCTAAAACCGGGGGAACTTCGTCTACTTGAAGTTGATAATCGAGTTGTACTTCCAACAGAATTACCAATCCGAATACTTATTTCCTCAGAA [...]
+	Eulemur_mongoz	ATGGCTTATCCAGTTCAACTAGGGTTCCAAGATGCTGCTTCCCCTATTATAGAAGAACTTTTATACTTCCATGACCACACCTTAATAATTATATTCCTAATTAGTTCTCTAGTCCTCTACATTATTTCCCTTATACTCACTACTGAGCTTATCCATACAAGTACTATAGACGCCCAAGAAGTAGAAACAGTATGAACTATTCTGCCCGCAGTAATTCTTATCCTTATTGCCCTCCCATCATTACGCATCCTATATATAATAGATGAAATCACCACACCCTCCTTAACTCTTAAAACTATGGGCCACCAATGATACTGAAGCTATGAGTACACGGACTATGAGAATCTGTGCTTTGACTCATACATAACTCCTCCTTCAGACCTAAAACCGGGAGAACTTCGTTTACTCGAAGTTGATAATCGAGTTGTGCTTCCAACAGAGCTACCAATCCGAATACTAATTTCCTCAGAAGATGT [...]
+	Eulemur_macaco_macaco	ATGGCTTATCCAGTTCAACTAGGATTTCAAGATGCTGCTTCCCCCATTATAGAAGAACTTTTATATTTTCATGACCACACTCTAATAATTATATTCCTAATTAGTTCTTTAGTCCTCTATATTATTTCCCTCATACTTACTACTGAGCTCATCCATACAAGTACCATAGATGCCCAAGAAGTAGAAACAGTATGAACTATTCTGCCCGCAGTAATTCTTATCCTTATTGCCCTTCCATCACTACGCATCCTATATATAATAGATGAAATTTCCACACCCTCCTTAACTCTTAAAACTATAGGCCACCAGTGATACTGAAGCTATGAATATACGGACTATGAGAATCTGTGCTTTGACTCATATATGACTCCACCCTCAGACCTAAAACCGGGAGAACTTCGCCTACTTGAAGTCGATAATCGAGTTGTGCTTCCAACAGAGTTACCAATCCGAATACTAATTTCCTCAG [...]
+	Eulemur_macaco_flavifrons	ATGGCTTATCCAGTTCAACTAGGATTTCAAGATGCTGCTTCCCCCATTATAGAAGAACTTTTATATTTTCATGACCACACTCTAATAATTATATTCCTAATTAGCTCTTTAGTCCTCTATATTATTTCCCTCATACTTACTACTGAGCTCATCCATACAAGTACCATAGATGCCCAAGAAGTAGAAACAGTATGAACTATTCTGCCCGCAGTAATTCTCATCCTTATTGCCCTCCCATCACTACGCATCCTATATATAATAGATGAAATTTCCACACCCTCCTTAACTCTTAAAACTATGGGCCACCAATGATACTGAAGCTATGAATATACGGATTATGAGAATCTGTGCTTTGACTCATATATGACTCCACCCTCAGACCTAAAACCAGGGGAACTTCGTCTACTCGAAGTCGATAATCGAGTTGTGCTTCCAACAGAATTGCCAATCCGAATACTAATTTCA [...]
+	Eulemur_fulvus_rufus	ATGGCTTATCCAGTTCAACTAGGGTTCCAAGACGCTGCTTCCCCCATTATAGAAGAACTTTTATACTTTCACGACCACACTCTAATAATTATATTCCTAATCAGTTCTCTAGTCCTCTATATTATTTCCCTTATACTTACTACTGAGCTCATTCATACAAGCACCATAGATGCCCAAGAAGTAGAAACAGTATGAACTATTCTGCCCGCAGTGATTCTCATCCTCATTGCCCTTCCATCATTACGCATCCTATACATAATAGATGAGATTACCACACCTTCCTTAACTCTTAAAACTATGGGCCACCAATGATACTGAAGCTATGAATATACGGATTATGAAAATCTGTGCTTTGACTCATACATAACTCCTCCCTCAGACCTAAAACCGGGAGAACTTCGTCTACTTGAAGTTGATAATCGAGTTGTACTTCCAACAGAATTACCAATCCGAATACTAATCTCCTCAGA [...]
+	Eulemur_fulvus_collaris	ATGGCTTATCCAGTTCAACTAGGGTTCCAAGATGCTGCTTCCCCTATTATAGAAGAACTTTTATACTTTCACGACCACACTCTAATAATTATGTTCCTAATCAGCTCTCTAGTCCTCTATATTATTTCCCTTATACTTACTACTGAACTCATTCATACAAGTACTATAGATGCCCAAGAAGTAGAAACAGTATGAACTATTCTGCCCGCAGTGATCCTAATCCTTATTGCCCTTCCATCATTACGCATCCTATACATAATAGATGAAATCACCACACCTTCCTTAACTCTTAAAACTATGGGCCACCAATGATACTGAAGCTATGAATATACGGATTATGAAAATCTGTGCTTTGACTCATACATGACTCCTCCCTCAGACCTAAAACCGGGAGAACTTCGTCTACTTGAAGTTGATAACCGAGTTGTGCTTCCAACAGAATTACCAATCCGAATACTAATTTCCTC [...]
+	Eulemur_fulvus_albifrons	ATGGCTTATCCAGTTCAACTAGGGTTCCAAGATGCTGCTTCCCCCATCATAGAAGAACTTCTATACTTTCACGACCACACTCTAATAATTATATTCCTAATCAGTTCTCTAGTCCTCTATATTATTTCCCTTATACTTACTACTGAGCTCATTCATACAAGTACCATAGATGCCCAAGAAGTAGAAACAGTATGAACTATTCTGCCCGCAGTGATTCTCATCCTTATTGCCCTTCCATCATTACGCATCCTATACATAATAGATGAGATCACCACACCTTCCTTAACTCTTAAAACTATGGGCCACCAATGATACTGAAGCTATGAGTATACGGATTATGAAAATCTGTGCTTTGACTCATACATAACTCCTCCCTCAGACCTAAAACCGGGAGAACTTCGTCTACTTGAAGTTGATAACCGAGTTGTACTTCCAACAGAATTACCAATCCGAATACTAATTTCCT [...]
+	Equus_caballus	ATGGCCTACCCCTTCCAACTAGGATTCCAAGACGCAACATCCCCTATTATAGAAGAACTCCTACACTTCCACGACCACACACTAATAATCGTATTCCTAATTAGCTCTCTAGTATTATATATTATCTCATCAATACTAACAACTAAATTAACCCATACCAGCACCATAGATGCTCAAGAAGTAGAGACAATTTGAACGATTTTACCAGCCATCATCCTTATTCTAATCGCCCTCCCATCCCTACGAATTCTATATATAATAGATGAAATCAATAATCCGTCCCTCACAGTCAAAACAATAGGCCACCAATGATACTGAAGCTACGAGTATACCGATTACGAAGACTTGACCTTTGACTCCTACATGATCCCCACATCAGACCTAAAACCAGGAGAATTACGTCTTCTAGAAGTCGACAATCGAGTGGTTCTCCCCATAGAAATAACCATCCGAATGCTAATTTCATCCGAAGACGT [...]
+	Didelphis_virginiana	ATGCCCTATCCAATACAACTAGGTTTCCAAGACGCTACATCTCCTATTATAGAAGAACTTATATACTTTCATGATCATACATTAATAATTGTATTTCTGATCAGTTCACTAGTATTATATATTATTATTCTTATACTTACTACAAAACTTACTCACACAAGCACTATAGATGCCCAAGAAGTGGAAACAATTTGAACAATTTTACCAGCCGTAATTCTTATCCTTATTGCCCTTCCTTCCTTACGAATTCTTTACATAATAGATGAAATCTATAATCCTTATCTAACAGTTAAAGCAATGGGTCATCAATGATATTGAAGCTATGAGTTCACAGACTATGAAAATTTAATATTCGACTCATACATAATCCCAACCAAAGACCTTAGTCCTGGGCAACTTCGTTTACTAGAAGTTGATAACCGAATTGTTCTCCCAATAGAACTACCAATTCGCATGCTAATTTCATCAGA [...]
+	Daubentonia	atggcttaccccgcccaaataggattccaagacgccacctcccctatcatagaagaacttctatatttccatgaccataccttaataattgtctttataattagctcattagtcctctatactatctcccttatactcacaaccagccttacccatacaaacaccataaacgcccaagaagtggaaacagtgtgaacaatcctccctgcaattatctgcatccttattgccctaccatccttacgtattctctacataatagatgaaattaacaacccttccctaaccattaaaactatgggccaccaatgatactgaacctatgagtatacagattatgaaaacataacctttgattcatacataacctcaaccaacgatctcacccccggagaacttcgacttctggaagtcgataatcgaatagtcctacctacggaattacctattcgagtgttagtctcctcagaagatgtact [...]
+	Cheirogaleus_major	ATGGCATGTCCAGTTCAACTAGGATTTCAAGACGCTGCCTCTCCTATTATAGAGGAACTTATATATTTCCATGACCATACTTTAATAATCGTCTTCCTAATTAGCTCCCTAGTCCTCTATATCATTTCCCTAATACTCACCACAGAACTTACCCACACAAACACAATAGATGCCCAAGAAGTAGAAACAGTATGAACCATCCTACCTGCAGTTATCTTAATCCTTATTGCTCTTCCATCACTACGAATTCTATATATAATAGATGAAATTACCACCCCATCTCTAACCCTAAAAACTATAGGCCATCAATGGTACTGAAGTTATGAATATACAGACTACGAAAACTTATGTTTTGATTCATATATAACGCCATCATCAGATCTCAAGCCAGGAGAACTTCGCCTACTAGAAGTTGATAACCGAGTTGTCCTACCCACAGAAATATCCATTCGTATACTCATCTCCTCAGAAG [...]
+	Canis_familiaris	ATGGCGTACCCATTTCAACTCGGATTACAGGACGCAACCTCCCCTATTATAGAGGAGCTACTTCATTTTCATGACCATACACTAATAATTGTATTCTTAATCAGTTCTTTAGTTCTCTATATCATTTCACTAATATTGACTACAAAATTAACCCATACAAGCACAATAGACGCACAAGAAGTGGAAACAGTATGAACCATTCTACCCGCCATTATCCTAATCCTAATCGCTCTACCTTCCCTCCGAATCCTTTATATAATGGACGAAATTAATAACCCCTCTTTAACCGTGAAAACAATAGGCCACCAATGATACTGAAGCTATGAATATACTGACTATGAAGACTTAAACTTTGACTCCTACATAATCCCAACACAAGAATTAAAGCCAGGAGAACTCCGACTATTAGAAGTAGACAACCGAGTTGTCCTCCCAATAGAAATAACCATCCGAATACTTATCTCTTCAGAAGAC [...]
+	Callithrix_jacchus	ATGGCAGCACCAGCCCAATTAGGCCTACAAAACGCCGCATCCCCAATCATAGAAGAACTTATTGCCTTCCATGACCATGCTCTAATAATTATCTTCTTAATTAGCTCACTAGTTCTATACATCATCTCTCTAATACTTACTACAAAACTGACACACACCAGTACCATGAACGCTCAAGAAATCGAAATGATCTGAACTATCCTACCTGCAATAATCCTCATTATAATTGCCCTTCCATCCCTACGCATTTTATATATAACAGACGAGTTTAATAAACCATATCTAACCCTTAAAGCAATCGGCCACCAATGATACTGAAGTTACGAATACTCCGACTATGAAGACTTAGCATTCGACTCCTACATTATACCAACATACTTCCTTGAACCCGGGGAATTCCGACTCCTTGAAGTAGACAACCGAACAACCTTGCCTATGGAAGCAGATATCCGTGTATTAATCTCATCACAAG [...]
+	Bos_taurus	ATGGCATATCCCATACAACTAGGATTCCAAGATGCAACATCACCAATCATAGAAGAACTACTTCACTTTCATGACCACACGCTAATAATTGTCTTCTTAATTAGCTCATTAGTACTTTACATTATTTCACTAATACTAACGACAAAGCTGACCCATACAAGCACGATAGATGCACAAGAAGTAGAGACAATCTGAACCATTCTGCCCGCCATCATCTTAATTCTAATTGCTCTTCCTTCTTTACGAATTCTATACATAATAGATGAAATCAATAACCCATCTCTTACAGTAAAAACCATAGGACATCAGTGATACTGAAGCTATGAGTATACAGATTATGAGGACTTAAGCTTCGACTCCTACATAATTCCAACATCAGAATTAAAGCCAGGGGAGCTACGACTATTAGAAGTCGATAATCGAGTTGTACTACCAATAGAAATAACAATCCGAATGTTAGTCTCCTCTGAAGACGTATTA [...]
+	Balaenoptera_physalus	ATGGCATATCCATTCCAACTAGGTTTCCAAGATGCAGCATCACCCATCATAGAAGAGCTCCTACACTTTCACGATCATACACTAATAATCGTTTTTCTAATTAGCTCTTTAGTTCTCTACATTATTACCCTAATGCTTACAACCAAATTAACACATACTAGTACAATAGACGCCCAAGAAGTAGAAACTGTCTGAACTATCCTCCCAGCCATTATCTTAATTTTAATTGCCTTGCCTTCATTACGGATCCTTTACATAATAGACGAAGTCAATAACCCCTCCCTCACTGTAAAAACAATAGGTCACCAATGATATTGAAGCTATGAGTATACCGACTACGAAGACCTAAGCTTCGACTCCTATATAATCCCAACATCAGACCTAAAGCCAGGAGAACTACGATTATTAGAAGTAGATAACCGAGTTGTCTTACCTATAGAAATAACAATCCGAATATTAGTCTCATCAG [...]
+
+;
+end;
+begin mrbayes;
+    [ HKY model, 4 gamma categories, 1 invariant site ]
+    lset nst=2;
+    lset rates=invgamma;
+    lset ngammacat=4;
+    [ strict clock model ]
+    prset brlenspr=clock:uniform;
+    mcmcp ngen=1000000 nchains=1 printfreq=10000;
+end;
diff --git a/examples/benchmark/mrbayes/testHKY336.nex b/examples/benchmark/mrbayes/testHKY336.nex
new file mode 100644
index 0000000..7a2524d
--- /dev/null
+++ b/examples/benchmark/mrbayes/testHKY336.nex
@@ -0,0 +1,44 @@
+#NEXUS
+begin data;
+	dimensions ntax=27 nchar=1949;
+	format datatype=dna missing=? gap=-;
+	matrix
+	Oryctolagus_cuniculus	UACCUGGUUGAUCCUGCCAGUAGCAUAUGCUUGUCUCAAAGAUUAAGCCAUGCAUGUCUAAGUACGCACGGCCGGUACAGUGAAACUGCGAAUGGCUCAUUAAAUCAGUUAUGGUUCCUUUGGUCGCUCGCUCCUCUCCUACUUGGAUAACUGUGGUAAUUCUAGAGCUAAUACAUGCCGACGG?CGCUGACUCCC?UUUGUG????UGGGAUGCGUGCAUUUAUCAGAUCAAAACCAACCCGGUCAGCCUCCCCGCCGGCCGGGGGGGUGGGGCGGCG?????????????????????????????????????????????????????????????????????GCUUUGGUGACUCUAGAUAACCUCGGGCCGAUCGCA?GCCCUCCGUGGCGGCGACGACCCAUUCGAACGUCUGCCCUAUCAACUUUCGAUGGUAGUCGCCGUGCCUACCAUGGUGACCACG [...]
+	Homo_sapiens	UACCUGGUUGAUCCUGCCAGUAGCAUAUGCUUGUCUCAAAGAUUAAGCCAUGCAUGUCUAAGUACGCACGGCCGGUACAGUGAAACUGCGAAUGGCUCAUUAAAUCAGUUAUGGUUCCUUUGGUCGCUCGCUCCUCUCCUACUUGGAUAACUGUGGUAAUUCUAGAGCUAAUACAUGCCGACGGGCGCUGACCCCC?UUCGCGGG??GGGGAUGCGUGCAUUUAUCAGAUCAAAACCAACCCGGUCAGCCCCUCUCCGGCCCCGGCCGGGGGGCGGGCCGCGGCG???????????????????????????????????????????????????????????????GCUUUGGUGACUCUAGAUAACCUCGGGCCGAUCGCACGCCCCCCGUGGCGGCGACGACCCAUUCGAACGUCUGCCCUAUCAACUUUCGAUGGUAGUCGCCGUGCCUACCAUGGUGACCACGGGUGACGGG [...]
+	Rattus_norvegicus	UACCUGGUUGAUCCUGCCAGUAGCAUAUGCUUGUCUCAAAGAUUAAGCCAUGCAUGUCUAAGUACGCACGGCCGGUACAGUGAAACUGCGAAUGGCUCAUUAAAUCAGUUAUGGUUCCUUUGGUCGCUCGCUCCUCUCCUACUUGGAUAACUGUGGUAAUUCUAGAGCUAAUACAUGCCGACGGGCGCUGACCCCCCUUCCCGUGGGGGGAACGCGUGCAUUUAUCAGAUCAAAACCAACCCGGUCAGCCCCCUCCCGGCUCCGGCCGGGGGUCGGGCGCCCGGCG??????????????????????????????????????????????????????????????GCUUUGGUGACUCUAGAUAACCUCGGGCCGAUCGCACGU?CCCCGUGGCGGCGACGACCCAUUCGAACGUCUGCCCUAUCAACUUUCGAUGGUAGUCGCCGUGCCUACCAUGGUGACCACGGGUG [...]
+	Mus_musculus	UACCUGGUUGAUCCUGCCAGUAGCAUAUGCUUGUCUCAAAGAUUAAGCCAUGCAUGUCUAAGUACGCACGGCCGGUACAGUGAAACUGCGAAUGGCUCAUUAAAUCAGUUAUGGUUCCUUUGGUCGCUCGCUCCUCUCCUACUUGGAUAACUGUGGUAAUUCUAGAGCUAAUACAUGCCGACGGGCGCUGACCCCCCUUCCCGGGG?GGGGAUGCGUGCAUUUAUCAGAUCAAAACCAACCCGGUGAGCUCCCUCCCGGCUCCGGCCGGGGGUCGGGCGCCGGCG???????????????????????????????????????????????????????????????GCUU?GGUGACUCUAGAUAACCUCGGGCCGAUCGCACGCCCCCCGUGGCGGCGACGACCCAUUCGAACGUCUGCCCUAUCAACUUUCGAUGGUAGUCGCCGUGCCUACCAUGGUGACCACGGGUGACGGG [...]
+	Gallus_gallus	??CC?GGUUGAUCCUGCCAGUAGCA???GCU?GUCUCAAAGAUUAAGCCAUGCAUGUCUAAGUACACACGGGCGGUACAGUGAAACUGCGAAUGGC?????AAAUCAGUUAUGG?????????UCGCUCCCCUCCC????ACUUGGAUAACUGU?G????UCU?GAGCUAAU?CAUGCCGACGAGCGCCGACCUCC???????????GGG?ACG?G??CAUUUAUCAGACCAAAACCAACGG?C?CGCCC??????????????????????????????????????????????????????????????????????????????????????????????????G???UGG??ACUCUAGAUAACCUCGAGCCGAUCGCA?GC?CCC??UGGCGGCGACGACCCAUU??AAUGUC??CCCUAUCAACUU?CGAUGGUACUGUCUGUGCCUACCAUGGUG???ACGGGUAACGG [...]
+	Turdus_migratorius	??CCUGGUUGAUCCUGCCAGUAGCAU??GCUUGUCUCAAAGAUUAAGCCAUGCAUGUCUAAGUACACACGGGCGGUACAGUGAAACUGCGAAUGGC????UAAAUCAGUUAUGGU??CUU??GUCGCUCCUCUCCCGC?UCCUUGGAUAACUGUGGU???UCUAGAGCUAAU?CAUGCCGACGAGCGCCGACCUCC???????????GGGGACGCGUGCAUUUAUCAGACCAAAACCAACGG????GCCC???A??????????????????????????????????????????????????????????????????????????????????????????????GCU?UGGUGACUCUAGAUAACCUCGAGCCGAUCGCA?GC?CCCCGCGGCGGCGACGACCCAUUCGAAUG????CCCUAUCAACUU?CGAUGGUACUGUCUGUGCCUACCAUGGUGACCACGGGU [...]
+	Alligator_mississippiensis	??CCUGGUUGAUCCUGCCAGUAGCAUA?GCUUGUCUCAAAGAUUAAGCCAUGCAUGUCUAAGUACACACGGCCGGUACAGUGAAACUGCGAAUGGCUCAUUAAAUCAGUUAUGGUUCCUU??GUCGCUCCAACCGU???UACUUGGAUAACUGUGGU??UUCUA?AGCUAAUACAUGCCGACGAGCGCUGACCU?C???????????GGGGAU?CGUG?AUUUAUCAGACCAAAACCAACGGGCUCGCCCGGCC??????????????????????????????????????????????????????????????????????????????????????????????GCU?UGGUGACUCUAGAUAACC?CGGGCCGAUCGCA?GC?CC?CGUGGCGGCGACGACGCAUUCGAAUGUCU?CCCUAUCAACUUUC?AUGGUACUUUCUGUGCCUACCAUGGUGA [...]
+	Sceloporus_undulatus	????????????????????????????GC??GUCUCAAAGAUUAAGCCAUGCAUGUCUAAGUACACACGGGCGUUA?AGUGAAACUGCGAAUGGCU???UAAAUCAGUUAUGGU??CU???GUCGCUCCCCC??U???UCCUUGGAUAACUGUGGU???UCUAGAGCUAAUACAUGCCAACGAGCGCUGACCUCC???????????GGGGAUGCGUGCAUUUAUCAGACCAAAACCAACGGGCUCGCCC??CC??????????????????????????????????????????????????????????????????????????????????????????????GCU?UGGU?ACUCUAGAUAACCUCGGGCCGAUCGCA?GCC?C?CGUGGCGGCGACGACGCAUUCGAAUGUCU?CCCUAUCAACUUUCGAUGGUACUUUCUGCGCCUACCAUGGUGACC?CGG [...]
+	Heterodon_platyrhinos	??CCU?GUUGAUCCUGCCAG?AGCA???GCU?GUCUCAAAGAUUAAGCCAUGCAUGUCUAAGUACACACGGGCGUGACAGUGAAACUGCGAAUGGC????UAAAUCAGUUAUGG???CU???GUCGCUCCCACCGU???UACUCGGAUAACUGUGG????UCUAGAGCUAAUACAUGCCGACGAGCGCUGACCUCC???????????GGGGAUGCGUGCAUUUAUCAGACCAAAACCAACGGGCU??CCCGGCC??????????????????????????????????????????????????????????????????????????????????????????????GCU?UGGUGACUCUAGAUAACCUCGGGCCGAUCGCA?GCCCCCCGUGGCGGCGACGACGCAUUCGAACGUCUGCCCUAUCAACUUUCGAUGGUACUUUCUGUGCCUACCAUGGUGACCACG [...]
+	Trachemys_scripta	??CCUGGUUGAUCCUGCCAGUAGCAUA?GCUUGUCUCAAAGAUUAAGCCAUGCAUGUCUAAGUACACACGGCCGGUACAGUGAAACUGCGAAUGGC???UUAAAUCAGUUAUGGU??CUU??GUCGCUCC?ACCCU???UACUUGGAUAACUGUGGU???UCU?GAGCU?AU?CAUGCCGACGAGCGCUGACCUCC???????????GGG?AUGCGUGCAUUUAUCAGACCAAAACCAACGGGCUCGCCCGGCC??????????????????????????????????????????????????????????????????????????????????????????????GCU?UGGUGACUCUAGAUAACCUCGGGC?GAUCGCA?GCCCCCCGUGGCGGCGACGAUGCAUUCGAAUGUCU?CCCUAUCAACUUUCGAUGGUACUUCCUGUGCCUACCAUGGUGACCACGGGUA [...]
+	Typhlonectes_natans	????UGGUUGAUCCUGCCAGUAGCA???GCUUGUCUCAAAGAUUAAGCCAUGCACGUGUAAGUACACACGGCCGGUACAGUGAAACUGCGAAUGGCU???UAAAUCAGUUAUGGU??CUU??AUCGCUCCAUCC??????ACUUGGAUAACUGUGGU???UCU?GAGCU?AU?CAUGCCGACGAGCGCUGACCUCC???????????CGG??UGCGUGCAUUUAUCAGACCA?AACCAAUGG?CUCGCCC??CC??????????????????????????????????????????????????????????????????????????????????????????????GC???GGU?ACUCUAGAUAACCUCGGGC?GAUCGCA?GUCCCCCGUGACGGCGACGAUGCAUUCGGAUGUCU?CCCUAUCAACUUUCGAUGGUACUUUCCG?GCCUACCAUGGUGACCACGGG [...]
+	Hypogeophis_rostratus	??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????AUCGCUC?AUCUCGU??UACUUGGAUAACUGUGGU?AUUCU?GAGCU?AUACAUGCCGACGAGCGCU?ACCUCC???????????CGGGAUG?GUGCAUUUAUCAGACC??AACCAAUGGGCUCGCC???C???????????????????????????????????????????????????????????????????????????????????????????????GCU??GGU?ACUCUAGAUAACCUCGGGCCGAUCGCACGUC?CCCGUGACGGCGACGAUACA???????????????????????????????????????????????????????????? [...]
+	Grandisonia_alternans	??CCU?GUU?AUCCU?CCAG?AGCA???GCU?GUCUCAAAGAUUAAGCCAUGCACGUGUAAGUACACACGGCCGGUACAGUGAAACUGCGA???????????????????????????????AUCGCUCCAUC?CGU??UACUUGGAUAACUGUGGU?AUUCU??A?CU?AUACAUGCCGACGAGCGCU?ACCUCC???????????CGGGAUG?GUGCAUUUAUCAGACC??AACCAAUGGGCUCGCC???CC??????????????????????????????????????????????????????????????????????????????????????????????GC???GGU?ACUCU?GAUAACCUCGGGC??AU?GCACGUC?C??GUGACGGCGACGAUACAUUCGGAUGUC?GCCCUAUC?ACUUUCG?UGGU?CUUUCUGCGCCUACCAUGGUGAC?ACG [...]
+	Ichthyophis_bannanicus	???????????????????????????????????UCAA?GA???AGCCAUGCACGUGUAAGUACACACGGCCGGUACAGUGAAACUGCGAAUGGC????UAAAUCAGUUAU?G????????AUCGCUC?AUCCGU????ACUUGGAUAACUGUGGU???UCU?GAGCU?AU?C?UGCCGACGAGCGCU?ACCCCC???????????CGG?AUGCGUGC?UUUAUC?GACCAAAACCAAUGGGCU?GCC???C???????????????????????????????????????????????????????????????????????????????????????????????GC???GGUGACUCUAGAUAACCUCGGGC?GAUCGCACGUC?CGCGUGACGGCGACGAUACAUUCGGAUGUCUGCCCUAUC?ACUUUCGAUGGUACUUUCU??GCCUACCAUGGUGAC?AC [...]
+	Plethodon_yonhalossee	?????GGUU?AUCCUGCCAG?AGCA???GCUUGUCUCAAAGAUUAAGCCAUGCACGUGUAAGUACGCACGGCCGGUACAGUGAAACUGCGAAUGGCU??UUAAAUCAGUUA??????CUU??AUCGCUCCAU???U???UACUUGGAUAACUGUGGU?AUUC??GAGCU?AUACAUGCCGA?GAGCGCU?ACCUUCAC?????????CGGGAUG?GUGCAUUUAUCAGACC??AACCAAUCGGG?GCCC?CCU?G??????????????????????????????????????????????????????????????????????????????????????????????CUUUGGU?ACUCUAGAUAACCU?GGG?U?AUCGCA?GUC?CCCGUGACGGCG???????????????????????????????????????????????????????????????????? [...]
+	Ambystoma_mexicanum	????UGGUUGAUCCUGCCAGUAGCA???GCUUGUCUC?AAGAUUAAGCCAUGC?CGUGUAAGUACACACGGCCGGUAC?GUGAAACUGCGAAUGGCU??UUAAAUC?CUUAUGGU??CUUU?AUCGCUCCAUCUGU???UACUUGGAUAACUGUGGU?AUUCUAGAGCUAAUACAUGCCGACGAGCGCUGACCUCC???????????CGGGAUGCGUGCAUUUAUCAGACCAAGACCAAUGGGCUCGCCCGGCC??????????????????????????????????????????????????????????????????????????????????????????????GC???GGUGACUCUAGAUAACCUCGGGCCGAUCGCA?GUCCCCCGUGACGGCGACGAUGCAUUCGGAUGUCUGCCCUAUCAACUUUCGAUGGUACUUUCUGUGCCUACCAUGGUGACCACGGG [...]
+	Amphiuma_tridactylum	??CCU?GUUGAUCCUGCCAG?AGCA???GCUUGUCUCAAAGAUUAAGCCAUGCACGUGUAAGUACACACGGCCGGUACAGUGAAACUGCGAA????????UAAAUCAGUUAU??????????AUCGCUCCAUCU?U???UACUUGGAUAACUGU?GUUAUUCUU?AGCUAAUACAUGCCGACGAGCGCUGACCUCC???????????CGGGAUG?GUGCAUUUAUC?GACCAAAACCAAUGGGCUCGCC???CC??????????????????????????????????????????????????????????????????????????????????????????????GC???GGU?ACUCUAGAUAACCUCGGGC?GAUCGCA?G?C?CCCGUGACGGCGACGA????????????????????????????????????????????????????????????????? [...]
+	Siren_intermedia	??CCUGGUUGAUCCUGCCAGUAGCA???GCUUGUCUCAAAGAUUAAGCCAUGCACGUGUAAGUACACACGGCCGGUACAGUGAAACUGCGAAUGGCU?A?UAAAUCAGUUAUGGU??CUU??AUCGCU???CC?GU???UACUUGGAUAACUGUGGU?AUUCU?GAGCUAAUACAUGCCGACGAGCGCUGACCUC????????????CGGGAUGCGUGCAUUUAUCAGACCAAGACCAAUGGGC?CGCC????CC?????????????????????????????????????????????????????????????????????????????????????????????GCU??GGU?ACUCUAGAUAACCUCGGGCC?AUCGCACGUCCCCCGUGACGGCGACGAUGCAUUCGGAUGUCUGCCCUAUCAACUUUCGAUGGUACUUUCUGUGCCUACCAUGGUGACCACGGGUAA [...]
+	Gastrophryne_carolinensis	???CUGGUUGAUCCUGCCAGUAGC????GCUUGUCUCAAAGAUUAAGCCAUGC?CGUGUAAGUACACACGGAC?GUACAGUGAAACUGCGAAUGGC???UUAAAUCAGUUAUGG???CUU??AUCGCUCCCAU???U??UACUUGGAUAACUGUGGUAAUUCU?GAGCU?AUACAUGCCGA?GAGCGCUGACCCCC???????????AGG?AUGCGUGCAUUUAUCAGACCAAAACCAAUCGGGGGC?C??G?GUC???G?CCC????CCC??G????????????????????????????????????????????????????????????????????????????UUUGGCGACUCUAGAUAACCUCGGGC?GAUCGCA?GUC?CCCGUGACGGCGACGAUACUUUCGGAUGUCUGCCCUAUC?ACUUUC?AU?GUUCUUUCU?CGC?UACCAU?GUGAC [...]
+	Hyla_cinerea	??CCUGGUUGAUCCUGCCAGUAGCA?A??C?UGUCUCAAAGAUUAAGCCAUGCACGUGUAAGUACACACGGCCGGUACAGUGAAACUGCGAAUGGCU??U?AAAUCAGUUAU?????CU???AUCGCUCCAACC??????CCUUGGAUAACUGU?GU?AUUCU??AGCU?AUACAUGCCGACGAGCGCUGACCACC???????????AGGGACGCGUGCAUUUAUCAGACCAAAACCAAUCGGGGGCCCGGG?GCGGCGG?GGCGGAGGGG?GGCUCU?AAAAGCC??????C?C???C??GCUCUCCC??G?C??????????????????????????????????GCCUUGGCGACUCUAGAUAACCUCGGGCCGAUCGCACGUC?CCCGUGACGGCGACGACGCAUUCGGAUGUCUGCCCUAUCAACUUUCGAUGGUACUUUCUGCGCCUACCAUGGUGACCACGGGUAACGGG [...]
+	Bufo_valliceps	?????????????????????????????????????????????AGCCAUGCACGUGUAAGUACGCACGGCCGGUACAGUGAAACUGCGAAUGGC??????????????????????????AUCGCUCCAACCGU???UACUUGGAUAACUGUGGUAAUUCUAGAGCUAAUACAUGCCGACGAGCGCUGACCCCC???????????AGGGAUGCGUGCAUUUAUCAGACCAAAACCAAUCGGGG???GGGCGC?CGGG?C??GG??U?GGGGGUGGUCU?GGCCUCCC??C?CAGCC?C??C?GCUCUCCC??G?C???????????????????????????????GCUUUGGUGACUCUAGAUAACCUCGGGCCGAUCGCACGUC?CCCGUGACGGCGACGAUCCAUUCGGAUGUCUGCCCUAUCAACUUUCGAUGGUACUUUCUGCGCCUACCAUGGUGACCACGGGUAACG [...]
+	Eleutherodactylus_cuneatus	??CCUGGUUGAUCCUGCCAGUAGCA???GCUUGUCUCAAAGAUUAAGCCAUGCACGUGUAAGUACACACGGCCGGUACAGUGAAACUGCGAAUGGC????UAAAUCAGUUAUGG???CUU??AUCGCUCCAACCG?????AC?????????????????????????????????????????????????????????????????AGGGAUG?GUGCAUUUAU?AGACCAAAACC??U?GGGU?U?GC?????GGGGC??AAGGG?????G?U?CUCCCCGGGA???G?GCCCGG???G??GG?CCG?????CC????G???????????????????????????GCCUUGGCGACUCUAGAUAACCUCGGGC??AUCGCACGUC?CCCGUGACGGCGACGAUCCAUUCGGACGUCUGCCCUAUCAACUUUCGAUGGUACUUUCUGCGCCUACCAUGGUGA [...]
+	Nesomantis_thomasseti	??CCU?GUU?AUCCUGCCAGUAGCU???GCUUGUCUC?AAGAUUAAGCCAUGCACGUGUGAGU?CGCACGGCCGGUAC?GUGAAACUGCGAAUGGC???UUAAAUCAGUUAU?G???CUU??AUCGCUCCAUCC??????AC?????????????????????????????????????????????????????????????????AGGGAUGCGUGCAUUUAU?AGACCAAAACCAAU?GGG?????????????????GGGUUUG??GG?G??GGGGGGGGGGGGUCGCGU?AG?C???????CC???G?CC??UCCUCCCG?GCCC?C?GUCCC?UCCC????CGCCU?GGU?ACUCUAGAUAACCUCGGG???AUCGCACGUC?CCCGUGACGGCGACGAUACAUUCGGAUGUCUGCCCUAUCAACUUUCGAUGGU?CUUUCUGCGCCUACCAUGGUGACCACG [...]
+	Scaphiopus_holbrooki	??????GUU?AU??UGC?AG??G?????GCUUGUCUC?????UU?AGCCAUGCACGUGUAAGUACACACGGCCGGUACAGUGAAACUGCGAAUGGC???UUAAAUCAGUUAU?G???CUU??AUCGCUC?AUC??U????ACUUGGAUAA?????????????????????????????????????????????????????????AGG?AUGCGUGCAUUUAUCAGACCAAAACCAAUCGGGUGGC?C?CCCCUCCC??CC?????????????????????????????????????????????????????????????????????????????????????GCU??GGU?ACUCUAGAUAACCUCGGGCCGAUCGCA??UC?CCCGUGACGGCGACGAUA??UUUGGAUGUCUGCCCUAU??ACUUUCGAU?GU?CUUUCUGUGCCUACCUUGGUGACCACGG [...]
+	Xenopus_laevis	UACCUGGUUGAUCCUGCCAGUAGCAUAUGCUUGUCUCAAAGAUUAAGCCAUGCACGUGUAAGUACGCACGGCCGGUACAGUGAAACUGCGAAUGGCUCAUUAAAUCAGUUAUGGUUCCUUUGAUCGCUCCAUCUGU???UACUUGGAUAACUGUGGUAAUUCUAGAGCUAAUACAUGCCGACGAGCGCUGACCCCC???????????AGGGAUGCGUGCAUUUAUCAGACCAAAACCAAUCCGGGGCCCCCGCGCCCCGGCC??????????????????????????????????????????????????????????????????????????????????????GCUUUGGUGACUCUAGAUAACCUCGGGCCGAUCGCACGUC?CCCGUGACGGCGACGAUACAUUCGGAUGUCUGCCCUAUCAACUUUCGAUGGUACUUUCUGCGCCUACCAUGGUGACCACGGGUAACG [...]
+	Discoglossus_pictus	????UGGUUGAUCCUGCCAGUAGCAUA??C?UGUCUCAAAGAUUAAG?CAUGCACGUGUAAGUACACACGGCCGGUACAGUGAAACUGCGAAUGGCU????AAAUCAGUUAUGGU??CU???AUCGCUCCAUCUGU???UACUUGGAUAACUGUGGU?AUUCU?GAGCUAAUACAUGCCGACGAGCGCUGACCC??????????????GG?AUGCGUGCAUUUAUCAGACCAAAACCAAUGGGCACUCGUGCC??G?C??????????????????????????????????????????????????????????????????????????????????????????GCUUUGGU?ACUCUAGAUAACCUCGGGC?GAUCGCACGUC?CCCGUGACGGCGACGAUACAUU???????????????????????????????????????????????????????????? [...]
+	Latimeria_chalumnae	UACCUGGUUGAUCCUGCCAGUAGCAUAUGCUUGUCUCAAAGAUUAAGCCAUGCAUGUCUAAGUACAAACGGUGCGUACAGUGAAACUGCGAAUGGCUCAUUAAAUCAGUUAUGGUUCCUUUGAUCGCUCCAAC?GU???UACUCGGAUAACUGUGGUAAUUCUAGAGCUAAUACAUGCCGACGAGCGCUGACCUUC???????????GGGGAUGCGUGCAUUUAUCAGACCAAAACCAAUCCGGGUCCGCCCGGCC????????????????????????????????????????????????????????????????????????????????????????????GCUUUGGUGACUCUAGAUAACCUCGGGCCGAUCGCACGUC?CUCGUGGCGGCGACGAUUCCUUCGAAUGUCUGCCCUAUCAACUUUCGAUGGUACUUUCUGUGCCUACCAUGGUGACCACGGG [...]
+
+;
+end;
+begin mrbayes;
+    [ HKY model, 4 gamma categories, 1 invariant site ]
+    lset nst=2;
+    lset rates=invgamma;
+    lset ngammacat=4;
+    [ strict clock model ]
+    prset brlenspr=clock:uniform;
+    mcmcp ngen=1000000 nchains=1 printfreq=10000;
+end;
diff --git a/examples/benchmark/mrbayes/testHKY3475.nex b/examples/benchmark/mrbayes/testHKY3475.nex
new file mode 100644
index 0000000..7cc050d
--- /dev/null
+++ b/examples/benchmark/mrbayes/testHKY3475.nex
@@ -0,0 +1,67 @@
+#NEXUS
+begin data;
+	dimensions ntax=50 nchar=378;
+	format datatype=dna missing=? gap=-;
+	matrix
+	Vila_semistalachtis	ctGCATAGtTAAGAcCtGCtGGATGAGGCTGCCCAgTTTCCGCTCCGTGGGTGACGCGCTAAAAGAtCGcTTCgacgGGGCaTCCCGAGTCAtGAtGCCCAATACGGAAGTAGAAgCACCCGTGCAGCGGAACGACGCAGCGCCT---CACAGGGTTCCAAGAAAAGATCGGTACAGATTCCAGCTCCGGCCGCACAATCCCGACCACAAGACGCCCGGCGTCAAgGACcTAGTGTACCTAGAATCATCGCCAGGCTTCTGTGAAAAGAACCCAAGGCTGGGCATTCCCGGTACACACGGGCgTgCCTGCaACgACACGAgTATCgGCGTCCACgGCTGTgACCTTATGTgTTGCGGGCGCGGCTATCGGACCgaaac
+	Vanessa_atalanta	ctgtactgttaagacttgttggatgaggctgcccagttttcgctccgtgggtGACgCGTTAAAAGATCgCTTCGATGGAGCATCgCGGGTCATGATgCCTAATACAGAAATCGAAGCGCCCGTACAgCGAAATGACGCAGCgCCT---CATAGAGTTCCAAGAAGAGATCGGTACAGATTCCAGCTTCGgCCGCACAATCCGGATCAtAAAACACCGGGAGCaAAAGACCTAGTCTACCTTGAATCATCACCGGGTTTTTGTGAAAAGAACCCGAGGCTGGGCATTCCCGGCACGcacgggcgtgcctgcaacgatacgagcatcggcgtcgacggctgcgacctcatgtgttgcggtcgtggttaccggaccgaaac
+	Tisiphone_abeona	ctgcacagtgaagacgtgctGGATGAGGCTGCCGAGTTTTCGCTCTGTAGGCGATGCTTTAAAAGATGGCTTCGACGGAGCATCGCGGGTCATGATGCCCAACACGGAGGTGGAAGCGCCGcTTCAGCGGAACGACGCCGCCCCG---CACCGAGTCCCGCGACGAGACCGATACAGGTTTCAACTCCGGCCGCACAATCCCGATCACAAAACACCCGGGGTCAAGGACCTAGTATACCTGGAATCATCGCCGGGTTTCTGCGAAAAGAACCCGAGGCTGGGCATTCCCGGTACGCACGGGCGTGCCTGCAACGATACGAGTATCGGCGTCGACGGCTGCGACCTCATGTGCTGCGGCCGCGGGTACCGGACCGAgAC
+	Taygetis_sp._RB294	ctgcactgtcaagacatgctggatgagattgtcgacgtttagatctgtgggagatgcttcgatagatggcttcgatggagcatcacgcgtcatgatgcccaacacagaggtagaagtgccggcTCAAAGAaATgACGcGGCTCCT---CATAGAGTACCACGAaGAgACCGaTaTaGGTTTCAACTCAGGCCGcACAATCCtgACCACAAAacACccGGggtCAaGGATTtGgTaTACCTGGAACCATCGCCAGgTTTCTgCGAAAAGAACCCACGGcTGGcCATTtCCGGCACGCACGGaCGTgCCTGcaACGACACAAGTATCGGCGTCGACGGCTGTGaCCTCATGTTCTgCGGTCgtgggtacaggaccgagac
+	Siproeta_stelenes	ctgcaccgttaagacctgctggatgaggctgcctagttttcgctccgtgggcGATGCTCTAAAGGATCGCTTCGATGGGGCATCGCGGGTAATGATGCCCAATACAGAAATCGAAGCTCCCGTGCAGCGAAACGAGGCAGCTCCT---CACAGAGTACCACGAAGAGATCGGTACAGATTCCAACTTAGGCCACACAATCCCGATCATAAAACACCGGGGACCACAGACCTAGTGTACCTAGAATCATCGCCGGACTTCTGTGAAAAGCACCCGAGACTGGGCATTCCCGGCACGcacgggcgtgcctgcaacgatacgagcatcggcgtcgacggttgcgaccttatgtgctgcggccgtggttaccgcaccgagac
+	Prepona_sp._RB256	ctgcactgtcaagacttgctggatgagactacccactttccggtcggtaggaGACGCgTtGAAAGATCGATTCGaCGGGGCGTCGAGAGTGATGATGCCCAATACGGtAGTGGAAGCGCCgGTGCAGcGAAACGATgCAGcCCCt---CACAGAGTCCCACGAaGAGATCGATATAGATTTCAAcTCCTGCCGCACAATCCCGATCACAAAACACCCGGGGTCAAGgACCTAGTGTACCTAGAATCGTCATCCGGTTTCTGTGAAAAGAATCCGAGACTGGGCATTCCCGGCACGcacggccgtgcctgcaacgatacgagcatcgacggtgtcgactgcgacctgatgtactacggtcgtgggtaccggactgagac
+	Podotricha_telesiphe	CTGCACAGTCAAGACCTGTTGGATGAGGCTTCCCAGTTTTAGATCAGTGGGAGACGCTTTGAAAGACCGTTTCGATGGAGCATCGCGGGTCATGATGCCCAACACGGAAGTTGAAGTGTCTGTTCAGAGGAATGACGCAGCTGCG---CACAGAGTTCCTCGAAGAGACCGGTACAAGTTTCAATTCCGACCACACAACCCAGACCATAAAACACCTAGTATACGGGATTTAGTTTACCTAGAACCATCGCCAGGTTTCTGCGAGAAGAATCCGAGAGTGGGCATTCCCGGCACGCACGGGCGTGCCTGCAACGATACCAGCATCGGCGTCGACGGCTGTGATCTCATGTGTTGCGGCCGCGGATACCGGACCgagac
+	Pieris_rapae	ctgcacggttaagacctgttggatgcgactaccaagtttccgttcggtcggCGACTCATTGAAAGACCGCTTCGACGGGGcATCGCGAGTGATGGTGTCTAACACGGACCTCGAaACGCCAGTACAACGAAACGACGCAGCCCCA---CACAGGGTGCCTCGCAGgGATCGATACAGATTCCAACTGCGTCCGCACAAcCCCGATCATAAATCACCGGGAGTCAAAGACCTCGTCTACTTGGAATCGTCGCCTGGTTTCTGCGAAAAGAATCCACGTTTGGGTATACCCGGCACCCACGGGCGTACTTGCAACGATACTAGTATCGGAGTGGACGGcTGCgAcCtCATGTgCTGCGGcCgCGGTTAcCGGactgagac
+	Phyciodes_tharos	ctgcactgtCaagacatGctGgAtgAGGcTGCCAAATTCTCGCtCCgTGGGTGAtgcACtTAAagATcGCTTtGAtGGGGCTTCTCGGGTCATGATGCCtAgCACAGAGAGTGACATGCCCTTACGACAGCGTAACGATGCAGCACCGCACAGAGTTCCTCGACGAGATCGTTACAGATTACaGCTCCGTCCTCTCaaTCCTGACCATAAAGCACCGGGAACTAAAGACCTAgTCTATCTGGAACCATCGCCAGGTTTCTGTGAAAAGAACACaAgGCTGGGGATTCCtGGCACCCACgGGCGTaCTTGCaATGACaCGAGTATCgGCGTCgACGGCTGCGACCTCATGTGTTGCGGCCgAGGTTaCCGGACgAACaC
+	Philaethria_dido	ctgcgctgtcaagacctgttggatgaggcTTCcCAGTTTTAGATCCGTGGGAGGAGCTTTGAAGGACCGCTTCGACGGAGCTTCGCGGGTCATGATGTCCAATACGGAAGTTGAAGTGCCTGTTCAGAGGAATGACGCAGCTGCG---CATAGAGTTCCTCGAAGAGATAGGTACAAGTTCCAACTCCgACCACATAATCCAGATCATAAAACACCTGGTGTCAAGGATTTAGTGTaCTTAGAACCATCACCGGGTtTCTGCGAGAAAAAcCCgAGGCTGGGCATTCCCGGCACGcACGGGCGTgcCTGCAACGATACTAGCATTGCCGTTGACGGCTgcGATCTCATGTGTTtcGGCCgCGGcTACCGGAcTGAGAC
+	Panacea_divalis	ctgcaccgtaaagacctgctggatgaggCTGCCCAGTTTCCGcTCCGTGGGTGATGCGTTGAAAGATCGcTTCGATGGGGCGTCGCGGGTCATGATGCCCAATACTGAAGTCGAGGCACCCGTGCAGCGGAACGACGCAGCGCCT---CACAGGGTTCCAAGAAGAGATCGGTACCGATTCCAACTTCGGCCACATAATCCCGATCACAAAACGCCTGGGGTCAAGGACCTAGTGTACCTAGAATCATCGcCGGGcTTCTGTGAAAAGAACCCGaGACTGGGcATTCCCGGTACGCACGGACGTGcTTGcAACGATACGAGTATCGGCGTCGACGGCTGTGACCTCATGTGTTGcGGGCGCGGTTACCGGACCGAGAc
+	Opsiphanes_cassina	???ttctgccaagacttgctggatgagactgccgagtgttcgatctgtaggtGATGCCTTGATAGACGGTTTCGTTGGAGCTTCGCGGGTCATGAAGCCCATCACGGAGGTAGAGGCCCCAATACACCGGACTGACGCCCCTCTT---CACAGAGTTCCGCGCCGGGATCTCTTCAGGTTCCAACTTCGGcCACACAAtCCCGAaCACAAAGCACCCGGGGTCAAGGACCTAGTATACTTAGAATCATCGCCGGGTTCCTGTGAAAAGAAGCCCAGGCTGGGCATTCCCGGTACGcacgggcgtatgtgcaacgacactagcatcggtgtcgtcggctgcgatctcatgtacttcgaccgaggataccggaccgagac
+	Oleria_aquata	ctgcacagtgaagacttgctggatgaggctaccgagtttccgttctgtgggcGATGCTCTAAAAGacCGCTTCGAcGGTGTTTCACGGgTAATGaTGCCCaACAcAGAAGTAGAAGCGCCGGtACAGCGtAATGACGCGGCACcC---CACAGAGTTCCACGAAGAGATCGATACAGATTTCAACTTCGGCCTCATAATCCTGACCATAAGACACCTGGTGTAAAAGATCTGGTATATCTGGAATCATCACCGGGTTTCTCCGAaAAGAACCCAAGGCTGGGCATTCCCGGTACGcacggacgtgcctgcaacgatactagtatcggcgtggacggctgcgacctcatgtgttgcggccgaggttaccgtacagagac
+	Neruda_metharme	TTGTACAGTCAAGacaTGCTGgATGAGGCTCCCCAATTTTAGATCCGTGGGGGACGCCTTAAAGGACCGCTTTGATGGAGCATCGCGGGTCATGATGCCTAaTGCGGAAgTTGAAgTGCCTGTTCAGCGGAACGATGCCGCTGCG---CACAGAACTCCTCgAAGAGATCGATACAACTTCCAaCTTCGACCACaCaATCCTGATCACaaaaCaCCCGGTGTCaAGGATTTAGTTTACCTAgAACCATCACCTGGTTTCTGCGAGAAGAACCCGAGGCTAGGTATtCCCGGCACGCACGGGCGTGCCTGCAACGACACCaGCATCgGCGTCGAcGGCtGCgATCTCATgTgTTGCGGCCgCGGATACCGGACTGAAat
+	Morpho_helenor	ctgctccgccaagacgtgctggatgcggttaccgagttttcggtctgtaggaGACGCCTTGAAAGATGGCTTCGATGGGGCGTCACGGGTCATGCTGCCGAACACTGAGGTGGAAGTGCCAGTGCAGCGGAATGACGCCGCTCCC---CACAGAGTACCCCGACGAGACCGGTACAGATTCCAACTTCGGCCGCATAATCCTGATCACAAATCACCTGGGGTCAAAGACCTAGTATACTTAGAATCGTCGCCGGGTTTCTGTGAAAAGAATCCCAGACTGGGCATTCCTGGTACGcacgggcgtgcctgcaacgacacgagtatcggcgtcgacggctgcgaactcatgtgctgcggccgcggataccggaccgagac
+	Memphis_sp._RB226	CTGCACGGTCAAAAcTTGCTGGATgagGCTACCGACTTTCCGATCCGTTGGGGaCCCCTtgAAAGATCGCTTTGACGGAGCGTCGAGGGTGATGATGCCCAATGTAgAAGTGGAAACACCAgCGATGCGTAACGACgCACTTCCT---CaCAGAgTCCCGCGACGGGATCGgtATCGATTTCAACTTAGGCCACACAAcCCTGATCACAAGACACCCGGGGTGAAGGACCTAGTCTACTTGGAATCGTCGCCGGGTTTCTGCGAAAAGAATCCCAGGCTGGGCATTCCCGGCACGCACGGGCGTACCTGCAACGATACGAGTATTGGTGTCGACGGTTGCGACCTCATGTGCTGCGGCCGCGGGTACCGCACCGAGAC
+	Megisto_cymela	CTGTACGGTCAAGACgTGCTGGATGAgGCTGCCAACTTTCCGGTCTGTGGGAGACGCCTTAAAAGACgGCTTtGACGGAGCATCACGAGTCATGATGCCCAATACCGAgGTTGAAGTACCAGCTCAGAGGAATGATGCTGCTCCG---CACAGAGTCCCGCGACGAGACCGATACAGATTTaAACTCCGGCCGCACAATCCTGACCACAAAACACCTGGGGTCAAGGACCTAGTATACtTGGAACCATCGCCGGGTTTCTGCgAAAAGAACCCGCGGCTGGGTATTCCCGGTACGCACGGGCGTgCCTGCAACGATACCAgTaTCGGCgTCgACGGTTGCgACCtCATGTGCTGCGGCCGAGGTTACCGGACCGAGAC
+	Mechanitis_polymnia	??gcacagtgaaaacttgttggatgaggctacccagttttcgatctgtaggcGATGCCCTAAAAGATCGATTCGAcGGCGCTTCACGGGTAATGATGCCCAACACAGAAGTAGAAGTGGCGGCACAACGGAACGACGCAGcGCCT---CACAGAGTTCCACGACGAgAtaGATaCAGATTtCAGCTTCGGCCTCATAATCCTGACCACAaGAcATCTgGAGTAAAAGACCtGGTATTCCTGGAaTcATCACCGGGTTTCTGCGAaAAgaACCcaaGGTtGGGCATTCCTGGTACTcacggacgtaactgcaacgacaccagcatcgtcgtggacggctgcgacctcatgtgttgcgcccgcggttaccggacggatac
+	Marpesia_orsilochus	CTGCACGGtCAAGAcTTGCTGGATGAGGCTGCCTAgTTTTCGCTCTGTCGGCGATGCTTTAAAAGATCGCTTCGATGGGGCATCGCGGGTCATGATGCCTAATACAGAAATCGAAGCGCCCGTACAGAGAAATGACGCGGCGCCT---CATAGGGTGCCACGAAgAGATCGGTACAGATTCCAACTACGACCGCACAATCCCGATCACAAAACACCCGGGGTCAAGGACCTAGTCTACCTAGAACCATCGCCGGGATTCTGCGAAAAGAAcCCGAGACTGGGCATTCCCGGTACGCATGGGCGTACCTGCAACGATACGAGCATAGgCgTCgATGGCTGTGACCTCATGTgCTgCGGcCGCGGCTACCGGACTGAgAC
+	Limenitis_arthemis	ctgcaccgtgaagacctgctggatgaggttacccagtttccgatccgtgggaGACTCGCTGAAGGATCGCTTCGACGGGGCATCGCGGGTCATGATGCCTAATACGGAAATTGAAGTTCCTGTTCAACGAAATGATGCAGCAGCT---CCCAGAGTTTCGCGAAGGGATCGATATAAATTCCAGCTTAGACCGCACAACCCCGATCACAAAACACCCGGGTTCAAGGATTTAGTGTACCTCGAATCTTCACCGGGTTTCTGCGAAAAGAACCCTCGGGTGGGGATTCCCGGCACGcacgggcgtgcctgcaacgatacaagcatcggtgtcgacggctgcgacctcatgtgctgcggccgcgggtatcggaccgagac
+	Libytheana_carinenta	ctgcactgtgaagacttgctggatgaggctgccgagtttccgctctgtgggtGACGCGttGAAGGACCGCTTCGACGGTGCCTCACGaGTCATGATGCCCAaCACCGATCTCGAGGCGCCCGTgCAGCGAAACGAAGCGGCgcCC---CACAGAGTGCCGTGGAGAGATCGATTCAGGTTCCAAATCCGGCCACACAATcCCGATCACAAGACACATGGAGTCAAGGATCTGGTGTACTTAGAGTCTTCgCCGGGCTTCTgCGAGAAGaATCCCCGgCTGGGCAtcCCCGGTAcGcacggtcgcacctgcaatgacaccagcattggggtcgaaggctgcgacctcatgtgctacgcccgcgggtacaggaccgagac
+	Laparus_doris	????????????????????GGATGAGGcTCCCCAGtTTcaGATCcGTGGGGGACGCCTTAAAGGATCGCTTCGATGGAGCATCGCGGGTCATGATGCCTAATACAGAAGTTGAAGTACCTGTTCAGAGGAACGACGCAGcTGCg---CATAGaGTTCCtCGAAGAGATCGGTATAAGTTCCAACTCCGACCgcACAATCCCGATCATAaAACACCTGGtGTCAAGGATTTaGTTTACCTAGaACCATCACCGGTTTTCTGcgagAagAACCCgAGGCTGGACATTCCCgGCACGTACgGGcgTgCCTgCAACGAtACTAGCATTGGCGacgaaggctgcgatCtCatgtgttccggccgcg????????????????
+	Hypolimnas_bolina	CtGtAcTgTTAaGAcTTGCTGGATGAGGCTTcCaAGTTTCCGCTCCGtGGTcGATGCGTTAAaAGATCGATTCGATGGTGCGTCGCGGGTCATGATGCCCAAcAcGgAAATCGAAGCGACTGTaCAGCGAAGCGACGGAGCGCCA---CACAGAGTTCCACGAAGAGATCgGtaCAGGTTCCAGCTCAGACCgCACAATCCCGaTCATAaAACACCGGGATCTAAaGaCCTAGTGTaCCTCGAATCATCgcCGGgTtTCTgTgAAAAgAaCCcGAGGcTggGCATTCCCGGCACGCACGGGCGTgTCTcCCTCGAtgCGAGCATCGGTGTCGGcGGCTGCGATCTCATGTgCTGCGGCCGTGGCTACAGGACCGAGAC
+	Hypna_clytemnestra	CTGCaCTGTCaAAAcTTGCTGGATGAgACTACCAACTTTCCGGTCTGTAGGCGACGCTTTAAAAGATCGCTTCGACGGGGCGTCGAgaGTGATGATGCCCAATACGGAgGTAgAAgCACCAGCGCAACGCAATGACGCTGCTCCT---CATCgAATCCCAAGACGAAATCGATATAGATTTCaACTTCGGCCGCACAATCCCGATCACAAAACACCTGGGGTCAAgGACCTAgTATACTTAGAATCaTCACCCgGCTTCTGTgAAAAgAATCCgAGGcTGGGCATTCCCGGCACgCaCGGGcGTACCTGCAACGATACGAGCATCGGCGTCGATGGTTGCGACCTCATGTGCTGCGGGCGCGGGTACCGGACGGAAAC
+	Heliconius_erato	????????tcaagacctgttggatgaggctccccagttttagatctgtcgggGACGCCTTAAaGGATCGcTTtGATGGAGCCTCGCGAGTCATGATGCCTAATACGGAAGTtGAaGTGcCTGTTCAGAGGAACGACGCAGCTGCG---CACAGAGTTCCTCGAAGAGACCGGTACAAGTTCCAACTGCGACCCCACAATCCCGATCATAAAACACCTGGTGCCAAGGATTTGGTTTACCTAGAACCATCACCGGGCTTCTGCGAgAAGAACCCGAGGCTGGGCATTcCCGGCACGcacgggcgtgcctgcaacgatactagcatcggcgtcgacggctgcgatctcatgtgttgcggccgcggataccggaccgaaac
+	Hamadryas_chloe	CTGCACCGTAAAgacctgctggatgaggctgcccagtttccgctccgtgggtGATGcatTAAaaGATCGcttCGATGGGGCgTCGcGGGTCATGATGCCCAATaCAGAAgTCGAAGtaCCCGTGCAGCGAAACGAcGCAGCgCCT---CACAGgGTTCCAaGAAGAGATCGGTACAGATTCCAACTTAGGCCgCACAATCCCgATCAcAAaACACCTgGGgtCAaGGAtCTAGTGTACCTaGAATCATCGcCGGGcTTCTGTGAAAAGAaCCCgAGgCTaGGCATTCCCGGtACgcacgggcgtgcctgcaacgatacgagtatcggtgtcgacggctgcgatcttatgtgttgcgggcgcggatatcgaaccgagac
+	Haetera_piera	ctgcctcgtgaagacgtgctggatgaggctgccgactttccgatctgtaggcGACgCctTAAAGGATgGCTTCGACGGtGCTTCGCGGGTCATGATGCCCAtCACGGAGGTAGAAGCaCCGGTGcAGAGGAaCGATGCCGCTCCG---CACAGAGTCCCGCGACGAGACCGATACAGATTTCAACTTCGGcCCCACAATCCTGACCATAAAACGCCTGGTGTCAAGGACCTAGTGTACTTGGAATCATCACcGGGGTTCTGTGAAAAGAATCCCAGACTGGgCATTCACGGTACgcacgggcgtgcctgcaacgatactagtatcggcgtcgacggctgcgacctcatgtgctgcggccgcgggtaccggaccgagac
+	Euptoieta_claudia	????accGtAAAGAcCTGCTGGATGAGGCTGCCAAGTTTCCGATCTGTGGGAGATGCATTGAAAGATCGCTTCGATGGAGCTTCTCGAGTAATGATGCCAAATACAG---TCGAAGTTCCTGTTCCACGTAATGATGCAGCGGCC---CATAGAGTACCTCGGAGGGATCGGTATAAATTTCAACTTAGACCACATAATCCTGATCACAAAACACCTGGAGTCAAGGATCTAGTGTACTTGGAATCATCACCGGGTTTCTGCGAAAAGAACCCAAGGCTGGGCATTCCCGGCACGCACGGGCGTGCCTGCAATGATACTAGCATTGGTGTCGACGGCTGCGATCTTATGTGTTGCGGCCGCGGCTTCCGGACCGAGAC
+	Euphydryas_phaeton	ctgtacTGTcAAGActTGcTGGATGAGGcTACCAAGTTTTCGCTCCGTGGGCGATGCACTTAAAGATCGCTTCGATGGAGCATCGCGGGTCATGATGCCAAATTCAGAAAGTGACATGCCCTTGCGACAGCGAAACGATGCAGCGCCTCACAGGGTTCCACGTAGAGATCGTTATAGGTTCCAACTCCGTCCACACAATCCCGATCATAAAACACCAGGTACCAaGGaCCTAGTATaTCTAGAACCATCGCCGGGTTTCTGTGAAAAGAACACAAGGCTGGGCATTCCTGGCACGCATGGGCGTGCTTGCAACGACACGAGCATTGGTGtTGGAGGCTgCGATCTTATGTGTTGtGGCCgtGGgTACCgGACCgaGAC
+	Eueides_vibilia	CTGCACAgtCAAGAcTtGTTGGATGAGGCTTCCCAGCTTTAGGTCCGTAGGGGACGCCTTGAAGGATCGCTTTGATGGAGCCTCAAGGGTTATGATGCCTAATACGGAAGTTGAAGTGCCTGTCCAGAGGAATGACGCTGCTGCG---CACAGAGTTCCTCGAAGAGATCGGTATAAaTTCCAACTTCGACCACATAACCCTGATCATAAAACACCTAGTGCCAAGGATTTGGTTTACTTAgAACCATCaCCGGGTTTCTGCGAGAAAAACCCGAGGCTgGGCATTCCCGGCACGCACGGGCGTgCCTGCAACGATACTAGCATCGGCGTTGACGGCTGCgATCTCATGTgTTGCGGCCGCGGATACCGGAcCGAgAC
+	Eresia_nauplius	CTGCACGTtCAAGAcATGCTGGATGAGGCtGCCGAgTTTTCGCTCCGTGGGTGATGCACTTAAAGATCGTTTcGACGGGGCTTCACGGGTCATGATGCCAAGCACAGAGACTGACATGCCCTTACGaCAGCGAAACGATGCAGCACCGCACAGAGTTCCACGACGAGATCGTTACAGATTACAACTCCGTCCTCTCAATCCTGATCATaAAGCACCGGGCACAaAAGACCTAGTCTATCTAGAACCATCGCCAGGTTTCTGTGAAAGGAACACAAGACTGGGGATTCCTGGCACGCACGGGCGTACTTGTAACGACaCgAgTaTCGGTGTCgATGGATGCgACCTCATgTgTTGCgGcCGTGGGTaCCGGACCgATAC
+	Dryas_iulia	ctgcacagttaagacctgttggatgagacttcccagttttagatctgtgggagacgctttgaaagatcgtttcgatggagcctcacgagtcatgatgcccaacacggaagttgaagtgcctgttcagaggaacgatgcggctgcg---cacagagttcctcgaagagatcggtacaagttccaactccgaccgcataatcctgatcacaaaacaccaggtgtcaaagatttagtatacctagaaccatcaccgggcttctgtgagaagaacccgaggctgggcattcccggcacgcacgggcgtgcctgcaacgatactagcatcggcgtcgacggctgcgacctcatgtgttgcggccgcggataccgcaccgagac
+	Dryadula_phaetusa	CTGCACAGTCAAGAcCTGCTGGATGAGGCTTcCCAGTTTTAGATCTGTGGGAGATGCTTTgAAGGACCGCTTTGATGGAGCATCGCGAGTCATGATGCCCAATACGGAAGTTGAGGTGCCTGTACAAAGGAATGACGCAGCTGCG---CACAGAGTTCCTCGAAGAGATCGGTACAAGTTCCAACTCCGACCGCACAATCCTGATCATAAAACACCTGGTGTGAAAGATCTAgTTTACCTAGAACCATCaCCGGGTTTCTGCGAAAAGAaCCCGAGGCTGGGCATTCCCGGCACGCACGGGCGTGCCTGCAACGATACTAGCATCGGCGTtGACGGCTGCCACCTCATGTGTTGCGGcCGCGGATACCGGACCGAaAC
+	Doxocopa_sp._RB273	ctgtactgtgaagacctgttggatgaggctcccaagtttccgctctgtgggtGATTcATTAAAAGATCGTTTCGACGGGGCATCGCGGGTTATGATGCCTAATACAGAAGTCGAAGCACCCGTACAGCGAAATGACGCAGCGCCT---CACAGGGTTCCAAGAAGAGATCGATACAGGTTTCAACTTCGACCGCACAATCCCGATCATAAAACACCCGGGGCCAAAGACCTAGTGTACCTAGAATCATCGCCGGGTTTCTGTGAAAAGAACCCGAGACTGGGCATTCCCGGGACGcacgggcgtgcctgcaacgatacgagcatcggcgtcgacggttgcgatctcatgtgttgcggccgcggttaccgaaccgagac
+	Dione_juno	ctGcACAGTCAAGAcTTGCTGGATGAGGCTTCCCAATTTTAGATCAGTGGGAGACGCCCTGAAGGATCGCTTCGACGGAGCCTCGCGGGTCATGATGCCTAATACGGAAGTTGAAGTACCTGTTCAAAGGAATGACGCAGcTGCG---CACAGAGTTCCTAGAAGAGATCGATATAAGTTCCAACTCCGTCCACACAACCCTGATCATAAAACACCTAGTGTCAAAGATTTGGTATACCTAGAACCATCACCGGGTTTCTGCGAGAAGAACCCGAGGCTGGGCATTCCCGGCACGCACGGGCGTGCCTGCAACGATACTAGCATCGGCGTCGACGGCTGCGATCTCATGTGTTtCGGCCGCGGATACAGGACCGAGAc
+	Diaethria_clymena	CTGTACTGTAAAGACCTGCTGGATGAGGCTGCCTAGTTTCCGGTCAGTGGGTGATGCATTAAAAGATCGCTTTGATGGGGCGTCGCGGGTCATGATGCCCAAcACAGAAGTTGAAGCACCAGTGCAGCGAAACGACGCAGCACCT---CACAGGGTTCCAAGAAGAGATCGGTATAGGTTTCAACTAAGACCGCACAATCCCGACCACAAgACTCCTGGaGTCAAAGACCTGGTGTACCTAGAACcATCACCAGGCTTTTGTGAAAAAAACCAGAGGCTGGGCATTCCCGGTACACACGGGCGTTCCTGCAACGATACGAGTATGGGCGTCGAAGGCTGTGACCTCATGTGtTGCGGGCGCGGCTTCCGGACCGAAaC
+	Colobura_dirce	ctGTActgTTAaGAcTTGCTGGATGAGATTACCCAGTTTTCGTTCTGTGGGTGATGCGTTAAAAGATCGTTTTGATGGAGCGTCACGGGTCATGATGCCTAATACAGAAATTGAAGCACCCGTACAACGAAATGACGCAGCGCCT---CACAGAGTTCCACGAAGAGATCGGTACAGATTTCAACTTCGACCCCACAATCCTGATCATAAAACACCGGGGGCTAAAGAcCTAGTGTACCTaGAATCATCACCGGGTTTTTGtGATAAGAACCCGAGGCTGGGCATCCCCgGTACACACgGGCgTgCCTGCAACGACACAAGCATCggCGTCGACGGcTgTgACCTTATGTgTTGCGGCCGTGGTTACCgAACCgAaaC
+	Cercyonis_pegala	ctgcacggtgaagacgtgctggatgaggctgCCGACGTTCCGGTCTGTAGGCGATGCCCTAAAGGATGGCTTCGACGGAGCGTCGCGGGTCATGATGCCCAATACAGAGGTGGaAGCGCCGGCTCAGCGGAACGATGCCGCTCCG---CACAGAGTGTCGCGACGAGACCGGTACAGATTTCAaCTCCGGcCGcACAaTCCTGACCACAAAACGCCTGGgGTCAaGGACCTAGTATACCTGGAATCCTCGcCGGgTTTCTGCGAAAAGAACCCtCGGCTGGGCATTCCCGGTACGCACGGgCGTgCCTGCAACGACACGAgTATCGGCGTCGACGGCTGCGAcCTCATGTGCTGCGGCCGCGGCTACCggaccgagac
+	Ceratinia_nise	ctgcacagtgaaaacttgctggatgaggctaccaagttttcgctctgtgggtGATGCCCCAAAAGACCTTATTGACGGCGCCTCACGGGTGATGATGCCCAACACAGAAGTAGAAGCGCCGGTACAGCGGAATGACGCAGCAAAC---CACAGAGTTCCACGAAGAGATCGATACAGATTTCAACTTCGGCCTCATAATTCCGACCACAAGACCCCTGGGGTAAAAGACCTGGTATACCTAGAATCGTCCCCAGGTTTCTGTGAAAAAAACCCTAGGTTGGGCATTCCCGGCACGcacggacgtgcttgcaccgacacgagtatcggcgtagacggctgcgacctcatgtgttgcgtccgcggttaccggacggagac
+	Catonephele_acontius	TtGcACAgtAAAGAcCTGCTGGATGAGGCTGCCCAGTTTCCGCTCCGTGGGTGATGCATTGAAAGATCGTTTCGACGGGGCATCGCGGGTCATGATGCCTAACACGGAAATCGAAGCACCCGTGCAGCGAAACGACGCAGCGCCT---CACAGGGTGCCAAAAAGAGATCGGTACAGGTTCCAGCTTAgACCGCACAATCCCGATCACAAAACACCCGGGGTTAAAGACCTAgTTTACCTAgAATCATCGCCGGGCTTCTGTGAAAAGAACCCGAGGCTGGGCATTCCCGGTACGCACGGGCGTgCCTGCAACGATACgAgTATCgGCGTCgACGGCTGCgACCTCaTGTgTTGCGGGCGCGGCTACCGGACCGAgAC
+	Caligo_idomeneus	?????ctgttaagacttgttggatgagactgccgagttttcgatccgtgggcGATGCTTTGAAAGATAGTTTTGATGGAGCGTCGCGGGTAATGATGCCCAATACGGACGTAGAGGCTCCAGTACAAAGAAATGATGCAGCTCCT---CACAGGCTTCCACGAGGAGACCGTTACAGATTCCAACTTCGGCCGCACAACCCTGACCACAAAGCACCCGGGGTCAAAGACTTAGTATACTTAGAATCATCTCCGGGTTTCTGTGAAAAAAATCCGAGGCTAGGCATCCCCGGTACAcacgggcgtgcctgcaacgacactagcatcggtgttgatggctgcgagctcatgtgctgcggccgtggttaccggaccgagac
+	Boloria_bellona	ctgtacagttAAGACATGCTGGATGAGGCTACCAAGTTTCCGATCTGTGGGAGATGCATTAAAGGACCGCTTTGATGGAGCTTCGCGGGTTATGATACCTAACACAGAAGTCGAAGCTCCTATACCACGTAACGATGCAGCAGCT---CACAGAGTTCCCCGAAGGGATCGGTACAAATTTCAACTTCGACCGCATAATCCTGACCATAAAACACCAGGGGTCAAGGATCTAGTATaCCTCGAATCATCGCCGGGTTTCTGTGAAAAGAACCCGAGGCTGGGCATTCCCGGCACGCACGGGCGTGCCTGcAATGATACTAGCATtGGCGTCGACGGGTGCGATCTCATGTGTtGTGGCCgCgGcTaCCGGACTGAGAC
+	Biblis_hyperia	CTGCaCAgTtAAGAcTTGCtGGATgAgGTTGCCGAGTTTCCGCTCCGTGGGTGATGCGCTAAAAGAtCGCttcGacggGGCgTCTCGAGTCATgATGcCcAaTACgGAaaTaGAAGcACCcGTgCAGAGaAACGaCGCAGCgcCT---CACAGaGTTCCaaGAAGAGATCGGTAcAGaTTCCAGCTCCGgCCgCACAATCCtGAcCACAAGACgCCcGGgGTCAAGGAcCTAGTGTACCTAGAATCATCgCCAGGTTTCTGTGAAAAGAACCCgAGGCTGGGCATTCCCGGtACGCACGGtCGTGCCTGCAACGAcACGAGTATCGGCGTCGACGGCTGtGACCTCATGTGcTGCGGGCGCGGcTACaGaACCGAGAC
+	Batesia_hypochlora	ctgCACCGtAAAGACcTGCTGGATGATGCTGCCCAATTTCCGCTCCGTGGGTGATGCGTTGAAAGATCGCTTTGATGGGGCGTCGCGTGTCATGATGCCCAATACTGAACTCGAGGCATCCGTGCAGCGGAACGACGCATCGCCT---CAGAGGGTTCCAAAAAAAGATCGGTACCGATTTCAACTTCGGCCATACAATCCCGATCACAAAACACCTGGGGTCAAGGACCTAGTGTACCTAGAATCATCGCCAGGCTTCTGTGAAAAGAACCcGAGACTGGGCATTCCCGGTACACACGGACGTGCCTGCAACGATACGAGTgTCgGCgTCGACGGCTGTgACCTCATGTGTtGCGGGCgCgGTTACCgGACCgAgAc
+	Asterocampa_clyton	ctgtactgtaaagacctgttGGatGAGGCTccCAAGTTTTCGCTCCGTGGGTGATGCATTAAAAGATCGCTTCGATGGGGcATCGCGAGTCATGATGCCTAATACAGAaGTCGAAGCACCCGTGCAGCGTAACGACGCAGtGTCT---CACAGAGTTCCAAGAAGAGATCGGTACAGATTCCAaCTACGCCCGCACAATCCCGATCATAAAACACCCGGGGTCAAGGACCTAGTGTaCCTAGAaTCATCGCCGGGCTTCTGTGAAAaGAACCCgaGACTGGGCATtCCCgGCACGCACGGGCGTGCCTGCAtCGATACGAgTATCGGTGTAGGCGGCTGCGATCTTATGTgTTGTGGCCtCGGTTACCGcacggagac
+	Antirrhea_sp.	ctgctccgtgaagacgtgctggatgaggctgccgagttttcggtctgtgggcGACGCTTTGAAGGACGGCTTCGATGGGGCGTCGCGGGTCATGATGCCCAACACAGAGGTTGAAGTGCCAGTCCTGCGAAACGATGCGGCTCCT---CACAGAGTCCCGCGGCGAGACCGTTACAGATTCCAACTTCGGCCGCACAATCCTGACCACAAATCACCGGGGGTCAAGGACCTAGTATACTTAGAATCATCGCCGGGTTTCTGTGAAAAGAATCCAAGGCTGGGCATTCCCGGTACGcacgggcgtgcctgcaacgatacgagtatcggtgtcgacggctgcgagctcatgtgctgcggccgcggataccgcacggagac
+	Anthocharis_midea	tggaACAGTGAAGACtTGCTGGATGcGGCTGCCCAgTTTTCGTTCTGTTGGCGATGCGCTaAAAGACCGCTTTGACGGGGCaTCCCGAGTGATGATGTCTAACaCGGACCTCGAAACGCCAGTACAGAGGAACGACGCAGCGCCA---CACaGAGTACCGCGAAgGGATCGATACAgATTCCAaTTGCGGCCGCACAACCCCGATCATAAGTCGCCGGGAACCAAAGACCTCGTGTACCTGGAATCATCACCGGGTTTCTGCGAAAAGAACCCGAGGCTGGGCATTTCCGGCACGCACGGGCGCACCTGCAACGATACgAGTATCGGAGTCGACGGCTGCGACCTCTTGTGTTGCGGACGCGGATATCgGACTGAAAC
+	Actinote_stratonice	CTGCACAgttAAgAcCTGTTGGaTgAGGtTGccTAGTTTCCGCTCAGTGGGAGATATCTTGAAAGACCGCTTTGATGGAGcATCGCGAGTAAAGATGCCGAATACGGAGGTTGATGTACCTGTTCAAAGGAACGACGCAGCAGCC---CACCGAATTCCTCGAAAgGACCGTTACAAATTCCAACTAGGTCCATATAaTCCAGAACATAAGACACCTGGATTCAAAGATTtAGTGTACCTGGATCCATCACCTGGCTTCTGCAACAAGAACACGAAGCTTGGCATTCCTGGCACTAAGGGGCGTgCCTGTAACGATACTAGCATCGGTGTTGATGGtTGCGATCTTATGTGTTGcGGtCGCGGaTaCCgAACTGAGAC
+	Actinote_genitrix	CtGCACAGTtAAGAccTGTtGGATGAGGTTGCCTAgTTTCCGCTCAGTGGGAGATATCTTGAAAGACCGCTTCGATGGAGCATCGCGAGTAAAGATGCCGAATACGGAGGTTGACGTACCTGTTCAAAGGAACGACGCAGCAGCC---CACCGAATCCCTCGAAAAGACCGTTACAAATTTCAACTAGGTCCATATAATCCAGAACATAAGACACCTGGATTCAAAGATTTAGTGTACCTGGATCCATCACCTGGCTTCTGCAACAAGAACACGAAGCTTGGCATTCCTGGTACTAAGGGGCGCGCCTGTAACGATACTAGCATCGGTGTTGATGGTTGTGATCTAATGTGTTGCGGTCGCGGATACCGAACTGAGAC
+	Acraea_andromacha	ctgtacagtaAAGAcaTGtTGGaTGAGGCTGCCTAGTTTCCGTTCTGTGGGAGACGCTTtGAAAGATCGCTTCGATGGAGcATCTCGAGTAATGATGCCGAACACGGAAGTTGAAGTACCTGTACAAAGGAACGACGCGGCAGCC---CACCGAGTTCCTCGGAGGGATCGCTATAAATTCCAACTAAGGCCACATAATCCAGATCACAAAACACCTGGACTCAAAGATTTAGTGTATCTAGAACCATCACCAGGCTTCTGCGAGAAGAACCCGAGGCTTGGCATTCCCGGAACACACGGGCGTGCCTGCAACGATACTAGCATCGGaGTCGATGGTTGCGATCTCATGTGCTGTGGCCGTAGGTaCCGGACTGAgAC
+
+;
+end;
+begin mrbayes;
+    [ HKY model, 4 gamma categories, 1 invariant site ]
+    lset nst=2;
+    lset rates=invgamma;
+    lset ngammacat=4;
+    [ strict clock model ]
+    prset brlenspr=clock:uniform;
+    mcmcp ngen=1000000 nchains=1 printfreq=10000;
+end;
diff --git a/examples/benchmark/mrbayes/testHKY501.nex b/examples/benchmark/mrbayes/testHKY501.nex
new file mode 100644
index 0000000..dfc7ee0
--- /dev/null
+++ b/examples/benchmark/mrbayes/testHKY501.nex
@@ -0,0 +1,47 @@
+#NEXUS
+begin data;
+	dimensions ntax=29 nchar=2520;
+	format datatype=dna missing=? gap=-;
+	matrix
+	Xenopus_laevis	AAAGATTAAGCCATGCA-CGTGTA-AGTACGC--ACG--------GCCGGT-AC-----------AG-T-G-AAACTGCGAA-TGGCTCATTAAAT-CAGTTAT--GGTTCCTTTGATCG-CTCC----------------ATCT-GT-TACTTGG-ATAACTGTGGTAAT-TCTAGAGCTAATACATGCCG----ACGA-GCGCTG-ACCC----CCA-------GGGA--TGCGT-GCATTTATCAGACCA----AAACC-AATCCGGGGC-------------CCCCGC----------------------------------GCCCCGG----CCG-CTTT-GGT-GA-CTCTAGATAACCTCGG-G--CCGA-T-CGCA--CGTC--CCCGT-GACGGCG-ACG-ATACATTC--GGATGTCTG-CCCTATC-AACTTTC-GATGGTACTTT--CTGCGCCTACCATGGT- [...]
+	Tenebrio_molitor	AAAGATTAAGCCATGCA-TGTCTC-AGTACAA--GCC---------GAATT-AA-----------GG-T-G-AAACCGCGAA-AGGCTCATTAAAT-CAGTTAT--GGTTCCTTAGATCG-TACC----------------CACA-TT-TACTTGG-ATAACTGTGGTAAT-TCTAGAGCTAATACATGCAA---ACAGA-GCTCCA-ACCG---GAAA-------CGGA-AGGAGC-GCTTTTATTAGATCA----AAACC-AATCGGTGGCGG--------------TCT--------------------------------CCGTCATCG--T-ACA-ACTT-GGT-GA-CTCTGAATAACTTTAC-G--CTGA-T-CGCA--CGGT--CTTGC-ACCGGCG-ACG-CATCTTTC--AAATGTCTG-CCTTATC-AACTGTC-GATGGTAGGTT--CTGCGCCTACCATGG [...]
+	Strongylocentrotus_purpuratus	AAAGATTAAGCCATGCA-TGTGTT-AGTACAA--GCT---------TGTAT--CA----------AG-C-G-AAACTGCGGA-TGGCTCATTAAAT-CAGTCAT--GGTTCCTTGGAACG-AGTT------------------GC-CC-TACATGG-ATAACTGTGGTAAT-TCTAGAGCTAATACATGCTA----CCAA-GCGCCG-ACC----TCTT--------GGA-AGGCGT-GCTTTTATTAGGAACAA--AGACC-AAGC---------------------CTAG-------------------------------------CCCG--C-TTT-CGTT-GGT-GAACTCTGGATAACTTAG-----CAGA-T-CGCA--CGGT-CATCGC-ACCGGCG-ACAGAAACCATC--AAACGTCTG-CCCTATC-AACTTTC-GATGGTACGTT--AT [...]
+	Scypha_ciliata	AAAGATTAAGCCATGCA-TGTCTA-AGTATAA--GCG-------TTCTTAT-AC-----------TG-T-G-AAACTGCGAA-TGGCTCATTAAAT-CAGTTAT--AGTTTATTTGATGT-TGAC------------------TT-AC-TACTTGG-ATAACCGTGGTAAT-TCTAGAGCTAATACATGCGT----TAAA-GTCCTG-ACC---TCTCGG-------GGA-AGGGAT-GTATTTATTAGATCCA---AAACC-GATGCAGTC----------------GAAA-------------------------------------GGCTGG--TT---ATT-GGT-GA-TTCATGATAACTGAA-----CGG?-T-CGCA--TGGT--CTTGC-GCCGGCG-ATG-ACTCATAC--AAATATCTG-CCCTATC-AACTTTC-GATGGTAAGGT--AGTGGCTTACCATGGT- [...]
+	Saccoglossus_kowalevskii	AAAGATTAAGCCATGCA-TGTCTA-AGTA-CGA-GCC---------TCGGT-ACAC---------GG-T-G-AAACTGCGAA-TGGCTCATTAAAT-CAGTTAT--GGTTCCTTTGATCG-TTAC------------------CC-CT-TACTTGG-ATAACTGTGGCAAT-TCTAGAGCTAATACATGCCT--ACCTCG-GCGCTG-ACC---TCGCG--------GGA--TGC-T-GCTTTTATTAGGACCA---AGACC-GACCCGGTGTCCTGCCTCCT-----TCGC--------------------------GGGTGGTGGGCCCGG----TCC-TCCT-GGC-GAACTCTGGATAACTTGG-----CGGA-T-CG-A--CGGC-CTCTGC-G--GGCG-ACG--AACTTTC--GAGTGTCTG-CCCTATC-AACTTTC-GACGGTACGTT--ATGCGCC [...]
+	Saccharomyces_cerevisiae	AAAGATTAAGCCATGCA-TGTCTA-AGTA-TAA-GCA--------ATTTAT-AC-----------AG-T-G-AAACTGCGAA-TGGCTCATTAAAT-CAGTTAT--CGTTTATTTGATAG-TTCC-----------------TTT-AC-TACATGGTATAACCGTGGTAAT-TCTAGAGCTAATACATGCTT-----AAA-ATCTCG-ACC----CTTT--------GGA-AGAGAT-GTATTTATTAGATAAA---AAATC-AATGTC-------------------TTC----------------------------------------GGAC---T--CTTT-GAT-GA-TTCATAATAACTTTT-----CGAA-T-CGCA--TGGC--CTTGT-GCTGGCG-ATG-GTTCATTC--AAATTTCTG-CCCTATC-AACTTTC-GATGGTAGGAT--AGTGGCC [...]
+	Priapulus_caudatus	AAAGATTAAGCCATGCA-TGTCTA-AGTA-CAG-ACG---------GATAC-AA-----------AG-T-G-AAACCGCGAA-TGGCTCATTAAAT-CAGTTAT--GGTTCCTTAGATCT-TACT------------------AT-CC-TACTTGG-ATAACTGTGGTAAT-TCTAGAGCTAATACATGCAA----TCAG-GCTCCG-ACC----TTACG-------GGA--CGAGC-GCTTTTATTAGACCA-----AACC-AATCGGGT-----------------TTCG------------------------------------GCCCG---TTC--TTTT-GGT-GA-CTCTGGATAACCTTGC-G--CTGA-T-CGCA--CGGT--CTCGC-ACCGGCG-ACG-TATCTTTC--AAATGTCTG-CCTTATC-AACTTTC-GATGGTAGATT--ATGTGCCTACCAT [...]
+	Placopecten_magellanicus	AAAGATTAAGCCATGCA-TGTCTA-AGTACAT--ACT---------TTTTG-AT-----------GG-T-G-AAACCGCGAA-TGGCTCATTAAAT-CAGTTAT--GGTTCCTTAGATCG-TACG------------------AT-CC-TACTTGG-ATAACTGTGGCAAT-TCTAGAGCTAATACATGCAA----AAAG-GCACCG-ACT-----CAC--------GGA--GGTGC-GATTTTATCAGTCCA----AAACC-AATCGGTC-----------------GCAA------------------------------------GGCCG---TCA--CTCT-GGT-GA-ATCTGGATAACTTTGT-G--CTGA-T-CGCA--CGGC-CCTAGT-GCCGGCG-ACG-TATCTTTC--AAATGTCTG-ACCTATC-AACTTTC-GATGGTACGTG--CTATGCC [...]
+	Pellioditis_typica	?????????????????-??????--?????---?--------------??-??--------------??G-AAACTGCGAA-CGGCTCATTAGAG-C--TTAT-ACTAAGCTAGCA-CC-----------------------TG-CC-TTTTAGG-ATATCTTCGACAAA-T-TGAAGCTAATACATGCAA----CCAT-GGCTCC--T------TCG---------G---GGGTC-GCA-ATATTAGAAC------TACC-AGT----------------------------------------------------------------TTA---CTG--GATA-GTT-GA-CTTTAATTATCGTAGA-AA-TCGG-C-AGCG--TGAG--CTC--------CG-ATG-GGTGCAAG--TTATGTACG-CCCTATC-ACCCA---GCAGGCTGTTT--AACCGACAGCCAG [...]
+	Opisthorchis_viverrini	AGAGATTAAGCCATGCA-TGTCTA-AGTACAA--ACC---------TTCAA-AC-----------GG-T-G-AAACCGCGAA-TGGCTCATTAAAT-CAGCTAT--GGTTCCTTGGATCG-TACA-------------------T-AC-TACATGG-ATAACTGTATTAAT-TCTAGAGCTAATACATGCCA----CTAT-GCCCTG-ACCC---GCAA-------GGGA-ACGGGT-GGATTTATTAGAACA----GAACC-AACCGGCGGTGAC------------TTCGGTT----------------------------GCCGTCGTTGCA-TTC---TGT-GAT-GA-CTCTGGATAACTTTA-----CTGA-T-CGCAGTCGGC--CTTGT-GTCGGCG-ACG-G-TCTTTC--AAATGTCTG-CCCTATC-AATTTTC-GATGGTAGGTG--ACCTGCCTA [...]
+	Nematodirus_battus	AAAGATTAAGCCATGCA-TGTCG--AGTT-CA--TCT-----------TTG-AG-----------A----G-AAACTGCGAA-CGGCTCATTAGAG-CAGATGT--CATTTATTCGGAAA-----------------------AT-CC-TTTTTGG-ATAACTGCGGCAAT-TCTGGAGCTAATACATGCGT----TTAG-GCCCTG-AC-----TTTT---------GA-AAGGGT-GCAATTATTAGAGCA-----AATC-AATCTCC------------------TTCG-------------------------------------GGTG----CT--GTTT-GCT-GA-CTCTGAATAATGCAG-----CATA-T-CGG---CGG---CTTGA--CCGCTG-ATA-ATCCGAAA--AAGTGTCTG-CCCTATC-AACCT---GATGGTAGTCT--ATTAGTCTACCAT [...]
+	Mnemiopsis_leidyi	AAAGATTAAGCCATGCA-TGTCTA-AGTA-TAA-ACT---------TTTAT-AC-----------TG-T-G-AAACTGCGAA-TGGCTCATTA?AT-CAGTTAT--CGTCTATTTGATTG-TGCC-----------------CTT-AC-TACATGG-ATAACCGTAGTAAT-TCTAGAGCTAATACATGCGA-----AAA-GTCCCG-ACT-----TCT--------GGA-AGGGAT-GTATTTATTAGATTAA---AAACC-AATGCGTT-----------------TAAC-------------------------------------GACGC---TT---TTC-GGT-GA-TTCATAATAACTGTT-----?GAA-T-CGCA--TGGC-CCTCGT-GCCGGCG-ATG-TTTCATTC--GAGTTTCTG-CCCTATC-AACTTTC-GATGGTAAGGT--ATTGGCTTACCATG [...]
+	Limicolaria_kambeul	AAAGATTAAGCCATGCA-TGTCTA-AGTT-CAC-ACT---------GTCTC-AC-----------GG-T-G-AAACCGCGAA-TGGCTCATTAAAT-CAGTCGA--GGTTCCTTAGATGA-CACG------------------AT-CC-TACTTGG-ATAACTGTGGCAAT-TCTAGAGCTAATACATGCTT---ACCAA-GCTCCG-ACC----CTCGC-------GGA-AAGAGC-GCTTTTATTAGTTCA----AAACC-AATCGTCGTTGCCC----------TTCAGC------------------------------GGGCGCGGCGT--CC---AACT-GGT-GA-CTCTGGATAACTTTGT-G--CTGA-T-CGCA--TGGCCTTCTGT-GCCGGCG-ACG-CATCTTTC--AAATGTCTG-CCCTATC-AAATGTC-GATGGTACGTG--ACATGCCTACCA [...]
+	Lepidodermella_squamata	AAAGATTAAGCCATGCA-TGTCTA-AGTA-CAC-ACT---------ACGGC-AA-----------AG-T-G-AAACTGCGAA-CGGCTCATTAAAT-CAGTTAT--GGTTTATTAGATCG-TGC-------------------CT-AT-CACGTGG-ATAACTGTGGTAAT-TCTAGAGCTAATACATGCAA-----CTA-GCCCTG-ACT-----TAC--------GGA--GGGGC-GCTTTTATTAGATCA----AAATC-AATCGGC------------------TTCG-------------------------------------GCCG---TTT--TTGT-GAT-GA-CTCTGGATAACTTT-T-G--CCGA-C-CGCA--TGGC--CTTGG-CCTGGCG-GCG-TATCTTTC--AAATGTCTG-CCCTATC-AACTTTC-GATGGTAGGTG--ACATGCCT [...]
+	Lanice_conchilega	TAAGATTAAGCCATGCA-TGTCTA-AGTA-CGA-ACT---------CTAAGCAC-----------AG-T-G-AAACCGCGAA-TGGCTCATTAAAC-CAGTTAA--TATTTCTTAGATCG-TCCG------------------AT-CC-TACTTGG-ATAACTGTGGTAAT-TCTAGAGCTAATACATGCAA----CAAA-GCCCCG-A?C?---C?CGT------CGGG-AGGGGC-GCTTTTATTAGATCA----AAACC-AGACGG??G----------------TTCGC----------------------------------CTCTGGT--CGG--CTTT-GGT-GA-CTCTGAGTAACTTATT-G--CGGA-T-CGCA--TGGC--CTCGT-GCCGGCG-ACG-TATCTTTG--AAGTGTCTG-CCCTATC-AACTATC-GTATGTGAGCG--CCTTGCCCACATAG [...]
+	Homo_sapiens	AAAGATTAAGCCATGCA-TGTCTA-AGTACGC--ACG--------GCCGGT-AC-----------AG-T-G-AAACTGCGAA-TGGCTCATTAAAT-CAGTTAT--GGTTCCTTTGGTCG-CTCGCT-------------CCTCT-CC-CACTTGG-ATAACTGTGGTAAT-TCTAGAGCTAATACATGCCG----ACGG-GCGCTG-ACCCCC-TTCGC--GGGGGGGA--TGCGT-GCATTTATCAGATCA----AAACC-AACCCGGTCAGCCCCTCTCCGGC--CCCG----------------------GCCGGGGGGCGGGCGCCGG----CGG-CTTT-GGT-GA-CTCTAGATAACCTCGG-G--CCGA-T-CGCA--CGCC-CCCCGT-GGCGGCG-ACG-ACCCATTC--GAACGTCTG-CCCTATC-AACTTTC-GATGGTAGTCG--CCGTGCCTACCATGGT-GA [...]
+	Haemonchus_placei	AAAGATTAAGCCATGCA-TGTCG--AGTT-CA--TCT-----------TTG-A------------AG-A-G-AAACTGCGAA-CGGCTCATTAGAG-CAGATGT--CATTTATTCGGAAC-GT-----------------------CC--TTTTGG-ATAACTGCGGTAAT-TCTGGAGCTAATACATGCAA----ATAA-ACCCTG-AC-----TTTT---------GA-AAGGGT-GCAATTATTAGAGCA-----AATC-AATCACT------------------TTCG-------------------------------------GGTG----CA--GTTT-GCT-GA-CTCTGAATAACGCAG-----CATA-T-CGG---CGG---CTTGT--TCGCCG-ATA-TTCCGAAA--AAGTGTCTG-CCCTATC-AACCT---GATGGTAGTCT--ATTAGTCTACCATG [...]
+	Eurypelma_californica	AAAGATTAAGCCATGCA-TGTCTA-AGTACAT--GCC---------TCCTT-AA-----------GG-C-G-AAACCGCGAA-TGGCTCATTAAAT-CAGTTAT--GGTTCCTTAGATCG-TACC------------------TT-AC-TACTTGG-ATAACTGTGGTAAT-TCTAGAGCTAATACATGCAT----CAGA-GCTCCG-ACCC----TCTG------GGGA--CGAGC-GCTTTTATTAGACCA----AAACC-AATCGGA-----------------CTCGT-------------------------------------TCCGT---ATC-CCAT-GGT-GA-CTCTGTATAACTTTGG-G--CTGA-T-CGCA--CGGG--CTTGT-CCCGGCG-ACG-CATCTTTC--AAGTGTCTG-CCTTATC-AACTGTC-GATGGTAGGCTT-ATGCGCCTAC [...]
+	Eisenia_foetida	AAAGATTAAGCCATGCA-TGTCTA-AGCA-CAA-ACC---------TTTAC-AC-----------GG-T-G-AAGCTGCGAA-TGGCTCATTAGGC-CACCCAT--GATTTCTTAGATCG-TACA------------------AT-CC-TACTTGG-ATAACTGCGGTAAT-TCTGGAGCTAATACATGCCA----CAAA-GCTCCG-ACCC---TTATG-------GGA-AAGAGC-GCGTTTATTAGGTCA----AAACC-AATCGGGTC----------------CTCGC----------------------------------GGCCCGT--AA---CTCT-GAT-GA-CTCTGGATAACTTCGA-G--CTGA-T-CGCA--TGGC--CTCGT-GCCGGCG-ACG-TATCTTTC--AAGTGTGTG-CCCTATC-AACTTTC-GATGGTACGTG--ATATGCCTACCATGGT [...]
+	Caenorhabditis_elegans	AAAGATTAAGCCATGCA-TGCTTT---GATT----CA------------TC-AA--------------T-G-AAATT-GCGTACGGCTCATTAGAG-CAGATAT--CACCTTATCCGGG--ATCC-----------------GGATCCTCATATGG-ATAACTGCGGAAAT-ACTGGAGCTAATACATGCAA-----CTA-TACCCC-AAC-----GCAAG-------G--CGGGGT-GCAATTATTAGAACA-----GACC-AAACGTT------------------TTCG--------------------------------------GACG----TT-GTTT-GTT-GA-CTCTGAATAAAGCAG-----TTTA-C-TGT---CAGT---TTCG-ACTGACT-CTA-TCCGGAAA--GGGTGTCTG-CCCTTTC-AACTA---GATGGTAGTTT--ATTGGACTA [...]
+	Artemia_salina	AAAGATTAAGCCATGCA-TGTCTA-AGTACAA--GCC---------CCCAG-TG-----------GG-C-G-AAACCGCGAA-TGGCTCAATAAAT-CAGTTAT--GGTTCCTTAGATCG-TACT----------------ATAT-CC-TACTTGG-ATAACTGTGGTAAT-TCTAGAGCTAATACATGCAC----AATA-GCCCCA-ACT----TCAC--------GGA-AGGGGT-GCTTTTATTAGATCA----AGACC-AATCGGG----------------GCTTCGG------------------------------------CTCG-----TC-TCTT-GGT-GA-CTCTGAATAACTATAG----CCGA-T-CGCA--CGGT--CTCGC-ACCGGCG-ACG-TGTCTTTC--AAATGTCTG-CCTTATC-AACTTTC-GATGGTAGGCT--ATGCGCCTACCATGGT- [...]
+	Anthopleura_kurogane	AAAGATTAAGCCATGCA-TGTCTA-AGTATAA--GCA---------CTTGT-AC-----------TG-T-G-AAACTGCGAA-TGGCTCATTAAAT-CAGTTAT--CGTTTATTTGATTG-TACG-----------------TTT-AC-TACTTGG-ATAACCGTGGTAAT-TCTAGAGCTAATACATGCGA-----AAA-GTCCCG-ACT-----TCT--------GGA-AGGGAT-GTATTTATTAGATTCA---AAACC-AATGCGGGT----------------TCC-------------------------------------GCCCGG---TG--TGTT-GGT-GA-TTCATAGTAACTGTT-----CGAA-T-CGCA--GGGC--CTTGGCGCTGGCGGATG-TTTCATTC--AAATTTCTG-CCCTATC-AACTGTC-GATGGTAAGGT--ATTGGCTTACC [...]
+	Anemonia_sulcata	AAAGATTAAGCCATGCA-TGTCTA-AGTATAA--GCA---------CTTGT-AC-----------TG-T-G-AAACTGCGAA-TGGCTCATTAAAT-CAGTTAT--CGTTTATTTGATTG-TACG-----------------TTT-AC-TACTTGG-ATAACCGTGGTAAT-TCTAGAGCTAATACATGCGA-----AGA-GTCCCG-ACT-----TCT--------GGA-AGGGAT-GTATTTATTAGATTCA---AAACC-AATGCGGGT----------------TCT-------------------------------------GCCCGG---TG--CTTT-GGT-GA-TTCATAGTAACTGAT-----CGAA-T-CGCA--TGGC--CTTGC-GCTGGCG-ATG-TTTCATTC--AAATTTCTG-CCCTATC-AACTGTC-GATGGTAAGGT--GTTGGCTTACCATGG [...]
+	Acanthopleura_japonica	AAAGATTAAGCCATGCA-TGTCTA-AGTACAG--ACT---------TTCAC-AT-----------AG-T-G-AAACCGCAAA-TGGCTCATTAAAT-CAGTTAT--GATTTCTTAGATCG-TACA------------------CT-CC-TACTTGG-ATAACTGTGGTAAT-TCTAGAGCTAATACATGACG----TTCA-GCTCCG-ACCTT---TTTGC----AGGGA--AGAGC-GCTTTTATTAGATCA----AGATC-AATCGGGC-----------------CTCG------------------------------------GCCCGT--CC---TGTT-GGT-GA-TTCTGAATAACTTTGT-G--CTGA-T-CGCA--TGGC--CACGC-GCCGGCG-ACG-TATCTTTC--AAGTGTCTG-CCCTATC-AACTTTC-GATGGTACGTG--ATATGCCTA [...]
+	Moniliformis_moniliformis	AAAGATTAAGCCATGCA-TGCGTA-AGTACAT--ACT----------TTTT-ATG----------GT-G-T-AAACCGCGAA-TGGCTCATTACAT-CAGTTGT--GGTTCATTAGATCA-TATG---------------------TT-TAAATGG-ATAACTGTGGCAAA-TCTAGAGCTAATACATGTTT----ACAA-GCTCCG-ACT-----TCT--------GGA-AAGAGC-GCTTTTGTTAGATCA-----AACC-AATGATTTC----------------ATCC-----------------------------------GAAATCA--CT---TAAT-GCT-GA-GTCTGAATAAATTTG-----CAGA-T-TGCA-GCGGT-CTTCGT-ACCGGCG-ACG-TATCTTTC--AAGTGTCTG-CCCTATC-AACTGGC-GATGGTAGTTT--ATGTGC [...]
+	Centrorhynchus_conspectus	------------ATGCA-TGCGTA-AGTGAAT--ACT----------AGCA-AC-----------GG-T-GAAAACCGCGAA-TGGCTCATTAAAT-CAGTTGC--ATTTTACGGTAACT-TGCAG-----------------------TTCGTGG-ATAACTGTGGAAAA-CCTAGAGCTAATACATGCAC-----AAA-GTCCTG-ACT-----TC---------GGC-AGGGAC-GCATTTATCAGATCA----AAGCC-AACTTTTCC---------------GGT-------------------------------------GAACAGCCGGT---TAAT-GAT-GA-CTCTGGGTAATTATT-----TTGA-T-CGCA-TTGCT-ACGTGA-ACAGGCG-ACG-GTGACTTC--AAACGCCTG-ACCTATC-AACTTGT-GTTGGCAGTTG--ATGTTA [...]
+	Neoechinorhynchus_pseudemydis	------------ATGCA-TGCGTA-AGTGCAT--ACT----------TTAT-AT-----------GG-T-TAAAACCGCGAA-TGGCTCATTAAAT-AAGTCTT--GGTTTATTAGATCA-TGCGG--------------------AT-CATATGG-ATAACTGTGGAAAA-TCTAGAGCTAATACATGCCA-----CGA-ATGCTT-CGT-----CTT--------ACGAAGAAGT-GCTTTTATTAGATCA----AAGCC-AATGACTTC---------------CTTC------------------------------------GGGT?GTCAAACG-TTGT-GCT-GA-TTCTGAGTAAAGTAA--G--CTGA-T-TGCA-TTGCC-GTTTAG-GCAGGCG-ACG-TGTCTTTC--AAGTGTCTT-ACCTATC-AACTATC-GTTGGTAGTTG--AT [...]
+	Philodina_acuticornis	????????????ATGCA-TGTCTA-AGTATGA--ACT---------GGTTT-AA-----------GG-T-G-AAACTGCGTA-CGGCTCATTACAT-CAGCTATA-ACTTTCTTTGATCA-TAA-------------------AT-TC-TAAATGGAATAACCGAGGAAAA-GCCTGGGCTAATACATGCG------AAA-ATTCCG-GTA-----GCA--------ATATCGGAAT-GCTTTTATTAGATCA----AAACC-TTCTAGTTCT-------------TTAACC-----------------------------------GGAACTG--TT---TGTT-GGT-GA-CTCTAAATAACTTTGT-G--TTGA-T-CGTA--TGAC-CTTTGT-GTCGACG-ACA-TATCTTTC--AAGTGTCTG-ACTTATC-AACTTTA-GACGGTACATT--ATATGTCTAC [...]
+	Brachionus_plicatilis	????????????ATGCA-TGTCTA-AGTA-CAT-ACC---------TTAGC-AC-----------GG-T-G-AAACCGCGAA-TGGCTCATTAAAT-CAGTTAT--GGTTCCTTAGATCG-TTC-------------------AT-AC-TACATGG-ATAACTGTGGTAAT-TCTAGAGCTAATACATGCAA-----AAA-GCTCCG-ACC-----GTATG------GGA--AGAGC-GCTTTTATTAGACCA----AAACC-AATGGGGTC-----------------GCAA----------------------------------GATCCC---TTT--GTAT-GGT-GA-CTCTGGATAACTTTGT-G--CTGA-T-CGCA--TGGC--CTAGA-GCCGGCG-ACG-TATCTTTC--AAGTGTCTG-CCCTATC-AACTTTC-GATGGTAAGCG--ATTTGCCTAC [...]
+
+;
+end;
+
+begin mrbayes;
+    [ HKY model, 4 gamma categories, 1 invariant site ]
+    lset nst=2;
+    lset rates=invgamma;
+    lset ngammacat=4;
+    [ strict clock model ]
+    prset brlenspr=clock:uniform;
+    mcmcp ngen=1000000 nchains=1 printfreq=10000;
+end;
diff --git a/examples/benchmark/mrbayes/testHKY520.nex b/examples/benchmark/mrbayes/testHKY520.nex
new file mode 100644
index 0000000..7b1326d
--- /dev/null
+++ b/examples/benchmark/mrbayes/testHKY520.nex
@@ -0,0 +1,84 @@
+#NEXUS
+begin data;
+	dimensions ntax=67 nchar=1098;
+	format datatype=dna missing=? gap=-;
+	matrix
+	Albertiniella_polyporicola	ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGCATAAGCAA--TTATACCGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-CCTACATGG-ATACCTGTGGTAATTCTAGAGCTAATACATGCGAAAAAGCCCCAACTTC--GGGAGGGGTGTGTTTATTAGATTAAAAACCAATGCCCCTCGGGGCTCCTT-GGTGATTCATAATAACTTCTCGAATCGCACGGCCTTGTGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTAGGTCTTGGCCAGCCGTGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATAC [...]
+	Cryptendoxyla_hypophloia	???????????????????????CCATGCATGTCTAAGTATAAGCAA--TTATACGGCGAAACTGCGAATGGCTCATTAAATCAG-TAT-GTTTATTTGATAGCACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCAACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCCTCGGGGCTCCTT-GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGCGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCTGACACAGGGAGGTAGTGACAATACATACTGGTACAG [...]
+	Cephalotheca_sulfurea	????????????????????????????????????????TAAGCAA--TTATACGGCGAAACTGCGAATGGCTCATTAAATCAGTTATTGTTTATTTGATAGCACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCCTCGGGGCTTTCT-GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGCGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACGTCCAAGGAAGGCAGCAGGCGCGCAAATTAACCAATCCCGACTCGGGGAGTTAGTGACAATACATACTGATACAGGGC [...]
+	Podospora_anserina	ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATATTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCAAAAAA-TCCCGACTTC--GGAAGGGATGTGTTTATTAGATTAAAAACCAATGCCCTCCGGGGCTCACT-GGTGATTCATAATAACCTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCATGGTGACAACGGGTAACGGGGAGTTAGGGCTCGACTCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCT [...]
+	Chaetomium_elatum	?????????????????????????ATGCATGTCTAAGTATAAGCAA--TTATACCGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCTCT-GGTGATTCATAATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTT [...]
+	Neurospora_crassa	ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTTTAAGCAA--TTAAACCGCGAAACTGCGAATGGCTCATTAAATCAGTTATAGTTTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTC--GGAAGGGGTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTAACT-GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTT [...]
+	Sordaria_fimicola	ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTTTAAGCAA--TTAAACCGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTC--GGAAGGGGTGTATTTATTAGATTAAAAACCAATGCCCTTCGGG?CTTCCT-GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTT [...]
+	Thielavia_terrestris	?????????????????????????ATGCATGTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCTCATTAAATCAGTTATCG?TTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCCTCGGGGCTCTCT-GGTGATTCATAATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTCACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCT [...]
+	Aporothielavia_leptoderma	ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCTCT-GGTGATTCATAATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACA [...]
+	Chaetomium_globosum	?????????????AAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACCGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATG?CCTTCGGGGCTCTCT-GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAAT?CCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTC [...]
+	Cercophora_septentrionalis	???????????????????????????????????????????????????????????AAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-GCTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATG?CCTTCGGGGCTCTCT-GGTGATTCATAATAACTTCTCGAAT??CA?GGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTCGGGGAGGTAGTGACAATAAATACTGATAC [...]
+	Ophiostoma_stenoceras	?????????????????????????ATGCATGTCTAAGTATAAGCAA--TTATACCGCGAAACTGCGAATGGCTCATTAAACCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAA-CCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCCCT-GGTGATTCATAATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGC [...]
+	Sporothrix_schenckii	???????????????????????????????GTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAA-CCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCCCT-GGTGATTCATAATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCT [...]
+	Fragosphaeria_purpurea	???????????????????????????????????????????????????????????AAACTGCGAATGGCTCATTAAATCAGTTATCGTCTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAA-CCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCTCCGGGGCTCCCT-GGTGATTCATAATAACTGCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACGCGGGGAGGTAGTGACAATAAATACTGATACAGGG [...]
+	Ophiostoma_ulmi	?????????????????????????ATGCATGTCTAAGTATAAGCAA--TTATACGGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGCCCCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAA-CCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCCTCGGGGCTCACT-GGTGATTCATGATAACTTGTCGAATCGCACGGCCTTGCGCCGGCGATGGCTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGATCTGGGCCCGCCATGGTGACAACGGGTAACGGAGGGTTAGGGCTCGGCCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTCGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTT [...]
+	Pidoplitchkoviella_terricola	???????????????????????????????????????????GCAA--TTATACAGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCAACTCA--CGAAGGGGTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCTTT-GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGCAGGGTCTTGGCCTGCCATGGTTACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTCGGGGAGGTAGTGACAATAAATACTGAT [...]
+	Daldinia_concentrica	??????????????AAG-TTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACTGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGTTAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTCA--CGGAGGGGTGTATTTATTAGATTAAAAACCAATG?CCTTCGGGGCTCTTT-GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGC?GGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGCAGGGTCTTGGCCTGCCATGGTTACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATACGGGGAGGTAGTGACAATAAATACTGATACAGGGCT [...]
+	Diatrype_disciformis	?????????????????????????????ATGTCTAAGTATAAGCAA--TTATACCGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTA--CGGAGGGATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCCTT-GGTGATTCATAATAACAACTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGCAGGGTCTTGGCCTGCCATGGTTACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTATCCAATCCCGATTCGGGGAGATAGTGACGATAAATACTGATACAGGGCT [...]
+	Xylaria_curta	???????????????????????CCATGCATGTCTAAGTATAAGCAA--TTATACGGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTCA--CGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCCTCGGGGCTTTCT-GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGCAGGGTCTTGGCCTGCCATGGTTACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTTGG [...]
+	Hypoxylon_atroroseum	????????????????????????????????????????????????????????????AACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTA--CGGAGGGATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCTCT-GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGAGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGCAGGGTCTTGGCCTGCCATGGTTACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATTCCGATACGGAGAGGTAGTGACGATAAATACTGATACAGGGCT [...]
+	Diaporthe_phaseolorum	?????????????????????????????????????????????????ATAAACGGCGAAACT???AATGGCTCATTAAATCAGTTATCGTATATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT-GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGC?GGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCC??GGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTCGGGGAGGTAGTGACAATAAATACTGATACAGGGC [...]
+	Leucostoma_persoonii	?????????????????????????ATGCAAGTCTAAGTTTAAGCAC--CTAAACGGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT-GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCT [...]
+	Cryphonectria_parasitica	???????????????????TAAGCCATGCAAGTCTAAGTTTAAGCAC--CTAAACGGCGAAACTGCGAATGGCTCATTAAATCAGTTATCGTATATTTGATAGTACCT--ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCACT-GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGACGGCTGGGTCTTGGCCAGCCGTGGTTACAACGGGTAACGGAGGGTTAGGGCTTGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATACGGGGAGGTAGTGACAATAAATACTGATACAG [...]
+	Microascus_trigonosporus	?????????????AAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACCGCGAAACTGCGAATGGCTCATTATATAAGTTATCGTTTATTTGATAGCACGTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTC--GGAAGGGGTGTATTTATTAGATTAAAAGCCAA?GCCCTTCGGGGCTCTGT-GGTGATTCATGATAACTTTTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGCGAGGGTCTTGTCCTCGCATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACAC?GGGAGGTAGTGACAATAAATACTGATACAG [...]
+	Ceratocystis_fimbriata	????????????????????AAGCCATGCATGTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCTCATTATATAAGTTATCGTTTATTTGATAGCACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATG?CCTTCGGGGCTTTCT-GGTGATTCATGATAACTTCTCGAATCGCATGGCCTTGCGC?GGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGCGAAGGTCTTGTCTTCGCATGGTTACAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAGGGAGCCTGAGAAATGGCTACCACTTTTAAGGAAGGCAGCAGGCGCGCAATTTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGG [...]
+	Bulbithecium_hyalosporum	????????????????????????????????????????????????????????????AACTGCGAATGGCTCATTATATAAGTTATCGTTTATTTGATAGCACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCACAAAA-TCCCGACTCA--CGAAGGGATGTATTTATTAGATACAAAACCAATGCCCTCCGGGGCTCACT-GGTGATTCATGATAACTTCGCGAATCGCACAGCCTTGCGCTGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTATTGGCCAAACATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAG [...]
+	Leucosphaerina_indica	????????????????????????????????????????????????????????????AACTGCGAATGGCTCATTATATAAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTC--GGAAGGGGTGTATTTATTAGATTAAAAACCAATG-CCTTCGGGGCTCCTT-GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTATTGGCCAAACATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGC [...]
+	Nigrosabulum_globosum	??????????????????????????????????????????????A--TTATACAGCGAAACTGCGAATGGCTCATTATATAAGTTATCGTTTATTTGATAGCACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAG-TCCCGACTTC--GGAAGGGATGTATTTATTAGATACAAAACCAATG-CCTCCGGGGCTCAAT-GGTGATTCATGATAACTTCGCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGATATGGGCCAAACATGGTGGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTCGGGGAGGTAGTGACAATAAATACTGATACAGGGC [...]
+	Hapsidospora_irregularis	??????????????????????????????????????????????A--TTATACAGCGAAACTGCGAATGGCTCATTATATAAGTTATCGTTTATTTGATAGCACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAG-TCCCGACTTC--GGAAGGGATGTATTTATTAGATACAAAACCAATG-CCTCCGGGGCTCAAT-GGTGATTCATGATAACTTCTCGAATCGCACGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTATTGGCCAAACATGGTGGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTCGGGGAGGTAGTGACAATAAATACTGATACAG [...]
+	Emericellopsis_terricola	?????????????????????????ATGCATGTCTAAGTATAAGCAA--TTATACGGCGAAACTGCGAATGGCTCATTATATAAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTC--GGAAGGGGTGTATTTATTAGATTAAAAACCAATGCCCTTCGGGGCTCCTT-GGTGATTCATGATAACTTCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTATTGGCCAAACATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTCGGGGAGGTAGTGACAATAAATACTGATACAG [...]
+	Cordyceps_capitata	?????????????????????????ATGCATGTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCTCATTATATAAGTTATCGTTTATTTGATGGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCTCTGGG-CTCTCT-GGTGATTCATGATAACTTCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTAGTGGCCAAACATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCT [...]
+	Claviceps_paspali	?????????????AAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCTCATTATATAAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAA-TCCCGACTCC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCCCGTGGGCTCGCT-GGTGAATCATGATAACTTCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTAGTGGCCAAACATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACCCGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTT [...]
+	Epichloe_typhina	???????????????????????????????????????????????????????????AAACTGCGAATGGCTCATTATATAAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATGCCCCCTGGGGCTCTCT-GGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTAGTGGCCAAACATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATTCGGGGAGGTAGTGACAATAAATACCGATACAGGGCTCTTT [...]
+	Hypocrea_schweinitzii	?????????????AAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACCGCGAAACTGCGAATGGCTCATTATATAAGTTATCGTTTATTTGATAATACTTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTGAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATCCCGCTCGGGGCTCTCT-GGTGAATCATAATAACTAGTCGAATCGACAGGCCTTGTGCCGGCGATGGCTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTATTGGCCAAACATGGTGGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGC [...]
+	Hypomyces_polyporinus	???????????????????????????????????????????????????????????AAACTGCGAATGGCTCATTATATAAGTTATCGTTTATTTGATAATACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTC--GGAAGGGTTGTATTTATTAGATTAAAAACCAATG-CCTCTGGG-CTCTCT-GGTGAATCATGATAACTAGTCGAATCGACAGGCCTTGTGCCGGCGATGGCTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTATTGGCCAAACATGGTGGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGAGACAATAAATACTGATACAGGGC [...]
+	Nectria_haematococca	?????????TCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACAGCGAAACTGCGAATGGCTCATTATATAAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTC--GGAAGGGATGTATTTATTAGATTAAAAACCAATG?CCTCCGGGGCTCACT-GGTGATTCATGATAACTCCTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTTCCCTATCAACTTTCGATGTTTGGGTATTGGCCAAACATGGTTGCAACGGGTAACGGAGGGTTAGGGCTCGACCCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACTCGGGGAGGTAGTGACAATAAATACTGATACAGGGCT [...]
+	Pseudeurotium_zonatum_ATCC62440	ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA-TCTATACAGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGATAATACATGCTAAAAA-CCTCGACTTC--GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTTCGGGGCTCCTT-GGTGATTCATGATAACTTAACGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACT [...]
+	Pseudeurotium_zonatum_CBS329_36	?????????????????????????????????????????????????????????????????CGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCTCGACTTC--GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTTCGGGGCTCCTT-GGTGATTCATGATAACTTAACGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACT [...]
+	Connersia_rilstonii	ATATGCTTGTCTCAAAGATCAAGCCATGCATGTCTAAGTATAAGCAA-TCTATACGGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTC--GGGAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTCCGGGGCTCCTT-GGTGATTCATGATAACTCGACGGATCGCATGGCCTTGTGCCGGCGATGGATCTTTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATATAGGGCTC [...]
+	Leuconeurospora_pulcherrima	ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA-TCTATACAGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTC--GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCTCTTCGGGGCTCCTT-GGTGATTCATGATAACTTAACGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATA [...]
+	Pleuroascus_nicholsonii	??????????????????????????????????????????????????????????GAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTC--GGAAGGGGTGTATTTATTAGATTAAAAACCAATG-CCTTCGGGGCTCCTT-GGTGATTCATGATAACTTATCGGATCGCATGGCCTTGTGCCGGCGATGGATTCTTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATATAGG [...]
+	Dothidea_insculpta	????????????????????????CATGCATGTCTAAGTATAAGCAA--CTATACGGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTC--GGAAGGGGTGTATTTATTAGATAAAAAACCAGCGCCCTTCGGGGCTCCTT-GGTGATTCATAATAACTTAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTATCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCT [...]
+	Aureobasidium_pullulans	ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--CTATACGGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCAACTTC--GGAAGGGGTGTATTTATTAGATAAAAAACCAACGCCCTTCGGGGCTCCTT-GGTGATTCATAATAACTAAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTATCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGG [...]
+	Blumeria_graminis	????????????????????????????????????????????CAA-TTTATACCGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAG-CCCCGACTTC--GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTCCGGGGCTCCTT-GGTGATTCATAATAACTTAACGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGTATATGGGACTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTT [...]
+	Sclerotinia_sclerotiorum	ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--CTATACTGTGAAACTGCGAAT?GCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCTCGACTTC--GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTTCGGG-CTCCCT-GGTGATTCATAATAACTTAACGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGG?ATTAGGGTTCTATTCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAG [...]
+	Cudonia_confusa	??????????????????????????????????TAAGTATAAGCAAA-CTATACCGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACTTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTC--GGAAGG-GTGTATTTATTAGATAAAAAACCAATGCCCTTCGG??CTCCCT-GGTGATTCATAATAACTTAACGAATCGCATGGCCTTGCGC-GGTGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCC?GACACGGGGAGGTAGTTACAATAAATACAGATACAGGGCTCTTTT [...]
+	Spathularia_flavida	???????????????????????????????GCTTAAGTATAAGCAAA-CTATACCGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACTTT-ACTACATGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTT--GGAAGGGGTGTATTTATTAGATAAAAAACCAATG?CCTTCGGGGCTCCCT-GGTGATTCATAATAACTTAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTC [...]
+	Peziza_badia	????????????????????????????????????????????????????????????????????????CTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTCACGGAAGGGGTGTATTTATTAGATAAAAAACCAATG-CCTTCGGGCCTCCT--GGTGATTCATGATAACTTAACGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACG-GGAGGTAGTGACAATAAATACTAATACAGGGGTTTTATGCC [...]
+	Inermisia_aggregata	????????????????????????????????TCTAAGTATAAGCAA-TCTATACAGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACCTCT-GGAAGGGATGTATTTATTAGATAAAAAACCAATG-CCTTCGGG-CTCCCT-GGTGATTCATGATAACTTTACGAATCGCATGGCCTTGTGC-GGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGC-C [...]
+	Morchella_esculenta	?????????????????????????????????????????????AA-TATATACAGTGAAACTGCGAATGGCTCATTAAAT??GTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTAA-CGGAGGGGTGTATTTATTAGATAAAAAACCAATG?CCTTCGGG-CTCCTT-GGTGATTCATGATAACTTAACGAATCGCATGGCCTTGTGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTC [...]
+	Tuber_rapaeodorum	?????????????????????????ATGCATGTCTAAGTATAAGCAA-TCTATACAGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTTTGCTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACCCCT-GGAAGGGATGTATTTATTAGATAAAAAACCAATG-GCTTCGGC-CTCCCT-GGTGATTCATGATAACTTAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTT [...]
+	Onygena_equina	?????????TCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA-CTTGTACGGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTTTTCCACATGG-ATACCCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCTCGACTTC--GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTTCGGGGCTCCTT-GGTGATTCATAATAACTTTTCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTGGCAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATCCGGGGAGGTAGTGACAATAAATACTGATACAGGGCTCTTTCG [...]
+	Blastomyces_dermititidis	ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAATCTTATACGGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATACCCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCTCGACTTC--GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTTCGGGGCTCCTT-GGTGATTCATAATAACTTATCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTGGCAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATACGGGGAGGTAGTGACAATAAATACTGATACAG [...]
+	Penicillium_notatum	ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAACTTTGTACTGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATACCTGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTCA-GGAAGGGGTGTATTTATTAGATAAAAAACCAACGCCCTTCGGGGCTCCTT-GGTGAATCATAATAACTTAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTGGCAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATACGGGGAGGTAGTGACAATAAATACTGATACGGGGCTC [...]
+	Eurotium_rubrum	????????????????????????CATGCATGTCTAAGTATAAGCAC-TTTATACTGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATACCTGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCTCGACTTC--GGAAGGGGTGTATTTATTAGATAAAAAACCAACGCCCTTCGGGGCTCCTT-GGTGAATCATAATAACTAAGCGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTGGCAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACGGGGCTCTTTT [...]
+	Aspergillus_fumigatus	ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA-TTTATACGGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACATGG-ATACCTGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCTCGACTTC--GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTTCGGGGCTCCTT-GGTGAATCATAATAACTTAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTGGCAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATACTGATACGGGGC [...]
+	Fonsecaea_pedrosoi	????????????????????????????????TCTAAGTATAGGCAC--TCATACTGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT---TACCTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCAACTTC--GGGAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTCTGGGGCTCCTT-GGTGATTCATAATAACTTAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATTGTAGGATAGAGGCCTACAATGGTCTTAACGGGTAACGGGGAATTAGGGTTCGACTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATGCTAATTCAGCGAGGTAGTGACAATAAATACTGATACGGGGCTCT [...]
+	Phialophora_verrucosa	????????????????????????????????????????TAGGCAA--TCATACTGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT---TACCTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-CCCCGACTTA--GGAAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTCT?GGGCTCCTT-GGTGATTCATAATAACTTAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAATTTTCGATGGTAGAGTAGTGGTCTACCATGATCTTAACGGGTAACGGGGAATTAGGGTTCTATTCCGGAGAAGGAGCCTGAGAAACGGCTACTACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATGCTAATTCAGCGAGGTAGTGACAATAAATACTGATACGGGGC [...]
+	Exophiala_jeanselmei	???????????????????????????????????????????GCAA--TCATACTGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTTCCTT---TACCTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTAAC??-CCCCGACTTC--GGGAGGGGTGTATTTATTAGATAAAAAACCAATGCCCTTCGGGGCTCCTT-GGTGATTCATAATAACTTAACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCACCTTTCGATTGTAAGATAGAGGCTTACAATGGGAGCAACGGGTAACGGGGAATAAGGGTTCTATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGATACGGGGAGGTAGTGACAATAAATACTGATACGGGGCT [...]
+	Candida_albicans	ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA-TTTATACAGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAA-TCCCGACTGTTTGGAAGGGATGTATTTATTAGATAAAAAATCAATG-CCTTCGGG-CTCTTT-GATGATTCATAATAACTTTTCGAATCGCATGGCCTTGTGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATAACGATACAGGGCCCTTT [...]
+	Saccharomyces_cereviseae	ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA-TTTATACAGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTTCCTTTACTACATGGTATAACTGTGGTAATTCTAGAGCTAATACATGCTTAAAA-TCTCGACCCTTTGGAAGAGATGTATTTATTAGATAAAAAATCAATG-TCTTCGGA-CTCTTT-GATGATTCATAATAACTTTTCGAATCGCATGGCCTTGTGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCTAATTCAGGGAGGTAGTGACAATAAATAACGATACAG [...]
+	Candida_tropicalis	ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA-TTTATACAGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTT-ACTACTTGG-ATAACCGTGGTAATTCTAGAGCTAATACATGCTTAAAA-TCCCGACTGTTTGGAAGGGATGTATTTATTAGATAAAAAATCAATG-TCTTCGGA-CTCTTT-GATGATTCATAATAACTTTTCGAATCGCATGGCCTTGTGCTGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGTGGCCTACCATGGTTTCAACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATAACGATACAGGGCCCT [...]
+	Protomyces_inouyei	?????CTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA-TTTATACAGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCCT-ACTACTTGG-ATACCCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTCT-GGAAGGGATGTATTTATTAGATAAAAAACCAATG--CTTCGGG-CTCCTT-GGTGATTCATAATAACTTTACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATAGAGGCCTACCATGGTTTTGACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCC-GACACGGGGAGGTAGTGACAATAAATAACAATACAGGGCTCT [...]
+	Taphrina_deformans	??????????CTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAA--TTATACAGTGAAACTGCGAATGGCTCATTAAATCAGTTATCGTTTATTTGATAGTACCTA-ATTACTTGG-ATACCCGTGGTAATTCTAGAGCTAATACATGCTAAAAA-TCCCGACTTCT-GGAAGGGATGTATTTATTAGATAAAAAACCAATG-CCTTCGGG-CTCCTT-GGTGATTCATAATAACTTTACGAATCGCATGGCCTTGCGCCGGCGATGGTTCATTCAAATTTCTGCCCTATCAACTTTCGATGGTAGGATATTGGCCTACCATGGTTTTGACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCC-GACACGGGGAGGTAGTGACAATAAATAACAATACAGGGCTCT [...]
+	Filobasidiella_neoformans	????GCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAACGAATTCATACTGTGAAACTGCGAATGGCTCATTAAATCAGTTATAGTTTATTTGATGGTATCTT-GCTACATGG-ATAACTGTGGTAATTCTAGAGCTAATACATGCTGAAAAGCCCCGACTTCT-GGAAGGGGTGTATTTATTAGATAAAAAACCAATGGGTTTCGGCCCTCTAT-GGTGAATCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGCTTCATTCAAATATCTGCCCTATCAACTTTCGATGGTAGGATAGAGGCCTACCATGGTATCAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATAACAATACA [...]
+	Spongipellis_unicolor	?????????????AAAGATTAAGCCATGCATGTCTAAGTATAAACAAGTTTGTACTGTGAAACTGCGAATGGCTCATTAAATCAGTTATAGTTTATTTGATGGTGCTTT-GCTACATGG-ATAACTGTGGTAATTCTAGAGCTAATACATGCAATCAAGCCCTGACTTCT-GGAAGGGGTGTATTTATTAGATAAAAAACCAACGCGGCTCGCCGCTCCATTGGTGAATCATAATAACTTCTCGAATCGCATGGCCTTGTGCCGGCGATGCTTCATTCAAATATCTGCCCTATCAACTTTCGATGGTAGGATAGAGGCCTACCATGGTTTCAACGGGTAACGGGGAATTAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATAACAATATAGGGC [...]
+	Athelia_bombacina	ATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAACAAATTTGTACTGTGAAACTGCGAATGGCTCATTAAATCAGTTATAGTTTATTTGATGATACCTT-ACTACATGG-ATAACTGTGGTAATTCTAGAGCTAATACATGCATTAAAGCCCCGACTTCT-GGGAGGGGTGTATTTATTAGATAAAAAACCAACGCGGCTCGCCGCTCCYTTGGTGATTCATAATAACTTCTCGAATCGCATGGCCTTGCGCCGGCGATGCTTCATTCAAATATCTGCCCTATCAACTTTCGATGGTAGGATAGAGGCCTACCATGGTTTCAACGGGTAACGGGGAATAAGGGTTCGATTCCGGAGAGGGAGCCTGAGAAACGGCTACCACATCCAAGGAAGGCAGCAGGCGCGCAAATTACCCAATCCCGACACGGGGAGGTAGTGACAATAAATAACAATATAGGGCTCTT [...]
+
+;
+end;
+begin mrbayes;
+    [ HKY model, 4 gamma categories, 1 invariant site ]
+    lset nst=2;
+    lset rates=invgamma;
+    lset ngammacat=4;
+    [ strict clock model ]
+    prset brlenspr=clock:uniform;
+    mcmcp ngen=1000000 nchains=1 printfreq=10000;
+end;
diff --git a/examples/benchmark/mrbayes/testHKY755.nex b/examples/benchmark/mrbayes/testHKY755.nex
new file mode 100644
index 0000000..70b12d4
--- /dev/null
+++ b/examples/benchmark/mrbayes/testHKY755.nex
@@ -0,0 +1,81 @@
+#NEXUS
+begin data;
+	dimensions ntax=64 nchar=1008;
+	format datatype=dna missing=? gap=-;
+	matrix
+	Sphaerostilbella_aureonitens	CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCTCGCGCGG-----GAGTTGTAATTTGTAGAGGATGCTTTTGGTGA-GGCGCCGCC-GAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGCTGGCCGCCGAGCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATATGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAACA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCGTGACCAGACTTGGGCTTGG-CGAAT-CATC-AGGG-TTCTCCCTGGTGCACTTTGCCTCGCTCAGGCCAGCATCAGTTCGCCGCGGGGGACAAAGGCTTCG [...]
+	Selinia_pulchra	CCTCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCCA-----GGCCCGAGTTGTAATTTGCAGAGGATGTTTCTGGCGC-GGTGCCTTCCGAGTTCCCTTGGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGCCGCCAAGCCTATGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCTAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGCC-GG-TTGATCATCCGCCG--TTCTCGGTGGTGCACTCTG-CCGGCTCAGGCCAGCATCAGTTTGGCCCGGGGGATAAAGGCGTCGGGAATGTGGCTCC [...]
+	Roumergueriella_rufula	CCTCAGTAACGGCGAG-TGAAGCGG-CAGCAG-CTCAAATTTGAAATCT-GGCCTA-----GGGGCCCGAGTTGTAATTTGCAGAGGATGTTTCTGGCGA-GGCGCCTTCCGAGTTCCCT-GGAACGGGACGCCGTAGAGGGTGAGAGCCCCGTACGGTTGGACGCTAAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCTAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGGC-GG-TCGATCACCCGCCG--TTCTCGGCG---CACTCGG-CCGGCCCAGGCCAGCATCAGTTTGGCCCGGGGGACAAAGGCGCCGGGAACG [...]
+	Plectosphaerella_cucumerina	CCTCAGTAACGGCGAG-TGAAGCGG-CACCAG-CTCAAATTTGAAATCT-GGCTCCTTC--GGGGTCCGAGTTGTAATTTGTAGAGGATGCGTCGGGTACGGGTCCCTACCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTAGGATACCCAGCCCATGTG-ACGC-TCCCTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAACGGGAGGTATACTCCTTCCAAAGCTAAATACCGGCTGGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTCAAACA-GCACGTGAAATTG-TTAAAAGGGAAGCACTCGCTACCAGACTTGGGTTTGG-AGGTTCAACCGGGGC-CACGCCCCGGGG-ATTCCG-CCAGCTCAGGCCAGCATCAGCTTTCCGTCGGGGGCAAAGACGTCGG [...]
+	Peethambara_sundara	CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGTCCCCA----GGGCCCGAGTTGTAATTTGCAGAGGATGCTTTGGGCGC-GGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCACAGAGGGTGAGAGCCCCGTCTGGTCGGACACCAAGCCTGTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTTAAACA-GCACGTGAAATTG-TTGAAAGGGAAGCGTTCATGACCAGACTTGG-CCCGG-TTGATCATCCAGCG--TTCTCGCTGGTGCACTCTG-CCGGTCCAGGCCAGCATCAGTTCGCCACGGGGGATAAAGGCGGCGGGAATGTGG [...]
+	Ochronectria_calami_2	CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGC-TCTC----GGGCCCGAGTTGTAATTTGAAGAGGATGTTTCTGGCAA-GGTACCTTCTGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTAGTTGGTCGCCGCGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGCC-GG-TTGATCATCCATCG--TTCTCGGTGGTGCACTCTG-CCGGTCCAGGCCAGCATCAGTTTGCCCCGGGGGATAAAGGCTTCGGGAATGT [...]
+	Ochronectria_calami_1	CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGC-TCTC----GGGCCCGAGTTGTAATTTGAAGAGGATGTTTCTGGCAA-GGTACCTTCTGAGTTCTCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTAGTTGGTCGCCGCGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGCC-GG-TTGATCATCCATCG--TTCTCGGTGGTGCACTCTG-CCGGTCCAGGCCAGCATCAGTTTGCCCTGGGGGATAAAGGCTTCGGGAATGT [...]
+	Nigrosabulum_globosum	CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCCA-----GGCCCGAGTTGTAATTTGCAGAGGATGCTTCTGGCGA-CGCGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCCGGTCGTGCGCCTAGCCTGTGTGAA-GC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-CTGAAAGGGAAGCGCTTATGACCAGACTTGGGCCCGG-TGAATCA-CCAGCG--TTCTCGCTGGTGCACTTTG-CCGGCCCAGGCCAGCATCAGTTCGTGCCGGGGGATAAAGGCTTCGGGAATGT [...]
+	Neotyphodium_coenophialum	CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCCC---GGGGCCCGAGTTGTAATTTGCAGAGGATGCTTTTGGCGA-GGCGCCTTCCGAGTTCCCT-GGAACGGGACGCCACAGAGGGTGAGAGCCCCGTCTGGTTGGATGCCGAGCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAAATAGTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGCCCGG-TGAAT-CATCCAGCG-TTCTCGCCGGTGCACTTTGCCGGGCTCAGGCCAGCATCAGTTCGCCCTGGGGGAGAAAGGCTCTGGGA [...]
+	Nectriopsis_violacea	CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCA------GGCCCGAGTTGTAATTTGTAGAGGATGTTTCTGACGA-GGTACCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGTCGCCAAGTCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATATAGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCATATGACCAGACTTGGCC-AGG-TTAATCATCCATCG--TTCTCGGTGGTGCACTTTG-CCTGGCCAGGCCAGCATCAGTTCGCCTTGGGGGATAAAGACTTCGGGAATGTG [...]
+	Nectriopsis_sporangiicola	CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCA-------GGCCGAGTTGTAATTTGTAGAGGATGTTTCTGACGA-GGTACCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGTCGCCAAGTCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATACGTCTTCTAAAGCTAAATATAGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCACATGACCAGACTTGGGT-GGG-TTGATCATCCGTCG--TTCTCGGCGGTGCACTCTG-CCCGACCAGGCCAGCATCAGTTCGCTGCGGGGGATAAAGACGTCGGGA [...]
+	Nectria_zonata	CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCA------GAGCCGAGTTGTAATTTGTAGAGGATGTTTCTGGAGA-GGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTG--CGCTATGCCTATGTGAAA-C-TCCTTCAACGCGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGTGGTGTACGCCATCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAA-GAGGGTTAAACA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACCTGGGCC-GG-TTGATCATCCGCCG--TTCTCGGTGGTGCACTCTG-CCGGCCCAGGCCAGCATCGGTCTGGCGCGGGGGTCAAAGGTTCCGGGAATGTGGCTCCC [...]
+	Nectria_sesquicilli	CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCGCAA-------GCCCGAGTTGTAATTTGTAGAGGATGTTTCTGGCGA-CGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGTTGCCTAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGTTTATGACCAGACTTGAGC-AGG-TTGATCATCCGTGG--TTCTCCGCGGTGCACTCTG-CCTGTTCAGGCCAGCATCAGTTTGGTTCGGGGGATAAAGGCTTCGGGAATGTAG [...]
+	Nectria_radicicola	CCCTAGTAACGGCGAG-TGAAGCGG--AACAG-CTCAAATTTGAAATCT-GGCCTTC-----GGGTCCGAGTTGTAATTTGTAGAGGATGCTTTGGGTGA-GGTACCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTTGGATACCGATCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGCTTGG-TTGATCATCCAGGG--TTCTCCCTGGTGCACTCTT-CCAGCTCAGGCCAGCATCAGTTCGCTGTGGGGGATAAAGGCTTCGGGAATGTGGC [...]
+	Nectria_pseudotrichia	CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCTCGT----GGTCCGAGTTGTAATTTGTAGAGGATGCTTTGGGTTA-GGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTTGGACACCGAGCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTGTGACCAGACTTGGGCCCGG-TCAATCATCCAGGG--TTCTCCCTGGTGCACTTTT-CCGGCTCAGGCCAGCATCAGTTTGTCGCGGGGGATAAAGACGTTGGGAATGT [...]
+	Nectria_pityrodes2	CCCTAGTAACGGCGAG-TGAAGCGG-CAACAGGCTCAAATTTGAAATCT-GGCCCTA------GGCCCGAGTTGTAATTTGTAGAGGATGTTTCTGGCGA-AGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGATGCCTAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGGTTATGACCAGACTTGGAC-AGG-TTGATCATCCACGG--TTCTCTGTGGTGCACTCTG-CCTGTCCAGGCCAGCATCAGTTCGCTTCGGGGGATAAAGACTTTGGGAATGTGGC [...]
+	Nectria_pityrodes1	CCCTAGTAACGGCGAG-TGAAGCGGGCAACAG-CTCAAATTTGAAATCT-GGCCCTA------GGCCCGAGTTGTAATTTGTAGAGGATGTTTCTGGCGA-AGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGATGCCTAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGGTTATGACCAGACTTGGAC-AGG-TTGATCATCCACGG--TTCTCTGTGGTGCACTCTG-CCTGTTCAGGCCAGCATCAGTTCGCTTCGGGGGATAAAGGCTTTGGGAATGTGGC [...]
+	Nectria_grammicospora	CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCGCAA-------GCCCGAGTTGTAATTTGTAGAGGATGTTTCTGGCGA-CGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGATGCCTAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCGTTCATGACCAGACTTGGGC-AGG-TTGATCATCCGTGG--TTCTCCGCGGTGCACTCTG-CCTGCCCAGGCCAGCATCAGTTCGCCCCGGGGGATAAAGGTTTCGGGAATGT [...]
+	Nectria_cinnabarina_2	CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCTTGT----GGTCCGAGTTGTAATTTGTAGAGGATGCTTTTGGTGA-GGTACCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTTGGATACCGATCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTGTGACCAGACTTGGGCTTGG-TTAATCATCCAGGG--TTCTCCCTGGTGCACTTGG-CCAGCCCAGGCCAGCATCAGTTTGTCGCGGGGGATAAAGGCGTTGGGAATGT [...]
+	Nectria_cinnabarina_1	CCCAAGTAACGGCGATGTGAATCGG-CAACAG-CTCAAATTTGAAATCTAGGCCCTTGT----GGTCCGAGTTGTAATTTGTAGAGGATGCTTTTGGTGA-GGTAC-TTCCGA-TTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTTGGATACCGATCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTA-TTTGGG-AATGCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGTTGATCGAAAGATGAAAAGCACTTTGAAAAGAGGGT-AAATA-GTACGTGAAATTGGTTGAAAGGGAAGCGCTTGTGACCAGACTTGGGCTTGG-TTAATCATCCAGGG--TTCTCCCTGGTGCACTTGG-CCAGCCCAGGCCAGCATCAGTTTGTCGCGGGGGATAAAGGCGTTGGGAATGT [...]
+	Myrothecium_inundatum	CCTCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCA------GGCCCGAGTTGTAATTTGCAGAGGATGCTTTTGGTGA-GGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTCGGACACCGAGCCTCTGT-AAAGCCTCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTTAAATA-GCACGTGAAATTG-TTGAAAGGGAAGCGTTTATGACCAGACTTGG-CCCGG-TTGATCATCCAGCG--TTCTCGCTGGTGCACTCTG-CCGGTCCAGGCCAGCATCAGTTCGTCGCGGGGGACAAAGGCTTCGGGAATGT [...]
+	Mycoarachis_inversa	CCTCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GCCCCCC------GGCCCGAGTTGTAATTTGCAGAGGATGCTTCTGGCGA-CGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCCGGTTGTGCGCCTAGCCTCTGTGAA-GC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-CTGAAAGGGAAGCGCTTCTGACCAGACTTGGGCCCGG-TGAATCATCCAGCG--TTCTCGCTGGTGCACTTTG-CCGCCC-AGGCCAGCATCAGTTCGCGCCGGGGGATAAAGGCTTCGGGAATGTAG [...]
+	Leucosphaerina_indica	CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAAGCT-GGCTCTC-----GGGCCCGCATTGTAATTTGCAGAGGATGCTTCTGGCGA-CGCGCCTTCCGAGTTTCCCTGGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCCGGTCGTGCGCCTAGCCTCTGTGAA-GT-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGCT-GGCTCGATCATCCGGCG--TTCTCGCCGGTGCACTCGGGCCG-CTCAGGCCAGCATCAGCTTCCGCCGGGGGATAAAGGCGGCGGGAATGT [...]
+	Leuconectria_clusiae	CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCTC-----GGGTCCGAGTTGTAATTTGTAGAGGATGCTTTGGGTGC-GGTACCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTTGGATACCAATCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTATGACCAGACTTGGGCTTGG-TTGATCATCCTGGG--TTTTCCCTGGTGCACTCTT-CCAGTTCAGGCCAGCATCAGTTTGTTTCGGGGGATAAAGGCTTCGGGAATGTG [...]
+	Kallichroma_tethys_2	CCCCAGTAACGGCGAG-TGAAGCGG-CAAAAG-CTCAAATTTGAAATCT-GGCCCCCCC---GGGCCCGAGTTGTAATTTGCAGAGGATGTTTCTGGCGC-GGCGCCAGCCGAGT-CCCTTGGAACAGGGCGCCACAGAGGGTGAGAGCCCCGTATGGCTGCGCGCTAAGCCTTTGTGAAA-C-TCCCTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAGCGGGAGGTGTACGTCTTCCAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCACTCATGACCAGACTTGGGCCCGG-CGGATCATCCAGCG--TTCTCGCTGGTGCACTTCACCGGGCTCAGGCCAGCATCAGTCCGCGCCGGGGGAAAAAGGCTTCGGGAATGTG [...]
+	Kallichroma_tethys_1	CCCCAGTAACGGCGAG-TGAAGCGG-CAAAAG-CTCAAATTTGAAATCT-GGCCCCCCC---GGGCCCGAGTTGTAATTTGCAGAGGATGTTTCTGGCGC-GGCGCCAGCCGAGT-CCCTTGGAACAGGGCGCCACAGAGGGTGAGAGCCCCGTATGGCTGCGCGCTAAGCCTTTGTGAAA-C-TCCCTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAGCGGGAGGTGTACGTCTTCCAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCACTCATGACCAGACTTGGGCCCGG-CGGATCATCCAGCG--TTCTCGCTGGTGCACTTCACCGGGCTCAGGCCAGCATCAGTCCGCGCCGGGGGAAAAAGGCTTCGGGAATGTG [...]
+	Kallichroma_glabrum	CCTCAGTAACGGCGAG-TGAAGCGG-CAAAAG-CTCAAATTTGAAATCT-GGCCCCCA-----GGCCCGAGTTGTAATTTGCAGAGGATGTTTCTGGCGC-GGCGCCTTCCGAGT-CCCTTGGAACAGGGCGCCATAGAGGGTGAGAGCCCCGTATGGTTGCGCGCTAAGCCTGTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCACTTATGACCAGACTTGGGCTCGGGCGAATCATCCAGCG--TTCTCGCTGGTGCACTTCTCCGGGCTCAGGCCAGCATCAGTCTGCTCCGGGGGATAAAGGCTTCGGGAATGTGG [...]
+	Hypomyces_australis	CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GCC--TAGGG-----CCCGAGTTGTAATTTGCAGAGGATGCTTTT-GCGA--GCGCCGCCCGAGTTCCCT-GGAACGGGACGCCGCAGAGGGTGAGAGCCCCGTCTG-CTGGACGCCGAGCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATATGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAACA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGCTTGG-CGGAT-CAGC---TG-TTCTC-CGGGTGCACTTCGCC-CGCCCAGGCCAGCATCAGCTCGCCCCGGGGGACAAAGGCTTCGGGAATGTGG [...]
+	Hypomyces_aurantius	CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCTAGGG----CCCTGAGTTGTAATTTGCAGAGGATGCTTTTGGCAA-GGCGCCGCCCGAGTTCCCT-GGAACGGGACGCCGCAGAGGGTGAGAGCCCCGTCTGGCTGGACGCCGAGCCTTTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAACA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGCTTGG-CGGATGCAGC---TG-TTCTCGCCGGTGCACTTCGCCTCGCCCAGGCCAGCATCAGTTCGCCCCGGGGGACAAAAGCTTCGGGAATGTGG [...]
+	Hypocrea_schweintzii	CCCCGATAACGGCGAG-TGAAGCG--CAACAG-CTCAAATTTG?AACTC-GGCCCTTTTG-GG--TCCGAGTTGTAATTTGTAGAGGATG?TTTTGGCAA-GGTGCCGCCCGAGTTCCCT-GGAACGGGACGCCACAGAGGGTGAGAGCCCCGTCTGGCTGGCCACCGAGCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATATGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACCTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTGTGACCAGACTTGGGCGCGG-CGGAT-CATCCGGGG-TTCTCCCCGGTGCACTTCGCCGTGTCCAGGCCAGCATCAGTTCGTCGCGGGGGAAAAAGGCTTCGGGAACGTG [...]
+	Hypocrea_pallida	CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCTAGCCGG----CGAGTTGTAATTTGCAGAGGATGCTTTTGGTGA-GGCGCCGGCCGAGTTCCCT-GGAACGGGATGCCACAGCGGGTGAGAGCCCCGTCTGCCTGGACGCCGAACCTATGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATATGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGCTTGG-CGGAT-CATC--GCG-TTCTCGCCGTTGCACTCTGCCTCGTCCAGGCCAGCATCAGTTCGTCCCGGGGGATAAAGGCGTCGGGAATGTGGCTC [...]
+	Hypocrea_lutea	CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCCCGGG----TCCGAGTTGTAATTTGTAGAGGATGCTTTTGGTGA-GGTGCCGCCCGAGTTCCCT-GGAACGGGACGCCACAGAGGGTGAGAGCCCCGTCTGGCTGGCCACCGAGCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATATGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACCTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTGTGACCAGACTTGGGCGCGG-CGGAT-CATCCGGGG-TTCTCTCCGGTGCACTTCGCCGCGTTCAGGCCAGCATCAGTTCGTCGCGGGGGATAAAGGCTTCGGGAACGTGGCTC-- [...]
+	Hydropisphaera_peziza_2	?????????????????????????????????????????TGAAATCT-GGCCCTA------GGCCCGAGTTGTAATTTGCAGAGGATGTTTCTGGCGA-GGTGCCTTCCGAGTGCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGTCGCTAAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGCC-GG-TTGATCATCCGCCG--TTCTCGGCGGTGCACTCTG-CCGGCTCAGGCCAGCATCAGTTTGGTCCGGGGGATAAAGGTGTAGGGAAT [...]
+	Hydropisphaera_peziza_1	CCTCAGTAACGGCGAGGTGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCTA------GGCCCGAGTTGTAATTTGCAGAGGATGTTTCTGGCGA-GGTGCCTTCCGAGTGCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGTCGCTAAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGCC-GG-TTGATCATCCGCCG--TTCTCGGCGGTGCACTCTG-CCGGCTCAGGCCAGCATCAGTTTGGTCCGGGGGATAAAGGTGTAGGGAAT [...]
+	Hydropisphaera_erubescens_4	CCTTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCTCT------GGCCCGAGTTGTAATTTGCAGAGGATGTTTCTGGCGA-GGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGTCGCTAAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCTAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTATGACCAGACTTGGGCC-GG-TTGATCATCCATCG--TTCTCGGTGGTGCACTCTG-CCGGTTCAGGCCAGCATCAGTTTGGCTTGGGGGATAAAGGCTTCGG [...]
+	Hydropisphaera_erubescens_3	CCTCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCTTCT-----GGCCCGAGTTGTAATTTGCAGAGGATGTTTCTGGCGA-GGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGTCGCTAAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCTAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTATGACCAGACTTGGACC-GG-TTGATCATCCATCG--TTCTCGGTGGTGCACTCTG-CCGGTTCAGGCCAGCATCAGTTTGGCCCGGGGGATAAAGGCTTCGG [...]
+	Hydropisphaera_erubescens_2	CCTTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCTTT------GGCCCGAGTTGTAATTTGCAGAGGATGTTTCTGGCGA-GGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGTCGCTAAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCTAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTATGACCAGACTTGGACC-GG-TTGATCATCCATCG--TTCTCGGTGGTGCACTCTG-CCGGTTCAGGCCAGCATCAGTTTGGCTCGGGGGATAAAGGTTTCGG [...]
+	Hydropisphaera_erubescens_1	CCTTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCTTCT-----GGCCCGAGTTGTAATTTGCAGAGGATGTTTCTGGCGA-GGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGTCGCTAAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGGGAATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCTAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGACC-GG-TTGATCATCCATCG--TTCTCGGTGGTGCACTCTG-CCGGTTCAGGCCAGCATCAGTTTGGCCCGGGGGATAAAGGTTTCGG [...]
+	Heleococcum_japonicum	CCTCAGTAACGGCGAG-TGAAGCGG-CAACAG-TTCAAATTTGAAATCT-GGCCCCA------GGCCCGAGTTGTAATTTGAAGAGGATGTTTCTGGCGA-GGTGCCTTCCGAGTGCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGTCGCTAAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGCC-GG-TTGATCATCCGCCG--TTCTCGGCGGTGCACTCTG-CCGGCTCAGGCCAGCATCAGTTTGGTCCGGGGGATAAAGGCGTAGGGAATGT [...]
+	Hapsidospora_irregularis	CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCCC-----GGCCCGAGTTGTAATTTGCAGAGGATGCTTCTGGCGA-CGCGCCTTCCGAGTTCCCT-GGAACGGGACGCCACAGAGGGTGAGAGCCCCGTCCGGTCGTGCGCCTAGCCTGTGTGAA-GC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-CTGAAAGGGAAGCGCTTATGACCAGACTTGGGCCCGG-TGAATCA-CCAGCG--TTCTCGCTGGTGCACTTTG-CCGGCCCAGGCCAGCATCAGTTCGCGCCGGGGGATAAAGGCTTCGGGAA [...]
+	Geosmithia_putterillii	CCTTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCCA-----GGCCCGAGTTGTAATTTGTAGAGGATGCTTCTGGCGA-CGCGACTTCCGAGTTCCCT-GGAACGGGACGCCAAAGAGGGTGAGAGCCCCGTCCGGCCGTTCGCCTAGCCTATGTGAA-GC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-CTGAAAGGGAAGCGCTTATGACCAGACTTGGGCTAGG-TGAATCATCCGGCG--TTCTCGCCGGTGCACTTTG-CCTGTCCAGGCCAGCATCAGTTCGCTTCGGGGGATAAAGGCTTCGGGAATG [...]
+	Geosmithia_lavendula	CCTCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCCA-----GGCCCGAGTTGTAATTTGTAGAGGATGATTCTGGCGA-CGCGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCCGGTCGTGCGCCTAGCCTCTGTGAAT-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAAAA-GTACGTGAAATTG-CTGAAAGGGAAGCGCTTATGACCAGACTTGGGCGTGG-TGAATCATCCGGCG--TTCTCGCCGGTGCACTTTG-CCTGTCCAGGCCAGCATCAGTTCTCCCCGGGGGATAAAGGCTTCGGGAATGTA [...]
+	Epichloe_typhina	CCCCAGTAACGGCGAG-TGAAGCGG-AAACAG-CTCAAATTTGAAATCT-GGCCCCCA----GGGCCCGAGTTGTAATTTGTAGAGGATGCTTTGGG-GA-GGCGCCTTCCGAGTTCCCT-GGAACGGGACGCCACAGAGGGTGAGAGCCCCGTCTGGTTGGATGCCGAGCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATCCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCATGACCAGACTTGGGCCCGG-TGAAT-CATCCAGCGGTTCTCGCTGGTGCACTTTGCCGGGCTCAGGCCAGCATCAGTTCGCCCCGGGGGACAAAGGCTCTGGGAATGTGGCTC [...]
+	Emericellopsis_terricola	CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCTCGT------GCCCGAGTTGTAATTTGTAGAGGATGCTTTTGGCGA-CGCGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCCGGTCGTGCGCCTAGCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-CTGAAAGGGAAGCGCTTATGACCAGACTTGGGCGCGG-CGGATCATCCGGCG--TTCTCGCCGGTGCACTCCA-CCGCCCCAGGCCAGCATCAGTTCGCGCCGGGGGACAAAGGCTTCGGGAA [...]
+	Didymostilbe_echinofibrosa	CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCA------GGCCCGAGTTGTAATTTGCAGAGGATGCTTTGGGCGC-GGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTCGGACACCAAGCCTATGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATATGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTTAAACA-GCACGTGAAATTG-TTGAAAGGGAAGCGTTCATGACCAGACTTGG-CCCGG-TTGATCATCCAGCG--TTCTCGCTGGTGCACTCTG-CCGGTCCAGGCCAGCATCAGTTCGCCGCGGGGGATAAAGGTTTCGGG [...]
+	Cylindrocladium_floridanum	CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCTC-----GGGTCCGAGTTGTAATTTGTAGAGGATGCTTTGGGTGA-GGTACCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTTGGATACCGATCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTATGACCAGACTTGGGCTTGG-TTGATCATCCTGGG--TTCTCCCTGGTGCACTCTT-CCAGTTCAGGCCAGCATCAGTTCGCTGCGGGGGATAAAAGCTTTAGG [...]
+	Cordyceps_capitata	CCCCAGTAACGGCGAG-TGAAGCGG-CAACGG-CTCAAATTTGAAATCT-GGCCCCCA----GGGCCCGAGTTGTAATTTGCAGAGGATGCTTTTGGCGC-GGCGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTCGGACGCCAAGCCAGTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAACGGGAGGTATATGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAACA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTGCGACCAGACTTGGGCCCGG-TGAAT-CATCCAGCG-TTCTCGCTGGTGCACTTCGCCGGGCTCAGGCCAGCATCAGTTCGCCGCGGGGGACAAAAGCTTCGGGAACGTGGC [...]
+	Cordycepioideus_bisporus	CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCCCCGCGGGGCCCGAGTTGTAATTTGCAGAGGATGCTTTTGGCGC-GGCGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTCGGACGCCCAGCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATATGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAACA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCGTGACCAGACTTGGGCGCGG-CGGAT-CATC-GGCG-TTCTCGCCGGTGCACTCCGCCGGGCCCAGGCCAGCATCGGTTCGCGGCGGGGGACAAAGGCGTCGGGAA [...]
+	Clonostachys_rosea	CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCGCACAC--------GGAGTTGTAATTTGTAGAGGATGTTTCTGGCGA-CGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGATGCCTAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCGTTCATGACCAGACTTGGGC-AGG-TTGATCATCCGTGG--TTCTCCGCGGTGCACTCTG-CCTGCCCAGGCCAGCATCAGTTCGCCCCGGGGGATAAAGGCTTTGGGAATGTGGC [...]
+	Ceratocystis_fimbriata	CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCTACATTCCGTAGTCCGAGTTGTAATTTGTAGAGGATGCTTTGGGTGA-GGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGACACCAAACCTCTGT-ATAGC-TCCTTCAACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATATCTCTTCTAAAGCTAAATATAGGCTAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTTAAACA-GCACGTGAAATTG-TTGAAAGGGAAGCGCCTATGACCAGACTTGTTTCTGG-CAGTTTCGTTAGC-C-CTCGGGCTGATTTACTCTGTCCAGTACAGGCCAGCATCAGTTTGCTGTCGGGGAGAAAGGCTCTGGGAACG [...]
+	Calonectria_morganii	CCCTAGTAACGGCGAG-TGAAGCGG-AAACAG-CTCAAATTTGAAATCT-GGCCCTC-----GGGTCCGAGTTGTAATTTGTAGAGGATGCTTTGGGTGA-GGTACCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTTGGATACCGATCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTATGACCAGACTTGGGCTTGG-TTGATCATCCTGGG--TTCTCCCTGGTGCACTCTT-CCAGTTCAGGCCAGCATCAGTTCGCTGCGGGGGATAAAAGCTTTAGGAATGTG [...]
+	Bulbithecium_hyalosporum	??????????????????????????????????????????????????????????????????????GTTGTAATTTGCAGAGGATGCTTCTGGCGA-CGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCCGGTCGCGCACCTAGCCTCTGTGAA-GC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-CTGAAAGGGAAGCGCTTATGACCAGACTTGGGCC-GG-TGAATCATCCGTCG--TTCTCGGCGGTGCACTTTG-CCGGCTCAGGCCAGCATCAGTTCGCCTCGGGGGATAAAGGCTTCGGGAA [...]
+	Bionectria_ochroleuca	CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCGCACAC--------GGAGTTGTAATTTGTAGAGGATGTTTCTGGCGA-CGCGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGCGGGTGAGAGCCCCGTACGGTTGGATGCCTAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCGTTCATGACCAGACTTGGGC-AGG-TTGATCATCCGTGG--TTCTCCGCGGTGCACTCTG-CCTGCCCAGGCCAGCATCAGTTCGCCCCGGGGGATAAAGGCTTTGGGAATGT [...]
+	Bionectria_cf._aureofulva_2	CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCGCAA-------GCCCGAGTTGTAATTTGTAGAGGATGTTTCTGGCGA-CGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGATGCCTAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCGTTCATGACCAGACTTGGGC-AGG-TTGATCAGCCGGGG--TTCTCCGCGGTGCACTCTG-CCTGCCCAGGCCAGCATCAGTTCGCCCCGGGGGATAAAGGTTTCGG [...]
+	Bionectria_cf._aureofulva_1	CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCGCAA-------GCCCGAGTTGTAATTTGTAGAGGATGTTTCTGGCGA-CGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTACGGTTGGATGCCTAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCGTTCATGACCAGACTTGGGC-AGG-TTGATCATCCGTGG--TTCTCCGCGGTGCACTCTG-CCTGCCCAGGCCAGCATCAGTTCGCCCCGGGGGATAAAGGTTTCGG [...]
+	Balansia_obtecta	CCCCAGTAACGGCGAG-TGAAGCGG--AACAG-TTCAAATTTGAAATCT-GGCCCCCTTGGGGGGCCCGAGTTGTAATTTGAAGAGGATGCTTTGGGCGA-GGCGCCTTCCGAGTTCCCT-GGAACGGGACGCCACAGAGGGTGAGAGCCCCGTCTGGTCGGACGCCGAGCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAACA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTACGACCAGACTTGGGCCCGG-CGAAT-CATCCGGCG-TTCTCGCCGGTGCACTTCGCCGGGCTCAGGCCAGCATCAGTTCGCGCCGGGGGACAAAGGCTCGGGGAATGTAGCTC [...]
+	Albosynnema_elegans	CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCCCC-----GGCCCGAGTTGTAATTTGCAGAGGATGCTTTGGGCGC-GGTGCCTTCCGAGTTCCCT-GGAACGGGACGCCACAGAGGGTGAGAGCCCCGTCTGGTCGGCCACCAAGCCTGTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATATGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTTAAACA-GCACGTGAAATTG-TTGAAAGGGAAGCGTTCATGACCAGACTTGG-CCCGG-CTGATCATCCAGCG--TTCTCGCTGGTGCACTCTG-CCGGTCCAGGCCAGCATCAGTTCGCCACGGGGGATAAAGGTTTCGGGAATGTGG [...]
+	Acremonium_alternatum	CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCTCAC-----GGTCCGAATTGTAATTTGTAGAGGATGTTTCTGGCGA-CGTGTCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCCGGTCGTACACCTAGCCTCTGTGAAA-C-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-CTGAAAGGGAAGCGCTTATGACCAGACTTGGGCTCGG-TGAATCATCCGGCG--TTCTCGCCGGTGCACTTTG-CCGTCCCAGGCCAGCATCAGTTCGCGCCGGGGGATAAAGGTTTCGGGAATGT [...]
+	Viridispora_diparietospora_2	CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCTC-----GGGTCCGAGTTGTAATTTGTAGAGGATGCTTTGGGTGC-GG-GCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTTGGACGCCAATCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTGTGACCAGACTTGGGCTTGG-TTGATCATCCAGGG--TTCTCCCCGGTGCACTCTT-CCAGTCCAGGCCAGCATCAGTTCGCCGCGGGGGACAAAAGCTTCG [...]
+	Viridispora_diparietospora_1	CCCTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCTC-----GGGTCCGAGTTGTAATTTGTAGAGGATGCTTTGGGTGC-GGGGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTTGGACGCCAATCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATCCTGCTCTAAATGGGAGGTATATGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTTAAAAA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTTGTGACCAGACTTGGGCTTGG-TTGATCATCCAGGG--TTCTCCCCGGTGCACTCTT-CCAGCCCAGGCCAGCATCAGTTCGCCGCGGGGGACAAAAGCTTCG [...]
+	Verticillium_dahliae	CCTTAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCTCCTTC--GGGGTCCGAGTTGTAATTTGTAGAGGATGCTTCGAGTTATGGTTCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGTAGGAAACCATGCTCATGTG-AAGC-TCCCTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACTCCTTCCAAGGCTAAATACCGGTTAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGAGTCAAACA-GCACGTGAAATTG-TTAAAAGGGAAGCGCTCGCTACCAGACGTGGGTTCGG-TGGTTCAACCAGGTC-CATGACCTGGGGCACTCCG-CCGGCCCAGGCCAGCATCAG-TTTCCGTCGGGGGCAAAGGCGTCGGGAATGTG [...]
+	Stanjemonium_grisellum	CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCTTGT------GCCCGAGTTGTAATTTGTAGAGGATGCTTCTGGCGA-CGCGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCCGGTCGTGCGCCTAGCCTCTGTGAA-GC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-CTGAAAGGGAAGCGCTTATGACCAGACTTGGGCGCGG-CGGATCATCCGGCG--TTCTCGCCGGTGCACTCCA-CCGCCCCAGGCCAGCATCAGCTCGCGCCGGGGGACAAAGGCTTCGGGAATG [...]
+	Stanjemonium_fuscescens	CCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCTTGT------GCCCGAGTTGTAATTTGTAGAGGATGCTTCTGGCGA-CGCGCCTTCCGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCCGGTCGTGCGCCTAGCCTCTGTGAA-GC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCTAAATGGGAGGTATACGTCTTCTAAAGCTAAATACCGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAATA-GTACGTGAAATTG-CTGAAAGGGAAGCGCTTATGACCAGACTTGGGCGCGG-CGGATCATCCGGCG--TTCTCGCCGGTGCACTCCA-CCGCCCCAGGCCAGCATCAGCTCGCGCCGGGGGACAAAGGCTTCGGGAAT [...]
+	Sphaerostilbella_berkeleyana	GCCCAGTAACGGCGAG-TGAAGCGG-CAACAG-CTCAAATTTGAAATCT-GGCCCTCGCGG----CCCGAGTTGTAATTTGTAGAGGATGCTTTTGGTGA-GGCGCCGCCTGAGTTCCCT-GGAACGGGACGCCATAGAGGGTGAGAGCCCCGTCTGGCTGGCCGCCGAGCCTCTGT-AAAGC-TCCTTCGACGAGTCGAGTAGTTTGGG-AATGCTGCTCAAAATGGGAGGTATATGTCTTCTAAAGCTAAATATTGGCCAGAGACCGATAGCGCACAAGTAGAGT-GATCGAAAGATGAAAAGCACTTTGAAAAGAGGGTTAAACA-GTACGTGAAATTG-TTGAAAGGGAAGCGCTCGTGACCAGACTTGGGCTTGG-CGAAT-CATCCAGGG-TTCTCCCTGGTGCACTTTGCCTCGTCCAGGCCAGCATCAGTTCGCCGCGGGGGATAAAGACGTCG [...]
+
+;
+end;
+begin mrbayes;
+    [ HKY model, 4 gamma categories, 1 invariant site ]
+    lset nst=2;
+    lset rates=invgamma;
+    lset ngammacat=4;
+    [ strict clock model ]
+    prset brlenspr=clock:uniform;
+    mcmcp ngen=1000000 nchains=1 printfreq=10000;
+end;
diff --git a/examples/benchmark/mrbayes/testHKY767.nex b/examples/benchmark/mrbayes/testHKY767.nex
new file mode 100644
index 0000000..73bd1f3
--- /dev/null
+++ b/examples/benchmark/mrbayes/testHKY767.nex
@@ -0,0 +1,88 @@
+#NEXUS
+begin data;
+	dimensions ntax=71 nchar=1082;
+	format datatype=dna missing=? gap=-;
+	matrix
+	Trebouxia_from_OC1_barbata	AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAA [...]
+	Trebouxia_from_LP1_barbata	AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAACT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAA [...]
+	Trebouxia_from_T3_lucida	AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAAC [...]
+	Trebouxia_from_L20a_lucida	AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAA [...]
+	Trebouxia_from_DP2_lucida	AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAA [...]
+	Trebouxia_from_SG1_lucida	AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAA [...]
+	Trebouxia_from_SG1_lupina	AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAA [...]
+	Trebouxia_from_TB2_barbata	AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAA [...]
+	Trebouxia_from_TB1_barbata	AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAA [...]
+	Trebouxia_from_CP2_rugosa	AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGACTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAA [...]
+	Trebouxia_from_CP1_rugosa	AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGCTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAA [...]
+	Trebouxia_from_ST1_barbata	AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAACTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACC-GG-TTGTGAGGGGTGGCT-TCAA [...]
+	Trebouxia_from_ST1_lucida	AAGGATCATTGAATC-TATCGTA-CCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAACTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACC-AG-TTGTGAGGGGTGGCT-TCAAA [...]
+	Trebouxia_from_EP1_lucida	AAGGATCATTGAATC-TATCGTA-CCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAACTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACC-GG-TTGTGAGGGGTGGCT-TCAAA [...]
+	Trebouxia_from_TC1_barbata	AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCcCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAA [...]
+	Trebouxia_from_B1_gracilis	AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAA [...]
+	Trebouxia_from_K148_gracilis	AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGa-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TC [...]
+	Trebouxia_from_K141_gracilis	AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TC [...]
+	Trebouxia_from_T23b_lupina	AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAA [...]
+	Trebouxia_from_T23a_lupina	AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-cTTACTTATGCCTTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAA [...]
+	Trebouxia_from_CL1_rugosa	AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAA [...]
+	Trebouxia_from_V1_rugosa	AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAAC [...]
+	Trebouxia_from_TC1_lupina	AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTtGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAA [...]
+	Trebouxia_from_ST2_lupina	AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAA [...]
+	Trebouxia_from_MV1_lupina	AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAA [...]
+	Trebouxia_from_KM2_lupina	AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAA [...]
+	Trebouxia_from_CL1_lupina	AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGTTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAA [...]
+	Trebouxia_from_SH1_lupina	AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGCTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAA [...]
+	Trebouxia_from_L22b_lupina	AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGCTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAA [...]
+	Trebouxia_from_DP1_lupina	AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGCTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAA [...]
+	Trebouxia_from_TB1_lupina	AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGCTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATC-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAA [...]
+	Trebouxia_from_T4_lupina	AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGCTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATC-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAAC [...]
+	Trebouxia_from_AP1_lupina	AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGCTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATC-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAA [...]
+	Trebouxia_from_CT3_lucida	AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGCTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATC-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAAA [...]
+	Trebouxia_from_CT2_barbata	AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGCTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATC-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAA [...]
+	Trebouxia_from_K1_gracilis	AAGGATCATTGAATC-TATCGTA-TCCACACCGCGAA-CTTACTTATGCCCTTTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATT-G-T-G-AGCAGCTCCTCTTGGGGAG-C-GTCC-TTTG---GA---TGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGGCTGGGCGGGTCCAATATCAATC-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCT-TCAA [...]
+	Trebouxia_jamesii_Z68701	AAGGATCATTGAATC-TATCGTG-CAAACACCGAGAA-CCTACTTATGCCCTCTA--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ACAAG-C-G--GCAGCTCCCTTCAAGCAG-CTG-CC-ATTG-T-GA--GTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAACATCAATT-GGGG-CCTTTCTGTCTTTTAGGCGGTGA-GG-TCT-ACC-GG-TTGTGAGGGGTGGCTTTCAA-C [...]
+	Trebouxia_jamesii_AF128270	NNNNNNNNNNNAATC-TATCGTG-TAAACACCGAGAA-CCTACTTATGCCCTCTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ACAAG-C-G--GCAGTTCCCCTTGAGGAGTCT--CC-TTTG-T-GA--GTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAATATCAATT-GGGG-CCTTTCTGCCTTTTGGGCGGTCA-GG-TCT-ACC-GG-TTGTGAGGGGTGGCTTTCAA [...]
+	Trebouxia_from_P_furfuracea	AAGGATCATTGAATC-TATCGTG-CAAACACCGAGAA-CcTACTtATGCCCTCTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ACAAG-C-G--GTAGCTCCcCTTGGGGAg-TTG-CC-TTTG-T-GA--GTGCGC--agGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAATATCAATT-GGGG-CCTGTCTGCCTTTTAGGCgGTCA-GG-TCT-ACC-GG-TTGTGAGGGGTGGCTTTCA [...]
+	Trebouxia_jamesii_Z68700	AAGGATCATTGAATC-TATCGTG-CAAACACCGAGAA-CCTACTTATGCCCTCTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ACAAG-C-G--GTACGTCCCCTTGGGGAG-TTG-CC-TTTG-T-GA--GTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAATATCAATT-GGGG-CCTGTCTGCCTTTTAGGCGGTCA-GG-TCT-ACC-GG-TTGTGAGGGGTGGCTTTCAA-C [...]
+	Trebouxia_jamesii_Z68699	AAGGATCATTGAATC-TATCGTG-CAAACACCGAGAA-CCTACTTATGCCCTCTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ACAAG-C-G--GTAGCTCCCCTTGGG-AG-TTG-CC-TTTG-T-GA--GTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAATATCAATT-GGGGTCCTGTCTGCCTTTTAGGCGGTCA-GG-TCT-ACC-GG-TTGTGAGGGGTGGCTTTCAA-C [...]
+	Trebouxia_from_IT2_vulpina	AAGGATCATTGAATC-TATCGTG-CAAACACCGTGAA-CCTACTTATGCCcTCTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ACAAG-C-G--GCAGCTCCCCTCAAGGAG-TTG-CC-TTTG-T-GA--GTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTtGACTGGGCGGGTCCAAAATCAATT-GGGG-CCTTTCTGCCTTTTGGGCGGTAA-GG-TCT-ACC-GG-TTGTGAGGGGTGGCTTTCAA [...]
+	Trebouxia_from_IT1_vulpina	AAGGATCATTGAATC-TATCGTG-CAAACACCGTGAA-CCTACTTATGCCcTCTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ACAAG-C-G--GCAGCTCCCCTCAAGGAG-TTG-CC-TTTG-T-GA--GTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTtGACTGGGCGGGTCCAAAATCAATT-GGGG-CCTTTCTGCCTTTTGGGCGGTAA-GG-TCT-ACC-GG-TTGTGAGGGGTGGCTTTCAA [...]
+	Trebouxia_from_AV3_vulpina	AAGGATCATTGAATC-TATCGTG-CAAACACCGTGAA-CCTACTTATGCCCTCTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ACAAG-C-G--GCAGCTCCCCTCAAGGAG-TTG-CC-TTTG-T-GA--GTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAAAATCAATT-GGGG-CCTTTCTGCCTTTTGGGCGGTAA-GG-TCT-ACC-GG-TTGTGAGGGGTGGCTTTCAA [...]
+	Trebouxia_from_AV2_vulpina	AAGGATCATTGAATC-TATCGTG-CAAACACCGTGAA-CCTACTTATGCCCTCTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ACAAG-C-G--GCAGCTCCCCTCAAGGAG-TTG-CC-TTTG-T-GA--GTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAAAATCAATT-GGGG-CCTTTCTGCCTTTTGGGCGGTAA-GG-TCT-ACC-GG-TTGTGAGGGGTGGCTTTCAA [...]
+	Trebouxia_jamesii_AJ249571	AAGGATCATTGAATC-TATCGTG-CAAACACCGTGAA-CTTACTTATGCCCTCTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------AT--GAT-G-GGCAGCTCCCTTCAAGGAG-TTG-CC-TTTG-T-GA--GTGCGC--AGGTCAGGGGTTGG---CTCCTTTTGG-TGTCAATTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTGAAGG-TTT-ACC-GG-TTGTGAGGGGTGGCTTTCAA [...]
+	Trebouxia_from_P_concosians	AAGGATCAtTGAATC-TATCGTG-CAAACACCGTGAA-CTTaCTTATGCCcTCTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------AT--GAT-G--GCAGCTCCCTTCAAGGAG-TTG-CC-TTTG-T-GA--GTGCGC--AGGTCAGGGGTTGG---CTCCTTTTGG-TGTCAATTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTTGCCTTTCAGGC-TTAAAGG-TTT-ACT-GG-TTGTGAGGGGTGGCTTTCA [...]
+	Trebouxia_from_P_cladonia	AAGGATCATtGAATC-TATCGTG-CAAACACCGTGAA-CttACTTATGCCcTCTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------AT--GAT-G--GCAGCTCCCTTCAAGGAG-TTG-CC-TTTG-T-GA--GTGCGC--AGGTCAGGGGTTGT---CTCCTTTTGG-TGTCAATTGACTTGGCTGGGCGGGTCCAATATCAATT-GGGA-CCTTTTCGCCTTTCAGGC-TTAAAGG-TTT-ACC-GG-TTGTGAGGGGTGGCTTTCAA- [...]
+	T_rebouxia_jamesii_AF128271	NNNNNNNNNNNAATC-TATCGTG-CACACACCGAGAA-CCTACTTATGCCCTCTC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ATCAG-C-G--GCAGCTCTTTTCAAG-AG-TTG-CC-TTTG-T-GA--GTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGATTGGGCGGGTCCAACATCAATT-GGGA-CCTTTCTGCCTGTTAGGCGGTAA-GG-TCT-GCC-GG-TTGTGAGGGGTGGCTTTCA [...]
+	T_rebouxia_galapagensis_AJ249567	AAGGATCATTGAATC-TATCGTG-CCAACACCGCGAA-CTTTCTAATGCCCTC-CTG-T---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CAT--GTTAGC-----CTTTTGAAAAAAGGCTTGACTGT--G---GCAGGTGCGT-AAGG-CAGGGGCTGGCA--TC-TTATGG-TGTCGGTTAGCCTGTCTGGGCGGGTCCAATATCAATTGGGGG-CCTCTTGGCC--ACTGG--GTAAGGGGACT-GCCCGA-TTGTGAGGGGTGGC [...]
+	Trebouxia_higgensiae_AJ249574	NNNNNNNNNNNNNNN-NNNNNNG-NCAACACCGCGNA-CTTTCTAATGCCCTC-CTG-T---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CAT--GTTAGC-----CTTTTGAAAAAAGGCTTGACTGT--G---GCAGGTGCGT-AAGG-CAGGGGCTGGCA--TC-TTATGG-TGTCGGTTAGCCTGTCTGGGCGGGTCCAATATCAATTGGGGG-CCTCTTG-CCC-ACTGG-GGTAAGGGGACTTGCCCGA-TTGTNAGGGGTGGCT-G [...]
+	Trebouxia_usneae_AJ249573	AAGGATCATTGAATC-TATCGTN-CCAACACCGNNNA-CTTACTGATGCCCTCT-TGCTA---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------AA--GACAGT-----CTTCCAACAAAAGACTTGTC--TT-G---GTAAGTGCGT--AGGTCAGGGGCCGGCA--TC-TTATGG-TGTCGGTTAGCCTGACTGGGCGGGTCCAATACCAATCCGGGG-CCCTTTA-CCTTACAAG---TGAAGGGACT-GCCTGGGTTGTGAGGGGTGGCT-GTTT- [...]
+	Trebouxia_corticola	AAGGATCATTGAATC-TATCGTG-CCAACACCGCNAA-CTTACTGATGCCCTCT-TGCTA---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------AA--GACAGT-----CTTCCAACAAAAGACTTGTC--TT-G---GTAAGTGCGT--AGGTCAGGGGCCGGCA--TC-TTATGG-TGTCGGTTAGCCTGACTGGGCGGGTCCAATACCAATCCGGGG-CCCTTTA-CCTTACAGG---TGAAGGGACT-GCCTGGGTTGTGAGGGGTGGCT-GTTT--AA--C [...]
+	Trebouxia_usneae_Z68702	AAGGATCATTGAATC-TATCGTG-CCAACACCGCGAA-CTTACTTATGCCCTC-CTGTTA--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------TAG--G-CATG-----CT-----CAAAAGGC--GT--GCC-TA-GATGGGTGCGT-AASS-CAGGGGCAGGCA--TC-TTATGG-TGTCAGTTAGCCTGGCTGGGCGGGTCCAACACCAATC-GGGG-CCTTTTG-CCTTTCAGG---CAAAGGGACTCGCTCGG-TTGTGAGGGGTGGCT-GTTT--A [...]
+	Trebouxia_impressa_AJ249570	AAGGATCATTGAATC-TATCGTG-CCCACACCGTGAA-CC-ATTTATGCCCTTTCTG-AA---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------AG--G-CAG------CTCTTGA-AAGGG-A--GTTTGCC-GATTGAAA--GCGC--AGGTCAGGGGCCG-CAGCTC--TTTGGCTGTCGGTTGACTTGACTGGGCGGGTCCAATACCAGTT-GGGTTCCTCT-TGCCTT---GGC-TTG-AGGTTC---CT-GG-CTGTGAGGGGTGGCTTG-- [...]
+	Trebouxia_impressa_AJ249576	AAGGATCATTGAATC-TATCGTG-CCCACACCGTGAA-CC-ATTTATGCCCTTTCTG-AA---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------AG--G-CAG------CTCTTGA-AAGGG-A--GTTTGCC-GATTGAAA--GCGC--AGGTCAGGGGCCG-CARCTC--TTTGGCTGTCGGTTGACTTGACTGGGCGGGTCCAATACCAGTT-GGGTTCCTCT-TGCCTT---GGC-TTG-AGGTTC---CT-GG-CTGTGAGGGGTGGCTTG-- [...]
+	Trebouxia_flava	AAGGATCATTGAATC-TATCGTG-CCCACACCGTGAA-CC-ATTGATGCCCTTTCTG-AA---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------AG--G-CAG------CTCCTGA-AAGGG-A--GTTTGCT-GATTGAAA--GCGC--AGGTCAGGGGCCG-CAGCTC--TTTGGCTGTCGGTTGACTTGGCTGGGCGGGTCCAATACCAGTT-GGGTTCCTCT-TGCCTT---GGC-TTG-aGGTTC---CT-GG-CTGTGAGGGGTGGCTTG-----AAA-AAC-- [...]
+	Trebouxia_potteri	AAGGATCATTGAATC-TATCGTG-cCCACACCGTGAA-Cc-AttTATGCCCTTTCTG-AA---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------AG--G-CAG------CTCCTGA-AAGGG-A--GTTTGCC-GATTGAAA--GCGC--AGGTCAGGGGCTG-CAGCTC--TTTGGCTGTCAGTTGACTTGGCTGGGCGGGTCCAATACCAGTT-GGGTTCCTCT-TGCCTT---GGC-TTG-AGGTTC---CT-GG-CTGTGAGGGGTGGCTTG-----AAA-CAC [...]
+	Trebouxia_from_U_arizonica	AAGGATCATTGAATC-TATcGTG-CCCACACCGTGAA-CC-ATTTATGCCCTCTCTG-AA---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------AG--G-CAA------TTGCTGA-AAGGC-A--A-TTGCC-GAGTGAGA--GCGC--AGGTCAGGGGCTG-CAGCTC--TTTGGCTGTCAGTTGACTTGGCTGGGCGGGTCCGATACCAGTT-GGGTTCCTCT-TGCCTTT--GGC-TTG-AGGTTG---CC-AG-CTGTGAGGGGTGGCTTG--- [...]
+	Trebouxia_gelatinosa_Z68698	AAGGATCATTGAATC-TATCGTA-CCAACACCGCGAA-CC-ATTGATGTCCTCTC---AATTTACCCAGCAGGGTGCCGCGATACGTGCCGCT-----------------------------------------------------------------------------------------------------------TAATGGCATTGCCCATAAAGGGGTCCACGATACGTGCTGCAGCATTGCCTATAAAGGGGCCCGCGATACGTGCCT-----G--GACATT-G-AG-T-TT-A-AAGGGTA--AACTGCT-GGT-GAGA--GCGC--AGGTCAGGGGCTG-CAGCTC--TTTGGCTGT-AGTTGACTTGGCTGGGCGGGTCCAATACCAATT-GGGTTCCTCTCCTGTTTC--GGTTA-G-AGGTT---ACTCAG-CTGTGAGGGGTGACTTG-- [...]
+	Trebouxia_gelatinosa_Z68697	AAGGATCATTGAATCGTATCGTATCCCACACCGCGAA-CC-ATTGATGTCCTCTC---AATTTACCCAGCAGGGTGCCGCGATACGTGCTGTT------------------------------------------------------------------------------------------------------------AATGGCATTGCCTAAAAAGGGGTCCACGATACGTGCTACGGCATTGAGTTTAAAGGGGCCCGCGATACGTGCCT----AG--G-CATT-G-AG-T-TT-A-AAGGGTA--ACCTGCT-GGT-GAGA--GCGC--AGGTCAGGGGCTG-CAGCTC--TTTGGCTGT-AGTTGACTTGGCTGGGCGGGTCCAATACCAATT-GGGTTCCTCTTCGCCTTT--GGCTAAG-AGGCT---ACTCAG-CTGTGAGGGGTGACTTG-- [...]
+	Trebouxia_gelatinosa_AJ249575	AAGGATCATTGAATC-TATCGTN-CCCACACCGCGAA-CC-ATTTATGTCCTCTC---AATTTACCCAGCAGGGTGCCGCGATACGTGCTGTT-------------------------------------ACTGCATTGCCCATAAAGGGGTCCAATTTACCC----------AGC--AGGGTGCC-GCGATACGTGCTGTTACTGCATTGCCCATAAAGGGGTCCACGATACGTGCTGTAGCATTGTCCATAAAGGGGCCCGCGATACGTGCCT----AG--G-CATT-G-AG-T-TT-A-AANNTTA--AACTGCT-GGT-GAGA--GCGC--AGGTCAGGGGCTG-CAGCTC--TTTGGCTGT-AGTTGACTTGGCTGGGCGGGTCCAATACCAGTG-GGGTTCCTCTTTGCTTTT--GGCTTAG-AGGTT---ACTCAG-CTGTGAGGGGTGACTTG [...]
+	Trebouxia_gelatinosa_AJ249568	AAGGATCATTGAATC-TATCGTA-CCCACACCGCGAA-CC-ATTAATGTCCTCTCTGGAATTTACCCAGCAGGGTGCCGCGATACGTGCTGTTGATAATTTACCCAGCAGGGCCGCGATACGTGCTGTTGATGGCATTGCCCAAAAAGGGGTCCACGATACGTGCTGTAGCATTGCGAAAGGGGCCCACGATACGTGCT---TCGGCATTGCCTAAAAAGGGGTCCACGATACGTGCTACAGCATTGAGTTTAAAGGGGCCCGCGATACGTGCCTGAAGAG--G-C-GT---TT-TACT---AAGGGTA--AACTGCT-GGT-GAGA--GCGC--AGGTCAGGGACTG-CAGCTC--TTTGGCTGT-AGTTGACTTGGCTGGGCGGGTCCAATACCAATT-GGGTTCCTCTTTGCCTTT--GGCTGAG-AGGCT---ACTCAG-CTGTGAGGGGTGACTTG [...]
+	Trebouxia_gigantea	aAGGATCATTGAATC-TATCGTG-CCCACACTGCGAAAAT-ACTTATGCCCTT-CTGGAG--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------TAG--G-CAG----A-CTTT----------ATTGTTTGCT-CTTCG-G-TTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTtGACTGGGCGGGTCCAATACCAGCC-GGACTCACCT-TGCCTTCTAGGC-TTG-GGGTTCT-GCC-GG-TTGTGAGGGGTGGCT-GTTT--AACCCA [...]
+	Trebouxia_gigantea_AJ249577	NNNNNNNNNNNNNNNNNNNNNNN-NCCACACTGCGAAA-T-ACTTATGCCCTT-CTGGAG--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------TAG--G-CAG----A-CTTT----------ATTGTTTGCT-CTTCG-G-TTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAATACCAGCC-GGACTCACCT-TGCCTTCTAGGC-TTG-GGGTTCT-GCC-GG-TTGTGAGGGGTGGCT-GTT [...]
+	Trebouxia_showmanii	AAGGATCATTGAATC-TATCGTG-CCCACACCGCGAAAAT-ACTTATGCCCTT-CTGGAA--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CAA--G-CAA----A-CTCA----------ACAGTTTGTT-CTTC-AG-TTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAATACCAGTC-GGATTCACCT-TGCCTTATAGGC-TAG-GGGTTCT-GCC-GG-CTGTGAGGGGTGGCT-GCTC--AACTC [...]
+	Trebouxia_asymmetrica_AJ249581	AAGGATCATTGAATC-TATCGTG-CCCACACCGCGAAACT-ACTTATGCCCTT-CTGGAA--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CCG--G-CAA----A-CTTT----------ATTGTTTGCC-CTTC-AG-TTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAACACCAGCC-GGACTCACCT-TGCCTTTTGGGC-TTG-GGGTTCT-GCC-GG-CTGTGAGGGGTGGCT- [...]
+	Trebouxia_sp_AJ249572	AAGGATCATTGAATC-TATCGTG-CCCACACCGCGAA-CTTACTTATGCCCTT-CTGGAA--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------CAG--G-CAG----A-CTTT----------GTTGTTTGCC-CTTC-AG-TTGCGT--AGGTCAGGGGTTGG---CTCCTTTTGG-TGTCAGTTCACTTGACTGGGCGGGTCCAACACCAGCC-GGATTCACCT-TGCCTTCTAGGC-TTG-GGGTTCT-GCC-GG-CTGTGAGGGGTGGCT-GTTT--AAC [...]
+	Trebouxia_arboricola_AJ249564	AAGGATCATTGAATC-TATCGTG-CCCACACCGCGAAAAT-ACTTATGCCCTT-CTGGGG-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------TCAG----CAA--G---CTTT----------ACTGCTTGCT-CTTC-AG-TTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAACACCAGCC-GGATTCACCT-TGTCT-CT-GGC-AAG-GGGTTCT-GCC-GA-CTGTGAGGGGTGGCT-G [...]
+	Trebouxia_arboricola_AJ249481	AAGGATCATTGAATC-TATCGTG-CCCACACCGCGAAAAT-ACTTATGCCCTT-CTGGGG-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------TCAG----CAA--G---CTTT----------ACTGTTTGCT-CTTC-AG-TTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAACACCAGCC-GGATTCACCT-TGTCT--TGGGC-AAG-GGGTTCT-GCC-GG-CTGTGAGGGGTGGCT-G [...]
+	Trebouxia_arboricola_Z68703	AAGGATCATTGAATC-TATCGTG-CCCACACCGCGAAAAT-ACTTATGCCCTT-CTGGGG-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------TCAG----CAA--G---CTTT----------ACTGTTTGCT-CTTC-AG-TTGCGC--AGGTCAGGGGCTGG---CTCCTTTTGG-TGTCAGTTGACTTGACTGGGCGGGTCCAACACCAGCC-GGATTCACCT-TGTCT-CT-GGC-AAG-GGGTTCT-GCC-GG-CTGTGAGGGGTGGCT-GTT [...]
+
+;
+end;
+begin mrbayes;
+    [ HKY model, 4 gamma categories, 1 invariant site ]
+    lset nst=2;
+    lset rates=invgamma;
+    lset ngammacat=4;
+    [ strict clock model ]
+    prset brlenspr=clock:uniform;
+    mcmcp ngen=1000000 nchains=1 printfreq=10000;
+end;
diff --git a/examples/bitflip.xml b/examples/bitflip.xml
new file mode 100644
index 0000000..7bcfc41
--- /dev/null
+++ b/examples/bitflip.xml
@@ -0,0 +1,22 @@
+<beast version='2.0'
+       namespace='beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.branchratemodel:beast.evolution.likelihood:beast.core.parameter'>
+
+    <parameter spec='BooleanParameter' name='indicators' id='indicators' dimension="5" value="false"/>
+
+    <run spec="MCMC" id="mcmc" chainLength="100000"> <!--autoOptimize="true"-->
+        <state>
+            <input name='stateNode' idref='indicators'/>
+        </state>
+	
+	<distribution spec="CompoundDistribution" id="posterior"/>
+
+        <operator id="bitflip" spec="BitFlipOperator" weight="1">
+            <input name="parameter" idref="indicators"/>
+        </operator>
+
+        <logger logEvery="10" fileName="bitflip.log">
+            <log idref="indicators"/>
+        </logger>
+    </run>
+
+</beast>
diff --git a/examples/nexus/26.nex b/examples/nexus/26.nex
new file mode 100644
index 0000000..37e42f6
--- /dev/null
+++ b/examples/nexus/26.nex
@@ -0,0 +1,63 @@
+#NEXUS
+[TBO26oLong]
+BEGIN DATA;
+	DIMENSIONS  NTAX =26 NCHAR=614;
+	FORMAT DATATYPE = DNA GAP = - MISSING = ?;
+	MATRIX	
+	Orthogeomys_heterodus   		ATTCTAGGCAAAAAG-AGCAATGCTGGAGGTATTACAATACCAGACTTCAAACTTTACTATAGAGCCATAATAACAAAAACCGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAATGGAAYAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGTCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCACCATGCACAGGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCAGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGGGAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATAGGAGAAAGACTCAATAAATGGGACTA [...]
+
+	Thomomys_bottae_awahnee_a 		????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACMCAGTCTATTCAATTATTGGKGCTGGCAAAACTGGGCAGCCMCATGCARAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAA?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+
+	Thomomys_bottae_awahnee_b  		????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCM-CAACAGATTGGAGAGAGACTCGATAAATGGGA [...]
+
+	Thomomys_bottae_xerophilus  		????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAAYTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAA???????????????????????????????????????????????? [...]
+
+	Thomomys_bottae_cactophilus  		????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAAYGTCAGACCGGAAACCGTGAAAYTGTTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAA?????????????????????????????????????????????????????????? [...]
+
+	Thomomys_bottae_albatus  		????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGATCCAGAAATAGAACCAC-ATACCTATAGTCAACTTGTATTTGATAAAGGAGCTAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCATTTCACCATGCACAAGAATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCT-------------------------------------CATAGGCACTCATAGGCACAGGCAAAAGATTCCTATACAGGAACCCAGGGTCAACAACAGATTGGAGAGAGACTCAATAAATGGGACT [...]
+
+	Thomomys_bottae_ruidosae  		????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCARAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAAYTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAG??????????????????????????????????????????????????????????? [...]
+
+	Thomomys_bottae_bottae  		????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAAATTCCTGAACAGAATCCCAGGGTCA-CAACAGATKGGAGAGAGACTCGATAAATGGGACTA [...]
+
+	Thomomys_bottae_alpinus  		????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCTATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCA???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+
+	Thomomys_bottae_riparius  		????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGAC [...]
+
+	Thomomys_bottae_mewa  			????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCATTTCACCATGCACAAGAATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAA??????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+
+	Thomomys_bottae_saxatilis  		????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAA????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+
+	Thomomys_bottae_laticeps  		????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAATTGCTACATGATAAWGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCAATAAATGGGAC [...]
+
+	Thomomys_talpoides_ocius   		???CTAGGCAAAA-G-AGC-ATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATMCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCRACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGA [...]
+
+	Thomomys_idahoensis_pygmaeus_a   	????????CAAAA-G-AGCAATGCTGGTGGTATYACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATMCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCRACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAA [...]
+
+	Thomomys_idahoensis_pygmaeus_b   	????GGCGCAAAA-G-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATMCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAA [...]
+
+	Thomomys_mazama_mazama   		ATTCTAGGCAAAAAGAAGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAAYTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACT [...]
+
+	Thomomys_mazama_nasicus   		ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCSCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAAYTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGAC [...]
+
+	Thomomys_monticola_a   			??????????????G-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGYCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTA [...]
+
+	Thomomys_monticola_b   			ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATYACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAWATAGAACCAC-ACAACTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAATGGAACRAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTA [...]
+
+	Thomomys_talpoides_yakimensis   	ATTCTAGGCAAAA-G-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTKTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAAYGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAAYTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAAT [...]
+
+	Thomomys_talpoides_bridgeri   		ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATCCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCRACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATG [...]
+
+	Thomomys_townsendii_townsendii   	ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTYGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAA [...]
+
+	Thomomys_townsendii_relictus   		??????????????G-AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTAYTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCACTATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAATGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAATTGCTACATGATAAWGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAAT [...]
+
+	Thomomys_umbrinus_chihuahuae   		?????????????AG-AGC-ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCTTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAAT [...]
+
+	Thomomys_umbrinus_atroavarius   	ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGCATTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGKCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGYCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAAYGTCAGACCGGAAACCGTGAAATTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAAT [...]
+
+
+;
+
+
+END;
diff --git a/examples/nexus/29.nex b/examples/nexus/29.nex
new file mode 100644
index 0000000..59bedd1
--- /dev/null
+++ b/examples/nexus/29.nex
@@ -0,0 +1,64 @@
+#NEXUS
+
+BEGIN DATA;
+	DIMENSIONS  NTAX =26 NCHAR=601;
+	FORMAT DATATYPE = DNA GAP = - MISSING = ?;
+	MATRIX	
+	Orthogeomys_heterodus   C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCACAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCGTTTCTGGAAAACTGAGATCTTGTTTTGACCAACAGAAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTACTGGTGATGTCTCTGTCAGGATCTAGTCCCATCCTG-AATCCATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTCAGAACTGACTGAATCAGGCCAGTGAAAGTTA-CAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATTGTGCATGGCTTCATTAGCAGGTTTACTGTGCTGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTT [...]
+
+	Thomomys_bottae_awahnee_a C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTG [...]
+
+	Thomomys_bottae_awahnee_b  C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTT [...]
+
+	Thomomys_bottae_xerophilus  C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCACTAAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTRTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGT [...]
+
+	Thomomys_bottae_cactophilus  C-AGCTTGCTG-TCACACTACCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCACTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAG [...]
+
+	Thomomys_bottae_albatus  C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGT [...]
+
+	Thomomys_bottae_ruidosae  ?????????????????????????????C-AGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTG [...]
+
+	Thomomys_bottae_bottae  C-AGCTTGCTG-TCACACYGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTAKGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTT [...]
+
+	Thomomys_bottae_alpinus  C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCC-AGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGTTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCYACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGT [...]
+
+	Thomomys_bottae_riparius  C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTG [...]
+
+	Thomomys_bottae_mewa  C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTAA [...]
+
+	Thomomys_bottae_saxatilis  C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTT [...]
+
+	Thomomys_bottae_laticeps  C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTG [...]
+
+	Thomomys_talpoides_ocius   C-AGCTTGCTGGTCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCATATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAAWGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTT [...]
+
+	Thomomys_idahoensis_pygmaeus_a   C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTTTAAGTGTTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGTCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGTCCAGTGAAACTTAACAGCTACCTTGCCAATKGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGG--TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAAT [...]
+
+	Thomomys_idahoensis_pygmaeus_b   CAAGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTGTTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGTCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGG--TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAAT [...]
+
+	Thomomys_mazama_mazama   C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTATTGCCTGGATATAGTGTCTATAGACAGAGACAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCACATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCACCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCTGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGT [...]
+
+	Thomomys_mazama_nasicus   C-AGCTTGCTG-TCACAATGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTATTGCCTGGATATAGTGTCTATAGACAGAGACAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCACATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCTGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTG [...]
+
+	Thomomys_monticola_a   C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGACGCCKTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTA [...]
+
+	Thomomys_monticola_b   C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGACGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTYCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTAGTTGTTA [...]
+
+	Thomomys_talpoides_yakimensis   C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGAMTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATC [...]
+
+	Thomomys_talpoides_bridgeri   C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCTA [...]
+
+	Thomomys_townsendii_townsendii   C-AGCTTGCTGGTCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAAT [...]
+
+	Thomomys_townsendii_relictus   C-AGCTTGCTGGTCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCT [...]
+
+	Thomomys_umbrinus_chihuahuae   C-AGCTTGCTGGTCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAAGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTGGAATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATCT [...]
+
+	Thomomys_umbrinus_atroavarius   C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAATGCTAATC [...]
+
+
+;
+
+
+END;
+
diff --git a/examples/nexus/47.nex b/examples/nexus/47.nex
new file mode 100644
index 0000000..342ad47
--- /dev/null
+++ b/examples/nexus/47.nex
@@ -0,0 +1,67 @@
+#NEXUS
+[written Sat Jun 17 23:07:43 PDT 2006 by Mesquite  version 1.1 (build h61) at museum-6f80213f/136.152.194.25]
+
+BEGIN DATA;
+	DIMENSIONS  NTAX=26 NCHAR=819;
+	FORMAT DATATYPE = DNA GAP = - MISSING = ?;
+	MATRIX
+	Orthogeomys_heterodus   CATGATTTTGTCATGCCTTCTTAC-TGCTTATCTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGATGATTGACGCTGCTGTCAGTAGTGAGTGACACAAATTTTATTTAGTTTGGGTGTGTGCCTACCAGTATAATTGCTGGACCACGTGTAGGTCTGTATTAATCTTCTGAAGAACGGTTAGGCCATCTGTGAATTGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCACGATTTCTTTTCCA-CC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+
+	Thomomys_bottae_awahnee_a CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACARAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCYTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCAACC------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+
+	Thomomys_bottae_awahnee_b  CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACASAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCYTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCAMCC------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ [...]
+
+	Thomomys_bottae_xerophilus  CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACAGAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCACCC----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+
+	Thomomys_bottae_cactophilus  CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACAGAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTRTGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCACCC---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+
+	Thomomys_bottae_albatus  CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACAGAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTGTGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCACCC-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+
+	Thomomys_bottae_ruidosae  CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTYGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACASAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCACCC------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+
+	Thomomys_bottae_bottae  CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTYGTTTTCACCTGTGTGTTGATTGACGCTACTGTCAGTAGTGGGTGACAGAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCYGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCAMCC--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+
+	Thomomys_bottae_alpinus  CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACAGAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCYGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCAMCC-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+
+	Thomomys_bottae_riparius  CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACAGAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTRTGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCACCC------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+
+	Thomomys_bottae_mewa  CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACAGAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCAACC----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+
+	Thomomys_bottae_saxatilis  CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACAGAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCAACC------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ [...]
+
+	Thomomys_bottae_laticeps  CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACASAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCYTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCAACC------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+
+	Thomomys_talpoides_ocius   CATGATTTTTTCATGCTTTCTTAC-TGCTTATCTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACACTATTGTCAGTAGTGGGTGACACAAATTTCATTTAATTTGGGTGTGTGCCTACCAGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAACGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCATGATATCTTTTCCAACCCTAGATTTTTTTTT--------------------------------GCACTGTCCTTGGACTTTCTCAAGGCTAGAGCTCTACCACTTGAGCCTCAGCATCACTTCTGGCTTTTTTTTTC-TATGTATGTGGTATCAAGGAATCGAACCCGGGTCTTCGTGCATGCTAGGCAAGCACTCTACCACTAGGCCAAACTCCCAGCCC [...]
+
+	Thomomys_idahoensis_pygmaeus_a   ???????TTTTCATGCTTTCTTAC-TGCTTATCTGCTTGTGGGCTTTGGGTTGTTTTTACCTGTGGGTTGATTGACACTACTGTCAGTAGTGGGTGACACAAATTTCATTTAATTTGGGTGTGTGCCTACCAGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAACGGTTCGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCACGATATCTTTTCCAACCCTAGATTTTTTTTTTT---------------------------T--GCACTGTCCTTGGACTTTCTCAAGGCTAGAGCTCTACCACTTGAGCCTCAGCATCACTTCTGGCTTTTTTTTTTCTATGTATGTGGTATCAAGGAATCGAACCCGGGTCTTCGTGCATGCTAGGCAAGCACTCTACCACTAGGCCAAACTCC [...]
+
+	Thomomys_idahoensis_pygmaeus_b   ?ATGATTTTTTCATGCTTTCTTAC-TGCTTATCTGCTTGTGGGCTTTGGGTTGTTTTTACCTGTGGGTTGATTGACACTACTGTCAGTAGTGGGTGACACAAATTTCATTTAATTTGGGTGTGTGCCTACTAGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAACGGTTAGGCCATCTGTGAAATGCTATACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCACGATATCTTTTCCAACCCTAGATGTTTTTTTT-G------------------------------CACTGTCCTTGGACTTTCTCAAGGCTAGAGCTCTACCACTTGAGCCTCAGCACCACTTCTGGCTTTTTTTTTTCTACGTATGTGGTATCAAGGAATCGAACCCGGGTCTTCGTGCATGCTAGGCAAGCACTCTACCACTAGGCCAAACTCC [...]
+
+	Thomomys_mazama_mazama   ??????????????????????A---GCTTATATGCTTGTGTGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACACTACTGCCAGTAGTGGGTGACACAAATTTCATTTAATTTGGGTGTGTGCCTACCAGTATAATTGCTGGACCACATATAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCACGATATCTTTTCCAACCCTAGATTTTTTTTTTT------------------------------------------------------------------------------------------------------TTCTATGTATGTGGTACCAAGGAATCGAACCCGGGTCTTTGTGCATGCTATGCAAGCACTTTACCACTAGGCCAAACTCCCAGCCCCA [...]
+
+	Thomomys_mazama_nasicus   ??????????????GCTTTCTTACGTGCTTATATGCTTGTGTGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACACTACTGCCAGTAGTGGGTGACACAAATTTCATTTAATTTGGGTGTGTGCCTACCAGTATAATTGCTGGACCACATATAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCATGATATCTTTTCCAACCCTAGATTTTTTTTTTTGCCAGTCCTGGGCTTGAGCTCAGGGCCTGAGCACTGTCCTTGGACTTTCTCAAGGCTAGAGCTCTACCACTTGAGCTTCAGCATCACTTCTGGCTTTTTTTTTTCTATGTATGTGGTACCAAGGAATCGAACCCGGGTCTTTGTGCATGCTATGCAGGCACTCTACCACTAGGCCAAACTCCCAGCCCC [...]
+
+	Thomomys_monticola_a   CATGATTTTTTCATGCTTTCTTAC-TGCTTATCTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACACTACTGTCAGTAGTGGGTGACACAAATTTCATTTAATTTGAGTGTGTGCCTACCAGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAACGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCACGATATCTTTTCCAACCCTAGATTTTTTTTTTTGCCAGTCCTGGGCTTGAGCTCAGGGCCTGAACACTGTCCTTGGACTTTCTCAAGGCTAGAGCTCTACCACTTGAGCCTCAGCATCACTTCTGGCTTTTTTT-TTCTATGTATGTGGTACCAAGGAATCGAACCCGGGTCTTCGTGCATGCTAGGCAAGCACTCTACCACTAGCCCAAACTCCCAGCCCCAAC [...]
+
+	Thomomys_monticola_b   CATGATTTTTTCATGCTTTCTTAC-TGCTTATCTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACACTACTGTCAGTAGTGGGTGACACAAATTTCATTTAATTTGAGTGTGTGCCTACCAGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAAYGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCACGATATCTTTTCCAACCCTAGATTTTTTTTT--GCCAGTCCTGGGCTTSAGCTCAGGGCCTGAACACTGTCCTTGGACTTTCTCAAGGCTAGAGCTKTACCACTTGAGCCTCAGCATCACTTCTGGCTTTTTTTTTTCTATGTATGTGGTACCAAGGAATCGAACCCGGGTCTTCGTGCATGCTAGGCAAGCACTCTACCACTAGCCCAAACTCCCAGCCCCAAC [...]
+
+	Thomomys_talpoides_yakimensis   ?????????????????TTCTTAC-TGCTTATCTGCTTGTGGGCTTTGGGCTGTTTTCACCTGTGGGTTGATTGACACTACTGTCAGTAGTGGGTGACACAAATTTCATTTAATTTGGTTGTGTGCCTACCAGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAACGGTTAGGCCATCTGTGAAGTGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCACGATATCTTTTCCAACCCTAGATTTTTTTTTTT---------------------------TTTGCACTGTCCTTGGACTTTCTCAAGGCTAGAGCTCTACCACTTGAGCCTCAGCATCACTTCTGGCTTTTTTTTTTCTATGTATGTGGTATCAAGGAATCGAACCCGGGTCTTCGTGCATGCTAGGCAAGCACTCTACCAGTAGGCCAAACTCCC [...]
+
+	Thomomys_talpoides_bridgeri   CATGATTTTTTCATGCTTTCTTAC-TGCTTATCTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACACTACTGTCAGTAGTGGGTGACACAAATTTCATTTAATTTGGTTGTGTGCCTACCAGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAACGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCACGATATCTTTTCCAACCCTAGATTTTTTTTTTT------------------------------GCACTGTCCTTGGACTTTCTCAAGGCTAGAGCTCTACCACTTGAGCCTCAGCATCACTTCTGGCTTTTTTT-TTCTATGTATGTGGTATCAAGGAATCGAACCCGGGTCTTCGTGCATGCTCGGCAAGCACTCTACCACTAGGCCAAACTCCCAG [...]
+
+	Thomomys_townsendii_townsendii   CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACACAAATTTCATTTAGTTTGGGTGTGTGCCTACCAGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCCTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCAACC------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ [...]
+
+	Thomomys_townsendii_relictus   CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACAGAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTATGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCACCC-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+
+	Thomomys_umbrinus_chihuahuae   CATGATTTTGTCATGCTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTTGATTGACGCTACTGTCAGTAGTGGGTGACAGAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTGTGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCACCC-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+
+	Thomomys_umbrinus_atroavarius   CATGATTTTGTCATGYTTTCTTAC-TGCTTATTTGCTTGTGGGCTTTGGGTTGTTTTCACCTGTGGGTYGATTGACGCTACTGTCAGTAGTGGGTGACAGAAATTTCATTTAGTTTGGGTGTGTGCCTACCGGTATAATTGCTGGACCACATGTAGGTCTGTATTAATCTTCTGAAGAATGGTTAGGCCATCTGTGAAATGCTGTACTTCTTTRTGTTCCCGCCATTCTGAGTTCTGATTTCATGATACCTTTTCCACCC------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
+
+
+;
+
+
+
+
+end;
+
diff --git a/examples/nexus/53.nex b/examples/nexus/53.nex
new file mode 100644
index 0000000..0828f05
--- /dev/null
+++ b/examples/nexus/53.nex
@@ -0,0 +1,63 @@
+#NEXUS
+
+BEGIN DATA;
+	DIMENSIONS  NTAX =26 NCHAR=621;
+	FORMAT DATATYPE = DNa GAP = - MISSING = ?;
+	MATRIX
+	Orthogeomys_heterodus   		?????????????????????????????AAAAAACCAAAAACCAAAACC-TAAACAAAACCCTGGCATTTGAGTTCTAAGGGTT-TCTAAGAGAACTCAGACACAAGGGAAAAAAATGG-CTGTTTGAAAATGGGCTGCTACCCCTAGTAGGTAGGTACTACCTACTGCCTCAAGGTTTCTAA-TGGTTAATTGAAATACAAATAAAAATTAACCGTAAAATGCTAGGGGAAAGGTCATTAAAAAGGTTT-GGGAAAAA--CATCAGGAATTAGTTCCTGGAAATAGAATTTGGAAGTAAAAATTGCCCTAAATGTTTATTTCAAAGTAGAGAAAGGACTACCAAAATGATTGTTTAATTGCTATTCCAGTTTGTCTGTAGCAATTACAGGCAGGCCCACAGAGAGACAGATGATTCTTATAAGTTTGTCAGATATAACTTTGTCCCTTAATAAGCTCCATGCT [...]
+
+	Thomomys_bottae_awahnee_a 		CCCCAGGACTGGAAAAAAAAA-TTAAAGTT-------AAAAACCAAAACC-AAAACAAAACCCTGTCATTTGATTTCTAAGGGTT-TCTAAGAGAACTCAGACTCAAGGGAAAAAA-TGG-CTGATTTAAAATGGGCCGC-----CTTG-AGGCAC-TAGTACCTAGTGCTTCAAGGTTTCTAA-TGGTTAATTGAAATACAAATGAAAATTAAATGTAAAATGCTAGGGGAAAGGTTATTAAAAAGGTTTTGGGGAAAA-CCATCAGGAATTGGTTCCTGGAAATAGAATTTGGAAGTAAAAATTGCCCTAAATGTTTATTTCAAAGTAGAGAAAGGACTACCAAAATGATTGCTTAATTGCTATTCCAGTTTGTCTGTAGCAATTACAGGCAGGCCCACAGAGGGACAGATGATTCTTATAAGTTTGTCAGATGTTACTTTGTCCCTTAATAAGCTCCATG [...]
+
+	Thomomys_bottae_awahnee_b  		CCCCAGGACTGGAAAAAAAAA-TTAAAGTT-------AAAAACCAAAACC-AAAACAAAACCCTGTCATTTGATTTCTAAGGGTT-TCTAAGAGAACTCAGACTCAAGGGAAAAAA-TGG-CTGATTTAAAATGGGCCGC-----CTTG-AGGCAC-TAGTACCTAGTGCTTCAAGGTTTCTAA-TGGTTAATTGAAATACAAATGAAAATTAAATGTAAAATGCTAGGGGAAAGGTTATTAAAAAGGTTTTGGGGAAAA-CCATCAGGAATTGGTTCCTGGAAATAGAATTTGGAAGTAAAAATTGCCCTAAATGTTTATTTCAAAGTAGAGAAAGGACTACCAAAATGATTGCTTAATTGCTATTCCAGTTTGTCTGTAGCAATTACAGGCAGGCCCACAGAGGGACAGATGATTCTTATAAGTTTGTCAGATGTTACTTTGTCCCTTAATAAGCTCCAT [...]
+
+	Thomomys_bottae_xerophilus  		CCCCAGGACTGGAAAAAAAAAATTAAAGTT-------AAAAACCAAAACC-AAAACAAAACCCTGTCATTTGATTTCTAAGGGTT-TCTAAGAGAACTCAGACTCAAGGGAAAAAAATGG-CTGTTTTAAAATGGGCCGC-----CTTG-AGGCAC-TAGTACCTAGTGCTTCAAGGTTTCTTA-TGGTTAACTGAAATACAAATGAAAATTAAACGTAAAATGCTAGGGGAAAGGTTATTAAAAAGGTTTTGGGGGAAA-CCATCAGGAATTGGTTCCTGGAAATAGAATTTGGAAGTAAAAATTGCCCTAAATGTTTATTTCAAAGTAGAGAAAGGACTACCAAAATGATTGCTTAATTGCTATTCCAGTTTGTCTGTAGCAATTACAGGCAGGCCCACAGAGGGACAGATGATTCTTATAAGTTTGTCAGATGTTACTTTGTCCCTTAATAAGCTCCA [...]
+
+	Thomomys_bottae_cactophilus  		CCCCAGGCCKGGAAAAAAAAA-TTAAAGTT-------AAAAACCAAAACC-AAAACAAAACCCTGTCATTTGATTTCTAAGGGTT-TCTAAGAGAACTCAGACTCAAGGGAAAAAAATGG-CTGTTTTAAAATGGGCCGC-----CTTG-AGGCAC-TAGTACCTAGTGCTTCAAGGTTTCTTA-TGGTTAACTGAAATACAAATGAAAATTAAACGTAAAATGCTAGGGGAAAGGTTATTAAAAAGGTTTTGGGGGAAA-CCATCAGGAATTGGTTCCTGGAAATAGAATTTGGAAGTAAAAATTGCCCTAAATGTTTATTTCAAAGTAGAGAAAGGACTACCAAAATGATTGCTTAATTGCTATTCCAGTTTGTCTGTAGCAATTACAGGCAGGCCCACAGAGGGACAGATGATTCTTATAAGTTTGTCAGATGTTACTTTGTCCCTTAATAAGCTCC [...]
+
+	Thomomys_bottae_albatus  		CCCTAGGACTGGAAAAAAAA--TTAAAGTTAAAAACCAAAAACCAAAACA-AAAACAAAACCCTGTCATTTGATTTCTAAGGGTT-TCTAAGAGAACTCAGACTCAAGGGAAAAAA-TGG-CTGTTTTAAAATGGGCTGC-----CTTG-AGGCAC-TAGTACCTAGTGCTTCAAGGTTTCTTA-TGGTTAACTGAAATACAAATGAAAATTAAACGTAAAATGCTAGGGGAAAGGTTATTAAAAAGGTTTTGGGGAAAA-CCATCAGGAATTGGTTCCTGGAAATAGAATTTGGAAGTAAAAATTGCCCTAAATGTTTATTTCAAAGTAGAGAAAGGACTACCAAAATGATTGCTTAATTGCTATTCCAGTTTGTCTGTAGCAATTACAGGCAGGCCCACAGAGGGACAGATGATTCTTATAAGTTTGTCAGATGTTACTTTGTCCCTTAATAAGCTCCATGC [...]
+
+	Thomomys_bottae_ruidosae  		CCCTAGGACTGGAAAAAAAA--TTAAAGTTAAAAACCAAAAACCAAAACA-AAAACAAAACCCTGTCATTTGATTTCTAAGGGTT-TCTAAGAGAACTCAGACTCAAGGGAAAAAA-TGG-CTGTTTTAAAATGGGCTGC-----CTTG-AGG-AC-TAGTACCTAGTACTTCAAGGTTTCTTA-TGGTTAACTGAAATACAAATGAAAATTAAACGTAAAATGCTAGGGGAAAGGTTATTAAAAAGGTTTTGGGGAAAA-CCATCAGGAATTGGTTCCTGGAAATAGAATTTGGAAGTAAAAATTGCCCTAAATGTTTATTTCAAAGTAGAGAAAGGACTACCAAAATGATTGCTTAATTGCTATTCCAGTTTGTCTGTAGCAATTACAGGCAGGCCCACAGAGGGACAGATGATTCTTATAAGTTTGTCAGATGTTACTTTGTCCCTTAATAAGCTCCATG [...]
+
+	Thomomys_bottae_bottae  		?????????TGGAAAAAAAAA-TTAAAGTT-------AAAAACCAAAACC-AAAACAAAACCCTGTCATTTGATTTCTAAGGGTT-TCTAARAGAACTCARACTCAAGGGAAAAAA-TGG-CTGATTTAAAATGGGCCGC-----CTTG-AGGCAC-TAGTACCTAGTGCTTCAAGGTTTCTTM-TGGTTAACTGAAATACAAATGAAAATTAAAYGTAAAATGCTAGGGGAAAGGTTATTAAAAAGGTTTTGGGGGAAA-CCATCAGGAATTGGTTCCTGGAAATAGAATTTGGAAGTAAAAATTGCCCTAAATGTTTATTTCAAAGTAGAGAAAGGACTACCAAAATGATTGCTTAATTGCTATTCCAGTTTGTCTGTAGCAATTACAGGCAGGCCCACAGAGAGACAGATGATTCTTATAAGTTTGTCAGATGTTACTTTGTCCCTTAATAAGCTCCATGCT [...]
+
+	Thomomys_bottae_alpinus  		CCCCAGGACTGGAAAAAAAAA-TTAAAGTT-------AAAAACCAAAACC-AAAACAAAACCCTGTCATTTGATTTCTAAGGGTT-TCTAAGAGAACTCAGACTCAAGGGAAAAAA-TGG-CTGATTTAAAATGGGCCGC-----CTTG-AGGCAC-TAGTACCTAGTGCTTCAAGGTTTCTTA-TGGTTAACTGAAATACAAATGAAAATTAAATGTAAAATGCTAGGGGAAAGGTTATTAAAAAGGTTTTGGGGGAAA-CCATCAGGAATTGGTTCCTGGAAATAGAATTTGGAAGTAAAAATTGCCCTAAATGTTTATTTCAAAGTAGAGAAAGGACTACCAAAATGATTGCTTAATTGCTATTCCAGTTTGTCTGTAGCAATTACAGGCAGGCCCACAGAGAGACAGATGATTCTTATAAGTTTGTCAGATGTTACTTTGTCCCTTAATAAGCTCCATGC [...]
+
+	Thomomys_bottae_riparius  		CCGTAGGACTGGAAAAAAAA--TTAAAGTTAAAAACCAAAAACCAAAACCCAAAACAAAACCCTGTCATTTGATTTCTAAGGGTT-TCTAAGAGAACTCAGACTCAAGGGAAAAAA-TGG-CTGTTTTAAAATGGGCTGC-----CTTG-AGGCAC-TAGTACCTAGTGCTTCAAGGTTTCTTA-TGGTTAACTGAAATACAAATGAAAATTAAACGTAAAATGCTAGGGGAAAGGTTATTAAAAAGGTTTTGGGGAAAA-CCATCAGGAATTGGTTCCTGGAAATAGAATTTGGAAGTAAAAATTGCCCTAAATGTTTATTTCAAAGTAGAGAAAGGACTACCAAAATGATTGCTTAATTGCTATTCCAGTTTGTCTGTAGCAATTACAGGCAGGCCCACAGAGGGACAGATGATTCTTATAAGTTTGTCAGATGTTACTTTGTCCCTTAATAAGCTCCATG [...]
+
+	Thomomys_bottae_mewa  			CCCTAGGRCTGGAAAAAAAA--TTAAAGTTAAAAACCAAAAACCAAAACC-AAAACAAAACCCTGTCATTTGATTTCTAAGGGTT-TCTAAGAGAACTCAGACTCAAGGGAAAAAA-TGG-CTGTTTTAAAATGGGCCGC-----CTTG-AGACAC-TAGTACATAGTGCTTCAARGTTTCTAA-TGGTTAATTGAAATACAAATGAAAATTAAACRTAAAATGCTAGGGGAAAGGTTATTAAAAAGGTTTTGGGGGAAAACCATCAGGAATTGGTTCCTGGAAATAGAATTTGGAAGTAAAAATTGCCCTAAATGTTTATTTCAAAGTAGAGAAAGGACTACCAAAATGATTGCTTAATTGCTATTCCAGTTTGTCTGTAGCAATTACAGGCAGGCCCACAGAGAGACAGATGATTCTTATAAGTTTGTCAGATGTTACTTTGTCCCTTAATAAGCTCCATGCTT [...]
+
+	Thomomys_bottae_saxatilis  		CCCCAGGACTAGAAAAAAAAA-TTAAAGTT-------AAAAACCCAAACC-AAAACAAAACCCTGTCATTTGATTTCTAAGGGTT-TCTAAGAGAACTCAGACTCAAGGGAAAAAA-TGG-CTGATTTAAAATGGGCCAC-----CTTG-AGGCAC-TAGTACCTAGTGCTTCAAGGTTTCTTA-TGGTTAACTGAAATACAAATGAAAATTAAACGTAAAATGCTAGGGTAAAGGTTATTAAAAAGGTTTTGGGGGAAA-CCATCAGGAATTGGTTCCTGGAAATAGAATTTGGAAGTAAAAATTGCCCTAAATGTTTATTTCAAAGTAGAGAAAGGACTACCAAAATGATTGCTTAATTGCTATTCCAGTTTGTCTGTAGCAATTACAGGCAGGCCCACAGAGAGACAGATGATTCTTATAAGTTTGTCAGATGTTACTTTGTCCCTTAATAAGCTCCAT [...]
+
+	Thomomys_bottae_laticeps  		CCCCAGGACTGGAAAAAAAA--TTAAAGTT-------AAAAACCAAAACC-AAAACAAAACCCTGTCATTTGATTTCTAAGGGTT-TCTAAGAGAACTCAGACTCAAGGGAAAAAA-TGG-CTGATTTAAAATGGGCCGC-----CTTG-AGGCAC-TAGTACCTAGTGCTTCAAGGTTTCTTA-TGGTTAACTGAAATACAAATGAAAATTAAACGTAAAATGCTAGGGGAAAGGTTATTAAAAAGGTTTTGGGGGAAA-CCATCAGGAATTGGTTCCTGGAAATAGAATTTGGAAGTAAAAATTGCCCTAAATGTTTATTTCAAAGTAGAGAAAGGACTACCAAAATGATTGCTTAATTGCTATTCCAGTTTGTCTGTAGCAATTACAGGCAGGCCCACAGAGAGACAGATGATTCTTATAAGTTTGTCAGATGTTACTTTGTCCCTTAATAAGCTCCATG [...]
+
+	Thomomys_talpoides_ocius   		CCCCAGGACTGGAAAAAAAAA-TTAAAGTTAAAAACCAAAAACCAGAACC-AAAACAAAACCCTGTCATTTGATTTCTAARGGTT-TTTAAGAGAACTCAGACTCAAGGGAAAATA-TGG-CTGTTTGAAAAAGGGGCGC-----CTTG-AGGCAA-TAATA----GTGCCTCAAGGTTTCTAA-TGGTTAATTGAAATTCAAATGAAAATTAAACATAAAATGCTAGGGGAAAGGTCATTAAAAAGGTTTTGGRAAAAA-CCATCAGGAATTGGTTCCTGGAATTAGAATTTGGAAGTAAAAATTGCCCTAAATGTTTATTTCAAAGTAGAGAGAGGACTACCAAAATGATTGCTTAATTGCTATTCCAGTTTGTCTGTAGCAATTACAGGCAGGCCCACAGAGAGACAGATGATTCTTATAAGTTTGTCAGATGTTACTTTGTCCCTTAATAAGCTCCAT [...]
+
+	Thomomys_idahoensis_pygmaeus_a   	CCCCAGGACTGGAAAAAAAA--TTAAAGTTAAAAWCCAAAAACCAAAACC-AAAACAAGACCCTGTCATTTGATTTCTAAGGGTT-TTTAAGAGAACTCAGACTCAAGGGAAAATA-TGG-CTGTTTGAAAAAGGGGTGC-----TTTG-AGGCAA-TAATA----GTGCCTCAAGGTTTCTAA-TGGTTAATTGAAATTCAAATGAAAATTAAACATAAAATGCTAGGGGAAAGGTCATTAAAAAGGTTTTGGGAAAAA-CCATCAGGAATTGGTTCCTGGAATTAGAATTTGGAAGTAAAAATTTCCCTATATGTTTATTTCAAAGTAGAGAGAGGACTACCAAAATGATTGCTTAATTGCTATTCCAGTTTGTCTGTAGCAATTACAGGCAGGCCCACAGAGAGACAGATGATTCTTATAAGTTTGTCAGATGTTACTTTGTCCCTTAATAAGC [...]
+
+	Thomomys_idahoensis_pygmaeus_b   	CCCCAGGACTGGAAAAAAAA--TTAAAGTTAAAAACCAAAAACCAAAACC-AAAACAAAACCCTGTCATTTGATTTCTAAGGGTT-TTTAAGAGAACTCAGACTCAAGGGAAAATA-TGG-CTGTTTGAAAAAGGGGTGC-----TTTG-AGGCAA-TAATA----GTGCCTCAAGGTTTCTAA-TGGTTAATTGAAATTCAAATGAAAATTAAACATAAAATGCTAGGGGAAAGGTCATTAAAAAGGTTTTGGGAAAAA-CCATCAGGAATTGGTTCCTGGAATTAGAATTTGGAAGTAAAAATTTCCCTAAATGTTTATTTCAAAGTAGAGAGAGGACTACCAAAATGATTGCTTAATTGCTATTCCAGTTTGTCTGTAGCAATTACAGGCAGGCCCACAGAGAGACAGATGATTCTTATAAGTTTGTCAGATGTTACTTTGTCCCTTAATAAGC [...]
+
+	Thomomys_mazama_mazama   		??????????GGAAAAAAAA--TTAAAGTTAAAAACCAAAAACCAAAACC-AAAACAAAACCCTGTCATTTGATTTCTAAGTGTTGTTTAAGAGAACTCAGACTCAAGGGAAAATA-TGGGCTGTTTGAAAAAGGGGCGC-----CTTG-AGGCAA-TAATA----G-GCCTCAAGCTTTCTAA-TGGTTAATTGAAATTCAAATGAAAATTAAACATAAAATGCTAGGGGAAAGGTCATTAAAAAGGTTTTGGGAAAAA-CCATCAGGAATTGGTTCCTGGAATTAGAATTTGGAAGTAAAAATTGCCCTAAATGTTTATTTCAAAGTAGAGAGAGGACTACCAAAATGATTGCTTAATTGCTATTCCAGTTTGTCTGTAGCAATTACAGGCAGGCCCACAGAGAGACAGATGATTCTTATAAGTTKGTCAGATGTTACTTTGTCCCTTAATAAGCTCCATGC [...]
+
+	Thomomys_mazama_nasicus   		CCCCAGGACTGGAAAAAAA---TTAAAGTTAAAAACCAAAAACCAAAACC-AAAACAAAACCCTGTCATTTGATTTCTAAGGGTT-TTTAAGAGAACTCAGACTCAAGGGAAAATA-TGG-CTGTTTGAAAAAGGGGCGC-----CTTG-AGGCAA-TAATA----GTGCCTCAAGGTTTCTAA-TGGTTAATTGAAATTCAAATGAAAATTAAACATAAAATGCTAGGGGAAAGGTCATTAAAAAGGTTTTGGGAAAAA-CCATCAGGAATTGGTTCCTGGAATTAGAATTTGGAAGTAAAAATTGCCCTAAATGTTTATTTCAAAGTAGAGAGAGGACTACCAAAATGATTGCTTAATTGCTATTCCAGTTTGTCTGTAGCAATTACAGGCAGGCCCACAGAGAGACAGATGATTCTTATAAGTTTGTCAGATGTTACTTTGTCCCTTAATAAGCTCCATG [...]
+
+	Thomomys_monticola_a   			CCCGAGGACTGGAAAAAAAA--TTAAAGTTAAAAACCAAAAACCAAAACC-AAAACCAAACCCTGTCATTTGATTTCTAAGGGTT-TTTAAGAGAACTCAGA---------AAATA-TGG-CTGTTTGAAAAAGGGGCGC-----CTTG-AGGCAA-TAATA----GTGCCTCAAGGTTTCTAA-TGGTTAATTGAAATTCAAATGAAAATTAAACATAAAATGCTAGGGGAAAGGTCATTAAAAAGGTTTTRGGAAAAA-CCATCAGGAATTGGTTCCTGGAATTAGAATTTGGAAGTAAAAATTGCCCTAAATGTTTATTTCAAAGTAGAGAGAGGACTACCAAAATGATTGCTTAATTGCTATTCCAGTTTGTCTGTAGCAATTACAGGCAGGCCCACAGAGAGACAGATGATTCTTATAAGTTTGTCAGATGTTACTTTGTCCCTTAATAAGCTCCATGCT [...]
+
+	Thomomys_monticola_b   			CCCGAGGACTGGAAAAAAAA--TTAAAGTTAAAAACCAAAAACCAAAACC-AAAACAAAACCCTGTCATTTGATTTCTAAGGGTT-TTTAAGAGAACTCAGACTCAAGGGAAAATA-TGG-CTGTTTGAAAAAGGGGCGC-----CTTG-AGGCAA-TAATA----GTGCCTCAAGGTTTCTAA-TGGTTAATTGAAATTCAAATGAAAATTAAACATAAAATGCTAGGGGAAAGGTCATTAAAAAGGTTTTGGGAAAAA-CCATCAGGAATTGGTTCCTGGAATTAGAATTTGGAAGTAAAAATTGCCCTAAATGTTTATTTCAAAGTAGAGAGAGGACTACCAAAATGATTGCTTAATTGCTATTCCAGTTTGTCTGTAGCAATTACAGGCAGGCCCACAGAGAGACAGATGATTCTTATAAGTTTGTCAGATGTTACTTTGTCCCTTAATAAGCTCCATGCT [...]
+
+	Thomomys_talpoides_yakimensis   	CCCCAGGACTGGAAAAAAA---TTAAAGTTAAAAACCAAAAACCAA------------AACCCTGTCATTTGATTTCTAAGGGTT-TTTAAGAGAACTCAGACTCAAGGGAAAATA-TGG-CTGTTTGAAAAAGGGGTGC-----CTTG-AGGCAA-TAATA----GTGCCTCAAGGTTTCTAA-TGGTTAATTGAAATTCAAATGAAAATTAAACATAAAATGCTAGGGGAAAGGTCATTAAAAAGGTTTTGGGAAAAA-CCATCAGGAATTGGTTCCTGGAATTAGAATTTGGAAGTAAAAATTGCCCTAAATGTTTATTTCGAAGTAGAGAGAGGACTACCAAAATGATTGCTTAATTGCTATTGCAGTTTGTCTGTAGCAATTACAGGCAGGCCCACAGAGAGACAGATGATTCTTATAAGTTTGTCAGATGTTACTTTGTCCCTTAATAAGCT [...]
+
+	Thomomys_talpoides_bridgeri   		?????????????????????????????????????AAAAACCAAAACC-AAAACAAAACCCTGTCATTTGATTTCTAAGGGTT-TTTAAGAGAACTCAGACTCAAGGGAAAATA-TGG-CTGTTTGAAAAAGGGGCGC-----CTTG-AGGCAA-TAATA----GTGCCTCAAGGTTTCTAA-TGGTTAATTGAAATTCAAATGAAAATTAAACATAAAATGCTAGGGGAAAGGTCATTTAAAAGGTTTTGGGAAAAA-CCATCAGGAATTGGTTCCTGGAATTAGAATTTGGAAGTAAAAATTGCCCTAAATGTTTATTTCAAAGTAGAGAGAGGACTACCAAAATGATTGCTTAATTGCTATTCCAGTTTGTCTGTAGCAATTACAGGCAGGCCCACAGAGAGACAGATGATTCTTATAAGTTTGTCAGATGTTACTTTGTCCCTTAATAAGCTC [...]
+
+	Thomomys_townsendii_townsendii   	CCCCAGGACTGGAAAAAAAAA-TTAAAGTT-------AAAAACCAAAACC-AAAACAAAACCCTGTCATTTGATTTCTAAGGGTT-TCTAAGAGAACTCAGACTCAAGGGAAAAAA-TGG-CTGATTTAAAATGGGCCGC-----CTTG-AGGCAC-TAGTACCTAGTGCTTCAAGGTTTCTTA-TGGTTAACTGAAATACAAATGAAAATTAAACGTAAAATGCTAGGGGAAAGGTTATTAAAAAGGTTTTGGGGGAAA-CTATCAGGAATTGGTTCCTGGAAATAGAATTTGGAAGTAAAAATTGCCCTAAATGTTTATTTCAAAGTAGAGAAAGGACTACCAAAATGATTGCTTAATTGCTATTCCAGTTTGTCTGTAGCAATTACAGGCAG----------------ATGATTCTTATAAGTTTGTCAGATGTTACTTTGTCCCTTAATAAGC [...]
+
+	Thomomys_townsendii_relictus   		CCCCAGGACTGGAAAAAAAAA-TTAAAGTT-------AAAAACCAAAACC-AAAACAAAACCCTGTCATTTGATTTCTAAGGGTT-TCTAAGAGAACTCAGACTCAAGGGAAAAAA-TGG-CTGATTTAAAATGGGCCGC-----CTTG-AGGCAC-TAGTACCTAGTGCTTCAAGGTTTCTTA-TGGTTAACTGAAATACAAATGAAAATTAAACGTAAAATGCTAGGGGAAAGGTTATTAAAAAGGTTTTGGGGGAAA-CTATCAGGAATTGGTTCCTGGAAATAGAATTTGGAAGTAAAAATTGCCCTAAATGTTTATTTCAAAGTAGAGAAAGGACTACCAAAATGATTGCTTAATTGCTATTCCAGTTTGTCTGTAGCAATTACAGGCAGGCCCACAGAGAGACAGATGATTCTTATAAGTTTGTCAGATGTTACTTTGTCCCTTAATAAGCT [...]
+
+	Thomomys_umbrinus_chihuahuae   		CCCTAGGACTGGAAAAAAAA--TTAAAGTTAAAAACCAAAAACCAAAACC-AAAACCAAACCCTGTCATTTGATTTCTAAGGGTT-TCTAAGAGAACTCAGACTCAAGGGAAAAAA-TGG-CTGATTTAAAATGGGCCGC-----CTTG-AGGCAC-TAGTACCTAGTGCTTCAAGGTTTCTAA-TGGTTAATTGAAATACAMATGAAAATTAAACGTAAAATGCTAGGGGAAAGGTTATTAAAAAGGTTTTGGGGAAAA-CCATCAGGAATTGGTTCCTGGAAATAGAATTTGGAAGTAAAAATTGTCCTAAATGTTTATTTCAAAGTAGAGAAAGGACTACCAAAATGATTGCTTAATTGCTATTCCAGTTTGTCTGTAGCAATTACAGGCAGGCCCACAGAGGGACAGATGATTCTTATAAGTTTGTCAGATGTTACTTTGTCCCTTAATAAGCT [...]
+
+	Thomomys_umbrinus_atroavarius   	CCCTAGGACTGGAAAAAAAA--TTAAAGTTCAAAACCAAAAACCAAAACC-AAAATCAAACCCTGTCATTTGATTTCTAAGGGTT-TCTAAGAGAACTCAGAYTCAAGGGAAAAAA-TGG-CTGATTTAAAATGGGCCGC-----CTTG-AGGCAC-TAGTACCTAGTGTTTCAAGGTTTCTAA-TGGTTAATTGAAATACAAATGAAAATTAAACGTAAMATGCTAGGGGAAAGGTTATTAAAAAGGTTTTGGGGAAAA-CCATCAGGAATTGGTTCCTGGAAATAGAATTTGGAAGTAAAAATTGTCCTAAATGTTTATTTCAAAGTAGAGAAAGGACTACCAAAATGATTGCTTAATTGCTATTCCAGTTTGTCTGTAGCAATTACAGGCAGGCCCACAGAGGGACAGATGATTCTTATAAGTTTGTCAGATGTTACTTTGTCCCTTAATAAGCT [...]
+
+																			
+;
+
+
+END;
diff --git a/examples/nexus/59.nex b/examples/nexus/59.nex
new file mode 100644
index 0000000..f467569
--- /dev/null
+++ b/examples/nexus/59.nex
@@ -0,0 +1,64 @@
+#NEXUS
+
+BEGIN DATA;
+	DIMENSIONS  NTAX =26 NCHAR=553;
+	FORMAT DATATYPE = DNA GAP = - MISSING = ?;
+	MATRIX	
+	Orthogeomys_heterodus   		AATGCAATG-ACCCACACCCACCACCTGTGAATACATATGTGATAGGTTTGCAAATGAATCTCTTTCTCTC-----------------------GATATRCTTTTGCTCATGAACCATCTTGTTATCGCTTTACCTGAACATTGCTAAGCAGGGAGGGTTTGCTGCCATCATCACTCTTCCTCTCTTTGAACTGGGAAGATTTCTGATAGGAAATCTTTCCTGTTTTTTCCTCTGAGGGCTTAAGTGTGTATAA-CTATTTTGTGCATGATATTGCAACAAACAAAAATGCCACATACTCGCACTGGGTACAATGGAATCCTAGCTACTCTGGAAGCTGAAATTGAGAGGATTGTGGTTTGAGGTCATCTGGACAAACAGTTTATGAAATCTCTTCTCAACCAATAAAGACTGGGTATGGTACCATGTTCCTCTCATCCCGATGGTTCAGGAAGCATAAATAGCT [...]
+
+	Thomomys_bottae_awahnee_a 		AATGCAATG-ACCCACACCCACCACCTGTGAATACATATGTGATAGGTTTGCAAATGAATCTATTTCTCTC-----------------------GATACACTTTTGCTCATGAAACGTCTTGTTATCGCTTTACCTGAACATTGCTAAGCAGRG----TTTGCTGCCATCATCACTCTTCCTCTCTTTGAACTGGGAAGATTTCTGATAGGAAATCTTTCCTGTCTTTACCCCTGAGGGCTTAAGYGTGTATAAACTATTTTGTACGTGATATTGCACCAAACAAAAATGCCACATACTTGCACTGGGTGCAATGGAATCCT---------GGAAGCTGAAATTGAGAGGATTGTGGTTTGAGGTCATCTGGGCAAACAGTTCATGAAATCTCTTCTCAACCAATAAAGACTGGGTATGGTACCATGTTCCTATCATCCCGATGGTTCAGGAAGCATAAATAG [...]
+
+	Thomomys_bottae_awahnee_b  		AATGCAATG-ACCCACACCCACCACCTGTGAATACATATGTGATAGGTTTGCAAATGAATCTATTTCTCTC-----------------------GATACACTTTTGCTCATGAAACGTCTTGTTATCGCTTTACCTGAACATTGCTAAGCAGRG----TTTGCTGCCATCATCACTCTTCCTCTCTTTGAACTRGGAAGATTTCTGATAGGAAATCTTTCCTGTCTTTACCCCTGAGGGCTTAAGYGTGTATAAACTATTTTGTACGTGATATTGCACCAAACAAAAATGCCACATACTTGCACTGGGTGCAATGGAATCCT---------GGAAGCTGAAATTGAGAGGATTGTGGTTTGAGGTCATCTGGGCAAACAGTTCATGAAATCTCTTCTCAACCAATAAAGACTGGGTATGGTACCATGTTCCTATCATCCCGATGGTTCAGGAAGCATAAATA [...]
+
+	Thomomys_bottae_xerophilus  		AATGCAATG-ACCCACACCCACCACCTGTGAATACATATGTGATAGGTTTGCAAATGAATCTATTTCTCTC-----------------------GATACACTTTTGCTCATGAAACGTCTTGTTATCGCTTTACCTGAACATTGCTAAGCAGGG----TTTGCTGCCATCATCACTCTTCCTCTCTTTGAACTGGGAAGATTTCTGATAGGAAATCTTTCCTGTCTTTACCYSTGAGGGCTTAAGTGTGTATAAACTATTTTGTACGTGATATTGCACCAAACAAAAATGCCACATACTTRCACTGGGTGYAATGGAATCCT---------GGAAGCTGAAATTGAGAGGATTGTGGTTTGAGGTCATCTGGGCAAACAGTTCATGAAATCTCTTCTCAACCAATAAAGACTGGGTATGGTACCATGTTCCTATCATCCCGATGGTTCAGGAAGCATAAAC [...]
+
+	Thomomys_bottae_cactophilus  		AATGCAATG-ACCCACACCCACCACCTGTGAATACATATGTGATAGGTTTGCAAATGAATCTATTTCTCTC-----------------------GATACACTTTTGCTCATGAAACGTCTTGTTATCGCTTTACCTGAACATTGCTAAGCAGGG----TTTGCTGCCATCATCACTCTTCCTCTCTTTGAACTGGGAAGATTTCTGATAGGAAATCTTTCCTGTCTTTACCCCTGAGGGCTTAAGTGTGTATAAACTATTTTGTACGTGATATTGCACCAAACAAAAATGCCACRTACTTRCACTGGGTGCAATGGAATCCT---------GGAAGCTGAAATTGAGAGGATTGTGGTTTGAGGTCATCTGGGCAAACAGTTCATGAAATCTCTTCTCAACCAATAAAGACTGGGTATGGTACCATGTTCCTATCATCCCGATGGTTCAGGAAGCATAAA [...]
+
+	Thomomys_bottae_albatus  		AATGCAATG-ACCCACACCCACCACCTGTGAATACATATGTGATAGGTTTGCAAATGAATCTATTTCTCTC-----------------------GATACACTTTTGCTCATGAAACGTCTTGTTATCGCTTTACCTGAACATTGCTAAGCAGGG----TTTGCTGCCATCATCACTCTTCCTCTCTTTGAACTGGGAAGATTTCTGATAGGAAATCTTTCCTGTCTTTACCTGTGAGGGCTTAAGTGTGTATAAACTATTTTGTACGTGATATTGCACCAAACAAAAATGCCACATACTTGCACTGGGTGTAATGGAATCCT---------GGAAGCTGAAATTGAGAGGATTGTGGTTTGAGGTCATCTGGGCAAACAGTTCATGAAATCTCTTCTCAACCAATAAAGACTGGGTATGGTACCATGTTCCTATCATCCCGATGGTTCAGGAAGCATAAATAGC [...]
+
+	Thomomys_bottae_ruidosae  		AATGCAATG-ACCCACACCCACCACCTGTGAATACATATGTGATAGGTTTGCAAATGAATCTATTTCTCTC-----------------------GATACACTTTTGCTCATGAAACGTCTTGTTATCGCTTTACCTGAACATTGCTAAGCAGGG----TTTGCTGCCATCATCACTCTTCCTYTCTTTGAACTGGGAAGATTTCTGATAGGAAATCTTTCCTGTCTTTACCTCTGAGGGCTTAAGTGTGTATAAACTATTTTGTACRTGATATTGCACCAAACAAAAATGCCACATACTTGCACTGGGTGCAATGGAATCCT---------GGAAGCTGAAATTGAGAGGATTGTGGTTTGAGGTCATCTGGGCAAACAGTTCATGAAATCTCTTCTCAACCAATAAAGACTGGKTATGGTACCATGTTCCTATCATCCCGATGGTTCAGGAAGCATAAATAG [...]
+
+	Thomomys_bottae_bottae  		AATGCAATG-ACCCACACCCACCACCTGTGAATACATATGTGATAGGTTTGCAAATGAATCTATTTCTCTC-----------------------GATACACTTTTGCTCATGAAACGTCTTGTTATCGCTTTACCTGAACATTGCTAAGCAGGG----TTTGCTGCCATCATCACTCTTCCTCTCTTTGAACTGGGAAGATTTCTGATAGGAAATCTTTCCTGTCTTTACCCCTGAGGGCTTAAGTGTGTATAAACTATTTTGTACGTGATATTGCACCAAACAAAAATGCCACATACTTGCACTGGGTGCAATGAAATCCT---------GGAAGCTGAAATTGAGAGGATTGTGGTTTGAGGTCATCTGGGCAAACAGTTCATGAAATCTCTTCTCAACCAATAAAGACTGGGTATGGTACCATGTTCCTATCATCCCGATGGTTCAGGAAGCATAAATAGCT [...]
+
+	Thomomys_bottae_alpinus  		AATGCAATGGACCCACACCCACCACCTGTGAATACATATGTGATAGGTRTGCAAATGAATCTATTTCTCTC-----------------------GATACACTTTTGCTCATGAAACGTCTTGTTATCGCTTTACCTGAACATTGCTAAGCAGGG----TTTGCTGCCATCATCACTCTTCCTCTCTTTGAACTGGGAAGATTTCTGATAGGAAATCTTTCCTGTCTTTACCCCTGAGGGCTTAAGTGTGTATAAACTATTTTGTACGTGATATTGCACCAAACAAAAATGCCACATACTTGCACTGGGTGCAATGGAATCCG---------GGAAGCTGAAATTGAGAGGATTGTGGTTTGAGGTCATCTGGGCAAACAGTTCATGAAATCTCTTCTCAACCAAGAAAGACTGGGTATGGTACCATGTTCCTATCATCCCGATGGTTCAGGAAGCATAAATAGC [...]
+
+	Thomomys_bottae_riparius  		AATGCAATG-ACCCACACCCACCACCTGTGAATACATATGTGATAGGTTTGCAAATGAATCTATTTCTCTC-----------------------GATACACTTTTGCTCATGAAACGTCTTGTTATCGCTTTACCTGAACATTGCTAAGCAGGG----TTTGCTGCCATCATCACTCTTCCTCTCTTTGAACTGGGAAGATTTCTGATAGGAAATCTTTCCTGTCTTTACCTSTGAGGGCTTAAGTGTGTATAAACTATTTTGTACGTGATATTGCACCAAACAAAAATGCCACATACTTGCACTGGGTGYAATGGAATCCT---------GGAAGCTGAAATTGAGAGGATTGTGGTTTGAGGTCATCTGGGCAAACAGTTCATGAAATSTCTTCTCAACCAATAAAGACTGGGTATGGTACCATGTTCCTATCATCCCGATGGTTCAGGAAGCATAAATAG [...]
+
+	Thomomys_bottae_mewa  			AATGCAATG-ACCCACACCCACCACCTGTGAATACATATGTGATAGGTTTGCAAATGAATCTATTTCTCTC-----------------------GATACACTTTTGCTCATGAAACGTCTTGTTATCGCTTTACCTGAACATTGCTAAGCAGGG----TTTGCTGCCATCATCACTCTTCYTCTCTTTGAACTGGGAAGATTTCTGATAGGAAATCTTTCCTGTCTTTACCCCTGAGGGCTTAAGTGTGTATAAACTATTTTGTACGTGATATTGCACCAAACAAAAATGCCACATACTTGCACTGGGTGCAATGGAATCCT---------GGAAGCTGAAATTGAGAGGATTGTGGTTTGAGGTCATCTGGGCAAACAGTTCATGAAATCTCTTCTCAACCAATAAAGACTGGGTATGGTACCATGTTCCTATCATCCCGATGGTTCAGGAAGCATAAATAGCTG [...]
+
+	Thomomys_bottae_saxatilis  		AATGCAATG-ACCCACACCCACCACCTGTGAATACATATGTGATAGGTTTGCAAATGAATCTATTTCTCTC-----------------------GATACACTTTTGCTCATGAAACGTCTTGTTATCGCTTTACCTGAACATTGCTAAGCAGGG----TTTGCTGCCATCATCACTCTTCCTCTCTTTGAACTGGGAAGATTTCTGATAGGAAATCTTTCCTGTCTTTACCCCTGAGGGCTTAAGTGTGTATAAACTATTTTGTACGTGATATTGCACCAAACAAAAATGCCACATACTTGCACTGGGTGCAATGGAATCCT---------GGAAGCTGAAATTGAGAGGATTGTGGTTTGAGGTCATCTGGGCAAACAGTTCATGAAATCTCTTCTCAACCAATAAAGACTGGGTATGGTACCATGTTCCTATCATCCCGATGGTTCAGGAAGCATAAATA [...]
+
+	Thomomys_bottae_laticeps  		AATGCAATG-ACCCACACCCACCACCTGTGAATACATATGTGATAGGTTTGCAAATGAATCTATTTCTCTC-----------------------GATACACTTTTGCTCATGAAACGTCTTGTTATCGCTTTACCTGAACATTGCTAAGCAGGG----TTTGCTGCCATCATCACTCTTCCTCTCTTTGAACTGGGAAGATTTCTGATAGGAAATCTTTCCTGTCTTTACCYCTGAGGGCTTAAGTGTGTATAAACTATTTTGTACGTGATATTGCACCAAACAAAAATGCCACATACTTGCACTGGGTGCAATGGAATCCT---------GGAAGCTGAAATTGAGAGGATTGTGGTTTGAGGTCATCTGGGCAAACAGTTCATGAAATCTCTTCTCAACCAATAAAGACTGGGTATGGTACCATKTTCCTATCATCCCGRTGGTTCAGGAAGCATAAATAG [...]
+
+	Thomomys_talpoides_ocius   		????????G-ACCCACACCCACCACCTGTGAATACATATGTGATAGGTTTGCAAATGAATCTATTTCTCT------------------------GATATACTTTTGCTCATGAAACGTCTTGTTATCACTTTACCTGAACATTGCTAAGCAGGG----TTTGCTGCCATCATCACTCTTCCTCTCTTTGAACTGGGAAGATTTCTGATAGGAAATCTTTCCTGTCTTTTCCTCTGAGGGCTTAAGTGTGTATAAACTATTTTGTACGTGATATTGCACCAAACAAAAATGCCACATACTCGCACTGGATGCAATGGAATCCTAGCTACTCTGGAAGCTGAAATTGAGAGGATTGTGATTTGAGGTCATCTGGGCAAACAGTTCATGAAATCTCTTTTCAACCAATAAAGACTGGGTATGGTACCATGTTCCTATCATCCCGATGGTTCAGGAAGCATAAATA [...]
+
+	Thomomys_idahoensis_pygmaeus_a   	AATGCAATG-ACCCACACCCACCACCTGTGAATACATATGTGATAGGTTTGCAAATGAATCTATTTCTCTC-----------------------GATATACTTTTGCTCATGAAACGTCTTGTTATCACTTTACCTGAACATTGCTAAGCAGGG----TTTGCTGCCATCATCACTCTTCCTCTCTTTGAACTGGGAAGATTTCTGATAGGAAATCTTTCCTGTCTTTTCCTCTGAGGGCGTAAGTGTGTATAAACTATTTTGTACGTGATATTGCACCAAACAAAAATGCCACATACTTGCACTGGATGCAATGGAATCCTAGCTACTCTGGAAGCTGAAATTGAGAGGATTGTGATTTGAGGTCATCTGGGCAAACAGTTCATGAAATCTCTTTTCAACCAATAAAGACTGGGTATGGTACCATGTTCCTATCATCCCGATGATTCAGGAAGCAT [...]
+
+	Thomomys_idahoensis_pygmaeus_b   	AATGCAATG-ACCCACACCCACCACCTGTGAATACATATGTGATAGGTTTGCAAATGAATCTATTTCTCTCGATATACTTTTGCTCATGAAACGGATATACTTTTGCTCATGAAACGTCTTGTTATCACTTTACCTGAACATTGCTAAGCAGGG----TTTGCTGCCATCATCACTCTTCCTCTCTTTGAACTGGGAAGATTTCTGATAGGAAATCTTTCCTGTCTTTTCCTCTGAGGGCTTAAGTGTGTATAAACTATTTTGTACGTGATATTGCACCAAACAAAAATGCCACATACTTGCACTGGATGCAATGGAATCCTAGCTACTCTGGAAGCTGAAATTGAGAGGATTGTGATTTGAGGTCATCTGGGCAAACAGTTCATGAAATCTCTTTTCAACCAATAAAGACTGGGTATGGTACCATGTTCCTATCATCCCGATGATTCAGGAAGCAT [...]
+
+	Thomomys_mazama_mazama   		??TGCAATG-ACCCACACCCACCACCTGTGAATACATATGTGATAGGTTTGCAAATGAATCTATTTCTCTC-----------------------GATATACTTTTGCTCATGAAACGTCTTGTTATCGCTTTACCTGAACAYTGCTAAGCAGGG----TTTGCTGCCATCATCACTCTTCCTCTCTTTGAACTGGGAAGATTTCTGATAGGAAATCTTTCCTGTCTTTTCCTCTGAGGGCTTAAGTGTGTATAAACTATTTTGTACGTGATATTGCACCAAACAAAAA???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+
+	Thomomys_mazama_nasicus   		AATGCAATG-ACCCACACCCACCACCTGTGAATACATATGTGATAGGTTTGCAAATGAATCTATTTCTCTC-----------------------GATATACTTTTGCTCATGAAACGTCTTGTTATCGCTTTACCTGAACATTGCTAAGCAGGG----TTTGCTGCCATCATCACTCTTCCTCTCTTTGAACTGGGAAGATTTCTGATAGGAAATCTTTCCTGTCTTTTCCTCTGAGGGCTTAAGTGTGTATAAACTATTTTGTACGTGATATTGCACCAAACAAAAATGCCACATACTTGCACTGGATGCAATGGAATCCTAGCTACTCTGGAAGCTGAAATTGAGAGGATTGTGGTTTGAGGACATCTGGGCGAACAGTTCATGAAATCTCTTCTTAACCAATACAGACTGGGTATGGTACCATGTTCCTATCGTCCCGATGGTTCAGGAAGCATAAATAG [...]
+
+	Thomomys_monticola_a   			AATGCAATG-ACCCACACCCACCACCTGTGAATACATATGTGATAGGTTTGCAAATGAATCTATTTCTCTC-----------------------GATGTACTTTTGCTCATGAAACATCTTGTTATCGCTTTACCTGAACATTGCTAAGCAGGG----TTTGCTGCCATCATCACTCTTCCTCTCTTTGAACTGGGAAGATTTCTGATAGGAAATCTTTCCTGTCTTTTCCTCTGAGGGCTTAAGTGTGTATAAACTATTTTGTACGTGATATTGCACCAAACAAAAATGCCACATACTCGCACTGGATGCAGTGGAATCCTAGCTACTCTGGAAGCTGAAATTGAGAGGATTGTGATTTGAGGTCATCTGGGCAAACAGTTCATGAAATCTCTTTTCAACCAATAAAGACTGGGTATGGTACCATGTTCCTATCATCCCGATGGTTCAGGAAGCATAAATAGCT [...]
+
+	Thomomys_monticola_b   			AATGCAATG-ACCCACACCCACCACCTGTGAATACATATGTGATAGGTTTGCAAATGAATCTATTTCTCTC-----------------------GATATACTTTTGCTCATGAAACGTCTTGTTATCGCTTTACCTGAACATTGCTAAGCAGGG----TTTGCTGCCATCATCACTCTTCCTCTCTTTGAACTGGGAAGATTTCTGATAGGAAATCTTTCCTGTCTTTTCCTCTGAGGGCTTAAGTGTGTATAAACTGTTTTGTACGTGATATTGCACCAAACAAAAATGCCACATACTCGCACTGGATGCAGTGGAATCCTAGCTACTCTGGAAGCTGAAACTGAGAGGATTGTGATTTGAGGTCATCTGGGCAAACAGTTCATGAAATCTCTTTTCAACCAATAAAGACTGGGTATGGTACCATGTTCCTATCATCCCGATGGTTCAGGAAGCATAAATAGCT [...]
+
+	Thomomys_talpoides_yakimensis   	AATGCAATG-ACCCACACCCACCACCTGTGAATACATATGTGATAGGTTTGCAAATGAATCTATTTCTCTC-----------------------GATATACTTTTGCTCATGAAACGTCTTGTTATCACTTTACCTGAACATTGCTAAGCAGGG----TTTGCTGCCATCATCACTCTTCCTCTCTTTGAACTGGGRAGATTTCTGATAGGAAATCTTTCCTGTCTTTTCCTTTGAGGGCTTAAGTGTGTRGAAACTATTTTGTACGTGATATTGCACCAAACAAAAATGCCACATACTCGCACTGGATGCAATGGAATCCTAGCTACTCTGGAAGCTGAAATTGAGAGGATTGTGATTTGAGGTCATCTGGGCAAACAGTTCACGAAATCTCTTTTCAACCAATAAAGACTGGGTACAGTACCATGTTCCTATCATCCCGATGGTTCAGGAAGCATA [...]
+
+	Thomomys_talpoides_bridgeri   		AATGCAATG-ACCCACACCCACCACCTGTGAATACATATGTGATAGGTTTGCAAATGAATCTATTTCTCTC-----------------------GATATACTTTTGCTCATGAAACGTCTTGTTATCACTTTACCTGAACATTGCTAAGCAGGG----TTTGCTGCCGTCATCACTCTTCCTCTCTTTGAACTGGGAAGATTTCTGATAGGAAATCTTTCCTGTCTTTTCCTCTGAGGGCTTAAGTGTGTATAAACTATTTTGTACGTGATATTGCACCAAACAAAAATGCCACATACTCGCACTGGATGCAATGGAATCCTAGCTACTCTGGAAGCTGAAATTGAGAGGATTGTGATTTGAGGTCATCTGGGCAAACAGTTCATGAAATCTCTTTTCAACCAATGAAGACTGGGTATGGTACCATGTTCCTATCATCCCGATGGTTCAGGAAGCATAA [...]
+
+	Thomomys_townsendii_townsendii   	AATGCAATG-ACCCACACCCACCACCTGTGAATACATATGTGATAGGTTTGCAAATGAATCTATTTCTCTC-----------------------GATACACTTTTGCTCATGAAACGTCTTGTTATCGCTTTACCTGAACATTGCTAAGCAGGG----TTTGCTGCCATCATCACTCTTCCTCTCTTTGAACTGGGAAGATTTCTGATAGGAAATCTTTCCTGTCTTTACCCCTGAGGGCTTAAGTGTGTATAAACTATTTTGTACGTGATATTGCACCAAACAAAAATGCCACATACTTGCACTGGGTGCAATGGAATCCT---------GGAAGCTGAAATTGAGAGGATTGTGGTTTGAGGTCATCTGGGCAAACAGTTCATGAAATCTCTTCTCAACCAATAAAGACTGGGTATGGTACCATGTTCCTATCATCCCGATGGTTCAGGAAGCAT [...]
+
+	Thomomys_townsendii_relictus   		AATGCAATG-ACCCACACCCACCACCTGTGAATACATATGTGATAGGTTTGCAAATGAATCTATTTCTCTC-----------------------GATACACTTTTGCTCATGAAACGTCTTGTTATCGCTTTACCTGAACATTGCTAAGCAGGG----TTTGCTGCCATCATCACTCTTCCTCTCTTTGAACTGGGAAGATTTCTGATAGGAAATCTTTCCTGTCTTTACCCCTGAGGGCTTAAGTGTGTATAAACTATTTTGTACGTGATATTGCACCAAACAAAAATGCCACATACTTGCACTGGGTGCAATGGAATCCT---------GGAAGCTGAAATTGAGAGGATTGTGGTTTGAGGTCATCTGGGCAAACAGTTCATGAAATCTCTTCTCAACCAATAAAGACTGGGTATGGTACCATGTTCCTATCATCCCGATGGTTCAGGAAGCATA [...]
+
+	Thomomys_umbrinus_chihuahuae   		AATGCAATG-ACCCACACCCACCACCTGTGAATACATATGTGATAGGTTTGCAAATGAATCTATTTCTCTC-----------------------GATACACTTTTGCTCATGAAACGTCTTGTTATCGCTTTACCTGAACATTGCTAAGCAGGG----TTTGCTGCCATCATCACTCTTCCTCTCTTTGAACTGGGAAGATTTCTGATAGGAAATCTTTCCTGTCTTTACCTCTGAGGGCTTAAGTGTGTATAAACTATTTTGTACGTGATATTGCACCAAACAAAAATGCCACATACTTGCACTGGGTKCAATGGAATCCT---------GGAAGCTGAAATTGAGAGGATTGTGGTTTGAGATCATCTGGGCAAACAGTTCATGAAATCTCTTCTCAACCAATAAAGACTGGGTATGGTACCATGTTCCTATCATCCCGATGGTTCAGGAAGCATA [...]
+
+	Thomomys_umbrinus_atroavarius   	AATGCAATG-ACCCACACCCACCACCTGTGAATACATATGTGATAGGTTTGCAAATGAATCTATTTCTCTC-----------------------GATACACTTTTGCTCATGAAACGTCTTGTTATCGCTTTACCTGAACATTGCTAAGCAGGG----TTTGCTGCCATCATCACTCTTCCTCTCTTTGAACTGGGAAGATTTCTGATAGGAAATCTTTCCTGTCTTTACCTCTGAGGGCTTAAGTGTGTATAAACTATTTTGTACGTGATATTGCACCAAACAAAAATGCCACATACTCGCACTGGGTGCAATGGAATCCTAGCTACTCTGGAAGCTGAAATTGAGAGGATTGTGGTTTGAGGTCATCTGGGCAAACAGTTCATGAAATCTCTTCTCAACCAATAAAGACTGGGTATGGTACCATGTTCCTATCATCCCGATGGTTCAGGAAGCATA [...]
+
+
+;
+
+
+END;
+
diff --git a/examples/nexus/64.nex b/examples/nexus/64.nex
new file mode 100644
index 0000000..f6ebd53
--- /dev/null
+++ b/examples/nexus/64.nex
@@ -0,0 +1,64 @@
+#NEXUS
+
+BEGIN DATA;
+	DIMENSIONS  NTAX =26 NCHAR=471;
+	FORMAT DATATYPE = DNA GAP = - MISSING = ?;
+	MATRIX
+	Orthogeomys_heterodus   		???????????????????????????C-TCATAGGACTTATCCTGTCCAGGC-TGGCTTA-GAACTGTGATCCTC-AGATTTCAGCGAGCTAGGCAGCTAGAATTCTTTAGGTACAAGTTAACATTGATTTTTC--TGTTTTGTTTTGCCC-TTGGTGATTTTCCT-AGGGTTTTAAATCAGGGCC????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
+
+	Thomomys_bottae_awahnee_a 		??GGACTGGCATACAATGCACA-AAGTC-TCAT-GGACTT-TCCTGTCCAGGC-TGGCTTA-GAACTGTGATCCTA-AGATTTCAGCGAGCTAGGCAGCTAGAATTCTTTAGGTACAAGGTAACATTGATTTTTT--TGTTTTGTTTTGCCCCTTGGTGATTTTCCT-AGGGTTTTAAATCAGGGCCTAGTATACTCTCACTGAAARTTTTTCTTCAGAGCTAGCAGGCTGTAGAATTTGAGCCAAACCTTGATTGCTCATGTTTATTTTTAAAATTTGGGT-GCTGGTACTATGCCTTAAACCCAAGGGCTGGTGCTTCT-ATYTGAA-GTTTTTCTTTATTTTCTT--AAGTCTACTGGTTGCTATTACTTGCAACATATGTC-AAGTTTGG-CTTTGGTTTTGTTTTG-C-TTTTCCTGGGCTGGTCC-TACT-CC-TTG-AACTCAGGGTC-TAGCCTC [...]
+
+	Thomomys_bottae_awahnee_b  		CAGGACTGGCATACAATGCACA-AAGTC-TCAT-GGACTT-TCCTGTCCAGGC-TGGCTTA-GAACTGTGATCCTA-AGATTTCAGCGAGCTAGGCAGCTAGAATTCTTTAGGTACAAGGTAACATTGATTTTTC--TGTTTTGTTTTGCCCCTTGGTGATTTTCCT-AGGGTTTTAAATCAGGGCCTTGTATACTCTCACTGAAAGTTTTTCTTCAGAGCTAGCAGGCTGTAGAATTTGAGCCAAACCTTGATTGCTCATGTTTATTTTTAAAATTTGGGT-GCTGGTACTATGCCTTAAACCCAAGGGCTGGTGCTTCT-ATTTGAA-GTTTTTCTTTATTTTCTT--AAGTCTACTGGTTGCTATTACTTGCAACATATGTC-AAGTTTGG-CTTTGGTTTTGTTTTG-C-TTTTCCTGGGCTGGTCC-TACT-CC-TTG-AACTCAGGGYC-TAGCCT [...]
+
+	Thomomys_bottae_xerophilus  		???GACTGGCATACAATGCACA-AAGTC-TCAT-GGACTT-TCCTGTCCAGGC-TGGCTTA-GAACTGTGATCCTT-AGATTTCAGCGAGCTAGGCAGCTAGAATTCTTTAGGTACAAGGTAACATTGATTT--CTTTGTTTTGTTTTGCCCTTTGGTGATTTCCCT-AGGGTTTTAAATCAGGGCCTAGTATACTCTCACKGAAARTTTTTCTTCAGAGCTAGCAGGCTGTAGAATTTGAGCCAAACCTTGATTGCTCATGTTTATTTTTWARATTTGGGT-GCTGGTACTATGCCTTAAACCCAAGGGCTGGTGCTTCT-ATCTGAA-GTTTTTSTTTATTTTCTT--AAGTCTACTRGKTGCTATTACTTGCAACATATGTC-AAGTTTGG-CTTTGGTTTTGTTTTG-C-TTTTCCTGGGCTGGTCC-TACT-CC-TTG-AACTCAGGGTC-TAGCC [...]
+
+	Thomomys_bottae_cactophilus  		CAGGACTGGCATACAATGCACAGAAGTC-TCAT-GGACTT-TCCTGTCCAGGC-TGGCTTA-GAACTGTGATCCTC-AGATTTCAGCGAGCTAGGCAGCTAGAATTCTTTAGGTACAAGTTAACATTGATTT--CTTTGTTTTGTTTTGCCCTTGGGGGATTTCCCT-AGGGTTTTAAATCAGGGCCTAGTATACTCTCACGGAAARTTTTTCTTCAGAGCTAGCAGGCTGTAGAATTTGAGCCAAACCTTGATTGCTCATGTTTATTTTTTAAATTTGGGT-GCTGGTACTATGCCTTAAACCCAAGGGCTGGTGCTTCT-ATCTGAA-GTTTTTSTTTATTTTCTT--AAGTCTACTGGGTGCTATTACTTGCAACATATGTC-AAGTTTGG-CTTTGGTTTTGTTTTG-C-TTTTCCTGGGCTGGTCC-TACT-CC-TTG-AACTCAGGGTC-TAGC [...]
+
+	Thomomys_bottae_albatus  		CAGGACTGGCATACAATGCACA-AGGTC-TCAT-GGACTT-TCCTGTCCAGGC-TGGCTTA-GAACTGTGATCCTG-AGATTTCAGCGAGCTAGGCAGCTAGAATTCTTTAGGTACAAGGTAACATTGATTTTTC--TGTTTTGTTTTGCCCTT-GGTGATTTCCCT-AGGGTTTTAAATCAGGGCCTAGTATACTCTCACTGAAARTTTTTCTTCAGAGCTAGCAGGCTGTAGAATTTGAGCCAAACCTTGATTGCTCATGTTTATTTTTWARATTTGGGT-GCTGGTACTATGCCTTAAACCCAAGGGCTGGTGCTTCT-ATCTGAA-GTTTTTSTTTATTTTCTT--AAGTCTACTGGGTGCTATTACTTGCAACATATGTC-AAGTTTGG-CTTTGGTTTTGTTTTG-C-TTTTCCWGGGCTGGTCC-TACT-CC-TTG-AACTCAGGGYC-TAGCCTCT [...]
+
+	Thomomys_bottae_ruidosae  		CAGGACTGGCATACAATGCAGA-AAGTC-TCAT-GGACTT-TCCTGTCCAGGC-TGGCTTA-GAACTGTGATCCTW-AGATTTCAGCGAGCTAGGCAGCTAGAATTCTTTAGGTACAAGGTAACATTGATTTTTC--TGTTTTGTTTTGCCCTTTGGTGATTTWCCT-AGGGTTTTAAATCAGGGCCTAGTATACTCTCACTGAAAGTTTTTCTTCAGAGCTAGCAGGCTGTAGAATTTGAGCCAAACCTTGATTGCTCATGTTTATTTTTWARATTTGGGT-GCTGGTACTATGCCTTAAACCCAAGGGCTGGTGCTTCT-ATCTGAA-GTTTTTCTTTATTTTCTT--AAGTCTACTAGGTGCTATTACTTGCAACATATGTC-AAGTTTGG-CTTTGGTTTTGTTTTG-C-TTTTCCWGGGCTGGTCC-TACT-CC-TTG-AACTCAGGGTC-TAGCCTC [...]
+
+	Thomomys_bottae_bottae  		CAGGACTGGCATACAATGCACA-AAGTC-TCAT-GGACTT-TCCTGTCCAGGC-TGGCTTA-GAACTGTGATCCTY-AGATTTCAGCGAGCTAGGCAGCTAGAATTCTTTAGGTACAAGGTAACATTGATTTTTY--TGTTTTGTTTTGCCCTTGGGGGATTTWCCT-AGGGTTTTAAATCAGGGCCTWGTATACTCTCACTGAAARTTTTTCTTCAGAGCTAGCAGGCTGTAGAATTTGAGCCAAACCTTGATTGCTCATGTTTATTTTTWARATTTGGGT-GCTGGTACTATGCCTTWAACCCAAGGGCTGGTGCTTCT-ATCTGAA-GTTTTTRTTTATTTTCTT--AAGTCTACTRGKTGCTATTACTTGCAACATATGTC-AAGTTTGG-CTTTGGTTTTGTTTTG-C-TTTTCCTGGGCTGGTCC-TACT-CC-TTG-AACTCAGGGTC-TAGCCTCTGGC????
+
+	Thomomys_bottae_alpinus  		CAGGACTGGCATACAATGCACA-AAGTC-TCAT-GGACTT-TCCTGTCCAGGC-TGGCTTA-GAACTGTGATCCTT-AGATTTCAGYGAGCTAGGCAGCTAGAATTCTTTAGGTACAAGGTAACATTGATTTTTY--TGTTTTGTTTTGCCC-TTGGTGATTTACCT-AGGGTTTTAAATCAGGGCCTWGTATACTCTCACTGAAARTTTTTCTTCAGAGCTAGCAGGCTGTAGAATTTGAGCCAAACCTTGATTGCTCATGTTTATTTTTAAGATTTGGGT-GCTGGTACTATGCCTTAAACCCAAGGGCTGGTGCTTCT-ATCTGAA-GTTTTTCTTTATTTTCTT--AAGTCTACTAGTTGCTATTACTTGCAACATATGTC-AAGTTTGG-CTTTGGTTTTGTTTTG-C-TTTTCCTGGGCTGGTCC-TACT-CC-TTG-AACTCAGGGTC-TAGCCTCT [...]
+
+	Thomomys_bottae_riparius  		CAGGACTGGCATACAATGCACA-AAGTC-TCAT-GGCCTT-TCCTGTCCAGGC-TGGCTTA-GAACTATGATCCCC-AGATTTCAGCGAGCTAGGCTGCTAGAATTCTTTAGCTACAATTTAACATTGATTT--CTTTGTTTTGTTTTGCCCTTTGGTGATTTTCCTTAGGGTTTTAAATCAAGGCCTAGTATACTCTCACTGAAAGTTTTTCTTCAGAGCTAGAAGGCTGTAGAATTTGAGCCAAACCTTGATTGCTTATGTTTATTTTTTAAATTTGGGT-GCTGGTACTATGCCTTTAACCCAAGGGCTGGTGCTTCT-ATCTGAA-GTTTTTGTTTATTTTCTT--AAGTCTCCTGGGTGCTATTACTTGCAACATATGTC-AAGTTTGA-CTTTGGTTTTGTTTTG-C-TTTTC-TGGGCTGGTCC-TACT-CC-TTG-AACTCAGGGCC-TAGACTC [...]
+
+	Thomomys_bottae_mewa  			???????GGCATACAATGCACA-AAGTC-TCAT-GGACTT-TCCTGTCCAGGC-TGGCTTA-GAACTGTGATCCTA-AGATTTCAGCGAGCTAGGCAGCTAGAATTCTTTAGGTACAAGGTAACATTGATTTTTC--TGTTTTGTTTTGCCCCTTGGTGATTTTCCT-AGGGTTTTAAATCAGGGCCTAGTATACTCTCACTGAAARTTTTTCTTCAGAGCTAGCAGGCTGTAGAATTTGAGCCAAACCTTGATTGCTCATGTTTATTTTTWAAATTTGGGT-GCTGGTACTATGCCTTAAACCCAAGGGCTGGTGCTTCT-ATCTGAA-GTTTTTCTTTATTTTCTT--AAGTCTACTGGGTGCTATTACTTGCAACATATGTC-AAGTTTGG-CTTTGGTTTTGTTTTG-C-TTTTCCTGGGCTGGTCC-TACT-CC-TTG-AACTCAGGGTC-TAGCCTCTGGCTTTA
+
+	Thomomys_bottae_saxatilis  		CAGGACTGGCATACAATGCACA-AAGTC-TCAT-GGACTT-TCCTGTCCAGGC-TGGCTTA-GAACTGTGATCCTA-AGATTTCAGTGAGCTAGGCAGCTAGAATTCTTTAGGTACAAGGTAACATTGATTTTTT--TGTTTTGTTTTGCCCCTTGGTGATTTACCT-AGGGTTTTAAATCAGGGCCTAGTATACTCTCAYTGAAAGTTTTTCTTCAGAGCTAGCAGGCTGTAGAATTTGAGCCAAACCTTGATTGCTCATGTTTATTTTTAAGATTTGGGT-GCTGGTACTATGCCTTAAACCCAAGGGCTGGTGCTTCT-ATCTGAA-GTTTTTCTTTATTTTCTT--AAGTCTACTGGTTGCTATTACTTGCAACATATGTC-AAGTTTGG-CTTTGGTTTTGTTTTG-C-TTTTCCTGGGCTGGTCC-TACT-CC-TTG-AACTCAGGGTC-TAGCCT [...]
+
+	Thomomys_bottae_laticeps  		CAGGACTGGCATACAATGCACA-AAGTC-TCAT-GGACTT-TCCTGTCCAGGC-TGGCTTA-GAACTGTGATCCTC-AGATTTCAGYGAGCTAGGCAGCTAGAATTCTTTAGGTACAAGGTAACATTGATTTTTC--TGTTTTGTTTTGCCCCTTGGTGATTTWCCT-AGGGTTTTAAATCAGGGCCTAGTATACTCTCACTGAAARTTTTTCTTCAGAGCTAGCAGGCTGTAGAATTTGAGCCAAACCTTGATTGCTCATGTTTATTTTTWARATTTGGGT-GCTGGTACTATGCCTTAAACCCAAGGGCTGGTGCTTCT-MTCTGAA-GTTTTTSTTTATTTTCTT--AAGTCTACTGGKTGCTATTACTTGCAACATATGTC-AAGTTTGG-CTTTGGTTTTGTTTTG-C-TTTTCCTGGGCTGGTCC-TACT-CC-TTG-AACTCAGGGYC-TAGCCTC [...]
+
+	Thomomys_talpoides_ocius   		??????????????????????????????????????????????????????????????GAACTGTGATC-TC-AGATTTCAGCRAGCTAGGCAGCTAGAATTCTTTAGCTACAAGTTAACATTGATTT--CTTTGTTTTGTTTTGCCCTTTGGTGATTTTCCTTAGGGTTTTAAATCAGGGCCTAGTATACTCTCACTGAAAGTTTTTCTTCAGAGGAAGCAGAGTGTAGAAATTGAGACAAACCTTGATTACTCATGTTTATTTTTTAAATTTGGGT-GCTGGTACTATGCCTTAAACCCAAGGGCTGGTGCTTCT-ATCTGAA-GTTTGTGTTTATTTTCTT--AAGTCTACTGGGTGCTATTACTTGCAACAWATGTC-AAGTTTGG-CTTTGGTTTTGTTTTG-C-TTTTCCTGGGCTGGTCC-TACT-CC-TTG-AACTCAGGGCC-TAGCCT [...]
+
+	Thomomys_idahoensis_pygmaeus_a   	CAGGACTGGTATACAGTGCACG-AAGTC-TCAT-GGCCTT-TCCTGTCCAGGC-TGGCTTA-GAACTGTGATCCCC-AGATTTCAGCAAGCTAGGCAGCTAGAATTCTTTAGCTACAAGTTAACATTGATTT--CTTTGTTTTGTTTTGCCCTTTGGTGATTTTCCTTAGGGTTTTAAATCAGGGCCTAGTATACTCTCACTGAAAGTTTTTCTTCAGAGGAAGCAGGCTGTAGAAATTGAGCCAAACCTTGATTACTCATGTTTATTTTTTAAATTTGGGT-GCTGGTACTATGCCTTAAACCCAAGGGCTGGTGCTTCT-ATCTGAA-GTTTGTGTTTATTTTCTT--AAGTCTACTGGGTGCTATTACTTGCAACATATGTC-AAGTTTGG-CTTTGGTTTTGTTTTG-C-TTTTCCTGGGCTGGTCC-TACT-CC-TTG-AACTCAGGGCC-T [...]
+
+	Thomomys_idahoensis_pygmaeus_b   	???????????????????????????????????GCCTT-TCCTGTCCAGGC-TGGCTTA-GAACTGTGATCCCC-AGATTTCAGCAAGCTAGGCAGCTAGAATTCTTTAGCTACAAGTTAACATTGATTT--CTTTGTTTTGTTTTGCCCTTTGGTGATTTTCCTTAGGGTTTTAAATCAGGGCCTAGTATACTCTCACTGAAAGTTTTTCTTCAGAGGAAGCAGGCTGTAGAAATTGAGCCAAACCTTGATTACTCATGTTTATTTTTTAAATTTGGGT-GCTGGTACTATGCCTTAAACCCAAGGGCTGGTGCTTCT-ATCTGAA-GTTTGTGTTTATTTTCTT--AAGTCTACTGGGTGCTATTACTTGCAACATATGTC-AAGTTTGG-CTTTGGTTTTGTTTTG-C-TTTTCCTGGGCTGGTCC-TACT-CC-TTG-AACTCAGGGCC-T [...]
+
+	Thomomys_mazama_mazama   		??????????????????CACG-AAGTCATCAT-GGCCTT-TCCTGTCCAGAGCTGGCTTATAAAGAGTGATCCCC-AGATTTCAGCGAGCTAGGCAGCTAGAATTCTTTAGCTACAAGWTAACATTGATTT--YTTTGTTTTGTTTTGCCCGTTGGTGATTTTCCTTAGGGTTTTAAATCAGGGCCTAGTATACTCTCACTGAAAGTTTTTCTTCAGAGGAAGCAGGCTGTAGAATTTGATCCAAACCTTRATTACTCATGTTTATTTTTGAAATTTGGGTTGCAGGTACTATGCCTTAAACCCAAGGGCTGGTGCTTCT-ATCTGAA-GTTTGTGTTTATTTTCTT--AAGTCTACTGGGTGCTATTACTTGCAACATATGTC-AAGTTTGG-CTTTGGTTTTGTTTTG-CTTTTTCCTGGGCTGGTCCCTACTCCCAT-GAAACTCAGGGCC-TA?????? [...]
+
+	Thomomys_mazama_nasicus   		??????TGGTATACAGTGCACG-AAGTC-TCAT-GGYCTT-TCCTGTCCAGGC-TGGCTTA-GAACTGTGATCCCC-AGATTTCAGCAAGCTAGGCAGCTAGAATTCTTTAGCTACAAGTTAACATTGATTT--CTTTGTTTTGTTTTGCCCKTTGGTGATTTTCCTTAGGGTTTTAAATCAGGGCCTAGTATACTCTCACTGAAAGTTTTTCTTCAGAGGAAGCAGGCTGTARAAATTGAGCCAAACCTTAACTACTCATGTTTATTTTTGAAAWTTGGG-GGCTGGTACTATGCCTTAAACCCAAGGGCTGGGGCTTTT-ATCTGAA-GTTTGTGTTTATTTTCTT--AAGTCTACTGGGTGCTATTACTTGCAACATATGTC-AAGTTTGG-CTTTGGTTTTGTTTTG-C-TTTTCCTGGGCTGGTCC-TACT-CCATTG-AACTCAGGGCC-TAGCCTC [...]
+
+	Thomomys_monticola_a   			CAGGACTGGTATACAGTGCACG-AAGTC-TCAT-GGCCTT-TCCTGTCCAGGC-TGGCTTA-AAACCTTGATCCCC-AGATATCAGCAAGCTAGGCAGCTAGAATTCTTTAGCTACAAGTTAACATTGATTT--CTTTGTTTTGTTTTGCCCTTTGGTGATTTTCCTTAGGGTTTTAAATCAGGGCCTAGTATACTCTCTCTGAAAGTTTTTCTTCAGAGGAAGCAGGCTGTAGAAATTGAGCCAAACCTTGATTACTCATGTTTATTTTTTAAATTTGGGT-GCTGGTACTATGCCTTAAACCCAAGGGCTGGTGCTTCT-ATCTGAA-GTTTGTGTTTATTTTCTT--AAGTCTACTGGGTGCTATTACTTGCAACATATGTC-AAGTTTGG-CTTTGGTTTTGTTTTG-C-TTTTCCTGGGCTGGTCC-TACT-CC-TTG-AACTCAGGGCC-TAGCCTCTGGCTTTT
+
+	Thomomys_monticola_b   			CAGGACTGATATACAGTGCATG-AAGTC-TCTT-GGCCTT-TCCTGTCCAGGC-TGGCTTA-GAACTGTGATCCCC-AGATTTCAGCAAGCTAGGCAGCTAGAATTCTTTAGCTACAAGTTAACATAGATTT--CTTTGTTTTGTTTTGCCCTTTGGTGATTTTCCTTAGGGTTTTAAATCAGGGCCTAGTATACTCTCACTGAAAGTTTT-CTTCAGAGGAAGCAGGCTGTAGAAATTGAGCCAAACCTTGATTACTCATGTTTATTTTTTAAATTTGGGT-GCTGGTACTATGCCTTAAACCCAAGGGCTGGTGCTTCT-ATCTGAA-GTTTGTGTTTATTTTCTT--AAGTCTACTGGGTGCTATTACTTGCAACATATGTC-AAGTTTGG-CTTTGGTTTTGTTTTG-C-TTTTCCTGGGCTGGTCC-TACT-CC-TTG-AACTCAGGGCC-TAGCCTCTGGCTTTT
+
+	Thomomys_talpoides_yakimensis   	CAGGACTGGTATACAGTGCACG-AAGTC-TCAT-GGCCTT-TCCTGTCCAGGC-TGGCTTA-GAACTGTGATCCCC-AGATTTCAGCAAGCTAGGCAGCTAGAATTCTTTAGCTACAAGTTAACATTGATTT--CTTTGTTTTGTTTTGCCCTTTGGTGATTTTCCTTARGGTTTTAAATCAGGGCCTAGTATACTCTCACTGAAAGTTTTTCTTCAGAGGAAGCAGGCTGTAGAAATTGAGCCAAACCTTGATTACTCATGTTTATTTTTTAAATTTGGGT-GCTGGTACTATGCCTTAAACCCAAGGGCTGGTGCTTCT-ATCTGAA-GTTTGTGTTTATTTTCTT--AAGTCTACTGGGTGCTATTACTTGCAACATATGTC-AAGTTTGG-CTTTGGTTTTGTTTTG-C-TTTTCCTGGGCTGGTCY-TACT-CC-TTG-AACTCAGGGCC-TA [...]
+
+	Thomomys_talpoides_bridgeri   		?????????????????????G-AAGTM-TCAT-GGCCTT-TCCTGTCCAGGCATG---TACAGACTGTGATCATCCAGATTTCAGCGAGCTAGGCAGCTAGAATTCTTTAGCTACAAGATAACATTGATTT--YTTTGTTTTGTTTTGCCCTTTGGTGATTTTCCTTAGGGTTTTAAATCAGGGCCTAGTATACTCTCACTGAAAGTTTTTCTTCAGAGGAAGCAGGCTGTAGAAWTTGAGCCAAACCTTGATTACTCATGTTTATTTTTKAAATTTGGGTTGCTGGTACTATGCCTTAAACCCAAGGGCTGGTGCTTCTCATCTGAA-GTTTGTGTTTATTTTCTTCTAAGTCTACTGGGTGCTATTACTTGCAACATATGTCCAAGTTTGGTCTTTGGCTTTTTTTTAACTTTTTCCTGGGCTGGTCC-TTCTTCCAT?????????????????? [...]
+
+	Thomomys_townsendii_townsendii   	CAGGACTGGCATACAATGCACA-AAGTC-TCAT-GGACTT-TCCTGTCCAGGC-TGGCTTA-GAACTGTGATCCCC-AGATTTCAGCGAGCTAGGCTGCTAGAATTCTTTAGCTACAATTTAACATTGATTT--CTTTGTTTTGTTTTGCCCTTGGGTGATTTTCCT-AGGGTTTTAAATCAGGGCCTTGTATACTCTCACTGAAAATTTTTCCTCAGAGCTAGCAGGCTGTAGAATTTGAGCCAAACCTTGATTGCTCATGTTTATTTTTTAAATTTGGGT-GCTGGTACTATGCCTTAAACCCAAGGGCTGGTGCTTCT-ATTTGAA-GTTTTTGTTTATTTTCTT--AAGTCTACTGGGTGCTATTACTTGCAACATATGTC-AAGTTTGG-CTTTGGTTTTGTTTTG-C-TTTTCCTGGGCTGGTCC-TACT-CC-TTG-AACTCAGGGYC-T [...]
+
+	Thomomys_townsendii_relictus   		CAGGACTGGCATACAATGCACA-AAGTC-TCAT-GGACTT-TCCTGTCCAGGC-TGGCTTA-GAACTRTGATCCYC-AGATTTCAGCGAGCTAGGCTGCTAGAATTCTTTAGCTACAATTTAACATTGATTT--CTTTGTTTTGTTTTGCCCTTTGGTGATTTTCCTTAGGGTTTTAAATCAAGGCCTAGTATACTCTCACTGAAAGTTTTTCTTCAGAGCTAGMAGGCTGTAGAATTTGAGCCAAACCTTGATTGCTTATGTTTATTTTTTAAATTTGGGT-GCTGGTACTATGCCTTTAACCCAAGGGCTGGTGCTTCT-ATCTGAA-GTTTTTGTTTATTTTCTT--AAGTCTCCTGGGTGCTATTACTTGCAACATATGTC-AAGTTTGA-CTTTGGTTTTGTTTTG-C-TTTTCCTGGGCTGGTCC-TACT-CY-TTG-AACTCAGGGYC-TA [...]
+
+	Thomomys_umbrinus_chihuahuae   		CAGGACTGGCATACAATGCACA-AAGTC-TCAT-GGMCTT-TCCTGTCCAGGC-TGGCTTA-GAACTGTGATCCCC-AGATTTCAGCGAGCTAGGCTGCTAGAATTCTTTAGCTACAATTTAACATTGATTT--YTTTGTTTTGTTTTGCCCYTTGGTGATTTTCCTTAGGGTTTTAAATCAAGGCCTAGTATACTCTCACTGAAAGTTTTTCTTCAGAGCTAGCAGGCTGTAGAATTTGAGCCAAACCTTGATTGCTCATGTTTATTTTTTAAATTTGGGT-GCTGGTACTATGCCTTTAACCCAAGGGCTGGTGCTTCT-ATYTGAA-GTTTATCTTTATTTTCTT--AAGTCTCCTGGGTGCTATTACYTGCAACATAWGTC-AAGTTTGR-CTTTGGTTTTGKTTTG-C-TTTYC-TGGGCTGGTCC-TACT-CY-TTG-AACTCAGGGYC-TA [...]
+
+	Thomomys_umbrinus_atroavarius   	CAGGACTGGCATACAATGCACA-AAGTC-TCAT-GGMCTT-TCCTGTCCAGGC-TGGCTTA-GAACTGTGATCCYC-AGATTTCAGCGAGCTAGGCTGCTAGAATTCTTTAGCTACAATTTAACATTGATTT--CTTTGTTTTGTTTTGCCCYTTGGTGATTTTCCTTAGGGTTTTAAATCARGGCCTAGTATACTCTCCCTGAAAGTTTTTCTTCAGAGCTAGCAGGCTGTAGAATTTGAGCCAAACCTTGATTGCTCATGTTTATTTTTTAAATTTGGGT-GCTGGTACTAAGCCTTTAACCCAAGGGCTGGTGCTTCT-ATCTGAA-GTTTTTGTTTATTTTYTY--AAGTYTMCTGGGTGSTATTMCYTSCMACMTATGTC-AAGTTTGA-CTTTGGTTTTGTTTTG-C-TTTTCCTGGGCTGGTCC-TACT-CC-TTG-AACTCAGGGCC-TA [...]
+
+
+;
+
+
+END;
+
diff --git a/examples/nexus/72.nex b/examples/nexus/72.nex
new file mode 100644
index 0000000..131036c
--- /dev/null
+++ b/examples/nexus/72.nex
@@ -0,0 +1,64 @@
+#NEXUS
+
+BEGIN DATA;
+	DIMENSIONS  NTAX =26 NCHAR=706;
+	FORMAT DATATYPE = DNA GAP = - MISSING = ?;
+	MATRIX                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      [...]
+	Orthogeomys_heterodus   		?????????????????????????????????????????????????????????????GGAGCCCCTGGCAGCCCATAGACCTGGCCTAGCAGAAGCTCGTCCATTTGCTTCGAGTTGTGGTCCAGAAGATCCAACGTCTCACAGTGCATGGCCAGCTCCGAGGCCAAAGTGCCCACCCGTGGGCGTTTCCGGAAGCCCTCCTCTGCAACCTTCTC-CTTTCATTGCTCCC--C-CTCCTG---------------CT-------------------------CCTCTTCCTCCTCCCCTCTGG-GCTC---------TGGAGCC-CCT---GGTTCCC-------------------------------------CAGGGA-TCT----------GCCCCAGC---AGAAGCTCAGCCA-TT--------TGCTTCGA---GTTGCGCCC-CA--GGAGAA [...]
+																																																																																									    
+	Thomomys_bottae_awahnee_a 		??????????????????????CCCCCCCCTGCTCCTCTTCCTCCTC-TGCTCTGGCCTCTGGATTCCCTGGTTGTCCAGGGGCTTGGCCCAGCAGAAGCTCGGCCATTTGCTTCGAATTGCGGCCCAGGAGAACCAACGTCTCCCAGCGCATGGCCAGCTCCTGGGCCAAAGTGCCCACCAGCGGGTGTTTGCAGAAGCCCTCCACTGTG--CTTCTCACACCCGTGGCTGCCAGCATTTCTGGGGTGATAGGCAGCACTGACAGCAGCCTCAAGGACTGTCGCACTCCCTCCCCGTCTTTTCTAGAGCTCAGGTGCTGCTGGAGCTGCCTCAAGGCTCCCGAAACCCACTCCGTCTGCGTCCCACTCACCACCTCCTCAGGGACTCTCGTGTCACTCACCTTAGCTCCAGGATCC-AGTGGATTACCCCCGGTGCTCTGACACATCACGTCCTCACTGGAT [...]
+																																																																																									    
+	Thomomys_bottae_awahnee_b  		???????????????????????CCCCCCCTGCTCCTCTTCCTCCTC-TGCTCTGGCCTCTGGATTCCCTGGTTGTCCAGGGGCTTGGCCCAGCAGAAGCTCGGCCATTTGCTTCGAATTGCGGCCCAGGAGAACCAACGTCTCCCAGCGCATGGCCAGCTCCTGGGCCAAAGTGCCCACCAGCGGGTGTTTGCAGAAGCCCTCCACTGTG--CTTCTCACACCCGTGGCTGCCAGCATTTCTGGGGTGATAGGCAGCACTGACAGCAGCCTCAAGGACTGTCGCACTCCCTCCCCRTCTTTTCTAGAGCTCAGGTGCTGCTGGAGCTGCCTCAAGGCTCCCGAAACCCACTCCGTCTGCGTCCCACTCACCACCTCCTCAGGGACTCTCGTGTCACTCACCTTAGCTCCAGGATCC-AGTGGATTACCCCCGGTGCTCTGACACATCACGTCCTCACTGGA [...]
+																																																																																									    
+	Thomomys_bottae_xerophilus  		??????????????????????CCCCCCCCTGCTCCTCTTCCTCCTC-TGCTCTGGCCTCTGGATTCCCTGGTTGTCCAGGGGCTTGGCCCAGCAGAAGCTCGGCCATTTGCTTCGAATTGCGGCCCAGGAGAACCAACGTCTCCCAGCGCATGGCCAGCTCCTGGGCCAAAGTGCCCACCAGCGGGTGTTTGCAGAAGCCCTCCACTGTG--CTTCTCACACCCGTGGCTGCCAGCATTTCTGGGGTGATAGGCAGCACTGACAGCAGCCTCAAGGACTGTCGCACTCCCTCCCCRTCTTTTCTAGAGCTCAGGTGCTGCTGGAGCTGCCTCAAGGCTCCCGAAACCCACTCCGTCTGCGTCCCACTCACCACCTCCTCAGGGACTCTCGTGTCACTCACCTTAGCTCCAGGATCC-AGTGGATTACCCCCGGTGCTCTGACACATCACGTCCTCACTGG [...]
+																																																																																									    
+	Thomomys_bottae_cactophilus  		??????????????????????CCCCCCCCTGCTCCTCTTCCTCCTC-TGCTCTGGCCTCTGGATTCCCTGGTTGTCCAGGGGCTTGGCCCAGCAGAAGCTCGGCCATTTGCTTCGAATTGCGGCCCAGGAGAACCAACGTCTCCCAGCGCATGGCCAGCTCCTGGGCCAAAGTGCCCACCAGCGGGTGTTTGCAGAAGCCCTCCACTGTG--CTTCTCACACCCGTGGCTGCCAGCATTTCTGGGGTGATAGGCAGCACTGACAGCAGCCTCAAGGACTGTCGCACTCCCTCCCCRTCTTTTCTAGAGCTCAGGTGCTGCTGGAGCTGCCTCAAGGCTCCCGAAACCCACTCCGTCTGCGTCCCACTCACCACCTCCTCAGGGACTCTCGTGTCACTCACCTTAGCTCCAGGATCC-AGTGGATTACCCCCGGTGCTCTGACACATCACGTCCTCACTG [...]
+																																																																																									    
+	Thomomys_bottae_albatus  		???????????????????????CCCCCCCTGCTCCTCTTCCTCCTC-TGCTCTGGCCTCTGGATTCCCTGGTTGTCCAGGGGCTTGGCCCAGCAGAAGCTCGGCCATTTGCTTCGAATTGCGGCCCAGGAGAACCAACGTCTCCCAGCGCATGGCCAGCTCCTGGGCCAAAGTGCCCACCAGCGGGTGTTTGCAGAAGCCCTCCACTGTG--CTTCTCACACCCGTGGCTGCCAGCATTTCTGGGGTGATAGGCAGCACTGACAGCAGCCTCAAGGACTGTCGCACTCCCTCCCCATCTTTTCTAGAGCTCAGGTGCTGCTGGAGCTGCCTCAAGGCTCCCGAAACCCACTCCGTCTGCGTCCCACTCACCACCTCCTCAGGGACTCTCGTGTCACTCACCTTAGCTCCAGGATCC-AGTGGATTACCCCCGGTGCTCTGACACATCACGTCCTCACTGGATG [...]
+																																																																																									    
+	Thomomys_bottae_ruidosae  		??????????????????????CCCCCCCCTGCTCCTCTTCCTCCTC-TGCTCTGGCCTCTGGATTCCCTGGTTGTCCAGGGGCTTGGCCCAGCAGAAGCTCGGCCATTTGCTTCGAATTGCGGCCCAGGAGAACCAACGTCTCCCAGCGCATGGCCAGCTCCTGGGCCAAAGTGCCCACCAGCGGGTGTTTGCAGAAGCCCTCCACTGTG--CTTCTCACACCCGTGGCTGCCAGCATTTCTGGGGTGATAGGCAGCACTGACAGCAGCCTCAAGGACTGTCGCACTCCCTCCCCRTCTTTTCTAGAGCTCAGGTGCTGCTGGAGCTGCCTCAAGGCTCCCGAAACCCACTCCGTCTGCGTCCCACTCACCACCTCCTCAGGGACTCTCGTGTCACTCACCTTAGCTCCAGGATCC-AGTGGATTACCCCCGGTGCTCTGACACATCACGTCCTCACTGGAT [...]
+																																																																																									    
+	Thomomys_bottae_bottae  		??????????????????????CCCCCCCCTGCTCCTCTTCCTCCTC-TGCTCTGGCCTCTGGATTCCCTGGTTGTCCAGGGGCTTGGCCCAGCAGAAGCTCGGCCATTTGCTTCGAATTGCGGCCCAGGAGAACCAACGTCTCCCAGCGCATGGCCAGCTCCTGGGCCAAAGTGCCCACCAGCGGGTGTTTGCAGAAGCCCTCCACTGTG--CTTCTCACACCCGKGGCTGCCAGCATTTCTGGGGTGATAGGCAGCACTGACAGCAGCCTCAAGGACTGTCGCACTCCCTCCCCKTCTTTTCTAGAGCTCAGGTGCTGCTGGAGCTGCCTCAAGGCTCCCGAAACCCACTCCGTCTGCGTCCCACTCACCACCTCCTCAGGGACTCTCGTGTCACTCACCTTAGCTCCAGGATCC-AGTGGATTACCCCCGGTGCTCTGACACATCACGTCCTCACTGGATGA [...]
+																																																																																									    
+	Thomomys_bottae_alpinus  		??????????????????????CCCCCCCCTGCTCCTCTTCCTCCTC-TGCTCTGGCCTCTGGATTCCCTGGTTGTCCAGGGGCTTGGCCCAGCAGAAGCTCGGCCATTTGCTTCGAATTGCGGCCCAGGAGAACCAACGTCTCCCAGCGCATGGCCAGCTCCTGGGCCAAAGTGCCCACCAGCGGGTGTTTGCAGAAGCCCTCCACTGTG--CTTCTCACACCCGTGGCTGCCAGCATTTCTGGGGTGATAGGCAGCACTGACAGCAGCCTCAAGGACTGTCGCACTCCCTCCCCRTCTTTTCTAGAGCTCAGGTGCTGCTGGAGCTGCCTCAAGGCTCCCGAAACCCACTCCGTCTGCGTCCCACTCACCACCTCCTCAGGGACTCTCGTGTCACTCACCTTAGCTCCAGGATCC-AGTGGATTACCCCCGGTGCTCTGACACATCACGTCCTCACTGGATG [...]
+																																																																																									    
+	Thomomys_bottae_riparius  		???????????????????????CCCCCCCTGCTCCTCTTCCTCCTC-TGCTCTGGCCTCTGGATTCCCTGGTTGTCCAGGGGCTTGGCCCAGCAAAAGCTCGGCCATTTGCTTCGAATTGCGGCCCAGGAGAACCAACGTCTCCCAGCGCATGGCCAGCTCCTGGGCCAAAGTGCCCACCAGCGGGTGTTTGCAGAAGCCCTCCACTGTG--CTTCTCACACCCGTGGCTGCCAGCATTTCTGGGGTGATAGGCAGCACTGACAGCAGCCTCAAGGACTGTCGCACTCCCTCCCCATCTTTTCTAGAGCTCAGGTGCTGCTGGAGCTGCCTCAAGGCTCCCGAAACCCACTCCGTCTGCGTCCCACTCACCACCTCCTCAGGGACTCTCGTGTCACTCACCTTAGCTCCAGGATCC-AGTGGATTACCCCCGGTGCTCTGACACATCACGTCCTCACTGGAT [...]
+																																																																																									    
+	Thomomys_bottae_mewa  			??????????????????????CCCCCCCCTGCTCCTCTTCCTCCTC-TGCTCTGGCCTCTGGATTCCCTGGTTGTCCAGGGGCTTGGCCCAGCAGAAGCTCGGCCATTTGCTTCGAATTGCGGCCCAGGAGAACCAACGTCTCCCAGCGCATGGCCAGCTCCTGGGCCAAAGTGCCCACCAGCGGGTGTTTGCAGAAGCCCTCCACTGTG--CTTCTCACACCCGTGGCTGCCAGCATTTCTGGGGTGATAGGCAGCACTGACAGCAGCCTCAAGGACTGTCGCACTCCCTCCCCRTCTTTTCTAGAGCTCAGGTGCTGCTGGAGCTGCCTCAAGGCTCCCGAAACCCACTCCGTCTGCGTCCCACTCACCACCTCCTCAGGGACTCTCGTGTCACTCACCTTAGCTCCAGGATCC-AGTGGATTACCCCCGGTGCTCTGACACATCACGTCCTCACTGGATGAC [...]
+																																																																																									    
+	Thomomys_bottae_saxatilis  		???????????????????????CCCCCCCTGCTCCTCTTCCTCCTC-TGCTCTGGCCTCTGGATTCCCTGGTTGTCCAGGGGCTTGGCCCAGCAGAAGCTCGGCCATTTGCTTCGAATTGCGGCCCAGGAGAACCAACGTCTCCCAGCGCATGGCCAGCTCCTGGGCCAAAGTGCCCACCAGCGGGTGTTTGCAGAAGCCCTCCACTGTG--CTTCTCACACCCGTGGCTGCCAGCATTTCTGGGGTGATAGGCAGCACTGACAGCAGCCTCAAGGACTGTCGCACTCCCTCCCCGTCTTTTCTAGAGCTCAGGTGCTGCTGGAGCTGCCTCAAGGCTCCCGAAACCCACTCCGTCTGYGTCCCACTCACCACCTCCTCAGGGACTCTCGTGTCACTCACCTTAGCTCCAGGATCC-AGTGGATTACCCCCGGTGCTCTGACACATCACGTCCTCACTGGA [...]
+																																																																																									    
+	Thomomys_bottae_laticeps  		??????????????????????CCCCCCCCTGCTCCTCTTCCTCCTC-TGCTCTGGCCTCTGGATTCCCTGGTTGTCCAGGGGCTTGGCCCAGCAGAAGCTCGGCCATTTGCTTCGAATTGCGGCCCAGGAGAACCAACGTCTCCCAGCGCATGGCCAGCTCCTGGGCCAAAGTGCCCACCAGCGGGTGTTTGCAGAAGCCCTCCACTGTG--CTTCTCACACCCGTGGCTGCCAGCATTTCTGGGGTGATAGGCAGCACTGACAGCAGCCTCAAGGACTGTCGCACTCCCTCCCCGTCTTTTCTAGAGCTCAGGTGCTGCTGGAGCTGCCTCAAGGCTCCCGAAACCCACTCCGTCTGYGTCCCACTCACCACCTCCTCAGGGACTCTCGTGTCACTCACCTTAGCTCCAGGATCC-AGTGGATTACCCCCGGTGCTCTGACACATCACGTCCTCACTGGAT [...]
+																																																																																									    
+	Thomomys_talpoides_ocius   		?????CTTCTCCTTCCATTGCTCCCCCTCCTGCTCCTCTTCCTCCTC-CGCTCTGGCCTCTGGATTCCCTGGCTGTCCAGGGACTTGGCCCAGCAGAAGCTCGGCCATTTGCTTCGAGTTGCGGCCCAGGAGAACCAACGTCTGCCAGCGCATGGCCAGCTCCTGGGCCAAAGTGCCCACCAGCGGGTGTTTGCAGAAGCCCTCCACTGTG--CTTCTCACACCCGTGGCTGCCAGCATTTCTGGGGTGATGGGCAGCACTGAGAGCAGCCGCAAGGACTGTCGCACCCCCTCCCCGTCTTTTCTAGAGCTCAGGTGCTGCTGGAGCTGCCTCAAGGCTCCCGACACCCACTCCGTCTGCGTCCCACTCACCACCTCCTCAGGGACTCTCGTGTCACTCACCTCAGCTCCAGGATCC-AGCGGGTTACCCGCGGTGCTCTGGCACATCACGTCCTCACTGGA [...]
+																																																																																									    
+	Thomomys_idahoensis_pygmaeus_a   	GCAACCTTCTCCTTCCATTGCTCCCCCTCCTGCTCCTCTTCCTCCTC-CGCTCTGGCCTCTGGATTCCCTGGCTGTCCAGGGACTTGGCCCAGCAGAAGCTCGGCCATTTGCTTCGAGTTGCGGCCCAGGAGAACCAACGTCTGCCAGCGCATGGCCAGCTCCTGGGCCAAAGTGCCCACCAGCGGGTGTTTGCAGAAGCCCTCCACTGTG--CTTCTCACACCCGTGGCTGCCAGCATTTCTGGGGTGATGGGCAGCACTGAGAGCAGCCGCAAGGACTGTCGCACGCCCTCCCCGTCTTTTCTAGAGCTCAGGTGCTGCTGGAGCTGCCTCAAGGCTCCCGACACCCACTCCGTCTGCGTCCCACTCACCACCTCCTCAGGGACTCTTGTATCACTCACCTCAGCTCCAGGATCC-AGCGGGTTACCCGCGGTGCTCTGGCACATCACGTCCTCA [...]
+																																																																																									    
+	Thomomys_idahoensis_pygmaeus_b   	?CAACCTTCTCCTTCCATTGCTCCCCCTCCTGCTCCTCTTCCTCCTC-CGCTCTGGCCTCTGGATTCCCTGGCTGTCCAGGGACTTGGCCCAGCAGAAGCTCGGCCATTTGCTTCGAGTTGCGGCCCAGGAGAACCAACGTCTGCCAGCGCATGGCCAGCTCCTGGGCCAAAGTGCCCACCAGCGGGTGTTTGCARAAGCCCTCCACTGTG--CTTCTCACACCCGTGGCTGCCAGCATTTCTGGGGTGATGGGCAGCACTGARAGCAGCCGCAAGGACTGTCGCACRCCCTCCCCGTCTTTTCTAGAGCTCAGGTGCTGCTGGAGCTGCCTCAAGGCTCCCGACACCCACTCCGTCTGCGTCCCACTCACCACCTCCTCAGGGACTCTTGTATCACTCACCTCAGCTCCAGGATCC-AGCGGGTTACCCGCGGTGCTCTGGCACATCACGTCCTCA [...]
+																																																																																									    
+	Thomomys_mazama_mazama   		??CACCTTCTCCTTCCATTGCTCCCCCTCCTGCTCCTCTTCCTCCTC-CGCTCTGGCCTCTGGATTCCCTGGCTGTCCAGGGACTTGGCCCAGCAGAAGCTCGGCCATTTGCTTCGAGTTGCGGCCCAGGAGAACCAACGTCTGCCAGCGCATGGCCAGCTCCTGGGCCAAAGTGCCCACCAGCGGGTGTTTGCAGAAGCCCTCCACTGTG--CTTCTCACACCCGTGGCTGCCAGCATTTCTGGGGTGATGGGCAGCACTGAGAGCAGCCGCAAGGACTGTCGCACCCCCTCCCCGTCTTTTCTAGAGCTCAGGTGCTGCTGGAGCTGCCTCAAGGCTCCCGACACCCACTCCGTCTGCGTCCCACTCACCACCTCCTCAGGGACTCTYGTGTCACTCACCTCAGCTCCAGGATCC-AGCGGGTTACCCGCGGTGCTCTGGCACATCACGTCCTCACTGGATG [...]
+																																																																																									    
+	Thomomys_mazama_nasicus   		GCAACCTTCTCCTTCCATTGCTCCCCCTCCTGCTCCTCTTCCTCCTC-CGCTCTGGCCTCTGGATTCCCTGGCTGTCCAGGGACTTGGCCCAGCAGAAGCTCGGCCATTTGCTTTGAGTTGCGGCCCAGGAGAACCAACGTCTGCCAGCGCATGGCCAGCTCCTGGGCCAAAGTGCCCACCAGCGGGTGTTTGCAGAAGCCCTCCACTGTG--CTTCTCACACCCGTGGCTGCCAGCATTTCTGGGGTGATGGGCAGCACTGAGAGCAGCCGCAAGGACTGTCGCACCCCCTCCCCGTCTTTTCTAGAGCTCAGGTGCTGCTGGAGCTGCCTCAAGGCTCCCGACACCCACTCCGTCTGCGTCCCACTCACCACCTCCTCAGGGACTCTYGTGTCACTCACCTCAGCTCCAGGATCC-AGCGGGTTACCCGCGGTGCTCTGGCACATCACGTCCTCACTGGAT [...]
+																																																																																									    
+	Thomomys_monticola_a   			?????????????TTCATTGCTCCCCCTCCTGCTCCTCTTCCTCCTC-CGCTCTGGCCTCTGGATTCCCTGGCTGTCCAGGGACTTGGCCCAGCAGAAGCTCGGCCATTTGCTTCGAGTTGCGGCCCAGGAGAACCAACGTCTGCCAGCGCATGGCCAGCTCCTGGGCCAAAGTGCCCACCAGCGGGTGTTTGCAGAAGCCCTCCACTGTG--CTTCTCACACCCGTGGCTGCCAGCATTTGTGGGGTGATGGGCAGCACTGAGAGCAGCCGCAAGGACTGTCGCACCCCCTCCCCGTCTTTTCTAGAGCTCAGGTGCTGCTGGAGCTGCCTCAAGGCTCCCGACACCCACTCCGTCTGCGTCCCACTCACCACCTCCTCAGGGACTCTCGTGTCACTCACCTCAGCTCCAGGATCC-AGCGGGTTACCCGCGGTGCTCTGGCACATCACGTCCTCACTGGATGA [...]
+																																																																																									    
+	Thomomys_monticola_b   			GCAACCTTCTCCTTCCATTGCTCCCCCTCCTGCTCCTCTTCCTCCTC-CGCTCTGGCCTCTGGATTCCCTGGCTGTCCAGGGACTTGGCCCAGCAGAAGCTCGGCCATTTGCTTCGAGTTGCGGCCCAGGAGAACCAACGTCTGCCAGCGCATGGCCAGCTCCTGGGCCAAAGTGCCCACCAGCGGGTGTTTGCAGAAGCCCTCCACTGTG--CTTCTCACACCCGTGGCTGCCAGCATTTGTGGGGTGATGGGCAGCACTGAGAGCAGCCGCAAGGACTGTCGCACCCCCTCCCCGTCTTTTCTAGAGCTCAGGTGCTGCTGGAGCTGCCTCAAGGCTCCCGACACCCACTCCGTCTGCGTCCCACTCACCACCTCCTCAGGGACTCTCGTGTCACTCACCTCAGCTCCAGGATCC-AGCGGGTTACCCGCGGTGCTCTGGCACATCACGTCCTCACTGGATGA [...]
+																																																																																									    
+	Thomomys_talpoides_yakimensis   	??????????????????????????????????????????????????????GGCCTCTGGATTCCCTGGCTGTCCAGGGACTTGGCCCAGCAGAAGCTCGGCCATTTGCTTCGAGTTGCGGCCCAGGAGAACCAACGTCTGCCAGCGCATGGC-AGCTCCTGGGCCAAAGTGCCCACCAGCGGGTGTTTGCAGAAGCCCTCCACTGTG--CTTCTCACACCCGTGGCTGCCAGCATTTCTGGGGTGATGGGCAGCACTGAGAGCAGCCGCAAGGACTGTCGCACCCCCTCCCCRTCTTTTCTAGAGCTCAGGTGCTGCTGGAGCTGCCTCAAGGCTCCCGACACCCACTCCGTCTGCGTCCCACTCACCACCTCCTCAGGGAYTCTCGTGTCACTCACCTCAGCTCCAGGATCC-AGCGGGTTACCCGCGGTGCTCTGGCACATCACGTCCTCAC [...]
+																																																																																									    
+	Thomomys_talpoides_bridgeri   		GCAACCTTCTCCTTTCATTGCTCCCCCTCCTGCTCCTCTTCCTCCTC-CGCTCTGGCCTCTGGATTCCCTGGCTGTCCAGGGACTTGGCCCAGCAGAAGCTCGGCCATTTGCTTCGAGTTGCGGCCCAGGAGAACCAACGTCTGCCAGCGCATGGCCAGCTCCTGGGCCAAAGTGCCCACCAGCGGGTGTTTGCAGAAGCCCTCCACTGTG--CTTCTCACACCCGTGGCTGCCAGCATTTCTGGGGTGATGGGCAGCACTGAGAGCAGCCGCAAGGACTGTCRCACCYCCTCCCYGTCTTTTCTAGAGCTCAGGTGCTGCTGGAGCTGCCTCAAGGCTCCCGACACCCACTCCGTCTGCGTCCCACTCACCACCTCCTCAGGGACTCTCGTGTCACTCACCTCAGCTCCAGGATCC-AGCGGGTTACCCGCGGTGCTCTGGCACATCACGTCCTCACT [...]
+																																																																																									    
+	Thomomys_townsendii_townsendii   	GCAACCTTCTCCTTCCATTGCTCCCCCCCCTGCTCCTCTTCCTCCTC-TGCTCTGGCCTCTGGATTCCCTGGYTGTCCAGGGGCTTGGCCCAGCAGAAGCTCGGCCATTTGCTTCGAATTGCGGCCCAGGAGAACCAACGTCTCCCAGCGCATGGCCAGCTCCTGGGCCAAAGTGCCCACCAGCGGGTGTTTGCAGAAGCCCTCCACTGTG--CTTCTCACACCCGTGGMTGCCAGCATTTCTGGGGTGATAGGCAGCACTGACAGCAGCCTCAAGGACTGTCGCACTCCCTCCCCGTCTTTTCTAGAGCTCAGGTGCTGCTGGAGCTGCCTCAAGGCTCCCGAAACCCACTCCGTCTGCGTCCCACTCACCACCTCCTCAGGGACTCTCGTGTCACTCACCTTAGCTCCAGGATCC-AGTGGATTACCCCCGGTGCTCTGACACATCACGTCCTCA [...]
+																																																																																									    
+	Thomomys_townsendii_relictus   		GCAACCTTCTCCTTTCATTGCTCCCCCCCCTGCTCCTCTTCCTCCTC-TGCTCTGGCCTCTGGATTCCCTGGTTGTCCAGGGGCTTGGCCCAGCAGAAGCTCGGCCATTTGCTTCGAATTGCGGCCCAGGAGAACCAACGTCTCCCAGCGCATGGCCAGCTCCTGGGCCAAAGTGCCCACCAGCGGGTGTTTGCAGAAGCCCTCCACTGTG--CTTCTCACACCCGTGGATGCCAGCATTTCTGGGGTGATAGGCAGCACTGACAGCAGCCTCAAGGACTGTCGCACTCCCTCCCCGTCTTTTCTAGAGCTCAGGTGCTGCTGGAGCTGCCTCAAGGCTCCCGAAACCCACTCCGTCTGCGTCCCACTCACCACCTCCTCAGGGACTCTCGTGTCACTCACCTTAGCTCCAGGATCC-AGTGGATTACCCCCGGTGCTCTGACACATCACGTCCTCAC [...]
+																																																																																									    
+	Thomomys_umbrinus_chihuahuae   		GCAACCTTCTCCTTCCATTGCTCCCCCCCCTGCTCCTCTTCCTCCTC-TGCTCTGGCCTCTGGATTCCCTGGCTGTCCAGGGGCTTGGCCCAGCAGAAGCTCGGCCATTTGCTTCGAATTGCGGCCCAGGAGAACCAACGTCTCCCAGCGCATGGCCAGCTCCTGGGCCAAAGTGCCCACCAGCGGGTGTTTGCAGAARCCCTCCACTGTG--CTTCTCACACCCGTGGCTGCCAGCATTTCTGGGGTGATAGGCAGCACTGACAGCAGCCTCAAGGACTGTCGCACTCCCTCCCCGTCTTTTCTAGAGCTCAGGTGCTGCTGGAGCTGCCTCAAGGCTCCCGAAACCCACTCCGTCTGCGTCCCACTCACCACCTCCTCAGGGACTCTCGTGTCACTCACCTTAGCTCCAGGATCC-AGTGGATTACCCCCGGTGCTCTGACACATCACGTCCTCAC [...]
+																																																																																									    
+	Thomomys_umbrinus_atroavarius   	GCCACCTTCTCCTTCCATTGCTCCCCCCCCTGCTCCTCTTCCTCCTC-TGCTCTGGCCTCTGGATTCCCTGGCTGTCCAGGGGCTTGGCCCAGCAGAAGCTCGGCCATTTGCTTCGAATTGCGGCCCAGGAGAACCAACGTCTCCCAGCGCATGGCCAGCTCCTGGGCCAAAGTGCCCACCAGCGGGTGTTTGCAGAAGCCCTCCACTGTG--CTTCTCACACCCGTGGCTGCCAGCATTTCTGGGGTGATAGGCAGCACTGACAGCAGCCTCAAGGACTGTCGCACTCCCTCCCCGTCTTTTCTAGAGCTCAGGTGCTGCTGGAGCTGCCTCAAGGCTCCCGAAACCCACTCCGTCTGCGTCCCACTCACCACCTCCTCAGGGACTCTCGTGTCACTCACCTTAGCTCCAGGATCC-AGTGGATTACCCCCGGTGCTCTGACACATCACGTCCTCAC [...]
+																																																																																										    
+
+;
+
+
+END;
+
diff --git a/examples/nexus/Darwins-finches.nex b/examples/nexus/Darwins-finches.nex
new file mode 100644
index 0000000..7684d75
--- /dev/null
+++ b/examples/nexus/Darwins-finches.nex
@@ -0,0 +1,46 @@
+#NEXUS
+begin taxa;
+	dimensions ntax=16;
+	taxlabels
+	AF_110423_C_olivacea[&description=" Certhidea olivacea mitochondrial control region, partial sequence"]
+	AF_109015_C_olivacea[&description=" Certhidia olivacea strain DRQ41 mitochondrial control region, partial sequence"]
+	AF_109025_C_olivacea[&description=" Certhidea olivacea strain CO10001 mitochondrial control region, partial sequence"]
+	AF_109060_C_parvulus[&description=" Camarhynchus parvulus strain DRT92-61 mitochondrial control region, partial sequence"]
+	AF_109018_C_parvulus[&description=" Camarhynchus parvulus strain DR91 mitochondrial control region, partial sequence"]
+	AF_109019_C_parvulus[&description=" Camarhynchus parvulus strain DR95 mitochondrial control region, partial sequence"]
+	AF_109037_G_magnirostris[&description=" Geospiza magnirostris strain DRT1241 mitochondrial control region, partial sequence"]
+	AF_109067_G_magnirostris[&description=" Geospiza magnirostris strain D13 mitochondrial control region, partial sequence"]
+	AF_109053_G_fortis[&description=" Geospiza fortis strain DRT51-41 mitochondrial control region, partial sequence"]
+	AF_109052_G_fortis[&description=" Geospiza fortis strain DRQ51101 mitochondrial control region, partial sequence"]
+	AF_109035_G_magnirostris[&description=" Geospiza magnirostris strain DRF11800 mitochondrial control region, partial sequence"]
+	AF_109028_G_fortis[&description=" Geospiza fortis strain gft0001 mitochondrial control region, partial sequence"]
+	AF_109036_G_magnirostris[&description=" Geospiza magnirostris strain DRS11103 mitochondrial control region, partial sequence"]
+	AF_109016_G_magnirostris[&description=" Geospiza magnirostris strain DR17 mitochondrial control region, partial sequence"]
+	AF_109027_G_fortis[&description=" Geospiza fortis strain gft0004 mitochondrial control region, partial sequence"]
+	AF_109034_G_magnirostris[&description=" Geospiza magnirostris strain DRQ1284 mitochondrial control region, partial sequence"]
+;
+end;
+
+begin characters;
+	dimensions nchar=1123;
+	format datatype=dna missing=? gap=-;
+	matrix
+	AF_110423_C_olivacea	ATAGCCAACGTCATACGTCATGCCCCTCCACCAAAAGCCCAAACATTATCTCCAAAACGGACCTCATTCGGCCAACACACCTACCAGGCACATTCTTGCTTCAGGTACCATACAGCCCAAATGCGTCTACCTACAGCCAAGCCGCAAGCGTCACCCAAAGACCCAGGAACTTATCTACTGTACATACCCCTCGACCTCGAAAACGACTACCGTCACAGTACACCTTTGAATTCCCCTAGTCTACTGAATTCGCCCACCTCCTAGGTACAATTCTTCACCAACAGCCTTCAAGCACTCCCAAGCCAGAGGACATGGTTATCTATTGATCGCGCTTCTCACGAGAACCGAGCTACTCAACGTCGAAAGTACCCTACGTTATTGCCCTGCAGGCGCATACATCTCCTAACCTTGCTCTTTTGCGCTATTGGTTGTAACTTCAGGAACATACCTGACAAACTTCCCTCCTCCTT [...]
+	AF_109015_C_olivacea	ATAGCCAACGTCATACGTCATGCCCCTCCACCAAAAGCCCAAACATTATCTCCAAAACGGACCTCATTCGGCCAACACACCTACCAGGCACATTCTTGCTTCAGGTACCATATAGCCCAAATGCGTCTACCTACAGCCGAGCCGCAAGCGTCACCCAAAGACCCAGGAACTTATCTACTGTACATACCCCTCAACCTCGAAAACGACTACCGTCACAGTACACCTTTGAATTCCCCTAGTCTACTGAATTCGCCCACCTCCTAGGTACAATTCTTCACCAACAGCCTTCAAGCACTCCCAAGCCAGAGGACATGGTTATCTATTGATCGCGCTTCTCACGAGAACCGAGCTACTCAACGTCGAAAGTACCCTACGTTATTGCCCTGCAGGCGCATACATCTCCTAACCTTGCTCTTTTGCGCTATTGGTTGTAACTTCAGGAACATACCTGA-AAACTTCCCTCCTCCTT [...]
+	AF_109025_C_olivacea	ATAGCCAACGTCATACGTCATGCCCCTCCACCAAAAGCCCAAACATTATCTCCAAAACGGACCTCATTCGGCCAACACACCTACCAGGCACATTCTTGCTTCAGGTACCATATAGCCCAAATGCGTCTACCTACAGCCGAGCCGCAAGCGTCACCCAAAGACCCAGGAACTTATCTACTGTACATACCCCTCAACCTCGG-AACGACTACCGTCACAGTACACCTTTGAATTCCCCTAGTCTACTGAATTCGCCCACCTCCTAGGTACAATTCTTCACCAACAGCCTTCAAGCACTCCCAAGCCAGAGGACATGGTTATCTATTGATCGCGCTTCTCACGAGAACCGAGCTACTCAACGTCGAAAGTACCCTACGTTATTGCCCTGCAGGCGCATACATCTCCTAACCTTGCTCTTTTGCGCTATTGGTTGTAACTTCAGGAACATACCTGAC-AAATTCCCTCCTCCTT [...]
+	AF_109060_C_parvulus	ATAGCCAACGTCATACGTCATGCCCCTCCACCAAAAGCCCAAACATTATCTCCAAAACGGACCTCATTCGGCCAACACACCCACCAGGCACATTCTTGCTTCAGGTACCATATAGCCCAAATGCGTCTACCTACAGCCAAGCCGCAAGCGTCACCCAAAGACCCAGGAACTTATCTACTGTACACACCTCCCAACCTCGGAAACGACTATTGTCACAGTACACCTTTGAATTCCCCTAGTCTACTGAATTCGCCCACCTCCTAGGTACGATTCTTCACCAACAACCTTCAAGCACTCCCAAGCCAGAGGACATGGTTATCTATTGATCGCGCTTCTCACGAGAACCGAGCTACTCAACGTCTAAGGTACCCTACGTTATTGCCCTGCAGGCGCATACATCTCCTAACCTTGCTCTTTTGCGCTATTGGTTGTAACTTCAGGAACATACCTGACGAA-TTCCCTCCTCCTT [...]
+	AF_109018_C_parvulus	ATAGCCAACGTCATACGTCATGCCCCTCCACCAAAAGCCCAAACATTATCTCCAAAACGGACCTCATTCGGCCAACACACCCACCAGGCACATTCTTGCTTCAGGTACCATATAGCCCAAATGCGTCTACCTACAGCCAAGCCGCAAGCGTCACCCAAAGACCCAGGAACTTATCTACTGTACACACCTCCCAACCTCGGAAATGACTATTGTCACAGTACACCTTTGAATTCCCCTAGTCTACTGAATTCGCCCACCTCCTAGGTACGATTCTTCACCAACAGCCTTCAAGCACTCCCAAGCCAGAGGACATGGTTATCTATTGATCGCGCTTCTCACGAGAACCGAGCTACTCAACGTCTAAAGTACCCTACGTTATTGCCCTGCAGGCGCATACATCTCCTAACCTTGCTCTTTTGCGCTATTGGTTGTAACTTCAGGAACATACCTGACGAA-TTCCCTCCTCCTT [...]
+	AF_109019_C_parvulus	ATAGCCAACGTCATACGTCATGCCCCTCCACCAAAAGCCCAAACATTATCTCCAAAACGGACCTCATTCGGCCAACACACCCACCAGGCACATTCTTGCTTCAGGTACCATATAGCCCAAATGCGTCTACCTACAGCCAAGCCGCAAGCGTCACCCAAAGACCCAGGAACTTATCTACTGTACACACCTCCCAACCTCGGAAACGACTATTGTCACAGTACACCTTTGAATTCCCCTAGTCTACTGAATTCGCCCACCTCCTAGGTACGATTCTTCACCAACAGCCTTCAAGCACTCCCAAGCCAGAGGACATGGTTATCTATTGATCGCGCTTCTCACGAGAACCGAGCTACTCAACGTCTAAGGTACCCTACGTTATTGCCCTGCAGGCGCATACATCTCCTAACCTTGCTCTTTTGCGCTATTGGTTGTAACTTCAGGAACATACCTGACGAA-TTCCCTCCTCCTT [...]
+	AF_109037_G_magnirostris	ATAGCCAACGTCATACGTCATGCCCCTCCACCAAAAGCCCAAACATTATCTCCAAAACGGACCTCATTCGGCCAACACACCTACCAGGCACATTCTTGCTTCAGGTACCATATAGCCCAAATGCGTCTACCTACAGCCAAGCCGCAAGCGTCACCCAAAGACCCAGGAACTTATCTACTATACACACTTCCCAACCTCGGAAACGACTATTGTCACAGTACACCTTTGAATTCCCCTAGTCTACTGAATTCGCCCACCTCCTAGGTACGATTCTTCACCAACAGCCTTCAAGCACTCCCAAGCCAGAGGACATGGTTATCTATTGATCGCGCTTCCCACGAGAACCGAGCTACTCAACGTCTAAGGTACCCTACGTTATTGCCCTGCAGGCGCATACATCTCCTAACCTTGCTCTTTTGCGCTATTGGTTGTAACTTCAGGAACATACCTGACGAA-TTCCCTCCT [...]
+	AF_109067_G_magnirostris	ATAGCCAACGTCATACGTCATGCCTCTCCACCAAAAGCCCAAACATCTCCTCCAAAACGGACCTCATTCGGCCATCACACCTACCAGGCACATTCTTGCTTCAGGTACCATATAGCCCAAATGCGTCTACCTACGGCCAAGCCGCAAGCGTCACCCAAAGACCCAGGAACTTATCTACTATACACACTTCCCAACCTCGGAAACGACTATTGTCACAGTACACCTTTGAATTCCCCTAGTCTACTGAATTCGCCCACCTCCTAGGTACGATTCTTCACCAACAGCCTTCAAGCACTCCCAAGCCAGAGGACATGGTTATCTATTGATCGCGCTTCTCACGAGAACCGAGCTACTCAACGTCTAAAGTACCCTACGTTATTGCCCTGCAGGCGCATACATCTCCTAACCTTGCTCTTTTGCGCTATTGGTTGTAACTTCAGGAACATACCTGACGAA-TTCCCTCCT [...]
+	AF_109053_G_fortis	ATAGCCAACGTCATACGTCATGCCCCTCCACCAAAAGCCCAAACATTATCTCCAAAACGGACCTCATTCGGCCAACGCACCTACCAGGCACATTCTTGCTTCAGGTACCATATAGCCCAAATGCGTCTACCTACAGCCAAGCCGCAAGCGTCACCCAAAGACCCAGGAACTTATCTACTATACACACTTCCCAACCTCGGAAACGACTATTGTCACAGTACACCTTTGAATTCCCCTAGTCTACTGAATTCGCCCACCTCCTAGGTACGATTCTTCACCAACAGCCTTCAAGCACTCCCAAGCCAGAGGACATGGTTATCTATTGATCGCGCTTCTCACGAGAACCGAGCTACTCAACGTCTAAAGTACCCTACGTTATTGCCCTGCAGGCGCATACATCTCCTAGCCTTGCTCTTTTGCGCTATTGGTTGTAACTTCAGGAACATACCTGACGAA-TTCCCTCCTCCTTGC [...]
+	AF_109052_G_fortis	ATAGCCAACGTCATACGTCATGCCCCTCCACCAAAAGCCCAAACATTATCTCCAAAACGGACCTCATTCGGCCAACACACCTACCAGGCACATTCTTGCTTCAGGTACCATATAGCCCAAATGCGTCTACCTACAGCCAAGCCGCAAGCGTCACCCAAAGACCCAGGAACTTATCTACTATACACACTTCCCAACCTCGGAAACGACTATTGTCACAGTACACCTTTGAATTCCCCTAGTCTACTGAATTCGCCCACCTCCTAGGCACGATTCTTCACCAACAGCCTTCAAGCACTCCCAAGCCAGAGGACATGGTTATCTATTGATCGCGCTTCTCACGAGAACCGAGCTACTCAACGTCTAAAGTACCCTACGTTATTGCCCTGCAGGCGCATACATCTCCTAACCTTGCTCTTTTGCGCTATTGGTTGTAACTTCAGGAACATACCTGACGAA-TTCCCTCCTCCTTGC [...]
+	AF_109035_G_magnirostris	ATAGCCAACGTCATACGTCATGCCCCTCCACCAAAAGCCCAAACATTATCTCCAAAACGGACCTCATTCGGCCAACACACCTACCAGGCACATTCTTGCTTCAGGTACCATATAGCCCAAATGCGTCTACCTACAGCCAAGCCGCAAGCGTCACCCAAAGACCCAGGAACTTATCTACTATACACACTTCCCAACCTCGGAAACGACTATTGTCACAGTACACCTTTGAATTCCCCTAGTCTACTGAATTCGCCCACCTCCTAGGTACGATTCTTCACCAACAGCCTTCAAGCACTCCCAAGCCAGAGGACATGGTTATCTATTGATCGCGCTTCTCACGAGAACCGAGCTACTCAACGTCTAAAGTACCCTACGTTATTGCCCTGCAGGCGCATACATCTCCTAACCTTGCTCTTTTGCGCTATTGGTTGTAACTTCAGGAACATACCTGACGAA-TTCCCTCCT [...]
+	AF_109028_G_fortis	ATAGCCAACGTCATACGTCATGCCCCTCCACCAAAAGCCCAAACATTATCTCCAAAACGGACCTCATTCGGCCAACACACCTACCAGGCACATTCTTGCTTCAGGTACCATATAGCCCAAATGCGTCTACCTACAGCCAAGCCGCAAGCGTCACCCAAAGACCCAGGAACTTATCTACTATACACACTTCCCAACCTCGGAAACGACTATTGTCACAGTACACCTTTGAATTCCCCTAGTCTACTGAATTCGCCCACCTCCTAGGTACGATTCTTCACCAACAGCCTTCAAGCACTCCCAAGCCAGAGGACATGGTTATCTATTGATCGCGCTTCTCACGAGAACCGAGCTACTCAACGTCTAAAGTACCCTACGTTATTGCCCTGCAGGCGCATACATCTCCTAACCTTGCTCTTTTGCGCTATTGGTTGTAACTTCAGGAACATACCTGACGAA-TTCCCTCCTCCTTGC [...]
+	AF_109036_G_magnirostris	ATAGCCAACGTCATACGTCATGCCCCTCCACCAAAAGCCCAAACATTATCTCCAAAACGGACCTCATTCGGCCAACACACCTACCAGGCACATTCTTGCTTCAGGTACCATATAGCCCAAATGCGTCTACCTACAGCCAAGCCGCAAGCGTCACCCAAAGACCCAGGAACTTATCTACTATACACACTTCCCAACCTCGGAAACGACTATTGTCACAGTACACCTTTGAATTCCCCTAGTCTACTGAATTCGCCCACCTCCTAGGTACGATTCTTCACCAACAGCCTTCAAGCACTCCCAAGCCAGAGGACATGGTTATCTATTGATCGCGCTTCTCACGAGAACCGAGCTACTCAACGTCTAAAGTACCCTACGTTATTGCCCTGCAGGCGCATACATCTCCTAACCTTGCTCTTTTGCGCTATTGGTTGTAACTTCAGGAACATACCTGACGAA-TTCCCTCCT [...]
+	AF_109016_G_magnirostris	ATAGCCAACGTCATACGTCATGCCCCTCCACCAAAAGCCCAAACATTATCTCCAAAACGGACCTCATTCGGCCAACACACCTACCAGGCACATTCTTGCTTCAGGTACCATATAGCCCAAATGCGTCTACCTACAGCCAAGCCGCAAGCGTCACCCAAAGACCCAGGAACTTATCTACTATACACACTTCCCAACCTCGGAAACGACTATTGTCACAGTACACCTTTGAATTCCCCTAGTCTACTGAATTCGCCCACCTCCTAGGTACGATTCTTCACCAACAGCCTTCAAGCACTCCCAAGCCAGAGGACATGGTTATCTATTGATCGCGCTTCTCACGAGAACCGAGCTACTCAACGTCTAAAGTACCCTACGTTATTGCCCTGCAGGCGCATACATCTCCTAACCTTGCTCTTTTGCGCTATTGGTTGTAACTTCAGGAACATACCTGACGAA-TTCCCTCCT [...]
+	AF_109027_G_fortis	ATAGCCAACGTCATACGTCATGCCCCTCCACCAAAAGCCCCAACATTATCTCCAAAACGGACCTCATTCGGCCAACACACCTACCAGGCACATTCTTGCTTCAGGTACCATATAGCCCAAATGCGTCTACCTACAGCCAAGCCGCAAGCGTCACCCAAAGACCCAGGAACTTATCTACTATACACACTTCCCAACCTCGGAAACGACTATTGTCACAGTACACCTTTGAATTCCCCTAGTCTACTGAATTCGCCCACCTCCTAGGTACGATTCTTCACCAACAGCCTTCAAGCACTCCCAAGCCAGAGGACATGGTTATCTATTGATCGCGCTTCTCACGAGAACCGAGCTACTCAACGTCTAAAGTACCCTACGTTATTGCCCTGCAGGCGCATACATCTCCTAACCTTGCTCTTTTGCGCTATTGGTTGTAACTTCAGGAACATACCTGACGAA-TTCCCTCCTCCTTGC [...]
+	AF_109034_G_magnirostris	ATAGCCAACGTCATACGTCATGCCCCTCCACCAAAAGCCCAAACATTATCTCCAAAACGGACCTCATTCGGCCAACACACCTACCAGGCACATTCTTGCTTCAGGTACCATATAGCCCAAATGCGTCTACCTACAGCCAAGCCGCAAGCGTCACCCAAAGACCCAGGAACTTATCTACTATACACACTTCCCAACCTCGGAAACGACTATTGTCACAGTACACCTTTGAATTCCCCTAGTCTACTGAATTCGCCCACCTCCTAGGTACGATTCTTCACCAACAGCCTTCAAGCACTCCCAAGCCAGAGGACATGGTTATCTATTGATCGCGCTTCTCACGAGAACCGAGCTACTCAACGTCTAAAGTACCCTACGTTATTGCCCTGCAGGCGCATACATCTCCTAACCTTGCTCTTTTGCGCTATTGGTTGTAACTTCAGGAACATACCTGACGAA-TTCCCTCCT [...]
+
+;
+end;
diff --git a/examples/nexus/Dengue4.env.nex b/examples/nexus/Dengue4.env.nex
new file mode 100644
index 0000000..ece25e4
--- /dev/null
+++ b/examples/nexus/Dengue4.env.nex
@@ -0,0 +1,54 @@
+#NEXUS
+
+BEGIN DATA;
+	DIMENSIONS NTAX=17 NCHAR=1485;
+	FORMAT MISSING=? GAP=- DATATYPE=DNA;
+	MATRIX
+D4Brazi82       ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGG [...]
+D4ElSal83       ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGG [...]
+D4ElSal94       ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTGGTGCTAGAACATGGAGGATGCGTCACAACCATAGCCCAGGGAAAACCAACCTTGGATTTTGAATTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGGAATGGCTGTGGCTTGCTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGATACCCATGCAGTAGGAAATGACACATCCAATCATGG [...]
+D4Indon76       ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTAAAAGAGGAACAAGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGG [...]
+D4Indon77       ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTAAAAGAGGAACAAGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTAGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAACCATGG [...]
+D4Mexico84      ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTAGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGCTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGG [...]
+D4NewCal81      ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGG [...]
+D4Philip64      ATGCGATGCGTGGGAGTGGGGAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATTTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCGATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAACCTTATCTCAAAGAGGAACAAGATCAACAGTACATCTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGATACATCCAACCATGG [...]
+D4Philip56      ATGCGATGCGTGGGAGTGGGGAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATTTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCGATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAACCTTATCTCAAAGAGGAACAAGATCAACAGTACATCTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGCTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTAGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACATATCCAACCATGG [...]
+D4Philip84      ATGCGATGCGTAGGAGTGGGGAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACTTAGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAAGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCGATATCAAACATAACCACGGCAACAAGATGCCCAACGCAAGGAGAACCTTATCTCAAAGAGGAACAAGATCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTCTCATGCTCGGGAAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATATACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAACCATGG [...]
+D4PRico86       ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGGGAGCCCTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATCTGGTCCAAATTGAGAACCTTGAGTACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGG [...]
+D4SLanka78      ATGCGATGCGTGGGAGTGGGGAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAAGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCCATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAGCCCTGTCTCAAAGAGGAACAGGATCAACAGTACATCTGCCGGAGAGACGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCCTGCTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACAGGCAACTTAGTCCGAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAACCACGG [...]
+D4Tahiti79      ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGG [...]
+D4Tahiti85      ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTTTCAGGTGGAGCATGGGTCGATTTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATCTGGTCCAAATTGAGAACCTTGAATACACAGTGGTCATAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGG [...]
+D4Thai63        ATGCGATGCGTAGGAGTGGGGAACAGGGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCTCAAGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCGATATCAAACATAACCACGGCGACAAGATGTCCAACGCAAGGAGAGCCTTATCTCAAAGAGGAACAAGATCAACAGTACATCTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTACTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACAGGCAACTTGGTTCGAATTGAGAACCTTGAATACACAGTGGTTGTGACAGTCCACAACGGAGACACCCATGCAGTAGGAAATGACATATCCAACCATGG [...]
+D4Thai78        ATGCGATGCGTAGGAGTGGGGAACAGAGACTTTGTAGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCCATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTACCTCAAAGAGGAACAAGATCAACAGTACATCTGCCGGAGAGACGTGGTAGATAGAGGGTGGGGCAACGGCTGTGGCTTGCTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACAGGCAACTTAGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCTGTAGGAAATGATACATCCAACCACGG [...]
+D4Thai84        ATGCGATGCGTAGGAGTAGGGAACAGAGACTTTGTAGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAGGGAAAACCAACCCTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCCATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTACCTCAAAGAGGAACAAGATCAACAGTACATCTGCCGGAGAGACGTGGTAGACAGAGGGTGGGGCAACGGCTGTGGCTTGTTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACGGGCAACTTAGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCTGTAGGAAATGATACATCCAACCACGG [...]
+	;
+END;
+
+BEGIN CALIBRATION;
+	OPTIONS SCALE = years;
+		
+	TIPCALIBRATION
+		94 = 1994:D4ElSal94,
+		86 = 1986:D4PRico86,
+		85 = 1985:D4Tahiti85,
+		84 = 1984:D4Mexico84 D4Philip84 D4Thai84,
+		82 = 1982:D4Brazi82,
+		83 = 1983:D4ElSal83,
+		81 = 1981:D4NewCal81,
+		79 = 1979:D4Tahiti79,
+		78 = 1978:D4SLanka78 D4Thai78,
+		77 = 1977:D4Indon77,
+		76 = 1976:D4Indon76,
+		64 = 1964:D4Philip64,
+		63 = 1963:D4Thai63,
+		56 = 1956:D4Philip56
+		;
+END;
+
+Begin RHINO;
+	NUCMODEL TYPE=HKY;
+	TREEMODEL TYPE=TIPDATES;
+	SITEMODEL TYPE=GA;
+	CPPARTITIONMODEL SUBSTMODEL=TRUE;
+End;
+
diff --git a/examples/nexus/FPV.nex b/examples/nexus/FPV.nex
new file mode 100644
index 0000000..293bf58
--- /dev/null
+++ b/examples/nexus/FPV.nex
@@ -0,0 +1,15 @@
+#NEXUS 
+
+Begin data;
+	Dimensions ntax=7 nchar=1434;
+	Format datatype=nucleotide gap=-;
+	Matrix
+CanineOralPV   ATGGCAAGGAAAAGACGCGCAGCCCCTCAAGATATATACCCTGCTTGTAAAGTGTCCAACACTTGCCCCGCTGATATTTTGAATAAAATGGAGCAAAATACGCTTGCAGATAAAATCCTCAAATATGGTAGTGCTGGTGTTTTTTTGGGGGGTCTAGGAATATCAACAGGCAAAGGGGTAGGGGGGCGCACAGGTTACATTCCTTTGGGAAGTGGAGTGGGTGTAGGCACAAGGGTCACAACAATAAGACCTACTGTCCCAATAAGCAGTGTGGGGTCTCCTGACTTTATTCCTGTAGATGCAGTAGACCCTCTAGGGCCTGCAGTCATACCCCCAGAAAGATTTCCTATAGCAGTAGAGGATCCTTTTACTCTACCTCCACCACGTTTCCCAACTGCAGTAGAAGAAGATGTAATTGAGCTGCAGCCTATTGGCCCTAAGATTACCACTGATGCTCAGCCTGCAATATTGGAAGTC [...]
+FelisPV1       ATGCTTAGGCAAAAACGTGCAGCCCCAAAAGATATTTACCCACAATGCAAGATATCCAACACCTGCCCGCCCGACATCCTGAATAAAGCTGAGCAAAACACGCTTGCAGATAAAATTTTAAAATATGGCTCTGCTGGTGTTTTTTTGGGGAGTCTGGGTATTGGGACGGGGCGTGGGACCGGGGGATCCTTGGGCTATGTGCCATTAGGCCAGGGGGTGCGTTTGGGGACTCGGGTGACTACAGTTAGGCCCACCCTGCCTGTGAGTAGTGTAGGCACTACAGATGTAATCCCTGTGGACGCTGTGGATCCTTTGGGGCCTGCAGTGCTTCCAGGCAGAATTTTTCCAACAGCTGTAGAAGATCCTGTCACTATTCAGCCCCCTAGATTTCCCTCTGTGGTGGACGAA---CCTGTAACTGTCTCCACACCCACACCTAAGGTGACCACAGATGCACAGCCTGCAGTGCTGGAAGTT [...]
+LynxPV1        ATGCTACGGCGAAAACGTGCAGCCCCCCATGATATCTACCCCCAATGCAAAATCTCCAACACCTGCCCGCCCGATATTCTCAATAAAGCTGAGCAAAACACGCTTGCAGATAAAATTTTAAGATATGGCTCTGCTGGTGTTTTTTTGGGTAGTTTGGGGATTGGTACAGGGCGTGGGTCTGGGGGGACATTAGGCTATGTGCCTGTTGGCCAGGGGGTGAGATTGGGAACGAGGGTGACCACAGTGAGGCCCACCCTGCCAATCAGCAGTGTTGGCAGTGCTGATGTGATCCCTATTAATGCAGTGGATCCTTTGGGGCCTGCAGTGCTTCCAGGTGATTATTTTCCCACTGCTGTAGAAGATCCTGTTGTCATACAGCCCCCACGGTTTCCTTCTGTTGTGGAGGAC---CCTGTGCCCGCGCAGTCCGAAACGCCCAAGGTGACCACTGATGGGCAACCAGCTGTCCTGGAAGTA [...]
+PumaPV1        ATGCTTAGGCGAAAACGTGCAGCCCCCAAAGATATTTACCCCCAATGCAAAATCTCCAACACCTGCCCACCCGATGTACTCAATAAAGCTGAGCAAAGCACGCTTGCAGATAAAATTTTAAAATATGGCTCTGCTGGTGTTTTTTTGGGGAGTCTGGGAATTGGTACGGGGCGTGGGTCAGGGGGAACTTTGGGATATGTGCCTGTGGGACAAGGGGTTCGCCTGGGAACACGTGTGTCAACTGTGAGGCCCTCATTGCCAATAAGCAGTGTGGGCACTGCAGATGTCATTCCCATAGATGCAGTAGATCCTTTGGGGCCTGCAGTGCTACCTGGCAATGTGTTTCCCACAGCTGTTGAAGACCCCTTCACAATTCAGCCCCCACGCTTTCCTTCTATTGTTGAAGAG---CCTGTGAGTGTGCACTCTGAAACACCCAAGGTGACCATAGATGGTCAGCCTGCTGTGCTGGAAGTA [...]
+RacoonPV1      ATGACTCGCAAACGCCGCGCCGCTCCTCGTGATATATACCCCTCTTGCAAACTGGCAAATACTTGTCCTCCTGATATTGTCGACTCGATTGAAAATAATACTTTGGCAGATAAGATCCTAAAATATGGTAGTGCTGGTGTTTTTTTTGGGAGTCTGGGGATTGGCACTGGGAGGGGTACTGGGGGTAGCACTGGCTACATTCCTCTGGGAGCTGGGGTGCGGCTGAACACGAGGGTGTCCACAGTGAGGCCTAGCTTGCCCATAAGCAGTGTACATCCCACTGATGTCATTCCAGTCGATGCTGTGGATCCTTTGGGTCCTGCAATCGTCCCATTATCAGAGCTGCCCTCCATAGTTGAGGACCCGGATCCTATACTACCCCCTCGCTTTCCCACTGCTGTTGAGGAAAGTGTCATAGACTTTTCACCTGCTTCTCCAAAGGTCACCACAACAGACACCTCAGCACTCATAGAGGTT [...]
+AsianLionPV1   ATGCTAAGGCGAAAACGTGCAGCCCCCTCAGATATCTACCCCCAATGCAAAATTTCCAATACCTGCCCCCCTGATATACTCAATAAAGCTGAGCAAAACACGCTTGCAGATAAAATTTTAAAATATGGTTCGGCTGGTGTTTTTTTGGGAAGTTTGGGAATCAGCACTGGGCGAGGGACGGGGGGCTCATATGGCTATGTGCCTGTTGGACAAGGGGTGCGGTTAGGAACCAGAGTCTCAACTGTCAGGCCTACATTGCCTATTAGCAGCGTGGGCACTGCTGATGTGATTCCTGTGGATGCTGTAGATCCTTTGGGACCAGCAGTTCTTCCAGGAAATGTGTTTCCCACAGCTGTAGAAGACCCTATTCCTATACAACCTCCCAGATTTCCTTCAGTTGTTGAGGAC---CTTCTTCCTGTGCAGCCAGAAACACCCAAAGTGACAACAGATGGACAACCAGCAGTATTAGAAGTT [...]
+SnowLeopardPV1 ATGCTAAGGCGAAAACGTGCAGCCCCTTCTGATATTTACCCACAATGCAAAATTTCCAATACCTGCCCGCCTGACATACTCAATAAAGCTGAGCAAAACACGCTTGCAGATAAAATTTTAAAATATGGATCGGCTGGTGTTTTTTTGGGGAGTCTGGGAATTAGTACTGGGCGAGGGACGGGGGGCTCCTATGGGTACGTGCCTGTTGGGCAGGGAGTGCGGTTGGGGACACGGGTGTCAACGGTCAGACCTACTCTCCCTATCAGCAGTGTGGGCTCTGCAGACGTGATTCCTGTTGATGCAGTGGATCCACTGGGGCCTGCTGTTCTTCCAGGCAATGTTTTCCCCACGGCTGTCGAAGACCCTGTCACTATCCAACCTCCCCGATTTCCATCCATCGTTGAGGAC---CTTCTACCTGTGCAACCTGAGACTCCCAAAGTAACCACAGATGATCAGCCAGCGGTGCTCGAGGTG [...]
+	;
+End;
diff --git a/examples/nexus/Flu.nex b/examples/nexus/Flu.nex
new file mode 100644
index 0000000..4e39941
--- /dev/null
+++ b/examples/nexus/Flu.nex
@@ -0,0 +1 @@
+#NEXUS

Begin DATA;
	Dimensions ntax=21 nchar=1698;
	Format datatype=dna gap=-;
	Matrix
	[                                         1         11        21        31        41        51        61        71        81        91        101       111       121       131       141       151       161       171       181       191       201       211       221       231       241       251       261       271       281       291       301       311       321       331       341       351       361       371       381       391       401       411       421       431       441        [...]
	[                                         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |          [...]
	TREESPARROW_HENAN_1_2004                  ATGGAGAAAATAGTGCTTCTTCGTGCAATGATCAATCTTGTTAAAAGTGATCAGATTGGCGTTGGTTACCATGCAGACTACTCGACAGAGCAGGGTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCTCAAGACATATTGGAAAAGACACACAACGGGAAGCTCTGCGACCTAGATGGAGTGAAGCCTCTAATTTTGAAAGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCAATGTGTGACGAATTCATCAATGTGCCGGAGTGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTACCCAGGGGATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAAAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCGATCATGAAGCCTCATCAGGGGTGAGCTCAGCA [...]
	HUMAN_VIETNAM_CL105_2005                  ATGGAGAAAATAGTGCTTCTTTTTGCGATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGCGATCTAGATGGAGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTACTCGGAAACCCAATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGTCAATCCAGTCAATGACCTCTGTTACCCAGGGGTTTTCAATGACTATGAAGAATTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAGTCATGAAGCCTCATTAGGGGTGAGCTCAGTA [...]
	TREESPARROW_HENAN_4_2004                  ATGGAGAAAATAGTGCTTCTTCTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGCAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGCGATCTAGATGGAGTGAAACCTCTAATTTTAAGAGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCAATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTACCCAGGGGATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCGATCATGAAGCCTCATCAGGGGTGAGCTCAGCA [...]
	CHICKEN_HEBEI_326_2005                    ATGGAGAGAATAGTGCTTCTTCTTGCAATAATCGGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCTCAAGACATACTGGAGAAGACACACAACGGGAAGCTCTGCAACCCAGATGGAGTGAAGCCTCTAATTTTGAAAGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCAATGTGTGACGAATTTATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGGCCTCTGTTACCCAGGGGATTTCAATGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCGATCATGGAGCCTCATCAGGGGTGAGCTCAGCA [...]
	CHICKEN_HONGKONG_915_1997                   ATGGAGAAAATAGTGCTTCTTCTTGCAACAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAATGTTACTGTTACACATGCCCAAGACATACTGGAAAGGACACACAACGGGAAGCTCTGCGATCTAAATGGAGTGAAACCTCTCATTTTGAGGGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCTATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTATCCAGGGAATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAATCATGATGCCTCATCAGGGGTGAGCTCAG [...]
	VIETNAM_3062_2004                         ATGGAGAAAATAGTGCTTCTTTTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGCGATCTAGATGGAGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCAATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAATCCAGTCAATGACCTCTGTTACCCAGGGGATTTCAATGACTATGAAGAATTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAGTCATGAAGCCTCATTAGGAGTGAGCTCAGCA [...]
	GOOSE_HONGKONG_W355_1997                    ATGGAGAAAATAGTGCTTCTTCTTGCAACAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAATGTTACTGTTACACATGCCCAAGACATACTGGAAAGGACACACAACGGGAAGCTCTGCGATCTAAATGGAGTGAAACCTCTCATTTTGAGGGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCTATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTATCCAGGGAATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAATCATGATGCCTCATCAGGGGTTAGCTCAG [...]
	DUCK_HONGKONG_Y283_1997                     ATGGAGAAAATAGTGCTTCTTCTTGCAACAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAATGTTACTGTTACACATGCCCAAGACATACTGGAAAGGACACACAACGGGAAGCTCTGCGATCTAAATGGAGTGAAACCTCTCATTTTGAGGGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCTATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTATCCAGGGAATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAATCATGATGCCTCATCAGGGGTTAGCTCAG [...]
	DUCK_VIETNAM_376_2005                     ATGGAGAAAATAGTGCTTCTTTTTGCGATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCAACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGCGATCTAGATGGAGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCAATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAATCCAGTCAATGACCTCTGTTACCCAGGGGATTTCAATGACTATGAAGAATTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAGTCATGAAGCCTCATTAGGAGTGAGCTCAGCA [...]
	MALLARD_VIETNAM_16_2003                   ATGGAGAAAATAGTGCTTCTTTTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGCGATCTAGATGGAGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCAATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAATCCAGTCAATGACCTCTGTTACCCAGGGGATTTCAATGAATATGAAGAATTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAGTCATGAAGCCTCATTAGGGGTGAGCTCAGCA [...]
	CHICKEN_THAILAND_KANCHANABURI_CK_160_2005 ATGGAGAAAATAGTGCTTCTTTTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCAACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGTGATCTAGATGGAGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTCCTTGGAAACCCAATGTGTGATGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAATCCAGCCAATGACCTCTGTTACCCAGGGGATTTCAATGACTATGAAGAATTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAGTCATGAAGCCTCATTAGGAGTGAGCTCAGCA [...]
	DUCK_GUANGZHOU_20_2005                    ATGGAGAAAATAGTGCTTCTTCTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAATGGGAAGCTCTGCGACCTAGATGGGGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTCCTCGGGAACCCAATGTGTGACGAATTCATCAATGTACCGGAATGGTCTTACATAGTGGAGAAGGCCAATCCAGCCAATGACCTCTGTTACCCAGGTGATTTCAACGATTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAACCATGAATCCTCATCAGGGGTGAGCTCAGCA [...]
	CK_HK_WF157_2003                          ATGGAGAAAATAGTGCTTCTTCTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACCCACAACGGGAAGCTCTGCGACCTAGATGGAGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTCCTCGGGAACCCAATGTGTGACGAATTCATCAATGTACCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCATCCAATGACCTCTGTTACCCAGGGGATTTCAACAATTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGCTCTTGGTCCAATCATGAAGCCTCATCAGGGGTGAGCTCAGCA [...]
	SWINE_ANHUI_2004                          ATGGAGAAAATAGTGCTTCTTCTTGCAATAGTCAGTCTTGTTAAAGGTGATCAGATTTGCACTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCTCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGCGACCTAGATGGAGTGAAGCCTCTAATTTTAAGAGATTGTAGTGTAGCTGGATGGCTCCTCGGGAACCCAATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAATCCAGCCAATGACCTCTGTTACCCAGGGGATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCGATCATGAAGCCTCATCAGGGGTGAGCTCAGCA [...]
	DUCK_VIETNAM_272_2005                     ATGGAGAAAATAGTGCTTCTTTTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGCGATCTAGATGGAGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTCCTTGGAAATCCAATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAATCCAGTCAATGACCTCTGTTACCCAGGGGATTTCAATGACTATGAAGAATTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGCCCAGTCATGAAGCCTCATTAGGGGTGAGCTCAGCA [...]
	HONGKONG_1997_1998                            ------------------------------------------------GACCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGATACAATAATGGAAAAGAATGTTACTGTTACACATGCCCAAGACATACTGGAAAGGACACACGACGGGAAGCTCTGCGATCTAAATGGAGTGAAACCTCTCATTTTGAGGGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCTATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTATCCAGGGAATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAATCATGATGCCTCATCAGGGGTGAGCTC [...]
	GOOSE_SHANTOU_2216_2005                   ATGGAGAAAATAGTGCTTCTTCTTGCAATAATCAGCCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAATGGGAAGCTCTGCGACTTAGATGGGGTGAAGCCTCTAATTTTGAGAGACTGTAGTGTAGCTGGATGGCTCCTCGGGAACCCAATGTGTGACGAATTCATCAATGTACCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTACCCAGGTGATTTCAACGATTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAATCATGAAGCCTCATCAGGGGTGAGCTCAGCA [...]
	TREESPARROW_HENAN_3_2004                  ATGGAGAAAATAGTGCTTCTTCTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACTATAATGGAAAAGAACGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAACGGGAAGCTCTGCGATCTAGATGGAGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCAATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTACCCAGGGGATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCGGATCATCCCCAAAAGTTCTTGGTCCAATCATGATGCCTCATCAGGGGTGAGCTCAGCA [...]
	PEREGRINEFALCON_HK_D0028_2004             ATGGAGAAAATAGTGCTTCTTCTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAATGTTACTGTTACACATGCCCAAGACATACTGGAAAAGACACACAATGGGAAGCTCTGTGACCTAGATGGGGTGAAGCCTCTAATTTTGAGAGATTGTAGTGTCGCTGGATGGCTCCTCGGGAACCCAATGTGTGACGAATTCATCAATGTACCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTACCCAGGTGATTTCAACGATTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAATCATGAAGCCTCATCAGGGGTGAGCTCAGCA [...]
	TREESPARROW_HENAN_2_2004                  ATGGAGAAAATAGTGCTTCTTCTTGCAATAGTCAGTCTTGTTAAAAGTGATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAACGTTACTGTTACACATGCTCAAGACATATTGGAAAAGACACACAACGGGAAGCTCTGCGACCTAGATGGAGTGAAGCCTCTAATTTTGAAAGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCAATGTGTGACGAATTCATCAATGTGCCGGAGTGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTACCCAGGGGATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAAAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCGATCATGAAGCCTCATCAGGGGTGAGCTCAGCA [...]
	HONGKONG_538_1997                           ------------------------------------------------GATCAGATTTGCATTGGTTACCATGCAAACAACTCGACAGAGCAGGTTGACACAATAATGGAAAAGAATGTTACTGTTACACATGCCCAAGACATACTGGAAAGGACACACAACGGGAAGCTCTGCGATCTAAATGGAGTGAAACCTCTCATTTTGAGGGATTGTAGTGTAGCTGGATGGCTCCTCGGAAACCCTATGTGTGACGAATTCATCAATGTGCCGGAATGGTCTTACATAGTGGAGAAGGCCAGTCCAGCCAATGACCTCTGTTATCCAGGGAATTTCAACGACTATGAAGAACTGAAACACCTATTGAGCAGAATAAACCATTTTGAGAAAATTCAGATCATCCCCAAAAGTTCTTGGTCCAATCATGATGCCTCATCAGGGGTGAGCTCAG [...]

;
End;

\ No newline at end of file
diff --git a/examples/nexus/M243.nex b/examples/nexus/M243.nex
new file mode 100644
index 0000000..45f69bd
--- /dev/null
+++ b/examples/nexus/M243.nex
@@ -0,0 +1,214 @@
+#NEXUS
+[!This data set was downloaded from TreeBASE, a relational database of phylogenetic knowledge. TreeBASE has been supported by the NSF, Harvard University, Yale University, SDSC and UC Davis. Please do not remove this acknowledgment from the Nexus file.
+
+
+Generated on December 29, 2014; 2:38 GMT
+
+TreeBASE (cc) 1994-2008
+
+Study reference:
+Miller S., & Buyck B. 2002. Molecular phylogeny of the genus Russula in Europe with
+a comparison of modern infrageneric classifications. Mycological Research, 106(3):
+259-276.
+
+TreeBASE Study URI:  http://purl.org/phylo/treebase/phylows/study/TB2:S824]
+
+BEGIN TAXA;
+        TITLE  Consensus;
+        DIMENSIONS NTAX=89;
+        TAXLABELS
+            Albatrellus_flettii
+            Gloeocystidiellum_aculeatum
+            Russula_adulterina
+            Russula_adusta
+            Russula_amethystina
+            Russula_amoenicolor
+            Russula_amoenipes
+            Russula_aquosa
+            Russula_archaea
+            Russula_atropurpurea2
+            Russula_aurantiaca
+            Russula_aurata2
+            Russula_azurea
+            Russula_betularum
+            Russula_caerulea
+            Russula_camarophylla
+            Russula_cessans1
+            Russula_chloroides
+            Russula_clariana
+            Russula_claroflava
+            Russula_consobrina
+            Russula_cuprea2
+            Russula_curtipes
+            Russula_cyanoxantha
+            Russula_decolorans1
+            Russula_delica
+            Russula_drimeia
+            Russula_emetica
+            Russula_exalbicans2
+            Russula_farinipes
+            Russula_fellea
+            Russula_foetens
+            Russula_gracillima
+            Russula_grisea2
+            Russula_helodes
+            Russula_heterophylla
+            Russula_ilicis
+            Russula_insignis
+            Russula_integra2
+            Russula_integriformis
+            Russula_laricina
+            Russula_laurocerasi
+            Russula_lepida
+            Russula_lepidicolor
+            Russula_lilacea
+            Russula_littoralis
+            Russula_maculata
+            Russula_melitodes
+            Russula_melliolens
+            Russula_melzeri
+            Russula_messapica
+            Russula_mustelina
+            Russula_nana
+            Russula_nauseosa
+            Russula_nigricans
+            Russula_nitida2
+            Russula_ochroleuca
+            Russula_odorata
+            Russula_olivacea
+            Russula_pallidospora2
+            Russula_paludosa
+            Russula_parazurea
+            Russula_pascua
+            Russula_pectinata
+            Russula_pectinatoides
+            Russula_persicina
+            Russula_pseudointegra
+            Russula_puellaris2
+            Russula_puellula2
+            Russula_pulverulenta4
+            Russula_queletii
+            Russula_raoultii
+            Russula_risigallina
+            Russula_romellii2
+            Russula_rosea2
+            Russula_roseipes
+            Russula_rubra
+            Russula_sanguinea
+            Russula_sphagnophila3
+            Russula_turci
+            Russula_velenovskyi
+            Russula_versicolor
+            Russula_vesca1
+            Russula_vinosa
+            Russula_violacea
+            Russula_violeipes
+            Russula_virescens1
+            Russula_viscida
+            Russula_xerampelina2
+            ;
+END;
+
+BEGIN CHARACTERS;
+[! TreeBASE Matrix URI: http://purl.org/phylo/treebase/phylows/matrix/TB2:M243]
+
+	TITLE Russula_ITS;
+	LINK TAXA = Consensus;
+	DIMENSIONS NCHAR=697;
+	FORMAT DATATYPE=DNA SYMBOLS= "A C G T" MISSING=? GAP= -;
+
+MATRIX
+[                                       10        20        30        40        50        60        70        80        90        100       110       120       130       140       150       160       170       180       190       200       210       220       230       240       250       260       270       280       290       300       310       320       330       340       350       360       370       380       390       400       410       420       430       440       450       46 [...]
+[                                        .         .         .         .         .         .         .         .         .         .         .         .         .         .         .         .         .         .         .         .         .         .         .         .         .         .         .         .         .         .         .         .         .         .         .         .         .         .         .         .         .         .         .         .         .         . [...]
+Albatrellus_flettii             AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTAATGA---GCGA-GGTTGTC--GCTG-TCCCCC--GG-CGTGCACGCCTTT-GTCTCTGT-CATCT-TCTC--AC--TGTGCACCTCTGCGTGGGTCCCT------------GGGGG----CTCGCGTC--ATA-AC-GAAC-C-ATGTATC----GGAACGTGCTACAGCA-GCAACTTGTACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATAAGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCTCTTGGTATTCCGAGGGGCACACCTGTTTGAGTATCGTGAAATCATCAACCCTTTTT-GTT----------GGGGGGTTAGGGCTTGGACTTGGAGG-TCGTTGCCGGGGGA [...]
+Gloeocystidiellum_aculeatum     ??????????????????TCCGTAGGTGAACCTGCGGAAGGATCATTATCGTATCGCACAGGCTGTC--GCTC?C---CAA--GCCGTGCACGCCTGA-GTGTTTC-AAATCCATCTC--AC-TTGTGCACCATTGCGTGAGCCCCTC-GGGCGACGC-T--GG----CTTGCGTTTTATACACAAA-C-C---ACAATGTCTAGAATGTGCAGTAACATGCAATCTATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCTCTTGGTATTCCGAGAGGCACGCCCGTTTGAGTGTCATGAAATTCTCAACCCTCTT-GGTTTTCTAAT-ATC-------GGG-CTTGGACTTGGAGG-CTCTTGCT--GA-- [...]
+Russula_adulterina              AAAAGTCGTAACAAGGCATAC?AAGAAGAACCGGCGCAAGGAGCATTATCGTAC??CAGG?G??GTC--GCTG?CCCTCAAAGGTCGA?-A?GTCCGT-GCGCGCTCA-ATCCATCTC--ACTTTGTGCATCACCGCGTGGGTCCCTCTG---------GGAGG----CCTGCGTTTT-CACATAAAACCG-ATACAGT--GTAGAATGTGCGGTTACACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATTCTCAACCCTTTCC--------GATG-----------GGA-TTGGACTTGGAGGTTCAATGCTCGGAAA [...]
+Russula_adusta                  AAAAGTCGTAACAAGGCATCCGTAGGTGAACCTGCGGAAGGATCATTATCGTACTGCAAGGGTTGTC--GCTGACCTTCAAAGGTCGTG-ACGCCCGA-GCGCTCTCA-ATCCATTTC--AC-TTGTGCATCACCGCGCGGG-CCCTCTTGGCTCGCTTGGAGG----CTCGCGTTTTACACATAAA-C------TGGT--TTAGAATGTGCGATCACACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGTATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATTCTCAA-CCTTCTTGGTTTCTCGATC----------TGG-CTTGGACTTGGAGG-CTTTTGCTGG-AAA [...]
+Russula_amethystina             AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTACTGCCAAGGCTGTC--GCTGACCCTCAAAGGTTGTG-ACGCCCAAAGCGCTCTCACATCCATCTC--ACTTTGTGCATCACCGCGTGGG-CCCTTTG---------GGAGG----CTTGCGTTTT-CACACAAAACTG-ATACAGT--GTAGAATGTGCAGTCACATGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATCATCAACCCTTTTC--------GATCA-TTGTGGTCAGGA-TTGGACTTGGAGGTTTCATGCTTG-AAA [...]
+Russula_amoenicolor             AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTATTGCTGGGGCTGTC--GCTGACCCTCGAAGGTCGTGCACGCCCAA-GTGCTCTC-CATCCATCTC--ACTTTGTGCATCACCGCGTGGG-CTCTTT?----------??GG----TCCGCGTTTTACACACA-CAC------CAGT--ATAGAATGTGCGGTCACACGCAATAAATACAACTTTCAACAACGGATCTCTTG-CTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGTATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAACTCCTCAA-CCTTCTTGGTTTTTCGACC----------AGG-CTTGGACTTGGAGGTTCATTGCTGG-AAA [...]
+Russula_amoenipes               AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTACAGAAGGATCATTATCGTACTGCAAAGGCTGTC--GCTGACCCTCAAAGGTCGTGCACGCCCGA-GCGCTCTCA-ATCCATCTC--ACTTTGTGCATCACCGCGTGGGTCCCTTTT---------GAAGG----CTTGCGTTTT-CACATAAAACTG-ATACAGT--GTAGAATGTGCGGTCACAAGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATCTTCAATCCTTTTT----------------------GGGG-TTGGACTTGGAGGTTTAATGCTCGGAAA [...]
+Russula_aquosa                  AAAAGTCGTAACAAGGCATCCGTAGAAGAGCCGGCGGAAGGATCATTATCGTACCACGAGGGC?GTC--GCTGACTTT-----GTCGTG-AC?CC-GA-GTGCTCTCA-ATCCATCTC--ACTATGTGCACCACCGCGTGGGTCCCTCTTGGCTCGTTC-GAGG-----TCGCGTTTT-CACACAAA-CCGAA-GCAGT--GTAGAATGTGCGATTACGCGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATTCTCAACCCTTCCTGGT-------------------AGGA-TTGGACTTGGAGGCCTTTTGCTGGG-AA [...]
+Russula_archaea                 AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTACCGTGCCACGAGGGCTGTC--GCTGACCACCAAAGGTCGTGCACGCCCGA-GCGCTCTCA-ATCCACCTC--AC-TTGTGCATCACCGCGCG-GTCCCTTT-GGCTCGTTCGAAGG----CCCGCGTTCT-CACAC-GAAC------TGGT--CTAGAATGTGCGATTACATGCAACCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGCGTCGTGA-CCCATCAA-CCTTGCTGGTTCCTTGACC----------AGG-CTTGGACTTGGAGG-GTCTTGCCGGG-AA [...]
+Russula_atropurpurea2           AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGAA-CGCGAGGGCTGTC--GCTGACCT-GAACGGTTGTGCACGTCCGA-GCGTCCTCACATCCATCTC--ACTATGTGCACCACCGCGTGGGTTCCTTT-GGCTCGTCC-AAGG----CTTACGTTTT-CACACAAA-CGT-ATGCAGT--GTAGAATGTGCGATCA--CGCAATTAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGTGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATTCTCAACCCTTTTC----------------------AGGG-TTGGACTTGGAGGCCTTTTGCTGGG-AA [...]
+Russula_aurantiaca              AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTACC-CGAGGGCTGTC--GCTGACCTTCAAAGGTTGTGCACGCCCAG-GTGCTCTCA--TCCATCTC--ACTTTGTGCATCACCGCGTGGG-CCC-------CAGTGTGGAGG----CTTGCGTTTTACATA-AAAAC-G-ATACAGT--GTAGAATGTGTGGTCACACACAATCAGTACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATCCTCAA-CCTTTTC--------GATC------GGTCAGGA-TTGGACTTGGAGGTTTGATGCTTGGAAA [...]
+Russula_aurata2                 AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCATACTACAAGGGCTGTC--GCTGGCCTTCAAAGGTTGTGCACGCCCGA-GTGCCCTCACATCCATTTT--ACTTTGTGCATCACCGCGTGGGG-CCTCTG-----------AGG----CCCACGTTTT-CACACAAA-CTGAACATAGT--TTAGAATGTGCGATGATACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAATTTCTCAATCCTTCTC----------------------AGGA-TTGGACTTGGAGG-TCAATGCTCAGAAA [...]
+Russula_azurea                  AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTACCGCAAAGGCTGTC--GCTGCCCT-CAAAGGTCGTG-ACGCACGA-GCGTTCTCACATCCATCTC--ACTTTGTGCATCACCGCGTGGGT-CCTCCT---------GGAGG----CTCGCGTTTT-CACATAAAACCG-ATATAGT--ATAGAATGTGCGGTCACACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATCATCAACCCTTTTC----------------------GGGACTTGGACTTGGAGGTTTGATGCTTGGAAA [...]
+Russula_betularum               ????????????????????????GGTGAAC-TGCGGAAGGATCATTATCATACTGCGAGGGCTGTC--GCTGACCTTC---GGTCGTGCACGCCCGA-GCGCTCTCA-ATCCATCTC--AC-TTGTGCACCACCGCGTGGGTCCCTTTCGGCTCGTCC-GAGG----CTCGCGTTTT-CACACAAA-CTGAA-GTAGT--GTAGAATGTGCGATAACACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATTCTCAACCCTTTCTGGTCATTTGACC----------AGGA-TTGGACTTGGAGGCCTTTTGCTGGG-AA [...]
+Russula_caerulea                AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTACTGTGAGGGCTGTC--GCTGACCTTGAA-GGTCGTGCACGCCCAA-GCAACCTCACATCCATCTC--ACTTTGTGCATCACCGCGTGGGTCCCTTT----------GGAGG----CTTGCGTTTT-CACATAAAACTG-ATACAGT--GTAGAATGTGCGGTCACACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGAAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGATTGAGTGTCGTGAAAT-ATCAATCCTTTTT----------------------AGGA-TTGGTCTTGGAGGTTCCATGCTCGGAAA [...]
+Russula_camarophylla            AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTACCGCGAGGGCTGTC--GCTGACCACCAAAGGTCGTGCACGCCCGA-GTGCCCTC--ATCCACCAC--AC-TTGTGCATCGCCGCGTG-GTCCCTTT-GGCTCGCCCGAAGG----CACGTCCTTTACACAAA-CGCTAAA-ACGGT--TTAGAATGTGCGGTGACACGCAATCAATACAACTTTCAACAATGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGTGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACGCCCGTTTGAGTGTCGTGA-CTCATCAA-CCTTCTCGGTCCTCTGATC----------AGG-CTTGGACTTGGAGG-CTTTTGCTGGG-AA [...]
+Russula_cessans1                AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTTACGCGACGGCTGTC--GCTGACCTTC---GGTCGTG-ACGCCCGA-GCCCTCTCA-ATCCATCTC--ACTTTGTGCATCACCGCGTGGGTCCCTTTG---------GGAGG----CCCGCGTCTT--ACACAAAACCG-ATACAGT--GTAGAATGTGCGCTCGCACGCGATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATCTTCAACCCTCTCT----------------------AGGA-TTGGACTTGGAGGTTCAATGCTCGGAAA [...]
+Russula_chloroides              ?????????AACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTACTACCAGGGCTGTC--GCTGACTTTC----GTCGTG-ACGCCCTGAGTGCTCTCATATCCATCTC--ACTTTGTGCATCACCGCGTG-GTCCCTTCCG--------GAAGG----CTCACGTTTTA-ACATCAAAC------TAGT--GTAGAATGTGCGATCACGCGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAACTCCTCAA-CCTGCTT-GTTCT-AAACC----------AGG-CTTGGAATTGGAGGTTTTCTGCTGGG-AA [...]
+Russula_clariana                AAAAGTCGTAACAAGGCATCCCAAGAAGAACCTGCGCAAGGATCATTATCGTT?TGCGAGGGATGTC--GCTGACCCTCAAAGGTCGT--ACGTCCTA-GCGCTC??ACATCCATCTC--ACTTTGTGCATCACCGCGTGGGTCCCTTTG---------GGGGG----CTTGCGTTTT-CACATAAAACCC-ATACTGT--GTAGAATGTGCGCTCATACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAAGGGCACACCCGTTTGAGTGTCGTGAAACCCTCAATCATTTTT--CTTTTT--------------AGGA-TTGGACTTGGAGGTTCAATGCTCGGAAA [...]
+Russula_claroflava              AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTACTGCAAGGGCTGTC--GCTGACC-TCAA-GGTTGTGCACGCCCAA-GCCCTCTCACATCCATCTC--ACTTTGTGCATCACCGCGTGGG-CCCTTTG---------GGAGG----CTTGCGTTTT-CACATAAAACTG-ATACAGT--GTAGAATGTGCGGTCACACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAATTCATCAA-CCTTTTC--------GATC--TTTCGGTCAGGA-TTGGACTTGGAGGTTCTATGCTTGGAAA [...]
+Russula_consobrina              AAAAGTCGTAACAAGGTTTCCGAAGGTGAACCTGCGCAAGGATCATTATCATA?CACGAG-GCAGTC--A-TGACGTTC----GTCGAGCACGCCCAAAGCGCTCTCACATCCATCTC--ACTATGTGCACCACCGCGTGGGTCCCTTTT---------GAAGG----CTCGCGTTTT-CATACAAA-CTG-ACGCAGT--GTAGAATGTGCGATCACACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATTCTCAA-CCTTTTCGGTCTTTCGACC----------TAG-CTTGGACTTGGAGGCTTTTTGCTGGG-AA [...]
+Russula_cuprea2                 AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTACTGCAAGGGCTGTC--GCTGACCCTCAAAGGTCGTGCACGCCCGA-GCGCGCTCA-ATCCATCTC--ACTTTGTGCATCACCGCGTGGGTCCCTCTG---------GGAGG----CCTGCGTTTT-CACATAAAACCG-ATACAGT--GTAGAATGTGCGGTTACACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATTCTCAACCCTTTCC--------GAT-----------GGGA-TTGGACTTGGAGGTTCAATGCTCGGAAA [...]
+Russula_curtipes                AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTACTGCGAGGGCTGTC--GCTGACCTTCGAAGGTCGTGCACGCCCGA-GCCCTCTCA-ATCCATCTC--ACTTTGTGCATCACCGCGTGGGTCCCTTTG---------GGAGG----CTCGCGTTTT-CACATAAAACCG-ATACAGT--GTAGAATGTGCGGTCGCACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATCCTCAACCCTCTTC----------------------AGGA-TTGGACTTGGAGGTTTGATGCTCGGAAA [...]
+Russula_cyanoxantha             AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTATTGCCGGGGCTGTC--GCTAACTTT--------GTG-ACGCCCTG-GTGCTCTCA-ATCCATCTC--ACTTTGTGCATCACCGCGTGGGTTCCTTTTGGTTTGTTCAAAGG----TTTGCGTTTT--ATACAAAAC-----GCA-TGTGTAGAATGTGCGATAATGCGCAATTAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGAATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAACTCCTCAA-CCTTTCTGGTTTCTTGACC----------AGG-CTTGGACTTGGGGGTTCATTGCTGGG-AA [...]
+Russula_decolorans1             AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATTTTAATACAT??GCTGTC--GCTCACCTTCAAAGGTTGT?-ACG?TCGA-GTGCTCTCACATCCATCTC--ACTTTGTGCATCACCGCGTGGG-TCCTTTG---------GGAGG----CTTGCGTTTT-CACATAAAACTG-ATACAGT--GTAGAATGTGCGGTCAAACGCAATTAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATCATCAA-CCTTTTC--------GATC--TTTTGGTCAGGA-TTGGACTTGGAGGTTCTATGCTCGGAAA [...]
+Russula_delica                  AAAAGTCGTAACAAGGCATACCAAGAAGAACCTGCCCAAGGTTCATTATCGAA??GCGACGAGTGTC--G?TGACTTTC---GGTCGTG-A??CC-GA-GTGCTCTCATATCCATCTC--ACTTTGTGCATCACCGCGTGGGTCCCTTCC---------GGAGG----CTCACGTTTTA-ACATCGAACCGAACGTATT--GTAGAATGTGCGATGACGCGCGATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAACTCCTCAA-CCTGCTCGGTTTTTAAACC----------AGG-CTTGGAATTGGAGGTTTTCTGCCGGG-AA [...]
+Russula_drimeia                 AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTACCACGAAGGCTGTC--GCTAACTTT-----GTCGTG-ACGCCCGA-GTGCTCTCA-ATCCATCTC--ACTATGTGCACCACCGCGTGGGTCCCTTTTGGCTCGTTC-GAGG----CTTGCGTTTT-CACACAAA-CTAAATACAGT--GTAGAATGTGCGATAACACGCAATTAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATTCTCAA-CCTTTCT----------------------AGGA-TTGGACATGGAGG-CTTTTGCTGGG-AA [...]
+Russula_emetica                 AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTAATGCGAGGGCTGTC--GCTGACCTTC---GGTCGTGCACGCCCGA-GTGCTCTCA-ATCCATCTC--AC-TTGTGCACCACCGCGTGGGTCCCTCTCGGCTCGTCC-GAGG----CTCGCGTTTT-CACACAAA-CTGAA-GTAGT--GTAGAATGTGCGATAACACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATTCTCAACCCTTTCTGGTCATTTGACCAT--------AGGA-TTGGACTTGGAGGCTTTTTGCTGGG-AA [...]
+Russula_exalbicans2             AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTACCGCGAGGGCTGTC--GCTGACTTTC----GTCGTGCACGCCCGA-GCGCTCTCACATCCACCTC--ACTATGTGCACCACCGCGTGGGTCCCTTTC-----------GGG----CTCGCGTTTTACACACAAA-CCG-ATACAGT--GTAGAATGTGCGATCACACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATTCTCAA-CCTTTTT----------------------AGGA-TTGGACTTGGAGGCCTTTTGCTGGG-AA [...]
+Russula_farinipes               AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTGCCGCGAGGGCTGTC--GCCGACTTCC----GTCGTGCACGCCCGA-GCGCTCTCATATCCACCTC--ACTTTGTGCATCACCGCGTGGGTCCCTTT----------AAAGG----CTCGCGTTTTAAAC-CAAA-CCGAACTATGT--TTAGAATGT---AT-ACATG--ATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCTCTTGGCATCCCGAGAGGCACCCCCGTTTGAGCGTCGTGA-CTCCTCAA-CCTTTCT--------GATC-TTTGCG-CCAGG-CTTGAACATGGGGG---TATGCTGGG-AA [...]
+Russula_fellea                  AAAAGTCGTAACAAGGCATACGAAGAAGCGCCGGCGCGAGGTGCATGATCGCACCGCAAGGGCTGTC--GCTGACTTT-----GTCGTG-ACGCCCGA-GTGCTCTC-CATCCATCTC--ACTATGTGCACCACCGCGTGGGTCCCTTTCGGCTTGTTC-GAGG-----TTGCGTTTT-CACACAAA-CTG-ATGCAGT--GTAGAATGTGCGATCACACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATTATCAACCCTTTCTGGTCTTTTGATC----------AGG--TTGGACTTGGAGGCCTTTTGCTGGG-AA [...]
+Russula_foetens                 AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTACTGCTGGGGTTGTC--GCTGACTTTGAAAGGTCGTGCACACCTCG-GTGCTCTCA-ATCCATCTC--ACTTTGTGCATCACCGCGTGGG-CCCTTTTGGCTAGTTC-GAGG----TTCACGTTTT--ACACAGA-CTTAATGCAATGTGTAGAATGTGCGATCACACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCTTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCATGA-CTCCTCAA-CCTTCTTGGTTTCTTGACC----------AGG-CTTGGACTTGGAGG-CTATTGCTGGGG-A [...]
+Russula_gracillima              AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCATACCACAAGGGCTGTC--GCTGACTTTC----GTCGTGCACGCCCAG-GTGCTCTCA-ATCCATCTC--ACTATGTGCACCACCGCGTGGGTCCCTTTTGGCTCGTCC-GAGG----CTCGCGTTTT-CACACAAA-CTAAACACAGT--GTAGAATGTGCGATCACACGCAATTAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATTCTCAACCCTTTTC----------------------AGGA-TTGGACTTGGAGGCTTTTTGCTGGG-AA [...]
+Russula_grisea2                 AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATAGTATTGCCCGGGCTGTC--GTCGTCCT-CAA-GGACGTGCACGCTCGGAGTGCCCTCACATCCATCTC--ACTTTGTGCATCACCGCGTGGG-CTCTTTT---------AGAGG----TTCACGTTTT--ACA-AGAACTTAATGCA-TGTGTAGAATGTGCGGTCACACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCACCCCTTGGTATTCCGAGGGGTGCACCCGTTTGAGTGTCGTGAACCCCTCAA-CCTTCTTGGTTTATCGACC----------AGG-CTTGGACTTGGACG----TTGCTGGG-AA [...]
+Russula_helodes                 AAAAGTCGTAACAAGGCATCC?AAGAAGCGCCGGCGCAAGGATCATTATCG-AA???????????TC--GCTGACTTT-----GTCGTG-ACGCGCG?AGCGCTCTCACATCCATCTC--ACTATGTGCACCACCGCGTGGGTTCCTTTTGGCTTGTTC-GAGG----CTCGCGTTTT-CACACAAA-CTG-ATGCAGT--GTAGAATGTGCGATCACACGCAGTCATTACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATTCTCAA-CCTTTCTGGTCTTTCGATC----------AGGA-TTGGACTTGGAGGCTTTTTGCTGGG-AG [...]
+Russula_heterophylla            AAAAGTCGTAACAAGGCATCCCAAGATGAACCTGCGGAAGGATCATTATCGTACTGCTG-GGCTGTC--GCTG-CCTT-AAAGG-C???-?CGCCCGGAGCACTCTCATATCCATCTC--ACTTTGTGCATTGCCGCGTGGGTCCCT--G---------AAAGG----CCTGCG?TTT--ACATAGA-CTGAATGCA-TGTGTAGAACGT-CGAT--------ATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGTATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAATCTCTCAA-CCTTCTTGGTTCTTTGACC----------AGG-CTTGGACTTGGAGGTTTCTTGCTGGGAAG [...]
+Russula_ilicis                  AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTATTGCCAGGGCTGTT--GCTGACTTTGAAAGGTCGT-CACGCCCGG-GCGCTCTCACATCCATCTC--ACTTTGTGCATCACCGCGTGGG-CCCTTTTGGTTTGTTC-GAGG----TTCACGTTTTACACACA---CTCAATGCA-TGTGTAGAATGTGCGATCGCACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGTATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAACTCCTCAA-CCTTCTTGGTTTCTTGACC----------AGG-CTTGGACTTGGAGGTTTATTGCTGGG-AA [...]
+Russula_insignis                AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTACTGCTGGGGTTGTC--GCTGACCTTCAAAGGTCGTGCACACCTCG-GTGCTCTCA-ATCCATCTC--ACTTTGTGCATCACCGCGTGGG-CCCTTTCGGCTAGTTC-GAGG----TTCACGTTTT--ATACAAA-CTTAATGCAATATGTAGAATGTGCGATCACACGCAATTAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCTTTGGCATTCCGAAGGGCACACCCGTTTGAGTGTCGTGA-CTTCTCAA-CCTTCTTGGTTTCTTGACC----------AGG-CTTGGACTTGGAGG-CTTTTGCTGGG-AA [...]
+Russula_integra2                AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATTGTATTGCAAGGGCTGTC--GCTGACCTTTAAAGGTTGTGCACGCCCGA-GCACTCTCA-ATCCATCTC--ACTTTGTGCATCACCGCGTGGG-CCCTTTG---------GGAGG----CTTGCGTTTT-CACATAAAACTG-ATACAGT--GTAGAATGTGCGGTCACACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATCATCAACCCTTTTT----------------------AGGA-TTGGACTTGGAGGTTCCATGCTCGGAAG [...]
+Russula_integriformis           AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATTGTATTGGCAAGGCTGTC--GCTGACCTTCAAAGGTTGTGCACGCCCAA-GCACACTCACATCCATCTC--ACTTTGTGCATCACCGCGTAGG-CCCTTTG---------GGAGG----CTTGCGTTTT-CACATAAAA-TG-ATACAGT--ATAGAATGTGCGGTCAAACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATCATCAACCCTTTTT----------------------AGGA-TTGAACTTGGAGGTTCCATGCTTGGAAG [...]
+Russula_laricina                AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTTACGTGAGGGCTGTC--GCTGACCTTC---GGTCGTGCACGCCCGA-GCCCTCTCA-ATCCATCTC--ACTTTGTGCATCACCGCGTGGGTCCCTTTG---------GGAGG----CCCGCGTCTT--ACACAAAACCG-ATACAGT--GTAGAATGTGCGCTCGCACGCGATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATCTTCAACCCTCTCT----------------------GGGA-TTGGACTTGGAGGTTCAATGCTCGGAAA [...]
+Russula_laurocerasi             AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTATTGCTG-GGTTGTC--GCTGACTTTGAAAGGTCGTGCACGCCTCA-GTGCTCTCA-ATCCATCTC--ACTTTGTGCATCACCGCGTGGG-CCCTTTTGGCTAGTTC-GAGG----TTCACGTTTTACA-A-AGA-CTTAATGCAATGTGTAGAATGTGCGATTATATGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGA-CTCCTCAA-CCTTCTTGGTTTCTTGACC----------AGG-CTTGGACCTGGAGG-TTTTTGCTGGG-GA [...]
+Russula_lepida                  AAAAGTCGTAACAAGGTTTCCGTAGAAGAACCGGCGGAAGGATCATTATTGTACTGCGAGGGCTGTC--GCTGACCTTCAAAGGTTGTG-ACGCCCAA-GTGCTCTCACATCCATCTC--ACTTTGTGCATCACCGCGTGGGTCCCTTTG---------GGAGG-----TTGCGTTTT-CACATAAAA-TG-ATACAGT--GTAGAATGTGTGGTCACACACAATCAGTACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATCCTCAA-CCTTTTC--------GATC--TTTTGGTCAGGA-TTGGACTTGGAGGTTTGATGCTTGGAAA [...]
+Russula_lepidicolor             AAAAGTCGTAACAAGGTTTCCGCAGGTGAACCTGCGGAAGGATCATTATCATACTGCAAGGGCTGTC--GCTGACCTTCAAAGGCCT??GACGCCTAA-GTACTTTCACATCCATCTC--ACTTTGTGCATCACCGCGTGGG-CTCTTTG---------AGAG-----CTTGCGTTTT-CACATAAAACTTAATATAGT--GCAGAATGTGCAGTCATATGCAATCAGTACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATCCTCAACCCTTTTC--------GAT-----------AGGA-TTGGACTTGGAGGTTTGATGCTTGGAAA [...]
+Russula_lilacea                 AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTACTGCAAGGGCTGTC--GCTGACCTT-AAGGGTTGTG-ACGCCCAA-GTGCTCTCACATCCATCTC--AC-TTGTGCATCACCGCGTGGGTCCCTT-----------GGAGG----CTCACGTCTT--ACATAAAACTG-ATATAGT--ATAGAATGTGCGGTCACACGCAATAAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATCATCAACCATTTCT----------------------AGGA-TTGGATTTGGAGGTTTGATGCTTG-AAA [...]
+Russula_littoralis              AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTACCGCGAGGGCTGTC--GCTGACTTTCAAAGGTCGTGCACGCCCAA-GTGTTCTCA-ATCCATCTC--AC-TTGTGCATCACCGCG-GGG-CCCTTTGGGCTTGTTCAAAGG----CTCACGTTTTA-ACACAGA-CTGAATGCAGT--GTAGAATGTGTAATG------AATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGTACACCCGTTTGAGTGTCGTGA-CTCTTCAA-CCTTCTTGGTTTCTTGATC----------AGG-CTTGGAATCGGAGG-CTTTTGCTGGG-AA [...]
+Russula_maculata                AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTACTGCAAGGG-TGTC--GCTGACCT-CAAAGGCCGTG-ACGCCCAA-GCCCTTTCA-ATCCATCTC--ACTTTGTGCATCACCGCGTGGGTCCCTTTT--C------GGAGG----CTTGCGTTTT-CACATAAAACTG-ACACAAT--ACAGAATGTGCGGTTATACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATTCTCAACCCTTTTT--------GATC--TCAGGGTTAGGA-TTGGACTTGGAGGTTCAATGCTCGGAAA [...]
+Russula_melitodes               AAAAGTCGTAACAAGGCATCCGTAGGTGAACCTGCGGAAGGATCATTATCGTACTGCGAAGGCTGTC--GCTGACCTTCAAAGGTCGTG-ACGCCCGA-GTGCTCTCACATCCATCTT--AC-TTGTGCACTGCCGCGTGGG-CCATTTT---------GGGGG----CTTGCGTTTTA-ACATAAAACTG-ATATGGT--GTAGAATGTGCGGTTACACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATCATCAACCCTTTTC--------GATC--TCTTGGTCGGGA-TTGGACTTGGAGGTTTCATGCTAGGAAA [...]
+Russula_melliolens              AAAAGTCGTAACAAGGTTTCCGTAGGTGAGCCTGCGGAAGGATCATTATCGTT-TAGT?C???TGTCGTGCT-ACCC-CAA-GGTT-TGGA???CCGA-GTGCTTCCA-ATCCATCTC--ACTTTGTGCATCACCGCGTGGGTTCCTTTG---------GAAGG----CCTGCGTTTTAT-CATAAAACTCAATACAGT--GTAGAATGTGCGGTCATACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATTCTCAACCCTTTTC--------GATC--TTGTGGTCAGGA-TTGGACTTGGAGGTTCAATGCTTGGAGA [...]
+Russula_melzeri                 AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTACCGCCAGGGCTGTC--GCTGACCTTCAGAGGTCGTGCACGCCCAAAGCGCTCTCA-ATCCATCTC--ACTTTGTGCATCACCGCGTGGGTCCCTTTG---------GGAGG----CTTGCGTTTT-CACATAAAACAT-ATACAGT--GTAGAATGTGCCATCATGCGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATCTTCAACCCTTTTT--------GATC--TTTTGGATAGGA-TTGGACTTGGAGGTTCAATGCTTGGAAA [...]
+Russula_messapica               AAAAGTCGTAACAAGGCATACCAAGAAGAACCTGCGGAAGGATCATTATCGAACTGCAA--GCCGTCCA-CTGACCTTCAAAGGCCGTG-ACGCCCGA-GCGCTCTCA-ATCCACCTC--ACTTTGTGCATCACCGCGTGGGTCCCTTTC-----------AGG----CTCGCGTTTT-CACATTAAACTG-ATACAGT--CTAGAATGTGCGGTCACACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATCCTCAATCCTTTTC--------GATC----------AGGACTTGGACTTGGAGGTTCAATGCTTGGAAA [...]
+Russula_mustelina               AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTACTGCCCAGGCTGTC--GCTGACCTTCAC-GGTCGTGCACGCCCAAAGTGCTCTCACGTCCATCTC--ACTTTGTGCATCACCACGTGG--CCC--AT---------GGAGG----TTCACGTTTT--ACACAGA-CTTAATGCATG-TGTAGAATGTGCGATCACACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGTATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAACCCCTCAA-CCTTCTTGGTTTCTTGACC----------AGG-CTTGGACTTGGAGGTCCTTTGCTGGG-AA [...]
+Russula_nana                    AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTAATGCGAGGGCTGTC--GC?GACCGTC---GGTCGGG-ACGCCCGA-GTGCTCTCA-ATCCATCTC--AC-TTGTGCACCACCGCGTGGGTCCCTTTCGGCTC-CTCGGAGG----CTCGCGTTTT-CACACAAA-CTGAA-GTAGT--GTAGAATGTGCGATAACACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATTCTCAACCCTTTCCGGTCATTTGACCATC-------AGGA-TTGGACTTGGAGGCTTTTTGCTGGG-AA [...]
+Russula_nauseosa                AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTACTGCGAGGGCTGTC--GCTGACCTTCAGAGGTCGTG-ACGCCCGA-GCGCTCTCA-ATCCATCTC--ACTTTGTGCATCACCGCGTGGGTCCCTTTG---------GGAGG----CTCGCGTTTT-CACATAAAACCG-ATACAGT--CTAGAATGTGCGGTCGCACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATCCTCAATCCTCTTC--------GATC----------AGGACTTGGACTTGGAGGTTCAATGCTCGGAAA [...]
+Russula_nigricans               AAAAGTCGTAACAAGGCATCCGAAGAAGAACCTGCGGAAGGATCATTATCGTACCGCGAGGGCTGTC--GCTGACCTTCAAAGGTCGTG-ACGCCCGA-GCGCTCTCA-ATCCACCTC--AC-TTGTGCATCACCGCGCGGG-CCCTCTTGGCTCGCTTAGAGG----CTCGCGTTCT-CACATCACAC------TAGT-TTT-GAATGTGCGATAACACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATTCTCAA-CCTTCTTGGTTTCTTGACC----------TGG-CTTGGACTTGGAGGTGTTGTGCTGG-AAA [...]
+Russula_nitida2                 AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTACTGCAAGGGCTGTC--GCTCACCGTCAAAGGTCGTGCACGCCCGA-GCGCTCTCA-ATCCATCTC--ACTTTGTGCATCACCGCGTGGGTCCCTTTC---------GGAGG----CTTGCGTTTTACATA-AAAAC-G-ATACAGT--GTAGAATGTGCGGTCACACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATCTTCAACCCTTTTC--------GATCA-TTTCGGTCAGGA-TTGGACTTGGAGGTTCAATGCTCGGAAA [...]
+Russula_ochroleuca              AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATTGTATTGCGAGGGCTGTC--GCTGACC--CGAAGGTCGTGCACGCCCGA-GTGCCCTCACATCCATCTC--ACTATGTGCACCACCGCGTGGGTCCCTTT-GGCTTGTTC-GAGG----CTTACGTTTT-CACACAAA-CGT-ATGCAGT--GTAGAATGTGCGAT--CACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATTCTCAATCCTTTTT----------------------AGGG-TTGGACTTGGAGGCTTTTTGCTGGG-AA [...]
+Russula_odorata                 AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATTGTAATGCAAGGGCTGTC--GCTGACCTTCAC-GGTCGTGCACGCCCGA-GCGCTCTCA-ATCCATCTC--ACTTTGTGCATCACCGCGTGGGTCCCTTTG---------GGAGG----CTCGCGTTTT-CACATAAAACTG-ACACAGT--CTAGAATGTGCGGTAACACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATTCTCAATCCTTTTC--------GATT----------AGGACTTGGACTTGGAGGTTCAATGCTCGGAAA [...]
+Russula_olivacea                AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCGGCGGAAGGATCATTATCGTACTGCGAGGGCTGTC--GCTGACCTTCAAAGGTCGTG-ACGCCCGA-GCGCTCTCA-ATCCATCTC--ACTTTGTGCATCACCGCGAGGGTCCC--AGGGCTGTAAC-AAGGACGTCTCGCGTTTT-CACACAAA-CCG-ATACAGT--GTAGAATGTGCGGTCACACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATCATCAA-CCTTTTT--------GATCA-TTTTGGTCAGGA-TTGGACTTGGAGGTTCCATGCTCGGAAA [...]
+Russula_pallidospora2           AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTACCGCGAGGGCTGTC--GCTGACTTTCAAAGGTCGTGCACGCCCAA-GTGTTCTCA-ATCCATCTC--AC-TTGTGCATCACCGCG-GGG-CCCTTTGGGCTTGTTCAAAGG----CTCACGTTTTA-ACACAGA-CTGAATGCAGT--GTAGAATGTGTAATG------AATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGTACACCCGTTTGAGTGTCGTGA-CTCTTCAA-CCTTCTTGGTTTCTTGATC----------AGG-CTTGGAATCGGAGG-CTTTTGCTGGG-AA [...]
+Russula_paludosa                AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATTGTAC??TGAGGGCTGTC--GCTGACCTTCAAAGGTCGTG-ACGCCCAA-GCACTTTCA-ATCCATCTC--ACTTTGTGCATCACCGCGTGGGTCCCTT-G---------GGAGG----CTCGCGTTTT-CACATAAAACCG-ATACAGT--GTAGAATGTGCGATCACACGCAATCAATACAACTTTCAACAATGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATCCTCAACCCTTTTC---------------------CGGGA-TTGGACTTGGAGGTTCAATGCTTGGAAA [...]
+Russula_parazurea               ????????TAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCATACCACCGGGGCTGTC--GCTGACCTT----GGTCGTG-ACGCCCAGAGTGCTCTCAAATCCATCTC--ACTTTGTGCATCACCGCGTGGG-TCCTTTTGGCTTGTTCGAAGG----TTCGCGTTTC-CATACAAA-CTTAATGCA-TGTGTAGAATGTGCGATCACACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGTATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAATCCCTCAA-CCTTCTTGGTTTCTTGACC----------AGG-CTTGGACTTGGAGGATTGTTGCCGGG-AA [...]
+Russula_pascua                  AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTACTGCAAAGGCTGTC--GCTGGCCCTCAAAGGTCGTGCACGCCCGA-GCGCTCTCA-ATCCATCTC--ACTTTGTGCATCACCGCGTGGGTCCCTTTG---------GGAGG----CTTGCGTTTT-CACATAAAACCG-ATACAGT--GTAGAATGTGCGGTCACACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATCTTCAACCCTTTTT--------AACCA-TCGTGGTCAGGA-TTGGACTTGGAGGTTTAATGCTCGGAAA [...]
+Russula_pectinata               AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTACTGCTGGGGTTGTC--GCTGACCTTGAAAGGTCGTGCACGCCTCG-GTGCTTTCA-ATCCATCTC--ACTTTGTGCATCACCGCGTGGG-CCCTTTTAGCTAGTTCGAAGG----TTCGCGTTTT----ACAAA-CTTAATGCAAT-TGTAGAATGTGCGATCACACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCTTTGGCATTCCGAAGGGCACACCCGTTTGAGTGTCGTGA-CTCCTCAATTCTT---GGTTTCTTGACT----------AGG-CTTGGACTTGGAGG-C-TTTACTGGG-AA [...]
+Russula_pectinatoides           AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTACTGCTGGGGTTGTC--GCTGACCTTGAAAGGTCGTGCACGCCTCG-GTGCTTTCA-ATCCATCTC--ACTTTGTGCATCACCGCGTGGG-CCCTTT-AGCTAGTTCGAAGG----TTCACGTTTT----AC-AAACTTAATGCAAT-TGTAGAATGTGCGATCACACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCTTTGGCATTCCGAAGGGCACACCCGTTTGAGTGTCGTGA-CTCCTCAA-CCTTTTT-GTTTCTTGACT----------AGG-CTTGGACTTGGAGG-CCTTTGCTGAGGAA [...]
+Russula_persicina               AAAAGTCGTAACAAGGCATCC?AAGATGAACCTGCG-AAGGATCATTATCGTACTGCGAGGGCTGTC--GCTGACCT-CGT--GTCGTG-ACGCCCGA-GTGCTCTCACATCCATCTC--ACTATGTGCACCACCGCGTGGGTCCCTTTTGGCTCGTTC-GAGG----CTCGCGTTTT-CACACAAA-CTG-ATACAGT--GTAGAATGTGCGATCACACGCAATTAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATTCTCAA-CCTTTCT----------------------AGGA-TTGGACTTGGAGGCCTTTTGCTGGG-AA [...]
+Russula_pseudointegra           AAAAGTCGTAACAAGGCATCCGAAGAAGAACCTGCGGAAGGATCATTATAGTA?TGCGACGGCTGTT--GCTGACCCTCAAAGGTCGTG-ACGCTCGA-GCTCTCTCACATCCACCTC--ACTTTGTGCATCGCCGCGTGGG-CCCTT-----------GGAGG-----TTGCGTTTT-CACATAAAACAG-ATGCAGT--GTAGAATGTGCGGTCACACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATCCTCAA-CCTGTTC--------GATT----------AGGG-TTGGACTTGGAGGATCAATGCTTGGAAG [...]
+Russula_puellaris2              AAAAGTCGTAACAAGGCATCCGTAGGTGAACCGGCGGAAGGATCATTATCGTACTGCGAGGGCTGTC--GCTGACCT-CAAAGGTCGTGCACGCCCGA-GCGCTCTCA-ATCCATCTC--ACTTTGTGCATCACCGCGCGGGTCCCTTTG---------GGAGG----CTCACGTTTT-CACACAAAA-TG-ATACAGT--CTAGAATGTGCGGTCACACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATCCTCAACCCTTTTC------------ATC-------GGGA-TTGGACTTGGAGGTTCAATGCTTG-AAG [...]
+Russula_puellula2               AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCATACCGCAAGGGCTGTC--GCTGACCTTCAAAGGTCGTGCACGCCCGA-GCGTTCTCA-ATCCATCTC--ACTTTGTGCATCACCGCGTGGGTCCCTTTG---------GGAGG----CTCGCGTTTT-CACATAAAACTG-ATACAGT--CTAGAATGTGCGGTCACACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATCCTCAACCCTTTTC--------GATC--TTTGGGTCAGAG-TTGGACTTGGAGGTTCAATGCTTGGAAA [...]
+Russula_pulverulenta4           AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTACTGCTGGGGTTGTC--GTCGACTTTCAAAGGTCGTGCACACCTCG-GTGCTCTCAAATCCAACTC--ACTTTGTGCATCACCGCGTGGG-CCCTTTTGGTTAGTTC-GAGG----TTCACGTTTT--ATACAAA-C--AATGCAATATGTAGAATGTGCGATCACACGCAATTAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCTTTGGCATTCCGAAGGGCACACCCGTTTGAGTGTCGTGA-CTTCTCAA-CCTTCTTGGTTTCTTGACC----------AGG-CTTGGACTTGGAGGC-TTTTGCTGGG-AA [...]
+Russula_queletii                AAAAGTCGTAACAAGGTTTCCCTAGGTGAACCCGAGTAAGG-CC-TG-T-GCGA?????GGGCTGTC--GCTGACTTTC----GTCGTG-ACGCCCGA-GTGCTCTCA-ATCCATCTC--AC--TGTGCACCACCGCGTGGGTCCCTTTTGGCTCGTCCAGAGG----CTTGCGTTTT-CACACAAA-CCG-ATACAGT--GTAGAATGTGCGATAACACGCAATTAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATTCTCAA-CCTTTCT----------------------AGGG-TTGGACTTGGAGGCTTTTTGCTGG--AA [...]
+Russula_raoultii                AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTAATGCGAGGGCTGTC--GCTGACCTTCTTTGGTCGTGCACGCCTGA-GTGCTCTCA-ATCCATCTC--AC-TTGTGCACCACCGCGTGGGTCCCTCTCGGCTAGTCC-GAGG----CTTGCGTTTT-CACACAAA-CTGAA-GTAGT--GTAGAATGTGCGATAACATGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATTCTCAATCCTTTCT----------------------AGGA-TTGGACTTGGAGGCCTTTTGCTGGG-AA [...]
+Russula_risigallina             AAAAGTCGTAACAAGGCATCCGAAGAAGCGCCGGCGGAAGGATCATTATCGTACTGCGATGGCTGTC--GCTGACCCTCGAAGGTCGTGCACGCTCGA-GCACTCTCAAATCCATCTC--ACTTTGTGCATCACCGCGTGGGTCCCTTTG---------GGAGG-----CCACGTTTT-CACACAAAACTG-ATACAGT--GTAGAATGTGCGGTCGCACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATTATCAACCCTTTTC-GTTT-------ACT-------AGGA-TTGGACTTGGA{CG}GTTTAATGCTTGG [...]
+Russula_romellii2               AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCATACTGCCCGGGCTGTC--ACTGACCTT-AAAGGTCGTGCACGCCCGA-GCACTCTCACATCCCTCTC--ACTGTGTGCA-CACCGCGTGAGTCCCT------------GAAGG----CCCACGTTTT-CACACAAA-CTAAA-GCAGT--GTAGAATGTGCGGTGATACGCGATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGTAGCGAAATGCGATATGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATCATCAA-CCTTTCC--------GATC--TTTTGGTCGGGA-TTGGACTTGAAGGATCAATGCTCAGAAA [...]
+Russula_rosea2                  AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTACTGCAAGGGCTGTC--GCTGACCTTCAAAGGTCGTGCACGCCCAA-GCGCCCTCACATCCATCTC--ACTTTGTGCATCACCGCGTGGG-TTCTTTG---------AGAGG----TCTGCGTTTT-CACATAAAACTG-ATACAGT--GTAGAATGTGCGGTCACACGCAATCATTACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATTCTCAA-CCTTTTC--------GACC--TTTT----AGGA-TTGGACTTGGAGGTTCAATGCTTGGAAA [...]
+Russula_roseipes                AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTAACGCAAGGGCTGTC--GCTGACCTTCAAAGGTCGTGCACGCCTGA-GCATCCTCACATCCATCTC--ACTTTGTGCATCACCGCGTGGGTTCCTTTT---------AAAGG----CTCACGTTTT-CACACAAAACTG-ATACAGT--GTAGAATGTGCGGTCACACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAACCCTCAATCCTTTTT--------GACTACT-------AGGA-TTGGACTTGGAGGTTCAATGCTCGGAAA [...]
+Russula_rubra                   AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTACTGCGAGGGCTGTC--GCTGACCTTCAAAGGTCGTGCACGCCCAA-GCGCTCTCA-ATCCATCTC--ACTTTGTGCATCACCGCGTGGG-CTCTTTG---------GGAGG----CTTGCGTTTT-CACATAAAACCG-ATACAGT--GTAGAATGTGCGGTCACACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATCATCAACCCTTTCT--------GATC-TTCGTGGTCGGGA-TTGGACTTGGAGGTCTCATGCTCGGAAA [...]
+Russula_sanguinea               AAAAGTCGTAACAAGGCATACCAAGAAGAACCGGCGCAAGGTGCA--AG??TGA?????????TG?C--GCTGACTTT-----GTCGAG-A-GACCGA-GTGCTCTCA-ATCCATCTC--ACTATGTGCACCACCGCGTGGGTCCCTTTTGGCTCGTTC-GAGG-----TTGCGTTTT-CACACAAA-CTAAATACAGT--GTAGAATGTGCGATAACACGCAATTAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATTCTCAA-CCTTTCT----------------------AGGA-TTGGACATGGAGG-CTTTTGCTGGG-AA [...]
+Russula_sphagnophila3           AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTACTGCGAGGGCTGTC--GCTGACCGTCAAAGGTCGTGCACGCTCGA-GCGCTCTCA-ATCCATCTC--ACTTTGTGCATCACCGCGTGGGTCCCTTTG---------GGAGG----CTTGCGTTTT-CACATAAAA-TCAATACAGT--GTAGAATGTGCGATCACACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATCTTCAACCCTTTTC--------GATCA-TTTTGGTCAGGA-TTGGACTTGGAGGTTCAATGCTCGGAAA [...]
+Russula_turci                   AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATTGTAATGCAAGGGCTGTC--GCTGACCTTCAAAGGTTGTG-ACGCCTGA-GCACCCTCACATCCATCTC--ACTTTGTGCATCACCGCGTGGGTTCCTTTT---------AAAGG----CTCACGTTTT-CACACAAAACTG-ATACAGT--GTAGAATGTGCGGTCACACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAACCCTCAATCCTTTTT--------GACTACT-------AGGA-TTGGACTTGGAGGTTTAATGCTTGGAAA [...]
+Russula_velenovskyi             AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTATTGCAAGGGCTGTT--GCTGACCTTCAAAGGTTGTGCACGCCCAA-GCACTCTCACATCCATCTC--AC-TTGTGCATCGCCGCGTGGG-CCCTTTG---------GGAGG----CTTGCGTTTT-CACATAAAACTG-ATACAGT--GTAGAATGTGCGGTCACACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATCATCAA-TCTTTTT----------------------AGGA-TTGGACTTGGAGGTTTCATGCTTGGAAA [...]
+Russula_versicolor              AAAAGTCGTAACAAGGCATCCGAAGATGAACCTGCGGAAGGATCATTATCGTACTGCAAGGG-TGTC--GCTGACCTTCAA-GGTCGTG-ACGCCCGA-GCGCTCTCA-ATCCATCTC--ACTTTGTGCATCACCGCGTGGGTCCCTTTG---------GGAGG----CTCGCGTTTT-CACACAAAACTG-ATACAGT--CCAGAATGTGCGGTAACACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATTCTCAATCCTTTTC--------GATC----------AGGACTTGGACTTGGAGGTTCAATGCTCGGAAA [...]
+Russula_vesca1                  AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTAGTGCTGGGGCTGTC--GCTGACCTTGAAAGGTCGTG-ACGCCCGGAGCACTCTCATATCCATCTC--ACTTTGTGCATTGCCGCGTGGGTCCCTTTTGGCTTGTTC-GAGG----CCTGCGTTTT--ACATAGA-CTGAATGCA-TGTGTAGAACGTGCGATCACACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGTATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAATCTCTCAA-CCTTCTTGGTTTCTTGACCAT--------AGG-CTTGGACTTGGAGGTTTCTTGCTGGG-AA [...]
+Russula_vinosa                  AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTACTGCAAGGGCTGTC--GCTGACCCTCAA-GGTCGTG-ACGCCCAA-GCTCTCTCACATCCATCTC--ACTTTGTGCATCACCGCGTGGG-CCCTTTG---------GGAGG----CTTGCGTTTT-CACATAAAACTG-ATACAGT--GTAGAATGTGCGGTCACACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATCATCAA-CCTTTTC--------GATC--TTTTGGTCAGGA-TTGGACTTGGAGGTTCCATGCTTGGAAA [...]
+Russula_violacea                AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTAC{CT}GCGA?G??TGTC--GCCGACCCT-AAAGG??-?G?AC?GCCGA-GCGCTCTCACATCCATCTC--ACTTTGTGCATCACCGCGTGGGTCCCTTGG---------GGGGG----CTTGCGTTTT-CACATAAAACCC-ATACTGT--GTAGAATGTGCGCTCACACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAACCCTCAATCATTTTT--CTTTTTGA------------AGGA-TTGGACTTGGAGGTTCAATGCTCGG [...]
+Russula_violeipes               AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATTGTATTACTAGGGCTGTC--GCTGACCCTCGAAGGTCGTGCACGCCCAA-GTGCTCTC--ATCCATCTC--ACTTTGTGCATCACCGCGTGGG-ACCTTCTGGCTTGTTTAGAGG----TTCACGTTTT--ACACA-CAC-----TATGT--ATAGAATGTGCGGTCATACGCAATAAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGTATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAACTCCTCAA-CCTTCTTGGTTTTCTGACC----------AGG-CTTGGACTTGGAGGTTCATTGCTGG-AGA [...]
+Russula_virescens1              AAAAGTCGTAACAAGGCATCCGAAGAAGAACCGGCGGAAGGATCATTATCG?A??GCCCAGGCTGTC--GCTGACCTTCACAGGTCGTG-ACGCCCAAGGTGCTCTCATGTCCATCTC--ACTTTGTGCATCACCGCGTG-G-CCCTT--GGCTTGTTCAAAGG----TTCGCGTTTTA-ACACAGA-CTTAAGAGCATGTGTAGAATGTGCGATTATGCGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGTATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAACCCCTCAA-CCTTCTTGGTTTCTTGACC----------AGG-CTTGGACTTGGAGGTTCCTTGCTGGG-AA [...]
+Russula_viscida                 ??????????????????????????????CCTGCGGAAGGATCATTATCGTACCGCGAGGGCTGTC--GCTGACCC-GAAAGGTTGTG-ACGCCTGAGGTGCTCTCA-ATCCATCTC--ACTATGTGCACCACCGCGTGGGTCCCTTC-GGCTTGTTC-GAGG-----TTACGTTTT-CACACAAA-CGT-ATGCAGT--GTAGAATGTGCGATC-T-CGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATTCTCAA-CCTTTTT----------------------AGGG-TTGGACTTGGAGGCCTTTTGCTGGG-AA [...]
+Russula_xerampelina2            AAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTATCGTACCGCAAAGGCTGTC--GCTGACCCTCAA-GGTTGTGCACGCCCGA-GTGCTCTCA-ATCCATCTC--ACTTTGTGCATCACCGCGTGGGTCCCTTTG---------GGAGG----CTCACGTTTT-CACATAAAACCG-ATACAGT--GTAGAATGTGCGGTCACACGCAATCAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATCGATGAAGAACGCAGCGAAATGCGATACGTAATGTGAATTGCAGAATTCAGTGAATCATCGAATCTTTGAACGCACCTTGCGCCCCTTGGCATTCCGAGGGGCACACCCGTTTGAGTGTCGTGAAATCTTCAACCCTTTTT--------AACCA-TTGCGGTCAGGA-TTGGACTTGGAGGCTTAATGCTTGGAAA [...]
+;
+END;
+
diff --git a/examples/nexus/ML_analysis.nex b/examples/nexus/ML_analysis.nex
new file mode 100644
index 0000000..06c483c
Binary files /dev/null and b/examples/nexus/ML_analysis.nex differ
diff --git a/examples/nexus/MP_analysis.nex b/examples/nexus/MP_analysis.nex
new file mode 100644
index 0000000..4ad2e30
--- /dev/null
+++ b/examples/nexus/MP_analysis.nex
@@ -0,0 +1 @@
+#NEXUS 

[This file contains two simulated DNA data sets, an assumption block, a sets block, 
 and a paup block.  Commands used in the sets block define the characters 
 representing each simulated data set.  Commands used in the assumption block define
 a usertype that weights transversions 10 times transitions. Both data sets were 
 simulated on the same tree; however, the first data set (d1) has a transition bias
 that when uncorrected causes a parsimony analysis to find the wrong tree.   
 The following numbered list corresponds with the numbered lines in the PAUP block.
 (1)  Automatically close the status window when an action completes. 
 (2)  Conduct a partition homogeneity test (ILD test of Farris, 1995) using the "genes"
      character partition. The seed value for the random number generator is set to 
	  one. 
 (3)  Include only the d1 data set.
 (4)  Conduct a heuristic search using default settings and show the tree.
 (5)  Include only the d2 data set.
 (6)  Conduct a heuristic search using default settings and show the tree.
 (7)  Include all the data.
 (8)  Weight tranversions 10 times transitions for the d1 data set only.
 (9)  Conduct a partition homogeneity test (ILD test of Farris, 1995) using the "genes"
      character partition and the 10_1 transversion weighting for the d1 data set.
	  The seed value for the random number generator is set to one.
 (10) Repeat steps 3-6 with tranversions weighted 10 times transitions.
]
Begin taxa;
  Dimensions ntax=8;
  taxlabels
A
B
C
D
E
F
G
H
;
End;

Begin data;
	Dimensions ntax=8 nchar=1200;
	Format datatype=dna interleave;
	Matrix
        [Start of d1]
		A ATAAGTCCAAGCGATAACTACACACGCCCAGCGGCAACCAAGAGGCAACAACAACACGAACAAGGAGGAAACAAAGAACAACAAGCGGCAACAAACAAAAGGGAAAAGCCCGACCGCGAAGCAGAACGAACCCAACCACACACAACACCGAAAAAAGCCGAGACGAAGAGAAAGGAAACCAAAAACACGCCCACCCGAATAGAAGATAACCCAGCCACTACTAACACGAACGCCCAACCCAGAGAAGCAAGAGACGCAGTCGCAGGAACGCTCGCCCCAGCAAAAGTACAACAACGAAAACCCGAGGACGAGACGCCAAGAAGGGGGAGTGCGAACTCAAGTAAAGAAAAACGATGAGCATTCATCAAACTACTGCAGAACAGGGCAAGACCAGCAAAATAAAAGAACCAAATAAAGCGAACAGGGCGACCCTAAAGCAACAGATATCAGCGCACGAAATTGAACAGCACACGAAAAAAAACACACGCG [...]
		B GCAGATAGGAACGGCGGAACTAAGCAACAGCCAGCACACAACGACAGAAAGCAGCATACGAGAAGGGCAAGCGAGAGATAACCAAACACAACGAGACAGAAGGGAAAGCCCGAACGCGGCGGAAGGTAAAGTCGATCGCCCGCGAGACAGGCACAAAGTCAGACAAGAGAAAGGAAATCCGGAGCCAAACCGACCTAGCAAAAAAACCGAACAAGCATCGACGGTATGAAAACACAACACGACAACACAACGATGACGACCAAAAGGATAACTGCCCTAACGAAAAGAAAAACCAAAGGGCCCAGAAGACGAGAGGCAGAGAAGAAGAAGGAAGACCCGGGCGGAAGAACAAGACAAGCGCTGATGCAGCCATGAAGAAAAGGAAACAAAAAAGGGGGAGACACAGCCCAGACACGGCAGGCATCAGGGCCCGAGGAGGGCCGGAAACAAAACACAGGACCCGACCGCCGCCAAAAAACAAGAAAGAAA [...]
		C GCAAATAAGCATACCGGCCATGCAGGCCCAGCAACGGTCAACGGATGACGGTTGCGGGAGCGAAAGAGGTAAAAAAAACGACCGGCAATGAAGAGGCAAAAGGGAAGGGCCGGCGACAACAGAAATCGAAGCCGGCAACACAACGAACCGGTGTGCAGGAAGTCGCAGAGAACGAGAAACAAAAGCGCACCAGCTAAATAAAGAAGTAAGATGACAAACATGAAGACGGACACGAGACGAGGAGAAACGGCAGTCACGATAAAGAAGATGACGACCGCGCAAAAAAGAGGGAAACAGAACCTCAGGAGCGACGCACCAAAGACAAGAAGTAAGACCCCAAGCAGAAGCGGGAGACAAACACTCCTAAGCCAACCAAAAAAAAAAACCGAAACAAAGAAAAACCCAGGCCAAGAAGAGAAAACATCCAAGATCAAGGACGGTGAGCGCCAGGACACCGAACGAGACCACAATCAAAAAGGAATAGAAACA [...]
		D GAGCACAAAGACGGCGGCGAAGCGTACCAAACAGCAGTCGGAAAACAGCAGCTACGCATACGAAAAGGAAACAAAGGACAACCAGAAATAGAACGCCAGGGGGAAAAACCCGGCCACACTAAGAACCAAGACCGGCCACGCGCAAAAACAGGGCACAAAAAAACACAAAAAAGGAGACACACGACCAAACCAGACAGATGAGAAAGCGAGACGGCCACAACCGGAGTAGATAAAGAACGCTAAGAAGTGACCACCGCAGTAAAAGTAGTAGCAATCTCGCCAAAAGGAAGAAGCCGGACGGTCAAGAGAAAGGAGGTAGGAGCGAGCGACAAGAACCCGGACAACGGAAGAGGGCAAGGACCCCCTAACGAGGCGAAAACGGGAACAAAAACAAGAGAGAACACAAACCGAACAGGAAACGCATCCAAACCAGAAGACAACAAACATAAGAGCACAAAATCAGAGACCAACCGAACAGAGACAAGAACG [...]
		E GCACACGAAAGCAACAATGATCTACGACAAGCAGGGGTCATAAAAGAAGGACCGCAGAGACAGAACAGGAACGGAGGGCAACAAGCAACGAGCAACCCGAAGAAGGAACCCGCCCACAGCACAAGGCAGACTTGATCACACACGGAGCCAGCAGAAGGGGGAACCGAAGGCGCAAAATACAACATAAAACCACCCAAACAGAGGGACAAGAAGACTGCTGCCAACATAGCCGCAAATCACGGGGAAACAGCCGCCGCGACAGAGGGAAAAAGAAAACCCACACGCGAAAGGAGCGAAATGCCCAAAAAGGGGAGACGAGAAAGCGAAAAACGCGATGCAAGACGGAGCAAAAAATGGACAACCCTAAGCCCACCAAACACGAAAGCGAGGGCCAATAAAACCCCAAACCCCACGGAGGAAGCTCGCAGACCAAGAAGAAATAAACAACCGAAAGCGCAGACAAACGGTAAACAAAGAAGAGTGACGATC [...]
		F CCCCACAAAAAAGACAATAATCTGCGACAAGCACAAGTCATAAAAGAAGGACCGCGCAAACAAAAACAGAACAGAGAGCGACAAATGATGACCAACCCGAAGAAGGAACCCGCCCACGACACAAGGCAGACTTGATCGCACACAAGGCCAACAGAAGGAGAAGCCAAAAATGCAAGATACACCGCAAAACCGCCCAAACAGAGGAACAAGAACACAACGGCCGCCACAGGCACGAACCGCAGAGAAACAACCACCACGAGAGAAAAAAAAAGAAAACCCACACAGGAAAGAACCAGAATGCCCGAAAGGAGAAGGCAAAGTAACGAGAAGCAGGGCGCAAGACAGAGCAAGGGAGGGACGACCCCAGACCCACCAAACACCAAAGCGGGGGCTAACGAAGGCCAAAATCCCACAAAGAAAACTTGCAAACCGAGGAGAAGCGGACATCCGAAAGCACAAGCAAACGGCGGGCAAAAAAGCATAACGGCA [...]
		G GGCAACGCAGCGGCCAACAATGCGCAGCAGGAGGAAAATAGGAAAGGCAGTACGCGTGAGAAGGCACGCAATCAAAGACAGCAAATACAGAGCCACATCAAAGAATCACCAGACTACGCCACAGACCAGCCCCAACAGGAAACCAGACCGACACACGCGGAGGCAAAAAATAGGAGCCGCGATAAAAAACCACCCGAGCAAGAGGGCAAAAAGCCCGTAACAAGAGCCAGCGCAAACAAAGAAGAGACAGAAGCCATGAAAAAAAGGGAGGCGGGACACGCCAAGGAGAAAGATGTGGTATCCGAACAAGAGGAACACAAAAGGAAAAGCTTAACCACAGAAGAAAACACAAAACAGGCATCCCTACGCAGACGAGACGCAGAAACAGAAGTCAAACGGGAACCCAGCCCCACGAGTAAAAGTAACGGAGAAAAAAAAACCAAACACCCAACAACACAGACAAGCCCCCAACAGAAGAGGATGACAACA [...]
		H AACAACGCAGGCCGAAACGATACGCAGCACAAGAAGACCAAAAAAAACAAGCCACAAAGAAGGACACGCAACCAAGGACAACAGGTACAGAACGACACCGAAGGAGAGCCAGGCCAAAGCACAAACCAACCTCAGCTAAACACAGAAACAGCGTATGAAGAAGCGGAGAAAAGAAAGCGCGGTACAAGACCAACCAAACGAGGCAGCAAAAAAATCAAAACAAGAAACAGCAGAAACGGAAAGAAAGCAAGAGACGACAGGAAGGGGGCAACGAGGCCCAACCGGAAAAAAGGTACAGCATCCGGACAAGGAGGACGCGAGAAAAAAGACCTAAGCACAGAAAAGGACACAGAGCGGGCATCCCAACGCGGACCAAACACAAGAGCAGAGATCAAACAGGAACCCGGCCCCACGAGGAGAAACCACAGAACAGGAAAAGCCAAACATCCAAGAACACGAGCAACCCCCACGCAGGAGGAGATGACAGTA [...]
		
		[Start of d2]
		A ATCCTTGGAATGTATCCGTAGCGCCTGGGCGGTTGCCCGAATCTTGAAGCAGCACAGGCAGCAGTCTGAACGCACGAAGCCGACTGGTGACGAACGCACCTTTCCCCTGGGGCGGTGTAATGATCCGGCAGGGAAGGAGAGAGACGCGCTAAAAACGCGTCTCGTCAGATAACGTCAAGCCCAACGCCTGGGAGGCTCCTCTCATCTACGGGATGGAGTAGTCAGAGGCACTGGGCAGGGATCTCATCCCTCTCGTGCTTGTGATTCCGTGTCTGCGGATGCAAATTCCCAGAAGTCAAACGGTATTCGTATCGTGGACGCCTGTTTATTGGTAAGTGAAGTCCATCACAAGTCTTAGCCTTCCTGAAAGTACTTGATACGATTTGAATAGGATCAAAATACACTAACGAAATACATCTCACATTTGGCGCCTCCATCAAGCTATCTCAGCTGCGTACCTTTCCGCTGCCAGGCAACCAAACCGCGTCT [...]
		B TCATATAGGAGGTGCTTAAGTCATGAACAGGGCTGCCAACATGAGATAAATCAGGGTCGTATCGTTGTACTGGCTCTCTCCCCCCAGCAGGGGATAGCGCCTTGACATCGGTCACTCTTATGAATTTACCGTGGCTTTGGCGCGAGCGATGCACCCCGTGCTACCATCTCAATGCACTCCGGAGGGCCAATTAGGTAGGGGCGCCCCGTAACAATCCTCTACGTTATTCAAGGCGAACAGTAGCAGCTCATTCTTCATCCCCAACTTATAAATTGCCTACGGAACGGCCCAAGGAGGTGTAGGAGCATAGTCTAGTACGGTCGTCATACTTAATGCGCTGGGGTCGTAATAATCAAGTATCTTATTCCTGGCTTGAGCCCATGAAAGCCAAACGTGTGATACAAGGGAGCTAGCTTGTCGTCATGAGTTCCGTAGGGTTTGGTTAGACACACGCGCGTACGGTCCATGGTGGAACCCCGCATCCCGAAC [...]
		C GCACATAAGTATGCAGGGCATTCATTGCGGGCAGGGGTCAAGTGGTTAGTGTTGGTTGCTGTGAATGTTTCAGACGGCGTACGTTCAGTGGAGCGTGCAAAGTTCATTTAGGGGTACCAAATTCATGTACGGATGCACGTGCACTACGGTGTGTTGCTTCCTTGGCATGTCAGTCTAAACAAGCTCTTCGAATGTAAATAGCTAGGTGATATTACAGACATTAAGACGTAGGATAGAGTATTCTCACGTGTCGTCCCTATCAGGTAGATTAGTCGGTGGTAGCAGCTCTTCACGGTGAGGGTGCTTCTCTCTTGGCGACTGCGCAGCCTTTATAGGGCAGTGAGCCTCTTGCTCTGAACTATGGTAAGCCAACGGCCCGCAACAAAGTAAAGCAAGCAAAACCCGGCCGCATAGTGGACCAACTCTACTATACGTGGCGGTTCGAGGTAGTCGCGCTACCTCTCAGAGGCTGGGACCTTGCTCTCAAGA [...]
		D TAGCACAAATACGGCTTCTAATGTTGGCCCACATGCGTCTGAAAGCATGAGATACGCATCTTCCACGTGCACGAATTACCCCCCGATATCTAACTCCATGTTTACAATGGATCATAAATTAATCCCAAATAAATTCGCCTATGAAAGAAATTGCCGCCACCCAGACACACAATGCTAAACATGAGCACAGAATACAGGTTATAAGTCTTGAGTTAGATAATGTGCGTCTATGAAGGCGTCTTCTAATTTGTGCCGTCCGTAAAAGTAGTTGGCCTGTGGATCAAGTGCATAAGCGTGACGTTGCCTATAGCTGATTTATTATGGATTTACAATCCCCCGTCCTCTGTCCTATTTTGATTTGGTCGTACCTAGTGTACCCGGTGAACAAAAAGCATAGATCAGACAAACCGAAGATTCAACTCATCGCCCCAATAAGGCAGCCCGCCGAGTAGGCCACCGTCAGCTACCTAGGGGACATTTAGCATACGG [...]
		E TCAGAGCACTTCGCTAATTATCGCCGACCGGCATGGATTATACCAGAAGCGTGTGCTAGAAGTCATCTGCGCTTATTGGAACCCGGAAGCGTAACCCATGCGCTTAATGTCTCTAACATCCCCACCGATAAGTTATTCTGGGGTTAGGATTTCTGACGTTTACGGTAATCTGGACGATACAAGCTCAGAGACCGTAATTCTCACGGCGTTACGTATTATTCGCACGTATTCGTCACTACCTTCTCACGATTGTAGGCTATATACTGAAACACCTCACGGCCGAGGTACAGCAGCGTCATGGTCCTATTGGGCGTGTGATTGCGGCGACCATGGTCTGCATGATCTGGACCTCTATGTTCCCCTCTACGCCCACAAAACGGTAGAAATGTTAGCAATCCAACCACCGACGCAATGTCTTACTCTTGGCTTGCCTTCCTAAGTAAACGACGCCGACTGTCGCCCCCCGCTGAAGAAAGAATGCTTACATTC [...]
		F TCCCACCACTAAGCTAACAATAGGCTACCGGCATGAATCCTAACAGAAGCGTCTCCGACAGGGCCTCAGCGCTTCTTGAAACCCGGTAGCTTAACCCATGCCCGGAATGTGTATTACTGCACCCCCGATTAGTTATTCCTGGGAAGGGATTTCTTACTATCATGCAAAACTGCACTCTACCCGGGGATGCAGCGTAAGTCTAACGGCCTTACGGAAAATTCGGCTGCATTCCTCAGCATGTTCTCACAAGTGAAGACTATACACTAGAACATCTAACGGCAGAGTTAAATCACCCTGATGGTCTTCTTGCGCGTGTAATTTCGGCGGCCGTAGTTCGCACGCTCTGGAACTGTATGTTCCCCTGAACCCCCACCCAAAGCCAAAGCTGTTCGTAAGTCAAGCAAAGATACAACGGCTCACACTTGTGATCCCTGGATAATCCGGACTCGCCGACTGTCGTGACCGGCCTGTCAGACAATGCTCATATCC [...]
		G TTGACGGGATTTGGTGCGCCTGGTCCTCGTGCGGACAATATTACATGTGGTAGTGGTTACATTGGAGTGACTTAACTGCATCCCGTAGAGATGGAGATAGCCTCGTCAGCATGATAATTAAGCTAAACGTCACGGCATGTAGGCGGACATCGAGGCTCTGATTGGGAACCTGTGAGGGTTGCTAACAACGAGGCATCTGACGAGGTGAGAGCGTCGTTACCACTATCGATGGTCCCAAAAGCCTCGAACGCAGATATTAACCACATTGCGGGTTTGCAGGAGAAGGATTCATCTTTTGTGTTCGACGCAGGCTGCTACTGCCGGGCCCTGTTGGCCAAATGCTCAGACCGGATAGATTCATCCGTTGTGATACTCGCCGCAGAACAAGCATTCAAAGGTCAAGCGGTCCCGAATATTCACCGTAAGGTGTAGCGCCCAGCCGCCCACGGAAGAAGGTCGTCAAGCGCCTACTGTACTATTCTTACAACC [...]
		H CAGCATGACTTGGTAGCGTCTAGTCATGCGCAGCAGAGCACAACAGACAATGACGCAGTCATGGGAGTGAAGGAATTGGACCCCTTTGAGACGTCGCACGCCTTGTCTGGAGGGTAACTCAGGCCCACGTCTGGTCTCATCGGCTAAAGTGGGTATTCTGCCTGGTAGCCAGTAAAGGTCGGTCCAATAGAGACAAATGGGGTCGTCAGACCCGTGAACGTACTATAGCTGGTCCCGGGACCGACGGGAGTATATTATATTCGCTGTGCCAGTCTTGCTAAGGGGGAAGCATGTCCATCATTGTTCTGAGGCTTCTTCTGTCCGACCTGTGTAATGAAACGCACTTACCGGTTGCTTTCATCGGAGCTTGTACGCCCCCTAATATGCGCGGTCAAAGCTGAAGCGTTCGCGCAGATTCGCCAAGAGATGCCATTCACATGCGAGGATGCAATAAGGTTCTCGACCGCAATGTGTTCTTAGCTTCGCTTC [...]
		;
End;

Begin sets;
  charset d1 = 1-600;
  charset d2 = 601-.;
  charpartition genes = gene1:d1, gene2:d2;
End;

Begin assumptions;
  usertype 10_1 = 4  [weights transversions 10 times transitions]
         a  c  g  t
     [a] .  10 1  10
     [c] 10 .  10 1
     [g] 1  10 .  10
     [t] 10 1  10 .
   ;
End;

Begin paup;
  [1] set autoclose=yes;
  [2] hompart partition=genes seed=1;
  [3] include d1/only;
  [4] hsearch;showtree;
  [5] include d2/only;
  [6] hsearch;showtree;
  [7] include all;
  [8] ctype 10_1:d1;
  [9] hompart partition=genes seed=1;
      include d1/only;
      hsearch;showtree;
      include d2/only;
      hsearch;showtree;
End;
\ No newline at end of file
diff --git a/examples/nexus/Primates.nex b/examples/nexus/Primates.nex
new file mode 100644
index 0000000..aa4475a
--- /dev/null
+++ b/examples/nexus/Primates.nex
@@ -0,0 +1,24 @@
+#NEXUS
+begin data;
+dimensions ntax=12 nchar=898;
+format datatype=dna interleave=no gap=-;
+matrix
+Tarsius_syrichta	AAGTTTCATTGGAGCCACCACTCTTATAATTGCCCATGGCCTCACCTCCTCCCTATTATTTTGCCTAGCAAATACAAACTACGAACGAGTCCACAGTCGAACAATAGCACTAGCCCGTGGCCTTCAAACCCTATTACCTCTTGCAGCAACATGATGACTCCTCGCCAGCTTAACCAACCTGGCCCTTCCCCCAACAATTAATTTAATCGGTGAACTGTCCGTAATAATAGCAGCATTTTCATGGTCACACCTAACTATTATCTTAGTAGGCCTTAACACCCTTATCACCGCCCTATATTCCCTATATATACTAATCATAACTCAACGAGGAAAATACACATATCATATCAACAATATCATGCCCCCTTTCACCCGAGAAAATACATTAATAATCATACACCTATTTCCCTTAATCCTACTATCTACCAACCCCAAAGTAATTATAGGAACCATGTACTGTAAATATAGTTTAAAC [...]
+Lemur_catta		AAGCTTCATAGGAGCAACCATTCTAATAATCGCACATGGCCTTACATCATCCATATTATTCTGTCTAGCCAACTCTAACTACGAACGAATCCATAGCCGTACAATACTACTAGCACGAGGGATCCAAACCATTCTCCCTCTTATAGCCACCTGATGACTACTCGCCAGCCTAACTAACCTAGCCCTACCCACCTCTATCAATTTAATTGGCGAACTATTCGTCACTATAGCATCCTTCTCATGATCAAACATTACAATTATCTTAATAGGCTTAAATATGCTCATCACCGCTCTCTATTCCCTCTATATATTAACTACTACACAACGAGGAAAACTCACATATCATTCGCACAACCTAAACCCATCCTTTACACGAGAAAACACCCTTATATCCATACACATACTCCCCCTTCTCCTATTTACCTTAAACCCCAAAATTATTCTAGGACCCACGTACTGTAAATATAGTTTAAA-AAAA [...]
+Homo_sapiens		AAGCTTCACCGGCGCAGTCATTCTCATAATCGCCCACGGGCTTACATCCTCATTACTATTCTGCCTAGCAAACTCAAACTACGAACGCACTCACAGTCGCATCATAATCCTCTCTCAAGGACTTCAAACTCTACTCCCACTAATAGCTTTTTGATGACTTCTAGCAAGCCTCGCTAACCTCGCCTTACCCCCCACTATTAACCTACTGGGAGAACTCTCTGTGCTAGTAACCACGTTCTCCTGATCAAATATCACTCTCCTACTTACAGGACTCAACATACTAGTCACAGCCCTATACTCCCTCTACATATTTACCACAACACAATGGGGCTCACTCACCCACCACATTAACAACATAAAACCCTCATTCACACGAGAAAACACCCTCATGTTCATACACCTATCCCCCATTCTCCTCCTATCCCTCAACCCCGACATCATTACCGGGTTTTCCTCTTGTAAATATAGTTTAACCAAA [...]
+Pan	  		AAGCTTCACCGGCGCAATTATCCTCATAATCGCCCACGGACTTACATCCTCATTATTATTCTGCCTAGCAAACTCAAATTATGAACGCACCCACAGTCGCATCATAATTCTCTCCCAAGGACTTCAAACTCTACTCCCACTAATAGCCTTTTGATGACTCCTAGCAAGCCTCGCTAACCTCGCCCTACCCCCTACCATTAATCTCCTAGGGGAACTCTCCGTGCTAGTAACCTCATTCTCCTGATCAAATACCACTCTCCTACTCACAGGATTCAACATACTAATCACAGCCCTGTACTCCCTCTACATGTTTACCACAACACAATGAGGCTCACTCACCCACCACATTAATAACATAAAGCCCTCATTCACACGAGAAAATACTCTCATATTTTTACACCTATCCCCCATCCTCCTTCTATCCCTCAATCCTGATATCATCACTGGATTCACCTCCTGTAAATATAGTTTAACCAAAACATCA [...]
+Gorilla   		AAGCTTCACCGGCGCAGTTGTTCTTATAATTGCCCACGGACTTACATCATCATTATTATTCTGCCTAGCAAACTCAAACTACGAACGAACCCACAGCCGCATCATAATTCTCTCTCAAGGACTCCAAACCCTACTCCCACTAATAGCCCTTTGATGACTTCTGGCAAGCCTCGCCAACCTCGCCTTACCCCCCACCATTAACCTACTAGGAGAGCTCTCCGTACTAGTAACCACATTCTCCTGATCAAACACCACCCTTTTACTTACAGGATCTAACATACTAATTACAGCCCTGTACTCCCTTTATATATTTACCACAACACAATGAGGCCCACTCACACACCACATCACCAACATAAAACCCTCATTTACACGAGAAAACATCCTCATATTCATGCACCTATCCCCCATCCTCCTCCTATCCCTCAACCCCGATATTATCACCGGGTTCACCTCCTGTAAATATAGTTTAACCAAAAC [...]
+Pongo     		AAGCTTCACCGGCGCAACCACCCTCATGATTGCCCATGGACTCACATCCTCCCTACTGTTCTGCCTAGCAAACTCAAACTACGAACGAACCCACAGCCGCATCATAATCCTCTCTCAAGGCCTTCAAACTCTACTCCCCCTAATAGCCCTCTGATGACTTCTAGCAAGCCTCACTAACCTTGCCCTACCACCCACCATCAACCTTCTAGGAGAACTCTCCGTACTAATAGCCATATTCTCTTGATCTAACATCACCATCCTACTAACAGGACTCAACATACTAATCACAACCCTATACTCTCTCTATATATTCACCACAACACAACGAGGTACACCCACACACCACATCAACAACATAAAACCTTCTTTCACACGCGAAAATACCCTCATGCTCATACACCTATCCCCCATCCTCCTCTTATCCCTCAACCCCAGCATCATCGCTGGGTTCGCCTACTGTAAATATAGTTTAACCAAAAC [...]
+Hylobates 		AAGCTTTACAGGTGCAACCGTCCTCATAATCGCCCACGGACTAACCTCTTCCCTGCTATTCTGCCTTGCAAACTCAAACTACGAACGAACTCACAGCCGCATCATAATCCTATCTCGAGGGCTCCAAGCCTTACTCCCACTGATAGCCTTCTGATGACTCGCAGCAAGCCTCGCTAACCTCGCCCTACCCCCCACTATTAACCTCCTAGGTGAACTCTTCGTACTAATGGCCTCCTTCTCCTGGGCAAACACTACTATTACACTCACCGGGCTCAACGTACTAATCACGGCCCTATACTCCCTTTACATATTTATCATAACACAACGAGGCACACTTACACACCACATTAAAAACATAAAACCCTCACTCACACGAGAAAACATATTAATACTTATGCACCTCTTCCCCCTCCTCCTCCTAACCCTCAACCCTAACATCATTACTGGCTTTACTCCCTGTAAACATAGTTTAATCAAAAC [...]
+Macaca_fuscata		AAGCTTTTCCGGCGCAACCATCCTTATGATCGCTCACGGACTCACCTCTTCCATATATTTCTGCCTAGCCAATTCAAACTATGAACGCACTCACAACCGTACCATACTACTGTCCCGAGGACTTCAAATCCTACTTCCACTAACAGCCTTTTGATGATTAACAGCAAGCCTTACTAACCTTGCCCTACCCCCCACTATCAATCTACTAGGTGAACTCTTTGTAATCGCAACCTCATTCTCCTGATCCCATATCACCATTATGCTAACAGGACTTAACATATTAATTACGGCCCTCTACTCTCTCCACATATTCACTACAACACAACGAGGAACACTCACACATCACATAATCAACATAAAGCCCCCCTTCACACGAGAAAACACATTAATATTCATACACCTCGCTCCAATTATCCTTCTATCCCTCAACCCCAACATCATCCTGGGGTTTACCTCCTGTAGATATAGTTTAACTA [...]
+M_mulatta		AAGCTTTTCTGGCGCAACCATCCTCATGATTGCTCACGGACTCACCTCTTCCATATATTTCTGCCTAGCCAATTCAAACTATGAACGCACTCACAACCGTACCATACTACTGTCCCGGGGACTTCAAATCCTACTTCCACTAACAGCTTTCTGATGATTAACAGCAAGCCTTACTAACCTTGCCCTACCCCCCACTATCAACCTACTAGGTGAACTCTTTGTAATCGCGACCTCATTCTCCTGGTCCCATATCACCATTATATTAACAGGATTTAACATACTAATTACGGCCCTCTACTCCCTCCACATATTCACCACAACACAACGAGGAGCACTCACACATCACATAATCAACATAAAACCCCCCTTCACACGAGAAAACATATTAATATTCATACACCTCGCTCCAATCATCCTCCTATCTCTCAACCCCAACATCATCCTGGGGTTTACTTCCTGTAGATATAGTTTAACTAAAACA [...]
+M_fascicularis		AAGCTTCTCCGGCGCAACCACCCTTATAATCGCCCACGGGCTCACCTCTTCCATGTATTTCTGCTTGGCCAATTCAAACTATGAGCGCACTCATAACCGTACCATACTACTATCCCGAGGACTTCAAATTCTACTTCCATTGACAGCCTTCTGATGACTCACAGCAAGCCTTACTAACCTTGCCCTACCCCCCACTATTAATCTACTAGGCGAACTCTTTGTAATCACAACTTCATTTTCCTGATCCCATATCACCATTGTGTTAACGGGCCTTAATATACTAATCACAGCCCTCTACTCTCTCCACATGTTCATTACAGTACAACGAGGAACACTCACACACCACATAATCAATATAAAACCCCCCTTCACACGAGAAAACATATTAATATTCATACACCTCGCTCCAATTATCCTTCTATCTCTCAACCCCAACATCATCCTGGGGTTTACCTCCTGTAAATATAGTTTAACTA [...]
+M_sylvanus		AAGCTTCTCCGGTGCAACTATCCTTATAGTTGCCCATGGACTCACCTCTTCCATATACTTCTGCTTGGCCAACTCAAACTACGAACGCACCCACAGCCGCATCATACTACTATCCCGAGGACTCCAAATCCTACTCCCACTAACAGCCTTCTGATGATTCACAGCAAGCCTTACTAATCTTGCTCTACCCTCCACTATTAATCTACTGGGCGAACTCTTCGTAATCGCAACCTCATTTTCCTGATCCCACATCACCATCATACTAACAGGACTGAACATACTAATTACAGCCCTCTACTCTCTTCACATATTCACCACAACACAACGAGGAGCGCTCACACACCACATAATTAACATAAAACCACCTTTCACACGAGAAAACATATTAATACTCATACACCTCGCTCCAATTATTCTTCTATCTCTTAACCCCAACATCATTCTAGGATTTACTTCCTGTAAATATAGTTTAATTAAAAC [...]
+Saimiri_sciureus	AAGCTTCACCGGCGCAATGATCCTAATAATCGCTCACGGGTTTACTTCGTCTATGCTATTCTGCCTAGCAAACTCAAATTACGAACGAATTCACAGCCGAACAATAACATTTACTCGAGGGCTCCAAACACTATTCCCGCTTATAGGCCTCTGATGACTCCTAGCAAATCTCGCTAACCTCGCCCTACCCACAGCTATTAATCTAGTAGGAGAATTACTCACAATCGTATCTTCCTTCTCTTGATCCAACTTTACTATTATATTCACAGGACTTAATATACTAATTACAGCACTCTACTCACTTCATATGTATGCCTCTACACAGCGAGGTCCACTTACATACAGCACCAGCAATATAAAACCAATATTTACACGAGAAAATACGCTAATATTTATACATATAACACCAATCCTCCTCCTTACCTTGAGCCCCAAGGTAATTATAGGACCCTCACCTTGTAATTATAGTTTAGCT [...]
+;
+end;
+
+begin assumptions;
+	charset firsthalf = 1-449;
+	charset secondhalf = 450-898;
+end;
\ No newline at end of file
diff --git a/examples/nexus/RSV2.nex b/examples/nexus/RSV2.nex
new file mode 100644
index 0000000..a989c94
--- /dev/null
+++ b/examples/nexus/RSV2.nex
@@ -0,0 +1,141 @@
+#NEXUS
+
+Begin DATA;
+	Dimensions ntax=129 nchar=629;
+	Format datatype=NUCLEOTIDE gap=-;
+	Matrix
+	[           1         11        21        31        41        51        61        71        81        91        101       111       121       131       141       151       161       171       181       191       201       211       221       231       241       251       261       271       281       291       301       311       321       331       341       351       361       371       381       391       401       411       421       431       441       451       461       471       [...]
+	[           |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         [...]
+	BE8078s92   TCCTCACCCAGAATCCCCAGTTTGGAATCAGCTTCTCCAATCTGTCCGAAACTACATCACAAATCACCACCATACTAGCTTCAACAACACCAAGTATCGAATCAACCCTGCTATCCACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCACAACAAACCACCAAACAAACCCAACAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCTTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCTATCTGTAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCACCAGGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAACACTCACCACCAAGCCCACAGAAAAGTCAACCATCAACACCACCAAAACAAACATCAGAACTACAATGCTTATC [...]
+	NYCH09s93   ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCCGAAACTACATCACAAACCACCACCATACTAGCCTCAACAACACCAAGTATCGAATCAACCCTGCTATCAACAACAGTCAAGACCAAAAACACAACAACAACCCAATTACAACCCAGCAAGCCCACCACAAAACAACGCCACAACAAACCACCAAACAAACCCAACAATGATTTTCACTTTGAAGTGTTCAACTTTGTTCCTTGCAGTATATGCAGCAACAATCCAACCTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACAACCAAGCCCACAAAAAGACCAACCACCAGGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGGAACACTCACCACCAAGCCTACAGAAAAGTCAACCATCAACGCCACCAAAACAAACATCAGAACTACAATGCCCATC [...]
+	SE01s92     ACCTCACCCAGGATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCTGAAACTACATCACAAACCACCACCATACTAGCTTCAACAACACCAAGTGTCGAATCAACCCTGCTACCCACAACAGTCAAGACCAAAAACACAACAACTACCCAAATACAACCCAGCAAGCCCGCCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAACAATGATTTTCACTTCGAAGTGTTCAACTTTGTACCTTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCACCAAGATAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGTACCTACCACCAAGCCCACAGAAAAGTCAACCATCAACACCACCAAAACAAACATCAGAACTACGCTGCTCACC [...]
+	SE05s91     ACCTCACCCAGGATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCTGAAACTACATCACAAACCACCACCATACTAGCTTCAACAACACCAAGTGTCGAATCAACCCTGCTACCCACAACAGTCAAGACCAAAAACACAACAACTACCCAAATACAACCCAGCAAGCTCGCCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAACAATGATTTTCACTTCGAAGTGTTCAACTTTGTACCTTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCACCAAGATAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGTACCTACCACCAAGCCCACAGAAAAGTCAACCATCAACACCACCAAAACAAACATCAGAACTATGCTGCTCACC [...]
+	MON1s92     ACCTGACCCAGAATCCCCAGCTTGGAATCAGCTTCTTTAATCTGTCTGGAACTACATCACAAACCACCGCCATACTAGCTTTAACAACACCAAGTGTCGAGTCAATCCTGCAATCTACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCGCCAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGCACCTACCACCAAGCCCACAGAAAAGCCAACCATCAACATCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	BE1587s89   ACCTGACCCAGAATCCCCAGCTTGGAATCAGCTTCTTCAATCTGTCTGGAACTACATCACAAACCACCGCCATACTAGCTTTAACAACACCAAGTGTCGAGTCAATCCTGCAATCTACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGCACCTACCACCAAGCCCACAGAAAAGCCAACCATCAACATCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	BE614s93    ACCTGACCCAGAATCCCCAGCTTGGAATCAGCTTCTTCAATCTGTCTGGAACTACATCACAAACCACTGCCATACTAGCTTTAACAACACCAAGTGTCGAGTCAATCCTGCAATCTACAACAGTCAAGACCAAAAACACAATAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGCACCTACCACCAAGCCCACAGAAAAGCCAACCATCAACATCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	BE12005s94  ACCTGACCCAGAATCCCCAGCTTGGAATCAGCTTCTTCAATCTGTCTGGAACTACATCACAAACCACCGCCATACTAGCTTTAACAACACCAAGTGTCGAGTCAATTCTGCAATCTACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACACCAAAACAAACCACCAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAGACCAAAGGAAGCATCTACCACCAAGCCCACAGAAAAGCCAACCATCAACATCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	BE174s95    ACCTGACCCAGAATCCCCAGCTTGGAATCAGCTTCTTCAATCTGTCTGGAACTACATCACAAACCACCGCCATACTAGCTTTAACAACACCAAGTGTCGAGTCAATTCTGCAATCTACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACACCAAAACAAACCACCAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAGACCAAAGGAAGCATCTACCACCAAGCCCACAGAAAAGCCAACCATCAACATCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	BE12350s96  ACCTGACCCAGAATCCCCAGCTTGGAATCAGCTTCTTCAATCTGTCTGGAACTACATCACAAACCACCGCCATACTAGCTTTAACAACACCAAGTGTCGAGTCAATTCTGCAATCTACAACAGTAAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACACCAAAACAAACCACCAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAGACCAAAGGAAGCATCTACCACCAAGCCCACAGAAAAGCCAACCATCAACATCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	BE12216s96  ACCTGACCCAGAATCCCCAGCTTGGAATCAGCTTCTTCAATCTGTCTGGAACTACATCACAAACCACCGCCATACTAGCTTTAACAACACCAAGTGTCGAGTCAATTCTGCAATCTACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACACCAAAACAAACCACCAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCTTCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAGACCAAAGGAAGCATCTACCACCAAGCCCACAGAAAAGCCAACCATCAACATCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	BE11600s94  ACCTGACCCAGAATCCCCAGCTTGGAATCAGCTTCTTCAATCTGTCTGGAACTACATCACAAACCACCGCCATACTAGCTTTAACAACACCAAGTGTCGAGTCAATTCTGCAATCTACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACACCAAAACAAACCACCAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAGACCAAAGGAAGCATCTACCACCAAGCCCACAGAAAAGCCAACCATCAACATCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	SE10s92     ACCTGACCCAGAATCCCCAGCTTGGAATCAGCTTCTTCAATCTGTCTGGAACTACATCACAAACCACCGCCATACTAGCTTTAACAACACCAAGTGTCGAGTCAATCCTGCAATCTACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACACCAAAACAAACCACCAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGCACCTACCACCAAGCCCACAGAAAAGCCAACCATCAACATCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	MAD6s92     ACCTGACCCAGAATCCCCAGCTTGGAATCAGCTTCTTCAATCTGTCTGGAACTACATCACAAACCACCGCCATACTAGCTTTAACAACACCAAGTGTCGAGTCAATCCTGCAATCTACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGCACCTACCACCAAGCCCACAGAAAAGCCAACCATCAACATCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	BE15471s97  ACCTGACCCAGAATCCCCAGCTTGAAATCAGCTTCTTCAATCTGTCTGGAACTACATCACAAACCACCGCCACACCAGCTCCAACAACACCAAGTGTCGAGTCAATCCTGCAATCTACAACAGTCAGGACCAAAAATACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAGAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAACACCTACCACCAAGCCCACAGAAAAGCCAACCATCAACATCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	SE03s91     ACCTGACCCAGAATCCCCAGCTTGGAATCAGCTTCTTCAATTTGTCTGGAACTACATCACAAACCACCGCCATACTAGCTTTAACAACACCAAGTGTCGAGTCAATCCTGCAATCTACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACACCAAAACAAACCACCAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGCACCTACCACCAAGCCCACAGAAAAGCCAACCATCAACATCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	MAD2s93     ACCTGACCCAGAATCCTCAGCTTGGAATCAGCTTCTTCAATCTGTCTGGAACTACATCACAAACCACCGCCATACTAGCTTTAACAACACCAAGTGTCGAGTCAATCCTGCAATCTACAACAGTCAAGACTAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGCACCTACCACCAAGCCCGCAGAAAAGCCAACCATCAACATCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	BE10490s93  ACCTGACCCAGAATCCTCAGCTTGGAATCAGCTTCTTCAATCTGTCTAGAACTACATCACAAACCACCGCCATACTAGCTTTAACAACACCAAGTGTCGAGTCAATCCTGCAATCTACAACAGTCAAGACTAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGCACCTACCACCAAGCCCACAGAAAAGCCAACCATCAACATCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	SE11s95     ACCTGACCCAGAATCCTCAGCTTGGAATCAGCTTCTTCAATCTGTCTGGAACTACATCACAAACCACCGCCATACTAGCTTTAACAACACCAAGTGTCGAGTCAATCCTGCAATCTACAACAGTCAAGACTAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGCATCTACCACCAGGCCCACAGAAAAACCAACCATCAACATCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	NYCH17s93   ACCTGACCCAGAATCCCCAGCTTGGAATCAGCTTCTTCAATCTGTCTGGAAATACATCACAAACCACCGCCATACTAGCTTTAACAACACCAAGTGTCGAGTCAATCCTGCAATCTACAACAGTCAAGACCAGAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGACATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGCACCTACCACCAAGCCCACAGAAAAGCCAACCATCAACATCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	MAD6s93     ACCTGACCCAGAATCCCCAGCTTGGAATCAGCTTCTTCAATCTGTCTGGAAATACATCACAAACCACCGCCATACTAGCTTTAACAACACCAAGTGTCGAGTCAATCCTGCAATCTACAACAGTCAAGACCAGAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGCACCCACCACCAAGCCCACAGAAAAGCCAACCATCAACATCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	MAD8s92     ACCTGACCCAGAATCCCCAGCTTGGAATCAGCTTCTTCAATCTGTCTGGAAATACATCACAAACCACCGCCATACTAGCTTTAACAACACCAAGTGTCGAGTCAATCCTGCAATCTACAACAGTCAAGACCAAAAACATAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAAGAAGCACCTACCACCAAGCCCACAGAAAAGCCAACCATCAACATCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	MAD1s93     ACCTGACCCAGAATCCCCAGCTTGGAATCAGCTTCTTCAATCTGTCTGGAAATACATCACAAACCACCGCCATGCTAGCTTTAACAACACCAAGTGTCGAGTCAATCCTGCAATCTACAACAGTCAAGACCAAAAACATAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCCCAAAACCAAAAGAAGCACCTACCACCAAGCCCACAGAAAAGCCAACCATCAACATCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	BE13280s99  ACCTGACCCAGAATCCCCAGCTTGGAATCAGCTTCTTCAATCTGTCTGGAACTACATCACAAACCACCGCCATACTAGCTTTAACAACACCAAGTGTCGAGTCAATCCTGCAATCTACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAACACAAACCACCAAACAACCCCAATGATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACGAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGCACCTACTACCAAGCCCACAGAAAAGCCAACCATCAACATCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	BE13192s99  ACCTCACCCAGAATCCTCAGCCCGGCATCAGCTTCTCCAATCTGTCCGAAACTACATCACAACCCACCACCATACTAGCTTCAACAACACCAAGTGCTGAGTCAACCCCACAATCTACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCTAGCAAACCCACCACAAAACAACGCCAACACAAACCACCAAACAACCCCAATGATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACGAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGCACCTACTACCAAGCCCACAGAAAAGCCAACCATCAACATCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	BE1061s100  ACCTGACCCAGAATCCCCAGCTTGGAATCAGCTTCTTCAATCTGTCTGGAACTACATCACAAACCACCGCCATACTAGCTTTAACAACACCAAGTGTCGAGTCAATCCTGCAATCTACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAACCCCAATGATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACGAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGCACCTACTACCAAGCCCACAGAAAAGCCAACCATCAACATCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	BE16s100    ACCTGACCCAGAATCCCCAGCTTGGAATCAGCTTCTTCAATCTGTCTGGAACTATATCACAAACCACCGCCATACTAGCTCCAACAACACCAAGTGTCGAGCCAATCCTGCAATCTACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCTCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATGATAATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACGAAAAAACAAACCATCAAGACAACCAAAAAAGATATCAAACCTCAAACCACAAAACCAAAGGAAGCACCTACCACCAAGCCCACAGAAAAGCCAACCATCAACATCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	BE2122s100  ACCTGACCCAGAATCCCCAGCTTGGAATTAGCTTCTTCAATCTGTCTGGAACTATATCACAAACCACCGCCATACTAGCTCCAACAACACCAAGTGTCGAGCCAATCCTGCAGTCTACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCTCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATGATAATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACGAAAAAACAAACCATCAAGACAACCAAAAAAGATATCAAACCTCAAACCACAAAACCAAAGGAAGCACCTACCACCAAGCCCACAGAAAAGCCAACCATCAACATCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	BE1556s101  ACCTGACCCAGAATCCCCAGCTTGGAATCAGCCTCTTCAATCTGTCTGGAACTATATCACAAACCACCGCCATACTAGCTCCAACAACACCAAGTGTCGAGCCAATCCTGCAATCTACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCTCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATGATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACGAAAAAACAAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACTACAAAACCAAAGGAAGCACCTACCACCAAGCCCACAGAAAAGCCAACCATCAACATCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	BE800s100   ACCTGACCCAGAATCCCCAGCTTGGAATCAGCTTCTTCAATCTGTCTGGAACTATATCACAAACCACCGCCATACTAGCTTTAACAACACCAAGTGTCGAGTCAATCCTGCAATCTACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCTCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATGATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACGAAAAAACAAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGACAGAACCTACCACCAAGCCCACAGACAAGCCAACCATCAACATCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	BE1441s101  ACCTTACCCAGAATCCCCAGCTTGGAATCAGCTTCTTCAATCTGTCTGGAACTACATCACAAACCACCGCCATACTAGCTTCAACAACACCAAGTGTCGAGTCAATCCCGCAATCCACAACAGCCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATGATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACGAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCCAAGGAAGCACCTACCACCAAGCCCACAGATAAGCCAACCATCAACATCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	BE11976s100 ACCTTACCCAGAATCCCCAGCTTGGAATCAGCTTCTTCAATCTGTCTGGTACTACATCACAAACCACCGCCATACTAGCTTCAACAACACCAAGTGTCGAGTCAATCCCGCAATCCACAACAGCCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATGATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACGAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCCAAGGAAGCACCTACCGCCAAGCCCACAGATAAGCCAACCATCAACATCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	BE64s101    ACCTTACCCAGAATCCCCAGCTTGGAATCAGCTTCTTCAATCTGTCTGGAACTACATCACAAACCACCGCCATACTGGCTTCAACAACACCAAGTGTCGAGTCAATCCCGCAATCCACAACAGCCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATGATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACGAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCCAAGGAAGCACCTACCACCAAGCCCACAGATAAGCCAACCATCAACATCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	BE822s100   ACCTTACTCAGAATCCCCAGCCTGGAATCAGCTTCTTCAATCTGTCTGGAACTACATCACAAACCACCGCCATACTAGCTTCAACAACACCAAGTGTCGAGTCAATCCCGCAATCCACAACAGCCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATGATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACGGAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCCAAGGAAGCACCTACCACCAAGCCCACAGATAAGCCAACCATCAACATCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	BE13281s99  ACCTGACCCAGAATCCCCAGCTTGGAATCAGCTTCTTCAATCTGTCTGGAACTATATCACAAACCACCGCCATACTAGCTTCAACAACACCAAGTGTCGAGTCAATCCCGCAATCCACAACAGCCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATGATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACGAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCCAAGGAAGCACCTACCACCAAGCCCACAGATAAGCCAACCATCAACACCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	BE1936s100  ACCTGACCCAGAATCCCCAGCTTGGAATCAGCTTCTTCAATCTGTCTGGAACTATATCACAAACCACCGCCATACTAGCTTCAACAACACCAAGTGTCGAGTCAATCCCGCAATCCACAACAGCCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATGATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACGAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCCAAGGAAGTACCTACCACCAAGCCCACAGATAAGCCAACCATCAACACCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	BE1835s101  ACCTGACCCAGAATCCCCAGCTTGGAATCAGCTTCTTCAATCTGTCTGGAACTATATCACAAACCACCGCCATACTAGCTTTAACAACACCAAGTGTCGAGTCAATCCTGCAATCTACAACAGTCAAAACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATGATAATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACGAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCCAAGGAAGCACCCACCACCAAGCCCACAGACAAGCCAACCATCAACACCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	BE1937s100  ACCTGACCCAGAATCCCCAGCTTGGAATCAGCTTCTTCAATCTGTCTGGAACTATATCACAAACCACCGCCATACTAGCTTTAACAACACCAAGTGTCGAGTCAATCCTGCAATCTACAACAGTCAAAACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATGATAATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGAAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACGAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCCAAGGAAGCACCCACCACCAAGCCCACAGACAAGCCAACCATCAACACCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	BE1224s101  ACCTGACCCAGAATCCCCAGCTTGGAATCAGCTTCTTCAATCTGTCTGGAACTATATCACAAACCACCGCCATACTAGCTTTAACAACACCAAGTGTCGAGTCAATCCTGCAATCTACAACAGTCAAAACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATGATAATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACGAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCCAAGGAAGCACCCACCACCAAGCCCACAGACAAGCCAACCATCAACACCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	BE2149s100  ACCTGACCCAGAATCCCCAGCTTGGAATCAGCTTCTTCAATCTGTCTGGAACTATATCACAAACCACCGCCATACTAGCTTTAACAACACCAAGTGTCGAGTCAATCCTGCAATCTACAACAGTCAAAACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATGATAATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACGAAAAAACCAACCATCAAGACAACCAAAAAAGATCACAAACCTCAAACCACAAAACCCAAGGAAGCACCCACCACCAAGCCCACAGACAAGCCAACCATCAACACCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	BE1343s101  ACCTGACCCAGAATCCCCAGCTTGGAATCAGCTTCTTCAATCTGTCTGGAACTATATCACAAACCACCGCCATACTAGCTTTAACAACACCAAGTGTCGAGTCAATCCTGCAATCTACAACAGTCAAAACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATGATAATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACGAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCCAAGGAAGCACCCACCACCAAGCCCACAGACAAGCCAACCATCAACACCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	BE1836s101  ACCTGACCCAGAATCCCCAGCTTGGAATCAGCTTCTTCAATCTGTCTAGAACTATATCACAAACCACCGCCATACTAGCTTTAACAACACCAAGTGTCGAGTCAATCCTGCAATCTACAACAGTCAAAACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATGATAATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACGAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCTAAGGAAGCACCCACCACCAAGCCCACAGACAAGCCAACCATCAACACCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	BE1717s101  ACCTGACCCAGAATCCCCAGCTTGGAATCAGCTTCTTCAATCTGTCTAGAACTATATCACAAACCACCGCCATACTAGCTTTAACAACACCAAGTGTCGAGTCAATCCTGCAATCTACAACAGTCAAAACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATGATAATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACGAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCCAAGGAAGCACCCACCACCAAGCCCACAGACAAGCCAACCATCAACACCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	BE112s101   ACCTGACCCAGAATCCCCAGCTTGGAATCAGCTTCTTCAATCTGTCTGGAACTATATCACAAACCACCGCCACACTAGCTTTAACAACACCAAGTGTCGAGTCAATCCTGCAATCTACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCAAAAACAAACCACCAAACAAACCCAATGATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACGAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGCACCCACCACCAAGCCCACAGATAAGCCAACCATCAACATCACCAAACCAAACATCAGAACCACACTGCTCACC [...]
+	BE1150s100  ACCTGACCCAGAATCCCCAGCTTGGAATCAGCTTCTTCAATCTGTCTGGAACTATATCACAAACCACCGCCATACTAGCTTTAACAACACCAAGTGTCGAGTCAATCCTGCAATCTACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATGATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACGAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGCACCTACCACCAAGCCCACAGATAAGCCAACCATCAACATCACCAAACCAAACATCAGAACTACACTGCTTACC [...]
+	BE797s100   ACCTGACCCAGAATCCCCAGCTTGGAATCAGCTTCTTCAATCTGTCTGGAACTATATCACAAACCACCGCCATACTAGCTTTAACAACACCAAGTGTCGAGTCAATCCTGCAATCTACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATGATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACGAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGCACCTACCACCAAGCCCACAGATAAGCCAACCATCAACATCACCAAACCAAACATCAGAACTACACTGCTTACC [...]
+	BE944s100   ACCTGACCCAGAATCCCCAGCTTGGAATCAGCTTCTTCAATCTGTCTGGAACTATATCACAAACCACCGCCATACTAGCTTTAACAACACCAAGTGTCGAGTCAATCCTGCAATCTACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATGATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACGAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGCACCTACCACCAAGCCCACAGATAAGCCAACCATCAACATCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	BE14536s98  ACCTGACCCAGAATCCCCAGCTTGGAATCAGCTTCTTCAATCTGTCTGGAACTATATCACAAGCTACCGCCATACTAGCTTTAACAACACCAAGTGTCGAGTCAATCCTGCAATCTACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATGATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACGAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAATGGAAGCACCTACCACCAAGCCCACAGAAAAGCCAACCATCAACATCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	BIR6190s89  ACTTGACCCAAAATCCCCAGCTTGGAATCAGCTTCTTCAATCTGTCTGGAACTACATCACAAACCACCGCCATACTAGCTTTAACAACACCAAGTGTCGAGTCAATCCTGCAATCTACAACAGTCAAGACCAAAAACACAACAACTACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCACAAACCTCAAACCACAAAACCAAAGGAAGCACCCACCACCAAGCCCACAGAAAAGCCAACCATCAACATCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	MON1s90     ACCTGACCCAGAATCCCCAGCTTGGAATCAGCTTCTTCAATCTGTCTGGAACTACATCACAAACCACCGCCATACTAGCTTTAACAACACCAAGTGTCGAATCAATCCTGCAATCTACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGCACTTACCACCAAGCCCACAGAAAAGCCAACCATCAACATCACTAAACCAAACATCAGAACTACACTGCTCACC [...]
+	WV12342s84  ACCTGACCCAGAATCCCCAGCTTGGAATCAGCTTCTTCAATCTGTCTGAAACTACATCACAAACCACCACCATACTAGCTTCAACAACACCAAGTGTCGAGTCAACCCTGCAATCCACAACAGTCAAGACCAAAAACACAACAACAACCCAAACACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATAATGATTTCCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGCACCTACCACCAAGCCCACAGAAAAGCCAACCATCAACATCACCAAACCAAACATTAGAACTACACTGCTCACC [...]
+	BE2584s85   ACCTGACCCAGAATCCCCAGCTTGGAATCAGCTTCTTCAATCTGTCTGAAACTACATCACAAACCACCACCATACTAGCTTCAACAACACCAAGTGTCGAGTCAACCCTGCAATCCACAACAGTCAAGACCAAAAACACAACAACAACCCAAACACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGCACCTACCATCAAGCTCACAGAAAAGCCAACCATCAACATCACCAAACCAAACATCAGAACTACACTGCACACC [...]
+	BE933s88    ACCTGACCCAGAATCCCCAGCTTGGAATCAGCTTCTTCAATCTGTCTGAAACTACACCACAAATTACCACCATACTAGCTTCCACAACACCAAGTGTCGAGTCAACCCTGCAATCCACAACAGTCAAGACCAAAAACACAACAACAACCCAAACACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACAACAAAACCAAAGGAAGCACCTACCACCAAGCCCACAGAAAAGCCAACCATCAACATCACCAAACCAAACATCAGAACTACACCGCTCACC [...]
+	WV5222s81   ACCTGACCCAGAATCCCCAGCTTGGAATCAGCTTCTTCAATCTGTCTGAAACTACATCACAAACCACCACCATACTAGCTTCAACAACACCAAGTGTCGAGTCAACCCTGCAATCCACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGTAGCATATGCAGCAACAATCCAACCTGCTGGGCCATCTGCAAAAGAATACCAAGCAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGCACCTACCACCAAGCCCACAGAAAAGCCAACCATCAACACCACCAAACCAAACATCAGAACTACACTGCTCACC [...]
+	BE156s84    ACCTGACTCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCTGAAACTACATCACAAACCACCACCATACTAGCTTCAACAACACCAAGTGTCGAGTCAACCCTGCAATCCACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAACCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCTTGCAGCATATGCAGCAATAATCCAACCTGCTGGGCTATCTGTAAAAGAATACCAAACAAAAAACCTGGGAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGCACCTACCACCAAGCCTACAGAAAAGCCAACCATCAACACCACCAAAACAAACATCAGAACTACACTGCTCACC [...]
+	S2s76       ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCTGAAACTACATCACAAACCACCACCATACTAGCTTCAACAACACCAAGTGTCAAGTCAACCCTGCAATCCACAACAGTCAAGACCAAAAACACAACAACAACCAAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCTTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCTATCTGTAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGTACCTACCACCAAGCCCACAGAAAAGCCAACCATCAACACCACCAAAACAAACATCAGAACTACACTGCTCACC [...]
+	BE11030s100 ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCCGAAACTACATCACAACCCATCACTATACTAGCTTCAACAACACCAAGTGCTGAGTTAACCCCACAATCCACAACAGTCAAGATCAAAAACACAACAACAACCCAAATGCAACCTAGCAAACCCACCACAAAACAACGCCAAAACAAACCACAAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAATTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCCATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCCCAAACCTCAAACTACAAAACCAAAGGAAGTACTCACCACCAAGCCCACAGAAAAGCCAACCATCAACACCACCAAAACAAACATCAAACCTACACTGCTCACC [...]
+	BE11129s100 ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTATCCGAAACTACATCACAACCCATCACTATACTAGCTTCAACAACACCAAGTGCTGAGTTAACCCCACAATCCACAACAGTCAAGATCAAAAACACAACAACAACCCAAATGCAACCTAGCAAACCCACCACAAAACAACGCCAAAACAAACCACAAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAATTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCCATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCCCAAACCTCAAACCACAAAACCAAAGGAAGTACTCACCACCAAGCCCACAGAAAAGCCAACCATCAACACCACCAAAACAAACATCAAAACTACACTGCTCACC [...]
+	BE11091s100 ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCCGAAACTACATCACAACCCATCACTATACTAGCTCCAACAACACCAAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGACCAAAAACACAACAACAACCCAAATGCAACCCAGCAAACCCACCACAAAACAACGCCAAAACAAACCACAAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAATTTTGTACCCTGCAGCATATGCAGTAACAATCCAACCTGCTGGGCCATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCCCAAACCTCAAACCACAAAACCAAAGGAAGTACTCACCACCAAGCCCACAGAAAAGCCAACCATCAACACCACCAAAACAAACATCAAAACTACACTGCTCACC [...]
+	BE519s101   ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCCGAAACTACATCACAACCCATCACCATACTAGCTTCAACAACACCAAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGATCAAAAACACAACAACAACCCAAATGCAACCTAGCAAACCCACCACAAAACAACGCCAAAACAAACCACAAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAATTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCCATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAATCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCCCAAACCTCAAACCACAAAACCAAAGGAAGTACTCACCACCAAGCCCACAGAAAAGCCAACCATCAACACCACCAAAACAAACATCAAAACTACACTGCTCACC [...]
+	BE13425s99  ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCCGAAACTACATCACAACCCATCACCATACTAGCTTCAACAACACCAAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGATCAAAAACACAACAACAACCCAAATGCAACCTAGCAAACCCACCACAAAACAACGCCAAAACAAACCACAAAACAAACCCAACAATGATTTTCACTTTGAAGTGTTCAATTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCCATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCCCAAACCTCAAACCACAAAACCAAAGGAAGTACTCACCACCAAGCCCACAGAAAAGCCAACCATCAACACCACCAAAACAAACATCAAAACTACACTGCTCACC [...]
+	BE004s102   ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCCGAAACTACATCACAACCCATCACCATACTGGCTTCAACAACACCAAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGATCAAAAACACAACAACAACCCAAATGCAACCTAGCAAACCCACCACAAAACAACGCCAAAACAAACCACAAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAATTTTGTACCCTGCAGCATATGCAGTAACAATCCAACCTGCTGGGCCATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCCCAAACCTCAAACCACAAAACCAAAGGAAGTACTCACCACCAAGCCCACAGAAAAGCCAACCATCAACACCACCAAAACAAACATCAAAACTACACTGCTCACC [...]
+	SE12s97     ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCCGAAACTACATCACAACCCACCACCATACTAGCTTCGACAACACCAAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGATCAAAAACACAACAACAACCCAAATACAACCTAGCAAACCCACCACAAAACAACGCCAAAACAAACCACAAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCCATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCCCAAACCTCAAACCACAAAACCAAAGGAAGTACTCACCACCAAGCCCACAGAAAAGCCAACCATCAACACCACCAAAACAAACATCAGAACTACACTGCTCACC [...]
+	BE14808s98  ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCCGAAACTACATCACAACCCACCACCATACTAGCTTCAACAACACCAAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGATCAAAAACACAACAACAACCCAAATACAACCTAGCAAACCCACCACAAAACAACGCCAAAACAAACCACAAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCCATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCCCAAACCTCAAACCACAAAACCAAAGGAAGTACTCACCACCAAGCCCACAGAAAAGCCAACCATCAACACCACCAAAACAAACATCAGAACTACACTGCTCACC [...]
+	SE02s98     ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCCGAAACTACATCACAACCCACCACCATACCAGCTTCAACAACACCAAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGATCAAAAACACAACAACAACCCAAATACAACCTAGCAAACCCACCACAAAACAACGCCAAAACAAACCACAAAACAAACCCAACAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCCATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCCCAAACCTCAAACCACAAAACCAAAGGAAGTACTCACCACCAAGCCCACAGAAAAGCCAACCATCAACACCACCAAAACAAACATCAGAACTACACTGCTCACC [...]
+	BE11s101    ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCAAATCTGTCCGAAACTACACCACAACCCCCCACCATATTAGCCTCAACAATACCAAGTGCTGAGTTAACCCCACAATCCACAACAGTCAAGATCAAAAACACAACAACAACCCAAATACAACCTAGCAAACCCACCACAAAACAACACCAAAACAAACCACAAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAATTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCCATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCCCAAACCTCAAACCACAAAACCAAAGGAAGTAATCACCACCAAGCCCACAAAAAAGCCAACCATCAACACCACCAAAACAAACATCAGAACTACACTGCTCACC [...]
+	BE13393s99  ACCTCACCCAGAATCCTCAGCCCGGCATCAGCTTCTCCAATCTGTCCGAAACTACATCACAACCCACCACCATACTAGCTTCAACAACACCAAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGATCAAAAACACAACAACAACCCAAATACAACCTAGCAAACCCACCACAAAACAACGCCAAAACAAACCACAAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAATTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCCATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCCCAAACCTCAAACCACAAAACCAAAGGAAGTACTCACCACCAAGCCCACAGAAAAGCCAACCATCAACACCACCAAAACAAGCATCAGAACTACACTGCTCACC [...]
+	BE14898s98  ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCCGAAACTACATCACAACCCACCACCATACTAGTTTCAACAACACCAAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGATCAAAAACACAACAACAACCCAAATACAACCTAGCAAACCCACCACAAAACAACGCCAAAACAAACCACAAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCCATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCCCAAACCTCAAACCACAAAACCAAAGGAAGCACTCACCACCAAGCCCACAGAAAAGCCAACCATCAACACCACCAAAACAAACATCAGAACTACACTGCTCACC [...]
+	BE332s102   ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCCGAAACTACATCAAAACCCACCACCATACTAGCTTCAACAACACCAAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCTAGCAAACCCACCACAAAACAACGTCAAAACAAACCACAAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCCATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACTACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCCCAAACCTCAAACCACAAAACCAAGGGAAGTACTCACCACCAAGCCCACAGAAAAGACAACCATCAACACCACCAAAACAAACATCAGAACTACACTGCTCACT [...]
+	BE12028s100 ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCCGAAACTACATCGCAACCCACCACCATACTGGCTTCAACAACACCAAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGATCAAAAACACAACAACAACCCAAATACAACCTAGCAAACCCACCACAAAACAACGCCAAAACAAACCACAAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAATTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCCATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCCCAAACCTCAAACCACAAAACCAAAGGAAGCACTCACTACCAAGCTCACAGAAAAGCCAACCATCAACACCACCAAAACAAACATCAGAACTACACTGCTCACC [...]
+	BE14461s98  ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCCGAAACTACATCACAATCCACCACCATACTAGCTTCAACAACACCAAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCTAGCAAGTCCACCACAAAACAACACCAAAAAAAACCACAAAACAAACCCAATAATGATTTTCACTTTGAGGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCCATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCCCAAACCTCAAACCACAAAACCAAAGGAAGTACTCACCACCAAGCCCACAGAAAAGCCAACCATCTACACCACCAAAACAAACATCAGAACTACACTGCTCACC [...]
+	MON2s88     ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCCGAAACTACATCACAACCCACCACCATACTAGCTTCAACAACACCAAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCTAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACAAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCATAAAACCAAAGGAAGTACTTACCACCAAGCCCACAGAAAAGCCAACCATCAACACCACCAAAACAAACATCAGAACTACACTGCTCACC [...]
+	NYCH57s94   ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCCGAAACTACATCACAACCCACCACCATACTAGCTTCAACAACACCAAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCTAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACAAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAGAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGTACTTACCACCAAGTCCACAGAAAAGCCAACCATCAACACCACCAAAACAAACATCAGAACTACACTGCTCACC [...]
+	BE11465s94  ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCCGAAACCACATCACAACCCACCACCACACTAGCTTCAACAACACCAAATGCTGAGTCAACCCCACAATCCACAACAGTCAAGACCAAAAACACAACAACAACCCAAACACAAACTAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACAAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAAACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGTACTTACCACCAAGCCCACAGAAAAGCCAACCATCAACACCACCAAAACAAACATCAGAACTACACTGCTCACC [...]
+	MON1s89     ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCCGGAACTACATCACAACCCACCACCATACTAGCTTCAACAACACCAAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCTAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACAAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAACCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGTACTTACCACCAAGCCCACAGAAAAGCCAACCATCAACACCACCAAAACAAACATCAGAACTACACTGCTCACC [...]
+	BE15752s97  ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCCGAAACTACATCACAACCCACCACCATACTAGCTTCAACAACACCAAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGACCAAAAATACAACAACAGCCCAAATACAACCTAGCAAGCCCACCACAAAACAACGCCAAAATAAACCACAAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCTATCTGCAAAAGAATACCCAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGTACTTACCACCAAGCCCACAGAAAAGCCAACCATCAGCACCACCAAAACAAACATCAGAACTACACTGCTCACC [...]
+	SE05s96     ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCCGAAACTACATCACAACCCACCACCATACTAGCTTCAACAACACCAAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGACCAAAAATACAACAACAGCCCAAATACAACCTAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACAAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCAGGGCTATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAATCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGTACTTACCACCAAGCCCACAGAAAAGCCAACCATCAGCACCACCAAAACAAGCATCAGAACTACACTGCTCACC [...]
+	BE13551s95  ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCCGAAACTACATCACAACCCACCACCATACTAGCTTCAACAACACCAAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGACCAAAAATACAACAACAACCCGAATACAACCTAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACAAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGTACTTACCACCAAGCCCACAGAAAAGCCAACCATCAGCACCACCAAAACAAACATCAGAACTACACTGCTCACC [...]
+	BE12895s95  ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCCGAAACTACATCACAACCCACCACCATACTAGCTTCAACAACACCAAGTGCCGAGTCAACCCCACAATCCACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCTAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACAAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGTACTTACCACCAAGCTCACAGAAAAGCCAACCATCAACACCACCAAAACAAACATCAGAACTACACTGCTTACC [...]
+	SE10s91     ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCACCAATCTGTCCGAAACTACATCACAACCCACCACCATACTAGCTTCAACAACACCAAGTGCCGAGTCAACCCCACAATCCACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCTAGCAAGTCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGTACTTACCACCAAGCCCACAGAAAAGCCAACCATCAACACCACCAAAACAAACATCAGAGCTACACTGCTCACC [...]
+	SE11s92     ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCCGAAACTACATCACAACCCACCACCATACTAGCTTCAACAACACCAAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAATCTAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCTATCTGCAAAAGAATACCCAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGTACTTACCACCAAACCCACAGAAAAGCCAACCATCAACACCACCAAAACGAACATCAGAGCTACGCTGCTCACC [...]
+	SE12s94     ACCTCACCCAGAATCACCAGCTTGGAATCAGCTTATTCAATCTGTCCAAAACTACGTCACAACCCGCCACCATACTAGCTTCAACAACACCAAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGAACAAAAACACAACAACAACCCAAATACAACCTAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCGACCACCAGGACAACCAAAAAAGATCTCACACCTCAAACCACAAAACCAAAGGAAGTACCCACCACCAAGCCCACAGAAAAGCCAACCATCAACACCACCAAAACAAACATCAGAACCACACTGCTCACC [...]
+	BE1591s90   ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCCGAAACTACATCACAACCCACCACCATACTAGCTTCAACAACACCAAGTGCTGAGTCAACCCCACTATCCACAACAGTTAAGACCAAAAACACAACAACAACCCAAATACAACCTAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCCCAAACCTCAAACCACAAAACAAAAGGAAGTACTTACCACCAAGCCCACAGAAAAGCCAACCATCAACACCACCAAAACAAACATCAGAACTACACTGCTCACC [...]
+	BE512s95    ACCACACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCCGAAACTACATCACAACCCACCACCATACTAGCTTCAACAACACCAAGTGCTGAGTCAACCCCACTATCCACAACAGTTAAGACCAAAAACACAACAACAACCCAAATACAACCTAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTTAAACCTCAAACCACAAAACAAAAGGAAGTACTTACCACCAAGCCCACAGAAAAGCCAACCATCAACACCACCAAGACAAGCATCAGAACTACACTGCTCACC [...]
+	SE01s95     ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCCGAAACTACATTACAACCCACCACCATACTAGCTTCAACAACACCAAGTGCTGAGTCAACCCCACCATCCACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCTAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACTTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACAAAAGGAAGTACTTACCACCAAGCCCACAGAAAAGCCAACCATCAACACCACCAAAACAAACATCAGAACTACACTGCTCACC [...]
+	BE4147s87   ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCCGAAACTACATCACAACCTACCACCATACTAGCTTCAACAACACTAAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGACCAAAAACACAACAACAACTCAAATACAACCTAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAATAATCCAACCTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATATCAAACCTCAAACCACAAAACCAAAGGAAATACCCACCACCAAGCCCACAGAAAAGCCAACCATCAACACCACCAAAACAAACATCAGAACTACACTGCTCACC [...]
+	BE071s88    ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCCGAAACTACATCACAACCTACCACCATACTAGCTTCAACAACACTAAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGACCAAAAACACAACAACAACTCAAATACAACCTAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAATAATCCAACCTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATATCAAACCTCAAACCACAAAACCAAAGGAAATACCCACCACCAAGCCCACAGAAAAGCCAACCATCAACACCACCAAAACAAACATCAGAACTACACTGCTTACC [...]
+	BE538s88    ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCCGAAACTACATCACAACCTACCACCATACTAGCTTCAACAACACTAAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGACCAAAAACACAACAACAACTCAAATACAACCTAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAATAATCCAACCTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATATCAAACCTCAAACCACAAAACCAAAGGAAATACCCACCACCAAGCCCACAGAAAAGCCAACCATCAACACCACCAAAACAAACATCAGAACTACACTGCTCACC [...]
+	BE204s84    ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCCGAAACCACATCACAACCCACCACCACACCAGCTCCAACAACACCAAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGACCAAAAACACAACAACAACTCAAACACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAACAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGTACCTACCACCAAGCCCACAGAAAAGCCAACCATCAACACCACCAAAACAAACATCAGAACTACACTGCTCACC [...]
+	BE183s85    ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCCGAAACCACATCACAACCCACCACCACACCAGCTCCAACAACACCAAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAACAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGTACTTACCACCAAGCCCACAGAAAAGCCAACCATCAACACCACCAAAACAAACATCAGAACTACACTGCTCACC [...]
+	BE076s86    ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCCGAAACCACATCACAACCCACCACCACACCAGCTCCAACAACACCAAGTGCTGAGTCAACCCCACAATCCACAACAGTCGAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCTAACAAACCCAACAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACTATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGCACTTACCACCAAGCCCACAGAAAAGCCAACCATCAACACCACCAAAACAAACATCAGAACTACACTGCTCACC [...]
+	BE2466s85   ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCCGAAACCACATCACAACCCACCACCACACCAGCTCCAACAACACCAAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCTAACAAACCCAACAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACTATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGCACTTACCACCAAGCCCACAGAAAAGCCAACCATCAACACCACCAAAACAAACATCAGAACTACACTGCTCACC [...]
+	BE4763s88   ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCCGAAACCACATCACAACCCACCACCACACCAGCTCCAACAACACCAAGTGCTGAGTCAACCCCACAATCCACAACAATCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCTAACAAACCCAACAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGTACTTACCACCAAGCCCACAGAAAAGCCAACCATCAACACCACCAAAACAAGCATCAGAACTACACTGCTCACC [...]
+	BE76s86     ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCCGAAACCACATCACAACCCACCACCACACCAGCTCTAACAACACCAAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAACAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGTACTTACCACCAAGCCCACAGAAAATCCAACCATCAACACCACCAAAACAAACATCAGAACTACACTGCTCACC [...]
+	BE339s86    ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCCGAAACCACATCACAACCCACCACCACACCAGCTCTAACAACACCAAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAACAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGTACTTACCACCAAGCCCACAGAAAATCCAATCATCAACACCACCAAAACAAACATCAGAACTACACTGCTCACC [...]
+	BE3252s86   ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCCGAAACCACATCACAACCCACCACCACACCAGCTCTAACAACACCAAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAGCAACGCCAAAACAAACCACCAAACAAACCCAACAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAACCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGTACTTACCACCAAGCCCACAGAAAATCCAACCATCAACACCACCAAAACAAACATCAGAACTACACTGCTCACC [...]
+	BE410s86    ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCCGAAACCACATCACAACCCACCACCACACCAGCTCTAACAACACCAAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAGCAACGCCAAAACAAACCACCAAACAAACCCAACAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGTACTTACCACCAAGCCCACAGAAAATCCAACCATCAACACCACCAAAACAAACATCAGAACTACACTGCTCACC [...]
+	WV23836s88  ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTATCCGAAACCACATCACAACCCACCACCACACCAGCTCTAACAACACCAAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAACAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGTACTTACCACCAAGCCCACAGAAAAGCCAACCATCAACACCACCAAAACAAACATCAGAACTACACTGCTCACC [...]
+	BE13462s99  ACTTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCTGAAACCACATCACAACCCACCACCACACCAGCTCTAGCAACACCAAGTGCTGAGTCAACCCCACAATCCACAACAATCAAGACCAAAAACACAACAACTACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAATAAACCCAACAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCTTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACTATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGTACTTACCACCAAGCCCACAGAAAAGCCAACTGTCAACACCACCAGAACAAACATCGGAACTACACTGCTCACC [...]
+	BE11584s101 ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCTGAAACCACAACACAACCCACCACCACACCAGCTCTAGCAACACCAAGTGCTGAGTCAACCCCACAATCCACAACAATCAAGACCAAAAATACAACAACTACCCAGATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAATAAACCCAACAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACTATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGTACTTACCACCAAGCCCGCAGAAAAGCCAACTATCAACACCACCAGAACAAACATCGGAACTACACTGCTCACC [...]
+	BE13412s99  ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTACTCCAATCTGTCTGAAACCACATCACAACCCACCACCACACCAGCTCTAGCAACACCAAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAATAAACCCAACAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCTATCTGCAAAAGAATACCCAACAAAAAACCCGGAAAGAAAACCACCACCAAGCCCACAAAGAAACCAACTATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGTATTTACCACCAAGCCCACAGAAAAGCCAACTATCAACACCACCAGAACAAACATCGGAACTACACAGCTCACC [...]
+	SE12s95     ACCTCATCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCTGAAACCACATCACAACCCACCACCACACCAGCTCTAGCAACACCTAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAATAAACCCAACAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACTATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGTACTTACCACCAAGCCCACAGAAAAGCCAACTATTAACACCACCAGAACAAACATCGGAACTACACTGCTCACC [...]
+	BE12243s96  ACCTCATCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCTGAAACCATATCACAACCCACCACCACACCAGCTCTAGCAACACCTAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAATAAACCCAACAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACTATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGTACTTACCACCAAGCCCACAGAAAAGCCAACTATTAACACCACCAGAACAAACATCGGAACTACACTGCTCACC [...]
+	SE08s96     ACCTCATCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCTGAAACCACATCACAACCCACCACCACACCAGCTCTAGCAACACCTAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGCCCAAAAAAACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCTAAACAAACCACCAAATGAACCCAACAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACTATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGTACTTACCACCAAGCCCACAGAAAAGCCAACTATCAACACCACCAGAACAAACATCGGAACTACACTGCTCACC [...]
+	SE09s92     ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCCGAAACCACATCACAACCCACCACCACACCAGCTCTAACAACACCAAGTGCTGAGTCAACCCCACAATCCACAACAGTCGAGACCAAAAACACAACAACAACTCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAACAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACTAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAATTAAAGGAAGTACTTACCACCAAGCCCACAGAAAAGCCAACCATCAACACCACCAGAACAAACATCAGAACTACACTGCTCACC [...]
+	SE12s92     ACCTCACCCAGAACCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCCGAAACCACATCACAACCCACCACCACACCAGCTCTTACAACACCAAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGACCAAAAACACAACAACAACTCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAACAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCAATAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACTAAAGGAAGTACTTACCACCAAGCCCACAGAAAAGCCAACCATCAACACCACCAGAACAAACATCAGAACTACACTGCTCACC [...]
+	BE6274s91   ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCTAATCTGTCCGAAACCACATCACAACCTACCACCACACCAGCTCTAACAACACCAAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAAACCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAACAATGATTTTCACTTTGAGGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGTACTTACCACCAAGCCCACAGAAAAGCCAACCATCAACACCACCAAAACAAACATCAAAACTACACTGCTCACC [...]
+	MADs91      ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCTAATCTGTCCGAAACCACATCACAACCTACCACCACACCAGCTCTAACAACACCAAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAAACCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAACAATGATTTTCACTTTGAGGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGTACTTACCACCAAGCCCACAGAAAAGCCAACCATCAACACCACCAAAACAAACATCAAAACTACACTGCTCACC [...]
+	BE1440s92   ACATCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCTAATCTGTCCGAAACCACATCACAACCTACCACCACACCAGCTCTAACAACACCAAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAAACCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAACAATGATTTTCACTTTGAGGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACTATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGTACTTACCACCAAGCCCACAGAAAAGCCAACCATCAACACCACCAAAACAAACATCAAAACTACACTGCTCACC [...]
+	BE6460s91   ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCTAATCTGTCCGAAACCACATCACAACCTACCACCACACCAGCTCTAACAACACCAAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAAACCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAACAATGATTTTCACTTTGAGGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGTACTTACCACCAAGCCCACAGAAAAGCCAACCATCAACACCACCAAAACAAACATCAAAACTACACTGCTCACC [...]
+	BE305s89    ACCTCACCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCCGAAACCACATCACAACCCACCACCACACCAGCTCTAACAACACCAAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAAACCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAACAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGTACTTACCACCAAGCCCACAGAAAAGCCAACCATCAACACCACCAAAACAAACATCAAAACTACACTGCTCACC [...]
+	BE3785s87   ACCTCTCCCAGAATCCCCAGCTTGGAATCAGCTTCTCCAATCTGTCCGAAACCACATCACAACCCACCACCACACCAGCTCTAACAACACCAAGTGCTGAGTCAACCCCACAATCCACAACAGTCAAGACCAAAAACACAACAACAACCCAAATACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAACAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCTGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAAAACCAAAGGAAGTACTTACCACCAAGCCCACAGAAAAGCCAACCATCAACACCACCAAAACAAACATCAGAACTACACTGCTCACC [...]
+	BE307s87    ACCTCACCCAGAATCCCCAGTTTGGAATCAGCTTCTCCAATCTGTCTGAAACTACATCACAACCCACCACCATACTAGCTTCAACAACACCAAGTGTCGAGTCAACCCTACAGTCTACAACAGTCAAGACCAAAAATACAACAACAACCCAAATACAACCTAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCAGGAAAGAAAACCACTACCAAACCCACTAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAACACCAAAGGAAGTACCCACCACCAATCCAACAGAAAAGCCAACCATCAACACCACCAAAACAAACATCAGAACTACACTGCTCACC [...]
+	BE119s87    ACCTCACCCAGAATCCCCAGTTTGGAATCAGCTTCTCCAATCTGTCTGAAACTACATCACAACCCACCACCATACTAGCTTCAACAACACCAAGTGTCGAGTCAACCCTACAGTCTACAACAGTCAAGACCAAAAATACAACAACAACCCAAATACAACCTAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCAGGAAAGAAAACCACTACCAAGCCCACTAAAAAACCAACCATCAAGACAACCAAAAAAGATCTCAAACCTCAAACCACAACACCAAAGGAAGTACCCACCACCAATCCAACAGAAAAGCCAACCATCAACACCACCAAAACAAACATCAGAACTACACTGCTCACC [...]
+	BE138s90    ATCTCACCCAGAATCCTCAGCTCGGAATCAGTCCCTCCAATCCGTCTGAAATTACATCACTAATTACCACCATACTAGGTTCAACAACACCAGGAGTCAAGTCAACCTTGCAATCCACAACAGTCGGGACCAAGAATACAACAACAACTCAAGCACAACCCAACAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAGCAAACCCAACAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATTTGCAGCAACAATCCAACCTGCTGGGCCATCTGCAAAAGAATACCCAACAAAAAACCAGGCAAGAGAACCACCACCAAGCCCACAAAAAAACCAACCCCAAAGACAACCAAAAAAGGTCCCAAGCCTCAAACCACTAAATCAAAGAAGGCACCCACCACCAAGCCCACAGAAGAGCCAACTATCAATACCACCAAAACAAACATCATAACTACACTACTCACC [...]
+	BE191s90    ATCTCACCCAGAATCCTCAGCTTGGAATCAGTCCCTCCAATCCGTCTGAAATTACATCACTAATTACCACCATACTAGGTTCAACAACACCAGGAGTCAAGTCAACCTTGCAATCCACAACAGTCGGGACCAAGAATACAACAACAACTCAAGCACAACCCAACAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAGCAAACCCAACAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATTTGCAGCAACAATCCAACCTGCTGGGCCATCTGCAAAAGAATACCCAACAAAAAACCAGGCAAGAGAACCACCACCAAGCCCACAAAAAAACCAACCCCAAAGACAACCAAAAAAGGTCCCAAGCCTCAAACCACTAAATCAAAGAAGGCACCCACCACCAAGCCCACAGAAGAGCCAACTATCAATACCACCAAAACAAACATCATAACTACACTACTCACC [...]
+	BE369s90    ATCTCACCCAGAATCCTCAGCTTGGAATCAGTCCCTCCAATCCGTCTGAAATTACATCACTAATTACCACCATACTAGATTCAACAACACCAGGAGTCAAGTCAACCTTGCAATCCACAACAGTCGGGACCAAGAATACAACAACAACTCAAGCACAACCCAACAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAGCAAACCCAACAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATTTGCAGCAACAATCCAACCTGCTGGGCCATCTGCAAAAGAATACCCAACAAAAAACCAGGCAAGAGAACCACCACCAAGCCCACAAAAAAACCAACCCCAAAGACAACCAAAAAAGGTCCCAAGCCTCAAACCACTAAATCAAAGAAGGCACCCACCACCAAGCCCACAGAAGAGCCAACTATCAATACCACCAAAACAAACATCATAACTACACTACTCACC [...]
+	MON9s91     ATCTAACCCAGAATCCTCAGCTTGGAATTAGTCCCTCCAATCCGTCTGAAATTACATCACTAATTACCACCACACTAGATTCAACAACACCAGGAGTCAAGTCAACCTTGCAATCCACAACAGTCGGGACCAAGAATACAACAACAACTCAAGCACAACCCAACAAGCCCACCACAAAACAACGCCAAAACAAATCACCAAGCAAACCCAACAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATTTGCAGCAACAATCCAACCTGCTGGGCCATCTGCAAAAGAATACCCAACAAAAAACCAGGCAAGAGAACCACCACCAAGCCCACAAAAAAACCAACCCCAAAGACAACCAAAAAAGGTCCCAAGCCTCAAACCACTAAATCAAAGAAGGCACTCACCACCAAGCCCACAGAAGAGCCAACTATCAATACCACCAAAACAAACATCATAACTACACTACTCACC [...]
+	BIR642s89   ATCTCACCCAGAATCCTCAGCTTGGAATCAGTCCCTCCAATCCGTCTGACATTACATCACTAATCACCACCATACTAGATTCAACAACACCAGGAGTCAAGTCAACCCTGCAATCCACAACAGTCGGGACCAAGAATACAACAACAACTCAAGCACAACCCAACAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAGCAAACCCAACAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCCATCTGCAAAAGAATACCCAACAAAAAACCAGGCAAGAGAACCACCACCAAGCCCACAAAAAAACCAACCCCAAAGACAACCAAAAAAGGTCCCAAGCCTCAAACCACTAAATCAAAGGAGGCACCCACCACCAAGCCCACAGAAGAGCCAACTATCAATACCACCAAAACAAACATCATAACTACACTACTCACC [...]
+	WV19983s87  ATCTCACCCAGAATCCTCAGCTTGGAATCAGTCCCTCCAATCCGTCTGAAATTACATCACTAATTACCACCATACTAGATTCAACAACACCAGGAGTCAAGTCAACCCTGCAATCCACAACAGTCGGGACCAAGAATACAACAACAACTCAAGCACAACCCAACAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAGCAAACCCAACAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCCATCTGCAAAAGAATACCCAACAAAAAACCAGGCAAGAGAACCACCACCAAGCCCACAAAAAAACCAACCCCAAAGACAACCAAAAAAGGTCCCAAGCCTCAAACCACTAAATCAAAGGAGGTACCCACCACCAAGCCCACAGAAGAGCCAACTATCAATACCACCAAAACAAACATCATAACTACACTACTCACC [...]
+	MON5s91     ATCTTACCCAGAATCCTCAACTTGGAATCAGTCCCTCTAATCCGTCTGAAATTACATCACTAATTACCACCATACTAGATTCAACAACACCAGGAGTCAAGTCAACCCTGCAATCCACAACAGTCGGGACCAAGAATACAACAACAACTCAAGCACAACCCAACAAGCCCATCACAAAACAACGCCAAAACAAACCACCAAGCAAACCCAACAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCCATCTGCAAAAGAATACCCAACAAAAAACCAGGTAAGAGAACCACCACCAAGCCCACAAAAAAACCAACCTTAAAGACAACCAAAAAAGGTCCCAAACCTCAAACCACTAAATCAAAGGAGGTACCCACCACCAAGCCCACAGAAGAGCCAACTATCAACACCACCAAAACAAACATCATAACTACACTACTCACC [...]
+	MON51s90    ATCTTACCCAGAATCCTCAACTTGGAATCAGTCCCTCTAATCCGTCTGAAATTACATCACTAATTACCACCATACTAGATTCAACAACACCAGGAGTCAAGTCAACCCTGCAATCCACAACAGTCGGGACCAAGAATACAACAACAACTCAAGCACAACCCAACAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAGCAAACCCAACAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCCATCTGCAAAAGAATACCCAACAAAAAACCAGGTAAGAGAACCACCACCAAGCCCACAAAAAAACCAACCTTAAAGACAACCAAAAAAGATCCCAAACCTCAAACCACTAAATCAAAGGAGGTACCCACCACCAAGCCCACAGAAGAGCCAACTATCAACACCACCAAAACAAACATCATAACTACACTACTCACC [...]
+	MON9s92     ATCTTACCCAGAATCCTCAGCTTGGAATCAGTCCCTCTAATCCGTCTGAAATTACATCACTAATTACCACCATACTAGATTCAACAACACCAGGAGTCAAGTCAACCCTGCAATCCACAACAGTCGGGACCAAGAATACAACAACAACTCAAGCACAACCCAACAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAGCAAACCCAACAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCCATATGCAAAAGAATACCCAACAAAAAACCAGGTAAGAGAACCACCACCAAGCCCACAAAAAAACCAACCTTAAAGACAACCAAAAAAGATCCCAAACCTCAAACCACCAAATCAAAGGAGGCACCCACCACCAAGCCCACAGAAGAGCCGACTATCAACACCACCAAAACAAACATCACAACCACACCACTCACC [...]
+	NYCH34s94   ATCTTACCCAGAATCCTCAGCTTGGAATCAGTCCCTCTAATCCGTCTGAAATTACATCACTAATTACCACCATACTAGATTCAACAACACCAGGAGTCAAGTCAACCCTGCAATCCACAACAGTTGGGACCAAGAATACAACAACAACTCAAGCACAACCCAACAAGCCCACCACAAAACAACGCCAAAACACCCCTCCAAGCAAACCCAACAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCCATATGCAAAAGAATACCCAACAAAAAACCAGGTAAGAGAACCACCACCAAGCCCACAAAAAAGCCAACCTTAAAGACAACCAAAAAAGATCCCAAACCTCAAACCACCAAATCAAAGGAGGCACCCACCACCAAGCCCACAGAAGAGCCGACTATCAACACCACCAAAACAGACATCACAACCACACCATTCACC [...]
+	BIR1734s89  ATCTCACCCAAAATCCTCAGCTTGGAATCAGTCCCTCTAATCCGTCTGAAATTACATCACTAATCACCACCATACTAGATCCAACAACACCAGGAGTCAAGTTAACCCTGCAATCCACCACAGTCAGGATCAAGAATACAACAACAACTCAAGCACAACCCAATAAGTCCACCACAAAACAACGCCAAAACAAACCACCAAGCAAACCCAACAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCCATCTGCAAAAGAATACCCAACAAAAAGCCAGGTAAGAGAACCACCACCAAGCCCACAAAGAAGCCAACCCTAAAGACAACCAAAAAAGATCCCAAACCTCAAACCACTAAATCAGAGGAGGTACCCACCACCAAGCTCACAGAAGAGCCAACTATCAACACCACCAAAACAAACATCATAACCACACCACTCACC [...]
+	WV2780s79   ATCTCACCCAGAATCCTCAGCTTGGAATCAGTCCCTCTAATCCGTCTGAAATTACATCACTAATTACCACCATACTAGATTCAACAACACCAGGAGTCAAGTCAACCCTGCAATCCACAACAGTCGGGACCAAGAATACAACAACAACTCAAGCACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAGCAAACCCAACAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCCATCTGCAAAAGAATACCCAACAAAAAACCAGGAAAGAGAACCACCACCAAGCCCACAAAAAAACCAACCTTAAAGACAACCAAAAAAGATCCCAAACCTCAAACCACTAAATCAAAGGAGGTACCCACCACCAAGCCCACAGAAGAGCCAACTATCAACACCACCAAAACAAACATCATAACTACACTACTCACC [...]
+	WV6973s82   ATCTCACCCAGAATCCTCAGCTTGGAATCAGTCCTTCTAAACCGTCTGAAATTACATCACAAATCACCACCATACTAGCTTCAACAACACCAGGAGTCAAGTCAACTCTGCAATCCACAACAGTCAGGACCAAGAATACAACAACAATTCAAGCACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAGCAAACCCAACAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCCATCTGCAAAAGAATACCCAACAAAAAACCAGGAAAGAAAACCACCACCAAGCCCACAAAAAAACCAACCCCAAAGACAACCAAAAAAGATCCCAAACCTCAAACCACCACATCAAAGGAGGTACCCACCACCAAGCCCACAGAAGAGCCAACTATCAACACCACCAAAACAAACATCATAACTACACTACTCACC [...]
+	AUSA2s61    ACCTCACCCAGAATCCTCAGCTTGGAATCAGTCCCTCTAATCCGTCTGAAATTACATCACAAATCACCACCATACTAGCTTCAACAACACCAGGAGTCAAGTCAACCCTGCAATCCACAACAGTCAAGACCAAAAACACAACAACAACTCAAACACAACCCAGCAAGCCCACCACAAAACAACGCCAAAACAAACCACCAAGCAAACCCAATAATGATTTTCACTTTGAAGTGTTCAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCAGGAAAGAAAACCACTACCAAGCCCACAAAAAAACCAACCCTCAAGACAACCAAAAAAGATCCCAAACCTCAAACCACTAAATCAAAGGAAGTACCCACCACCAAGCCCACAGAAGAGCCAACCATCAACACCACCAAAACAAACATCATAACTACACTACTCACC [...]
+	USALongs56  ACCTCACTCAGGATCCTCAGCTTGGAATCAGCTTCTCCAATCTGTCTGAAATTACATCACAAACCACCACCATACTAGCTTCAACAACACCAGGAGTCAAGTCAAACCTGCAACCCACAACAGTCAAGACTAAAAACACAACAACAACCCAAACACAACCCAGCAAGCCCACTACAAAACAACGCCAAAACAAACCACCAAACAAACCCAATAATGATTTTCACTTCGAAGTGTTTAACTTTGTACCCTGCAGCATATGCAGCAACAATCCAACCTGCTGGGCTATCTGCAAAAGAATACCAAACAAAAAACCAGGAAAGAAAACCACCACCAAGCCTACAAAAAAACCAACCTTCAAGACAACCAAAAAAGATCACAAACCTCAAACCACTAAACCAAAGGAAGTACCCACCACCAAGCCCACAGAAGAGCCAACCATCAACACCACCAAAACAAACATCATAACTACACTACTCACC [...]
+
+;
+End;
+
diff --git a/examples/nexus/Shankarappa.Patient9.nex b/examples/nexus/Shankarappa.Patient9.nex
new file mode 100644
index 0000000..46f18fc
--- /dev/null
+++ b/examples/nexus/Shankarappa.Patient9.nex
@@ -0,0 +1,259 @@
+#NEXUS
+
+Begin DATA;
+	Dimensions ntax=117 nchar=663;
+	Format datatype=NUCLEOTIDE gap=-;
+	Matrix
+	[            1         11        21        31        41        51        61        71        81        91        101       111       121       131       141       151       161       171       181       191       201       211       221       231       241       251       261       271       281       291       301       311       321       331       341       351       361       371       381       391       401       411       421       431       441       451       461       471      [...]
+	[            |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |         |        [...]
+	'p9c003-01'  GAAGAAGAGGTAGTAATTAGATCTGAAAATTTCACGGACAATGCTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACATATAGGACCGGGGAGAGCATGGTATACAACAGGAGAAATAATAGGA---GATATAAGACAAGCACATTGTAACCTTAGTGAAGCAAATTGGAATAAAGCTTTAGAACAGATAGTTAAAAAATTAAAAGAACAATTTGGGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCCAGAAATTGTAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTGATACAACAAAGCTGTTTAATAGTACTTGGAATGTTACTAGTACTTGGAAT---------------GCAAATAAC------------------------------AATAGAACTATCACAC [...]
+	'p9c003-04'  GAAGAAGAGGTAGTAATTAGATCTGAAAATTTCACGGACAATGCTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACATATAGGACCGGGGAGAGCATGGTATACAACAGGAGAAATAATAGGA---GATATAAGACAAGCACATTGTAGCCTTAGTGAAGCAAATTGGAATAAAGCTTTAGAACAGATAGTTAAAAAATTAAAAGAACAATTTGAGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCCAGAAATTGTAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGCTTAAT------------------AGTACTTGGAATAATACTGAAGGG---TCAGGTAACAATGGA------------------------------ACTATCACAC [...]
+	'p9c003-09'  GAAGAAGAGGTAGTAATTAGATCTGAAAATTTCACGGACAATGCTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACATATAGGACCGGGGAGAGCATGGTATACAACAGGAGAAATAATAGGA---GATATAAGACAAGCACATTGTAACCTTAGTGAAGCAGATTGGAATAAAGCTTTAGAACAGATAGTTAAAAAATTAAAAGAACAATTTGGGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCCAGAAATTGTAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAATAGTACTTGGAATGTTACTAGTACTTGGAAT---------------GCAAATAAC------------------------------AATAGAACTATCACAC [...]
+	'p9c003-11'  GAAGAAGAGGTAGTAATTAGATCTGAAAATTTCACGGACAATGCTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACATATAGGACCGGGGAGAGCATGGTATACAACAGGAGAAATAATAGGA---GATATAAGACAAGCACATTGTAACCTTAGTGAAGCAAATTGGAATAAAGCTTTAGAACAGATAGTTAAAAAATTAAAAGAACAATTTGGGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCCAGAAATTGTAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAATAGTACTTGGAATGTTACTAGTACTTGGAAT---------------GCAAATAAC------------------------------AATAGAACTATCACAC [...]
+	'p9c003-364' GAAGGAGAGGTAGTAATTAGATCTGAAAATTTCACGGACAATGCTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACATATAGGACCGGGGAGAGCATGGTATACAACAGGAGAAATAATAGGA---GATATAAGACAAGCACATTGTAACCTTAGTGAAGCAAATTGGAATAAAGCTTTAGAACAGATAGTTAAAAAATTAAAAGAACAATTTGAGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCCAGAAATTGTAATGCACAGTTTTAACTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAAT------------------AGTACTTGGAATAATACTGAAGGG---TCAGGTAACAATGGA------------------------------ACTATCACAC [...]
+	'p9c003-367' GAAGAAGAGGTAGTAATTAGATCTGAAAATTTCACGGACAATGCTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACATATAGGACCGGGGAGAGCATGGTATACAACAGGAGAAATAATAGGA---GATATAAGACAAGCACATTGTAACCTTAGTGAAGCAAATTGGAATAAAGCTTTAGAACAGATAGTTAAAAAATTAAAAGAACAATTTGAGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCCAGAAATTGTAATGCACAGTTTTAGTTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAAT------------------AGTACTTGGAATAATACTGAAGGG---TCAGGTAACAATGGA------------------------------ACTATCACAC [...]
+	'p9c003-368' GAAGAAGAGGTAGTAATTAGATCTGAAAATTTCACGGACAATGCTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACATATAGGACCGGGGAGAGCATGGTATACGACAGGAGAAATAATAGGA---GATATAAGACAAGCACATTGTAACCTTAGTGAAGCAAATTGGAATAAAGCTTTAGAACAGATAGTTAAAAAATTAAGAGAACAATTTGAGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCCAGAAATTGTAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAATAGTACTTGGAATGTTACTAGTACTTGGAAT---------------GCAAATAAC------------------------------AATAGAACTATCACAC [...]
+	'p9c003-369' ---GAAGAGGTAGTAATTAGATCTGAAAATTTCACGGACAATGCTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACATATAGGACCGGGGAGAGCATGGTATACAACAGGAGAAATAATAGGA---GATATAAGACAAGCACATTGTAACCTTAGTGAAGCAAATTGGAATAAAGCTTTAGAACAGATAGTTAAAAAATTAAAAGAACAATTTGGGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCCAGAAATTGTAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAATAGTACTTGGAATGTTACTAGTACTTGGAGT---------------GCAAATAAC------------------------------AATAGAACTATCACAC [...]
+	'p9c003-371' ---GAAGAGGTGGTAATTAGATCTGAAAATTTCACGGACAATGCTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACATATAGGACCGGGGAGAGCATGGTATACAACAGGAGAAATAATAGGA---GATATAAGACAAGCACATTGTAACCTTAGTGAAGCAAATTGGAATAAAGCTTTAGAACAGATAGTTAAAAAATTAAAAGAACAATTTGGGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCCAGAAATTGTAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAGTAGTACTTGGAATGTTACTAGTACTTGGAAT---------------GCAAATAAC------------------------------AATAGAACTATCACAC [...]
+	'p9c009-03'  GAAGAAGAGGTAGTAATTAGATCTGAAAATTTCGCGGACAATGCTAAAACCATAATAGCACAGCTGAATGAATCGGTAGTAATTAATTGTTCAAGACCCAACAACAATACAAGAAAAAGTATACATATAGGACCGGGGAGAGCATGGTATACAACAGGAGAAATAATAGGA---GATATAAGACAAGCACATTGTAACCTTAGTGAAGCAGATTGGAATAAAGCTTTAAAACAGATAGTTAAAAAATTAAAAGAACAATTTGAGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCCAGAAATTGTAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAAT------------------AGTACTTGGAATAATACTGAAGGG---TCAGGTAACAATGGA------------------------------ACTATCACAC [...]
+	'p9c009-07'  GAAGAAGAGGTAGTAATTAGATCTGAAAATTTCACGGACAATGCTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACATATAGGACCGGGGAGAGCATGGTATACAACAGGAGAAATAATAGGA---GATATAAGACAAGCACATTGTAACCTTAGTGAAGCAAATTGGAATAAAGCTTTAGAACAGATAGTTAAAAAATTAAAAGAACAATTTGAGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCCAGAAATTGTAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAAT------------------AGTACTTGGAATAATACTGAAAGG---TCAGGTAACAATGGA------------------------------ACTATCACAC [...]
+	'p9c009-14'  GAAGAAGAGGTAGTAATTAGATCTGAAAATTTCACGGACAATGCTAAAACCATAATAGTACAACTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACATATAGGACCGGGGAGAGCATGGTATACAACAGGAGAAATAATAGGA---GATATAAGACAAGCACATTGTAACCTTAGTGGAGCAAATTGGAATAAAGCTTTAGAACAGATAGTTAAAAAATTAAAAGAACAATTTGGGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCCAGAAATTGTAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAATAGTACTTGGAATGTTACTAGTACTTGGGAT---------------GCAAATAAC------------------------------AATAGAACTATCACAC [...]
+	'p9c009-384' GAAGAAGAGGTAGTAATTAGATCTGAAAATTTCACGGACAATGCTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATGCAAGAAAAAGTATACATATAGGACCGGGGAGAGCATGGTATACAACAGGAGAAATAATAGGA---AATATAAGACAAGCACATTGTAACCTTAGTGAAGCAAATTGGAATAAAGCTTTAGAACAGATAGTTAAAAAATTAAAAAAACAATTTGGGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCCAGAAATTGTAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAATAGTACTTGGAATGTTAATAGTACTTGGAATAATACTGAAGGG---TCAGGTAACAATGGA------------------------------ACTATCACAC [...]
+	'p9c009-390' GAAGAAGAGGTAGTAATTAGATCTGAAAATTTCACGGACAATGCTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACATATAGGACCGGGGAGAGCATGGTATACAACAGGAGAAATAATAGGA---GATATAAGACAAGCACATTGTAACCTTAGTGAAGCAAATTGGAATAAAGCTTTAGAACAGATAGTTAAAAAATTAAAAGAACAATTTGAGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCCAGAAATTGTAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAAT------------------AGTACTTGGAATAATACTGAAGGG---TCAGGTAACAATGGA------------------------------ACTATCACAC [...]
+	'p9c009-392' GAAGAAGAGGTAGTAATTAGATCTGAAAATTTCACGGACAATGCTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACATATAGGACCGGGGAGAGCATGGTATACAACAGGAGAAATAATAGGA---GATATAAGACAAGCACATTGTAACCTTAGTGAAGCAAATTGGAATAAAGCTTTAGAACAGATAGTTAAAAAATTAAAAGAACAATTTGAGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCCAGAAATTGTAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAAT------------------AGTACCTGGAATAATACTGAAGGG---TCAGGTAACAATGGAGGGTCAGGT------------AACAATGGAACTATCACAC [...]
+	'p9c009-393' GAAGAAGAGGTAGTAATTAGATCTGAAAATTTCACGGACAATGCTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTACTTGTACAAGACCCAACAACAATACAAGAAAAAGTATACCTATAGGACCGGGGAGAGCATGGTATACAACAGGAGAAATAATAGGA---AATATAAGACAAGCACATTGTAACCTTAGTGAAGCAAATTGGAATAAAGCTTTAGAACAGATAGTTAAAAAATTAAAAGAACAATTTGGGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCCAGAAATTGTAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAATAGTACTTGGAATGTTAATAGTACTTGGAATAATGCTGAAGGG---TCAGGTAACAATGGA------------------------------ACTATCACAC [...]
+	'p9c017-01'  GAAGAAGAGGTAGTAATTAGATCTGAAAATTTCACGGACAATGCTAAAACCATAATAGTACAGCTGAATGAATCGGTAGCAATTAATTGTATAAGACCCAACAACAATACAAGAAAAAGTATACATATAGGACTGGGGAGAGCATGGTATACAACAGGAGAAATAATAGGA---AATATAAGACAAGCACATTGTAACCTTAGTGAAGCAAATTGGAATAAAGCTTTAGAACAGATAGTTAAAAAATTAAAAGAACAATTTGGGAAT---AGAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCCAGAAATTGTAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAATAGTACTTGGAATGTTAATAGTACTTGGAATAATACTGAAGGG---TCAGGTAACAATGGA------------------------------ACTATCACAC [...]
+	'p9c017-02'  GAAGAAGAGGTAGTAATTAGATCTGAAAATTTCACGGACAATGCTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACATATAGGACCGGGGAGAGCATGGTATACAACAGGAGAAATAATAGGA---GATATAAGACAAGCACATTGTAACCTTAGTGAAGCAAATTGGAATAAAGCTTTAGAACAGATAGTTAAAAAATTAAAAGAACAATTTGGGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCCAGAAATTGTAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAATAGTACTTGGAATGTTACTAGTACTTGGAAT---------------GCAAATAACAATAGA------------------------------ACTATCACAC [...]
+	'p9c017-04'  GAAGAAGAGGTAGTAATTAGATCTGAAAATTTCACGGACAATGCTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACATATAGGACCGGGGAGAGCATGGTATACAACAGGAGAAATAATAGGA---GATATAAGACAAGCACATTGTAACCTTAGTGAAGCAAATTGGAATAAAGCTTTAGAACAGATAGTTAAAAAATTAAAAGAACAATTTGGGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCCAGAAATTGTAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAATAGTACTTGGAATGTTACTAGTACTTGGAAT---------------GCAAATAACAATAGA------------------------------ACTATCACAC [...]
+	'p9c017-05'  GAAGAAGAGGTAGTAATTAGATCTGAAAATTTCACGGACAATGCTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTAAAAGACCCAACAACAATACAAGAAAAAGTATACCTATAGGACCGGGGAGAGCATGGTATACAACAGGAGAAATAATAGGA---AATATAAGACAAGCACATTGTAACCTTAGTGAAGCAAATTGGAATAAAGCTTTAGAACAGATAGTTAAAAAATTAAAAGAACAATTTGAGAAT---AAAACAATAGTCTTTGATCAATCCTCAGGAGGGGACCCAGAAATTGTAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAAT------------------AGTACTTGGAATAATACTGAAGGG---TCAGGTAACAATGGA------------------------------ACTATCACAC [...]
+	'p9c017-06'  GAAGAAGAGGTAGTAATTAGATCAGAAAATTTCACGGACAATGCTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACATATAGGACTGGGGAGAGCATGGTATACAACAGGGGAAATAATAGGA---AATATAAGACAAGCACATTGTAACCTTAGTGAAGCAGATTGGAATAAAGCTTTAAAACAGATAGTTAAAAAATTAAAAGAACAATTTGAGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCCAGAAATTGTAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAAT------------------AGTACTTGGAATAATACTGAAGGG---TCAGGTAACAATGGA------------------------------ACTATCACAC [...]
+	'p9c017-13'  GAAGAAGAGGTAGTAATTAGATCTGAAAATTTCACGGACAATGCTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACATATAGGGCCGGGGAGAGCATGGTATACAACAGGAGAAATAATAGGA---GATATAAGACAAGCACATTGTAACCTTAGTGAAGCAAATTGGAATAAAGCTTTAGAACAGATAGTTAAAAAATTAAAAGAACAATTTGAGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCCAGAAATTGTAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAAT------------------AGTACTTGGAATAATACTGAAGGG---TCAGGTAACAATGGA------------------------------ACTATCACAC [...]
+	'p9c017-16'  GAAGAAGAGGTAGTAATTAGATCTGAAAATTTCACGGGCAATGCTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACATATAGGACCGGGGAGAGCATGGTATACAACAGGAGAAATAATAGGA---GATATAGGACAAGCACATTGTAACCTTAGTGAAGCAAATTGGAATAAAGCTTTAGAACAGGTAGTTAAAAAATTAAAAGAACAATTTGAGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCCAGAAATTGTAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAAT------------------AGTACTTGGAATAATACTGAAGGG---TCAGGTAACAATGGA------------------------------ACTATCACAC [...]
+	'p9c017-407' GAAGAAGAGGTAGTAATTAGATCTGAAAATTTCACGGACAATGCTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACATATAGGACCGGGGAGAGCATGGTATACAACAGGAGAAATAATAGGA---GATATAAGACAAGCACATTGTAACCTTAGTGAAGCAAATTGGAATAAAGCTTTAGAACAGATAGTTAAAAAATTAAAAGAACAATTTGGGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCCAGAAATTGTAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAAT------------------AGTACTTGGAATAATACTGAAGGG---TCAGGTAACAATGGA------------------------------ACTATCACAC [...]
+	'p9c017-409' GAAGAAGAGGTAGTAATTAGATCTGAAAATTTCACGGACAATGCTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACATATAGGACCGGGGGGAGCATGGTATACAACAGGAGAAATAATAGGA---GATATAAGACAAGCACATTGTAACCTTAGTGAAGCAAATTGGAATAAAGCTTTAGAACAGATAGTTAAAAAATTAAAAGAACAATTTGAGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCCAGAAATTGTAATGCACAGTTTTAATTGTGGAGGAGAATTTTTCTACTGTAATACAACAAAGCTGTTTAAT------------------AGTACTTGGAATAATACTGAAGGG---TCAGGTAACAATGGA------------------------------ACTATCACAC [...]
+	'p9c039-02'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTCATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACATATGGGACTGGGGAGAGCATGGTATACAACAGGGGAAATAATAGGA---AATATAAGACAAGCACAGTGTAACCTTGGTGAAGCAAATTGGAATAAAACTTTAGAACAGATAGTTAAAAAATTAAGAGAACAATTTGGGAAT---AAAACAATAGTCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTGTAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAATAGTACTTGGAATGTTAATAGTACTTGGAATAATACTGAAGGG---TCAGGTAACAATGGA------------------------------ACTATCACAC [...]
+	'p9c039-03'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAGAAGTATACAGATGGGACTGGGGAGAGCATGGTATACAACAGGGGAAATAGTAGGA---GATATAAAACAAGCACATTGTAACCTTGGTGAAGCAAATTGGAATAAAACTTTAGAACAGATAGTTAAAAAATTAAAAGAACAATTTGAGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCTAGAAATTGTAACGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATAGTACTGAAGGG---TCAGGTAACAATGGAACTAGT---------------AACAATGGAAATATCACCC [...]
+	'p9c039-04'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACATATAGGACCGGGGGGAGCATGGTATACAACAGGGGACATAATAGGA---GATATAAGACAAGCACATTGTAACCTTAGGGAAGCAAATTGGAATAAAGCTTTAGAACAGATAGTTAAAAAATTAAGAGAACAATTTGGAAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCTAGAAATTATAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAATAGTACTTGGAATGTTAATAGTACTTGGAATAATACTGAAGGG---TCAGGTAACAATGGA------------------------------ACTATCACAC [...]
+	'p9c039-05'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACAGATGGGACTGGGGAGAGCATGGTATACAACAGGGGAAATAATAGGA---GATATAAGACAAGCACATTGTAACCTTAATGAAACAAATTGGAATAAAACTTTAGAACAGATAGTTAAAAAATTAAGAGAACAATTTGGGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCTAGAAATTATAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAACTGTTTAATAGTACTTGGAATGTTAATAGTACTTGGAATAATACTGAAGGG---TCAGGTAACAATGGA------------------------------ACTATCACAC [...]
+	'p9c039-07'  GAAGAAGAGGTAGTAATTAGATCTGAAAATTTCACGGACAATGCTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACATATAGGACCGGGGAGAGCATGGTATACAACAGGAGAAATAATAGGA---GATATAAGACAAGCACATTGTAACCTTAGTGAAGCAAATTGGAATAAAGCTTTAGAACAGATAGTTAAAAAATTAAAAGAACAATTTGGGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCCAGAAATTGTAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAACTGTTTAATAGTACTTGGAATGTTAATAGTACTTGGAATAATACTGAAGGG---TCAGGTAACAATGGA------------------------------ACTATCACAC [...]
+	'p9c039-09'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTGAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACATATAGGACTGGGGAGAGCATGGTATACAACAGGAGACATAATAGGA---GATATAAGACAAGCACATTGTAACCTTAATGAAGCAAATTGGAATAAAGCTTTAGAACAGATAGTTAAAAAATTAAAAGAACAATTTGGGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCTAGAAATTATAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAATAGTACTTGGAATGTTAATAGTACTTGGAATAATACTGAAGGG---TCAGGTAACAATGGA------------------------------ACTATCACAC [...]
+	'p9c039-10'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACAGATGGGACTGGGGAGAGCATGGTATACAACAGGGGAAATAATAGGA---GATATAAAACAAGCACATTGTGACCTTGGTGAAGCAAATTGGAATAAAACTTTAGAACAGATAGTTAAAAAATTAAGAGAACAATTTGGGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCTAGAAATTGAAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAACTGTTTAATAGTACTTGGAATGTTAATAGTACTTGGAATAATACTGAAGGG---TCAGGTAACAATGGA------------------------------ACTATCACAC [...]
+	'p9c039-18'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCATGGACAATACTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACAGATGGGACTGGGGAGAGCATGGTATACAACAGGGGAAATAATAGGA---GATATAAGACAAGCACATTGTAACCTTAATGAAACAAATTGGAATAAAACTTTAGAACAGATAGTTAAAAAATTAAGAGAACAATTTGGGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCTAGAAATTATAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAACTGTTTAATAGTACTTGGAATGTTAATAGTACTTGGAATAATACTGAAGGG---TCAGGTAACAATGGA------------------------------ACTATCACAC [...]
+	'p9c039-299' GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACATATGGGACTGGGGAGAGCATGGTATACAACAGGGGAAATAATAGGA---AATATAAGACAAGCACAGTGTAACCTTGGTGAAGCAAATTGGAATAAAACTTTAGAACAGATAGTTAAAAAATTAAGAGAACAATTTGGGAAT---AAAACAATAGTCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTGTAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAATAGTACTTGGAATGTTAATAGTACTTGGAATAATACTGAAGGG---TCAGGTAACAATGGA------------------------------ACTATCACAC [...]
+	'p9c039-300' GAAGAAGAGGTAGTAATTAGATCTGAAAATTTCACGGACAATGCTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACATATAGGACCGGGGAGAGCATGGTATACAACAGGAGAAATAATAGGA---GATATAAGACAAGCACATTGTAACCTTAGTGAAGCAAATTGGAATAAAGCTTTAGAACAGATAGTTAAAAAATTAAAAGAACAATTTGGGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCCAGAAATTGTAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAATAGTACTTGGAATGTTACTAGTACTTGGAAT---------------GCAAATAACAATAGA------------------------------ACTATCACAC [...]
+	'p9c063-01'  GAAGAAGAGGTAGTAATTAGATCTGAAAATTTCACGAACAATGCTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACAAATGGGACTGGGGAGAGCATGGTATACAACAGGAGACATAATAGGA---GATATAAGACAAGCACAATGTAACCTTAGCGAAGCAGATTGGAATAAAGCTTTAGAACAGATAGTTAAAAAATTAAGAGAACAATTTGGGAAT---AAAACAATAGTCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTGTAACGCACAGTTTTAATTGTGGAGGAGAATTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGG------ACTGAAGGG---TCAGGTAACAATGGAACTAGT---------------AACAATGGAAATATCACAC [...]
+	'p9c063-02'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCCACAACAATACAAGAAAAAGTATACAGATGGGACTGGGGAGAGCATGGTATACAACAGGGGAAATAATAGGA---GATATAAGACAAGCACATTGTAACCTTAATGAAACAAATTGGAATAAAGCTTTAGAACAGATAGTTAAAAAATTAAGAGAACAATTTGGGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCCAGAAATTGTAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAATAGTACTTGGAATGTTACTGGTACTTGGAAT---------------GCAAATAACAATAGA------------------------------ACTATCACAC [...]
+	'p9c063-04'  GAAGAAGGGGTAGTAATTAGATCTGAAAATTTCACGAACAATGTTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACAGATGGGACTGGGGAGAGCATGGTATACAACAGGGGAAATAATAGGA---GATATAAGACAAGCACATTGTAACCTTAATGAAGCAAATTGGAATAAAACTTTAGAACGGATAGTTAAAAAATTAAGAGAACAATTTGGAAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCTAGAAATTATAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAATAGTACTTGGAATGTTAATAGTACTTGGAATAATACTGAAGGG---TCAGGTAACAATGGA------------------------------ACTATCACAC [...]
+	'p9c063-05'  GAAGAAGAGGTAGTAATTAGATCTGAAAATGTCACGGACAATACTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAGCAACAATACAAGAAAAAGTATACAAATGGGACTGGGGAGAGCATGGTATACAACAGGAGACATAATAGGA---GATATAAGACAAGCACATTGTAACCTTAGTGAAGCAGATTGGAATAAAGCTTTAAAACAGATAGTTAAAAAATTAAAAGAACAATTTGGAAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCTAGAAATTGTAACGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACACAGCTGTTTAGT------------------AGTACTTGGAATAATACTGAAGGG---TCAGGTAACAATGGAACTAGT---------------AACAATGGAAATATCACAC [...]
+	'p9c063-06'  GAAGAAGAGGTAGTAATTAGATCTGAAAATGTCACGGACAATACTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAGCAACAATACAAGAAAAAGTATACAAATGGGACTGGGGAGAGCATGGTATACAACAGGAGACATAATAGGA---GATATAAGACAAGCACATTGTAACCTTAGTGAAGCAGATTGGAATAAAGCTTTAAAACAGATAGTTAAAAAATTAAAAGAACAATTTGGAAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCTAGAAATTGTAACGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAATAGTACTTGGAATGTTACTAGTACTTGGAAT---------------GCAAATAACAGTAGA------------------------------ACTATCACAC [...]
+	'p9c063-07'  GAAGAAGAGGTAGTAATTAGATCTGAAAATTTCACGGACAATGCTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACATATAGGACCGGGGAGAGCGTGGTATACAACAGGAGAAATAATAGGA---GATATAAGACAAGCACATTGTAACCTTAGTGAGGCAAATTGGAATAAAGCTTTAGAACAGATAGTTAAAAAATTAAAAGAACAATTTGGGAAT---AAAACAATAGTCTTTAATCAAACCTCAGGAGGGGACCCAGAAATTGTAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAATAGTACTTGGAATGTTACTAGTACT---------------------TGGAATGCAAATAACAATAGA------------------------ACTATCACAC [...]
+	'p9c063-09'  GAAGAAGAGGTAGTAATTAGATCTGAAAATTTCACGGACAATGCTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACATATAGGACCGGGGAGAGCATGGTATACAACAGGAGAAATAATAGGA---GATATAAGACAAGCACATTGTAACCTTAGTGAAGCAAATTGGAATAAAGCTTTAGAACAGATAGTTAAAAAATTAAAAGAACAATTTGGGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCTAGAAATTATAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAACTGTTTAATAGTACTTGGAATGTTAATAGTACTTGGAATAATACTGAAGGG---TCAGGTAACAATGGA------------------------------ACTATCACAC [...]
+	'p9c063-10'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACCTATAGGACCGGGGAGAGCATGGTATACAACAGGAGAAATAATAGGA---GATATAAGACAAGCACATTGTAACCTTAGTGAAGCAAATTGGAATAAAGCTTTAGAACAGATAGTTAAAAAATTGAAAGAACAATTTGAGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCCAGAAATTGTAATGCACAGTTTTAATTGTGGAGGGGAACTTTTCTACTGTAATACAACACAGCTGTTTAGT------------------AGTACTTGGAATAATACTGAAGGG---TCAGGTAACAATGGAACTAGT---------------AACAATGGAAATATCACAC [...]
+	'p9c063-11'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACAAATGGGACTGGGGAGAGCATGGTATACAACAGGAGACATAATAGGA---GATATAAGACAAGCACATTGTAACCTTAGTAAAGCAGATTGGAATAAAGCTTTAAAACAGATAGTTAAAAAATTAAGAGAACAATTTGGGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCTAGAAATTATAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAATAGTACTCGGAATGTTAATAGTACTTGGAATAATACTGAA---------GGTAGCAATGGA------------------------------AATATCACAC [...]
+	'p9c063-12'  GAAGAAGAGGTAGTAATTAGATCTGAAAATTTCACGGACAATGCTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACAGATGGGACTGGGGAGAGCATGGTATACAACAGGAGACATAATAGGA---GATATAAGACAAGCACATTGTAACCTTAATAAAGCAAATTGGAATAAAGCTTTAGGACAGATAGTTAAAAAATTAAGAGAACAATTTGGGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCTAGAAATTATAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAATCTGTTTAATAGTACTTGGAATGTTAATAGTACTTGGAATAATACTGAA---------GGTAGCAATGGA------------------------------AATATCACAC [...]
+	'p9c063-13'  GAAGAAGAGGTAGTAATTAGATCTGAAAATTTCACGGACAATGCTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACATATAGGACCGGGGAGAGCATGGTATACAACAGGAGAAATAATAGGA---GATATAAGACAAGCACATTGTAACCTTAGTGAAGCAAATTGGAATAAAGCTTTAGAACAGATAGTTAAAAAATTGAAAGAACAATTTGAGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCCAGAAATTGTAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAATAGTACTTGGAATGTTAATAGTACTTGGAATAATACTGAAGGG---TCAGGTAACAATGGA------------------------------ACTATCATAC [...]
+	'p9c063-16'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCCACAACAATACAAGAAAAAGTATACATATGGGACCGGGGAGAGCATGGTATACAACAGGGGAAGTAATAGGA---AAGATAAGACAAGCAGAGTGTAACCTTGGTGAAGCAAATTGGAATAAGACTTTAGAACAGATAGTTAAAAAATTAAGAGAACAATTTGGGAAT---AAAACAATAGTCTTTAATCACTCCTCAGGAGGGGACCTAGAAGTTGTAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAGAGCTGTTTAATAGTACTTGGAATGTTACTAGTACTTGGAAT---------------GCAAATAACAATAGA------------------------------ACTATCACAC [...]
+	'p9c086-02'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACAGATGGGACTGGGGAGAGCATGGCATACAACAGGGGAAATAATAGGA---GATATAAGACGAGCATATTGTACCCTTAATGAAACAAATTGGAATAAAGCTTTAGGACAGATAGTTAAAAAATTAAGAGAACCATTTGGGAAT---AAAACAATAGTCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTATAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAATAGTACTTGGAATGTTACTAGTACTTGGAAT---------------GCAAATAACAATAGA------------------------------ACTATCACAC [...]
+	'p9c086-03'  GAAGAAGAGGTAGTAATTAGATCTGAAAATTTCACGGACAATGCTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTACTTGTACAAGACCCAACAACAATACAAGAAAAAGTATACCTATAGGACCGGGGAGAGCATGGTATACAACAGGAGAAATAATAGGA---AATATAAGACAAGCACATTGTAACCTTAGTGAAGCAAATTGGAATAAAGCTTTAGAACAGATAGTTAAAAAATTAAAAGAACAATTTGGGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCCAGAAATTGTAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAATAGTACTTGGAATGTTAATAGTACTTGGAATAATACTGAAGGG---TCAGGTAACAATGGA------------------------------ACTATCACAC [...]
+	'p9c086-05'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACAGATGGGACTGGGGAGAGCATGGCATACAACAGGGGAAATAATAGGA---GATATAAGAAAAGCATATTGTACCCTTAATGAAACAAATTGGAATAAAGCTTTAGGACAGATAGTTAAAAAATTAAGAGAACAATTTGGGAAT---AAAACAATAGTCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTATAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTGAAGGG---TCAGGTAGCAATGGAACTAGT------------------AATGGAAATATCACAC [...]
+	'p9c086-08'  GAAGAAGAGGTAGTAATTAGATCTGAAAATTTCACGGACAATGCTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTACTTGTACAAGACCCAACAACAATACAAGAAAAAGTATACCTATAGGACCGGGGAGAGCATGGTATACAACAGGAGAAATAATAGGA---AATATAAGACAAGCACATTGTAACCTTAGTGAAGCAAATTGGAATAAAGCTTTAGAACAGATAGTTAAAAAATTAAAAGAACAATTTGGGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCCAGAAATTGTAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAATAGTACTTGGAATGTTAATAGTACTTGGAATAATACTGAAGGG---TCAGGTAACAATGGA------------------------------ACTATCACAC [...]
+	'p9c086-10'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCCACAACAATACAAGAAAAAGTATACAGATGGGACTGGGGAGAGCATGGTATACAACAGGGGAAATAATAGGA---GATATAAGACAAGCACATTGTACCCTTAGTGAAGCAGATTGGAACAAAGCATTAAAACAGATAGTTAAAAAATTAAGAGAACAATTTGGGAAT---AAAACAATAGTCTTTAATCGATCCTCAGGAGGGGACCTAGAAATTGTAATGCACAGTTTTAATTGTGGAGGAGAATTTTTCTACTGTAGTACAACAAAGCTGTTTAATAGTACTTGGAATGATAATAACACTTGGAATAATATTGAA---------AGTAACACTGAA------------------------------AATATCACAC [...]
+	'p9c086-11'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCCACAACAATACAAGAAAAAGTATACAGATGGGACTGGGGAGAGCATGGTATACAACAGGGGAAATAATAGGA---GATATAAGACAAGCACATTGTACCCTTAGTGAAGCAGATTGGAACAAAGCATTAAAACAGATAGTTAAAAAATTAAGAGAACAATTTGGGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCTAGAAATTGTAATGCACAGTTTTAATTGTGGAGGAGAATTTTTCTACTGTAGTACAACAAAGCTGTTTAATAGTACTTGGAATGTTGATAGTACTTGGAATAATACTGAA---------GGTAACACTGAA------------------------------AATATCACAC [...]
+	'p9c086-12'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACAAATGGGACTGGGGAGAGCATGGTATACAACAGGAGACATAATAGGA---GATATAAGACAAGCATCTTGTAACCTTAGTGAAGCAGATTGGAATAAAGCTTTAAAGCAGATAGTTAGAAAATTAAGAGAACAATTTGGGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCTAGAAATTATAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTGAAGGG---TCAGGTAGCAATGGAACTAATAACAATGGAACTAATAACAATGGAAAGATCACAC [...]
+	'p9c086-17'  ---GAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCCACAACAATACAAGAAAAAGTATACAGATGGGACTGGGGAGAGCATGGCATACAACAGGGGAAATAATAGGA---GATATAAGACAAGCACATTGTACCCTTAGTGAAGCAGATTGGAACAAAGCATTAAAACAGATAGTTAAAAAATTAAGAGAACAATTTGGGAAT---AAAACAATAATCTTTAATCAATCCTCAGGAGGGGACCTAGAAATTGTAATGCACAGTTTTAATTGTGGAGGAGAATTTTTCTACTGTAGTACAACAAAGCTGTTTAATAGTACTTGGAATGTTAATGATACTTGGAATGATATTAAAGGT---------AACACTGAA------------------------------AATATCACAC [...]
+	'p9c086-19'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACAGATGGGACTGGGGAGAGCATGGCATACAACAGGGGAAATAATAGGA---GATATAAGAAAAGCATATTGTACCCTTAATGAAACAAATTGGAATAAAGCTTTAGGACAGATAGTTAAAAAATTAAGAGAACAATTTGGGAAT---AAAACAATAGTCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTATAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTGAAGGG---TCAGGTAGCAATGGAACTAGT------------------AATGGAAATATCACAC [...]
+	'p9c086-20'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACATATGGGATTGGGGAGAGCATGGTATACAACAGGGGAAATAATAGGA---AATATAAGACAAGCAGAGTGTAACCTTGGTGAAGCAAATTGGGATAAAACTTTAGAACAGATAGTTAAAAAATTAAGAGAACAATTTGGGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCTAGAAATTGAAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAATAGTACTTGGAATGTTAATAGTACTTGGAATAATACTGAAGGG---TCAGGTAACAATGGA------------------------------ACTATCACAC [...]
+	'p9c104-02'  GAAGAAGAGGTAGTAATTAGATCTGAAAATTTCACGAACAATGCTAAAACCATACTAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACAAATGGGACTGGGGAGAGCATGGTATACAACAGGAGACATAATAGGA---GATATAAGACAAGCATCTTGTAACCTTAGTGAAGCAGATTGGAATAAAGCTTTAAAGCAGATAGTTAGAAAATTAAGAGAACAATTTGGGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCTAGAAATTATAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTGAAGGG---TCAGGTAGCAATGGAACTAAT---------------AACAATGGAAATATCACAC [...]
+	'p9c104-05'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAAACCATAATAGTACAGCTGAGTGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACAGATGGGACTGGGGAGAGCATGGCATACAACAGGGGAAATAATAGGA---GATATAAGAAAAGCATATTGTACCCTTAATGAAACAAATTGGAATAAAGCTTTAGGACAGATAGTTAAAAAATTAAGAGAACAATTTGGGAAC---AAAACAATAGTCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACCGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTGAAGGG---TCAGATAACAATGGAACTAAT------------------AATGGAAATATCACAC [...]
+	'p9c104-09'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATGCTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACAGATGGGACTGGGGAGAGCATGGCATACAACAGGGGAAATAATAGGA---GATATAAGAAAAGCATATTGTACCCTTAATGAAACAAATTGGAATAAAGCTTTAGGACAGATAGTTAAAAAATTAAGAGAACAATTTGGGAAT---AAAACAATAGTCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAGTTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTGAAGGG---TCAGATAACAATGGAACTAAT------------------AATGGAAATATCACAC [...]
+	'p9c104-10'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACAAATGGGACTGGGGAGAGCATGGTATACAACAGGAGACATAATAGGA---GATATAAGACAAGCACATTGTAACCTTAGTGAAGCAGATTGGAATAAAGCTTTAAAACAGATAGTTAAAAAATTAAAAGAACAATTTGAGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCTAGAAATTGTAACGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATAATACTGAAGGG---TCAGGTAACAATGGAACTAGT---------------AACAATGGAAATATCACAC [...]
+	'p9c104-12'  GAAGAAGAGGTAGTAATTAGATCTGAAAATTTCACGGACAATGCTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACAAATGGGACTGGGGAGAGCATGGTATACAACAGGAGACATAATAGGA---GATATAAGACAAGCACAGTGTGACCTTAGTGAAGCAGATTGGAATAAAGCTTTAGGACAGATAGTTAAAAAATTAAGAGAACAATTTGGGAAT---AAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCTAGAAATTGTAACGCACAGTTTTAATTGTGGAGGGGAGTTTTTCTACTGTAGTACAACAAAGCTGTTTAATAGTACTTGGAATGTTAATAGT------AATAATACTGAAGGT---------GGCAAGGGA------------------------------AATATCACAC [...]
+	'p9c104-14'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACAGATGGGACTGGGGAGAGCATGGCATACAACAGGGGAAATAATAGGA---GATATAAGACGAGCATATTGTACCCTTAATGAAACAAATTGGAATAAAACTTTAGAACAGGTAGTTAAAAAATTAAGAGAACAATTTGGGAAT---AAAACAATAGTCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTAAAGGG---TCAGGTAACAATGGAACTAGT------------------AATGGAACTATCACAC [...]
+	'p9c111-02'  GAAGAAGAGGTAGTAATTAGATCTGAAAATTTCACGAACAATGTTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTGCAAGACCCGGCAACAATACAAGAAAAAGTGTACAGATGGGACTGGGGAGAGCATGGCATACAACAGGGGAAATAATAGGA---GATATAAGACAAGCACATTGTAACCTTAGTGGAGCAGATTGGAATAAAGCTTTAAAACAGGTAGTTAAAAAATTAAGAGAACAATTTGGAAATAATAAAACAATAGCCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTAAATGG---TCAGGTAACAATGGAACTAGT------------------AATGGAACTATCATAC [...]
+	'p9c111-05'  GAAGAAGGGGTAGTAATTAGATCAAAAAATTTCACGGACAATACTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACAGATGGGATTTGGGAGAGCATGGCATACAACAGGGGAAATAATAGGA---GATATAAGAAAAGCATATTGTACCCTTAATGAAACAAATTGGAATAAAACTTTAGAACAGATAGTTAAAAAATTAAGAGAACAATTTGGAAATAATAAAACAATAGCCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTACAATGCGCAGTTTTAATTGCGGAGGGGAATTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATGTTACTAAATGG---TCAGGTAACAATGGAACTAGT------------------AATGGAACTATCATAC [...]
+	'p9c111-07'  GAAGAAGAGGTAGTAATTAGATCTGAAAATTTCACGAACAATGTTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCGGCAACAATACAAGAAAAAGTATACAGATGGGACTGGGGAGAGCATGGCATACAACAGGGGAAATAATAGGA---GATATAAGACAAGCACATTGTAACCTTAGTGGAGCAGATTGGAATAAAGCTTTAAAACAGGTAGTTAAAAAATTAAGAGAACAATTTGGAAATAATAAAACAATAGCCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTGAAGGG---TCAGATAACAATGGAACTGAT------------------AATGGAAATATCACAC [...]
+	'p9c111-08'  GAAGAAGAGGTAGTAATTAGATCTGAAAATTTCACGAACAATGTTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACAGATGGGATTTGGGAGAGCATGGCATACAACAGGGGAAATAATAGGA---GATATAAGAAAAGCATATTGTACCCTTAATGAAACAAATTGGAATAAAACTTTAGAACAGATAGTTAAAAAATTAAGAGAACAATTTGGAAATAATAAAACAATAGTCTTTAATCAATCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAATCTGTTTAATAGTGCTTGGAGTGTTAATAGTACTTGGAATAATACTGGAGGG---ACAGGTAAC------------------------------AATGGAACTATCACAC [...]
+	'p9c111-10'  GAAGAAGAGGTAGTAATTAGATCTGAAAATTTCACGGACAATGCTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACAGATGGGACTGGGGAGAGCATGGCATACAACAGGGGAAATAATAGGA---GATATAAGAAAAGCATATTGTACCCTTAATGAAACAAATTGGAATAAAACTTTAGAACAGATAGTTAAAAAATTAAGAGAACAATTTGGAAATAATAAAACAATAGCCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAATAGTACTTGGGGTGTTAATAATACTTGG------ACTGGAGAG---TCAGGTGAC------------------------------AATGGAACTATCACAC [...]
+	'p9c111-11'  GAAGAAGAGGTAGTAATTAGATCAAAAAATTTCACGGACAATACTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACAGATGGGATTTGGGAGAGCATGGCATACAACAGGGGAAATAATAGGA---GATATAAGAAAAGCATATTGTACCCTTAATGAAACAAATTGGAATAAAACTTTAGAACAGATAGTTAAAAAATTAAGAGAACAATTTGGAAATAATAAAACAATAGCCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTGAAGGG---TCAGATAACAATGGAACTAAT------------------AATGGAAATATCACAC [...]
+	'p9c111-16'  ---GAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAGACCATAATAGTACAGCTGAATGAAACGGTAGTAATTAATTGTACAAGACCCAACAGCAATACAGGAAAAAGTATACGGATGGGACTGGGGAGAGCAAGGCATACAACAAGGGAAATAATAGGA---GATATAAGACGAGCATATTGTACCCTTAATGAAACAAAGTGGAATAAGGCTTTAGGACAGATAGTTAAAAAATTAAGAGAACAATTTGGGAAT---AAAACAATAGTCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTGAAGGG---TCAGGTAACAATAAAACTAGT------------------AATGGAAATATCACAC [...]
+	'p9c111-18'  GAAGAAGAGGTAGTAATTAGATCTGAAAATTTCACGGACAATGCTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACAGATGGGATTTGGGAGAGCATGGCATACAACAGGGGAAATAATAGGA---GATATAAGAAAAGCATATTGTACCCTTAATGAAACAAATTGGAATAAAACTTTAGAACAGGTAGTTAAAAAATTAAGAGAACAATTTGGAAATAATAAAACAATAGCCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTAAATGG---TCAGGTAACAATGGAACTAGT------------------AATGGAACTATCATAC [...]
+	'p9c117-02'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAGACCATAATAGTACAGCTGAATGAAACGGTAGTAATTAATTGTACAAGACCCAACAGGAATACAGGAAAAAGTATACGGATGGGACTGGGGAGAGCATGGCATACAACAAGGGAAATAATAGGA---GATATAAGAAAAGCATATTGTACCCTTAATGGAACAAATTGGAATAAAACTTTAGAACAGGTAGTTAAAAAATTAAGAGAACAATTTAGGAAT---AAAACAATAGTCTTTAATCACTCCTCAGGAGGGGGCCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTAAAGGGTGGTCAGGTAACAATGGAACTAAT------------------AATGGAACTATCACAC [...]
+	'p9c117-03'  GAAGAAGAGGTAATAATTAGATCTAAAAATTTCACGGACAATACTAAAACCATAATAGTACAGCTGAATGAATCAGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACAGATGGGACTGGGGAGAGCATGGCATACAACAGGGGAAATAATAGGA---GATATAAGACGAGCATATTGTACCCTTAATGAAACAAATTGGAATAAAACTTTAGAACAGGTAGTTAAAAAATTAAGCGAACAATTTAGGAAT---AAAACAATAGTCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAACTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAATAGTACTTGGGGTGATAATAGTACTTGG------ACTGGAGAG---TCAGGTAACAATGGA------------------------------ACTATCACAC [...]
+	'p9c117-06'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAGACCATAATAGTACAGCTGAATGAAACGGTAGTAATTAATTGTACAAGACCCAACCGCAATACAGGAAAAAGTATACGGATGGGACTGGGGAGAGCATGGCATACAACAAGGGAAATAATAGGA---GATATAAGACGAGCATATTGTACCCTTAATGAAACAAAGTGGAATAAGGCTTTAGGACAGATAGTTAAAAAATTAAGAGAACAATTTGGGAGT---AAAACAATAGTCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTGAAGGG---TCAGGTAACAATAAAACTAGT------------------AATGGAAATATCACAC [...]
+	'p9c117-07'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAGACCATAATAGTACAGCTGAATGAAACGGTAGTAATTAATTGTACAAGACCCAACAGACATACAGGAAAAAGTATACGGATGGGACTGGGGAGAGCGTGGCATACAACAAGGGAAATAATAGGA---GATATAAGAAAAGCATATTGTACCCTTAATGGAACAAATTGGAATAAAATTTTAGAACAGGTAGTTAAAAAGTTAAGAGAACAATTTAGGAAT---AAAACAATAGTCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTAAAGGGTGGTCAGGTAACAATGGAACTAAT------------------AATGGAACTATCACAC [...]
+	'p9c117-09'  GAAGAAGAGGTAGTAATTAGAACTGAAAATTTCACGAACAATGTTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACAGATGGGATTTGGGAGAGCATGGCATACAACAGGGGAAATAATAGGA---GATATAAGAAAATCATATTGTACCCTTAATGGAACAAATTGGAATAAAACTTTAGAACAGGTAGTTAAAAAATTAAGAGAACAATTTAGGAAT---AAAACAATAGTCTTTAATCCCTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTACAGGGTGGTCAGGTAACAATGGAACTAGT------------------AATGGAACTATCACAC [...]
+	'p9c117-11'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAGACCATAATAGTACAGCTGAATGAAACGGTAGTAATTAATTGTACAAGACCCAACCGCAATACAGGAAAAAGTATACGGGTGGGACTGGGGAGAGCATGGCATACAACAAGGGAAATAATAGGA---GATATAAGACGAGCATATTGTACCCTTAATGGAACAAATTGGAATAAAACTTTAGGACAGATAGTTAAAAAATTAAGAGAACAATTTGTGAAT---AAAACAATAGTCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTAAAGGGTGGTCAGGTAACAATGGAACTAGT------------------AATGGAACTATCACAC [...]
+	'p9c117-12'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAAACCATAATAGTACAACTGAATGAATCGGTAGTAATTAATTGTACAAGACCCCACAACAATACAAGAAAAAGTATACAGATGGGACTGGGGAGAGCATGGCATACAACAGGGGAAATAATAGGA---GATATAAGACGAGCATATTGTACCCTTAATGAAACAAATTGGAATAAAACTTTAGAACAGGTAGTTAAAAAATTAAGAGAACAATTTAGGAAT---AAAACAATAGTCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAACTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAACTGTTTAATAGTACTTGGGGT---AATAGTACTTGG------ACTGGAGAG---TCAGGTAACAATGGA------------------------------ACTATCACAC [...]
+	'p9c117-13'  GAAGAAGAGGTAGTAATTAGATCCAAAAATTTCACGGACAATACTAAGACCATAATAGTACAGCTGAATGAAACGGTAGTAATTAATTGTACAAGACCCAACAGACATACAGGAAAAAGTATACGGAAGGGACTGGGGAGAGCATGGCATACAACAAGGGAAATAATAGGA---GATATAAGAAAAGCATATTGTACCCTTAATGGAACAAATTGGAATAAAACTTTAGAACAGGTAGTTAAAAAGTTAAGAGAACAATTTAGGAAT---AAAACAATAGTCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTAAAGGGTGGTCAGGTAACAATGGAACTAAT------------------AATGGAACTATCACAC [...]
+	'p9c122-03'  GAAGAAGAGGTAGTAACTAGATCTAAAAATTTCACGGACAATACTAAGACCATAATAGTACAGCTGAATGAAACGGTAGTAATTAATTGTACAAGACCCAACAGACATACAGGAAAAAGTATACGGATGGGACTGGGGAGAGCATGGCATACAACAAGGGAAATAATAGGA---GATATAAGAAAAGCATATTGTACCCTTAATGGAACAAATTGGAATAAAACTTTAGAACAGGTAGTTAAAAAGTTAAGAGAACAATTTAGGAAT---AAAACAATAGTCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTAAAGGGTGGTCAGGTAACAATGGAACTAAT------------------AATGGAACTATCACAC [...]
+	'p9c122-06'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAGACCATAATAGTACAGCTGAATGAAACGGTAGTAATTAATTGTACAAGACCCAACAGACATACAGGAAAAAGTATACGGATGGGACTGGGGAGAGCATGGCATACAACAAGGGAAATAATAGGA---GATATAAGAAAAGCATATTGTACCCTTAATGGAACAAATTGGAATAAAACTTTAGAACAGGTAGTTAAAAAATTAAGAGAACAATTTAGGAAT---AAAACAATAGTCTTTAATCACTCCTCAGGAGGGGGCCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTAAAGGGTGGTCAGGTAACAATGGAACTAAG------------------AATGGAACTATCACAC [...]
+	'p9c122-07'  GAAGAAGAGGTAGTAGTTAGATCTAAAAATTTCACGGACAATACTAAGACCATAATAGTACAGCTGAATGAAACGGTAGTAATTAATTGTACAAGACCCAACAGACATACAGGAAAAAGTATACGGATGGGACTGGGGAGAGCATGGCATACAACAAGGGAAATAATAGGA---GATATAAGAAAAGCATATTGTACCCTTAATGGAACAAATTGGAATAAAACTTTAGAACAGGTAGTTAAAAAGTTAAGAGAACAATTTAGGAAT---AAAACAATAGTCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTACAGGGTGGTCAGGTAAC---GGAACTAGT------------------AATGGAACTATCACAC [...]
+	'p9c122-09'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAGACCATAATAGTACAGCTGAATGAAACGGTAGTAATTAATTGTACAAGACCCAACAGCCATACAGGAAAAAGTATACGGATGGGACTGGGGAGAGCATGGCATACAACAAGGGAAATAATAGGA---GATATAAGAAAAGCATATTGTACCCTTAATGGAACAAATTGGAATAAAACTTTAGAACAGGTAGTTAAAAAATTAAGAGAACAATTTAGGAAT---AAAACAATAGTCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTACAGGGTGGTCAGGTAACAATGGAACTAGT------------------AATGGAACTATCACAC [...]
+	'p9c122-10'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAGACCATAATAGTACAGCTGAATGAAACGGTAGTAATTAATTGTACAAGACCCAACAGACATACAGGAAAAAGTATACGGATGGGACTGGGGAGAGCATGGCATACAACAAGGGAAATAATAGGA---GATATAAGAAAAGCATATTGTACCCTTAATGGAACAAATTGGAATAAAACTTTAGAACAGGTAGTTAAAAAGTTAAGAGAACAATTCAGGAAT---AAAACAATAGTCTTTAATCACTCCTCAGGAGGGGACCTAGGAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTACAGGGTGGTCAGGTAAC---GGAACTAGT------------------AATGGAACTATCACAC [...]
+	'p9c122-11'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAGACCATAATAGTACAGCTGAATGAAACGGTAGTAATTAATTGTACAAGACCCAACAGACATACAGGAAAAAGTATACGGATGGGACTGGGGAGAGCATGGCATACAACAAGGGAAATAATAGGA---GGTATAAGAAAAGCATATTGTACCCTTAACGGAACAAATTGGAATAAAACTTTAGAACAGGTAGTTAAAAAGTTAAGAGAACAATTTAGGAGT---AAAACAATAGTCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTAAAGGGTGGTCAGGTAACAATGGAACTAAT------------------AATGGAACTATCACAC [...]
+	'p9c122-12'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAGACCATAATAGTACAGCTGAATGAAACGGTAGTAATTAATTGTACAAGACCCAACAGACATACAGGAAAAAGTATACGGATGGGACTGGGGAGAGCATGGCATACAACAAGGGAAATAATAGGA---GATATAAGAAAAGCATATTGTACCCTTAATGGAACAAATTGGAATAAAACTTTAGAACAGGTAGTTAAAAAGTTAAGAGAACAATTTAGGAAT---AAAACAATAGTCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTAAAGGGTGGTCAGGTAACGATGGAACTAAT------------------AATGGAACTATCACAC [...]
+	'p9c122-15'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAGACCATAATAGTACAGCTGAATGAAACGGTAGTAATTAATTGTACAAGACCCAACAGACATACAGGAAAAAGTATACGGATAGGACTGGGGAGAGCATGGCATACAACAAGGGAAATAATAGGA---GATATAAGAAAAGCATATTGTACCCTTAATGGAACAAATTGGAATAAAACTTTAGAACAGGTAGTTAAAAAATTAAGAGAACAATTTAGGAAT---AAAACAATAGTCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTAAAGGGTGGTCAGGTAACAATGGAACTAAG------------------AATGGAACTATCACAC [...]
+	'p9c122-16'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAGACCATAATAGTACAGCTGAATGAAACGGTAGTAATTAATTGTACAAGACCCAACAGACATACAGGAAAAAGTATACGGATGGGACTGGGGAGAGCATGGCATACAACAAGGGAAATAATAGGA---GATATAAGAAAAGCATATTGTACCCTTAATGGAACAAATTGGAATAAAACTTTAGAACAGGTAGTTAAAAAGTTAAGAGAACAATTTAGGAAT---AAAACAGTAGTCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTAAAGGGTGGTCAGGTAACAATGGAACTAAT------------------AATGGAACTATCACAC [...]
+	'p9c122-17'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAGACCATAATAGTACAGCTGAATGAAACGGTAGTAATTAATTATACAAGACCCATCAGACATACAGGAAAAAGTATACGGATGGGACTGGGGAGAGCATGGCATACAACAAGGGAAATAATAGGA---GATATAAGAAAAGCATATTGTACCCTTAATGGAACAAATTGGAATAAAACTTTAGAACAGGTAGTTAAAAAATTAAGAGAACAATTTAGGAAT---AAAACAATAGTCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTACAGGGTGGTCAGGTAAC---GGAACTAGT------------------AATGGAACTATCACAC [...]
+	'p9c129-02'  ---GAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAGACCATAATAGTACAGCTGAATGAAACGGTAGTAATTAATTGTACAAGACCCAACAGACATACAGGAAAAAGTATACGGATGGGACTGGGGAGAGCATGGCATACAACAAGGGAAATAATAGGA---GATATAAGAAAAGCATATTGTACCCTTAATGGAACAAATTGGAATAAAACTTTAGAACAGGTAGTTAAAAAGTTAAGAGAACAATTTAGGAAT---AAAACAATAGTCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTCCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTACAGGGTGGTCAGGTAACAATGGAACTAGT------------------AATGGAACTATCACAC [...]
+	'p9c129-03'  GAAGAAAAGGTAGTAATTAGATCTGAAAATTTCACGAACAATGTTAAAACCATAATAGTACAGCTGAATGAATCGGTAGCAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACAGATGGGATTTGGGAGAGCATGGCATACAACAGGGGAAATAATAGGA---GATATAAGAAAATCATATTGTACCCTTAATGGAACAAATTGGAATAAAACTTTAGAACAGGTAGTTAGAAAATTAAGAGAACAATTTAGGAAT---AAAACAATAGTCTTTAATCCCTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTGATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTACAGGGTGGTCAGGTAACAATGGAACTAGT------------------AATGGAACTATCACAC [...]
+	'p9c129-08'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAGACCATAATAGTACAGCTGAATGAAACGGTAGTAATTAATTGTACAAGACCCAACAGACATACAGGAAAAAGTATACGGATGGGACTGGGGAGAGCATGGCATACAACAAGGGAAATAATAGGA---GATATAAGAAAAGCATATTGTACCCTTAATGGAACAAATTGGAATAAAACTTTAGAACAGGTAGTTAAAAAGTTAAGAGAACAATTTAGGAAT---AAAACAATAGTCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTACAGGGTGGTCAGGTAAC---GGAACTAGT------------------AATGGAACTATCACAC [...]
+	'p9c129-09'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAGACCATAATAGTACAGCTGAATGAAACGGTAGTAATTAATTGTACAAGACCCAACAGACATACAGGAAAAAGTATACGGATGGGACTGGGGAGAGCATGGCATACAACAAGGGAAATAATAGGA---GATATAAGAAAAGCATATTGTACCCTTAATGGAACAAATTGGAATAAAACTTTAGAACAGGTAGTTAAAAAGTTAAGAGAACAATTTAGGAAT---AAAACAATAGTCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTACAGGGTGGTCAGGTAAC---GGAACTAGT------------------AATGGAACTATCACAC [...]
+	'p9c129-10'  GAAGAAGAGGTAGTAATTAGATCTGAAAATTTCACGAACAATGTTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACAGATGGGATTTGGGAGAGCATGGCATACAACAGGGGAAATAATAGGA---GATATAAGAAAATTATATTGTACCCTTAATGGAACAAATTGGAATAAAACTTTAGAACAGGTAGTTAGAAAATTAAGAGAACAATTTAGGAAT---AAAACAATAGTCTTTAATCCCTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTGATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTACAGGGTGGTCAGGTAACAATGGAACTAGT------------------AATGGAACTATCACAC [...]
+	'p9c129-12'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAGACCATAATAGTACAGCTGAATGAAACGGTAGTAATTAATTGTACAAGACCCAACAGACATACAGGAAAAAGTATACGGATGGGACTGGGGAGAGCATGGCATACAACAAGGGAAATAATAGGA---GATATAAGAAAAGCATATTGTACCCTTAATGGAACAAATTGGAATAAAACTTTAGAACAGGTAGTTAAAAAATTAAGAGAACAATTTAGGAAT---AAAACAATAGTCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTACAGGGTGGTCAGGTAAC---GGAACTAGT------------------AATGGAACTATCACAC [...]
+	'p9c129-15'  GAAGAAGAGGTAGTAATTAGATCTGAAAACTTCACGAACAATGTTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACAGATGGGATTTGGGAGAGCATGGCATACAACAGGGGAAATAATAGGA---GATATAAGAAAATCATATTGTACCCTTAATGGAACAAATTGGAATAAAACTTTAGAACAGGTAGTTGAAAAATTAAGAGAACAATTTGGAAATAATAAAACAATAGTCTTTAATCCCTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATCTTTCTACTGTGATACAACACAGCTGTTTAAT------------------AGTACTTGGAACATTACTACAGGGTGGTCAGGTAACAATGGAACTAGT------------------AATGGAACTATCACAC [...]
+	'p9c129-16'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAGACCATAATAGTACAGCTGAATGAAACGGTAGTAATTAATTGTACAAGACCCAACAGACATACAGGAAAAAGTATACGGATGGGACTGGGGAGAGCATGGCATACAACAAGGGAAATAATAGGA---GATATAAGAAAAGCATATTGTACCCTTAATGGAACAAATTGGAATAAAACTTTAGAACAGGTAGTTAAAAAATTAAGAGGACAATTTAGGAAT---AAAACAATAGTCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTACAGGGTGGTCAGGTAAC---GGAACTAGT------------------AATGGAACTATCACAC [...]
+	'p9c129-17'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAGACCATAATAGTACAGCTGAATGAAACGGTAGTAATTAATTGTACAAGACCCAACAGACATACAGGAAAAAGTATACGGATGGGACTGGGGAGAGCATGGCATACAACAAGGGAAATAATAGGA---GATATAAGAAAAGCATATTGTACCCTTAATGGAACAAATTGGAATAAAACTTTAGAACAGGTAGTTAAAAAATTAAGAGAACAATTTAGGAAT---AAAACAATAGTCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTACAGGGTGGTCAGGTAAC---GGAACTAGT------------------AATGGAACTATCACAC [...]
+	'p9c129-18'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAGACCATAATAGTACAGCTGAATGAAACGGTAGTAATTAATTGTACAAGACCCAACAGACATACAGGAAAAAGTATACGGATGGGACTGGGGAGAGCATGGCATACAACAAGGGAAATAATAGGA---GATATAAGAAAAGCATACTGTACCCTTAATGGAACAAATTGGAATAAAACTTTAGAACAGGTAGTTAAAAAGTTAAGAGAACAATTTAGGAAT---AAAACAATAGTCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTACAGGGTGGTCAGGTAAC---GGAACTAGT------------------AATGGAACTATCACAC [...]
+	'p9c134-01'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAGACCATAATAGTACAGCTGAATGAAACGGTAGTAATTAATTGTACAAGACCCAACAGACATACAGGAAAAAGTATACGGATGGGACTGGGGAGAGCATGGCATACAACAAGGGAAATAATAGGAGGAGATATAAGAAAAGCATATTGTACCCTTAATGGAACAAATTGGAATAAAACTTTAGAACAGGTAGTTAAAAAATTAAGAGAACAATTTAGGAAT---AAAACAATAGTCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTACAGGGTGGTCAGGTAAC---GGAACTAGT------------------AATGGAACTATCACAC [...]
+	'p9c134-02'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAGACCATAATAGTACAGCTGAATGAAACGGTAGTAATTAATTGTACAAGACCCAACAGACATACAGGAAAAAGTATACGGATGGGACTGGGGAGAGCATGGCATACAACAAGGGAAATAATAGGA---GATATAAGAAAAGCATATTGTACCCTTAATGGAACAAATTGGAATAAAACTTTAGAACAGGTAGTTAAAAAATTAAGAGAACAATTTAGGAAT---AAAACAATAGTCTTTAATCCCTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTGATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTACAGGGTGGTCAGGTAATAATGGAACTAGT------------------AATGGAACTATCACAC [...]
+	'p9c134-03'  GAAGAAGAGGTAGTAATTAGATCTGAAAATTTCACGAACAATGTTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACAGATGGGATTTGGGAGAGCATGGCATACAACAGGGGAAATAATAGGA---GATATAAGAAAATCATATTGTACCCTTAATGGAACAAATTGGAATAAAACTTTAGAACAGGTAGTTGAAAAATTAAGAGAACAATTTGGAAATAATAAAACAATAGTCTTTAATCCCTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTGATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTACAGGGTGGTCAGGTAACAATGGAACTAGT------------------AATGGAACTATCATAC [...]
+	'p9c134-05'  GAAGAAGAGGTAGTAATTAGATCAAAAAATTTCACGGACAATACTAAGACCATAATAGTACAGCTGAATGAAACGGTAGTAATTAATTGTACAAGACCCAACAGCCATACAGGAAAAAGTATACGGATGGGACTGGGGAGAGCATGGCATACAACAAGGGAAATAATAGGA---GATATAAGAAAAGCATATTGTACCCTTAATGGAACAAATTGGAATAAAACTTTAGAACAGGTAGTTAAAAAATTAAGAGAACAATTTAGGAAT---AAAACAATAGTCTTTAGTAACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTACAGGGTGGTCAGGTAAC---GGAACTAGT------------------AATGGAACTATCACAC [...]
+	'p9c134-07'  GAAGAAGAGGTAATAATTAGATCTAAAAATTTCACGGACAATACTAAGACCATAATAGTACAGCTGAATGAAACGGTAGTAATTAATTGTACAAGGCCCAACAGACATACAGGAAAAAGTATACGGATGGGAATGGGGAGAGCATGGCATACAACAAGGGAAATAATAGGAGATGATATAAGAAAAGCATATTGTACCCTTAATGGAACAAATTGGAATAAAACTTTAGAACAGGTAGTTAAAAAATTAAGAGAACAATTTAGGAAT---AAAACAATAGTCTTTAGTAACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTACAGGGTGGTCAGGTAAC---GGAACTAGT------------------AATGGAACTATCACAC [...]
+	'p9c134-08'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAGACCATAATAGTACAGCTGAATGAAACGGTAGTAATTAATTGTACAAGACCCAACAGACATACAGGAAAAAGTATACGGATGGGACTGGGGAGAGCATGGCATACAACAAGGGAAATAATAGGA---GATATAAGAAAAGCATATTGTACCCTTAATGGAACAAATTGGAATAAAACTTTAGAACAGGTAGTTAAAAAATTAAGAGAACAATTTAGGAAT---AAAACAATAGTCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAGTATTACTACAGGGTGGTCAGGTAAC---GGAACTAGT------------------AATGGAACTATCACAC [...]
+	'p9c134-09'  GAAGAAGAGGTAGTAATTAGATCAAAAAATTTCACGGACAATACTAAGACCATAATAGTACAGCTGAATGAAACGGTAGTAATTAATTGTACAAGACCCAACAGACATACGGGAAAAAGTATACGGATGGGACTGGGGAGAGCATGGCATACAACAAGGGAAATAATAGGA---GATGTAAGAAAAGCATATTGTACCCTTAATGGAACAAATTGGAATAAAACTTTAGAACAGGTAGTTAAAAAATTAAGAGAACAATTTAGGAAT---AAAACAATAGTCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTGATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTACAGGGTGGTCAGGTAAC---GGAACTAGT------------------AATGGAACTATCACAC [...]
+	'p9c134-11'  GAAGAAGAGGTAGTAATTAGATCTGAAAATTTCACGAACAATGTTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACAGATGGGATTTGGGAGAGCATGGCATACAACAGGGGAAATAATAGGA---GATATAAGAAAATCATATTGTACCCTTAATGGAACAAATTGGAATAAAACTTTAGAACAGGTAGTTAGAAAATTAAGAGAACAATTTGGAAATAATAAAACAATAGTCTTTAATCCCTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTGATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTACAGGGCGGTCAGGTAACAATGGAACTAGT------------------AATGGAACTATCACAC [...]
+	'p9c134-19'  GAAGAAGAGGCAGTAATTAGATCAAAAAATTTCACGGACAATACTAAGACCATAATAGTACAGCTGAATGAAACGGTAGTAATTAATTGTACAAGACCCAACAGCCATACAGGAAAAAGTATACGGATGGGACTGGGGAGAGCATGGCATACAACAAGGGAAATAATAGGAGGAGATATAAGAAAAGCATATTGTACCCTTAATGGAACAAATTGGAATAAAACTTTAGAACAGGTAGTTAAAAAATTAAGAGAACAATTTGTGAAT---AAAACAATAGTCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTACAGGGTGGTCAGGTAACAATGGAACTAGT------------------AATGGAACTATCACAC [...]
+	'p9c134-20'  GAAGAAGAGGTAGTAATTAGATCAAAAAATTTCACGGACAATACTAAGACCATAATAGTACAGCTGAATGAAACGGTAGTAATTAATTGTACAAGACCCAACAGACATGCAGGAAAAAGTATACGGATGGGAATGGGGAGAGCATGGCATACAACAAGGGAAATAATAGGAGATGATATCAGAAAAGCATATCGTACCCTTAATGGAACAAATTGGAATAAAACTTTAGAACAGGTAGTTGAAAAATTAAGAGAACAATTTGGAAATAATAAAACAATAGTCTTTAATCCCTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTGATACAACACAGCTGTTTAAT------------------AGTACTTGGAATATTACTACAGGGTGGTCAGGTAACAATGGAACTAGT------------------AATGGAACTATCACAC [...]
+	'p9c104-03'  GAAGAAGAGGTAATAATTAGATCTAAAAATTTCACGGACAATACTAAAACCATAATAGTACAGCTGAATGAATCAGTAGTAATTAATAGTACAAGACCCAACAACAATACAAGAAAAAGTATACAGATGGGACTGGGGAGAGCATGGCATACAACAGGGGAAATAATAGGA---GATATAAGACGAGCATATTGTACCCTTAATGAAACAAATTGGAATAAAACTTTAGAACAGGTAGTTAAAAAATTAAGCGAACAATTTAGGAAT---AAAACAATAGTCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGCTTTAACTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAATAGTACTTGGGGTGTTAATAGTACTTGGAC----------TGGAGAGCAGGTAACAATGGA------------------------------ACTATCACAC [...]
+	'p9c104-08'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACAGATGGGACTGGGGAGAGCATGGCATACAACAGGGGAAATAATAGGA---GATATAAGACGAGCATATTGTACCCTTAATGAAACAAATTGGAATAAAACTTTAGAACAGGTAGTTAAAAAATTAAGCGAACAATTTAGGAAT---AAAACAATAGTCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAACTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAATAGTACGTGGGGTGTTAATAGTACTTGGAC----------TGGAGAGCAGGTAACAATGGA------------------------------ACTATCACAC [...]
+	'p9c104-11'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAACACTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACAGATGGGACTGGGGAGAGCATGGCATACAACAGGGGAAATAATAGGA---GATATAAGAAAAGCATATTGTACCCTTAATGAAACAAATTGGAATAAAACTTTAGAACAGATAGTTAAAAAATTAAGAGAACAATTTGGAAATAATAAAACAATAGCCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAGTACAACAAAGCTGTTTGATAGTACTTGGGTTGTTAATGGTACTTGGAC----------TGGAGAGCAGGTAACAATGGA------------------------------ACTATCACAC [...]
+	'p9c111-04'  GAAGAAGAGGTAGTAATTAGATCTAAAAATTTCACGGACAATACTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACAGATGGGACTGGGGAGAGCATGGCATACAACAGGGGAAATAATAGGA---GATATAAGACGAGCATATTGTACCCTTAATGAAACAAATTGGAATAAAACTTTAGAACAGGTAGTTAAAAAATTAAGAGAACAATTTAGGAAT---AAAACAATAGTCTTTACTCAATCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAATCTGTTTAATAGTACTTGGGGTGTTAATAGAACTTGGAC----------TGGAGGGCAGGTAACAATGGA------------------------------ACTATCACAC [...]
+	'p9c111-20'  GAAGAAGAGGTAGTAATTAGATCAAAAAATTTCACGGACAATACTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACAGATGGGACTGGGGAGAGCATGGCATACAACAGGGGAAATAATAGGA---GATATAAGACGAGCATATTGTACCCTTAATGAAACAAATTGGAATAAAACTTTAGAACAGGTAGTTAAAAAATTAAGAGAACAATTTAGGAAT---AAAACAATAGTCTTTACTCAATCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAATCTGTTTAATAGTACTTGGGGTGTTAATAGAACTTGGAC----------TGGAGGGCAGGTAACAATGGA------------------------------ACTATCACAC [...]
+	'p9c117-15'  GAGGAAGAGGTAGTAATTAGATCTGAAAATTTCACGAACAATGTTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACAGATGGGATTTGGGAGAGCATGGCATACAACAGGGGAAATAATAGGA---GATATAAGACAAGCATATTGTACCCTTAATGAAACAAATTGGAATAAAACTTTAGAACAGGTAGTTGAAAAATTAAGAGAACAATTTGGAAATAATAAAACAATAGCCTTTGATCACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAGTACAACAAAGCTGTTTAATAGTACTTGGGATGTTAATGGTACTTGGAC----------TGGAGAGCAGGTGACAATGGA------------------------------ACTATCACAC [...]
+	'p9c117-16'  GAAGAAGAGGTAATAATTAGATCTAAAAATTTCACGGACAATACTAAAACCATAATAGTACAGCTGAATGAATCAGTAGTAATTAATTGTACAAGACCCAACAACAATACAAGAAAAAGTATACAGATGGGACTGGGGAGAGCATGGCATACAACAGGGGAAATAATAGGA---GATATAAGACGAGCATATTGTACCCTTAATGAGACAAATTGGAATAAAACTTTAGAACAGGTAGTTAAAAAATTAAGCGAACAATTTAGGAAT---AAAACAATAGTCTTTAATCACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAACTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAATAGTACTTGGGGTGATAATAGTACTTGGAC----------TGGAGAGCAGGTAACAATGGA------------------------------ACTATCACAC [...]
+	'p9c129-04'  GAAGAAGAGGTAGTAATTAGATCTGAAAATTTCACGAACAATGTTAAAACCATAATAGTACAGCTGAATGAATCGGTAGTAATTAATTGTACAAGACCTAACAACAATACAAGAAAAAGTATACAGATGGGATTTGGGAGAGCATGGCATACAACAGGGGAAATAATAGGA---GATATAAGAAAAGCATATTGTACCCTTAATGGAACAAATTGGAATAAAACTTTAGAACAGGTAGTTAAAAAATTAAGAGAACAATATAGGAAT---AAAACAATAGCCTTTACTCACTCCTCAGGAGGGGACCTAGAAATTACAATGCACAGTTTTAATTGTGGAGGGGAATTTTTCTACTGTAATACAACAAAGCTGTTTAATAGTACTTGGGGTGTTAATAATACTTGGAC----------TGGAGAGCCGGTGACAATGGA------------------------------ACTATCACAC [...]
+
+;
+End;
+
+BEGIN CALIBRATION;
+	OPTIONS SCALE = months;
+		
+	TIPCALIBRATION
+		003 = 003:p9c003-01,
+		003 = 003:p9c003-04,
+		003 = 003:p9c003-09,
+		003 = 003:p9c003-11,
+		003 = 003:p9c003-364,
+		003 = 003:p9c003-367,
+		003 = 003:p9c003-368,
+		003 = 003:p9c003-369,
+		003 = 003:p9c003-371,
+		009 = 009:p9c009-03,
+		009 = 009:p9c009-07,
+		009 = 009:p9c009-14,
+		009 = 009:p9c009-384,
+		009 = 009:p9c009-390,
+		009 = 009:p9c009-392,
+		009 = 009:p9c009-393,
+		017 = 017:p9c017-01,
+		017 = 017:p9c017-02,
+		017 = 017:p9c017-04,
+		017 = 017:p9c017-05,
+		017 = 017:p9c017-06,
+		017 = 017:p9c017-13,
+		017 = 017:p9c017-16,
+		017 = 017:p9c017-407,
+		017 = 017:p9c017-409,
+		039 = 039:p9c039-02,
+		039 = 039:p9c039-03,
+		039 = 039:p9c039-04,
+		039 = 039:p9c039-05,
+		039 = 039:p9c039-07,
+		039 = 039:p9c039-09,
+		039 = 039:p9c039-10,
+		039 = 039:p9c039-18,
+		039 = 039:p9c039-299,
+		039 = 039:p9c039-300,
+		063 = 063:p9c063-01,
+		063 = 063:p9c063-02,
+		063 = 063:p9c063-04,
+		063 = 063:p9c063-05,
+		063 = 063:p9c063-06,
+		063 = 063:p9c063-07,
+		063 = 063:p9c063-09,
+		063 = 063:p9c063-10,
+		063 = 063:p9c063-11,
+		063 = 063:p9c063-12,
+		063 = 063:p9c063-13,
+		063 = 063:p9c063-16,
+		086 = 086:p9c086-02,
+		086 = 086:p9c086-03,
+		086 = 086:p9c086-05,
+		086 = 086:p9c086-08,
+		086 = 086:p9c086-10,
+		086 = 086:p9c086-11,
+		086 = 086:p9c086-12,
+		086 = 086:p9c086-17,
+		086 = 086:p9c086-19,
+		086 = 086:p9c086-20,
+		104 = 104:p9c104-02,
+		104 = 104:p9c104-05,
+		104 = 104:p9c104-09,
+		104 = 104:p9c104-10,
+		104 = 104:p9c104-12,
+		104 = 104:p9c104-14,
+		111 = 111:p9c111-02,
+		111 = 111:p9c111-05,
+		111 = 111:p9c111-07,
+		111 = 111:p9c111-08,
+		111 = 111:p9c111-10,
+		111 = 111:p9c111-11,
+		111 = 111:p9c111-16,
+		111 = 111:p9c111-18,
+		117 = 117:p9c117-02,
+		117 = 117:p9c117-03,
+		117 = 117:p9c117-06,
+		117 = 117:p9c117-07,
+		117 = 117:p9c117-09,
+		117 = 117:p9c117-11,
+		117 = 117:p9c117-12,
+		117 = 117:p9c117-13,
+		122 = 122:p9c122-03,
+		122 = 122:p9c122-06,
+		122 = 122:p9c122-07,
+		122 = 122:p9c122-09,
+		122 = 122:p9c122-10,
+		122 = 122:p9c122-11,
+		122 = 122:p9c122-12,
+		122 = 122:p9c122-15,
+		122 = 122:p9c122-16,
+		122 = 122:p9c122-17,
+		129 = 129:p9c129-02,
+		129 = 129:p9c129-03,
+		129 = 129:p9c129-08,
+		129 = 129:p9c129-09,
+		129 = 129:p9c129-10,
+		129 = 129:p9c129-12,
+		129 = 129:p9c129-15,
+		129 = 129:p9c129-16,
+		129 = 129:p9c129-17,
+		129 = 129:p9c129-18,
+		134 = 134:p9c134-01,
+		134 = 134:p9c134-02,
+		134 = 134:p9c134-03,
+		134 = 134:p9c134-05,
+		134 = 134:p9c134-07,
+		134 = 134:p9c134-08,
+		134 = 134:p9c134-09,
+		134 = 134:p9c134-11,
+		134 = 134:p9c134-19,
+		134 = 134:p9c134-20,
+		104 = 104:p9c104-03,
+		104 = 104:p9c104-08,
+		104 = 104:p9c104-11,
+		111 = 111:p9c111-04,
+		111 = 111:p9c111-20,
+		117 = 117:p9c117-15,
+		117 = 117:p9c117-16,
+		129 = 129:p9c129-04
+		;
+END;
+
+Begin RHINO;
+	NUCMODEL TYPE=HKY;
+	TREEMODEL TYPE=TIPDATES;
+	SITEMODEL TYPE=HOMO;
+End;
+
diff --git a/examples/nexus/angiosperms.nex b/examples/nexus/angiosperms.nex
new file mode 100644
index 0000000..2c8fcf4
--- /dev/null
+++ b/examples/nexus/angiosperms.nex
@@ -0,0 +1 @@
+#NEXUS

[!Data from:
	Young, D. A. 1981. Are the angiosperm primitively vesselless?
		Systematic Botany. 6:313-330.
    Character 9 coded "0" for OTU AUST, following Riggins and Farris (1983)
]

begin taxa;
	dimensions ntax=34;
	taxlabels
ANCEST    ANNO      AMBO      ARIS      AUST      CALY      
CANE      CHLO      DEGE      EUPO      GOMO      GYRO      
HERN      HIMA      IDIO      ILLI      LACT      LAUR      
MAGN      MONI      MYRI      PIPE      SARC      SAUR      
SCHI      TRIM      WINT      TETR      TROC      CERC      
CABO      CERA      NYMP      NELU      
	;
end;

begin characters;
	dimensions nchar=41;
	format symbols = "012";
	matrix
ANCEST    00000000000000000000000000000000000000000
ANNO      00010000001010102001000110010000000022022
AMBO      00000000011210002000000100002200000022100
ARIS      10010000011010111111010102212000000000022
AUST      10200000001000000000000000010000000000000
CALY      00210000001001000001000100010200011002022
CANE      00000000001010101011100002011000000022001
CHLO      00201000111111210010011100102210100122000
DEGE      00000000001001101000000000002000000000000
EUPO      00000000001001210000000000210000000022000
GOMO      00200000001020002101001102212200010022001
GYRO      00000000011120002101001100212200011002022
HERN      01000000011120002101001100212200011002022
HIMA      00000000001011102110000000011200000000022
IDIO      00200000001001000000001100002200001002022
ILLI      00001000001001000001000200010200000000000
LACT      00000000101101002100001020002100000000021
LAUR      00110000011120002111011100112200011022011
MAGN      00010000101102100000000000010000000011000
MONI      00200100001110100001000110110200000002011
MYRI      00000000001220112111100000012200000020011
PIPE      20110000111120210001001002012210101122022
SARC      10201000111000210000011100002200000022100
SAUR      20020000111020210001001001112210001101022
SCHI      10021000001200000001100200000200000022000
TRIM      00110100001120112101001100002200000022000
WINT      00000000001121100001000011000000000011100
TETR      00021000111020112101001201012100000000100
TROC      00221000011020210001000200010000000000100
CERC      00221000100210112101000200012000000000001
CABO      20010000010000102101000000011200011101100
CERA      20211000010200210001000100012210211002100
NYMP      20020000010002100000000012110000001120100
NELU      20020000110002000001000200000200011002000
	;
end;

begin assumptions;
	options deftype = ord;
end;
\ No newline at end of file
diff --git a/examples/nexus/anolis.nex b/examples/nexus/anolis.nex
new file mode 100644
index 0000000..e64ad44
--- /dev/null
+++ b/examples/nexus/anolis.nex
@@ -0,0 +1,37 @@
+#NEXUS 
+
+Begin data;
+	Dimensions ntax=29 nchar=1456;
+	Format datatype=dna gap=-;
+	Matrix
+Anolis_ahli          ATGAGCCCAATAATATACACAATTATACTATCAAGCCTAGCAACAGGCACTATCGTTACCATAACGAGCTACCACTGACTCCTAGCCTGAATCGGACTAGAAATAAACACTTTATCAATTATTCCAATTATTTCTACCATACACCACCCACGATCAACAGAGGCCGCCACAAAATACTTTTTAACACAAGCAGCGGCTTCTGCCATAATCTTGTTTTCAAGCATAATTAACGCCTGACAAACCGGATCATGGGATATTACTCAATTATCATCTACACCATCACACATTCTATTAACCATGGCATTAGCAATAAAACTGGGCCTAGTCCCAGTACATTTTTGACTACCAGAAGTTATTCAGGGTTCAACAATAACCACGGCACTCATTATTACCACATGACAAAAACTTGCCCCAATTTCCCTAATTTATTTATCTATTAATAACCTCTCAACAGTGGTCCTAATAACCATG [...]
+Anolis_aliniger      ATGAGCCCTACAGTTTATTCAATTATTTTGTCAAGCCTACCAACAGGCACAGTTATTACTATAACCAGCTACCATTGATTAATAGCCTGAGTCGGGCTAGAAATTAACACACTCGCAATTATTCCTGTTGTTTCAATACAACATCACCCACGGTCCACAGAAGCCGCCACAAAATATTTTCTAACACAAGCAGCAGCCTCCGCCTTAATTCTATTTGCTAGCACAACTAACGCCTGATCAACGGGCACATGAGATATTACCCAAATATCCTCTACCCCCTCTCATATCCTTTTAACTATCGCGCTTGCTATAAAACTAGGCCTAGCACCCACCCACTTCTGATTACCAGAAGTAGTTCAAGGTTCAACTATAACAACAGCGTTTATTATTATAACATGGCAAAAACTAGCCCCAATATCATTAATTTATTTAACCATAAATAATCTTTCCCCAACAATTCTTCTTCTATTA [...]
+Anolis_alutaceus     ATGAACCCAACAATTATTATAATTACCCTAACCAGCCTGGCAACTGGTACAGTTATTACCATACATAGCTTCCATTGATTAATGGCCTGA?TCGGATTAGA?ATCAATACACTATCAATTATTCCAATAATTTCAACATTACACCACCCACGATCAACTGAAGCTGCTACAAAATATTTCCTCACCCAAGCAGCTGCTTCA?CTTTAATCCTTTTTTCAAGCACAATTAATGCCTGACAAACAGGATCATGAGACATTACCCAACTATCATCAACCCCCTCACACATTTTATTAACTATGGCTTTGGCCATAAAACTAGGACTCGCCCCACTTCACTTTTGATTACCAGAAGTAATTCAAGGGTCTTCCATAAACACAGCCTTAATTATTGT?ACTTGACAAAAACTAGCCCCAATATCCCTAATCTTTTTAACCATAAATAATTTATCAACAACTATTTTAATGATAATA [...]
+Anolis_angusticeps   ATGAGCCCCCCCATTTTTACAATTATCATCTCAAGTCTAGCAACAGGTACAATTATTACCATAACCAGCTACCATTGACTCATAGCCTGAGTTGGTCTAGAAATAAATACACTAGCAATTATTCCTATTATTTCAACAACACATCACCCACGAGCCACAGAAGCTTCCACAAAATATTTTCTTACACAAGCTGCAGCCTCTGCTCTAATTTTATTTTCTAGTATAATTAACGCATGACACACAGGATCTTGAGACATTACTCAAATATTATCTACCCAATCAAATACTATATTGACTATAGCCCTAGCTATAAAACTAGGGCTGGCCCCACTTCACTTTTGACTACCAGAAGTAATCCAAGGATCAACAATACTAACCGCCTTTATTATTACTACATGACAAAAACTAGCCCCAATATCTCTAATTTTTTTAACTATAAATAATATATCCACAACAATCCTCCTACTAATA [...]
+Anolis_bahorucoensis ATGAGCCCCATAATTTACTCAATTGTATTCTCAAGCCTAGC?ACAGGTACTATTATTACTATAACCAGCTACCACTGATTTATGGCCTGAATCGGACTAGAAATTAATACACTAGCAGTAATCCCCATTATTTCAACACTACACCACCCACGATCTACAGAAGCTGCTACAAAATACTTCTTAACACAAGCAGCAGCCTCCGCCACAATCCTATTTTCAAGTATAATTAATGCCTGACAAACAGGCACATGAGATATTACCCAATTATCCACAACCCCCGCCCACATCCTACTGACTATAGCACTTGCCATAAAACTAGGCCTAGTCCCAGCCCATTTCTGACTACCAGAAGTCCTCCAAGGTTCAACCATTACAACTGCCCTCATTATTACTACATGACAAAAACTCGCTCCAATATCACTAATTTTCTTAACCATTAACAACCTGTCCTCAACAGCCCTTCTATTATTA [...]
+Anolis_barahonae     ATGAGCCCGCTAATTTATATGATTATTTTATCAAGCTTAGCAACAGGCACAATTATTACAATAACGAGTTTTCATTGAATTATAGCTTGAATTGGGTTAGAAATCAACACCTTAGCAATTATCCCAATTATTTCTATATTACACCACCCACGTTCTACTGAAGCAGCCACAAAATATTTTCTTACACAAGCAGCAGCATCCGCTATAATCCTATTTTCAAGTATAATTAATGCCTGACAAACAGGAACATGAGATATCACTCAAATAACTAATATCCAATCCAACATTCTATTAACAATAGCACTT?CCATAAAATTAGGTCTAGCACCACTACATTTCTGACTTCCAGAAGTATTACAAGGCTCAACCTTAAATACCGCCCTTATTATAATTACATGACAAAAGCTAGCCCCAATATCATTAATTTTTATAACCATTAATAACTTATCGACAACAATACTATTATTACTA [...]
+Anolis_brevirostris  ATGAGCCCACTAATCCACACAATTATACTCTCAAGTCTAGCAACAGGCACTATTATTACTATATCTAGCCACCACTGACTAATAGCCTGAATTGGATTAGAAATTAACACACTAGCAATTATCCCCATCATTTCAACATCCCACCACCCACGATCAACAGAAGCTGCCACAAAATATTTCCTTACACAAGCAGCAGCCTCTGCCACCGTACTATTTTCTAGTATAATTAATGCCTGACAAACCGGAACATGAGACATCACTCAAATATCTTATGCACCATCCAACATACTTTTAACTATAGCACTCTCCATAAAGCTCGGACTAGCCCCGCTACACTTCTGACTTCCAGAGGTTCTTCAAGGCTCAACCCTACCCACCGCCCTCATTATTACCACATGGCAAAAACTAGCCCCTATAGCACTAATCTGCCTAACAATTAATAATCTTAACCCAGCAATCCTACTAATCTTA [...]
+Anolis_coelestinus   ATGAGCCCACTAATTTTTTCAATCGTCCTGTCAAGCCTAGCAACAGGCACTATTATTACCATAACCAGCTATCACTGATTAATAGCTTGAATTGGTCTAGAAATAAACACACTTGCTATTATTCCAATTATCTCAATACAACATCACCCTCGATCTACAGAAGCCGCTACAAAATATTTCCTTACACAAGCAGCAGCCTCCGCTATGATTTTATTCGCCAGCACAACAAATGCTTGATACACAGGCACATGAGACATCACTCAAATTTCCGCCACCCCATCCCACATCCTCCTAACTGCCGCATTAGCCATAAAACTAGGCCTAGCCCCTATACACTTCTGATTACCAGAAGTCCTTCAAGGGTCCACCTTAAAAACAAGCTTTATTATTGTCACATGACAAAAACTAGCCCCTATATCATTAATTTATTTAACTATAAATAATCTTTCCTCAACAATTCTTCTCTCACTA [...]
+Anolis_cristatellus  ATGAGC???ACAATCTACACAATTATTTTGT?????CTAGCAACAGGCACTATCATCACTATAACTAGCTTCCACTGACTAATGGCCTGAATCGGACTAGAGCTTAATACGCTAGCAATTATCCCGATTATTTCAACATTACACCACCCACGATCAACAGAAGCCGCAACAAAATACTTCTTAACACAAGCAGCAGCCTCTGCAATAATTATGTTTTCTAGCATAATTAATGCCTGAAACATAGGAACATGGGACATTACTCAAATATCTTATACCCCATCAAATGTTCTTCTTTTACTAGCACTGGCCCTAAAACTAGGACTAGCCCCAGCACACTTCTGACTCCCAGAGGTATTACAGGGCTCAACCTTATTTATTGCCCTCATTATTACTACGTGGCAAAAACTGGCCCCAATGTCACTTATCTACATATGTACAAATAATCTTCCATCAGTAATTTTATTAATACTA [...]
+Anolis_cuvieri       ATGAGCCCAACAATTCTCTCAATCATTTTATCAAGCCTAGCAGCAGGAACAATTATTACAATAACAAGCTTTCATTGATTAATAGCCTGAATTGGACTAGAAATTAATACACTAGCAATTATTCCAATTATCTCAATAATACATCACCCACGATCTACAGAAGCAGCCACAAAATATTTTCTCACACAAGCAGCAGCATCAGCTATAATCCTGTTCTCAAGCATAATTAATGCTTGACAAACAGGGACATGAGATATTACCCAAATATATACTCCTCAATCTAACATTTTATTAACTATAGCCCTTGCCATAAAAATAGGATTAGCCCCAATACACTTCTGACTACCAGAAGTACTTCAAGGTTCAACCTTAAACGCTGCTCTTATTATTACCACATGACAAAAAATCGCCCCAATGTCATTAATTTATTTAACCATTAATAATTTATCAACAACAACCTTATTAACACTA [...]
+Anolis_distichus     ATGAGCCCGCCAATCTACGCAATTATACTATCAAGCTTAGCAACAGGCACCATTATCACTATAACCAGTTACCATTGACTAATGGCCTGAATTGGACTAGAAATTAATACACTAGCAATTCTTCCAATTATTGCAACATCACACAACCCACGATCCACAGAAGCTGCCACAAAATACTTTTTAACACAATCAGCAGCTTCCGCCACTATCTTATTTTCTAGCATACTTAACGCCTGACAAACCGGAACATGAGACATTACTCAAATATCTTATGCGCCATCTAACCTCCTTCTCTCCATAGCACTAGCCATAAAACTAGGACTAGCCCCCCTACACTTTTGACTCCCAGAAGTACTTCAAGGCTCAACTTTATTTTCTGCCCTCATTATTGTTACATGACAAAAATTAGCCCCAATATCACTGATTTATTTAACTATTAGTAACCTTAACCCAACTATTCTACTAATCTTA [...]
+Anolis_equestris     ATGAGCCCAACAATTTATTCAATTATCCTATCAAGCCTTGCAA?????ACAATTATTACTATAACCAGCCACCATTGACTAATAGCCTGA?TCGGATTAGAAATTAACACATTAGCAATTATCCCAATTATTTCAACATTACACCACCCACGATCCACAGAAGCCGCCACAAAATATTTCCTAACACAAGCAGCTGCTTCTGCTATAATTTTATTTTCTAGCATAACAAATGCTTGATACACAGGTACATGAGACATTACCCAAATATCAGCCAACCCCTCCCATATTATATTAACTATGGCACTTGCCATAAAACTAGGCCTAGCACCTCTACACTTCTGACTACCAGAAGTACTCCAAGGCTCAACCATAAAAACCGCATTCATCATTACAACATGACAAAAACTTGCCCCAATATCATTAATCTACCTCATTATTAATAACTTATCCCCCACACTTCTCCTCCTATTA [...]
+Anolis_garmani       ATGAGCCCAACCATCCTTATAATTATTATCTCAAGCCTGGCAACAGGTACCATTATTACCATAACAAGCCACCACTGACTCATAGCCTGAATCGGACTAGAAATAAATACCTTAGCTATTATTCCAATCATTACTACTATACACAACCCACGATCAACAGAAGCCGCCACAAAATACTTCTTAACACAAGCAGCAGCCTCTGCCATAATCTTATTCTCAAGCATAATTAATGCCTGACAAATAGGATCATGAAATATTATTAACTTAACATACGAACCCGCGCACATCCTATTAATTATGGCCCTAGCAATAAAACTTGGCCTCGCACCCATACACTTTTGACTGCCAGAAGTTCTTCAAGGCTCAACCTTAACCACTGCACTAATTATTACCACTTGACAAAAACTCGCCCCAATATCTTTAATTTATATAACCCTAAACAATCTATCGACCACAATTTTAATTTTACTC [...]
+Anolis_grahami       ATGAGCCCATCAATCCTTATAATTATTATTTCAAGCCTGGCAACAGGCACTATTATTACTATAACAAGCCACCACTGACTTATAGCCTGAGTCGGACTAGAAATAAATACTTTGGCAATTATCCCAATTATTTCTACTACACACAGCCCGCGATCCACAGAAGCCGCTACAAAATATTTTTTAACACAAGCAGCTGCCTCTACCATAATCTTATTTTCAAGCATAACCAACGCCTGACAAACAGGCACATGAGACATTATTAACTTAACATATGAGCCCGCGCACATCCTGCTAACCCTGGCCCTAGCAATAAAACTAGGCCTTGCACCTATACACTTCTGA?TACCAGAAGTATTACAAGGCTCAACCTTAACCACTGCACTAATTATTACCACTTGACAAAAACTAGCCCCAATATCCTTAATTTATATGACCCTAAACAACCTGTCAACCACAACTTTAATCTTACTA [...]
+Anolis_insolitus     ATGAACCCAACTATTCTTACATTAATTTTATCAAGCTTAGCAACAGGTACAATCCTTACAATAATCAGCTTTCACTGACTACTCGCATGAATTGGTCTAGAGATTAATACCCTAGCAATTATTCCTATTATCTCAGCACCTCACCACCCCCGACCCACAGAAGCCTCCACAAAATATTTCCTTACACAAGCAGCTGCTTCTGCTACAATCTTATTTTCAAGCATAATTAATGCTTGACTAACAGGCACATGAAACATTACCCAAATATCCTCTACTCCCGCTAATATTCTTCTAACCCTAGCACTAGCAATAAAACTAGGACTTGCCCCCACACACTTCTGACTACCAGAAGTGCTTCAAGGCTCAACTATAAACACAGCCCTCATTATTCATACATGACAAAAACTTGCCCCAATGTCACTGATTTACTTAACAGTAAATAACTTATCCCCTACAATTCTATTATCCCTG [...]
+Anolis_krugi         ATGAGCCCTGCAATTTACACAATTATATTATCAAGCTTGGCAACAGGCACTATCATCACTATAACAAGCTTCCACTGACTAATAGCCTGAGTTGGACTAGAACTTAATACATTAGCAATTATCCCAATTATTTCAACATTACACCACCCCCGGGCCACAGAAGCCTCAACAAAGTATTTCCTCACTCAAGCAGCAGCCTCTGCCATAATTTTATTTTCTAGCATAATTAATGCCTGACACACGGGAACATGGGACATTACTCAAATATCTTACACCCCCTCCAACATCATTTTAACAATAGCACTAGCCATAAAGCTAGGACTTGCCCCAATGCACTTTTGACTTCCAGAAGTCCTACAAAACTCAACCCTTATTACTGCTTTTATTATTTCTACATGACAAAAACTTGCCCCAATATCACTAGTCTACTTGACTATTAATAACCTTCCACCAATAATTCTGCTTACCCTA [...]
+Anolis_lineatopus    ATGAGCCCTGCTATCTTTTCAATTGTCATATCCAGCCTAGCAACAGGCACTATTATTACCATAACAAGCCACCACTGACTATTAGCCTGAATAGGGTTAGAAATAAATACCCTAGCAATTATTCCAATTATTTCTATTACCCACAACCCCCGAGCCACAGAAGCCGCCACAAAGTACTTCTTAACACAAGCAGCAGCCTCAGCCATAGTTTTATTTGCAAGCATAACTAATGCTTGACAAACAGGAACATGAGATATTACTAGCCTATCATATATGCCCTCACATATTTTATTAACTATAGCATTAGCTATAAAACTAGGGCTTGCCCCAATGCACTTCTGACTACCAGAAGTGCTACAAGGAACAGCCCTACCAACTTCACTTATTATTACTACTTGACAAAAACTTGCCCCAATGTCCCTAATTTATATAACTATTAATAGTTTATCAACCATAATTCTAAT?TCACTA [...]
+Anolis_loysiana      ATGAACCCAGTCGTTATT???ATTCTTCTATCAAGCCTAGCAACTGGTACTATTATTACTATAACTAGCTATCACTGATTAATAGCCTGAGTTGGACTAGAAATAAACACATTAGCAATTATTCCAATCATTTCAACAACTCACCACCCACGAGCCACAGAAGCAGCCACAAAATACTTCTTAACCCAAGCTGCAGCCTCCGCCCTAATCTTATTTTCAAGTACAATTAATGCTTGATACTCAGGCTCATGAAATATTACCCAAATACTAACCTTCCCATCACACATTCTCTTAGCCATAGCACTGGCCATAAAATTAGGCCTAGCCCCACTTCACTTCTGACTACCAGAAGTTATTCAAGGATCAACCATAATTACTGCATTT?TTATTACCACATGACAAAAACTAGCCCCTATGTCTCTTATTTTCATAACCTCAAACAATATGCCCACAACAATCTTTCTGCTTATA [...]
+Anolis_luteogularis  ATGAGTCCAACAATTTATTCAATTATTCTATCAAGCCTTGCAACAGGTACAATTATTACTATAACCAGCTACCATTGACTAATAGCCTGAGTCGGATTAGAAATTAACACATTAGCAATTATCCCAATTATTTCAACATTACACCATCCACGATCCACAGAAGCAGCCACAAAATACTTCCTAACACAAGCAGCTGCTTCTGCTATAATTTTATTTTCTAGCATAACAAATGCTTGATACACAGGTACATGAGACATTACCCAAATATCAGCTAACCCCTCCCATATTATATTAACCATAGCGCTTGCCATAAAACTAGGCCTAGCACCTCTACACTTCTGACTACCAGAAGTACTCCAAGGCCTAACCATAAAAACCGCATTCATCATTACAACATGACAAAAACTTGCCCCAATATCATTAATTTACCTCATTATTAATAACCTATCACCTATACTTCTCCTCCTATTA [...]
+Anolis_marcanoi      ATGAGCCCAACAATTTTTTCAATTATGCTATCGAGTCTAGCAACAGGCACCATTATTACTATAACAAGCTTTCACTGACTAATGGCCTGAGTCGGCTTAGAAATTAATACGCTAGCTGCTATTCCAATTATTTCAATACAACACCACCCTCGATCAACAGAAGCAGCCACAAAATACTTTTTAACACAAGCAACTGCATCCTCCTTAATTTTATTTTCAAGTATGATTAATGCTTGGCATACAGGAACATGAGACATTACTCAAATTTCAACTACCCAATCATGCACCCTTCTTACAATAGCAATCTCAATAAAGCTAGGCTTAGCCCCACTACACTTCTGACTACCAGAGGTTCTCCAAGGTTCAACAATATTTACTGCTTTAATTATTATAACATGACAGAAACTAGCCCCCATATCCCTACTTTTCCTCACTATAAACAACCTATCCACATCAATACTCTTAACAATT [...]
+Anolis_occultus      ATGAGCCCCAATAATCTACTTAATAGTTTAATTAGCTTATTTATA???ACAACACTAGTAACCACTAGCCACCACTGATTATTAGCGTGAGTTGGCTTGGAAATTAACACACTTGCAGCTATTCCACTTATCTCAACAAAACATCACCCCCGAGCTACAGAATCAGCCACAAAATACTTTTTAATTCAAGCAGCAGCCTCAGCTACAATCTTATTTTCAAGTACCATTAATGCTTGACACACAGGCTCATGAGACATTACCCAAATAACCACAAACCCATCCAATATTTTACTAACTATAGCCCTTGCCATAAAACTAGGCCTAGCCCCAACACACTTCTGACTCCCAGAAGTACTTCAAGGGTCAACTATAGACACTGCCCTAATTATTACAACATGACAAAAAATTGCCCCAATAACCCTAATTTACCTCACCATAAACAACCTATACCCAAGCATTCTAATAACAATA [...]
+Anolis_olssoni       ATGAACCCCACCATCTCCATAAATTATCTATCAAGCCTAGCAACAGGAACAATTATTACTATGACCAGCTTTCATTGATTAATAGCATGAATTGGATTAGAAGTCAACACACTAGCAATTATTCCAATCATCTCAGCCCCTCACCACCCACGATCAACAGAAGCTGCAACAAAATACTTTCTCACACAAGCAGCTGCCTCCGCTATAATTCTATTTGCCAGTATAATTAACGCCTGACAAACAGGCACATGAGACATTACTCAACTGTCAACCACCCCTGCCCACACCCTCCTAACTATAGCACTAGCCATAAAACTAGGACTTGCCCCACTTCACTTCTGATTACCAGAAGTTATTCAAGGTGCCACCCTTCCCACTGCTTTCATCATTGTAACATGGCAAAAACTTGCTCCTATATCACTTATTTTTTTAACCATAAACAACCTAAACCCAACAATTTTACTTCTCCTT [...]
+Anolis_ophiolepis    ATGAGCCCAACAATCTTTATAATTATTTTATCAAGTCTTGCAACTGGTACAATTATTACTATAACTAGTTATCACTGACTATTAGCCTGAATCGGCCTAGAAATTAATACCTTATCAATTATCCCACTTATTTCAACAACCCACCATCCACGAGCCACAGAAGCCGCTACCAAGTATTTTCTTACACAAGCAGCAGCTTCGGCCATAATTTTGTTTTCTAGTATAACTAATGCATGAGAGACAGGCACATGAGATATTACCCAGCTATCATCAACACCATCACACATCTTTCTTACAATAGCATTAGCAATAAAACTAGGTCTAGTCCCAGTACACTTTTGATTACCAGAAGTCCTACAAGGGTCAACCCTAACAACTGCACTTATTATTACTACATGACAAAAACTTGCACCAATATCTTTAGTCTACTTAACCATTAATTCCCTTTCAACAACAGTTTTATTATTAATG [...]
+Anolis_paternus      ATGAGCCCATTTATTTTTACAATTATTTTTTCAAGCTTAGCAACAGGCACAATTATTACTATAACCAGCTACCACTGACTTATAGCCTGAGTTGGATTAGAAATAAACACACTAGCAATTATTCCCATTATCTCAACAACACATCACCCACGAGCCACAGAAGCTTCCACAAAATATTTTCTTACACAAGCTGCAGCCTCTGCCTTAATTTTATTTTCTAGTATAACCAATGCATGACATACGGGATCTTGAGACATTACTCAAATATTATTTACTCCATCAAACACCATGCTAACCATAGCCCTAGCCATAAAACTAGGGTTAGCTCCACTTCACTTCTGGCTACCAGAAGTAATTCAAGGATCAACAACACTAACCGCCTTTATTATTACTACATGACAAAAACTAGCCCCAATATCTCTAATTTTTTTAACTATAAATAGTATGTCCACAACAATTCTTCTACTAATG [...]
+Anolis_sagrei        ATGAGCCCAACAATCTTTATAATTATCATACTAAGTCTTGCAACTGGTACAATTATTACTACTACTAGCCACCACTGACTATTAGCCTGAATCGGCCTAGAAATTAATACCCTCTCAATTATTCCAATTATTTCAATAACCCACCACCCACGATCCACAGAAGCCGCTACCAAGTACTTTCTGACACAAGCAGCAGCCTCCGCCCTAATTTTATTTTCCAGTATAACTAATGCATGAGAAACAGGTACATGAGACATTACACAACTCTCATCAACACCATCACACATCTTATTAACAGTAGCACTAGCAATAAAACTAGGCCTCGTACCAATACACTTTTGACTGCCAGAAGTACTACAAGGGTCAAGCCTAATAACTGCACTTATTATTACTACATGACAAAAAATCGCACCTATAACTTTAATTTATCTAACAATTAACTCCCTCTCAACAACAATTCTGTTATTTATG [...]
+Anolis_strahmi       ATGAGC???????????????????????????????????????????????????ACTATAACAAGCTACCACTGACTCATAGCCTGAATTGGACTAGAAATTAACACCTTAGCCATTATTCCAATTATTTCTATACAACACAACCCACGATCAACGGAAGCCGCAACAAAATACTTCCTAACTCAAGCAGCTGCATCCTCCCTAATTTTATTCGCAAGCCTATTTAACGCCTGACAAGTAGGCACATGAGATATTACACAACTATCAACTACACAAGCACACATTCTTTTGACTATGGCCCTATCAATAAAACTAGGCCTAGCCCCACTACACTTTTGATTACCAGAAGTAATTCAAGGATCTACTATATTTACTGCCTTAATTATTACAACATGACAAAAACTAGCCCCAATATCTCTTATTTTCCTCACCGCAAACAACTTATCAACGACAATTCTTTTAACAATA [...]
+Anolis_stratulus     ATGAGCCCTATAATTTACACAATCATTTTGTCAAGCCTAGCAACAGGGACAATTATTACCATAACCAGCTACCACTGATTAATAGCTTGAATAGGCCTAGAACTTAATACTCTAGCAATTATTCCATTATCTCATACAACACACAACCCACGATCTACAGAAGCCGCAACAAAATACTTCTTAACACAAGCAGCAGCATCTGCTATAATCTTGTTTTCCAGCATAACCAACGCCTGCTTTACGGGCATATGAGACATTACTCAAATATCTTATTTACCATCTAATATTCTTCTAACCATGGCACTAGCCATAAAACTCGGCCTAGCACCAGTGCACTTCTGATTTCCAGAAGTCTTACAAGGCTCAACCCTACTTACCGCTTTTATTATTTCAACATGACAAAAACTGGCCCCAATATCACTAATTTTTTTGACAATAAGCAATCTTCCACCTATAATTTTATTAACTTTA [...]
+Anolis_valencienni   ????????????????????????????????????????????????????????????ATAACAAGTTATCATTGACTTATGGCCTGAATTGGACTAGAAATAAACACATTAGCAATTATTCCAATTA?ATTTACTATACACAACCCACGAGCCACAGAAGCTGCCACAAAGTACTTCCTAACACAAGCATCAGCATCAGCCATAATTTTATTTTCAAGCACAATTAACGCCTGACAAACAGGGACCTGAGACATTACTAACCTCTCATCCGAACCAGCACACATTTTATTAACCATTGCACTAGCAATAAAACTAGGCCTAGCCCCAATACACTTTTGACTACCAGAAGTACTACAAGGGTCAACCATAACCACAGCACTAGTTATCTCTACTTGACAAAAACTGGCCCCAATAGCCCTAATTTATCTGAACATTAATAATCTATCAACAGCTGTCCTAATCTTACTA [...]
+Anolis_vanidicus     ATGAGCCCAACAATTTATACAACTATTCTAACCAGTCTTGCCACCGGAACAATTATTACAATAACCAGCCACCACTGATTAATAGCCTGA?TCGGATTAGAAAT?AATACATTAGCAATAATCCCAACTATCTCAACAATGCACCACCCTCGATCAACTGAAGCTGCCACAAAATACTTCTTAACTCAGGCAGCTGCCTCAGCCTTAATTCTCTTTTCTAGTATAACTAACGCCTGACAAACAGGCTCCTGAGATATTACCCATCTATCATCAACCCCAGCACATATTTTATTAACCATGGCCCTAGCAATAAAATTAGGCCTGGCCCCATTTCACTTTTGATTACCAGAAGTCCTACAAGGATCTGCTATAAATACTGCACTAATCATTACTACTTGACAAAAGCTAGCTCCAATATCTCTAATTTTCTTGACCGTAAATAACCTATCTACAACAATTCTTTTAACAATG [...]
+	;
+End;
diff --git a/examples/nexus/avian-ovomucoids.nex b/examples/nexus/avian-ovomucoids.nex
new file mode 100644
index 0000000..5cbf909
--- /dev/null
+++ b/examples/nexus/avian-ovomucoids.nex
@@ -0,0 +1 @@
+#NEXUS 

[!Data from:
Laskowski, M., Jr., and W.M. Fitch.  1989.  Evolution of avian ovomucoids and of birds.
Pp. 371-387 in B. Fernholm, K. Bremer, and H. J�rnvall (eds.),  The Hierarchy of Life.
Elsevier Press, Amsterdam. 
]

begin taxa;
	dimensions ntax=89;
	taxlabels
        	Struthio_camelus
			Rhea_americana
			Pterocnemia_pennata
			Casuarius_casuarius
			Dromaius_novaehollandiae
			Nothoprocta_cinerascens
			Eudromia_elegans
			Pygoscelis_adeliae_f
			Pygoscelis_adeliae_y
			Spheniscus_humboldti
			Phalacrocorax_sulcirostris
			Anhinga_novaehollandeae
			Nycticorax_nycticorax
			Chauna_chavaria
			Anseranas_semipalmata
			Dendrocygna_arcuata
			Dendrocygna_autumnalis
			Dendrocygna_eytoni_d
			Dendrocygna_eytoni_e
			Dendrocygna_viduata
			Coscoroba_coscoroba
			Cygnus_atratus
			Goose
			Anser_indicus
			Branta_canadensis
			Cereopsis_novaehollandiae
			Chloephaga_picta
			Duck
			Anas_platyrhynchos
			Megapodius_freycinet
			Leipoa_ocellata
			Ortalis_vetula
			Penelope_jacquacu
			Penelope_superciliaris
			Bonasa_umbellus
			Tympanuchus_cupido
			Oreortyx_pictus
			Callipepla_squamata_n
			Callipepla_squamata_s
			Lophortyx_californicus
			Colinus_virginianus
			Cyrtonyx_montezumae_l
			Cyrtonyx_montezumae_s
			Alectoris_chukar
			Alectoris_rufa
			Francolinus_afer
			Francolinus_erckelii
			Francolinus_coqui_v
			Francolinus_coqui_a
			Francolinus_francolinus_a
			Francolinus_francolinus_v
			Francolinus_pondicerianus
			Perdix_perdix
			Coturnix_delegorguei
			Coturnix_coturnix_japonica_1
			Coturnix_coturnix_japonica_2
			Arborophilia_torqueola
			Bambusicola_thoracica
			Tragopan_satyra
			Tragopan_temmincki
			Lophophorus_impejanus
			Crossoptilon_auritum
			Lophura_edwardsi
			Lophura_ignita
			Gallus_gallus
			Grey_jungle_fowl
			Phasianus_colchicus
			Syrmaticus_ellioti
			Syrmaticus_reevesii
			Chrysolophus_amherstiae
			Polyplectron_bicalcaratum
			Argusianus_argus_argus
			Pavo_cristatus
			Afropavo_congensis
			Numida_meleagris
			Acryllium_vulturinum
			Meleagris_gallopavo
			Grus_carunculatus
			Anthropoides_virgo
			Grus_vipio
			Fulica_atra
			Vanellus_spinosus
			Larus_rudibundus
			Turnix_sylvatica
			Gallirallus_australis
			Geococcyx_californianus
			Dacelo_novaeguineae
			Carpococcyx_renauldi
			Podargus_strigoides
;
end;

begin characters;
	dimensions nchar=88;
	format missing=? gap=- matchchar=. datatype=protein symbols= " 1 2 3 4" ;

matrix
[                                        10        20        30        40        50        60        70        80       ]
[                                        .         .         .         .         .         .         .         .        ]

Struthio_camelus                VKYPNTNEEGKEVVLPKILSPIGSDGVYSNELANIEYTNVSK??????FAT--VDDYKPVPLDYMLDSKTSNKNNVVESSGTLRHFGK   [86]
Rhea_americana                  .............L..E..N.V.T................?.D?????...--...H...S.E..........D.....N...S....   [86]
Pterocnemia_pennata             .............L..E..N.V.A..................DHD?EV...--...H...S.E..........D.....N...S....   [86]
Casuarius_casuarius             ........D....L.....N.........DD......A....DHDKEV...--..E....SPE.......N..DS....N...G....   [86]
Dromaius_novaehollandiae        ........D....L.....N..........D......A..??D?????...--.......S.E.......N..D.....N...G....   [86]
Nothoprocta_cinerascens         .....A.D.....P...TP...A.NA.FGS....V....I..DHDK?????T-..G...AT.E.F..NQ.A..A....KNV....L..   [87]
Eudromia_elegans                .R.....D.....P...TP..V.AN....S....V....I?.?????????S-I.G...AT.EFF..NQ....A.A..KNV..N.I.E   [87]
Pygoscelis_adeliae_f            .TF..........LVT.......T..................DHDKEVI..--.......S.E..............D.N...S....   [86]
Pygoscelis_adeliae_y            .T...........LVT.......T..................DHDKEVI..--.......S.E..............D.N...S....   [86]
Spheniscus_humboldti            .T.S.........LIT.......T..................D?DKEVI..--I......S.E..............D.N.I.S....   [86]
Phalacrocorax_sulcirostris      .S.SK.......ALVT.......T..............KI..DHDKEVI..--.......S.E.............AD.N...S....   [86]
Anhinga_novaehollandeae         .L.S.........LVT.......T................T.DHDKEVI.S--.......S.E..............D.N...S....   [86]
Nycticorax_nycticorax           .T.S.A....R..LVT.......A..........M....I..DHDGEVIV.--.......SPEN.V.......D..AD.N...S....   [86]
Chauna_chavaria                 .R...........L.T.T.....T..................DRDKEAV..--......AT.E....NQ....S...D.N...S....   [86]
Anseranas_semipalmata           .R...S.......L.T.D...................A....DHDKEAV..--..E...AT.E....NQ........D.N...S....   [86]
Dendrocygna_arcuata             .RF..........L.T.E...V.................I..D?DKEAV..--......AT.E....N..G......D.N...S....   [86]
Dendrocygna_autumnalis          .RF..........L.T.D.....................I..DHDKEAV..--......AT.E....N..G......D.N...S....   [86]
Dendrocygna_eytoni_d            .RF..........L.T.DVI.V............L....I..DHDKEAV..--....R.DT.E....N..G......D.N...S....   [86]
Dendrocygna_eytoni_e            .RF..........L.T.DVI.V............L....I..DHDKEAV..--..E.R.DT.E....N..G......D.N...S....   [86]
Dendrocygna_viduata             .RFS.........L.T.E...V.................I..D?D?EAV..--......AT.E....N..G.R....D.N...S....   [86]
Coscoroba_coscoroba             ..F..........L.T.D.I...T...............I..DHDKEAV..--..G...ATME....N..G......D.N...S....   [86]
Cygnus_atratus                  .RF..........L.T.D.....T...............I..DHDKEAV..--......ATME....N..G......D.N...S....   [86]
Goose                           .RF..........L.T.D.....T...............I..DHDKEAV..--......ATVE....N..D......D.N...S....   [86]
Anser_indicus                   .RF..........L.T.D.A...T...............I..DHDKEAV..--......ATVE....N..D......D.N...S....   [86]
Branta_canadensis               .RF.......R..L.T.D.....T...............I..DHD???V..--......ATVE....N..G......D.N...S....   [86]
Cereopsis_novaehollandiae       ..F..........L...DVI.T.T...............I..D?D??AV..--......ARME....N..G......D.N...S....   [86]
Chloephaga_picta                .RF..........L.T.E.....T...............I..D??KEAV..--..G...ATME....N..G......D.N...S...E   [86]
Duck                            .RF..........L.T.E...V.T...............I..DHDKEAV..--..G...ATME....N..G......D.N...S...E   [86]
Anas_platyrhynchos              .RF........D.L.T.E...V.T...............I..DHDKEAV..--..G...ATME....N..G......D.N...S...E   [86]
Megapodius_freycinet            .R...........LVTQDV?...T....?....G...??I????????LV.--......ST.EDK..NQ....S...D.N...S....   [86]
Leipoa_ocellata                 IRH..........LVTEDS....T...............I..E?DK??VV.--..G.THAT.ELK..NQ....G..AQ.N...S....   [86]
Ortalis_vetula                  ...........D.LA.EDPNL.......T-.......???????????..PN-...H..ALQEQKI.N..D..S...D.N...S....   [86]
Penelope_jacquacu               ...........D.LA.EDP.........T-.........I..ERDKEA..PN-...H..ALQEQK..N..D..S...D.N...S....   [86]
Penelope_superciliaris          ...........D.LVAEDP....................I..E?DKEA..PN-...H..ALQEQK..N..D..S...D.N...S....   [87]
Bonasa_umbellus                 .RF........V.LV.EDPR...T.A.....M.......I..EHD???L.AS-..E...ATME.R..N..G........N.N.S...T   [87]
Tympanuchus_cupido              .RF........D.LVTED.H...T...............I..EHD???L.AS-..E...ATME.R..N..G........N...S....   [87]
Oreortyx_pictus                 .RF........D.LAT.E.H...T........S......I..EHDTEA..AS-..E...AT.E.R.....A........N...S....   [87]
Callipepla_squamata_n           .RF........D.LAT.E.H...T........Y......I..EHD??A..AS-..E...DT.E.R..N..A........N...S....   [87]
Callipepla_squamata_s           .RF........D.LAT.E.H...T........Y......I..EHD??A..AS-..E...DT.E.R..N..AS.......N...S....   [87]
Lophortyx_californicus          .RF........D.LVT.E.Q...T........Y......I..EHD?EA..AS-..E...AT.E.R..N..A........N...S....   [87]
Colinus_virginianus             .RF........D.LATEE.H...T....MS.MF......T..EHDTEA..AS-..E...AMSE.R..N..V........N...S....   [87]
Cyrtonyx_montezumae_l           .RF........D.LVTEEV....T........S..A.?.I.?E?D???..AS-..E...AT.E.VI.N..G........N...S....   [87]
Cyrtonyx_montezumae_s           .RF........D.LVTEEV....T........S..A.?.I.?E?D???..AS-..E...ATSE.VI.N..G........N...S....   [87]
Alectoris_chukar                ARF..A.....D..VTED.R...T....T-.........I..EHDGETL.A--..E...AT.E.R.....G........N...S....   [85]
Alectoris_rufa                  ARF..A.....D..VTED.H...T....T-.........I..EHD???L.A--..E...AT.E.R.....G........N...S....   [85]
Francolinus_afer                .RF..A....RD..VSEN.R...TH........SM....I..EHDREAP.AS-..E...ATME.RV.NI.G......K.N...S....   [87]
Francolinus_erckelii            .RF..A.....D.AVSEN.R...T...N-.....M....I??EHD?EAP.AS-..E...ATME.RV.NI.G......K.N...S.K..   [86]
Francolinus_coqui_v             .RF..A....RD..VSEN.R...T.........SMN...I..E?D?EA???S-..E...GTME.RV.NI.G......K.N...S....   [87]
Francolinus_coqui_a             .RF..A....RD.AVSEN.R...T.........SMN...I..E?D?EA???S-..E...GTME.RV.NI.G......K.N...S....   [87]
Francolinus_francolinus_a       ARF........V.LDS.D.I...T..LHDS..S...H.KIK.EHDRE????S-..G...ETAEET..N..R........N........   [87]
Francolinus_francolinus_v       .RF........V.LDS.D.I...T..LHDS..S...H.KIK.EHDRE????S-..G...ETAEET..N..R........N........   [87]
Francolinus_pondicerianus       ARFS.A.....D.LVIDDPR.M.T....DS..F.M....I..EHD???LPAS-..E...DTTEER..N..G........N...S....   [87]
Perdix_perdix                   .RF........D.LVTED.Q...T...............I..EHT???L.AS-..E...ATME.R..N..G..D.....N...N....   [87]
Coturnix_delegorguei            .RF........DE.V.DE.RF..T....NH.MF.K....I..EQDGET???S-..E...A.K..RV.N..G........N...NR...   [87]
Coturnix_coturnix_japonica_1    .RF........DE.V.DE.RL..T....NH.MF.K....I..EQDGETL.AS-..E...A.K..RV.N...........N...N....   [87]
Coturnix_coturnix_japonica_2    .RF........DE.V.DE.RL..T....NH.MF.K....I..EQDGETL.AS-..E...A.K..RV.N..G........N...N....   [87]
Arborophilia_torqueola          .RF..S.....V..VKEDPR...T.........H..T??I?.?????????S-....M.ATME.RV.N..G........N...S....   [87]
Bambusicola_thoracica           ARF..A.....V.LDTQE.R...T.......MS......I.IK?DKE?L.AS-..E...ETAEERI.N..G........N....N...   [87]
Tragopan_satyra                 .RF........D.LVTED.H...T...............I..GHDREAL.AS-..E...ATME.R..N..G........N...S....   [87]
Tragopan_temmincki              .RF........D.LVTED.R...T...............I..GHD???L.AS-..E...ATME.R..N..G........N...S....   [87]
Lophophorus_impejanus           .RF..A.....D.LVTED.R...T...............I..EHDREAL.AS-..E...ATME.R..N..G........N...S....   [87]
Crossoptilon_auritum            .RF........D.LVAED.R...T...............I..ERDGEAL.AS-..E...ATME.R..N..G........N...S....   [87]
Lophura_edwardsi                .RF........D.LVAED.R...T.......M.......I..ERDGEAL.AS-..E...ATME.R..N..G........N...S....   [87]
Lophura_ignita                  .RF........D.LVGEDIR...T.......M.......N..ERDGEAL.AS-..E...ATME.R..N.SD........N...S....   [87]
Gallus_gallus                   ARF..ADK...D.LVN.D.R...T....T.D..S..F..I..EHDKETL.AS-..E...DTAEDR..N..G........N...S....   [87]
Grey_jungle_fowl                ARF..ADK...D.LVN.D.R...T....T.D..S..F..I..EHDKETL.AS-..E...DTVEDR..N..G........N...S....   [87]
Phasianus_colchicus             .RF..........LVAED.R.V.T.....S.........I..EHEGEAL.AS-..E...ATME.R..N..G........N...NR..Q   [87]
Syrmaticus_ellioti              .RF..K.....D.LVAED.H...T...............I..ER?G??L.AS-..E...ATME.R..N..G........N...S....   [87]
Syrmaticus_reevesii             .RF..K.......LVAED.H...T.....S.........I..ERNGEAL.AS-..E...ATME.R..N..G........N...SR..E   [87]
Chrysolophus_amherstiae         .RFL.....S.D-LVAED.H...T...............I..EHDG?AL.AS-..E...ATME.R..N..G........N...N....   [86]
Polyplectron_bicalcaratum       .RF....K...D.LA.EEVR...T.....D.S..RD...I..EHDR?????S-..E.Q.TTTEHRVNNE.G......K.N..VS....   [87]
Argusianus_argus_argus          .RF........D.LVSEDRH...T.....H..T......I..EHD?EAL.A--..EH..AT.EDR..N.I...D..L..N...S....   [86]
Pavo_cristatus                  .RF..A.....D.LVSED.H...T.....H.........I..EHDREAL.AS-..E...AT.EHR..N..G........N...S....   [87]
Afropavo_congensis              .RF........D.SAS.D.R...T.....H.........I..EHDGEAL.AS-..E...ATMEQR..N..G........N...S....   [87]
Numida_meleagris                .RF..A.....D.LVTED.R...T......D........I.?????EAL.A--..E...ATME.R..N..D........N...S....   [86]
Acryllium_vulturinum            .RF..A.....D.LVIED.R...T......D........I..EHD???L.A--..E...ATME.R..N..D........N...S....   [86]
Meleagris_gallopavo             .RF........D.LVTED.R...T...H.-.........I..EHDREAL.AS-..E...AT.E.R..N..G........N...S....   [86]
Grus_carunculatus               .T...........LVT.......T..................DHDKEAT..--......AT.E..F...........D.N...S....   [86]
Anthropoides_virgo              .T...........LVT.......T..................DHDKEVT..--......AT.E..F...........D.N...S....   [86]
Grus_vipio                      IT...........LVT.......T..................DHDKEAT..--......AT.E..F...........D.N...S....   [86]
Fulica_atra                     .T...........LVT.....V.TN......S..........DYDKEVT..--..G.Q.AS.E.VF.N.....D..AD.N...S....   [86]
Vanellus_spinosus               .T...........LVT.......T..........L.......DYDKEVI..--......AS................D.N...S..E.   [86]
Larus_rudibundus                .T...........LAT.A...V....................DYDKEDI..--......AS................D.N...S..E.   [86]
Turnix_sylvatica                .RF........DT.AD.D.P.........-.M.......I..EHD??T???S-..E...GMMERL..N..ND.......N...N...E   [86]
Gallirallus_australis           .T.........V.LVT.NI..V.TN...T..S.I...S....DYD???T..??..G.QSA.Q..VF.N........AD.N...S....   [88]
Geococcyx_californianus         .A...A......ALVTTARLH..T....G.....L.H..I..DYNKEVI.S--.N.....S.L....N..G.....AD.N...S....   [86]
Dacelo_novaeguineae             .......D.....LVTE......T.R................EHDKEAI..-Q..EH..AT...RI.......D..MD.N...S....   [87]
Carpococcyx_renauldi            .R...S......GLATT.R....T....G.....L....I..DYD???I..--.......T.ED...NI.H..Y..AH.N..FS....   [86]
Podargus_strigoides             .T.......S...LVDEV.....T..........L.-..I..DRDK??I..--....Q..MG...............D.N...N....   [85]
;
end;

\ No newline at end of file
diff --git a/examples/nexus/dna.nex b/examples/nexus/dna.nex
new file mode 100644
index 0000000..7bc2e7e
--- /dev/null
+++ b/examples/nexus/dna.nex
@@ -0,0 +1,142 @@
+#nexus 
+# source: http://wiki.christophchamp.com/index.php/NEXUS_file_format
+
+begin data;
+dimensions ntax=10 nchar=705;
+format datatype=dna interleave=yes gap=- missing=?;
+matrix
+Cow     ATGGCATATCCCATACAACTAGGATTCCAAGATGCAACATCACCAATCATAGAAGAACTA
+Carp    ATGGCACACCCAACGCAACTAGGTTTCAAGGACGCGGCCATACCCGTTATAGAGGAACTT
+Chicken ATGGCCAACCACTCCCAACTAGGCTTTCAAGACGCCTCATCCCCCATCATAGAAGAGCTC
+Human   ATGGCACATGCAGCGCAAGTAGGTCTACAAGACGCTACTTCCCCTATCATAGAAGAGCTT
+Loach   ATGGCACATCCCACACAATTAGGATTCCAAGACGCGGCCTCACCCGTAATAGAAGAACTT
+Mouse   ATGGCCTACCCATTCCAACTTGGTCTACAAGACGCCACATCCCCTATTATAGAAGAGCTA
+Rat     ATGGCTTACCCATTTCAACTTGGCTTACAAGACGCTACATCACCTATCATAGAAGAACTT
+Seal    ATGGCATACCCCCTACAAATAGGCCTACAAGATGCAACCTCTCCCATTATAGAGGAGTTA
+Whale   ATGGCATATCCATTCCAACTAGGTTTCCAAGATGCAGCATCACCCATCATAGAAGAGCTC
+Frog    ATGGCACACCCATCACAATTAGGTTTTCAAGACGCAGCCTCTCCAATTATAGAAGAATTA
+
+Cow     CTTCACTTTCATGACCACACGCTAATAATTGTCTTCTTAATTAGCTCATTAGTACTTTAC
+Carp    CTTCACTTCCACGACCACGCATTAATAATTGTGCTCCTAATTAGCACTTTAGTTTTATAT
+Chicken GTTGAATTCCACGACCACGCCCTGATAGTCGCACTAGCAATTTGCAGCTTAGTACTCTAC
+Human   ATCACCTTTCATGATCACGCCCTCATAATCATTTTCCTTATCTGCTTCCTAGTCCTGTAT
+Loach   CTTCACTTCCATGACCATGCCCTAATAATTGTATTTTTGATTAGCGCCCTAGTACTTTAT
+Mouse   ATAAATTTCCATGATCACACACTAATAATTGTTTTCCTAATTAGCTCCTTAGTCCTCTAT
+Rat     ACAAACTTTCATGACCACACCCTAATAATTGTATTCCTCATCAGCTCCCTAGTACTTTAT
+Seal    CTACACTTCCATGACCACACATTAATAATTGTGTTCCTAATTAGCTCATTAGTACTCTAC
+Whale   CTACACTTTCACGATCATACACTAATAATCGTTTTTCTAATTAGCTCTTTAGTTCTCTAC
+Frog    CTTCACTTCCACGACCATACCCTCATAGCCGTTTTTCTTATTAGTACGCTAGTTCTTTAC
+
+Cow     ATTATTTCACTAATACTAACGACAAAGCTGACCCATACAAGCACGATAGATGCACAAGAA
+Carp    ATTATTACTGCAATGGTATCAACTAAACTTACTAATAAATATATTCTAGACTCCCAAGAA
+Chicken CTTCTAACTCTTATACTTATAGAAAAACTATCA---TCAAACACCGTAGATGCCCAAGAA
+Human   GCCCTTTTCCTAACACTCACAACAAAACTAACTAATACTAACATCTCAGACGCTCAGGAA
+Loach   GTTATTATTACAACCGTCTCAACAAAACTCACTAACATATATATTTTGGACTCACAAGAA
+Mouse   ATCATCTCGCTAATATTAACAACAAAACTAACACATACAAGCACAATAGATGCACAAGAA
+Rat     ATTATTTCACTAATACTAACAACAAAACTAACACACACAAGCACAATAGACGCCCAAGAA
+Seal    ATTATCTCACTTATACTAACCACGAAACTCACCCACACAAGTACAATAGACGCACAAGAA
+Whale   ATTATTACCCTAATGCTTACAACCAAATTAACACATACTAGTACAATAGACGCCCAAGAA
+Frog    ATTATTACTATTATAATAACTACTAAACTAACTAATACAAACCTAATGGACGCACAAGAG
+
+Cow     GTAGAGACAATCTGAACCATTCTGCCCGCCATCATCTTAATTCTAATTGCTCTTCCTTCT
+Carp    ATCGAAATCGTATGAACCATTCTACCAGCCGTCATTTTAGTACTAATCGCCCTGCCCTCC
+Chicken GTTGAACTAATCTGAACCATCCTACCCGCTATTGTCCTAGTCCTGCTTGCCCTCCCCTCC
+Human   ATAGAAACCGTCTGAACTATCCTGCCCGCCATCATCCTAGTCCTCATCGCCCTCCCATCC
+Loach   ATTGAAATCGTATGAACTGTGCTCCCTGCCCTAATCCTCATTTTAATCGCCCTCCCCTCA
+Mouse   GTTGAAACCATTTGAACTATTCTACCAGCTGTAATCCTTATCATAATTGCTCTCCCCTCT
+Rat     GTAGAAACAATTTGAACAATTCTCCCAGCTGTCATTCTTATTCTAATTGCCCTTCCCTCC
+Seal    GTGGAAACGGTGTGAACGATCCTACCCGCTATCATTTTAATTCTCATTGCCCTACCATCA
+Whale   GTAGAAACTGTCTGAACTATCCTCCCAGCCATTATCTTAATTTTAATTGCCTTGCCTTCA
+Frog    ATCGAAATAGTGTGAACTATTATACCAGCTATTAGCCTCATCATAATTGCCCTTCCATCC
+
+Cow     TTACGAATTCTATACATAATAGATGAAATCAATAACCCATCTCTTACAGTAAAAACCATA
+Carp    CTACGCATCCTGTACCTTATAGACGAAATTAACGACCCTCACCTGACAATTAAAGCAATA
+Chicken CTCCAAATCCTCTACATAATAGACGAAATCGACGAACCTGATCTCACCCTAAAAGCCATC
+Human   CTACGCATCCTTTACATAACAGACGAGGTCAACGATCCCTCCCTTACCATCAAATCAATT
+Loach   CTACGAATTCTATATCTTATAGACGAGATTAATGACCCCCACCTAACAATTAAGGCCATG
+Mouse   CTACGCATTCTATATATAATAGACGAAATCAACAACCCCGTATTAACCGTTAAAACCATA
+Rat     CTACGAATTCTATACATAATAGACGAGATTAATAACCCAGTTCTAACAGTAAAAACTATA
+Seal    TTACGAATCCTCTACATAATGGACGAGATCAATAACCCTTCCTTGACCGTAAAAACTATA
+Whale   TTACGGATCCTTTACATAATAGACGAAGTCAATAACCCCTCCCTCACTGTAAAAACAATA
+Frog   CTTCGTATCCTATATTTAATAGATGAAGTTAATGATCCACACTTAACAATTAAAGCAATC
+
+Cow     GGACATCAGTGATACTGAAGCTATGAGTATACAGATTATGAGGACTTAAGCTTCGACTCC
+Carp    GGACACCAATGATACTGAAGTTACGAGTATACAGACTATGAAAATCTAGGATTCGACTCC
+Chicken GGACACCAATGATACTGAACCTATGAATACACAGACTTCAAGGACCTCTCATTTGACTCC
+Human   GGCCACCAATGGTACTGAACCTACGAGTACACCGACTACGGCGGACTAATCTTCAACTCC
+Loach   GGGCACCAATGATACTGAAGCTACGAGTATACTGATTATGAAAACTTAAGTTTTGACTCC
+Mouse   GGGCACCAATGATACTGAAGCTACGAATATACTGACTATGAAGACCTATGCTTTGATTCA
+Rat     GGACACCAATGATACTGAAGCTATGAATATACTGACTATGAAGACCTATGCTTTGACTCC
+Seal    GGACATCAGTGATACTGAAGCTATGAGTACACAGACTACGAAGACCTGAACTTTGACTCA
+Whale   GGTCACCAATGATATTGAAGCTATGAGTATACCGACTACGAAGACCTAAGCTTCGACTCC
+Frog    GGCCACCAATGATACTGAAGCTACGAATATACTAACTATGAGGATCTCTCATTTGACTCT
+
+Cow     TACATAATTCCAACATCAGAATTAAAGCCAGGGGAGCTACGACTATTAGAAGTCGATAAT
+Carp    TATATAGTACCAACCCAAGACCTTGCCCCCGGACAATTCCGACTTCTGGAAACAGACCAC
+Chicken TACATAACCCCAACAACAGACCTCCCCCTAGGCCACTTCCGCCTACTAGAAGTCGACCAT
+Human   TACATACTTCCCCCATTATTCCTAGAACCAGGCGACCTGCGACTCCTTGACGTTGACAAT
+Loach   TACATAATCCCCACCCAGGACCTAACCCCTGGACAATTCCGGCTACTAGAGACAGACCAC
+Mouse   TATATAATCCCAACAAACGACCTAAAACCTGGTGAACTACGACTGCTAGAAGTTGATAAC
+Rat     TACATAATCCCAACCAATGACCTAAAACCAGGTGAACTTCGTCTATTAGAAGTTGATAAT
+Seal    TATATGATCCCCACACAAGAACTAAAGCCCGGAGAACTACGACTGCTAGAAGTAGACAAT
+Whale   TATATAATCCCAACATCAGACCTAAAGCCAGGAGAACTACGATTATTAGAAGTAGATAAC
+Frog    TATATAATTCCAACTAATGACCTTACCCCTGGACAATTCCGGCTGCTAGAAGTTGATAAT
+
+Cow     CGAGTTGTACTACCAATAGAAATAACAATCCGAATGTTAGTCTCCTCTGAAGACGTATTA
+Carp    CGAATAGTTGTTCCAATAGAATCCCCAGTCCGTGTCCTAGTATCTGCTGAAGACGTGCTA
+Chicken CGCATTGTAATCCCCATAGAATCCCCCATTCGAGTAATCATCACCGCTGATGACGTCCTC
+Human   CGAGTAGTACTCCCGATTGAAGCCCCCATTCGTATAATAATTACATCACAAGACGTCTTG
+Loach   CGAATGGTTGTTCCCATAGAATCCCCTATTCGCATTCTTGTTTCCGCCGAAGATGTACTA
+Mouse   CGAGTCGTTCTGCCAATAGAACTTCCAATCCGTATATTAATTTCATCTGAAGACGTCCTC
+Rat     CGGGTAGTCTTACCAATAGAACTTCCAATTCGTATACTAATCTCATCCGAAGACGTCCTG
+Seal    CGAGTAGTCCTCCCAATAGAAATAACAATCCGCATACTAATCTCATCAGAAGATGTACTC
+Whale   CGAGTTGTCTTACCTATAGAAATAACAATCCGAATATTAGTCTCATCAGAAGACGTACTC
+Frog    CGAATAGTAGTCCCAATAGAATCTCCAACCCGACTTTTAGTTACAGCCGAAGACGTCCTC
+
+Cow     CACTCATGAGCTGTGCCCTCTCTAGGACTAAAAACAGACGCAATCCCAGGCCGTCTAAAC
+Carp    CATTCTTGAGCTGTTCCATCCCTTGGCGTAAAAATGGACGCAGTCCCAGGACGACTAAAT
+Chicken CACTCATGAGCCGTACCCGCCCTCGGGGTAAAAACAGACGCAATCCCTGGACGACTAAAT
+Human   CACTCATGAGCTGTCCCCACATTAGGCTTAAAAACAGATGCAATTCCCGGACGTCTAAAC
+Loach   CACTCCTGGGCCCTTCCAGCCATGGGGGTAAAGATAGACGCGGTCCCAGGACGCCTTAAC
+Mouse   CACTCATGAGCAGTCCCCTCCCTAGGACTTAAAACTGATGCCATCCCAGGCCGACTAAAT
+Rat     CACTCATGAGCCATCCCTTCACTAGGGTTAAAAACCGACGCAATCCCCGGCCGCCTAAAC
+Seal    CACTCATGAGCCGTACCGTCCCTAGGACTAAAAACTGATGCTATCCCAGGACGACTAAAC
+Whale   CACTCATGGGCCGTACCCTCCTTGGGCCTAAAAACAGATGCAATCCCAGGACGCCTAAAC
+Frog    CACTCGTGAGCTGTACCCTCCTTGGGTGTCAAAACAGATGCAATCCCAGGACGACTTCAT
+
+Cow     CAAACAACCCTTATATCGTCCCGTCCAGGCTTATATTACGGTCAATGCTCAGAAATTTGC
+Carp    CAAGCCGCCTTTATTGCCTCACGCCCAGGGGTCTTTTACGGACAATGCTCTGAAATTTGT
+Chicken CAAACCTCCTTCATCACCACTCGACCAGGAGTGTTTTACGGACAATGCTCAGAAATCTGC
+Human   CAAACCACTTTCACCGCTACACGACCGGGGGTATACTACGGTCAATGCTCTGAAATCTGT
+Loach   CAAACCGCCTTTATTGCCTCCCGCCCCGGGGTATTCTATGGGCAATGCTCAGAAATCTGT
+Mouse   CAAGCAACAGTAACATCAAACCGACCAGGGTTATTCTATGGCCAATGCTCTGAAATTTGT
+Rat     CAAGCTACAGTCACATCAAACCGACCAGGTCTATTCTATGGCCAATGCTCTGAAATTTGC
+Seal    CAAACAACCCTAATAACCATACGACCAGGACTGTACTACGGTCAATGCTCAGAAATCTGT
+Whale   CAAACAACCTTAATATCAACACGACCAGGCCTATTTTATGGACAATGCTCAGAGATCTGC
+Frog    CAAACATCATTTATTGCTACTCGTCCGGGAGTATTTTACGGACAATGTTCAGAAATTTGC
+
+Cow     GGGTCAAACCACAGTTTCATACCCATTGTCCTTGAGTTAGTCCCACTAAAGTACTTTGAA
+Carp    GGAGCTAATCACAGCTTTATACCAATTGTAGTTGAAGCAGTACCTCTCGAACACTTCGAA
+Chicken GGAGCTAACCACAGCTACATACCCATTGTAGTAGAGTCTACCCCCCTAAAACACTTTGAA
+Human   GGAGCAAACCACAGTTTCATGCCCATCGTCCTAGAATTAATTCCCCTAAAAATCTTTGAA
+Loach   GGAGCAAACCACAGCTTTATACCCATCGTAGTAGAAGCGGTCCCACTATCTCACTTCGAA
+Mouse   GGATCTAACCATAGCTTTATGCCCATTGTCCTAGAAATGGTTCCACTAAAATATTTCGAA
+Rat     GGCTCAAATCACAGCTTCATACCCATTGTACTAGAAATAGTGCCTCTAAAATATTTCGAA
+Seal    GGTTCAAACCACAGCTTCATACCTATTGTCCTCGAATTGGTCCCACTATCCCACTTCGAG
+Whale   GGCTCAAACCACAGTTTCATACCAATTGTCCTAGAACTAGTACCCCTAGAAGTCTTTGAA
+Frog    GGAGCAAACCACAGCTTTATACCAATTGTAGTTGAAGCAGTACCGCTAACCGACTTTGAA
+
+Cow     AAATGATCTGCGTCAATATTA---------------------TAA
+Carp    AACTGATCCTCATTAATACTAGAAGACGCCTCGCTAGGAAGCTAA
+Chicken GCCTGATCCTCACTA------------------CTGTCATCTTAA
+Human   ATA---------------------GGGCCCGTATTTACCCTATAG
+Loach   AACTGGTCCACCCTTATACTAAAAGACGCCTCACTAGGAAGCTAA
+Mouse   AACTGATCTGCTTCAATAATT---------------------TAA
+Rat     AACTGATCAGCTTCTATAATT---------------------TAA
+Seal    AAATGATCTACCTCAATGCTT---------------------TAA
+Whale   AAATGATCTGTATCAATACTA---------------------TAA
+Frog    AACTGATCTTCATCAATACTA---GAAGCATCACTA------AGA
+;
+end;
+
+
diff --git a/examples/nexus/gopher.nex b/examples/nexus/gopher.nex
new file mode 100644
index 0000000..37e42f6
--- /dev/null
+++ b/examples/nexus/gopher.nex
@@ -0,0 +1,63 @@
+#NEXUS
+[TBO26oLong]
+BEGIN DATA;
+	DIMENSIONS  NTAX =26 NCHAR=614;
+	FORMAT DATATYPE = DNA GAP = - MISSING = ?;
+	MATRIX	
+	Orthogeomys_heterodus   		ATTCTAGGCAAAAAG-AGCAATGCTGGAGGTATTACAATACCAGACTTCAAACTTTACTATAGAGCCATAATAACAAAAACCGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAATGGAAYAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGTCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCACCATGCACAGGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCAGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGGGAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATAGGAGAAAGACTCAATAAATGGGACTA [...]
+
+	Thomomys_bottae_awahnee_a 		????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACMCAGTCTATTCAATTATTGGKGCTGGCAAAACTGGGCAGCCMCATGCARAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAA?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+
+	Thomomys_bottae_awahnee_b  		????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCM-CAACAGATTGGAGAGAGACTCGATAAATGGGA [...]
+
+	Thomomys_bottae_xerophilus  		????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAAYTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAA???????????????????????????????????????????????? [...]
+
+	Thomomys_bottae_cactophilus  		????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAAYGTCAGACCGGAAACCGTGAAAYTGTTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAA?????????????????????????????????????????????????????????? [...]
+
+	Thomomys_bottae_albatus  		????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGATCCAGAAATAGAACCAC-ATACCTATAGTCAACTTGTATTTGATAAAGGAGCTAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCATTTCACCATGCACAAGAATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCT-------------------------------------CATAGGCACTCATAGGCACAGGCAAAAGATTCCTATACAGGAACCCAGGGTCAACAACAGATTGGAGAGAGACTCAATAAATGGGACT [...]
+
+	Thomomys_bottae_ruidosae  		????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCARAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAAYTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAG??????????????????????????????????????????????????????????? [...]
+
+	Thomomys_bottae_bottae  		????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAAATTCCTGAACAGAATCCCAGGGTCA-CAACAGATKGGAGAGAGACTCGATAAATGGGACTA [...]
+
+	Thomomys_bottae_alpinus  		????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCTATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCA???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+
+	Thomomys_bottae_riparius  		????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAATGGGAC [...]
+
+	Thomomys_bottae_mewa  			????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCATTTCACCATGCACAAGAATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAA??????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+
+	Thomomys_bottae_saxatilis  		????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAA????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+
+	Thomomys_bottae_laticeps  		????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAATTGCTACATGATAAWGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCAATAAATGGGAC [...]
+
+	Thomomys_talpoides_ocius   		???CTAGGCAAAA-G-AGC-ATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATMCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCRACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGA [...]
+
+	Thomomys_idahoensis_pygmaeus_a   	????????CAAAA-G-AGCAATGCTGGTGGTATYACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATMCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCRACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAA [...]
+
+	Thomomys_idahoensis_pygmaeus_b   	????GGCGCAAAA-G-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATMCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAA [...]
+
+	Thomomys_mazama_mazama   		ATTCTAGGCAAAAAGAAGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAAYTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACT [...]
+
+	Thomomys_mazama_nasicus   		ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCSCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAAYTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGAC [...]
+
+	Thomomys_monticola_a   			??????????????G-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGYCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTA [...]
+
+	Thomomys_monticola_b   			ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATYACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAWATAGAACCAC-ACAACTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAATGGAACRAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATGGGACTA [...]
+
+	Thomomys_talpoides_yakimensis   	ATTCTAGGCAAAA-G-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTKTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAAYGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAAYTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAAT [...]
+
+	Thomomys_talpoides_bridgeri   		ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATCCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCRACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGACAAATG [...]
+
+	Thomomys_townsendii_townsendii   	ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTYGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAA [...]
+
+	Thomomys_townsendii_relictus   		??????????????G-AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTAYTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCACTATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAATGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAATTGCTACATGATAAWGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAAT [...]
+
+	Thomomys_umbrinus_chihuahuae   		?????????????AG-AGC-ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCTTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAAT [...]
+
+	Thomomys_umbrinus_atroavarius   	ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGCATTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGKCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGYCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAAYGTCAGACCGGAAACCGTGAAATTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTCGATAAAT [...]
+
+
+;
+
+
+END;
diff --git a/examples/nexus/humanChimpSNP.nex b/examples/nexus/humanChimpSNP.nex
new file mode 100644
index 0000000..655f79c
--- /dev/null
+++ b/examples/nexus/humanChimpSNP.nex
@@ -0,0 +1,19 @@
+#NEXUS
+
+begin characters;
+	dimensions nchar=484 ntax=6;
+	format symbols = "012";
+	matrix
+Chimp			0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111	
+San			    0000000000000000000000000000000000000000000000000000000000000000000000000000000011111111111111111111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222222222222222222222222222222222222222222222222200000000000000000000000000000000000000000000000000000000000000000000000000000000011111111111111111111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222222222222222222222222222222222222222222222222				
+Yoruba		    0000000000000000000000000011111111111111111111111111122222222222222222222222222200000000000000000000000000011111111111111111111111111122222222222222222222222222200000000000000000000000000011111111111111111111111111122222222222222222222222222200000000000000000000000000011111111111111111111111111122222222222222222222222222200000000000000000000000000011111111111111111111111111122222222222222222222222222200000000000000000000000000011111111111111111111111111122222222222222222222222222			
+European		0000000011111111122222222200000000011111111122222222200000000011111111122222222200000000011111111122222222200000000011111111122222222200000000011111111122222222200000000011111111122222222200000000011111111122222222200000000011111111122222222200000000011111111122222222200000000011111111122222222200000000011111111122222222200000000011111111122222222200000000011111111122222222200000000011111111122222222200000000011111111122222222200000000011111111122222222200000000011111111122222222		 	
+Han		 	    0011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011122200011 [...]
+Korean 		    1201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201201
+End;
+
+begin assumptions;
+wtset MyWeights (VECTOR) = 1517 141 1526 487 159 151 161 84 2340 357 74 331 307 155 85 127 116 227 96 40 98 114 88 33 66 157 3896 202 39 253 178 59 34 66 43 394 143 41 149 154 91 44 74 118 88 47 20 65 91 70 29 65 202 284 44 14 27 40 17 5 20 23 72 27 5 32 35 25 6 34 58 28 14 11 14 32 36 8 31 201 5058 141 34 166 141 39 34 41 50 249 88 27 87 81 46 14 33 59 77 29 9 42 45 40 23 35 111 639 97 16 90 101 45 24 33 45 132 56 26 72 119 73 23 61 100 50 35 12 43 71 68 18 79 300 133 28 9 25 37 20 3 19 [...]
+end;
+
+
diff --git a/examples/nexus/old.nex b/examples/nexus/old.nex
new file mode 100644
index 0000000..bb6df7b
--- /dev/null
+++ b/examples/nexus/old.nex
@@ -0,0 +1,25 @@
+#nexus
+
+BEGIN Taxa;
+DIMENSIONS ntax=1;
+TAXLABELS
+[1] cae
+;
+END; [Taxa]
+
+BEGIN Characters;
+DIMENSIONS nchar=4;
+format datatype=standard
+        missing=?
+        gap=- 
+        symbols="01"
+        labels=left
+        transpose=no
+        interleave=no
+;
+MATRIX
+cae    1000
+;
+END; [Characters]
+
+
diff --git a/examples/nexus/primate-mtDNA-interleaved.nex b/examples/nexus/primate-mtDNA-interleaved.nex
new file mode 100644
index 0000000..6520d36
--- /dev/null
+++ b/examples/nexus/primate-mtDNA-interleaved.nex
@@ -0,0 +1 @@
+#NEXUS

[!Data from:
	Hayasaka, K., T. Gojobori, and S. Horai. 1988. Molecular phylogeny
		and evolution of primate mitochondrial DNA. Mol. Biol. Evol.
		5:626-644.
]

begin taxa;
	dimensions ntax=12;
	taxlabels
Lemur_catta	
Homo_sapiens
Pan
Gorilla
Pongo
Hylobates
Macaca_fuscata
M._mulatta
M._fascicularis 
M._sylvanus
Saimiri_sciureus
Tarsius_syrichta
;
end;

begin characters;
	dimensions nchar=898;
	format missing=? gap=- matchchar=. interleave datatype=dna;
	options gapmode=missing;
	matrix

Lemur_catta      AAGCTTCATAGGAGCAACCATTCTAATAATCGCACATGGCCTTACATCATCCATATTATT
Homo_sapiens     AAGCTTCACCGGCGCAGTCATTCTCATAATCGCCCACGGGCTTACATCCTCATTACTATT
Pan              AAGCTTCACCGGCGCAATTATCCTCATAATCGCCCACGGACTTACATCCTCATTATTATT
Gorilla          AAGCTTCACCGGCGCAGTTGTTCTTATAATTGCCCACGGACTTACATCATCATTATTATT
Pongo            AAGCTTCACCGGCGCAACCACCCTCATGATTGCCCATGGACTCACATCCTCCCTACTGTT
Hylobates        AAGCTTTACAGGTGCAACCGTCCTCATAATCGCCCACGGACTAACCTCTTCCCTGCTATT
Macaca_fuscata   AAGCTTTTCCGGCGCAACCATCCTTATGATCGCTCACGGACTCACCTCTTCCATATATTT
M._mulatta       AAGCTTTTCTGGCGCAACCATCCTCATGATTGCTCACGGACTCACCTCTTCCATATATTT
M._fascicularis  AAGCTTCTCCGGCGCAACCACCCTTATAATCGCCCACGGGCTCACCTCTTCCATGTATTT
M._sylvanus      AAGCTTCTCCGGTGCAACTATCCTTATAGTTGCCCATGGACTCACCTCTTCCATATACTT
Saimiri_sciureus AAGCTTCACCGGCGCAATGATCCTAATAATCGCTCACGGGTTTACTTCGTCTATGCTATT
Tarsius_syrichta AAGTTTCATTGGAGCCACCACTCTTATAATTGCCCATGGCCTCACCTCCTCCCTATTATT

Lemur_catta      CTGTCTAGCCAACTCTAACTACGAACGAATCCATAGCCGTACAATACTACTAGCACGAGG
Homo_sapiens     CTGCCTAGCAAACTCAAACTACGAACGCACTCACAGTCGCATCATAATCCTCTCTCAAGG
Pan              CTGCCTAGCAAACTCAAATTATGAACGCACCCACAGTCGCATCATAATTCTCTCCCAAGG
Gorilla          CTGCCTAGCAAACTCAAACTACGAACGAACCCACAGCCGCATCATAATTCTCTCTCAAGG
Pongo            CTGCCTAGCAAACTCAAACTACGAACGAACCCACAGCCGCATCATAATCCTCTCTCAAGG
Hylobates        CTGCCTTGCAAACTCAAACTACGAACGAACTCACAGCCGCATCATAATCCTATCTCGAGG
Macaca_fuscata   CTGCCTAGCCAATTCAAACTATGAACGCACTCACAACCGTACCATACTACTGTCCCGAGG
M._mulatta       CTGCCTAGCCAATTCAAACTATGAACGCACTCACAACCGTACCATACTACTGTCCCGGGG
M._fascicularis  CTGCTTGGCCAATTCAAACTATGAGCGCACTCATAACCGTACCATACTACTATCCCGAGG
M._sylvanus      CTGCTTGGCCAACTCAAACTACGAACGCACCCACAGCCGCATCATACTACTATCCCGAGG
Saimiri_sciureus CTGCCTAGCAAACTCAAATTACGAACGAATTCACAGCCGAACAATAACATTTACTCGAGG
Tarsius_syrichta TTGCCTAGCAAATACAAACTACGAACGAGTCCACAGTCGAACAATAGCACTAGCCCGTGG

Lemur_catta      GATCCAAACCATTCTCCCTCTTATAGCCACCTGATGACTACTCGCCAGCCTAACTAACCT
Homo_sapiens     ACTTCAAACTCTACTCCCACTAATAGCTTTTTGATGACTTCTAGCAAGCCTCGCTAACCT
Pan              ACTTCAAACTCTACTCCCACTAATAGCCTTTTGATGACTCCTAGCAAGCCTCGCTAACCT
Gorilla          ACTCCAAACCCTACTCCCACTAATAGCCCTTTGATGACTTCTGGCAAGCCTCGCCAACCT
Pongo            CCTTCAAACTCTACTCCCCCTAATAGCCCTCTGATGACTTCTAGCAAGCCTCACTAACCT
Hylobates        GCTCCAAGCCTTACTCCCACTGATAGCCTTCTGATGACTCGCAGCAAGCCTCGCTAACCT
Macaca_fuscata   ACTTCAAATCCTACTTCCACTAACAGCCTTTTGATGATTAACAGCAAGCCTTACTAACCT
M._mulatta       ACTTCAAATCCTACTTCCACTAACAGCTTTCTGATGATTAACAGCAAGCCTTACTAACCT
M._fascicularis  ACTTCAAATTCTACTTCCATTGACAGCCTTCTGATGACTCACAGCAAGCCTTACTAACCT
M._sylvanus      ACTCCAAATCCTACTCCCACTAACAGCCTTCTGATGATTCACAGCAAGCCTTACTAATCT
Saimiri_sciureus GCTCCAAACACTATTCCCGCTTATAGGCCTCTGATGACTCCTAGCAAATCTCGCTAACCT
Tarsius_syrichta CCTTCAAACCCTATTACCTCTTGCAGCAACATGATGACTCCTCGCCAGCTTAACCAACCT

Lemur_catta      AGCCCTACCCACCTCTATCAATTTAATTGGCGAACTATTCGTCACTATAGCATCCTTCTC
Homo_sapiens     CGCCTTACCCCCCACTATTAACCTACTGGGAGAACTCTCTGTGCTAGTAACCACGTTCTC
Pan              CGCCCTACCCCCTACCATTAATCTCCTAGGGGAACTCTCCGTGCTAGTAACCTCATTCTC
Gorilla          CGCCTTACCCCCCACCATTAACCTACTAGGAGAGCTCTCCGTACTAGTAACCACATTCTC
Pongo            TGCCCTACCACCCACCATCAACCTTCTAGGAGAACTCTCCGTACTAATAGCCATATTCTC
Hylobates        CGCCCTACCCCCCACTATTAACCTCCTAGGTGAACTCTTCGTACTAATGGCCTCCTTCTC
Macaca_fuscata   TGCCCTACCCCCCACTATCAATCTACTAGGTGAACTCTTTGTAATCGCAACCTCATTCTC
M._mulatta       TGCCCTACCCCCCACTATCAACCTACTAGGTGAACTCTTTGTAATCGCGACCTCATTCTC
M._fascicularis  TGCCCTACCCCCCACTATTAATCTACTAGGCGAACTCTTTGTAATCACAACTTCATTTTC
M._sylvanus      TGCTCTACCCTCCACTATTAATCTACTGGGCGAACTCTTCGTAATCGCAACCTCATTTTC
Saimiri_sciureus CGCCCTACCCACAGCTATTAATCTAGTAGGAGAATTACTCACAATCGTATCTTCCTTCTC
Tarsius_syrichta GGCCCTTCCCCCAACAATTAATTTAATCGGTGAACTGTCCGTAATAATAGCAGCATTTTC

Lemur_catta      ATGATCAAACATTACAATTATCTTAATAGGCTTAAATATGCTCATCACCGCTCTCTATTC
Homo_sapiens     CTGATCAAATATCACTCTCCTACTTACAGGACTCAACATACTAGTCACAGCCCTATACTC
Pan              CTGATCAAATACCACTCTCCTACTCACAGGATTCAACATACTAATCACAGCCCTGTACTC
Gorilla          CTGATCAAACACCACCCTTTTACTTACAGGATCTAACATACTAATTACAGCCCTGTACTC
Pongo            TTGATCTAACATCACCATCCTACTAACAGGACTCAACATACTAATCACAACCCTATACTC
Hylobates        CTGGGCAAACACTACTATTACACTCACCGGGCTCAACGTACTAATCACGGCCCTATACTC
Macaca_fuscata   CTGATCCCATATCACCATTATGCTAACAGGACTTAACATATTAATTACGGCCCTCTACTC
M._mulatta       CTGGTCCCATATCACCATTATATTAACAGGATTTAACATACTAATTACGGCCCTCTACTC
M._fascicularis  CTGATCCCATATCACCATTGTGTTAACGGGCCTTAATATACTAATCACAGCCCTCTACTC
M._sylvanus      CTGATCCCACATCACCATCATACTAACAGGACTGAACATACTAATTACAGCCCTCTACTC
Saimiri_sciureus TTGATCCAACTTTACTATTATATTCACAGGACTTAATATACTAATTACAGCACTCTACTC
Tarsius_syrichta ATGGTCACACCTAACTATTATCTTAGTAGGCCTTAACACCCTTATCACCGCCCTATATTC

Lemur_catta      CCTCTATATATTAACTACTACACAACGAGGAAAACTCACATATCATTCGCACAACCTAAA
Homo_sapiens     CCTCTACATATTTACCACAACACAATGGGGCTCACTCACCCACCACATTAACAACATAAA
Pan              CCTCTACATGTTTACCACAACACAATGAGGCTCACTCACCCACCACATTAATAACATAAA
Gorilla          CCTTTATATATTTACCACAACACAATGAGGCCCACTCACACACCACATCACCAACATAAA
Pongo            TCTCTATATATTCACCACAACACAACGAGGTACACCCACACACCACATCAACAACATAAA
Hylobates        CCTTTACATATTTATCATAACACAACGAGGCACACTTACACACCACATTAAAAACATAAA
Macaca_fuscata   TCTCCACATATTCACTACAACACAACGAGGAACACTCACACATCACATAATCAACATAAA
M._mulatta       CCTCCACATATTCACCACAACACAACGAGGAGCACTCACACATCACATAATCAACATAAA
M._fascicularis  TCTCCACATGTTCATTACAGTACAACGAGGAACACTCACACACCACATAATCAATATAAA
M._sylvanus      TCTTCACATATTCACCACAACACAACGAGGAGCGCTCACACACCACATAATTAACATAAA
Saimiri_sciureus ACTTCATATGTATGCCTCTACACAGCGAGGTCCACTTACATACAGCACCAGCAATATAAA
Tarsius_syrichta CCTATATATACTAATCATAACTCAACGAGGAAAATACACATATCATATCAACAATATCAT

Lemur_catta      CCCATCCTTTACACGAGAAAACACCCTTATATCCATACACATACTCCCCCTTCTCCTATT
Homo_sapiens     ACCCTCATTCACACGAGAAAACACCCTCATGTTCATACACCTATCCCCCATTCTCCTCCT
Pan              GCCCTCATTCACACGAGAAAATACTCTCATATTTTTACACCTATCCCCCATCCTCCTTCT
Gorilla          ACCCTCATTTACACGAGAAAACATCCTCATATTCATGCACCTATCCCCCATCCTCCTCCT
Pongo            ACCTTCTTTCACACGCGAAAATACCCTCATGCTCATACACCTATCCCCCATCCTCCTCTT
Hylobates        ACCCTCACTCACACGAGAAAACATATTAATACTTATGCACCTCTTCCCCCTCCTCCTCCT
Macaca_fuscata   GCCCCCCTTCACACGAGAAAACACATTAATATTCATACACCTCGCTCCAATTATCCTTCT
M._mulatta       ACCCCCCTTCACACGAGAAAACATATTAATATTCATACACCTCGCTCCAATCATCCTCCT
M._fascicularis  ACCCCCCTTCACACGAGAAAACATATTAATATTCATACACCTCGCTCCAATTATCCTTCT
M._sylvanus      ACCACCTTTCACACGAGAAAACATATTAATACTCATACACCTCGCTCCAATTATTCTTCT
Saimiri_sciureus ACCAATATTTACACGAGAAAATACGCTAATATTTATACATATAACACCAATCCTCCTCCT
Tarsius_syrichta GCCCCCTTTCACCCGAGAAAATACATTAATAATCATACACCTATTTCCCTTAATCCTACT

Lemur_catta      TACCTTAAACCCCAAAATTATTCTAGGACCCACGTACTGTAAATATAGTTTAAA-AAAAC
Homo_sapiens     ATCCCTCAACCCCGACATCATTACCGGGTTTTCCTCTTGTAAATATAGTTTAACCAAAAC
Pan              ATCCCTCAATCCTGATATCATCACTGGATTCACCTCCTGTAAATATAGTTTAACCAAAAC
Gorilla          ATCCCTCAACCCCGATATTATCACCGGGTTCACCTCCTGTAAATATAGTTTAACCAAAAC
Pongo            ATCCCTCAACCCCAGCATCATCGCTGGGTTCGCCTACTGTAAATATAGTTTAACCAAAAC
Hylobates        AACCCTCAACCCTAACATCATTACTGGCTTTACTCCCTGTAAACATAGTTTAATCAAAAC
Macaca_fuscata   ATCCCTCAACCCCAACATCATCCTGGGGTTTACCTCCTGTAGATATAGTTTAACTAAAAC
M._mulatta       ATCTCTCAACCCCAACATCATCCTGGGGTTTACTTCCTGTAGATATAGTTTAACTAAAAC
M._fascicularis  ATCTCTCAACCCCAACATCATCCTGGGGTTTACCTCCTGTAAATATAGTTTAACTAAAAC
M._sylvanus      ATCTCTTAACCCCAACATCATTCTAGGATTTACTTCCTGTAAATATAGTTTAATTAAAAC
Saimiri_sciureus TACCTTGAGCCCCAAGGTAATTATAGGACCCTCACCTTGTAATTATAGTTTAGCTAAAAC
Tarsius_syrichta ATCTACCAACCCCAAAGTAATTATAGGAACCATGTACTGTAAATATAGTTTAAACAAAAC

Lemur_catta      ACTAGATTGTGAATCCAGAAATAGAAGCTCAAAC-CTTCTTATTTACCGAGAAAGTAATG
Homo_sapiens     ATCAGATTGTGAATCTGACAACAGAGGCTTA-CGACCCCTTATTTACCGAGAAAGCT-CA
Pan              ATCAGATTGTGAATCTGACAACAGAGGCTCA-CGACCCCTTATTTACCGAGAAAGCT-TA
Gorilla          ATCAGATTGTGAATCTGATAACAGAGGCTCA-CAACCCCTTATTTACCGAGAAAGCT-CG
Pongo            ATTAGATTGTGAATCTAATAATAGGGCCCCA-CAACCCCTTATTTACCGAGAAAGCT-CA
Hylobates        ATTAGATTGTGAATCTAACAATAGAGGCTCG-AAACCTCTTGCTTACCGAGAAAGCC-CA
Macaca_fuscata   ACTAGATTGTGAATCTAACCATAGAGACTCA-CCACCTCTTATTTACCGAGAAAACT-CG
M._mulatta       ATTAGATTGTGAATCTAACCATAGAGACTTA-CCACCTCTTATTTACCGAGAAAACT-CG
M._fascicularis  ATTAGATTGTGAATCTAACTATAGAGGCCTA-CCACTTCTTATTTACCGAGAAAACT-CG
M._sylvanus      ATTAGACTGTGAATCTAACTATAGAAGCTTA-CCACTTCTTATTTACCGAGAAAACT-TG
Saimiri_sciureus ATTAGATTGTGAATCTAATAATAGAAGAATA-TAACTTCTTAATTACCGAGAAAGTG-CG
Tarsius_syrichta ATTAGATTGTGAGTCTAATAATAGAAGCCCAAAGATTTCTTATTTACCAAGAAAGTA-TG

Lemur_catta      TATGAACTGCTAACTCTGCACTCCGTATATAAAAATACGGCTATCTCAACTTTTAAAGGA
Homo_sapiens     CAAGAACTGCTAACTCATGCCCCCATGTCTAACAACATGGCTTTCTCAACTTTTAAAGGA
Pan              TAAGAACTGCTAATTCATATCCCCATGCCTGACAACATGGCTTTCTCAACTTTTAAAGGA
Gorilla          TAAGAGCTGCTAACTCATACCCCCGTGCTTGACAACATGGCTTTCTCAACTTTTAAAGGA
Pongo            CAAGAACTGCTAACTCTCACT-CCATGTGTGACAACATGGCTTTCTCAGCTTTTAAAGGA
Hylobates        CAAGAACTGCTAACTCACTATCCCATGTATGACAACATGGCTTTCTCAACTTTTAAAGGA
Macaca_fuscata   CAAGGACTGCTAACCCATGTACCCGTACCTAAAATTACGGTTTTCTCAACTTTTAAAGGA
M._mulatta       CGAGGACTGCTAACCCATGTATCCGTACCTAAAATTACGGTTTTCTCAACTTTTAAAGGA
M._fascicularis  CAAGGACTGCTAATCCATGCCTCCGTACTTAAAACTACGGTTTCCTCAACTTTTAAAGGA
M._sylvanus      CAAGGACCGCTAATCCACACCTCCGTACTTAAAACTACGGTTTTCTCAACTTTTAAAGGA
Saimiri_sciureus CAAGAACTGCTAATTCATGCTCCCAAGACTAACAACTTGGCTTCCTCAACTTTTAAAGGA
Tarsius_syrichta CAAGAACTGCTAACTCATGCCTCCATATATAACAATGTGGCTTTCTT-ACTTTTAAAGGA

Lemur_catta      TAGAAGTAATCCATTGGCCTTAGGAGCCAAAAA-ATTGGTGCAACTCCAAATAAAAGTAA
Homo_sapiens     TAACAGCTATCCATTGGTCTTAGGCCCCAAAAATTTTGGTGCAACTCCAAATAAAAGTAA
Pan              TAACAGCCATCCGTTGGTCTTAGGCCCCAAAAATTTTGGTGCAACTCCAAATAAAAGTAA
Gorilla          TAACAGCTATCCATTGGTCTTAGGACCCAAAAATTTTGGTGCAACTCCAAATAAAAGTAA
Pongo            TAACAGCTATCCCTTGGTCTTAGGATCCAAAAATTTTGGTGCAACTCCAAATAAAAGTAA
Hylobates        TAACAGCTATCCATTGGTCTTAGGACCCAAAAATTTTGGTGCAACTCCAAATAAAAGTAA
Macaca_fuscata   TAACAGCTATCCATTGACCTTAGGAGTCAAAAACATTGGTGCAACTCCAAATAAAAGTAA
M._mulatta       TAACAGCTATCCATTGACCTTAGGAGTCAAAAATATTGGTGCAACTCCAAATAAAAGTAA
M._fascicularis  TAACAGCTATCCATTGACCTTAGGAGTCAAAAACATTGGTGCAACTCCAAATAAAAGTAA
M._sylvanus      TAACAGCTATCCATTGGCCTTAGGAGTCAAAAATATTGGTGCAACTCCAAATAAAAGTAA
Saimiri_sciureus TAGTAGTTATCCATTGGTCTTAGGAGCCAAAAACATTGGTGCAACTCCAAATAAAAGTAA
Tarsius_syrichta TAGAAGTAATCCATCGGTCTTAGGAACCGAAAA-ATTGGTGCAACTCCAAATAAAAGTAA

Lemur_catta      TAAATCTATTATCCTCTTTCACCCTTGTCACACTGATTATCCTAACTTTACCTATCATTA
Homo_sapiens     TAACCATGCACACTACTATAACCACCCTAACCCTGACTTCCCTAATTCCCCCCATCCTTA
Pan              TAACCATGTATACTACCATAACCACCTTAACCCTAACTCCCTTAATTCTCCCCATCCTCA
Gorilla          TAACTATGTACGCTACCATAACCACCTTAGCCCTAACTTCCTTAATTCCCCCTATCCTTA
Pongo            CAGCCATGTTTACCACCATAACTGCCCTCACCTTAACTTCCCTAATCCCCCCCATTACCG
Hylobates        TAGCAATGTACACCACCATAGCCATTCTAACGCTAACCTCCCTAATTCCCCCCATTACAG
Macaca_fuscata   TAATCATGCACACCCCCATCATTATAACAACCCTTATCTCCCTAACTCTCCCAATTTTTG
M._mulatta       TAATCATGCACACCCCTATCATAATAACAACCCTTATCTCCCTAACTCTCCCAATTTTTG
M._fascicularis  TAATCATGCACACCCCCATCATAATAACAACCCTCATCTCCCTGACCCTTCCAATTTTTG
M._sylvanus      TAATCATGTATACCCCCATCATAATAACAACTCTCATCTCCCTAACTCTTCCAATTTTCG
Saimiri_sciureus TA---ATACACTTCTCCATCACTCTAATAACACTAATTAGCCTACTAGCGCCAATCCTAG
Tarsius_syrichta TAAATTTATTTTCATCCTCCATTTTACTATCACTTACACTCTTAATTACCCCATTTATTA

Lemur_catta      TAAACGTTACAAACATATACAAAAACTACCCCTATGCACCATACGTAAAATCTTCTATTG
Homo_sapiens     CCACCCTCGTTAACCCTAACAAAAAAAACTCATACCCCCATTATGTAAAATCCATTGTCG
Pan              CCACCCTCATTAACCCTAACAAAAAAAACTCATATCCCCATTATGTGAAATCCATTATCG
Gorilla          CCACCTTCATCAATCCTAACAAAAAAAGCTCATACCCCCATTACGTAAAATCTATCGTCG
Pongo            CTACCCTCATTAACCCCAACAAAAAAAACCCATACCCCCACTATGTAAAAACGGCCATCG
Hylobates        CCACCCTTATTAACCCCAATAAAAAGAACTTATACCCGCACTACGTAAAAATGACCATTG
Macaca_fuscata   CCACCCTCATCAACCCTTACAAAAAACGTCCATACCCAGATTACGTAAAAACAACCGTAA
M._mulatta       CCACCCTCATCAACCCTTACAAAAAACGTCCATACCCAGATTACGTAAAAACAACCGTAA
M._fascicularis  CCACCCTCACCAACCCCTATAAAAAACGTTCATACCCAGACTACGTAAAAACAACCGTAA
M._sylvanus      CTACCCTTATCAACCCCAACAAAAAACACCTATATCCAAACTACGTAAAAACAGCCGTAA
Saimiri_sciureus CTACCCTCATTAACCCTAACAAAAGCACACTATACCCGTACTACGTAAAACTAGCCATCA
Tarsius_syrichta TTACAACAACTAAAAAATATGAAACACATGCATACCCTTACTACGTAAAAAACTCTATCG

Lemur_catta      CATGTGCCTTCATCACTAGCCTCATCCCAACTATATTATTTATCTCCTCAGGACAAGAAA
Homo_sapiens     CATCCACCTTTATTATCAGTCTCTTCCCCACAACAATATTCATGTGCCTAGACCAAGAAG
Pan              CGTCCACCTTTATCATTAGCCTTTTCCCCACAACAATATTCATATGCCTAGACCAAGAAG
Gorilla          CATCCACCTTTATCATCAGCCTCTTCCCCACAACAATATTTCTATGCCTAGACCAAGAAG
Pongo            CATCCGCCTTTACTATCAGCCTTATCCCAACAACAATATTTATCTGCCTAGGACAAGAAA
Hylobates        CCTCTACCTTTATAATCAGCCTATTTCCCACAATAATATTCATGTGCACAGACCAAGAAA
Macaca_fuscata   TATATGCTTTCATCATCAGCCTCCCCTCAACAACTTTATTCATCTTCTCAAACCAAGAAA
M._mulatta       TATATGCTTTCATCATCAGCCTCCCCTCAACAACTTTATTCATCTTCTCAAACCAAGAAA
M._fascicularis  TATATGCTTTTATTACCAGTCTCCCCTCAACAACCCTATTCATCCTCTCAAACCAAGAAA
M._sylvanus      TATATGCTTTCATTACCAGCCTCTCTTCAACAACTTTATATATATTCTTAAACCAAGAAA
Saimiri_sciureus TCTACGCCCTCATTACCAGTACCTTATCTATAATATTCTTTATCCTTACAGGCCAAGAAT
Tarsius_syrichta CCTGCGCATTTATAACAAGCCTAGTCCCAATGCTCATATTTCTATACACAAATCAAGAAA

Lemur_catta      CAATCATTTCCAACTGACATTGAATAACAATCCAAACCCTAAAACTATCTATTAGCTT
Homo_sapiens     TTATTATCTCGAACTGACACTGAGCCACAACCCAAACAACCCAGCTCTCCCTAAGCTT
Pan              CTATTATCTCAAACTGGCACTGAGCAACAACCCAAACAACCCAGCTCTCCCTAAGCTT
Gorilla          CTATTATCTCAAGCTGACACTGAGCAACAACCCAAACAATTCAACTCTCCCTAAGCTT
Pongo            CCATCGTCACAAACTGATGCTGAACAACCACCCAGACACTACAACTCTCACTAAGCTT
Hylobates        CCATTATTTCAAACTGACACTGAACTGCAACCCAAACGCTAGAACTCTCCCTAAGCTT
Macaca_fuscata   CAACCATTTGGAGCTGACATTGAATAATGACCCAAACACTAGACCTAACGCTAAGCTT
M._mulatta       CAACCATTTGAAGCTGACATTGAATAATAACCCAAACACTAGACCTAACACTAAGCTT
M._fascicularis  CAACCATTTGGAGTTGACATTGAATAACAACCCAAACATTAGACCTAACACTAAGCTT
M._sylvanus      CAATCATCTGAAGCTGGCACTGAATAATAACCCAAACACTAAGCCTAACATTAAGCTT
Saimiri_sciureus CAATAATTTCAAACTGACACTGAATAACTATCCAAACCATCAAACTATCCCTAAGCTT
Tarsius_syrichta TAATCATTTCCAACTGACATTGAATAACGATTCATACTATCAAATTATGCCTAAGCTT
	;
end;

begin assumptions;
	charset coding = 2-457 660-896;
	charset noncoding = 1 458-659 897-898;
	charset 1stpos = 2-457\3 660-896\3;
	charset 2ndpos = 3-457\3 661-896\3;
	charset 3rdpos = 4-457\3 662-.\3;
	
	exset coding = noncoding;
	exset noncoding = coding;
	
	usertype 2_1 = 4		[weights transversions 2 times transitions]
		a  c  g  t
	[a]	.  2  1  2
	[c] 2  .  2  1
	[g]	1  2  .  2
	[t]	2  1  2  .
		;
	usertype 3_1 = 4		[weights transversions 3 times transitions]
		a  c  g  t
	[a]	.  3  1  3
	[c] 3  .  3  1
	[g]	1  3  .  3
	[t]	3  1  3  .
		;
		
	taxset hominoids = Homo_sapiens Pan Gorilla Pongo Hylobates;
end;

begin paup;
	constraints ch = ((Homo_sapiens,Pan));
	constraints chg = ((Homo_sapiens,Pan,Gorilla));
end;
\ No newline at end of file
diff --git a/examples/nexus/primate-mtDNA.nex b/examples/nexus/primate-mtDNA.nex
new file mode 100644
index 0000000..bf738b4
--- /dev/null
+++ b/examples/nexus/primate-mtDNA.nex
@@ -0,0 +1 @@
+#NEXUS

[!Data from:
	Hayasaka, K., T. Gojobori, and S. Horai. 1988. Molecular phylogeny
		and evolution of primate mitochondrial DNA. Mol. Biol. Evol.
		5:626-644.
]

begin taxa;
	dimensions ntax=12;
	taxlabels
Lemur_catta	
Homo_sapiens
Pan
Gorilla
Pongo
Hylobates
Macaca_fuscata
M._mulatta
M._fascicularis 
M._sylvanus
Saimiri_sciureus
Tarsius_syrichta
;
end;

begin characters;
	dimensions nchar=898;
	format missing=? gap=- matchchar=. datatype=dna;
	options gapmode=missing;
	matrix
[                                                                                                                      1                                                                                                   2                                                                                                   3                                                                                                   4                                                                          [...]
[                            1         2         3         4         5         6         7         8         9         0         1         2         3         4         5         6         7         8         9         0         1         2         3         4         5         6         7         8         9         0         1         2         3         4         5         6         7         8         9         0         1         2         3         4         5         6         7    [...]
[                   12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123 [...]

Lemur_catta         AAGCTTCATAGGAGCAACCATTCTAATAATCGCACATGGCCTTACATCATCCATATTATTCTGTCTAGCCAACTCTAACTACGAACGAATCCATAGCCGTACAATACTACTAGCACGAGGGATCCAAACCATTCTCCCTCTTATAGCCACCTGATGACTACTCGCCAGCCTAACTAACCTAGCCCTACCCACCTCTATCAATTTAATTGGCGAACTATTCGTCACTATAGCATCCTTCTCATGATCAAACATTACAATTATCTTAATAGGCTTAAATATGCTCATCACCGCTCTCTATTCCCTCTATATATTAACTACTACACAACGAGGAAAACTCACATATCATTCGCACAACCTAAACCCATCCTTTACACGAGAAAACACCCTTATATCCATACACATACTCCCCCTTCTCCTATTTACCTTAAACCCCAAAATTATTCTAGGACCCACGTACTGTAAATATAGTTTAA [...]
Homo_sapiens        ........CC..C...GT......C........C..C..G........C..AT..C.......C.....A.....A...........C.CT..C..T..C.TC...A.C..CT.T.A...AC.T.....TC.A.....A..A.....TTTT........T..A..A.....CG.......C...T.....C..A....T..CC..C.G..A.....C.CT..GCTAG..A.CA.G.....C........T..C..TC.CC.AC.T.C...AC.C..C..A..AG....A..C..A..C........C.....T..C..A......T.G..CTC......CC.C..CATTA.....A....A..C..A..C.................C..G.T.......C..TC....A.......CC.AT..C.C......G.C..C...ACC..GTTTT.C.CT................ [...]
Pan                 ........CC..C....TT..C..C........C..C..A........C..AT..........C.....A.....A..T..T.....C.C...C..T..C.TC...A.T..CT.C.A...AC.T.....TC.A.....A..A......TTT........C..A..A.....CG.......C.........C.TA.C..T...C.CC.A..G.....C.C...GCTAG..A.C..A.....C........T.CC..TC.CC.AC.C.C...A..C..C..A..A.....A..C..G..C........C..G..T..C..A......T....CTC......CC.C..CATTA.T...A....G..C..A..C...........T..T..C....TTT.....C..TC....A.C.....TC.AT..C.C..T..TG.T..C..CACT...TT...C.C................. [...]
Gorilla             ........CC..C...GTTG....T.....T..C..C..A...........AT..........C.....A.....A.............C...C.....C.TC...A.T..CT.T.A...AC........C.A.....A..A......CTT........T..G..A.....CG.C.....C...T.....C..A.C..T..CC..C.A..A..G..C.C...ACTAG..A.CA.A.....C..........CC..CC..T.AC.T.C...A.CT..C..A..A..T..A..C..G..C.....T........T..C..A......T....CCC.......C.C..CATCAC....A....A..C..A................T...C....T...G...C..TC....A.C.....CC.AT..C.C......G.T.....CACC..GTT...C.C................. [...]
Pongo               ........CC..C.......CC..C..G..T..C.....A..C.....C...C..C.G.....C.....A.....A.............C...C.....C.TC...A.C..CT.T.A...CC.T.....TC.A.....C..A......CT.........T..A..A.....C........T........AC..A.C.....CC.TC.A..A.....C.C...ACTA.....CATA.....T.....T.....C..C..CC.AC...C...AC.C..C..A..A.....AA.C..A..C..T...........C..C..A...........T.C..C....C.C..CATCA.....A....A..T..T..C.....C.....T.....C..GCT.......C..TC....A.C.....C..AT..C.C.......GC..C..CGCT..GTT.G.C................... [...]
Hylobates           ......T.C...T......G.C..C........C..C..A..A..C..T...C.GC.......C..T..A.....A.............CT..C.....C.TC...A.C...T.T......C.....G..T.A.....A..G......TT.........CGCA..A.....CG.......C.........C..A....T..CC.CC.A..T.....C.....ACTA..G..C........C..GG......C...T....CAC.C.CC..GC.C..CG.A..A.....G..C..A..C.....T..C.....T.TC.TA...........C.C...T...C.C..CATTA.A...A....A..C..AC.C.............TAT.A...CTT..G...C.CT.......C.....CC.A...C.C.....T..C..C...ACT..CTTT..TCC.......C......... [...]
Macaca_fuscata      ......TTCC..C........C..T..G.....T..C..A..C..C..T.......AT.....C........T..A.....T.....C.CT..C.A......C........GT.C.....AC.T....T.C.A..T..A..A.C....TTT......T..ACA..A.....T........T.........C..A........C..C.A..T.....C..T..A.TCGC.A.C..A.....C.....CC.T..C..C.....GC...C...AC.T..C..AT.A..T..G..C.....C..T...C.C.....C.....A.............C.......C....CATAAT....A....G..CC....C..............AT.A....T.......C.CGCT..AA..A....TC.AT..C.C........C..C..C..G..GTTT..C.C.....G........... [...]
M._mulatta          ......TTCT..C........C..C..G..T..T..C..A..C..C..T.......AT.....C........T..A.....T.....C.CT..C.A......C........GT.C..G..AC.T....T.C.A..T..A..A.C...TTT.......T..ACA..A.....T........T.........C..A.......CC..C.A..T.....C..T..A.TCGCGA.C..A.....C..G..CC.T..C..C.....A....C...A..T..C..A..A..T..G..C.....C......C.C.....C..C..A............GC.......C....CATAAT....A....A..CC....C.............TAT.A....T.......C.CGCT..AA.CA....CC.AT.TC.C........C..C..C..G..GTTT..T.C.....G........... [...]
M._fascicularis     .......TCC..C.......CC..T........C..C..G..C..C..T.....G.AT.....CT.G.....T..A.....T..G..C.CT....A......C.........T.C.....AC.T....TTC.A..T..AT.G.C....TT.........CACA..A.....T........T.........C..A....T...C..C.A........C..T..A.TC.C.A.T..A..T..C.....CC.T..C..C...G.G....CG...C.T.....A..A.....A..C.....C..T...C.C..G..C.T...AGT...........C.......C.C..CATAAT...TA....A..CC....C.............TAT.A....T.......C.CGCT..AA..A....TC.AT.TC.C........C..C..C..G..GTTT..C.C................. [...]
M._sylvanus         .......TCC..T.....T..C..T...G.T..C.....A..C..C..T.......AC.....CT.G........A...........C.C...C.....C.TC.........T.C.....AC......T.C.A.....A..A.C....TT.......T.CACA..A.....T.....T..T..T......T..A....T...C..C.G........C.....A.TCGC.A.C..A..T..C.....CC....C..C..C..AC...C...AC.G..C..A..A..T..A..C.....C..T..TC.C.....C..C..A............GCG......C.C..CATAATT...A....A...C.T..C.............TAT.A...CT.......C.CGCT..AA..A.T..TC.AT.TC.T........C..C.........TTT..T.C................. [...]
Saimiri_sciureus    ........CC..C....TG..C...........T..C..GT....T..G..T..GC.......C.....A.....A..T...........T..C.....A......AC.T.TA.T......C.......AC.AT....G.......G.CT.........C..A..A.AT..CG.......C...........AG....T...C..G.A..A...T..C..ACA.TCG..T.T........T.....C...T....T.....A..C.C...AC.T.....A..A..T..A..A.....C..A..TC....G.ATG.CT.......G.....TCC...T.....CAGCA.CAG...TA....A...ATA..............T..G..A....TT.....T...ACA..AA.C.....CC.......G.G......GG.A...A........T.ACCT.....T.........G [...]
Tarsius_syrichta    ...T.....T.....C....C...T.....T..C........C..C..C...C.......T..C.....A..TA.A............G....C..T..A......GC......C..T..CC.T......C.AT.A......GC...A..A........C.........T....C.....G.....T...C.AA.A..T........C..T.....G.C...A.TA......G.A..T.....G...C..C.A..T.........G.....C.T..C.CC..T........C..A........A......C...TC.TA..T............TA..........ATCA....TA.C.TG..CC.T..C..C........T..AT.A...AT.......C..T.T...T.AA.....C.AT.TACC.........G.A...A.....A...T.................... [...]
	;
end;

begin assumptions;
	charset coding = 2-457 660-896;
	charset noncoding = 1 458-659 897-898;
	charset 1stpos = 2-457\3 660-896\3;
	charset 2ndpos = 3-457\3 661-896\3;
	charset 3rdpos = 4-457\3 662-.\3;
	
	exset coding = noncoding;
	exset noncoding = coding;
	
	usertype 2_1 = 4		[weights transversions 2 times transitions]
		a  c  g  t
	[a]	.  2  1  2
	[c] 2  .  2  1
	[g]	1  2  .  2
	[t]	2  1  2  .
		;
	usertype 3_1 = 4		[weights transversions 3 times transitions]
		a  c  g  t
	[a]	.  3  1  3
	[c] 3  .  3  1
	[g]	1  3  .  3
	[t]	3  1  3  .
		;
		
	taxset hominoids = Homo_sapiens Pan Gorilla Pongo Hylobates;
end;

begin paup;
	constraints ch = ((Homo_sapiens,Pan));
	constraints chg = ((Homo_sapiens,Pan,Gorilla));
end;

\ No newline at end of file
diff --git a/examples/nexus/protein.nex b/examples/nexus/protein.nex
new file mode 100644
index 0000000..54d1bd7
--- /dev/null
+++ b/examples/nexus/protein.nex
@@ -0,0 +1,54 @@
+#NEXUS 
+# source: http://wiki.christophchamp.com/index.php/NEXUS_file_format
+
+Begin data;
+Dimensions ntax=10 nchar=234;
+Format datatype=protein gap=- interleave;
+Matrix
+Cow     MAYPMQLGFQDATSPIMEELLHFHDHTLMIVFLISSLVLYIISLMLTTKLTHTSTMDAQE
+Carp    MAHPTQLGFKDAAMPVMEELLHFHDHALMIVLLISTLVLYIITAMVSTKLTNKYILDSQE
+Chicken MANHSQLGFQDASSPIMEELVEFHDHALMVALAICSLVLYLLTLMLMEKLS-SNTVDAQE
+Human   MAHAAQVGLQDATSPIMEELITFHDHALMIIFLICFLVLYALFLTLTTKLTNTNISDAQE
+Loach   MAHPTQLGFQDAASPVMEELLHFHDHALMIVFLISALVLYVIITTVSTKLTNMYILDSQE
+Mouse   MAYPFQLGLQDATSPIMEELMNFHDHTLMIVFLISSLVLYIISLMLTTKLTHTSTMDAQE
+Rat     MAYPFQLGLQDATSPIMEELTNFHDHTLMIVFLISSLVLYIISLMLTTKLTHTSTMDAQE
+Seal    MAYPLQMGLQDATSPIMEELLHFHDHTLMIVFLISSLVLYIISLMLTTKLTHTSTMDAQE
+Whale   MAYPFQLGFQDAASPIMEELLHFHDHTLMIVFLISSLVLYIITLMLTTKLTHTSTMDAQE
+Frog    MAHPSQLGFQDAASPIMEELLHFHDHTLMAVFLISTLVLYIITIMMTTKLTNTNLMDAQE
+
+Cow     VETIWTILPAIILILIALPSLRILYMMDEINNPSLTVKTMGHQWYWSYEYTDYEDLSFDS
+Carp    IEIVWTILPAVILVLIALPSLRILYLMDEINDPHLTIKAMGHQWYWSYEYTDYENLGFDS
+Chicken VELIWTILPAIVLVLLALPSLQILYMMDEIDEPDLTLKAIGHQWYWTYEYTDFKDLSFDS
+Human   METVWTILPAIILVLIALPSLRILYMTDEVNDPSLTIKSIGHQWYWTYEYTDYGGLIFNS
+Loach   IEIVWTVLPALILILIALPSLRILYLMDEINDPHLTIKAMGHQWYWSYEYTDYENLSFDS
+Mouse   VETIWTILPAVILIMIALPSLRILYMMDEINNPVLTVKTMGHQWYWSYEYTDYEDLCFDS
+Rat     VETIWTILPAVILILIALPSLRILYMMDEINNPVLTVKTMGHQWYWSYEYTDYEDLCFDS
+Seal    VETVWTILPAIILILIALPSLRILYMMDEINNPSLTVKTMGHQWYWSYEYTDYEDLNFDS
+Whale   VETVWTILPAIILILIALPSLRILYMMDEVNNPSLTVKTMGHQWYWSYEYTDYEDLSFDS
+Frog    IEMVWTIMPAISLIMIALPSLRILYLMDEVNDPHLTIKAIGHQWYWSYEYTNYEDLSFDS
+
+Cow     YMIPTSELKPGELRLLEVDNRVVLPMEMTIRMLVSSEDVLHSWAVPSLGLKTDAIPGRLN
+Carp    YMVPTQDLAPGQFRLLETDHRMVVPMESPVRVLVSAEDVLHSWAVPSLGVKMDAVPGRLN
+Chicken YMTPTTDLPLGHFRLLEVDHRIVIPMESPIRVIITADDVLHSWAVPALGVKTDAIPGRLN
+Human   YMLPPLFLEPGDLRLLDVDNRVVLPIEAPIRMMITSQDVLHSWAVPTLGLKTDAIPGRLN
+Loach   YMIPTQDLTPGQFRLLETDHRMVVPMESPIRILVSAEDVLHSWALPAMGVKMDAVPGRLN
+Mouse   YMIPTNDLKPGELRLLEVDNRVVLPMELPIRMLISSEDVLHSWAVPSLGLKTDAIPGRLN
+Rat     YMIPTNDLKPGELRLLEVDNRVVLPMELPIRMLISSEDVLHSWAIPSLGLKTDAIPGRLN
+Seal    YMIPTQELKPGELRLLEVDNRVVLPMEMTIRMLISSEDVLHSWAVPSLGLKTDAIPGRLN
+Whale   YMIPTSDLKPGELRLLEVDNRVVLPMEMTIRMLVSSEDVLHSWAVPSLGLKTDAIPGRLN
+Frog    YMIPTNDLTPGQFRLLEVDNRMVVPMESPTRLLVTAEDVLHSWAVPSLGVKTDAIPGRLH
+
+Cow     QTTLMSSRPGLYYGQCSEICGSNHSFMPIVLELVPLKYFEKWSASML-------
+Carp    QAAFIASRPGVFYGQCSEICGANHSFMPIVVEAVPLEHFENWSSLMLEDASLGS
+Chicken QTSFITTRPGVFYGQCSEICGANHSYMPIVVESTPLKHFEAWSSL------LSS
+Human   QTTFTATRPGVYYGQCSEICGANHSFMPIVLELIPLKIFEM-------GPVFTL
+Loach   QTAFIASRPGVFYGQCSEICGANHSFMPIVVEAVPLSHFENWSTLMLKDASLGS
+Mouse   QATVTSNRPGLFYGQCSEICGSNHSFMPIVLEMVPLKYFENWSASMI-------
+Rat     QATVTSNRPGLFYGQCSEICGSNHSFMPIVLEMVPLKYFENWSASMI-------
+Seal    QTTLMTMRPGLYYGQCSEICGSNHSFMPIVLELVPLSHFEKWSTSML-------
+Whale   QTTLMSTRPGLFYGQCSEICGSNHSFMPIVLELVPLEVFEKWSVSML-------
+Frog    QTSFIATRPGVFYGQCSEICGANHSFMPIVVEAVPLTDFENWSSSML-EASL--
+	;
+End;
+
+
diff --git a/examples/nexus/seaview.nxs b/examples/nexus/seaview.nxs
new file mode 100644
index 0000000..c6b105d
--- /dev/null
+++ b/examples/nexus/seaview.nxs
@@ -0,0 +1,606 @@
+#NEXUS
+[saved by seaview on Mon Mar 16 15:43:12 2009]
+BEGIN DATA;
+  DIMENSIONS NTAX=54 NCHAR=456;
+  FORMAT DATATYPE=DNA
+  GAP=-
+  ;
+MATRIX
+[1] D82069.PE1
+---------atgaagcctgaggaaatttcaagaggaaaagcttttggactgctgaaagcc
+caacaggaagagaggttggatgggatcaacaagcacttcctcgatgatcccaagtacagc
+agtgatgaggatctgcagtccaaactggaggccttcaagacgaagtacatggagtttgat
+ctgaatggcaatggagatatcgatattatgtccttgaagcgaatgctggagaaacttggg
+gttcccaagacccatctagagctgaagaaattaattagagaggtgtccagtggctccgag
+---gagacgttcagttactctgactttctcagaatgatgctgggcaagagatctgccatc
+ttgagaatgattctgatgtatgaggagaaaaacaaagaacaccag---aagccaactggt
+cccccagccaagaaagctatttctgagttgccctaa
+[2] 'AB019540.AIF-1'
+------------atggacagcacagctcaaggaggtaaagcatttggtcttctcaagtct
+caccaggaagaaaaattgaactctatcaatgaggcttttctctcagatccccaatatgca
+gaagaggaagacctcagctcaaagcttgaagcatttaaaaagaaatacatggagtttgat
+cttaacgacaaaggagaaatagatattatgggtttgaaacggatgctggaaaaactcgga
+ttggccaagactcacttggagctgaaaaagatgatgtcagaggtctgtggaggaacatcg
+aaagaaactttcggctaccacgacttcctgaatatgatgctgggaaaaagaaatgcaatt
+ctaaaactgatcttgatgtttgaaggcatgggaaaggagcacgagtccaaagatgcggca
+ccacctcctcgcaaaaccttttcagacctgccctga
+[3] AB000818.PE1
+------atgagccagagcaaggatttgcagggaggaaaagcttttggactgctgaaagcc
+cagcaggaagagaggttggatgggatcaacaagcacttcctcgatgatcccaagtacagc
+agtgatgaggatctgcagtccaaactggaggccttcaagacgaagtacatggagtttgat
+ctgaatggcaatggagatatcgatattatgtccttgaagcgaatgctggagaaacttggg
+gttcccaagacccatctagagctgaagaaattaattagagaggtgtccagtggctccgag
+---gagacgttcagttactctgactttctcagaatgatgctgggcaagagatctgccatc
+ttgagaatgattctgatgtatgaggagaaaaacaaagaacaccag---aagccaactggt
+cccccagccaagaaagctatttctgagttgccctaa
+[4] AB012309.PE1
+------atgccttccaaccagaatttacaaggcgggaaagccttcgggttactcaaagca
+cagcagagggagaagctggatgaaatcaataaggagtttatggaagatcagaagtaccgg
+gatgaagaggatttgcaagagaagctagattcttttaaaaataaatatgctgagtttgac
+ctgaacgatcagggggatatcgacatgatgggcttgaagcgaatgatggagaagttgggt
+gtgccaaagactcacctggagatgaagaaaatgatctcagaggtgacaggaggttgcagc
+---gacaccatcaactacagggactttgtgaaaatgatgcttggcaagcgatcagctgtt
+ctcaaactggttatgatgtttgaagacaaagctaatgaggccagcggtaaacccgatgga
+cccccacccaagcgtgacatcaccacccttccataa
+[5] 'AB013745.AIF-1'
+------atgagccaaagcagggatttgcagggaggaaaagcttttggactgctgaaggcc
+cagcaggaagagaggctggaggggatcaacaagcaattcctcgatgatcccaaatacagc
+aatgatgaggatctgccgtccaaacttgaagccttcaaggtgaagtacatggagtttgat
+ctgaatggaaatggagatatcgatattatgtccttgaagcgaatgctggagaaacttggg
+gttcccaagacccacctagagctgaagagattaattagagaggtgtccagtggctccgag
+---gagacgttcagctactctgactttctcagaatgatgctgggcaagagatctgccatc
+ttgagaatgattctgatgtatgaggagaaaaacaaagaacacaag---aggccaactggt
+cccccagccaagaaagctatctccgagctgccctga
+[6] AB035322
+atgtcggtcgcactcagcaacaggttccaaggagggaaggcgttcggtttgctcaaagcc
+cggcaggagaagaggctcgaggagatcaatcgggagttcctctgtgaccagaagtacagt
+gatgaagagaacctgccggaaaagctcgcagccttcaaagagaaatacatggagtttgac
+ctgaataatgaaggcgagattgatctgatgtctttaaagaggatgatggagaagctgggg
+gtccccaagacccacctggagatgaagaagatgatctcggaggtgacagggggtgtcagt
+---gacaccatctcctaccgagactttgtgaatatgatgctgggcaagcggtcggctgtc
+ctcaagctggtcatgatgtttgaaggaaaagccaacgagagcagcccgaagccagctggc
+ccacctccagagcgagacatcgccagcctgccttga
+[7] AB036423.IBA1
+---------atgaagcctgaggagatttcaagaggaaaagcttttggactgctgaaggcc
+cagcaggaagagaggctggaggggatcaacaagcaattcctcgatgatcccaaatacagc
+aatgatgaggatctgccgtccaaacttgaagccttcaaggtgaagtacatggagtttgat
+ctgaatggaaatggagatatcgatattatgtccttgaagcgaatgctggagaaacttggg
+gttcccaagacccacctagagctgaagagattaattagagaggtgtccagtggctccgag
+---gagacgttcagctactctgactttctcagaatgatgctgggcaagagatctgccatc
+ttgagaatgattctgatgtatgaggagaaaaacaaagaacacaag---aggccaactggt
+cccccagccaagaaagctatctccgagctgccctga
+[8] AB036423.PE2
+------atgagccaaagcagggatttgcagggaggaaaagcttttggactgctgaaggcc
+cagcaggaagagaggctggaggggatcaacaagcaattcctcgatgatcccaaatacagc
+aatgatgaggatctgccgtccaaacttgaagccttcaaggtgaagtacatggagtttgat
+ctgaatggaaatggagatatcgatattatgtccttgaagcgaatgctggagaaacttggg
+gttcccaagacccacctagagctgaagagattaattagagaggtgtccagtggctccgag
+---gagacgttcagctactctgactttctcagaatgatgctgggcaagagatctgccatc
+ttgagaatgattctgatgtatgaggagaaaaacaaagaacacaag---aggccaactggt
+cccccagccaagaaagctatctccgagctgccctga
+[9] AB094629.IBA2
+atgtcggtcgcactcagcaacaggttccaaggagggaaggcgttcggtttgctcaaagcc
+cggcaggagaagaggctcgaggagatcaatcgggagttcctctgtgaccagaagtacagt
+gatgaagagaacctgccggaaaagctcgcagccttcaaagagaaatacatggagtttgac
+ctgaataatgaaggcgagattgatctgatgtctttaaagaggatgatggagaagctgggg
+gtccccaagacccacctggagatgaagaagatgatctcggaggtgacagggggtgtcagt
+---gacaccatctcctaccgagactttgtgaatatgatgctgggcaagcggtcggctgtc
+ctcaagctggtcatgatgtttgaaggaaaagccaacgagagcagcccgaagccagctggc
+ccacctccagagcgagacatcgccagcctgccttga
+[10] AB128049.AIF1
+------atgagccaaaccagggatttacagggaggaaaagctttcggactgctgaaggcc
+cagcaggaagagaggctggatgagatcaacaagcaatttctagatgatcccaaatacagc
+agtgatgaggatctgctctccaaactggaaggcttcaaagagaaatacatggagtttgac
+cttaatggaaacggcgatattgatatcatgtccctgaagcgaatgctggagaaacttggg
+gtccccaagactcacctagagctaaagaaattaattggagaggtgtccagtggctccggg
+---gagacgttcagctaccctgactttctcaggatgatgctgggcaagagatctgccatt
+ctaaaaatgatcctgatgtatgaggaaaaagcgagagaaaaggaa---aagccaacaggc
+cccccagccaagaaagctatttctgagttgccctga
+[11] AF074959.PE1
+------atgagccaaagcagggatttgcagggaggaaaagcttttggactgctgaaggcc
+cagcaggaagagaggctggaggggatcaacaagcaattcctcgatgatcccaaatacagc
+aatgatgaggatctgccgtccaaacttgaagccttcaaggtgaagtacatggagtttgat
+ctgaatggaaatggagatatcgatattatgtccttgaagcgaatgctggagaaacttggg
+gttcccaagacccacctagagctgaagagattaattagagaggtgtccagtggctccgag
+---gagacgttcagctactctgactttctcagaatgatgctgggcaagagatctgccatc
+ttgagaatgattctgatgtatgaggagaaaaacaaagaacacaag---aggccaactggt
+cccccagccaagaaagctatctccgagctgccctga
+[12] AF109719.PE7
+------atgagccaaagcagggatttgcagggaggaaaagcttttggactgctgaaggcc
+cagcaggaagagaggctggaggggatcaacaagcaattcctcgatgatcccaaatacagc
+aatgatgaggatctgccgtccaaacttgaagccttcaaggtgaagtacatggagtttgat
+ctgaatggaaatggagatatcgatattatgtccttgaagcgaatgctggagaaacttggg
+gttcccaagacccacctagagctgaagagattaattagagaggtgtccagtggctccgag
+---gagacgttcagctactctgactttctcagaatgatgctgggcaagagatctgccatc
+ttgagaatgattctgatgtatgaggagaaaaacaaagaacacaag---aggccaactggt
+cccccagccaagaaagctatctccgagctgccctga
+[13] AF129756.PE18
+------atgagccaaaccagggatttacagggaggaaaagctttcagactgctgaaggcc
+cagcaggaagagaggctggatgagatcaacaagcaattcctagacgatcccaaatatagc
+agtgatgaggatctgccctccaaactggaaggcttcaaagagaaatacatggagtttgac
+cttaatggaaatggcgatattgatatcatgtccctgaaacgaatgctggagaaacttgga
+gtccccaagactcacctagagctaaagaaattaattggagaggtgtccagtggctccggg
+---gagacgttcagctaccctgactttctcaggatgatgctgggcaagagatctgccatc
+ctaaaaatgatcctgatgtatgaggaaaaagcgagagaaaaggaa---aagccaacaggc
+cccccagccaagaaagctatctctgagttgccctga
+[14] AF348450.PE1
+------atgagcgaaactagggatttacagggaggaaaagcctttgggctgcggaaagcc
+cagcaggaagagagaatcaatgaaatcaaccagcaattcctggatgatcccaaatacagc
+agtgatgaggacctgccctccaaactggaagccttcaagaagaaatacatggagtttgac
+ctgaatgaagatggaggtatcgatatcatgtccctgaagcgaatgatggagaaacttggg
+gttcccaagacccacctggagctaaagaaattaatcatggaggtatccagtggccctggg
+---gagactttcagctactctgactttctcaagatgatgttgggcaagagatctgccatt
+ctaaaaatgatcctgatgtatgaagagaaagcaagagaacaggag---aagccaacaggt
+ctcccagccaagaaagctatctctgagttgccctga
+[15] AJ506968.AIF1
+------------atggagaaaaatgttcaaggaggcaaagcgtatggacttctcaaaagt
+caccaggaagagaaactgaactcgatcaatgaggcttttcagtcagatcctcaatatgcc
+gaagaggaggaccttggctccaaacttgaaatgtttaaaaataaatacatggagtttgat
+ctcaatgatcaaggagacatagacataatggggttaaaacggatgcttgaaaaacttgga
+gtggccaagactcacctagaactgaaaaagatgatgtcagaggtgattggtggggcctcg
+aaagacacaatcagctaccacgacttcctaaatatgatgctggggaaaagaaatgcaatt
+ctcaaactgatcctgatgtttgaaggaatggggaaggagcaggagtcaaaagtcgttggt
+ccacctggtcgcaaaaccttttcagacctgccctga
+[16] AK006184.PE1
+------atgagccaaagcagggatttgcagggaggaaaagcttttggactgctgaaggcc
+cagcaggaagagaggctggaggggatcaacaagcaattcctcgatgatcccaaatacagc
+aatgatgaggatctgccgtccaaacttgaagccttcaaggtgaagtacatggagtttgat
+ctgaatggaaatggagatatcgatattatgtccttgaagcgaatgctggagaaacttggg
+gttcccaagacccacctagagctgaagagattaattagagaggtgtccagtggctccgag
+---gagacgttcagctactctgactttctcagaatgatgctgggcaagagatctgccatc
+ttgagaatgattctgatgtatgaggagaaaaacaaagaacacaag---aggccaactggt
+cccccagccaagaaagctatctccgagctgccctga
+[17] AK006562.PE1
+------atgagccaaagcagggatttgcagggaggaaaagcttttggactgctgaaggcc
+cagcaggaagagaggctggaggggatcaacaagcaattcctcgatgatcccaaatacagc
+aatgatgaggatctgccgtccaaacttgaagccttcaaggtgaagtacatggagtttgat
+ctgaatggaaatggagatatcgatattatgtccttgaagcgaatgctggagaaacttggg
+gttcccaagacccacctagagctgaagagattaattagagaggtgtccagtggctccgag
+---gagacgttcagctactctgactttctcagaatgatgctgggcaagagatctgccatc
+ttgagaatgattctgatgtatgaggagaaaaacaaagaacacaag---aggccaactggt
+cccccagccaagaaagctatctccgagctgccctga
+[18] AK022845.PE1
+atgtcgggcgagctcagcaacaggttccaaggagggaaggcgttcggcttgctcaaagcc
+cggcaggagaggaggctggccgagatcaaccgggagcttctgtgtgaccagaagtacagt
+gatgaagagaaccttccagaaaagctcacagccttcaaagagaagtacatggagtttgac
+ctgaacaatgaaggcgagattgacctgatgtctttaaagaggatgatggagaagcttggt
+gtccccaagacccacctggagatgaagaagatgatctcagaggtgacaggaggggtcagt
+---gacactatatcctaccgagactttgtgaacatgatgctggggaaacggtcggctgtc
+ctcaagttagtcatgatgtttgaaggaaaagccaacgagagcagccccaagccagttggc
+ccccctccagagagagacattgctagcctgccctga
+[19] AK028955.PE1
+atgtcggtcgcactcagcaacaggttccaaggagggaaggcgttcggtttgctcaaagcc
+cggcaggagaagaggctcgaggagatcaatcgggagttcctctgtgaccagaagtacagt
+gatgaagagaacctgccggaaaagctcgcagccttcaaagagaaatacatggagtttgac
+ctgaataatgaaggcgagattgatctgatgtctttaaagaggatgatggagaagctgggg
+gtccccaagacccacctggagatgaagaagatgatctcggaggtgacagggggtgtcagt
+---gacaccatctcctaccgagactttgtgaataagatgctgggcaagcggtcggctgtc
+ctcaagctggtcatgatgtttgaaggaaaagccaacgagagcagcccgaagccagctggc
+ccacctccagagcgagacatcgccagcctgccttga
+[20] AK045539.PE1
+atgtcggtcgcactcagcaacaggttccaaggagggaaggcgttcggtttgctcaaagcc
+cggcaggagaagaggctcgaggagatcaatcgggagttcctctgtgaccagaagtacagt
+gatgaagagaacctgccggaaaagctcgcagccttcaaagagaaatacatggagtttgac
+ctgaataatgaaggcgagattgatctgatgtctttaaagaggatgatggagaagctgggg
+gtccccaagacccacctggagatgaagaagatgatctcggaggtgacagggggtgtcagt
+---gacaccatctcctaccgagactttgtgaatatgatgctgggcaagcggtcggctgtc
+ctcaagctggtcatgatgtttgaaggaaaagccaacgagagcagcccgaagccagctggc
+ccacctccagagcgagacatcgccagcctgccttga
+[21] AK091912.PE1
+atgtcgggcgagctcagcaacaggttccaaggagggaaggcgttcggcttgctcaaagcc
+cggcaggagaggaggctggccgagatcaaccgggagtttctgtgtgaccagaagtacagt
+gatgaagagaaccttccagaaaagctcacagccttcaaagagaagtacatggagttt---
+---------------------gacctgatgtctttaaagaggatgatggagaagcttggt
+gtccccaagacccacctggagatgaagaagatgatctcagaggtgacaggaggggtcagt
+---gacactatatcctaccgagactttgtgaacatgatgctggggaaacggtcggctgtc
+ctcaagttagtcatgatgtttgaaggaaaagccaacgagagcagccccaagccagttggc
+ccccctccagagagagacattgctagcctgccctga
+[22] AL136566.PE1
+atgtcgggcgagctcagcaacaggttccaaggagggaaggcgttcggcttgctcaaagcc
+cggcaggagaggaggctggccgagatcaaccgggagtttctgtgtgaccagaagtacagt
+gatgaagagaaccttccagaaaagctcacagccttcaaagagaagtacatggagtttgac
+ctgaacaatgaaggcgagattgacctgatgtctttaaagaggatgatggagaagcttggt
+gtccccaagacccacctggagatgaagaagatgatctcagaggtgacaggaggggtcagt
+---gacactatatcctaccgagactttgtgaacatgatgctggggaaacggtcggctgtc
+ctcaagttagtcatgatgtttgaaggaaaagccaacgagagcagccccaagccagttggc
+ccccctccagagagagacattgctagcctgccctga
+[23] AL157938.PE2
+atgtcgggcgagctcagcaacaggttccaaggagggaaggcgttcggcttgctcaaagcc
+cggcaggagaggaggctggccgagatcaaccgggagtttctgtgtgaccagaagtacagt
+gatgaagagaaccttccagaaaagctcacagccttcaaagagaagtacatggagtttgac
+ctgaacaatgaaggcgagattgacctgatgtctttaaagaggatgatggagaagcttggt
+gtccccaagacccacctggagatgaagaagatgatctcagaggtgacaggaggggtcagt
+---gacactatatcctaccgagactttgtgaacatgatgctggggaaacggtcggctgtc
+ctcaagttagtcatgatgtttgaaggaaaagccaacgagagcagccccaagccagttggc
+ccccctccagagagagacattgctagcctgccctga
+[24] AL157938.PE3
+atgtcgggcgagctcagcaacaggttccaaggagggaaggcgttcggcttgctcaaagcc
+cggcaggagaggaggctggccgagatcaaccgggagtttctgtgtgaccagaagtacagt
+gatgaagagaaccttccagaaaagctcacagccttcaaagagaagtacatggagttt---
+---------------------gacctgatgtctttaaagaggatgatggagaagcttggt
+gtccccaagacccacctggagatgaagaagatgatctcagaggtgacaggaggggtcagt
+---gacactatatcctaccgagactttgtgaacatgatgctggggaaacggtcggctgtc
+ctcaagttagtcatgatgtttgaaggaaaagccaacgagagcagccccaagccagttggc
+ccccctccagagagagacattgctagcctgccctga
+[25] AL662801.PE45
+------atgagccaaaccagggatttacagggaggaaaagctttcggactgctgaaggcc
+cagcaggaagagaggctggatgagatcaacaagcaattcctagacgatcccaaatatagc
+agtgatgaggatctgccctccaaactggaaggcttcaaagagaaatacatggagtttgac
+cttaatggaaatggcgatattgatatcatgtccctgaaacgaatgctggagaaacttgga
+gtccccaagactcacctagagctaaagaaattaattggagaggtgtccagtggctccggg
+---gagacgttcagctaccctgactttctcaggatgatgctgggcaagagatctgccatc
+ctaaaaatgatcctgatgtatgaggaaaaagcgagagaaaaggaa---aagccaacaggc
+cccccagccaagaaagctatctctgagttgccctga
+[26] AL662847.AIF1
+------atgagccaaaccagggatttacagggaggaaaagctttcggactgctgaaggcc
+cagcaggaagagaggctggatgagatcaacaagcaattcctagacgatcccaaatatagc
+agtgatgaggatctgccctccaaactggaaggcttcaaagagaaatacatggagtttgac
+cttaatggaaatggcgatattgatatcatgtccctgaaacgaatgctggagaaacttgga
+gtccccaagactcacctagagctaaagaaattaattggagaggtgtccagtggctccggg
+---gagacgttcagctaccctgactttctcaggatgatgctgggcaagagatctgccatc
+ctaaaaatgatcctgatgtatgaggaaaaagcgagagaaaaggaa---aagccaacaggc
+cccccagccaagaaagctatctctgagttgccctga
+[27] AL805934.AIF1
+------atgagccaaaccagggatttacagggaggaaaagctttcggactgctgaaggcc
+cagcaggaagagaggctggatgagatcaacaagcaattcctagacgatcccaaatatagc
+agtgatgaggatctgccctccaaactggaaggcttcaaagagaaatacatggagtttgac
+cttaatggaaatggcgatattgatatcatgtccctgaaacgaatgctggagaaacttgga
+gtccccaagactcacctagagctaaagaaattaattggagaggtgtccagtggctccggg
+---gagacgttcagctaccctgactttctcaggatgatgctgggcaagagatctgccatc
+ctaaaaatgatcctgatgtatgaggaaaaagcgagagaaaaggaa---aagccaacaggc
+cccccagccaagaaagctatctctgagttgccctga
+[28] AL833896.PE1
+atgtcgggcgagctcagcaacaggttccaaggagggaaggcgttcggcttgctcaaagcc
+cggcaggagaggaggctggccgagatcaaccgggagtttctgtgtgaccagaagtacagt
+gatgaagagaaccttccagaaaagctcacagccttcaaagagaagtacatggagtttgac
+ctgaacaatgaaggcgagattgacctgatgtctttaaagaggatgatggagaagcttggt
+gtccccaagacccacctggagatgaagaagatgatctcagaggtgacaggaggggtcagt
+---gacactatatcctaccgagactttgtgaacatgatgctggggaaacggtcggctgtc
+ctcaagttagtcatgatgtttgaaggaaaagccaacgagagcagccccaagccagttggc
+ccccctccagagagagacattgctagcctgccctga
+[29] AL928893.PE3
+atgtcggtcgcactcagcaacaggttccaaggagggaaggcgttcggtttgctcaaagcc
+cggcaggagaagaggctcgaggagatcaatcgggagttcctctgtgaccagaagtacagt
+gatgaagagaacctgccggaaaagctcgcagccttcaaagagaaatacatggagtttgac
+ctgaataatgaaggcgagattgatctgatgtctttaaagaggatgatggagaagctgggg
+gtccccaagacccacctggagatgaagaagatgatctcggaggtgacagggggtgtcagt
+---gacaccatctcctaccgagactttgtgaatatgatgctgggcaagcggtcggctgtc
+ctcaagctggtcatgatgtttgaaggaaaagccaacgagagcagcccgaagccagctggc
+ccacctccagagcgagacatcgccagcctgccttga
+[30] AY359067.PE1
+atgtcgggcgagctcagcaacaggttccaaggagggaaggcgttcggcttgctcaaagcc
+cggcaggagaggaggctggccgagatcaaccgggagtttctgtgtgaccagaagtacagt
+gatgaagagaaccttccagaaaagctcacagccttcaaagagaagtacatggagtttgac
+ctgaacaatgaaggcgagattgacctgatgtctttaaagaggatgatggagaagcttggt
+gtccccaagacccacctggagatgaagaagatgatctcagaggtgacaggaggggtcagt
+---gacactatatcctaccgagactttgtgaacatgatgctggggaaacggtcggctgtc
+ctcaagttagtcatgatgtttgaaggaaaagccaacgagagcagccccaagccagttggc
+ccccctccagagagagacattgctagcctgccctga
+[31] BA000025.AIF1
+------atgagccaaaccagggatttacagggaggaaaagctttcggactgctgaaggcc
+cagcaggaagagaggctggatgagatcaacaagcaattcctagacgatcccaaatatagc
+agtgatgaggatctgccctccaaactggaaggcttcaaagagaaatacatggagtttgac
+cttaatggaaatggcgatattgatatcatgtccctgaaacgaatgctggagaaacttgga
+gtccccaagactcacctagagctaaagaaattaattggagaggtgtccagtggctccggg
+---gagacgttcagctaccctgactttctcaggatgatgctgggcaagagatctgccatc
+ctaaaaatgatcctgatgtatgaggaaaaagcgagagaaaaggaa---aagccaacaggc
+cccccagccaagaaagctatctctgagttgccctga
+[32] BC009474.AIF1
+------atgagccaaaccagggatttacagggaggaaaagctttcggactgctgaaggcc
+cagcaggaagagaggctggatgagatcaacaagcaattcctagacgatcccaaatatagc
+agtgatgaggatctgccctccaaactggaaggcttcaaagagaaatacatggagtttgac
+cttaatggaaatggcgatattgatatcatgtccctgaaacgaatgctggagaaacttgga
+gtccccaagactcacctagagctaaagaaattaattggagaggtgtccagtggctccggg
+---gagacgttcagctaccctgactttctcaggatgatgctgggcaagagatctgccatc
+ctaaaaatgatcctgatgtatgaggaaaaagcgagagaaaaggaa---aagccaacaggc
+cccccagccaagaaagctatctctgagttgccctga
+[33] BC021539.PE1
+------atgagccaaagcagggatttgcagggaggaaaagcttttggactgctgaaggcc
+cagcaggaagagaggctggaggggatcaacaagcaattcctcgatgatcccaaatacagc
+aatgatgaggatctgccgtccaaacttgaagccttcaaggtgaaatacatggagtttgat
+ctgaatggaaatggagatatcgatattatgtccttgaagcgaatgctggagaaacttggg
+gttcccaagacccacctagagctgaagagattaattagagaggtgtccagtggctccgag
+---gagacgttcagctactctgactttctcagaatgatgctgggcaagagatctgccatc
+ttgagaatgattctgatgtatgaggagaaaaacaaagaacacaag---aggccaactggt
+cccccagccaagaaagctatctccgagctgccctga
+[34] BC024599.PE1
+atgtcggtcgcactcagcaacaggttccaaggagggaaggcgttcggtttgctcaaagcc
+cggcaggagaagaggctcgaggagatcaatcgggagttcctctgtgaccagaagtacagt
+gatgaagagaacctgccggaaaagctcgcagccttcaaagagaaatacatggagtttgac
+ctgaataatgaaggcgagattgatctgatgtctttaaagaggatgatggagaagctgggg
+gtccccaagacccacctggagatgaagaagatgatctcggaggtgacagggggtgtcagt
+---gacaccatctcctaccgagactttgtgaatatgatgctgggcaagcggtcggctgtc
+ctcaagctggtcatgatgtttgaaggaaaagccaacgagagcagcccgaagccagctggc
+ccacctccagagcgagacatcgccagcctgccttga
+[35] BC073304.MGC8069
+------atgtcttctaataacattaaacaaggtggcaaagctttcgtgatccaaaaggca
+cagcaggagcacagactagaggaggtgaacaaggagttccttaaagatgaaaaatacaag
+gatgatgaggacttggataaaaaactgatgtcctttaaaaaaaagtacatggaatttgac
+cttaaccaacaaggagagctggatatgatgggcctcaagaaaatgttggagaatctggga
+gccgctaagacccatttagaagttaagaaattgatatatgaagtgacaggaggcaaaagt
+---gaggcaatcagctatcaggattttgtaaccatgatgcttggaaaacgttcagccata
+atgaaatttatcatgatgtttgagggaaaaaatgaagtcacaagtcccaagcccatgggt
+ccaccaccaaagagagacatcagcagcctaccctga
+[36] BC074259.MGC8401
+------atgtcttccaataacattaaacaaggtggcaaagctttcgtgatccaaaaggcg
+cagcaggagcacagactggaggaggtgaacaaggagttccttaaagatgaaaaatacaag
+gatgacgaggacttggataaaaaactgatgtcctttaaaaaaaagtacatggaatttgac
+cttaaccaccaaggagagctggatatgatgggcctgaagaaaatgatggagaacctggga
+gctgctaaaacccatttagaagttaagaaactgatatatgaagtgacgggaggcaaaagt
+---gaggcaatcagctaccgggattttgtaaccatgatgctgggaaaacgttctgccgtg
+atgaaatttatcatgatgtttgagggaaaaaatgaagtcacatgtcccaagccaaagggt
+ccaccacccaagagagacatcagcagccttccctga
+[37] BC084814.MGC8401
+------atgtcttccaataacattaaacaaggtggcaaagctttcgtgatccaaaaggcg
+cagcaggagcacagactggaggaggtgaacaaggagttccttaaagatgaaaaatacaag
+gatgacgaggacttggataaaaaactgatgtcctttaaaaaaaagtacatggaatttgac
+cttaaccaccaaggagagctggatatgatgggcctgaagaaaatgatggagaacctggga
+gctgctaaaacccatttagaagttaagaaactgatatatgaagtgacgggaggcaaaagt
+---gaggcaatcagctaccgggattttgtaaccatgatgctgggaaaacgttctgccgtg
+atgaaatttatcatgatgtttgagggaaaaaatgaagtcacatgtcccaagccaaagggt
+ccaccacccaagagagacatcagcagccttccctga
+[38] BC102890.AIF1
+------atgagcgaaactagggatttacagggaggaaaagcctttgggctgcggaaagcc
+cagcaggaagagagaatcaatgaaatcaaccagcaattcctggatgatcccaaatacagc
+agtgatgaggacctgccctccaaactggaagccttcaagaagaaatacatggagtttgac
+ctgaatgaagatggaggtatcgatatcatgtccctgaagcgaatgatggagaaacttggg
+gttcccaagacccacctggagctaaagaaattaatcatggaggtatccagtggccctggg
+---gagactttcagctactctgactttctcaagatgatgttgggcaagagatctgccatt
+ctaaaaatgatcctgatgtatgaagagaaagcaagagaacaggag---aagccaacaggt
+ctcccagccaagaaagctatctctgagttgccctga
+[39] BC126840.C9ORF58
+atgtcggtcgcgttcagcaacaggttccaaggagggaaagccttcggtttgctcaaagcc
+cggcaggagaggaggctggccgagatcaaccgggagttcctctgcgaccaaaagtacagt
+gatgaagagaacctgccggaaaagctcacagcctttaaagagaagtacatggagtttgac
+ctgaacaatgagggagagattgatctgatgtctttgaagaggatgatggagaagcttggg
+gtccccaagacccacctggagatgaagaagatgatctcggaggtgacaggtggggtcagc
+---gacaccatctcctaccgagacttcgtgaacatgatgctggggaagcggtcggcggtc
+cttaagctagtcatgatgtttgaaggaaaagccaacgaaggcagctccaagccagtcggg
+ccccctccagagagagacatcgccagcctgccctga
+[40] BX248305.PE3
+------atgagccaaaccagggatttacagggaggaaaagctttcggactgctgaaggcc
+cagcaggaagagaggctggatgagatcaacaagcaattcctagacgatcccaaatatagc
+agtgatgaggatctgccctccaaactggaaggcttcaaagagaaatacatggagtttgac
+cttaatggaaatggcgatattgatatcatgtccctgaaacgaatgctggagaaacttgga
+gtccccaagactcacctagagctaaagaaattaattggagaggtgtccagtggctccggg
+---gagacgttcagctaccctgactttctcaggatgatgctgggcaagagatctgccatc
+ctaaaaatgatcctgatgtatgaggaaaaagcgagagaaaaggaa---aagccaacaggc
+cccccagccaagaaagctatctctgagttgccctga
+[41] BX571730.PE3
+------atgccttccaacatggacttacaaggcggaaaagccttcgggttgctcaaagct
+cagcagagggacaagctggaggaaatcaataaggagttcatggaagatcagaagtacaga
+gacgaagaggacttgcctgaaaagctggattcttttaaaaataaatatgcagagtttgac
+ctgaacgatcaaggggaaatcgacatgatgggcttgaagcgaatgatggagaagttgggt
+gtgccaaaaactcatctgcagatgaagaaaatgatctctgaggtgacaggaggctgcagt
+---gacaccatcaactacagggattttgtgaaaatgatgctcggcaagcgatcagctgtt
+ctcaaactggttatgatgtttgaagacaaagctaatgggtccagctgtaagcctgatggg
+cctccacccaaacgtgacatcaccagcctaccatag
+[42] BX883046.AIF1
+------atgagccagagcaaggatttgcagggaggaaaagcttttggactgctgaaagcc
+caacaggaagagaggttggatgggatcaacaagcacttcctcgatgatcccaagtacagc
+agtgatgaggatctgcagtccaaactggaggccttcaagacgaagtacatggagtttgat
+ctgaatggcaatggagatatcgatattatgtccttgaagcgaatgctggagaaacttggg
+gttcccaagacccatctagagctgaagaaattaattagagaggtgtccagtggctccgag
+---gagacgttcagttactctgactttctcagaatgatgctgggcaagagatctgccatc
+ttgagaatgattctgatgtatgaggagaaaaacaaagaacaccag---aagccaactggt
+cccccagccaagaaagctatttctgagttgccctaa
+[43] CR762385.PE3
+------atgccttccaacatggacttacaaggcggaaaagccttcgggttgctcaaagct
+cagcagagggacaagctggaggaaatcaataaggagttcatggaagatcagaagtacaga
+gacgaagaggacttgcctgaaaagctggattcttttaaaaataaatatgcagagtttgac
+ctgaacgatcaaggggaaatcgacatgatgggcttgaagcgaatgatggagaagttgggt
+gtgccaaaaactcatctgcagatgaagaaaatgatctctgaggtgacaggaggctgcagt
+---gacaccatcaactacagggattttgtgaaaatgatgctcggcaagcgatcagctgtt
+ctcaaactggttatgatgtttgaagacaaagctaatgggtccagctgtaagcctgatggg
+cctccacccaaacgtgacatcaccagcctaccatag
+[44] CR857925.PE1
+atgtcgggcgagctcagcaacaggttccaaggagggaaggcgttcggcttgctcaaagcc
+cggcaggagaggaggctggccgagatcgaccgggagtttctctgtgaccagaagtacagt
+gatgaagagaaccttccagaaaagctcacagccttcaaagagaagtacatggagtttgac
+ctgaacaatgaaggcgagattgacctaatgtctttaaagaggatgatggagaagcttggt
+gtccccaagacccacctggagatgaagaagatgatctcagaggtgacaggaggggtcagt
+---gacaccatatcctaccgagactttgtgaacatgatgctggggaaacggtcggctgtc
+ctcaagctagtcatgatgtttgaaggaaaggccaacgagagcagccccaagccagttggc
+ccccctccagagagagacattgctagcctgccctga
+[45] CT010265
+------atgagccaaagcagggatttgcagggaggaaaagcttttggactgctgaaggcc
+cagcaggaagagaggctggaggggatcaacaagcaattcctcgatgatcccaaatacagc
+aatgatgaggatctgccgtccaaacttgaagccttcaaggtgaagtacatggagtttgat
+ctgaatggaaatggagatatcgatattatgtccttgaagcgaatgctggagaaacttggg
+gttcccaagacccacctagagctgaagagattaattagagaggtgtccagtggctccgag
+---gagacgttcagctactctgactttctcagaatgatgctgggcaagagatctgccatc
+ttgagaatgattctgatgtatgaggagaaaaacaaagaacacaag---aggccaactggt
+cccccagccaagaaagctatctccgagctgccctag
+[46] CT010385
+------atgagccaaagcagggatttgcagggaggaaaagcttttggactgctgaaggcc
+cagcaggaagagaggctggaggggatcaacaagcaattcctcgatgatcccaaatacagc
+aatgatgaggatctgccgtccaaacttgaagccttcaaggtgaaatacatggagtttgat
+ctgaatggaaatggagatatcgatattatgtccttgaagcgaatgctggagaaacttggg
+gttcccaagacccacctagagctgaagagattaattagagaggtgtccagtggctccgag
+---gagacgttcagctactctgactttctcagaatgatgctgggcaagagatctgccatc
+ttgagaatgattctgatgtatgaggagaaaaacaaagaacacaag---aggccaactggt
+cccccagccaagaaagctatctccgagctgccctag
+[47] D86382.IBA1
+------atgagccaaagcagggatttgcagggaggaaaagcttttggactgctgaaggcc
+cagcaggaagagaggctggaggggatcaacaagcaattcctcgatgatcccaaatacagc
+aatgatgaggatctgccgtccaaacttgaagccttcaaggtgaagtacatggagtttgat
+ctgaatggaaatggagatatcgatattatgtccttgaagcgaatgctggagaaacttggg
+gttcccaagacccacctagagctgaagagattaattagagaggtgtccagtggctccgag
+---gagacgttcagctactctgactttctcagaatgatgctgggcaagagatctgccatc
+ttgagaatgattctgatgtatgaggagaaaaacaaagaacacaag---aggccaactggt
+cccccagccaagaaagctatctccgagctgccctga
+[48] D86438.IBA1
+------atgagccaaaccagggatttacagggaggaaaagctttcggactgctgaaggcc
+cagcaggaagagaggctggatgagatcaacaagcaattcctagacgatcccaaatatagc
+agtgatgaggatctgccctccaaactggaaggcttcaaagagaaatacatggagtttgac
+cttaatggaaatggcgatattgatatcatgtccctgaaacgaatgctggagaaacttgga
+gtccccaagactcacctagagctaaagaaattaattggagaggtgtccagtggctccggg
+---gagacgttcagctaccctgactttctcaggatgatgctgggcaagagatctgccatc
+ctaaaaatgatcctgatgtatgaggaaaaagcgagagaaaaggaa---aagccaacaggc
+cccccagccaagaaagctatctctgagttgccctga
+[49] EF070983.PE1
+------atgagccaaaccagggatttacagggaggaaaagctttcggactgctgaaggcc
+cagcaggaagagaggctggatgagatcaacaagcaattcctagacgatcccaaatatagc
+agtgatgaggatctgccctccaaactggaaggcttcaaagagaaatacatggagtttgac
+cttaatggaaatggcgatattgatatcatgtccctgaaacgaatgctggagaaacttgga
+gtccccaagactcacctagagctaaagaaattaattggagaggtgtccagtggctccggg
+---gagacgttcagctaccctgactttctcaggatgatgctgggcaagagatctgccatc
+ctaaaaatgatcctgatgtatgaggaaaaagcgagagaaaaggaa---aagccaacaggc
+cccccagccaagaaagctatctctgagttgccctga
+[50] U17919.PE1
+------atgagccagagcaaggatttgcagggaggaaaagcttttggactgctgaaagcc
+cagcaggaagagaggttggatgggatcaacaagcacttcctcgatgatcccaagtacagc
+agtgatgaggatctgcagtccaaactggaggccttcaagacgaagtacatggagtttgat
+ctgaatggcaatggagatatcgatattatgtccttgaagcgaatgctggagaaacttggg
+gttcccaagacccatctagagctgaagaaattaattagagaggtgtccagtggctccgag
+---gagacgttcagttactctgactttctcagaatgatgctgggcaagagatctgccatc
+ttgagaatgattctgatgtatgaggagaaaaacaaagaacaccag---aagccaactggt
+cccccagccaagaaagctatttctgagttgccctaa
+[51] U19713.PE1
+------atgagccaaaccagggatttacagggaggaaaagctttcggactgctgaaggcc
+cagcaggaagagaggctggatgagatcaacaagcaattcctagacgatcccaaatatagc
+agtgatgaggatctgccctccaaactggaaggcttcaaagagaaatacatggagtttgac
+cttaatggaaatggcgatattgatatcatgtccctgaaacgaatgctggagaaacttgga
+gtccccaagactcacctagagctaaagaaattaattggagaggtgtccagtggctccggg
+---gagacgttcagctaccctgactttctcaggatgatgctgggcaagagatctgccatc
+ctaaaaatgatcctgatgtatgaggaaaaagcgagagaaaaggaa---aagccaacaggc
+cccccagccaagaaagctatctctgagttgccctga
+[52] 'U49392.AIF-1'
+------atgagccaaaccagggatttacagggaggaaaagctttcggactgctgaaggcc
+cagcaggaagagaggctggatgagatcaacaagcaattcctacacgatcccaaatatagc
+agtgatgaggatctgccctccaaactggaaggcttcaaagagaaatacatggagtttgac
+cttaatggaaatggcgatattgatatcatgtccttgaaacgaatgctggagaaacttgga
+gtccccaagactcacctagagctaaagaaattaattggagaggtgtccagtggctccggg
+---gagacgttcagctaccctgactttctcaggatgatgctgggcaagagatctgccatc
+ctaaaaatgatcctgatgtatgaggaaaaagcgagagaaagg------aaaaccaacacg
+ccccccagccaagaaagccctatctga---------
+[53] U82792.PE1
+------atgagccaaagcagggatttgcagggaggaaaagcttttggactgctgaaggcc
+cagcaggaagagaggctggaggggatcaacaagcaattcctcgatgatcccaaatacagc
+aatgatgaggatctgccgtccaaacttgaagccttcaaggtgaagtacatggagtttgat
+ctgaatggaaatggagatatcgatattatgtccttgaagcgaatgctggagaaacttggg
+gttcccaagacccacctagagctgaagagattaattagagaggtgtccagtggctccgag
+---gagacgttcagctactctgactttctcagaatgatgctgggcaagagatctgccatc
+ttgagaatgattctgatgtatgaggagaaaaacaaagaacacaag---aggccaactggt
+cccccagccaagaaagctatctccgagctgccctga
+[54] Y14768.PE3
+------atgagccaaaccagggatttacagggaggaaaagctttcggactgctgaaggcc
+cagcaggaagagaggctggatgagatcaacaagcaattcctagacgatcccaaatatagc
+agtgatgaggatctgccctccaaactggaaggcttcaaagagaaatacatggagtttgac
+cttaatggaaatggcgatattgatatcatgtccctgaaacgaatgctggagaaacttgga
+gtccccaagactcacctagagctaaagaaattaattggagaggtgtccagtggctccggg
+---gagacgttcagctaccctgactttctcaggatgatgctgggcaagagatctgccatc
+ctaaaaatgatcctgatgtatgaggaaaaagcgagagaaaaggaa---aagccaacaggc
+cccccagccaagaaagctatctctgagttgccctga
+;
+END;
+BEGIN NOTES;
+  TEXT TAXON=1 TEXT='D82069.PE1 CDS /codon_start=1 /product="iba1, ionized calcium binding adapter mo
+';
+  TEXT TAXON=2 TEXT='AB019540.AIF-1 CDS /codon_start=1 /transl_table=1 /gene="AIF-1" /product="allogr
+';
+  TEXT TAXON=3 TEXT='AB000818.PE1 CDS /codon_start=1 /transl_table=1 /product="MRF-1" /db_xref="GOA:P
+';
+  TEXT TAXON=4 TEXT='AB012309.PE1 CDS /codon_start=1 /transl_table=1 /product="allograft inflammatory
+';
+  TEXT TAXON=5 TEXT='AB013745.AIF-1 CDS /codon_start=1 /transl_table=1 /gene="AIF-1" /product="allogr
+';
+  TEXT TAXON=6 TEXT='AB035322 Mus musculus mRNA for ionized calcium binding adapter molecule 2 (Iba2)
+';
+  TEXT TAXON=7 TEXT='AB036423.IBA1 CDS /codon_start=1 /transl_table=1 /gene="iba1" /product="ionized 
+';
+  TEXT TAXON=8 TEXT='AB036423.PE2 CDS /codon_start=1 /transl_table=1 /gene="iba1" /product="ionized c
+';
+  TEXT TAXON=9 TEXT='AB094629.IBA2 CDS /codon_start=1 /transl_table=1 /gene="iba2" /product="ionized 
+';
+  TEXT TAXON=10 TEXT='AB128049.AIF1 CDS /codon_start=1 /transl_table=1 /gene="AIF1" /product="allograf
+';
+  TEXT TAXON=11 TEXT='AF074959.PE1 CDS /codon_start=1 /product="allograft inflammatory factor-1" /note
+';
+  TEXT TAXON=12 TEXT='AF109719.PE7 CDS /codon_start=1 /product="AIF-1" /note="allograft inflammatory f
+';
+  TEXT TAXON=13 TEXT='AF129756.PE18 CDS /codon_start=1 /product="AIF-1" /note="anti-inflammatory facto
+';
+  TEXT TAXON=14 TEXT='AF348450.PE1 CDS /codon_start=1 /product="allograft inflammatory factor-1" /note
+';
+  TEXT TAXON=15 TEXT='AJ506968.AIF1 CDS /gene="aif1" /product="allograft inflammatory factor 1" /db_xr
+';
+  TEXT TAXON=16 TEXT='AK006184.PE1 CDS /codon_start=1 /transl_table=1 /note="ALLOGRAFT INFLAMMATORY FA
+';
+  TEXT TAXON=17 TEXT='AK006562.PE1 CDS /codon_start=1 /transl_table=1 /note="ALLOGRAFT INFLAMMATORY FA
+';
+  TEXT TAXON=18 TEXT='AK022845.PE1 CDS /codon_start=1 /db_xref="GOA:Q9BQI0" /db_xref="HGNC:28904" /db_
+';
+  TEXT TAXON=19 TEXT='AK028955.PE1 CDS /codon_start=1 /transl_table=1 /note="IONIZED CALCIUM BINDING A
+';
+  TEXT TAXON=20 TEXT='AK045539.PE1 CDS /codon_start=1 /transl_table=1 /note="IONIZED CALCIUM BINDING A
+';
+  TEXT TAXON=21 TEXT='AK091912.PE1 CDS /codon_start=1 /db_xref="GOA:Q9BQI0" /db_xref="HGNC:28904" /db_
+';
+  TEXT TAXON=22 TEXT='AL136566.PE1 CDS /codon_start=1 /gene="DKFZp761J191" /product="hypothetical prot
+';
+  TEXT TAXON=23 TEXT='AL157938.PE2 CDS /gene="C9orf58" /locus_tag="RP11-544A12.2-001" /standard_name="
+';
+  TEXT TAXON=24 TEXT='AL157938.PE3 CDS /gene="C9orf58" /locus_tag="RP11-544A12.2-003" /standard_name="
+';
+  TEXT TAXON=25 TEXT='AL662801.PE45 CDS /gene="AIF1" /locus_tag="XXbac-BPG296P20.11-001" /standard_nam
+';
+  TEXT TAXON=26 TEXT='AL662847.AIF1 CDS /gene="AIF1" /locus_tag="XXbac-BCX270M2.5-001" /standard_name=
+';
+  TEXT TAXON=27 TEXT='AL805934.AIF1 CDS /gene="AIF1" /locus_tag="DAQB-195H10.2-001" /standard_name="OT
+';
+  TEXT TAXON=28 TEXT='AL833896.PE1 CDS /codon_start=1 /gene="DKFZp761N011" /product="hypothetical prot
+';
+  TEXT TAXON=29 TEXT='AL928893.PE3 CDS /locus_tag="RP23-55I14.2-001" /standard_name="OTTMUSP0000001316
+';
+  TEXT TAXON=30 TEXT='AY359067.PE1 CDS /codon_start=1 /locus_tag="UNQ672" /product="SGEL672" /note="PR
+';
+  TEXT TAXON=31 TEXT='BA000025.AIF1 CDS /codon_start=1 /transl_table=1 /gene="AIF1" /product="Allograf
+';
+  TEXT TAXON=32 TEXT='BC009474.AIF1 CDS /codon_start=1 /gene="AIF1" /product="allograft inflammatory f
+';
+  TEXT TAXON=33 TEXT='BC021539.PE1 CDS /codon_start=1 /product="Aif1 protein" /db_xref="GOA:O70200"
+';
+  TEXT TAXON=34 TEXT='BC024599.PE1 CDS /codon_start=1 /gene="2810003C17Rik" /product="RIKEN cDNA 28100
+';
+  TEXT TAXON=35 TEXT='BC073304.MGC8069 CDS /codon_start=1 /gene="MGC80699" /product="MGC80699 protein"
+';
+  TEXT TAXON=36 TEXT='BC074259.MGC8401 CDS /codon_start=1 /gene="MGC84014" /product="MGC84014 protein"
+';
+  TEXT TAXON=37 TEXT='BC084814.MGC8401 CDS /codon_start=1 /gene="MGC84014" /product="MGC84014 protein"
+';
+  TEXT TAXON=38 TEXT='BC102890.AIF1 CDS /codon_start=1 /gene="AIF1" /product="allograft inflammatory f
+';
+  TEXT TAXON=39 TEXT='BC126840.C9ORF58 CDS /codon_start=1 /gene="C9orf58" /product="ionized calcium bi
+';
+  TEXT TAXON=40 TEXT='BX248305.PE3 CDS /gene="AIF1" /locus_tag="DASS-82G15.2-001" /standard_name="OTTH
+';
+  TEXT TAXON=41 TEXT='BX571730.PE3 CDS /gene="DKEY-35I22.4" /locus_tag="DKEY-35I22.4-001" /standard_na
+';
+  TEXT TAXON=42 TEXT='BX883046.AIF1 CDS /codon_start=1 /gene="Aif1" /product="allograft inflammatory f
+';
+  TEXT TAXON=43 TEXT='CR762385.PE3 CDS /gene="DKEY-35I22.4" /locus_tag="DKEY-35I22.4-001" /standard_na
+';
+  TEXT TAXON=44 TEXT='CR857925.PE1 CDS /codon_start=1 /gene="DKFZp469A1629" /product="hypothetical pro
+';
+  TEXT TAXON=45 TEXT='CT010265 Mus musculus full open reading frame cDNA clone RZPDo836F0551D for gene
+';
+  TEXT TAXON=46 TEXT='CT010385 Mus musculus full open reading frame cDNA clone RZPDo836E0453D for gene
+';
+  TEXT TAXON=47 TEXT='D86382.IBA1 CDS /transl_table=1 /gene="iba1" /product="Iba1 (ionized calcium bin
+';
+  TEXT TAXON=48 TEXT='D86438.IBA1 CDS /codon_start=1 /transl_table=1 /gene="iba1" /product="Iba1 (ioni
+';
+  TEXT TAXON=49 TEXT='EF070983.PE1 CDS /codon_start=1 /product="allograft inflammatory factor 1 isofor
+';
+  TEXT TAXON=50 TEXT='U17919.PE1 CDS /codon_start=1 /product="allograft inflammatory factor-1" /note="
+';
+  TEXT TAXON=51 TEXT='U19713.PE1 CDS /codon_start=1 /product="allograft-inflammatory factor-1" /db_xre
+';
+  TEXT TAXON=52 TEXT='U49392.AIF-1 CDS /codon_start=1 /gene="AIF-1" /product="allograft inflammatory f
+';
+  TEXT TAXON=53 TEXT='U82792.PE1 CDS /codon_start=1 /product="allograft inflammatory factor-1" /note="
+';
+  TEXT TAXON=54 TEXT='Y14768.PE3 CDS /gene="AIF1" /product="allograft inflamatory factor-1" /note="U19
+';
+END;
diff --git a/examples/nexus/traitlab.nex b/examples/nexus/traitlab.nex
new file mode 100644
index 0000000..cd97e55
--- /dev/null
+++ b/examples/nexus/traitlab.nex
@@ -0,0 +1,35 @@
+#NEXUS
+[file format produced by TraitLab]
+
+BEGIN DATA;
+
+DIMENSIONS NTAX=9 NCHAR=30;
+FORMAT MISSING=? GAP=- INTERLEAVE ;
+
+MATRIX
+
+taxon_1 00?1111010110101000101001?0000
+taxon_2 101111010?11001111001011011000
+taxon_3 01101101??1110111?001010011000
+taxon_4 010111100111011100110000100100
+taxon_5 110111101111011??0110100100100
+taxon_6 111111010111?01111001011011011
+taxon_7 1111???101101011110??011011011
+taxon_8 111111000111101110001011011011
+taxon_9 11111101?111101111001011?11011
+;
+END;
+
+BEGIN CLADES;
+
+CLADE NAME = Clade_1
+ROOTMIN = 346
+ROOTMAX = 422
+TAXA = taxon_4, taxon_5;
+
+CLADE NAME = Clade_2
+ORIGINATEMIN = 346
+TAXA = taxon_1, taxon_8, taxon_9;
+
+END;
+
diff --git a/examples/starbeastinit/sbi-01.xml b/examples/starbeastinit/sbi-01.xml
new file mode 100644
index 0000000..bd8bbe5
--- /dev/null
+++ b/examples/starbeastinit/sbi-01.xml
@@ -0,0 +1,170 @@
+<beast namespace="beast.core:beast.evolution.alignment:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood:util:beast.evolution.speciation:beast.math.distributions:beast.evolution.tree" version="2.0">
+  <data dataType="nucleotide" id="sb_l0_examnple01" name="alignment" strip="false">
+    <sequence id="seq_sb_l0_examnple01_s3_tip0" taxon="s3_tip0" totalcount="4" value="ACTGTAGGGTTGTTTCTTCAGAGGATTGCGTCGGCCGTAGGTTCATGCTTTCGCCGTTCACCATTAACCCTACACGCTGTAAATGGTCGGCTGCACATGCCCCTATCCTATTCATAGGAAACCACAACTCTGGCCACAAATCTTGGGTATCGACTAGCCCGCGTTAATTGATAGAAAGATACCTCATCAGCTTCAACGCCCATATGAATGTCACGGTTACAATTGTCGAGAAACCCTCGGGAGTGCATGAGACTAGCGCCCATTGATAATAAGCCGACCAGAATGTTACGGAAGAAAGGCGAACCCATCAAACCTGACCGCAGCGTCAGCGCCTTCGCTGTGCGGGGTTCGAGCGCTAGGTAGAGCCCAATCGAATATATTGCGAAATTATAGAGCTGGGTGACCG [...]
+    <sequence id="seq_sb_l0_examnple01_s2_tip0" taxon="s2_tip0" totalcount="4" value="ACTGTAGGGTTGTTTCTTCAGCGGATTGCGTCGGCCGTAGGTTCTTGCTTTCGCCACTCACCATAAACCCTTCACGCTGTAAATGGTCGGCGGCACATGCCCTGATCCTATTCATAGGAAACCACAACTCTCGCCACAAACCTTGGGTATCGACTAGCGCGCGTTCATTGATAGAAAGATACCTCATCAGCTTCAACGCCCATATGAATGTGACGGTTACAATTGACGATAAACCCTGGGGAGCGCATGAGACTAGCGCCCATTGATAATGAGCCGACCAGAATATTACGGAAGAAAGACCTACCCATCAAACCTGACCGCAGCGTCAGCTCCTTCGCTGTGCGGGGTTCGATCGGTAGGTAGAGCCCAGTCGAATATATTGCGAAATTATAGAGCTGGGTGACCG [...]
+    <sequence id="seq_sb_l0_examnple01_s1_tip0" taxon="s1_tip0" totalcount="4" value="ACTGTAGGGTTGTTTCTTCAGAGGATTGGGTCGGCCGTAGGTTCATGCTTTCGCCGTTCACCATAAACCCTACACGCTGTAAATGGTCGGCTGCACATGCCCTGATCCTATTCATAGGAAACCACAATTCTCACCACAAATCTTGGGTATCGACTAGCCCGCGTCAATTGATAGAAAGATAGCTCATCAGCTTCAACGCCCATATTAATGTCACGGTTACAATTGACGATAACCCCTTGGGAGCGCATTAAACTAGCGCCCATTGATAACGAGCCGACCAGAATGTTACGGAAGAAAGGCGTACCTATCAAACATGACCGCAGCGTCAGCGCCTTCGCTGAGCGGGGTTCGATCGCTAGGTAGAGTCCAGTCGAAAATATTGCGAAATTATAGAGCTGGGTGACCG [...]
+    <sequence id="seq_sb_l0_examnple01_s0_tip0" taxon="s0_tip0" totalcount="4" value="ACTGTAGGGTTGTTTCTTCAGAGGATTGCGTCGGCCGTAGGTTCATGCTTTCGCCGTTCACCATAAACCCTACACGCTGTAAATGGTCGGCTGCACATGCCCCTATCCTATTCATAGGAAACCACAACTCTCGCCACAAATCTTGGGTATCGACTAGCCCGCGTTAATTGATAGAAAGATACCTCATCAGCTTCCACGCCCATATGAATGTCACGGTTACAATTGACGAGAAACCCTCGGGAGCGCATGAGACTAGCGCCCATTGATAATAAGCCGACCAGAATGTTACGGAAGAAAGGCGTACCCATCAAACCTGACCGCACCGTCAGCGCCTTCGCTGTGCGGGGTACGAGCGCTAGGTAGAGCCCAATCGAATATATTGCGAAATTATAGAGCTGGGTGACCG [...]
+  </data>
+  <data dataType="nucleotide" id="sb_l1_examnple01" name="alignment" strip="false">
+    <sequence id="seq_sb_l1_examnple01_s3_tip0" taxon="s3_tip0" totalcount="4" value="TAAAAGGCACATTTCGCATGGTCCCGCATGTATCTGGGCTGTCATTTACTGAAACGGTAGATTAAAACTTACGTAGTTGTAGTCAAGCTTCTTGAGTTGGGAAACCCACTCAGATGTGTCGACGGCCGCCTGCAGCCGTGCATCGCTGGTGCTTTAGCTTGAATACATACAGGTTGACGACTTACCTCAAGGCTTTCGGTCGGCGCGTCAGTATACGCAAAACAGCGGGCGTATGCACCCACCGGTCCGAAAAGAGTTTCCTGCCGGTGGTGTCAACATGGGTGGACAGACAGGCGGTGGTTAAACCAGAATGACAGGGTTGATATCTCCGCGACTTCTCGGTCCAGTACCCACCGCTTCACGGTAACCGGGTTCAGTTTGACGGAGCAGAGCTTAGGTGGGCGCT [...]
+    <sequence id="seq_sb_l1_examnple01_s2_tip0" taxon="s2_tip0" totalcount="4" value="TAAACGGCACATTTCTCGTGGCCCCGCATGTATCTGGGATGTCATCTCATGAAACGGTAGATTAAAACTTACGTAGTTGTATTCAAGCTTTTTTAGTTGGGAAACCCACTTAGATGTGTCGACGGCCGCCTGCAGCCGTGCATCGCTGTTGCTTTAGCTTGAATACATACAGGTTGACGACTTACCCCAAGGCTCTCGGTCGGCGCGTCAGTATACGGAAAACAGCGTGCGTATGCACCCACCGGTCGGAAAAGAGTTTCCTGCCGGTGGTGTCTACATGGGTAGACAGACAGGCGGTGGTTAAACCAGAATGACAGGGTTGATAACTGCGCGACATCACGGTCCAGTACCCACCTCTTCACGTTAACCGGGTTCAGTTTGACGGAGCAGCGCTTAGGTGGGCGCT [...]
+    <sequence id="seq_sb_l1_examnple01_s1_tip0" taxon="s1_tip0" totalcount="4" value="TAAACGGCACATTTCTCATGGCCCCGCATCTATCTGGGCTGTCATTTAAAGAAACGGTAGAGGAAAACTTACGTAGTTGTCGTCAAGCTTTTTTAGTTGGGAAACCCACTCAGATGTGTCGACGGCCGCCTGCAGCCGTGCATAGCTCGTGCTTTAGCTTGCATACAAACACGTTGACGACTTACCCCAAGGCTCTCGGTCGGCGCGTCAGTATACGCAAAACAGCGGGCGGATGCACCCACCGGTCGGAAAAGAGATTCCTGCCGGTGGTGTCAACATGGGTAGACAGACAGGCGTTGGTTAAACCAGAATGTCAGGGTTGATAACTGCGCGACATCTCGGTCCAGTACCCACCGCTTCACGTTAACCGGGTTCAGTTTGACGGAGCAGAGCTTAGGTGGGCGGT [...]
+    <sequence id="seq_sb_l1_examnple01_s0_tip0" taxon="s0_tip0" totalcount="4" value="TGAACGGCACATTTCTCATGGTCCCGCATGTATCTGGGCTGTCACTTCCTGAAACGGTAGATGAAAACTTACGTAGTTGTCGTCAAGCTTTTTTAGTTGGGAAACCCACTCAGATGTGTCGACGGCCGCCTGCAGCCGTGCATCGCTGGTCCTTTAGCTTGAATACATACAGGTAGACGACTTACCCCAAGGCTTTCGGTCGGCGCGTCAGTATACGCAAAACAGCGGGCGTTTGCACCCACCGGTCGGAAAAGAGTTTCCTGCCGGTGGTTTCAACATGGGTAGACAGACAGGCGGTGGTTAAACCAGAATGACAGGGTTGATATCTCCGCGACTTCTCGGTCCAGTACCCACCGCTTCACGTTAACCGGGTTCAGTTTGACGGAGCACAGCCTAGGTGGGCGCT [...]
+  </data>
+  <distribution id="posterior" spec="CompoundDistribution" useThreads="false">
+    <distribution id="speciescoalescent" spec="CompoundDistribution" useThreads="false">
+      <distribution bottomPopSize="@popSize" gammaParameter="@popMean" id="SpeciesTreePopSize.Species" popFunction="constant" spec="SpeciesTreePrior" taxonset="@speciestaxa" tree="@Tree.Species"/>
+      <distribution id="treePrior.sb_l0_examnple01" ploidy="1.0" spec="GeneTreeForSpeciesTreeDistribution" speciesTree="@Tree.Species" speciesTreePrior="@SpeciesTreePopSize.Species" tree="@Tree.sb_l0_examnple01"/>
+      <distribution id="treePrior.sb_l1_examnple01" ploidy="1.0" spec="GeneTreeForSpeciesTreeDistribution" speciesTree="@Tree.Species" speciesTreePrior="@SpeciesTreePopSize.Species" tree="@Tree.sb_l1_examnple01"/>
+    </distribution>
+    <distribution id="prior" spec="CompoundDistribution" useThreads="false">
+      <distribution birthDiffRate="@birthRate.Species" conditionalOnRoot="false" id="YuleModel.Species" spec="YuleModel" tree="@Tree.Species"/>
+      <distribution id="YuleBirthRatePrior.Species" spec="Prior" x="@birthRate.Species">
+        <distr id="OneOnX.0" offset="0.0" spec="OneOnX"/>
+      </distribution>
+      <distribution id="popMean.prior" spec="Prior" x="@popMean">
+        <distr id="OneOnX.01" offset="0.0" spec="OneOnX"/>
+      </distribution>
+    </distribution>
+    <distribution id="likelihood" spec="CompoundDistribution" useThreads="false">
+      <distribution data="@sb_l0_examnple01" id="treeLikelihood.sb_l0_examnple01" spec="TreeLikelihood" tree="@Tree.sb_l0_examnple01" useAmbiguities="false">
+        <siteModel gammaCategoryCount="0" id="SiteModel.sb_l0_examnple01" spec="SiteModel">
+          <parameter estimate="false" id="mutationRate.sb_l0_examnple01" name="mutationRate" value="1.0"/>
+          <parameter estimate="false" id="gammaShape.sb_l0_examnple01" name="shape" value="1.0"/>
+          <parameter estimate="false" id="proportionInvariant.sb_l0_examnple01" name="proportionInvariant" value="0.0"/>
+          <substModel id="JC69.sb_l0_examnple01" spec="JukesCantor"/>
+        </siteModel>
+        <branchRateModel id="StrictClock.sb_l0_examnple01" spec="beast.evolution.branchratemodel.StrictClockModel">
+          <parameter estimate="false" id="clockRate.sb_l0_examnple01" name="clock.rate" value="0.01"/>
+        </branchRateModel>
+      </distribution>
+      <distribution data="@sb_l1_examnple01" id="treeLikelihood.sb_l1_examnple01" spec="TreeLikelihood" tree="@Tree.sb_l1_examnple01" useAmbiguities="false">
+        <siteModel gammaCategoryCount="0" id="SiteModel.sb_l1_examnple01" spec="SiteModel">
+          <parameter estimate="false" id="mutationRate.sb_l1_examnple01" name="mutationRate" value="1.0"/>
+          <parameter estimate="false" id="gammaShape.sb_l1_examnple01" name="shape" value="1.0"/>
+          <parameter estimate="false" id="proportionInvariant.sb_l1_examnple01" name="proportionInvariant" value="0.0"/>
+          <substModel id="JC69.sb_l1_examnple01" spec="JukesCantor"/>
+        </siteModel>
+        <branchRateModel clock.rate="@clockRate.sb_l1_examnple01" id="StrictClock.sb_l1_examnple01" spec="beast.evolution.branchratemodel.StrictClockModel">
+	</branchRateModel>
+      </distribution>
+    </distribution>
+  </distribution>
+  <run chainLength="400000" id="mcmc" preBurnin="0" sampleFromPrior="false" spec="MCMC">
+    <state id="state">
+      <parameter dimension="1" id="popSize" minordimension="1" name="stateNode" value="1"/>
+      <tree id="Tree.sb_l0_examnple01" name="stateNode">
+        <taxonset id="TaxonSet.sb_l0_examnple01" spec="TaxonSet">
+          <data idref="sb_l0_examnple01" name="alignment"/>
+        </taxonset>
+      </tree>
+      <tree id="Tree.sb_l1_examnple01" name="stateNode">
+        <taxonset id="TaxonSet.sb_l1_examnple01" spec="TaxonSet">
+          <data idref="sb_l1_examnple01" name="alignment"/>
+        </taxonset>
+      </tree>
+      <parameter id="clockRate.sb_l1_examnple01" name="stateNode" value="0.01" lower="0.001" upper="0.1"/>
+      <tree id="Tree.Species" name="stateNode">
+        <taxonset id="speciestaxa" spec="TaxonSet">
+          <taxon id="s3" spec="TaxonSet">
+            <taxon id="s3_tip0" spec="Taxon"/>
+          </taxon>
+          <taxon id="s2" spec="TaxonSet">
+            <taxon id="s2_tip0" spec="Taxon"/>
+          </taxon>
+          <taxon id="s1" spec="TaxonSet">
+            <taxon id="s1_tip0" spec="Taxon"/>
+          </taxon>
+          <taxon id="s0" spec="TaxonSet">
+            <taxon id="s0_tip0" spec="Taxon"/>
+          </taxon>
+        </taxonset>
+      </tree>
+      <parameter dimension="1" estimate="true" id="birthRate.Species" minordimension="1" name="stateNode" lower="0.01" upper="100.0" value="1"/>
+      <parameter dimension="1" estimate="true" id="popMean" minordimension="1" name="stateNode" lower="0.05" upper="5.0" value="1"/>
+    </state>
+    <distribution idref="posterior"/>
+    <operator id="Reheight" spec="NodeReheight" taxonset="@speciestaxa" tree="@Tree.Species" weight="14">
+      <tree idref="Tree.sb_l0_examnple01" name="genetree"/>
+      <tree idref="Tree.sb_l1_examnple01" name="genetree"/>
+    </operator>
+    <operator degreesOfFreedom="1" id="popSizeScaler" optimise="true" parameter="@popSize" rootOnly="false" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.5" lower="0.05" upper="0.95" spec="ScaleOperator" weight="2"/>
+    <operator id="updown.stree" optimise="true" scaleFactor="0.75" spec="UpDownOperator" weight="5">
+      <parameter idref="birthRate.Species" name="up"/>
+      <parameter idref="popMean" name="down"/>
+      <parameter idref="popSize" name="down"/>
+      <tree idref="Tree.Species" name="down"/>
+    </operator>
+    <operator id="updown.pops" optimise="true" scaleFactor="0.75" spec="UpDownOperator" weight="5">
+      <parameter idref="popMean" name="down"/>
+      <parameter idref="popSize" name="down"/>
+    </operator>
+    <operator id="updown.all" optimise="true" scaleFactor="0.75" spec="UpDownOperator" weight="6">
+      <parameter idref="birthRate.Species" name="up"/>
+      <parameter idref="popMean" name="down"/>
+      <parameter idref="popSize" name="down"/>
+      <tree idref="Tree.Species" name="down"/>
+      <tree idref="Tree.sb_l0_examnple01" name="down"/>
+      <tree idref="Tree.sb_l1_examnple01" name="down"/>
+    </operator>
+    <operator degreesOfFreedom="1" id="YuleBirthRateScaler.Species" optimise="true" parameter="@birthRate.Species" rootOnly="false" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.75" lower="0.05" upper="0.95" spec="ScaleOperator" weight="2"/>
+    <operator degreesOfFreedom="1" id="popMeanScale" optimise="true" parameter="@popMean" rootOnly="false" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.75" lower="0.05" upper="0.95" spec="ScaleOperator" weight="2"/>
+    <operator id="treeScaler.sb_l0_examnple01" scaleFactor="0.5" lower="0.05" upper="0.95" spec="ScaleOperator" tree="@Tree.sb_l0_examnple01" weight="3.0"/>
+    <operator id="UniformOperator.sb_l0_examnple01" spec="Uniform" tree="@Tree.sb_l0_examnple01" weight="10.0"/>
+    <operator gaussian="true" id="SubtreeSlide.sb_l0_examnple01" optimise="true" size="1.0" spec="SubtreeSlide" tree="@Tree.sb_l0_examnple01" weight="5.0"/>
+    <operator id="narrow.sb_l0_examnple01" isNarrow="true" spec="Exchange" tree="@Tree.sb_l0_examnple01" weight="2.0"/>
+    <operator id="treeScaler.sb_l1_examnple01" scaleFactor="0.5" lower="0.05" upper="0.95" spec="ScaleOperator" tree="@Tree.sb_l1_examnple01" weight="3.0"/>
+    <operator id="UniformOperator.sb_l1_examnple01" spec="Uniform" tree="@Tree.sb_l1_examnple01" weight="10.0"/>
+    <operator gaussian="true" id="SubtreeSlide.sb_l1_examnple01" optimise="true" size="1.0" spec="SubtreeSlide" tree="@Tree.sb_l1_examnple01" weight="5.0"/>
+    <operator id="narrow.sb_l1_examnple01" isNarrow="true" spec="Exchange" tree="@Tree.sb_l1_examnple01" weight="2.0"/>
+    <operator id="updown.sb_l1_examnple01" optimise="true" scaleFactor="0.75" spec="UpDownOperator" weight="3.0">
+      <up idref="clockRate.sb_l1_examnple01"/>
+      <down idref="Tree.sb_l1_examnple01"/>
+    </operator>
+    <operator id="StrictClockRateScaler.sb_l1_examnple01" parameter="@clockRate.sb_l1_examnple01" scaleFactor="0.75" lower="0.05" upper="0.95" spec="ScaleOperator" weight="3.0"/>
+    <logger fileName="sb_examnple01_$(seed).log" id="tracelog" logEvery="10000" mode="autodetect" model="@posterior">
+      <distribution idref="posterior" name="log"/>
+      <distribution idref="likelihood" name="log"/>
+      <distribution idref="prior" name="log"/>
+      <distribution idref="speciescoalescent" name="log"/>
+      <parameter idref="birthRate.Species" name="log"/>
+      <distribution idref="YuleModel.Species" name="log"/>
+      <log id="SpeciesTreeHeight" spec="TreeHeightLogger" tree="@Tree.Species"/>
+      <log idref="popMean"/>
+      <log id="TreeHeight.sb_l0_examnple01" spec="beast.evolution.tree.TreeHeightLogger" tree="@Tree.sb_l0_examnple01"/>
+      <log id="TreeHeight.sb_l1_examnple01" spec="beast.evolution.tree.TreeHeightLogger" tree="@Tree.sb_l1_examnple01"/>
+      <parameter idref="clockRate.sb_l1_examnple01" name="log"/>
+    </logger>
+    <logger fileName="sb_examnple01_species_$(seed).trees" id="speciesTreeLogger" logEvery="10000" mode="tree">
+      <log id="SpeciesTreeLogger.0" popSize="@popSize" spec="SpeciesTreeLogger" speciesTreePrior="@SpeciesTreePopSize.Species" tree="@Tree.Species">
+        <treetop id="treeTopFinder" spec="TreeTopFinder">
+          <tree idref="Tree.sb_l0_examnple01"/>
+          <tree idref="Tree.sb_l1_examnple01"/>
+        </treetop>
+      </log>
+    </logger>
+    <logger id="screenlog" logEvery="10000" mode="autodetect" model="@posterior">
+      <distribution idref="posterior" name="log"/>
+      <log arg="@posterior" id="ESS.0" spec="util.ESS"/>
+      <distribution idref="likelihood" name="log"/>
+      <distribution idref="prior" name="log"/>
+    </logger>
+    <operatorschedule autoOptimize="true" autoOptimizeDelay="10000" id="OperatorSchedule.0" spec="OperatorSchedule" transform="sqrt"/>
+    <logger fileName="sb_l0_examnple01.$(seed).trees" id="treelog.sb_l0_examnple01" logEvery="10000" mode="tree">
+      <tree idref="Tree.sb_l0_examnple01" name="log"/>
+    </logger>
+    <logger fileName="sb_l1_examnple01.$(seed).trees" id="treelog.sb_l1_examnple01" logEvery="10000" mode="tree">
+      <tree idref="Tree.sb_l1_examnple01" name="log"/>
+    </logger>
+
+    <tree id="SBI"  name="init" spec="StarBeastStartState">
+      <gene idref="Tree.sb_l0_examnple01"/>
+      <gene idref="Tree.sb_l1_examnple01"/>
+      <speciesTree idref="Tree.Species"/>
+      <baseRate idref="clockRate.sb_l0_examnple01"/>
+      <popMean idref="popMean"/>
+      <birthRate idref="birthRate.Species"/>
+      <speciesTreePrior idref="SpeciesTreePopSize.Species"/>
+    </tree>
+  </run>
+</beast>
diff --git a/examples/starbeastinit/sbi-02.xml b/examples/starbeastinit/sbi-02.xml
new file mode 100644
index 0000000..40d39d6
--- /dev/null
+++ b/examples/starbeastinit/sbi-02.xml
@@ -0,0 +1,170 @@
+<beast namespace="beast.core:beast.evolution.alignment:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood:util:beast.evolution.speciation:beast.math.distributions:beast.evolution.tree" version="2.0">
+  <data dataType="nucleotide" id="sb_l0_examnple01" name="alignment" strip="false">
+    <sequence id="seq_sb_l0_examnple01_s3_tip0" taxon="s3_tip0" totalcount="4" value="ACTGTAGGGTTGTTTCTTCAGAGGATTGCGTCGGCCGTAGGTTCATGCTTTCGCCGTTCACCATTAACCCTACACGCTGTAAATGGTCGGCTGCACATGCCCCTATCCTATTCATAGGAAACCACAACTCTGGCCACAAATCTTGGGTATCGACTAGCCCGCGTTAATTGATAGAAAGATACCTCATCAGCTTCAACGCCCATATGAATGTCACGGTTACAATTGTCGAGAAACCCTCGGGAGTGCATGAGACTAGCGCCCATTGATAATAAGCCGACCAGAATGTTACGGAAGAAAGGCGAACCCATCAAACCTGACCGCAGCGTCAGCGCCTTCGCTGTGCGGGGTTCGAGCGCTAGGTAGAGCCCAATCGAATATATTGCGAAATTATAGAGCTGGGTGACCG [...]
+    <sequence id="seq_sb_l0_examnple01_s2_tip0" taxon="s2_tip0" totalcount="4" value="ACTGTAGGGTTGTTTCTTCAGCGGATTGCGTCGGCCGTAGGTTCTTGCTTTCGCCACTCACCATAAACCCTTCACGCTGTAAATGGTCGGCGGCACATGCCCTGATCCTATTCATAGGAAACCACAACTCTCGCCACAAACCTTGGGTATCGACTAGCGCGCGTTCATTGATAGAAAGATACCTCATCAGCTTCAACGCCCATATGAATGTGACGGTTACAATTGACGATAAACCCTGGGGAGCGCATGAGACTAGCGCCCATTGATAATGAGCCGACCAGAATATTACGGAAGAAAGACCTACCCATCAAACCTGACCGCAGCGTCAGCTCCTTCGCTGTGCGGGGTTCGATCGGTAGGTAGAGCCCAGTCGAATATATTGCGAAATTATAGAGCTGGGTGACCG [...]
+    <sequence id="seq_sb_l0_examnple01_s1_tip0" taxon="s1_tip0" totalcount="4" value="ACTGTAGGGTTGTTTCTTCAGAGGATTGGGTCGGCCGTAGGTTCATGCTTTCGCCGTTCACCATAAACCCTACACGCTGTAAATGGTCGGCTGCACATGCCCTGATCCTATTCATAGGAAACCACAATTCTCACCACAAATCTTGGGTATCGACTAGCCCGCGTCAATTGATAGAAAGATAGCTCATCAGCTTCAACGCCCATATTAATGTCACGGTTACAATTGACGATAACCCCTTGGGAGCGCATTAAACTAGCGCCCATTGATAACGAGCCGACCAGAATGTTACGGAAGAAAGGCGTACCTATCAAACATGACCGCAGCGTCAGCGCCTTCGCTGAGCGGGGTTCGATCGCTAGGTAGAGTCCAGTCGAAAATATTGCGAAATTATAGAGCTGGGTGACCG [...]
+    <sequence id="seq_sb_l0_examnple01_s0_tip0" taxon="s0_tip0" totalcount="4" value="ACTGTAGGGTTGTTTCTTCAGAGGATTGCGTCGGCCGTAGGTTCATGCTTTCGCCGTTCACCATAAACCCTACACGCTGTAAATGGTCGGCTGCACATGCCCCTATCCTATTCATAGGAAACCACAACTCTCGCCACAAATCTTGGGTATCGACTAGCCCGCGTTAATTGATAGAAAGATACCTCATCAGCTTCCACGCCCATATGAATGTCACGGTTACAATTGACGAGAAACCCTCGGGAGCGCATGAGACTAGCGCCCATTGATAATAAGCCGACCAGAATGTTACGGAAGAAAGGCGTACCCATCAAACCTGACCGCACCGTCAGCGCCTTCGCTGTGCGGGGTACGAGCGCTAGGTAGAGCCCAATCGAATATATTGCGAAATTATAGAGCTGGGTGACCG [...]
+  </data>
+  <data dataType="nucleotide" id="sb_l1_examnple01" name="alignment" strip="false">
+    <sequence id="seq_sb_l1_examnple01_s3_tip0" taxon="s3_tip0" totalcount="4" value="TAAAAGGCACATTTCGCATGGTCCCGCATGTATCTGGGCTGTCATTTACTGAAACGGTAGATTAAAACTTACGTAGTTGTAGTCAAGCTTCTTGAGTTGGGAAACCCACTCAGATGTGTCGACGGCCGCCTGCAGCCGTGCATCGCTGGTGCTTTAGCTTGAATACATACAGGTTGACGACTTACCTCAAGGCTTTCGGTCGGCGCGTCAGTATACGCAAAACAGCGGGCGTATGCACCCACCGGTCCGAAAAGAGTTTCCTGCCGGTGGTGTCAACATGGGTGGACAGACAGGCGGTGGTTAAACCAGAATGACAGGGTTGATATCTCCGCGACTTCTCGGTCCAGTACCCACCGCTTCACGGTAACCGGGTTCAGTTTGACGGAGCAGAGCTTAGGTGGGCGCT [...]
+    <sequence id="seq_sb_l1_examnple01_s2_tip0" taxon="s2_tip0" totalcount="4" value="TAAACGGCACATTTCTCGTGGCCCCGCATGTATCTGGGATGTCATCTCATGAAACGGTAGATTAAAACTTACGTAGTTGTATTCAAGCTTTTTTAGTTGGGAAACCCACTTAGATGTGTCGACGGCCGCCTGCAGCCGTGCATCGCTGTTGCTTTAGCTTGAATACATACAGGTTGACGACTTACCCCAAGGCTCTCGGTCGGCGCGTCAGTATACGGAAAACAGCGTGCGTATGCACCCACCGGTCGGAAAAGAGTTTCCTGCCGGTGGTGTCTACATGGGTAGACAGACAGGCGGTGGTTAAACCAGAATGACAGGGTTGATAACTGCGCGACATCACGGTCCAGTACCCACCTCTTCACGTTAACCGGGTTCAGTTTGACGGAGCAGCGCTTAGGTGGGCGCT [...]
+    <sequence id="seq_sb_l1_examnple01_s1_tip0" taxon="s1_tip0" totalcount="4" value="TAAACGGCACATTTCTCATGGCCCCGCATCTATCTGGGCTGTCATTTAAAGAAACGGTAGAGGAAAACTTACGTAGTTGTCGTCAAGCTTTTTTAGTTGGGAAACCCACTCAGATGTGTCGACGGCCGCCTGCAGCCGTGCATAGCTCGTGCTTTAGCTTGCATACAAACACGTTGACGACTTACCCCAAGGCTCTCGGTCGGCGCGTCAGTATACGCAAAACAGCGGGCGGATGCACCCACCGGTCGGAAAAGAGATTCCTGCCGGTGGTGTCAACATGGGTAGACAGACAGGCGTTGGTTAAACCAGAATGTCAGGGTTGATAACTGCGCGACATCTCGGTCCAGTACCCACCGCTTCACGTTAACCGGGTTCAGTTTGACGGAGCAGAGCTTAGGTGGGCGGT [...]
+    <sequence id="seq_sb_l1_examnple01_s0_tip0" taxon="s0_tip0" totalcount="4" value="TGAACGGCACATTTCTCATGGTCCCGCATGTATCTGGGCTGTCACTTCCTGAAACGGTAGATGAAAACTTACGTAGTTGTCGTCAAGCTTTTTTAGTTGGGAAACCCACTCAGATGTGTCGACGGCCGCCTGCAGCCGTGCATCGCTGGTCCTTTAGCTTGAATACATACAGGTAGACGACTTACCCCAAGGCTTTCGGTCGGCGCGTCAGTATACGCAAAACAGCGGGCGTTTGCACCCACCGGTCGGAAAAGAGTTTCCTGCCGGTGGTTTCAACATGGGTAGACAGACAGGCGGTGGTTAAACCAGAATGACAGGGTTGATATCTCCGCGACTTCTCGGTCCAGTACCCACCGCTTCACGTTAACCGGGTTCAGTTTGACGGAGCACAGCCTAGGTGGGCGCT [...]
+  </data>
+  <distribution id="posterior" spec="CompoundDistribution" useThreads="false">
+    <distribution id="speciescoalescent" spec="CompoundDistribution" useThreads="false">
+      <distribution bottomPopSize="@popSize" gammaParameter="@popMean" id="SpeciesTreePopSize.Species" popFunction="constant" spec="SpeciesTreePrior" taxonset="@speciestaxa" tree="@Tree.Species"/>
+      <distribution id="treePrior.sb_l0_examnple01" ploidy="1.0" spec="GeneTreeForSpeciesTreeDistribution" speciesTree="@Tree.Species" speciesTreePrior="@SpeciesTreePopSize.Species" tree="@Tree.sb_l0_examnple01"/>
+      <distribution id="treePrior.sb_l1_examnple01" ploidy="1.0" spec="GeneTreeForSpeciesTreeDistribution" speciesTree="@Tree.Species" speciesTreePrior="@SpeciesTreePopSize.Species" tree="@Tree.sb_l1_examnple01"/>
+    </distribution>
+    <distribution id="prior" spec="CompoundDistribution" useThreads="false">
+      <distribution birthDiffRate="@birthRate.Species" conditionalOnRoot="false" id="YuleModel.Species" spec="YuleModel" tree="@Tree.Species"/>
+      <distribution id="YuleBirthRatePrior.Species" spec="Prior" x="@birthRate.Species">
+        <distr id="OneOnX.0" offset="0.0" spec="OneOnX"/>
+      </distribution>
+      <distribution id="popMean.prior" spec="Prior" x="@popMean">
+        <distr id="OneOnX.01" offset="0.0" spec="OneOnX"/>
+      </distribution>
+    </distribution>
+    <distribution id="likelihood" spec="CompoundDistribution" useThreads="false">
+      <distribution data="@sb_l0_examnple01" id="treeLikelihood.sb_l0_examnple01" spec="TreeLikelihood" tree="@Tree.sb_l0_examnple01" useAmbiguities="false">
+        <siteModel gammaCategoryCount="0" id="SiteModel.sb_l0_examnple01" spec="SiteModel">
+          <parameter estimate="false" id="mutationRate.sb_l0_examnple01" name="mutationRate" value="1.0"/>
+          <parameter estimate="false" id="gammaShape.sb_l0_examnple01" name="shape" value="1.0"/>
+          <parameter estimate="false" id="proportionInvariant.sb_l0_examnple01" name="proportionInvariant" value="0.0"/>
+          <substModel id="JC69.sb_l0_examnple01" spec="JukesCantor"/>
+        </siteModel>
+        <branchRateModel id="StrictClock.sb_l0_examnple01" spec="beast.evolution.branchratemodel.StrictClockModel">
+          <parameter estimate="false" id="clockRate.sb_l0_examnple01" name="clock.rate" value="0.01"/>
+        </branchRateModel>
+      </distribution>
+      <distribution data="@sb_l1_examnple01" id="treeLikelihood.sb_l1_examnple01" spec="TreeLikelihood" tree="@Tree.sb_l1_examnple01" useAmbiguities="false">
+        <siteModel gammaCategoryCount="0" id="SiteModel.sb_l1_examnple01" spec="SiteModel">
+          <parameter estimate="false" id="mutationRate.sb_l1_examnple01" name="mutationRate" value="1.0"/>
+          <parameter estimate="false" id="gammaShape.sb_l1_examnple01" name="shape" value="1.0"/>
+          <parameter estimate="false" id="proportionInvariant.sb_l1_examnple01" name="proportionInvariant" value="0.0"/>
+          <substModel id="JC69.sb_l1_examnple01" spec="JukesCantor"/>
+        </siteModel>
+        <branchRateModel clock.rate="@clockRate.sb_l1_examnple01" id="StrictClock.sb_l1_examnple01" spec="beast.evolution.branchratemodel.StrictClockModel">
+	</branchRateModel>
+      </distribution>
+    </distribution>
+  </distribution>
+  <run chainLength="400000" id="mcmc" preBurnin="0" sampleFromPrior="false" spec="MCMC">
+    <state id="state">
+      <parameter dimension="1" id="popSize" minordimension="1" name="stateNode" value="1"/>
+      <tree id="Tree.sb_l0_examnple01" name="stateNode">
+        <taxonset id="TaxonSet.sb_l0_examnple01" spec="TaxonSet">
+          <data idref="sb_l0_examnple01" name="alignment"/>
+        </taxonset>
+      </tree>
+      <tree id="Tree.sb_l1_examnple01" name="stateNode">
+        <taxonset id="TaxonSet.sb_l1_examnple01" spec="TaxonSet">
+          <data idref="sb_l1_examnple01" name="alignment"/>
+        </taxonset>
+      </tree>
+      <parameter id="clockRate.sb_l1_examnple01" name="stateNode" value="0.01" lower="0.001" upper="0.1"/>
+      <tree id="Tree.Species" name="stateNode">
+        <taxonset id="speciestaxa" spec="TaxonSet">
+          <taxon id="s3" spec="TaxonSet">
+            <taxon id="s3_tip0" spec="Taxon"/>
+          </taxon>
+          <taxon id="s2" spec="TaxonSet">
+            <taxon id="s2_tip0" spec="Taxon"/>
+          </taxon>
+          <taxon id="s1" spec="TaxonSet">
+            <taxon id="s1_tip0" spec="Taxon"/>
+          </taxon>
+          <taxon id="s0" spec="TaxonSet">
+            <taxon id="s0_tip0" spec="Taxon"/>
+          </taxon>
+        </taxonset>
+      </tree>
+      <parameter dimension="1" estimate="true" id="birthRate.Species" minordimension="1" name="stateNode" lower="0.01" upper="100.0" value="1"/>
+      <parameter dimension="1" estimate="true" id="popMean" minordimension="1" name="stateNode" lower="0.05" upper="5.0" value="1"/>
+    </state>
+    <distribution idref="posterior"/>
+    <operator id="Reheight" spec="NodeReheight" taxonset="@speciestaxa" tree="@Tree.Species" weight="14">
+      <tree idref="Tree.sb_l0_examnple01" name="genetree"/>
+      <tree idref="Tree.sb_l1_examnple01" name="genetree"/>
+    </operator>
+    <operator degreesOfFreedom="1" id="popSizeScaler" optimise="true" parameter="@popSize" rootOnly="false" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.5" lower="0.05" upper="0.95" spec="ScaleOperator" weight="2"/>
+    <operator id="updown.stree" optimise="true" scaleFactor="0.75" spec="UpDownOperator" weight="5">
+      <parameter idref="birthRate.Species" name="up"/>
+      <parameter idref="popMean" name="down"/>
+      <parameter idref="popSize" name="down"/>
+      <tree idref="Tree.Species" name="down"/>
+    </operator>
+    <operator id="updown.pops" optimise="true" scaleFactor="0.75" spec="UpDownOperator" weight="5">
+      <parameter idref="popMean" name="down"/>
+      <parameter idref="popSize" name="down"/>
+    </operator>
+    <operator id="updown.all" optimise="true" scaleFactor="0.75" spec="UpDownOperator" weight="6">
+      <parameter idref="birthRate.Species" name="up"/>
+      <parameter idref="popMean" name="down"/>
+      <parameter idref="popSize" name="down"/>
+      <tree idref="Tree.Species" name="down"/>
+      <tree idref="Tree.sb_l0_examnple01" name="down"/>
+      <tree idref="Tree.sb_l1_examnple01" name="down"/>
+    </operator>
+    <operator degreesOfFreedom="1" id="YuleBirthRateScaler.Species" optimise="true" parameter="@birthRate.Species" rootOnly="false" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.75" lower="0.05" upper="0.95" spec="ScaleOperator" weight="2"/>
+    <operator degreesOfFreedom="1" id="popMeanScale" optimise="true" parameter="@popMean" rootOnly="false" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.75" lower="0.05" upper="0.95" spec="ScaleOperator" weight="2"/>
+    <operator id="treeScaler.sb_l0_examnple01" scaleFactor="0.5" lower="0.05" upper="0.95" spec="ScaleOperator" tree="@Tree.sb_l0_examnple01" weight="3.0"/>
+    <operator id="UniformOperator.sb_l0_examnple01" spec="Uniform" tree="@Tree.sb_l0_examnple01" weight="10.0"/>
+    <operator gaussian="true" id="SubtreeSlide.sb_l0_examnple01" optimise="true" size="1.0" spec="SubtreeSlide" tree="@Tree.sb_l0_examnple01" weight="5.0"/>
+    <operator id="narrow.sb_l0_examnple01" isNarrow="true" spec="Exchange" tree="@Tree.sb_l0_examnple01" weight="2.0"/>
+    <operator id="treeScaler.sb_l1_examnple01" scaleFactor="0.5" lower="0.05" upper="0.95" spec="ScaleOperator" tree="@Tree.sb_l1_examnple01" weight="3.0"/>
+    <operator id="UniformOperator.sb_l1_examnple01" spec="Uniform" tree="@Tree.sb_l1_examnple01" weight="10.0"/>
+    <operator gaussian="true" id="SubtreeSlide.sb_l1_examnple01" optimise="true" size="1.0" spec="SubtreeSlide" tree="@Tree.sb_l1_examnple01" weight="5.0"/>
+    <operator id="narrow.sb_l1_examnple01" isNarrow="true" spec="Exchange" tree="@Tree.sb_l1_examnple01" weight="2.0"/>
+    <operator id="updown.sb_l1_examnple01" optimise="true" scaleFactor="0.75" spec="UpDownOperator" weight="3.0">
+      <up idref="clockRate.sb_l1_examnple01"/>
+      <down idref="Tree.sb_l1_examnple01"/>
+    </operator>
+    <operator id="StrictClockRateScaler.sb_l1_examnple01" parameter="@clockRate.sb_l1_examnple01" scaleFactor="0.75" lower="0.05" upper="0.95" spec="ScaleOperator" weight="3.0"/>
+    <logger fileName="sb_examnple01_$(seed).log" id="tracelog" logEvery="10000" mode="autodetect" model="@posterior">
+      <distribution idref="posterior" name="log"/>
+      <distribution idref="likelihood" name="log"/>
+      <distribution idref="prior" name="log"/>
+      <distribution idref="speciescoalescent" name="log"/>
+      <parameter idref="birthRate.Species" name="log"/>
+      <distribution idref="YuleModel.Species" name="log"/>
+      <log id="SpeciesTreeHeight" spec="TreeHeightLogger" tree="@Tree.Species"/>
+      <log idref="popMean"/>
+      <log id="TreeHeight.sb_l0_examnple01" spec="beast.evolution.tree.TreeHeightLogger" tree="@Tree.sb_l0_examnple01"/>
+      <log id="TreeHeight.sb_l1_examnple01" spec="beast.evolution.tree.TreeHeightLogger" tree="@Tree.sb_l1_examnple01"/>
+      <parameter idref="clockRate.sb_l1_examnple01" name="log"/>
+    </logger>
+    <logger fileName="sb_examnple01_species_$(seed).trees" id="speciesTreeLogger" logEvery="10000" mode="tree">
+      <log id="SpeciesTreeLogger.0" popSize="@popSize" spec="SpeciesTreeLogger" speciesTreePrior="@SpeciesTreePopSize.Species" tree="@Tree.Species">
+        <treetop id="treeTopFinder" spec="TreeTopFinder">
+          <tree idref="Tree.sb_l0_examnple01"/>
+          <tree idref="Tree.sb_l1_examnple01"/>
+        </treetop>
+      </log>
+    </logger>
+    <logger id="screenlog" logEvery="10000" mode="autodetect" model="@posterior">
+      <distribution idref="posterior" name="log"/>
+      <log arg="@posterior" id="ESS.0" spec="util.ESS"/>
+      <distribution idref="likelihood" name="log"/>
+      <distribution idref="prior" name="log"/>
+    </logger>
+    <operatorschedule autoOptimize="true" autoOptimizeDelay="10000" id="OperatorSchedule.0" spec="OperatorSchedule" transform="sqrt"/>
+    <logger fileName="sb_l0_examnple01.$(seed).trees" id="treelog.sb_l0_examnple01" logEvery="10000" mode="tree">
+      <tree idref="Tree.sb_l0_examnple01" name="log"/>
+    </logger>
+    <logger fileName="sb_l1_examnple01.$(seed).trees" id="treelog.sb_l1_examnple01" logEvery="10000" mode="tree">
+      <tree idref="Tree.sb_l1_examnple01" name="log"/>
+    </logger>
+
+    <tree id="SBI"  name="init" spec="StarBeastStartState" method="random">
+      <gene idref="Tree.sb_l0_examnple01"/>
+      <gene idref="Tree.sb_l1_examnple01"/>
+      <speciesTree idref="Tree.Species"/>
+      <baseRate idref="clockRate.sb_l0_examnple01"/>
+      <popMean idref="popMean"/>
+      <birthRate idref="birthRate.Species"/>
+      <speciesTreePrior idref="SpeciesTreePopSize.Species"/>
+    </tree>
+  </run>
+</beast>
diff --git a/examples/starbeastinit/sbi-03.xml b/examples/starbeastinit/sbi-03.xml
new file mode 100644
index 0000000..5a999da
--- /dev/null
+++ b/examples/starbeastinit/sbi-03.xml
@@ -0,0 +1,210 @@
+<beast namespace="beast.core:beast.evolution.alignment:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood:util:beast.evolution.speciation:beast.math.distributions:beast.evolution.tree" version="2.0">
+  <data dataType="nucleotide" id="sb_l0_example03" name="alignment" strip="false">
+    <sequence id="seq_sb_l0_example03_s6_tip0" taxon="s6_tip0" totalcount="4" value="TTCAACTTCCGTAGATTATGAGGTATATTCTTTACTTCCCCCAGATTGCCAGACTTTTAATATGATTGCCCTTCCATCTCGGTTCAACGGGAATCCGTGTCGTAAAATGACTCTGTGAGCCATGAACAAGCGCTACGATCCAGGCAGAGCGGGTTCGATTTATTTGGCCCGGCGGTGTATCGAACTCGGGATGGGATCGATAGCTATTAGTTGTTCTGATTGTTAGAAGAAGCGGATCGGGTGCCTCGACAGCCAAGGCCAAGAATCTTACGTGCCTGAGTCTGCGAGACTTAGGGTAATCCGAGCCCCGGAGTGAAGAACCGTCCGGCGGGCCTCCCCGACAAGTGTATGCATGGTTATAACGCCGTTAGACGGGATCGTACAGTGAGAGTCATTGCGTCCCTTCG [...]
+    <sequence id="seq_sb_l0_example03_s6_tip1" taxon="s6_tip1" totalcount="4" value="TTCAACTTCCGTAGATTATGAGGTATATTCTTTACTTCCCCCAGATTGCCAGACTTTTAATATGATTGCCCTTCCATCTCGGTTCAACGGGAATCCGTGTCGTAAAATGACTCTGTGAGCCATGAACAAGCGCTACGATCCAGGCAGAGCGGGTTCGATTTATTTGGCCCGGCGGTGTATCGAACTCGGGATGGGATCGATAGCTATTAGTTGTTCTGATTGTTAGAAGAAGCGGATCGGGTGCCTCGACAGCCAAGGCCAAGAATCTTACGTGCCTGAGTCTGCGAGACTTAGGGTAATCCGAGCCCCGGAGTGAAGAACCGTCCGGCGGGCCTCCCCGACAAGTGTATGCATGGTTATAACGCCGTTAGACGGGATCGTACAGTGAGAGTCATTGCGTCCCTTCG [...]
+    <sequence id="seq_sb_l0_example03_s4_tip0" taxon="s4_tip0" totalcount="4" value="TTCAACTTCCGTAGATTATGAGGTATATGCTTTACTTCCCCCAGATTGGCAGACTTTTAATATGATTGCCCTTCCATCTCGGTTCAACGGGAATCCATGTCGTAAAATGACTGTATGAGCCAAAAACAAGCGCTACGATCCAGGCAGAGCGGGTTCGATTTATTCGGCGCGGTGCTGTATCGAACTCGGGATGGGATCGATAGCTATTAGTTGTTCTGATTGTTAGAAGAAGCGGATCGGGTGCCTCGACAGCCAAGGCGAAGAATCTTACGTGCCTGAGTTTGCGAGTCTTAGGGGAATCAGAGCCCCGGAGTGAAGATCCGTCCGGCGGGCCTCCCCGACAAGTGTATGCATGGTTATAACGCCGTTAGACGGGATCGTACAGTGAGAGTCATTGCGTCCCTTCG [...]
+    <sequence id="seq_sb_l0_example03_s4_tip1" taxon="s4_tip1" totalcount="4" value="TTCAACTTCCGTAGATTATGAGGTATATGCTTTACTTCCCCCAGATTGGCAGACTTTTAATATGATTGCCCTTCCATCTCGGTTCAACGGGAATCCATGTCGTAAAATGACTGTATGAGCCAAAAACAAGCGCTACGATCCAGGCAGAGCGGGTTCGATTTATTCGGCGCGGTGCTGTATCGAACTCGGGATGGGATCGATAGCTATTAGTTGTTCTGATTGTTAGAAGAAGCGGATCGGGTGCCTCGACAGCCAAGGCGAAGAATCTTACGTGCCTGAGTTTGCGAGTCTTAGGGGAATCAGAGCCCCGGAGTGAAGATCCGTCCGGCGGGCCTCCCCGACAAGTGTATGCATGGTTATAACGCCGTTAGACGGGATCGTACAGTGAGAGTCATTGCGTCCCTTCG [...]
+    <sequence id="seq_sb_l0_example03_s2_tip1" taxon="s2_tip1" totalcount="4" value="TTCAACTTCCGTAGATTATGAGGTATATTCTTTACTTCCCCCACATTGCCAGACTTTTAATATGATTGCCCTTCCATCTCGGTTCAACGGGAATCCATGTCGTAAAATGACTGTATGAGCCATGAACAAGCGCTACGATCCAGGCAGAGCGGGTTCGATTTATTTGGCCCGGCGCTGTATCGAACTCGGGATGGGATCGATAGCTATTAGTTGTTCTGGTTGTTAGAAGAAGCGGATCGGGTGCCTCGACAGCCAAGGCGAAGAATCTTACGTGCCTGAGTCTGCGAGACTTAGGGGAATCAGAGCCCCGGAGCGAAGAACCGTCCGGCGCGCCTCCCCGACAAGTGTATGCATGGTTATAACGCCGTTAGAGGGGATCGTACAGTGAGAGTCATTGCGTCCCTTCG [...]
+    <sequence id="seq_sb_l0_example03_s2_tip0" taxon="s2_tip0" totalcount="4" value="TTCAACTTCCGTAGATTATGAGGTATATTCTTTACTTCCCCCACATTGCCAGACTTTTAATATGATTGCCCTTCCATCTCGGTTCAACGGGAATCCATGTCGTAAAATGACTGTATGAGCCATGAACAAGCGCTACGATCCAGGCAGAGCGGGTTCGATTTATTTGGCCCGGCGCTGTATCGAACTCGGGATGGGATCGATAGCTATTAGTTGTTCTGGTTGTTAGAAGAAGCGGATCGGGTGCCTCGACAGCCAAGGCGAAGAATCTTACGTGCCTGAGTCTGCGAGACTTAGGGGAATCAGAGCCCCGGAGCGAAGAACCGTCCGGCGCGCCTCCCCGACAAGTGTATGCATGGTTATAACGCCGTTAGACGGGATCGTACAGTGAGAGTCATTGCGTCCCTTCG [...]
+    <sequence id="seq_sb_l0_example03_s3_tip1" taxon="s3_tip1" totalcount="4" value="TTCAACTTCCGTAGATTATGAGGTATATGCTTTACTTCCCCCAGATTGGCAGACTTTTAATATGATTGCCCTTCCATCTCGGTTCAACGGGAATCCATGTCGTAAAATGACTGTATGAGCCAAAAACAAGCGCTACGATCCAGGCAGAGCGGGTTCGATTTATTCGGCGCGGTGCTGTATCGAACTCGGGATGGGATCGATAGCTATTAGTTGTTCTGATTGTTAGAAGAAGCGGATCGGGTGCCTCGACAGCCAAGGCGAAGAATCTTACGTGCCTGAGTTTGCGAGTCTTAGGGGAATCAGAGCCCCGGAGTGAAGATCCGTCCGGCGGGCCTCCCCGACAAGTGTATGCATGGTTATAACGCCGTTAGACGGGATCGTACAGTGAGAGTCATTGCGTCCCTTCG [...]
+    <sequence id="seq_sb_l0_example03_s3_tip0" taxon="s3_tip0" totalcount="4" value="TTCAACTTCCGTAGATTATGAGGTATATGCTTTACTTCCCCCAGATTGGCAGACTTTTAATATGATTGCCCTTCCATCTCGGTTCAACGGGAATCCATGTCGTAAAATGACTGTATGAGCCAAAAACAAGCGCTACGATCCAGGCAGAGCGGGTTCGATTTATTCGGCGCGGTGCTGTATCGAACTCGGGATGGGATCGATAGCTATTAGTTGTTCTGATTGTTAGAAGAAGCGGATCGGGTGCCTCGACAGCCAAGGCGAAGAATCTTACGTGCCTGAGTTTGCGAGTCTTAGGGGAATCAGAGCCCCGGAGTGAAGATCCGTCCGGCGGGCCTCCCCGACAAGTGTATGCATGGTTATAACGCCGTTAGACGGGATCGTACAGTGAGAGTCATTGCGTCCCTTCG [...]
+    <sequence id="seq_sb_l0_example03_s7_tip1" taxon="s7_tip1" totalcount="4" value="TTCAACTTCCGTAGATTATGAGGTATATTCTTTACTTCCCCCAGATTGCCAGACTTTTAATATGATTGCCCTTCCATCTCGGTTCAACGGGAATCCGTGTCGTAAAATGACTGTATGAGCCATGAACAAGCGCTACGATCCAGGCAGAGCGGGTTCGATTTATTTGGCCCGGCGGTGTATCGAACTTGGGATGGGATCGATAGCTATTAGTTGTTCTGATTGTTAGAAGAAGCGGATCGGGTGCCTCGACAGCCAAGGCGAAGAATCTTACGTGCCTGAGTCTGCGAGACTTAGGGGAATCCGAGCCCCGGAGTGAAGAACCGTCCGGCGGGCCTCCCCGACAAGTGTATGCATGGTTATAACGCCGTTAGACGGGATCGTACAGTGAGAGTCATTGCGTCCCTTCG [...]
+    <sequence id="seq_sb_l0_example03_s7_tip0" taxon="s7_tip0" totalcount="4" value="TTCAACTTCCGTAGATTATGAGGTATATTCTTTACTTCCCCCAGATTGCCAGACTTTTAATATGATTGCCCTTCCATCTCGGTTCAACGGGAATCCGTGTCGTAAAATGACTGTATGAGCCATGAACAAGCGCTACGATCCAGGCAGAGCGGGTTCGATTTATTTGGCCCGGCGGTGTATCGAACTTGGGATGGGATCGATAGCTATTAGTTGTTCTGATTGTTAGAAGAAGCGGATCGGGTGCCTCGACAGCCAAGGCGAAGAATCTTACGTGCCTGAGTCTGCGAGACTTAGGGGAATCCGAGCCCCGGAGTGAAGAACCGTCCGGCGGGCCTCCCCGACAAGTGTATGCATGGTTATAACGCCGTTAGACGGGATCGTACAGTGAGAGTCATTGCGTCCCTTCG [...]
+    <sequence id="seq_sb_l0_example03_s5_tip1" taxon="s5_tip1" totalcount="4" value="TTCAACTTCCGTAGATTATGGGGTATATGCTTTACTTCCCCCAGATTGGCAGACTTTTAATATGATTGCCCTTCCATCTCGGTTCAACGGGAATCCATGTCGTAAAATGACTGTATGAGCCATAAACAAGCGCTACGATCCAGGCAGAGCGGGTTCGATTTATTCGGCGCGGTGCTGTATCGAACTCGGGATGGGATCGATAGCTATTAGTTGTTATGATTGTTAGAAGAAGCGGATCGGGTGCCTCGACAGCCAAGGCGAAGAATCTTACGTGCCTGAGTTTGCGAGACCTAGGGGAATCAGAGCCCCGGAGTGAAGATCCGTCCGGCGGGCCTCCCCGACAAGTGTATGCATGGTTATAACGCCGTTAGACGGGATCGTACAGTGAGCGTCATTGCTTACCTTCG [...]
+    <sequence id="seq_sb_l0_example03_s5_tip0" taxon="s5_tip0" totalcount="4" value="TTCAACTTCCGTAGATTATGGGGTAGATGCTTTACTTCCCCCAGATTGGCAGACTTTTAATATGATTGCCCTTCCATCTCGGTTCAACGGGAATCCATGTCGTAAAATGACTGTATGAGCCATAAACAAGCGCTACGATCCAGGCAGAGCGGGTTCGATTTATTCGGCGCGGTGCTGTATCGAACTCGGGATGGGATCGATAGCTATTAGTTGTTATGATTGTTAGAAGAAGCGGATCGGGTGCCTCGACAGCCAAGGCGAAGAATCTTACGTGCCTGAGTTTGCGAGACTTAGGGGAATCAGAGCCCCGGAGTGAAGATCCGTCCGGCGGGCCTCCCCGACAAGTGTATGCATGGTTATAACGCCGTTAGACGGGATCGTACAGTGAGCGTCATTGCTTCCCTTCG [...]
+    <sequence id="seq_sb_l0_example03_s0_tip0" taxon="s0_tip0" totalcount="4" value="TTCAACTTCCGTAGATTATGAGGTATATTCTTTACTTCCCCCACATTGCCAGACTTTTAATATGATTGCCCTTCCATCTCGGTTCAACGGGAATCCGTGTCGTAAAATGACTCTGTGAGCCATGAACAAGCGCTACGATCCAGGCAGAGCGGGTTCGATTTATTTGGCCCGGCGGTGTATCGAACTCGGGATGGGATCGATAGCTATTAGTTGTTCTGATTGTTAGAAGAAGCGGATCGGGTGCCTCGACAGCCAAGGCCAAGAATCTTACGTGCCTGAGTCTGCGAGACTTAGGGTAATCCGAGCCCCGGAGTGAAGAACCGTCCGGCGGGCCTCCCCGACAAGTGTATGCATGGTTATAACGCCGTTAGACGGGATCGTACAGTGAGAGTCATTGCGTCCCTTCG [...]
+    <sequence id="seq_sb_l0_example03_s0_tip1" taxon="s0_tip1" totalcount="4" value="TTCAACTTCCGTAGATTATGAGGTATATTCTTTACTTCCCCCACATTGCCAGACTTTTAATATGATTGCCCTTCCATCTCGGTTCAACGGGAATCCGTGTCGTAAAATGACTCTGTGAGCCATGAACAAGCGCTACGATCCAGGCAGAGCGGGTTCGATTTATTTGGCCCGGCGGTGTATCGAACTCGGGATGGGATCGATAGCTATTAGTTGTTCTGATTGTTAGAAGAAGCGGATCGGGTGCCTCGACAGCCAAGGCCAAGAATCTTACGTGCCTGAGTCTGCGAGACTTAGGGTAATCCGAGCCCCGGAGTGAAGAACCGTCCGGCGGGCCTCCCCGACAAGTGTATGCATGGTTATAACGCCGTTAGACGGGATCGTACAGTGAGAGTCATTGCGTCCCTTCG [...]
+    <sequence id="seq_sb_l0_example03_s1_tip1" taxon="s1_tip1" totalcount="4" value="TTCAGCTTCCGTAGATTATGAGGGATATTCTTTACTTCCCCCAGATTGCCAGACTTTTAATATGATTGCCCTTCCATCTCGGTTCAACGGGAATCCATGTCGTAAAATGACTGTATGAGCCATGAACAAGCGCTACGATCCAGGCAGAGCGGGTTCGATTTATTTGGCCCGGCGCTGTAGCGAACTCGGGATGGGATCGATAGCTATTAGTTGTTCTGATTGTTAGAAGAAGCGGATCGGGTGCCTCGACAGCCAAGGCGAAGAATCTTACGTGCCTGAGTCTGCGAGCCTTAGGGGAATCAGAGCCCCGGAGTGAAGAACCGTCCGGCGGGCCTCCCCGACAAGTGTATGCATGGTTATAACGCCGTTAGACGGGATCGTACAGTGAGAGTCATTGCGTCCCTTCG [...]
+    <sequence id="seq_sb_l0_example03_s1_tip0" taxon="s1_tip0" totalcount="4" value="TTCAACTTCCGTAGATTATGAGGGATATTCTTTACTTCCCCCAGATTGCCAGAGTTTTAATATGATTGCCCTTCCATCTCGGATCAACGGGAATCCATGTCGTAAAATGACTGTATGTGCCATGAACAAGCGCTACGATCCAGGCAGAGCGGGTTCGATTTATTTGGCCCGGCGCTGTAGCGAACTCGGGATGGGATCGATAGCTATTAGTTGTTCTGATTGTTAGAAGAAGCGGATCGGGTGCCTCGACAGCCAAGGCGAAGAATCTTACGTGCCTGAGTCTGCGAGCATTAGGGGAATCAGAGCCCCGGAGTGAAGAACCGTCCGGCGGGCCTCCCCGACAAGTGTATGCATGGTTATAACGCCGTTAGACGGGATCGTACAGTGAGAGTCATTGCGTCCCTTCG [...]
+  </data>
+  <data dataType="nucleotide" id="sb_l1_example03" name="alignment" strip="false">
+    <sequence id="seq_sb_l1_example03_s6_tip0" taxon="s6_tip0" totalcount="4" value="GGCCCGTCAGCCTAACGCTAACATCCGAATGAGGGATAAGCCCGGAGTCACGACGGTAGCCTGGAAAATTGGCTAATTTACAATCTCGTCCAGGTTATATATAGGTTGTTACGCAAAGTTCATAGCTGAGCACCACCACTACGTACCGCAAATAACAGGTGGCGTCCTGCCGCTTCGGCTACTACAATGCGCTGTATCCGTAAAATTAATCGGGTAAACGGTTACTTAAATGAACCCCCAAATCGATATTAATCTAAGCGGCGATATACGTAAGTTGGGGTGCGCACAGAAGGTGCCCCGTACGACGGATCTCAACTCAAACGCGCCAGGAGCTACGCGCGGAAAAGCTTTGTCGATGGGAGGGTCTAACGGCCATATATACCTGCAACTTTTTAACCAATGAAACG [...]
+    <sequence id="seq_sb_l1_example03_s6_tip1" taxon="s6_tip1" totalcount="4" value="GGCCCGTCAGCCTAACGCTAACATCCGAATGAGGGATAAGCCCGGAGTCACGACGGTAGCCTGGAAAATTGGCTAATTTACAATCTCGTCCAGGTTATATATAGGTTGTTACGGAAAGTTCACAGCTGAGCACCACCACTACGTACCGCAAATAACAGGTGGCGTCCTGCCGCTTCGGCTACTACAATGCGCTGTATCCGTAAAATTAATCGGGTAAACGGTTACTTAAATGAACCCCCAAATCGATATTAATCTAAGCGGCGATATACGTAAGTTGGGGTGCGCACAGAAGGTGCCCCGTACGACGGATCTCAACTCAAACGCGCCAGGAGCTACGCGCGGAAAAGCTTTGTCGATGGGAGGGTCTAACGGCCATATATACCTGCAACTTTTTAACCAATGAAACG [...]
+    <sequence id="seq_sb_l1_example03_s4_tip0" taxon="s4_tip0" totalcount="4" value="GGCCCGTCAGCCTAACGCTAACATCCGAATGAGGGATAAGCCCGGAGTCACGACGGTCTCCTGGAAAATTGGCTAATTTACAATCTCGTCCAGGTTATATATAGGTTGTTACGCAAAGTTCATAGGTGAGCGCCACCACTACGTACCGCAAATACCAGGTGGCGTCCTGCCGCTTCGGCTACTACAATGCGCTGTATCCGTAAAATTAATAGAGTAAATGGTTACTTAAATGAACCCCCAAATCGATATTAATCTAAGCGGCGATATACGTAAGTTGGGGTACGCACAGAACGTGCCCCGTACGACGGATCTCAACTCAAACGCGCCAGGAGCTACGCGCGGAAAAGCTCTGTCGATGGGAGAGTCTAACGGCCATATATACCTGCAACTTTTTAACCAATGTAACG [...]
+    <sequence id="seq_sb_l1_example03_s4_tip1" taxon="s4_tip1" totalcount="4" value="GGCCCGTCAGCCTAACGCTAACATCCGAATGAGGGATAAGCCCGGAGTCACGACGGTCTCCTGGAAAATTGGCTAATTTACAATCTCGTCCAGGTTATATATAGGTTGTTACGCAAAGTTCATAGGTGAGCGCCACCACTACGTACCGCAAATACCAGGTGGCGTCCTGCCGCTTCGGCTACTACAATGCGCTGTATCCGTAAAATTAATAGAGTAAATGGTTACTTAAATGAACCCCCAAATCGATATTAATCTAAGCGGCGATATACGTAAGTTGGGGTACGCACAGAACGTGCCCCGTACGACGGATCTCAACTCAAACGCGCCAGGAGCTACGCGCGGAAAAGCTCTGTCGATGGGAGAGTCTAACGGCCATATATACCTGCAACTTTTTAACCAATGTAACG [...]
+    <sequence id="seq_sb_l1_example03_s2_tip1" taxon="s2_tip1" totalcount="4" value="GGCCCGTCAGCCTAACGCTAACATCCGAATGAGGGATAAGCCCGGAGTCACGACGGTCGCCTGGAAAATTGGCTAATTTACAATCTCGTCCAGGTTATATATAGGTTGTTACGCAAAGTTCATAGCTGAGCACCACCACTACGTACCGCAAATAACAGGTGGCGTCCTGCCGCTTCGGCTACTACAATGCGCTGTATCCGTAAAATTAATCGGGTAAATGGTTACTTAAATGAACCCCCAAATCGATATTAATCTAAGCGGCGATATACGTAAGTTGGGGTGCGCACAGAAGGTGCCCCGTACGACGGATCTCAACTCAAACGCGCCAGGAGCTACGCGCGGAAAAGCTCTGTCGATGGGAGGGTCTAACGGCCATAGATACCTGCAACTTTTTAACCAATGTAACG [...]
+    <sequence id="seq_sb_l1_example03_s2_tip0" taxon="s2_tip0" totalcount="4" value="GGCCCGTCAGCCTAACGCTAACATCCGAATGAGGGATAAGCCCGGAGTCACGACGGTCGCCTGGAAAATTGGCTAATTTACAATCTCGTCCAGGTTATATATAGTTTGTAACGCAAAGTTCATAGCTGGGCACCACCACTACGTACCGCAAATAACAGGTGGCGTCCTGCCGCTTCGGCTACTACAATGCGCTGTATCCGTAAAATTAATCGGGTAAATGGTTACTTAAATGAACCCCCAAATCGATATTAATCTAAGCGGCGATATACGTAAGTTGGGGTGCGCACAGAAGGTGCCCCGTACGACGGATCTCAACTCAAACGCGCCAGGAGCTACGCGCGGAAAAGCTCTGTCGATGGGAGGGTCTAACGGCCATATATACCTGCAACTTTTTAACCAATGTAACG [...]
+    <sequence id="seq_sb_l1_example03_s3_tip1" taxon="s3_tip1" totalcount="4" value="GGCCCGTCAGCCTAACGCTAACATCCGAATGAGGGATAAGCCCGGAGTCACGACGGTCTCCTGGAAAATTGGCTAATTTACAATCTCGTCCAGGTTATATATAGGTTGTTACGCAAAGTTCATAGCTGAGCGCCACCACTACGTACCGCAAATACCAGGTGGCGTCCTGCCGCTTCGGCTACTACAATGCGCTGTATCCGTAAAATTAATAGAGCAAATGGTTACTTAAATGAACCCCCAAATCGATATTAATCTAAGCGGCGATATACGTAAGTTGGGGTACGCACAGAACGTGCCCCGTACGACGGATCTCAACTCAAACGCGCCAGGAGCTACGCGCGGAAAAGCTCTGTCGATGGGAGAGTCTAACGGCCATATGTACCTGCAACTTTTTAACCAATGTAACG [...]
+    <sequence id="seq_sb_l1_example03_s3_tip0" taxon="s3_tip0" totalcount="4" value="GGCCCGTCAGCCTAACGCTAACATCCGAATGAGGGATGAGCCCGGAGCCACGACGGTCTCCTGGAAAATTGGCTAATTTACAATCTCGTCCAGATTATATATAGGTTGTTACGCAAAGTTCATAGCTGAGCGCCACCACTACGTACCGCAAATACCAGGTGGCGTCCTGCCGCTTCGGCTACTACAATGCGCTGTATCCGTAAAATTAATAGAGTAAATGGTTACTTAAATGAACCCCCAAATCGATATTAATCTAAGCGGCGATATACGTAAGTTGGGGTACGCACAGAACGTGCCCCGTACGACGGATCTCAACTCAAACGCGCCAGGAGCTACGCGCGGAAAAGCTCTGTCGATGGGAGAGTCTAACGGCCATATATACCTGCAACTTTTTAACCAATGTAACG [...]
+    <sequence id="seq_sb_l1_example03_s0_tip0" taxon="s0_tip0" totalcount="4" value="GGCCCGTCAGCCTAACGCTAACATCCGAATGAGGGATAAGCCCGGAGTCACGACGGTAGCCTGGAAAATTGGCTAATTTACAATCTCGTCCAGGTTATATATATGTTGTTACGCAAAGTTCATAGCTGAGCACCACCACTACGTACCGCAAATAACAGGTGGCGTCCTGCCGCTTCGGCTACTACAATGCGCTGTATCCGTAAAATTAATCGGGTAAACGGTTACTTAAATGAACCCCCAAATCGATATTAATCTAAGCGGCGATATACGTAAGTTGGGGTGCGCACAGAAGGTGCCCCGTACGACGGATCTCAACTCAAACGCGCCAGGAGCTACGCGCGGAAAAGCTCTGTCGATGGGAGGGTCTAACGGCCATATATACCTGCAACTTTTTAACCAATGAAACG [...]
+    <sequence id="seq_sb_l1_example03_s7_tip0" taxon="s7_tip0" totalcount="4" value="GGCCCGTCAGCCTAACGCTAACATCCGAATGAGGGATAAGCCCGGAGTCACGACGGTCGCCTGGAAAATTGGCTAATTTACAATCTCGTCCAGGTTATATATAGGTTGTTACGCAAAGTTCATAGCTGAGCACCACCACTACGTACCGCAAATAACAGGTGGCGTCCTGCCGCTTCGGCTACTACAATGCGCTGTATCCGTAAAATTAATCGGGTAAATGGTTACTTAAATGAACCCCCAAATCGATATTAATCTAAGCGGCGATATACGTAAGTTGGGGTGCGCACAGAAGGTGCCCCGTACGACGGATCTCAACTCAAACGCGCCAGGAGCTACGCGCGGAAAAGCTCTGTCGAGGGGAGGGTCTAACGGCCATATATACCTGCAACTTTTTAACCAATGTAACG [...]
+    <sequence id="seq_sb_l1_example03_s5_tip1" taxon="s5_tip1" totalcount="4" value="GGCCCGTCAGCCTAACGCTAACATCCGAATGAGGGATAAGCCCGGAGTCACGACGGTCTCCTGGAAAATTGGCTAATTTACAATCTCGTCCAGGTTATATATAGGTTGTTACGCAAAGTTCATAGCTGAGCACCACCACTACGTACCGCAAATAACAGGTGGCGTCCTGCCGCTTCGGCTACTACAATGCGCTGTATCCGTAAAATTAAAAGAGTAAATGGTTACTTAAATGAACCCCCAAATCGATATTAATCTAAGCGGCGATATACGTAAGTTGGGGTACGCACAGAAGGTGCCCCGTACGACGGATCTCAACTCAAACGCGCCAGGAGCTACGCGCGGAAAAGCTCTGTCGATGGGAGAGTCTAACGGCCATATATACCTGCAACTTTTTAACCAATGTAACG [...]
+    <sequence id="seq_sb_l1_example03_s5_tip0" taxon="s5_tip0" totalcount="4" value="GGCCCGTCAGCCTAACGCTAACATCCGAATGAGGGATAAGCCCGGAGTCACGACGGTCTCCTGGAAAATTGGCTAATTTACAATCTCGTCCAGGTTATATATAGGTTGTTACGCAAAGTTCATAGCTGAGCACCACCACTACGTACCGCAAATAACAGGTGGCGTCCTGCCGCTTCGGCTACTACAATGCGCTGTATCCGTAAAATTAATAGAGTAAATGGTTACTTAAATGAACCCCCAAATCGATATTAATCTAAGCGGCGATATACGTAAGTTGGGGTACGCACAGAAGGTGCCCCGTACGACGGATCTCAACTCAAACGCGCCAGGAGCTACGCGCGGAAAAGCTCTGTCGATGGGAGAGTCTAACGGCCATATATACCTGCAACTTTTTAACCAATGTAACG [...]
+    <sequence id="seq_sb_l1_example03_s7_tip1" taxon="s7_tip1" totalcount="4" value="GGCCCGTCAGCCTAACGCTAACATCCGAATGAGGGATAAGCCCGGAGTCACGACGGTCGCCTGGAAAATTGGCTAATTTACAATCTCGTCCAGGTTATATATAGGTTGTTACGCAAAGTTCATAGCTGAGCACCACCACTACGTACCGCAAATAACAGGTGGCGTCCTGCCGCTTCGGCTACTACAATGCGCTGTATCCGTAAAATTAATCGGGTAAATGGTTACTTAAATGAACCCCCAAATCGATATTAATCTAAGCGGCGATATACGTAAGTTGGGGTGCGCACAGAAGGTGCCCCGTACGACGGATCTCAACTCAAACGCGCCAGGAGCTACGCGCGGAAAAGCTCTGTCGAGGGGAGGGTCTAACGGCCATATATACCTGCAACTTTTTAACCAATGTAACG [...]
+    <sequence id="seq_sb_l1_example03_s0_tip1" taxon="s0_tip1" totalcount="4" value="GGCCCGTCAGCCTAACGCTAACATCCGAATGAGGGATAAGCCCGGAGTCACGACGGTAGCCTGGAAAATTGGCTAATTTACAATCTCGTCCAGGTTATATATAGGTTGTTACGCAAAGTTCATAGCTGAGCACCACCACTACGTACCGCAAATAACAGGTGGCGTCCTGCCGCTTCGGCTACTACAATGCGCTGTATCCGTAAAATTAATCGGGTAAACGGTTACTTAAATGAACCCCCAAATCGATATTAATCTAAGCGGCGATATACGTAAGTTGGGGTGCGCACAGAAGGTGCCCCGTACGACGGATCTCAACTCAAACGCGCCAGGAGCTACGCGCGGAAAAGCTCTGTCGATGGGAGGGTCTAACGGCCATATATACCTGCAACTTTTTAACCAATGAAACG [...]
+    <sequence id="seq_sb_l1_example03_s1_tip1" taxon="s1_tip1" totalcount="4" value="GGCCAGTCAGCCTAACGCTAACATCCGAATGAGGGATAAGCCCGGAGTCACGACGGTCGCCTGGAAAATTGGCTAATTTACAATCTCGTCAAGGTTATATATAGGTTGTTACGCAACGTTCATAGCTGCGCATCACCACTACGTACCGCAAATAACAGGTGGCGTCCTGCCGCTTCGGCTACTACAATGCGCTGTATCCGTAAAATTAATCGAGTAAATGGTTACTTAAATGAACCCCCAAATCGATATTAATCTAATCGGCGATATACGTAAGTTGGGGTGCGCACAGAAGGTGCCCCGTACGACGGATCTCAACTCAAACGCGCCAGGAGCTACGCGCGGAGAAGCTCTGTCGATGGGAGGGTCTAACGGCCATATATACCTGCAACTTTTTAACCAATGTAACG [...]
+    <sequence id="seq_sb_l1_example03_s1_tip0" taxon="s1_tip0" totalcount="4" value="GGCCAGTCAGCCTAACGCTAACATCCGAATGAGGGATAAGCCCGGAGTCACGACGGTCGCCTGGAAAATTGGCTAATTTACAATCTCGTCAAGGTTATATATAGGTTGTTACGCAACGTTCATAGCTGCGCATCACCACTACGTACCGCAAATAACAGGTGGCGTCCTGCCGCTTCGGCTACTACAATGCGCTGTATCCGTAAAATTAATCGAGTAAATGGTTACTTAAATGAACCCCCAAATCGATATTAATCTAATCGGCGATATACGTAAGTTGGGGTGCGCACAGAAGGTGCCCCGTACGACGGATCTCAACTCAAACGCGCCAGGAGCTACGCGCGGAAAAGCTCTGTCGATGGGAGGGTCTAACGGCCATATATACCTGCAACTTTTTAACCAATGTAACG [...]
+  </data>
+  <distribution id="posterior" spec="CompoundDistribution" useThreads="false">
+    <distribution id="speciescoalescent" spec="CompoundDistribution" useThreads="false">
+      <distribution bottomPopSize="@popSize" gammaParameter="@popMean" id="SpeciesTreePopSize.Species" popFunction="constant" spec="SpeciesTreePrior" taxonset="@speciestaxa" tree="@Tree.Species"/>
+      <distribution id="treePrior.sb_l0_example03" ploidy="1.0" spec="GeneTreeForSpeciesTreeDistribution" speciesTree="@Tree.Species" speciesTreePrior="@SpeciesTreePopSize.Species" tree="@Tree.sb_l0_example03"/>
+      <distribution id="treePrior.sb_l1_example03" ploidy="1.0" spec="GeneTreeForSpeciesTreeDistribution" speciesTree="@Tree.Species" speciesTreePrior="@SpeciesTreePopSize.Species" tree="@Tree.sb_l1_example03"/>
+    </distribution>
+    <distribution id="prior" spec="CompoundDistribution" useThreads="false">
+      <distribution birthDiffRate="@birthRate.Species" conditionalOnRoot="false" id="YuleModel.Species" spec="YuleModel" tree="@Tree.Species"/>
+      <distribution id="YuleBirthRatePrior.Species" spec="Prior" x="@birthRate.Species">
+        <distr id="OneOnX.0" offset="0.0" spec="OneOnX"/>
+      </distribution>
+      <distribution id="popMean.prior" spec="Prior" x="@popMean">
+        <distr id="OneOnX.01" offset="0.0" spec="OneOnX"/>
+      </distribution>
+    </distribution>
+    <distribution id="likelihood" spec="CompoundDistribution" useThreads="false">
+      <distribution data="@sb_l0_example03" id="treeLikelihood.sb_l0_example03" spec="TreeLikelihood" tree="@Tree.sb_l0_example03" useAmbiguities="false">
+        <siteModel gammaCategoryCount="0" id="SiteModel.sb_l0_example03" spec="SiteModel">
+          <parameter estimate="false" id="mutationRate.sb_l0_example03" name="mutationRate" value="1.0"/>
+          <parameter estimate="false" id="gammaShape.sb_l0_example03" name="shape" value="1.0"/>
+          <parameter estimate="false" id="proportionInvariant.sb_l0_example03" name="proportionInvariant" value="0.0"/>
+          <substModel id="JC69.sb_l0_example03" spec="JukesCantor"/>
+        </siteModel>
+        <branchRateModel id="StrictClock.sb_l0_example03" spec="beast.evolution.branchratemodel.StrictClockModel">
+          <parameter estimate="false" id="clockRate.sb_l0_example03" name="clock.rate" value="0.005"/>
+        </branchRateModel>
+      </distribution>
+      <distribution data="@sb_l1_example03" id="treeLikelihood.sb_l1_example03" spec="TreeLikelihood" tree="@Tree.sb_l1_example03" useAmbiguities="false">
+        <siteModel gammaCategoryCount="0" id="SiteModel.sb_l1_example03" spec="SiteModel">
+          <parameter estimate="false" id="mutationRate.sb_l1_example03" name="mutationRate" value="1.0"/>
+          <parameter estimate="false" id="gammaShape.sb_l1_example03" name="shape" value="1.0"/>
+          <parameter estimate="false" id="proportionInvariant.sb_l1_example03" name="proportionInvariant" value="0.0"/>
+          <substModel id="JC69.sb_l1_example03" spec="JukesCantor"/>
+        </siteModel>
+        <branchRateModel id="StrictClock.sb_l1_example03" spec="beast.evolution.branchratemodel.StrictClockModel">
+          <parameter estimate="false" id="clockRate.sb_l1_example03" name="clock.rate" value="0.005"/>
+        </branchRateModel>
+      </distribution>
+    </distribution>
+  </distribution>
+  <run chainLength="400000" id="mcmc" preBurnin="0" sampleFromPrior="false" spec="MCMC">
+    <state id="state">
+      <parameter dimension="1" id="popSize" minordimension="1" name="stateNode" value="1"/>
+      <tree id="Tree.sb_l0_example03" name="stateNode">
+        <taxonset id="TaxonSet.sb_l0_example03" spec="TaxonSet">
+          <data idref="sb_l0_example03" name="alignment"/>
+        </taxonset>
+      </tree>
+      <tree id="Tree.sb_l1_example03" name="stateNode">
+        <taxonset id="TaxonSet.sb_l1_example03" spec="TaxonSet">
+          <data idref="sb_l1_example03" name="alignment"/>
+        </taxonset>
+      </tree>
+      <tree id="Tree.Species" name="stateNode">
+        <taxonset id="speciestaxa" spec="TaxonSet">
+          <taxon id="s6" spec="TaxonSet">
+            <taxon id="s6_tip0" spec="Taxon"/>
+            <taxon id="s6_tip1" spec="Taxon"/>
+          </taxon>
+          <taxon id="s4" spec="TaxonSet">
+            <taxon id="s4_tip0" spec="Taxon"/>
+            <taxon id="s4_tip1" spec="Taxon"/>
+          </taxon>
+          <taxon id="s2" spec="TaxonSet">
+            <taxon id="s2_tip1" spec="Taxon"/>
+            <taxon id="s2_tip0" spec="Taxon"/>
+          </taxon>
+          <taxon id="s3" spec="TaxonSet">
+            <taxon id="s3_tip1" spec="Taxon"/>
+            <taxon id="s3_tip0" spec="Taxon"/>
+          </taxon>
+          <taxon id="s7" spec="TaxonSet">
+            <taxon id="s7_tip1" spec="Taxon"/>
+            <taxon id="s7_tip0" spec="Taxon"/>
+          </taxon>
+          <taxon id="s5" spec="TaxonSet">
+            <taxon id="s5_tip1" spec="Taxon"/>
+            <taxon id="s5_tip0" spec="Taxon"/>
+          </taxon>
+          <taxon id="s0" spec="TaxonSet">
+            <taxon id="s0_tip0" spec="Taxon"/>
+            <taxon id="s0_tip1" spec="Taxon"/>
+          </taxon>
+          <taxon id="s1" spec="TaxonSet">
+            <taxon id="s1_tip1" spec="Taxon"/>
+            <taxon id="s1_tip0" spec="Taxon"/>
+          </taxon>
+        </taxonset>
+      </tree>
+      <parameter dimension="1" estimate="true" id="birthRate.Species" minordimension="1" name="stateNode" lower="0.01" upper="100.0" value="1"/>
+      <parameter dimension="1" estimate="true" id="popMean" minordimension="1" name="stateNode" lower="0.01" upper="100.0" value="1"/>
+    </state>
+    <distribution idref="posterior"/>
+    <operator id="Reheight" spec="NodeReheight" taxonset="@speciestaxa" tree="@Tree.Species" weight="14">
+      <tree idref="Tree.sb_l0_example03" name="genetree"/>
+      <tree idref="Tree.sb_l1_example03" name="genetree"/>
+    </operator>
+    <operator degreesOfFreedom="1" id="popSizeScaler" optimise="true" parameter="@popSize" rootOnly="false" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.5" lower="0.05" upper="0.95" spec="ScaleOperator" weight="2"/>
+    <operator id="updown.stree" optimise="true" scaleFactor="0.75" spec="UpDownOperator" weight="5">
+      <parameter idref="birthRate.Species" name="up"/>
+      <parameter idref="popMean" name="down"/>
+      <parameter idref="popSize" name="down"/>
+      <tree idref="Tree.Species" name="down"/>
+    </operator>
+    <operator id="updown.pops" optimise="true" scaleFactor="0.75" spec="UpDownOperator" weight="5">
+      <parameter idref="popMean" name="down"/>
+      <parameter idref="popSize" name="down"/>
+    </operator>
+    <operator id="updown.all" optimise="true" scaleFactor="0.75" spec="UpDownOperator" weight="6">
+      <parameter idref="birthRate.Species" name="up"/>
+      <parameter idref="popMean" name="down"/>
+      <parameter idref="popSize" name="down"/>
+      <tree idref="Tree.Species" name="down"/>
+      <tree idref="Tree.sb_l0_example03" name="down"/>
+      <tree idref="Tree.sb_l1_example03" name="down"/>
+    </operator>
+    <operator degreesOfFreedom="1" id="YuleBirthRateScaler.Species" optimise="true" parameter="@birthRate.Species" rootOnly="false" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.75" lower="0.05" upper="0.95" spec="ScaleOperator" weight="2"/>
+    <operator degreesOfFreedom="1" id="popMeanScale" optimise="true" parameter="@popMean" rootOnly="false" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.75" lower="0.05" upper="0.95" spec="ScaleOperator" weight="2"/>
+    <operator id="treeScaler.sb_l0_example03" scaleFactor="0.5" lower="0.05" upper="0.95" spec="ScaleOperator" tree="@Tree.sb_l0_example03" weight="3.0"/>
+    <operator id="UniformOperator.sb_l0_example03" spec="Uniform" tree="@Tree.sb_l0_example03" weight="10.0"/>
+    <operator gaussian="true" id="SubtreeSlide.sb_l0_example03" optimise="true" size="1.0" spec="SubtreeSlide" tree="@Tree.sb_l0_example03" weight="5.0"/>
+    <operator id="narrow.sb_l0_example03" isNarrow="true" spec="Exchange" tree="@Tree.sb_l0_example03" weight="2.0"/>
+    <operator id="treeScaler.sb_l1_example03" scaleFactor="0.5" lower="0.05" upper="0.95" spec="ScaleOperator" tree="@Tree.sb_l1_example03" weight="3.0"/>
+    <operator id="UniformOperator.sb_l1_example03" spec="Uniform" tree="@Tree.sb_l1_example03" weight="10.0"/>
+    <operator gaussian="true" id="SubtreeSlide.sb_l1_example03" optimise="true" size="1.0" spec="SubtreeSlide" tree="@Tree.sb_l1_example03" weight="5.0"/>
+    <operator id="narrow.sb_l1_example03" isNarrow="true" spec="Exchange" tree="@Tree.sb_l1_example03" weight="2.0"/>
+    <logger fileName="sb_example03_$(seed).log" id="tracelog" logEvery="10000" mode="autodetect" model="@posterior">
+      <distribution idref="posterior" name="log"/>
+      <distribution idref="likelihood" name="log"/>
+      <distribution idref="prior" name="log"/>
+      <distribution idref="speciescoalescent" name="log"/>
+      <parameter idref="birthRate.Species" name="log"/>
+      <distribution idref="YuleModel.Species" name="log"/>
+      <log id="SpeciesTreeHeight" spec="TreeHeightLogger" tree="@Tree.Species"/>
+      <log idref="popMean"/>
+      <log id="TreeHeight.sb_l0_example03" spec="beast.evolution.tree.TreeHeightLogger" tree="@Tree.sb_l0_example03"/>
+      <log id="TreeHeight.sb_l1_example03" spec="beast.evolution.tree.TreeHeightLogger" tree="@Tree.sb_l1_example03"/>
+    </logger>
+    <logger fileName="sb_example03_species_$(seed).trees" id="speciesTreeLogger" logEvery="10000" mode="tree">
+      <log id="SpeciesTreeLogger.0" popSize="@popSize" spec="SpeciesTreeLogger" speciesTreePrior="@SpeciesTreePopSize.Species" tree="@Tree.Species">
+        <treetop id="treeTopFinder" spec="TreeTopFinder">
+          <tree idref="Tree.sb_l0_example03"/>
+          <tree idref="Tree.sb_l1_example03"/>
+        </treetop>
+      </log>
+    </logger>
+    <logger id="screenlog" logEvery="10000" mode="autodetect" model="@posterior">
+      <distribution idref="posterior" name="log"/>
+      <log arg="@posterior" id="ESS.0" spec="util.ESS"/>
+      <distribution idref="likelihood" name="log"/>
+      <distribution idref="prior" name="log"/>
+    </logger>
+    <operatorschedule autoOptimize="true" autoOptimizeDelay="10000" id="OperatorSchedule.0" spec="OperatorSchedule" transform="sqrt"/>
+    <logger fileName="sb_l0_example03.$(seed).trees" id="treelog.sb_l0_example03" logEvery="10000" mode="tree">
+      <tree idref="Tree.sb_l0_example03" name="log"/>
+    </logger>
+    <logger fileName="sb_l1_example03.$(seed).trees" id="treelog.sb_l1_example03" logEvery="10000" mode="tree">
+      <tree idref="Tree.sb_l1_example03" name="log"/>
+    </logger>
+
+    <tree id="SBI"  name="init" spec="StarBeastStartState">
+      <!-- method="random" -->
+      <gene idref="Tree.sb_l0_example03"/>
+      <gene idref="Tree.sb_l1_example03"/>
+      <speciesTree idref="Tree.Species"/>
+      <baseRate idref="clockRate.sb_l0_example03"/>
+      <popMean idref="popMean"/>
+      <birthRate idref="birthRate.Species"/>
+      <speciesTreePrior idref="SpeciesTreePopSize.Species"/>
+    </tree>
+    
+  </run>
+</beast>
diff --git a/examples/testBSP.xml b/examples/testBSP.xml
new file mode 100644
index 0000000..d68d936
--- /dev/null
+++ b/examples/testBSP.xml
@@ -0,0 +1,205 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beast version='2.0'
+       namespace='beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood'>
+
+    <!-- 17 taxa, 1485 sites, 138 patterns -->
+    <data dataType="nucleotide" id="alignment">
+        <sequence taxon="D4Brazi82">
+
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence taxon="D4ElSal83">
+
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence taxon="D4ElSal94">
+
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTGGTGCTAGAACATGGAGGATGCGTCACAACCATAGCCCAGGGAAAACCAACCTTGGATTTTGAATTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGGAATGGCTGTGGCTTGCTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGATACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence taxon="D4Indon76">
+
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTAAAAGAGGAACAAGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence taxon="D4Indon77">
+
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTAAAAGAGGAACAAGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTAGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAACCATGGAGTT [...]
+        </sequence>
+        <sequence taxon="D4Mexico84">
+
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTAGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGCTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence taxon="D4NewCal81">
+
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence taxon="D4Philip64">
+
+            ATGCGATGCGTGGGAGTGGGGAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATTTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCGATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAACCTTATCTCAAAGAGGAACAAGATCAACAGTACATCTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGATACATCCAACCATGGAGTG [...]
+        </sequence>
+        <sequence taxon="D4Philip56">
+
+            ATGCGATGCGTGGGAGTGGGGAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATTTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCGATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAACCTTATCTCAAAGAGGAACAAGATCAACAGTACATCTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGCTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTAGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACATATCCAACCATGGAGTG [...]
+        </sequence>
+        <sequence taxon="D4Philip84">
+
+            ATGCGATGCGTAGGAGTGGGGAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACTTAGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAAGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCGATATCAAACATAACCACGGCAACAAGATGCCCAACGCAAGGAGAACCTTATCTCAAAGAGGAACAAGATCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTCTCATGCTCGGGAAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATATACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAACCATGGAGTG [...]
+        </sequence>
+        <sequence taxon="D4PRico86">
+
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGGGAGCCCTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATCTGGTCCAAATTGAGAACCTTGAGTACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence taxon="D4SLanka78">
+
+            ATGCGATGCGTGGGAGTGGGGAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAAGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCCATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAGCCCTGTCTCAAAGAGGAACAGGATCAACAGTACATCTGCCGGAGAGACGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCCTGCTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACAGGCAACTTAGTCCGAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAACCACGGAGTG [...]
+        </sequence>
+        <sequence taxon="D4Tahiti79">
+
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence taxon="D4Tahiti85">
+
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTTTCAGGTGGAGCATGGGTCGATTTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATCTGGTCCAAATTGAGAACCTTGAATACACAGTGGTCATAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+        <sequence taxon="D4Thai63">
+
+            ATGCGATGCGTAGGAGTGGGGAACAGGGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCTCAAGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCGATATCAAACATAACCACGGCGACAAGATGTCCAACGCAAGGAGAGCCTTATCTCAAAGAGGAACAAGATCAACAGTACATCTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTACTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACAGGCAACTTGGTTCGAATTGAGAACCTTGAATACACAGTGGTTGTGACAGTCCACAACGGAGACACCCATGCAGTAGGAAATGACATATCCAACCATGGAGTG [...]
+        </sequence>
+        <sequence taxon="D4Thai78">
+
+            ATGCGATGCGTAGGAGTGGGGAACAGAGACTTTGTAGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCCATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTACCTCAAAGAGGAACAAGATCAACAGTACATCTGCCGGAGAGACGTGGTAGATAGAGGGTGGGGCAACGGCTGTGGCTTGCTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACAGGCAACTTAGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCTGTAGGAAATGATACATCCAACCACGGAGTG [...]
+        </sequence>
+        <sequence taxon="D4Thai84">
+
+            ATGCGATGCGTAGGAGTAGGGAACAGAGACTTTGTAGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAGGGAAAACCAACCCTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCCATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTACCTCAAAGAGGAACAAGATCAACAGTACATCTGCCGGAGAGACGTGGTAGACAGAGGGTGGGGCAACGGCTGTGGCTTGTTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACGGGCAACTTAGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCTGTAGGAAATGATACATCCAACCACGGAGTG [...]
+        </sequence>
+    </data>
+
+
+
+
+
+    <tree spec='beast.util.ClusterTree' id='tree' clusterType='upgma'>
+        <trait spec='beast.evolution.tree.TraitSet' traitname='date-forward' units='year'
+               value='
+		D4Brazi82  = 1982,
+		D4ElSal83  = 1983,
+		D4ElSal94  = 1994,
+		D4Indon76  = 1976,
+		D4Indon77  = 1977,
+		D4Mexico84 = 1984,
+		D4NewCal81 = 1981,
+		D4Philip64 = 1964,
+		D4Philip56 = 1956,
+		D4Philip84 = 1984,
+		D4PRico86  = 1986,
+		D4SLanka78 = 1978,
+		D4Tahiti79 = 1979,
+		D4Tahiti85 = 1985,
+		D4Thai63   = 1963,
+		D4Thai78   = 1978,
+		D4Thai84   = 1984'>
+		<taxa spec='beast.evolution.alignment.TaxonSet' alignment='@alignment'/>
+        </trait>
+        <taxa idref='alignment'/>
+    </tree>
+
+    <distribution spec="CompoundDistribution" id="posterior">
+        <distribution spec="CompoundDistribution" id="prior">
+            <distribution id="hky.kappa.prior" spec="beast.math.distributions.Prior" x="@hky.kappa">
+                <distr id="LogNormalDistributionModel" M="1.0" S="1.25" meanInRealSpace="false"
+                              spec="beast.math.distributions.LogNormalDistributionModel"/>
+            </distribution>
+
+            <distribution spec="BayesianSkyline" id='skyline'>
+                <popSizes idref="skyline.popSize"/>
+                <groupSizes idref='skyline.groupSize'/>
+                <treeIntervals spec='TreeIntervals' id='TreeIntervals'>
+                    <tree idref="tree"/>
+                </treeIntervals>
+            </distribution>
+
+            <distribution id='eml1' spec="beast.math.distributions.MarkovChainDistribution" 
+				jeffreys="true"
+				parameter="@skyline.popSize"/>
+        </distribution>
+
+		<distribution spec='TreeLikelihood' id="likelihood">
+		    <data idref="alignment"/>
+		    <tree idref="tree"/>
+			<siteModel spec='SiteModel' id="siteModel" gammaCategoryCount="4">
+				<parameter id='siteModel.alpha' name='shape' value='5.40372E-2'/>
+				<substModel spec='HKY' id="hky">
+					<parameter name='kappa' id="hky.kappa" value="21.5056" lower="0.0"/>
+					<frequencies id='freqs' spec='Frequencies' data="@alignment"/>
+				</substModel>
+			</siteModel>
+			<branchRateModel spec='beast.evolution.branchratemodel.StrictClockModel' id="branchRates">
+				<parameter name='clock.rate' id='clock.rate' value="8.8579E-4" lower="0.0" upper="100.0"/>
+			</branchRateModel>
+		</distribution>
+    </distribution>
+
+    <run spec="MCMC" id="mcmc" chainLength="10000000">
+        <state>
+			<parameter name='stateNode' id="skyline.popSize" dimension="5" value="380.0" lower="0.0" upper="38000.0"/>
+			<stateNode spec='parameter.IntegerParameter' id='skyline.groupSize' dimension="5" value="0"/>
+            <stateNode idref="hky.kappa"/>
+            <stateNode idref="tree"/>
+            <stateNode idref="clock.rate"/>
+            <stateNode idref="siteModel.alpha"/>
+        </state>
+
+        <distribution idref="posterior"/>
+        <operator id='kappaScaler' spec='ScaleOperator' scaleFactor="0.75" weight="1" parameter="@hky.kappa"/>
+        <operator id='shapeScaler' spec='ScaleOperator' scaleFactor="0.75" weight="1" parameter="@siteModel.alpha"/>
+        <operator id='clockRateScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3" parameter="@clock.rate"/>
+
+        <operator id='upDown' spec='UpDownOperator' scaleFactor="0.77" weight="3" up="@clock.rate" down='@tree'/>
+
+        <operator id='popSizesScaler' spec='ScaleOperator' scaleFactor="0.75" weight="15" parameter="@skyline.popSize"/>
+
+        <operator id='groupSizesDelta' spec='DeltaExchangeOperator' delta="1" weight="6" integer="true"
+                  intparameter="@skyline.groupSize"/>
+
+<!--
+        <operator id='frequenciesDelta' spec='DeltaExchangeOperator' delta="0.01" weight="0.1"
+                  parameter="@hky.frequencies"/>
+-->
+        <operator id='treeRootScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3" tree="@tree" rootOnly='true'/>
+        <operator spec='Uniform' weight="30" tree="@tree"/>
+<!--
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3" tree="@tree"/>
+-->
+        <operator spec='SubtreeSlide' weight="15" gaussian="true" size="3.8" tree="@tree"/>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="15" tree="@tree"/>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="3" tree="@tree"/>
+        <operator spec='WilsonBalding' weight="3" tree="@tree"/>
+
+
+        <logger logEvery="1000" fileName="test.$(seed).log">
+            <log idref="posterior"/>
+            <log idref="siteModel.alpha"/>
+            <log idref="clock.rate"/>
+            <log idref="skyline.popSize"/>
+            <log idref="skyline.groupSize"/>
+            <log idref="hky.kappa"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree' id='treeModel.rootHeight'/>
+            <log idref="likelihood"/>
+            <log idref="skyline"/>
+            <log idref="eml1"/>
+        </logger>
+
+        <logger logEvery="1000" fileName="test.$(seed).trees">
+			<log idref="tree"/>
+		</logger>              
+
+        <logger logEvery="100000">
+            <log idref="posterior"/>
+            <log idref="likelihood"/>
+            <log idref="prior"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+        </logger>
+
+    </run>
+</beast>
+
diff --git a/examples/testCalYule_5t_2c.xml b/examples/testCalYule_5t_2c.xml
new file mode 100644
index 0000000..37a4f98
--- /dev/null
+++ b/examples/testCalYule_5t_2c.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0" standalone="yes"?>
+<!-- Test calibration implementation: 5 taxa - prior on 2-taxon clade, uniform prior  -->
+<beast version='2.0'
+       namespace='beast.evolution.alignment:beast.evolution.speciation:beast.core:beast.evolution.tree.coalescent:beast.util:beast.core.util:beast.evolution.likelihood:beast.math.distributions:beast.evolution.operators'>
+
+  <taxonset spec='TaxonSet' id='taxa'>
+	<taxon spec='Taxon' id='a'/> 
+	<taxon spec='Taxon' id='b'/>
+	<taxon spec='Taxon' id='c'/> 
+	<taxon spec='Taxon' id='d'/>
+	<taxon spec='Taxon' id='e'/>
+   </taxonset>
+
+  <input spec='CalibratedYuleModel' type="full" id="cyule">
+    <birthRate spec='parameter.RealParameter' value="2.0"/>
+    <tree idref='tree'/>
+
+    <calibrations spec='CalibrationPoint' id='cal'>
+      <taxonset spec='TaxonSet'>
+	<taxon idref='a'/> 
+	<taxon idref='b'/>
+      </taxonset>
+      <distr id="Uniform" lower="4.0" upper="7.0" spec="Uniform"/>
+    </calibrations>
+  </input>
+
+  <run spec="MCMC" id="mcmc" chainLength="10000">
+    <init spec='CalibratedYuleInitialTree' id='startTree' initial='@tree'
+	  taxonset='@taxa' calibrations='@cal'>
+    </init>
+
+    <state>
+      <stateNode spec='beast.evolution.tree.Tree' id='tree'/>
+    </state>
+
+    <distribution spec='CompoundDistribution' id='posterior'>
+      <distribution id="cyule.prior" idref='cyule'/>
+    </distribution>
+
+    <operator spec='SubtreeSlide' weight="15" gaussian="true" size="0.5" tree="@tree"/>
+
+    <logger logEvery="100" fileName="test_5t_2c_i.$(seed).log">
+      <model idref='posterior'/>
+      <log idref="posterior"/>
+      <log idref="cyule"/>
+    </logger>
+    <logger logEvery="100" fileName="test_5t_2c_i.$(seed).trees">
+        <log idref="tree"/>
+    </logger>
+    <logger logEvery="1000">
+      <model idref='posterior'/>
+      <log idref="cyule"/>
+    </logger>
+  </run>
+</beast>
diff --git a/examples/testCalibration.xml b/examples/testCalibration.xml
new file mode 100644
index 0000000..799e596
--- /dev/null
+++ b/examples/testCalibration.xml
@@ -0,0 +1,146 @@
+<beast version='2.0'
+       namespace='beast.evolution:beast.evolution.alignment:beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood'>
+
+
+    <!-- The sequence alignment                                                  -->
+    <!-- ntax=6 nchar=768                                                        -->
+    <!-- npatterns=69                                                            -->
+    <data id="alignment" dataType="nucleotide">
+        <sequence taxon="human">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="chimp">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="bonobo">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAGC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTTGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="gorilla">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTAAACATAGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA-CAACACTTAATTTCTGTAAGGACTGCAAAACCCTACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCAATGGGACTCAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAT-TCAC [...]
+        </sequence>
+        <sequence taxon="orangutan">
+            AGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA-CAGCACTTAATTTCTGTAAGGACTGCAAAACCCCACTTTGCATCAACTGAGCGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCCTAGACCGATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAT-TGGCTTCAGTCCAAAGCCCCGGCAGGCCTTAAAGCTGCTCCTTCGAATTTGCAATTCAACATGACAA-TCAC [...]
+        </sequence>
+        <sequence taxon="siamang">
+            AGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTAACAAAACTTAATTTCTGCAAGGGCTGCAAAACCCTACTTTGCATCAACCGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCGATGGGACTTAAACCCATAAAAATTTAGTTAACAGCTAAACACCCTAAACAACCTGGCTTCAATCTAAAGCCCCGGCAGA-GTTGAAGCTGCTTCTTTGAACTTGCAATTCAACGTGAAAAATCAC [...]
+        </sequence>
+    </data>
+
+
+
+    <run spec="MCMC" id="mcmc" chainLength="10000000"> <!--autoOptimize="true"-->
+        <init spec='beast.evolution.tree.RandomTree' id='randomTree' initial='@tree' taxa='@alignment'>
+            <populationModel spec='ConstantPopulation' popSize='@popSize'/>
+            <constraint idref='mrcaPrior2'/>
+            <constraint idref='mrcaPrior1'/>
+        </init>
+
+        <state>
+            <stateNode spec='parameter.RealParameter' id="hky.kappa" value="2.0" lower="0.0"/>
+            <stateNode spec='parameter.RealParameter' id="hky.frequencies" value="0.25" dimension="4" lower='0.0'/>
+            <stateNode spec='parameter.RealParameter' id="popSize" value="17" lower="0.0"/>
+            <stateNode spec='beast.evolution.tree.Tree' id='tree'>
+                <taxonset spec='TaxonSet' alignment='@alignment'/>
+            </stateNode>
+        </state>
+
+        <distribution spec='CompoundDistribution' id='posterior'>
+            <distribution spec='CompoundDistribution' id='prior'>
+                <distribution id="hky.kappa.prior" spec="beast.math.distributions.Prior" x="@hky.kappa">
+                    <distr id="LogNormalDistributionModel" M="1.0" S="1.25" meanInRealSpace="false"
+                                  spec="beast.math.distributions.LogNormalDistributionModel"/>
+                </distribution>
+                <distribution id="hky.frequencies.prior" spec="beast.math.distributions.Prior" x="@hky.frequencies">
+                    <distr id="Uniform" lower="0.0" upper="1.0" spec="beast.math.distributions.Uniform"/>
+                </distribution>
+                <distribution id="popSize.prior" spec="beast.math.distributions.Prior" x="@popSize">
+                    <distr id="OneOnX" offset="0.0" spec="beast.math.distributions.OneOnX"/>
+                </distribution>
+
+                <distribution id='mrcaPrior1' spec='beast.math.distributions.MRCAPrior' tree='@tree' monophyletic='true'>
+                    <taxonset spec='TaxonSet' id='allButSiamang'>
+<!--
+-->
+                        <taxon spec='Taxon' idref='human'/>
+                        <taxon spec='Taxon' id='bonobo'/>
+                        <taxon spec='Taxon' idref='chimp'/>
+                        <taxon spec='Taxon' id='gorilla'/>
+                        <taxon spec='Taxon' id='orangutan'/>
+                    </taxonset>
+                    <distr idref='normalDistr'/>
+                </distribution>
+
+                <distribution id='mrcaPrior2' spec='beast.math.distributions.MRCAPrior' tree='@tree' monophyletic='true'>
+                    <taxonset spec='TaxonSet' id='human,chimp'>
+                        <taxon spec='Taxon' id='human'/>
+                        <taxon spec='Taxon' id='chimp'/>
+                    </taxonset>
+                    <distr id='normalDistr' spec='beast.math.distributions.Normal'>
+                        <parameter name='mean' value='6.0'/>
+                        <parameter name='sigma' value='0.5'/>
+                    </distr>
+                </distribution>
+
+
+                <distribution id="coalescent" spec="Coalescent">
+                    <treeIntervals spec='TreeIntervals' id='TreeIntervals'>
+                        <tree idref="tree"/>
+                    </treeIntervals>
+                    <populationModel spec="ConstantPopulation" id='ConstantPopulation'>
+                        <parameter name="popSize" idref="popSize"/>
+                    </populationModel>
+                </distribution>
+            </distribution>
+
+            <distribution spec='TreeLikelihood' id="likelihood" data='@alignment' tree='@tree'>
+                <siteModel id="siteModel" spec='SiteModel'>
+                    <substModel spec='HKY' id="hky">
+                        <parameter name='kappa' idref='hky.kappa'/>
+                        <frequencies id='freqs' spec='Frequencies' frequencies='@hky.frequencies'/>
+                    </substModel>
+                </siteModel>
+            </distribution>
+        </distribution>
+
+        <operator id='kappaScaler' spec='ScaleOperator' scaleFactor="0.75" weight="0.1" parameter="@hky.kappa"/>
+        <operator id='frequenciesDelta' spec='DeltaExchangeOperator' delta="0.01" weight="0.1"
+                  parameter="@hky.frequencies"/>
+        <operator id='popSizeScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3" parameter="@popSize"/>
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3" tree="@tree"/>
+        <operator spec='Uniform' weight="30" tree="@tree"/>
+        <operator spec='SubtreeSlide' weight="15" gaussian="true" size="1.7" tree="@tree"/>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="15" tree="@tree"/>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="3" tree="@tree"/>
+        <operator spec='WilsonBalding' weight="1" tree="@tree"/>
+        <operator spec='UpDownOperator' scaleFactor="0.75" weight="3" down="@tree"/>
+
+        <logger logEvery="1000" fileName="test.$(seed).log">
+            <model idref='posterior'/>
+            <log idref="posterior"/>
+            <log idref="prior"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+            <log spec='beast.math.distributions.MRCAPrior' tree='@tree' id='HumanChimpMRCA' taxonset='@human,chimp' />
+            <log idref="popSize"/>
+            <log idref="hky.kappa"/>
+            <log idref="hky.frequencies"/>
+            <log idref="likelihood"/>
+            <log idref="coalescent"/>
+        </logger>
+        <logger logEvery="1000" fileName="test.$(seed).trees">
+            <log idref="tree"/>
+        </logger>
+        <logger logEvery="100000">
+            <model idref='posterior'/>
+            <log idref="posterior"/>
+            <log idref="prior"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+            <log idref='HumanChimpMRCA'/>
+            <log idref="popSize"/>
+            <log idref="hky.kappa"/>
+            <log idref="hky.frequencies"/>
+            <log idref="likelihood"/>
+            <log idref="coalescent"/>
+        </logger>
+    </run>
+
+</beast>
diff --git a/examples/testClassicRootCalibrationPrior.xml b/examples/testClassicRootCalibrationPrior.xml
new file mode 100644
index 0000000..d42ab91
--- /dev/null
+++ b/examples/testClassicRootCalibrationPrior.xml
@@ -0,0 +1,78 @@
+<?xml version="1.0" standalone="yes"?>
+<beast version='2.0'
+       namespace='beast.evolution.alignment:beast.evolution.speciation:beast.core:beast.evolution.tree.coalescent:beast.util:beast.core.util:beast.evolution.likelihood:beast.math.distributions:beast.evolution.operators'>
+
+    <!-- for Figure 9.1 in BEAST2 book -->
+
+    <taxonset spec='TaxonSet' id='taxa'>
+        <taxon spec='Taxon' id='1'/>
+        <taxon spec='Taxon' id='2'/>
+        <taxon spec='Taxon' id='3'/>
+        <taxon spec='Taxon' id='4'/>
+    </taxonset>
+
+    <data id="alignment" dataType="nucleotide">
+        <sequence taxon="1">A</sequence>
+        <sequence taxon="2">A</sequence>
+        <sequence taxon="3">A</sequence>
+        <sequence taxon="4">A</sequence>
+    </data>
+
+    <input spec='YuleModel' id="yule">
+        <parameter name='birthDiffRate' id="birthRate" value="1"/>
+        <tree spec='TreeParser' id='tree' taxa='@alignment'
+              newick='(((1:1.0,2:1.0):1.0,3:2.0):1.0,4:3.0);'/>
+    </input>
+
+    <distribution id='rootPrior' spec='beast.math.distributions.MRCAPrior' tree='@tree' monophyletic='true'>
+        <taxonset spec='TaxonSet' id='all'>
+            <taxon idref='1'/>
+            <taxon idref='2'/>
+            <taxon idref='3'/>
+            <taxon idref='4'/>
+        </taxonset>
+        <distr id='logNormalDistribution' spec='beast.math.distributions.LogNormalDistributionModel'>
+            <parameter name='M' value='2'/>
+            <parameter name='S' value='0.2'/>
+        </distr>
+    </distribution>
+
+    <run spec="MCMC" id="mcmc" chainLength="1000000">
+
+        <state>
+            <stateNode idref='tree'/>
+            <stateNode idref="birthRate"/>
+        </state>
+
+        <distribution spec='CompoundDistribution' id='posterior'>
+            <distribution id="yule.prior" idref='yule'/>
+            <distribution idref="rootPrior"/>
+
+            <distribution id="birthRate.prior" spec="beast.math.distributions.Prior" x="@birthRate">
+                <distr id="OneOnX" offset="0.0" spec="beast.math.distributions.OneOnX"/>
+            </distribution>
+
+        </distribution>
+
+        <operator spec='SubtreeSlide' weight="4" gaussian="true" size="2.5" tree="@tree"/>
+        <operator spec="ScaleOperator" weight="1" scaleFactor="0.25">
+            <parameter idref="birthRate"/>
+        </operator>
+
+        <logger logEvery="100" fileName="classic_root_prior_oneOnX.$(seed).log">
+            <model idref='posterior'/>
+            <log idref="posterior"/>
+            <log idref="yule"/>
+            <log spec='beast.math.distributions.MRCAPrior' tree='@tree' id='all.age' taxonset='@all' />
+            <log idref="birthRate"/>
+        </logger>
+        <logger logEvery="100" fileName="classic_root_prior_oneOnX.$(seed).trees">
+            <log idref="tree"/>
+        </logger>
+        <logger logEvery="100">
+            <model idref='posterior'/>
+            <log idref="yule"/>
+            <log idref="birthRate"/>
+        </logger>
+    </run>
+</beast>
diff --git a/examples/testCoalescent.xml b/examples/testCoalescent.xml
new file mode 100644
index 0000000..b202959
--- /dev/null
+++ b/examples/testCoalescent.xml
@@ -0,0 +1,126 @@
+<beast version='2.0'
+       namespace='beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood'>
+
+
+    <!-- The sequence alignment (each sequence refers to a taxon above).         -->
+    <!-- ntax=6 nchar=768                                                        -->
+    <!-- npatterns=69                                                            -->
+    <data id="alignment" dataType="nucleotide">
+        <sequence taxon="human">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="chimp">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="bonobo">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAGC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTTGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="gorilla">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTAAACATAGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA-CAACACTTAATTTCTGTAAGGACTGCAAAACCCTACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCAATGGGACTCAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAT-TCAC [...]
+        </sequence>
+        <sequence taxon="orangutan">
+            AGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA-CAGCACTTAATTTCTGTAAGGACTGCAAAACCCCACTTTGCATCAACTGAGCGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCCTAGACCGATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAT-TGGCTTCAGTCCAAAGCCCCGGCAGGCCTTAAAGCTGCTCCTTCGAATTTGCAATTCAACATGACAA-TCAC [...]
+        </sequence>
+        <sequence taxon="siamang">
+            AGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTAACAAAACTTAATTTCTGCAAGGGCTGCAAAACCCTACTTTGCATCAACCGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCGATGGGACTTAAACCCATAAAAATTTAGTTAACAGCTAAACACCCTAAACAACCTGGCTTCAATCTAAAGCCCCGGCAGA-GTTGAAGCTGCTTCTTTGAACTTGCAATTCAACGTGAAAAATCAC [...]
+        </sequence>
+    </data>
+
+    <!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+    <input spec='HKY' id="hky">
+        <parameter name='kappa' idref='hky.kappa'/>
+        <input id='freqs' name='frequencies' spec='Frequencies'>
+            <input name='data' idref='alignment'/>
+        </input>
+    </input>
+
+    <!-- site model                                                              -->
+    <input spec='SiteModel' id="siteModel">
+        <!--<parameter name='mutationRate'>1.0</parameter>-->
+        <input name='substModel' idref='hky'/>
+    </input>
+
+    <input spec='TreeLikelihood' id="treeLikelihood">
+        <input name='data' idref="alignment"/>
+        <input name='tree' idref="tree"/>
+        <input name='siteModel' idref="siteModel"/>
+    </input>
+
+
+    <input spec='beast.util.ClusterTree' id='tree' clusterType='upgma'>
+        <input name='taxa' idref='alignment'/>
+    </input>
+
+    <input spec='beast.core.parameter.RealParameter' id="hky.kappa">1.0</input>
+
+    <input spec='beast.core.parameter.RealParameter' id="popSize">1.0</input>
+
+
+    <run spec="MCMC" id="mcmc" chainLength="1000000"> <!--autoOptimize="true"-->
+        <state>
+            <input name='stateNode' idref='hky.kappa'/>
+            <input name='stateNode' idref='popSize'/>
+            <input name='stateNode' idref='tree'/>
+        </state>
+
+        <distribution spec="CompoundDistribution" id="posterior">
+            <distribution id="coalescent" spec="Coalescent">
+                <treeIntervals spec='TreeIntervals' id='TreeIntervals'>
+                     <tree idref="tree"/>
+                </treeIntervals>
+                <populationModel spec="ConstantPopulation" id='ConstantPopulation'>
+                    <parameter name="popSize" idref="popSize"/>
+                </populationModel>
+            </distribution>
+            <distribution id='likelihood' idref="treeLikelihood"/>
+        </distribution>
+
+        <operator id='kappaScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1">
+            <parameter idref="hky.kappa"/>
+        </operator>
+        <operator id='popSizeScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1">
+            <parameter idref="popSize"/>
+        </operator>
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1">
+            <tree idref="tree"/>
+        </operator>
+        <operator spec='Uniform' weight="10">
+            <tree idref="tree"/>
+        </operator>
+        <operator spec='SubtreeSlide' weight="5" gaussian="true" size="1.0">
+            <tree idref="tree"/>
+        </operator>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="1">
+            <tree idref="tree"/>
+        </operator>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="1">
+            <tree idref="tree"/>
+        </operator>
+        <operator spec='WilsonBalding' weight="1">
+            <tree idref="tree"/>
+        </operator>
+
+        <logger logEvery="10000" fileName="test.$(seed).log">
+   	        <model idref='posterior'/>
+            <log idref="coalescent"/>
+            <log idref="likelihood"/>
+            <!--parameter idref="treeModel.rootHeight"/-->
+            <log idref="popSize"/>
+            <log idref="hky.kappa"/>
+            <log idref="posterior"/>
+        </logger>
+        <logger logEvery="10000" fileName="test.$(seed).trees">
+            <log idref="tree"/>
+        </logger>
+        <logger logEvery="10000">
+	        <model idref='posterior'/>
+            <log idref="coalescent"/>
+            <log idref="likelihood"/>
+            <!--parameter idref="treeModel.rootHeight"/-->
+            <log idref="popSize"/>
+            <log idref="hky.kappa"/>
+            <log idref="posterior"/>
+        </logger>
+    </run>
+
+</beast>
diff --git a/examples/testConditionalRootCalibrationPrior.xml b/examples/testConditionalRootCalibrationPrior.xml
new file mode 100644
index 0000000..b0582a6
--- /dev/null
+++ b/examples/testConditionalRootCalibrationPrior.xml
@@ -0,0 +1,78 @@
+<?xml version="1.0" standalone="yes"?>
+<beast version='2.0'
+       namespace='beast.evolution.alignment:beast.evolution.speciation:beast.core:beast.evolution.tree.coalescent:beast.util:beast.core.util:beast.evolution.likelihood:beast.math.distributions:beast.evolution.operators'>
+
+    <!-- for Figure 9.1 in BEAST2 book -->
+
+    <taxonset spec='TaxonSet' id='taxa'>
+        <taxon spec='Taxon' id='1'/>
+        <taxon spec='Taxon' id='2'/>
+        <taxon spec='Taxon' id='3'/>
+        <taxon spec='Taxon' id='4'/>
+    </taxonset>
+
+    <data id="alignment" dataType="nucleotide">
+        <sequence taxon="1">A</sequence>
+        <sequence taxon="2">A</sequence>
+        <sequence taxon="3">A</sequence>
+        <sequence taxon="4">A</sequence>
+    </data>
+
+    <input spec='CalibratedYuleModel' type="full" id="cyule">
+        <birthRate spec='parameter.RealParameter' value="2.0" id="birthRate"/>
+        <tree spec='TreeParser' id='tree' taxa='@alignment'
+              newick='(((1:1.0,2:1.0):1.0,3:2.0):1.0,4:3.0);'/>
+
+        <calibrations spec='CalibrationPoint' id='cal'>
+            <taxonset spec='TaxonSet' id='all'>
+                <taxon idref='1'/>
+                <taxon idref='2'/>
+                <taxon idref='3'/>
+                <taxon idref='4'/>
+            </taxonset>
+            <distr id='logNormalDistribution' spec='beast.math.distributions.LogNormalDistributionModel'>
+                <parameter name='M' value='2'/>
+                <parameter name='S' value='0.2'/>
+            </distr>
+        </calibrations>
+    </input>
+
+    <run spec="MCMC" id="mcmc" chainLength="1000000">
+
+        <state>
+            <stateNode idref='tree'/>
+            <stateNode idref="birthRate"/>
+        </state>
+
+        <distribution spec='CompoundDistribution' id='posterior'>
+            <distribution id="yule.prior" idref='cyule'/>
+
+            <!-- <distribution id="birthRate.prior" spec="beast.math.distributions.Prior" x="@birthRate">
+                <distr id="OneOnX" offset="0.0" spec="beast.math.distributions.OneOnX"/>
+            </distribution> -->
+
+        </distribution>
+
+        <operator spec='SubtreeSlide' weight="4" gaussian="true" size="2.5" tree="@tree"/>
+        <operator spec="ScaleOperator" weight="1" scaleFactor="0.25">
+            <parameter idref="birthRate"/>
+        </operator>
+
+        <logger logEvery="100" fileName="cond_root_prior.$(seed).log">
+            <model idref='posterior'/>
+            <log idref="posterior"/>
+            <log idref="cyule"/>
+            <log idref="birthRate"/>
+            <log id="TreeHeight" spec="beast.evolution.tree.TreeHeightLogger" tree="@tree"/>
+        </logger>
+        <logger logEvery="100" fileName="cond_root_prior.$(seed).trees">
+            <log idref="tree"/>
+        </logger>
+        <logger logEvery="100">
+            <model idref='posterior'/>
+            <log idref="cyule"/>
+            <log idref="birthRate"/>
+            <log idref="TreeHeight"/>
+        </logger>
+    </run>
+</beast>
diff --git a/examples/testEBSP.xml b/examples/testEBSP.xml
new file mode 100644
index 0000000..b9a1b49
--- /dev/null
+++ b/examples/testEBSP.xml
@@ -0,0 +1,601 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><beast namespace="beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood" version="2.0">
+
+<!--
+	demographic function: 5 over all interval,
+	 0) tree root ploidy (4): 18.5433
+	    substitution model: Kimura 2P(R=1.25)
+	    mutation rate: 5e-05
+	 1) tree root ploidy (4): 65.6623
+	    substitution model: Kimura 2P(R=1.25)
+	    mutation rate: 5e-05
+	 2) tree root ploidy (4): 32.3994
+	    substitution model: Kimura 2P(R=1.25)
+	    mutation rate: 5e-05
+	 3) tree root: 4.61462
+	    substitution model: Kimura 2P(R=7.5)
+	    mutation rate: 0.001
+-->
+
+
+    <data dataType="nucleotide" id="alignment000" name="taxa">
+                <sequence taxon="l00_tip_022" totalcount="4">
+                    
+		CAGTTGACCTCAAGTTCTAACTGTAATTGACCGAGATGGAAAAGTTTGACCTCTGGTACCAGCTATTAACACTACAGGTGAGGCGGTAATACCAGTTACACCAACAGACATTGCGTTAGCGGAGCCGTCTTTTGCTATTGGCTCTGCCCTCGTGGGATCGGCTAGAAGGGACGACCCCCAAGACGCGGCTTCTTGAGACGAGTGGACCCAGGCAGTCGCTTGTAGAATAGGCTCTGTTAGCCGCAGCATTGCCGGTCACAGCTTAGTAAGGCGGCACGGGTATCAACCTGCAGTAATCTAATGGAAAGTGATGTTGGACTTGCCCTTAAGACAAACCACCGACACGTAGGAAAACGTATCATGTCGAGCAGGCACTGGTGGCATATTAGTTAAAACAGTGCCAACTCTGGAATTTCCATAGTGATGGTTTGGGTCTAAAGCCGAGCGGTTTCTGGCCTGGTCACCCGGAAAATCTCTGCCGTGCCCGTTA [...]
+	                </sequence>
+                <sequence taxon="l00_tip_009" totalcount="4">
+                    
+		CAGTTGACCTCAAGTTCTAACTGTAATTGACCGAGATGGAAAAGTTTGACCTCTGGTAGCAGCTATTAACACTACAGGTGAGGCGGTAATACCAGTTACACCAACAGACATTGCGTTAGCGGAGCCGTCTTTTGCTATTGGCTCTGCCCTCGTGGGATCGGCTAGAAGGGACGACCCCCAAGACGCGGCTTCTTGAGACGAGTGGACCCAGGCAGTCGCTTGTAGAATAGGCTCTGTTAGCCGCAGCATTGCCGGTCACAGCTTAGTAAGGCGGCACGGGTATCAACCTGCAGTAATCTAATGGAAAGTGATGTTGGACTTGCCCTTAAGACAAACCACCGACACGTAGGAAAACGTATCATGTCGAGCAGGCACTGGTGGCATATTAGTTAAAACAGTGCCAACTCTGGAATTTCCATAGTGATGGTTTGGGTCTAAAGCCGAGCGGTTTCTGGCCTGGTCACCCGGAAAATCTCTGCCGTGCCCGTTA [...]
+	                </sequence>
+                <sequence taxon="l00_tip_020" totalcount="4">
+                    
+		CAGTTGACCTCAAGTTCTAACTGTAATTGACCGAGATGGAAAAGTTTGACCTCTGGTACCAGCTATTAACACTACAGGTGAGGCGGTAATACCAGTTACACCAACAGACATTGCGTTAGCGGAGCCGTCTTTTGCTATTGGCTCTGCCCTCGTGGGATCGGCTAGAAGGGACGACCCCCAAGACGCGGCTTCTTGAGACGAGTGGACCCAGGCAGTCGCTTGTAGAATAGGCTCTGTTAGCCGCAGCATTGCCGGTCACAGCTTAGTAAGGCGGCACGGGTATCAACCTGCAGTAATCTAATGGAAAGTGATGTTGGACTTGCCCTTAAGACAAACCACCGACACGTAGGAAAACGTATCATGTCGAGCAGGCACTGGTGGCATATTAGTTAAAACAGTGCCAACTCTGGAATTTCCATAGTGATGGTTTGGGTCTAAAGCCGAGCGGTTTCTGGCCTGGTCACCCGGAAAATCTCTGCCGTGCCCGTTA [...]
+	                </sequence>
+                <sequence taxon="l00_tip_021" totalcount="4">
+                    
+		CAGTTGACCTCAAGTTCTAACTGTAATTGACCGAGATGGAAAAGTTTGACCTCTGGTACCAGCTATTAACACTACAGGTGAGGCGGTAATACCAGTTACACCAACAGACATTGCGTTAGCGGAGCCGTCTTTTGCTATTGGCTCTGCCCTCGTGGGATCGGCTAGAAGGGACGACCCCCAAGACGCGGCTTCTTGAGACGAGTGGACCCAGGCAGTCGCTTGTAGAATAGGCTCTGTTAGCCGCAGCATTGCCGGTCACAGCTTAGTAAGGCGGCACGGGTATCAACCTGCAGTAATCTAATGGAAAGTGATGTTGGACTTGCCCTTAAGACAAACCACCGACACGTAGGAAAACGTATCATGTCGAGCAGGCACTGGTGGCATATTAGTTAAAACAGTGCCAACTCTGGAATTTCCATAGTGATGGTTTGGGTCTAAAGCCGAGCGGTTTCTGGCCTGGTCACCCGGAAAATCTCTGCCGTGCCCGTTA [...]
+	                </sequence>
+                <sequence taxon="l00_tip_000" totalcount="4">
+                    
+		CAGTTGACCTCAAGTTCTAACTGTAATTGACCGAGATGGAAAAGTTTGACCTCTGGTACCAGCTATTAACACTACAGGTGAGGCGGTAATACCAGTTACACCAACAGACATTGCGTTAGCGGAGCCGTCTTTTGCTATTGGCTCTGCCCTCGTGGGATCGGCTAGAAGGGACGACCCCCAAGACGCGGCTTCTTGAGACGAGTGGACCCAGGCAGTCGCTTGTAGAATAGGCTCTGTTAGCCGCAGCATTGCCGGTCACAGCTTAGTAAGGCGGCACGGGTATCAACCTGCAGTAATCTAATGGAAAGTGATGTTGGACTTGCCCTTAAGACAAACCACCGACACGTAGGAAAACGTATCATGTCGAGCAGGCACTGGTGGCATATTAGTTAAAACAGTGCCAACTCTGGAATTTCCATAGTGATGGTTTGGGTCTAAAGCCGAGCGGTTTCTGGCCTGGTCACCCGGAAAATCTCTGCCGTGCCCGTTA [...]
+	                </sequence>
+                <sequence taxon="l00_tip_001" totalcount="4">
+                    
+		CAGTTGACCTCAAGTTCTAACTGTAATTGACCGAGATGGAAAAGTTTGACCTCTGGTACCAGCTATTAACACTACAGGTGAGGCGGTAATACCAGTTACACCAACAGACATTGCGTTAGCGGAGCCGTCTTTTGCTATTGGCTCTGCCCTCGTGGGATCGGCTAGAAGGGACGACCCCCAAGACGCGGCTTCTTGAGACGAGTGGACCCAGGCAGTCGCTTGTAGAATAGGCTCTGTTAGCCGCAGCATTGCCGGTCACAGCTTAGTAAGGCGGCACGGGTATCAACCTGCAGTAATCTAATGGAAAGTGATGTTGGACTTGCCCTTAAGACAAACCACCGACACGTAGGAAAACGTATCATGTCGAGCAGGCACTGGTGGCATATTAGTTAAAACAGTGCCAACTCTGGAATTTCCATAGTGATGGTTTGGGTCTAAAGCCGAGCGGTTTCTGGCCTGGTCACCCGGAAAATCTCTGCCGTGCCCGTTA [...]
+	                </sequence>
+                <sequence taxon="l00_tip_002" totalcount="4">
+                    
+		CAGTTGACCTCAAGTTCTAACTGTAATTGACCGAGATGGAAAAGTTTGACCTCTGGTACCAGCTATTAACACTACAGGTGAGGCGGTAATACCAGTTACACCAACAGACATTGCGTTAGCGGAGCCGTCTTTTGCTATTGGCTCTGCCCTCGTAGGATCGGCTAGAAGGGACGACCCCCAAGACGCGGCTTCTTGAGACGAGTGGACCCAGGCAGTCGCTTGTAGAATAGGCTCTGTTAGCCGCAGCATTGCCGGTCACAGCTTAGTAAGGCGGCACGGGTATCAACCTGCAGTAATCTAATGGAAAGTGATGTTGGACTTGCCCTTAAGACAAACCACCGACACGTAGGAAAACGTATCATGTCGAGCAGGCACTGGTGGCATATTAGTTAAAACAGTGCCAACTCTGGAATTTCCATAGTGATGGTTTGGGTCTAAAGCCGAGCGGTTTCTGGCCTGGTCACCCGGATAATCTCTGCCGTGCCCGTTA [...]
+	                </sequence>
+                <sequence taxon="l00_tip_003" totalcount="4">
+                    
+		CAGTTGACCTCAAGTTCTAACTGTAATTGACCGAGATGGAAAAGTTTGACCTCTGGTACCAGCTATTAACACTACAGGTGAGGCGGTAATACCAGTTACACCAACAGACATTGCGTTAGCGGAGCCGTCTTTTGCTATTGGCTCTGCCCTCGTAGGATCGGCTAGAAGGGACGACCCCCAAGACGCGGCTTCTTGAGACGAGTGGACCCAGGCAGTCGCTTGTAGAATAGGCTCTGTTAGCCGCAGCATTGCCGGTCACAGCTTAGTAAGGCGGCACGGGTATCAACCTGCAGTAATCTAATGGAAAGTGATGTTGGACTTGCCCTTAAGACAAACCACCGACACGTAGGAAAACGTATCATGTCGAGCAGGCACTGGTGGCATATTAGTTAAAACAGTGCCAACTCTGGAATTTCCATAGTGATGGTTTGGGTCTAAAGCCGAGCGGTTTCTGGCCTGGTCACCCGGATAATCTCTGCCGTGCCCGTTA [...]
+	                </sequence>
+                <sequence taxon="l00_tip_004" totalcount="4">
+                    
+		CAGTTGACCTCAAGTTCTAACTGTAATTGACCGAGATGGAAAAGTTTGACCTCTGGTAGCAGCTATTAACACTACAGGTGAGGCGGTAATACCAGTTACACCAACAGACATTGCGTTAGCGGAGCCGTCTTTTGCTATTGGCTCTGCCCTCGTGGGATCGGCTAGAAGGGACGACCCCCAAGACGCGGCTTCTTGAGACGAGTGGACCCAGGCAGTCGCTTGTAGAATAGGCTCTGTTAGCCGCAGCATTGCCGGTCACAGCTTAGTAAGGCGGCACGGGTATCAACCTGCAGTAATCTAATGGAAAGTGATGTTGGACTTGCCCTTAAGACAAACCACCGACACGTAGGAAAACGTATCATGTCGAGCAGGCACTGGTGGCATATTAGTTAAAACAGTGCCAACTCTGGAATTTCCATAGTGATGGTTTGGGTCTAAAGCCGAGCGGTTTCTGGCCTGGTCACCCGGAAAATCTCTGCCGTGCCCGTTA [...]
+	                </sequence>
+                <sequence taxon="l00_tip_005" totalcount="4">
+                    
+		CAGTTGACCTCAAGTTCTAACTGTAATTGACCGAGATGGAAAAGTTTGACCTCTGGTACCAGCTATTAACACTACAGGTGAGGCGGTAATACCAGTTACACCAACAGACATTGCGTTAGCGGAGCCGTCTTTTGCTATTGGCTCTGCCCTCGTGGGATCGGCTAGAAGGGACGACCCCCAAGACGCGGCTTCTTGAGACGAGTGGACCCAGGCAGTCGCTTGTAGAATAGGCTCTGTTAGCCGCAGCATTGCCGGTCACAGCTTAGTAAGGCGGCACGGGTATCAACCTGCAGTAATCTAATGGAAAGTGATGTTGGACTTGCCCTTAAGACAAACCACCGACACGTAGGAAAACGTATCATGTCGAGCAGGCACTGGTGGCATATTAGTTAAAACAGTGCCAACTCTGGAATTTCCATAGTGATGGTTTGGGTCTAAAGCCGAGCGGTTTCTGGCCTGGTCACCCGGAAAATCTCTGCCGTGCCCGTTA [...]
+	                </sequence>
+                <sequence taxon="l00_tip_006" totalcount="4">
+                    
+		CAGTTGACCTCAAGTTCTAACTGTAATTGACCGAGATGGAAAAGTTTGACCTCTGGTACCAGCTATTAACACTACAGGTGAGGCGGTAATACCAGTTACACCAACAGACCTTGCGTTAGCGGAGCCGTCTTTTGCTATTGGCTCTGCCCTCGTAGGATCGGCTAGAAGGGACGACCCCCAAGACGCGGCTTCTTGAGACGAGTGGACCCAGGCAGTCGCTTGTAGAATAGGCTCTGTTAGCCGCAGCATTGCCGGTCACAGCTTAGTAAGGCGGCACGGGTATCAACCTGCAGTAATCTAATGGAAAGTGATGTTGGACTTGCCCTTAAGACAAACCACCGACACGTAGGAAAACGTATCATGTCGAGCAGGCACTGGTGGCATATTAGTTAAAACAGTGCCAACTCTGGAATTTCCATAGTGATGGTTTGGGTCTAAAGCCGAGCGGTTTCTGGCCTGGTCACCCGGATAATCTCTGCCGTGCCCGTTA [...]
+	                </sequence>
+                <sequence taxon="l00_tip_007" totalcount="4">
+                    
+		CAGTTGACCTCAAGTTCTAACTGTAATTGACCGAGATGGAAAAGTTTGACCTCTGGTAGCAGCTATTAACACTACAGGTGAGGCGGTAATACCAGTTACACCAACAGACATTGCGTTAGCGGAGCCGTCTTTTGCTATTGGCTCTGCCCTCGTGGGATCGGCTAGAAGGGACGACCCCCAAGACGCGGCTTCTTGAGACGAGTGGACCCAGGCAGTCGCTTGTAGAATAGGCTCTGTTAGCCGCAGCATTGCCGGTCACAGCTTAGTAAGGCGGCACGGGTATCAACCTGCAGTAATCTAATGGAAAGTGATGTTGGACTTGCCCTTAAGACAAACCACCGACACGTAGGAAAACGTATCATGTCGAGCAGGCACTGGTGGCATATTAGTTAAAACAGTGCCAACTCTGGAATTTCCATAGTGATGGTTTGGGTCTAAAGCCGAGCGGTTTCTGGCCTGGTCACCCGGAAAATCTCTGCCGTGCCCGTTA [...]
+	                </sequence>
+                <sequence taxon="l00_tip_019" totalcount="4">
+                    
+		CAGTTGACCTCAAGTTCTAACTGTAGTTGACCGAGATGGAAAAGTTTGACCTCTGGTACCAGCTATTAACACTACAGGTGAGGCGGTAATACCAGTTACACCAACAGACATTGCGTTAGCGGAGCCGTCTTTTGCTATTGGCTCTGCCCTCGTGGGATCGGCTAGAAGGGACGACCCCCAAGACGCGGCTTCTTGAGACGAGTGGACCCAGGCAGTCGCTTGTAGAATAGGCTCTGTTAGCCGCAGCATTGCCGGTCACAGCTTAGTAAGGCGGCACGGGTATCAACCTGCAGTAATCTAATGGAAAGTGATGTTGGACTTGCCCTTAAGACAAACCACCGACACGTAGGAAAACGTATCATGTCGAGCAGGCACTGGTGGCATATTAGTTAAAACAGTGCCAACTCTGGAATTTCCATAGTGATGGTTTGGGTCTAAAGCCGAGCGGTTTCTGGCCTGGTCACCCGGAAAATCTCTGCCGTGCCCGTTA [...]
+	                </sequence>
+                <sequence taxon="l00_tip_018" totalcount="4">
+                    
+		CAGTTGACCTCAAGTTCTAACTGTAATTGACCGAGATGGAAAAGTTTGACCTCTGGTAGCAGCTATTAACACTACAGGTGAGGCGGTAATACCAGTTACACCAACAGACATTGCGTTAGCGGAGCCGTCTTTTGCTATTGGCTCTGCCCTCGTGGGATCGGCTAGAAGGGACGACCCCCAAGACGCGGCTTCTTGAGACGAGTGGACCCAGGCAGTCGCTTGTAGAATAGGCTCTGTTAGCCGCAGCATTGCCGGTCACAGCTTAGTAAGGCGGCACGGGTATCAACCTGCAGTAATCTAATGGAAAGTGATGTTGGACTTGCCCTTAAGACAAACCACCGACACGTAGGAAAACGTATCATGTCGAGCAGGCACTGGTGGCATATTAGTTAAAACAGTGCCAACTCTGGAATTTCCATAGTGATGGTTTGGGTCTAAAGCCGAGCGGTTTCTGGCCTGGTCACCCGGAAAATCTCTGCCGTGCCCGTTA [...]
+	                </sequence>
+                <sequence taxon="l00_tip_013" totalcount="4">
+                    
+		CAGTTGACCTCAAGTTCTAACTGTAATTGACCGAGATGGAAAAGTTTGACCTCTGGTACCAGCTATTAACACTACAGGTGAGGCGGTAATACCAGTTACACCAACAGACATTGCGTTAGCGGAGCCGTCTTTTGCTATTGGCTCTGCCCTCGTGGGATCGGCTAGAAGGGACGACCCCCAAGACGCGGCTTCTTGAGACGAGTGGACCCAGGCAGTCGCTTGTAGAATAGGCTCTGTTAGCCGCAGCATTGCCGGTCACAGCTTAGTAAGGCGGCACGGGTATCAACCTGCAGTAATCTAATGGAAAGTGATGTTGGACTTGCCCTTAAGACAAACCACCGACACGTAGGAAAACGTATCATGTCGAGCAGGCACTGGTGGCATATTAGTTAAAACAGTGCCAACTCTGGAATTTCCATAGTGATGGTTTGGGTCTAAAGCCGAGCGGTTTCTGGCCTGGTCACCCGGAAAATCTCTGCCGTGCCCGTTA [...]
+	                </sequence>
+                <sequence taxon="l00_tip_012" totalcount="4">
+                    
+		CAGTTGACCTCAAGTTCTAACTGTAATTGACCGAGATGGAAAAGTTTGACCTCTGGTAGCAGCTATTAACACTACAGGTGAGGCGGTAATACCAGTTACACCAACAGACATTGCGTTAGCGGAGCCGTCTTTTGCTATTGGCTCTGCCCTCGTGGGATCGGCTAGAAGGGACGACCCCCAAGACGCGGCTTCTTGAGACGAGTGGACCCAGGCAGTCGCTTGTAGAATAGGCTCTGTTAGCCGCAGCATTGCCGGTCACAGCTTAGTAAGGCGGCACGGGTATCAACCTGCAGTAATCTAATGGAAAGTGATGTTGGACTTGCCCTTAAGACAAACCACCGACACGTAGGAAAACGTATCATGTCGAGCAGGCACTGGTGGCATATTAGTTAAAACAGTGCCAACTCTGGAATTTCCATAGTGATGGTTTGGGTCTAAAGCCGAGCGGTTTCTGGCCTGGTCACCCGGAAAATCTCTGCCGTGCCCGTTA [...]
+	                </sequence>
+                <sequence taxon="l00_tip_011" totalcount="4">
+                    
+		CAGTTGACCTCAAGTTCTAACTGTAATTGACCGAGATGGAAAAGTTTGACCTCTGGTACCAGCTATTAACACTACAGGTGAGGCGGTAATACCAGTTACACCAACAGACATTGCGTTAGCGGAGCCGTCTTTTGCTATTGGCTCTGCCCTCGTGGGATCGGCTAGAAGGGACGACCCCCAAGACGCGGCTTCTTGAGACGAGTGGACCCAGGCAGTCGCTTGTAGAATAGGCTCTGTTAGCCGCAGCATTGCCGGTCACAGCTTAGTAAGGCGGCACGGGTATCAACCTGCAGTAATCTAATGGAAAGTGATGTTGGACTTGCCCTTAAGACAAACCACCGACACGTAGGAAAACGTATCATGTCGAGCAGGCACTGGTGGCATATTAGTTAAAACAGTGCCAACTCTGGAATTTCCATAGTGATGGTTTGGGTCTAAAGCCGAGCGGTTTCTGGCCTGGTCACCCGGAAAATCTCTGCCGTGCCCGTTA [...]
+	                </sequence>
+                <sequence taxon="l00_tip_010" totalcount="4">
+                    
+		CAGTTGACCTCAAGTTCTAACTGTAATTGACCGAGATGGAAAAGTTTGACCTCTGGTAGCAGCTATTAACACTACAGGTGAGGCGGTAATACCAGTTACACCAACAGACATTGCGTTAGCGGAGCCGTCTTTTGCTATTGGCTCTGCCCTCGTGGGATCGGCTAGAAGGGACGACCCCCAAGACGCGGCTTCTTGAGACGAGTGGACCCAGGCAGTCGCTTGTAGAATAGGCTCTGTTAGCCGCAGCATTGCCGGTCACAGCTTAGTAAGGCGGCACGGGTATCAACCTGCAGTAATCTAATGGAAAGTGATGTTGGACTTGCCCTTAAGACAAACCACCGACACGTAGGAAAACGTATCATGTCGAGCAGGCACTGGTGGCATATTAGTTAAAACAGTGCCAACTCTGGAATTTCCATAGTGATGGTTTGGGTCTAAAGCCGAGCGGTTTCTGGCCTGGTCACCCGGAAAATCTCTGCCGTGCCCGTTA [...]
+	                </sequence>
+                <sequence taxon="l00_tip_017" totalcount="4">
+                    
+		CAGTTGACCTCAAGTTCTAACTGTAATTGACCGAGATGGAAAAGTTTGACCTCTGGTACCAGCTATTAACACTACAGGTGAGGCGGTAATACCAGTTACACCAACAGACATTGCGTTAGCGGAGCCGTCTTTTGCTATTGGCTCTGCCCTCGTGGGATCGGCTAGAAGGGACGACCCCCAAGACGCGGCTTCTTGAGACGAGTGGACCCAGGCAGTCGCTTGTAGAATAGGCTCTGTTAGCCGCAGCATTGCCGGTCACAGCTTAGTAAGGCGGCACGGGTATCAACCTGCAGTAATCTAATGGAAAGTGATGTTGGACTTGCCCTTAAGACAAACCACCGACACGTAGGAAAACGTATCATGTCGAGCAGGCACTGGTGGCATATTAGTTAAAACAGTGCCAACTCTGGAATTTCCATAGTGATGGTTTGGGTCTAAAGCCGAGCGGTTTCTGGCCTGGTCACCCGGAAAATCTCTGCCGTGCCCGTTA [...]
+	                </sequence>
+                <sequence taxon="l00_tip_016" totalcount="4">
+                    
+		CAGTTGACCTCAAGTTCTAACTGTAATTGACCGAGATGGAAAAGTTTGACCTCTGGTAGCAGCTATTAACACTACAGGTGAGGCGGTAATACCAGTTACACCAACAGACATTGCGTTAGCGGAGCCGTCTTTTGCTATTGGCTCTGCCCTCGTGGGATCGGCTAGAAGGGACGACCCCCAAGACGCGGCTTCTTGAGACGAGTGGACCCAGGCAGTCGCTTGTAGAATAGGCTCTGTTAGCCGCAGCATTGCCGGTCACAGCTTAGTAAGGCGGCACGGGTATCAACCTGCAGTAATCTAATGGAAAGTGATGTTGGACTTGCCCTTAAGACAAACCACCGACACGTAGGAAAACGTATCATGTCGAGCAGGCACTGGTGGCATATTAGTTAAAACAGTGCCAACTCTGGAATTTCCATAGTGATGGTTTGGGTCTAAAGCCGAGCGGTTTCTGGCCTGGTCACCCGGAAAATCTCTGCCGTGCCCGTTA [...]
+	                </sequence>
+                <sequence taxon="l00_tip_015" totalcount="4">
+                    
+		CAGTTGACCTCAAGTTCTAACTGTAATTGACCGAGATGGAAAAGTTTGACCTCTGGTACCAGCTATTAACACTACAGGTGAGGCGGTAATACCAGTTACACCAACAGACATTGCGTTAGCGGAGCCGTCTTTTGCTATTGGCTCTGCCCTCGTAGGATCGGCTAGAAGGGACGACCCCCAAGACGCGGCTTCTTGAGACGAGTGGACCCAGGCAGTCGCTTGTAGAATAGGCTCTGTTAGCCGCAGCATTGCCGGTCACAGCTTAGTAAGGCGGCACGGGTATCAACCTGCAGTAATCTAATGGAAAGTGATGTTGGACTTGCCCTTAAGACAAACCACCGACACGTAGGAAAACGTATCATGTCGAGCAGGCACTGGTGGCATATTAGTTAAAACAGTGCCAACTCTGGAATTTCCATAGTGATGGTTTGGGTCTAAAGCCGAGCGGTTTCTGGCCTGGTCACCCGGATAATCTCTGCCGTGCCCGTTA [...]
+	                </sequence>
+                <sequence taxon="l00_tip_014" totalcount="4">
+                    
+		CAGTTGACCTCAAGTTCTAACTGTAATTGACCGAGATGGAAAAGTTTGACCTCTGGTAGCAGCTATTAACACTACAGGTGAGGCGGTAATACCAGTTACACCAACAGACATTGCGTTAGCGGAGCCGTCTTTTGCTATTGGCTCTGCCCTCGTGGGATCGGCTAGAAGGGACGACCCCCAAGACGCGGCTTCTTGAGACGAGTGGACCCAGGCAGTCGCTTGTAGAATAGGCTCTGTTAGCCGCAGCATTGCCGGTCACAGCTTAGTAAGGCGGCACGGGTATCAACCTGCAGTAATCTAATGGAAAGTGATGTTGGACTTGCCCTTAAGACAAACCACCGACACGTAGGAAAACGTATCATGTCGAGCAGGCACTGGTGGCATATTAGTTAAAACAGTGCCAACTCTGGAATTTCCATAGTGATGGTTTGGGTCTAAAGCCGAGCGGTTTCTGGCCTGGTCACCCGGAAAATCTCTGCCGTGCCCGTTA [...]
+	                </sequence>
+                <sequence taxon="l00_tip_008" totalcount="4">
+                    
+		CAGTTGACCTCAAGTTCTAACTGTAATTGACCGAGATGGAAAAGTTTGACCTCTGGTAGCAGCTATTAACACTACAGGTGAGGCGGTAATACCAGTTACACCAACAGACATTGCGTTAGCGGAGCCGTCTTTTGCTATTGGCTCTGCCCTCGTGGGATCGGCTAGAAGGGACGACCCCCAAGACGCGGCTTCTTGAGACGAGTGGACCCAGGCAGTCGCTTGTAGAATAGGCTCTGTTAGCCGCAGCATTGCCGGTCACAGCTTAGTAAGGCGGCACGGGTATCAACCTGCAGTAATCTAATGGAAAGTGATGTTGGACTTGCCCTTAAGACAAACCACCGACACGTAGGAAAACGTATCATGTCGAGCAGGCACTGGTGGCATATTAGTTAAAACAGTGCCAACTCTGGAATTTCCATAGTGATGGTTTGGGTCTAAAGCCGAGCGGTTTCTGGCCTGGTCACCCGGAAAATCTCTGCCGTGCCCGTTA [...]
+	                </sequence>
+                <sequence taxon="l00_tip_023" totalcount="4">
+                    
+		CAGTTGACCTCAAGTTCTAACTGTAATTGACCGAGATGGAAAAGTTTGACCTCTGGTAGCAGCTATTAACACTACAGGTGAGGCGGTAATACCAGTTACACCAACAGACATTGCGTTAGCGGAGCCGTCTTTTGCTATTGGCTCTGCCCTCGTGGGATCGGCTAGAAGGGACGACCCCCAAGACGCGGCTTCTTGAGACGAGTGGACCCAGGCAGTCGCTTGTAGAATAGGCTCTGTTAGCCGCAGCATTGCCGGTCACAGCTTAGTAAGGCGGCACGGGTATCAACCTGCAGTAATCTAATGGAAAGTGATGTTGGACTTGCCCTTAAGACAAACCACCGACACGTAGGAAAACGTATCATGTCGAGCAGGCACTGGTGGCATATTAGTTAAAACAGTGCCAACTCTGGAATTTCCATAGTGATGGTTTGGGTCTAAAGCCGAGCGGTTTCTGGCCTGGTCACCCGGAAAATCTCTGCCGTGCCCGTTA [...]
+	                </sequence>
+            </data>
+<data dataType="nucleotide" id="alignment001" name="taxa">
+                <sequence taxon="l01_tip_005" totalcount="4">
+                    
+		ATAACAACGTTGCCCAACTATTTAATCGTACTGAGGATGTAAAACAATATACAGAATAGTGGGCATGAGTGGGATTCGCTTACGCGAGGTGCCCTAGCCTCACTCCGATCATGGGGTCCAAAGGGGCCAATCTCTTTAAGCTGCAGCCCCATTCGCTTATGCCTACGGATATGGAGAATTACCCCGTCTTCTGTAGTCGGGCTAGTAGGTCTTCCATGGACAGAATTACTCCGTGCCGAGTTTCTTCTAAAGGCCACGCAAATTTGTTGGTTAGGCTCCTTAGCCAGTGACATATTCGCATGGAGGGCCAGACTTGCTAGCTAAGGACTATTCTACTGTTTTCACGCCGAGGCCTAAAACTCCTGTCGGTGTCCGAAATAGGAAGAGCGCCGGTACGTGGCCATTCTAGTTCGGTATAGCTTAAGGTCTTTACGACTTTTAAGTACCGAGCCCAAGCGACCCGGGGTAGTGTTGTTCACCCGAAAATGCG [...]
+	                </sequence>
+                <sequence taxon="l01_tip_022" totalcount="4">
+                    
+		ATAACAACGTTGCCCAACTATTTAATCGTACTGAGGATGTAAAACAATATACAGAATAGTGGGCATGAGTGGGATTCGCTTACGCGAGGTGCCCTAGCCTCACTCCGATCATGGGGTCCAAAGGGGCCAATCTCTTTAAGCTGCAGCCCCATTCGCTTATGCCTACGGATATGGAGAATTACCCCGTCTTCTGTAGTCGGGCTAGTAGGTCTTCCATGGACAGAATTACTCCGTGCCGAGTTTCTTCTAAAGGCCACGCAAATTTGTTGGTTAGGCTCCTTAGCCAGTGACATATTCGCATGGAGGGCCAGACTTGCTAGCTAAGGACTATTCTACTGTTTTCACGCCGAGGCCTAAAACTCCTGTCGGTGTCCGAAATAGGAAGAGCGCCGGTACGTGGCCATTCTAGTTCGGTATAGCTTAAGGTCTTTACGACTTTTAAGTACCGAGCCCAAGCGACCCGGGGTAGTGTTGTTCACCCGAAAATGCG [...]
+	                </sequence>
+                <sequence taxon="l01_tip_007" totalcount="4">
+                    
+		ATAACAACGTTGCCCAACTATTTAATCGTACTGAGGATGTAAAACAATATACAGAATAGTGGGCATGAGTGGGATTCGCTTACGCGAGGTGCCCTAGCCTCACTCCGATCATGGGGTCCAAAGGGGCCAATCTCTTTAAGCTGCAGCCCCATTCGCTTATGCCTACGGATATGGAGAATTACCCCGCCTTCTGTAGTCGGGCTAGTAGGTCTTCCATGGACAGAATTACTCCGTGCCGAGTTTCTTCTAAAGGCCACGCAAATTTGTTGGTTAGGCTCCTTAGCCAGTGACATATTCGCATGGAGGGCCAGACTTGCTAGCTAAGGACTATTCTACTGTTTTCACGCCGAGGCCTAAAACTCCTGTCGGTGTCCGAAATAGGAAGAGCGCCGGTACGTGGCCATTCTAGTTCGGTATAGCTTAAGGTCTTTACGACTTTTAAGTACCGAGCCCAAGCGACCCGGGGTAGTGTTGTTCACCCGAAAATGCG [...]
+	                </sequence>
+                <sequence taxon="l01_tip_023" totalcount="4">
+                    
+		ATAACAACGTTGCCCAACTATTTAATCGTACTGAGGATGTAAAACAATATACAGAATAGTGGGCATGAGTGGGATTCGCTTACGCGAGGTGCCCTAGCCTCACTCCGATCATGGGGTCCAAAGGGGCCAATCTCTTTAAGCTGCAGCCCCATTCGCTTATGCCTACGGATATGGAGAATTACCCCGCCTTCTGCAGTCGGGCTAGTAGGTCTTCCATGGACAGAATTACTCCGTGCCGAGTTTCTTCTAAAGGCCACGCAAATTTGTTGGTTAGGCTCCTTAGCCAGTGACATATTCGCATGGAGGGCCAGACTTGCTAGCTAAGGACTATTCTACTGTTTTCACGCCGAGGCCTAAAACTCCTGTCGGTGTCCGAAATAGGAAGAGCGCCGGTACGTGGCCATTCTAGTTCGGTATAGCTTAAGGTCTTTACGACTTTTAAGTACCGAGCCCAAGCGACCCGGGGTAGTGTTGTTCACCCGAAAATGCG [...]
+	                </sequence>
+                <sequence taxon="l01_tip_004" totalcount="4">
+                    
+		ATAACAACGTTGCCCAACTATTTAATCGTACTGAGGATGTAAAACAATATACAGAATAGTGGGCATGAGTGGGATTCGCTTACGCGAGGTGCCCTAGCCTCACTCCGATCATGGGGTCCAAAGGGGCCAATCTCTTTAAGCTGCAGCCCCATTCGCTTATGCCTACGGATATGGAGAATTACCCCGTCTTCTGTAGTCGGGCTAGTAGGTCTTCCATGGACAGAATTACTCCGTGCCGAGTTTCTTCTAAAGGCCACGCAAATTTGTTGGTTAGGCTCCTTAGCCAGTGACATATTCGCATGGAGGGCCAGACTTGCTAGCTAAGGACTATTCTACTGTTTTCACGCCGAGGCCTAAAACTCCTGTCGGTGTCCGAAATAGGAAGAGCGCCGGTACGTGGCCATTCTAGTTCGGTATAGCTTAAGGTCTTTACGACTTTTAAGTACCGAGCCCAAGCGACCCGGGGTAGTGTTGTTCACCCGAAAATGCG [...]
+	                </sequence>
+                <sequence taxon="l01_tip_021" totalcount="4">
+                    
+		ATAACAACGTTGCCCAACTATTTAATCGTACTGAGGATGTAAAACAATATACAGAATAGTGGGCATGAGTGGGATTCGCTTACGCGAGGTGCCCTAGCCTCACTCCGATCATGGGGTCCAAAGGGGCCAATCTCTTTAAGCTGCAGCCCCATTCGCTTATGCCTACGGATATGGAGAATTACCCCGCCTTCTGTAGTCGGGCTAGTAGGTCTTCCATGGACAGAATTACTCCGTGCCGAGTTTCTTCTAAAGGCCACGCAAATTTGTTGGTTAGGCTCCTTAGCCAGTGACATATTCGCATGGAGGGCCAGACTTGCTAGCTAAGGACTATTCTACTGTTTTCACGCCGAGGCCTAAAACTCCTGTCGGTGTCCGAAATAGGAAGAGCGCCGGTACATGGCCATTCTAGTTCGGTATAGCTTAAGGTCTTTACGACTTTTAAGTACCGAGCCCAAGCGACCCGGGGTAGTGTTGTTCACCCGAAAATGCG [...]
+	                </sequence>
+                <sequence taxon="l01_tip_006" totalcount="4">
+                    
+		ATAACAACGTTGCCCAACTATTTAATCGTACTGAGGATGTAAAACAATATACAGAATAGTGGGCATGAGTGGGATTCGCTTACGCGAGGTGCCCTAGCCTCACTCCGATCATGGGGTCCAAAGGGGCCAATCTCTTTAAGCTGCAGCCCCATTCGCTTATGCCTACGGATATGGAGAATTACCCCGTCTTCTGTAGTCGGGCTAGTAGGTCTTCCATGGACAGAATTACTCCGTGCCGAGTTTCTTCTAAAGGCCACGCAAATTTGTTGGTTAGGCTCCTTAGCCAGTGACATATTCGCATGGAGGGCCAGACTTGCTAGCTAAGGACTATTCTACTGTTTTCACGCCGAGGCCTAAAACTCCTGTCGGTGTCCGAAATAGGAAGAGCGCCGGTACGTGGCCATTCTAGTTCGGTATAGCTTAAGGTCTTTACGACTTTTAAGTACCGAGCCCAAGCGACCCGGGGTAGTGTTGTTCACCCGAAAATGCG [...]
+	                </sequence>
+                <sequence taxon="l01_tip_001" totalcount="4">
+                    
+		ATAACAACGTTGCCCAACTATTTAATCGTACTGAGGATGTAAAACAATATACAGAATAGTGGGCATAAGTGGGATTCGCTTACGCGAGGTGCCCTAGCCTCACTCCGATCATGGGGTCCAAAGGGGCCAATCGCTTTAAGCTGCAGCCCCATTCGCTTATGCCTACGGATATGGAGAATTACCCCGCCTTCTGTAGTCGGGCTAGTAGGTCTCCCATGGACAGAATTACTCCGTGCCGAGTTTCTTCTAAAGGCCACGCAAATTTGTTGGTTAGGCTCCTTAGCCAGTGACATATTTGCATGGGGGGCCAGACTTGCTAGCTAAGGACTATTCTACTGTTTTCACGCCGAGGCCTAAAACTCCTGTCGGTGTCCGAAATAGGAAGAGCGCCGGTACGTGGCCATTCTAGTTCGGTATAGCTTAAGGTCTTTACGACTTTTAAGTACCGAGCCCAAGCGACCCGGGGTAGTGTTGTTCACCCGAAAATGCG [...]
+	                </sequence>
+                <sequence taxon="l01_tip_000" totalcount="4">
+                    
+		ATAACAACGTTGCCCAACTATTTAATCGTACTGAGGATGTAAAACAATATACAGAATAGTGGGCATGAGTGGGATTCGCTTACGCGAGGTGCCCTAGCCTCACTCCGATCATGGGGTCCAAAGGGGCCAATCTCTTTAAGCTGCAGCCCCATTCGCTTATGCCTACGGATATGGAGAATTACCCCGTCTTCTGTAGTCGGGCTAGTAGGTCTTCCATGGACAGAATTACTCCGTGCCGAGTTTCTTCTAAAGGCCACGCAAATTTGTTGGTTAGGCTCCTTAGCCAGTGACATATTCGCATGGAGGGCCAGACTTGCTAGCTAAGGACTATTCTACTGTTTTCACGCCGAGGCCTAAAACTCCTGTCGGTGTCCGAAATAGGAAGAGCGCCGGTACGTGGCCATTCTAGTTCGGTATAGCTTAAGGTCTTTACGACTTTTAAGTACCGAGCCCAAGCGACCCGGGGTAGTGTTGTTCACCCGAAAATGCG [...]
+	                </sequence>
+                <sequence taxon="l01_tip_003" totalcount="4">
+                    
+		ATAACAACGTTGCCCAACTATTTAATCGTACTGAGGATGTAAAACAATATACAGAATAGTGGGCATGAGTGGGATTCGCTTACGCGAGGTGCCCTAGCCTCACTCCGATCATGGGGTCCAAAGGGGCCAATCTCTTTAAGCTGCAGCCCCATTCGCTTATGCCTACGGATATGGAGAATTACCCCGCCTTCTGTAGTCGGGCTAGTAGGTCTTCCATGGACAGAATTACTCCGTGCCGAGTTTCTTCTAAAGGCCACGCAAATTTGTTGGTTAGGCTCCTTAGCCAGTGACATATTCGCATGGAGGGCCAGACTTGCTAGCTAAGGACTATTCTACTGTTTTCACGCCGAGGCCTAAAACTCCTGTCGGTGTCCGAAATAGGAAGAGCGCCGGTACGTGGCCATTCTAGTTCGGTATAGCTTAAGGTCTTTACGACTTTTAAGTACCGAGCCCAAGCGACCCGGGGTAGTGTTGTTCACCCGAAAATGCG [...]
+	                </sequence>
+                <sequence taxon="l01_tip_002" totalcount="4">
+                    
+		ATAACAACGTTGCCCAACTATTTAATCGTACTGAGGATGTAAAACAATATACAGAATAGTGGGCATGAGTGGGATTCGCTTACGCGAGGTGCCCTAGCCTCACTCCGATCATGGGGTCCAAAGGGGCCAATCTCTTTAAGCTGCAGCCCCATTCGCTTATGCCTACGGATATGGAGAATTACCCCGTCTTCTGTAGTCGGGCTAGTAGGTCTTCCATGGACAGAATTACTCCGTGCCGAGTTTCTTCTAAAGGCCACGCAAATTTGTTGGTTAGGCTCCTTAGCCAGTGACATATTCGCATGGAGGGCCAGACTTGCTAGCTAAGGACTATTCTACTGTTTTCACGCCGAGGCCTAAAACTCCTGTCGGTGTCCGAAATAGGAAGAGCGCCGGTACGTGGCCATTCTAGTTCGGTATAGCTTAAGGTCTTTACGACTTTTAAGTACCGAGCCCAAGCGACCCGGGGTAGTGTTGTTCACCCGAAAATGCG [...]
+	                </sequence>
+                <sequence taxon="l01_tip_009" totalcount="4">
+                    
+		ATAACAACGTTGCCCAACTATTTAATCGTACTGAGGATGTAAAACAATATACAGAATAGTGGGCATGAGTGGGATTCGCTTACGCGAGGTGCCCTAGCCTCACTCCGATCATGGGGTCCAAAGGGGCCAATCTCTTTAAGCTGCAGCCCCATTCGCTTATGCCTACGGATATGGAGAATTACCCCGCCTTCTGTAGTCGGGCTAGTAGGTCTTCCATGGACAGAATTACTCCGTGCCGAGTTTCTTCTAAAGGCCACGCAAATTTGTTGGTTAGGCTCCTTAGCCAGTGACATATTCGCATGGAGGGCCAGACTTGCTAGCTAAGGACTATTCTACTGTTTTCACGCCGAGGCCTAAAACTCCTGTCGGTGTCCGAAATAGGAAGAGCGCCGGTACATGGCCATTCTAGTTCGGTATAGCTTAAGGTCTTTACGACTTTTAAGTACCGAGCCCAAGCGACCCGGGGTAGTGTTGTTCACCCGAAAATGCG [...]
+	                </sequence>
+                <sequence taxon="l01_tip_008" totalcount="4">
+                    
+		ATAACAACGTTGCCCAACTATTTAATCGTACTGAGGATGTAAAACAATATACAGAATAGTGGGCATGAGTGGGATTCGCTTACGCGAGGTGCCCTAGCCTCACTCCGATCATGGGGTCCAAAGGGGCCAATCTCTTTAAGCTGCAGCCCCATTCGCTTATGCCTACGGATATGGAGAATTACCCCGTCTTCTGTAGTCGGGCTAGTAGGTCTTCCATGGACAGAATTACTCCGTGCCGAGTTTCTTCTAAAGGCCACGCAAATTTGTTGGTTAGGCTCCTTAGCCAGTGACATATTCGCATGGAGGGCCAGACTTGCTAGCTAAGGACTATTCTACTGTTTTCACGCCGAGGCCTAAAACTCCTGTCGGTGTCCGAAATAGGAAGAGCGCCGGTACGTGGCCATTCTAGTTCGGTATAGCTTAAGGTCTTTACGACTTTTAAGTACCGAGCCCAAGCGACCCGGGGTAGTGTTGTTCACCCGAAAATGCG [...]
+	                </sequence>
+                <sequence taxon="l01_tip_020" totalcount="4">
+                    
+		ATAACAACGTTGCCCAACTATTTAATCGTACTGAGGATGTAAAACAATATACAGAATAGTGGGCATGAGTGGGATTCGCTTACGCGAGGTGCCCTAGCCTCACTCCGATCATGGGGTCCAAAGGGGCCAATCTCTTTAAGCTGCAGCCCCATTCGCTTATGCCTACGGATATGGAGAATTACCCCGCCTTCTGTAGTCGGGCTAGTAGGTCTTCCATGGACAGAATTACTCCGTGCCGAGTTTCTTCTAAAGGCCACGCAAATTTGTTGGTTAGGCTCCTTAGCCAGTGACATATTCGCATGGAGGGCCAGACTTGCTAGCTAAGGACTATTCTACTGTTTTCACGCCGAGGCCTAAAACTCCTGTCGGTGTCCGAAATAGGAAGAGCGCCGGTACGTGGCCATTCTAGTTCGGTATAGCTTAAGGTCTTTACGACTTTTAAGTACCGAGCCCAAGCGACCCGGGGTAGTGTTGTTCACCCGAAGATGCG [...]
+	                </sequence>
+                <sequence taxon="l01_tip_018" totalcount="4">
+                    
+		ATAACAACGTTGCCCAACTATTTAATCGTACTGAGGATGTAAAACAATATACAGAATAGTGGGCATGAGTGGGATTCGCTTACGCGAGGTGCCCTAGCCTCACTCCGATCATGGGGTCCAAAGGGGCCAATCTCTTTAAGCTGCAGCCCCATTCGCTTATGCCTACGGATATGGAGAATTACCCCGCCTTCTGCAGTCGGGCTAGTAGGTCTTCCATGGACAGAATTACTCCGTGCCGAGTTTCTTCTAAAGGCCACGCAAATTTGTTGGTTAGGCTCCTTAGCCAGTGACATATTCGCATGGAGGGCCAGACTTGCTAGCTAAGGACTATTCTACTGTTTTCACGCCGAGGCCTAAAACTCCTGTCGGTGTCCGAAATAGGAAGAGCGCCGGTACGTGGCCATTCTAGTTCGGTATAGCTTAAGGTCTTTACGACTTTTAAGTACCGAGCCCAAGCGACCCGGGGTAGTGTTGTTCACCCGAAAATGCG [...]
+	                </sequence>
+                <sequence taxon="l01_tip_019" totalcount="4">
+                    
+		ATAACAACGTTGCCCAACTATTTAATCGTACTGAGGATGTAAAACAATATACAGAATAGTGGGCATGAGTGGGATTCGCTTACGCGAGGTGCCCTAGCCTCACTCCGATCATGGGGTCCAAAGGGGCCAATCTCTTTAAGCTGCAGCCCCATTCGCTTATGCCTACGGATATGGAGAATTACCCCGTCTTCTGTAGTCGGGCTAGTAGGTCTTCCATGGACAGAATTACTCCGTGCCGAGTTTCTTCTAAAGGCCACGCAAATTTGTTGGTTAGGCTCCTTAGCCAGTGACATATTCGCATGGAGGGCCAGACTTGCTAGCTAAGGACTATTCTACTGTTTTCACGCCGAGGCCTAAAACTCCTGTCGGTGTCCGAAATAGGAAGAGCGCCGGTACGTGGCCATTCTAGTTCGGTATAGCTTAAGGTCTTTACGACTTTTAAGTACCGAGCCCAAGCGACCCGGGGTAGTGTTGTTCACCCGAAAATGCG [...]
+	                </sequence>
+                <sequence taxon="l01_tip_012" totalcount="4">
+                    
+		ATAACAACGTTGCCCAACTATTTAATCGTACTGAGGATGTAAAACAATATACAGAATAGTGGGCATGAGTGGGATTCGCTTACGCGAGGTGCCCTAGCCTCACTCCGATCATGGGGTCCAAAGGGGCCAATCTCTTTAAGCTGCAGCCCCATTCGCTTATGCCTACGGATATGGAGAATTACCCCGCCTTCTGCAGTCGGGCTAGTAGGTCTTCCATGGACAGAATTACTCCGTGCCGAGTTTCTTCTAAAGGCCACGCAAATTTGTTGGTTAGGCTCCTTAGCCAGTGACATATTCGCATGGAGGGCCAGACTTGCTAGCTAAGGACTATTCTACTGTTTTCACGCCGAGGCCTAAAACTCCTGTCGGTGTCCGAAATAGGAAGAGCGCCGGTACGTGGCCATTCTAGTTCGGTATAGCTTAAGGTCTTTACGACTTTTAAGTACCGAGCCCAAGCGACCCGGGGTAGTGTTGTTCACCCGAAAATGCG [...]
+	                </sequence>
+                <sequence taxon="l01_tip_013" totalcount="4">
+                    
+		ATAACAACGTTGCCCAACTATTTAATCGTACTGAGGATGTAAAACAATATACAGAATAGTGGGCATGAGTGGGATTCGCTTACGCGAGGTGCCCTAGCCTCACTCCGATCATGGGGTCCAAAGGGGCCAATCTCTTTAAGCTGCAGCCCCATTCGCTTATGCCTACGGATATGGAGAATTACCCCGCCTTCTGTAGTCGGGCTAGTAGGTCTTCCATGGACAGAATTACTCCGTGCCGAGTTTCTTTTAAAGGCCACGCAAATTTGTTGGTTAGGCTCCTTAGCCAGTGACATATTCGCATGGAGGGCCAGACTTGCTAGCTAAGGACTATTCTACTGTTTTCACGCCGAGGCCTAAAACTCCTGTCGGTGTCCGAAATAGGAAGAGCGCCGGTACGTGGCCATTCTAGTTCGGTATAGCTTAAGGTCTTTACGACTTTTAAGTACCGAGCCCAAGCGACCCGGGGTAGTGTTGTTCACCCGAAAATGCG [...]
+	                </sequence>
+                <sequence taxon="l01_tip_010" totalcount="4">
+                    
+		ATAACAACGTTGCCCAACTATTTAATCGTACTGAGGATGTAAAACAATATACAGAATAGTGGGCATAAGTGGGATTCGCTTACGCGAGGTGCCCTAGCCTCACTCCGATCATGGGGTCCAAAGGGGCCAATCGCTTTAAGCTGCAGCCCCATTCGCTTATGCCTACGGATATGGAGAATTACCCCGCCTTCTGTAGTCGGGCTAGTAGGTCTCCCATGGACAGAATTACTCCGTGCCGAGTTTCTTCTAAAGGCCACGCAAATTTGTTGGTTAGGCTCCTTAGCCAGTGACATATTTGCATGGGGGGCCAGACTTGCTAGCTAAGGACTATTCTACTGTTTTCACGCCGAGGCCTAAAACTCCTGTCGGTGTCCGAAATAGGAAGAGCGCCGGTACGTGGCCATTCTAGTTCGGTATAGCTTAAGGTCTTTACGACTTTTAAGTACCGAGCCCAAGCGACCCGGGGTAGTGTTGTTCACCCGAAAATGCG [...]
+	                </sequence>
+                <sequence taxon="l01_tip_011" totalcount="4">
+                    
+		ATAACAACGTTGCCCAACTATTTAATCGTACTGAGGATGTAAAACAATATACAGAATAGTGGGCATAAGTGGGATTCGCTTACGCGAGGTGCCCTAGCCTCACTCCGATCATGGGGTCCAAAGGGGCCAATCGCTTTAAGCTGCAGCCCCATTCGCTTATGCCTACGGATATGGAGAATTACCCCGCCTTCTGTAGTCGGGCTAGTAGGTCTCCCATGGACAGAATTACTCCGTGCCGAGTTTCTTCTAAAGGCCACGCAAATTTGTTGGTTAGGCTCCTTAGCCAGTGACATATTTGCATGGGGGGCCAGACTTGCTAGCTAAGGACTATTCTACTGTTTTCACGCCGAGGCCTAAAACTCCTGTCGGTGTCCGAAATAGGAAGAGCGCCGGTACGTGGCCATTCTAGTTCGGTATAGCTTAAGGTCTTTACGACTTTTAAGTACCGAGCCCAAGCGACCCGGGGTAGTGTTGTTCACCCGAAAATGCG [...]
+	                </sequence>
+                <sequence taxon="l01_tip_016" totalcount="4">
+                    
+		ATAACAACGTTGCCCAACTATTTAATCGTACTGAGGATGTAAAACAATATACAGAATAGTGGGCATGAGTGGGATTCGCTTACGCGAGGTGCCCTAGCCTCACTCCGATCATGGGGTCCAAAGGGGCCAATCTCTTTAAGCTGCAGCCCCATTCGCTTATGCCTACGGATATGGAGAATTACCCCGTCTTCTGTAGTCGGGCTAGTAGGTCTTCCATGGACAGAATTACTCCGTGCCGAGTTTCTTCTAAAGGCCACGCAAATTTGTTGGTTAGGCTCCTTAGCCAGTGACATATTCGCATGGAGGGCCAGACTTGCTAGCTAAGGACTATTCTACTGTTTTCACGCCGAGGCCTAAAACTCCTGTCGGTGTCCGAAATAGGAAGAGCGCCGGTACGTGGCCATTCTAGTTCGGTATAGCTTAAGGTCTTTACGACTTTTAAGTACCGAGCCCAAGCGACCCGGGGTAGTGTTGTTCACCCGAAAATGCG [...]
+	                </sequence>
+                <sequence taxon="l01_tip_017" totalcount="4">
+                    
+		ATAACAACGTTGCCCAACTATTTAATCGTACTGAGGATGTAAAACAATATACAGAATAGTGGGCATGAGTGGGATTCGCTTACGCGAGGTGCCCTAGCCTCACTCCGATCATGGGGTCCAAAGGGGCCAATCTCTTTAAGCTGCAGCCCCATTCGCTTATGCCTACGGATATGGAGAATTACCCCGCCTTCTGTAGTCGGGCTAGTAGGTCTTCCATGGACAGAATTACTCCGTGCCGAGTTTCTTCTAAAGGCCACGCAAATTTGTTGGTTAGGCTCCTTAGCCAGTGACATATTCGCATGGAGGGCCAGACTTGCTAGCTAAGGACTATTCTACTGTTTTCACGCCGAGGCCTAAAACTCCTGTCGGTGTCCGAAATAGGAAGAGCGCCGGTACGTGGCCATTCTAGTTCGGTATAGCTTAAGGTCTTTACGACTTTTAAGTACCGAGCCCAAGCGACCCGGGGTAGTGTTGTTCACCCGAAGATGCG [...]
+	                </sequence>
+                <sequence taxon="l01_tip_014" totalcount="4">
+                    
+		ATAACAACGTTGCCCAACTATTTAATCGTACTGAGGATGTAAAACAATATACAGAATAGTGGGCATGAGTGGGATTCGCTTACGCGAGGTGCCCTAGCCTCACTCCGATCATGGGGTCCAAAGGGGCCAATCTCTTTAAGCTGCAGCCCCATTCGCTTATGCCTACGGATATGGAGAATTACCCCGCCTTCTGTAGTCGGGCTAGTAGGTCTTCCATGGACAGAATTACTCCGTGCCGAGTTTCTTCTAAAGGCCACGCAAATTTGTTGGTTAGGCTCCTTAGCCAGTGACATATTCGCATGGAGGGCCAGACTTGCTAGCTAAGGACTATTCTACTGTTTTCACGCCGAGGCCTAAAACTCCTGTCGGTGTCCGAAATAGGAAGAGCGCCGGTACGTGGCCATTCTAGTTCGGTATAGCTTAAGGTCTTTACGACTTTTAAGTACCGAGCCCAAGCGACCCGGGGTAGTGTTGTTCACCCGAAGATGCG [...]
+	                </sequence>
+                <sequence taxon="l01_tip_015" totalcount="4">
+                    
+		ATAACAACGTTGCCCAACTATTTAATCGTACTGAGGATGTAAAACAATATACAGAATAGTGGGCATGAGTGGGATTCGCTTACGCGAGGTGCCCTAGCCTCACTCCGATCATGGGGTCCAAAGGGGCCAATCTCTTTAAGCTGCAGCCCCATTCGCTTATGCCTACGGATATGGAGAATTACCCCGTCTTCTGTAGTCGGGCTAGTAGGTCTTCCATGGACAGAATTACTCCGTGCCGAGTTTCTTCTAAAGGCCACGCAAATTTGTTGGTTAGGCTCCTTAGCCAGTGACATATTCGCATGGAGGGCCAGACTTGCTAGCTAAGGACTATTCTACTGTTTTCACGCCGAGGCCTAAAACTCCTGTCGGTGTCCGAAATAGGAAGAGCGCCGGTACGTGGCCATTCTAGTTCGGTATAGCTTAAGGTCTTTACGACTTTTAAGTACCGAGCCCAAGCGACCCGGGGTAGTGTTGTTCACCCGAAAATGCG [...]
+	                </sequence>
+            </data>
+<data dataType="nucleotide" id="alignment002" name="taxa">
+                <sequence taxon="l02_tip_011" totalcount="4">
+                    
+		GATCGACGGCGTTCACGAGGCTGGCGCGGATTCATCATTTGTAGGAGTCCGCCGCCAGGCACACACTATAGGTTTCTTTTACGAAGTTCTTTTGAAAGCGGAATACGCGCAGTAACAGTTGTGCCCTGAGTCAAGGATTTGACACATACAACTCGTGTCGGAGGCCCATAGTATTTCGAATATGTAGGGGTTTCGGATCGCATCGGGTTATCCGTAAGGTTAGTCGTAAAATTTTAATCTGCCCCTGAGTGTCCGGTGGTTGCGCTCACCCGACCATAAACTCCCGAAACGGTTTGCCACCTCTGGATTTTCGCGTAGACTGCTTCTGCGTTATCGAACGGAGCTGAACACCGTTGCCAGTATTATCATTGCTCATTTCCGGTTGGTGTGGTAACATAAATTCTGAGATTCATTAACAGCATCGCGGAAGATGCACACAGACTTCACCTACAGGCCCATCCGAGGAGAAAAGTCGTAGGAGGTCTCCCTC [...]
+	                </sequence>
+                <sequence taxon="l02_tip_010" totalcount="4">
+                    
+		GATCGACGGCGTTCACGAGGCTGGCGCGGATTCATCATTTGTAGGAGTCCGCCGCCAGGCACACACTATAGGTTTCTTTTACGAAGTTCTTTTGAAAGCGGAATACGCGCAGTAACAGTTGTGCCCTGAGTCAAGGATTTGACACATACAACTCGTGTCGGAGGCCCATAGTATTTCGAATATGTAGGGGTTTCGGATCGCATCGGGTTATCCGTAAGGTTAGTCGTAAAATTTTAATCTGCCCCTGAGTGTCCGGTGGTTGCGCTCACCCGACCATAAACTCCCGAAACGGTTTGCCACCTCTGGATTTTCGCGTAGACTGCTTCTGCGTTATCGAACGGAGCTGAACACCGTTGCCAGTATTATCATTGCTCATTTCCGGTTGGTGTGGTAACATAAATTCTGAGATTCATTAACAGCATCGCGGAAGATGCACACAGACTTCACCTACAGGCCCATCCGAGGAGAAAAGTCGTAGGAGGTCTCCCTC [...]
+	                </sequence>
+                <sequence taxon="l02_tip_013" totalcount="4">
+                    
+		GATCGACGGCGTTCACGAGGCTGGCGCGGATTCATCATTTGTAGGAGTCCGCCGCCAGGCACACACTATAGGTTTCTTTTACGAAGTTCTTTTGAAAGCGGAATACGCGCAGTAACAGTTGTGCCCTGAGTCAAGGATTTGACACATACAACTCGTGTCGGAGGCCCATAGTATTTCGAATATGTAGGGGTTTCGGATCGCATCGGGTTATCCGTAAGGTTAGTCGTAAAATTTTAATCTGCCCCTGAGTGTCCGGTGGTTGCGCTCACCCGACCATAAACTCCCGAAACGGTTTGCCACCTCTGGATTTTCGCGTAGACTGCTTCTGCGTTATCGAACGGAGCTGAACACCGTTGCCAGTATTATCATTGCTCATTTCCGGTTGGTGTGGTAACATAAATTCTGAGATTCATTAACAGCATCGCGGAAGATGCACACAGACTTCACCTACAGGCCCATCCGAGGAGAAAAGTCGTAGGAGGTCTCCCTC [...]
+	                </sequence>
+                <sequence taxon="l02_tip_012" totalcount="4">
+                    
+		GATCGACGGCGTTCACGAGGCTGGCGCGGATTCATCATTTGTAGGAGTCCGCCGCCAGGCACACACTATAGGTTTCTTTTACGAAGTTCTTTTGAAAGCGGAATACGCGCAGTAACAGTTGTGCCCTGAGTCAAGGATTTGACACATACAACTCGTGTCGGAGGCCCATAGTATTTCGAATATGTAGGGGTTTCGGATCGCATCGGGTTATCCGTAAGGTTAGTCGTAAAATTTTAATCTGCCCCTGAGTGTCCGGTGGTTGCGCTCACCCGACCATAAACTCCCGAAACGGTTTGCCACCTCTGGATTTTCGCGTAGACTGCTTCTGCGTTATCGAACGGAGCTGAACACCGTTGCCAGTATTATCATTGCTCATTTCCGGTTGGTGTGGTAACATAAATTCTGAGATTCATTAACAGCATCGCGGAAGATGCACACAGACTTCACCTACAGGCCCATCCGAGGAGAAAAGTCGTAGGAGGTCTCCCTC [...]
+	                </sequence>
+                <sequence taxon="l02_tip_015" totalcount="4">
+                    
+		GATCGACAGCGTTCACGAGGCTGGCGCGGATTCATCATTTGTAGGAGTCCGCCGCCAGGCACACACTATAGGTTTCTTTTACGAAGTTCTTTTGAAAGCGGAATACGCGCAGTAACAGTTGTGCCCTGAGTCAAGGATTTGACACATACAACTCGTGTCGGAGGCCCATAGTATTTCGAATATGTAGGGGTTTCGGATCGCATCGGGTTATCCGTAAGGTTAGTCGTAAAATTTTAATCTGCCCCTGAGTGTCCGGTGGTTGCGCTCACCCGACCACAAACTCCCGAAACGGTTTGCCACCTCTGGATTTTCGCGTAGACTGCTTCTGTGTTATCGAACGGAGCTGAACACCGTTGCCAGTATTATCATTGCTCATTTCCGGTTGGTGTGGTAACATAAATTCTGAGATTCATTAACAGCATCGCGGAAGATGCACACAGACTTCACCTACAGGCCCATCCGAGGAGAAAAGTCGTAGGAGGTCTCCCTC [...]
+	                </sequence>
+                <sequence taxon="l02_tip_014" totalcount="4">
+                    
+		GATCGACAGCGTTCACGAGGCTGGCGCGGATTCATCATTTGTAGGAGTCCGCCGCCAGGCACACACTATAGGTTTCTTTTACGAAGTTCTTTTGAAAGCGGAATACGCGCAGTAACAGTTGTGCCCTGAGTCAAGGATTTGACACATACAACTCGTGTCGGAGGCCCATAGTATTTCGAATATGTAGGGGTTTCGGATCGCATCGGGTTATCCGTAAGGTTAGTCGTAAAATTTTAATCTGCCCCTGAGTGTCCGGTGGTTGCGCTCACCCGACCACAAACTCCCGAAACGGTTTGCCACCTCTGGATTTTCGCGTAGACTGCTTCTGTGTTATCGAACGGAGCTGAACACCGTTGCCAGTATTATCATTGCTCATTTCCGGTTGGTGTGGTAACATAAATTCTGAGATTCATTAACAGCATCGCGGAAGATGCACACAGACTTCACCTACAGGCCCATCCGAGGAGAAAAGTCGTAGGAGGTCTCCCTC [...]
+	                </sequence>
+                <sequence taxon="l02_tip_017" totalcount="4">
+                    
+		GATCGACGGCGTTCACGAGGCTGGCGCGGATTCATCATTTGTAGGAGTCCGCCGCCAGGCACACACTATAGGTTTCTTTTACGAAGTTCTTTTGAAAGCGGAATACGCGCAGTAACAGTTGTGCCCTGAGTCAAGGATTTGACACATACAACTCGTGTCGGAGGCCCATAGTATTTCGAATATGTAGGGGTTTCGGATCGCATCGGGTTATCCGTAAGGTTAGTCGTAAAATTTTAATCTGCCCCTGAGTGTCCGGTGGTTGCGCTCACCCGACCATAAACTCCCGAAACGGTTTGCCACCTCTGGATTTTCGCGTAGACTGCTTCTGTGTTATCGAACGGAGCTGAACACCGTTGCCAGTATTATCATTGCTCATTTCCGGTTGGTGTGGTAACATAAATTCTGAGATTCATTAACAGCATCGCGGAAGATGCACACAGACTTCACCTACAGGCCCATCCGAGGAGAAAAGTCGTAGGAGGTCTCCCTC [...]
+	                </sequence>
+                <sequence taxon="l02_tip_016" totalcount="4">
+                    
+		GATCGACGGCGTTCACGAGGCTGGCGCGGATTCATCATTTGTAGGAGTCCGCCGCCAGGCACACACTATAGGTTTCTTTTACGAAGTTCTTTTGAAAGCGGAATACGCGCAGTAACAGTTGTGCCCTGAGTCAAGGATTTGACACATACAACTCGTGTCGGAGGCCCATAGTATTTCGAATATGTAGGGGTTTCGGATCGCATCGGGTTATCCGTAAGGTTAGTCGTAAAATTTTAATCTGCCCCTGAGTGTCCGGTGGTTGCGCTCACCCGACCATAAACTCCCGAAACGGTTTGCCACCTCTGGATTTTCGCGTAGACTGCTTCTGCGTTATCGAACGGAGCTGAACACCGTTGCCAGTATTATCATTGCTCATTTCCGGTTGGTGTGGTAACATAAATTCTGAGATTCATTAACAGCATCGCGGAAGATGCACACAGACTTCACCTACAGGCCCATCCGAGGAGAAAAGTCGTAGGAGGTCTCCCTC [...]
+	                </sequence>
+                <sequence taxon="l02_tip_019" totalcount="4">
+                    
+		GATCGACGGCGTTCACGAGGCTGGCGCGGATTCATCATTTGTAGGAGTCCGCCGCCAGGCACACACTATAGGTTTCTTTTACGAAGTTCTTTTGAAAGCGGAATACGCGCAGTAACAGTTGTGCCCTGAGTCAAGGATTTGACACATACAACTCGTGTCGGAGGCCCATAGTATTTCGAATATGTAGGGGTTTCGGATCGCATCGGGTTATCCGTAAGGTTAGTCGTAAAATTTTAATCTGCCCCTGAGTGTCCGGTGGTTGCGCTCACCCGACCATAAACTCCCGAAACGGTTTGCCACCTCTGGATTTTCGCGTAGACTGCTTCTGTGTTATCGAACGGAGCTGAACACCGTTGCCAGTATTATCATTGCTCATTTCCGGTTGGTGTGGTAACATAAATTCTGAGATTCATTAACAGCATCGCGGAAGATGCACACAGACTTCACCTACAGGCCCATCCGAGGAGAAAAGTCGTAGGAGGTCTCCCTC [...]
+	                </sequence>
+                <sequence taxon="l02_tip_018" totalcount="4">
+                    
+		GATCGACGGCGTTCACGAGGCTGGCGCGGATTCATCATTTGTAGGAGTCCGCCGCCAGGCACACACTATAGGTTTCTTTTACGAAGTTCTTTTGAAAGCGGAATACGCGCAGTAACAGTTGTGCCCTGAGTCAAGGATTTGACACATACAACTCGTGTCGGAGGCCCATAGTATTTCGAATATGTAGGGGTTTCGGATCGCATCGGGTTATCCGTAAGGTTAGTCGTAAAATTTTAATCTGCCCCTGAGTGTCCGGTGGTTGCGCTCACCCGACCATAAACTCCCGAAACGGTTTGCCACCTCTGGATTTTCGCGTAGACTGCTTCTGCGTTATCGAACGGAGCTGAACACCGTTGCCAGTATTATCATTGCTCATTTCCGGTTGGTGTGGTAACATAAATTCTGAGATTCATTAACAGCATCGCGGAAGATGCACACAGACTTCACCTACAGGCCCATCCGAGGAGAAAAGTCGTAGGAGGTCTCCCTC [...]
+	                </sequence>
+                <sequence taxon="l02_tip_006" totalcount="4">
+                    
+		GATCGACAGCGTTCACGAGGCTGGCGCGGATTCATCATTTGTAGGAGTCCGCCGCCAGGCACACACTATAGGTTTCTTTTACGAAGTTCTTTTGAAAGCGGAATACGCGCAGTAACAGTTGTGCCCTGAGTCAAGGATTTGACACATACAACTCGTGTCGGAGGCCCATAGTATTTCGAATATGTAGGGGTTTCGGATCGCATCGGGTTATCCGTAAGGTTAGTCGTAAAATTTTAATCTGCCCCTGAGTGTCCGGTGGTTGCGCTCACCCGACCACAAACTCCCGAAACGGTTTGCCACCTCTGGATTTTCGCGTAGACTGCTTCTGTGTTATCGAACGGAGCTGAACACCGTTGCCAGTATTATCATTGCTCATTTCCGGTTGGTGTGGTAACATAAATTCTGAGATTCATTAACAGCATCGCGGAAGATGCACACAGACTTCACCTACAGGCCCATCCGAGGAGAAAAGTCGTAGGAGGTCTCCCTC [...]
+	                </sequence>
+                <sequence taxon="l02_tip_007" totalcount="4">
+                    
+		GATCGACGGCGTTCACGAGGCTGGCGCGGATTCATCATTTGTAGGAGTCCGCCGCCAGGCACACACTATAGGTTTCTTTTACGAAGTTCTTTTGAAAGCGGAATACGCGCAGTAACAGTTGTGCCCTGAGTCAAGGATTTGACACATACAACTCGTGTCGGAGGCCCATAGTATTTCGAATATGTAGGGGTTTCGGATCGCATCGGGTTATCCGTAAGGTTAGTCGTAAAATTTTAATCTGCCCCTGAGTGTCCGGTGGTTGCGCTCACCCGACCATAAACTCCCGAAACGGTTTGCCACCTCTGGATTTTCGCGTAGACTGCTTCTGTGTTATCGAACGGAGCTGAACACCGTTGCCAGTATTATCATTGCTCATTTCCGGTTGGTGTGGTAACATAAATTCTGAGATTCATTAACAGCATCGCGGAAGATGCACACAGACTTCACCTACAGGCCCATCCGAGGAGAAAAGTCGTAGGAGGTCTCCCTC [...]
+	                </sequence>
+                <sequence taxon="l02_tip_004" totalcount="4">
+                    
+		GATCGACAGCGTTCACGAGGCTGGCGCGGATTCATCATTTGTAGGAGTCCGCCGCCAGGCACACACTATAGGTTTCTTTTACGAAGTTCTTTTGAAAGCGGAATACGCGCAGTAACAGTTGTGCCCTGAGTCAAGGATTTGACACATACAACTCGTGTCGGAGGCCCATAGTATTTCGAATATGTAGGGGTTTCGGATCGCATCGGGTTATCCGTAAGGTTAGTCGTAAAATTTTAATCTGCCCCTGAGTGTCCGGTGGTTGCGCTCACCCGACCACAAACTCCCGAAACGGTTTGCCACCTCTGGATTTTCGCGTAGACTGCTTCTGTGTTATCGAACGGAGCTGAACACCGTTGCCAGTATTATCATTGCTCATTTCCGGTTGGTGTGGTAACATAAATTCTGAGATTCATTAACAGCATCGCGGAAGATGCACACAGACTTCACCTACAGGCCCATCCGAGGAGAAAAGTCGTAGGAGGTCTCCCTC [...]
+	                </sequence>
+                <sequence taxon="l02_tip_005" totalcount="4">
+                    
+		GATCGACGGCGTTCACGAGGCTGGCGCGGATTCATCATTTGTAGGAGTCCGCCGCCAGGCACACACTATAGGTTTCTTTTACGAAGTTCTTTTGAAAGCGGAATACGCGCAGTAACAGTTGTGCCCTGAGTCAAGGATTTGACACATACAACTCGTGTCGGAGGCCCATAGTATTTCGAATATGTAGGGGTTTCGGATCGCATCGGGTTATCCGTAAGGTTAGTCGTAAAATTTTAATCTGCCCCTGAGTGTCCGGTGGTTGCGCTCACCCGACCATAAACTCCCGAAACGGTTTGCCACCTCTGGATTTTCGCGTAGACTGCTTCTGTGTTATCGAACGGAGCTGAACACCGTTGCCAGTATTATCATTGCTCATTTCCGGTTGGTGTGGTAACATAAATTCTGAGATTCATTAACAGCATCGCGGAAGATGCACACAGACTTCACCTACAGGCCCATCCGAGGAGAAAAGTCGTAGGAGGTCTCCCTC [...]
+	                </sequence>
+                <sequence taxon="l02_tip_002" totalcount="4">
+                    
+		GATCGACGGCGTTCACGAGGCTGGCGCGGATTCATCATTTGTAGGAGTCCGCCGCCAGGCACACACTATAGGTTTCTTTTACGAAGTTCTTTTGAAAGCGGAATACGCGCAGTAACAGTTGTGCCCTGAGTCAAGGATTTGACACATACAACTCGTGTCGGAGGCCCATAGTATTTCGAATATGTAGGGGTTTCGGATCGCATCGGGTTATCCGTAAGGTTAGTCGTAAAATTTTAATCTGCCCCTGAGTGTCCGGTGGTTGCGCTCACCCGACCATAAACTCCCGAAACGGTTTGCCACCTCTGGATTTTCGCGTAGACTGCTTCTGTGTTATCGAACGGAGCTGAACACCGTTGCCAGTATTATCATTGCTCATTTCCGGTTGGTGTGGTAACATAAATTCTGAGATTCATTAACAGCATCGCGGAAGATGCACACAGACTTCACCTACAGGCCCATCCGAGGAGAAAAGTCGTAGGAGGTCTCCCTC [...]
+	                </sequence>
+                <sequence taxon="l02_tip_003" totalcount="4">
+                    
+		GATCGACGGCGTTCACGAGGCTGGCGCGGATTCATCATTTGTAGGAGTCCGCCGCCAGGCACACACTATAGGTTTCTTTTACGAAGTTCTTTTGAAAGCGGAATACGCGCAGTAACAGTTGTGCCCTGAGTCAAGGATTTGACACATACAACTCGTGTCGGAGGCCCATAGTATTTCGAATATGTAGGGGTTTCGGATCGCATCGGGTTATCCGTAAGGTTAGTCGTAAAATTTTAATCTGCCCCTGAGTGTCCGGTGGTTGCGCTCACCCGACCATAAACTCCCGAAACGGTTTGCCACCTCTGGATTTTCGCGTAGACTGCTTCTGTGTTATCGAACGGAGCTGAACACCGTTGCCAGTATTATCATTGCTCATTTCCGGTTGGTGTGGTAACATAAATTCTGAGATTCATTAACAGCATCGCGGAAGATGCACACAGACTTCACCTACAGGCCCATCCGAGGAGAAAAGTCGTAGGAGGTCTCCCTC [...]
+	                </sequence>
+                <sequence taxon="l02_tip_000" totalcount="4">
+                    
+		GATCGACGGCGTTCACGAGGCTGGCGCGGATTCATCATTTGTAGGAGTCCGCCGCCAGGCACACACTATAGGTTTCTTTTACGAAGTTCTTTTGAAAGCGGAATACGCGCAGTAACAGTTGTGCCCTGAGTCAAGGATTTGACACATACAACTCGTGTCGGAGGCCCATAGTATTTCGAATATGTAGGGGTTTCGGATCGCATCGGGTTATCCGTAAGGTTAGTCGTAAAATTTTAATCTGCCCCTGAGTGTCCGGTGGTTGCGCTCACCCGACCATAAACTCCCGAAACGGTTTGCCACCTCTGGATTTTCGCGTAGACTGCTTCTGCGTTATCGAACGGAGCTGAACACCGTTGCCAGTATTATCATTGCTCATTTCCGGTTGGTGTGGTAACATAAATTCTGAGATTCATTAACAGCATCGCGGAAGATGCACACAGACTTCACCTACAGGCCCATCCGAGGAGAAAAGTCGTAGGAGGTCTCCCTC [...]
+	                </sequence>
+                <sequence taxon="l02_tip_001" totalcount="4">
+                    
+		GATCGACGGCGTTCACGAGGCTGGCGCGGATTCATCATTTGTAGGAGTCCGCCGCCAGGCACACACTATAGGTTTCTTTTACGAAGTTCTTTTGAAAGCGGAATACGCGCAGTAACAGTTGTGCCCTGAGTCAAGGATTTGACACATACAACTCGTGTCGGAGGCCCATAGTATTTCGAATATGTAGGGGTTTCGGATCGCATCGGGTTATCCGTAAGGTTAGTCGTAAAATTTTAATCTGCCCCTGAGTGTCCGGTGGTTGCGCTCACCCGACCATAAACTCCCGAAACGGTTTGCCACCTCTGGATTTTCGCGTAGACTGCTTCTGCGTTATCGAACGGAGCTGAACACCGTTGCCAGTATTATCATTGCTCATTTCCGGTTGGTGTGGTAACATAAATTCTGAGATTCATTAACAGCATCGCGGAAGATGCACACAGACTTCACCTACAGGCCCATCCGAGGAGAAAAGTCGTAGGAGGTCTCCCTC [...]
+	                </sequence>
+                <sequence taxon="l02_tip_020" totalcount="4">
+                    
+		GATCGACGGCGTTCACGAGGCTGGCGCGGATTCATCATTTGTAGGAGTCCGCCGCCAGGCACACACTATAGGTTTCTTTTACGAAGTTCTTTTGAAAGCGGAATACGCGCAGTAACAGTTGTGCCCTGAGTCAAGGATTTGACACATACAACTCGTGTCGGAGGCCCATAGTATTTCGAATATGTAGGGGTTTCGGATCGCATCGGGTTATCCGTAAGGTTAGTCGTAAAATTTTAATCTGCCCCTGAGTGTCCGGTGGTTGCGCTCACCCGACCATAAACTCCCGAAACGGTTTGCCACCTCTGGATTTTCGCGTAGACTGCTTCTGTGTTATCGAACGGAGCTGAACACCGTTGCCAGTATTATCATTGCTCATTTCCGGTTGGTGTGGTAACATAAATTCTGAGATTCATTAACAGCATCGCGGAAGATGCACACAGACTTCACCTACAGGCCCATCCGAGGAGAAAAGTCGTAGGAGGTCTCCCTC [...]
+	                </sequence>
+                <sequence taxon="l02_tip_021" totalcount="4">
+                    
+		GATCGACAGCGTTCACGAGGCTGGCGCGGATTCATCATTTGTAGGAGTCCGCCGCCAGGCACACACTATAGGTTTCTTTTACGAAGTTCTTTTGAAAGCGGAATACGCGCAGTAACAGTTGTGCCCTGAGTCAAGGATTTGACACATACAACTCGTGTCGGAGGCCCATAGTATTTCGAATATGTAGGGGTTTCGGATCGCATCGGGTTATCCGTAAGGTTAGTCGTAAAATTTTAATCTGCCCCTGAGTGTCCGGTGGTTGCGCTCACCCGACCACAAACTCCCGAAACGGTTTGCCACCTCTGGATTTTCGCGTAGACTGCTTCTGTGTTATCGAACGGAGCTGAACACCGTTGCCAGTATTATCATTGCTCATTTCCGGTTGGTGTGGTAACATAAATTCTGAGATTCATTAACAGCATCGCGGAAGATGCACACAGACTTCACCTACAGGCCCATCCGAGGAGAAAAGTCGTAGGAGGTCTCCCTC [...]
+	                </sequence>
+                <sequence taxon="l02_tip_022" totalcount="4">
+                    
+		GATCGACGGCGTTCACGAGGCTGGCGCGGATTCATCATTTGTAGGAGTCCGCCGCCAGGCACACACTATAGGTTTCTTTTACGAAGTTCTTTTGAAAGCGGAATACGCGCAGTAACAGTTGTGCCCTGAGTCAAGGATTTGACACATACAACTCGTGTCGGAGGCCCATAGTATTTCGAATATGTAGGGGTTTCGGATCGCATCGGGTTATCCGTAAGGTTAGTCGTAAAATTTTAATCTGCCCCTGAGTGTCCGGTGGTTGCGCTCACCCGACCATAAACTCCCGAAACGGTTTGCCACCTCTGGATTTTCGCGTAGACTGCTTCTGTGTTATCGAACGGAGCTGAACACCGTTGCCAGTATTATCATTGCTCATTTCCGGTTGGTGTGGTAACATAAATTCTGAGATTCATTAACAGCATCGCGGAAGATGCACACAGACTTCACCTACAGGCCCATCCGAGGAGAAAAGTCGTAGGAGGTCTCCCTC [...]
+	                </sequence>
+                <sequence taxon="l02_tip_009" totalcount="4">
+                    
+		GATCGACGGCGTTCACGAGGCTGGCGCGGATTCATCATTTGTAGGAGTCCGCCGCCAGGCACACACTATAGGTTTCTTTTACGAAGTTCTTTTGAAAGCGGAATACGCGCAGTAACAGTTGTGCCCTGAGTCAAGGATTTGACACATACAACTCGTGTCGGAGGCCCATAGTATTTCGAATATGTAGGGGTTTCGGATCGCATCGGGTTATCCGTAAGGTTAGTCGTAAAATTTTAATCTGCCCCTGAGTGTCCGGTGGTTGCGCTCACCCGACCATAAACTCCCGAAACGGTTTGCCACCTCTGGATTTTCGCGTAGACTGCTTCTGCGTTATCGAACGGAGCTGAACACCGTTGCCAGTATTATCATTGCTCATTTCCGGTTGGTGTGGTAACATAAATTCTGAGATTCATTAACAGCATCGCGGAAGATGCACACAGACTTCACCTACAGGCCCATCCGAGGAGAAAAGTCGTAGGAGGTCTCCCTC [...]
+	                </sequence>
+                <sequence taxon="l02_tip_008" totalcount="4">
+                    
+		GATCGACGGCGTTCACGAGGCTGGCGCGGATTCATCATTTGTAGGAGTCCGCCGCCAGGCACACACTATAGGTTTCTTTTACGAAGTTCTTTTGAAAGCGGAATACGCGCAGTAACAGTTGTGCCCTGAGTCAAGGATTTGACACATACAACTCGTGTCGGAGGCCCATAGTATTTCGAATATGTAGGGGTTTCGGATCGCATCGGGTTATCCGTAAGGTTAGTCGTAAAATTTTAATCTGCCCCTGAGTGTCCGGTGGTTGCGCTCACCCGACCATAAACTCCCGAAACGGTTTGCCACCTCTGGATTTTCGCGTAGACTGCTTCTGCGTTATCGAACGGAGCTGAACACCGTTGCCAGTATTATCATTGCTCATTTCCGGTTGGTGTGGTAACATAAATTCTGAGATTCATTAACAGCATCGCGGAAGATGCACACAGACTTCACCTACAGGCCCATCCGAGGAGAAAAGTCGTAGGAGGTCTCCCTC [...]
+	                </sequence>
+                <sequence taxon="l02_tip_023" totalcount="4">
+                    
+		GATCGACGGCGTTCACGAGGCTGGCGCGGATTCATCATTTGTAGGAGTCCGCCGCCAGGCACACACTATAGGTTTCTTTTACGAAGTTCTTTTGAAAGCGGAATACGCGCAGTAACAGTTGTGCCCTGAGTCAAGGATTTGACACATACAACTCGTGTCGGAGGCCCATAGTATTTCGAATATGTAGGGGTTTCGGATCGCATCGGGTTATCCGTAAGGTTAGTCGTAAAATTTTAATCTGCCCCTGAGTGTCCGGTGGTTGCGCTCACCCGACCATAAACTCCCGAAACGGTTTGCCACCTCTGGATTTTCGCGTAGACTGCTTCTGCGTTATCGAACGGAGCTGAACACCGTTGCCAGTATTATCATTGCTCATTTCCGGTTGGTGTGGTAACATAAATTCTGAGATTCATTAACAGCATCGCGGAAGATGCACACAGACTTCACCTACAGGCCCATCCGAGGAGAAAAGTCGTAGGAGGTCTCCCTC [...]
+	                </sequence>
+            </data>
+<data dataType="nucleotide" id="alignment003" name="taxa">
+                <sequence taxon="l03_tip_003" totalcount="4">
+                    
+		CCAACAATGCGGCGTATCACTAATGTCTTGATTTAACGGGCTTAATTCGCAGTGTTTCCTCATGACTAGATAGGTATTTCACTTTCTCTAGAAATTTACTCCATTTTACGACCCTTGGCCATGTCATGCGTGACATTGGGCCGGAAACGGCTAGGCAACAGGATACTAAAGCGAGTGAGCGTCAAACAAGGCTCTAATGTTCTCACCATTCCGTACGATTAAATTTCGACAAAAGGGGACTATTCTTAGACATCGGGTAAACTTAGAGACATGAGCATTTCGAATTATATTCCCGCCATGGGAATGGTTAATTGTAGGAAAAAGTTCGCGGCGACCGAGTTGCTTCGGAAAGTGCCGTTCGAAGGCGCTGACAATGGCGTTTGCGCATCGTAAACGTCTGGTACCACGCAAAGTCTAAACCTGCCTTGGCCGTGTAACATCATGTATAATGTAAGACCTATCGGCACACTGTTGAACCATAACAGACAAC [...]
+	                </sequence>
+                <sequence taxon="l03_tip_002" totalcount="4">
+                    
+		CCAACAATGCGGCGTATCACTGATGTCTTGATTTAACGCGCTTAATTCGCAGTGTTTCCTCATGACTAGATAGGTATTTCACTTTCTCTAGAAATTTACTCCATTTTACGACCCTTGGCCATGTCATGCGTGACATTGGGCCGGAAACGGCTAGGCAACAGGATACTAAAGCGAGTGAGCGTCAAGCAAGGCTCTAATGTTCTCACCATTCCGTACGATTAAATTTCGACAATAGGGGACTATTCTTAGACATCGGGTAAACTAAGAGACATGAGCATTTCGAATTATATTCCCGCCATGGGAATGGTTAATTGTAGGAAAAAGTTCGCGGCGACCGAGTTGCTTCGGAAAGTGCTGTTCGAAGGCGCTGACAATGGCGTTTGCGCATCGTAAACGTCTGGTACCACGCAAAGTCTAAACCTGCCTTGGCCGTGTAATATCATGTATAATGTAAGACCTATCGGCACACTGTTGAACTATAACAGACAAC [...]
+	                </sequence>
+                <sequence taxon="l03_tip_001" totalcount="4">
+                    
+		CCAACAATGCGGCGTATCACTAATGTCTTGATTTAACGGGCTTAATTCGCAGTGTTTCCTCATGACTAGATAGGTATTTCACTTTCTCTAGAAATTTACTCCATTTTACGACCCTTGGCCATGTCATGCGTGACATTGGGCCGGAAACGGCTAGGCAACAGGATACTAAAGCGAGTGAGCGTCAAACAAGGCTCTAATGTTCTCACCATTCCGTACGATTAAATTTCGACAAAAGGGGACTATTCTTAGACATCGGGTAAACTTAGAGACATGAGCATTTCGAATTATATTCCCGCCATGGGAATGGTTAATTGTAGGAAAAAGTTCGCGGCGACCGAGTTGCTTCGGAAAGTGCCGTTCGAAGGCGCTGACAATGGCGTTTGCGCATCGTAAACGTCTGGTACCACGCAAAGTCTAAACCTGCCTTGGCCGTGTAACATCATGTATAATGTAAGACCTATCGGCACACTGTTGAACCATAACAGACAAC [...]
+	                </sequence>
+                <sequence taxon="l03_tip_000" totalcount="4">
+                    
+		CCAACAATGCGGCGTATCACTAATGTCTTGATTTAACGGGCTTAATTCGCAGTGTTTCCTCATGACTAGATAGGTATTTCACTTTCTCTAGAAATTTACTCCATTTTACGACCCTTGGCCATGTCATGCGTGACATTGGGCCGGAAACGGCTAGGCAACAGGATACTAAAGCGAGTGAGCGTCAAACAAGGCTCTAATGTTCTCACCATTCCGTACGATTAAATTTCGACAAAAGGGGACTATTCTTAGACATCGGGTAAACTTAGAGACATGAGCATTTCGAATTATATTCCCGCCATGGGAATGGTTAATTGTAGGAAAAAGTTCGCGGCGACCGAGTTGCTTCGGAAAGTGCCGTTCGAAGGCGCTGACAATGGCGTTTGCGCATCGTAAACGTCTGGTACCACGCAAAGTCTAAACCTGCCTTGGCCGTGTAACATCATGTATAATGTAAGACCTATCGGCACACTGTTGAACCATAACAGACAAC [...]
+	                </sequence>
+                <sequence taxon="l03_tip_007" totalcount="4">
+                    
+		CCAACAATGCGGCGTATCACTAATGTCTTGATTTAACGGGCTTAATTCGCAGTGTTTCCTCATGACTAGATAGGTATTTCACTTTCTCTAGAAATTTACTCCATTTTACGACCCTTGGCCATGTCATGCGTGACATTGGGCCGGAAACGGCTAGGCAACAGGATACTAAAGCGAGTGAGCGTCAAGCAAGGCTCTAATGTTCTCACCATTCCGTACGATTAAATTTCGACAAAAGGGGACTATTCTTAGACATCGGGTAAACTTAGAGACATGAGCATTTCGAATTATATTCCCGCCATGGGAATGGTTAATTGTAGGAAAAAGTTCGCGGCGACCGAGTTGCTTCGGAAAGTGCCGTTCGAAGGCGCTGACAATGGCGTTTGCGCATCGTAAACGTCTGGTACCACGCAAAGTCTAAACCTGCCTTGGCCGTGTAACATCATGTATAATGTAAGACCTATCGGCACACTGTTGAACTATAACAGACAAC [...]
+	                </sequence>
+                <sequence taxon="l03_tip_006" totalcount="4">
+                    
+		CCAACAATGCGGCGTATCACTGATGTCTTGATTTAACGCGCTTAATTCGCAGTGTTTCCTCATGACTAGATAGGTATTTCACTTTCTCTAGAAATTTACTCCATTTTACGACCCTTGGCCATGTCATGCGTGGCATTGGGCCGGAAACGGCTAGGCAACAGGATACTAAAGCGAGTGAGCGTCAAGCAAGGCTCTAATGTTCTCACCATTCCGTACGATTAAATTTCGACAATAGGGGACTATTCTTAGACATCGGGTAAACTAAGAGACATGAGCATTTCGAATTATATTCCCGCCATGGGAATGGTTAATTGTAGGAAAAAGTTCGCGGCGACCGAGTTGCTTCGGAAAGTGCTGTTCGAAGGCGCTGACAATGGCGTTTGCACATCGTAAACGTCTGGTACCACGCAAAGTCTAAACCTGCCTTGGCCGTGTAATATCATGTATAATGTAAGACCTATCGGCACACTGTTGAACTATAACAGACAAC [...]
+	                </sequence>
+                <sequence taxon="l03_tip_005" totalcount="4">
+                    
+		CCAACAATGCGGCGTATCACTAATGTCTTGATTTAACGGGCTTAATTCGCAGTGTTTCCTCATGACTAGATAGGTATTTCACTTTCTCTAGAAATTTACTCCATTTTACGACCCTTGGCCATGTCATGCGTGACATTGGGCCGGAAACGGCTAGGCAACAGGATACTAAAGCGAGTGAGCGTCAAGCAAGGCTCTAATGTTCTCACCATTCCGTACGATTAAATTTCGACAAAAGGGGACTATTCTTAGACATCGGGTAAACTTAGAGACATGAGCATTTCGAATTATATTCCCGCCATGGGAATGGTTAATTGTAGGAAAAAGTTCGCGGCGACCGAGTTGCTTCGGAAAGTGCCGTTCGAAGGCGCTGACAATGGCGTTTGCGCATCGTAAACGTCTGGTACCACGCAAAGTCTAAACCTGCCTTGGCCGTGTAACATCATGTATAATGTAAGACCTATCGGCACACTGTTGAACTATAACAGACAAC [...]
+	                </sequence>
+                <sequence taxon="l03_tip_011" totalcount="4">
+                    
+		CCAACAATGCGGCGTATCACTAATGTCTTGATTTAACGGGCTTAATTCGCAGTGTTTCCTCATGACTAGATAGGTATTTCACTTTCTCTAGAAATTTACTCCATTTTACGACCCTTGGCCATGTCATGCGTGACATTGGGCCGGAAACGGCTAGGCAACAGGATACTAAAGCGAGTGAGCGTCAAGCAAGGCTCTAATGTTCTCACCATTCCGTACGATTAAATTTCGACAAAAGGGGACTATTCTTAGACATCGGGTAAACTTAGAGACATGAGCATTTCGAATTATATTCCCGCCATGGGAATGGTTAATTGTAGGAAAAAGTCCGCGGCGACCGAGTTGCTTCGGAAAGTGCCGTCCGAAGGCGCTGACAATGGCGTTTGCGCATCGTAAACGTCTGGTACCACGCAAAGTCTAAACCTGCCTTGGCCGTGTAATATCATGTATAATGTAAGACCTATCGGCACACTGTTGAACTATAACAGACAAC [...]
+	                </sequence>
+                <sequence taxon="l03_tip_004" totalcount="4">
+                    
+		CCAACAATGCGGCGTATCACTAATGTCTTGATTTAACGGGCTTAATTCGCAGTGTTTCCTCATGACTAGATAGGTATTTCACTTTCTCTAGAAATTTACTCCATTTTACGACCCTTGGCCATGTCATGCGTGACATTGGGCCGGAAACGGCTAGGCAACAGGATACTAAAGCGAGTGAGCGTCAAGCAAGGCTCTAATGTTCTCACCATTCCGTACGATTAAATTTCGACAAAAGGGGACTATTCTTAGACATCGGGTAAACTTAGAGACATGAGCATTTCGAATTATATTCCCGCCATGGGAATGGTTAATTGTAGGAAAAAGTCCGCGGCGACCGAGTTGCTTCGGAAAGTGCCGTCCGAAGGCGCTGACAATGGCGTTTGCGCATCGTAAACGTCTGGTACCACGCAAAGTCTAAACCTGCCTTGGCCGTGTAATATCATGTATAATGTAAGACCTATCGGCACACTGTTGAACTATAACAGACAAC [...]
+	                </sequence>
+                <sequence taxon="l03_tip_008" totalcount="4">
+                    
+		CCAACAATGCGGCGTATCACTGATGTCTTGATTTAACGCGCTTAATTCGCAGTGTTTCCTCATGACTAGATAGGTATTTCACTTTCTCTAGAAATTTACTCCATTTTACGACCCTTGGCCATGTCATGCGTGACATTGGGCCGGAAACGGCTAGGCAACAGGATACTAAAGCGAGTGAGCGTCAAGCAAGGCTCTAATGTTCTCACCATTCCGTACGATTAAATTTCGACAATAGGGGACTATTCTTAGACATCGGGTAAACTAAGAGACATGAGCATTTCGAATTATATTCCCGCCATGGGAATGGTTAATTGTAGGAAAAAGTTCGCGGCGACCGAGTTGCTTCGGAAAGTGCTGTTCGAAGGCGCTGACAATGGCGTTTGCACATCGTAAACGTCTGGTACCACGCAAAGTCTAAACCTGCCTTGGCCGTGTAATATCATGTATAATGTAAGACCTATCGGCACACTGTTGAACTATAACAGACAAC [...]
+	                </sequence>
+                <sequence taxon="l03_tip_010" totalcount="4">
+                    
+		CCAACAATGCGGCGTATCACTAATGTCTTGATTTAACGGGCTTAATTCGCAGTGTTTCCTCATGACTAGATAGGTATTTCACTTTCTCTAGAAATTTACTCCATTTTACGACCCTTGGCCATGTCATGCGTGACATTGGGCCGGAAACGGCTAGGCAACAGGATACTAAAGCGAGTGAGCGTCAAGCAAGGCTCTAATGTTCTCACCATTCCGTACGATTAAATTTCGACAAAAGGGGACTATTCTTAGACATCGGGTAAACTTAGAGACATGAGCATTTCGAATTATATTCCCGCCATGGGAATGGTTAATTGTAGGAAAAAGTCCGCGGCGACCGAGTTGCTTCGGAAAGTGCCGTTCGAAGGCGCTGACAATGGCGTTTGCGCATCGTAAACGTCTGGTACCACGCAAAGTCTAAACCTGCCTTGGCCGTGTAATATCATGTATAATGTAAGACCTATCGGCACACTGTTGAACTATAACAGACAAC [...]
+	                </sequence>
+                <sequence taxon="l03_tip_009" totalcount="4">
+                    
+		CCAACAATGCGGCGTATCACTAATGTCTTGATTTAACGGGCTTAATTCGCAGTGTTTCCTCATGACTAGATAGGTATTTCACTTTCTCTAGAAATTTACTCCATTTTACGACCCTTGGCCATGTCATGCGTGACATTGGGCCGGAAACGGCTAGGCAACAGGATACTAAAACGAGTGAGCGTCAAGCAAGGCTCTAATGTTCTCACCATTCCGTACGATTAAATTTCGACAAAAGGGGACTATTCTTAGACATCGGGTAAACTCAGAGACATGAGCATTTCGAATTATATTCCCGCCATGGGAATGGTTAATTGTAGGAAAAAGTTCGCGGCGACCGAGTTGCTTCGGAAAGTGCCGTTCGAAGGCGCTGACAATGGCGTTTGCGCATCGTAAACGTCTGGTACCACGCAAAGTCTAAACCTGCCTTGGCCGTGTAACATCATGTATAATGTAAGACCTATCGGCACACTGTTGAACTATAACAGACAAC [...]
+	                </sequence>
+            </data>
+
+
+    
+
+
+    <distribution id="posterior" spec="util.CompoundDistribution">
+        <distribution id="prior" spec="util.CompoundDistribution">
+            <distribution spec="beast.math.distributions.Prior" x="@populationMean">
+                <distr offset="0.0" spec="beast.math.distributions.OneOnX"/>
+            </distribution>
+            <distribution spec="beast.math.distributions.Prior">
+                <x arg="@indicators" id="indsSun" spec="util.Sum"/>
+                <distr offset="0.0" spec="beast.math.distributions.Poisson">
+                    <parameter dimension="1" estimate="true" lower="0.0" name="lambda" upper="0.0" value="0.69314718056"/>
+                </distr>
+            </distribution>
+            <distribution id="populationMeanPrior" spec="beast.math.distributions.Prior" x="@popSizes">
+                <distr id="popPriorDist" mean="@populationMean" offset="0.0" spec="beast.math.distributions.Exponential"/>
+            </distribution>
+            <distribution id="coalescent" spec="util.CompoundDistribution">
+                <distribution id="treeModel000Coal" spec="Coalescent" treeIntervals="@treeModel000Intervals">
+                    <populationModel id="scaledDemo4" spec="beast.evolution.tree.coalescent.ScaledPopulationFunction">
+                        <population id="demographic" populationIndicators="@indicators" populationSizes="@popSizes" spec="beast.evolution.tree.coalescent.CompoundPopulationFunction" type="linear" useIntervalsMiddle="false">
+                            <itree id="treeModel000Intervals" spec="TreeIntervals" tree="@treeModel000"/>
+                            <itree id="treeModel001Intervals" spec="TreeIntervals" tree="@treeModel001"/>
+                            <itree id="treeModel002Intervals" spec="TreeIntervals" tree="@treeModel002"/>
+                            <itree id="treeModel003Intervals" spec="TreeIntervals" tree="@treeModel003"/>
+                        </population>
+                        <parameter dimension="1" estimate="true" lower="0.0" name="factor" upper="0.0" value="4"/>
+                    </populationModel>
+                    
+                </distribution>
+                <distribution id="treeModel001Coal" populationModel="@scaledDemo4" spec="Coalescent" treeIntervals="@treeModel001Intervals"/>
+                <distribution id="treeModel002Coal" populationModel="@scaledDemo4" spec="Coalescent" treeIntervals="@treeModel002Intervals"/>
+                <distribution id="treeModel003Coal" populationModel="@demographic" spec="Coalescent" treeIntervals="@treeModel003Intervals"/>
+            </distribution>
+            <distribution spec="beast.math.distributions.Prior" x="@hky000.kappa">
+                <distr meanInRealSpace="true" offset="0.0" spec="beast.math.distributions.LogNormalDistributionModel">
+                    <parameter dimension="1" estimate="true" lower="0.0" name="M" upper="0.0" value="1.0"/>
+                    <parameter dimension="1" estimate="true" lower="0.0" name="S" upper="0.0" value="1"/>
+                </distr>
+            </distribution>
+            <distribution spec="beast.math.distributions.Prior" x="@hky003.kappa">
+                <distr meanInRealSpace="true" offset="0.0" spec="beast.math.distributions.LogNormalDistributionModel">
+                    <parameter dimension="1" estimate="true" lower="0.0" name="M" upper="0.0" value="1.0"/>
+                    <parameter dimension="1" estimate="true" lower="0.0" name="S" upper="0.0" value="1"/>
+                </distr>
+            </distribution>
+        </distribution>
+        <distribution id="likelihood" spec="util.CompoundDistribution">
+            <distribution data="@alignment000" id="treeLikelihood000" spec="TreeLikelihood" tree="@treeModel000" useAmbiguities="false">
+                <siteModel gammaCategoryCount="0" id="siteModel000" spec="SiteModel">
+                    <parameter dimension="1" estimate="true" id="siteModel000.mu" lower="0.0" name="mutationRate" value="0.000050"/>
+                    <substModel id="hky000" kappa="@hky000.kappa" spec="HKY">
+                        <frequencies data="@alignment000" estimate="true" id="hky000.frequencies" spec="Frequencies"/>
+                    </substModel>
+                </siteModel>
+            </distribution>
+            <distribution data="@alignment001" id="treeLikelihood001" spec="TreeLikelihood" tree="@treeModel001" useAmbiguities="false">
+                <siteModel gammaCategoryCount="0" id="siteModel001" spec="SiteModel">
+                    <parameter dimension="1" estimate="true" id="siteModel001.mu" lower="0.0" name="mutationRate" value="0.000050"/>
+                    <substModel id="hky001" kappa="@hky000.kappa" spec="HKY">
+                        <frequencies data="@alignment001" estimate="true" id="hky001.frequencies" spec="Frequencies"/>
+                    </substModel>
+                </siteModel>
+            </distribution>
+            <distribution data="@alignment002" id="treeLikelihood002" spec="TreeLikelihood" tree="@treeModel002" useAmbiguities="false">
+                <siteModel gammaCategoryCount="0" id="siteModel002" spec="SiteModel">
+                    <parameter dimension="1" estimate="true" id="siteModel002.mu" lower="0.0" name="mutationRate" value="0.000050"/>
+                    <substModel id="hky002" kappa="@hky000.kappa" spec="HKY">
+                        <frequencies data="@alignment002" estimate="true" id="hky002.frequencies" spec="Frequencies"/>
+                    </substModel>
+                </siteModel>
+            </distribution>
+            <distribution data="@alignment003" id="treeLikelihood003" spec="TreeLikelihood" tree="@treeModel003" useAmbiguities="false">
+                <siteModel gammaCategoryCount="0" id="siteModel003" spec="SiteModel">
+                    <parameter dimension="1" estimate="true" id="siteModel003.mu" lower="0.0" name="mutationRate" value="0.001"/>
+                    <substModel id="hky003" kappa="@hky003.kappa" spec="HKY">
+                        <frequencies data="@alignment003" estimate="true" id="hky003.frequencies" spec="Frequencies"/>
+                    </substModel>
+                </siteModel>
+            </distribution>
+        </distribution>
+    </distribution>
+
+
+    
+<run chainLength="10000000" distribution="@posterior" id="mcmc" preBurnin="0" spec="MCMC" storeEvery="-1">
+    <state storeEvery="-1">
+        <parameter dimension="1" estimate="true" id="hky000.kappa" lower="0.0" name="stateNode" upper="100.0" value="1.0"/>
+        <parameter dimension="1" estimate="true" id="hky003.kappa" lower="0.0" name="stateNode" upper="100.0" value="1.0"/>
+        <parameter dimension="1" estimate="true" id="populationMean" lower="0.0" name="stateNode" value="1"/>
+        <stateNode dimension="1" estimate="true" id="indicators" spec="parameter.BooleanParameter" value="false"/>
+        <parameter dimension="1" estimate="true" id="popSizes" lower="0.0" name="stateNode" value="1"/>
+        <tree clusterType="upgma" estimate="true" id="treeModel000" name="stateNode" nodetype="beast.evolution.tree.Node" spec="beast.util.ClusterTree">
+            <taxa idref="alignment000"/>
+        </tree>
+        <tree clusterType="upgma" estimate="true" id="treeModel001" name="stateNode" nodetype="beast.evolution.tree.Node" spec="beast.util.ClusterTree">
+            <taxa idref="alignment001"/>
+        </tree>
+        <tree clusterType="upgma" estimate="true" id="treeModel002" name="stateNode" nodetype="beast.evolution.tree.Node" spec="beast.util.ClusterTree">
+            <taxa idref="alignment002"/>
+        </tree>
+        <tree clusterType="upgma" estimate="true" id="treeModel003" name="stateNode" nodetype="beast.evolution.tree.Node" spec="beast.util.ClusterTree">
+            <taxa idref="alignment003"/>
+        </tree>
+    </state>
+
+    
+
+    <operator id="bitflip" parameter="@indicators" spec="BitFlipOperator" uniform="true" weight="1.0"/>
+
+    <operator dist="@popPriorDist" indicators="@indicators" spec="beast.evolution.tree.coalescent.SampleOffValues" values="@popSizes" weight="15.0"/>
+
+    <operator degreesOfFreedom="1" indicator="@indicators" parameter="@popSizes" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.5" spec="ScaleOperator" weight="15.0"/>
+
+    <operator degreesOfFreedom="1" parameter="@populationMean" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.9" spec="ScaleOperator" weight="3.0"/>
+
+    <operator scaleFactor="0.7" spec="UpDownOperator" weight="5.0">
+        <up idref="popSizes"/>
+        <up idref="populationMean"/>
+    </operator>
+
+    <operator degreesOfFreedom="1" parameter="@hky000.kappa" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.5" spec="ScaleOperator" weight="2.0"/>
+
+    <operator degreesOfFreedom="1" parameter="@hky003.kappa" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.5" spec="ScaleOperator" weight="2.0"/>
+
+    <operator id="treeModel000(uniform)" spec="Uniform" tree="@treeModel000" weight="10.0"/>
+
+    <operator degreesOfFreedom="1" id="treeModel000(scaleOperator)" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.5" spec="ScaleOperator" tree="@treeModel000" weight="5.0"/>
+
+    <operator gaussian="true" id="treeModel000(subtreeSlide)" size="1.0" spec="SubtreeSlide" tree="@treeModel000" weight="5.0"/>
+
+    <operator id="treeModel000(narrow)" isNarrow="true" spec="Exchange" tree="@treeModel000" weight="1.0"/>
+
+    <operator id="treeModel000(wide)" isNarrow="false" spec="Exchange" tree="@treeModel000" weight="1.0"/>
+
+    <operator id="treeModel000(wilsonBalding)" spec="WilsonBalding" tree="@treeModel000" weight="1.0"/>
+
+    <operator id="treeModel001(uniform)" spec="Uniform" tree="@treeModel001" weight="10.0"/>
+
+    <operator degreesOfFreedom="1" id="treeModel001(scaleOperator)" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.5" spec="ScaleOperator" tree="@treeModel001" weight="5.0"/>
+
+    <operator gaussian="true" id="treeModel001(subtreeSlide)" size="1.0" spec="SubtreeSlide" tree="@treeModel001" weight="5.0"/>
+
+    <operator id="treeModel001(narrow)" isNarrow="true" spec="Exchange" tree="@treeModel001" weight="1.0"/>
+
+    <operator id="treeModel001(wide)" isNarrow="false" spec="Exchange" tree="@treeModel001" weight="1.0"/>
+
+    <operator id="treeModel001(wilsonBalding)" spec="WilsonBalding" tree="@treeModel001" weight="1.0"/>
+
+    <operator id="treeModel002(uniform)" spec="Uniform" tree="@treeModel002" weight="10.0"/>
+
+    <operator degreesOfFreedom="1" id="treeModel002(scaleOperator)" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.5" spec="ScaleOperator" tree="@treeModel002" weight="5.0"/>
+
+    <operator gaussian="true" id="treeModel002(subtreeSlide)" size="1.0" spec="SubtreeSlide" tree="@treeModel002" weight="5.0"/>
+
+    <operator id="treeModel002(narrow)" isNarrow="true" spec="Exchange" tree="@treeModel002" weight="1.0"/>
+
+    <operator id="treeModel002(wide)" isNarrow="false" spec="Exchange" tree="@treeModel002" weight="1.0"/>
+
+    <operator id="treeModel002(wilsonBalding)" spec="WilsonBalding" tree="@treeModel002" weight="1.0"/>
+
+    <operator id="treeModel003(uniform)" spec="Uniform" tree="@treeModel003" weight="10.0"/>
+
+    <operator degreesOfFreedom="1" id="treeModel003(scaleOperator)" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.5" spec="ScaleOperator" tree="@treeModel003" weight="5.0"/>
+
+    <operator gaussian="true" id="treeModel003(subtreeSlide)" size="1.0" spec="SubtreeSlide" tree="@treeModel003" weight="5.0"/>
+
+    <operator id="treeModel003(narrow)" isNarrow="true" spec="Exchange" tree="@treeModel003" weight="1.0"/>
+
+    <operator id="treeModel003(wide)" isNarrow="false" spec="Exchange" tree="@treeModel003" weight="1.0"/>
+
+    <operator id="treeModel003(wilsonBalding)" spec="WilsonBalding" tree="@treeModel003" weight="1.0"/>
+
+    <logger logEvery="5000" mode="autodetect">
+        <log idref="posterior"/>
+        <log idref="likelihood"/>
+        <log idref="coalescent"/>
+        <log idref="populationMean"/>
+        <log idref="hky000.kappa"/>
+        <log idref="hky003.kappa"/>
+        <log spec="util.Sum" arg="@indicators"/>
+        <log idref="treeLikelihood000"/>
+        <log idref="treeLikelihood001"/>
+        <log idref="treeLikelihood002"/>
+        <log idref="treeLikelihood003"/>
+    </logger>
+
+    <logger fileName="testEBSP.$(seed).log" log="@indicators" logEvery="5000" mode="autodetect" model="@posterior">
+        <log idref="posterior"/>
+        <log idref="likelihood"/>
+        <log idref="coalescent"/>
+        <log idref="populationMean"/>
+        <log idref="hky000.kappa"/>
+        <log idref="hky003.kappa"/>
+        <log spec="util.Sum" arg="@indicators"/>
+        <log spec="beast.evolution.tree.TreeHeightLogger" tree="@treeModel000"/>
+        <log spec="beast.evolution.tree.TreeHeightLogger" tree="@treeModel001"/>
+        <log spec="beast.evolution.tree.TreeHeightLogger" tree="@treeModel002"/>
+        <log spec="beast.evolution.tree.TreeHeightLogger" tree="@treeModel003"/>
+        <log idref="treeLikelihood000"/>
+        <log idref="treeLikelihood001"/>
+        <log idref="treeLikelihood002"/>
+        <log idref="treeLikelihood003"/>
+        <log idref="popSizes"/>
+    </logger>
+
+<!--
+    <logger fileName="demographic.$(seed).log" logEvery="5000" mode="autodetect">
+        <log idref='popSizes'/>
+        <log idref='indicators'/>
+        <log idref="demographic"/>
+    </logger>
+-->
+    <logger fileName="treeModel000.$(seed).trees" logEvery="5000" mode="autodetect">
+        <log idref="treeModel000"/>
+    </logger>
+
+    <logger fileName="treeModel001.$(seed).trees" logEvery="5000" mode="autodetect">
+        <log idref="treeModel001"/>
+    </logger>
+
+    <logger fileName="treeModel002.$(seed).trees" logEvery="5000" mode="autodetect">
+        <log idref="treeModel002"/>
+    </logger>
+
+    <logger fileName="treeModel003.$(seed).trees" logEvery="5000" mode="autodetect">
+        <log idref="treeModel003"/>
+    </logger>
+
+    <logger fileName='EBSP.$(seed).log' logEvery='5000'>
+        <log idref='demographic'/>
+    </logger>
+
+</run>
+
+</beast>
diff --git a/examples/testExponentialGrowth.xml b/examples/testExponentialGrowth.xml
new file mode 100644
index 0000000..480828d
--- /dev/null
+++ b/examples/testExponentialGrowth.xml
@@ -0,0 +1,213 @@
+<beast version='2.0'
+       namespace='beast.evolution.alignment:beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood'>
+
+
+    <!-- The sequence alignment (each sequence refers to a taxon above).         -->
+    <!-- ntax=6 nchar=768                                                        -->
+    <!-- npatterns=69                                                            -->
+    <data id="alignment" dataType="nucleotide">
+        <sequence taxon="human">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="chimp">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="bonobo">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAGC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTTGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="gorilla">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTAAACATAGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA-CAACACTTAATTTCTGTAAGGACTGCAAAACCCTACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCAATGGGACTCAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAT-TCAC [...]
+        </sequence>
+        <sequence taxon="orangutan">
+            AGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA-CAGCACTTAATTTCTGTAAGGACTGCAAAACCCCACTTTGCATCAACTGAGCGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCCTAGACCGATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAT-TGGCTTCAGTCCAAAGCCCCGGCAGGCCTTAAAGCTGCTCCTTCGAATTTGCAATTCAACATGACAA-TCAC [...]
+        </sequence>
+        <sequence taxon="siamang">
+            AGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTAACAAAACTTAATTTCTGCAAGGGCTGCAAAACCCTACTTTGCATCAACCGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCGATGGGACTTAAACCCATAAAAATTTAGTTAACAGCTAAACACCCTAAACAACCTGGCTTCAATCTAAAGCCCCGGCAGA-GTTGAAGCTGCTTCTTTGAACTTGCAATTCAACGTGAAAAATCAC [...]
+        </sequence>
+    </data>
+
+    <!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+    <input spec='HKY' id="hky">
+        <parameter name='kappa' idref='hky.kappa'/>
+        <input id='freqs' name='frequencies' spec='Frequencies'>
+            <input name='data' idref='alignment'/>
+        </input>
+    </input>
+
+    <!-- site model                                                              -->
+    <input spec='SiteModel' id="siteModel">
+        <!--<parameter name='mutationRate'>1.0</parameter>-->
+        <input name='substModel' idref='hky'/>
+    </input>
+
+    <input spec='TreeLikelihood' id="treeLikelihood">
+        <input name='data' idref="alignment"/>
+        <input name='tree' idref="tree"/>
+        <input name='siteModel' idref="siteModel"/>
+    </input>
+
+
+    <input spec='beast.util.ClusterTree' id='tree' clusterType='upgma'>
+        <input name='taxa' idref='alignment'/>
+    </input>
+
+    <input spec='beast.core.parameter.RealParameter' id="hky.kappa">1.0</input>
+
+    <parameter id="popSize">1.0</parameter>
+    <parameter id="growthRate">1.0</parameter>
+
+    <taxonset spec='TaxonSet' id='taxonset'>
+        <taxon spec='Taxon' id="'20_0.95_2'"/>
+        <taxon spec='Taxon' id="'34_2.19_0'"/>
+        <taxon spec='Taxon' id="'149_3.33_2'"/>
+        <taxon spec='Taxon' id="'191_3.13_2'"/>
+        <taxon spec='Taxon' id="'248_2.96_0'"/>
+        <taxon spec='Taxon' id="'289_4.39_0'"/>
+        <taxon spec='Taxon' id="'367_1.2_1'"/>
+        <taxon spec='Taxon' id="'403_9.78_2'"/>
+        <taxon spec='Taxon' id="'439_4.11_1'"/>
+        <taxon spec='Taxon' id="'480_6.8_2'"/>
+        <taxon spec='Taxon' id="'552_2.05_0'"/>
+        <taxon spec='Taxon' id="'622_1.33_2'"/>
+        <taxon spec='Taxon' id="'637_2.03_2'"/>
+        <taxon spec='Taxon' id="'645_1.38_2'"/>
+        <taxon spec='Taxon' id="'653_2.38_2'"/>
+        <taxon spec='Taxon' id="'764_3.51_1'"/>
+        <taxon spec='Taxon' id="'793_1.39_0'"/>
+        <taxon spec='Taxon' id="'827_1.32_1'"/>
+        <taxon spec='Taxon' id="'902_1.67_1'"/>
+        <taxon spec='Taxon' id="'942_1.81_1'"/>
+        <taxon spec='Taxon' id="'1039_3.06_1'"/>
+        <taxon spec='Taxon' id="'1117_1.66_1'"/>
+        <taxon spec='Taxon' id="'1149_3.5_0'"/>
+        <taxon spec='Taxon' id="'1381_4.16_2'"/>
+        <taxon spec='Taxon' id="'1385_3.98_2'"/>
+        <taxon spec='Taxon' id="'1421_1.45_2'"/>
+        <taxon spec='Taxon' id="'1449_1.28_2'"/>
+        <taxon spec='Taxon' id="'1521_2.04_1'"/>
+        <taxon spec='Taxon' id="'1558_8.23_1'"/>
+        <taxon spec='Taxon' id="'1610_5.53_1'"/>
+        <taxon spec='Taxon' id="'1612_2.55_1'"/>
+        <taxon spec='Taxon' id="'1694_1.48_1'"/>
+        <taxon spec='Taxon' id="'1702_3.39_1'"/>
+        <taxon spec='Taxon' id="'1768_7.42_0'"/>
+        <taxon spec='Taxon' id="'1838_1.95_1'"/>
+        <taxon spec='Taxon' id="'1925_1.54_1'"/>
+        <taxon spec='Taxon' id="'2006_4.07_0'"/>
+        <taxon spec='Taxon' id="'2020_1.62_0'"/>
+        <taxon spec='Taxon' id="'2035_2.59_0'"/>
+        <taxon spec='Taxon' id="'2044_2.25_0'"/>
+        <taxon spec='Taxon' id="'2119_2.39_2'"/>
+        <taxon spec='Taxon' id="'2147_3.18_0'"/>
+        <taxon spec='Taxon' id="'2169_2.29_0'"/>
+        <taxon spec='Taxon' id="'2197_2.49_0'"/>
+        <taxon spec='Taxon' id="'2228_1.81_0'"/>
+        <taxon spec='Taxon' id="'2382_1.32_0'"/>
+        <taxon spec='Taxon' id="'2463_3.51_0'"/>
+        <taxon spec='Taxon' id="'2487_1.74_0'"/>
+        <taxon spec='Taxon' id="'2507_8.01_1'"/>
+        <taxon spec='Taxon' id="'2534_1.86_0'"/>
+        <taxon spec='Taxon' id="'2579_2.75_0'"/>
+        <taxon spec='Taxon' id="'2620_2.75_0'"/>
+        <taxon spec='Taxon' id="'2639_2.21_0'"/>
+        <taxon spec='Taxon' id="'2665_1.75_0'"/>
+        <taxon spec='Taxon' id="'2708_1.97_0'"/>
+        <taxon spec='Taxon' id="'2793_2.56_1'"/>
+        <taxon spec='Taxon' id="'2801_1.66_1'"/>
+        <taxon spec='Taxon' id="'2915_1.43_2'"/>
+        <taxon spec='Taxon' id="'2921_4.02_2'"/>
+        <taxon spec='Taxon' id="'2975_2.36_1'"/>
+    </taxonset>
+
+
+    <run spec="MCMC" id="mcmc" chainLength="1000000"> <!--autoOptimize="true"-->
+        <state>
+            <!--
+                        <tree spec='util.TreeParser' id='tree'>
+                            <input name='newick'>((5:0.04847887618847128,(3:0.03189934232093919,((2:0.011076861832266626,1:0.011076861832266626):0.009810542752873795,4:0.02088740458514042):0.011011937735798769):0.01657953386753209):0.017232517763959114,6:0.06571139395243039);</input>
+                           <input name='taxa' idref='alignment'/>
+                        </tree>
+            -->
+            <input name='stateNode' idref='hky.kappa'/>
+            <input name='stateNode' idref='popSize'/>
+            <input name='stateNode' idref='growthRate'/>
+            <input name='stateNode' idref='tree'/>
+
+
+    <stateNode spec='beast.util.TreeParser' id='tree3' singlechild='true' IsLabelledNewick='true'>
+        <input name='newick'>
+            <![CDATA[
+                (((("2_1_8.52"[&state="1"]:0.9513638109565195)[&state="0"]:0.3187954324401767)[&state="0"]:1.6166559757752683)[&state="1"]:0.7340511267332372, (((((((((((((((((("46_2_19.01"[&state="2"]:1.7435336921954985)[&state="2"]:0.603421040396551)[&state="2"]:0.41172178394915804, ("48_2_20.97"[&state="2"]:2.8732359693779017)[&state="2"]:1.848516886257876)[&state="2"]:0.37758919572537764)[&state="2"]:0.5078870774740754)[&state="2"]:1.3806726536517768, "59_0_16.54"[&state="0"]:2.55600 [...]
+           ]]>
+        </input>
+    </stateNode>
+<!--
+    <stateNode spec='beast.util.TreeParser' id='tree2' singlechild='true' IsLabelledNewick='true'
+newick='            ((((((((((((('20_0.95_2'[&ampstate="2"]:0.027124271996372462)[&ampstate="2"]:0.12341614346202234)[&ampstate="2"]:0.00472060636769378)[&ampstate="2"]:0.02017696004447045)[&ampstate="2"]:0.29630811973994975)[&ampstate="2"]:0.2261714903175604,((((('34_2.19_0'[&ampstate="0"]:1.2113355253435147)[&ampstate="2"]:0.10404538058169166)[&ampstate="2"]:0.14636667603867992)[&ampstate="2"]:0.11324446751523409)[&ampstat [...]
+        <taxonset idref='taxonset'/>
+</stateNode>
+-->
+        </state>
+
+        <distribution spec="CompoundDistribution" id="posterior">
+            <distribution id="coalescent" spec="Coalescent">
+                <treeIntervals spec='TreeIntervals' id='TreeIntervals'>
+                     <tree idref="tree"/>
+                </treeIntervals>
+                <populationModel spec="ExponentialGrowth">
+                    <parameter name="popSize" idref="popSize"/>
+                    <parameter name="growthRate" idref="growthRate"/>
+                </populationModel>
+            </distribution>
+            <distribution id='likelihood' idref="treeLikelihood"/>
+        </distribution>
+
+        <operator id='kappaScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1">
+            <parameter idref="hky.kappa"/>
+        </operator>
+        <operator id='popSizeScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1">
+            <parameter idref="popSize"/>
+        </operator>
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1">
+            <tree idref="tree"/>
+        </operator>
+        <operator spec='Uniform' weight="10">
+            <tree idref="tree"/>
+        </operator>
+        <operator spec='SubtreeSlide' weight="5" gaussian="true" size="1.0">
+            <tree idref="tree"/>
+        </operator>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="1">
+            <tree idref="tree"/>
+        </operator>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="1">
+            <tree idref="tree"/>
+        </operator>
+        <operator spec='WilsonBalding' weight="1">
+            <tree idref="tree"/>
+        </operator>
+
+        <logger logEvery="10000">
+	        <model idref='posterior'/>
+            <log idref="coalescent"/>
+            <log idref="likelihood"/>
+            <!--parameter idref="treeModel.rootHeight"/-->
+            <log idref="popSize"/>
+            <log idref="hky.kappa"/>
+            <log idref="posterior"/>
+        </logger>
+        <logger logEvery="10000" fileName="test.$(seed).log">
+   	        <model idref='posterior'/>
+            <log idref="coalescent"/>
+            <log idref="likelihood"/>
+            <!--parameter idref="treeModel.rootHeight"/-->
+            <log idref="popSize"/>
+            <log idref="hky.kappa"/>
+            <log idref="posterior"/>
+        </logger>
+        <logger logEvery="10000" fileName="test.$(seed).trees">
+            <log idref="tree"/>
+        </logger>
+    </run>
+
+</beast>
diff --git a/examples/testGTR.xml b/examples/testGTR.xml
new file mode 100644
index 0000000..fba5c68
--- /dev/null
+++ b/examples/testGTR.xml
@@ -0,0 +1,211 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<beast beautitemplate='Standard' beautistatus=''
+       namespace="beast.core:beast.evolution.alignment:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood"
+       version="2.0">
+
+
+    <data id="primate-mtDNA">
+        <sequence id="seq_Lemur_catta" taxon="Lemur_catta" totalcount="4"
+                  value="AAGCTTCATAGGAGCAACCATTCTAATAATCGCACATGGCCTTACATCATCCATATTATTCTGTCTAGCCAACTCTAACTACGAACGAATCCATAGCCGTACAATACTACTAGCACGAGGGATCCAAACCATTCTCCCTCTTATAGCCACCTGATGACTACTCGCCAGCCTAACTAACCTAGCCCTACCCACCTCTATCAATTTAATTGGCGAACTATTCGTCACTATAGCATCCTTCTCATGATCAAACATTACAATTATCTTAATAGGCTTAAATATGCTCATCACCGCTCTCTATTCCCTCTATATATTAACTACTACACAACGAGGAAAACTCACATATCATTCGCACAACCTAAACCCATCCTTTACACGAGAAAACACCCTTATATCCATACACATACTCCCCCTTCTCCTATTTACCTTAAACCCCAAAATTATTCTAGGACCCACGTACTGTAAATATA [...]
+        <sequence id="seq_Homo_sapiens" taxon="Homo_sapiens" totalcount="4"
+                  value="AAGCTTCACCGGCGCAGTCATTCTCATAATCGCCCACGGGCTTACATCCTCATTACTATTCTGCCTAGCAAACTCAAACTACGAACGCACTCACAGTCGCATCATAATCCTCTCTCAAGGACTTCAAACTCTACTCCCACTAATAGCTTTTTGATGACTTCTAGCAAGCCTCGCTAACCTCGCCTTACCCCCCACTATTAACCTACTGGGAGAACTCTCTGTGCTAGTAACCACGTTCTCCTGATCAAATATCACTCTCCTACTTACAGGACTCAACATACTAGTCACAGCCCTATACTCCCTCTACATATTTACCACAACACAATGGGGCTCACTCACCCACCACATTAACAACATAAAACCCTCATTCACACGAGAAAACACCCTCATGTTCATACACCTATCCCCCATTCTCCTCCTATCCCTCAACCCCGACATCATTACCGGGTTTTCCTCTTGTAAATATA [...]
+        <sequence id="seq_Pan" taxon="Pan" totalcount="4"
+                  value="AAGCTTCACCGGCGCAATTATCCTCATAATCGCCCACGGACTTACATCCTCATTATTATTCTGCCTAGCAAACTCAAATTATGAACGCACCCACAGTCGCATCATAATTCTCTCCCAAGGACTTCAAACTCTACTCCCACTAATAGCCTTTTGATGACTCCTAGCAAGCCTCGCTAACCTCGCCCTACCCCCTACCATTAATCTCCTAGGGGAACTCTCCGTGCTAGTAACCTCATTCTCCTGATCAAATACCACTCTCCTACTCACAGGATTCAACATACTAATCACAGCCCTGTACTCCCTCTACATGTTTACCACAACACAATGAGGCTCACTCACCCACCACATTAATAACATAAAGCCCTCATTCACACGAGAAAATACTCTCATATTTTTACACCTATCCCCCATCCTCCTTCTATCCCTCAATCCTGATATCATCACTGGATTCACCTCCTGTAAATATA [...]
+        <sequence id="seq_Gorilla" taxon="Gorilla" totalcount="4"
+                  value="AAGCTTCACCGGCGCAGTTGTTCTTATAATTGCCCACGGACTTACATCATCATTATTATTCTGCCTAGCAAACTCAAACTACGAACGAACCCACAGCCGCATCATAATTCTCTCTCAAGGACTCCAAACCCTACTCCCACTAATAGCCCTTTGATGACTTCTGGCAAGCCTCGCCAACCTCGCCTTACCCCCCACCATTAACCTACTAGGAGAGCTCTCCGTACTAGTAACCACATTCTCCTGATCAAACACCACCCTTTTACTTACAGGATCTAACATACTAATTACAGCCCTGTACTCCCTTTATATATTTACCACAACACAATGAGGCCCACTCACACACCACATCACCAACATAAAACCCTCATTTACACGAGAAAACATCCTCATATTCATGCACCTATCCCCCATCCTCCTCCTATCCCTCAACCCCGATATTATCACCGGGTTCACCTCCTGTAAATATA [...]
+        <sequence id="seq_Pongo" taxon="Pongo" totalcount="4"
+                  value="AAGCTTCACCGGCGCAACCACCCTCATGATTGCCCATGGACTCACATCCTCCCTACTGTTCTGCCTAGCAAACTCAAACTACGAACGAACCCACAGCCGCATCATAATCCTCTCTCAAGGCCTTCAAACTCTACTCCCCCTAATAGCCCTCTGATGACTTCTAGCAAGCCTCACTAACCTTGCCCTACCACCCACCATCAACCTTCTAGGAGAACTCTCCGTACTAATAGCCATATTCTCTTGATCTAACATCACCATCCTACTAACAGGACTCAACATACTAATCACAACCCTATACTCTCTCTATATATTCACCACAACACAACGAGGTACACCCACACACCACATCAACAACATAAAACCTTCTTTCACACGCGAAAATACCCTCATGCTCATACACCTATCCCCCATCCTCCTCTTATCCCTCAACCCCAGCATCATCGCTGGGTTCGCCTACTGTAAATATA [...]
+        <sequence id="seq_Hylobates" taxon="Hylobates" totalcount="4"
+                  value="AAGCTTTACAGGTGCAACCGTCCTCATAATCGCCCACGGACTAACCTCTTCCCTGCTATTCTGCCTTGCAAACTCAAACTACGAACGAACTCACAGCCGCATCATAATCCTATCTCGAGGGCTCCAAGCCTTACTCCCACTGATAGCCTTCTGATGACTCGCAGCAAGCCTCGCTAACCTCGCCCTACCCCCCACTATTAACCTCCTAGGTGAACTCTTCGTACTAATGGCCTCCTTCTCCTGGGCAAACACTACTATTACACTCACCGGGCTCAACGTACTAATCACGGCCCTATACTCCCTTTACATATTTATCATAACACAACGAGGCACACTTACACACCACATTAAAAACATAAAACCCTCACTCACACGAGAAAACATATTAATACTTATGCACCTCTTCCCCCTCCTCCTCCTAACCCTCAACCCTAACATCATTACTGGCTTTACTCCCTGTAAACATA [...]
+        <sequence id="seq_Macaca_fuscata" taxon="Macaca_fuscata" totalcount="4"
+                  value="AAGCTTTTCCGGCGCAACCATCCTTATGATCGCTCACGGACTCACCTCTTCCATATATTTCTGCCTAGCCAATTCAAACTATGAACGCACTCACAACCGTACCATACTACTGTCCCGAGGACTTCAAATCCTACTTCCACTAACAGCCTTTTGATGATTAACAGCAAGCCTTACTAACCTTGCCCTACCCCCCACTATCAATCTACTAGGTGAACTCTTTGTAATCGCAACCTCATTCTCCTGATCCCATATCACCATTATGCTAACAGGACTTAACATATTAATTACGGCCCTCTACTCTCTCCACATATTCACTACAACACAACGAGGAACACTCACACATCACATAATCAACATAAAGCCCCCCTTCACACGAGAAAACACATTAATATTCATACACCTCGCTCCAATTATCCTTCTATCCCTCAACCCCAACATCATCCTGGGGTTTACCTCCTGTAGATATA [...]
+        <sequence id="seq_M._mulatta" taxon="M._mulatta" totalcount="4"
+                  value="AAGCTTTTCTGGCGCAACCATCCTCATGATTGCTCACGGACTCACCTCTTCCATATATTTCTGCCTAGCCAATTCAAACTATGAACGCACTCACAACCGTACCATACTACTGTCCCGGGGACTTCAAATCCTACTTCCACTAACAGCTTTCTGATGATTAACAGCAAGCCTTACTAACCTTGCCCTACCCCCCACTATCAACCTACTAGGTGAACTCTTTGTAATCGCGACCTCATTCTCCTGGTCCCATATCACCATTATATTAACAGGATTTAACATACTAATTACGGCCCTCTACTCCCTCCACATATTCACCACAACACAACGAGGAGCACTCACACATCACATAATCAACATAAAACCCCCCTTCACACGAGAAAACATATTAATATTCATACACCTCGCTCCAATCATCCTCCTATCTCTCAACCCCAACATCATCCTGGGGTTTACTTCCTGTAGATATA [...]
+        <sequence id="seq_M._fascicularis" taxon="M._fascicularis" totalcount="4"
+                  value="AAGCTTCTCCGGCGCAACCACCCTTATAATCGCCCACGGGCTCACCTCTTCCATGTATTTCTGCTTGGCCAATTCAAACTATGAGCGCACTCATAACCGTACCATACTACTATCCCGAGGACTTCAAATTCTACTTCCATTGACAGCCTTCTGATGACTCACAGCAAGCCTTACTAACCTTGCCCTACCCCCCACTATTAATCTACTAGGCGAACTCTTTGTAATCACAACTTCATTTTCCTGATCCCATATCACCATTGTGTTAACGGGCCTTAATATACTAATCACAGCCCTCTACTCTCTCCACATGTTCATTACAGTACAACGAGGAACACTCACACACCACATAATCAATATAAAACCCCCCTTCACACGAGAAAACATATTAATATTCATACACCTCGCTCCAATTATCCTTCTATCTCTCAACCCCAACATCATCCTGGGGTTTACCTCCTGTAAATATA [...]
+        <sequence id="seq_M._sylvanus" taxon="M._sylvanus" totalcount="4"
+                  value="AAGCTTCTCCGGTGCAACTATCCTTATAGTTGCCCATGGACTCACCTCTTCCATATACTTCTGCTTGGCCAACTCAAACTACGAACGCACCCACAGCCGCATCATACTACTATCCCGAGGACTCCAAATCCTACTCCCACTAACAGCCTTCTGATGATTCACAGCAAGCCTTACTAATCTTGCTCTACCCTCCACTATTAATCTACTGGGCGAACTCTTCGTAATCGCAACCTCATTTTCCTGATCCCACATCACCATCATACTAACAGGACTGAACATACTAATTACAGCCCTCTACTCTCTTCACATATTCACCACAACACAACGAGGAGCGCTCACACACCACATAATTAACATAAAACCACCTTTCACACGAGAAAACATATTAATACTCATACACCTCGCTCCAATTATTCTTCTATCTCTTAACCCCAACATCATTCTAGGATTTACTTCCTGTAAATATA [...]
+        <sequence id="seq_Saimiri_sciureus" taxon="Saimiri_sciureus" totalcount="4"
+                  value="AAGCTTCACCGGCGCAATGATCCTAATAATCGCTCACGGGTTTACTTCGTCTATGCTATTCTGCCTAGCAAACTCAAATTACGAACGAATTCACAGCCGAACAATAACATTTACTCGAGGGCTCCAAACACTATTCCCGCTTATAGGCCTCTGATGACTCCTAGCAAATCTCGCTAACCTCGCCCTACCCACAGCTATTAATCTAGTAGGAGAATTACTCACAATCGTATCTTCCTTCTCTTGATCCAACTTTACTATTATATTCACAGGACTTAATATACTAATTACAGCACTCTACTCACTTCATATGTATGCCTCTACACAGCGAGGTCCACTTACATACAGCACCAGCAATATAAAACCAATATTTACACGAGAAAATACGCTAATATTTATACATATAACACCAATCCTCCTCCTTACCTTGAGCCCCAAGGTAATTATAGGACCCTCACCTTGTAATTATA [...]
+        <sequence id="seq_Tarsius_syrichta" taxon="Tarsius_syrichta" totalcount="4"
+                  value="AAGTTTCATTGGAGCCACCACTCTTATAATTGCCCATGGCCTCACCTCCTCCCTATTATTTTGCCTAGCAAATACAAACTACGAACGAGTCCACAGTCGAACAATAGCACTAGCCCGTGGCCTTCAAACCCTATTACCTCTTGCAGCAACATGATGACTCCTCGCCAGCTTAACCAACCTGGCCCTTCCCCCAACAATTAATTTAATCGGTGAACTGTCCGTAATAATAGCAGCATTTTCATGGTCACACCTAACTATTATCTTAGTAGGCCTTAACACCCTTATCACCGCCCTATATTCCCTATATATACTAATCATAACTCAACGAGGAAAATACACATATCATATCAACAATATCATGCCCCCTTTCACCCGAGAAAATACATTAATAATCATACACCTATTTCCCTTAATCCTACTATCTACCAACCCCAAAGTAATTATAGGAACCATGTACTGTAAATATA [...]
+    </data>
+
+
+    <map name="Beta">beast.math.distributions.Beta</map>
+    <map name="Exponential">beast.math.distributions.Exponential</map>
+    <map name="InverseGamma">beast.math.distributions.InverseGamma</map>
+    <map name="LogNormal">beast.math.distributions.LogNormalDistributionModel</map>
+    <map name="Gamma">beast.math.distributions.Gamma</map>
+    <map name="Uniform">beast.math.distributions.Uniform</map>
+    <map name="prior">beast.math.distributions.Prior</map>
+    <map name="LaplaceDistribution">beast.math.distributions.LaplaceDistribution</map>
+    <map name="OneOnX">beast.math.distributions.OneOnX</map>
+    <map name="Normal">beast.math.distributions.Normal</map>
+
+
+    <run chainLength="5000000" id="mcmc" spec="MCMC">
+        <state id="state" storeEvery="5000">
+            <tree id="Tree.t:primate" name="stateNode">
+                <taxonset id="TaxonSet.coding" spec="TaxonSet">
+                    <alignment filter="2-457,660-896" id="coding" spec="FilteredAlignment">
+                        <data idref="primate-mtDNA"/>
+                    </alignment>
+                </taxonset>
+            </tree>
+            <parameter id="birthRate.t:primate" name="stateNode" value="1.0"/>
+            <parameter id="rateAC.s:primate" lower="0.0" name="stateNode" value="1.0"/>
+            <parameter id="rateAG.s:primate" lower="0.0" name="stateNode" value="1.0"/>
+            <parameter id="rateAT.s:primate" lower="0.0" name="stateNode" value="1.0"/>
+            <parameter id="rateCG.s:primate" lower="0.0" name="stateNode" value="1.0"/>
+            <parameter id="rateGT.s:primate" lower="0.0" name="stateNode" value="1.0"/>
+            <parameter dimension="4" id="freqParameter.s:primate" lower="0.0" name="stateNode" upper="1.0"
+                       value="0.25"/>
+        </state>
+
+        <init estimate="false" id="RandomTree.t:primate" initial="@Tree.t:primate"
+              spec="beast.evolution.tree.RandomTree" taxa="@coding">
+            <populationModel id="ConstantPopulation0.t:primate" spec="ConstantPopulation">
+                <parameter id="randomPopSize.t:primate" name="popSize" value="1"/>
+            </populationModel>
+        </init>
+
+        <distribution id="posterior" spec="util.CompoundDistribution">
+            <distribution id="prior" spec="util.CompoundDistribution">
+                <distribution birthDiffRate="@birthRate.t:primate" id="YuleModel.t:primate"
+                              spec="beast.evolution.speciation.YuleModel" tree="@Tree.t:primate"/>
+                <prior id="YuleBirthRatePrior.t:primate" name="distribution" x="@birthRate.t:primate">
+                    <Uniform id="Uniform.0" name="distr" upper="Infinity"/>
+                </prior>
+                <prior id="RateACPrior.s:primate" name="distribution" x="@rateAC.s:primate">
+                    <LogNormal id="LogNormalDistributionModel.0" name="distr">
+                        <parameter estimate="false" id="RealParameter.0" name="M" value="0"/>
+                        <parameter estimate="false" id="RealParameter.01" lower="0.0" name="S" upper="5.0"
+                                   value="1.25"/>
+                    </LogNormal>
+                </prior>
+                <prior id="RateAGPrior.s:primate" name="distribution" x="@rateAG.s:primate">
+                    <LogNormal id="LogNormalDistributionModel.01" name="distr">
+                        <parameter estimate="false" id="RealParameter.02" name="M" value="0"/>
+                        <parameter estimate="false" id="RealParameter.03" lower="0.0" name="S" upper="5.0"
+                                   value="1.25"/>
+                    </LogNormal>
+                </prior>
+                <prior id="RateATPrior.s:primate" name="distribution" x="@rateAT.s:primate">
+                    <LogNormal id="LogNormalDistributionModel.02" name="distr">
+                        <parameter estimate="false" id="RealParameter.04" name="M" value="0"/>
+                        <parameter estimate="false" id="RealParameter.05" lower="0.0" name="S" upper="5.0"
+                                   value="1.25"/>
+                    </LogNormal>
+                </prior>
+                <prior id="RateCGPrior.s:primate" name="distribution" x="@rateCG.s:primate">
+                    <LogNormal id="LogNormalDistributionModel.03" name="distr">
+                        <parameter estimate="false" id="RealParameter.06" name="M" value="0"/>
+                        <parameter estimate="false" id="RealParameter.07" lower="0.0" name="S" upper="5.0"
+                                   value="1.25"/>
+                    </LogNormal>
+                </prior>
+                <prior id="RateGTPrior.s:primate" name="distribution" x="@rateGT.s:primate">
+                    <LogNormal id="LogNormalDistributionModel.04" name="distr">
+                        <parameter estimate="false" id="RealParameter.08" name="M" value="0"/>
+                        <parameter estimate="false" id="RealParameter.09" lower="0.0" name="S" upper="5.0"
+                                   value="1.25"/>
+                    </LogNormal>
+                </prior>
+            </distribution>
+            <distribution id="likelihood" spec="util.CompoundDistribution">
+                <distribution data="@coding" id="treeLikelihood.coding" spec="TreeLikelihood" tree="@Tree.t:primate">
+                    <siteModel id="SiteModel.s:primate" spec="SiteModel">
+                        <parameter estimate="false" id="mutationRate.s:primate" name="mutationRate" value="1.0"/>
+                        <parameter estimate="false" id="gammaShape.s:primate" name="shape" value="1.0"/>
+                        <parameter estimate="false" id="proportionInvariant.s:primate" lower="0.0"
+                                   name="proportionInvariant" upper="1.0" value="0.0"/>
+                        <substModel id="gtr.s:primate" rateAC="@rateAC.s:primate" rateAG="@rateAG.s:primate"
+                                    rateAT="@rateAT.s:primate" rateCG="@rateCG.s:primate" rateGT="@rateGT.s:primate"
+                                    spec="GTR">
+                            <parameter estimate="false" id="rateCT.s:primate" lower="0.0" name="rateCT" value="1.0"/>
+                            <frequencies frequencies="@freqParameter.s:primate" id="estimatedFreqs.s:primate"
+                                         spec="Frequencies"/>
+                        </substModel>
+                    </siteModel>
+                    <branchRateModel id="StrictClock.c:primate" spec="beast.evolution.branchratemodel.StrictClockModel">
+                        <parameter estimate="false" id="clockRate.c:primate" name="clock.rate" value="1.0"/>
+                    </branchRateModel>
+                </distribution>
+                <distribution branchRateModel="@StrictClock.c:primate" id="treeLikelihood.noncoding"
+                              siteModel="@SiteModel.s:primate" spec="TreeLikelihood" tree="@Tree.t:primate">
+                    <data data="@primate-mtDNA" filter="1,458-659,897-898" id="noncoding" spec="FilteredAlignment"/>
+                </distribution>
+            </distribution>
+        </distribution>
+
+        <operator id="YuleBirthRateScaler.t:primate" parameter="@birthRate.t:primate" scaleFactor="0.75"
+                  spec="ScaleOperator" weight="3.0"/>
+
+        <operator id="treeScaler.t:primate" scaleFactor="0.5" spec="ScaleOperator" tree="@Tree.t:primate" weight="3.0"/>
+
+        <operator id="treeRootScaler.t:primate" rootOnly="true" scaleFactor="0.5" spec="ScaleOperator"
+                  tree="@Tree.t:primate" weight="3.0"/>
+
+        <operator id="UniformOperator.t:primate" spec="Uniform" tree="@Tree.t:primate" weight="30.0"/>
+
+        <operator id="SubtreeSlide.t:primate" spec="SubtreeSlide" tree="@Tree.t:primate" weight="15.0"/>
+
+        <operator id="narrow.t:primate" spec="Exchange" tree="@Tree.t:primate" weight="15.0"/>
+
+        <operator id="wide.t:primate" isNarrow="false" spec="Exchange" tree="@Tree.t:primate" weight="3.0"/>
+
+        <operator id="WilsonBalding.t:primate" spec="WilsonBalding" tree="@Tree.t:primate" weight="3.0"/>
+
+        <operator id="RateACScaler.s:primate" parameter="@rateAC.s:primate" scaleFactor="0.5" spec="ScaleOperator"
+                  weight="0.1"/>
+
+        <operator id="RateAGScaler.s:primate" parameter="@rateAG.s:primate" scaleFactor="0.5" spec="ScaleOperator"
+                  weight="0.1"/>
+
+        <operator id="RateATScaler.s:primate" parameter="@rateAT.s:primate" scaleFactor="0.5" spec="ScaleOperator"
+                  weight="0.1"/>
+
+        <operator id="RateCGScaler.s:primate" parameter="@rateCG.s:primate" scaleFactor="0.5" spec="ScaleOperator"
+                  weight="0.1"/>
+
+        <operator id="RateGTScaler.s:primate" parameter="@rateGT.s:primate" scaleFactor="0.5" spec="ScaleOperator"
+                  weight="0.1"/>
+
+        <operator delta="0.01" id="FrequenciesExchanger.s:primate" spec="DeltaExchangeOperator" weight="0.1">
+            <parameter idref="freqParameter.s:primate"/>
+        </operator>
+
+        <logger fileName="primate-mtDNA.log" id="tracelog" logEvery="5000" model="@posterior" sanitiseHeaders="true"
+                sort="smart">
+            <log idref="posterior"/>
+            <log idref="likelihood"/>
+            <log idref="prior"/>
+            <log idref="treeLikelihood.noncoding"/>
+            <log idref="treeLikelihood.coding"/>
+            <log id="TreeHeight.t:primate" spec="beast.evolution.tree.TreeHeightLogger" tree="@Tree.t:primate"/>
+            <log idref="YuleModel.t:primate"/>
+            <parameter idref="birthRate.t:primate" name="log"/>
+            <parameter idref="rateAC.s:primate" name="log"/>
+            <parameter idref="rateAG.s:primate" name="log"/>
+            <parameter idref="rateAT.s:primate" name="log"/>
+            <parameter idref="rateCG.s:primate" name="log"/>
+            <parameter idref="rateGT.s:primate" name="log"/>
+            <parameter idref="freqParameter.s:primate" name="log"/>
+        </logger>
+
+        <logger id="screenlog" logEvery="5000">
+            <log idref="posterior"/>
+            <log arg="@posterior" id="ESS.0" spec="util.ESS"/>
+            <log idref="likelihood"/>
+            <log idref="prior"/>
+        </logger>
+
+        <logger fileName="$(tree).trees" id="treelog.t:primate" logEvery="5000" mode="tree">
+            <log id="TreeWithMetaDataLogger.t:primate" spec="beast.evolution.tree.TreeWithMetaDataLogger"
+                 tree="@Tree.t:primate"/>
+        </logger>
+
+    </run>
+
+</beast>
diff --git a/examples/testHKY.json b/examples/testHKY.json
new file mode 100644
index 0000000..64e8189
--- /dev/null
+++ b/examples/testHKY.json
@@ -0,0 +1,87 @@
+{version: "2.0",
+namespace: "beast.core:beast.evolution.alignment:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood",
+
+analysis: [
+	{id: "alignment.org",
+	 spec: "Alignment",
+	 bonobo    :"AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAGC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTTGAATTTGCAATTCAATATGAAAA-TC [...]
+	 chimp     :"AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TC [...]
+	 gorilla   :"AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTAAACATAGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA-CAACACTTAATTTCTGTAAGGACTGCAAAACCCTACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCAATGGGACTCAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAT-TC [...]
+	 human     :"AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TC [...]
+	 orangutan :"AGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA-CAGCACTTAATTTCTGTAAGGACTGCAAAACCCCACTTTGCATCAACTGAGCGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCCTAGACCGATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAT-TGGCTTCAGTCCAAAGCCCCGGCAGGCCTTAAAGCTGCTCCTTCGAATTTGCAATTCAACATGACAA-TC [...]
+	 siamang   :"AGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTAACAAAACTTAATTTCTGCAAGGGCTGCAAAACCCTACTTTGCATCAACCGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCGATGGGACTTAAACCCATAAAAATTTAGTTAACAGCTAAACACCCTAAACAACCTGGCTTCAATCTAAAGCCCCGGCAGA-GTTGAAGCTGCTTCTTTGAACTTGCAATTCAACGTGAAAAATC [...]
+	},
+
+	{id: "mcmc",
+	 spec: "MCMC", chainLength: 10000000,
+	 state: { storeEvery: 100000,
+		 stateNode: [
+			 {id: "hky.kappa", spec: "parameter.RealParameter", lower: 0.0, value: [ 1.0 ] },
+			 {id: "tree", spec: "beast.evolution.tree.Tree" }
+		  ]
+		},
+	 init: [
+		{id: "coalescentSimulator",
+		 spec: "beast.evolution.tree.RandomTree", initial: "@tree",
+		 taxa: {id: "alignment",
+			 spec: "FilteredAlignment", filter: "::", data: "@alignment.org",
+				 constantSiteWeights: { lower: 0, upper: 0, dimension: 4, value: [ 100, 200, 300, 400 ] }
+			},
+		 populationModel: {spec: "ConstantPopulation",
+				 popSize: { value: [ 1.0 ] }
+			}
+		}
+	  ],
+	 distribution: {id: "posterior",
+		 spec: "util.CompoundDistribution",
+		 distribution: [
+			{spec: "beast.math.distributions.Prior", x: "@hky.kappa",
+				 distr: {spec: "beast.math.distributions.OneOnX" }
+			},
+			{id: "treeLikelihood",
+			 spec: "TreeLikelihood", data: "@alignment", tree: "@tree",
+			 siteModel: {id: "siteModel",
+				 spec: "SiteModel", gammaCategoryCount: 1,
+				 substModel: {id: "hky",
+					 spec: "HKY", kappa: "@hky.kappa",
+						 frequencies: {id: "freqs", data: "@alignment" }
+					}
+				}
+			}
+		  ]
+		},
+	 operator: [
+		 {id: "kappaScaler", spec: "ScaleOperator", parameter: "@hky.kappa", scaleFactor: 0.5, weight: 1.0 },
+		 {id: "treeScaler", spec: "ScaleOperator", tree: "@tree", scaleFactor: 0.5, weight: 1.0 },
+		 {id: "subtreeSlide1", spec: "SubtreeSlide", tree: "@tree", weight: 5.0 },
+		 {id: "uniform", spec: "Uniform", tree: "@tree", weight: 10.0 },
+		 {id: "subtreeSlide2", spec: "SubtreeSlide", optimise: false, tree: "@tree", weight: 5.0 },
+		 {id: "narrow", spec: "Exchange", tree: "@tree", weight: 1.0 },
+		 {id: "wide", spec: "Exchange", isNarrow: false, tree: "@tree", weight: 1.0 },
+		 {id: "wilsonBalding", spec: "WilsonBalding", tree: "@tree", weight: 1.0 }
+	  ],
+	 logger: [
+		{ fileName: "test.$(seed).log", logEvery: 10000, model: "@treeLikelihood",
+		 log: [
+			 {idref: "treeLikelihood" },
+			 {idref: "hky.kappa" },
+			 {spec: "beast.evolution.tree.TreeHeightLogger", tree: "@tree" }
+		  ]
+		},
+		{ fileName: "test.$(seed).trees", logEvery: 10000,
+		 log: [
+			 {idref: "tree" }
+		  ]
+		},
+		{ logEvery: 10000, model: "@treeLikelihood",
+		 log: [
+			 {idref: "treeLikelihood" },
+			 {spec: "util.ESS", arg: "@treeLikelihood" },
+			 {idref: "hky.kappa" },
+			 {spec: "util.ESS", arg: "@hky.kappa" }
+		  ]
+		}
+	  ]
+	}
+]
+}
diff --git a/examples/testHKY.xml b/examples/testHKY.xml
new file mode 100644
index 0000000..c8acb9b
--- /dev/null
+++ b/examples/testHKY.xml
@@ -0,0 +1,104 @@
+<beast version='2.0'
+       namespace='beast.evolution.alignment:beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood'>
+
+
+    <!-- The sequence alignment                                                  -->
+    <!-- ntax=6 nchar=768                                                        -->
+    <!-- npatterns=69                                                            -->
+    <data id="alignment" dataType="nucleotide">
+        <sequence taxon="human">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="chimp">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="bonobo">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAGC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTTGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="gorilla">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTAAACATAGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA-CAACACTTAATTTCTGTAAGGACTGCAAAACCCTACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCAATGGGACTCAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAT-TCAC [...]
+        </sequence>
+        <sequence taxon="orangutan">
+            AGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA-CAGCACTTAATTTCTGTAAGGACTGCAAAACCCCACTTTGCATCAACTGAGCGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCCTAGACCGATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAT-TGGCTTCAGTCCAAAGCCCCGGCAGGCCTTAAAGCTGCTCCTTCGAATTTGCAATTCAACATGACAA-TCAC [...]
+        </sequence>
+        <sequence taxon="siamang">
+            AGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTAACAAAACTTAATTTCTGCAAGGGCTGCAAAACCCTACTTTGCATCAACCGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCGATGGGACTTAAACCCATAAAAATTTAGTTAACAGCTAAACACCCTAAACAACCTGGCTTCAATCTAAAGCCCCGGCAGA-GTTGAAGCTGCTTCTTTGAACTTGCAATTCAACGTGAAAAATCAC [...]
+        </sequence>
+    </data>
+
+    <!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+    <input spec='HKY' id='hky'>
+        <kappa idref='hky.kappa'/>
+        <frequencies id='freqs' spec='Frequencies'>
+            <data idref='alignment'/>
+        </frequencies>
+    </input>
+
+    <!-- site model                                                              -->
+    <input spec='SiteModel' id="siteModel" gammaCategoryCount='1'>
+        <!--
+            <parameter name='shape' id='shape' value='0.5'/>
+            <parameter name='proportionInvariant' id='propInvar' value='0.2'/>
+        -->
+        <substModel idref='hky'/>
+    </input>
+
+    <input spec='TreeLikelihood' id="treeLikelihood">
+        <data idref="alignment"/>
+        <tree idref="tree"/>
+        <siteModel idref="siteModel"/>
+    </input>
+
+    <parameter id="hky.kappa" value="1.0" lower="0.0"/>
+
+    <tree id='tree'/>
+
+    <tree spec='beast.util.ClusterTree' id='upgmatree' clusterType='upgma' initial='@tree'>
+        <taxa idref='alignment'/>
+    </tree>
+    <tree spec='beast.evolution.tree.RandomTree' id='coalescentSimulator' initial='@tree' taxa='@alignment'>
+        <populationModel spec='ConstantPopulation'>
+            <popSize spec='parameter.RealParameter' value='1'/>
+        </populationModel>
+    </tree>
+
+
+    <run spec="MCMC" id="mcmc" chainLength="5000000" preBurnin="50000">
+
+        <init idref='coalescentSimulator'/>
+        <distribution spec='CompoundDistribution' id='posterior'>
+            <distribution spec='beast.math.distributions.Prior' x='@hky.kappa'>
+                <distr spec='beast.math.distributions.OneOnX'/>
+            </distribution>
+            <distribution id='likelihood' idref="treeLikelihood"/>
+        </distribution>
+
+        <operator id='kappaScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" parameter="@hky.kappa"/>
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" tree="@tree"/>
+
+        <operator id='subtreeSlide' spec='SubtreeSlide' weight="5" gaussian="true" size="1.0" tree="@tree"/>
+
+        <operator id='uniform' spec='Uniform' weight="10" tree="@tree"/>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="1" tree="@tree"/>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="1" tree="@tree"/>
+        <operator id='wilsonBalding' spec='WilsonBalding' weight="1" tree="@tree"/>
+
+        <logger logEvery="10000" fileName="test.$(seed).log">
+            <model idref='likelihood'/>
+            <log idref="likelihood"/>
+            <log idref='hky.kappa'/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+        </logger>
+        <logger logEvery="10000" fileName="test.$(seed).trees">
+            <log idref="tree"/>
+        </logger>
+        <logger logEvery="10000">
+            <model idref='likelihood'/>
+            <log idref="likelihood"/>
+            <ESS spec='ESS' name='log' arg="@likelihood"/>
+            <log idref='hky.kappa'/>
+            <ESS spec='ESS' name='log' arg="@hky.kappa"/>
+        </logger>
+    </run>
+
+</beast>
diff --git a/examples/testJukesCantor.xml b/examples/testJukesCantor.xml
new file mode 100644
index 0000000..f0eb9a1
--- /dev/null
+++ b/examples/testJukesCantor.xml
@@ -0,0 +1,85 @@
+<beast version='2.0'
+       namespace='beast.evolution.alignment:beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood'>
+
+
+    <!-- The sequence alignment                                                  -->
+    <!-- ntax=6 nchar=768                                                        -->
+    <!-- npatterns=69                                                            -->
+    <data id="alignment" dataType="nucleotide">
+        <sequence taxon="human">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="chimp">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="bonobo">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAGC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTTGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="gorilla">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTAAACATAGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA-CAACACTTAATTTCTGTAAGGACTGCAAAACCCTACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCAATGGGACTCAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAT-TCAC [...]
+        </sequence>
+        <sequence taxon="orangutan">
+            AGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA-CAGCACTTAATTTCTGTAAGGACTGCAAAACCCCACTTTGCATCAACTGAGCGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCCTAGACCGATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAT-TGGCTTCAGTCCAAAGCCCCGGCAGGCCTTAAAGCTGCTCCTTCGAATTTGCAATTCAACATGACAA-TCAC [...]
+        </sequence>
+        <sequence taxon="siamang">
+            AGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTAACAAAACTTAATTTCTGCAAGGGCTGCAAAACCCTACTTTGCATCAACCGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCGATGGGACTTAAACCCATAAAAATTTAGTTAACAGCTAAACACCCTAAACAACCTGGCTTCAATCTAAAGCCCCGGCAGA-GTTGAAGCTGCTTCTTTGAACTTGCAATTCAACGTGAAAAATCAC [...]
+        </sequence>
+    </data>
+
+    <!-- The Jukes-Cantor substitution model (Jukes & Cantor, 1969)             -->
+    <input spec='JukesCantor' id='jc69'/>
+
+    <!-- site model                                                              -->
+    <input spec='SiteModel' id="siteModel" gammaCategoryCount='1'>
+        <substModel idref='jc69'/>
+    </input>
+
+    <input spec='TreeLikelihood' id="treeLikelihood">
+        <data idref="alignment"/>
+        <tree idref="tree"/>
+        <siteModel idref="siteModel"/>
+    </input>
+
+    <tree id='tree'/>
+
+    <tree spec='beast.util.ClusterTree' id='upgmatree' clusterType='upgma' initial='@tree'>
+        <taxa idref='alignment'/>
+    </tree>
+    <tree spec='beast.evolution.tree.RandomTree' id='coalescentSimulator' initial='@tree' taxa='@alignment'>
+        <populationModel spec='ConstantPopulation'>
+            <popSize spec='parameter.RealParameter' value='0.05'/>
+        </populationModel>
+    </tree>
+
+    <run spec="MCMC" id="mcmc" chainLength="5000000" preBurnin="50000">
+
+        <init idref='coalescentSimulator'/>
+        <distribution spec='CompoundDistribution' id='posterior'>
+            <distribution id='likelihood' idref="treeLikelihood"/>
+        </distribution>
+
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" tree="@tree"/>
+
+        <operator spec='SubtreeSlide' weight="5" gaussian="true" size="1.0" tree="@tree"/>
+
+        <operator spec='Uniform' weight="10" tree="@tree"/>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="1" tree="@tree"/>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="1" tree="@tree"/>
+        <operator spec='WilsonBalding' weight="1" tree="@tree"/>
+
+        <logger logEvery="1000" fileName="test.$(seed).log">
+            <model idref='likelihood'/>
+            <log idref="likelihood"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+        </logger>
+        <logger logEvery="1000" fileName="test.$(seed).trees">
+            <log idref="tree"/>
+        </logger>
+        <logger logEvery="20000">
+            <model idref='likelihood'/>
+            <log idref="likelihood"/>
+            <ESS spec='ESS' name='log' arg="@likelihood"/>
+        </logger>
+    </run>
+
+</beast>
diff --git a/examples/testJukesCantorShort.xml b/examples/testJukesCantorShort.xml
new file mode 100644
index 0000000..7b9b1fe
--- /dev/null
+++ b/examples/testJukesCantorShort.xml
@@ -0,0 +1,84 @@
+<beast version='2.0'
+       namespace='beast.evolution.alignment:beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood'>
+
+
+    <!-- A shortened version of the mitochondrial DNA alignment in testJukesCantor.xml, leading to higher uncertainty regarding the splits in the tree.  -->
+    <!-- ntax=6 nchar=415                                                        -->
+    <data id="alignment" dataType="nucleotide">
+        <sequence taxon="human">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACCCTAATCAAC-TGGCTTC
+        </sequence>
+        <sequence taxon="chimp">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAAC-TGGCTTC
+        </sequence>
+        <sequence taxon="bonobo">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAGC-TGGCTTC
+        </sequence>
+        <sequence taxon="gorilla">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTAAACATAGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA-CAACACTTAATTTCTGTAAGGACTGCAAAACCCTACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCAATGGGACTCAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAC-TGGCTTC
+        </sequence>
+        <sequence taxon="orangutan">
+            AGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA-CAGCACTTAATTTCTGTAAGGACTGCAAAACCCCACTTTGCATCAACTGAGCGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCCTAGACCGATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAT-TGGCTTC
+        </sequence>
+        <sequence taxon="siamang">
+            AGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTAACAAAACTTAATTTCTGCAAGGGCTGCAAAACCCTACTTTGCATCAACCGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCGATGGGACTTAAACCCATAAAAATTTAGTTAACAGCTAAACACCCTAAACAACCTGGCTTC
+        </sequence>
+    </data>
+
+    <!-- The Jukes-Cantor substitution model (Jukes & Cantor, 1969)             -->
+    <input spec='JukesCantor' id='jc69'/>
+
+    <!-- site model                                                              -->
+    <input spec='SiteModel' id="siteModel" gammaCategoryCount='1'>
+        <substModel idref='jc69'/>
+    </input>
+
+    <input spec='TreeLikelihood' id="treeLikelihood">
+        <data idref="alignment"/>
+        <tree idref="tree"/>
+        <siteModel idref="siteModel"/>
+    </input>
+
+    <tree id='tree'/>
+
+    <tree spec='beast.util.ClusterTree' id='upgmatree' clusterType='upgma' initial='@tree'>
+        <taxa idref='alignment'/>
+    </tree>
+    <tree spec='beast.evolution.tree.RandomTree' id='coalescentSimulator' initial='@tree' taxa='@alignment'>
+        <populationModel spec='ConstantPopulation'>
+            <popSize spec='parameter.RealParameter' value='0.05'/>
+        </populationModel>
+    </tree>
+
+    <run spec="MCMC" id="mcmc" chainLength="5000000" preBurnin="50000">
+
+        <init idref='coalescentSimulator'/>
+        <distribution spec='CompoundDistribution' id='posterior'>
+            <distribution id='likelihood' idref="treeLikelihood"/>
+        </distribution>
+
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" tree="@tree"/>
+
+        <operator spec='SubtreeSlide' weight="5" gaussian="true" size="1.0" tree="@tree"/>
+
+        <operator spec='Uniform' weight="10" tree="@tree"/>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="1" tree="@tree"/>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="1" tree="@tree"/>
+        <operator spec='WilsonBalding' weight="1" tree="@tree"/>
+
+        <logger logEvery="1000" fileName="test.$(seed).log">
+            <model idref='likelihood'/>
+            <log idref="likelihood"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+        </logger>
+        <logger logEvery="1000" fileName="test.$(seed).trees">
+            <log idref="tree"/>
+        </logger>
+        <logger logEvery="20000">
+            <model idref='likelihood'/>
+            <log idref="likelihood"/>
+            <ESS spec='ESS' name='log' arg="@likelihood"/>
+        </logger>
+    </run>
+
+</beast>
diff --git a/examples/testJukesCantorShortUncertain.xml b/examples/testJukesCantorShortUncertain.xml
new file mode 100644
index 0000000..45af83a
--- /dev/null
+++ b/examples/testJukesCantorShortUncertain.xml
@@ -0,0 +1,95 @@
+<beast version='2.0'
+       namespace='beast.evolution.alignment:beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood'>
+
+
+    <!-- The sequence alignment from testJukesCantorShort.xml, after converting to tip likelihoods.
+	These tip likelihoods denote the likelihood of observed data (e.g. read counts) given a particular base call.
+	The likelihoods used here are derived by simulating reads from a multinomial model with probability vector
+	alpha = 0.5 + 0.1 * a + (1,0,0,0) * a (for sites containing an A in testJukesCantorShort.xml) 
+	alpha = 0.5 + 0.1 * a + (0,1,0,0) * a (for sites containing  a C in testJukesCantorShort.xml)
+	alpha = 0.5 + 0.1 * a + (0,0,1,0) * a (for sites containing  a G in testJukesCantorShort.xml)
+	alpha = 0.5 + 0.1 * a + (0,0,0,1) * a (for sites containing an T in testJukesCantorShort.xml)
+	with a = 2, and then computing the likelihood of the sampled data under each of the above four cases. 
+	Each site had coverage drawn uniformly from the integers in the interval [5,10].
+	Gaps are replaced by 1,1,1,1.
+    -->
+    <!-- ntax=6 nchar=415                                                        -->
+    <!--                                                            -->
+    <data id="alignment" dataType="nucleotide">
+        <sequence taxon="human" uncertain="true">
+			0.0025,0.00071,0.032,2e-04; 0.0021,0.0021,0.027,0.00059; 0.028,0.00062,0.00017,4.8e-05; 0.02,0.00012,0.0015,0.0015; 0.031,0.0024,0.0087,0.031; 0.01,0.0028,0.0028,0.036; 0.023,3.2e-06,1.1e-05,1.1e-05; 0.0045,2.8e-05,9.8e-05,0.0045; 0.0013,0.00037,0.061,0.0013; 3.3e-05,0.00042,0.00042,0.019; 0.0013,0.061,0.0013,0.00037; 0.029,0.008,0.008,0.029; 4.8e-05,0.00062,0.028,0.00017; 0.0073,0.00016,0.0073,0.0021; 1.6e-06,1.6e-06,2e-05,0.012; 0.0095,0.034,0.00075,0.0027; 0.037,0.00082,0.00082,0.0 [...]
+		</sequence>
+		<sequence taxon="chimp" uncertain="true">
+			0.056,0.00035,0.00035,0.00035; 0.013,0.00029,0.0037,8.1e-05; 0.012,0.012,0.00026,0.00094; 0.003,6.6e-05,0.011,6.6e-05; 0.065,0.0014,0.0014,0.0014; 0.01,0.00079,0.0028,0.01; 0.014,0.014,0.0011,0.014; 8.2e-05,8.2e-05,8.2e-05,0.047; 5.5e-05,7e-04,0.009,0.0025; 0.0015,0.00041,0.00041,0.066; 0.0024,0.03,0.00019,0.00019; 0.00024,0.00024,0.00084,0.038; 0.00024,0.00024,0.038,0.00084; 0.027,0.00059,0.0021,0.0021; 0.0053,0.0053,0.0053,0.068; 0.0053,0.0053,0.0053,0.068; 0.066,0.00041,0.00041,0.0 [...]
+		</sequence>
+		<sequence taxon="bonobo" uncertain="true">
+			0.023,3.9e-05,0.00014,1.1e-05; 1.1e-05,0.00014,0.023,3.9e-05; 0.027,1.3e-05,1.3e-05,4.7e-05; 0.031,0.0024,0.0087,0.031; 0.061,0.00037,0.0013,0.0013; 0.00041,0.0015,0.00041,0.066; 0.038,0.00024,0.00084,0.00024; 8.1e-06,8.1e-06,1e-04,0.017; 0.00035,0.00035,0.056,0.00035; 7.5e-05,7.5e-05,0.00027,0.043; 0.0037,0.013,0.00029,8.1e-05; 0.015,0.015,0.0043,0.015; 3.9e-05,0.00014,0.023,1.1e-05; 0.022,0.0062,0.0017,0.0062; 1.1e-05,3.9e-05,0.00014,0.023; 0.031,0.031,0.0087,0.0024; 0.061,0.00037,0 [...]
+		</sequence>
+		<sequence taxon="gorilla" uncertain="true">
+			0.027,1.3e-05,4.7e-05,1.3e-05; 0.017,0.017,0.062,0.017; 0.038,0.00024,0.00084,0.00024; 0.074,0.0058,0.0016,0.0058; 0.011,0.00025,0.011,0.00025; 0.0058,0.0058,0.0016,0.074; 0.027,0.0021,0.0021,0.00059; 0.00082,0.01,0.00082,0.037; 0.0015,0.00012,0.02,0.0015; 0.034,0.0027,0.00075,0.0095; 0.01,0.037,0.00082,0.00082; 2e-05,1.6e-06,1.6e-06,0.012; 0.01,0.0028,0.01,0.00079; 0.017,2.3e-06,2.3e-06,8.2e-06; 0.022,0.0017,0.0062,0.0062; 0.074,0.0058,0.0016,0.0058; 0.015,0.015,0.0012,0.0012; 0.023, [...]
+		</sequence>
+		<sequence taxon="orangutan" uncertain="true">
+			0.028,4.8e-05,0.00017,0.00062; 0.0058,0.0016,0.074,0.0058; 0.032,0.0025,0.00071,2e-04; 0.012,2e-05,1.6e-06,1.6e-06; 0.033,5.8e-05,1.6e-05,5.8e-05; 0.031,0.031,0.0024,0.0087; 0.027,0.0021,0.00059,0.0021; 0.00059,0.0021,0.0021,0.027; 0.001,2.2e-05,0.013,7.9e-05; 0.0015,0.00012,0.0015,0.02; 1.1e-05,0.023,1.1e-05,3.2e-06; 0.029,0.008,0.008,0.029; 0.01,0.00079,0.01,0.0028; 0.031,0.0024,0.0087,0.031; 0.0037,0.013,0.00029,8.1e-05; 0.011,0.00025,0.00025,0.011; 0.028,0.00017,0.00062,4.8e-05; 0 [...]
+		</sequence>
+		<sequence taxon="siamang" uncertain="true">
+			0.032,0.00071,0.0025,2e-04; 1.1e-05,3.2e-06,0.023,1.1e-05; 0.036,0.0028,0.0028,0.01; 0.047,8.2e-05,8.2e-05,8.2e-05; 0.015,0.0012,0.0012,0.015; 0.0095,0.0027,0.00075,0.034; 0.0053,0.0053,0.0053,0.068; 0.00082,0.037,0.00082,0.01; 0.034,0.0095,0.00075,0.0027; 0.003,6.6e-05,6.6e-05,0.011; 0.00039,0.005,0.00039,0.018; 0.029,0.008,0.008,0.029; 8.2e-05,8.2e-05,0.047,8.2e-05; 0.019,0.00042,0.00042,3.3e-05; 0.0013,0.061,0.0013,0.00037; 0.0058,0.0016,0.074,0.0058; 0.027,0.0021,0.00059,0.0021; 0 [...]
+		</sequence>
+    </data>
+
+    <!-- The Jukes-Cantor substitution model (Jukes & Cantor, 1969)             -->
+    <input spec='JukesCantor' id='jc69'/>
+
+    <!-- site model                                                              -->
+    <input spec='SiteModel' id="siteModel" gammaCategoryCount='1'>
+        <substModel idref='jc69'/>
+    </input>
+
+    <input spec='TreeLikelihood' id="treeLikelihood" useTipLikelihoods="true">
+        <data idref="alignment"/>
+        <tree idref="tree"/>
+        <siteModel idref="siteModel"/>
+    </input>
+
+    <tree id='tree'/>
+
+    <tree spec='beast.util.ClusterTree' id='upgmatree' clusterType='upgma' initial='@tree'>
+        <taxa idref='alignment'/>
+    </tree>
+    <tree spec='beast.evolution.tree.RandomTree' id='coalescentSimulator' initial='@tree' taxa='@alignment'>
+        <populationModel spec='ConstantPopulation'>
+            <popSize spec='parameter.RealParameter' value='0.05'/>
+        </populationModel>
+    </tree>
+
+    <run spec="MCMC" id="mcmc" chainLength="5000000" preBurnin="50000">
+
+        <init idref='coalescentSimulator'/>
+        <distribution spec='CompoundDistribution' id='posterior'>
+            <distribution id='likelihood' idref="treeLikelihood"/>
+        </distribution>
+
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" tree="@tree"/>
+
+        <operator spec='SubtreeSlide' weight="5" gaussian="true" size="1.0" tree="@tree"/>
+
+        <operator spec='Uniform' weight="10" tree="@tree"/>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="1" tree="@tree"/>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="1" tree="@tree"/>
+        <operator spec='WilsonBalding' weight="1" tree="@tree"/>
+
+        <logger logEvery="1000" fileName="test.$(seed).log">
+            <model idref='likelihood'/>
+            <log idref="likelihood"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+        </logger>
+        <logger logEvery="1000" fileName="test.$(seed).trees">
+            <log idref="tree"/>
+        </logger>
+        <logger logEvery="20000">
+            <model idref='likelihood'/>
+            <log idref="likelihood"/>
+            <ESS spec='ESS' name='log' arg="@likelihood"/>
+        </logger>
+    </run>
+
+</beast>
diff --git a/examples/testJukesCantorShortUncertain2.xml b/examples/testJukesCantorShortUncertain2.xml
new file mode 100644
index 0000000..33c6b34
--- /dev/null
+++ b/examples/testJukesCantorShortUncertain2.xml
@@ -0,0 +1,96 @@
+<beast version='2.0'
+       namespace='beast.evolution.alignment:beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood'>
+
+
+    <!-- The sequence alignment from testJukesCantorShort.xml, after converting to tip likelihoods.
+	These tip likelihoods denote the likelihood of observed data (e.g. read counts) given a particular base call.
+	The likelihoods used here are derived by simulating reads from a multinomial model with probability vector
+	alpha = 0.5 + 0.1 * a + (1,0,0,0) * a (for sites containing an A in testJukesCantorShort.xml) 
+	alpha = 0.5 + 0.1 * a + (0,1,0,0) * a (for sites containing  a C in testJukesCantorShort.xml)
+	alpha = 0.5 + 0.1 * a + (0,0,1,0) * a (for sites containing  a G in testJukesCantorShort.xml)
+	alpha = 0.5 + 0.1 * a + (0,0,0,1) * a (for sites containing an T in testJukesCantorShort.xml)
+	with a = 2, and then computing the likelihood of the sampled data under each of the above four cases. 
+	Each site had coverage drawn uniformly from the integers in the interval [5,20].
+	Gaps are replaced by 1,1,1,1.
+    -->
+    <!-- ntax=6 nchar=415                                                        -->
+    <!--                                                            -->
+    <data id="alignment" dataType="nucleotide">
+<sequence taxon="human" uncertain="true">
+0.015,2.1e-06,2.1e-06,2.1e-06; 4.7e-07,6e-06,0.013,6e-06; 0.00014,0.0018,8.6e-07,2.4e-07; 0.014,1.9e-06,1.9e-06,1.9e-06; 0.027,4.7e-05,1.3e-05,4.7e-05; 1.5e-07,5.5e-07,1.5e-07,0.014; 0.012,2e-05,1.6e-06,1.6e-06; 1.4e-05,1.1e-06,1.4e-05,0.008; 3e-08,3e-08,0.01,8.3e-09; 2.3e-05,5e-07,0.00029,0.001; 5e-07,0.013,6.4e-06,1.8e-06; 5.8e-05,1.6e-05,5.8e-05,0.033; 1.4e-05,1.1e-06,0.0079,4.8e-05; 0.037,0.00082,0.00082,0.01; 3.1e-05,0.00011,8.6e-06,0.018; 0.0094,2.8e-08,2.8e-08,2.8e-08; 0.056,0.000 [...]
+</sequence>
+<sequence taxon="chimp" uncertain="true">
+0.0094,1.6e-05,1.3e-06,3.5e-07; 0.0013,0.0013,0.0046,0.0013; 0.034,0.0095,0.0027,0.00075; 0.0044,3.6e-09,1.6e-07,4.6e-08; 0.016,0.0013,1e-04,0.00036; 5.2e-05,1.1e-06,1.1e-06,0.0085; 0.029,0.00064,0.00064,0.00018; 0.0027,0.034,0.00075,0.0095; 0.0027,0.00075,0.0095,0.034; 4.4e-05,0.00016,0.00056,0.0071; 4.6e-06,0.00021,1.6e-05,0.0095; 0.00014,0.00014,3.1e-06,0.0018; 0.005,0.00039,0.018,0.00039; 0.0029,8.6e-09,3.9e-07,1.4e-06; 9.1e-07,3.3e-06,7.1e-08,0.0068; 0.0057,6.1e-08,2.8e-06,2.8e-06;  [...]
+</sequence>
+<sequence taxon="bonobo" uncertain="true">
+0.0089,9.4e-08,7.3e-09,9.4e-08; 3e-09,1.4e-07,0.0036,1.1e-08; 0.016,2.8e-05,2.2e-06,2.2e-06; 0.032,0.00071,0.0025,2e-04; 0.011,5.2e-06,5.2e-06,1.8e-05; 1.3e-05,4.7e-05,1.3e-05,0.027; 0.0051,3.1e-05,6.9e-07,3.1e-05; 5.8e-06,4.6e-07,5.8e-06,0.012; 2.8e-05,2.2e-06,0.016,2.2e-06; 0.00057,0.00016,4.5e-05,0.002; 0.0024,0.031,0.0087,0.031; 0.0025,0.00071,2e-04,0.032; 5.4e-06,6.9e-05,0.0031,0.00025; 0.0068,7.1e-08,3.3e-06,9.1e-07; 0.0014,8.7e-06,2.4e-06,0.0014; 0.0044,0.00034,2.1e-06,7.5e-06; 0. [...]
+</sequence>
+<sequence taxon="gorilla" uncertain="true">
+0.0046,6.2e-07,4.8e-08,7.9e-06; 2.2e-08,1e-06,0.0074,2.8e-07; 0.0078,6.4e-09,2.3e-08,6.4e-09; 0.0066,5.5e-09,2.5e-07,2e-08; 0.0097,4.7e-06,0.00021,6e-05; 3.3e-06,3.3e-06,1.2e-05,0.024; 0.016,0.0013,0.00036,1e-04; 0.0014,0.0014,0.0014,0.065; 0.00082,0.01,0.037,0.00082; 1.2e-07,3.3e-08,4.3e-07,0.011; 0.0087,0.031,0.0024,0.031; 5e-05,0.00018,0.00018,0.029; 1.8e-05,6.3e-05,0.01,4.9e-06; 0.016,0.00036,0.0013,1e-04; 1.2e-05,2.6e-07,2.6e-07,0.0069; 0.034,0.0027,0.0095,0.00075; 0.0049,0.0014,3e- [...]
+</sequence>
+<sequence taxon="orangutan" uncertain="true">
+0.037,0.00082,0.01,0.00082; 1.2e-07,1.2e-07,0.011,1.5e-06; 0.002,2.8e-07,0.00016,9.8e-07; 0.061,0.0013,0.0013,0.00037; 0.0096,1e-07,3.6e-07,1.3e-06; 0.0012,2.5e-05,2e-06,0.0012; 0.00079,0.0028,0.01,0.01; 0.00041,0.00011,0.0015,0.0052; 0.00076,1.7e-05,0.0098,0.00021; 0.00059,0.0021,0.0021,0.027; 0.0021,0.0073,0.00016,0.0073; 0.00016,0.00016,0.00016,0.027; 3.9e-09,1.4e-08,0.0047,5e-08; 0.036,1.7e-05,1.7e-05,1.7e-05; 5.4e-05,0.0088,0.00019,1.5e-05; 0.074,0.0016,0.0058,0.0058; 0.016,2.2e-06, [...]
+</sequence>
+<sequence taxon="siamang" uncertain="true">
+0.013,1.4e-07,3.9e-08,3.9e-08; 0.0058,0.0016,0.074,0.0058; 0.015,5.6e-07,5.6e-07,1.6e-07; 0.03,5.1e-05,1.4e-05,1.4e-05; 0.018,0.00011,3.1e-05,0.00039; 4.7e-06,0.00021,6e-05,0.0097; 0.061,0.00037,0.0013,0.0013; 8.7e-06,0.018,0.00011,8.7e-06; 2.7e-06,1.7e-08,0.0016,1.7e-08; 0.00075,0.0095,0.0027,0.034; 0.031,0.0087,0.0024,0.031; 0.00019,0.0024,0.00019,0.03; 0.0028,0.01,0.036,0.0028; 0.0028,8.2e-09,2.9e-08,1.3e-06; 9.4e-06,0.019,3.3e-05,9.4e-06; 0.00014,1.1e-05,0.0062,0.00049; 0.015,5.8e-07 [...]
+</sequence>
+
+</data>
+
+    <!-- The Jukes-Cantor substitution model (Jukes & Cantor, 1969)             -->
+    <input spec='JukesCantor' id='jc69'/>
+
+    <!-- site model                                                              -->
+    <input spec='SiteModel' id="siteModel" gammaCategoryCount='1'>
+        <substModel idref='jc69'/>
+    </input>
+
+    <input spec='TreeLikelihood' id="treeLikelihood" useTipLikelihoods="true">
+        <data idref="alignment"/>
+        <tree idref="tree"/>
+        <siteModel idref="siteModel"/>
+    </input>
+
+    <tree id='tree'/>
+
+    <tree spec='beast.util.ClusterTree' id='upgmatree' clusterType='upgma' initial='@tree'>
+        <taxa idref='alignment'/>
+    </tree>
+    <tree spec='beast.evolution.tree.RandomTree' id='coalescentSimulator' initial='@tree' taxa='@alignment'>
+        <populationModel spec='ConstantPopulation'>
+            <popSize spec='parameter.RealParameter' value='0.05'/>
+        </populationModel>
+    </tree>
+
+    <run spec="MCMC" id="mcmc" chainLength="5000000" preBurnin="50000">
+
+        <init idref='coalescentSimulator'/>
+        <distribution spec='CompoundDistribution' id='posterior'>
+            <distribution id='likelihood' idref="treeLikelihood"/>
+        </distribution>
+
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" tree="@tree"/>
+
+        <operator spec='SubtreeSlide' weight="5" gaussian="true" size="1.0" tree="@tree"/>
+
+        <operator spec='Uniform' weight="10" tree="@tree"/>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="1" tree="@tree"/>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="1" tree="@tree"/>
+        <operator spec='WilsonBalding' weight="1" tree="@tree"/>
+
+        <logger logEvery="1000" fileName="test.$(seed).log">
+            <model idref='likelihood'/>
+            <log idref="likelihood"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+        </logger>
+        <logger logEvery="1000" fileName="test.$(seed).trees">
+            <log idref="tree"/>
+        </logger>
+        <logger logEvery="20000">
+            <model idref='likelihood'/>
+            <log idref="likelihood"/>
+            <ESS spec='ESS' name='log' arg="@likelihood"/>
+        </logger>
+    </run>
+
+</beast>
diff --git a/examples/testJukesCantorShortUncertain2MLE.xml b/examples/testJukesCantorShortUncertain2MLE.xml
new file mode 100644
index 0000000..f13dd31
--- /dev/null
+++ b/examples/testJukesCantorShortUncertain2MLE.xml
@@ -0,0 +1,87 @@
+<beast version='2.0'
+       namespace='beast.evolution.alignment:beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood'>
+
+
+    <!-- The sequence alignment from testJukesCantorShortUncertain2.xml, after 
+    reconstructing the MLE for the sequences from the noisy simulated read data.
+    -->
+    <!-- ntax=6 nchar=415                                                        -->
+    <!--                                                            -->
+    <data id="alignment" dataType="nucleotide">
+        <sequence taxon="human">
+			AGCAATATGTCTGATAAAAGAGTTACTTTGATACTGTAAATAAGAGGTGCTTAAACCCCCTTCATCCTACTAGGGCTCTGAGAATCGAACCCAGCACACAGAATCCAAAATCCTCCCTGCCACCTATCACACCGCATCCCAAGTAAGGTCAGCTGAATAACCTATCGGGCCCAAAGCCCGGAAATGTACGTTATACCATTCCCGTACTAAGAAATTTAGGTTAAGCACAAACCAAGACCCTTCCAAGCCCTCAGTAAGTTC-CGATACTTCATTACTGTAATGATTGCAAAAACCCACTATGCATCAACTGAACGAAAATAAGCTACTTTAACTAAGCTAAGCCCAACTAGACCAATGGAGCTTAAACCCACAAACACTTAATTAACAGCCAAGCACCAGAATCAAC-GGGCTAC
+		</sequence>
+		<sequence taxon="chimp">
+			AGAAATACTTTTGATAAAAGAATTACTGCAATAGAGTTAACAATAGGAGTTCAAATCCCCTTACTTCTACCCGGACTATAAGAATAGGACGCATTACTGAGAATCCAAAATTCTCCGTGCTACCTATCACAACCCAACCTAAATAAGGTCAGCTAAATAAGCTATCGTGACCAGACCCCGAAAATGTAGGTTAAACCCTTCCCCTACTCAGTCAATTAGGTGAAGCACAGACCAAGCGCATACAAAGCCCTCAGCGAGTTA-AACTACTTACTTTCTCTAAGGACTCCAAAACCCCAATTAGCATCAACTGAACGCAAATCAGCCAATTTAATAAAACTAAAGCATTCTAGATTAATGCGACTTAAACCCACAAACATCTGGTTAACATCTAAACTCCCTAATCAAC-TGCCTCC
+		</sequence>
+		<sequence taxon="bonobo">
+			AGAAATATGTCTGAAAAAAGAATTACCTTGGGAGAGCCAATACTAGGAATTTAAATCCCTTTATTTCTACTAGAACTATGAGAGTCGGACCAAGCCCTGAGAATCCAAAACTCTCCGTGCCCCCTATCACACCCGCTCCTAAGTAACGTTAGCTAAAGAAGCAATCGGGCCCCTACCCCGAAAATGCTGGTTACACCCATCCCGTTCTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA-CAATACTTAATTTATGTACGGACTCCACAACTCCACTCTGCATCCACTCAACGAAAATCAGCTACTTTAAATAAGCTAAGCCCTTCTAGATTATTGGGACTTAAACCCACAAACATTTAGTTAGCAGCTAAACACCGTAATCAGC-TAGCATC
+		</sequence>
+		<sequence taxon="gorilla">
+			AGAAATATGTCTGATAATAGAGTTACTTTGATAGAGTAAATACTAGAGGTTTAAATCCCCTTGTTTCTACTCGGACTATGAAAATTGAACCCATCCCTGAGGATCCAAAATTCTCCGTGCCACCTGTCAAACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATTGGGCCCAAACCCCGAAAATGACGGTCACATCTTTACCACACTAAGAAATATAGGTTAAACATTGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA-CAACACTTAAGTCCTGTAAGGACTGCCAAACCCTACTCTGCATCAACTGAAAGCAAATCAGGCACTTTAATTAAGCTAAGCCACCATAGATCAAAGCGACACAAACCCACAAACATTTCGCTAACAGCTAAACTCCCTAGTCAAC-GGGTTTC
+		</sequence>
+		<sequence taxon="orangutan">
+			AGAAAAGTGTCTGACAAAAGAGCTACTTTGATAGAGTAAAAAATAGATGCCTAAATCCAATTATCTCTACTAGGGAACCGGGAATTGAACCCACCCCGGAGGATCTAAATTTCTCCGTGACACGCATCTCACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCGCATAACCCGAAAATGTTAGTTACACGCTTCCCGTACTCACAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA-CAGCACTTAATTTCGGTACGGAATGCCAAACCCAACTTCGCAACAACGGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCATAGACCGAAGGGCCTAAACCCCACAAACATTTAGTTAACACCTAACCACCTTAGTCAAT-TGGTTTC
+		</sequence>
+		<sequence taxon="siamang">
+			AGAAATACGTATGACGAAAGAGTTACTTTGATAGATCAAATAACAGAAGTTCAAATCCCCTTAATTCTACTAGAACCCTAGGGGTCGAACCCAACCTTGAGAATACAGAACTCTCCGTGCCCGCCGGCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCAATCGAGCCCATACCCCGAAAATGAAGTTCATACCCTTCCCAAACTAAGAAATTTAGGCTAAATACAAACTAAGATCCTTCAAAGCCCTCACTAAGTTAACAAAACTTAATATCTGCTAGGGCTCCAAAACCCTACTTTGCATCAACCGAGCGCAATTCAGCCACTTTAATTCAGCTAAGCCCCTCTAGATCGATGGGACTTTAACCCATAAAGATTAAGGTAACAGCTAAACACCCTAAACAATCTGGGCTA
+		</sequence>
+    </data>
+
+    <!-- The Jukes-Cantor substitution model (Jukes & Cantor, 1969)             -->
+    <input spec='JukesCantor' id='jc69'/>
+
+    <!-- site model                                                              -->
+    <input spec='SiteModel' id="siteModel" gammaCategoryCount='1'>
+        <substModel idref='jc69'/>
+    </input>
+
+    <input spec='TreeLikelihood' id="treeLikelihood">
+        <data idref="alignment"/>
+        <tree idref="tree"/>
+        <siteModel idref="siteModel"/>
+    </input>
+
+    <tree id='tree'/>
+
+    <tree spec='beast.util.ClusterTree' id='upgmatree' clusterType='upgma' initial='@tree'>
+        <taxa idref='alignment'/>
+    </tree>
+    <tree spec='beast.evolution.tree.RandomTree' id='coalescentSimulator' initial='@tree' taxa='@alignment'>
+        <populationModel spec='ConstantPopulation'>
+            <popSize spec='parameter.RealParameter' value='0.05'/>
+        </populationModel>
+    </tree>
+
+    <run spec="MCMC" id="mcmc" chainLength="5000000" preBurnin="50000">
+
+        <init idref='coalescentSimulator'/>
+        <distribution spec='CompoundDistribution' id='posterior'>
+            <distribution id='likelihood' idref="treeLikelihood"/>
+        </distribution>
+
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" tree="@tree"/>
+
+        <operator spec='SubtreeSlide' weight="5" gaussian="true" size="1.0" tree="@tree"/>
+
+        <operator spec='Uniform' weight="10" tree="@tree"/>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="1" tree="@tree"/>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="1" tree="@tree"/>
+        <operator spec='WilsonBalding' weight="1" tree="@tree"/>
+
+        <logger logEvery="1000" fileName="test.$(seed).log">
+            <model idref='likelihood'/>
+            <log idref="likelihood"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+        </logger>
+        <logger logEvery="1000" fileName="test.$(seed).trees">
+            <log idref="tree"/>
+        </logger>
+        <logger logEvery="20000">
+            <model idref='likelihood'/>
+            <log idref="likelihood"/>
+            <ESS spec='ESS' name='log' arg="@likelihood"/>
+        </logger>
+    </run>
+
+</beast>
diff --git a/examples/testMultipleAlignments_randomTaxaOrder.xml b/examples/testMultipleAlignments_randomTaxaOrder.xml
new file mode 100644
index 0000000..12bf8cb
--- /dev/null
+++ b/examples/testMultipleAlignments_randomTaxaOrder.xml
@@ -0,0 +1,332 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<beast beautitemplate="Standard" beautistatus="" namespace="beast.core:beast.evolution.alignment:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood" version="2.0">
+
+<!-- Correct estimated rate is 1.46e-8 -->
+
+<data id='gene1'>
+    <sequence taxon='CB121212.12_1' value='CTCGACGCTACTGGGCTCATAAATCTTTGGACCAAGTACCCGGCGATAGACTCACAAGAGATAGCGCGGTGCCCGTTGTCGAACATGAAGTGCATCAACGACCCAGTCAAGAAGATCAGCTGTCACTAGAGCATTAGGGGACGTATCAACGGGAAGTCACCACTAACCGTTTGGACCATCTCCTAGCTCTGGATACAGTAGCCATGCACACGCCCCAGGGCGTCTTAGTCCGCCGTCAGCCGGATCCAACCGCGCAGCCTAGCCATGAGGACGGACTACTGATGAGCCCGGAAAGGGAGCTGTGAGGTGGACTCGAGTTAGGGCCATCATTCATAGCTACCCTATCTTATTTCCACCTTGGTATTACCTCACTCAGTAGGCCTAAGGTTAAACCCCTTGCTACCACGTAGGGACTCGAGGCCTGAGATACCGGTAACGGGGCTCCGTGC [...]
+
+    <sequence taxon='CB070121.16_1' value='CTCGACGCTACTGGGCTCATAAATCTTTGGACCAAGTACCCGGCGATAGACTCACAAGAGATAGCGCGGTGCCCGTTGTCGAACATGAAGTGCATCAACGACCCAGTCAAGAAGATCAGCTGTCACTAGAGCATTAGGGGACGTATCAACGGGAAGTCACCACTAACCGTTTGGACCATCTCCTAGCTCTGGATACAGTAGCCATGCACACGCCCCAGGGCGTCTTAGTCCGCCGTCAGCCGGATCCAACCGCGCAGCCTAGCCATGAGGACGGACTACTGATGAGCCCGGAAAGGGAGCTGTGAGGTGGACTCGAGTTAGGGCCATCATTCATAGCTACCCTATCTTATTTCCACCTTGGTATTACCTCACTCAGTAGGCCTAAGGTTAAACCCCTTGCTACCACGTAGGGACTCGAGGCCTGAGATACCGGTAACGGGGCTCCGTGC [...]
+
+    <sequence taxon='CA3.T415_1' value='CTCGACGCTACTGGGCTCATAAATCTTTGGACCAAGTACCCGGCGATAGACTCACAAGAGATAGCGCGGTGCCCGTTGTCGAACATGAAGTGCATCAACGACCCAGTCAAGAAGATCAGCTGTCACTAGAGCATTAGGGGACGTATCAACGGGAAGTCACCACTAACCGTTTGGACCATCTCCTAGCTCTGGATACAGTAGCCATGCACACGCCCCAGGGCGTCTTAGTCCGCCGTCAGCCGGATCCAACCGCGCAGCCTAGCCATGAGGACGGACTACTGATGAGCCCGGAAAGGGAGCTGTGAGGTGGACTCGAGTTAGGGCCATCATTCATAGCTACCCTATCTTATTTCCACCTTGGTATTACCTCACTCAGTAGGCCTAAGGTTAAACCCCTTGCTACCACGTAGGGACTCGAGGCCTGAGATACCGGTAACGGGGCTCCGTGCACG [...]
+
+    <sequence taxon='CB070117.03_1' value='CTCGACGCTACTGGGCTCATAAATCTTTGGACCAAGTACCCGGCGATAGACTCGCAAGAGATAGCGCGGTGCCCGTTGTCGAACATGAAGTGCATCAACGACCCAGTCAAGAAGATCAGCTGTCACTAGAGCATTAGGGGACGTATCAACGGGAAGTCACCACTAACCGTTTGGACCATCTCCTAGCTCTGGATACAGTAGCCATGCACACGCCCCAGGGCGTCTTAGTCCGCCGTCAGCCGGATCCAACCGCGCAGCCTAGCCATGAGGACGGACTACTGATGAGCCCGGAAAGGGAGTTGTGAGGTGGACTCAAGTTAGGGCCATCATTCATAGCTACCCTATCTTATTTCCACCTTGGTATTACCTCACTCAGTAGGCCTAAGGTTAAACCCCTTGCTACCACGTAGGGACTCGAGGCCTGAGATACCGGTAACGGGGCTCCGTGC [...]
+
+    <sequence taxon='CB070121.08_1' value='CTCGACGCTACTGGGCTCATAAATCTTTGGACCAAGTACCCGGCGATAGACTCGCAAGAGATAGCGCGGTGCCCGTTGTCGAACATGAAGTGCATCAACGACCCAGTCAAGAAGATCAGCTGTCACTAGAGCATTAGGGGACGTATCAACGGGAAGTCACCACTAACCGTTTGGACCATCTCCTAGCTCTGGATACAGTAGCCATGCACACGCCCCAGGGCGTCTTAGTCCGCCGTCAGCCGGATCCAACCGCGCAGCCTAGCCATGAGGACGGACTACTGATGAGCCCGGAAAGGGAGTTGTGAGGTGGACTCAAGTTAGGGCCATCATTCATAGCTACCCTATCTTATTTCCACCTTGGTATTACCTCACTCAGTAGGCCTAAGGTTAAACCCCTTGCTACCACGTAGGGACTCGAGGCCTGAGATACCGGTAACGGGGCTCCGTGC [...]
+
+    <sequence taxon='CA1.T401_1' value='CTCGACGCTACTGGGCTCATAAATCTTTGGACCAAGTACCCGGCGATAGACTCACAAGAGATAGCGCGGTGCCCGTAGTCGAACATGAAGTGCATCAACGACCCAGTCAAGAAGATCAGCTGTCACTAGAGCATTAGGGGACGTATCAACGGGAAGTCACCACTAACCGTTTGGACCATCTCCTAGCTCTGGATACAGTAGCCATGCACACGCCCCAGGGCGTCTTAGTCCGCCGTCAGCCGGATCCGACCGCGCAGCCTAGCCATGAGGACGGACTACTGATGAGCCCGGAAAGGGAGCTGTGAGGTGGACTCAAGTTAGGGCCATCATTCATAGCTACCCTATCTTATTTCCACCTTGGTATTACCTCACTCAGTAGGCCTAAGGTTAAACCCCTTGCTACCACGTAGGGACTCGAGGCCTGAGATACCGGTAACGGGGCTCCGTGCACG [...]
+
+    <input spec='beast.evolution.datatype.Nucleotide' name='userDataType'/>
+
+</data>
+
+
+
+<data id='gene2'>
+    <sequence taxon='CA3.T415_1' value='CGTTGGTGGGCTCCAAGTGCACGAGCCTCCCCCATAACATTTCGTCACTGTTATCTTACGTAGATCAATTGCTCGACGCTTATGCGTCTCTCCCCACACGCGAACCTAAGGGCTCTATGATAGGCTTTGGGAGTTAGCTTGAGATGGTTTGTTAAAGGTGGGAACTGCGAGCTGTTCCCCTGCCCAGCGTCCTTTGATCGACGAGACACCCGAGGAAGGAGACACGGATATTGACCCCAAGCTGGTCGCTGGAGAGTACAACAGTTCTTCTCCCTATGGTTAGGCTCGGTTTAGAGCGTACTTCACAATTCTAAAAAGACCTCATATAAGCCTACGCAACACATGGATAAATCCAAAGCGTGCGCCGGCCCGCCCTAGCCCCGCAACGATTGAGTATTGGAGTAAACCGCATGAGATCCGGGCAACCTACAACCTCTACACATATTTACCTT [...]
+
+    <sequence taxon='CA1.T401_1' value='CGTTGGTGGGCTCCAAGTGCACGAGCCTCCCCCATAACATTTCGTCACTGTAATCTTACGTAGATCAATTGCTCGACGCTTATGCGTCTCTCCCCACACGCGAACCTAAGGGCTCTATGATAGGCTTTGGGAGTTAGCTTGAGATGGTTTGTTAAAGGTGGGAACTGCGAGCTGTTCCCCTGCCCAGCGTCCTTTGATCGACGAGACACCCGAGGAAGGAGACACGGATATTGACCCCAAGCTGGTCGCTGGAGAGTATAACAGTTCTTCTCCCTATGGTTAGGCTCGGTTTAGAGCGTACTTCACAATTCTAAAAAGACCTCATATAAGCCTACGCAACACATGGATAAATCCAAAGCGTGCGCCGGCCCGCCCTAGCCCCGTAACGATTGAGTATTGGAGTAAACCGCATGAGATCCGGGCAACCTACAACCTCTACACATATTTACCTT [...]
+
+    <sequence taxon='CB121212.12_1' value='CGTTGGTGGGCTCCAAGTGCACGAGCCTCCCCCATAACATTTCGTCACTGTTATCTTACGTAGATCAATTGCTCGACGCTTATGCGTCTCTCCCCACACGCGAACCTAAGGGCTCTATGATAGGCTTTGGGAGTTAGCTTGAGATGGTTTGTTAAAGGTGGGAACTGCGAGCTGTTCCCCTGCCCAGCGTCCTTTGATCGACGAGACACCCGAGGAAGGAGACACGGATATTGACCCCAAGCTGGTCGCTGGAGAGTATAACAGTTCTTCTCCCTATGGTTAGGCTCGGTTTAGAGCGTACTTCACAATTCTAAAAAGACCTCATATAAGCCTACGCAACACATGGATAAATCCAAAGCGTGCGCCGGCCCGCCCTAGCCCCGTAACGATTGAGTATTGGAGTAAACCGCATGAGATCCGGGCAACCTACAACCTCTACACATATTTAC [...]
+
+    <sequence taxon='CB070121.08_1' value='CGTTGGTGGGCTCCAAGTGCACTAGCCTCCCCCATAACATTTCGTCACTGTAATCTTACGTAGATCAATTGCTCGACGCTTATGCGTCTCTCCCCACACGCGAACCTAAGGGCTCTATGATAGGCTTTGGGAGTTAGCTTGGGATGGTTTGTTAAAGGTGGGAACTGCGAGCTGTTCCCCTGCCCAGCGTCCTTTGATCGACGAGACACCCGAGGAAGGAGACACGGATATTGACCCCAAGCTGGTCGCTGGAGAGTACAACAGTTCTTCTCCCTATGGTTAGGCTCGGTTTAGAGCGTACTTCACAATTCTAAAAAGACCTCATATAAGCCTACGCAACACATGGATAAATCCAAAGCGTGCGCCGGCCCGCCCTAGCCCCGCAACGATTGAGTATTGGAGTAAACCGCATGAGATCCGGGCAACCTACAACCTCTACACATATTTAC [...]
+
+    <sequence taxon='CB070117.03_1' value='CGTTGGTGGGCTCCAAGTGCACTAGCCTCCCCCATAACATTTCGTCACTGTAATCTTACGTAGATCAATTGCTCGACGCTTATGCGTCTCTCCCCACACGCGAACCTAAGGGCTCTATGATAGGCTTTGGGAGTTAGCTTGGGATGGTTTGTTAAAGGTGGGAACTGCGAGCTGTTCCCCTGCCCAGCGTCCTTTGATCGACGAGACACCCGAGGAAGGAGACACGGATATTGACCCCAAGCTGGTCGCTGGAGAGTACAACAGTTCTTCTCCCTATGGTTAGGCTCGGTTTAGAGCGTACTTCACAATTCTAAAAAGACCTCATATAAGCCTACGCAACACATGGATAAATCCAAAGCGTGCGCCGGCCCGCCCTAGCCCCGCAACGATTGAGTATTGGAGTAAACCGCATGAGATCCGGGCAACCTACAACCTCTACACATATTTAC [...]
+
+    <sequence taxon='CB070121.16_1' value='CGTTGGTGGGCTCCAAGTGCACTAGCCTCCCCCATAACATTTCGTCACTGTAATCTTACGTAGATCAATTGCTCGACGCTTATGCGTCTCTCCCCACACGCGAACCTAAGGGCTCTATGATAGGCTTTGGGAGTTAGCTTGGGATGGTTTGTTAAAGGTGGGAACTGCGAGCTGTTCCCCTGCCCAGCGTCCTTTGATCGACGAGACACCCGAGGAAGGAGACACGGATATTGACCCCAAGCTGGTCGCTGGAGAGTACAACAGTTCTTCTCCCTATGGTTAGGCTCGGTTTAGAGCGTACTTCACAATTCTAAAAAGACCTCATATAAGCCTACGCAACACATGGATAAATCCAAAGCGTGCGCCGGCCCGCCCTAGCCCCGCAACGATTGAGTATTGGAGTAAACCGCATGAGATCCGGGCAACCTACAACCTCTACACATATTTAC [...]
+
+    <input spec='beast.evolution.datatype.Nucleotide' name='userDataType'/>
+
+</data>
+
+
+
+<data id='gene3'>
+    <sequence taxon='CA3.T415_1' value='ACCATTCTATGTCTTGTAATCGTAGACCCATTACGGGATCAACATGCCGGGCCGTAGGACTTACTGCCTAGTCGTATATATTAGGAGGCGCAGCGCCCGTAGTATACAAAACGTAGGGATAAGGGGAAGACATGACTCTCCCCCGGGTAAGGTCGGTGTGACTCGGTGAGATGAGCCGCTTAGCTGGATATATAAAAACAAGCAGAACAGGATCATAGGACTCATAGTGAAGCGTGGCGCTGGCCAATCTCCGTGATGTTATGATTCAAGGGCCACCTATCGGGTTTAGCATAGCTCGGTTGCACAATCTGGAAAAGTGGCGGGGCTTCGTGCGAGATTACCTAGAGGCCGCATGCTCCCGGTGTCTCGTTGCCCAAAATTGAGCTGGGTTTTAACTAACAGAGCGCTGAATGCGTCCATGCCCAGCCGTAAGTACGATTTCTTGGTAGCGC [...]
+
+    <sequence taxon='CB070121.08_1' value='ACCATTCTATGTCTTGTAATCGTAGACCCATTACGGGATCAACATGCCGGGCCGTAGGACTTACTGCCTAGTCGTATATATTAGGAGGCGCAGCGCCCGTAGTATACAAAACGTAGGGATAAGGGGAAGACATGACTCTCCCCCGGGTAAGGTCGGTGTGACTCGGTGAGATGAGCCGCTTAGCTGGATATATAAAAACAAGCAGAACAGGATCATAGGACTCATAGTGAAGCGTGGCGCTGGCCAATCTCCGTGATGTTATGATTCAAGGGCCACCTATCGGGTTTAGCATAGCTCGGTTGCACAATCTGGAAAAGTGGCGGGGCTTCGTGCGAGATTACCTAGAGGCAGCATGCTCCCGGTGTCTCGTTGCCCAAAATTGAGCTGGGTTTTAACTAACAGAGCGCTGAATGCGTCCATGCCCAGCCGTAAGTACGATTTCTTGGTAG [...]
+
+    <sequence taxon='CB070121.16_1' value='ACCATTCTATGTCTTGTAATCGTAGACCCATTACGGGATCAACATGCCGGGCCGTAGGACTTACTGCCTAGTCGTATATATTAGGAGGCGCAGCGCCCGTAGTATACAAAACGTAGGGATAAGGGGAAGACATGACTCTCCCCCGGGTAAGGTCGGTGTGACTCGGTGAGATGAGCCGCTTAGCTGGATATATAAAAACAAGCAGAACAGGATCATAGGACTCATAGTGAAGCGTGGCGCTGGCCAATCTCCGTGATGTTATGATTCAAGGGCCACCTATCGGGTTTAGCATAGCTCGGTTGCACAATCTGGAAAAGTGGCGGGGCTTCGTGCGAGATTACCTAGAGGCCGCATGCTCCCGGTGTCTCGTTGCCCAAAATTGAGCTGGGTTTTAACTAACAGAGCGCTGAATGCGTCCATGCCCAGCCGTAAGTACGATTTCTTGGTAG [...]
+
+    <sequence taxon='CA1.T401_1' value='ACCATTCTATGTCTTGTAATCGTAGACCCATTACGGGATCAACATGCCGGGCCGTAGGACTTACTGCCTAGTCGTATATATTAGGAGGCGCAGCGCCCGTAGTATACAAAACGTAGGGATAAGGGGAAGACATGACTCTCCCCCGGGTAAGGTCGGTGTGACTCGGTGAGATGAGCCGCTTAGCTGGATATATAAAAACAAGCAGAACAGGATCATAGGACTCATAGTGAAGCGTGGCGCTGGCCAATCTCCGTGATGTTATGATTCAAGGGCCACCTATCGGGTTTAGCATAGCTCGGTTGCACAATCTGGAAAAGTGGCGGGGCTTCGTGCGAGATTACCTAGAGGCCGCATGCTCCCGGTGTCTCGTTGCCCAAAATTGAGCTGGGTTTTAACTAACAGAGCGCTGAATGCGTCCATGCCCAGCCGTAAGTACGATTTCTTGGTAGCGC [...]
+
+    <sequence taxon='CB070117.03_1' value='ACCATTCTATGTCTTGTAATCGTAGACCCATTACGGGATCAACATGCCGGGCCGTAGGACTTACTGCCTAGTCGTATATATTAGGAGGCGCAGCGCCCGTAGTATACAAAACGTAGGGATAAGGGGAAGACATGACTCTCCCCCGGGTAAGGTCGGTGTGACTCGGTGAGATGAGCCGCTTAGCTGGATATATAAAAACAAGCAGAACAGGATCATAGGACTCATAGTGAAGCGTGGCGCTGGCCAATCTCCGTGATGTTATGATTCAAGGGCCACCTATCGGGTTTAGCATAGCTCGGTTGCACAATCTGGAAAAGTGGCGGGGCTTCGTGCGAGATTACCTAGAGGCCGCATGCTCCCGGTGTCTCGTTGCCCAAAATTGAGCTGGGTTTTAACTAACAGAGCGCTGAATGCGTCCATGCCCAGCCGTAAGTACGATTTCTTGGTAG [...]
+
+    <sequence taxon='CB121212.12_1' value='ACCATTCTATGTCTTGTAATCGTAGACCCATTACGGGATCAACATGCCGGGCCGTAGGACTTACTGCCTAGTCGTATATATTAGGAGGCGCAGCGCCCGTAGTATACAAAACGTAGGGATAAGGGGAAGACATGACTCTCCCCCGGGTAAGGTCGGTGTGACTCGGTGAGATGAGCCGCTTAGCTGGATATATAAAAACAAGCAGAACAGGATCATAGGACTCATAGTGAAGCGTGGCGCTGGCCAATCTCCGTGATGTTATGATTCAAGGGCCACCTATCGGGTTTAGCATAGCTCGGTTGCACAATCTGGAAAAGTGGCGGGGCTTCGTGCGAGATTACCTAGAGGCCGCATGCTCCCGGTGTCTCGTTGCCCAAAATTGAGCTGGGTTTTAACTAACAGAGCGCTGAATACGTCCATGCCCAGCCGTAAGTACGATTTCTTGGTAG [...]
+
+    <input spec='beast.evolution.datatype.Nucleotide' name='userDataType'/>
+
+</data>
+
+
+
+
+
+	<map name="Uniform">beast.math.distributions.Uniform</map>
+	<map name="Exponential">beast.math.distributions.Exponential</map>
+	<map name="LogNormal">beast.math.distributions.LogNormalDistributionModel</map>
+	<map name="Normal">beast.math.distributions.Normal</map>
+	<map name="Beta">beast.math.distributions.Beta</map>
+	<map name="Gamma">beast.math.distributions.Gamma</map>
+	<map name="LaplaceDistribution">beast.math.distributions.LaplaceDistribution</map>
+	<map name="prior">beast.math.distributions.Prior</map>
+	<map name="InverseGamma">beast.math.distributions.InverseGamma</map>
+	<map name="OneOnX">beast.math.distributions.OneOnX</map>
+
+
+
+
+	<run chainLength="100000000" id="mcmc" spec="MCMC">
+		<state id="state" storeEvery="100000">
+			<tree id="Tree.t:gene1" name="stateNode">
+				<trait id="dateTrait.t:gene1" spec="beast.evolution.tree.TraitSet" traitname="date-backward">
+				CA1.T401_1=0,CA3.T415_1=0,CB121212.12_1=5388,CB070117.03_1=6220,CB070121.08_1=25600,CB070121.16_1=30000
+					<taxa id="TaxonSet.gene1" spec="TaxonSet">
+						<data idref="gene1" name="alignment"/>
+					</taxa>
+				</trait>
+				<taxonset idref="TaxonSet.gene1"/>
+			</tree>
+			<tree id="Tree.t:gene2" name="stateNode">
+				<trait idref="dateTrait.t:gene1" spec="beast.evolution.tree.TraitSet" traitname="date-backward"/>
+				<taxonset idref="TaxonSet.gene1"/>
+			</tree>
+			<tree id="Tree.t:gene3" name="stateNode">
+				<trait idref="dateTrait.t:gene1" spec="beast.evolution.tree.TraitSet" traitname="date-backward"/>
+				<taxonset idref="TaxonSet.gene1"/>
+			</tree>
+			<parameter id="clockRate.c:gene1" name="stateNode">1.0E-8</parameter>
+			<parameter id="kappa.s:gene1" lower="0.0" name="stateNode">2.0</parameter>
+			<parameter id="gammaShape.s:gene1" name="stateNode">0.5</parameter>
+			<parameter id="popSize.t:gene1" name="stateNode">137550.0</parameter>
+		</state>
+
+
+	<init estimate="false" id="RandomTree.t:gene1" initial="@Tree.t:gene1"
+		spec="beast.evolution.tree.RandomTree" taxa="@gene1">
+		<populationModel id="ConstantPopulation0.t:gene1" spec="ConstantPopulation">
+			<parameter id="randomPopSize.t:gene1" name="popSize">300000.0</parameter>
+		</populationModel>
+	</init>
+	<init estimate="false" id="RandomTree.t:gene2" initial="@Tree.t:gene2"
+		spec="beast.evolution.tree.RandomTree" taxa="@gene2">
+		<populationModel id="ConstantPopulation0.t:gene2" spec="ConstantPopulation">
+			<parameter idref="randomPopSize.t:gene1" name="popSize"/>
+		</populationModel>
+	</init>
+	<init estimate="false" id="RandomTree.t:gene3" initial="@Tree.t:gene3"
+		spec="beast.evolution.tree.RandomTree" taxa="@gene3">
+		<populationModel id="ConstantPopulation0.t:gene3" spec="ConstantPopulation">
+			<parameter idref="randomPopSize.t:gene1" name="popSize"/>
+		</populationModel>
+	</init>
+
+
+		<distribution id="posterior" spec="util.CompoundDistribution">
+			<distribution id="prior" spec="util.CompoundDistribution">
+				<distribution id="CoalescentConstant.t:gene1" spec="Coalescent">
+					<populationModel id="ConstantPopulation.t:gene1"
+						popSize="@popSize.t:gene1" spec="ConstantPopulation"/>
+					<treeIntervals id="TreeIntervals.t:gene1" spec="TreeIntervals"
+						tree="@Tree.t:gene1"/>
+				</distribution>
+				<distribution id="CoalescentConstant.t:gene2" spec="Coalescent">
+					<populationModel id="ConstantPopulation.t:gene2"
+						popSize="@popSize.t:gene1" spec="ConstantPopulation"/>
+					<treeIntervals id="TreeIntervals.t:gene2" spec="TreeIntervals"
+						tree="@Tree.t:gene2"/>
+				</distribution>
+				<distribution id="CoalescentConstant.t:gene3" spec="Coalescent">
+					<populationModel id="ConstantPopulation.t:gene3"
+						popSize="@popSize.t:gene1" spec="ConstantPopulation"/>
+					<treeIntervals id="TreeIntervals.t:gene3" spec="TreeIntervals"
+						tree="@Tree.t:gene3"/>
+				</distribution>
+
+
+				<prior id="ClockPrior.c:gene1" name="distribution"
+						x="@clockRate.c:gene1">
+					<OneOnX id="OneOnX.1" name="distr"/>
+				</prior>
+				<prior id="GammaShapePrior.s:gene1" name="distribution"
+						x="@gammaShape.s:gene1">
+					<Exponential id="Exponential.0" name="distr">
+						<parameter id="RealParameter.0" lower="0.0" name="mean" upper="0.0">1.0</parameter>
+					</Exponential>
+				</prior>
+				<prior id="KappaPrior.s:gene1" name="distribution" x="@kappa.s:gene1">
+					<LogNormal id="LogNormalDistributionModel.0" name="distr">
+						<parameter estimate="false" id="RealParameter.01" name="M">1.0</parameter>
+						<parameter estimate="false" id="RealParameter.02" name="S">1.25</parameter>
+					</LogNormal>
+				</prior>
+				<prior id="PopSizePrior.t:gene1" name="distribution"
+						x="@popSize.t:gene1">
+					<OneOnX id="OneOnX.0" name="distr"/>
+				</prior>
+			</distribution>
+
+
+			<distribution id="likelihood" spec="util.CompoundDistribution">
+				<distribution data="@gene1" id="treeLikelihood.gene1"
+						spec="TreeLikelihood" tree="@Tree.t:gene1">
+					<siteModel gammaCategoryCount="4" id="SiteModel.s:gene1"
+							shape="@gammaShape.s:gene1" spec="SiteModel">
+						<parameter estimate="false" id="mutationRate.s:gene1" name="mutationRate">1.0</parameter>
+						<parameter estimate="false" id="proportionInvariant.s:gene1" lower="0.0"
+							name="proportionInvariant" upper="1.0">0.0</parameter>
+						<substModel id="hky.s:gene1" kappa="@kappa.s:gene1" spec="HKY">
+							<frequencies data="@gene1" id="empiricalFreqs.s:gene1" spec="Frequencies"/>
+						</substModel>
+					</siteModel>
+					<branchRateModel clock.rate="@clockRate.c:gene1"
+						id="StrictClock.c:gene1"
+						spec="beast.evolution.branchratemodel.StrictClockModel"/>
+				</distribution>
+				<distribution branchRateModel="@StrictClock.c:gene1" data="@gene2"
+					id="treeLikelihood.gene2" siteModel="@SiteModel.s:gene1"
+					spec="TreeLikelihood" tree="@Tree.t:gene2"/>
+				<distribution branchRateModel="@StrictClock.c:gene1" data="@gene3"
+					id="treeLikelihood.gene3" siteModel="@SiteModel.s:gene1"
+					spec="TreeLikelihood" tree="@Tree.t:gene3"/>
+			</distribution>
+		</distribution>
+
+
+		<operator id="treeScaler.t:gene1" scaleFactor="0.8" optimise="false" spec="ScaleOperator"
+			tree="@Tree.t:gene1" weight="3.0"/>
+
+		<operator id="treeRootScaler.t:gene1" rootOnly="true" scaleFactor="0.7" optimise="false" spec="ScaleOperator"
+			tree="@Tree.t:gene1" weight="3.0"/>
+
+		<operator id="UniformOperator.t:gene1" spec="Uniform" tree="@Tree.t:gene1"
+			weight="30.0"/>
+
+		<operator id="SubtreeSlide.t:gene1" spec="SubtreeSlide" tree="@Tree.t:gene1"
+			weight="15.0"/>
+
+		<operator id="narrow.t:gene1" spec="Exchange" tree="@Tree.t:gene1"
+			weight="15.0"/>
+
+		<operator id="wide.t:gene1" isNarrow="false" spec="Exchange"
+			tree="@Tree.t:gene1" weight="3.0"/>
+
+		<operator id="WilsonBalding.t:gene1" spec="WilsonBalding" tree="@Tree.t:gene1"
+			weight="3.0"/>
+		<operator id="treeScaler.t:gene2" scaleFactor="0.8" optimise="false" spec="ScaleOperator"
+			tree="@Tree.t:gene2" weight="3.0"/>
+
+		<operator id="treeRootScaler.t:gene2" rootOnly="true" scaleFactor="0.7" optimise="false" spec="ScaleOperator"
+			tree="@Tree.t:gene2" weight="3.0"/>
+
+		<operator id="UniformOperator.t:gene2" spec="Uniform" tree="@Tree.t:gene2"
+			weight="30.0"/>
+
+		<operator id="SubtreeSlide.t:gene2" spec="SubtreeSlide" tree="@Tree.t:gene2"
+			weight="15.0"/>
+
+		<operator id="narrow.t:gene2" spec="Exchange" tree="@Tree.t:gene2"
+			weight="15.0"/>
+
+		<operator id="wide.t:gene2" isNarrow="false" spec="Exchange"
+			tree="@Tree.t:gene2" weight="3.0"/>
+
+		<operator id="WilsonBalding.t:gene2" spec="WilsonBalding" tree="@Tree.t:gene2"
+			weight="3.0"/>
+		<operator id="treeScaler.t:gene3" scaleFactor="0.8" optimise="false" spec="ScaleOperator"
+			tree="@Tree.t:gene3" weight="3.0"/>
+
+		<operator id="treeRootScaler.t:gene3" rootOnly="true" scaleFactor="0.7" optimise="false" spec="ScaleOperator"
+			tree="@Tree.t:gene3" weight="3.0"/>
+
+		<operator id="UniformOperator.t:gene3" spec="Uniform" tree="@Tree.t:gene3"
+			weight="30.0"/>
+
+		<operator id="SubtreeSlide.t:gene3" spec="SubtreeSlide" tree="@Tree.t:gene3"
+			weight="15.0"/>
+
+		<operator id="narrow.t:gene3" spec="Exchange" tree="@Tree.t:gene3"
+			weight="15.0"/>
+
+		<operator id="wide.t:gene3" isNarrow="false" spec="Exchange"
+			tree="@Tree.t:gene3" weight="3.0"/>
+
+		<operator id="WilsonBalding.t:gene3" spec="WilsonBalding" tree="@Tree.t:gene3"
+			weight="3.0"/>
+
+
+		<operator id="strictClockUpDownOperator.c:gene1" scaleFactor="0.9" optimise="false" spec="UpDownOperator" weight="15.0">
+			<parameter idref="clockRate.c:gene1" name="up"/>
+			<tree idref="Tree.t:gene1" name="down"/>
+		</operator>
+		<operator id="strictClockUpDownOperator.c:gene2" scaleFactor="0.9" optimise="false" spec="UpDownOperator" weight="15.0">
+			<parameter idref="clockRate.c:gene1" name="up"/>
+			<tree idref="Tree.t:gene2" name="down"/>
+		</operator>
+		<operator id="strictClockUpDownOperator.c:gene3" scaleFactor="0.9" optimise="false" spec="UpDownOperator" weight="15.0">
+			<parameter idref="clockRate.c:gene1" name="up"/>
+			<tree idref="Tree.t:gene3" name="down"/>
+		</operator>
+
+
+		<operator id="strictClockUpDownOperator.all" scaleFactor="0.95" optimise="false" spec="UpDownOperator" weight="15.0">
+			<parameter idref="clockRate.c:gene1" name="up"/>
+			<tree idref="Tree.t:gene1" name="down"/>
+			<tree idref="Tree.t:gene2" name="down"/>
+			<tree idref="Tree.t:gene3" name="down"/>
+		</operator>
+
+
+
+
+		<operator id="StrictClockRateScaler.c:gene1" parameter="@clockRate.c:gene1"
+				scaleFactor="0.75" spec="ScaleOperator" weight="3.0"/>
+		<operator id="KappaScaler.s:gene1" parameter="@kappa.s:gene1"
+				scaleFactor="0.5" spec="ScaleOperator" weight="0.1"/>
+		<operator id="gammaShapeScaler.s:gene1" parameter="@gammaShape.s:gene1"
+				scaleFactor="0.5" spec="ScaleOperator" weight="0.1"/>
+
+
+		<logger fileName="testMultipleAlignments_randomTaxaOrder.xml.log" id="tracelog" logEvery="10000" model="@posterior" sanitiseHeaders="true" sort="smart">
+			<log idref="posterior"/>
+			<log idref="likelihood"/>
+			<log idref="prior"/>
+			<parameter idref="clockRate.c:gene1" name="log"/>
+			<parameter idref="kappa.s:gene1" name="log"/>
+			<parameter idref="gammaShape.s:gene1" name="log"/>
+			<parameter idref="popSize.t:gene1" name="log"/>
+
+			<log idref="treeLikelihood.gene1"/>
+			<log id="TreeHeight.t:gene1" spec="beast.evolution.tree.TreeHeightLogger" tree="@Tree.t:gene1"/>
+			<log idref="treeLikelihood.gene2"/>
+			<log id="TreeHeight.t:gene2" spec="beast.evolution.tree.TreeHeightLogger" tree="@Tree.t:gene2"/>
+			<log idref="treeLikelihood.gene3"/>
+			<log id="TreeHeight.t:gene3" spec="beast.evolution.tree.TreeHeightLogger" tree="@Tree.t:gene3"/>
+			<log idref="CoalescentConstant.t:gene1"/>
+			<log idref="CoalescentConstant.t:gene2"/>
+			<log idref="CoalescentConstant.t:gene3"/>
+		</logger>
+
+		<logger id="screenlog" logEvery="100000">
+			<log idref="posterior"/>
+			<log arg="@posterior" id="ESS.0" spec="util.ESS"/>
+			<log idref="likelihood"/>
+			<log idref="prior"/>
+			<log idref="clockRate.c:gene1"/>
+		</logger>
+
+<logger fileName="testMultipleAlignments_randomTaxaOrder_$(tree).trees" id="treelog.t:gene1" logEvery="100000" mode="tree">
+	<log id="TreeWithMetaDataLogger.t:gene1" spec="beast.evolution.tree.TreeWithMetaDataLogger"
+		tree="@Tree.t:gene1"/>
+</logger>
+<logger fileName="testMultipleAlignments_randomTaxaOrder_$(tree).trees" id="treelog.t:gene2" logEvery="100000" mode="tree">
+	<log id="TreeWithMetaDataLogger.t:gene2" spec="beast.evolution.tree.TreeWithMetaDataLogger"
+		tree="@Tree.t:gene2"/>
+</logger>
+<logger fileName="testMultipleAlignments_randomTaxaOrder_$(tree).trees" id="treelog.t:gene3" logEvery="100000" mode="tree">
+	<log id="TreeWithMetaDataLogger.t:gene3" spec="beast.evolution.tree.TreeWithMetaDataLogger"
+		tree="@Tree.t:gene3"/>
+</logger>
+	</run>
+</beast>
+
diff --git a/examples/testPlates.xml b/examples/testPlates.xml
new file mode 100644
index 0000000..1402753
--- /dev/null
+++ b/examples/testPlates.xml
@@ -0,0 +1,128 @@
+<beast version='2.0'
+       namespace='beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood'>
+
+
+    <!-- The sequence alignment                                                  -->
+    <!-- ntax=6 nchar=768                                                        -->
+    <!-- npatterns=69                                                            -->
+    <!-- split in three bits -->
+    <data id="alignment.p1" dataType="nucleotide">
+        <sequence taxon="human">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG        </sequence>
+        <sequence taxon="chimp">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA        </sequence>
+        <sequence taxon="bonobo">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA        </sequence>
+        <sequence taxon="gorilla">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTAAACATAGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA        </sequence>
+        <sequence taxon="orangutan">
+            AGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA        </sequence>
+        <sequence taxon="siamang">
+            AGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTA        </sequence>
+    </data>
+
+    <data id="alignment.p2" dataType="nucleotide">
+        <sequence taxon="human">
+            CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-        </sequence>
+        <sequence taxon="chimp">
+            CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-        </sequence>
+        <sequence taxon="bonobo">
+            CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAGC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTTGAATTTGCAATTCAATATGAAAA-        </sequence>
+        <sequence taxon="gorilla">
+            CAACACTTAATTTCTGTAAGGACTGCAAAACCCTACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCAATGGGACTCAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAT-        </sequence>
+        <sequence taxon="orangutan">
+            CAGCACTTAATTTCTGTAAGGACTGCAAAACCCCACTTTGCATCAACTGAGCGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCCTAGACCGATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAT-TGGCTTCAGTCCAAAGCCCCGGCAGGCCTTAAAGCTGCTCCTTCGAATTTGCAATTCAACATGACAA-        </sequence>
+        <sequence taxon="siamang">
+            CAAAACTTAATTTCTGCAAGGGCTGCAAAACCCTACTTTGCATCAACCGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCGATGGGACTTAAACCCATAAAAATTTAGTTAACAGCTAAACACCCTAAACAACCTGGCTTCAATCTAAAGCCCCGGCAGA-GTTGAAGCTGCTTCTTTGAACTTGCAATTCAACGTGAAAAA        </sequence>
+    </data>
+
+    <data id="alignment.p3" dataType="nucleotide">
+        <sequence taxon="human">
+            TCACCTCGGAGCTTGGTAAAAAGAGGCCTAACCCCTGTCTTTAGATTTACAGTCCAATGCTTCA-CTCAGCCATTTTACCACAAAAAAGGAAGGAATCGAACCCCCCAAAGCTGGTTTCAAGCCAACCCCATGGCCTCCATGACTTTTTCAAAAGGTATTAGAAAAACCATTTCATAACTTTGTCAAAGTTAAATTATAGGCT-AAATCCTATATATCTTA-CACTGTAAAGCTAACTTAGCATTAACCTTTTAAGTTAAAGATTAAGAGAACCAACACCTCTTTACAGTGA
+        </sequence>
+        <sequence taxon="chimp">
+            TCACCTCAGAGCTTGGTAAAAAGAGGCTTAACCCCTGTCTTTAGATTTACAGTCCAATGCTTCA-CTCAGCCATTTTACCACAAAAAAGGAAGGAATCGAACCCCCTAAAGCTGGTTTCAAGCCAACCCCATGACCTCCATGACTTTTTCAAAAGATATTAGAAAAACTATTTCATAACTTTGTCAAAGTTAAATTACAGGTT-AACCCCCGTATATCTTA-CACTGTAAAGCTAACCTAGCATTAACCTTTTAAGTTAAAGATTAAGAGGACCGACACCTCTTTACAGTGA
+        </sequence>
+        <sequence taxon="bonobo">
+            TCACCTCAGAGCTTGGTAAAAAGAGGCTTAACCCCTGTCTTTAGATTTACAGTCCAATGCTTCA-CTCAGCCATTTTACCACAAAAAAGGAAGGAATCGAACCCCCTAAAGCTGGTTTCAAGCCAACCCCATGACCCCCATGACTTTTTCAAAAGATATTAGAAAAACTATTTCATAACTTTGTCAAAGTTAAATTACAGGTT-AAACCCCGTATATCTTA-CACTGTAAAGCTAACCTAGCATTAACCTTTTAAGTTAAAGATTAAGAGGACCAACACCTCTTTACAGTGA
+        </sequence>
+        <sequence taxon="gorilla">
+            TCACCTCGGAGCTTGGTAAAAAGAGGCCCAGCCTCTGTCTTTAGATTTACAGTCCAATGCCTTA-CTCAGCCATTTTACCACAAAAAAGGAAGGAATCGAACCCCCCAAAGCTGGTTTCAAGCCAACCCCATGACCTTCATGACTTTTTCAAAAGATATTAGAAAAACTATTTCATAACTTTGTCAAGGTTAAATTACGGGTT-AAACCCCGTATATCTTA-CACTGTAAAGCTAACCTAGCGTTAACCTTTTAAGTTAAAGATTAAGAGTATCGGCACCTCTTTGCAGTGA
+        </sequence>
+        <sequence taxon="orangutan">
+            TCACCTCAGGGCTTGGTAAAAAGAGGTCTGACCCCTGTTCTTAGATTTACAGCCTAATGCCTTAACTCGGCCATTTTACCGCAAAAAAGGAAGGAATCGAACCTCCTAAAGCTGGTTTCAAGCCAACCCCATAACCCCCATGACTTTTTCAAAAGGTACTAGAAAAACCATTTCGTAACTTTGTCAAAGTTAAATTACAGGTC-AGACCCTGTGTATCTTA-CATTGCAAAGCTAACCTAGCATTAACCTTTTAAGTTAAAGACTAAGAGAACCAGCCTCTCTTTGCAATGA
+        </sequence>
+        <sequence taxon="siamang">
+            TCACTTCGGAGCTTGGCAAAAAGAGGTTTCACCTCTGTCCTTAGATTTACAGTCTAATGCTTTA-CTCAGCCACTTTACCACAAAAAAGGAAGGAATCGAACCCTCTAAAACCGGTTTCAAGCCAGCCCCATAACCTTTATGACTTTTTCAAAAGATATTAGAAAAACTATTTCATAACTTTGTCAAAGTTAAATCACAGGTCCAAACCCCGTATATCTTATCACTGTAGAGCTAGACCAGCATTAACCTTTTAAGTTAAAGACTAAGAGAACTACCGCCTCTTTACAGTGA
+        </sequence>
+    </data>
+
+    <plate spec='util.Plate' var='n' range='.p1,.p2,.p3'>
+        <!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+        <input spec='HKY' id='hky$(n)' kappa='@hky.kappa$(n)'>
+            <frequencies id='freqs$(n)' spec='Frequencies' data='@alignment$(n)'/>
+        </input>
+
+        <!-- site model                                                              -->
+        <input spec='SiteModel' id="siteModel$(n)" substModel='@hky$(n)'/>
+
+        <input spec='TreeLikelihood' id="treeLikelihood$(n)"
+            data="@alignment$(n)"
+            tree="@tree"
+            siteModel="@siteModel$(n)"
+        />
+
+        <parameter id="hky.kappa$(n)" value="1.0" lower="0.0"/>
+    </plate>
+
+    <tree spec='beast.util.ClusterTree' id='tree' clusterType='upgma' taxa='@alignment.p1'/>
+
+
+    <run spec="MCMC" id="mcmc" chainLength="10000000">
+        <state storeEvery='100000'>
+            <stateNode idref="hky.kappa.p1"/>
+            <stateNode idref="hky.kappa.p2"/>
+            <stateNode idref="hky.kappa.p3"/>
+            <stateNode idref="tree"/>
+        </state>
+
+        <distribution spec='CompoundDistribution' id='likelihood'>
+            <plate var='n' range='.p1,.p2,.p3'>
+                <distribution id='likelihood$(n)' idref="treeLikelihood$(n)"/>
+            </plate>
+        </distribution>
+    
+        <plate var='n' range='.p1,.p2,.p3'>
+            <operator id='kappaScaler$(n)' spec='ScaleOperator' scaleFactor="0.5" weight="1" parameter="@hky.kappa$(n)"/>
+        </plate>
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" tree="@tree"/>
+        <operator spec='Uniform' weight="10" tree="@tree"/>
+        <operator spec='SubtreeSlide' weight="5" gaussian="true" size="1.0" tree="@tree"/>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="1" tree="@tree"/>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="1" tree="@tree"/>
+        <operator spec='WilsonBalding' weight="1" tree="@tree"/>
+
+        <logger logEvery="10000" fileName="test.$(seed).log">
+	        <model idref='likelihood'/>
+            <log idref="likelihood"/>
+            <plate var='n' range='.p1,.p2,.p3'>
+                <log idref='hky.kappa$(n)'/>
+            </plate>
+            <log spec='beast.evolution.tree.TreeHeightLogger'><tree idref='tree'/></log>
+        </logger>
+        <logger logEvery="10000" fileName="test.$(seed).trees">
+            <log idref="tree"/>
+        </logger>
+        <logger logEvery="10000">
+	        <model idref='likelihood'/>
+            <log idref="likelihood"/>
+    	    <ESS spec='ESS' name='log' arg="@likelihood"/>
+            <plate var='n' range='.p1,.p2,.p3'>
+                <log idref='hky.kappa$(n)'/>
+        	    <ESS spec='ESS' name='log' arg="@hky.kappa$(n)"/>
+            </plate>
+        </logger>
+
+    </run>
+
+</beast>
diff --git a/examples/testRNA.xml b/examples/testRNA.xml
new file mode 100644
index 0000000..8b32045
--- /dev/null
+++ b/examples/testRNA.xml
@@ -0,0 +1,212 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<beast beautitemplate='Standard' beautistatus=''
+       namespace="beast.core:beast.evolution.alignment:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood"
+       version="2.0">
+
+<!-- A fake RNA alignment.  Should give exactly the same result as testGTR.xml. -->
+
+    <data id="primate-mtDNA">
+        <sequence id="seq_Lemur_catta" taxon="Lemur_catta" totalcount="4"
+                  value="AAGCUUCAUAGGAGCAACCAUUCUAAUAAUCGCACAUGGCCUUACAUCAUCCAUAUUAUUCUGUCUAGCCAACUCUAACUACGAACGAAUCCAUAGCCGUACAAUACUACUAGCACGAGGGAUCCAAACCAUUCUCCCUCUUAUAGCCACCUGAUGACUACUCGCCAGCCUAACUAACCUAGCCCUACCCACCUCUAUCAAUUUAAUUGGCGAACUAUUCGUCACUAUAGCAUCCUUCUCAUGAUCAAACAUUACAAUUAUCUUAAUAGGCUUAAAUAUGCUCAUCACCGCUCUCUAUUCCCUCUAUAUAUUAACUACUACACAACGAGGAAAACUCACAUAUCAUUCGCACAACCUAAACCCAUCCUUUACACGAGAAAACACCCUUAUAUCCAUACACAUACUCCCCCUUCUCCUAUUUACCUUAAACCCCAAAAUUAUUCUAGGACCCACGUACUGUAAAUAUA [...]
+        <sequence id="seq_Homo_sapiens" taxon="Homo_sapiens" totalcount="4"
+                  value="AAGCUUCACCGGCGCAGUCAUUCUCAUAAUCGCCCACGGGCUUACAUCCUCAUUACUAUUCUGCCUAGCAAACUCAAACUACGAACGCACUCACAGUCGCAUCAUAAUCCUCUCUCAAGGACUUCAAACUCUACUCCCACUAAUAGCUUUUUGAUGACUUCUAGCAAGCCUCGCUAACCUCGCCUUACCCCCCACUAUUAACCUACUGGGAGAACUCUCUGUGCUAGUAACCACGUUCUCCUGAUCAAAUAUCACUCUCCUACUUACAGGACUCAACAUACUAGUCACAGCCCUAUACUCCCUCUACAUAUUUACCACAACACAAUGGGGCUCACUCACCCACCACAUUAACAACAUAAAACCCUCAUUCACACGAGAAAACACCCUCAUGUUCAUACACCUAUCCCCCAUUCUCCUCCUAUCCCUCAACCCCGACAUCAUUACCGGGUUUUCCUCUUGUAAAUAUA [...]
+        <sequence id="seq_Pan" taxon="Pan" totalcount="4"
+                  value="AAGCUUCACCGGCGCAAUUAUCCUCAUAAUCGCCCACGGACUUACAUCCUCAUUAUUAUUCUGCCUAGCAAACUCAAAUUAUGAACGCACCCACAGUCGCAUCAUAAUUCUCUCCCAAGGACUUCAAACUCUACUCCCACUAAUAGCCUUUUGAUGACUCCUAGCAAGCCUCGCUAACCUCGCCCUACCCCCUACCAUUAAUCUCCUAGGGGAACUCUCCGUGCUAGUAACCUCAUUCUCCUGAUCAAAUACCACUCUCCUACUCACAGGAUUCAACAUACUAAUCACAGCCCUGUACUCCCUCUACAUGUUUACCACAACACAAUGAGGCUCACUCACCCACCACAUUAAUAACAUAAAGCCCUCAUUCACACGAGAAAAUACUCUCAUAUUUUUACACCUAUCCCCCAUCCUCCUUCUAUCCCUCAAUCCUGAUAUCAUCACUGGAUUCACCUCCUGUAAAUAUA [...]
+        <sequence id="seq_Gorilla" taxon="Gorilla" totalcount="4"
+                  value="AAGCUUCACCGGCGCAGUUGUUCUUAUAAUUGCCCACGGACUUACAUCAUCAUUAUUAUUCUGCCUAGCAAACUCAAACUACGAACGAACCCACAGCCGCAUCAUAAUUCUCUCUCAAGGACUCCAAACCCUACUCCCACUAAUAGCCCUUUGAUGACUUCUGGCAAGCCUCGCCAACCUCGCCUUACCCCCCACCAUUAACCUACUAGGAGAGCUCUCCGUACUAGUAACCACAUUCUCCUGAUCAAACACCACCCUUUUACUUACAGGAUCUAACAUACUAAUUACAGCCCUGUACUCCCUUUAUAUAUUUACCACAACACAAUGAGGCCCACUCACACACCACAUCACCAACAUAAAACCCUCAUUUACACGAGAAAACAUCCUCAUAUUCAUGCACCUAUCCCCCAUCCUCCUCCUAUCCCUCAACCCCGAUAUUAUCACCGGGUUCACCUCCUGUAAAUAUA [...]
+        <sequence id="seq_Pongo" taxon="Pongo" totalcount="4"
+                  value="AAGCUUCACCGGCGCAACCACCCUCAUGAUUGCCCAUGGACUCACAUCCUCCCUACUGUUCUGCCUAGCAAACUCAAACUACGAACGAACCCACAGCCGCAUCAUAAUCCUCUCUCAAGGCCUUCAAACUCUACUCCCCCUAAUAGCCCUCUGAUGACUUCUAGCAAGCCUCACUAACCUUGCCCUACCACCCACCAUCAACCUUCUAGGAGAACUCUCCGUACUAAUAGCCAUAUUCUCUUGAUCUAACAUCACCAUCCUACUAACAGGACUCAACAUACUAAUCACAACCCUAUACUCUCUCUAUAUAUUCACCACAACACAACGAGGUACACCCACACACCACAUCAACAACAUAAAACCUUCUUUCACACGCGAAAAUACCCUCAUGCUCAUACACCUAUCCCCCAUCCUCCUCUUAUCCCUCAACCCCAGCAUCAUCGCUGGGUUCGCCUACUGUAAAUAUA [...]
+        <sequence id="seq_Hylobates" taxon="Hylobates" totalcount="4"
+                  value="AAGCUUUACAGGUGCAACCGUCCUCAUAAUCGCCCACGGACUAACCUCUUCCCUGCUAUUCUGCCUUGCAAACUCAAACUACGAACGAACUCACAGCCGCAUCAUAAUCCUAUCUCGAGGGCUCCAAGCCUUACUCCCACUGAUAGCCUUCUGAUGACUCGCAGCAAGCCUCGCUAACCUCGCCCUACCCCCCACUAUUAACCUCCUAGGUGAACUCUUCGUACUAAUGGCCUCCUUCUCCUGGGCAAACACUACUAUUACACUCACCGGGCUCAACGUACUAAUCACGGCCCUAUACUCCCUUUACAUAUUUAUCAUAACACAACGAGGCACACUUACACACCACAUUAAAAACAUAAAACCCUCACUCACACGAGAAAACAUAUUAAUACUUAUGCACCUCUUCCCCCUCCUCCUCCUAACCCUCAACCCUAACAUCAUUACUGGCUUUACUCCCUGUAAACAUA [...]
+        <sequence id="seq_Macaca_fuscata" taxon="Macaca_fuscata" totalcount="4"
+                  value="AAGCUUUUCCGGCGCAACCAUCCUUAUGAUCGCUCACGGACUCACCUCUUCCAUAUAUUUCUGCCUAGCCAAUUCAAACUAUGAACGCACUCACAACCGUACCAUACUACUGUCCCGAGGACUUCAAAUCCUACUUCCACUAACAGCCUUUUGAUGAUUAACAGCAAGCCUUACUAACCUUGCCCUACCCCCCACUAUCAAUCUACUAGGUGAACUCUUUGUAAUCGCAACCUCAUUCUCCUGAUCCCAUAUCACCAUUAUGCUAACAGGACUUAACAUAUUAAUUACGGCCCUCUACUCUCUCCACAUAUUCACUACAACACAACGAGGAACACUCACACAUCACAUAAUCAACAUAAAGCCCCCCUUCACACGAGAAAACACAUUAAUAUUCAUACACCUCGCUCCAAUUAUCCUUCUAUCCCUCAACCCCAACAUCAUCCUGGGGUUUACCUCCUGUAGAUAUA [...]
+        <sequence id="seq_M._mulatta" taxon="M._mulatta" totalcount="4"
+                  value="AAGCUUUUCUGGCGCAACCAUCCUCAUGAUUGCUCACGGACUCACCUCUUCCAUAUAUUUCUGCCUAGCCAAUUCAAACUAUGAACGCACUCACAACCGUACCAUACUACUGUCCCGGGGACUUCAAAUCCUACUUCCACUAACAGCUUUCUGAUGAUUAACAGCAAGCCUUACUAACCUUGCCCUACCCCCCACUAUCAACCUACUAGGUGAACUCUUUGUAAUCGCGACCUCAUUCUCCUGGUCCCAUAUCACCAUUAUAUUAACAGGAUUUAACAUACUAAUUACGGCCCUCUACUCCCUCCACAUAUUCACCACAACACAACGAGGAGCACUCACACAUCACAUAAUCAACAUAAAACCCCCCUUCACACGAGAAAACAUAUUAAUAUUCAUACACCUCGCUCCAAUCAUCCUCCUAUCUCUCAACCCCAACAUCAUCCUGGGGUUUACUUCCUGUAGAUAUA [...]
+        <sequence id="seq_M._fascicularis" taxon="M._fascicularis" totalcount="4"
+                  value="AAGCUUCUCCGGCGCAACCACCCUUAUAAUCGCCCACGGGCUCACCUCUUCCAUGUAUUUCUGCUUGGCCAAUUCAAACUAUGAGCGCACUCAUAACCGUACCAUACUACUAUCCCGAGGACUUCAAAUUCUACUUCCAUUGACAGCCUUCUGAUGACUCACAGCAAGCCUUACUAACCUUGCCCUACCCCCCACUAUUAAUCUACUAGGCGAACUCUUUGUAAUCACAACUUCAUUUUCCUGAUCCCAUAUCACCAUUGUGUUAACGGGCCUUAAUAUACUAAUCACAGCCCUCUACUCUCUCCACAUGUUCAUUACAGUACAACGAGGAACACUCACACACCACAUAAUCAAUAUAAAACCCCCCUUCACACGAGAAAACAUAUUAAUAUUCAUACACCUCGCUCCAAUUAUCCUUCUAUCUCUCAACCCCAACAUCAUCCUGGGGUUUACCUCCUGUAAAUAUA [...]
+        <sequence id="seq_M._sylvanus" taxon="M._sylvanus" totalcount="4"
+                  value="AAGCUUCUCCGGUGCAACUAUCCUUAUAGUUGCCCAUGGACUCACCUCUUCCAUAUACUUCUGCUUGGCCAACUCAAACUACGAACGCACCCACAGCCGCAUCAUACUACUAUCCCGAGGACUCCAAAUCCUACUCCCACUAACAGCCUUCUGAUGAUUCACAGCAAGCCUUACUAAUCUUGCUCUACCCUCCACUAUUAAUCUACUGGGCGAACUCUUCGUAAUCGCAACCUCAUUUUCCUGAUCCCACAUCACCAUCAUACUAACAGGACUGAACAUACUAAUUACAGCCCUCUACUCUCUUCACAUAUUCACCACAACACAACGAGGAGCGCUCACACACCACAUAAUUAACAUAAAACCACCUUUCACACGAGAAAACAUAUUAAUACUCAUACACCUCGCUCCAAUUAUUCUUCUAUCUCUUAACCCCAACAUCAUUCUAGGAUUUACUUCCUGUAAAUAUA [...]
+        <sequence id="seq_Saimiri_sciureus" taxon="Saimiri_sciureus" totalcount="4"
+                  value="AAGCUUCACCGGCGCAAUGAUCCUAAUAAUCGCUCACGGGUUUACUUCGUCUAUGCUAUUCUGCCUAGCAAACUCAAAUUACGAACGAAUUCACAGCCGAACAAUAACAUUUACUCGAGGGCUCCAAACACUAUUCCCGCUUAUAGGCCUCUGAUGACUCCUAGCAAAUCUCGCUAACCUCGCCCUACCCACAGCUAUUAAUCUAGUAGGAGAAUUACUCACAAUCGUAUCUUCCUUCUCUUGAUCCAACUUUACUAUUAUAUUCACAGGACUUAAUAUACUAAUUACAGCACUCUACUCACUUCAUAUGUAUGCCUCUACACAGCGAGGUCCACUUACAUACAGCACCAGCAAUAUAAAACCAAUAUUUACACGAGAAAAUACGCUAAUAUUUAUACAUAUAACACCAAUCCUCCUCCUUACCUUGAGCCCCAAGGUAAUUAUAGGACCCUCACCUUGUAAUUAUA [...]
+        <sequence id="seq_Tarsius_syrichta" taxon="Tarsius_syrichta" totalcount="4"
+                  value="AAGUUUCAUUGGAGCCACCACUCUUAUAAUUGCCCAUGGCCUCACCUCCUCCCUAUUAUUUUGCCUAGCAAAUACAAACUACGAACGAGUCCACAGUCGAACAAUAGCACUAGCCCGUGGCCUUCAAACCCUAUUACCUCUUGCAGCAACAUGAUGACUCCUCGCCAGCUUAACCAACCUGGCCCUUCCCCCAACAAUUAAUUUAAUCGGUGAACUGUCCGUAAUAAUAGCAGCAUUUUCAUGGUCACACCUAACUAUUAUCUUAGUAGGCCUUAACACCCUUAUCACCGCCCUAUAUUCCCUAUAUAUACUAAUCAUAACUCAACGAGGAAAAUACACAUAUCAUAUCAACAAUAUCAUGCCCCCUUUCACCCGAGAAAAUACAUUAAUAAUCAUACACCUAUUUCCCUUAAUCCUACUAUCUACCAACCCCAAAGUAAUUAUAGGAACCAUGUACUGUAAAUAUA [...]
+    </data>
+
+
+    <map name="Beta">beast.math.distributions.Beta</map>
+    <map name="Exponential">beast.math.distributions.Exponential</map>
+    <map name="InverseGamma">beast.math.distributions.InverseGamma</map>
+    <map name="LogNormal">beast.math.distributions.LogNormalDistributionModel</map>
+    <map name="Gamma">beast.math.distributions.Gamma</map>
+    <map name="Uniform">beast.math.distributions.Uniform</map>
+    <map name="prior">beast.math.distributions.Prior</map>
+    <map name="LaplaceDistribution">beast.math.distributions.LaplaceDistribution</map>
+    <map name="OneOnX">beast.math.distributions.OneOnX</map>
+    <map name="Normal">beast.math.distributions.Normal</map>
+
+
+    <run chainLength="5000000" id="mcmc" spec="MCMC">
+        <state id="state" storeEvery="5000">
+            <tree id="Tree.t:primate" name="stateNode">
+                <taxonset id="TaxonSet.coding" spec="TaxonSet">
+                    <alignment filter="2-457,660-896" id="coding" spec="FilteredAlignment">
+                        <data idref="primate-mtDNA"/>
+                    </alignment>
+                </taxonset>
+            </tree>
+            <parameter id="birthRate.t:primate" name="stateNode" value="1.0"/>
+            <parameter id="rateAC.s:primate" lower="0.0" name="stateNode" value="1.0"/>
+            <parameter id="rateAG.s:primate" lower="0.0" name="stateNode" value="1.0"/>
+            <parameter id="rateAT.s:primate" lower="0.0" name="stateNode" value="1.0"/>
+            <parameter id="rateCG.s:primate" lower="0.0" name="stateNode" value="1.0"/>
+            <parameter id="rateGT.s:primate" lower="0.0" name="stateNode" value="1.0"/>
+            <parameter dimension="4" id="freqParameter.s:primate" lower="0.0" name="stateNode" upper="1.0"
+                       value="0.25"/>
+        </state>
+
+        <init estimate="false" id="RandomTree.t:primate" initial="@Tree.t:primate"
+              spec="beast.evolution.tree.RandomTree" taxa="@coding">
+            <populationModel id="ConstantPopulation0.t:primate" spec="ConstantPopulation">
+                <parameter id="randomPopSize.t:primate" name="popSize" value="1"/>
+            </populationModel>
+        </init>
+
+        <distribution id="posterior" spec="util.CompoundDistribution">
+            <distribution id="prior" spec="util.CompoundDistribution">
+                <distribution birthDiffRate="@birthRate.t:primate" id="YuleModel.t:primate"
+                              spec="beast.evolution.speciation.YuleModel" tree="@Tree.t:primate"/>
+                <prior id="YuleBirthRatePrior.t:primate" name="distribution" x="@birthRate.t:primate">
+                    <Uniform id="Uniform.0" name="distr" upper="Infinity"/>
+                </prior>
+                <prior id="RateACPrior.s:primate" name="distribution" x="@rateAC.s:primate">
+                    <LogNormal id="LogNormalDistributionModel.0" name="distr">
+                        <parameter estimate="false" id="RealParameter.0" name="M" value="0"/>
+                        <parameter estimate="false" id="RealParameter.01" lower="0.0" name="S" upper="5.0"
+                                   value="1.25"/>
+                    </LogNormal>
+                </prior>
+                <prior id="RateAGPrior.s:primate" name="distribution" x="@rateAG.s:primate">
+                    <LogNormal id="LogNormalDistributionModel.01" name="distr">
+                        <parameter estimate="false" id="RealParameter.02" name="M" value="0"/>
+                        <parameter estimate="false" id="RealParameter.03" lower="0.0" name="S" upper="5.0"
+                                   value="1.25"/>
+                    </LogNormal>
+                </prior>
+                <prior id="RateATPrior.s:primate" name="distribution" x="@rateAT.s:primate">
+                    <LogNormal id="LogNormalDistributionModel.02" name="distr">
+                        <parameter estimate="false" id="RealParameter.04" name="M" value="0"/>
+                        <parameter estimate="false" id="RealParameter.05" lower="0.0" name="S" upper="5.0"
+                                   value="1.25"/>
+                    </LogNormal>
+                </prior>
+                <prior id="RateCGPrior.s:primate" name="distribution" x="@rateCG.s:primate">
+                    <LogNormal id="LogNormalDistributionModel.03" name="distr">
+                        <parameter estimate="false" id="RealParameter.06" name="M" value="0"/>
+                        <parameter estimate="false" id="RealParameter.07" lower="0.0" name="S" upper="5.0"
+                                   value="1.25"/>
+                    </LogNormal>
+                </prior>
+                <prior id="RateGTPrior.s:primate" name="distribution" x="@rateGT.s:primate">
+                    <LogNormal id="LogNormalDistributionModel.04" name="distr">
+                        <parameter estimate="false" id="RealParameter.08" name="M" value="0"/>
+                        <parameter estimate="false" id="RealParameter.09" lower="0.0" name="S" upper="5.0"
+                                   value="1.25"/>
+                    </LogNormal>
+                </prior>
+            </distribution>
+            <distribution id="likelihood" spec="util.CompoundDistribution">
+                <distribution data="@coding" id="treeLikelihood.coding" spec="TreeLikelihood" tree="@Tree.t:primate">
+                    <siteModel id="SiteModel.s:primate" spec="SiteModel">
+                        <parameter estimate="false" id="mutationRate.s:primate" name="mutationRate" value="1.0"/>
+                        <parameter estimate="false" id="gammaShape.s:primate" name="shape" value="1.0"/>
+                        <parameter estimate="false" id="proportionInvariant.s:primate" lower="0.0"
+                                   name="proportionInvariant" upper="1.0" value="0.0"/>
+                        <substModel id="gtr.s:primate" rateAC="@rateAC.s:primate" rateAG="@rateAG.s:primate"
+                                    rateAT="@rateAT.s:primate" rateCG="@rateCG.s:primate" rateGT="@rateGT.s:primate"
+                                    spec="GTR">
+                            <parameter estimate="false" id="rateCT.s:primate" lower="0.0" name="rateCT" value="1.0"/>
+                            <frequencies frequencies="@freqParameter.s:primate" id="estimatedFreqs.s:primate"
+                                         spec="Frequencies"/>
+                        </substModel>
+                    </siteModel>
+                    <branchRateModel id="StrictClock.c:primate" spec="beast.evolution.branchratemodel.StrictClockModel">
+                        <parameter estimate="false" id="clockRate.c:primate" name="clock.rate" value="1.0"/>
+                    </branchRateModel>
+                </distribution>
+                <distribution branchRateModel="@StrictClock.c:primate" id="treeLikelihood.noncoding"
+                              siteModel="@SiteModel.s:primate" spec="TreeLikelihood" tree="@Tree.t:primate">
+                    <data data="@primate-mtDNA" filter="1,458-659,897-898" id="noncoding" spec="FilteredAlignment"/>
+                </distribution>
+            </distribution>
+        </distribution>
+
+        <operator id="YuleBirthRateScaler.t:primate" parameter="@birthRate.t:primate" scaleFactor="0.75"
+                  spec="ScaleOperator" weight="3.0"/>
+
+        <operator id="treeScaler.t:primate" scaleFactor="0.5" spec="ScaleOperator" tree="@Tree.t:primate" weight="3.0"/>
+
+        <operator id="treeRootScaler.t:primate" rootOnly="true" scaleFactor="0.5" spec="ScaleOperator"
+                  tree="@Tree.t:primate" weight="3.0"/>
+
+        <operator id="UniformOperator.t:primate" spec="Uniform" tree="@Tree.t:primate" weight="30.0"/>
+
+        <operator id="SubtreeSlide.t:primate" spec="SubtreeSlide" tree="@Tree.t:primate" weight="15.0"/>
+
+        <operator id="narrow.t:primate" spec="Exchange" tree="@Tree.t:primate" weight="15.0"/>
+
+        <operator id="wide.t:primate" isNarrow="false" spec="Exchange" tree="@Tree.t:primate" weight="3.0"/>
+
+        <operator id="WilsonBalding.t:primate" spec="WilsonBalding" tree="@Tree.t:primate" weight="3.0"/>
+
+        <operator id="RateACScaler.s:primate" parameter="@rateAC.s:primate" scaleFactor="0.5" spec="ScaleOperator"
+                  weight="0.1"/>
+
+        <operator id="RateAGScaler.s:primate" parameter="@rateAG.s:primate" scaleFactor="0.5" spec="ScaleOperator"
+                  weight="0.1"/>
+
+        <operator id="RateATScaler.s:primate" parameter="@rateAT.s:primate" scaleFactor="0.5" spec="ScaleOperator"
+                  weight="0.1"/>
+
+        <operator id="RateCGScaler.s:primate" parameter="@rateCG.s:primate" scaleFactor="0.5" spec="ScaleOperator"
+                  weight="0.1"/>
+
+        <operator id="RateGTScaler.s:primate" parameter="@rateGT.s:primate" scaleFactor="0.5" spec="ScaleOperator"
+                  weight="0.1"/>
+
+        <operator delta="0.01" id="FrequenciesExchanger.s:primate" spec="DeltaExchangeOperator" weight="0.1">
+            <parameter idref="freqParameter.s:primate"/>
+        </operator>
+
+        <logger fileName="testRNA.log" id="tracelog" logEvery="5000" model="@posterior" sanitiseHeaders="true"
+                sort="smart">
+            <log idref="posterior"/>
+            <log idref="likelihood"/>
+            <log idref="prior"/>
+            <log idref="treeLikelihood.noncoding"/>
+            <log idref="treeLikelihood.coding"/>
+            <log id="TreeHeight.t:primate" spec="beast.evolution.tree.TreeHeightLogger" tree="@Tree.t:primate"/>
+            <log idref="YuleModel.t:primate"/>
+            <parameter idref="birthRate.t:primate" name="log"/>
+            <parameter idref="rateAC.s:primate" name="log"/>
+            <parameter idref="rateAG.s:primate" name="log"/>
+            <parameter idref="rateAT.s:primate" name="log"/>
+            <parameter idref="rateCG.s:primate" name="log"/>
+            <parameter idref="rateGT.s:primate" name="log"/>
+            <parameter idref="freqParameter.s:primate" name="log"/>
+        </logger>
+
+        <logger id="screenlog" logEvery="5000">
+            <log idref="posterior"/>
+            <log arg="@posterior" id="ESS.0" spec="util.ESS"/>
+            <log idref="likelihood"/>
+            <log idref="prior"/>
+        </logger>
+
+        <logger fileName="testRNA.trees" id="treelog.t:primate" logEvery="5000" mode="tree">
+            <log id="TreeWithMetaDataLogger.t:primate" spec="beast.evolution.tree.TreeWithMetaDataLogger"
+                 tree="@Tree.t:primate"/>
+        </logger>
+
+    </run>
+
+</beast>
diff --git a/examples/testRandomLocalClock.xml b/examples/testRandomLocalClock.xml
new file mode 100644
index 0000000..17e2974
--- /dev/null
+++ b/examples/testRandomLocalClock.xml
@@ -0,0 +1,120 @@
+<beast version='2.0'
+       namespace='beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.branchratemodel:beast.evolution.likelihood:beast.core.parameter'>
+
+
+    <!-- The sequence alignment (each sequence refers to a taxon above).         -->
+    <!-- ntax=6 nchar=768                                                        -->
+    <!-- npatterns=69                                                            -->
+    <data id="alignment" dataType="nucleotide">
+        <sequence taxon="human">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="chimp">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="bonobo">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAGC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTTGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="gorilla">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTAAACATAGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA-CAACACTTAATTTCTGTAAGGACTGCAAAACCCTACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCAATGGGACTCAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAT-TCAC [...]
+        </sequence>
+        <sequence taxon="orangutan">
+            AGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA-CAGCACTTAATTTCTGTAAGGACTGCAAAACCCCACTTTGCATCAACTGAGCGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCCTAGACCGATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAT-TGGCTTCAGTCCAAAGCCCCGGCAGGCCTTAAAGCTGCTCCTTCGAATTTGCAATTCAACATGACAA-TCAC [...]
+        </sequence>
+        <sequence taxon="siamang">
+            AGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTAACAAAACTTAATTTCTGCAAGGGCTGCAAAACCCTACTTTGCATCAACCGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCGATGGGACTTAAACCCATAAAAATTTAGTTAACAGCTAAACACCCTAAACAACCTGGCTTCAATCTAAAGCCCCGGCAGA-GTTGAAGCTGCTTCTTTGAACTTGCAATTCAACGTGAAAAATCAC [...]
+        </sequence>
+    </data>
+
+
+
+
+    <input spec='RandomLocalClockModel' id="branchRates" ratesAreMultipliers="false" tree='@tree'>
+        <!--<parameter name='mutationRate'>1.0</parameter>-->
+        <parameter name='rates' id='rates' value="1" lower='0' upper='100'/>
+        <indicators spec='BooleanParameter' id='indicators' value="false"/>
+    </input>
+
+    <input spec='TreeLikelihood' id="treeLikelihood" data='@alignment' tree='@tree' branchRateModel='@branchRates'>
+        <siteModel spec='SiteModel' id="siteModel">
+            <!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+            <substModel spec='HKY' id="hky">
+                <parameter name='kappa' idref='hky.kappa'/>
+                <frequencies id='freqs' spec='Frequencies' data='@alignment'/>
+            </substModel>
+        </siteModel>
+    </input>
+
+    <tree spec='beast.util.ClusterTree' id='tree' clusterType='upgma' taxa='@alignment'/>
+
+    <parameter spec='beast.core.parameter.RealParameter' id="hky.kappa">1.0</parameter>
+
+    <parameter spec='beast.core.parameter.RealParameter' id="popSize">1.0</parameter>
+
+
+    <run spec="MCMC" id="mcmc" chainLength="2000000"> <!--autoOptimize="true"-->
+        <state>
+            <input name='stateNode' idref='hky.kappa'/>
+            <input name='stateNode' idref='popSize'/>
+            <input name='stateNode' idref='rates'/>
+            <input name='stateNode' idref='tree'/>
+            <input name='stateNode' idref='indicators'/>
+        </state>
+
+        <distribution spec="CompoundDistribution" id="posterior">
+            <distribution id="coalescent" spec="Coalescent">
+                <treeIntervals spec='TreeIntervals' id='TreeIntervals'>
+                     <tree idref="tree"/>
+                </treeIntervals>
+                <populationModel spec="ConstantPopulation">
+                    <parameter name="popSize" idref="popSize"/>
+                </populationModel>
+            </distribution>
+            <distribution id='likelihood' idref="treeLikelihood"/>
+        </distribution>
+
+        <!--operator id="indicatorsRandomWalk" spec="UniformOperator" weight="1" parameter='@indicators'/-->
+        <operator id='indicatorFlip' spec='BitFlipOperator' weight='1' parameter='@indicators'/>
+        <operator id='rateScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" parameter='@rates'/>
+
+        <operator id='kappaScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" parameter='@hky.kappa'/>
+        <operator id='popSizeScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" parameter='@popSize'/>
+
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" tree='@tree'/>
+        <operator spec='Uniform' weight="10"  tree='@tree'/>
+        <operator spec='SubtreeSlide' weight="5" gaussian="true" size="1.0" tree='@tree'/>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="1" tree='@tree'/>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="1" tree='@tree'/>
+        <operator spec='WilsonBalding' weight="1" tree='@tree'/>
+
+        <logger logEvery="10000" fileName="test.$(seed).log">
+	    <model idref='posterior'/>
+            <log idref="coalescent"/>
+            <log idref="likelihood"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger'>
+                <tree idref='tree'/>
+            </log>
+            <log idref="popSize"/>
+            <log idref="hky.kappa"/>
+            <log idref="indicators"/>
+            <log idref="rates"/>
+            <log idref="posterior"/>
+        </logger>
+        <logger logEvery="10000" fileName="test.$(seed).trees">
+            <log idref="tree"/>
+        </logger>
+        <logger logEvery="10000">
+	    <model idref='posterior'/>
+            <log idref="coalescent"/>
+            <log idref="likelihood"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger'>
+                <tree idref='tree'/>
+            </log>
+            <log idref="popSize"/>
+            <log idref="hky.kappa"/>
+            <log idref="indicators"/>
+            <log idref="posterior"/>
+        </logger>
+    </run>
+
+</beast>
diff --git a/examples/testRelaxedClock.xml b/examples/testRelaxedClock.xml
new file mode 100644
index 0000000..af33b7c
--- /dev/null
+++ b/examples/testRelaxedClock.xml
@@ -0,0 +1,163 @@
+<beast version='2.0'
+       namespace='beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.branchratemodel:beast.evolution.likelihood:beast.core.parameter'>
+
+
+    <!-- The sequence alignment (each sequence refers to a taxon above).         -->
+    <!-- ntax=6 nchar=768                                                        -->
+    <!-- npatterns=69                                                            -->
+    <data id="alignment" dataType="nucleotide">
+        <sequence taxon="human">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="chimp">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="bonobo">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAGC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTTGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="gorilla">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTAAACATAGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA-CAACACTTAATTTCTGTAAGGACTGCAAAACCCTACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCAATGGGACTCAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAT-TCAC [...]
+        </sequence>
+        <sequence taxon="orangutan">
+            AGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA-CAGCACTTAATTTCTGTAAGGACTGCAAAACCCCACTTTGCATCAACTGAGCGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCCTAGACCGATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAT-TGGCTTCAGTCCAAAGCCCCGGCAGGCCTTAAAGCTGCTCCTTCGAATTTGCAATTCAACATGACAA-TCAC [...]
+        </sequence>
+        <sequence taxon="siamang">
+            AGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTAACAAAACTTAATTTCTGCAAGGGCTGCAAAACCCTACTTTGCATCAACCGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCGATGGGACTTAAACCCATAAAAATTTAGTTAACAGCTAAACACCCTAAACAACCTGGCTTCAATCTAAAGCCCCGGCAGA-GTTGAAGCTGCTTCTTTGAACTTGCAATTCAACGTGAAAAATCAC [...]
+        </sequence>
+    </data>
+
+    <!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+    <input spec='HKY' id="hky">
+        <parameter name='kappa' idref='hky.kappa'/>
+        <input id='freqs' name='frequencies' spec='Frequencies'>
+            <input name='data' idref='alignment'/>
+        </input>
+    </input>
+
+    <!-- site model                                                              -->
+    <input spec='SiteModel' id="siteModel">
+        <!--<parameter name='mutationRate'>1.0</parameter>-->
+        <input name='substModel' idref='hky'/>
+    </input>
+
+
+    <input spec='UCRelaxedClockModel' id="branchRates" normalize='true'>
+        <!--<parameter name='mutationRate'>1.0</parameter>-->
+		<parameter name='clock.rate' id='ucld.mean' value='1.0'/>
+        <distr id='lognormal' spec="beast.math.distributions.LogNormalDistributionModel">
+            <parameter name='M' id='M' value="1"/>
+            <parameter name='S' id='ucld.stdev' value="0.5" lower="0" upper="5"/>
+        </distr>
+        <parameter spec='IntegerParameter' name='rateCategories' id='rateCategories' dimension="11" value="1"/>
+        <input name='tree' idref="tree"/>
+    </input>
+
+    <input spec='TreeLikelihood' id="treeLikelihood">
+        <input name='data' idref="alignment"/>
+        <input name='tree' idref="tree"/>
+        <input name='siteModel' idref="siteModel"/>
+        <input name="branchRateModel" idref="branchRates"/>
+    </input>
+
+    <input spec='beast.util.ClusterTree' id='tree' clusterType='upgma'>
+	<!--trait idref='rateCategories'/--> 
+        <input name='taxa' idref='alignment'/>
+    </input>
+
+    <input spec='beast.core.parameter.RealParameter' id="hky.kappa">1.0</input>
+
+    <input spec='beast.core.parameter.RealParameter' id="popSize">1.0</input>
+
+
+    <run spec="MCMC" id="mcmc" chainLength="1000000"> <!--autoOptimize="true"-->
+        <state>
+            <input name='stateNode' idref='hky.kappa'/>
+            <input name='stateNode' idref='popSize'/>
+            <input name='stateNode' idref='ucld.mean'/>
+            <input name='stateNode' idref='ucld.stdev'/>
+            <input name='stateNode' idref='tree'/>
+            <input name='stateNode' idref='rateCategories'/>
+        </state>
+
+        <distribution spec="CompoundDistribution" id="posterior">
+            <distribution id="coalescent" spec="Coalescent">
+                <treeIntervals spec='TreeIntervals' id='TreeIntervals'>
+                     <tree idref="tree"/>
+                </treeIntervals>
+                <populationModel spec="ConstantPopulation">
+                    <parameter name="popSize" idref="popSize"/>
+                </populationModel>
+            </distribution>
+            <distribution id='likelihood' idref="treeLikelihood"/>
+        </distribution>
+
+        <operator id="categoriesRandomWalk" spec="UniformOperator" weight="1">
+            <input name="parameter" idref="rateCategories"/>
+        </operator>
+
+        <operator id='SScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" parameter='@ucld.stdev'/>
+
+        <operator id='kappaScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1">
+            <parameter idref="hky.kappa"/>
+        </operator>
+        <operator id='popSizeScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1">
+            <parameter idref="popSize"/>
+        </operator>
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1">
+            <tree idref="tree"/>
+        </operator>
+        <operator spec='Uniform' weight="10">
+            <tree idref="tree"/>
+        </operator>
+        <operator spec='SubtreeSlide' weight="5" gaussian="true" size="1.0">
+            <tree idref="tree"/>
+        </operator>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="1">
+            <tree idref="tree"/>
+        </operator>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="1">
+            <tree idref="tree"/>
+        </operator>
+        <operator spec='WilsonBalding' weight="1">
+            <tree idref="tree"/>
+        </operator>
+
+        <logger logEvery="1000" fileName="test.$(seed).log">
+	    <model idref='posterior'/>
+            <log idref="coalescent"/>
+            <log idref="likelihood"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger'>
+                <tree idref='tree'/>
+            </log>
+            <log idref="popSize"/>
+            <log idref="hky.kappa"/>
+            <log idref="ucld.stdev"/>
+            <log idref="rateCategories"/>
+            <log idref="posterior"/>
+        </logger>
+        <logger logEvery="1000" fileName="test.(time).$(seed).trees" mode='tree'>
+			<log spec='beast.evolution.tree.TreeWithMetaDataLogger' tree='@tree' dp='6'>
+				<branchratemodel idref='branchRates'/>
+			</log>
+        </logger>
+        <logger logEvery="1000" fileName="test.(subst).$(seed).trees" mode='tree'>
+			<log spec='beast.evolution.tree.TreeWithMetaDataLogger' tree='@tree' substitutions='true' dp='6'>
+				<branchratemodel idref='branchRates'/>
+			</log>
+        </logger>
+        <logger logEvery="10000">
+	    <model idref='posterior'/>
+            <log idref="coalescent"/>
+            <log idref="likelihood"/>
+            <log spec='beast.evolution.tree.TreeHeightLogger'>
+                <tree idref='tree'/>
+            </log>
+            <log idref="popSize"/>
+            <log idref="hky.kappa"/>
+            <log idref="ucld.stdev"/>
+            <!--log idref="rateCategories"/-->
+            <log idref="posterior"/>
+        </logger>
+    </run>
+
+</beast>
diff --git a/examples/testRestrictedGTR.xml b/examples/testRestrictedGTR.xml
new file mode 100644
index 0000000..b100408
--- /dev/null
+++ b/examples/testRestrictedGTR.xml
@@ -0,0 +1,179 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<beast beautitemplate='Standard' beautistatus=''
+       namespace="beast.core:beast.evolution.alignment:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood"
+       version="2.0">
+
+
+    <data id="primate-mtDNA">
+        <sequence id="seq_Lemur_catta" taxon="Lemur_catta" totalcount="4"
+                  value="AAGCTTCATAGGAGCAACCATTCTAATAATCGCACATGGCCTTACATCATCCATATTATTCTGTCTAGCCAACTCTAACTACGAACGAATCCATAGCCGTACAATACTACTAGCACGAGGGATCCAAACCATTCTCCCTCTTATAGCCACCTGATGACTACTCGCCAGCCTAACTAACCTAGCCCTACCCACCTCTATCAATTTAATTGGCGAACTATTCGTCACTATAGCATCCTTCTCATGATCAAACATTACAATTATCTTAATAGGCTTAAATATGCTCATCACCGCTCTCTATTCCCTCTATATATTAACTACTACACAACGAGGAAAACTCACATATCATTCGCACAACCTAAACCCATCCTTTACACGAGAAAACACCCTTATATCCATACACATACTCCCCCTTCTCCTATTTACCTTAAACCCCAAAATTATTCTAGGACCCACGTACTGTAAATATA [...]
+        <sequence id="seq_Homo_sapiens" taxon="Homo_sapiens" totalcount="4"
+                  value="AAGCTTCACCGGCGCAGTCATTCTCATAATCGCCCACGGGCTTACATCCTCATTACTATTCTGCCTAGCAAACTCAAACTACGAACGCACTCACAGTCGCATCATAATCCTCTCTCAAGGACTTCAAACTCTACTCCCACTAATAGCTTTTTGATGACTTCTAGCAAGCCTCGCTAACCTCGCCTTACCCCCCACTATTAACCTACTGGGAGAACTCTCTGTGCTAGTAACCACGTTCTCCTGATCAAATATCACTCTCCTACTTACAGGACTCAACATACTAGTCACAGCCCTATACTCCCTCTACATATTTACCACAACACAATGGGGCTCACTCACCCACCACATTAACAACATAAAACCCTCATTCACACGAGAAAACACCCTCATGTTCATACACCTATCCCCCATTCTCCTCCTATCCCTCAACCCCGACATCATTACCGGGTTTTCCTCTTGTAAATATA [...]
+        <sequence id="seq_Pan" taxon="Pan" totalcount="4"
+                  value="AAGCTTCACCGGCGCAATTATCCTCATAATCGCCCACGGACTTACATCCTCATTATTATTCTGCCTAGCAAACTCAAATTATGAACGCACCCACAGTCGCATCATAATTCTCTCCCAAGGACTTCAAACTCTACTCCCACTAATAGCCTTTTGATGACTCCTAGCAAGCCTCGCTAACCTCGCCCTACCCCCTACCATTAATCTCCTAGGGGAACTCTCCGTGCTAGTAACCTCATTCTCCTGATCAAATACCACTCTCCTACTCACAGGATTCAACATACTAATCACAGCCCTGTACTCCCTCTACATGTTTACCACAACACAATGAGGCTCACTCACCCACCACATTAATAACATAAAGCCCTCATTCACACGAGAAAATACTCTCATATTTTTACACCTATCCCCCATCCTCCTTCTATCCCTCAATCCTGATATCATCACTGGATTCACCTCCTGTAAATATA [...]
+        <sequence id="seq_Gorilla" taxon="Gorilla" totalcount="4"
+                  value="AAGCTTCACCGGCGCAGTTGTTCTTATAATTGCCCACGGACTTACATCATCATTATTATTCTGCCTAGCAAACTCAAACTACGAACGAACCCACAGCCGCATCATAATTCTCTCTCAAGGACTCCAAACCCTACTCCCACTAATAGCCCTTTGATGACTTCTGGCAAGCCTCGCCAACCTCGCCTTACCCCCCACCATTAACCTACTAGGAGAGCTCTCCGTACTAGTAACCACATTCTCCTGATCAAACACCACCCTTTTACTTACAGGATCTAACATACTAATTACAGCCCTGTACTCCCTTTATATATTTACCACAACACAATGAGGCCCACTCACACACCACATCACCAACATAAAACCCTCATTTACACGAGAAAACATCCTCATATTCATGCACCTATCCCCCATCCTCCTCCTATCCCTCAACCCCGATATTATCACCGGGTTCACCTCCTGTAAATATA [...]
+        <sequence id="seq_Pongo" taxon="Pongo" totalcount="4"
+                  value="AAGCTTCACCGGCGCAACCACCCTCATGATTGCCCATGGACTCACATCCTCCCTACTGTTCTGCCTAGCAAACTCAAACTACGAACGAACCCACAGCCGCATCATAATCCTCTCTCAAGGCCTTCAAACTCTACTCCCCCTAATAGCCCTCTGATGACTTCTAGCAAGCCTCACTAACCTTGCCCTACCACCCACCATCAACCTTCTAGGAGAACTCTCCGTACTAATAGCCATATTCTCTTGATCTAACATCACCATCCTACTAACAGGACTCAACATACTAATCACAACCCTATACTCTCTCTATATATTCACCACAACACAACGAGGTACACCCACACACCACATCAACAACATAAAACCTTCTTTCACACGCGAAAATACCCTCATGCTCATACACCTATCCCCCATCCTCCTCTTATCCCTCAACCCCAGCATCATCGCTGGGTTCGCCTACTGTAAATATA [...]
+        <sequence id="seq_Hylobates" taxon="Hylobates" totalcount="4"
+                  value="AAGCTTTACAGGTGCAACCGTCCTCATAATCGCCCACGGACTAACCTCTTCCCTGCTATTCTGCCTTGCAAACTCAAACTACGAACGAACTCACAGCCGCATCATAATCCTATCTCGAGGGCTCCAAGCCTTACTCCCACTGATAGCCTTCTGATGACTCGCAGCAAGCCTCGCTAACCTCGCCCTACCCCCCACTATTAACCTCCTAGGTGAACTCTTCGTACTAATGGCCTCCTTCTCCTGGGCAAACACTACTATTACACTCACCGGGCTCAACGTACTAATCACGGCCCTATACTCCCTTTACATATTTATCATAACACAACGAGGCACACTTACACACCACATTAAAAACATAAAACCCTCACTCACACGAGAAAACATATTAATACTTATGCACCTCTTCCCCCTCCTCCTCCTAACCCTCAACCCTAACATCATTACTGGCTTTACTCCCTGTAAACATA [...]
+        <sequence id="seq_Macaca_fuscata" taxon="Macaca_fuscata" totalcount="4"
+                  value="AAGCTTTTCCGGCGCAACCATCCTTATGATCGCTCACGGACTCACCTCTTCCATATATTTCTGCCTAGCCAATTCAAACTATGAACGCACTCACAACCGTACCATACTACTGTCCCGAGGACTTCAAATCCTACTTCCACTAACAGCCTTTTGATGATTAACAGCAAGCCTTACTAACCTTGCCCTACCCCCCACTATCAATCTACTAGGTGAACTCTTTGTAATCGCAACCTCATTCTCCTGATCCCATATCACCATTATGCTAACAGGACTTAACATATTAATTACGGCCCTCTACTCTCTCCACATATTCACTACAACACAACGAGGAACACTCACACATCACATAATCAACATAAAGCCCCCCTTCACACGAGAAAACACATTAATATTCATACACCTCGCTCCAATTATCCTTCTATCCCTCAACCCCAACATCATCCTGGGGTTTACCTCCTGTAGATATA [...]
+        <sequence id="seq_M._mulatta" taxon="M._mulatta" totalcount="4"
+                  value="AAGCTTTTCTGGCGCAACCATCCTCATGATTGCTCACGGACTCACCTCTTCCATATATTTCTGCCTAGCCAATTCAAACTATGAACGCACTCACAACCGTACCATACTACTGTCCCGGGGACTTCAAATCCTACTTCCACTAACAGCTTTCTGATGATTAACAGCAAGCCTTACTAACCTTGCCCTACCCCCCACTATCAACCTACTAGGTGAACTCTTTGTAATCGCGACCTCATTCTCCTGGTCCCATATCACCATTATATTAACAGGATTTAACATACTAATTACGGCCCTCTACTCCCTCCACATATTCACCACAACACAACGAGGAGCACTCACACATCACATAATCAACATAAAACCCCCCTTCACACGAGAAAACATATTAATATTCATACACCTCGCTCCAATCATCCTCCTATCTCTCAACCCCAACATCATCCTGGGGTTTACTTCCTGTAGATATA [...]
+        <sequence id="seq_M._fascicularis" taxon="M._fascicularis" totalcount="4"
+                  value="AAGCTTCTCCGGCGCAACCACCCTTATAATCGCCCACGGGCTCACCTCTTCCATGTATTTCTGCTTGGCCAATTCAAACTATGAGCGCACTCATAACCGTACCATACTACTATCCCGAGGACTTCAAATTCTACTTCCATTGACAGCCTTCTGATGACTCACAGCAAGCCTTACTAACCTTGCCCTACCCCCCACTATTAATCTACTAGGCGAACTCTTTGTAATCACAACTTCATTTTCCTGATCCCATATCACCATTGTGTTAACGGGCCTTAATATACTAATCACAGCCCTCTACTCTCTCCACATGTTCATTACAGTACAACGAGGAACACTCACACACCACATAATCAATATAAAACCCCCCTTCACACGAGAAAACATATTAATATTCATACACCTCGCTCCAATTATCCTTCTATCTCTCAACCCCAACATCATCCTGGGGTTTACCTCCTGTAAATATA [...]
+        <sequence id="seq_M._sylvanus" taxon="M._sylvanus" totalcount="4"
+                  value="AAGCTTCTCCGGTGCAACTATCCTTATAGTTGCCCATGGACTCACCTCTTCCATATACTTCTGCTTGGCCAACTCAAACTACGAACGCACCCACAGCCGCATCATACTACTATCCCGAGGACTCCAAATCCTACTCCCACTAACAGCCTTCTGATGATTCACAGCAAGCCTTACTAATCTTGCTCTACCCTCCACTATTAATCTACTGGGCGAACTCTTCGTAATCGCAACCTCATTTTCCTGATCCCACATCACCATCATACTAACAGGACTGAACATACTAATTACAGCCCTCTACTCTCTTCACATATTCACCACAACACAACGAGGAGCGCTCACACACCACATAATTAACATAAAACCACCTTTCACACGAGAAAACATATTAATACTCATACACCTCGCTCCAATTATTCTTCTATCTCTTAACCCCAACATCATTCTAGGATTTACTTCCTGTAAATATA [...]
+        <sequence id="seq_Saimiri_sciureus" taxon="Saimiri_sciureus" totalcount="4"
+                  value="AAGCTTCACCGGCGCAATGATCCTAATAATCGCTCACGGGTTTACTTCGTCTATGCTATTCTGCCTAGCAAACTCAAATTACGAACGAATTCACAGCCGAACAATAACATTTACTCGAGGGCTCCAAACACTATTCCCGCTTATAGGCCTCTGATGACTCCTAGCAAATCTCGCTAACCTCGCCCTACCCACAGCTATTAATCTAGTAGGAGAATTACTCACAATCGTATCTTCCTTCTCTTGATCCAACTTTACTATTATATTCACAGGACTTAATATACTAATTACAGCACTCTACTCACTTCATATGTATGCCTCTACACAGCGAGGTCCACTTACATACAGCACCAGCAATATAAAACCAATATTTACACGAGAAAATACGCTAATATTTATACATATAACACCAATCCTCCTCCTTACCTTGAGCCCCAAGGTAATTATAGGACCCTCACCTTGTAATTATA [...]
+        <sequence id="seq_Tarsius_syrichta" taxon="Tarsius_syrichta" totalcount="4"
+                  value="AAGTTTCATTGGAGCCACCACTCTTATAATTGCCCATGGCCTCACCTCCTCCCTATTATTTTGCCTAGCAAATACAAACTACGAACGAGTCCACAGTCGAACAATAGCACTAGCCCGTGGCCTTCAAACCCTATTACCTCTTGCAGCAACATGATGACTCCTCGCCAGCTTAACCAACCTGGCCCTTCCCCCAACAATTAATTTAATCGGTGAACTGTCCGTAATAATAGCAGCATTTTCATGGTCACACCTAACTATTATCTTAGTAGGCCTTAACACCCTTATCACCGCCCTATATTCCCTATATATACTAATCATAACTCAACGAGGAAAATACACATATCATATCAACAATATCATGCCCCCTTTCACCCGAGAAAATACATTAATAATCATACACCTATTTCCCTTAATCCTACTATCTACCAACCCCAAAGTAATTATAGGAACCATGTACTGTAAATATA [...]
+    </data>
+
+
+    <map name="Beta">beast.math.distributions.Beta</map>
+    <map name="Exponential">beast.math.distributions.Exponential</map>
+    <map name="InverseGamma">beast.math.distributions.InverseGamma</map>
+    <map name="LogNormal">beast.math.distributions.LogNormalDistributionModel</map>
+    <map name="Gamma">beast.math.distributions.Gamma</map>
+    <map name="Uniform">beast.math.distributions.Uniform</map>
+    <map name="prior">beast.math.distributions.Prior</map>
+    <map name="LaplaceDistribution">beast.math.distributions.LaplaceDistribution</map>
+    <map name="OneOnX">beast.math.distributions.OneOnX</map>
+    <map name="Normal">beast.math.distributions.Normal</map>
+
+
+    <run chainLength="5000000" id="mcmc" spec="MCMC">
+        <state id="state" storeEvery="5000">
+            <tree id="Tree.t:primate" name="stateNode">
+                <taxonset id="TaxonSet.coding" spec="TaxonSet">
+                    <alignment filter="2-457,660-896" id="coding" spec="FilteredAlignment">
+                        <data idref="primate-mtDNA"/>
+                    </alignment>
+                </taxonset>
+            </tree>
+            <parameter id="birthRate.t:primate" name="stateNode" value="1.0"/>
+            <parameter id="rateTransversion.s:primate" lower="0.0" name="stateNode" value="1.0"/>
+            <parameter id="rateAG.s:primate" lower="0.0" name="stateNode" value="1.0"/>
+            <parameter dimension="4" id="freqParameter.s:primate" lower="0.0" name="stateNode" upper="1.0"
+                       value="0.25"/>
+        </state>
+
+        <init estimate="false" id="RandomTree.t:primate" initial="@Tree.t:primate"
+              spec="beast.evolution.tree.RandomTree" taxa="@coding">
+            <populationModel id="ConstantPopulation0.t:primate" spec="ConstantPopulation">
+                <parameter id="randomPopSize.t:primate" name="popSize" value="1"/>
+            </populationModel>
+        </init>
+
+        <distribution id="posterior" spec="util.CompoundDistribution">
+            <distribution id="prior" spec="util.CompoundDistribution">
+                <distribution birthDiffRate="@birthRate.t:primate" id="YuleModel.t:primate"
+                              spec="beast.evolution.speciation.YuleModel" tree="@Tree.t:primate"/>
+                <prior id="YuleBirthRatePrior.t:primate" name="distribution" x="@birthRate.t:primate">
+                    <Uniform id="Uniform.0" name="distr" upper="Infinity"/>
+                </prior>
+                <prior id="RateTransversionPrior.s:primate" name="distribution" x="@rateTransversion.s:primate">
+                    <LogNormal id="LogNormalDistributionModel.0" name="distr">
+                        <parameter estimate="false" id="RealParameter.0" name="M" value="0"/>
+                        <parameter estimate="false" id="RealParameter.01" lower="0.0" name="S" upper="5.0"
+                                   value="1.25"/>
+                    </LogNormal>
+                </prior>
+                <prior id="RateAGPrior.s:primate" name="distribution" x="@rateAG.s:primate">
+                    <LogNormal id="LogNormalDistributionModel.01" name="distr">
+                        <parameter estimate="false" id="RealParameter.02" name="M" value="0"/>
+                        <parameter estimate="false" id="RealParameter.03" lower="0.0" name="S" upper="5.0"
+                                   value="1.25"/>
+                    </LogNormal>
+                </prior>
+            </distribution>
+            <distribution id="likelihood" spec="util.CompoundDistribution">
+                <distribution data="@coding" id="treeLikelihood.coding" spec="TreeLikelihood" tree="@Tree.t:primate">
+                    <siteModel id="SiteModel.s:primate" spec="SiteModel">
+                        <parameter estimate="false" id="mutationRate.s:primate" name="mutationRate" value="1.0"/>
+                        <parameter estimate="false" id="gammaShape.s:primate" name="shape" value="1.0"/>
+                        <parameter estimate="false" id="proportionInvariant.s:primate" lower="0.0"
+                                   name="proportionInvariant" upper="1.0" value="0.0"/>
+                        <substModel id="gtr.s:primate"
+                                    rateAC="@rateTransversion.s:primate"
+                                    rateAG="@rateAG.s:primate"
+                                    rateAT="@rateTransversion.s:primate"
+                                    rateCG="@rateTransversion.s:primate"
+                                    rateGT="@rateTransversion.s:primate"
+                                    spec="GTR">
+                            <parameter estimate="false" id="rateCT.s:primate" lower="0.0" name="rateCT" value="1.0"/>
+                            <frequencies frequencies="@freqParameter.s:primate" id="estimatedFreqs.s:primate"
+                                         spec="Frequencies"/>
+                        </substModel>
+                    </siteModel>
+                    <branchRateModel id="StrictClock.c:primate" spec="beast.evolution.branchratemodel.StrictClockModel">
+                        <parameter estimate="false" id="clockRate.c:primate" name="clock.rate" value="1.0"/>
+                    </branchRateModel>
+                </distribution>
+                <distribution branchRateModel="@StrictClock.c:primate" id="treeLikelihood.noncoding"
+                              siteModel="@SiteModel.s:primate" spec="TreeLikelihood" tree="@Tree.t:primate">
+                    <data data="@primate-mtDNA" filter="1,458-659,897-898" id="noncoding" spec="FilteredAlignment"/>
+                </distribution>
+            </distribution>
+        </distribution>
+
+        <operator id="YuleBirthRateScaler.t:primate" parameter="@birthRate.t:primate" scaleFactor="0.75"
+                  spec="ScaleOperator" weight="3.0"/>
+
+        <operator id="treeScaler.t:primate" scaleFactor="0.5" spec="ScaleOperator" tree="@Tree.t:primate" weight="3.0"/>
+
+        <operator id="treeRootScaler.t:primate" rootOnly="true" scaleFactor="0.5" spec="ScaleOperator"
+                  tree="@Tree.t:primate" weight="3.0"/>
+
+        <operator id="UniformOperator.t:primate" spec="Uniform" tree="@Tree.t:primate" weight="30.0"/>
+
+        <operator id="SubtreeSlide.t:primate" spec="SubtreeSlide" tree="@Tree.t:primate" weight="15.0"/>
+
+        <operator id="narrow.t:primate" spec="Exchange" tree="@Tree.t:primate" weight="15.0"/>
+
+        <operator id="wide.t:primate" isNarrow="false" spec="Exchange" tree="@Tree.t:primate" weight="3.0"/>
+
+        <operator id="WilsonBalding.t:primate" spec="WilsonBalding" tree="@Tree.t:primate" weight="3.0"/>
+
+        <operator id="RateTransversionScaler.s:primate" parameter="@rateTransversion.s:primate" scaleFactor="0.5"
+                  spec="ScaleOperator"
+                  weight="0.1"/>
+
+        <operator id="RateAGScaler.s:primate" parameter="@rateAG.s:primate" scaleFactor="0.5" spec="ScaleOperator"
+                  weight="0.1"/>
+
+        <operator delta="0.01" id="FrequenciesExchanger.s:primate" spec="DeltaExchangeOperator" weight="0.1">
+            <parameter idref="freqParameter.s:primate"/>
+        </operator>
+
+        <logger fileName="primate-mtDNA-restrictedGTR.log" id="tracelog" logEvery="5000" model="@posterior"
+                sanitiseHeaders="true"
+                sort="smart">
+            <log idref="posterior"/>
+            <log idref="likelihood"/>
+            <log idref="prior"/>
+            <log idref="treeLikelihood.noncoding"/>
+            <log idref="treeLikelihood.coding"/>
+            <log id="TreeHeight.t:primate" spec="beast.evolution.tree.TreeHeightLogger" tree="@Tree.t:primate"/>
+            <log idref="YuleModel.t:primate"/>
+            <parameter idref="birthRate.t:primate" name="log"/>
+            <parameter idref="rateTransversion.s:primate" name="log"/>
+            <parameter idref="rateAG.s:primate" name="log"/>
+            <parameter idref="freqParameter.s:primate" name="log"/>
+        </logger>
+
+        <logger id="screenlog" logEvery="5000">
+            <log idref="posterior"/>
+            <log arg="@posterior" id="ESS.0" spec="util.ESS"/>
+            <log idref="likelihood"/>
+            <log idref="prior"/>
+        </logger>
+
+        <logger fileName="primate-mtDNA-restrictedGTR-$(tree).trees" id="treelog.t:primate" logEvery="5000" mode="tree">
+            <log id="TreeWithMetaDataLogger.t:primate" spec="beast.evolution.tree.TreeWithMetaDataLogger"
+                 tree="@Tree.t:primate"/>
+        </logger>
+    </run>
+</beast>
diff --git a/examples/testSRD06.xml b/examples/testSRD06.xml
new file mode 100644
index 0000000..a7f641f
--- /dev/null
+++ b/examples/testSRD06.xml
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><beast namespace="beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood" version="2.0">
+<!-- SRD06 model: split sequences in first together with seconds and thirds of all sites -->
+
+    <data dataType="nucleotide" id="Primates">
+        <sequence id="seq_Tarsius_syrichta" taxon="Tarsius_syrichta" totalcount="4" value="AAGTTTCATTGGAGCCACCACTCTTATAATTGCCCATGGCCTCACCTCCTCCCTATTATTTTGCCTAGCAAATACAAACTACGAACGAGTCCACAGTCGAACAATAGCACTAGCCCGTGGCCTTCAAACCCTATTACCTCTTGCAGCAACATGATGACTCCTCGCCAGCTTAACCAACCTGGCCCTTCCCCCAACAATTAATTTAATCGGTGAACTGTCCGTAATAATAGCAGCATTTTCATGGTCACACCTAACTATTATCTTAGTAGGCCTTAACACCCTTATCACCGCCCTATATTCCCTATATATACTAATCATAACTCAACGAGGAAAATACACATATCATATCAACAATATCATGCCCCCTTTCACCCGAGAAAATACATTAATAATCATACACC [...]
+        <sequence id="seq_Lemur_catta" taxon="Lemur_catta" totalcount="4" value="AAGCTTCATAGGAGCAACCATTCTAATAATCGCACATGGCCTTACATCATCCATATTATTCTGTCTAGCCAACTCTAACTACGAACGAATCCATAGCCGTACAATACTACTAGCACGAGGGATCCAAACCATTCTCCCTCTTATAGCCACCTGATGACTACTCGCCAGCCTAACTAACCTAGCCCTACCCACCTCTATCAATTTAATTGGCGAACTATTCGTCACTATAGCATCCTTCTCATGATCAAACATTACAATTATCTTAATAGGCTTAAATATGCTCATCACCGCTCTCTATTCCCTCTATATATTAACTACTACACAACGAGGAAAACTCACATATCATTCGCACAACCTAAACCCATCCTTTACACGAGAAAACACCCTTATATCCATACACATACTCCCCCT [...]
+        <sequence id="seq_Homo_sapiens" taxon="Homo_sapiens" totalcount="4" value="AAGCTTCACCGGCGCAGTCATTCTCATAATCGCCCACGGGCTTACATCCTCATTACTATTCTGCCTAGCAAACTCAAACTACGAACGCACTCACAGTCGCATCATAATCCTCTCTCAAGGACTTCAAACTCTACTCCCACTAATAGCTTTTTGATGACTTCTAGCAAGCCTCGCTAACCTCGCCTTACCCCCCACTATTAACCTACTGGGAGAACTCTCTGTGCTAGTAACCACGTTCTCCTGATCAAATATCACTCTCCTACTTACAGGACTCAACATACTAGTCACAGCCCTATACTCCCTCTACATATTTACCACAACACAATGGGGCTCACTCACCCACCACATTAACAACATAAAACCCTCATTCACACGAGAAAACACCCTCATGTTCATACACCTATCCCCC [...]
+        <sequence id="seq_Pan" taxon="Pan" totalcount="4" value="AAGCTTCACCGGCGCAATTATCCTCATAATCGCCCACGGACTTACATCCTCATTATTATTCTGCCTAGCAAACTCAAATTATGAACGCACCCACAGTCGCATCATAATTCTCTCCCAAGGACTTCAAACTCTACTCCCACTAATAGCCTTTTGATGACTCCTAGCAAGCCTCGCTAACCTCGCCCTACCCCCTACCATTAATCTCCTAGGGGAACTCTCCGTGCTAGTAACCTCATTCTCCTGATCAAATACCACTCTCCTACTCACAGGATTCAACATACTAATCACAGCCCTGTACTCCCTCTACATGTTTACCACAACACAATGAGGCTCACTCACCCACCACATTAATAACATAAAGCCCTCATTCACACGAGAAAATACTCTCATATTTTTACACCTATCCCCCATCCTCCTTCTATCCCTC [...]
+        <sequence id="seq_Gorilla" taxon="Gorilla" totalcount="4" value="AAGCTTCACCGGCGCAGTTGTTCTTATAATTGCCCACGGACTTACATCATCATTATTATTCTGCCTAGCAAACTCAAACTACGAACGAACCCACAGCCGCATCATAATTCTCTCTCAAGGACTCCAAACCCTACTCCCACTAATAGCCCTTTGATGACTTCTGGCAAGCCTCGCCAACCTCGCCTTACCCCCCACCATTAACCTACTAGGAGAGCTCTCCGTACTAGTAACCACATTCTCCTGATCAAACACCACCCTTTTACTTACAGGATCTAACATACTAATTACAGCCCTGTACTCCCTTTATATATTTACCACAACACAATGAGGCCCACTCACACACCACATCACCAACATAAAACCCTCATTTACACGAGAAAACATCCTCATATTCATGCACCTATCCCCCATCCTCCTCC [...]
+        <sequence id="seq_Pongo" taxon="Pongo" totalcount="4" value="AAGCTTCACCGGCGCAACCACCCTCATGATTGCCCATGGACTCACATCCTCCCTACTGTTCTGCCTAGCAAACTCAAACTACGAACGAACCCACAGCCGCATCATAATCCTCTCTCAAGGCCTTCAAACTCTACTCCCCCTAATAGCCCTCTGATGACTTCTAGCAAGCCTCACTAACCTTGCCCTACCACCCACCATCAACCTTCTAGGAGAACTCTCCGTACTAATAGCCATATTCTCTTGATCTAACATCACCATCCTACTAACAGGACTCAACATACTAATCACAACCCTATACTCTCTCTATATATTCACCACAACACAACGAGGTACACCCACACACCACATCAACAACATAAAACCTTCTTTCACACGCGAAAATACCCTCATGCTCATACACCTATCCCCCATCCTCCTCTTATC [...]
+        <sequence id="seq_Hylobates" taxon="Hylobates" totalcount="4" value="AAGCTTTACAGGTGCAACCGTCCTCATAATCGCCCACGGACTAACCTCTTCCCTGCTATTCTGCCTTGCAAACTCAAACTACGAACGAACTCACAGCCGCATCATAATCCTATCTCGAGGGCTCCAAGCCTTACTCCCACTGATAGCCTTCTGATGACTCGCAGCAAGCCTCGCTAACCTCGCCCTACCCCCCACTATTAACCTCCTAGGTGAACTCTTCGTACTAATGGCCTCCTTCTCCTGGGCAAACACTACTATTACACTCACCGGGCTCAACGTACTAATCACGGCCCTATACTCCCTTTACATATTTATCATAACACAACGAGGCACACTTACACACCACATTAAAAACATAAAACCCTCACTCACACGAGAAAACATATTAATACTTATGCACCTCTTCCCCCTCCTC [...]
+        <sequence id="seq_Macaca_fuscata" taxon="Macaca_fuscata" totalcount="4" value="AAGCTTTTCCGGCGCAACCATCCTTATGATCGCTCACGGACTCACCTCTTCCATATATTTCTGCCTAGCCAATTCAAACTATGAACGCACTCACAACCGTACCATACTACTGTCCCGAGGACTTCAAATCCTACTTCCACTAACAGCCTTTTGATGATTAACAGCAAGCCTTACTAACCTTGCCCTACCCCCCACTATCAATCTACTAGGTGAACTCTTTGTAATCGCAACCTCATTCTCCTGATCCCATATCACCATTATGCTAACAGGACTTAACATATTAATTACGGCCCTCTACTCTCTCCACATATTCACTACAACACAACGAGGAACACTCACACATCACATAATCAACATAAAGCCCCCCTTCACACGAGAAAACACATTAATATTCATACACCTCGC [...]
+        <sequence id="seq_M_mulatta" taxon="M_mulatta" totalcount="4" value="AAGCTTTTCTGGCGCAACCATCCTCATGATTGCTCACGGACTCACCTCTTCCATATATTTCTGCCTAGCCAATTCAAACTATGAACGCACTCACAACCGTACCATACTACTGTCCCGGGGACTTCAAATCCTACTTCCACTAACAGCTTTCTGATGATTAACAGCAAGCCTTACTAACCTTGCCCTACCCCCCACTATCAACCTACTAGGTGAACTCTTTGTAATCGCGACCTCATTCTCCTGGTCCCATATCACCATTATATTAACAGGATTTAACATACTAATTACGGCCCTCTACTCCCTCCACATATTCACCACAACACAACGAGGAGCACTCACACATCACATAATCAACATAAAACCCCCCTTCACACGAGAAAACATATTAATATTCATACACCTCGCTCCAATCATC [...]
+        <sequence id="seq_M_fascicularis" taxon="M_fascicularis" totalcount="4" value="AAGCTTCTCCGGCGCAACCACCCTTATAATCGCCCACGGGCTCACCTCTTCCATGTATTTCTGCTTGGCCAATTCAAACTATGAGCGCACTCATAACCGTACCATACTACTATCCCGAGGACTTCAAATTCTACTTCCATTGACAGCCTTCTGATGACTCACAGCAAGCCTTACTAACCTTGCCCTACCCCCCACTATTAATCTACTAGGCGAACTCTTTGTAATCACAACTTCATTTTCCTGATCCCATATCACCATTGTGTTAACGGGCCTTAATATACTAATCACAGCCCTCTACTCTCTCCACATGTTCATTACAGTACAACGAGGAACACTCACACACCACATAATCAATATAAAACCCCCCTTCACACGAGAAAACATATTAATATTCATACACCTCGC [...]
+        <sequence id="seq_M_sylvanus" taxon="M_sylvanus" totalcount="4" value="AAGCTTCTCCGGTGCAACTATCCTTATAGTTGCCCATGGACTCACCTCTTCCATATACTTCTGCTTGGCCAACTCAAACTACGAACGCACCCACAGCCGCATCATACTACTATCCCGAGGACTCCAAATCCTACTCCCACTAACAGCCTTCTGATGATTCACAGCAAGCCTTACTAATCTTGCTCTACCCTCCACTATTAATCTACTGGGCGAACTCTTCGTAATCGCAACCTCATTTTCCTGATCCCACATCACCATCATACTAACAGGACTGAACATACTAATTACAGCCCTCTACTCTCTTCACATATTCACCACAACACAACGAGGAGCGCTCACACACCACATAATTAACATAAAACCACCTTTCACACGAGAAAACATATTAATACTCATACACCTCGCTCCAATTA [...]
+        <sequence id="seq_Saimiri_sciureus" taxon="Saimiri_sciureus" totalcount="4" value="AAGCTTCACCGGCGCAATGATCCTAATAATCGCTCACGGGTTTACTTCGTCTATGCTATTCTGCCTAGCAAACTCAAATTACGAACGAATTCACAGCCGAACAATAACATTTACTCGAGGGCTCCAAACACTATTCCCGCTTATAGGCCTCTGATGACTCCTAGCAAATCTCGCTAACCTCGCCCTACCCACAGCTATTAATCTAGTAGGAGAATTACTCACAATCGTATCTTCCTTCTCTTGATCCAACTTTACTATTATATTCACAGGACTTAATATACTAATTACAGCACTCTACTCACTTCATATGTATGCCTCTACACAGCGAGGTCCACTTACATACAGCACCAGCAATATAAAACCAATATTTACACGAGAAAATACGCTAATATTTATACATA [...]
+    </data>
+
+    <data data="@Primates" dataType="nucleotide" filter="1::3,2::3" id="firstAndSecondSites" name="taxa" spec="beast.evolution.alignment.FilteredAlignment"/>
+    <data data="@Primates" dataType="nucleotide" filter="3::3" id="thirdSites" name="taxa" spec="beast.evolution.alignment.FilteredAlignment"/>
+
+
+    <distribution id="posterior" spec="util.CompoundDistribution">
+
+        <distribution id="prior" spec="util.CompoundDistribution">
+            <distribution id="firstAndSecondSites.coalescent" populationModel="@firstAndSecondSites.ConstantPopulation" spec="Coalescent">
+                <treeIntervals id="treeIntervals" spec="TreeIntervals" tree="@tree"/>
+            </distribution>
+            <distribution id="firstAndSecondSites.kappa.prior" spec="beast.math.distributions.Prior" x="@firstAndSecondSites.hky.kappa">
+                <distr id="OneOnX0" offset="0.0" spec="beast.math.distributions.OneOnX"/>
+            </distribution>
+            <distribution id="thirdSites.kappa.prior" spec="beast.math.distributions.Prior" x="@thirdSites.hky.kappa">
+                <distr id="OneOnX1" offset="0.0" spec="beast.math.distributions.OneOnX"/>
+            </distribution>
+        </distribution>
+
+        <distribution id="likelihood" spec="util.CompoundDistribution">
+            <distribution data="@firstAndSecondSites" id="treeLikelihood" spec="TreeLikelihood" tree="@tree" useAmbiguities="false">
+                <siteModel gammaCategoryCount="0" id="firstAndSecondSites.siteModel" spec="SiteModel">
+                    <parameter dimension="1" estimate="false" id="firstAndSecondSites.mutationRate" name="mutationRate" value="1.0"/>
+                    <parameter dimension="1" estimate="false" id="firstAndSecondSites.gammaShape" name="shape" value="1.0"/>
+                    <parameter dimension="1" estimate="false" id="firstAndSecondSites.proportionInvariant" lower="0.0" name="proportionInvariant" upper="1.0" value="0.0"/>
+                    <substModel id="firstAndSecondSites.hky" kappa="@firstAndSecondSites.hky.kappa" spec="HKY">
+                        <frequencies estimate="true" frequencies="@firstAndSecondSites.freqParameter" id="firstAndSecondSites.freqs" spec="Frequencies"/>
+                    </substModel>
+                </siteModel>
+                <branchRateModel id="firstAndSecondSites.StrictClockModel" spec="beast.evolution.branchratemodel.StrictClockModel">
+                    <parameter dimension="1" estimate="false" id="firstAndSecondSites.clockRate" name="clock.rate" value="1.0"/>
+                </branchRateModel>
+            </distribution>
+            <distribution branchRateModel="@firstAndSecondSites.StrictClockModel" data="@thirdSites" id="thirdSites.treeLikelihood" spec="TreeLikelihood" tree="@tree" useAmbiguities="false">
+                <siteModel gammaCategoryCount="0" id="thirdSites.siteModel" spec="SiteModel">
+                    <parameter dimension="1" estimate="false" id="thirdSites.mutationRate" name="mutationRate" value="1.0"/>
+                    <parameter dimension="1" estimate="false" id="thirdSites.gammaShape" name="shape" value="1.0"/>
+                    <parameter dimension="1" estimate="false" id="thirdSites.proportionInvariant" lower="0.0" name="proportionInvariant" upper="1.0" value="0.0"/>
+                    <substModel id="thirdSites.hky" kappa="@thirdSites.hky.kappa" spec="HKY">
+                        <frequencies estimate="true" frequencies="@thirdSites.freqParameter" id="thirdSites.freqs" spec="Frequencies"/>
+                    </substModel>
+                </siteModel>
+            </distribution>
+        </distribution>
+    </distribution>
+
+
+    
+<run chainLength="10000000" id="mcmc" preBurnin="0" spec="MCMC" storeEvery="-1">
+    <init estimate="false" id="firstAndSecondSites.RandomTree" initial="@tree" spec="beast.evolution.tree.RandomTree">
+        <data idref="firstAndSecondSites" name="taxa"/>
+        <populationModel id="firstAndSecondSites.ConstantPopulation" spec="ConstantPopulation">
+            <parameter dimension="1" estimate="false" id="firstAndSecondSites.popSize" name="popSize" value="1.0"/>
+        </populationModel>
+    </init>
+
+
+    <state id="State0" storeEvery="100000">
+        <tree estimate="true" id="tree" name="stateNode"/>
+        <parameter dimension="4" estimate="true" id="thirdSites.freqParameter" name="stateNode" value="0.25"/>
+        <parameter dimension="1" estimate="true" id="thirdSites.hky.kappa" lower="0.0" name="stateNode" value="1.0"/>
+        <parameter dimension="1" estimate="true" id="firstAndSecondSites.hky.kappa" lower="0.0" name="stateNode" value="1.0"/>
+        <parameter dimension="1" estimate="true" id="RealParameter7" name="stateNode" value="0.333"/>
+        <parameter dimension="1" estimate="true" id="RealParameter6" name="stateNode" value="0.333"/>
+        <parameter dimension="4" estimate="true" id="firstAndSecondSites.freqParameter" name="stateNode" value="0.25"/>
+    </state>
+
+    <distribution idref="posterior"/>
+
+    <operator autoOptimize="true" delta="0.01" id="firstAndSecondSites.FrequenciesExchanger" integer="false" parameter="@firstAndSecondSites.freqParameter" spec="DeltaExchangeOperator" weight="0.1"/>
+    <operator autoOptimize="true" delta="0.01" id="thirdSites.FrequenciesExchanger" integer="false" parameter="@thirdSites.freqParameter" spec="DeltaExchangeOperator" weight="0.1"/>
+    <operator id="WilsonBalding0" spec="WilsonBalding" tree="@tree" weight="1.0"/>
+    <operator degreesOfFreedom="1" id="thirdSites.kappaScaler" parameter="@thirdSites.hky.kappa" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.5" spec="ScaleOperator" weight="1.0"/>
+    <operator degreesOfFreedom="1" id="treeScaler" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.5" spec="ScaleOperator" tree="@tree" weight="1.0"/>
+    <operator id="firstAndSecondSites.wide" isNarrow="false" spec="Exchange" tree="@tree" weight="1.0"/>
+    <operator id="Uniform0" spec="Uniform" tree="@tree" weight="10.0"/>
+    <operator id="firstAndSecondSites.narrow" isNarrow="true" spec="Exchange" tree="@tree" weight="1.0"/>
+    <operator degreesOfFreedom="1" id="firstAndSecondSites.kappaScaler" parameter="@firstAndSecondSites.hky.kappa" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.5" spec="ScaleOperator" weight="1.0"/>
+    <operator gaussian="true" id="SubtreeSlide0" size="1.0" spec="SubtreeSlide" tree="@tree" weight="5.0"/>
+
+    <logger fileName="beast_$(seed).log" id="tracelog" logEvery="10000" mode="autodetect" model="@posterior">
+        <distribution idref="likelihood" name="log"/>
+        <parameter idref="firstAndSecondSites.hky.kappa" name="log"/>
+        <log id="TreeHeightLogger0" spec="beast.evolution.tree.TreeHeightLogger" tree="@tree"/>
+        <parameter idref="firstAndSecondSites.freqParameter" name="log"/>
+        <parameter idref="thirdSites.hky.kappa" name="log"/>
+        <parameter idref="thirdSites.freqParameter" name="log"/>
+    </logger>
+
+    <logger fileName="beast_.$(seed).trees" id=".treelog" logEvery="10000" mode="autodetect">
+        <tree idref="tree" name="log"/>
+    </logger>
+
+    <logger id="screenlog" logEvery="10000" mode="autodetect" model="@posterior">
+        <log idref="posterior"/>
+        <distribution idref="treeLikelihood" name="log"/>
+        <distribution idref="thirdSites.treeLikelihood" name="log"/>
+        <log arg="@likelihood" id="ESS0" spec="util.ESS"/>
+        <parameter idref="firstAndSecondSites.hky.kappa" name="log"/>
+        <log arg="@firstAndSecondSites.hky.kappa" id="ESS1" spec="util.ESS"/>
+        <parameter idref="thirdSites.hky.kappa" name="log"/>
+        <log arg="@thirdSites.hky.kappa" id="ESS2" spec="util.ESS"/>
+    </logger>
+
+</run>
+
+
+
+
+</beast>
diff --git a/examples/testSYM.xml b/examples/testSYM.xml
new file mode 100644
index 0000000..dcafd09
--- /dev/null
+++ b/examples/testSYM.xml
@@ -0,0 +1,207 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<beast beautitemplate='Standard' beautistatus=''
+       namespace="beast.core:beast.evolution.alignment:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood"
+       version="2.0">
+
+
+    <data id="primate-mtDNA">
+        <sequence id="seq_Lemur_catta" taxon="Lemur_catta" totalcount="4"
+                  value="AAGCTTCATAGGAGCAACCATTCTAATAATCGCACATGGCCTTACATCATCCATATTATTCTGTCTAGCCAACTCTAACTACGAACGAATCCATAGCCGTACAATACTACTAGCACGAGGGATCCAAACCATTCTCCCTCTTATAGCCACCTGATGACTACTCGCCAGCCTAACTAACCTAGCCCTACCCACCTCTATCAATTTAATTGGCGAACTATTCGTCACTATAGCATCCTTCTCATGATCAAACATTACAATTATCTTAATAGGCTTAAATATGCTCATCACCGCTCTCTATTCCCTCTATATATTAACTACTACACAACGAGGAAAACTCACATATCATTCGCACAACCTAAACCCATCCTTTACACGAGAAAACACCCTTATATCCATACACATACTCCCCCTTCTCCTATTTACCTTAAACCCCAAAATTATTCTAGGACCCACGTACTGTAAATATA [...]
+        <sequence id="seq_Homo_sapiens" taxon="Homo_sapiens" totalcount="4"
+                  value="AAGCTTCACCGGCGCAGTCATTCTCATAATCGCCCACGGGCTTACATCCTCATTACTATTCTGCCTAGCAAACTCAAACTACGAACGCACTCACAGTCGCATCATAATCCTCTCTCAAGGACTTCAAACTCTACTCCCACTAATAGCTTTTTGATGACTTCTAGCAAGCCTCGCTAACCTCGCCTTACCCCCCACTATTAACCTACTGGGAGAACTCTCTGTGCTAGTAACCACGTTCTCCTGATCAAATATCACTCTCCTACTTACAGGACTCAACATACTAGTCACAGCCCTATACTCCCTCTACATATTTACCACAACACAATGGGGCTCACTCACCCACCACATTAACAACATAAAACCCTCATTCACACGAGAAAACACCCTCATGTTCATACACCTATCCCCCATTCTCCTCCTATCCCTCAACCCCGACATCATTACCGGGTTTTCCTCTTGTAAATATA [...]
+        <sequence id="seq_Pan" taxon="Pan" totalcount="4"
+                  value="AAGCTTCACCGGCGCAATTATCCTCATAATCGCCCACGGACTTACATCCTCATTATTATTCTGCCTAGCAAACTCAAATTATGAACGCACCCACAGTCGCATCATAATTCTCTCCCAAGGACTTCAAACTCTACTCCCACTAATAGCCTTTTGATGACTCCTAGCAAGCCTCGCTAACCTCGCCCTACCCCCTACCATTAATCTCCTAGGGGAACTCTCCGTGCTAGTAACCTCATTCTCCTGATCAAATACCACTCTCCTACTCACAGGATTCAACATACTAATCACAGCCCTGTACTCCCTCTACATGTTTACCACAACACAATGAGGCTCACTCACCCACCACATTAATAACATAAAGCCCTCATTCACACGAGAAAATACTCTCATATTTTTACACCTATCCCCCATCCTCCTTCTATCCCTCAATCCTGATATCATCACTGGATTCACCTCCTGTAAATATA [...]
+        <sequence id="seq_Gorilla" taxon="Gorilla" totalcount="4"
+                  value="AAGCTTCACCGGCGCAGTTGTTCTTATAATTGCCCACGGACTTACATCATCATTATTATTCTGCCTAGCAAACTCAAACTACGAACGAACCCACAGCCGCATCATAATTCTCTCTCAAGGACTCCAAACCCTACTCCCACTAATAGCCCTTTGATGACTTCTGGCAAGCCTCGCCAACCTCGCCTTACCCCCCACCATTAACCTACTAGGAGAGCTCTCCGTACTAGTAACCACATTCTCCTGATCAAACACCACCCTTTTACTTACAGGATCTAACATACTAATTACAGCCCTGTACTCCCTTTATATATTTACCACAACACAATGAGGCCCACTCACACACCACATCACCAACATAAAACCCTCATTTACACGAGAAAACATCCTCATATTCATGCACCTATCCCCCATCCTCCTCCTATCCCTCAACCCCGATATTATCACCGGGTTCACCTCCTGTAAATATA [...]
+        <sequence id="seq_Pongo" taxon="Pongo" totalcount="4"
+                  value="AAGCTTCACCGGCGCAACCACCCTCATGATTGCCCATGGACTCACATCCTCCCTACTGTTCTGCCTAGCAAACTCAAACTACGAACGAACCCACAGCCGCATCATAATCCTCTCTCAAGGCCTTCAAACTCTACTCCCCCTAATAGCCCTCTGATGACTTCTAGCAAGCCTCACTAACCTTGCCCTACCACCCACCATCAACCTTCTAGGAGAACTCTCCGTACTAATAGCCATATTCTCTTGATCTAACATCACCATCCTACTAACAGGACTCAACATACTAATCACAACCCTATACTCTCTCTATATATTCACCACAACACAACGAGGTACACCCACACACCACATCAACAACATAAAACCTTCTTTCACACGCGAAAATACCCTCATGCTCATACACCTATCCCCCATCCTCCTCTTATCCCTCAACCCCAGCATCATCGCTGGGTTCGCCTACTGTAAATATA [...]
+        <sequence id="seq_Hylobates" taxon="Hylobates" totalcount="4"
+                  value="AAGCTTTACAGGTGCAACCGTCCTCATAATCGCCCACGGACTAACCTCTTCCCTGCTATTCTGCCTTGCAAACTCAAACTACGAACGAACTCACAGCCGCATCATAATCCTATCTCGAGGGCTCCAAGCCTTACTCCCACTGATAGCCTTCTGATGACTCGCAGCAAGCCTCGCTAACCTCGCCCTACCCCCCACTATTAACCTCCTAGGTGAACTCTTCGTACTAATGGCCTCCTTCTCCTGGGCAAACACTACTATTACACTCACCGGGCTCAACGTACTAATCACGGCCCTATACTCCCTTTACATATTTATCATAACACAACGAGGCACACTTACACACCACATTAAAAACATAAAACCCTCACTCACACGAGAAAACATATTAATACTTATGCACCTCTTCCCCCTCCTCCTCCTAACCCTCAACCCTAACATCATTACTGGCTTTACTCCCTGTAAACATA [...]
+        <sequence id="seq_Macaca_fuscata" taxon="Macaca_fuscata" totalcount="4"
+                  value="AAGCTTTTCCGGCGCAACCATCCTTATGATCGCTCACGGACTCACCTCTTCCATATATTTCTGCCTAGCCAATTCAAACTATGAACGCACTCACAACCGTACCATACTACTGTCCCGAGGACTTCAAATCCTACTTCCACTAACAGCCTTTTGATGATTAACAGCAAGCCTTACTAACCTTGCCCTACCCCCCACTATCAATCTACTAGGTGAACTCTTTGTAATCGCAACCTCATTCTCCTGATCCCATATCACCATTATGCTAACAGGACTTAACATATTAATTACGGCCCTCTACTCTCTCCACATATTCACTACAACACAACGAGGAACACTCACACATCACATAATCAACATAAAGCCCCCCTTCACACGAGAAAACACATTAATATTCATACACCTCGCTCCAATTATCCTTCTATCCCTCAACCCCAACATCATCCTGGGGTTTACCTCCTGTAGATATA [...]
+        <sequence id="seq_M._mulatta" taxon="M._mulatta" totalcount="4"
+                  value="AAGCTTTTCTGGCGCAACCATCCTCATGATTGCTCACGGACTCACCTCTTCCATATATTTCTGCCTAGCCAATTCAAACTATGAACGCACTCACAACCGTACCATACTACTGTCCCGGGGACTTCAAATCCTACTTCCACTAACAGCTTTCTGATGATTAACAGCAAGCCTTACTAACCTTGCCCTACCCCCCACTATCAACCTACTAGGTGAACTCTTTGTAATCGCGACCTCATTCTCCTGGTCCCATATCACCATTATATTAACAGGATTTAACATACTAATTACGGCCCTCTACTCCCTCCACATATTCACCACAACACAACGAGGAGCACTCACACATCACATAATCAACATAAAACCCCCCTTCACACGAGAAAACATATTAATATTCATACACCTCGCTCCAATCATCCTCCTATCTCTCAACCCCAACATCATCCTGGGGTTTACTTCCTGTAGATATA [...]
+        <sequence id="seq_M._fascicularis" taxon="M._fascicularis" totalcount="4"
+                  value="AAGCTTCTCCGGCGCAACCACCCTTATAATCGCCCACGGGCTCACCTCTTCCATGTATTTCTGCTTGGCCAATTCAAACTATGAGCGCACTCATAACCGTACCATACTACTATCCCGAGGACTTCAAATTCTACTTCCATTGACAGCCTTCTGATGACTCACAGCAAGCCTTACTAACCTTGCCCTACCCCCCACTATTAATCTACTAGGCGAACTCTTTGTAATCACAACTTCATTTTCCTGATCCCATATCACCATTGTGTTAACGGGCCTTAATATACTAATCACAGCCCTCTACTCTCTCCACATGTTCATTACAGTACAACGAGGAACACTCACACACCACATAATCAATATAAAACCCCCCTTCACACGAGAAAACATATTAATATTCATACACCTCGCTCCAATTATCCTTCTATCTCTCAACCCCAACATCATCCTGGGGTTTACCTCCTGTAAATATA [...]
+        <sequence id="seq_M._sylvanus" taxon="M._sylvanus" totalcount="4"
+                  value="AAGCTTCTCCGGTGCAACTATCCTTATAGTTGCCCATGGACTCACCTCTTCCATATACTTCTGCTTGGCCAACTCAAACTACGAACGCACCCACAGCCGCATCATACTACTATCCCGAGGACTCCAAATCCTACTCCCACTAACAGCCTTCTGATGATTCACAGCAAGCCTTACTAATCTTGCTCTACCCTCCACTATTAATCTACTGGGCGAACTCTTCGTAATCGCAACCTCATTTTCCTGATCCCACATCACCATCATACTAACAGGACTGAACATACTAATTACAGCCCTCTACTCTCTTCACATATTCACCACAACACAACGAGGAGCGCTCACACACCACATAATTAACATAAAACCACCTTTCACACGAGAAAACATATTAATACTCATACACCTCGCTCCAATTATTCTTCTATCTCTTAACCCCAACATCATTCTAGGATTTACTTCCTGTAAATATA [...]
+        <sequence id="seq_Saimiri_sciureus" taxon="Saimiri_sciureus" totalcount="4"
+                  value="AAGCTTCACCGGCGCAATGATCCTAATAATCGCTCACGGGTTTACTTCGTCTATGCTATTCTGCCTAGCAAACTCAAATTACGAACGAATTCACAGCCGAACAATAACATTTACTCGAGGGCTCCAAACACTATTCCCGCTTATAGGCCTCTGATGACTCCTAGCAAATCTCGCTAACCTCGCCCTACCCACAGCTATTAATCTAGTAGGAGAATTACTCACAATCGTATCTTCCTTCTCTTGATCCAACTTTACTATTATATTCACAGGACTTAATATACTAATTACAGCACTCTACTCACTTCATATGTATGCCTCTACACAGCGAGGTCCACTTACATACAGCACCAGCAATATAAAACCAATATTTACACGAGAAAATACGCTAATATTTATACATATAACACCAATCCTCCTCCTTACCTTGAGCCCCAAGGTAATTATAGGACCCTCACCTTGTAATTATA [...]
+        <sequence id="seq_Tarsius_syrichta" taxon="Tarsius_syrichta" totalcount="4"
+                  value="AAGTTTCATTGGAGCCACCACTCTTATAATTGCCCATGGCCTCACCTCCTCCCTATTATTTTGCCTAGCAAATACAAACTACGAACGAGTCCACAGTCGAACAATAGCACTAGCCCGTGGCCTTCAAACCCTATTACCTCTTGCAGCAACATGATGACTCCTCGCCAGCTTAACCAACCTGGCCCTTCCCCCAACAATTAATTTAATCGGTGAACTGTCCGTAATAATAGCAGCATTTTCATGGTCACACCTAACTATTATCTTAGTAGGCCTTAACACCCTTATCACCGCCCTATATTCCCTATATATACTAATCATAACTCAACGAGGAAAATACACATATCATATCAACAATATCATGCCCCCTTTCACCCGAGAAAATACATTAATAATCATACACCTATTTCCCTTAATCCTACTATCTACCAACCCCAAAGTAATTATAGGAACCATGTACTGTAAATATA [...]
+    </data>
+
+
+    <map name="Beta">beast.math.distributions.Beta</map>
+    <map name="Exponential">beast.math.distributions.Exponential</map>
+    <map name="InverseGamma">beast.math.distributions.InverseGamma</map>
+    <map name="LogNormal">beast.math.distributions.LogNormalDistributionModel</map>
+    <map name="Gamma">beast.math.distributions.Gamma</map>
+    <map name="Uniform">beast.math.distributions.Uniform</map>
+    <map name="prior">beast.math.distributions.Prior</map>
+    <map name="LaplaceDistribution">beast.math.distributions.LaplaceDistribution</map>
+    <map name="OneOnX">beast.math.distributions.OneOnX</map>
+    <map name="Normal">beast.math.distributions.Normal</map>
+
+
+    <run chainLength="5000000" id="mcmc" spec="MCMC">
+        <state id="state" storeEvery="5000">
+            <tree id="Tree.t:primate" name="stateNode">
+                <taxonset id="TaxonSet.coding" spec="TaxonSet">
+                    <alignment filter="2-457,660-896" id="coding" spec="FilteredAlignment">
+                        <data idref="primate-mtDNA"/>
+                    </alignment>
+                </taxonset>
+            </tree>
+            <parameter id="birthRate.t:primate" name="stateNode" value="1.0"/>
+            <parameter id="rateAC.s:primate" lower="0.0" name="stateNode" value="1.0"/>
+            <parameter id="rateAG.s:primate" lower="0.0" name="stateNode" value="1.0"/>
+            <parameter id="rateAT.s:primate" lower="0.0" name="stateNode" value="1.0"/>
+            <parameter id="rateCG.s:primate" lower="0.0" name="stateNode" value="1.0"/>
+            <parameter id="rateGT.s:primate" lower="0.0" name="stateNode" value="1.0"/>
+            <parameter dimension="4" id="freqParameter.s:primate" lower="0.0" name="stateNode" upper="1.0"
+                       value="0.25"/>
+        </state>
+
+        <init estimate="false" id="RandomTree.t:primate" initial="@Tree.t:primate"
+              spec="beast.evolution.tree.RandomTree" taxa="@coding">
+            <populationModel id="ConstantPopulation0.t:primate" spec="ConstantPopulation">
+                <parameter id="randomPopSize.t:primate" name="popSize" value="1"/>
+            </populationModel>
+        </init>
+
+        <distribution id="posterior" spec="util.CompoundDistribution">
+            <distribution id="prior" spec="util.CompoundDistribution">
+                <distribution birthDiffRate="@birthRate.t:primate" id="YuleModel.t:primate"
+                              spec="beast.evolution.speciation.YuleModel" tree="@Tree.t:primate"/>
+                <prior id="YuleBirthRatePrior.t:primate" name="distribution" x="@birthRate.t:primate">
+                    <Uniform id="Uniform.0" name="distr" upper="Infinity"/>
+                </prior>
+                <prior id="RateACPrior.s:primate" name="distribution" x="@rateAC.s:primate">
+                    <LogNormal id="LogNormalDistributionModel.0" name="distr">
+                        <parameter estimate="false" id="RealParameter.0" name="M" value="0"/>
+                        <parameter estimate="false" id="RealParameter.01" lower="0.0" name="S" upper="5.0"
+                                   value="1.25"/>
+                    </LogNormal>
+                </prior>
+                <prior id="RateAGPrior.s:primate" name="distribution" x="@rateAG.s:primate">
+                    <LogNormal id="LogNormalDistributionModel.01" name="distr">
+                        <parameter estimate="false" id="RealParameter.02" name="M" value="0"/>
+                        <parameter estimate="false" id="RealParameter.03" lower="0.0" name="S" upper="5.0"
+                                   value="1.25"/>
+                    </LogNormal>
+                </prior>
+                <prior id="RateATPrior.s:primate" name="distribution" x="@rateAT.s:primate">
+                    <LogNormal id="LogNormalDistributionModel.02" name="distr">
+                        <parameter estimate="false" id="RealParameter.04" name="M" value="0"/>
+                        <parameter estimate="false" id="RealParameter.05" lower="0.0" name="S" upper="5.0"
+                                   value="1.25"/>
+                    </LogNormal>
+                </prior>
+                <prior id="RateCGPrior.s:primate" name="distribution" x="@rateCG.s:primate">
+                    <LogNormal id="LogNormalDistributionModel.03" name="distr">
+                        <parameter estimate="false" id="RealParameter.06" name="M" value="0"/>
+                        <parameter estimate="false" id="RealParameter.07" lower="0.0" name="S" upper="5.0"
+                                   value="1.25"/>
+                    </LogNormal>
+                </prior>
+                <prior id="RateGTPrior.s:primate" name="distribution" x="@rateGT.s:primate">
+                    <LogNormal id="LogNormalDistributionModel.04" name="distr">
+                        <parameter estimate="false" id="RealParameter.08" name="M" value="0"/>
+                        <parameter estimate="false" id="RealParameter.09" lower="0.0" name="S" upper="5.0"
+                                   value="1.25"/>
+                    </LogNormal>
+                </prior>
+            </distribution>
+            <distribution id="likelihood" spec="util.CompoundDistribution">
+                <distribution data="@coding" id="treeLikelihood.coding" spec="TreeLikelihood" tree="@Tree.t:primate">
+                    <siteModel id="SiteModel.s:primate" spec="SiteModel">
+                        <parameter estimate="false" id="mutationRate.s:primate" name="mutationRate" value="1.0"/>
+                        <parameter estimate="false" id="gammaShape.s:primate" name="shape" value="1.0"/>
+                        <parameter estimate="false" id="proportionInvariant.s:primate" lower="0.0"
+                                   name="proportionInvariant" upper="1.0" value="0.0"/>
+                        <substModel id="gtr.s:primate" rateAC="@rateAC.s:primate" rateAG="@rateAG.s:primate"
+                                    rateAT="@rateAT.s:primate" rateCG="@rateCG.s:primate" rateGT="@rateGT.s:primate"
+                                    spec="GTR">
+                            <parameter estimate="false" id="rateCT.s:primate" lower="0.0" name="rateCT" value="1.0"/>
+                            <frequencies frequencies="@freqParameter.s:primate" id="estimatedFreqs.s:primate"
+                                         spec="Frequencies"/>
+                        </substModel>
+                    </siteModel>
+                    <branchRateModel id="StrictClock.c:primate" spec="beast.evolution.branchratemodel.StrictClockModel">
+                        <parameter estimate="false" id="clockRate.c:primate" name="clock.rate" value="1.0"/>
+                    </branchRateModel>
+                </distribution>
+                <distribution branchRateModel="@StrictClock.c:primate" id="treeLikelihood.noncoding"
+                              siteModel="@SiteModel.s:primate" spec="TreeLikelihood" tree="@Tree.t:primate">
+                    <data data="@primate-mtDNA" filter="1,458-659,897-898" id="noncoding" spec="FilteredAlignment"/>
+                </distribution>
+            </distribution>
+        </distribution>
+
+        <operator id="YuleBirthRateScaler.t:primate" parameter="@birthRate.t:primate" scaleFactor="0.75"
+                  spec="ScaleOperator" weight="3.0"/>
+
+        <operator id="treeScaler.t:primate" scaleFactor="0.5" spec="ScaleOperator" tree="@Tree.t:primate" weight="3.0"/>
+
+        <operator id="treeRootScaler.t:primate" rootOnly="true" scaleFactor="0.5" spec="ScaleOperator"
+                  tree="@Tree.t:primate" weight="3.0"/>
+
+        <operator id="UniformOperator.t:primate" spec="Uniform" tree="@Tree.t:primate" weight="30.0"/>
+
+        <operator id="SubtreeSlide.t:primate" spec="SubtreeSlide" tree="@Tree.t:primate" weight="15.0"/>
+
+        <operator id="narrow.t:primate" spec="Exchange" tree="@Tree.t:primate" weight="15.0"/>
+
+        <operator id="wide.t:primate" isNarrow="false" spec="Exchange" tree="@Tree.t:primate" weight="3.0"/>
+
+        <operator id="WilsonBalding.t:primate" spec="WilsonBalding" tree="@Tree.t:primate" weight="3.0"/>
+
+        <operator id="RateACScaler.s:primate" parameter="@rateAC.s:primate" scaleFactor="0.5" spec="ScaleOperator"
+                  weight="0.1"/>
+
+        <operator id="RateAGScaler.s:primate" parameter="@rateAG.s:primate" scaleFactor="0.5" spec="ScaleOperator"
+                  weight="0.1"/>
+
+        <operator id="RateATScaler.s:primate" parameter="@rateAT.s:primate" scaleFactor="0.5" spec="ScaleOperator"
+                  weight="0.1"/>
+
+        <operator id="RateCGScaler.s:primate" parameter="@rateCG.s:primate" scaleFactor="0.5" spec="ScaleOperator"
+                  weight="0.1"/>
+
+        <operator id="RateGTScaler.s:primate" parameter="@rateGT.s:primate" scaleFactor="0.5" spec="ScaleOperator"
+                  weight="0.1"/>
+
+        <logger fileName="primate-mtDNA-SYM.log" id="tracelog" logEvery="5000" model="@posterior" sanitiseHeaders="true"
+                sort="smart">
+            <log idref="posterior"/>
+            <log idref="likelihood"/>
+            <log idref="prior"/>
+            <log idref="treeLikelihood.noncoding"/>
+            <log idref="treeLikelihood.coding"/>
+            <log id="TreeHeight.t:primate" spec="beast.evolution.tree.TreeHeightLogger" tree="@Tree.t:primate"/>
+            <log idref="YuleModel.t:primate"/>
+            <parameter idref="birthRate.t:primate" name="log"/>
+            <parameter idref="rateAC.s:primate" name="log"/>
+            <parameter idref="rateAG.s:primate" name="log"/>
+            <parameter idref="rateAT.s:primate" name="log"/>
+            <parameter idref="rateCG.s:primate" name="log"/>
+            <parameter idref="rateGT.s:primate" name="log"/>
+            <parameter idref="freqParameter.s:primate" name="log"/>
+        </logger>
+
+        <logger id="screenlog" logEvery="5000">
+            <log idref="posterior"/>
+            <log arg="@posterior" id="ESS.0" spec="util.ESS"/>
+            <log idref="likelihood"/>
+            <log idref="prior"/>
+        </logger>
+
+        <logger fileName="$(tree).trees" id="treelog.t:primate" logEvery="5000" mode="tree">
+            <log id="TreeWithMetaDataLogger.t:primate" spec="beast.evolution.tree.TreeWithMetaDataLogger"
+                 tree="@Tree.t:primate"/>
+        </logger>
+
+    </run>
+
+</beast>
diff --git a/examples/testSeqGen.xml b/examples/testSeqGen.xml
new file mode 100644
index 0000000..775c881
--- /dev/null
+++ b/examples/testSeqGen.xml
@@ -0,0 +1,89 @@
+<beast version='2.0'
+       namespace='beast.evolution.alignment:beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood'>
+
+
+    <data id="alignment" dataType="nucleotide">
+        <sequence taxon="human">?</sequence>
+        <sequence taxon="chimp">?</sequence>
+        <sequence taxon="bonobo">?</sequence>
+        <sequence taxon="gorilla">?</sequence>
+        <sequence taxon="orangutan">?</sequence>
+        <sequence taxon="siamang">?</sequence>
+    </data>
+
+
+
+    <tree id='tree' spec='beast.util.TreeParser' IsLabelledNewick='true' newick='((((human:0.02096625515232275,(chimp:0.014857143159686462,bonobo:0.014857143159686462):0.0061091119926362895):0.012862878672687175,gorilla:0.033829133825009926):0.029471223948245952,orangutan:0.06330035777325588):0.0031773962188650223,siamang:0.0664777539921209)' taxa='@alignment'/>
+
+
+    <run spec="beast.app.seqgen.SequenceSimulator" id="seqgen" data='@alignment' tree='@tree' sequencelength='3000'>
+	    <siteModel spec='SiteModel' id="siteModel" gammaCategoryCount='1'>
+<!--
+			<substModel spec='JukesCantor' id='JC69'/>
+-->
+			<substModel spec='HKY' id='hky'>
+			    <parameter name='kappa' id="hky.kappa" value="5.0" lower="0.0"/>
+				<frequencies id='freqs' spec='Frequencies'>
+				    <data idref='alignment'/>
+				</frequencies>
+			</substModel>
+
+<!--
+            <substModel id="GTR" spec="GTR">
+				<parameter dimension="1" id="rateAC.alignment" lower="0.0" minordimension="1" name="rateAC" value="0.01"/>
+				<parameter dimension="1" id="rateAG.alignment" lower="0.0" minordimension="1" name="rateAG" value="5.0"/>
+				<parameter dimension="1" id="rateAT.alignment" lower="0.0" minordimension="1" name="rateAT" value="0.2"/>
+				<parameter dimension="1" id="rateCG.alignment" lower="0.0" minordimension="1" name="rateCG" value="0.03"/>
+				<parameter dimension="1" id="rateCT.alignment" lower="0.0" minordimension="1" name="rateCT" value="1.0"/>
+				<parameter dimension="1" id="rateGT.alignment" lower="0.0" minordimension="1" name="rateGT" value="0.1"/>
+                <frequencies id="freqs" spec="Frequencies">
+					<parameter name='frequencies' value='0.25 0.25 0.25 0.25'/>
+				</frequencies>
+            </substModel>
+-->
+<!--
+            <substModel id="TN93" spec="GTR">
+				<parameter dimension="1" id="rateAC.alignment" lower="0.0" minordimension="1" name="rateAC" value="0.5"/>
+				<parameter dimension="1" id="rateAG.alignment" lower="0.0" minordimension="1" name="rateAG" value="5.0"/>
+				<parameter dimension="1" id="rateAT.alignment" lower="0.0" minordimension="1" name="rateAT" value="0.5"/>
+				<parameter dimension="1" id="rateCG.alignment" lower="0.0" minordimension="1" name="rateCG" value="0.5"/>
+				<parameter dimension="1" id="rateCT.alignment" lower="0.0" minordimension="1" name="rateCT" value="1.0"/>
+				<parameter dimension="1" id="rateGT.alignment" lower="0.0" minordimension="1" name="rateGT" value="0.5"/>
+                <frequencies id="freqs" spec="Frequencies">
+					<parameter name='frequencies' value='0.25 0.25 0.25 0.25'/>
+				</frequencies>
+            </substModel>
+-->
+<!--
+            <substModel id="TIM" spec="GTR">
+				<parameter dimension="1" id="rateAC.alignment" lower="0.0" minordimension="1" name="rateAC" value="0.2"/>
+				<parameter dimension="1" id="rateAG.alignment" lower="0.0" minordimension="1" name="rateAG" value="5.0"/>
+				<parameter dimension="1" id="rateAT.alignment" lower="0.0" minordimension="1" name="rateAT" value="0.5"/>
+				<parameter dimension="1" id="rateCG.alignment" lower="0.0" minordimension="1" name="rateCG" value="0.5"/>
+				<parameter dimension="1" id="rateCT.alignment" lower="0.0" minordimension="1" name="rateCT" value="1.0"/>
+				<parameter dimension="1" id="rateGT.alignment" lower="0.0" minordimension="1" name="rateGT" value="0.2"/>
+                <frequencies id="freqs" spec="Frequencies">
+					<parameter name='frequencies' value='0.25 0.25 0.25 0.25'/>
+				</frequencies>
+            </substModel>
+-->
+<!--
+            <substModel id="new" spec="GTR">
+				<parameter dimension="1" id="rateAC.alignment" lower="0.0" minordimension="1" name="rateAC" value="0.2"/>
+				<parameter dimension="1" id="rateAG.alignment" lower="0.0" minordimension="1" name="rateAG" value="5.0"/>
+				<parameter dimension="1" id="rateAT.alignment" lower="0.0" minordimension="1" name="rateAT" value="0.5"/>
+				<parameter dimension="1" id="rateCG.alignment" lower="0.0" minordimension="1" name="rateCG" value="0.1"/>
+				<parameter dimension="1" id="rateCT.alignment" lower="0.0" minordimension="1" name="rateCT" value="1.0"/>
+				<parameter dimension="1" id="rateGT.alignment" lower="0.0" minordimension="1" name="rateGT" value="0.2"/>
+                <frequencies id="freqs" spec="Frequencies">
+					<parameter name='frequencies' value='0.25 0.25 0.25 0.25'/>
+				</frequencies>
+            </substModel>
+-->
+	    </siteModel>
+
+        <branchRateModel id="StrictClock" spec="beast.evolution.branchratemodel.StrictClockModel">
+            <parameter dimension="1" estimate="false" id="clockRate" minordimension="1" name="clock.rate" value="1.0"/>
+        </branchRateModel>
+	</run>
+</beast>
diff --git a/examples/testSimulatedAlignment.xml b/examples/testSimulatedAlignment.xml
new file mode 100644
index 0000000..ffcd160
--- /dev/null
+++ b/examples/testSimulatedAlignment.xml
@@ -0,0 +1,126 @@
+<beast version='2.0'
+       namespace='beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood:beast.evolution.alignment'>
+
+    <!-- The simulated sequence alignment. -->
+    <data spec='beast.app.seqgen.SimulatedAlignment' id="alignment"
+	  sequencelength="2000"
+	  outputFileName="simulated_alignment.xml">
+
+      <!-- The true tree down which sequences are simulated. -->
+      <tree spec='beast.util.TreeParser'
+	    newick="((((human:0.021044961362048316,(chimp:0.01010430475937982,bonobo:0.01010430475937982):0.010940656602668497):0.012937366252643932,gorilla:0.03398232761469225):0.019356330316295488,orangutan:0.053338657930987736):0.011836836575646971,siamang:0.0651754945066347):0.0"
+	    IsLabelledNewick="true"/>
+
+      <data spec='Alignment' id="input_alignment" dataType="nucleotide">
+        <sequence spec='Sequence' taxon="human" value="?"/>
+        <sequence spec='Sequence' taxon="chimp" value="?"/>
+        <sequence spec='Sequence' taxon="bonobo" value="?"/>
+        <sequence spec='Sequence' taxon="gorilla" value="?"/>
+        <sequence spec='Sequence' taxon="orangutan" value="?"/>
+        <sequence spec='Sequence' taxon="siamang" value="?"/>
+      </data>
+
+      <siteModel spec="SiteModel" id="trueSiteModel" mutationRate="0.005">
+	<substModel spec="JukesCantor"/>
+      </siteModel>
+      
+    </data>
+
+    <!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+    <input spec='HKY' id="hky">
+        <parameter name='kappa' idref='hky.kappa'/>
+        <input id='freqs' name='frequencies' spec='Frequencies'>
+            <input name='data' idref='alignment'/>
+        </input>
+    </input>
+
+    <!-- site model                                                              -->
+    <input spec='SiteModel' id="siteModel">
+        <!--<parameter name='mutationRate'>1.0</parameter>-->
+        <input name='substModel' idref='hky'/>
+    </input>
+
+    <input spec='TreeLikelihood' id="treeLikelihood">
+        <input name='data' idref="alignment"/>
+        <input name='tree' idref="tree"/>
+        <input name='siteModel' idref="siteModel"/>
+    </input>
+
+
+    <input spec='beast.util.ClusterTree' id='tree' clusterType='upgma'>
+        <input name='taxa' idref='alignment'/>
+    </input>
+
+    <input spec='beast.core.parameter.RealParameter' id="hky.kappa">1.0</input>
+
+    <input spec='beast.core.parameter.RealParameter' id="popSize">1.0</input>
+
+
+    <run spec="MCMC" id="mcmc" chainLength="1000000"> <!--autoOptimize="true"-->
+        <state>
+            <input name='stateNode' idref='hky.kappa'/>
+            <input name='stateNode' idref='popSize'/>
+            <input name='stateNode' idref='tree'/>
+        </state>
+
+        <distribution spec="CompoundDistribution" id="posterior">
+            <distribution id="coalescent" spec="Coalescent">
+                <treeIntervals spec='TreeIntervals' id='TreeIntervals'>
+                     <tree idref="tree"/>
+                </treeIntervals>
+                <populationModel spec="ConstantPopulation" id='ConstantPopulation'>
+                    <parameter name="popSize" idref="popSize"/>
+                </populationModel>
+            </distribution>
+            <distribution id='likelihood' idref="treeLikelihood"/>
+        </distribution>
+
+        <operator id='kappaScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1">
+            <parameter idref="hky.kappa"/>
+        </operator>
+        <operator id='popSizeScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1">
+            <parameter idref="popSize"/>
+        </operator>
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1">
+            <tree idref="tree"/>
+        </operator>
+        <operator spec='Uniform' weight="10">
+            <tree idref="tree"/>
+        </operator>
+        <operator spec='SubtreeSlide' weight="5" gaussian="true" size="1.0">
+            <tree idref="tree"/>
+        </operator>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="1">
+            <tree idref="tree"/>
+        </operator>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="1">
+            <tree idref="tree"/>
+        </operator>
+        <operator spec='WilsonBalding' weight="1">
+            <tree idref="tree"/>
+        </operator>
+
+        <logger logEvery="10000" fileName="test.$(seed).log">
+   	        <model idref='posterior'/>
+            <log idref="coalescent"/>
+            <log idref="likelihood"/>
+            <!--parameter idref="treeModel.rootHeight"/-->
+            <log idref="popSize"/>
+            <log idref="hky.kappa"/>
+            <log idref="posterior"/>
+        </logger>
+        <logger logEvery="10000" fileName="test.$(seed).trees">
+            <log idref="tree"/>
+        </logger>
+        <logger logEvery="10000">
+	        <model idref='posterior'/>
+            <log idref="coalescent"/>
+            <log idref="likelihood"/>
+            <!--parameter idref="treeModel.rootHeight"/-->
+            <log idref="popSize"/>
+            <log idref="hky.kappa"/>
+            <log idref="posterior"/>
+        </logger>
+    </run>
+
+</beast>
diff --git a/examples/testSliceHKY.xml b/examples/testSliceHKY.xml
new file mode 100644
index 0000000..ac0533e
--- /dev/null
+++ b/examples/testSliceHKY.xml
@@ -0,0 +1,127 @@
+<beast version='2.0'
+       namespace='beast.evolution.alignment:beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood'>
+
+
+    <!-- The sequence alignment                                                  -->
+    <!-- ntax=6 nchar=768                                                        -->
+    <!-- npatterns=69                                                            -->
+    <data id="alignment" dataType="nucleotide">
+        <sequence taxon="human">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="chimp">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="bonobo">
+            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAGC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTTGAATTTGCAATTCAATATGAAAA-TCAC [...]
+        </sequence>
+        <sequence taxon="gorilla">
+            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTAAACATAGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA-CAACACTTAATTTCTGTAAGGACTGCAAAACCCTACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCAATGGGACTCAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAT-TCAC [...]
+        </sequence>
+        <sequence taxon="orangutan">
+            AGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA-CAGCACTTAATTTCTGTAAGGACTGCAAAACCCCACTTTGCATCAACTGAGCGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCCTAGACCGATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAT-TGGCTTCAGTCCAAAGCCCCGGCAGGCCTTAAAGCTGCTCCTTCGAATTTGCAATTCAACATGACAA-TCAC [...]
+        </sequence>
+        <sequence taxon="siamang">
+            AGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTAACAAAACTTAATTTCTGCAAGGGCTGCAAAACCCTACTTTGCATCAACCGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCGATGGGACTTAAACCCATAAAAATTTAGTTAACAGCTAAACACCCTAAACAACCTGGCTTCAATCTAAAGCCCCGGCAGA-GTTGAAGCTGCTTCTTTGAACTTGCAATTCAACGTGAAAAATCAC [...]
+        </sequence>
+    </data>
+
+    <!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+    <input spec='HKY' id='hky'>
+        <kappa idref='hky.kappa'/>
+        <frequencies id='freqs' spec='Frequencies'>
+            <data idref='alignment'/>
+        </frequencies>
+    </input>
+
+    <!-- site model                                                              -->
+    <input spec='SiteModel' id="siteModel" gammaCategoryCount='1'>
+<!--
+	<parameter name='shape' id='shape' value='0.5'/>
+	<parameter name='proportionInvariant' id='propInvar' value='0.2'/>
+-->
+        <substModel idref='hky'/>
+    </input>
+
+    <input spec='TreeLikelihood' id="treeLikelihood">
+        <data idref="alignment"/>
+        <tree idref="tree"/>
+        <siteModel idref="siteModel"/>
+    </input>
+
+    <parameter id="hky.kappa" value="1.0" lower="0.0"/>
+
+    <tree id='tree'/>
+
+    <tree spec='beast.util.ClusterTree' id='upgmatree' clusterType='upgma' initial='@tree'>
+        <taxa idref='alignment'/>
+    </tree>
+    <tree spec='beast.evolution.tree.RandomTree' id='coalescentSimulator' initial='@tree' taxa='@alignment'>
+        <populationModel spec='ConstantPopulation'>
+		<popSize spec='parameter.RealParameter' value='1'/>
+	</populationModel>
+    </tree>
+
+
+
+    <run spec="MCMC" id="mcmc" chainLength="10000000">
+<!--
+        <state storeEvery='100000'>
+            <stateNode idref="hky.kappa"/>
+            <stateNode idref="tree"/>
+            <stateNode idref="propInvar"/>
+            <stateNode idref="shape"/>
+        </state>
+-->
+	<init idref='coalescentSimulator'/>
+	<distribution spec='CompoundDistribution' id='posterior'>
+<!--
+		<distribution spec='beast.math.distributions.Prior' x='@hky.kappa'>
+			<distribution spec='beast.math.distributions.OneOnX'/>
+		</distribution>
+-->
+        	<distribution id='likelihood' idref="treeLikelihood"/>
+	</distribution>
+<!--
+        <operator id='shapeScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" parameter="@shape"/>
+        <operator id='invarScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" parameter="@propInvar"/>
+-->
+        <operator id='kappaScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" parameter="@hky.kappa"/>
+        <operator id='kappaSlice' spec='SliceOperator' weight="1"
+		  parameter="@hky.kappa"
+		  windowSize="1"
+		  sliceDensity="@posterior"/>
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" tree="@tree"/>
+
+
+<!--
+        <operator spec='SubtreeSlide' weight="5" gaussian="true" size="1.0" tree="@tree"/>
+        <operator id="Reheight" spec="NodeReheight2" tree="@tree" weight="5" scaleFactor='0.5'>
+        </operator>
+-->
+
+        <operator spec='Uniform' weight="10" tree="@tree"/>
+        <operator spec='SubtreeSlide' weight="5" gaussian="true" size="1.0" tree="@tree"/>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="1" tree="@tree"/>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="1" tree="@tree"/>
+        <operator spec='WilsonBalding' weight="1" tree="@tree"/>
+
+        <logger logEvery="10000" fileName="test.$(seed).log">
+	        <model idref='likelihood'/>
+            <log idref="likelihood"/>
+            <log idref='hky.kappa'/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+        </logger>
+        <logger logEvery="10000" fileName="test.$(seed).trees">
+            <log idref="tree"/>
+        </logger>
+        <logger logEvery="10000">
+	        <model idref='likelihood'/>
+            <log idref="likelihood"/>
+    	    <ESS spec='ESS' name='log' arg="@likelihood"/>
+            <log idref='hky.kappa'/>
+    	    <ESS spec='ESS' name='log' arg="@hky.kappa"/>
+        </logger>
+    </run>
+
+</beast>
diff --git a/examples/testStarBeast.xml b/examples/testStarBeast.xml
new file mode 100644
index 0000000..17d9bf1
--- /dev/null
+++ b/examples/testStarBeast.xml
@@ -0,0 +1,349 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><beast namespace="beast.evolution.speciation:beast.evolution.alignment:beast.core:beast.math:beast.evolution:beast.evolution.tree:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood" version="2.0">
+
+
+
+
+    <data dataType="nucleotide" id="26" name="taxa">
+<sequence taxon="Orthogeomys_heterodus">		ATTCTAGGCAAAAAG-AGCAATGCTGGAGGTATTACAATACCAGACTTCAAACTTTACTATAGAGCCATAATAACAAAAACCGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAATGGAAYAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGTCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCACCATGCACAGGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCAGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGGGAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATAGGAGAAAGACT [...]
+<sequence taxon="Thomomys_bottae_albatus">		????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGATCCAGAAATAGAACCAC-ATACCTATAGTCAACTTGTATTTGATAAAGGAGCTAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCATTTCACCATGCACAAGAATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCT-------------------------------------CATAGGCACTCATAGGCACAGGCAAAAGATTCCTATACAGGAACCCAGGGTCAACAACAGATTGGAGAGAGA [...]
+<sequence taxon="Thomomys_bottae_alpinus">		????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCTATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCA???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+<sequence taxon="Thomomys_bottae_awahnee_a">		????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACMCAGTCTATTCAATTATTGGKGCTGGCAAAACTGGGCAGCCMCATGCARAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAA????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+<sequence taxon="Thomomys_bottae_awahnee_b">		????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCM-CAACAGATTGGAGAGA [...]
+<sequence taxon="Thomomys_bottae_bottae">		????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAAATTCCTGAACAGAATCCCAGGGTCA-CAACAGATKGGAGAGAGAC [...]
+<sequence taxon="Thomomys_bottae_cactophilus">		????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAAYGTCAGACCGGAAACCGTGAAAYTGTTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAA?????????????????????????????????????????? [...]
+<sequence taxon="Thomomys_bottae_laticeps">		????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAATTGCTACATGATAAWGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAG [...]
+<sequence taxon="Thomomys_bottae_mewa">		????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCATTTCACCATGCACAAGAATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAA???????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+<sequence taxon="Thomomys_bottae_riparius">		????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAG [...]
+<sequence taxon="Thomomys_bottae_ruidosae">		????????????????AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCARAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAAYTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAG??????????????????????????????????????????? [...]
+<sequence taxon="Thomomys_bottae_saxatilis">		????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAA????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? [...]
+<sequence taxon="Thomomys_bottae_xerophilus">		????????????????????ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAAYTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAA???????????????????????????????? [...]
+<sequence taxon="Thomomys_idahoensis_pygmaeus_a">		????????CAAAA-G-AGCAATGCTGGTGGTATYACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATMCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCRACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGG [...]
+<sequence taxon="Thomomys_idahoensis_pygmaeus_b">		????GGCGCAAAA-G-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATMCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGG [...]
+<sequence taxon="Thomomys_mazama_mazama">		ATTCTAGGCAAAAAGAAGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAAYTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGAC [...]
+<sequence taxon="Thomomys_mazama_nasicus">		ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCSCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAAYTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGA [...]
+<sequence taxon="Thomomys_monticola_a">		??????????????G-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGYCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTC [...]
+<sequence taxon="Thomomys_monticola_b">		ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATYACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAWATAGAACCAC-ACAACTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAATGGAACRAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAGACTC [...]
+<sequence taxon="Thomomys_talpoides_bridgeri">		ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATCCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCRACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGA [...]
+<sequence taxon="Thomomys_talpoides_ocius">		???CTAGGCAAAA-G-AGC-ATGCTGGTGGTATCACAATACCAGACTTCAAACTTTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATMCAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCRACGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAACTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAGAGAG [...]
+<sequence taxon="Thomomys_talpoides_yakimensis">		ATTCTAGGCAAAA-G-AGCAATGCTGGTGGTATCACAATACCAGACTTCAAACTKTACTATAAAGCCATAATAACAAAAACTGC-TTGGTACTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGATATAGAACCAC-ACAACTATAGGCAACTTRTATTTGACAAAGGAGCCAAAGATATACAATGGAACGAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGAAAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAAYGTCAGACCGGAAACCGTGAAACTGCTACATGATAATGTAGGAGAGACACTGGAAYTCATAGGCACAGGAAACAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGA [...]
+<sequence taxon="Thomomys_townsendii_relictus">		??????????????G-AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTAYTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCACTATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACAATGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAATTGCTACATGATAAWGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAG [...]
+<sequence taxon="Thomomys_townsendii_townsendii">		ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTYGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAACGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGG [...]
+<sequence taxon="Thomomys_umbrinus_atroavarius">		ATTCTAGGCAAAAAG-AGCAATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGCATTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGKCAACTTGTATTTGACAAAGGAGCCAAAGATATACAGTGGAACAAACACAGYCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCCTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAAYGTCAGACCGGAAACCGTGAAATTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGA [...]
+<sequence taxon="Thomomys_umbrinus_chihuahuae">		?????????????AG-AGC-ATGCTGGTGGTATTACAATACCAGACTTCAAACTCTACTATAGAGCCATAATAACAAAAACTGC-TTGGTATTGGCACAAAAACAGACCAGAAGATCAGTGGAACAGAATAGAAGACCCAGAAATAGAACCAC-ATACCTATAGGCAACTTGTATTTGACAAAGGAGCCAAAGATATACARTGGAACAAACACAGTCTATTCAATTATTGGTGCTGGCAAAACTGGGCAGCCACATGCAGAAAACTAAAAATTGACCCTAGCTTTTCGCCATGCACAAGCATTAACTCAAAGTGGATCAAAGACCTCAATGTCAGACCGGAAACCGTGAAACTGCTACATGATAAAGTAGGAGAGACACTGGAACTCATAGGCACAGGCAAAAGATTCCTGAACAGAATCCCAGGGTCA-CAACAGATTGGAG [...]
+</data>
+
+    <data dataType="nucleotide" id="29" name="taxa">
+
+<sequence taxon="Orthogeomys_heterodus">		C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCACAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCGTTTCTGGAAAACTGAGATCTTGTTTTGACCAACAGAAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTACTGGTGATGTCTCTGTCAGGATCTAGTCCCATCCTG-AATCCATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTCAGAACTGACTGAATCAGGCCAGTGAAAGTTA-CAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATTGTGCATGGCTTCATTAGCAGGTTTACTGTGCTGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAA [...]
+<sequence taxon="Thomomys_bottae_albatus">		C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGC [...]
+<sequence taxon="Thomomys_bottae_alpinus">		C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCC-AGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGTTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCYACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGC [...]
+<sequence taxon="Thomomys_bottae_awahnee_a">		C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTT [...]
+<sequence taxon="Thomomys_bottae_awahnee_b">		C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTT [...]
+<sequence taxon="Thomomys_bottae_bottae">		C-AGCTTGCTG-TCACACYGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTAKGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCA [...]
+<sequence taxon="Thomomys_bottae_cactophilus">		C-AGCTTGCTG-TCACACTACCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCACTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAAT [...]
+<sequence taxon="Thomomys_bottae_laticeps">		C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTG [...]
+<sequence taxon="Thomomys_bottae_mewa">		C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTGCAAA [...]
+<sequence taxon="Thomomys_bottae_riparius">		C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTG [...]
+<sequence taxon="Thomomys_bottae_ruidosae">		?????????????????????????????C-AGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTTG [...]
+<sequence taxon="Thomomys_bottae_saxatilis">		C-AGCTTGCTG-TCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATTT [...]
+<sequence taxon="Thomomys_bottae_xerophilus">		C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCACTAAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTRTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAATT [...]
+<sequence taxon="Thomomys_idahoensis_pygmaeus_a">		C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTTTAAGTGTTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGTCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGTCCAGTGAAACTTAACAGCTACCTTGCCAATKGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGG--TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATA [...]
+<sequence taxon="Thomomys_idahoensis_pygmaeus_b">		CAAGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTGTTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGTCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGG--TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATA [...]
+<sequence taxon="Thomomys_mazama_mazama">		C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTATTGCCTGGATATAGTGTCTATAGACAGAGACAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCACATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCACCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCTGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCA [...]
+<sequence taxon="Thomomys_mazama_nasicus">		C-AGCTTGCTG-TCACAATGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTATTGCCTGGATATAGTGTCTATAGACAGAGACAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCACATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCTGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGC [...]
+<sequence taxon="Thomomys_monticola_a">		C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGACGCCKTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAA [...]
+<sequence taxon="Thomomys_monticola_b">		C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGACGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTYCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTGCAAA [...]
+<sequence taxon="Thomomys_talpoides_bridgeri">		C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAAT [...]
+<sequence taxon="Thomomys_talpoides_ocius">		C-AGCTTGCTGGTCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCATATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAAWGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAAATTTG [...]
+<sequence taxon="Thomomys_talpoides_yakimensis">		C-AGCTTGCTG-TCACACTGTCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTGCCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCTCCTCAGCTCCTGGATTGCTGGTGCTGGTGACGTCTCTGTCAGGATCCAGTCCCATCCTG-AATTGATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGACTCTTAAGAACTGAMTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGG-TCTTTCCAAGGATTGTGCTTCTTGATTTGGTCCCTGGATAA [...]
+<sequence taxon="Thomomys_townsendii_relictus">		C-AGCTTGCTGGTCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAA [...]
+<sequence taxon="Thomomys_townsendii_townsendii">		C-AGCTTGCTGGTCACACCGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATA [...]
+<sequence taxon="Thomomys_umbrinus_atroavarius">		C-AGCTTGCTG-TCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAGGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTG-AATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAA [...]
+<sequence taxon="Thomomys_umbrinus_chihuahuae">		C-AGCTTGCTGGTCACACTGCCCCTTCTACAAGCCCAGCTGACAGAGGCCTTAAGTACTACCTGGATATAATGTCTATAGACAGAGGCAATTCTGGAAAACTCAGATCTTATTTTGACCAACAAGAATTAATGTCTATGGTAGAATTCCCCTCAGCTCCTGGATTGCTGGTACTGGTGACGTCTCTGTCAGAATCCAGTCCCATCCTGGAATTTATACTTAACAATTTTCTAAGTATTTTGTGGTCTTGCTCTACCTCCAGGGAAGCTGGCCTGGCTATGAAAGGAAGGGCTCTTTAGAACTGACTGAATCAGGCCAGTGAAACTTAACAGCTACCTTGCCAATGGTCTGTGTGCCAGTGACATCGTGCATGGCTTCATTAGCAGATTTACTGTGCCGGGGTCTTTCCAAGGATTGTGCTTGTTGATTTGGTCCCTGGATAAA [...]
+            </data>
+
+	<taxonset spec='TaxonSet' id='lineagetaxa'>
+		<taxon idref='Orthogeomys_heterodus'/>
+		<taxon idref='Thomomys_bottae_albatus'/>
+		<taxon idref='Thomomys_bottae_alpinus'/>
+		<taxon idref='Thomomys_bottae_awahnee_a'/>
+		<taxon idref='Thomomys_bottae_awahnee_b'/>
+		<taxon idref='Thomomys_bottae_bottae'/>
+		<taxon idref='Thomomys_bottae_cactophilus'/>
+		<taxon idref='Thomomys_bottae_laticeps'/>
+		<taxon idref='Thomomys_bottae_mewa'/>
+		<taxon idref='Thomomys_bottae_riparius'/>
+		<taxon idref='Thomomys_bottae_ruidosae'/>
+		<taxon idref='Thomomys_bottae_saxatilis'/>
+		<taxon idref='Thomomys_bottae_xerophilus'/>
+		<taxon idref='Thomomys_idahoensis_pygmaeus_a'/>
+		<taxon idref='Thomomys_idahoensis_pygmaeus_b'/>
+		<taxon idref='Thomomys_mazama_mazama'/>
+		<taxon idref='Thomomys_mazama_nasicus'/>
+		<taxon idref='Thomomys_monticola_a'/>
+		<taxon idref='Thomomys_monticola_b'/>
+		<taxon idref='Thomomys_talpoides_bridgeri'/>
+		<taxon idref='Thomomys_talpoides_ocius'/>
+		<taxon idref='Thomomys_talpoides_yakimensis'/>
+		<taxon idref='Thomomys_townsendii_relictus'/>
+		<taxon idref='Thomomys_townsendii_townsendii'/>
+		<taxon idref='Thomomys_umbrinus_atroavarius'/>
+		<taxon idref='Thomomys_umbrinus_chihuahuae'/>        
+    </taxonset>   
+    
+	<taxonset spec='TaxonSet' id='taxonsuperset'>
+                <taxon spec='TaxonSet' id='Orthogeomys_heterodus_species'>
+                    <taxon spec='Taxon' id='Orthogeomys_heterodus'/>
+                </taxon>
+                <taxon spec='TaxonSet' id='Thomomys_bottae'>
+                    <taxon spec='Taxon' id='Thomomys_bottae_awahnee_a'/>
+                    <taxon spec='Taxon' id='Thomomys_bottae_awahnee_b'/>
+                    <taxon spec='Taxon' id='Thomomys_bottae_xerophilus'/>
+                    <taxon spec='Taxon' id='Thomomys_bottae_cactophilus'/>
+                    <taxon spec='Taxon' id='Thomomys_bottae_albatus'/>
+                    <taxon spec='Taxon' id='Thomomys_bottae_ruidosae'/>
+                    <taxon spec='Taxon' id='Thomomys_bottae_bottae'/>
+                    <taxon spec='Taxon' id='Thomomys_bottae_alpinus'/>
+                    <taxon spec='Taxon' id='Thomomys_bottae_riparius'/>
+                    <taxon spec='Taxon' id='Thomomys_bottae_mewa'/>
+                    <taxon spec='Taxon' id='Thomomys_bottae_saxatilis'/>
+                    <taxon spec='Taxon' id='Thomomys_bottae_laticeps'/>
+                </taxon>
+                <taxon spec='TaxonSet' id='Thomomys_idahoensis'>
+                    <taxon spec='Taxon' id='Thomomys_idahoensis_pygmaeus_a'/>
+                    <taxon spec='Taxon' id='Thomomys_idahoensis_pygmaeus_b'/>
+                </taxon>
+                <taxon spec='TaxonSet' id='Thomomys_mazama'>
+                    <taxon spec='Taxon' id='Thomomys_mazama_mazama'/>
+                    <taxon spec='Taxon' id='Thomomys_mazama_nasicus'/>
+                </taxon>
+                <taxon spec='TaxonSet' id='Thomomys_monticola'>
+                    <taxon spec='Taxon' id='Thomomys_monticola_a'/>
+                    <taxon spec='Taxon' id='Thomomys_monticola_b'/>
+                </taxon>
+                <taxon spec='TaxonSet' id='Thomomys_talpoides'>
+                    <taxon spec='Taxon' id='Thomomys_talpoides_yakimensis'/>
+                    <taxon spec='Taxon' id='Thomomys_talpoides_bridgeri'/>
+                    <taxon spec='Taxon' id='Thomomys_talpoides_ocius'/>
+                </taxon>
+                <taxon spec='TaxonSet' id='Thomomys_townsendii'>
+                    <taxon spec='Taxon' id='Thomomys_townsendii_townsendii'/>
+                    <taxon spec='Taxon' id='Thomomys_townsendii_relictus'/>
+                </taxon>
+                <taxon spec='TaxonSet' id='Thomomys_umbrinus'>
+                    <taxon spec='Taxon' id='Thomomys_umbrinus_chihuahuae'/>
+                    <taxon spec='Taxon' id='Thomomys_umbrinus_atroavarius'/>
+                </taxon>
+	</taxonset>
+
+    <distribution id="posterior" spec="util.CompoundDistribution">
+        <distribution id="prior" spec="util.CompoundDistribution">
+
+		    <distribution id="speciesCoalescent" spec="util.CompoundDistribution">
+		        <!-- gene tree priors -->
+		        <distribution id='tree.prior.29' spec='GeneTreeForSpeciesTreeDistribution' tree='@tree29' speciesTree='@speciesTree' speciesTreePrior='@SpeciesTreePopSizePrior'/>
+		        <distribution id='tree.prior.26' spec='GeneTreeForSpeciesTreeDistribution' tree='@tree26' speciesTree='@speciesTree' speciesTreePrior='@SpeciesTreePopSizePrior'/>
+
+		        <!-- species tree priors -->
+		        <distribution id='SpeciesTreePopSizePrior' spec='SpeciesTreePrior' tree='@speciesTree' 
+		        		popFunction='constant' taxonset='@taxonsuperset'>
+		            <bottomPopSize spec='parameter.RealParameter' id='popSize' value='1'/> 
+		            <parameter name='gammaParameter' id='popMean' value='0.004'/>
+		        </distribution>
+		    </distribution>
+
+            <distribution id="SpeciesTreeDivergenceTimesPrior" spec="speciation.YuleModel" tree='@speciesTree'>
+                <birthDiffRate spec='parameter.RealParameter' id="birthRate" value='213.2021' lower='0' upper='10000' />
+            </distribution>
+
+            <!-- hyper priors for assorted parameters -->
+            <distribution id='birthRatePrior' spec='distributions.Prior' x='@birthRate'>
+                <distr id='OneOnX' spec='distributions.OneOnX'/>
+            </distribution>
+
+            <distribution id="popMean.prior26" spec="beast.math.distributions.Prior" x="@popMean" distr='@OneOnX'/>
+
+            <distribution id="kappa.prior26" spec="beast.math.distributions.Prior" x="@hky.kappa26">
+                <distr id='logNormal' spec='beast.math.distributions.LogNormalDistributionModel' M="1.0" S="1.25" offset="0.0" meanInRealSpace="false"/>
+            </distribution>
+
+            <distribution id="kappa.prior29" spec="beast.math.distributions.Prior" x="@hky.kappa29"  distr='@logNormal'/>
+
+        </distribution>
+        <distribution id="likelihood" spec="util.CompoundDistribution">
+            <distribution data="@26" id="treelikelihood.26" spec="TreeLikelihood" tree="@tree26" useAmbiguities="false">
+                <siteModel gammaCategoryCount="1" id="siteModel26" mutationRate="@mutationRate" proportionInvariant="@proportionInvariant" shape="@gammaShape" spec="SiteModel">
+                    <substModel id="hky26" kappa="@hky.kappa26" spec="HKY">
+                        <frequencies id="freqs26" spec="Frequencies" estimate='true' data='@26'/>
+                    </substModel>
+                </siteModel>
+                <branchRateModel clock.rate="@clockRate" id="StrictClockModel26" spec="beast.evolution.branchratemodel.StrictClockModel"/>
+            </distribution>
+            <distribution data="@29" id="treelikelihood.29" spec="TreeLikelihood" tree="@tree29" useAmbiguities="false">
+                <siteModel gammaCategoryCount="1" id="siteModel29" mutationRate="@mutationRate" proportionInvariant="@proportionInvariant" shape="@gammaShape" spec="SiteModel">
+                    <substModel id="hky29" kappa="@hky.kappa29" spec="HKY">
+                        <frequencies id="freqs29" spec="Frequencies" estimate='true' data='@29'/>
+                    </substModel>
+                </siteModel>
+                <branchRateModel clock.rate="@clockRate" id="StrictClockModel29" spec="beast.evolution.branchratemodel.StrictClockModel"/>
+            </distribution>
+        </distribution>
+    </distribution>
+
+    <tree spec='RandomTree' id='randomSpeciesTree' initial='@speciesTree'
+        taxonset='@taxonsuperset'>
+        <populationModel spec='ConstantPopulation'>
+		<popSize spec='parameter.RealParameter' value='1'/>
+	</populationModel>
+    </tree>
+
+
+<tree spec='beast.util.TreeParser' id='newickSpeciesTree' IsLabelledNewick='true' newick='(Orthogeomys_heterodus_species:0.02065265792151943,(((Thomomys_talpoides:0.0013609706233106656,Thomomys_mazama:0.0013609706233106656):6.032405317365711E-4,(Thomomys_idahoensis:0.0019116640088644983,Thomomys_monticola:0.0019116640088644983):5.254714618273845E-5):0.01135560317788915,(Thomomys_umbrinus:0.001060205025110908,(Thomomys_townsendii:2.1835631905959876E-4,Thomomys_bottae:2.1835631905959876E-4 [...]
+initial='@speciesTree' threshold='1e-12' taxonset='@taxonsuperset'/>
+
+
+<tree spec='beast.util.TreeParser' id='newickGeneTree1' IsLabelledNewick='true' newick='((((Thomomys_idahoensis_pygmaeus_a:4.790629004925939E-4,Thomomys_idahoensis_pygmaeus_b:4.790629004925939E-4):0.002807766516703272,(Thomomys_monticola_a:3.1053813362974055E-5,Thomomys_monticola_b:3.1053813362974055E-5):0.0032557756038328915):1.3936218139959985E-4,((Thomomys_talpoides_yakimensis:0.001392151582227928,(Thomomys_talpoides_bridgeri:4.271344427331326E-4,Thomomys_talpoides_ocius:4.27134442733 [...]
+
+<tree spec='beast.util.TreeParser' id='newickGeneTree2' IsLabelledNewick='true' newick='(Orthogeomys_heterodus:0.02555754747205849,((Thomomys_mazama_nasicus:0.001146519512253189,Thomomys_mazama_mazama:0.001146519512253189):0.01169723135080885,((Thomomys_talpoides_ocius:0.00703974619989265,(((Thomomys_talpoides_yakimensis:0.0014682135377831343,(Thomomys_monticola_a:3.1427207759506006E-5,Thomomys_monticola_b:3.1427207759506006E-5):0.0014367863300236282):3.5111237723683074E-4,(Thomomys_idah [...]
+initial='@tree29' taxonset='@lineagetaxa' threshold='1e-12' />
+
+    <tree spec='RandomGeneTree' id='randomGeneTree1' 
+	initial='@tree26' speciesTree='@speciesTree' taxa='@26'>
+        <populationModel spec='ConstantPopulation'>
+		<popSize spec='parameter.RealParameter' value='1'/>
+	</populationModel>
+    </tree>
+    
+    <tree spec='RandomGeneTree' id='randomGeneTree2' 
+	initial='@tree29' speciesTree='@speciesTree' taxa='@29'>
+        <populationModel spec='ConstantPopulation'>
+		<popSize spec='parameter.RealParameter' value='1'/>
+	</populationModel>
+    </tree>
+
+<run chainLength="10000000" id="mcmc" preBurnin="0" spec="MCMC">
+    <!--init idref='randomSpeciesTree'/-->
+    <init idref='newickSpeciesTree'/>
+    <!--init idref='newickGeneTree1'/>
+    <init idref='newickGeneTree2'/-->
+
+    <init idref='randomGeneTree1'/>
+    <init idref='randomGeneTree2'/>
+
+
+    <distribution idref="posterior"/>
+
+    <state id="State0" storeEvery="100000">
+        <!--parameter dimension="1" estimate="false" id="popSize" name="stateNode" value="1.0"/-->
+        <parameter dimension="1" estimate="false" id="mutationRate" name="stateNode" value="1.0"/>
+        <parameter dimension="1" estimate="false" id="clockRate" name="stateNode" value="1.0"/>
+        <parameter dimension="1" estimate="true" id="hky.kappa26" lower="0.0" name="stateNode" value="1.0"/>
+        <parameter dimension="1" estimate="true" id="hky.kappa29" lower="0.0" name="stateNode" value="1.0"/>
+
+        <stateNode idref='popSize'/> 
+        <stateNode idref='popMean'/>
+
+        <tree estimate="true" id="tree26" name="stateNode"/>
+        <tree estimate="true" id="tree29" name="stateNode"/>
+        <tree estimate="true" id="speciesTree" name="stateNode"/>
+
+        <stateNode idref="birthRate"/>
+       	<!--stateNode idref="relativeDeathRate"/-->
+        <parameter dimension="1" estimate="false" id="gammaShape" name="stateNode" value="1.0"/>
+        <parameter dimension="1" estimate="false" id="proportionInvariant" lower="0.0" name="stateNode" upper="1.0" value="0.0"/>
+    </state>
+
+    <operator degreesOfFreedom="1" id="popSizeScaler" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.5" spec="ScaleOperator" parameter="@popSize" weight="5.0"/>
+    <operator degreesOfFreedom="1" id="birthRateScaler" scaleFactor="0.5" spec="ScaleOperator" parameter="@birthRate" weight="3"/>
+    <!--operator degreesOfFreedom="1" id="relDeathRateScaler" scaleFactor="0.5" spec="ScaleOperator" parameter="@relativeDeathRate" weight="1.0"/-->
+    <operator degreesOfFreedom="1" id="psiScaler" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.5" spec="ScaleOperator" parameter="@popMean" weight="94"/>
+    <operator degreesOfFreedom="1" id="kappa26Scaler" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.35" spec="ScaleOperator" parameter="@hky.kappa26" weight="0.1"/>
+    <operator degreesOfFreedom="1" id="kappa29Scaler" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.35" spec="ScaleOperator" parameter="@hky.kappa29" weight="0.1"/>
+
+    <operator gaussian="true" id="SubtreeSlide26" size="0.003" spec="SubtreeSlide" tree="@tree26" weight="15.0"/>
+    <operator degreesOfFreedom="1" id="treeScaler26" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.85" spec="ScaleOperator" tree="@tree26" weight="6.0"/>
+    <operator id="wide26" isNarrow="false" spec="Exchange" tree="@tree26" weight="1.0"/>
+    <operator id="narrow26" isNarrow="true" spec="Exchange" tree="@tree26" weight="15"/>
+    <operator id="WilsonBalding26" spec="WilsonBalding" tree="@tree26" weight="3"/>
+<!--
+-->
+    <operator id="Uniform26" spec="Uniform" tree="@tree26" weight="30.0"/>
+
+    <operator gaussian="true" id="SubtreeSlide29" size="0.002" spec="SubtreeSlide" tree="@tree29" weight="15.0"/>
+    <operator degreesOfFreedom="1" id="treeScaler29" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.85" spec="ScaleOperator" tree="@tree29" weight="6.0"/>
+    <operator id="wide29" isNarrow="false" spec="Exchange" tree="@tree29" weight="1.0"/>
+    <operator id="narrow29" isNarrow="true" spec="Exchange" tree="@tree29" weight="15"/>
+    <operator id="WilsonBalding29" spec="WilsonBalding" tree="@tree29" weight="3"/>
+<!--
+-->
+    <operator id="Uniform29" spec="Uniform" tree="@tree29" weight="30.0"/>
+
+	<operator spec='UpDownOperator' scaleFactor="0.75" weight="30">
+			<up idref="birthRate"/>
+			<down idref="popSize"/>
+			<down idref="popMean"/>
+			<down idref="speciesTree"/>
+			<down idref="tree26"/>
+			<down idref="tree29"/>
+	</operator>
+
+<!--
+    <operator id="wideSP" isNarrow="false" spec="Exchange" tree="@speciesTree" weight="1.0"/>
+    <operator gaussian="true" id="SubtreeSlideSP" size="0.003" spec="SubtreeSlide" tree="@speciesTree" weight="15.0"/>
+    <operator degreesOfFreedom="1" id="treeScalerSP" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.85" spec="ScaleOperator" tree="@speciesTree" weight="6.0"/>
+    <operator id="UniformSP" spec="Uniform" tree="@speciesTree" weight="30.0"/>
+-->
+
+    <operator id="Reheight" spec="NodeReheight" tree="@speciesTree" weight="94" taxonset='@taxonsuperset'>
+        <genetree idref='tree26'/>
+        <genetree idref='tree29'/>
+    </operator>
+
+    <logger fileName="z$(seed).log" id="Logger0" logEvery="1000" mode="autodetect" model="@posterior">
+        <log idref="posterior"/>
+        <log idref="prior"/>
+        <log idref="speciesCoalescent"/>
+        <log idref="SpeciesTreePopSizePrior"/>
+        <log idref="tree.prior.26"/>
+        <log idref="tree.prior.29"/>
+        <log idref="SpeciesTreeDivergenceTimesPrior"/>
+        <log idref="likelihood"/>
+        <log idref="popMean"/>
+        <log idref="birthRate"/>
+        <!--log idref="relativeDeathRate"/-->
+        <log idref="hky.kappa26"/>
+        <log idref="hky.kappa29"/>
+        <log idref="popSize"/>
+        <log id="TreeHeightSP" spec="beast.evolution.tree.TreeHeightLogger" tree="@speciesTree"/>
+        <log id="TreeHeight26" spec="beast.evolution.tree.TreeHeightLogger" tree="@tree26"/>
+        <log id="TreeHeight29" spec="beast.evolution.tree.TreeHeightLogger" tree="@tree29"/>
+    </logger>
+
+    <logger fileName="z$(seed).sp.trees" id="Logger4" logEvery="1000" mode="tree">
+        <log spec='SpeciesTreeLogger' popSize='@popSize' tree="@speciesTree">
+			<treetop spec='TreeTopFinder' id='treeTopFinder'>
+				<tree idref='tree26'/>
+				<tree idref='tree29'/>
+			</treetop>
+		</log>
+    </logger>
+
+    <logger fileName="z$(seed).26.trees" id="Logger2" logEvery="1000" mode="autodetect">
+        <log idref="tree26"/>
+    </logger>
+
+    <logger fileName="z$(seed).29.trees" id="Logger3" logEvery="1000" mode="autodetect">
+        <log idref="tree29"/>
+    </logger>
+
+    <logger id="Logger1" logEvery="100000" mode="autodetect">
+        <log idref="posterior"/>
+        <log spec='ESS' arg='@posterior'/>
+        <log idref="prior"/>
+        <log spec='ESS' arg='@prior'/>
+    </logger>
+
+</run>
+
+
+</beast>
diff --git a/examples/testTIM.xml b/examples/testTIM.xml
new file mode 100644
index 0000000..eb52fbf
--- /dev/null
+++ b/examples/testTIM.xml
@@ -0,0 +1,188 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<beast beautitemplate='Standard' beautistatus=''
+       namespace="beast.core:beast.evolution.alignment:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood"
+       version="2.0">
+
+
+    <data id="primate-mtDNA">
+        <sequence id="seq_Lemur_catta" taxon="Lemur_catta" totalcount="4"
+                  value="AAGCTTCATAGGAGCAACCATTCTAATAATCGCACATGGCCTTACATCATCCATATTATTCTGTCTAGCCAACTCTAACTACGAACGAATCCATAGCCGTACAATACTACTAGCACGAGGGATCCAAACCATTCTCCCTCTTATAGCCACCTGATGACTACTCGCCAGCCTAACTAACCTAGCCCTACCCACCTCTATCAATTTAATTGGCGAACTATTCGTCACTATAGCATCCTTCTCATGATCAAACATTACAATTATCTTAATAGGCTTAAATATGCTCATCACCGCTCTCTATTCCCTCTATATATTAACTACTACACAACGAGGAAAACTCACATATCATTCGCACAACCTAAACCCATCCTTTACACGAGAAAACACCCTTATATCCATACACATACTCCCCCTTCTCCTATTTACCTTAAACCCCAAAATTATTCTAGGACCCACGTACTGTAAATATA [...]
+        <sequence id="seq_Homo_sapiens" taxon="Homo_sapiens" totalcount="4"
+                  value="AAGCTTCACCGGCGCAGTCATTCTCATAATCGCCCACGGGCTTACATCCTCATTACTATTCTGCCTAGCAAACTCAAACTACGAACGCACTCACAGTCGCATCATAATCCTCTCTCAAGGACTTCAAACTCTACTCCCACTAATAGCTTTTTGATGACTTCTAGCAAGCCTCGCTAACCTCGCCTTACCCCCCACTATTAACCTACTGGGAGAACTCTCTGTGCTAGTAACCACGTTCTCCTGATCAAATATCACTCTCCTACTTACAGGACTCAACATACTAGTCACAGCCCTATACTCCCTCTACATATTTACCACAACACAATGGGGCTCACTCACCCACCACATTAACAACATAAAACCCTCATTCACACGAGAAAACACCCTCATGTTCATACACCTATCCCCCATTCTCCTCCTATCCCTCAACCCCGACATCATTACCGGGTTTTCCTCTTGTAAATATA [...]
+        <sequence id="seq_Pan" taxon="Pan" totalcount="4"
+                  value="AAGCTTCACCGGCGCAATTATCCTCATAATCGCCCACGGACTTACATCCTCATTATTATTCTGCCTAGCAAACTCAAATTATGAACGCACCCACAGTCGCATCATAATTCTCTCCCAAGGACTTCAAACTCTACTCCCACTAATAGCCTTTTGATGACTCCTAGCAAGCCTCGCTAACCTCGCCCTACCCCCTACCATTAATCTCCTAGGGGAACTCTCCGTGCTAGTAACCTCATTCTCCTGATCAAATACCACTCTCCTACTCACAGGATTCAACATACTAATCACAGCCCTGTACTCCCTCTACATGTTTACCACAACACAATGAGGCTCACTCACCCACCACATTAATAACATAAAGCCCTCATTCACACGAGAAAATACTCTCATATTTTTACACCTATCCCCCATCCTCCTTCTATCCCTCAATCCTGATATCATCACTGGATTCACCTCCTGTAAATATA [...]
+        <sequence id="seq_Gorilla" taxon="Gorilla" totalcount="4"
+                  value="AAGCTTCACCGGCGCAGTTGTTCTTATAATTGCCCACGGACTTACATCATCATTATTATTCTGCCTAGCAAACTCAAACTACGAACGAACCCACAGCCGCATCATAATTCTCTCTCAAGGACTCCAAACCCTACTCCCACTAATAGCCCTTTGATGACTTCTGGCAAGCCTCGCCAACCTCGCCTTACCCCCCACCATTAACCTACTAGGAGAGCTCTCCGTACTAGTAACCACATTCTCCTGATCAAACACCACCCTTTTACTTACAGGATCTAACATACTAATTACAGCCCTGTACTCCCTTTATATATTTACCACAACACAATGAGGCCCACTCACACACCACATCACCAACATAAAACCCTCATTTACACGAGAAAACATCCTCATATTCATGCACCTATCCCCCATCCTCCTCCTATCCCTCAACCCCGATATTATCACCGGGTTCACCTCCTGTAAATATA [...]
+        <sequence id="seq_Pongo" taxon="Pongo" totalcount="4"
+                  value="AAGCTTCACCGGCGCAACCACCCTCATGATTGCCCATGGACTCACATCCTCCCTACTGTTCTGCCTAGCAAACTCAAACTACGAACGAACCCACAGCCGCATCATAATCCTCTCTCAAGGCCTTCAAACTCTACTCCCCCTAATAGCCCTCTGATGACTTCTAGCAAGCCTCACTAACCTTGCCCTACCACCCACCATCAACCTTCTAGGAGAACTCTCCGTACTAATAGCCATATTCTCTTGATCTAACATCACCATCCTACTAACAGGACTCAACATACTAATCACAACCCTATACTCTCTCTATATATTCACCACAACACAACGAGGTACACCCACACACCACATCAACAACATAAAACCTTCTTTCACACGCGAAAATACCCTCATGCTCATACACCTATCCCCCATCCTCCTCTTATCCCTCAACCCCAGCATCATCGCTGGGTTCGCCTACTGTAAATATA [...]
+        <sequence id="seq_Hylobates" taxon="Hylobates" totalcount="4"
+                  value="AAGCTTTACAGGTGCAACCGTCCTCATAATCGCCCACGGACTAACCTCTTCCCTGCTATTCTGCCTTGCAAACTCAAACTACGAACGAACTCACAGCCGCATCATAATCCTATCTCGAGGGCTCCAAGCCTTACTCCCACTGATAGCCTTCTGATGACTCGCAGCAAGCCTCGCTAACCTCGCCCTACCCCCCACTATTAACCTCCTAGGTGAACTCTTCGTACTAATGGCCTCCTTCTCCTGGGCAAACACTACTATTACACTCACCGGGCTCAACGTACTAATCACGGCCCTATACTCCCTTTACATATTTATCATAACACAACGAGGCACACTTACACACCACATTAAAAACATAAAACCCTCACTCACACGAGAAAACATATTAATACTTATGCACCTCTTCCCCCTCCTCCTCCTAACCCTCAACCCTAACATCATTACTGGCTTTACTCCCTGTAAACATA [...]
+        <sequence id="seq_Macaca_fuscata" taxon="Macaca_fuscata" totalcount="4"
+                  value="AAGCTTTTCCGGCGCAACCATCCTTATGATCGCTCACGGACTCACCTCTTCCATATATTTCTGCCTAGCCAATTCAAACTATGAACGCACTCACAACCGTACCATACTACTGTCCCGAGGACTTCAAATCCTACTTCCACTAACAGCCTTTTGATGATTAACAGCAAGCCTTACTAACCTTGCCCTACCCCCCACTATCAATCTACTAGGTGAACTCTTTGTAATCGCAACCTCATTCTCCTGATCCCATATCACCATTATGCTAACAGGACTTAACATATTAATTACGGCCCTCTACTCTCTCCACATATTCACTACAACACAACGAGGAACACTCACACATCACATAATCAACATAAAGCCCCCCTTCACACGAGAAAACACATTAATATTCATACACCTCGCTCCAATTATCCTTCTATCCCTCAACCCCAACATCATCCTGGGGTTTACCTCCTGTAGATATA [...]
+        <sequence id="seq_M._mulatta" taxon="M._mulatta" totalcount="4"
+                  value="AAGCTTTTCTGGCGCAACCATCCTCATGATTGCTCACGGACTCACCTCTTCCATATATTTCTGCCTAGCCAATTCAAACTATGAACGCACTCACAACCGTACCATACTACTGTCCCGGGGACTTCAAATCCTACTTCCACTAACAGCTTTCTGATGATTAACAGCAAGCCTTACTAACCTTGCCCTACCCCCCACTATCAACCTACTAGGTGAACTCTTTGTAATCGCGACCTCATTCTCCTGGTCCCATATCACCATTATATTAACAGGATTTAACATACTAATTACGGCCCTCTACTCCCTCCACATATTCACCACAACACAACGAGGAGCACTCACACATCACATAATCAACATAAAACCCCCCTTCACACGAGAAAACATATTAATATTCATACACCTCGCTCCAATCATCCTCCTATCTCTCAACCCCAACATCATCCTGGGGTTTACTTCCTGTAGATATA [...]
+        <sequence id="seq_M._fascicularis" taxon="M._fascicularis" totalcount="4"
+                  value="AAGCTTCTCCGGCGCAACCACCCTTATAATCGCCCACGGGCTCACCTCTTCCATGTATTTCTGCTTGGCCAATTCAAACTATGAGCGCACTCATAACCGTACCATACTACTATCCCGAGGACTTCAAATTCTACTTCCATTGACAGCCTTCTGATGACTCACAGCAAGCCTTACTAACCTTGCCCTACCCCCCACTATTAATCTACTAGGCGAACTCTTTGTAATCACAACTTCATTTTCCTGATCCCATATCACCATTGTGTTAACGGGCCTTAATATACTAATCACAGCCCTCTACTCTCTCCACATGTTCATTACAGTACAACGAGGAACACTCACACACCACATAATCAATATAAAACCCCCCTTCACACGAGAAAACATATTAATATTCATACACCTCGCTCCAATTATCCTTCTATCTCTCAACCCCAACATCATCCTGGGGTTTACCTCCTGTAAATATA [...]
+        <sequence id="seq_M._sylvanus" taxon="M._sylvanus" totalcount="4"
+                  value="AAGCTTCTCCGGTGCAACTATCCTTATAGTTGCCCATGGACTCACCTCTTCCATATACTTCTGCTTGGCCAACTCAAACTACGAACGCACCCACAGCCGCATCATACTACTATCCCGAGGACTCCAAATCCTACTCCCACTAACAGCCTTCTGATGATTCACAGCAAGCCTTACTAATCTTGCTCTACCCTCCACTATTAATCTACTGGGCGAACTCTTCGTAATCGCAACCTCATTTTCCTGATCCCACATCACCATCATACTAACAGGACTGAACATACTAATTACAGCCCTCTACTCTCTTCACATATTCACCACAACACAACGAGGAGCGCTCACACACCACATAATTAACATAAAACCACCTTTCACACGAGAAAACATATTAATACTCATACACCTCGCTCCAATTATTCTTCTATCTCTTAACCCCAACATCATTCTAGGATTTACTTCCTGTAAATATA [...]
+        <sequence id="seq_Saimiri_sciureus" taxon="Saimiri_sciureus" totalcount="4"
+                  value="AAGCTTCACCGGCGCAATGATCCTAATAATCGCTCACGGGTTTACTTCGTCTATGCTATTCTGCCTAGCAAACTCAAATTACGAACGAATTCACAGCCGAACAATAACATTTACTCGAGGGCTCCAAACACTATTCCCGCTTATAGGCCTCTGATGACTCCTAGCAAATCTCGCTAACCTCGCCCTACCCACAGCTATTAATCTAGTAGGAGAATTACTCACAATCGTATCTTCCTTCTCTTGATCCAACTTTACTATTATATTCACAGGACTTAATATACTAATTACAGCACTCTACTCACTTCATATGTATGCCTCTACACAGCGAGGTCCACTTACATACAGCACCAGCAATATAAAACCAATATTTACACGAGAAAATACGCTAATATTTATACATATAACACCAATCCTCCTCCTTACCTTGAGCCCCAAGGTAATTATAGGACCCTCACCTTGTAATTATA [...]
+        <sequence id="seq_Tarsius_syrichta" taxon="Tarsius_syrichta" totalcount="4"
+                  value="AAGTTTCATTGGAGCCACCACTCTTATAATTGCCCATGGCCTCACCTCCTCCCTATTATTTTGCCTAGCAAATACAAACTACGAACGAGTCCACAGTCGAACAATAGCACTAGCCCGTGGCCTTCAAACCCTATTACCTCTTGCAGCAACATGATGACTCCTCGCCAGCTTAACCAACCTGGCCCTTCCCCCAACAATTAATTTAATCGGTGAACTGTCCGTAATAATAGCAGCATTTTCATGGTCACACCTAACTATTATCTTAGTAGGCCTTAACACCCTTATCACCGCCCTATATTCCCTATATATACTAATCATAACTCAACGAGGAAAATACACATATCATATCAACAATATCATGCCCCCTTTCACCCGAGAAAATACATTAATAATCATACACCTATTTCCCTTAATCCTACTATCTACCAACCCCAAAGTAATTATAGGAACCATGTACTGTAAATATA [...]
+    </data>
+
+
+    <map name="Beta">beast.math.distributions.Beta</map>
+    <map name="Exponential">beast.math.distributions.Exponential</map>
+    <map name="InverseGamma">beast.math.distributions.InverseGamma</map>
+    <map name="LogNormal">beast.math.distributions.LogNormalDistributionModel</map>
+    <map name="Gamma">beast.math.distributions.Gamma</map>
+    <map name="Uniform">beast.math.distributions.Uniform</map>
+    <map name="prior">beast.math.distributions.Prior</map>
+    <map name="LaplaceDistribution">beast.math.distributions.LaplaceDistribution</map>
+    <map name="OneOnX">beast.math.distributions.OneOnX</map>
+    <map name="Normal">beast.math.distributions.Normal</map>
+
+
+    <run chainLength="5000000" id="mcmc" spec="MCMC">
+        <state id="state" storeEvery="5000">
+            <tree id="Tree.t:primate" name="stateNode">
+                <taxonset id="TaxonSet.coding" spec="TaxonSet">
+                    <alignment filter="2-457,660-896" id="coding" spec="FilteredAlignment">
+                        <data idref="primate-mtDNA"/>
+                    </alignment>
+                </taxonset>
+            </tree>
+            <parameter id="birthRate.t:primate" name="stateNode" value="1.0"/>
+            <parameter id="rateAG.s:primate" lower="0.0" name="stateNode" value="1.0"/>
+            <parameter id="rateTransversions1.s:primate" lower="0.0" name="stateNode" value="1.0"/>
+            <parameter id="rateTransversions2.s:primate" lower="0.0" name="stateNode" value="1.0"/>
+            <parameter dimension="4" id="freqParameter.s:primate" lower="0.0" name="stateNode" upper="1.0"
+                       value="0.25"/>
+        </state>
+
+        <init estimate="false" id="RandomTree.t:primate" initial="@Tree.t:primate"
+              spec="beast.evolution.tree.RandomTree" taxa="@coding">
+            <populationModel id="ConstantPopulation0.t:primate" spec="ConstantPopulation">
+                <parameter id="randomPopSize.t:primate" name="popSize" value="1"/>
+            </populationModel>
+        </init>
+
+        <distribution id="posterior" spec="util.CompoundDistribution">
+            <distribution id="prior" spec="util.CompoundDistribution">
+                <distribution birthDiffRate="@birthRate.t:primate" id="YuleModel.t:primate"
+                              spec="beast.evolution.speciation.YuleModel" tree="@Tree.t:primate"/>
+                <prior id="YuleBirthRatePrior.t:primate" name="distribution" x="@birthRate.t:primate">
+                    <Uniform id="Uniform.0" name="distr" upper="Infinity"/>
+                </prior>
+                <prior id="RateAGPrior.s:primate" name="distribution" x="@rateAG.s:primate">
+                    <LogNormal id="LogNormalDistributionModel.0" name="distr">
+                        <parameter estimate="false" id="RealParameter.0" name="M" value="0"/>
+                        <parameter estimate="false" id="RealParameter.01" lower="0.0" name="S" upper="5.0"
+                                   value="1.25"/>
+                    </LogNormal>
+                </prior>
+                <prior id="RateTransversions1Prior.s:primate" name="distribution" x="@rateTransversions1.s:primate">
+                    <LogNormal id="LogNormalDistributionModel.01" name="distr">
+                        <parameter estimate="false" id="RealParameter.02" name="M" value="0"/>
+                        <parameter estimate="false" id="RealParameter.03" lower="0.0" name="S" upper="5.0"
+                                   value="1.25"/>
+                    </LogNormal>
+                </prior>
+                <prior id="RateTransversions2Prior.s:primate" name="distribution" x="@rateTransversions2.s:primate">
+                    <LogNormal id="LogNormalDistributionModel.02" name="distr">
+                        <parameter estimate="false" id="RealParameter.04" name="M" value="0"/>
+                        <parameter estimate="false" id="RealParameter.05" lower="0.0" name="S" upper="5.0"
+                                   value="1.25"/>
+                    </LogNormal>
+                </prior>
+            </distribution>
+            <distribution id="likelihood" spec="util.CompoundDistribution">
+                <distribution data="@coding" id="treeLikelihood.coding" spec="TreeLikelihood" tree="@Tree.t:primate">
+                    <siteModel id="SiteModel.s:primate" spec="SiteModel">
+                        <parameter estimate="false" id="mutationRate.s:primate" name="mutationRate" value="1.0"/>
+                        <parameter estimate="false" id="gammaShape.s:primate" name="shape" value="1.0"/>
+                        <parameter estimate="false" id="proportionInvariant.s:primate" lower="0.0"
+                                   name="proportionInvariant" upper="1.0" value="0.0"/>
+                        <substModel id="tim.s:primate" rateAG="@rateAG.s:primate"
+                                    rateTransversions1="@rateTransversions1.s:primate"
+                                    rateTransversions2="@rateTransversions2.s:primate"
+                                    spec="TIM">
+                            <parameter estimate="false" id="rateCT.s:primate" lower="0.0" name="rateCT" value="1.0"/>
+                            <frequencies frequencies="@freqParameter.s:primate" id="estimatedFreqs.s:primate"
+                                         spec="Frequencies"/>
+                        </substModel>
+                    </siteModel>
+                    <branchRateModel id="StrictClock.c:primate" spec="beast.evolution.branchratemodel.StrictClockModel">
+                        <parameter estimate="false" id="clockRate.c:primate" name="clock.rate" value="1.0"/>
+                    </branchRateModel>
+                </distribution>
+                <distribution branchRateModel="@StrictClock.c:primate" id="treeLikelihood.noncoding"
+                              siteModel="@SiteModel.s:primate" spec="TreeLikelihood" tree="@Tree.t:primate">
+                    <data data="@primate-mtDNA" filter="1,458-659,897-898" id="noncoding" spec="FilteredAlignment"/>
+                </distribution>
+            </distribution>
+        </distribution>
+
+        <operator id="YuleBirthRateScaler.t:primate" parameter="@birthRate.t:primate" scaleFactor="0.75"
+                  spec="ScaleOperator" weight="3.0"/>
+
+        <operator id="treeScaler.t:primate" scaleFactor="0.5" spec="ScaleOperator" tree="@Tree.t:primate" weight="3.0"/>
+
+        <operator id="treeRootScaler.t:primate" rootOnly="true" scaleFactor="0.5" spec="ScaleOperator"
+                  tree="@Tree.t:primate" weight="3.0"/>
+
+        <operator id="UniformOperator.t:primate" spec="Uniform" tree="@Tree.t:primate" weight="30.0"/>
+
+        <operator id="SubtreeSlide.t:primate" spec="SubtreeSlide" tree="@Tree.t:primate" weight="15.0"/>
+
+        <operator id="narrow.t:primate" spec="Exchange" tree="@Tree.t:primate" weight="15.0"/>
+
+        <operator id="wide.t:primate" isNarrow="false" spec="Exchange" tree="@Tree.t:primate" weight="3.0"/>
+
+        <operator id="WilsonBalding.t:primate" spec="WilsonBalding" tree="@Tree.t:primate" weight="3.0"/>
+
+        <operator id="RateAGScaler.s:primate" parameter="@rateAG.s:primate" scaleFactor="0.5" spec="ScaleOperator"
+                  weight="0.1"/>
+
+        <operator id="RateTransversions1Scaler.s:primate" parameter="@rateTransversions1.s:primate" scaleFactor="0.5"
+                  spec="ScaleOperator" weight="0.1"/>
+
+        <operator id="RateTransversions2Scaler.s:primate" parameter="@rateTransversions2.s:primate" scaleFactor="0.5"
+                  spec="ScaleOperator" weight="0.1"/>
+
+        <operator delta="0.01" id="FrequenciesExchanger.s:primate" spec="DeltaExchangeOperator" weight="0.1">
+            <parameter idref="freqParameter.s:primate"/>
+        </operator>
+
+        <logger fileName="primate-mtDNA-TIM.log" id="tracelog" logEvery="5000" model="@posterior" sanitiseHeaders="true"
+                sort="smart">
+            <log idref="posterior"/>
+            <log idref="likelihood"/>
+            <log idref="prior"/>
+            <log idref="treeLikelihood.noncoding"/>
+            <log idref="treeLikelihood.coding"/>
+            <log id="TreeHeight.t:primate" spec="beast.evolution.tree.TreeHeightLogger" tree="@Tree.t:primate"/>
+            <log idref="YuleModel.t:primate"/>
+            <parameter idref="birthRate.t:primate" name="log"/>
+            <parameter idref="rateAG.s:primate" name="log"/>
+            <parameter idref="rateTransversions1.s:primate" name="log"/>
+            <parameter idref="rateTransversions2.s:primate" name="log"/>
+            <parameter idref="freqParameter.s:primate" name="log"/>
+        </logger>
+
+        <logger id="screenlog" logEvery="5000">
+            <log idref="posterior"/>
+            <log arg="@posterior" id="ESS.0" spec="util.ESS"/>
+            <log idref="likelihood"/>
+            <log idref="prior"/>
+        </logger>
+
+        <logger fileName="$(tree).trees" id="treelog.t:primate" logEvery="5000" mode="tree">
+            <log id="TreeWithMetaDataLogger.t:primate" spec="beast.evolution.tree.TreeWithMetaDataLogger"
+                 tree="@Tree.t:primate"/>
+        </logger>
+
+    </run>
+
+</beast>
diff --git a/examples/testTN93.xml b/examples/testTN93.xml
new file mode 100644
index 0000000..3ec10aa
--- /dev/null
+++ b/examples/testTN93.xml
@@ -0,0 +1,161 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<beast beautitemplate='Standard' beautistatus=''
+       namespace="beast.core:beast.evolution.alignment:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood"
+       version="2.0">
+
+
+    <data id="primate-mtDNA">
+        <sequence id="seq_Lemur_catta" taxon="Lemur_catta" totalcount="4"
+                  value="AAGCTTCATAGGAGCAACCATTCTAATAATCGCACATGGCCTTACATCATCCATATTATTCTGTCTAGCCAACTCTAACTACGAACGAATCCATAGCCGTACAATACTACTAGCACGAGGGATCCAAACCATTCTCCCTCTTATAGCCACCTGATGACTACTCGCCAGCCTAACTAACCTAGCCCTACCCACCTCTATCAATTTAATTGGCGAACTATTCGTCACTATAGCATCCTTCTCATGATCAAACATTACAATTATCTTAATAGGCTTAAATATGCTCATCACCGCTCTCTATTCCCTCTATATATTAACTACTACACAACGAGGAAAACTCACATATCATTCGCACAACCTAAACCCATCCTTTACACGAGAAAACACCCTTATATCCATACACATACTCCCCCTTCTCCTATTTACCTTAAACCCCAAAATTATTCTAGGACCCACGTACTGTAAATATA [...]
+        <sequence id="seq_Homo_sapiens" taxon="Homo_sapiens" totalcount="4"
+                  value="AAGCTTCACCGGCGCAGTCATTCTCATAATCGCCCACGGGCTTACATCCTCATTACTATTCTGCCTAGCAAACTCAAACTACGAACGCACTCACAGTCGCATCATAATCCTCTCTCAAGGACTTCAAACTCTACTCCCACTAATAGCTTTTTGATGACTTCTAGCAAGCCTCGCTAACCTCGCCTTACCCCCCACTATTAACCTACTGGGAGAACTCTCTGTGCTAGTAACCACGTTCTCCTGATCAAATATCACTCTCCTACTTACAGGACTCAACATACTAGTCACAGCCCTATACTCCCTCTACATATTTACCACAACACAATGGGGCTCACTCACCCACCACATTAACAACATAAAACCCTCATTCACACGAGAAAACACCCTCATGTTCATACACCTATCCCCCATTCTCCTCCTATCCCTCAACCCCGACATCATTACCGGGTTTTCCTCTTGTAAATATA [...]
+        <sequence id="seq_Pan" taxon="Pan" totalcount="4"
+                  value="AAGCTTCACCGGCGCAATTATCCTCATAATCGCCCACGGACTTACATCCTCATTATTATTCTGCCTAGCAAACTCAAATTATGAACGCACCCACAGTCGCATCATAATTCTCTCCCAAGGACTTCAAACTCTACTCCCACTAATAGCCTTTTGATGACTCCTAGCAAGCCTCGCTAACCTCGCCCTACCCCCTACCATTAATCTCCTAGGGGAACTCTCCGTGCTAGTAACCTCATTCTCCTGATCAAATACCACTCTCCTACTCACAGGATTCAACATACTAATCACAGCCCTGTACTCCCTCTACATGTTTACCACAACACAATGAGGCTCACTCACCCACCACATTAATAACATAAAGCCCTCATTCACACGAGAAAATACTCTCATATTTTTACACCTATCCCCCATCCTCCTTCTATCCCTCAATCCTGATATCATCACTGGATTCACCTCCTGTAAATATA [...]
+        <sequence id="seq_Gorilla" taxon="Gorilla" totalcount="4"
+                  value="AAGCTTCACCGGCGCAGTTGTTCTTATAATTGCCCACGGACTTACATCATCATTATTATTCTGCCTAGCAAACTCAAACTACGAACGAACCCACAGCCGCATCATAATTCTCTCTCAAGGACTCCAAACCCTACTCCCACTAATAGCCCTTTGATGACTTCTGGCAAGCCTCGCCAACCTCGCCTTACCCCCCACCATTAACCTACTAGGAGAGCTCTCCGTACTAGTAACCACATTCTCCTGATCAAACACCACCCTTTTACTTACAGGATCTAACATACTAATTACAGCCCTGTACTCCCTTTATATATTTACCACAACACAATGAGGCCCACTCACACACCACATCACCAACATAAAACCCTCATTTACACGAGAAAACATCCTCATATTCATGCACCTATCCCCCATCCTCCTCCTATCCCTCAACCCCGATATTATCACCGGGTTCACCTCCTGTAAATATA [...]
+        <sequence id="seq_Pongo" taxon="Pongo" totalcount="4"
+                  value="AAGCTTCACCGGCGCAACCACCCTCATGATTGCCCATGGACTCACATCCTCCCTACTGTTCTGCCTAGCAAACTCAAACTACGAACGAACCCACAGCCGCATCATAATCCTCTCTCAAGGCCTTCAAACTCTACTCCCCCTAATAGCCCTCTGATGACTTCTAGCAAGCCTCACTAACCTTGCCCTACCACCCACCATCAACCTTCTAGGAGAACTCTCCGTACTAATAGCCATATTCTCTTGATCTAACATCACCATCCTACTAACAGGACTCAACATACTAATCACAACCCTATACTCTCTCTATATATTCACCACAACACAACGAGGTACACCCACACACCACATCAACAACATAAAACCTTCTTTCACACGCGAAAATACCCTCATGCTCATACACCTATCCCCCATCCTCCTCTTATCCCTCAACCCCAGCATCATCGCTGGGTTCGCCTACTGTAAATATA [...]
+        <sequence id="seq_Hylobates" taxon="Hylobates" totalcount="4"
+                  value="AAGCTTTACAGGTGCAACCGTCCTCATAATCGCCCACGGACTAACCTCTTCCCTGCTATTCTGCCTTGCAAACTCAAACTACGAACGAACTCACAGCCGCATCATAATCCTATCTCGAGGGCTCCAAGCCTTACTCCCACTGATAGCCTTCTGATGACTCGCAGCAAGCCTCGCTAACCTCGCCCTACCCCCCACTATTAACCTCCTAGGTGAACTCTTCGTACTAATGGCCTCCTTCTCCTGGGCAAACACTACTATTACACTCACCGGGCTCAACGTACTAATCACGGCCCTATACTCCCTTTACATATTTATCATAACACAACGAGGCACACTTACACACCACATTAAAAACATAAAACCCTCACTCACACGAGAAAACATATTAATACTTATGCACCTCTTCCCCCTCCTCCTCCTAACCCTCAACCCTAACATCATTACTGGCTTTACTCCCTGTAAACATA [...]
+        <sequence id="seq_Macaca_fuscata" taxon="Macaca_fuscata" totalcount="4"
+                  value="AAGCTTTTCCGGCGCAACCATCCTTATGATCGCTCACGGACTCACCTCTTCCATATATTTCTGCCTAGCCAATTCAAACTATGAACGCACTCACAACCGTACCATACTACTGTCCCGAGGACTTCAAATCCTACTTCCACTAACAGCCTTTTGATGATTAACAGCAAGCCTTACTAACCTTGCCCTACCCCCCACTATCAATCTACTAGGTGAACTCTTTGTAATCGCAACCTCATTCTCCTGATCCCATATCACCATTATGCTAACAGGACTTAACATATTAATTACGGCCCTCTACTCTCTCCACATATTCACTACAACACAACGAGGAACACTCACACATCACATAATCAACATAAAGCCCCCCTTCACACGAGAAAACACATTAATATTCATACACCTCGCTCCAATTATCCTTCTATCCCTCAACCCCAACATCATCCTGGGGTTTACCTCCTGTAGATATA [...]
+        <sequence id="seq_M._mulatta" taxon="M._mulatta" totalcount="4"
+                  value="AAGCTTTTCTGGCGCAACCATCCTCATGATTGCTCACGGACTCACCTCTTCCATATATTTCTGCCTAGCCAATTCAAACTATGAACGCACTCACAACCGTACCATACTACTGTCCCGGGGACTTCAAATCCTACTTCCACTAACAGCTTTCTGATGATTAACAGCAAGCCTTACTAACCTTGCCCTACCCCCCACTATCAACCTACTAGGTGAACTCTTTGTAATCGCGACCTCATTCTCCTGGTCCCATATCACCATTATATTAACAGGATTTAACATACTAATTACGGCCCTCTACTCCCTCCACATATTCACCACAACACAACGAGGAGCACTCACACATCACATAATCAACATAAAACCCCCCTTCACACGAGAAAACATATTAATATTCATACACCTCGCTCCAATCATCCTCCTATCTCTCAACCCCAACATCATCCTGGGGTTTACTTCCTGTAGATATA [...]
+        <sequence id="seq_M._fascicularis" taxon="M._fascicularis" totalcount="4"
+                  value="AAGCTTCTCCGGCGCAACCACCCTTATAATCGCCCACGGGCTCACCTCTTCCATGTATTTCTGCTTGGCCAATTCAAACTATGAGCGCACTCATAACCGTACCATACTACTATCCCGAGGACTTCAAATTCTACTTCCATTGACAGCCTTCTGATGACTCACAGCAAGCCTTACTAACCTTGCCCTACCCCCCACTATTAATCTACTAGGCGAACTCTTTGTAATCACAACTTCATTTTCCTGATCCCATATCACCATTGTGTTAACGGGCCTTAATATACTAATCACAGCCCTCTACTCTCTCCACATGTTCATTACAGTACAACGAGGAACACTCACACACCACATAATCAATATAAAACCCCCCTTCACACGAGAAAACATATTAATATTCATACACCTCGCTCCAATTATCCTTCTATCTCTCAACCCCAACATCATCCTGGGGTTTACCTCCTGTAAATATA [...]
+        <sequence id="seq_M._sylvanus" taxon="M._sylvanus" totalcount="4"
+                  value="AAGCTTCTCCGGTGCAACTATCCTTATAGTTGCCCATGGACTCACCTCTTCCATATACTTCTGCTTGGCCAACTCAAACTACGAACGCACCCACAGCCGCATCATACTACTATCCCGAGGACTCCAAATCCTACTCCCACTAACAGCCTTCTGATGATTCACAGCAAGCCTTACTAATCTTGCTCTACCCTCCACTATTAATCTACTGGGCGAACTCTTCGTAATCGCAACCTCATTTTCCTGATCCCACATCACCATCATACTAACAGGACTGAACATACTAATTACAGCCCTCTACTCTCTTCACATATTCACCACAACACAACGAGGAGCGCTCACACACCACATAATTAACATAAAACCACCTTTCACACGAGAAAACATATTAATACTCATACACCTCGCTCCAATTATTCTTCTATCTCTTAACCCCAACATCATTCTAGGATTTACTTCCTGTAAATATA [...]
+        <sequence id="seq_Saimiri_sciureus" taxon="Saimiri_sciureus" totalcount="4"
+                  value="AAGCTTCACCGGCGCAATGATCCTAATAATCGCTCACGGGTTTACTTCGTCTATGCTATTCTGCCTAGCAAACTCAAATTACGAACGAATTCACAGCCGAACAATAACATTTACTCGAGGGCTCCAAACACTATTCCCGCTTATAGGCCTCTGATGACTCCTAGCAAATCTCGCTAACCTCGCCCTACCCACAGCTATTAATCTAGTAGGAGAATTACTCACAATCGTATCTTCCTTCTCTTGATCCAACTTTACTATTATATTCACAGGACTTAATATACTAATTACAGCACTCTACTCACTTCATATGTATGCCTCTACACAGCGAGGTCCACTTACATACAGCACCAGCAATATAAAACCAATATTTACACGAGAAAATACGCTAATATTTATACATATAACACCAATCCTCCTCCTTACCTTGAGCCCCAAGGTAATTATAGGACCCTCACCTTGTAATTATA [...]
+        <sequence id="seq_Tarsius_syrichta" taxon="Tarsius_syrichta" totalcount="4"
+                  value="AAGTTTCATTGGAGCCACCACTCTTATAATTGCCCATGGCCTCACCTCCTCCCTATTATTTTGCCTAGCAAATACAAACTACGAACGAGTCCACAGTCGAACAATAGCACTAGCCCGTGGCCTTCAAACCCTATTACCTCTTGCAGCAACATGATGACTCCTCGCCAGCTTAACCAACCTGGCCCTTCCCCCAACAATTAATTTAATCGGTGAACTGTCCGTAATAATAGCAGCATTTTCATGGTCACACCTAACTATTATCTTAGTAGGCCTTAACACCCTTATCACCGCCCTATATTCCCTATATATACTAATCATAACTCAACGAGGAAAATACACATATCATATCAACAATATCATGCCCCCTTTCACCCGAGAAAATACATTAATAATCATACACCTATTTCCCTTAATCCTACTATCTACCAACCCCAAAGTAATTATAGGAACCATGTACTGTAAATATA [...]
+    </data>
+
+
+    <map name="Beta">beast.math.distributions.Beta</map>
+    <map name="Exponential">beast.math.distributions.Exponential</map>
+    <map name="InverseGamma">beast.math.distributions.InverseGamma</map>
+    <map name="LogNormal">beast.math.distributions.LogNormalDistributionModel</map>
+    <map name="Gamma">beast.math.distributions.Gamma</map>
+    <map name="Uniform">beast.math.distributions.Uniform</map>
+    <map name="prior">beast.math.distributions.Prior</map>
+    <map name="LaplaceDistribution">beast.math.distributions.LaplaceDistribution</map>
+    <map name="OneOnX">beast.math.distributions.OneOnX</map>
+    <map name="Normal">beast.math.distributions.Normal</map>
+
+
+    <run chainLength="5000000" id="mcmc" spec="MCMC">
+        <state id="state" storeEvery="5000">
+            <tree id="Tree.t:primate" name="stateNode">
+                <taxonset id="TaxonSet.coding" spec="TaxonSet">
+                    <alignment filter="2-457,660-896" id="coding" spec="FilteredAlignment">
+                        <data idref="primate-mtDNA"/>
+                    </alignment>
+                </taxonset>
+            </tree>
+            <parameter id="birthRate.t:primate" name="stateNode" value="1.0"/>
+            <parameter id="rateAG.s:primate" lower="0.0" name="stateNode" value="2.0"/>
+            <parameter id="rateCT.s:primate" lower="0.0" name="stateNode" value="2.0"/>
+            <parameter dimension="4" id="freqParameter.s:primate" lower="0.0" name="stateNode" upper="1.0"
+                       value="0.25"/>
+        </state>
+
+        <init estimate="false" id="RandomTree.t:primate" initial="@Tree.t:primate"
+              spec="beast.evolution.tree.RandomTree" taxa="@coding">
+            <populationModel id="ConstantPopulation0.t:primate" spec="ConstantPopulation">
+                <parameter id="randomPopSize.t:primate" name="popSize" value="1"/>
+            </populationModel>
+        </init>
+
+        <distribution id="posterior" spec="util.CompoundDistribution">
+            <distribution id="prior" spec="util.CompoundDistribution">
+                <distribution birthDiffRate="@birthRate.t:primate" id="YuleModel.t:primate"
+                              spec="beast.evolution.speciation.YuleModel" tree="@Tree.t:primate"/>
+                <prior id="YuleBirthRatePrior.t:primate" name="distribution" x="@birthRate.t:primate">
+                    <Uniform id="Uniform.0" name="distr" upper="Infinity"/>
+                </prior>
+            </distribution>
+            <distribution id="likelihood" spec="util.CompoundDistribution">
+                <distribution data="@coding" id="treeLikelihood.coding" spec="TreeLikelihood" tree="@Tree.t:primate">
+                    <siteModel id="SiteModel.s:primate" spec="SiteModel">
+                        <parameter estimate="false" id="mutationRate.s:primate" name="mutationRate" value="1.0"/>
+                        <parameter estimate="false" id="gammaShape.s:primate" name="shape" value="1.0"/>
+                        <parameter estimate="false" id="proportionInvariant.s:primate" lower="0.0"
+                                   name="proportionInvariant" upper="1.0" value="0.0"/>
+                        <substModel id="tn93.s:primate" kappa1="@rateAG.s:primate" kappa2="@rateCT.s:primate"
+                                    spec="TN93">
+                            <frequencies frequencies="@freqParameter.s:primate" id="estimatedFreqs.s:primate"
+                                         spec="Frequencies"/>
+                        </substModel>
+                    </siteModel>
+                    <branchRateModel id="StrictClock.c:primate" spec="beast.evolution.branchratemodel.StrictClockModel">
+                        <parameter estimate="false" id="clockRate.c:primate" name="clock.rate" value="1.0"/>
+                    </branchRateModel>
+                </distribution>
+                <distribution branchRateModel="@StrictClock.c:primate" id="treeLikelihood.noncoding"
+                              siteModel="@SiteModel.s:primate" spec="TreeLikelihood" tree="@Tree.t:primate">
+                    <data data="@primate-mtDNA" filter="1,458-659,897-898" id="noncoding" spec="FilteredAlignment"/>
+                </distribution>
+            </distribution>
+        </distribution>
+
+        <operator id="YuleBirthRateScaler.t:primate" parameter="@birthRate.t:primate" scaleFactor="0.75"
+                  spec="ScaleOperator" weight="3.0"/>
+
+        <operator id="treeScaler.t:primate" scaleFactor="0.5" spec="ScaleOperator" tree="@Tree.t:primate" weight="3.0"/>
+
+        <operator id="treeRootScaler.t:primate" rootOnly="true" scaleFactor="0.5" spec="ScaleOperator"
+                  tree="@Tree.t:primate" weight="3.0"/>
+
+        <operator id="UniformOperator.t:primate" spec="Uniform" tree="@Tree.t:primate" weight="30.0"/>
+
+        <operator id="SubtreeSlide.t:primate" spec="SubtreeSlide" tree="@Tree.t:primate" weight="15.0"/>
+
+        <operator id="narrow.t:primate" spec="Exchange" tree="@Tree.t:primate" weight="15.0"/>
+
+        <operator id="wide.t:primate" isNarrow="false" spec="Exchange" tree="@Tree.t:primate" weight="3.0"/>
+
+        <operator id="WilsonBalding.t:primate" spec="WilsonBalding" tree="@Tree.t:primate" weight="3.0"/>
+
+        <operator id="RateAGScaler.s:primate" parameter="@rateAG.s:primate" scaleFactor="0.5" spec="ScaleOperator"
+                  weight="0.1"/>
+
+        <operator id="RateCTScaler.s:primate" parameter="@rateCT.s:primate" scaleFactor="0.5" spec="ScaleOperator"
+                  weight="0.1"/>
+
+        <operator delta="0.01" id="FrequenciesExchanger.s:primate" spec="DeltaExchangeOperator" weight="0.1">
+            <parameter idref="freqParameter.s:primate"/>
+        </operator>
+
+        <logger fileName="primate-mtDNA-tn93.log" id="tracelog" logEvery="5000" model="@posterior"
+                sanitiseHeaders="true" sort="smart">
+            <log idref="posterior"/>
+            <log idref="likelihood"/>
+            <log idref="prior"/>
+            <log idref="treeLikelihood.coding"/>
+            <log id="TreeHeight.t:primate" spec="beast.evolution.tree.TreeHeightLogger" tree="@Tree.t:primate"/>
+            <log idref="YuleModel.t:primate"/>
+            <parameter idref="birthRate.t:primate" name="log"/>
+            <log idref="treeLikelihood.noncoding"/>
+            <parameter idref="rateAG.s:primate" name="log"/>
+            <parameter idref="rateCT.s:primate" name="log"/>
+            <parameter idref="freqParameter.s:primate" name="log"/>
+        </logger>
+
+        <logger id="screenlog" logEvery="5000">
+            <log idref="posterior"/>
+            <log arg="@posterior" id="ESS.0" spec="util.ESS"/>
+            <log idref="likelihood"/>
+            <log idref="prior"/>
+            <parameter idref="rateAG.s:primate" name="log"/>
+            <parameter idref="rateCT.s:primate" name="log"/>
+        </logger>
+
+        <logger fileName="primate-mtDNA-tn93.trees" id="treelog.t:primate" logEvery="5000" mode="tree">
+            <log id="TreeWithMetaDataLogger.t:primate" spec="beast.evolution.tree.TreeWithMetaDataLogger"
+                 tree="@Tree.t:primate"/>
+        </logger>
+
+    </run>
+
+</beast>
diff --git a/examples/testTVM.xml b/examples/testTVM.xml
new file mode 100644
index 0000000..db220b7
--- /dev/null
+++ b/examples/testTVM.xml
@@ -0,0 +1,197 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<beast beautitemplate='Standard' beautistatus=''
+       namespace="beast.core:beast.evolution.alignment:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood"
+       version="2.0">
+
+    <data id="primate-mtDNA">
+        <sequence id="seq_Lemur_catta" taxon="Lemur_catta" totalcount="4"
+                  value="AAGCTTCATAGGAGCAACCATTCTAATAATCGCACATGGCCTTACATCATCCATATTATTCTGTCTAGCCAACTCTAACTACGAACGAATCCATAGCCGTACAATACTACTAGCACGAGGGATCCAAACCATTCTCCCTCTTATAGCCACCTGATGACTACTCGCCAGCCTAACTAACCTAGCCCTACCCACCTCTATCAATTTAATTGGCGAACTATTCGTCACTATAGCATCCTTCTCATGATCAAACATTACAATTATCTTAATAGGCTTAAATATGCTCATCACCGCTCTCTATTCCCTCTATATATTAACTACTACACAACGAGGAAAACTCACATATCATTCGCACAACCTAAACCCATCCTTTACACGAGAAAACACCCTTATATCCATACACATACTCCCCCTTCTCCTATTTACCTTAAACCCCAAAATTATTCTAGGACCCACGTACTGTAAATATA [...]
+        <sequence id="seq_Homo_sapiens" taxon="Homo_sapiens" totalcount="4"
+                  value="AAGCTTCACCGGCGCAGTCATTCTCATAATCGCCCACGGGCTTACATCCTCATTACTATTCTGCCTAGCAAACTCAAACTACGAACGCACTCACAGTCGCATCATAATCCTCTCTCAAGGACTTCAAACTCTACTCCCACTAATAGCTTTTTGATGACTTCTAGCAAGCCTCGCTAACCTCGCCTTACCCCCCACTATTAACCTACTGGGAGAACTCTCTGTGCTAGTAACCACGTTCTCCTGATCAAATATCACTCTCCTACTTACAGGACTCAACATACTAGTCACAGCCCTATACTCCCTCTACATATTTACCACAACACAATGGGGCTCACTCACCCACCACATTAACAACATAAAACCCTCATTCACACGAGAAAACACCCTCATGTTCATACACCTATCCCCCATTCTCCTCCTATCCCTCAACCCCGACATCATTACCGGGTTTTCCTCTTGTAAATATA [...]
+        <sequence id="seq_Pan" taxon="Pan" totalcount="4"
+                  value="AAGCTTCACCGGCGCAATTATCCTCATAATCGCCCACGGACTTACATCCTCATTATTATTCTGCCTAGCAAACTCAAATTATGAACGCACCCACAGTCGCATCATAATTCTCTCCCAAGGACTTCAAACTCTACTCCCACTAATAGCCTTTTGATGACTCCTAGCAAGCCTCGCTAACCTCGCCCTACCCCCTACCATTAATCTCCTAGGGGAACTCTCCGTGCTAGTAACCTCATTCTCCTGATCAAATACCACTCTCCTACTCACAGGATTCAACATACTAATCACAGCCCTGTACTCCCTCTACATGTTTACCACAACACAATGAGGCTCACTCACCCACCACATTAATAACATAAAGCCCTCATTCACACGAGAAAATACTCTCATATTTTTACACCTATCCCCCATCCTCCTTCTATCCCTCAATCCTGATATCATCACTGGATTCACCTCCTGTAAATATA [...]
+        <sequence id="seq_Gorilla" taxon="Gorilla" totalcount="4"
+                  value="AAGCTTCACCGGCGCAGTTGTTCTTATAATTGCCCACGGACTTACATCATCATTATTATTCTGCCTAGCAAACTCAAACTACGAACGAACCCACAGCCGCATCATAATTCTCTCTCAAGGACTCCAAACCCTACTCCCACTAATAGCCCTTTGATGACTTCTGGCAAGCCTCGCCAACCTCGCCTTACCCCCCACCATTAACCTACTAGGAGAGCTCTCCGTACTAGTAACCACATTCTCCTGATCAAACACCACCCTTTTACTTACAGGATCTAACATACTAATTACAGCCCTGTACTCCCTTTATATATTTACCACAACACAATGAGGCCCACTCACACACCACATCACCAACATAAAACCCTCATTTACACGAGAAAACATCCTCATATTCATGCACCTATCCCCCATCCTCCTCCTATCCCTCAACCCCGATATTATCACCGGGTTCACCTCCTGTAAATATA [...]
+        <sequence id="seq_Pongo" taxon="Pongo" totalcount="4"
+                  value="AAGCTTCACCGGCGCAACCACCCTCATGATTGCCCATGGACTCACATCCTCCCTACTGTTCTGCCTAGCAAACTCAAACTACGAACGAACCCACAGCCGCATCATAATCCTCTCTCAAGGCCTTCAAACTCTACTCCCCCTAATAGCCCTCTGATGACTTCTAGCAAGCCTCACTAACCTTGCCCTACCACCCACCATCAACCTTCTAGGAGAACTCTCCGTACTAATAGCCATATTCTCTTGATCTAACATCACCATCCTACTAACAGGACTCAACATACTAATCACAACCCTATACTCTCTCTATATATTCACCACAACACAACGAGGTACACCCACACACCACATCAACAACATAAAACCTTCTTTCACACGCGAAAATACCCTCATGCTCATACACCTATCCCCCATCCTCCTCTTATCCCTCAACCCCAGCATCATCGCTGGGTTCGCCTACTGTAAATATA [...]
+        <sequence id="seq_Hylobates" taxon="Hylobates" totalcount="4"
+                  value="AAGCTTTACAGGTGCAACCGTCCTCATAATCGCCCACGGACTAACCTCTTCCCTGCTATTCTGCCTTGCAAACTCAAACTACGAACGAACTCACAGCCGCATCATAATCCTATCTCGAGGGCTCCAAGCCTTACTCCCACTGATAGCCTTCTGATGACTCGCAGCAAGCCTCGCTAACCTCGCCCTACCCCCCACTATTAACCTCCTAGGTGAACTCTTCGTACTAATGGCCTCCTTCTCCTGGGCAAACACTACTATTACACTCACCGGGCTCAACGTACTAATCACGGCCCTATACTCCCTTTACATATTTATCATAACACAACGAGGCACACTTACACACCACATTAAAAACATAAAACCCTCACTCACACGAGAAAACATATTAATACTTATGCACCTCTTCCCCCTCCTCCTCCTAACCCTCAACCCTAACATCATTACTGGCTTTACTCCCTGTAAACATA [...]
+        <sequence id="seq_Macaca_fuscata" taxon="Macaca_fuscata" totalcount="4"
+                  value="AAGCTTTTCCGGCGCAACCATCCTTATGATCGCTCACGGACTCACCTCTTCCATATATTTCTGCCTAGCCAATTCAAACTATGAACGCACTCACAACCGTACCATACTACTGTCCCGAGGACTTCAAATCCTACTTCCACTAACAGCCTTTTGATGATTAACAGCAAGCCTTACTAACCTTGCCCTACCCCCCACTATCAATCTACTAGGTGAACTCTTTGTAATCGCAACCTCATTCTCCTGATCCCATATCACCATTATGCTAACAGGACTTAACATATTAATTACGGCCCTCTACTCTCTCCACATATTCACTACAACACAACGAGGAACACTCACACATCACATAATCAACATAAAGCCCCCCTTCACACGAGAAAACACATTAATATTCATACACCTCGCTCCAATTATCCTTCTATCCCTCAACCCCAACATCATCCTGGGGTTTACCTCCTGTAGATATA [...]
+        <sequence id="seq_M._mulatta" taxon="M._mulatta" totalcount="4"
+                  value="AAGCTTTTCTGGCGCAACCATCCTCATGATTGCTCACGGACTCACCTCTTCCATATATTTCTGCCTAGCCAATTCAAACTATGAACGCACTCACAACCGTACCATACTACTGTCCCGGGGACTTCAAATCCTACTTCCACTAACAGCTTTCTGATGATTAACAGCAAGCCTTACTAACCTTGCCCTACCCCCCACTATCAACCTACTAGGTGAACTCTTTGTAATCGCGACCTCATTCTCCTGGTCCCATATCACCATTATATTAACAGGATTTAACATACTAATTACGGCCCTCTACTCCCTCCACATATTCACCACAACACAACGAGGAGCACTCACACATCACATAATCAACATAAAACCCCCCTTCACACGAGAAAACATATTAATATTCATACACCTCGCTCCAATCATCCTCCTATCTCTCAACCCCAACATCATCCTGGGGTTTACTTCCTGTAGATATA [...]
+        <sequence id="seq_M._fascicularis" taxon="M._fascicularis" totalcount="4"
+                  value="AAGCTTCTCCGGCGCAACCACCCTTATAATCGCCCACGGGCTCACCTCTTCCATGTATTTCTGCTTGGCCAATTCAAACTATGAGCGCACTCATAACCGTACCATACTACTATCCCGAGGACTTCAAATTCTACTTCCATTGACAGCCTTCTGATGACTCACAGCAAGCCTTACTAACCTTGCCCTACCCCCCACTATTAATCTACTAGGCGAACTCTTTGTAATCACAACTTCATTTTCCTGATCCCATATCACCATTGTGTTAACGGGCCTTAATATACTAATCACAGCCCTCTACTCTCTCCACATGTTCATTACAGTACAACGAGGAACACTCACACACCACATAATCAATATAAAACCCCCCTTCACACGAGAAAACATATTAATATTCATACACCTCGCTCCAATTATCCTTCTATCTCTCAACCCCAACATCATCCTGGGGTTTACCTCCTGTAAATATA [...]
+        <sequence id="seq_M._sylvanus" taxon="M._sylvanus" totalcount="4"
+                  value="AAGCTTCTCCGGTGCAACTATCCTTATAGTTGCCCATGGACTCACCTCTTCCATATACTTCTGCTTGGCCAACTCAAACTACGAACGCACCCACAGCCGCATCATACTACTATCCCGAGGACTCCAAATCCTACTCCCACTAACAGCCTTCTGATGATTCACAGCAAGCCTTACTAATCTTGCTCTACCCTCCACTATTAATCTACTGGGCGAACTCTTCGTAATCGCAACCTCATTTTCCTGATCCCACATCACCATCATACTAACAGGACTGAACATACTAATTACAGCCCTCTACTCTCTTCACATATTCACCACAACACAACGAGGAGCGCTCACACACCACATAATTAACATAAAACCACCTTTCACACGAGAAAACATATTAATACTCATACACCTCGCTCCAATTATTCTTCTATCTCTTAACCCCAACATCATTCTAGGATTTACTTCCTGTAAATATA [...]
+        <sequence id="seq_Saimiri_sciureus" taxon="Saimiri_sciureus" totalcount="4"
+                  value="AAGCTTCACCGGCGCAATGATCCTAATAATCGCTCACGGGTTTACTTCGTCTATGCTATTCTGCCTAGCAAACTCAAATTACGAACGAATTCACAGCCGAACAATAACATTTACTCGAGGGCTCCAAACACTATTCCCGCTTATAGGCCTCTGATGACTCCTAGCAAATCTCGCTAACCTCGCCCTACCCACAGCTATTAATCTAGTAGGAGAATTACTCACAATCGTATCTTCCTTCTCTTGATCCAACTTTACTATTATATTCACAGGACTTAATATACTAATTACAGCACTCTACTCACTTCATATGTATGCCTCTACACAGCGAGGTCCACTTACATACAGCACCAGCAATATAAAACCAATATTTACACGAGAAAATACGCTAATATTTATACATATAACACCAATCCTCCTCCTTACCTTGAGCCCCAAGGTAATTATAGGACCCTCACCTTGTAATTATA [...]
+        <sequence id="seq_Tarsius_syrichta" taxon="Tarsius_syrichta" totalcount="4"
+                  value="AAGTTTCATTGGAGCCACCACTCTTATAATTGCCCATGGCCTCACCTCCTCCCTATTATTTTGCCTAGCAAATACAAACTACGAACGAGTCCACAGTCGAACAATAGCACTAGCCCGTGGCCTTCAAACCCTATTACCTCTTGCAGCAACATGATGACTCCTCGCCAGCTTAACCAACCTGGCCCTTCCCCCAACAATTAATTTAATCGGTGAACTGTCCGTAATAATAGCAGCATTTTCATGGTCACACCTAACTATTATCTTAGTAGGCCTTAACACCCTTATCACCGCCCTATATTCCCTATATATACTAATCATAACTCAACGAGGAAAATACACATATCATATCAACAATATCATGCCCCCTTTCACCCGAGAAAATACATTAATAATCATACACCTATTTCCCTTAATCCTACTATCTACCAACCCCAAAGTAATTATAGGAACCATGTACTGTAAATATA [...]
+    </data>
+
+
+    <map name="Beta">beast.math.distributions.Beta</map>
+    <map name="Exponential">beast.math.distributions.Exponential</map>
+    <map name="InverseGamma">beast.math.distributions.InverseGamma</map>
+    <map name="LogNormal">beast.math.distributions.LogNormalDistributionModel</map>
+    <map name="Gamma">beast.math.distributions.Gamma</map>
+    <map name="Uniform">beast.math.distributions.Uniform</map>
+    <map name="prior">beast.math.distributions.Prior</map>
+    <map name="LaplaceDistribution">beast.math.distributions.LaplaceDistribution</map>
+    <map name="OneOnX">beast.math.distributions.OneOnX</map>
+    <map name="Normal">beast.math.distributions.Normal</map>
+
+
+    <run chainLength="5000000" id="mcmc" spec="MCMC">
+        <state id="state" storeEvery="5000">
+            <tree id="Tree.t:primate" name="stateNode">
+                <taxonset id="TaxonSet.coding" spec="TaxonSet">
+                    <alignment filter="2-457,660-896" id="coding" spec="FilteredAlignment">
+                        <data idref="primate-mtDNA"/>
+                    </alignment>
+                </taxonset>
+            </tree>
+            <parameter id="birthRate.t:primate" name="stateNode" value="1.0"/>
+            <parameter id="rateGT.s:primate" lower="0.0" name="stateNode" value="1.0"/>
+            <parameter id="rateTransitions.s:primate" lower="0.0" name="stateNode" value="1.0"/>
+            <parameter id="rateAT.s:primate" lower="0.0" name="stateNode" value="1.0"/>
+            <parameter id="rateCG.s:primate" lower="0.0" name="stateNode" value="1.0"/>
+            <parameter dimension="4" id="freqParameter.s:primate" lower="0.0" name="stateNode" upper="1.0"
+                       value="0.25"/>
+        </state>
+
+        <init estimate="false" id="RandomTree.t:primate" initial="@Tree.t:primate"
+              spec="beast.evolution.tree.RandomTree" taxa="@coding">
+            <populationModel id="ConstantPopulation0.t:primate" spec="ConstantPopulation">
+                <parameter id="randomPopSize.t:primate" name="popSize" value="1"/>
+            </populationModel>
+        </init>
+
+        <distribution id="posterior" spec="util.CompoundDistribution">
+            <distribution id="prior" spec="util.CompoundDistribution">
+                <distribution birthDiffRate="@birthRate.t:primate" id="YuleModel.t:primate"
+                              spec="beast.evolution.speciation.YuleModel" tree="@Tree.t:primate"/>
+                <prior id="YuleBirthRatePrior.t:primate" name="distribution" x="@birthRate.t:primate">
+                    <Uniform id="Uniform.0" name="distr" upper="Infinity"/>
+                </prior>
+                <prior id="RateGTPrior.s:primate" name="distribution" x="@rateGT.s:primate">
+                    <LogNormal id="LogNormalDistributionModel.0" name="distr">
+                        <parameter estimate="false" id="RealParameter.0" name="M" value="0"/>
+                        <parameter estimate="false" id="RealParameter.01" lower="0.0" name="S" upper="5.0"
+                                   value="1.25"/>
+                    </LogNormal>
+                </prior>
+                <prior id="RateTransitionsPrior.s:primate" name="distribution" x="@rateTransitions.s:primate">
+                    <LogNormal id="LogNormalDistributionModel.01" name="distr">
+                        <parameter estimate="false" id="RealParameter.02" name="M" value="0"/>
+                        <parameter estimate="false" id="RealParameter.03" lower="0.0" name="S" upper="5.0"
+                                   value="1.25"/>
+                    </LogNormal>
+                </prior>
+                <prior id="RateATPrior.s:primate" name="distribution" x="@rateAT.s:primate">
+                    <LogNormal id="LogNormalDistributionModel.02" name="distr">
+                        <parameter estimate="false" id="RealParameter.04" name="M" value="0"/>
+                        <parameter estimate="false" id="RealParameter.05" lower="0.0" name="S" upper="5.0"
+                                   value="1.25"/>
+                    </LogNormal>
+                </prior>
+                <prior id="RateCGPrior.s:primate" name="distribution" x="@rateCG.s:primate">
+                    <LogNormal id="LogNormalDistributionModel.03" name="distr">
+                        <parameter estimate="false" id="RealParameter.06" name="M" value="0"/>
+                        <parameter estimate="false" id="RealParameter.07" lower="0.0" name="S" upper="5.0"
+                                   value="1.25"/>
+                    </LogNormal>
+                </prior>
+            </distribution>
+
+            <distribution id="likelihood" spec="util.CompoundDistribution">
+                <distribution data="@coding" id="treeLikelihood.coding" spec="TreeLikelihood" tree="@Tree.t:primate">
+                    <siteModel id="SiteModel.s:primate" spec="SiteModel">
+                        <parameter estimate="false" id="mutationRate.s:primate" name="mutationRate" value="1.0"/>
+                        <parameter estimate="false" id="gammaShape.s:primate" name="shape" value="1.0"/>
+                        <parameter estimate="false" id="proportionInvariant.s:primate" lower="0.0"
+                                   name="proportionInvariant" upper="1.0" value="0.0"/>
+                        <substModel id="tvm.s:primate" rateGT="@rateGT.s:primate" rateTransitions="@rateTransitions.s:primate"
+                                    rateAT="@rateAT.s:primate" rateCG="@rateCG.s:primate" spec="TVM">
+                            <parameter estimate="false" id="rateAC.s:primate" lower="0.0" name="rateAC" value="1.0"/>
+                            <frequencies frequencies="@freqParameter.s:primate" id="estimatedFreqs.s:primate"
+                                         spec="Frequencies"/>
+                        </substModel>
+                    </siteModel>
+                    <branchRateModel id="StrictClock.c:primate" spec="beast.evolution.branchratemodel.StrictClockModel">
+                        <parameter estimate="false" id="clockRate.c:primate" name="clock.rate" value="1.0"/>
+                    </branchRateModel>
+                </distribution>
+                <distribution branchRateModel="@StrictClock.c:primate" id="treeLikelihood.noncoding"
+                              siteModel="@SiteModel.s:primate" spec="TreeLikelihood" tree="@Tree.t:primate">
+                    <data data="@primate-mtDNA" filter="1,458-659,897-898" id="noncoding" spec="FilteredAlignment"/>
+                </distribution>
+            </distribution>
+        </distribution>
+
+        <operator id="YuleBirthRateScaler.t:primate" parameter="@birthRate.t:primate" scaleFactor="0.75"
+                  spec="ScaleOperator" weight="3.0"/>
+
+        <operator id="treeScaler.t:primate" scaleFactor="0.5" spec="ScaleOperator" tree="@Tree.t:primate" weight="3.0"/>
+
+        <operator id="treeRootScaler.t:primate" rootOnly="true" scaleFactor="0.5" spec="ScaleOperator"
+                  tree="@Tree.t:primate" weight="3.0"/>
+
+        <operator id="UniformOperator.t:primate" spec="Uniform" tree="@Tree.t:primate" weight="30.0"/>
+
+        <operator id="SubtreeSlide.t:primate" spec="SubtreeSlide" tree="@Tree.t:primate" weight="15.0"/>
+
+        <operator id="narrow.t:primate" spec="Exchange" tree="@Tree.t:primate" weight="15.0"/>
+
+        <operator id="wide.t:primate" isNarrow="false" spec="Exchange" tree="@Tree.t:primate" weight="3.0"/>
+
+        <operator id="WilsonBalding.t:primate" spec="WilsonBalding" tree="@Tree.t:primate" weight="3.0"/>
+
+        <operator id="RateGTScaler.s:primate" parameter="@rateGT.s:primate" scaleFactor="0.5" spec="ScaleOperator"
+                  weight="0.1"/>
+
+        <operator id="RateATScaler.s:primate" parameter="@rateAT.s:primate" scaleFactor="0.5" spec="ScaleOperator"
+                  weight="0.1"/>
+
+        <operator id="RateCGScaler.s:primate" parameter="@rateCG.s:primate" scaleFactor="0.5" spec="ScaleOperator"
+                  weight="0.1"/>
+
+        <operator id="RateTransitionsScaler.s:primate" parameter="@rateTransitions.s:primate" scaleFactor="0.5" spec="ScaleOperator"
+                  weight="0.1"/>
+
+        <operator delta="0.01" id="FrequenciesExchanger.s:primate" spec="DeltaExchangeOperator" weight="0.1">
+            <parameter idref="freqParameter.s:primate"/>
+        </operator>
+
+        <logger fileName="primate-mtDNA-TVM.log" id="tracelog" logEvery="5000" model="@posterior" sanitiseHeaders="true"
+                sort="smart">
+            <log idref="posterior"/>
+            <log idref="likelihood"/>
+            <log idref="prior"/>
+            <log idref="treeLikelihood.noncoding"/>
+            <log idref="treeLikelihood.coding"/>
+            <log id="TreeHeight.t:primate" spec="beast.evolution.tree.TreeHeightLogger" tree="@Tree.t:primate"/>
+            <log idref="YuleModel.t:primate"/>
+            <parameter idref="birthRate.t:primate" name="log"/>
+            <parameter idref="rateGT.s:primate" name="log"/>
+            <parameter idref="rateTransitions.s:primate" name="log"/>
+            <parameter idref="rateAT.s:primate" name="log"/>
+            <parameter idref="rateCG.s:primate" name="log"/>
+            <parameter idref="freqParameter.s:primate" name="log"/>
+        </logger>
+
+        <logger id="screenlog" logEvery="5000">
+            <log idref="posterior"/>
+            <log arg="@posterior" id="ESS.0" spec="util.ESS"/>
+            <log idref="likelihood"/>
+            <log idref="prior"/>
+        </logger>
+
+        <logger fileName="$(tree).trees" id="treelog.t:primate" logEvery="5000" mode="tree">
+            <log id="TreeWithMetaDataLogger.t:primate" spec="beast.evolution.tree.TreeWithMetaDataLogger"
+                 tree="@Tree.t:primate"/>
+        </logger>
+
+    </run>
+</beast>
diff --git a/examples/testTipDates.xml b/examples/testTipDates.xml
new file mode 100644
index 0000000..2418c74
--- /dev/null
+++ b/examples/testTipDates.xml
@@ -0,0 +1,199 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beast version='2.0'
+       namespace='beast.math:beast.evolution.alignment:beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood'>
+
+<!-- 17 taxa, 1485 sites, 138 patterns -->
+<data dataType="nucleotide" id="alignment">
+<sequence taxon="D4Brazi82">
+            
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+<sequence taxon="D4ElSal83">
+            
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+<sequence taxon="D4ElSal94">
+            
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTGGTGCTAGAACATGGAGGATGCGTCACAACCATAGCCCAGGGAAAACCAACCTTGGATTTTGAATTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGGAATGGCTGTGGCTTGCTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGATACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+<sequence taxon="D4Indon76">
+            
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTAAAAGAGGAACAAGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+<sequence taxon="D4Indon77">
+            
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTAAAAGAGGAACAAGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTAGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAACCATGGAGTT [...]
+        </sequence>
+<sequence taxon="D4Mexico84">
+            
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTAGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGCTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+<sequence taxon="D4NewCal81">
+            
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+<sequence taxon="D4Philip64">
+            
+            ATGCGATGCGTGGGAGTGGGGAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATTTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCGATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAACCTTATCTCAAAGAGGAACAAGATCAACAGTACATCTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGATACATCCAACCATGGAGTG [...]
+        </sequence>
+<sequence taxon="D4Philip56">
+            
+            ATGCGATGCGTGGGAGTGGGGAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATTTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCGATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAACCTTATCTCAAAGAGGAACAAGATCAACAGTACATCTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGCTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTAGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACATATCCAACCATGGAGTG [...]
+        </sequence>
+<sequence taxon="D4Philip84">
+            
+            ATGCGATGCGTAGGAGTGGGGAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACTTAGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAAGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCGATATCAAACATAACCACGGCAACAAGATGCCCAACGCAAGGAGAACCTTATCTCAAAGAGGAACAAGATCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTCTCATGCTCGGGAAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATATACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAACCATGGAGTG [...]
+        </sequence>
+<sequence taxon="D4PRico86">
+            
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGACCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGGGAGCCCTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATCTGGTCCAAATTGAGAACCTTGAGTACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+<sequence taxon="D4SLanka78">
+            
+            ATGCGATGCGTGGGAGTGGGGAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAAGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCCATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAGCCCTGTCTCAAAGAGGAACAGGATCAACAGTACATCTGCCGGAGAGACGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCCTGCTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACAGGCAACTTAGTCCGAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAACCACGGAGTG [...]
+        </sequence>
+<sequence taxon="D4Tahiti79">
+            
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATTTGGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+<sequence taxon="D4Tahiti85">
+            
+            ATGCGATGCGTAGGAGTAGGAAACAGAGACTTTGTGGAAGGAGTTTCAGGTGGAGCATGGGTCGATTTGGTGCTAGAACATGGAGGATGCGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGACTAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCAATATCAAACATAACTACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTATCTGAAAGAGGAACAGGACCAACAGTACATTTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTGTTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGTTCGGGGAAGATAACAGGCAATCTGGTCCAAATTGAGAACCTTGAATACACAGTGGTCATAACAGTCCACAATGGAGACACCCATGCAGTAGGAAATGACACATCCAATCATGGAGTT [...]
+        </sequence>
+<sequence taxon="D4Thai63">
+            
+            ATGCGATGCGTAGGAGTGGGGAACAGGGACTTTGTGGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCTCAAGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCGATATCAAACATAACCACGGCGACAAGATGTCCAACGCAAGGAGAGCCTTATCTCAAAGAGGAACAAGATCAACAGTACATCTGCCGGAGAGATGTGGTAGACAGAGGGTGGGGCAATGGCTGTGGCTTACTTGGAAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACAGGCAACTTGGTTCGAATTGAGAACCTTGAATACACAGTGGTTGTGACAGTCCACAACGGAGACACCCATGCAGTAGGAAATGACATATCCAACCATGGAGTG [...]
+        </sequence>
+<sequence taxon="D4Thai78">
+            
+            ATGCGATGCGTAGGAGTGGGGAACAGAGACTTTGTAGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAGGGAAAACCAACCTTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCCATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTACCTCAAAGAGGAACAAGATCAACAGTACATCTGCCGGAGAGACGTGGTAGATAGAGGGTGGGGCAACGGCTGTGGCTTGCTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACAGGCAACTTAGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCTGTAGGAAATGATACATCCAACCACGGAGTG [...]
+        </sequence>
+<sequence taxon="D4Thai84">
+            
+            ATGCGATGCGTAGGAGTAGGGAACAGAGACTTTGTAGAAGGAGTCTCAGGTGGAGCATGGGTCGATCTGGTGCTAGAACATGGAGGATGTGTCACAACCATGGCCCAGGGAAAACCAACCCTGGATTTTGAACTGATCAAGACAACAGCCAAGGAAGTGGCTCTGTTAAGAACCTATTGCATTGAAGCCTCCATATCAAACATAACCACGGCAACAAGATGTCCAACGCAAGGAGAGCCTTACCTCAAAGAGGAACAAGATCAACAGTACATCTGCCGGAGAGACGTGGTAGACAGAGGGTGGGGCAACGGCTGTGGCTTGTTTGGGAAAGGAGGAGTTGTGACATGTGCGAAGTTTTCATGCTCGGGGAAGATAACGGGCAACTTAGTCCAAATTGAGAACCTTGAATACACAGTGGTTGTAACAGTCCACAATGGAGACACCCATGCTGTAGGAAATGATACATCCAACCACGGAGTG [...]
+        </sequence>
+</data>
+
+
+
+    <!-- The HKY substitution model (Hasegawa, Kishino & Yano, 1985)             -->
+    <input spec='HKY' id='hky'>
+        <parameter name='kappa' idref='hky.kappa'/>
+        <input id='freqs' name='frequencies' spec='Frequencies'>
+            <input name='data' idref='alignment'/>
+        </input>
+    </input>
+
+    <!-- site model                                                              -->
+    <input spec='SiteModel' id="siteModel">
+        <input name='substModel' idref='hky'/>
+    </input>
+
+
+    <parameter id="hky.kappa" value="1.0" lower="0.0"/>
+
+    <tree spec='beast.util.ClusterTree' id='tree' clusterType='upgma'>
+		<trait spec='beast.evolution.tree.TraitSet' traitname='date-forward' units='year'
+			value='
+			D4Brazi82  = 1982,
+			D4ElSal83  = 1983,
+			D4ElSal94  = 1994,
+			D4Indon76  = 1976,
+			D4Indon77  = 1977,
+			D4Mexico84 = 1984,
+			D4NewCal81 = 1981,
+			D4Philip64 = 1964,
+			D4Philip56 = 1956,
+			D4Philip84 = 1984,
+			D4PRico86  = 1986,
+			D4SLanka78 = 1978,
+			D4Tahiti79 = 1979,
+			D4Tahiti85 = 1985,
+			D4Thai63   = 1963,
+			D4Thai78   = 1978,
+			D4Thai84   = 1984
+			'>
+			<taxa spec='TaxonSet' alignment='@alignment'/>
+		</trait>
+        <input name='taxa' idref='alignment'/>
+    </tree>
+
+    <distribution id="posterior" spec="util.CompoundDistribution">
+        <distribution id="prior" spec="util.CompoundDistribution">
+            <distribution id="coalescent" spec="Coalescent">
+                <populationModel id="ConstantPopulation" spec="ConstantPopulation">
+                    <parameter dimension="1" estimate="false" id="popSize" name="popSize" value="1.0"/>
+                </populationModel>
+                <treeIntervals id="TreeIntervals" spec="TreeIntervals" tree="@tree"/>
+            </distribution>
+
+            <distribution id="tipDates" monophyletic="false" spec="distributions.MRCAPrior" tipsonly="true" tree="@tree">
+                <taxonset id="TaxonSet0" spec="TaxonSet">
+                    <taxon id="D4PRico86" spec="Taxon"/>
+                </taxonset>
+                <distr id="Uniform0" lower="1985" offset="0.0" spec="distributions.Uniform" upper="1987"/>
+            </distribution>
+
+            <distribution id="tipDates2" monophyletic="false" spec="distributions.MRCAPrior" tipsonly="true" tree="@tree">
+                <taxonset id="TaxonSet1" spec="TaxonSet">
+                    <taxon id="D4ElSal94" spec="Taxon"/>
+                </taxonset>
+                <distr id="Noraml0" offset="0.0" spec="distributions.Normal" mean="1994" sigma="1"/>
+            </distribution>
+
+            <distribution id="kappa.prior" spec="distributions.Prior" x="@hky.kappa">
+                <distr id="OneOnX0" offset="0.0" spec="distributions.OneOnX"/>
+            </distribution>
+        </distribution>
+        <distribution id="likelihood" spec="util.CompoundDistribution">
+			<distribution spec='TreeLikelihood' id="treeLikelihood">
+				<input name='data' idref="alignment"/>
+				<input name='tree' idref="tree"/>
+				<input name='siteModel' idref="siteModel"/>
+                <branchRateModel id="StrictClockModel" spec="beast.evolution.branchratemodel.StrictClockModel">
+                    <parameter dimension="1" estimate="false" id="clockRate" name="clock.rate" value="1.0"/>
+                </branchRateModel>
+		    </distribution>
+		</distribution>
+	</distribution>
+
+    <run spec="MCMC" id="mcmc" chainLength="1000000">
+        <state>
+            <input name='stateNode' idref="hky.kappa"/>
+            <input name='stateNode' idref="clockRate"/>
+            <input name='stateNode' idref="tree"/>
+        </state>
+
+        <distribution idref="posterior"/>
+
+	    <operator id="TipDatesRandomWalker" windowSize="1" spec="TipDatesRandomWalker" taxonset="@TaxonSet0" tree="@tree" weight="1.0"/>
+	    <operator id="TipDatesRandomWalker2" windowSize="1" spec="TipDatesRandomWalker" taxonset="@TaxonSet1" tree="@tree" weight="1.0"/>
+
+        <operator id='kappaScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" parameter="@hky.kappa"/>
+        <operator id='clockRateScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" parameter="@clockRate"/>
+
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" tree='@tree'/>
+        <operator spec='Uniform' weight="10" tree='@tree'/>
+        <operator spec='SubtreeSlide' weight="5" gaussian="true" size="1.0" tree='@tree'/>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="1" tree='@tree'/>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="1" tree='@tree'/>
+        <operator spec='WilsonBalding' weight="1" tree='@tree'/>
+
+        <logger logEvery="1000" fileName="test.$(seed).log">
+            <log idref="likelihood"/>
+			<log idref='tipDates'/>
+			<log idref='tipDates2'/>
+			<log idref='hky.kappa'/>
+			<log idref='clockRate'/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+        </logger>
+        <logger logEvery="10000" fileName="test.$(seed).trees">
+            <log idref="tree"/>
+        </logger>
+        <logger logEvery="10000">
+            <log idref="likelihood"/>
+        </logger>
+
+    </run>
+</beast>
+
diff --git a/examples/testTipDates2.xml b/examples/testTipDates2.xml
new file mode 100644
index 0000000..f608020
--- /dev/null
+++ b/examples/testTipDates2.xml
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><beast namespace="beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood" version="2.0">
+
+<!-- sample tip dates -->
+
+    <data dataType="nucleotide" id="Primates">
+        <sequence id="seq_Tarsius_syrichta" taxon="Tarsius_syrichta" totalcount="4" value="AAGTTTCATTGGAGCCACCACTCTTATAATTGCCCATGGCCTCACCTCCTCCCTATTATTTTGCCTAGCAAATACAAACTACGAACGAGTCCACAGTCGAACAATAGCACTAGCCCGTGGCCTTCAAACCCTATTACCTCTTGCAGCAACATGATGACTCCTCGCCAGCTTAACCAACCTGGCCCTTCCCCCAACAATTAATTTAATCGGTGAACTGTCCGTAATAATAGCAGCATTTTCATGGTCACACCTAACTATTATCTTAGTAGGCCTTAACACCCTTATCACCGCCCTATATTCCCTATATATACTAATCATAACTCAACGAGGAAAATACACATATCATATCAACAATATCATGCCCCCTTTCACCCGAGAAAATACATTAATAATCATACACC [...]
+        <sequence id="seq_Lemur_catta" taxon="Lemur_catta" totalcount="4" value="AAGCTTCATAGGAGCAACCATTCTAATAATCGCACATGGCCTTACATCATCCATATTATTCTGTCTAGCCAACTCTAACTACGAACGAATCCATAGCCGTACAATACTACTAGCACGAGGGATCCAAACCATTCTCCCTCTTATAGCCACCTGATGACTACTCGCCAGCCTAACTAACCTAGCCCTACCCACCTCTATCAATTTAATTGGCGAACTATTCGTCACTATAGCATCCTTCTCATGATCAAACATTACAATTATCTTAATAGGCTTAAATATGCTCATCACCGCTCTCTATTCCCTCTATATATTAACTACTACACAACGAGGAAAACTCACATATCATTCGCACAACCTAAACCCATCCTTTACACGAGAAAACACCCTTATATCCATACACATACTCCCCCT [...]
+        <sequence id="seq_Homo_sapiens" taxon="Homo_sapiens" totalcount="4" value="AAGCTTCACCGGCGCAGTCATTCTCATAATCGCCCACGGGCTTACATCCTCATTACTATTCTGCCTAGCAAACTCAAACTACGAACGCACTCACAGTCGCATCATAATCCTCTCTCAAGGACTTCAAACTCTACTCCCACTAATAGCTTTTTGATGACTTCTAGCAAGCCTCGCTAACCTCGCCTTACCCCCCACTATTAACCTACTGGGAGAACTCTCTGTGCTAGTAACCACGTTCTCCTGATCAAATATCACTCTCCTACTTACAGGACTCAACATACTAGTCACAGCCCTATACTCCCTCTACATATTTACCACAACACAATGGGGCTCACTCACCCACCACATTAACAACATAAAACCCTCATTCACACGAGAAAACACCCTCATGTTCATACACCTATCCCCC [...]
+        <sequence id="seq_Pan" taxon="Pan" totalcount="4" value="AAGCTTCACCGGCGCAATTATCCTCATAATCGCCCACGGACTTACATCCTCATTATTATTCTGCCTAGCAAACTCAAATTATGAACGCACCCACAGTCGCATCATAATTCTCTCCCAAGGACTTCAAACTCTACTCCCACTAATAGCCTTTTGATGACTCCTAGCAAGCCTCGCTAACCTCGCCCTACCCCCTACCATTAATCTCCTAGGGGAACTCTCCGTGCTAGTAACCTCATTCTCCTGATCAAATACCACTCTCCTACTCACAGGATTCAACATACTAATCACAGCCCTGTACTCCCTCTACATGTTTACCACAACACAATGAGGCTCACTCACCCACCACATTAATAACATAAAGCCCTCATTCACACGAGAAAATACTCTCATATTTTTACACCTATCCCCCATCCTCCTTCTATCCCTC [...]
+        <sequence id="seq_Gorilla" taxon="Gorilla" totalcount="4" value="AAGCTTCACCGGCGCAGTTGTTCTTATAATTGCCCACGGACTTACATCATCATTATTATTCTGCCTAGCAAACTCAAACTACGAACGAACCCACAGCCGCATCATAATTCTCTCTCAAGGACTCCAAACCCTACTCCCACTAATAGCCCTTTGATGACTTCTGGCAAGCCTCGCCAACCTCGCCTTACCCCCCACCATTAACCTACTAGGAGAGCTCTCCGTACTAGTAACCACATTCTCCTGATCAAACACCACCCTTTTACTTACAGGATCTAACATACTAATTACAGCCCTGTACTCCCTTTATATATTTACCACAACACAATGAGGCCCACTCACACACCACATCACCAACATAAAACCCTCATTTACACGAGAAAACATCCTCATATTCATGCACCTATCCCCCATCCTCCTCC [...]
+        <sequence id="seq_Pongo" taxon="Pongo" totalcount="4" value="AAGCTTCACCGGCGCAACCACCCTCATGATTGCCCATGGACTCACATCCTCCCTACTGTTCTGCCTAGCAAACTCAAACTACGAACGAACCCACAGCCGCATCATAATCCTCTCTCAAGGCCTTCAAACTCTACTCCCCCTAATAGCCCTCTGATGACTTCTAGCAAGCCTCACTAACCTTGCCCTACCACCCACCATCAACCTTCTAGGAGAACTCTCCGTACTAATAGCCATATTCTCTTGATCTAACATCACCATCCTACTAACAGGACTCAACATACTAATCACAACCCTATACTCTCTCTATATATTCACCACAACACAACGAGGTACACCCACACACCACATCAACAACATAAAACCTTCTTTCACACGCGAAAATACCCTCATGCTCATACACCTATCCCCCATCCTCCTCTTATC [...]
+        <sequence id="seq_Hylobates" taxon="Hylobates" totalcount="4" value="AAGCTTTACAGGTGCAACCGTCCTCATAATCGCCCACGGACTAACCTCTTCCCTGCTATTCTGCCTTGCAAACTCAAACTACGAACGAACTCACAGCCGCATCATAATCCTATCTCGAGGGCTCCAAGCCTTACTCCCACTGATAGCCTTCTGATGACTCGCAGCAAGCCTCGCTAACCTCGCCCTACCCCCCACTATTAACCTCCTAGGTGAACTCTTCGTACTAATGGCCTCCTTCTCCTGGGCAAACACTACTATTACACTCACCGGGCTCAACGTACTAATCACGGCCCTATACTCCCTTTACATATTTATCATAACACAACGAGGCACACTTACACACCACATTAAAAACATAAAACCCTCACTCACACGAGAAAACATATTAATACTTATGCACCTCTTCCCCCTCCTC [...]
+        <sequence id="seq_Macaca_fuscata" taxon="Macaca_fuscata" totalcount="4" value="AAGCTTTTCCGGCGCAACCATCCTTATGATCGCTCACGGACTCACCTCTTCCATATATTTCTGCCTAGCCAATTCAAACTATGAACGCACTCACAACCGTACCATACTACTGTCCCGAGGACTTCAAATCCTACTTCCACTAACAGCCTTTTGATGATTAACAGCAAGCCTTACTAACCTTGCCCTACCCCCCACTATCAATCTACTAGGTGAACTCTTTGTAATCGCAACCTCATTCTCCTGATCCCATATCACCATTATGCTAACAGGACTTAACATATTAATTACGGCCCTCTACTCTCTCCACATATTCACTACAACACAACGAGGAACACTCACACATCACATAATCAACATAAAGCCCCCCTTCACACGAGAAAACACATTAATATTCATACACCTCGC [...]
+        <sequence id="seq_M_mulatta" taxon="M_mulatta" totalcount="4" value="AAGCTTTTCTGGCGCAACCATCCTCATGATTGCTCACGGACTCACCTCTTCCATATATTTCTGCCTAGCCAATTCAAACTATGAACGCACTCACAACCGTACCATACTACTGTCCCGGGGACTTCAAATCCTACTTCCACTAACAGCTTTCTGATGATTAACAGCAAGCCTTACTAACCTTGCCCTACCCCCCACTATCAACCTACTAGGTGAACTCTTTGTAATCGCGACCTCATTCTCCTGGTCCCATATCACCATTATATTAACAGGATTTAACATACTAATTACGGCCCTCTACTCCCTCCACATATTCACCACAACACAACGAGGAGCACTCACACATCACATAATCAACATAAAACCCCCCTTCACACGAGAAAACATATTAATATTCATACACCTCGCTCCAATCATC [...]
+        <sequence id="seq_M_fascicularis" taxon="M_fascicularis" totalcount="4" value="AAGCTTCTCCGGCGCAACCACCCTTATAATCGCCCACGGGCTCACCTCTTCCATGTATTTCTGCTTGGCCAATTCAAACTATGAGCGCACTCATAACCGTACCATACTACTATCCCGAGGACTTCAAATTCTACTTCCATTGACAGCCTTCTGATGACTCACAGCAAGCCTTACTAACCTTGCCCTACCCCCCACTATTAATCTACTAGGCGAACTCTTTGTAATCACAACTTCATTTTCCTGATCCCATATCACCATTGTGTTAACGGGCCTTAATATACTAATCACAGCCCTCTACTCTCTCCACATGTTCATTACAGTACAACGAGGAACACTCACACACCACATAATCAATATAAAACCCCCCTTCACACGAGAAAACATATTAATATTCATACACCTCGC [...]
+        <sequence id="seq_M_sylvanus" taxon="M_sylvanus" totalcount="4" value="AAGCTTCTCCGGTGCAACTATCCTTATAGTTGCCCATGGACTCACCTCTTCCATATACTTCTGCTTGGCCAACTCAAACTACGAACGCACCCACAGCCGCATCATACTACTATCCCGAGGACTCCAAATCCTACTCCCACTAACAGCCTTCTGATGATTCACAGCAAGCCTTACTAATCTTGCTCTACCCTCCACTATTAATCTACTGGGCGAACTCTTCGTAATCGCAACCTCATTTTCCTGATCCCACATCACCATCATACTAACAGGACTGAACATACTAATTACAGCCCTCTACTCTCTTCACATATTCACCACAACACAACGAGGAGCGCTCACACACCACATAATTAACATAAAACCACCTTTCACACGAGAAAACATATTAATACTCATACACCTCGCTCCAATTA [...]
+        <sequence id="seq_Saimiri_sciureus" taxon="Saimiri_sciureus" totalcount="4" value="AAGCTTCACCGGCGCAATGATCCTAATAATCGCTCACGGGTTTACTTCGTCTATGCTATTCTGCCTAGCAAACTCAAATTACGAACGAATTCACAGCCGAACAATAACATTTACTCGAGGGCTCCAAACACTATTCCCGCTTATAGGCCTCTGATGACTCCTAGCAAATCTCGCTAACCTCGCCCTACCCACAGCTATTAATCTAGTAGGAGAATTACTCACAATCGTATCTTCCTTCTCTTGATCCAACTTTACTATTATATTCACAGGACTTAATATACTAATTACAGCACTCTACTCACTTCATATGTATGCCTCTACACAGCGAGGTCCACTTACATACAGCACCAGCAATATAAAACCAATATTTACACGAGAAAATACGCTAATATTTATACATA [...]
+   </data>
+
+    <distribution id="posterior" spec="util.CompoundDistribution">
+        <distribution id="prior" spec="util.CompoundDistribution">
+            <distribution id="coalescent" populationModel="@ConstantPopulation" spec="Coalescent">
+                <treeIntervals id="TreeIntervals" spec="TreeIntervals" tree="@tree"/>
+            </distribution>
+            <distribution id="tipDates" monophyletic="false" spec="beast.math.distributions.MRCAPrior" tipsonly="true" tree="@tree">
+                <taxonset id="TaxonSet0" spec="beast.evolution.alignment.TaxonSet">
+                    <taxon id="Lemur_catta" spec="beast.evolution.alignment.Taxon"/>
+                    <taxon id="M_fascicularis" spec="beast.evolution.alignment.Taxon"/>
+                </taxonset>
+                <distr id="Uniform0" lower="0.0" offset="0.0" spec="beast.math.distributions.Uniform" upper="1.0"/>
+            </distribution>
+
+            <distribution id="kappa.prior" spec="beast.math.distributions.Prior" x="@hky.kappa">
+                <distr id="OneOnX0" offset="0.0" spec="beast.math.distributions.OneOnX"/>
+            </distribution>
+        </distribution>
+        <distribution id="likelihood" spec="util.CompoundDistribution">
+            <distribution data="@Primates" id="treeLikelihood" spec="TreeLikelihood" tree="@tree" useAmbiguities="false">
+                <siteModel gammaCategoryCount="0" id="siteModel" spec="SiteModel">
+                    <parameter dimension="1" estimate="false" id="mutationRate" name="mutationRate" value="1.0"/>
+                    <parameter dimension="1" estimate="false" id="gammaShape" name="shape" value="1.0"/>
+                    <parameter dimension="1" estimate="false" id="proportionInvariant" lower="0.0" name="proportionInvariant" upper="1.0" value="0.0"/>
+                    <substModel id="hky" kappa="@hky.kappa" spec="HKY">
+                        <frequencies estimate="true" frequencies="@freqParameter" id="freqs" spec="Frequencies"/>
+                    </substModel>
+                </siteModel>
+                <branchRateModel id="StrictClockModel" spec="beast.evolution.branchratemodel.StrictClockModel">
+                    <parameter dimension="1" estimate="false" id="clockRate" name="clock.rate" value="1.0"/>
+                </branchRateModel>
+            </distribution>
+        </distribution>
+    </distribution>
+
+    
+<run chainLength="10000000" id="mcmc" preBurnin="0" spec="MCMC" storeEvery="-1">
+
+    <init estimate="false" id="RandomTree" initial="@tree" spec="beast.evolution.tree.RandomTree">
+        <data idref="Primates" name="taxa"/>
+        <populationModel id="ConstantPopulation" spec="ConstantPopulation">
+            <parameter dimension="1" estimate="false" id="popSize" name="popSize" value="1.0"/>
+        </populationModel>
+    </init>
+
+    <state id="State0" storeEvery="100000">
+        <parameter dimension="4" estimate="true" id="freqParameter" name="stateNode" value="0.25"/>
+        <tree estimate="true" id="tree" name="stateNode">
+                <trait id="datetrait" spec="beast.evolution.tree.TraitSet" traitname="date" units="year">
+Lemur_catta=1,
+M_fascicularis=1
+					<taxa spec='beast.evolution.alignment.TaxonSet' alignment='@Primates'/>
+                </trait>
+        </tree>
+        <parameter dimension="1" estimate="true" id="hky.kappa" lower="0.0" name="stateNode" value="1.0"/>
+    </state>
+
+    <distribution idref="posterior"/>
+
+    <operator id="TipDatesRandomWalker" windowSize="1" spec="TipDatesRandomWalker" taxonset="@TaxonSet0" tree="@tree" weight="1.0"/>
+
+    <operator degreesOfFreedom="1" id="treeScaler" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.5" spec="ScaleOperator" tree="@tree" weight="1.0"/>
+    <operator id="Uniform2" spec="Uniform" tree="@tree" weight="10.0"/>
+    <operator degreesOfFreedom="1" id="kappaScaler" parameter="@hky.kappa" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.5" spec="ScaleOperator" weight="1.0"/>
+    <operator gaussian="true" id="SubtreeSlide0" size="1.0" spec="SubtreeSlide" tree="@tree" weight="5.0"/>
+    <operator id="wide" isNarrow="false" spec="Exchange" tree="@tree" weight="1.0"/>
+    <operator id="WilsonBalding0" spec="WilsonBalding" tree="@tree" weight="1.0"/>
+    <operator autoOptimize="true" delta="0.01" id="FrequenciesExchanger" integer="false" parameter="@freqParameter" spec="DeltaExchangeOperator" weight="0.1"/>
+    <operator id="narrow" isNarrow="true" spec="Exchange" tree="@tree" weight="1.0"/>
+
+    <logger fileName="beast_$(seed).log" id="tracelog" logEvery="10000" mode="autodetect" model="@posterior">
+        <log idref="likelihood"/>
+        <log idref="hky.kappa"/>
+        <log id="TreeHeightLogger0" spec="beast.evolution.tree.TreeHeightLogger" tree="@tree"/>
+        <log idref="freqParameter"/>
+        <log spec='beast.math.distributions.MRCAPrior' tree='@tree' id='TipDatesLogger' taxonset='@TaxonSet0' tipsonly='true'/>
+        <log spec='beast.math.distributions.MRCAPrior' tree='@tree' id='TipDatesLogger2' tipsonly='true'/>
+    </logger>
+
+    <logger fileName="beast_$(seed).trees" id="treelog" logEvery="10000" mode="autodetect">
+        <tree idref="tree" name="log"/>
+    </logger>
+
+    <logger id="screenlog" logEvery="10000" mode="autodetect" model="@posterior">
+        <distribution idref="likelihood" name="log"/>
+        <log arg="@likelihood" id="ESS0" spec="util.ESS"/>
+        <parameter idref="hky.kappa" name="log"/>
+        <log arg="@hky.kappa" id="ESS1" spec="util.ESS"/>
+    </logger>
+
+</run>
+
+
+
+</beast>
diff --git a/examples/testTwoCalibrationsPrior.xml b/examples/testTwoCalibrationsPrior.xml
new file mode 100644
index 0000000..680b20e
--- /dev/null
+++ b/examples/testTwoCalibrationsPrior.xml
@@ -0,0 +1,91 @@
+<?xml version="1.0" standalone="yes"?>
+<beast version='2.0'
+       namespace='beast.evolution.alignment:beast.evolution.speciation:beast.core:beast.evolution.tree.coalescent:beast.util:beast.core.util:beast.evolution.likelihood:beast.math.distributions:beast.evolution.operators'>
+
+    <!-- for Figure 9.1 in BEAST2 book -->
+
+    <taxonset spec='TaxonSet' id='taxa'>
+        <taxon spec='Taxon' id='1'/>
+        <taxon spec='Taxon' id='2'/>
+        <taxon spec='Taxon' id='3'/>
+        <taxon spec='Taxon' id='4'/>
+    </taxonset>
+
+    <data id="alignment" dataType="nucleotide">
+        <sequence taxon="1">A</sequence>
+        <sequence taxon="2">A</sequence>
+        <sequence taxon="3">A</sequence>
+        <sequence taxon="4">A</sequence>
+    </data>
+
+    <distr id="Uniform.0" lower="0.0" offset="0.0" spec="beast.math.distributions.Uniform" upper="Infinity"/>
+
+
+    <input spec='YuleModel' id="yule">
+        <parameter name='birthDiffRate' id="birthRate" value="1"/>
+        <tree spec='TreeParser' id='tree' taxa='@alignment'
+              newick='(((1:1.0,2:1.0):1.0,3:2.0):1.0,4:3.0);'/>
+    </input>
+
+    <distribution id='mrcaPrior1' spec='beast.math.distributions.MRCAPrior' tree='@tree' monophyletic='true'>
+        <taxonset spec='TaxonSet' id='all'>
+            <!--
+            -->
+            <taxon idref='1'/>
+            <taxon idref='2'/>
+            <taxon idref='3'/>
+            <taxon idref='4'/>
+        </taxonset>
+        <distr id='uniformPrior' spec='beast.math.distributions.Uniform' lower="0.0" upper="10.0"/>
+    </distribution>
+
+    <distribution id='mrcaPrior2' spec='beast.math.distributions.MRCAPrior' tree='@tree' monophyletic='true'>
+        <taxonset spec='TaxonSet' id='ingroup'>
+            <taxon idref='1'/>
+            <taxon idref='2'/>
+            <taxon idref='3'/>
+
+        </taxonset>
+        <distr id='logNormalDistribution' spec='beast.math.distributions.LogNormalDistributionModel'>
+            <!-- lognormal distribution(2.19,0.115) -->
+            <parameter name='M' value='2.19'/>
+            <parameter name='S' value='0.115'/>
+        </distr>
+    </distribution>
+
+
+    <run spec="MCMC" id="mcmc" chainLength="1000000">
+
+        <state>
+            <stateNode idref='tree'/>
+            <stateNode idref="birthRate"/>
+        </state>
+
+        <distribution spec='CompoundDistribution' id='posterior'>
+            <distribution id="yule.prior" idref='yule'/>
+            <distribution idref="mrcaPrior1"/>
+            <distribution idref="mrcaPrior2"/>
+        </distribution>
+
+        <operator spec='SubtreeSlide' weight="4" gaussian="true" size="2.5" tree="@tree"/>
+        <operator spec="ScaleOperator" weight="1" scaleFactor="0.25">
+            <parameter idref="birthRate"/>
+        </operator>
+
+        <logger logEvery="100" fileName="test_two_calibrations.$(seed).log">
+            <model idref='posterior'/>
+            <log idref="posterior"/>
+            <log idref="yule"/>
+            <log spec='beast.math.distributions.MRCAPrior' tree='@tree' id='all.age' taxonset='@all' />
+            <log spec='beast.math.distributions.MRCAPrior' tree='@tree' id='ingroup.age' taxonset='@ingroup' />
+
+        </logger>
+        <logger logEvery="100" fileName="test_two_calibrations.$(seed).trees">
+            <log idref="tree"/>
+        </logger>
+        <logger logEvery="100">
+            <model idref='posterior'/>
+            <log idref="yule"/>
+        </logger>
+    </run>
+</beast>
diff --git a/examples/testYuleCalibrated.xml b/examples/testYuleCalibrated.xml
new file mode 100644
index 0000000..75618db
--- /dev/null
+++ b/examples/testYuleCalibrated.xml
@@ -0,0 +1,151 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><beast namespace="beast.core:beast.evolution.alignment:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood" version="2.0">
+
+
+    <data dataType="nucleotide" id="alignment" name="alignment" strip="false">
+                    <sequence id="Sequence.0" taxon="human" totalcount="4" value="            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACC [...]
+                    <sequence id="Sequence.01" taxon="chimp" totalcount="4" value="            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACAC [...]
+                    <sequence id="Sequence.02" taxon="bonobo" totalcount="4" value="            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACA [...]
+                    <sequence id="Sequence.03" taxon="gorilla" totalcount="4" value="            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTAAACATAGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA-CAACACTTAATTTCTGTAAGGACTGCAAAACCCTACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCAATGGGACTCAAACCCACAAACATTTAGTTAACAGCTAAAC [...]
+                    <sequence id="Sequence.04" taxon="orangutan" totalcount="4" value="            AGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA-CAGCACTTAATTTCTGTAAGGACTGCAAAACCCCACTTTGCATCAACTGAGCGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCCTAGACCGATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAA [...]
+                    <sequence id="Sequence.05" taxon="siamang" totalcount="4" value="            AGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTAACAAAACTTAATTTCTGCAAGGGCTGCAAAACCCTACTTTGCATCAACCGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCGATGGGACTTAAACCCATAAAAATTTAGTTAACAGCTAAAC [...]
+                </data>
+
+
+    
+
+
+    <distribution id="posterior" ignore="false" spec="util.CompoundDistribution" useThreads="false">
+        <distribution id="prior" ignore="false" spec="util.CompoundDistribution" useThreads="false">
+            <distribution birthRate="@birthRateY.t:alignment" id="CalibratedYuleModel.t:alignment"
+                          spec="beast.evolution.speciation.CalibratedYuleModel" tree="@Tree.t:alignment" type="full"/>
+            <distribution id="CalibratedYuleBirthRatePrior.t:alignment" spec="beast.math.distributions.Prior" x="@birthRateY.t:alignment">
+                <distr id="Uniform.0" lower="0.0" offset="0.0" spec="beast.math.distributions.Uniform" upper="1000.0"/>
+            </distribution>
+            <distribution id="ClockPrior.c:alignment" spec="beast.math.distributions.Prior" x="@clockRate.c:alignment">
+                <distr id="Uniform.01" lower="0.0" offset="0.0" spec="beast.math.distributions.Uniform" upper="Infinity"/>
+            </distribution>
+            <distribution id="KappaPrior.s:alignment" spec="beast.math.distributions.Prior" x="@kappa.s:alignment">
+                <distr id="LogNormalDistributionModel.0" meanInRealSpace="true" offset="0.0" spec="beast.math.distributions.LogNormalDistributionModel">
+                    <parameter dimension="1" estimate="false" id="RealParameter.0" minordimension="1" name="M" value="1.0"/>
+                    <parameter dimension="1" estimate="false" id="RealParameter.01" minordimension="1" name="S" value="1.25"/>
+                </distr>
+            </distribution>
+            <distribution id="chimpgroup.prior" monophyletic="true" spec="beast.math.distributions.MRCAPrior" tipsonly="false" tree="@Tree.t:alignment">
+                <taxonset id="chimpgroup" spec="TaxonSet">
+                    <taxon id="bonobo" spec="Taxon"/>
+                    <taxon id="chimp" spec="Taxon"/>
+                    <taxon id="human" spec="Taxon"/>
+                </taxonset>
+                <distr id="LogNormalDistributionModel.01" meanInRealSpace="true" offset="0.0" spec="beast.math.distributions.LogNormalDistributionModel">
+                    <parameter dimension="1" estimate="false" id="RealParameter.02" minordimension="1" name="M" value="6"/>
+                    <parameter dimension="1" estimate="false" id="RealParameter.03" lower="0.0" minordimension="1" name="S" upper="5.0" value="0.25"/>
+                </distr>
+            </distribution>
+        </distribution>
+        <distribution id="likelihood" ignore="false" spec="util.CompoundDistribution" useThreads="false">
+            <distribution data="@alignment" id="treeLikelihood.alignment" scaling="_default" spec="TreeLikelihood" tree="@Tree.t:alignment" useAmbiguities="false">
+                <siteModel gammaCategoryCount="0" id="SiteModel.s:alignment" spec="SiteModel">
+                    <parameter dimension="1" estimate="false" id="mutationRate.s:alignment" minordimension="1" name="mutationRate" value="1.0"/>
+                    <parameter dimension="1" estimate="false" id="gammaShape.s:alignment" minordimension="1" name="shape" value="1.0"/>
+                    <parameter dimension="1" estimate="false" id="proportionInvariant.s:alignment" lower="0.0" minordimension="1" name="proportionInvariant" upper="1.0" value="0.0"/>
+                    <substModel id="hky.s:alignment" kappa="@kappa.s:alignment" spec="HKY">
+                        <frequencies estimate="true" frequencies="@freqParameter.s:alignment" id="estimatedFreqs.s:alignment" spec="Frequencies"/>
+                    </substModel>
+                </siteModel>
+                <branchRateModel clock.rate="@clockRate.c:alignment" id="StrictClock.c:alignment" spec="beast.evolution.branchratemodel.StrictClockModel"/>
+            </distribution>
+        </distribution>
+    </distribution>
+
+
+    
+<run chainLength="10000000" id="mcmc" preBurnin="0" sampleFromPrior="false" spec="MCMC" storeEvery="-1">
+    <state id="state" storeEvery="1000">
+        <tree estimate="true" id="Tree.t:alignment" name="stateNode">
+            <taxonset id="TaxonSet.alignment" spec="TaxonSet">
+                <data idref="alignment" name="alignment"/>
+            </taxonset>
+        </tree>
+        <parameter dimension="1" estimate="true" id="kappa.s:alignment" lower="0.0" minordimension="1" name="stateNode" value="2.0"/>
+        <parameter dimension="1" estimate="true" id="birthRateY.t:alignment" minordimension="1" name="stateNode" value="1.0"/>
+        <parameter dimension="1" estimate="true" id="clockRate.c:alignment" minordimension="1" name="stateNode" value="1.0"/>
+        <parameter dimension="4" estimate="true" id="freqParameter.s:alignment" lower="0.0" minordimension="1" name="stateNode" upper="1.0" value="0.25"/>
+    </state>
+
+    <distribution idref="posterior"/>
+
+    <operator id="allTipDatesRandomWalker.t:alignment" spec="TipDatesRandomWalker" tree="@Tree.t:alignment" useGaussian="false" weight="0.0" windowSize="1.0"/>
+
+    <operator degreesOfFreedom="1" id="treeScaler.t:alignment" optimise="true" rootOnly="false" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.5" spec="ScaleOperator" tree="@Tree.t:alignment" weight="3.0"/>
+
+    <operator degreesOfFreedom="1" id="treeRootScaler.t:alignment" optimise="true" rootOnly="true" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.5" spec="ScaleOperator" tree="@Tree.t:alignment" weight="3.0"/>
+
+    <operator id="UniformOperator.t:alignment" spec="Uniform" tree="@Tree.t:alignment" weight="30.0"/>
+
+    <operator gaussian="true" id="SubtreeSlide.t:alignment" optimise="true" size="1.0" spec="SubtreeSlide" tree="@Tree.t:alignment" weight="15.0"/>
+
+    <operator id="narrow.t:alignment" isNarrow="true" spec="Exchange" tree="@Tree.t:alignment" weight="15.0"/>
+
+    <operator id="wide.t:alignment" isNarrow="false" spec="Exchange" tree="@Tree.t:alignment" weight="3.0"/>
+
+    <operator id="WilsonBalding.t:alignment" spec="WilsonBalding" tree="@Tree.t:alignment" weight="3.0"/>
+
+    <operator degreesOfFreedom="1" id="KappaScaler.s:alignment" optimise="true" parameter="@kappa.s:alignment" rootOnly="false" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.5" spec="ScaleOperator" weight="0.1"/>
+
+    <operator degreesOfFreedom="1" id="CalibratedYuleBirthRateScaler.t:alignment" optimise="true" parameter="@birthRateY.t:alignment" rootOnly="false" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.75" spec="ScaleOperator" weight="3.0"/>
+
+    <operator degreesOfFreedom="1" id="StrictClockRateScaler.c:alignment" optimise="true" parameter="@clockRate.c:alignment" rootOnly="false" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.75" spec="ScaleOperator" weight="3.0"/>
+
+    <operator id="strictClockUpDownOperator.c:alignment" optimise="true" scaleFactor="0.75" spec="UpDownOperator" weight="3.0">
+        <parameter idref="clockRate.c:alignment" name="up"/>
+        <tree idref="Tree.t:alignment" name="down"/>
+    </operator>
+
+    <operator autoOptimize="true" delta="0.01" id="FrequenciesExchanger.s:alignment" integer="false" spec="DeltaExchangeOperator" weight="0.1">
+        <parameter idref="freqParameter.s:alignment"/>
+    </operator>
+
+    <logger fileName="ape.calyule.$(seed).log" id="tracelog" logEvery="1000" mode="autodetect" model="@posterior" sanitiseHeaders="true" sort="smart">
+        <distribution idref="posterior" name="log"/>
+        <distribution idref="likelihood" name="log"/>
+        <distribution idref="prior" name="log"/>
+        <distribution idref="treeLikelihood.alignment" name="log"/>
+        <log id="TreeHeight.t:alignment" spec="beast.evolution.tree.TreeHeightLogger" tree="@Tree.t:alignment"/>
+        <parameter idref="kappa.s:alignment" name="log"/>
+        <distribution idref="CalibratedYuleModel.t:alignment" name="log"/>
+        <parameter idref="birthRateY.t:alignment" name="log"/>
+        <distribution idref="chimpgroup.prior" name="log"/>
+        <parameter idref="clockRate.c:alignment" name="log"/>
+        <parameter idref="freqParameter.s:alignment" name="log"/>
+    </logger>
+
+    <logger id="screenlog" logEvery="1000" mode="autodetect" sanitiseHeaders="false" sort="none">
+        <distribution idref="posterior" name="log"/>
+        <log arg="@posterior" id="ESS.0" spec="util.ESS"/>
+        <distribution idref="likelihood" name="log"/>
+        <distribution idref="prior" name="log"/>
+    </logger>
+
+    <logger fileName="ape.calyule.$(seed).trees" id="treelog.t:alignment" logEvery="1000" mode="tree" sanitiseHeaders="false" sort="none">
+        <log id="TreeWithMetaDataLogger.t:alignment" spec="beast.evolution.tree.TreeWithMetaDataLogger" tree="@Tree.t:alignment"/>
+    </logger>
+
+    <tree estimate="false" id="RandomTree.t:alignment" initial="@Tree.t:alignment" name="init" spec="beast.evolution.tree.RandomTree" taxa="@alignment">
+        <populationModel id="ConstantPopulation0.t:alignment" spec="ConstantPopulation">
+            <parameter dimension="1" estimate="true" id="randomPopSize.t:alignment" minordimension="1" name="popSize" value="1"/>
+        </populationModel>
+    </tree>
+
+    <operatorschedule autoOptimize="true" autoOptimizeDelay="10000" id="OperatorSchedule.0" spec="OperatorSchedule" transform="none"/>
+
+</run>
+
+
+
+<!-- DO NOT EDIT the following machine generated text, they are used in Beauti 
+
+
+
+-->
+
+</beast>
diff --git a/examples/testYuleOneSite.xml b/examples/testYuleOneSite.xml
new file mode 100644
index 0000000..ecb1909
--- /dev/null
+++ b/examples/testYuleOneSite.xml
@@ -0,0 +1,90 @@
+<?xml version="1.0" standalone="yes"?>
+<!-- test Yule birth model and Birth Death model per Gernhard 2008-->
+<beast version='2.0'
+       namespace='beast.evolution.speciation:beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood'>
+
+    <data id="alignment" dataType="nucleotide">
+        <sequence taxon="A">A</sequence>
+        <sequence taxon="B">A</sequence>
+        <sequence taxon="C">A</sequence>
+        <sequence taxon="D">A</sequence>
+    </data>
+    
+    <!-- A prior on the distribution node heights defined given                  -->
+    <!-- a Yule speciation process (a pure birth process).                       -->
+    <input spec='YuleModel' id="yule">
+        <parameter name='birthDiffRate' idref="birthRate"/>
+	<tree spec='TreeParser' id='tree' IsLabelledNewick='true' taxa='@alignment'
+	        newick='((A:1.0,B:1.0):1.0,(C:1.0,D:1.0):1.0);'/>
+    </input>
+
+    <input spec='BirthDeathGernhard08Model' id="yulelike" type='unscaled' tree='@tree'>
+        <parameter name='birthDiffRate' idref="birthRate"/>
+	    <parameter name='relativeDeathRate' idref='relativeDeathRate'/>
+    </input>
+
+    <!-- site model                                                              -->
+    <input spec='SiteModel' id="siteModel" gammaCategoryCount='1'>
+	<substModel spec='HKY' id='hky'>
+	    <kappa id='hky.kappa' spec='parameter.RealParameter' value='1.0'/>
+	    <frequencies id='freqs' spec='Frequencies'>
+	       <data idref='alignment'/>
+	    </frequencies>
+	</substModel>
+    </input>
+
+    <parameter id="birthRate" value="1.0" lower="0.0" upper="100.0"/>
+    <parameter id='relativeDeathRate' value='0'/>
+
+    <!-- initial yule prior = -6.0, yule-like prior = -2.8219461696520542 -->
+    <!-- expected yule prior = 1/(n.lambda)\sum_{k=1}^{n-1}k/(n-k) where lambda = birth rate, n = number of taxa
+	with lambda=1, n=-4 we expect 1/4(1/3+2/2+3/1)=1.155555555
+ -->
+    <run spec='MCMC' chainLength="10">
+	<state>
+	    <stateNode idref='tree'/>
+	    <stateNode idref='birthRate'/>
+	    <stateNode id='tree-test-single-child-parsing' IsLabelledNewick='true' spec='beast.util.TreeParser' singlechild='true' newick='((A:1.0):2,C:3);' >
+			<taxonset spec='beast.evolution.alignment.TaxonSet'>
+				<taxon spec='beast.evolution.alignment.Taxon' id='A'/>
+				<taxon spec='beast.evolution.alignment.Taxon' id='C'/>
+			</taxonset>
+		</stateNode>
+	</state>
+
+	<distribution spec='CompoundDistribution'>
+	        <distribution id="yule.prior" idref='yule'/>
+<!--
+		<distribution spec='TreeLikelihood' id="treeLikelihood" data='@alignment' tree='@tree' siteModel='@siteModel'/>
+-->
+	        <distribution id="yulelike.prior" idref='yulelike'/>
+	</distribution>
+
+        <operator spec='SubtreeSlide' weight="5" gaussian="true" size="1.0" tree="@tree"/>
+<!--
+        <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.5" weight="1" tree="@tree"/>
+-->
+        <operator spec='Uniform' weight="10" tree="@tree"/>
+        <operator id='narrow' spec='Exchange' isNarrow='true' weight="1" tree="@tree"/>
+        <operator id='wide' spec='Exchange' isNarrow='false' weight="1" tree="@tree"/>
+        <operator spec='WilsonBalding' weight="1" tree="@tree"/>
+<!--
+        <operator spec='ScaleOperator' scaleFactor="0.75" weight="3">
+            <parameter idref="birthRate"/>
+        </operator>
+-->
+	<logger logEvery='100'>
+	    <log idref='yule.prior'/>
+	    <!--log idref='treeLikelihood'/-->
+	    <log idref='yulelike.prior'/>
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+	</logger>
+	<logger logEvery='100' fileName='$(seed).log'>
+	    <log idref='yule.prior'/>
+	    <!--log idref='treeLikelihood'/-->
+	    <!--log idref='yulelike.prior'/-->
+            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>
+	</logger>
+    </run>
+
+</beast>
diff --git a/examples/testYuleUncalibrated.xml b/examples/testYuleUncalibrated.xml
new file mode 100644
index 0000000..a1154f1
--- /dev/null
+++ b/examples/testYuleUncalibrated.xml
@@ -0,0 +1,150 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><beast namespace="beast.core:beast.evolution.alignment:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood" version="2.0">
+
+
+    <data dataType="nucleotide" id="alignment" name="alignment" strip="false">
+                    <sequence id="Sequence.0" taxon="human" totalcount="4" value="            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACC [...]
+                    <sequence id="Sequence.01" taxon="chimp" totalcount="4" value="            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACAC [...]
+                    <sequence id="Sequence.02" taxon="bonobo" totalcount="4" value="            AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACA [...]
+                    <sequence id="Sequence.03" taxon="gorilla" totalcount="4" value="            AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTAAACATAGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA-CAACACTTAATTTCTGTAAGGACTGCAAAACCCTACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCAATGGGACTCAAACCCACAAACATTTAGTTAACAGCTAAAC [...]
+                    <sequence id="Sequence.04" taxon="orangutan" totalcount="4" value="            AGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA-CAGCACTTAATTTCTGTAAGGACTGCAAAACCCCACTTTGCATCAACTGAGCGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCCTAGACCGATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAA [...]
+                    <sequence id="Sequence.05" taxon="siamang" totalcount="4" value="            AGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTAACAAAACTTAATTTCTGCAAGGGCTGCAAAACCCTACTTTGCATCAACCGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCGATGGGACTTAAACCCATAAAAATTTAGTTAACAGCTAAAC [...]
+                </data>
+
+
+    
+
+
+    <distribution id="posterior" ignore="false" spec="util.CompoundDistribution" useThreads="false">
+        <distribution id="prior" ignore="false" spec="util.CompoundDistribution" useThreads="false">
+            <distribution birthDiffRate="@birthRate.t:alignment" conditionalOnRoot="false" id="YuleModel.t:alignment" spec="beast.evolution.speciation.YuleModel" tree="@Tree.t:alignment"/>
+            <distribution id="YuleBirthRatePrior.t:alignment" spec="beast.math.distributions.Prior" x="@birthRate.t:alignment">
+                <distr id="Uniform.0" lower="0.0" offset="0.0" spec="beast.math.distributions.Uniform" upper="Infinity"/>
+            </distribution>
+            <distribution id="ClockPrior.c:alignment" spec="beast.math.distributions.Prior" x="@clockRate.c:alignment">
+                <distr id="Uniform.01" lower="0.0" offset="0.0" spec="beast.math.distributions.Uniform" upper="Infinity"/>
+            </distribution>
+            <distribution id="KappaPrior.s:alignment" spec="beast.math.distributions.Prior" x="@kappa.s:alignment">
+                <distr id="LogNormalDistributionModel.0" meanInRealSpace="true" offset="0.0" spec="beast.math.distributions.LogNormalDistributionModel">
+                    <parameter dimension="1" estimate="false" id="RealParameter.0" minordimension="1" name="M" value="1.0"/>
+                    <parameter dimension="1" estimate="false" id="RealParameter.01" minordimension="1" name="S" value="1.25"/>
+                </distr>
+            </distribution>
+            <distribution id="chimpgroup.prior" monophyletic="true" spec="beast.math.distributions.MRCAPrior" tipsonly="false" tree="@Tree.t:alignment">
+                <taxonset id="chimpgroup" spec="TaxonSet">
+                    <taxon id="bonobo" spec="Taxon"/>
+                    <taxon id="chimp" spec="Taxon"/>
+                    <taxon id="human" spec="Taxon"/>
+                </taxonset>
+                <distr id="LogNormalDistributionModel.01" meanInRealSpace="true" offset="0.0" spec="beast.math.distributions.LogNormalDistributionModel">
+                    <parameter dimension="1" estimate="false" id="RealParameter.02" minordimension="1" name="M" value="6"/>
+                    <parameter dimension="1" estimate="false" id="RealParameter.03" lower="0.0" minordimension="1" name="S" upper="5.0" value="0.25"/>
+                </distr>
+            </distribution>
+        </distribution>
+        <distribution id="likelihood" ignore="false" spec="util.CompoundDistribution" useThreads="false">
+            <distribution data="@alignment" id="treeLikelihood.alignment" scaling="_default" spec="TreeLikelihood" tree="@Tree.t:alignment" useAmbiguities="false">
+                <siteModel gammaCategoryCount="0" id="SiteModel.s:alignment" spec="SiteModel">
+                    <parameter dimension="1" estimate="false" id="mutationRate.s:alignment" minordimension="1" name="mutationRate" value="1.0"/>
+                    <parameter dimension="1" estimate="false" id="gammaShape.s:alignment" minordimension="1" name="shape" value="1.0"/>
+                    <parameter dimension="1" estimate="false" id="proportionInvariant.s:alignment" lower="0.0" minordimension="1" name="proportionInvariant" upper="1.0" value="0.0"/>
+                    <substModel id="hky.s:alignment" kappa="@kappa.s:alignment" spec="HKY">
+                        <frequencies estimate="true" frequencies="@freqParameter.s:alignment" id="estimatedFreqs.s:alignment" spec="Frequencies"/>
+                    </substModel>
+                </siteModel>
+                <branchRateModel clock.rate="@clockRate.c:alignment" id="StrictClock.c:alignment" spec="beast.evolution.branchratemodel.StrictClockModel"/>
+            </distribution>
+        </distribution>
+    </distribution>
+
+
+    
+<run chainLength="10000000" id="mcmc" preBurnin="0" sampleFromPrior="false" spec="MCMC" storeEvery="-1">
+    <state id="state" storeEvery="1000">
+        <tree estimate="true" id="Tree.t:alignment" name="stateNode">
+            <taxonset id="TaxonSet.alignment" spec="TaxonSet">
+                <data idref="alignment" name="alignment"/>
+            </taxonset>
+        </tree>
+        <parameter dimension="1" estimate="true" id="kappa.s:alignment" lower="0.0" minordimension="1" name="stateNode" value="2.0"/>
+        <parameter dimension="1" estimate="true" id="clockRate.c:alignment" minordimension="1" name="stateNode" value="1.0"/>
+        <parameter dimension="1" estimate="true" id="birthRate.t:alignment" minordimension="1" name="stateNode" value="1.0"/>
+        <parameter dimension="4" estimate="true" id="freqParameter.s:alignment" lower="0.0" minordimension="1" name="stateNode" upper="1.0" value="0.25"/>
+    </state>
+
+    <distribution idref="posterior"/>
+
+    <operator id="allTipDatesRandomWalker.t:alignment" spec="TipDatesRandomWalker" tree="@Tree.t:alignment" useGaussian="false" weight="0.0" windowSize="1.0"/>
+
+    <operator degreesOfFreedom="1" id="treeScaler.t:alignment" optimise="true" rootOnly="false" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.5" spec="ScaleOperator" tree="@Tree.t:alignment" weight="3.0"/>
+
+    <operator degreesOfFreedom="1" id="treeRootScaler.t:alignment" optimise="true" rootOnly="true" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.5" spec="ScaleOperator" tree="@Tree.t:alignment" weight="3.0"/>
+
+    <operator id="UniformOperator.t:alignment" spec="Uniform" tree="@Tree.t:alignment" weight="30.0"/>
+
+    <operator gaussian="true" id="SubtreeSlide.t:alignment" optimise="true" size="1.0" spec="SubtreeSlide" tree="@Tree.t:alignment" weight="15.0"/>
+
+    <operator id="narrow.t:alignment" isNarrow="true" spec="Exchange" tree="@Tree.t:alignment" weight="15.0"/>
+
+    <operator id="wide.t:alignment" isNarrow="false" spec="Exchange" tree="@Tree.t:alignment" weight="3.0"/>
+
+    <operator id="WilsonBalding.t:alignment" spec="WilsonBalding" tree="@Tree.t:alignment" weight="3.0"/>
+
+    <operator degreesOfFreedom="1" id="KappaScaler.s:alignment" optimise="true" parameter="@kappa.s:alignment" rootOnly="false" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.5" spec="ScaleOperator" weight="0.1"/>
+
+    <operator degreesOfFreedom="1" id="StrictClockRateScaler.c:alignment" optimise="true" parameter="@clockRate.c:alignment" rootOnly="false" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.75" spec="ScaleOperator" weight="3.0"/>
+
+    <operator id="strictClockUpDownOperator.c:alignment" optimise="true" scaleFactor="0.75" spec="UpDownOperator" weight="3.0">
+        <parameter idref="clockRate.c:alignment" name="up"/>
+        <tree idref="Tree.t:alignment" name="down"/>
+    </operator>
+
+    <operator degreesOfFreedom="1" id="YuleBirthRateScaler.t:alignment" optimise="true" parameter="@birthRate.t:alignment" rootOnly="false" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.75" spec="ScaleOperator" weight="3.0"/>
+
+    <operator autoOptimize="true" delta="0.01" id="FrequenciesExchanger.s:alignment" integer="false" spec="DeltaExchangeOperator" weight="0.1">
+        <parameter idref="freqParameter.s:alignment"/>
+    </operator>
+
+    <logger fileName="ape.yule.$(seed).log" id="tracelog" logEvery="1000" mode="autodetect" model="@posterior" sanitiseHeaders="true" sort="smart">
+        <distribution idref="posterior" name="log"/>
+        <distribution idref="likelihood" name="log"/>
+        <distribution idref="prior" name="log"/>
+        <distribution idref="treeLikelihood.alignment" name="log"/>
+        <log id="TreeHeight.t:alignment" spec="beast.evolution.tree.TreeHeightLogger" tree="@Tree.t:alignment"/>
+        <parameter idref="kappa.s:alignment" name="log"/>
+        <distribution idref="chimpgroup.prior" name="log"/>
+        <parameter idref="clockRate.c:alignment" name="log"/>
+        <distribution idref="YuleModel.t:alignment" name="log"/>
+        <parameter idref="birthRate.t:alignment" name="log"/>
+        <parameter idref="freqParameter.s:alignment" name="log"/>
+    </logger>
+
+    <logger id="screenlog" logEvery="1000" mode="autodetect" sanitiseHeaders="false" sort="none">
+        <distribution idref="posterior" name="log"/>
+        <log arg="@posterior" id="ESS.0" spec="util.ESS"/>
+        <distribution idref="likelihood" name="log"/>
+        <distribution idref="prior" name="log"/>
+    </logger>
+
+    <logger fileName="ape.yule.$(seed).trees" id="treelog.t:alignment" logEvery="1000" mode="tree" sanitiseHeaders="false" sort="none">
+        <log id="TreeWithMetaDataLogger.t:alignment" spec="beast.evolution.tree.TreeWithMetaDataLogger" tree="@Tree.t:alignment"/>
+    </logger>
+
+    <tree estimate="false" id="RandomTree.t:alignment" initial="@Tree.t:alignment" name="init" spec="beast.evolution.tree.RandomTree" taxa="@alignment">
+        <populationModel id="ConstantPopulation0.t:alignment" spec="ConstantPopulation">
+            <parameter dimension="1" estimate="true" id="randomPopSize.t:alignment" minordimension="1" name="popSize" value="1"/>
+        </populationModel>
+    </tree>
+
+    <operatorschedule autoOptimize="true" autoOptimizeDelay="10000" id="OperatorSchedule.0" spec="OperatorSchedule" transform="none"/>
+
+</run>
+
+
+
+<!-- DO NOT EDIT the following machine generated text, they are used in Beauti 
+
+
+
+-->
+
+</beast>
diff --git a/packages.xml b/packages.xml
new file mode 100644
index 0000000..15e46e8
--- /dev/null
+++ b/packages.xml
@@ -0,0 +1,71 @@
+<packages>
+    <!--names in alphabetic order-->
+
+    <package name='BDSKY' version='1.1.0'
+           url="http://bdssm-beast2.googlecode.com/files/BDSKY.addon.v1.1.0.zip"
+           description="birth death skyline -- handles serially sampled tips">
+        <depends on='beast2' atleast='2.1.0'/>
+    </package>
+
+    <package name='BEASTii' version='1.1.0'
+           url="http://beastii.googlecode.com/files/BEASTii.addon.v1.1.0.zip"
+           description="BEAST utilities, such as multi threaded treeliklihood">
+        <depends on='beast2' atleast='2.1.0'/>
+    </package>
+
+    <package name='BEAST_CLASSIC' version='1.1.2'
+           url="https://www.cs.auckland.ac.nz/~remco/BEASTBook/BEAST_CLASSIC.addon.v1.1.2.zip"
+           description="BEAST classes ported from BEAST 1 in wrappers" >
+        <depends on='beast2' atleast='2.1.0'/>
+        <depends on='BEASTii' atleast='1.1.0'/>
+    </package>
+
+    <package name='CA' version='1.0.0'
+           url="http://beastii.googlecode.com/files/CA.addon.v1.0.0.zip"
+           description="CladeAge package for fossil calibrations">
+        <depends on='beast2' atleast='2.1.0'/>
+    </package>
+
+    <package name='DISSECT' version='1.0.0'
+           url="http://www.indriid.com/2014/DISSECT.addon.v1.0.0.zip"
+           description="species delimitation with *BEAST">
+        <depends on='beast2' atleast='2.1.0'/>
+    </package>
+
+    <package name='phylodynamics' version='1.0.0'
+           url="http://bdssm-beast2.googlecode.com/files/phylodynamics.addon.zip"
+           description="birth death skyline model" >
+        <depends on='beast2' atleast='2.1.0'/>
+    </package>
+
+    <package name='MASTER' version='1.4.1'
+           url="https://github.com/CompEvol/MASTER/releases/download/v1.4.1/MASTER.addon.v1.4.1.zip"
+           description="stochastic simulation" >
+        <depends on='beast2' atleast='2.1.0'/>
+    </package>
+
+    <package name='RBS' version='1.1.0'
+           url="http://rb-beast.googlecode.com/files/RBS.addon.v1.1.0.zip"
+           description="Reversible-jump Based substitution model" >
+        <depends on='beast2' atleast='2.1.0'/>
+    </package>
+
+    <package name='SA' version='1.0.0'
+           url="http://beastii.googlecode.com/files/SA.addon.v1.0.0.zip"
+           description="Sampled ancestor trees" >
+        <depends on='beast2' atleast='2.1.0'/>
+    </package>
+
+    <package name='SNAPP' version='1.1.4'
+           url="https://www.cs.auckland.ac.nz/~remco/BEASTBook/SNAPP.addon.v1.1.4.zip"
+           description="SNP and AFLP Phylogenies" >
+        <depends on='beast2' atleast='2.1.0'/>
+    </package>
+
+    <package name='SubstBMA' version='1.1.0'
+           url="http://www.cs.auckland.ac.nz/~remco/BEASTBook/SubstBMA.addon.v1.1.0.zip"
+           description="Substitution Bayesian Model Averaging" >
+        <depends on='beast2' atleast='2.1.0'/>
+    </package>
+
+</packages>
diff --git a/release/Linux/bin/addonmanager b/release/Linux/bin/addonmanager
new file mode 100755
index 0000000..ab4b369
--- /dev/null
+++ b/release/Linux/bin/addonmanager
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+if [ -z "$BEAST" ]; then
+	## resolve links - $0 may be a link to application
+	PRG="$0"
+
+	# need this for relative symlinks
+	while [ -h "$PRG" ] ; do
+	    ls=`ls -ld "$PRG"`
+	    link=`expr "$ls" : '.*-> \(.*\)$'`
+	    if expr "$link" : '/.*' > /dev/null; then
+		PRG="$link"
+	    else
+		PRG="`dirname "$PRG"`/$link"
+	    fi
+	done
+
+	# make it fully qualified
+	saveddir=`pwd`
+	BEAST0=`dirname "$PRG"`/..
+	BEAST=`cd "$BEAST0" && pwd`
+	cd "$saveddir"
+fi
+
+BEAST_LIB="$BEAST/lib"
+
+if [ -z "$JAVA_HOME" ]; then
+  JAVA=java
+else
+  JAVA=$JAVA_HOME/bin/java
+fi
+$JAVA -Xms256m -Xmx1024m -Djava.library.path="$BEAST_LIB" -cp "$BEAST_LIB/beast.jar" beast.util.AddOnManager $*
+
diff --git a/release/Linux/bin/appstore b/release/Linux/bin/appstore
new file mode 100755
index 0000000..946a3b3
--- /dev/null
+++ b/release/Linux/bin/appstore
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+if [ -z "$BEAST" ]; then
+	## resolve links - $0 may be a link to application
+	PRG="$0"
+
+	# need this for relative symlinks
+	while [ -h "$PRG" ] ; do
+	    ls=`ls -ld "$PRG"`
+	    link=`expr "$ls" : '.*-> \(.*\)$'`
+	    if expr "$link" : '/.*' > /dev/null; then
+		PRG="$link"
+	    else
+		PRG="`dirname "$PRG"`/$link"
+	    fi
+	done
+
+	# make it fully qualified
+	saveddir=`pwd`
+	BEAST0=`dirname "$PRG"`/..
+	BEAST=`cd "$BEAST0" && pwd`
+	cd "$saveddir"
+fi
+
+BEAST_LIB="$BEAST/lib"
+
+if [ -z "$JAVA_HOME" ]; then
+  JAVA=java
+else
+  JAVA=$JAVA_HOME/bin/java
+fi
+$JAVA -Xms256m -Xmx1024m -Djava.library.path="$BEAST_LIB" -cp "$BEAST_LIB/launcher.jar" beast.app.tools.AppStoreLauncher $*
+
diff --git a/release/Linux/bin/beast b/release/Linux/bin/beast
new file mode 100755
index 0000000..5ed9bef
--- /dev/null
+++ b/release/Linux/bin/beast
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+if [ -z "$BEAST" ]; then
+	## resolve links - $0 may be a link to application
+	PRG="$0"
+
+	# need this for relative symlinks
+	while [ -h "$PRG" ] ; do
+	    ls=`ls -ld "$PRG"`
+	    link=`expr "$ls" : '.*-> \(.*\)$'`
+	    if expr "$link" : '/.*' > /dev/null; then
+		PRG="$link"
+	    else
+		PRG="`dirname "$PRG"`/$link"
+	    fi
+	done
+
+	# make it fully qualified
+	saveddir=`pwd`
+	BEAST0=`dirname "$PRG"`/..
+	BEAST=`cd "$BEAST0" && pwd`
+	cd "$saveddir"
+fi
+
+BEAST_LIB="$BEAST/lib"
+
+if [ -z "$JAVA_HOME" ]; then
+  JAVA=java
+else
+  JAVA=$JAVA_HOME/bin/java
+fi
+$JAVA -Xms64m -Xmx4g -Djava.library.path="$BEAST_LIB:/usr/local/lib" -cp "$BEAST_LIB/launcher.jar" beast.app.beastapp.BeastLauncher $*
diff --git a/release/Linux/bin/beauti b/release/Linux/bin/beauti
new file mode 100755
index 0000000..e4f519c
--- /dev/null
+++ b/release/Linux/bin/beauti
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+if [ -z "$BEAST" ]; then
+	## resolve links - $0 may be a link to application
+	PRG="$0"
+
+	# need this for relative symlinks
+	while [ -h "$PRG" ] ; do
+	    ls=`ls -ld "$PRG"`
+	    link=`expr "$ls" : '.*-> \(.*\)$'`
+	    if expr "$link" : '/.*' > /dev/null; then
+		PRG="$link"
+	    else
+		PRG="`dirname "$PRG"`/$link"
+	    fi
+	done
+
+	# make it fully qualified
+	saveddir=`pwd`
+	BEAST0=`dirname "$PRG"`/..
+	BEAST=`cd "$BEAST0" && pwd`
+	cd "$saveddir"
+fi
+
+BEAST_LIB="$BEAST/lib"
+
+if [ -z "$JAVA_HOME" ]; then
+  JAVA=java
+else
+  JAVA=$JAVA_HOME/bin/java
+fi
+$JAVA -Xms256m -Xmx4g -Djava.library.path="$BEAST_LIB" -cp "$BEAST_LIB/launcher.jar" beast.app.beauti.BeautiLauncher -capture $*
+
diff --git a/release/Linux/bin/densitree b/release/Linux/bin/densitree
new file mode 100755
index 0000000..23a2a47
--- /dev/null
+++ b/release/Linux/bin/densitree
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+if [ -z "$BEAST" ]; then
+	## resolve links - $0 may be a link to application
+	PRG="$0"
+
+	# need this for relative symlinks
+	while [ -h "$PRG" ] ; do
+	    ls=`ls -ld "$PRG"`
+	    link=`expr "$ls" : '.*-> \(.*\)$'`
+	    if expr "$link" : '/.*' > /dev/null; then
+		PRG="$link"
+	    else
+		PRG="`dirname "$PRG"`/$link"
+	    fi
+	done
+
+	# make it fully qualified
+	saveddir=`pwd`
+	BEAST0=`dirname "$PRG"`/..
+	BEAST=`cd "$BEAST0" && pwd`
+	cd "$saveddir"
+fi
+
+BEAST_LIB="$BEAST/lib"
+
+if [ -z "$JAVA_HOME" ]; then
+  JAVA=java
+else
+  JAVA=$JAVA_HOME/bin/java
+fi
+$JAVA -Xms256m -Xmx4g -Djava.library.path="$BEAST_LIB" -cp "$BEAST_LIB/DensiTree.jar" viz.DensiTree $*
+
diff --git a/release/Linux/bin/logcombiner b/release/Linux/bin/logcombiner
new file mode 100755
index 0000000..3676d83
--- /dev/null
+++ b/release/Linux/bin/logcombiner
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+if [ -z "$BEAST" ]; then
+	## resolve links - $0 may be a link to application
+	PRG="$0"
+
+	# need this for relative symlinks
+	while [ -h "$PRG" ] ; do
+	    ls=`ls -ld "$PRG"`
+	    link=`expr "$ls" : '.*-> \(.*\)$'`
+	    if expr "$link" : '/.*' > /dev/null; then
+		PRG="$link"
+	    else
+		PRG="`dirname "$PRG"`/$link"
+	    fi
+	done
+
+	# make it fully qualified
+	saveddir=`pwd`
+	BEAST0=`dirname "$PRG"`/..
+	BEAST=`cd "$BEAST0" && pwd`
+	cd "$saveddir"
+fi
+
+BEAST_LIB="$BEAST/lib"
+
+if [ -z "$JAVA_HOME" ]; then
+  JAVA=java
+else
+  JAVA=$JAVA_HOME/bin/java
+fi
+$JAVA -Xms256m -Xmx4g -Djava.library.path="$BEAST_LIB" -cp "$BEAST_LIB/launcher.jar" beast.app.tools.LogCombinerLauncher $*
+
diff --git a/release/Linux/bin/treeannotator b/release/Linux/bin/treeannotator
new file mode 100755
index 0000000..ce1e3ad
--- /dev/null
+++ b/release/Linux/bin/treeannotator
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+if [ -z "$BEAST" ]; then
+	## resolve links - $0 may be a link to application
+	PRG="$0"
+
+	# need this for relative symlinks
+	while [ -h "$PRG" ] ; do
+	    ls=`ls -ld "$PRG"`
+	    link=`expr "$ls" : '.*-> \(.*\)$'`
+	    if expr "$link" : '/.*' > /dev/null; then
+		PRG="$link"
+	    else
+		PRG="`dirname "$PRG"`/$link"
+	    fi
+	done
+
+	# make it fully qualified
+	saveddir=`pwd`
+	BEAST0=`dirname "$PRG"`/..
+	BEAST=`cd "$BEAST0" && pwd`
+	cd "$saveddir"
+fi
+
+BEAST_LIB="$BEAST/lib"
+
+if [ -z "$JAVA_HOME" ]; then
+  JAVA=java
+else
+  JAVA=$JAVA_HOME/bin/java
+fi
+$JAVA -Xms256m -Xmx4g -Djava.library.path="$BEAST_LIB" -cp "$BEAST_LIB/launcher.jar" beast.app.treeannotator.TreeAnnotatorLauncher $*
+
diff --git a/release/Mac/createdmg.sh b/release/Mac/createdmg.sh
new file mode 100755
index 0000000..d49bf0a
--- /dev/null
+++ b/release/Mac/createdmg.sh
@@ -0,0 +1,58 @@
+#!/bin/sh
+cd release/Mac
+
+export source=BEAST
+export applicationName=BEAST
+export version=`perl -e 'while($s=<>) {if ($s=~/"version"/) {$s =~ /value="([^"]*)"/; print $1;}}' < ../../build.xml`
+export title="BEAST v${version}"
+export size=1g
+export backgroundPictureName=install.png
+export finalDMGName=${title}
+
+
+mkdir "BEAST/BEAST ${version}"
+mv BEAST/* "BEAST/BEAST ${version}"
+
+cp install.png ${source}/${backgroundPictureName}
+
+hdiutil create -srcfolder "${source}" -volname "${title}" -fs HFS+ \
+      -fsargs "-c c=64,a=16,e=16" -format UDRW -size ${size}k pack.temp.dmg
+
+export device=$(hdiutil attach -readwrite -noverify -noautoopen "pack.temp.dmg" | \
+         egrep '^/dev/' | sed 1q | awk '{print $1}')
+
+
+echo '
+   tell application "Finder"
+     tell disk "'${title}'"
+           open
+           set current view of container window to icon view
+           set toolbar visible of container window to false
+           set statusbar visible of container window to false
+           set the bounds of container window to {400, 100, 885, 430}
+           set theViewOptions to the icon view options of container window
+           set arrangement of theViewOptions to not arranged
+           set background picture of theViewOptions to file "'${backgroundPictureName}'"
+           set icon size of theViewOptions to 72
+           make new alias file at container window to POSIX file "/Applications" with properties {name:"Applications"}
+           set position of item "'${applicationName}' '${version}'" of container window to {100, 100}
+           set position of item "'${backgroundPictureName}'" of container window to {800, 100}
+           set position of item "Applications" of container window to {375, 100}
+			close
+			open
+           update without registering applications
+           delay 5
+#           eject
+     end tell
+   end tell
+' | osascript
+
+echo "OSASCRIPT DONE"
+ 
+ 
+chmod -Rf go-w /Volumes/"${title}"
+sync
+sync
+hdiutil detach ${device}
+hdiutil convert "pack.temp.dmg" -format UDZO -imagekey zlib-level=9 -o "${finalDMGName}"
+rm -f /pack.temp.dmg 
diff --git a/release/Mac/install.png b/release/Mac/install.png
new file mode 100755
index 0000000..a409bf5
Binary files /dev/null and b/release/Mac/install.png differ
diff --git a/release/Windows/AppStore_launch4j.xml b/release/Windows/AppStore_launch4j.xml
new file mode 100644
index 0000000..0861c65
--- /dev/null
+++ b/release/Windows/AppStore_launch4j.xml
@@ -0,0 +1,21 @@
+<launch4jConfig>
+  <headerType>gui</headerType>
+  <icon>../common/icons/utility.ico</icon>
+  <classPath>
+  	<mainClass>beast.app.tools.AppStoreLauncher</mainClass>
+  	<cp>./lib/launcher.jar</cp>
+  </classPath>
+  <cmdLine></cmdLine>
+  <jre>
+    <minVersion>1.6.0</minVersion>
+    <initialHeapSize>256</initialHeapSize>
+    <maxHeapSize>1024</maxHeapSize>
+  </jre>    
+  <versionInfo>
+    <fileDescription>AppStore</fileDescription>
+    <copyright>Beast 2 development team 2002-2015</copyright>
+    <productName>AppStore</productName>
+    <internalName>AppStore</internalName>
+    <originalFilename>AppStore.exe</originalFilename>
+  </versionInfo>
+</launch4jConfig>
diff --git a/release/Windows/BEAST_launch4j.xml b/release/Windows/BEAST_launch4j.xml
new file mode 100644
index 0000000..5e7d5ca
--- /dev/null
+++ b/release/Windows/BEAST_launch4j.xml
@@ -0,0 +1,21 @@
+<launch4jConfig>
+  <headerType>gui</headerType>
+  <icon>../common/icons/beast.ico</icon>
+  <classPath>
+  	<mainClass>beast.app.beastapp.BeastLauncher</mainClass>
+  	<cp>./lib/launcher.jar</cp>
+  </classPath>
+  <cmdLine>-window -working -options</cmdLine>
+  <jre>
+    <minVersion>1.6.0</minVersion>
+    <initialHeapSize>256</initialHeapSize>
+    <maxHeapSize>4048</maxHeapSize>
+  </jre>    
+  <versionInfo>
+    <fileDescription>BEAST2</fileDescription>    
+    <copyright>Beast 2 development team 2002-2015</copyright>
+    <productName>BEAST2</productName>
+    <internalName>BEAST2</internalName>
+    <originalFilename>BEAST2.exe</originalFilename>    
+  </versionInfo>
+</launch4jConfig>
diff --git a/release/Windows/BEAUti_launch4j.xml b/release/Windows/BEAUti_launch4j.xml
new file mode 100644
index 0000000..e7b1f5d
--- /dev/null
+++ b/release/Windows/BEAUti_launch4j.xml
@@ -0,0 +1,21 @@
+<launch4jConfig>
+  <headerType>gui</headerType>
+  <icon>../common/icons/beauti.ico</icon>
+  <classPath>
+  	<mainClass>beast.app.beauti.BeautiLauncher</mainClass>
+  	<cp>./lib/launcher.jar</cp>
+  </classPath>
+  <cmdLine>-capture</cmdLine>
+  <jre>
+    <minVersion>1.6.0</minVersion>
+    <initialHeapSize>256</initialHeapSize>
+    <maxHeapSize>4048</maxHeapSize>
+  </jre>    
+  <versionInfo>
+    <fileDescription>BEAUti2</fileDescription>
+    <copyright>Beast 2 development team 2002-2015</copyright>
+    <productName>BEAUti2</productName>
+    <internalName>BEAUti2</internalName>
+    <originalFilename>BEAUti2.exe</originalFilename>    
+  </versionInfo>
+</launch4jConfig>
diff --git a/release/Windows/LogCombiner_launch4j.xml b/release/Windows/LogCombiner_launch4j.xml
new file mode 100644
index 0000000..40e6fff
--- /dev/null
+++ b/release/Windows/LogCombiner_launch4j.xml
@@ -0,0 +1,21 @@
+<launch4jConfig>
+  <headerType>gui</headerType>
+  <icon>../common/icons/utility.ico</icon>
+  <classPath>
+  	<mainClass>beast.app.tools.LogCombinerLauncher</mainClass>
+  	<cp>./lib/launcher.jar</cp>
+  </classPath>
+  <cmdLine></cmdLine>
+  <jre>
+    <minVersion>1.6.0</minVersion>
+    <initialHeapSize>256</initialHeapSize>
+    <maxHeapSize>4048</maxHeapSize>
+  </jre>    
+  <versionInfo>
+    <fileDescription>LogCombiner</fileDescription>    
+    <copyright>Beast 2 development team 2002-2015</copyright>
+    <productName>LogCombiner</productName>
+    <internalName>LogCombiner</internalName>
+    <originalFilename>LogCombiner.exe</originalFilename>    
+  </versionInfo>
+</launch4jConfig>
diff --git a/release/Windows/TreeAnnotator_launch4j.xml b/release/Windows/TreeAnnotator_launch4j.xml
new file mode 100644
index 0000000..02982d1
--- /dev/null
+++ b/release/Windows/TreeAnnotator_launch4j.xml
@@ -0,0 +1,20 @@
+<launch4jConfig>
+  <headerType>gui</headerType>
+  <icon>../common/icons/utility.ico</icon>
+  <classPath>
+  	<mainClass>beast.app.treeannotator.TreeAnnotatorLauncher</mainClass>
+  	<cp>./lib/launcher.jar</cp>
+  </classPath>
+  <jre>
+    <minVersion>1.6.0</minVersion>
+    <initialHeapSize>256</initialHeapSize>
+    <maxHeapSize>4048</maxHeapSize>
+  </jre>    
+  <versionInfo>
+    <fileDescription>TreeAnnotator</fileDescription>    
+    <copyright>Beast 2 development team 2002-2015</copyright>
+    <productName>TreeAnnotator</productName>
+    <internalName>TreeAnnotator</internalName>
+    <originalFilename>TreeAnnotator.exe</originalFilename>    
+  </versionInfo>
+</launch4jConfig>
diff --git a/release/common/LICENSE.txt b/release/common/LICENSE.txt
new file mode 100644
index 0000000..a2a1d92
--- /dev/null
+++ b/release/common/LICENSE.txt
@@ -0,0 +1,504 @@
+		  GNU LESSER GENERAL PUBLIC LICENSE
+		       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+     51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+

+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+

+		  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+

+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+

+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+

+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+

+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+

+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+

+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+			    NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+

+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library 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 library 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 library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
+
+
diff --git a/release/common/README.txt b/release/common/README.txt
new file mode 100644
index 0000000..d115a3f
--- /dev/null
+++ b/release/common/README.txt
@@ -0,0 +1,203 @@
+                    BEAST v2.3.1 2015
+                 Beast 2 development team 2011-2015
+
+Last updated: September 2015
+
+Contents:
+1) INTRODUCTION
+2) INSTALLING BEAST
+3) CONVERTING SEQUENCES
+4) RUNNING BEAST
+5) ANALYZING RESULTS
+6) NATIVE LIBRARIES
+7) UNINSTALLING OLDER BEAST 2.x.x VERSIONS
+8) SUPPORT & LINKS
+9) ACKNOWLEDGMENTS 
+
+___________________________________________________________________________
+1) INTRODUCTION
+
+BEAST (Bayesian evolutionary analysis sampling trees) is package for
+evolutionary inference from molecular sequences.
+
+BEAST uses a complex and powerful input format (specified in XML) to
+describe the evolutionary model. This has advantages in terms of
+flexibility in that the developers of BEAST do not have to try and predict
+every analysis that researchers may wish to perform and explicitly provide
+an option for doing it. However, this flexibility means it is possible to
+construct models that don't perform well under the Markov chain Monte Carlo
+(MCMC) inference framework used. We cannot test every possible model that
+can be used in BEAST. There are two solutions to this: Firstly, we  supply
+a range of recipes for commonly performed analyses that we know should work
+in BEAST and provide example input files for these (although, the actual
+data can also produce unexpected behavour). Secondly, we provide advice and
+tools for the diagnosis of problems and suggestions on how to fix them:
+
+<http://beast2.cs.auckland.ac.nz/>
+
+BEAST is not a black-box into which you can put your data and expect an
+easily interpretable answer. It requires careful inspection of the output
+to check that it has performed correctly and usually will need tweaking,
+adjustment and a number of runs to get a valid answer. Sorry.
+___________________________________________________________________________
+2) INSTALLING BEAST
+
+BEAST requires a Java Virtual Machine to run. Many systems will already
+have this installed. It requires at least version 1.8 of Java to run. The
+latest versions of Java can be downloaded from:
+
+<http://java.sun.com/>
+
+If in doubt type "java -version" to see what version of java is installed
+(or if it is installed at all).
+
+Mac OS X will already have a suitable version of Java installed.
+
+Within the BEAST package will be the following directories:
+Directory       Contents
+doc/            Documentation of BEAST
+examples/       Some NEXUS and XML files
+lib/            Java & native libraries used by BEAST 
+bin/            Scripts of the corresponding OS
+templates/      Templates to initiate BEAUti
+
+___________________________________________________________________________
+3) CONVERTING SEQUENCES
+
+A program called "BEAUti" will import data in NEXUS format, allow you to
+select various models and options and generate an XML file ready for use in
+BEAST.
+
+To run BEAUti simply double-click the "BEAUti.exe" file in the BEAST
+folder. If this doesn't work then you may not have Java installed correctly. 
+Try opening an MS-DOS window and typing:
+
+	java -cp lib/beast.jar beast.app.beauti.Beauti
+
+__________________________________________________________________________
+4) RUNNING BEAST
+
+To run BEAST simply double-click the "BEAST.exe" file in the BEAST
+folder. You will be asked to select a BEAST XML input file.
+
+Alternatively open a Command window and type:
+	
+	java -jar lib/beast.jar input.xml
+
+Where "input.xml" is the name of a BEAST XML format file. This file can
+either be created from scratch using a text editor or be created by the
+BEAUti program from a NEXUS format file. 
+
+For documentation on creating and tuning the input files look at the
+documentation and tutorials on-line at:
+
+Help -      <http://www.beast2.org/>
+FAQ -       <http://www.beast2.org/wiki/index.php/FAQ>
+Tutorials - <http://www.beast2.org/wiki/index.php/Main_Page#BEAST_2_Tutorials>
+
+BEAST arguments:
+
+    -window Provide a console window
+    -options Display an options dialog
+    -working Change working directory to input file's directory
+    -seed Specify a random number generator seed
+    -prefix Specify a prefix for all output log filenames
+    -statefile Specify the filename for storing/restoring the state
+    -overwrite Allow overwriting of log files
+    -resume Allow appending of log files
+    -errors Specify maximum number of numerical errors before stopping
+    -threads The number of computational threads to use (default auto)
+    -java Use Java only, no native implementations
+    -noerr Suppress all output to standard error
+    -loglevel error,warning,info,debug,trace
+    -beagle Use beagle library if available
+    -beagle_info BEAGLE: show information on available resources
+    -beagle_order BEAGLE: set order of resource use
+    -beagle_instances BEAGLE: divide site patterns amongst instances
+    -beagle_CPU BEAGLE: use CPU instance
+    -beagle_GPU BEAGLE: use GPU instance if available
+    -beagle_SSE BEAGLE: use SSE extensions if available
+    -beagle_single BEAGLE: use single precision if available
+    -beagle_double BEAGLE: use double precision if available
+    -beagle_scaling BEAGLE: specify scaling scheme to use
+    -help Print this information and stop
+
+For example:
+
+     java -jar lib/beast.jar -seed 123456 -overwrite input.xml
+
+___________________________________________________________________________
+5) ANALYZING RESULTS
+
+We have produced a powerful graphical program for analysing MCMC log files
+(it can also analyse output from MrBayes and other MCMCs). This is called
+'Tracer' and is available from the Tracer web site:
+
+<http://tree.bio.ed.ac.uk/software/tracer>
+
+Additionally, two new programs are distributed as part of the BEAST
+package: LogCombiner & TreeAnnotator. LogCombiner can combine log or tree
+files from multiple runs of BEAST into a single combined results file
+(after removing appropriate burn-ins). TreeAnnotator can summarize a sample
+of trees from BEAST using a single target tree, annotating it with
+posterior probabilities, HPD node heights and rates. This tree can then be
+viewed in a new program called 'FigTree' which is available from:
+
+<http://tree.bio.ed.ac.uk/software/figtree>
+
+or 'DensiTree' available from BEAST package.
+
+___________________________________________________________________________
+6) NATIVE LIBRARIES
+
+We recommend that you install the BEAGLE library. BEAST attempts to use 
+BEAGLE by default and this can speed up running BEAST considerably. The 
+BEAGLE library needs to be installed separately from BEAST, and can be 
+obtained from:
+
+http://code.google.com/p/beagle-lib/
+
+
+___________________________________________________________________________
+7) UNINSTALLING OLDER BEAST 2.x.x VERSIONS
+
+If you installed BEAST version 2.x.x, you do no longer need to remove the 
+packages (add-ons) installed with that version of BEAST. But if you want to
+uninstall these packages, the easiest way to do this is in BEAUti
+version 2.x.x, using the add-on manager under the menu File/Mangage add-ons.
+
+Alternatively, delete the package directory:
+C:\Users\<yourusername>\BEAST                            on Windows
+/Users/<yourusername>/Library/Application Support/BEAST  on Mac
+/home/<yourusername>/.beast                              on Linux
+
+___________________________________________________________________________
+8) SUPPORT & LINKS
+
+BEAST is an extremely complex program and as such will inevitably have
+bugs. Please email us to discuss any problems:
+
+<remco at cs.auckland.ac.nz>
+<alexei at cs.auckland.ac.nz>
+<a.rambaut at ed.ac.uk>
+<msuchard at ucla.edu>
+
+The BEAST users' mailing-list 
+<https://groups.google.com/forum/#!forum/beast-users>
+
+The website for beast is here:
+
+<http://www.beast2.org/>
+
+Source code distributed under the GNU Lesser General Public License:
+
+<https://github.com/CompEvol/beast2>
+
+___________________________________________________________________________
+9) ACKNOWLEDGMENTS
+
+Thanks for supplying code or assisting with the creation
+or testing of Beast 2 development team.
+
+
+
diff --git a/release/common/VERSION HISTORY.txt b/release/common/VERSION HISTORY.txt
new file mode 100644
index 0000000..23f6246
--- /dev/null
+++ b/release/common/VERSION HISTORY.txt	
@@ -0,0 +1,167 @@
+                    BEAST v2.3.1 2015
+                 Beast 2 development team 2011-2015
+Version History
+Last updated: September 2015
+
+All issues can be viewed at https://github.com/CompEvol/beast2/issues
+================================================================================
+Version 2.3.1 September 2015
+        BEAUti fixes
+           robustify (un)linking
+	   improved Fasta import
+
+	BEAST
+	   support for uncertain alignments (see examples/testJukesCantorShortUncertain.xml) 
+           improved error messages
+
+        TreeAnnotator allows lower memory consumption
+
+	AppStore, LogCombiners, LogAnalyser improved command line interface 
+
+	Antlr based tree parsing
+
+        DensiTree updated to v2.2.3
+
+	BinaryCovarion model option to run as reversible model 
+
+	Set log level by environment variable
+	
+Version 2.3.0 May 2015
+	BEAUti fixes
+		cloning, linking, unlinking bugs fixed
+        more robust templates
+        calibrations can be deleted now
+		improved access to package folders
+        improved import menu
+
+	LogCombiner improved command line interface
+
+	Fix synchronisation issues affecting ThreadedTreeLikelihood
+    
+	Auto load beast.jar, giving footprint for Mac
+
+	Bug fix in EigenDecomposition affecting asymmetric rate matrices
+
+	Reduced dependency on taxon order making multiple partition handling more robust
+
+    Can keep running v2.2 and its packages alongside v2.3
+
+	DensiTree updated to v2.2.2
+
+Version 2.2.1 March 2015
+	Support for multi-gamma-site-model package 
+
+	BEAUti some bug fixes involved in linking/cloning + some cosmetic changes
+
+	Better error reporting:
+    - in BEAUti, estimate of relative substitution rate for single partition only caused BEAST to hang
+    - check correct java version (8) is used
+	- package manager warns when there is no internet connection
+
+	Improved NEXUS Standard datatype support
+
+	TreeAnnotator improved sampled ancestor support
+
+	CLI script now sensitive to JAVA_HOME environment variable
+
+	DensiTree updated to v2.2.1
+
+Version 2.2.0 January 2015
+	Uses Java 8 to facilitate package development, thus preventing version clashes with packages
+
+	BEAUti default settings preventing common errors, template fixes, layout enhancements, error logging
+
+	Enhanced package manager
+	
+	Better error reporting for finding common issues with XML files (such as *BEAST gene trees not covering all species)
+
+	Improved install for Mac
+
+	Over 300 commits for small bug fixes and performance enhancements (more readable XML, better NEXUS parsing, TreeAnnotator fix, etc.)
+
+Version 2.1.3 May 2014
+	Patch release
+	
+	*BEAST template fixed
+
+	add AppStore for conveniently launching applications from packages
+
+	improved FASTA support
+
+	a few small fixes (BEAUti displays of log normal, monophyletic constraint logging, allow import of alignments with same name in BEAUti,etc.)
+
+
+Version 2.1.2 April 2014
+	Patch release
+
+	BEAUti handles multiple partitions more conveniently
+
+	improved package management
+
+	fix bug in *BEAST template
+	
+	many small fixes (FASTA support, stochastic distributions, *BEAST operator weighting, etc.)
+
+
+Version 2.1.1 January 2014
+	Patch release speeding up BEAUti to handle large Nexus files and handle multiple files.
+
+
+Version 2.1.0 December 2013
+	Support for many more packages, including 
+		o CladeAge for fossil calibrations
+		o Sampled Ancestor Trees
+		o Multi Type Trees for structured coalescent
+		o Birth-Death SIR model
+    If not already available these will be so soon.
+
+	Support for JSON file format
+
+	Beagle update issue resolved -- no more incorrectly calculated likelihoods
+
+	Core refactored, for ease of developing packages
+
+	*BEAST start state for getting faster through burn-in
+
+	BEAUti many small fixes supporting more packages
+
+	DensiTree and TreeAnnotator updated
+
+
+
+Version 2.0.2 February 2013
+
+	Beagle scale issue resolved, resulting in potentially faster 
+	treelikelihood calculations
+
+	Treeannotator and logcombiner updated to version 2
+	
+	BEAUti - use-ambiguities flag in partition panel
+
+	colt and apache math-commons libraries included so not all add-ons
+	need to supply them separately
+
+	Support for path-sampling through beastii add-on
+
+
+
+Version 2.0.c released on 1st December 2011
+
+	New Features:
+	
+    Allows resuming an MCMC chain. Handy when the chain turns out to
+    converge slower than expected.
+
+    Real time tracking of ESSs while running a chain.
+
+    Beauti allows reloading files, so that small changes do not require any
+    XML editing.
+
+    For developers, code is better documented, and only the most relevant
+    classes are part of Beast 2 (i.e. no experimental research code), making
+    it easier to learn.
+
+    Easily extendible: for example, the BeastII add-on supports multi chain
+    MCMC, some experimental likelihood calculations that are potentially
+    faster than the base implementation, and a spread sheet GUI for
+    manipulating models.    
diff --git a/release/common/icons/beast.icns b/release/common/icons/beast.icns
new file mode 100644
index 0000000..683461d
Binary files /dev/null and b/release/common/icons/beast.icns differ
diff --git a/release/common/icons/beast.ico b/release/common/icons/beast.ico
new file mode 100644
index 0000000..a801862
Binary files /dev/null and b/release/common/icons/beast.ico differ
diff --git a/release/common/icons/beast.png b/release/common/icons/beast.png
new file mode 100644
index 0000000..585b4d1
Binary files /dev/null and b/release/common/icons/beast.png differ
diff --git a/release/common/icons/beauti.icns b/release/common/icons/beauti.icns
new file mode 100644
index 0000000..4281757
Binary files /dev/null and b/release/common/icons/beauti.icns differ
diff --git a/release/common/icons/beauti.ico b/release/common/icons/beauti.ico
new file mode 100644
index 0000000..4dbaf76
Binary files /dev/null and b/release/common/icons/beauti.ico differ
diff --git a/release/common/icons/beauti.png b/release/common/icons/beauti.png
new file mode 100644
index 0000000..3052af8
Binary files /dev/null and b/release/common/icons/beauti.png differ
diff --git a/release/common/icons/utility.icns b/release/common/icons/utility.icns
new file mode 100644
index 0000000..8795836
Binary files /dev/null and b/release/common/icons/utility.icns differ
diff --git a/release/common/icons/utility.ico b/release/common/icons/utility.ico
new file mode 100644
index 0000000..77480af
Binary files /dev/null and b/release/common/icons/utility.ico differ
diff --git a/release/common/icons/utility.png b/release/common/icons/utility.png
new file mode 100644
index 0000000..f008380
Binary files /dev/null and b/release/common/icons/utility.png differ
diff --git a/release/common/tools/DensiTree.icns b/release/common/tools/DensiTree.icns
new file mode 100644
index 0000000..fd3ec3b
Binary files /dev/null and b/release/common/tools/DensiTree.icns differ
diff --git a/release/common/tools/DensiTree.ico b/release/common/tools/DensiTree.ico
new file mode 100644
index 0000000..a411634
Binary files /dev/null and b/release/common/tools/DensiTree.ico differ
diff --git a/release/common/tools/DensiTree.png b/release/common/tools/DensiTree.png
new file mode 100644
index 0000000..6626534
Binary files /dev/null and b/release/common/tools/DensiTree.png differ
diff --git a/release/common/tools/DensiTree_launch4j.xml b/release/common/tools/DensiTree_launch4j.xml
new file mode 100644
index 0000000..2c08552
--- /dev/null
+++ b/release/common/tools/DensiTree_launch4j.xml
@@ -0,0 +1,16 @@
+<launch4jConfig>
+  <headerType>gui</headerType>
+  <icon>./DensiTree.ico</icon>  
+  <jre>
+    <minVersion>1.6.0</minVersion>
+    <initialHeapSize>256</initialHeapSize>
+    <maxHeapSize>4096</maxHeapSize>
+  </jre>    
+  <versionInfo>
+    <fileDescription>DensiTree</fileDescription>
+    <copyright>http://compevol.auckland.ac.nz/software/DensiTree/</copyright>
+    <productName>DensiTree</productName>
+    <internalName>DensiTree</internalName>
+    <originalFilename>DensiTree.exe</originalFilename>    
+  </versionInfo>
+</launch4jConfig>
diff --git a/scripts/doc.pl b/scripts/doc.pl
new file mode 100755
index 0000000..0e9beb3
--- /dev/null
+++ b/scripts/doc.pl
@@ -0,0 +1,88 @@
+#/usr/bin/perl
+# Script that copies all files from src directory to src2 directory
+# and extracts @Description and Input.description info into comments
+# so that javadoc has access to them.
+#
+# build.xml has a javadoc target, which runs this script before running
+# javadoc on the output. Results are stored in release/common/doc/develop/javadoc/
+
+use Cwd;
+
+mkdir("src2");
+
+
+ at list = `find src/|grep java|grep beast|grep -v "\.svn"|grep -v test|egrep -v BeerLikelihoodCore.+.java`;
+print $#list;
+
+# grab Description info for abstract classes
+foreach $sFile (@list) {
+    chomp($sFile);
+    print "Processing $sFile\n";
+    $sClass = $sFile;
+    $sClass =~ s/src.//;
+    $sClass =~ s/.java$//;
+    $sClass =~ s/\//./g;
+    open(FIN,$sFile) or die "Cannot open file $sFile for reading";
+    while ($s = <FIN>) {
+        if ($s =~ /^\s*\@Description/) {
+            # extract Description text
+            $d = $s;
+            $d =~ s/.*\@Description\s*\(\s*"(.*)".*/$1/;
+            while (($s !~ /\bpublic.+class\b/) && ($s !~ /\bpublic.+interface\b/) && ($s = <FIN>)) {
+                if (($s !~ /\bpublic.+class\b/) && ($s !~ /\bpublic.+interface\b/)) {
+                    $s =~ s/\s*"(.*)".*/$1/;
+                    $d .= $s;
+                }
+            }
+            $map{"$sClass \@description"} = $d;
+        }
+    }
+    close FIN;
+}
+
+
+# grab description and input info from DocMaker
+open (FIN,"java -cp build:lib/commons-math3-3.1.1.jar beast.app.DocMaker -javadoc |");
+while ($s = <FIN>) {
+    $s =~ /^([^:]*):([^:]*):(.*)$/;
+    $map{"$1 $2"} = $3;
+}
+
+
+# process files: copy each Java class from src to src2
+foreach $sFile (@list) {
+    chomp($sFile);
+    print "Processing $sFile\n";
+    $sClass = $sFile;
+    $sClass =~ s/src.//;
+    $sClass =~ s/.java$//;
+    $sClass =~ s/\//./g;
+    $sDir = $sFile;
+    $sDir =~ s/src/src2/;
+    $sDir =~ s/[^\/]*java$//;
+    `mkdir -p $sDir`;
+    open(FIN,$sFile) or die "Cannot open file $sFile for reading";
+    $sFile2 = $sFile;
+    $sFile2 =~ s/src/src2/;
+    open(FOUT,">$sFile2") or die "Cannot open file $sFile2 for writing";
+    while ($s = <FIN>) {
+        if ($s =~ /^\s*\@Description/) {
+            # extract Description text and insert as comment
+            while (($s !~ /\bpublic.+class\b/) && ($s !~ /\bpublic.+interface\b/) && ($s = <FIN>)) {
+            }
+            if (length($map{"$sClass \@description"}) > 1) {
+                print FOUT "\n/**\n * ".$map{"$sClass \@description"}." */\n";
+            }
+        }
+        # insert input description
+        if ($s =~ /new\s+Input<.*>\("([^"]*)"\s*,/) {
+            print FOUT "/** ".$map{"$sClass $1"}." **/\n";
+        }
+        print FOUT $s;        
+    }
+    close FIN;
+    close FOUT;
+}
+#print `cp src/beast/core/Plugin.java src2/beast/core`;
+print `cp src/beast/core/Description.java src2/beast/core`;
+print `cp src/beast/core/Citation.java src2/beast/core`;
\ No newline at end of file
diff --git a/src/beast/app/BEASTVersion.java b/src/beast/app/BEASTVersion.java
new file mode 100644
index 0000000..30cfa0a
--- /dev/null
+++ b/src/beast/app/BEASTVersion.java
@@ -0,0 +1,150 @@
+package beast.app;
+
+import beast.app.util.Version;
+
+/**
+ * This class provides a mechanism for returning the version number of the
+ * dr software. It relies on the administrator of the dr source using the
+ * module tagging system in CVS. The method getVersionString() will return
+ * the version of dr under the following condition: <BR>
+ * 1. the dr source has been checked out *by tag* before being packaged for
+ * distribution.
+ * <p/>
+ *
+ * @author Alexei Drummond
+ * @author Andrew Rambaut
+ */
+public class BEASTVersion extends Version {
+
+    /**
+     * Version string: assumed to be in format x.x.x
+     */
+    private static final String VERSION = "2.3.1";
+
+    private static final String DATE_STRING = "2002-2015";
+
+    private static final boolean IS_PRERELEASE = false;
+
+    private static final String BEAST2_WEBPAGE = "http://beast2.org/";
+    
+    private static final String BEAST2_SOURCE = "http://github.com/CompEvol/beast2";
+
+    public String getVersion() {
+        return VERSION;
+    }
+
+    public String getVersionString() {
+        return "v" + VERSION + (IS_PRERELEASE ? " Prerelease" : "");
+    }
+
+    public String getDateString() {
+        return DATE_STRING;
+    }
+
+    public String[] getCredits() {
+        return new String[]{
+                "Designed and developed by",
+                "Remco Bouckaert, Alexei J. Drummond, Andrew Rambaut & Marc A. Suchard",
+                "",
+                "Department of Computer Science",
+                "University of Auckland",
+                "remco at cs.auckland.ac.nz",
+                "alexei at cs.auckland.ac.nz",
+                "",
+                "Institute of Evolutionary Biology",
+                "University of Edinburgh",
+                "a.rambaut at ed.ac.uk",
+                "",
+                "David Geffen School of Medicine",
+                "University of California, Los Angeles",
+                "msuchard at ucla.edu",
+                "",
+                "Downloads, Help & Resources:",
+
+                BEAST2_WEBPAGE,
+                "",
+                "Source code distributed under the GNU Lesser General Public License:",
+                BEAST2_SOURCE,
+                "",
+                "BEAST developers:",
+                "Alex Alekseyenko, Trevor Bedford, Erik Bloomquist, Joseph Heled, ",
+                "Sebastian Hoehna, Denise Kuehnert, Philippe Lemey, Wai Lok Sibon Li, ",
+                "Gerton Lunter, Sidney Markowitz, Vladimir Minin, Michael Defoin Platel, ",
+                "Oliver Pybus, Chieh-Hsi Wu, Walter Xie",
+                "",
+                "Thanks to:",
+                "Roald Forsberg, Beth Shapiro and Korbinian Strimmer"};
+    }
+
+    public String getHTMLCredits() {
+        return
+                "<p>Designed and developed by<br>" +
+                        "Remco Bouckaert, Alexei J. Drummond, Andrew Rambaut and Marc A. Suchard</p>" +
+                        "<p>Department of Computer Science, University of Auckland<br>" +
+                        "<a href=\"mailto:remco at cs.auckland.ac.nz\">remco at cs.auckland.ac.nz</a><br>" +
+                        "<a href=\"mailto:alexei at cs.auckland.ac.nz\">alexei at cs.auckland.ac.nz</a></p>" +
+                        "<p>Institute of Evolutionary Biology, University of Edinburgh<br>" +
+                        "<a href=\"mailto:a.rambaut at ed.ac.uk\">a.rambaut at ed.ac.uk</a></p>" +
+                        "<p>David Geffen School of Medicine, University of California, Los Angeles<br>" +
+                        "<a href=\"mailto:msuchard at ucla.edu\">msuchard at ucla.edu</a></p>" +
+                        "<p><a href=\"" + BEAST2_WEBPAGE + "\">" + BEAST2_WEBPAGE + "</a></p>" +
+                        "<p>Source code distributed under the GNU LGPL:<br>" +
+                        "<a href=\"" + BEAST2_SOURCE + "\">" + BEAST2_SOURCE + "</a></p>" +
+                        "<p>BEAST developers:<br>" +
+                        "Alex Alekseyenko, Erik Bloomquist, Joseph Heled, Sebastian Hoehna, Philippe Lemey,<br>" +
+                        "Wai Lok Sibon Li, Gerton Lunter, Sidney Markowitz, Vladimir Minin,<br>" +
+                        "Michael Defoin Platel, Oliver Pybus, Chieh-Hsi Wu, Walter Xie,<br>" +
+                        "Denise Kuehnert</p>" +
+                        "<p>Thanks to Roald Forsberg, Beth Shapiro and Korbinian Strimmer</p>";
+    }
+
+    /**
+     * such as 2.1
+     * @return
+     */
+    public String getMajorVersion() {
+        return VERSION.substring(0, VERSION.lastIndexOf("."));
+    }
+
+    /** Parse version string, assume it is of the form 1.2.3
+     * returns version where each sub-version is divided by 100,
+     * so 2.0 -> return 2
+     * 2.1 return 2.01
+     * 2.2.3 return 2.0103
+     * Letters are ignored, so
+     * 2.0.e -> 2.0
+     * 2.x.1 -> 2.0001
+     * @return
+     */
+    public double parseVersion(String sVersion) {
+        // is of the form 1.2.3
+        String [] strs = sVersion.split("\\.");
+        double version = 0;
+        double divider = 1.0;
+        for (int i = 0; i < strs.length; i++) {
+            try {
+                version += Double.parseDouble(strs[i]) / divider;
+                divider = divider * 100.0;
+            } catch (NumberFormatException e) {
+                // ignore
+            }
+        }
+        return version;
+    }
+
+    /** inverse of parseVersion **/
+    public String formatVersion(double version) {
+        if (Double.isInfinite(version)) {
+            return " any number";
+        }
+        String str = "" + (int) (version + 0.000001);
+        version = version - (int) (version + 0.000001);
+        while (version > 0.00001) {
+            version *= 100;
+            str += "." + (int) (version + 0.00001);
+            version = version - (int) (version + 0.00001);
+        }
+        return str;
+    }
+
+}
diff --git a/src/beast/app/BeastMCMC.java b/src/beast/app/BeastMCMC.java
new file mode 100644
index 0000000..1ce13a4
--- /dev/null
+++ b/src/beast/app/BeastMCMC.java
@@ -0,0 +1,533 @@
+/*
+* File BeastMCMC.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+package beast.app;
+
+
+import jam.util.IconUtils;
+
+import java.awt.BorderLayout;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.File;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+import javax.swing.BorderFactory;
+import javax.swing.Box;
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JComboBox;
+import javax.swing.JDialog;
+import javax.swing.JFileChooser;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JTextField;
+import javax.swing.border.EtchedBorder;
+import javax.swing.filechooser.FileFilter;
+
+import beagle.BeagleFlag;
+import beast.app.beastapp.BeastDialog;
+import beast.app.beastapp.BeastMain;
+import beast.app.beauti.Beauti;
+import beast.app.draw.ExtensionFileFilter;
+import beast.app.util.Version;
+import beast.core.Logger;
+import beast.core.Logger.LogFileMode;
+import beast.core.Runnable;
+
+import beast.util.AddOnManager;
+import beast.util.JSONParser;
+import beast.util.Randomizer;
+import beast.util.XMLParser;
+import beast.util.XMLParserException;
+
+/**
+ * Main application for performing MCMC runs.
+ * See getUsage() for command line options.
+ */
+public class BeastMCMC {
+    final public static String VERSION = "2.0 Release candidate";
+    final public static String DEVELOPERS = "Beast 2 development team";
+    final public static String COPYRIGHT = "Beast 2 development team 2011";
+
+    /**
+     * number of threads used to run the likelihood beast.core *
+     */
+    static public int m_nThreads = 1;
+    /**
+     * thread pool *
+     */
+    public static ExecutorService g_exec = Executors.newFixedThreadPool(m_nThreads);
+    /**
+     * random number seed used to initialise Randomizer *
+     */
+    long m_nSeed = 127;
+
+    /**
+     * MCMC object to execute *
+     */
+    Runnable m_runnable;
+
+    /**
+     * parse command line arguments, and load file if specified
+     *
+     * @throws Exception *
+     */
+    public void parseArgs(String[] args) throws Exception {
+        int i = 0;
+        boolean resume = false;
+
+        File beastFile = null;
+
+        try {
+            while (i < args.length) {
+                int iOld = i;
+                if (i < args.length) {
+                    if (args[i].equals("")) {
+                        i += 1;
+                    } else if (args[i].equals("-batch")) {
+                        Logger.FILE_MODE = Logger.LogFileMode.only_new_or_exit;
+                        i += 1;
+                    } else if (args[i].equals("-resume")) {
+                        resume = true;
+                        Logger.FILE_MODE = Logger.LogFileMode.resume;
+                        System.setProperty("beast.resume", "true");
+                        System.setProperty("beast.debug", "false");
+                        i += 1;
+                    } else if (args[i].equals("-overwrite")) {
+                        Logger.FILE_MODE = Logger.LogFileMode.overwrite;
+                        i += 1;
+                    } else if (args[i].equals("-seed")) {
+                        if (args[i + 1].equals("random")) {
+                            m_nSeed = Randomizer.getSeed();
+                        } else {
+                            m_nSeed = Long.parseLong(args[i + 1]);
+                        }
+                        i += 2;
+
+                    } else if (args[i].equals("-threads")) {
+                        m_nThreads = Integer.parseInt(args[i + 1]);
+                        g_exec = Executors.newFixedThreadPool(m_nThreads);
+                        i += 2;
+// use BEAST environment variable to set Beast directories as colon separated list						
+//					} else if (args[i].equals("-beastlib")) {
+//						ClassDiscovery.setJarPath(args[i + 1]);
+//						i += 2;
+                    } else if (args[i].equals("-prefix")) {
+                        System.setProperty("file.name.prefix", args[i + 1].trim());
+                        i += 2;
+                    }
+                    if (i == iOld) {
+                        if (i == args.length - 1) {
+                            beastFile = new File(args[i]);
+                            i++;
+                        } else {
+                            throw new Exception("Wrong argument");
+                        }
+                    }
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new Exception("Error parsing command line arguments: " + Arrays.toString(args) + "\nArguments ignored\n\n" + getUsage());
+        }
+
+        if (beastFile == null) {
+            // Not resuming so get starting options...
+
+            List<String> MCMCargs = new ArrayList<String>();
+            Version version = new BEASTVersion();
+            String titleString = "<html><center><p>Bayesian Evolutionary Analysis Sampling Trees<br>" +
+                    "Version " + version.getVersionString() + ", " + version.getDateString() + "</p></center></html>";
+            javax.swing.Icon icon = IconUtils.getIcon(BeastMain.class, "images/beast.png");
+            String nameString = "BEAST " + version.getVersionString();
+
+            BeastDialog dialog = new BeastDialog(new JFrame(), titleString, icon);
+
+            if (!dialog.showDialog(nameString, m_nSeed)) {
+                return;
+            }
+
+            switch (dialog.getLogginMode()) {
+                case 0:/* do not ovewrite */
+                    break;
+                case 1:
+                    MCMCargs.add("-overwrite");
+                    break;
+                case 2:
+                    MCMCargs.add("-resume");
+                    break;
+            }
+            MCMCargs.add("-seed");
+            MCMCargs.add(dialog.getSeed() + "");
+
+            if (dialog.getThreadPoolSize() > 0) {
+                MCMCargs.add("-threads");
+                MCMCargs.add(dialog.getThreadPoolSize() + "");
+            }
+
+            boolean useBeagle = dialog.useBeagle();
+            boolean beagleShowInfo = false;
+            long beagleFlags = 0;
+            if (useBeagle) {
+                beagleShowInfo = dialog.showBeagleInfo();
+                if (dialog.preferBeagleCPU()) {
+                    beagleFlags |= BeagleFlag.PROCESSOR_CPU.getMask();
+                }
+                if (dialog.preferBeagleSSE()) {
+                    beagleFlags |= BeagleFlag.VECTOR_SSE.getMask();
+                }
+                if (dialog.preferBeagleGPU()) {
+                    beagleFlags |= BeagleFlag.PROCESSOR_GPU.getMask();
+                }
+                if (dialog.preferBeagleDouble()) {
+                    beagleFlags |= BeagleFlag.PRECISION_DOUBLE.getMask();
+                }
+                if (dialog.preferBeagleSingle()) {
+                    beagleFlags |= BeagleFlag.PRECISION_SINGLE.getMask();
+                }
+            }
+            if (beagleFlags != 0) {
+                System.setProperty("beagle.preferred.flags", Long.toString(beagleFlags));
+            }
+            if (!useBeagle) {
+                System.setProperty("java.only", "true");
+            }
+
+            File inputFile = dialog.getInputFile();
+            if (!beagleShowInfo && inputFile == null) {
+                System.err.println("No input file specified");
+                System.exit(0);
+            }
+            MCMCargs.add(inputFile.getAbsolutePath());
+
+//			BeastStartDialog dlg = new BeastStartDialog();
+//			if (dlg.m_bOK) {
+//				parseArgs(dlg.getArgs());
+//			}
+            parseArgs(MCMCargs.toArray(new String[0]));
+            return;
+        }
+
+        System.err.println("File: " + beastFile.getName() + " seed: " + m_nSeed + " threads: " + m_nThreads);
+        if (resume) {
+            System.out.println("Resuming from file");
+        }
+
+        AddOnManager.loadExternalJars();
+        // parse xml
+        Randomizer.setSeed(m_nSeed);
+        if (beastFile.getPath().toLowerCase().endsWith(".json")) {
+            m_runnable = new JSONParser().parseFile(beastFile);
+        } else {        	
+        	m_runnable = new XMLParser().parseFile(beastFile);
+        }
+        m_runnable.setStateFile(beastFile.getName() + ".state", resume);
+    } // parseArgs
+
+
+    public static String getUsage() {
+        return "Usage: BeastMCMC [options] <Beast.xml>\n" +
+                "where <Beast.xml> the name of a file specifying a Beast run\n" +
+                "and the following options are allowed:\n" +
+                "-resume : read state that was stored at the end of the last run from file and append log file\n" +
+                "-overwrite : overwrite existing log files (if any). By default, existing files will not be overwritten.\n" +
+                "-seed [<int>|random] : sets random number seed (default 127), or picks a random seed\n" +
+                "-threads <int> : sets number of threads (default 1)\n" +
+                "-prefix <name> : use name as prefix for all log files\n" +
+                "-beastlib <path> : Colon separated list of directories. All jar files in the path are loaded. (default 'beastlib')";
+    } // getUsage
+
+    /**
+     * open file dialog for prompting the user to specify an xml script file to process *
+     */
+    String getFileNameByDialog() {
+        JFileChooser fc = new JFileChooser(System.getProperty("user.dir"));
+        fc.addChoosableFileFilter(new FileFilter() {
+            public boolean accept(File f) {
+                if (f.isDirectory()) {
+                    return true;
+                }
+                String name = f.getName().toLowerCase();
+                if (name.endsWith(".xml")) {
+                    return true;
+                }
+                return false;
+            }
+
+            // The description of this filter
+            public String getDescription() {
+                return "xml files";
+            }
+        });
+
+        fc.setDialogTitle("Load xml file");
+        int rval = fc.showOpenDialog(null);
+
+        if (rval == JFileChooser.APPROVE_OPTION) {
+            return fc.getSelectedFile().toString();
+        }
+        return null;
+    } // getFileNameByDialog
+
+    public void run() throws Exception {
+        g_exec = Executors.newFixedThreadPool(m_nThreads);
+        m_runnable.run();
+        g_exec.shutdown();
+        g_exec.shutdownNow();
+    } // run
+
+
+    /**
+     * class for starting Beast with a dialog *
+     */
+    class BeastStartDialog extends JDialog {
+        private static final long serialVersionUID = 1L;
+        boolean m_bOK = false;
+        JTextField m_fileEntry;
+        JTextField m_seedEntry;
+        JCheckBox m_bUseGPU;
+        JComboBox m_mode;
+
+        public BeastStartDialog() {
+            setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
+            setModalityType(DEFAULT_MODALITY_TYPE);
+            init();
+            setVisible(true);
+        }
+
+        String[] getArgs() {
+            List<String> sArgs = new ArrayList<String>();
+            sArgs.add("-seed");
+            sArgs.add(m_seedEntry.getText());
+            switch (m_mode.getSelectedIndex()) {
+                case 0:
+                    break;
+                case 1:
+                    sArgs.add("-overwrite");
+                    break;
+                case 2:
+                    sArgs.add("-resume");
+                    break;
+            }
+//			if (m_bUseGPU.isSelected()) {
+//				sArgs.add("-useGPU");
+//			}
+            sArgs.add(m_fileEntry.getText());
+            return sArgs.toArray(new String[0]);
+        }
+
+        void init() {
+            try {
+                setTitle("Beast Start Dialog");
+                Box box = Box.createVerticalBox();
+
+                box.add(createHeader());
+                box.add(Box.createVerticalStrut(10));
+                box.add(createFileInput());
+                box.add(Box.createVerticalStrut(10));
+                box.add(Box.createVerticalBox());
+                box.add(Box.createVerticalStrut(10));
+                box.add(createSeedInput());
+//		        box.add(Box.createVerticalStrut(10));
+//		        box.add(createBeagleInput());
+                box.add(Box.createVerticalStrut(10));
+                box.add(createModeInput());
+
+                box.add(Box.createVerticalGlue());
+                box.add(createRunQuitButtons());
+                add(box);
+                setSize(new Dimension(600, 500));
+            } catch (Exception e) {
+                e.printStackTrace();
+                JOptionPane.showMessageDialog(this, "Could not create dialog: " + e.getMessage());
+            }
+        } // BeastStartDialog::init
+
+        private Component createHeader() {
+            Box box = Box.createHorizontalBox();
+
+            String sIconLocation = "beast/app/draw/icons/beast.png";
+            ImageIcon icon = null;
+            try {
+                URL url = (URL) ClassLoader.getSystemResource(sIconLocation);
+                if (url == null) {
+                    System.err.println("Cannot find icon " + sIconLocation);
+                    return null;
+                }
+                icon = new ImageIcon(url);
+            } catch (Exception e) {
+                System.err.println("Cannot load icon " + sIconLocation + " " + e.getMessage());
+                return null;
+            }
+
+
+            JLabel label = new JLabel(icon);
+            label.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10));
+            box.add(label, BorderLayout.WEST);
+            label = new JLabel("<html><center>BEAST<br>Version: " + VERSION + "<br>Developers: " + DEVELOPERS + "<br>Copyright: " + COPYRIGHT + "</html>");
+            label.setHorizontalAlignment(JLabel.CENTER);
+            box.add(label);
+            return box;
+        } // BeastStartDialog::createHeader
+
+        private Component createFileInput() {
+            Box box = Box.createHorizontalBox();
+            box.add(new JLabel("Beast XML File: "));
+            m_fileEntry = new JTextField();
+            Dimension size = new Dimension(300, 20);
+            m_fileEntry.setMinimumSize(size);
+            m_fileEntry.setPreferredSize(size);
+            m_fileEntry.setSize(size);
+            m_fileEntry.setToolTipText("Enter file name of Beast 2 XML file");
+            m_fileEntry.setMaximumSize(new Dimension(1024, 20));
+            box.add(m_fileEntry);
+            //box.add(Box.createHorizontalGlue());
+
+            JButton button = new JButton("Choose file");
+            button.addActionListener(new ActionListener() {
+                @Override
+                public void actionPerformed(ActionEvent e) {
+                    JFileChooser fileChooser = new JFileChooser(Beauti.g_sDir);
+                    File file = new File(m_fileEntry.getText());
+                    if (file.exists())
+                        fileChooser.setSelectedFile(file);
+                    fileChooser.addChoosableFileFilter(new ExtensionFileFilter(".xml", "Beast xml file (*.xml)"));
+                    fileChooser.setDialogTitle("Select Beast 2 XML file");
+                    int rval = fileChooser.showOpenDialog(null);
+                    if (rval == JFileChooser.APPROVE_OPTION) {
+                        String sFileName = fileChooser.getSelectedFile().toString();
+                        if (sFileName.lastIndexOf('/') > 0) {
+                            Beauti.g_sDir = sFileName.substring(0, sFileName.lastIndexOf('/'));
+                        }
+                        m_fileEntry.setText(sFileName);
+                    }
+                }
+            });
+            box.add(button);
+
+            return box;
+        } // BeastStartDialog::createFileInput
+
+        private Component createSeedInput() {
+            Box box = Box.createHorizontalBox();
+            box.add(new JLabel("Random number seed: "));
+            m_seedEntry = new JTextField("127");
+            m_seedEntry.setHorizontalAlignment(JTextField.RIGHT);
+            Dimension size = new Dimension(100, 20);
+            m_seedEntry.setMinimumSize(size);
+            m_seedEntry.setPreferredSize(size);
+            m_seedEntry.setSize(size);
+            m_seedEntry.setToolTipText("Enter seed number used for initialising the random number generator");
+            m_seedEntry.setMaximumSize(new Dimension(1024, 20));
+            box.add(m_seedEntry);
+            box.add(Box.createHorizontalGlue());
+            return box;
+        } // BeastStartDialog::createSeedInput
+
+        private Component createBeagleInput() {
+            Box box = Box.createHorizontalBox();
+            m_bUseGPU = new JCheckBox("Use GPU through Beagle (if available)");
+            box.add(m_bUseGPU);
+            box.add(Box.createHorizontalGlue());
+            return box;
+        } // BeastStartDialog::createSeedInput
+
+
+        private Component createModeInput() {
+            Box box = Box.createHorizontalBox();
+            box.add(new JLabel("Mode of running: "));
+            m_mode = new JComboBox(new String[]{"default: only write new log files",
+                    "overwrite: overwrite log files",
+                    "resume: appends log to existing files (if any)"});
+            Dimension size = new Dimension(350, 20);
+            m_mode.setMinimumSize(size);
+            m_mode.setPreferredSize(size);
+            m_mode.setSize(size);
+            m_mode.setMaximumSize(size);
+
+            m_mode.setSelectedIndex(0);
+            box.add(m_mode);
+            box.add(Box.createHorizontalGlue());
+            return box;
+        } // BeastStartDialog::createModeInput
+
+        Component createRunQuitButtons() {
+            Box cancelOkBox = Box.createHorizontalBox();
+            cancelOkBox.setBorder(new EtchedBorder());
+            JButton okButton = new JButton("Run");
+            okButton.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent e) {
+                    m_bOK = true;
+                    dispose();
+                }
+            });
+            JButton cancelButton = new JButton("Quit");
+            cancelButton.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent e) {
+                    dispose();
+                    System.exit(0);
+                }
+            });
+            cancelOkBox.add(Box.createHorizontalGlue());
+            cancelOkBox.add(cancelButton);
+            cancelOkBox.add(Box.createHorizontalStrut(20));
+            cancelOkBox.add(okButton);
+            cancelOkBox.add(Box.createHorizontalStrut(20));
+            return cancelOkBox;
+        } // BeastStartDialog::createRunQuitButtons
+
+    } // class BeastStartDialog
+
+
+    public static void main(String[] args) {
+        try {
+            System.setProperty("beast.debug", "true");
+            BeastMCMC app = new BeastMCMC();
+            app.parseArgs(args);
+
+            app.run();
+        } catch (XMLParserException e) {
+            System.out.println(e.getMessage());
+            //e.printStackTrace();
+        } catch (Exception e) {
+            e.printStackTrace();
+            System.out.println(BeastMCMC.getUsage());
+        }
+        if (System.getProperty("beast.useWindow") == null) {
+            // this indicates no window is open
+            System.exit(0);
+        }
+    } // main
+
+} // BeastMCMC
diff --git a/src/beast/app/DocMaker.java b/src/beast/app/DocMaker.java
new file mode 100644
index 0000000..f2de5df
--- /dev/null
+++ b/src/beast/app/DocMaker.java
@@ -0,0 +1,567 @@
+/*
+* File DocMaker.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+package beast.app;
+
+
+
+import java.io.*;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import beast.core.Citation;
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.Loggable;
+import beast.core.BEASTObject;
+import beast.util.AddOnManager;
+
+
+
+/**
+ * Plug in documentation generator.
+ * Goes through all plug-ins and generate one page per plug-in.
+ * <p/>
+ * Usage: DocMaker <target directory>
+ * where <target directory> is the place where the HTML files
+ * should go. Default directory is /tmp.
+ * *
+ */
+public class DocMaker {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * output directory *
+     */
+    String m_sDir = "/tmp";
+    /**
+     * names of the plug-ins to document *
+     */
+    List<String> m_sPluginNames;
+    /**
+     * map of plug-in name to its derived plug-ins *
+     */
+    HashMap<String, String[]> m_isa;
+    /**
+     * map of plug-in name to its ancestor plug-ins *
+     */
+    HashMap<String, List<String>> m_ancestors;
+    /**
+     * map of plug-in name to its description (from @Description annotations) *
+     */
+    HashMap<String, String> m_descriptions;
+
+    Set<String> m_sLoggables;
+    
+    BEASTVersion version = new BEASTVersion();
+    
+    public DocMaker(String[] args) {
+        this();
+        if (args.length > 0) {
+            if (args[0].equals("-javadoc")) {
+                makeJavaDoc();
+                System.exit(0);
+            }
+            m_sDir = args[0];
+        }
+    } // c'tor
+
+    public DocMaker() {
+        // find plug ins to document
+        m_sPluginNames = AddOnManager.find(beast.core.BEASTObject.class, AddOnManager.IMPLEMENTATION_DIR);
+        /** determine hierarchical relation between plug-ins **/
+        m_isa = new HashMap<String, String[]>();
+        m_ancestors = new HashMap<String, List<String>>();
+        m_descriptions = new HashMap<String, String>();
+        m_sLoggables = new HashSet<String>();
+        for (String sPlugin : m_sPluginNames) {
+            m_ancestors.put(sPlugin, new ArrayList<String>());
+        }
+        for (String sPlugin : m_sPluginNames) {
+            try {
+                Class _class = Class.forName(sPlugin);
+                BEASTObject plugin = (BEASTObject) _class.newInstance();
+                String sDescription = getInheritableDescription(plugin.getClass());
+                System.err.println(sPlugin + " => " + sDescription);
+                m_descriptions.put(sPlugin, sDescription);
+                String[] sImplementations = getImplementations(plugin);
+                m_isa.put(sPlugin, sImplementations);
+                for (String sImp : sImplementations) {
+                    m_ancestors.get(sImp).add(sPlugin);
+                }
+                if (plugin instanceof Loggable) {
+                    m_sLoggables.add(sPlugin);
+                }
+            } catch (Exception e) {
+                System.err.println(sPlugin + " not documented :" + e.getMessage());
+            }
+        }
+    } // c'tor
+
+
+    /**
+     * print @Description and Input.description info so that it can
+     * be inserted in the code before creating Javadoc documentation
+     * for the Beast II SDK.
+     */
+    void makeJavaDoc() {
+        for (String sPlugin : m_sPluginNames) {
+            try {
+                BEASTObject plugin = (BEASTObject) Class.forName(sPlugin).newInstance();
+                System.out.println(sPlugin + ":@description:" + plugin.getDescription());
+                for (Input<?> input : plugin.listInputs()) {
+                    System.out.println(sPlugin + ":" + input.getName() + ":" + input.getTipText());
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    /**
+     * create CSS style sheet for all pages *
+     */
+    void createCSS() throws Exception {
+        PrintStream out = new PrintStream(m_sDir + "/doc.css");
+        out.println(getCSS());
+    }
+
+    String getCSS() {
+    		return  "<!--\n" +
+    				 "a.summary-letter {text-decoration: none}\n" +
+    				 "blockquote.smallquotation {font-size: smaller}\n" +
+    				 "div.display {margin-left: 3.2em}\n" +
+    				 "div.example {margin-left: 3.2em}\n" +
+    				 "div.indentedblock {margin-left: 3.2em}\n" +
+    				 "div.lisp {margin-left: 3.2em}\n" +
+    				 "div.smalldisplay {margin-left: 3.2em}\n" +
+    				 "div.smallexample {margin-left: 3.2em}\n" +
+    				 "div.smallindentedblock {margin-left: 3.2em; font-size: smaller}\n" +
+    				 "div.smalllisp {margin-left: 3.2em}\n" +
+    				 "kbd {font-style:oblique}\n" +
+    				 "pre.display {font-family: inherit}\n" +
+    				 "pre.format {font-family: inherit}\n" +
+    				 "pre.menu-comment {font-family: serif}\n" +
+    				 "pre.menu-preformatted {font-family: serif}\n" +
+    				 "pre.smalldisplay {font-family: inherit; font-size: smaller}\n" +
+    				 "pre.smallexample {font-size: smaller}\n" +
+    				 "pre.smallformat {font-family: inherit; font-size: smaller}\n" +
+    				 "pre.smalllisp {font-size: smaller}\n" +
+    				 "span.nocodebreak {white-space:nowrap}\n" +
+    				 "span.nolinebreak {white-space:nowrap}\n" +
+    				 "span.roman {font-family:serif; font-weight:normal}\n" +
+    				 "span.sansserif {font-family:sans-serif; font-weight:normal}\n" +
+    				 "ul.no-bullet {list-style: none}\n" +
+    				 "body {margin-left: 5%; margin-right: 5%;}\n" +
+    				 "\n" +
+    				 "H1 {             \n" +
+    				 "    background: white;\n" +
+    				 "    color: rgb(25%, 25%, 25%);\n" +
+    				 "    font-family: monospace;\n" +
+    				 "    font-size: xx-large;\n" +
+    				 "    text-align: center\n" +
+    				 "}\n" +
+    				 "\n" +
+    				 "H2 {\n" +
+    				 "    background: white;\n" +
+    				 "    color: rgb(40%, 40%, 40%);\n" +
+    				 "    font-family: monospace;\n" +
+    				 "    font-size: x-large;\n" +
+    				 "    text-align: center\n" +
+    				 "}\n" +
+    				 "\n" +
+    				 "H3 {\n" +
+    				 "    background: white;\n" +
+    				 "    color: rgb(40%, 40%, 40%);\n" +
+    				 "    font-family: monospace;\n" +
+    				 "    font-size: large\n" +
+    				 "}\n" +
+    				 "\n" +
+    				 "H4 {\n" +
+    				 "    background: white;\n" +
+    				 "    color: rgb(40%, 40%, 40%);\n" +
+    				 "    font-family: monospace\n" +
+    				 "}\n" +
+    				 "\n" +
+    				 "span.samp{font-family: monospace}\n" +
+    				 "span.command{font-family: monospace}\n" +
+    				 "span.option{font-family: monospace}\n" +
+    				 "span.file{font-family: monospace}\n" +
+    				 "span.env{font-family: monospace}\n" +
+    				 "\n" +
+    				 "ul {\n" +
+    				 "    margin-top: 0.25ex;\n" +
+    				 "    margin-bottom: 0.25ex;\n" +
+    				 "}\n" +
+    				 "li {\n" +
+    				 "    margin-top: 0.25ex;\n" +
+    				 "    margin-bottom: 0.25ex;\n" +
+    				 "}\n" +
+    				 "p {\n" +
+    				 "    margin-top: 0.6ex;\n" +
+    				 "    margin-bottom: 1.2ex;\n" +
+    				 "}\n" +
+    				 "caption {\n" +
+	                 "	font:  20pt Arial, Helvetica, sans-serif;\n" +
+	                 "	text-align: left;\n" +
+	                 "	height: 45px;\n" +
+	                 "	color: #243D02;\n" +
+	                 "	border-top: 1px solid #243D02;\n" +
+	                 "}\n" +
+	                 "table, th, td {border: 0px;)\n"
+    				 ;
+    }
+
+    /**
+     * create plug in index pages, shown in left frame *
+     */
+    void createIndex() throws Exception {
+        {
+            PrintStream out = new PrintStream(m_sDir + "/index.html");
+            out.println("<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Frameset//EN'\n" +
+                    "		   'http://www.w3.org/TR/html4/frameset.dtd'>\n" +
+                    "		<HTML>\n" +
+                    "		<HEAD>\n" +
+                    "		<TITLE>BEAST " + version.getVersionString() + " Documentation</TITLE>\n" +
+                    "		</HEAD>\n" +
+                    "		<FRAMESET cols='20%, 80%'>\n" +
+                    "		  <FRAMESET rows='50, 200'>\n" +
+//                    "		      <FRAME src='http://www.omnomnomnom.com/random/rotate.php' align='center'>\n" +
+                    "		      <FRAME src='beast.png' align='center'>\n" +
+                    "		      <FRAME src='contents.html'>\n" +
+                    "		  </FRAMESET>\n" +
+                    "		  <FRAME name='display' src='contents.html'>\n" +
+                    "		</FRAMESET>\n" +
+                    "		</HTML>");
+        }
+
+        {
+        }
+
+        {
+        	try {
+	            InputStream in = new FileInputStream(new File("src/beast/app/draw/icons/beast.png"));
+	            OutputStream out = new FileOutputStream(new File(m_sDir + "/beast.png"));
+	            byte[] buf = new byte[1024];
+	            int len;
+	            while ((len = in.read(buf)) > 0) {
+	                out.write(buf, 0, len);
+	            }
+	            in.close();
+	            out.close();
+        	} catch (Exception e) {
+				// TODO: handle exception
+			}
+        }
+        PrintStream out = new PrintStream(m_sDir + "/contents.html");
+        out.println("<html>\n<head><title>BEAST " + version.getVersionString() + " Documentation index</title>\n" +
+                "<link rel='StyleSheet' href='doc.css' type='text/css'>\n" +
+                "</head>\n");
+        out.println("<body>\n");
+        out.println("<h1>BEAST " + version.getVersionString() + " Documentation index</h1>\n");
+        String sPrev = null;
+        String sPrevPackage = null;
+        for (String sPlugin : m_sPluginNames) {
+            String sNext = sPlugin.substring(0, sPlugin.indexOf('.'));
+            if (sPrev != null && !sNext.equals(sPrev)) {
+                out.println("<hr/>");
+            }
+            sPrev = sNext;
+            String sName = sPlugin.substring(sPlugin.lastIndexOf('.') + 1);
+            String sPackage = sPlugin.substring(0, sPlugin.lastIndexOf('.'));
+            // count nr of packages
+            int i = 0;
+            while (sPlugin.indexOf('.', i) > 0) {
+                sName = "." + sName;
+                i = sPlugin.indexOf('.', i) + 1;
+            }
+            System.err.println(sName + " <= " + sPlugin);
+            if (sPrevPackage == null || !sPackage.equals(sPrevPackage)) {
+                out.println("<span style='color:grey'>" + sPackage + "</span><br/>");
+            }
+            out.println("<a href='" + sPlugin + ".html' target='display'>" + sName + "</a><br/>");
+            sPrevPackage = sPackage;
+        }
+        out.println("</body>\n");
+        out.println("</html>\n");
+    } // createIndex
+
+    /**
+     * Find all plugins that are derived from given plugin *
+     */
+    String[] getImplementations(BEASTObject plugin) {
+        String sName = plugin.getClass().getName();
+        List<String> sImplementations = new ArrayList<String>();
+        for (String sPlugin : m_sPluginNames) {
+            try {
+                if (!sPlugin.equals(sName) && plugin.getClass().isAssignableFrom(Class.forName(sPlugin))) {
+                    sImplementations.add(sPlugin);
+                }
+            } catch (ClassNotFoundException e) {
+            }
+        }
+        return sImplementations.toArray(new String[0]);
+    }
+
+    /**
+     * Extract description from @Description annotation
+     * but only if the description is inheritable *
+     */
+    String getInheritableDescription(Class<?> pluginClass) {
+        String sStr = "";
+        Class<?> superClass = pluginClass.getSuperclass();
+        if (superClass != null) {
+            String sSuper = getInheritableDescription(superClass);
+            if (sSuper != null) {
+                sStr += sSuper + "<br/>";
+            }
+        }
+        Annotation[] classAnnotations = pluginClass.getAnnotations();
+        for (Annotation annotation : classAnnotations) {
+            if (annotation instanceof Description) {
+                Description description = (Description) annotation;
+                if (description.isInheritable()) {
+                    sStr += description.value();
+                } else {
+                    return null;
+                }
+            }
+        }
+        return sStr;
+    }
+
+    /**
+     * Create page for individual plug-in *
+     */
+    void createPluginPage(String sPlugin) throws Exception {
+        PrintStream out = new PrintStream(m_sDir + "/" + sPlugin + ".html");
+        try {
+            out.print(getHTML(sPlugin, true));
+        } catch (Exception e) {
+            System.err.println("Page creation failed for " + sPlugin + ": " + e.getMessage());
+        }
+    } // createPluginPage
+
+
+    public String getHTML(String sPlugin, boolean bUseExternalStyleSheet) throws Exception {
+        StringBuffer buf = new StringBuffer();
+        buf.append("<html>\n<head>\n<title>BEAST " + version.getVersionString() + " Documentation: " + sPlugin + "</title>\n");
+        if (bUseExternalStyleSheet) {
+            buf.append("<link rel='StyleSheet' href='/tmp/styles.css' type='text/css'>\n");
+        } else {
+            buf.append("<style type='text/css'>\n");
+            buf.append(getCSS());
+            buf.append("</style>\n");
+        }
+        buf.append("</head>\n");
+        buf.append("<body>\n");
+        buf.append("<h1>BEAST " + version.getVersionString() + " Documentation: " + sPlugin + "</h1>\n");
+        BEASTObject plugin = (BEASTObject) Class.forName(sPlugin).newInstance();
+
+        // show all implementation of this plug-in
+        String[] sImplementations = m_isa.get(sPlugin);
+        if (sImplementations == null) {
+            // this class is not documented, perhaps outside ClassDiscover path?
+            buf.append("No documentation available for " + sPlugin + ". Perhaps it is not in the ClassDiscovery path\n");
+            buf.append("</body>\n");
+            buf.append("</html>\n");
+            return buf.toString();
+        }
+
+        if (sImplementations.length > 0) {
+            buf.append("<table border='1px'>\n");
+            buf.append("<thead><tr><td>implemented by the following</td></tr></thead>\n");
+            for (String sImp : sImplementations) {
+                buf.append("<tr><td><a href='" + sImp + ".html'>" + sImp + "</a></td></tr>\n");
+            }
+            buf.append("</table>\n");
+        }
+
+        // show descriptions of all plug-ins implemented by this plug in...
+        buf.append("<p>" + m_descriptions.get(sPlugin) + "</p>\n");
+
+        // show citation (if any)
+        Citation citation = plugin.getCitation();
+        if (citation != null) {
+            buf.append("<h2>Reference:</h2><p>" + citation.value() + "</p>\n");
+            if (citation.DOI().length() > 0) {
+                buf.append("<p><a href=\"http://dx.doi.org/" + citation.DOI() + "\">doi:" + citation.DOI() + "</a></p>\n");
+            }
+        }
+
+        // show if this is Loggable
+        if (m_sLoggables.contains(sPlugin)) {
+            buf.append("<p>Logable:");
+            buf.append(" yes, this can be used in a log.");
+            buf.append("</p>\n");
+//        } else {
+//        	buf.append(" no, this cannot be used in a log.");
+        }
+
+        // show short list its inputs
+        buf.append("<h2>Inputs:</h2>\n");
+        buf.append("<p>");
+        List<Input<?>> inputs = plugin.listInputs();
+        for (Input<?> input : inputs) {
+        	buf.append("<a href='#" + input.getName()+"'>" + input.getName() + "</a>, ");
+        }
+        buf.delete(buf.length() - 3, buf.length()-1);
+        buf.append("</p>\n");
+        
+        // list its inputs
+        if (inputs.size() == 0) {
+            buf.append("<none>");
+        }
+        for (Input<?> input : inputs) {
+        	buf.append("<p>&nbsp</p>");
+            buf.append("<table id='" + input.getName() + "' border='1px' width='90%'>\n");
+            buf.append("<caption>" + input.getName() + "</caption>\n");
+            buf.append("<thead><tr bgcolor='#AAAAAA'><td>type: " + getType(plugin, input.getName()) + "</td></tr></thead>\n");
+            buf.append("<tr><td>" + input.getTipText() + "</td></tr>\n");
+            buf.append("<tr><td>\n");
+            switch (input.getRule()) {
+                case OPTIONAL:
+                    buf.append("Optional input");
+                    if (input.defaultValue != null) {
+                        if (input.defaultValue instanceof Integer ||
+                                input.defaultValue instanceof Double ||
+                                input.defaultValue instanceof Boolean ||
+                                input.defaultValue instanceof String) {
+                            buf.append(". Default: " + input.defaultValue.toString());
+                        }
+                    }
+                    break;
+                case REQUIRED:
+                    buf.append("Required input");
+                    break;
+                case XOR:
+                    buf.append("Either this, or " + input.getOther().getName() + " needs to be specified");
+                    break;
+            }
+            buf.append("</td></tr>\n");
+            buf.append("</table>\n");
+        }
+        buf.append("</body>\n");
+        buf.append("</html>\n");
+        return buf.toString();
+    } // getHTML
+
+    /**
+     * determine type of input of a plug in with name sName
+     */
+    String getType(BEASTObject plugin, String sName) {
+        try {
+            Field[] fields = plugin.getClass().getFields();
+            for (int i = 0; i < fields.length; i++) {
+                if (fields[i].getType().isAssignableFrom(Input.class)) {
+                    Input<?> input = (Input<?>) fields[i].get(plugin);
+                    if (input.getName().equals(sName)) {
+                        Type t = fields[i].getGenericType();
+                        Type[] genericTypes = ((ParameterizedType) t).getActualTypeArguments();
+                        if (input.getType() != null) {
+                            return (input.getType().isAssignableFrom(BEASTObject.class) ? "<a href='" + input.getType().getName() + ".html'>" : "") +
+                                    input.getType().getName() +
+                                    (input.get() != null && input.get() instanceof List<?> ? "***" : "") +
+                                    (input.getType().isAssignableFrom(BEASTObject.class) ? "</a>" : "");
+                        }
+                        if (input.get() != null && input.get() instanceof List<?>) {
+                            Type[] genericTypes2 = ((ParameterizedType) genericTypes[0]).getActualTypeArguments();
+                            Class<?> _class = (Class<?>) genericTypes2[0];
+                            Object o = null;
+                            try {
+                                o = Class.forName(_class.getName()).newInstance();
+                            } catch (Exception e) {
+                            }
+                            if (o != null && o instanceof BEASTObject) {
+                                return "<a href='" + _class.getName() + ".html'>" + _class.getName() + "***</a>";
+                            } else {
+                                return _class.getName() + "***";
+                            }
+                        } else {
+                            Class<?> genericType = (Class<?>) genericTypes[0];
+                            Class<?> _class = genericType;
+                            Object o = null;
+                            try {
+                                o = Class.forName(_class.getName()).newInstance();
+                            } catch (Exception e) {
+                            }
+                            if (o != null && o instanceof BEASTObject) {
+                                return "<a href='" + _class.getName() + ".html'>" + _class.getName() + "</a>";
+                            } else {
+                                return _class.getName();
+                            }
+                        }
+                    }
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return "?";
+    } // getType
+
+    /**
+     * generate set of documents for plug ins
+     * including index page + frame
+     * individual pages for each plug in
+     * *
+     */
+    public void generateDocs() throws Exception {
+        // first, produce CSS & index page
+        createCSS();
+        createIndex();
+        // next, produce pages for individual plug-ins
+        for (String sPlugin : m_sPluginNames) {
+            createPluginPage(sPlugin);
+        }
+    } // generateDocs
+
+
+    /**
+     * Usage: DocMaker <target directory>
+     * where <target directory> is the place where the HTML files
+     * should go. Default directory is /tmp
+     */
+    public static void main(String[] args) {
+        try {
+            System.err.println("Producing documentation...");
+            AddOnManager.loadExternalJars();
+            DocMaker b = new DocMaker(args);
+            b.generateDocs();
+            System.err.println("Done!!!");
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    } // main
+
+
+} // BeastDocMaker
diff --git a/src/beast/app/ModelBuilder.java b/src/beast/app/ModelBuilder.java
new file mode 100644
index 0000000..a9221ee
--- /dev/null
+++ b/src/beast/app/ModelBuilder.java
@@ -0,0 +1,88 @@
+/*
+* File ModelBuilder.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+package beast.app;
+
+
+
+import javax.imageio.ImageIO;
+import javax.swing.*;
+
+import beast.util.AddOnManager;
+import beast.util.Randomizer;
+
+
+import java.awt.*;
+import java.net.URL;
+
+
+/**
+ * Program for drawing BEAST 2.0 models.
+ * This is a bit of a clutch... but potentially useful.
+ * <p/>
+ * *
+ */
+
+public class ModelBuilder extends JPanel {
+    /**
+     * for serialisation
+     */
+    static final long serialVersionUID = 1L;
+
+    public static void main(String args[]) {
+        Randomizer.setSeed(127);
+        try {
+            AddOnManager.loadExternalJars();
+        } catch (Exception e) {
+            e.printStackTrace();// ignore
+        }
+        JFrame f = new JFrame("Model Builder");
+        beast.app.draw.ModelBuilder drawTest = new beast.app.draw.ModelBuilder();
+        drawTest.init();
+        JMenuBar menuBar = drawTest.makeMenuBar();
+        f.setJMenuBar(menuBar);
+
+        f.add(drawTest.m_jTbTools, BorderLayout.NORTH);
+        f.add(drawTest.g_panel, BorderLayout.CENTER);
+
+        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+//        java.net.URL tempURL = ClassLoader.getSystemResource(beast.app.draw.ModelBuilder.ICONPATH + "/GenerationD.png");
+        try {
+            URL url = (URL) ClassLoader.getSystemResource(beast.app.draw.ModelBuilder.ICONPATH + "/GenerationD.png");
+            ImageIcon icon = new ImageIcon(url);
+            f.setIconImage(icon.getImage());
+        } catch (Exception e) {
+            System.err.println("error loading icon");
+            e.printStackTrace();
+            // ignore
+        }
+        //drawTest.m_doc.loadFile("G:\\eclipse\\workspace\\var\\test2.xdl");
+        if (args.length > 0) {
+            drawTest.m_doc.loadFile(args[0]);
+            drawTest.setDrawingFlag();
+        }
+        f.setSize(600, 800);
+        f.setVisible(true);
+    } // main
+}
diff --git a/src/beast/app/beastapp/BeastDialog.java b/src/beast/app/beastapp/BeastDialog.java
new file mode 100644
index 0000000..15742d5
--- /dev/null
+++ b/src/beast/app/beastapp/BeastDialog.java
@@ -0,0 +1,252 @@
+package beast.app.beastapp;
+
+import jam.html.SimpleLinkListener;
+import jam.mac.Utils;
+import jam.panels.OptionsPanel;
+
+import javax.swing.*;
+import javax.swing.border.EmptyBorder;
+import javax.swing.border.TitledBorder;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+import javax.swing.filechooser.FileFilter;
+
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.File;
+
+
+public class BeastDialog {
+    private final JFrame frame;
+
+    private final OptionsPanel optionPanel;
+
+    private final WholeNumberField seedText = new WholeNumberField((long) 1, Long.MAX_VALUE);
+    //    private final JCheckBox overwriteCheckBox = new JCheckBox("Allow overwriting of log files");
+    private final JComboBox logginMode = new JComboBox(new String[]{"default: only write new log files",
+            "overwrite: overwrite log files",
+            "resume: appends log to existing files (if any)"});
+
+    private final JCheckBox beagleCheckBox = new JCheckBox("Use BEAGLE library if available:");
+    private final JCheckBox beagleInfoCheckBox = new JCheckBox("Show list of available BEAGLE resources and Quit");
+    private final JComboBox beagleResourceCombo = new JComboBox(new Object[]{"CPU", "GPU"});
+    private final JCheckBox beagleSSECheckBox = new JCheckBox("Use CPU's SSE extensions");
+    private final JComboBox beaglePrecisionCombo = new JComboBox(new Object[]{"Double", "Single"});
+
+    private final JComboBox threadsCombo = new JComboBox(new Object[]{"Automatic", 0, 1, 2, 3, 4, 5, 6, 7, 8});
+
+    private File inputFile = null;
+
+    public BeastDialog(final JFrame frame, final String titleString, final Icon icon) {
+        this.frame = frame;
+
+        optionPanel = new OptionsPanel(12, 12);
+
+        //this.frame = frame;
+
+//        JPanel panel = new JPanel(new BorderLayout());
+//        panel.setOpaque(false);
+
+        final JLabel titleText = new JLabel(titleString);
+        titleText.setIcon(icon);
+        optionPanel.addSpanningComponent(titleText);
+        titleText.setFont(new Font("sans-serif", 0, 12));
+
+        final JButton inputFileButton = new JButton("Choose File...");
+        final JTextField inputFileNameText = new JTextField("not selected", 16);
+
+        inputFileButton.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent ae) {
+                File file = beast.app.util.Utils.getLoadFile("Load xml file", inputFile, "Beast xml files", "xml");
+                if (file != null) {
+                    inputFile = file;
+                    inputFileNameText.setText(inputFile.getName());
+                }
+
+//            	if (!Utils.isMacOSX()) {
+//	        		JFileChooser fc = new JFileChooser(System.getProperty("user.dir"));
+//	        		fc.addChoosableFileFilter(new FileFilter() {
+//	        			public boolean accept(File f) {
+//	        				if (f.isDirectory()) {
+//	        					return true;
+//	        				}
+//	        				String name = f.getName().toLowerCase();
+//	        				if (name.endsWith(".xml")) {
+//	        					return true;
+//	        				}
+//	        				return false;
+//	        			}
+//	
+//	        			// The description of this filter
+//	        			public String getDescription() {
+//	        				return "xml files";
+//	        			}
+//	        		});
+//	
+//	        		fc.setDialogTitle("Load xml file");
+//	        		int rval = fc.showOpenDialog(null);
+//	        		if (rval == JFileChooser.APPROVE_OPTION) {
+//	                    inputFile = fc.getSelectedFile();
+//	                    inputFileNameText.setText(inputFile.getName());
+//	        		}
+//                } else {
+//                    FileDialog dialog = new FileDialog(frame,
+//                            "Select target file...",
+//                            FileDialog.LOAD);
+//
+//                    dialog.setVisible(true);
+//                    if (dialog.getFile() == null) {
+//                        // the dialog was cancelled...
+//                        return;
+//                    }
+//
+//                    inputFile = new File(dialog.getDirectory(), dialog.getFile());
+//                    inputFileNameText.setText(inputFile.getName());
+//
+//                }
+            }
+        });
+        inputFileNameText.setEditable(false);
+
+        JPanel panel1 = new JPanel(new BorderLayout(0, 0));
+        panel1.add(inputFileNameText, BorderLayout.CENTER);
+        panel1.add(inputFileButton, BorderLayout.EAST);
+        optionPanel.addComponentWithLabel("BEAST XML File: ", panel1);
+
+        optionPanel.addComponent(logginMode);
+//        optionPanel.addComponent(overwriteCheckBox);
+
+        optionPanel.addSeparator();
+
+        seedText.setColumns(12);
+        optionPanel.addComponentWithLabel("Random number seed: ", seedText);
+
+        optionPanel.addComponentWithLabel("Thread pool size: ", threadsCombo);
+
+        optionPanel.addSeparator();
+
+        optionPanel.addSpanningComponent(beagleCheckBox);
+        beagleCheckBox.setSelected(true);
+
+        final OptionsPanel optionPanel1 = new OptionsPanel(0, 12);
+//        optionPanel1.setBorder(BorderFactory.createEmptyBorder());
+        optionPanel1.setBorder(new TitledBorder(""));
+
+        OptionsPanel optionPanel2 = new OptionsPanel(0, 12);
+        optionPanel2.setBorder(BorderFactory.createEmptyBorder());
+        final JLabel label1 = optionPanel2.addComponentWithLabel("Prefer use of: ", beagleResourceCombo);
+//        optionPanel2.addComponent(beagleSSECheckBox);
+        beagleSSECheckBox.setSelected(true);
+        final JLabel label2 = optionPanel2.addComponentWithLabel("Prefer precision: ", beaglePrecisionCombo);
+        optionPanel2.addComponent(beagleInfoCheckBox);
+
+        optionPanel1.addComponent(optionPanel2);
+
+        final JEditorPane beagleInfo = new JEditorPane("text/html",
+                "<html><div style=\"font-family:sans-serif;font-size:12;\"><p>BEAGLE is a high-performance phylogenetic library that can make use of<br>" +
+                        "additional computational resources such as graphics boards. It must be<br>" +
+                        "downloaded and installed independently of BEAST:</p>" +
+                        "<pre><a href=\"http://beagle-lib.googlecode.com/\">http://beagle-lib.googlecode.com/</a></pre></div>");
+        beagleInfo.setOpaque(false);
+        beagleInfo.setEditable(false);
+        beagleInfo.addHyperlinkListener(new SimpleLinkListener());
+        optionPanel1.addComponent(beagleInfo);
+
+        optionPanel.addSpanningComponent(optionPanel1);
+
+        beagleInfoCheckBox.setEnabled(false);
+        beagleCheckBox.addChangeListener(new ChangeListener() {
+            public void stateChanged(ChangeEvent e) {
+                beagleInfo.setEnabled(beagleCheckBox.isSelected());
+                beagleInfoCheckBox.setEnabled(beagleCheckBox.isSelected());
+                label1.setEnabled(beagleCheckBox.isSelected());
+                beagleResourceCombo.setEnabled(beagleCheckBox.isSelected());
+                beagleSSECheckBox.setEnabled(beagleCheckBox.isSelected());
+                label2.setEnabled(beagleCheckBox.isSelected());
+                beaglePrecisionCombo.setEnabled(beagleCheckBox.isSelected());
+            }
+        });
+
+        beagleCheckBox.setSelected(false);
+        beagleResourceCombo.setSelectedItem("CPU");
+    }
+
+    public boolean showDialog(String title, long seed) {
+
+        JOptionPane optionPane = new JOptionPane(optionPanel,
+                JOptionPane.PLAIN_MESSAGE,
+                JOptionPane.OK_CANCEL_OPTION,
+                null,
+                new String[]{"Run", "Quit"},
+                "Run");
+        optionPane.setBorder(new EmptyBorder(12, 12, 12, 12));
+
+        seedText.setValue(seed);
+
+        final JDialog dialog = optionPane.createDialog(frame, title);
+        //dialog.setResizable(true);
+        dialog.pack();
+
+        dialog.setVisible(true);
+
+        if (optionPane.getValue() == null) {
+            System.exit(0);
+        }
+
+        return optionPane.getValue().equals("Run");
+    }
+
+    public long getSeed() {
+        return seedText.getLongValue();
+    }
+
+//    public boolean allowOverwrite() {
+//        return overwriteCheckBox.isSelected();
+//    }
+
+    public int getLogginMode() {
+        return logginMode.getSelectedIndex();
+    }
+
+    public boolean useBeagle() {
+        return beagleCheckBox.isSelected();
+    }
+
+    public boolean preferBeagleGPU() {
+        return beagleResourceCombo.getSelectedItem().equals("GPU");
+    }
+
+    public boolean preferBeagleCPU() {
+        return beagleResourceCombo.getSelectedItem().equals("CPU");
+    }
+
+    public boolean preferBeagleSSE() {
+        // for the moment we will alway use SSE if CPU is selected...
+        return preferBeagleCPU();
+    }
+
+    public boolean preferBeagleSingle() {
+        return beaglePrecisionCombo.getSelectedItem().equals("Single");
+    }
+
+    public boolean preferBeagleDouble() {
+        return beaglePrecisionCombo.getSelectedItem().equals("Double");
+    }
+
+    public boolean showBeagleInfo() {
+        return beagleInfoCheckBox.isSelected();
+    }
+
+    public int getThreadPoolSize() {
+        if (threadsCombo.getSelectedIndex() == 0) {
+            // Automatic
+            return -1;
+        }
+        return (Integer) threadsCombo.getSelectedItem();
+    }
+
+    public File getInputFile() {
+        return inputFile;
+    }
+}
\ No newline at end of file
diff --git a/src/beast/app/beastapp/BeastLauncher.java b/src/beast/app/beastapp/BeastLauncher.java
new file mode 100644
index 0000000..e50c6bc
--- /dev/null
+++ b/src/beast/app/beastapp/BeastLauncher.java
@@ -0,0 +1,152 @@
+package beast.app.beastapp;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.net.URLDecoder;
+
+import javax.swing.JOptionPane;
+
+import beast.core.util.Log;
+
+
+/**
+ * Loads beast.jar and launches BEAST through the BEASTMain class
+ * 
+ * This class should be compiled against 1.6 and packaged by itself. The
+ * remained of BEAST can be compiled against Java 1.8
+ * **/
+public class BeastLauncher {
+
+	public static void main(String[] args) throws Exception {
+		if (javaVersionCheck("BEAST")) {
+			loadBEASTJars();
+			BeastMain.main(args);
+		}
+	}
+
+	/**
+	 * Load jars. The path is relative to the parent directory of the jar
+	 * containing this class, taking the lib directory. This is meant only to
+	 * load beast.jar and perhaps some other libraries, not all packages.
+	 **/
+	static protected void loadBEASTJars() throws IOException, NoSuchMethodException, SecurityException, ClassNotFoundException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
+		BeastLauncher clu = new BeastLauncher();
+		String launcherJar = clu.getClass().getProtectionDomain().getCodeSource().getLocation().getPath();
+		// deal with special characters and spaces in path
+		launcherJar = URLDecoder.decode(launcherJar, "UTF-8");
+
+		// TODO remove following debugging code
+		try {
+			FileWriter outfile = new FileWriter("/tmp/beast.log");
+			outfile.write("jardir = " + launcherJar);
+			outfile.close();
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+
+		System.err.println("jardir = " + launcherJar);
+		File jarDir0 = new File(launcherJar).getParentFile();
+		boolean foundOne = false;
+		while ((!foundOne) && (jarDir0 != null)) { // && jarDir0.exists() &&
+											// jarDir0.isDirectory()) {
+			foundOne = checkForBEAST(jarDir0, clu);
+			foundOne = foundOne ||
+			    checkForBEAST((isWindows() ? new File(jarDir0.getAbsolutePath() + "\\lib") : new File(jarDir0.getAbsolutePath() + "/lib")), clu);
+			
+			jarDir0 = jarDir0.getParentFile();
+		}
+		
+		if (!foundOne) {
+			Log.warning.println("WARNING: could not find beast.jar");
+			// if beast.jar or its classes are not already in the class path (as is when launched e.g. as developer)
+			// the next line will fail
+		}
+		
+		// initialise beast.jar
+        Method method = Class.forName("beast.evolution.alignment.Alignment").getMethod("findDataTypes");
+        method.invoke(null);
+
+	}
+
+	private static boolean checkForBEAST(File jarDir, Object clu) throws IOException {
+		System.err.println("Checking out " + jarDir.getAbsolutePath());
+		boolean foundOne = false;
+		if (jarDir.exists()) {
+			URL url = new URL("file://" + (isWindows() ? "/" : "") + jarDir.getAbsolutePath() + "/beast.jar");
+			if (new File(jarDir.getAbsoluteFile()+File.separator+"beast.jar").exists()) {
+				URLClassLoader sysLoader = (URLClassLoader) clu.getClass().getClassLoader();
+				Class<?> sysclass = URLClassLoader.class;
+				try {
+					// Parameters
+					Class<?>[] parameters = new Class[] { URL.class };
+					Method method = sysclass.getDeclaredMethod("addURL", parameters);
+					method.setAccessible(true);
+					method.invoke(sysLoader, new Object[] { url });
+					System.err.println("Loaded URL " + url);
+					foundOne = true;
+				} catch (Throwable t) {
+					t.printStackTrace();
+					throw new IOException("Error, could not add URL to system classloader");
+				}
+		        String classpath = System.getProperty("java.class.path");
+		        String sJar = url + "";
+		        classpath += System.getProperty("path.separator") + sJar.substring(5);
+		        System.setProperty("java.class.path", classpath);
+			}
+		}
+		return foundOne;
+	}
+
+	static boolean isMac() {
+		return System.getProperty("os.name").toLowerCase().startsWith("mac");
+	}
+
+	static boolean isWindows() {
+		return System.getProperty("os.name").toLowerCase().startsWith("windows");
+	}
+
+	static boolean isLinux() {
+		return System.getProperty("os.name").toLowerCase().startsWith("linux");
+	}
+
+	/** make sure we run Java version 8 or better **/
+	static protected boolean javaVersionCheck(String app) {
+		String javaVersion = System.getProperty("java.version");
+		// javaVersion should be something like "1.7.0_25"
+		String[] version = javaVersion.split("\\.");
+		if (version.length > 2) {
+			try {
+				int majorVersion = Integer.parseInt(version[1]);
+				if (majorVersion <= 7) {
+					String JAVA_VERSION_MSG = "<html>" + app + " requires Java version 8,<br>" + "but the current version is " + majorVersion
+							+ ".<br><br>" + "You can get Java from <a href='https://www.java.com/en/'>https://www.java.com/</a>.<br><br> "
+							+ "Continuing, but expect the unexpected.</html>";
+					if (!java.awt.GraphicsEnvironment.isHeadless()) {
+						JOptionPane.showMessageDialog(null, JAVA_VERSION_MSG);
+					} else {
+						JAVA_VERSION_MSG = JAVA_VERSION_MSG.replaceAll("<br>", "\n");
+						JAVA_VERSION_MSG = JAVA_VERSION_MSG.replaceAll("<[^<]*>", "");
+						System.err.println(JAVA_VERSION_MSG);
+					}
+					return true;
+				}
+			} catch (NumberFormatException e) {
+				// We only get here if the JVM does not return the expected
+				// string format when asked for java.version.
+				// hope for the best
+			}
+			return true;
+		}
+		// We only get here if the JVM does not return the expected
+		// string format when asked for java.version.
+		// hope for the best
+		return true;
+	}
+
+}
diff --git a/src/beast/app/beastapp/BeastMain.java b/src/beast/app/beastapp/BeastMain.java
new file mode 100644
index 0000000..f47ddcd
--- /dev/null
+++ b/src/beast/app/beastapp/BeastMain.java
@@ -0,0 +1,622 @@
+package beast.app.beastapp;
+
+import beagle.BeagleFlag;
+import beagle.BeagleInfo;
+import beast.app.BEASTVersion;
+import beast.app.BeastMCMC;
+import beast.app.util.Arguments;
+import beast.app.util.ErrorLogHandler;
+import beast.app.util.MessageLogHandler;
+import beast.app.util.Utils;
+import beast.app.util.Version;
+import beast.core.util.Log;
+import beast.util.Randomizer;
+import beast.util.XMLParserException;
+import jam.util.IconUtils;
+
+import javax.swing.*;
+import javax.swing.filechooser.FileFilter;
+
+import java.awt.*;
+import java.io.File;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintStream;
+import java.util.*;
+import java.util.List;
+import java.util.logging.*;
+
+public class BeastMain {
+
+    private final static Version version = new BEASTVersion();
+
+    static class BeastConsoleApp extends jam.console.ConsoleApplication {
+
+        public BeastConsoleApp(final String nameString, final String aboutString, final javax.swing.Icon icon) throws IOException {
+            super(nameString, aboutString, icon, false);
+            getDefaultFrame().setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
+        }
+
+        public void doStop() {
+            // thread.stop is deprecated so need to send a message to running threads...
+//            Iterator iter = parser.getThreads();
+//            while (iter.hasNext()) {
+//                Thread thread = (Thread) iter.next();
+//                thread.stop(); // http://java.sun.com/j2se/1.5.0/docs/guide/misc/threadPrimitiveDeprecation.html
+//            }
+        }
+
+        public void setTitle(final String title) {
+            getDefaultFrame().setTitle(title);
+        }
+
+        BeastMCMC beastMCMC;
+    }
+
+    public BeastMain(final BeastMCMC beastMCMC, final BeastConsoleApp consoleApp, final int maxErrorCount) {
+
+        final Logger infoLogger = Logger.getLogger("beast.app");
+        try {
+
+            if (consoleApp != null) {
+                consoleApp.beastMCMC = beastMCMC;
+            }
+
+            // Add a handler to handle warnings and errors. This is a ConsoleHandler
+            // so the messages will go to StdOut..
+            final Logger logger = Logger.getLogger("beast");
+
+            Handler handler = new MessageLogHandler();
+            handler.setFilter(record -> record.getLevel().intValue() < Level.WARNING.intValue());
+            logger.addHandler(handler);
+
+//            // Add a handler to handle warnings and errors. This is a ConsoleHandler
+//            // so the messages will go to StdErr..
+//            handler = new ConsoleHandler();
+//            handler.setFilter(new Filter() {
+//                public boolean isLoggable(LogRecord record) {
+//                    if (verbose) {
+//                        return record.getLevel().intValue() >= Level.WARNING.intValue();
+//                    } else {
+//                        return record.getLevel().intValue() >= Level.SEVERE.intValue();
+//                    }
+//                }
+//            });
+//            logger.addHandler(handler);
+
+            logger.setUseParentHandlers(false);
+
+//            infoLogger.info("Parsing XML file: " + fileName);
+//            infoLogger.info("  File encoding: " + fileReader.getEncoding());
+
+            // This is a special logger that is for logging numerical and statistical errors
+            // during the MCMC run. It will tolerate up to maxErrorCount before throwing a
+            // RuntimeException to shut down the run.
+            //Logger errorLogger = Logger.getLogger("error");
+            handler = new ErrorLogHandler(maxErrorCount);
+            handler.setLevel(Level.WARNING);
+            logger.addHandler(handler);
+
+            beastMCMC.run();
+
+        } catch (java.io.IOException ioe) {
+            infoLogger.severe("File error: " + ioe.getMessage());
+            /* Catch exceptions and report useful information
+
+        }  catch (org.xml.sax.SAXParseException spe) {
+            if (spe.getMessage() != null && spe.getMessage().equals("Content is not allowed in prolog")) {
+                infoLogger.severe("Parsing error - the input file, " + fileName + ", is not a valid XML file.");
+            } else {
+                infoLogger.severe("Error running file: " + fileName);
+                infoLogger.severe("Parsing error - poorly formed XML (possibly not an XML file):\n" +
+                        spe.getMessage());
+            }
+        } catch (org.w3c.dom.DOMException dome) {
+            infoLogger.severe("Error running file: " + fileName);
+            infoLogger.severe("Parsing error - poorly formed XML:\n" +
+                    dome.getMessage());
+        } catch (dr.xml.XMLParseException pxe) {
+            if (pxe.getMessage() != null && pxe.getMessage().equals("Unknown root document element, beauti")) {
+                infoLogger.severe("Error running file: " + fileName);
+                infoLogger.severe(
+                        "The file you just tried to run in BEAST is actually a BEAUti document.\n" +
+                                "Although this uses XML, it is not a format that BEAST understands.\n" +
+                                "These files are used by BEAUti to save and load your settings so that\n" +
+                                "you can go back and alter them. To generate a BEAST file you must\n" +
+                                "select the 'Generate BEAST File' option, either from the File menu or\n" +
+                                "the button at the bottom right of the window.");
+
+            } else {
+                infoLogger.severe("Parsing error - poorly formed BEAST file, " + fileName + ":\n" +
+                        pxe.getMessage());
+            }
+
+        } catch (RuntimeException rex) {
+            if (rex.getMessage() != null && rex.getMessage().startsWith("The initial posterior is zero")) {
+                infoLogger.warning("Error running file: " + fileName);
+                infoLogger.severe(
+                        "The initial model is invalid because state has a zero probability.\n\n" +
+                                "If the log likelihood of the tree is -Inf, his may be because the\n" +
+                                "initial, random tree is so large that it has an extremely bad\n" +
+                                "likelihood which is being rounded to zero.\n\n" +
+                                "Alternatively, it may be that the product of starting mutation rate\n" +
+                                "and tree height is extremely small or extremely large. \n\n" +
+                                "Finally, it may be that the initial state is incompatible with\n" +
+                                "one or more 'hard' constraints (on monophyly or bounds on parameter\n" +
+                                "values. This will result in Priors with zero probability.\n\n" +
+                                "The individual components of the posterior are as follows:\n" +
+                                rex.getMessage() + "\n" +
+                                "For more information go to <http://beast.bio.ed.ac.uk/>.");
+            } else {
+                // This call never returns as another RuntimeException exception is raised by
+                // the error log handler???
+                infoLogger.warning("Error running file: " + fileName);
+                System.err.println("Fatal exception: " + rex.getMessage());
+                rex.printStackTrace(System.err);
+            }
+            */
+        } catch (XMLParserException e) {
+            System.out.println(e.getMessage());
+            //e.printStackTrace();
+        } catch (Exception e) {
+            e.printStackTrace(System.err);
+        }
+//            infoLogger.warning("Error running file: " + fileName);
+//            infoLogger.severe("Fatal exception: " + ex.getMessage());
+//            System.err.println("Fatal exception: " + ex.getMessage());
+//            ex.printStackTrace(System.err);
+//        }
+    }
+
+    static String getFileNameByDialog(final String title) {
+        final JFileChooser fc = new JFileChooser(System.getProperty("user.dir"));
+        fc.addChoosableFileFilter(new FileFilter() {
+            public boolean accept(final File f) {
+                if (f.isDirectory()) {
+                    return true;
+                }
+                final String name = f.getName().toLowerCase();
+                if (name.endsWith(".xml")) {
+                    return true;
+                }
+                return false;
+            }
+
+            // The description of this filter
+            public String getDescription() {
+                return "xml files";
+            }
+        });
+
+        fc.setDialogTitle(title);
+        final int rval = fc.showOpenDialog(null);
+
+        if (rval == JFileChooser.APPROVE_OPTION) {
+            return fc.getSelectedFile().toString();
+        }
+        return null;
+    } // getFileNameByDialog
+
+
+    public static void centreLine(final String line, final int pageWidth) {
+        final int n = pageWidth - line.length();
+        final int n1 = n / 2;
+        for (int i = 0; i < n1; i++) {
+            System.out.print(" ");
+        }
+        System.out.println(line);
+    }
+
+    public static void printTitle() {
+
+        int pageWidth = 72;
+
+        System.out.println();
+        centreLine("BEAST " + version.getVersionString() + ", " + version.getDateString(), pageWidth);
+        centreLine("Bayesian Evolutionary Analysis Sampling Trees", pageWidth);
+        for (final String creditLine : version.getCredits()) {
+            centreLine(creditLine, pageWidth);
+        }
+        System.out.println();
+    }
+
+    public static void printUsage(final Arguments arguments) {
+
+        arguments.printUsage("beast", "[<input-file-name>]");
+        System.out.println();
+        System.out.println("  Example: beast test.xml");
+        System.out.println("  Example: beast -window test.xml");
+        System.out.println("  Example: beast -help");
+        System.out.println();
+    }
+
+    //Main method
+    public static void main(final String[] args) throws java.io.IOException {
+
+        final List<String> MCMCargs = new ArrayList<String>();
+//    	Utils.loadUIManager();
+
+        final Arguments arguments = new Arguments(
+                new Arguments.Option[]{
+
+//                        new Arguments.Option("verbose", "Give verbose XML parsing messages"),
+//                        new Arguments.Option("warnings", "Show warning messages about BEAST XML file"),
+//                        new Arguments.Option("strict", "Fail on non-conforming BEAST XML file"),
+                        new Arguments.Option("window", "Provide a console window"),
+                        new Arguments.Option("options", "Display an options dialog"),
+                        new Arguments.Option("working", "Change working directory to input file's directory"),
+                        new Arguments.LongOption("seed", "Specify a random number generator seed"),
+                        new Arguments.StringOption("prefix", "PREFIX", "Specify a prefix for all output log filenames"),
+                        new Arguments.StringOption("statefile", "STATEFILE", "Specify the filename for storing/restoring the state"),
+                        new Arguments.Option("overwrite", "Allow overwriting of log files"),
+                        new Arguments.Option("resume", "Allow appending of log files"),
+                        // RRB: not sure what effect this option has
+                        new Arguments.IntegerOption("errors", "Specify maximum number of numerical errors before stopping"),
+                        new Arguments.IntegerOption("threads", "The number of computational threads to use (default auto)"),
+                        new Arguments.Option("java", "Use Java only, no native implementations"),
+                        new Arguments.Option("noerr", "Suppress all output to standard error"),
+                        new Arguments.StringOption("loglevel", "LEVEL", "error,warning,info,debug,trace"),
+                        new Arguments.Option("beagle", "Use beagle library if available"),
+                        new Arguments.Option("beagle_info", "BEAGLE: show information on available resources"),
+                        new Arguments.StringOption("beagle_order", "order", "BEAGLE: set order of resource use"),
+                        new Arguments.IntegerOption("beagle_instances", "BEAGLE: divide site patterns amongst instances"),
+                        new Arguments.Option("beagle_CPU", "BEAGLE: use CPU instance"),
+                        new Arguments.Option("beagle_GPU", "BEAGLE: use GPU instance if available"),
+                        new Arguments.Option("beagle_SSE", "BEAGLE: use SSE extensions if available"),
+                        new Arguments.Option("beagle_single", "BEAGLE: use single precision if available"),
+                        new Arguments.Option("beagle_double", "BEAGLE: use double precision if available"),
+                        new Arguments.StringOption("beagle_scaling", new String[]{"default", "none", "dynamic", "always"},
+                                false, "BEAGLE: specify scaling scheme to use"),
+                        new Arguments.Option("help", "Print this information and stop"),
+                });
+
+        try {
+            arguments.parseArguments(args);
+        } catch (Arguments.ArgumentException ae) {
+            System.out.println();
+            System.out.println(ae.getMessage());
+            System.out.println();
+            printUsage(arguments);
+            System.exit(1);
+        }
+
+        if (arguments.hasOption("help")) {
+            printUsage(arguments);
+            System.exit(0);
+        }
+
+//        final boolean verbose = arguments.hasOption("verbose");
+//        final boolean parserWarning = arguments.hasOption("warnings"); // if dev, then auto turn on, otherwise default to turn off
+//        final boolean strictXML = arguments.hasOption("strict");
+        final boolean window = arguments.hasOption("window");
+        final boolean options = arguments.hasOption("options");
+        final boolean working = arguments.hasOption("working");
+        String fileNamePrefix = null;
+        String stateFileName = null;
+        //boolean allowOverwrite = arguments.hasOption("overwrite");
+
+        long seed = Randomizer.getSeed();
+        boolean useJava = false;
+
+        int threadCount = 0;
+
+        if (arguments.hasOption("java")) {
+            useJava = true;
+        }
+
+        if (arguments.hasOption("prefix")) {
+            fileNamePrefix = arguments.getStringOption("prefix");
+        }
+
+        if (arguments.hasOption("statefile")) {
+        	stateFileName = arguments.getStringOption("statefile");
+        }
+
+        long beagleFlags = 0;
+
+        boolean useBeagle = arguments.hasOption("beagle") ||
+                arguments.hasOption("beagle_CPU") ||
+                arguments.hasOption("beagle_GPU") ||
+                arguments.hasOption("beagle_SSE") ||
+                arguments.hasOption("beagle_double") ||
+                arguments.hasOption("beagle_single") ||
+                arguments.hasOption("beagle_order") ||
+                arguments.hasOption("beagle_instances");
+
+        if (arguments.hasOption("beagle_scaling")) {
+            System.setProperty("beagle.scaling", arguments.getStringOption("beagle_scaling"));
+        }
+
+        boolean beagleShowInfo = arguments.hasOption("beagle_info");
+
+        if (arguments.hasOption("beagle_CPU")) {
+            beagleFlags |= BeagleFlag.PROCESSOR_CPU.getMask();
+        }
+        if (arguments.hasOption("beagle_GPU")) {
+            beagleFlags |= BeagleFlag.PROCESSOR_GPU.getMask();
+        }
+        if (arguments.hasOption("beagle_SSE")) {
+            beagleFlags |= BeagleFlag.PROCESSOR_CPU.getMask();
+            beagleFlags |= BeagleFlag.VECTOR_SSE.getMask();
+        }
+        if (arguments.hasOption("beagle_double")) {
+            beagleFlags |= BeagleFlag.PRECISION_DOUBLE.getMask();
+        }
+        if (arguments.hasOption("beagle_single")) {
+            beagleFlags |= BeagleFlag.PRECISION_SINGLE.getMask();
+        }
+
+        if (arguments.hasOption("noerr")) {
+		 	System.setErr(new PrintStream(new OutputStream() {
+		 		public void write(int b) {
+		 		}
+		 	}));
+        }        
+        
+        if (arguments.hasOption("beagle_order")) {
+            System.setProperty("beagle.resource.order", arguments.getStringOption("beagle_order"));
+        }
+
+        if (arguments.hasOption("beagle_instances")) {
+            System.setProperty("beagle.instance.count", Integer.toString(arguments.getIntegerOption("beagle_instances")));
+        }
+
+        if (arguments.hasOption("beagle_scaling")) {
+            System.setProperty("beagle.scaling", arguments.getStringOption("beagle_scaling"));
+        }
+
+        if (arguments.hasOption("threads")) {
+            threadCount = arguments.getIntegerOption("threads");
+            if (threadCount < 0) {
+                printTitle();
+                System.err.println("The number of threads should be >= 0");
+                System.exit(1);
+            }
+        }
+
+        if (arguments.hasOption("seed")) {
+            seed = arguments.getLongOption("seed");
+            if (seed <= 0) {
+                printTitle();
+                System.err.println("The random number seed should be > 0");
+                System.exit(1);
+            }
+        }
+
+        int maxErrorCount = 0;
+        if (arguments.hasOption("errors")) {
+            maxErrorCount = arguments.getIntegerOption("errors");
+            if (maxErrorCount < 0) {
+                maxErrorCount = 0;
+            }
+        }
+
+        BeastConsoleApp consoleApp = null;
+
+        final String nameString = "BEAST " + version.getVersionString();
+
+        if (window) {
+            Utils.loadUIManager();
+            System.setProperty("com.apple.macos.useScreenMenuBar", "true");
+            System.setProperty("apple.laf.useScreenMenuBar", "true");
+            System.setProperty("apple.awt.showGrowBox", "true");
+            System.setProperty("beast.useWindow", "true");
+
+            final javax.swing.Icon icon = IconUtils.getIcon(BeastMain.class, "images/beast.png");
+
+            final String aboutString = "<html><div style=\"font-family:sans-serif;\"><center>" +
+                    "<div style=\"font-size:12;\"><p>Bayesian Evolutionary Analysis Sampling Trees<br>" +
+                    "Version " + version.getVersionString() + ", " + version.getDateString() + "</p>" +
+                    version.getHTMLCredits() +
+                    "</div></center></div></html>";
+
+            consoleApp = new BeastConsoleApp(nameString, aboutString, icon);
+        }
+
+        printTitle();
+
+        File inputFile = null;
+
+        if (options) {
+
+            final String titleString = "<html><center><p>Bayesian Evolutionary Analysis Sampling Trees<br>" +
+                    "Version " + version.getVersionString() + ", " + version.getDateString() + "</p></center></html>";
+            final javax.swing.Icon icon = IconUtils.getIcon(BeastMain.class, "images/beast.png");
+
+            final BeastDialog dialog = new BeastDialog(new JFrame(), titleString, icon);
+
+            if (!dialog.showDialog(nameString, seed)) {
+                System.exit(0);
+            }
+
+//            if (dialog.allowOverwrite()) {
+//                allowOverwrite = true;
+//            }
+            switch (dialog.getLogginMode()) {
+                case 0:/* do not ovewrite */
+                    break;
+                case 1:
+                    MCMCargs.add("-overwrite");
+                    break;
+                case 2:
+                    MCMCargs.add("-resume");
+                    break;
+            }
+
+            seed = dialog.getSeed();
+            threadCount = dialog.getThreadPoolSize();
+
+            useBeagle = dialog.useBeagle();
+            if (useBeagle) {
+                beagleShowInfo = dialog.showBeagleInfo();
+                if (dialog.preferBeagleCPU()) {
+                    beagleFlags |= BeagleFlag.PROCESSOR_CPU.getMask();
+                }
+                if (dialog.preferBeagleSSE()) {
+                    beagleFlags |= BeagleFlag.VECTOR_SSE.getMask();
+                }
+                if (dialog.preferBeagleGPU()) {
+                    beagleFlags |= BeagleFlag.PROCESSOR_GPU.getMask();
+                }
+                if (dialog.preferBeagleDouble()) {
+                    beagleFlags |= BeagleFlag.PRECISION_DOUBLE.getMask();
+                }
+                if (dialog.preferBeagleSingle()) {
+                    beagleFlags |= BeagleFlag.PRECISION_SINGLE.getMask();
+                }
+            }
+
+            inputFile = dialog.getInputFile();
+            if (!beagleShowInfo && inputFile == null) {
+                System.err.println("No input file specified");
+                return;
+            }
+
+        } else {
+            if (arguments.hasOption("overwrite")) {
+                MCMCargs.add("-overwrite");
+            }
+
+            if (arguments.hasOption("resume")) {
+                MCMCargs.add("-resume");
+            }
+        }
+
+        if (beagleShowInfo) {
+            BeagleInfo.printResourceList();
+            return;
+        }
+
+        if (inputFile == null) {
+
+            final String[] args2 = arguments.getLeftoverArguments();
+
+            if (args2.length > 1) {
+                System.err.println("Unknown option: " + args2[1]);
+                System.err.println();
+                printUsage(arguments);
+                return;
+            }
+
+            String inputFileName = null;
+
+
+            if (args2.length > 0) {
+                inputFileName = args2[0];
+                inputFile = new File(inputFileName);
+            }
+
+            if (inputFileName == null) {
+                // No input file name was given so throw up a dialog box...
+            	String fileName = getFileNameByDialog("BEAST " + version.getVersionString() + " - Select XML input file");
+            	if (fileName == null) {
+            		System.exit(0);
+            	}
+                inputFile = new File(fileName);
+            }
+        }
+
+        if (inputFile != null && inputFile.getParent() != null && working) {
+            System.setProperty("file.name.prefix", inputFile.getParentFile().getAbsolutePath());
+        }
+
+        if (window) {
+            if (inputFile == null) {
+                consoleApp.setTitle("null");
+            } else {
+                consoleApp.setTitle(inputFile.getName());
+            }
+        }
+
+        if (useJava) {
+            System.setProperty("java.only", "true");
+        }
+
+        if (arguments.hasOption("loglevel")) {
+            String l = arguments.getStringOption("loglevel");
+            switch (l) {
+                case "error":
+                    Log.setLevel(Log.Level.error);
+                    break;
+                case "warning":
+                    Log.setLevel(Log.Level.warning);
+                    break;
+                case "info":
+                    Log.setLevel(Log.Level.info);
+                    break;
+	            case "debug":
+	                Log.setLevel(Log.Level.debug);
+	                break;
+	            case "trace":
+	                Log.setLevel(Log.Level.trace);
+	                break;
+            }
+        }
+
+        if (fileNamePrefix != null && fileNamePrefix.trim().length() > 0) {
+            System.setProperty("file.name.prefix", fileNamePrefix.trim());
+        }
+
+        if (stateFileName!= null && stateFileName.trim().length() > 0) {
+            System.setProperty("state.file.name", stateFileName.trim());
+            System.out.println("Writing state to file " + stateFileName);
+        }
+
+//        if (allowOverwrite) {
+//            System.setProperty("log.allow.overwrite", "true");
+//        }
+
+        if (beagleFlags != 0) {
+            System.setProperty("beagle.preferred.flags", Long.toString(beagleFlags));
+
+        }
+
+        if (threadCount > 0) {
+            System.setProperty("thread.count", String.valueOf(threadCount));
+            MCMCargs.add("-threads");
+            MCMCargs.add(threadCount + "");
+        }
+
+        MCMCargs.add("-seed");
+        MCMCargs.add(seed + "");
+        Randomizer.setSeed(seed);
+
+        System.out.println("Random number seed: " + seed);
+        System.out.println();
+
+        // Construct the beast object
+        final BeastMCMC beastMCMC = new BeastMCMC();
+
+        try {
+            // set all the settings...
+            MCMCargs.add(inputFile.getAbsolutePath());
+            beastMCMC.parseArgs(MCMCargs.toArray(new String[0]));
+            
+
+            new BeastMain(beastMCMC, consoleApp, maxErrorCount);
+        } catch (RuntimeException rte) {
+            if (window) {
+                // This sleep for 2 seconds is to ensure that the final message
+                // appears at the end of the console.
+                try {
+                    Thread.sleep(2000);
+                } catch (InterruptedException e) {
+                    e.printStackTrace();
+                }
+                System.out.println();
+                System.out.println("BEAST has terminated with an error. Please select QUIT from the menu.");
+            }
+            // logger.severe will throw a RTE but we want to keep the console visible
+        } catch (XMLParserException e) {
+            System.out.println(e.getMessage());
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        if (!window) {
+            System.exit(0);
+        }
+    }
+}
+
+
diff --git a/src/beast/app/beastapp/WholeNumberField.java b/src/beast/app/beastapp/WholeNumberField.java
new file mode 100644
index 0000000..46c253c
--- /dev/null
+++ b/src/beast/app/beastapp/WholeNumberField.java
@@ -0,0 +1,202 @@
+package beast.app.beastapp;
+
+import javax.swing.*;
+import javax.swing.event.*;
+import javax.swing.text.AttributeSet;
+import javax.swing.text.BadLocationException;
+import javax.swing.text.Document;
+import javax.swing.text.PlainDocument;
+import java.awt.*;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
+
+
+public class WholeNumberField extends JTextField
+        implements FocusListener, DocumentListener {
+
+    protected static char MINUS_CHAR = '-';
+    protected EventListenerList changeListeners = new EventListenerList();
+    protected long min;
+    protected long max;
+    protected boolean range_check = false;
+    protected boolean range_checked = false;
+
+    public WholeNumberField() {
+        this(Integer.MIN_VALUE, Integer.MAX_VALUE);
+    }
+
+    public WholeNumberField(int min, int max) {
+        super();
+        this.min = min;
+        this.max = max;
+        range_check = true;
+        this.addFocusListener(this);
+    }
+
+    public WholeNumberField(long min, long max) {
+        super();
+        this.min = min;
+        this.max = max;
+        range_check = true;
+        this.addFocusListener(this);
+    }
+
+    public void focusGained(FocusEvent evt) {
+    }
+
+    public void focusLost(FocusEvent evt) {
+        if (range_check && !range_checked) {
+            range_checked = true;
+            try {
+                long value = Long.valueOf(getText());
+                if (value < min || value > max) {
+                    errorMsg();
+                }
+            } catch (NumberFormatException e) {
+                errorMsg();
+            }
+        }
+    }
+
+    public void setText(Integer obj) {
+        setText(obj.toString());
+    }
+
+    protected void errorMsg() {
+        JOptionPane.showMessageDialog(this,
+                "Illegal entry\nValue must be between " + min + " and " +
+                        max + " inclusive", "Error", JOptionPane.ERROR_MESSAGE);
+    }
+
+    public void setValue(int value) {
+        if (range_check) {
+            if (value < min || value > max) {
+                errorMsg();
+                return;
+            }
+        }
+        setText(Integer.toString(value));
+    }
+
+    public void setValue(long value) {
+        if (range_check) {
+            if (value < min || value > max) {
+                errorMsg();
+                return;
+            }
+        }
+        setText(Long.toString(value));
+    }
+
+    public Integer getValue() {
+        try {
+            return new Integer(getText());
+        } catch (NumberFormatException e) {
+            return null;
+        }
+    }
+
+    public Long getLongValue() {
+        try {
+            return new Long(getText());
+        } catch (NumberFormatException e) {
+            return null;
+        }
+    }
+
+    public Integer getValue(int default_value) {
+        Integer value = getValue();
+        if (value == null)
+            return default_value;
+        else
+            return value;
+    }
+
+    public Long getValue(long default_value) {
+        Long value = getLongValue();
+        if (value == null)
+            return default_value;
+        else
+            return value;
+    }
+
+    protected Document createDefaultModel() {
+        Document doc = new WholeNumberFieldDocument();
+        doc.addDocumentListener(this);
+        return doc;
+    }
+
+    public void insertUpdate(DocumentEvent e) {
+        range_checked = false;
+        fireChanged();
+    }
+
+    public void removeUpdate(DocumentEvent e) {
+        range_checked = false;
+        fireChanged();
+    }
+
+    public void changedUpdate(DocumentEvent e) {
+        range_checked = false;
+        fireChanged();
+    }
+
+    static char[] numberSet = {
+            '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'
+    };
+
+    class WholeNumberFieldDocument extends PlainDocument {
+        public void insertString(int offs, String str, AttributeSet a)
+                throws BadLocationException {
+
+            if (str == null) return;
+            str = str.trim();
+
+            String buf = getText(0, offs) + str;
+            char[] array = buf.toCharArray();
+
+            if (array.length > 0) {
+                if (array[0] != MINUS_CHAR && !member(array[0], numberSet)) {
+                    Toolkit.getDefaultToolkit().beep();
+                    return;
+                }
+            }
+
+            for (int i = 1; i < array.length; i++) {
+                if (!member(array[i], numberSet)) {
+                    Toolkit.getDefaultToolkit().beep();
+                    return;
+                }
+            }
+            super.insertString(offs, str, a);
+        }
+    }
+
+    static boolean member(char item, char[] array) {
+        for (int i = 0; i < array.length; i++)
+            if (array[i] == item) return true;
+        return false;
+    }
+    //------------------------------------------------------------------------
+    // Event Methods
+    //------------------------------------------------------------------------
+
+    public void addChangeListener(ChangeListener x) {
+        changeListeners.add(ChangeListener.class, x);
+    }
+
+    public void removeChangeListener(ChangeListener x) {
+        changeListeners.remove(ChangeListener.class, x);
+    }
+
+    protected void fireChanged() {
+        ChangeEvent c = new ChangeEvent(this);
+        Object[] listeners = changeListeners.getListenerList();
+        for (int i = listeners.length - 2; i >= 0; i -= 2) {
+            if (listeners[i] == ChangeListener.class) {
+                ChangeListener cl = (ChangeListener) listeners[i + 1];
+                cl.stateChanged(c);
+            }
+        }
+    }
+}
diff --git a/src/beast/app/beastapp/images/beast.png b/src/beast/app/beastapp/images/beast.png
new file mode 100644
index 0000000..585b4d1
Binary files /dev/null and b/src/beast/app/beastapp/images/beast.png differ
diff --git a/src/beast/app/beauti/0.png b/src/beast/app/beauti/0.png
new file mode 100644
index 0000000..51106c1
Binary files /dev/null and b/src/beast/app/beauti/0.png differ
diff --git a/src/beast/app/beauti/1.png b/src/beast/app/beauti/1.png
new file mode 100644
index 0000000..761f30f
Binary files /dev/null and b/src/beast/app/beauti/1.png differ
diff --git a/src/beast/app/beauti/10.png b/src/beast/app/beauti/10.png
new file mode 100644
index 0000000..a6dcfae
Binary files /dev/null and b/src/beast/app/beauti/10.png differ
diff --git a/src/beast/app/beauti/11.png b/src/beast/app/beauti/11.png
new file mode 100644
index 0000000..54b70e8
Binary files /dev/null and b/src/beast/app/beauti/11.png differ
diff --git a/src/beast/app/beauti/12.png b/src/beast/app/beauti/12.png
new file mode 100644
index 0000000..cb0f668
Binary files /dev/null and b/src/beast/app/beauti/12.png differ
diff --git a/src/beast/app/beauti/13.png b/src/beast/app/beauti/13.png
new file mode 100644
index 0000000..7633b2b
Binary files /dev/null and b/src/beast/app/beauti/13.png differ
diff --git a/src/beast/app/beauti/2.png b/src/beast/app/beauti/2.png
new file mode 100644
index 0000000..4b39763
Binary files /dev/null and b/src/beast/app/beauti/2.png differ
diff --git a/src/beast/app/beauti/3.png b/src/beast/app/beauti/3.png
new file mode 100644
index 0000000..061bc10
Binary files /dev/null and b/src/beast/app/beauti/3.png differ
diff --git a/src/beast/app/beauti/4.png b/src/beast/app/beauti/4.png
new file mode 100644
index 0000000..3e46338
Binary files /dev/null and b/src/beast/app/beauti/4.png differ
diff --git a/src/beast/app/beauti/5.png b/src/beast/app/beauti/5.png
new file mode 100644
index 0000000..2d669c7
Binary files /dev/null and b/src/beast/app/beauti/5.png differ
diff --git a/src/beast/app/beauti/6.png b/src/beast/app/beauti/6.png
new file mode 100644
index 0000000..75816b2
Binary files /dev/null and b/src/beast/app/beauti/6.png differ
diff --git a/src/beast/app/beauti/7.png b/src/beast/app/beauti/7.png
new file mode 100644
index 0000000..90c2a35
Binary files /dev/null and b/src/beast/app/beauti/7.png differ
diff --git a/src/beast/app/beauti/8.png b/src/beast/app/beauti/8.png
new file mode 100644
index 0000000..75a3c1f
Binary files /dev/null and b/src/beast/app/beauti/8.png differ
diff --git a/src/beast/app/beauti/9.png b/src/beast/app/beauti/9.png
new file mode 100644
index 0000000..06a2df4
Binary files /dev/null and b/src/beast/app/beauti/9.png differ
diff --git a/src/beast/app/beauti/AlignmentListInputEditor.java b/src/beast/app/beauti/AlignmentListInputEditor.java
new file mode 100644
index 0000000..87dc9e6
--- /dev/null
+++ b/src/beast/app/beauti/AlignmentListInputEditor.java
@@ -0,0 +1,1223 @@
+package beast.app.beauti;
+
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.EventObject;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.swing.*;
+import javax.swing.border.Border;
+import javax.swing.event.CellEditorListener;
+import javax.swing.event.DocumentEvent;
+import javax.swing.event.DocumentListener;
+import javax.swing.table.TableCellEditor;
+import javax.swing.table.TableCellRenderer;
+import javax.swing.table.TableColumn;
+
+import beast.app.draw.ListInputEditor;
+import beast.app.draw.SmallButton;
+import beast.app.util.FileDrop;
+import beast.core.Input;
+import beast.core.MCMC;
+import beast.core.BEASTInterface;
+import beast.core.Input.Validate;
+import beast.core.State;
+import beast.core.StateNode;
+import beast.core.util.CompoundDistribution;
+import beast.evolution.alignment.Alignment;
+import beast.evolution.alignment.FilteredAlignment;
+import beast.evolution.alignment.Taxon;
+import beast.evolution.branchratemodel.BranchRateModel;
+import beast.evolution.likelihood.GenericTreeLikelihood;
+import beast.evolution.sitemodel.SiteModel;
+import beast.evolution.sitemodel.SiteModelInterface;
+import beast.evolution.tree.TreeInterface;
+
+// TODO: add useAmbiguities flag 
+// TODO: add warning if useAmbiguities=false and nr of patterns=1 (happens when all data is ambiguous)
+
+public class AlignmentListInputEditor extends ListInputEditor {
+	private static final long serialVersionUID = 1L;
+
+	final static int NAME_COLUMN = 0;
+	final static int FILE_COLUMN = 1;
+	final static int TAXA_COLUMN = 2;
+	final static int SITES_COLUMN = 3;
+	final static int TYPE_COLUMN = 4;
+	final static int SITEMODEL_COLUMN = 5;
+	final static int CLOCKMODEL_COLUMN = 6;
+	final static int TREE_COLUMN = 7;
+	final static int USE_AMBIGUITIES_COLUMN = 8;
+	
+	final static int NR_OF_COLUMNS = 9;
+
+    final static int STRUT_SIZE = 5;
+
+	/**
+	 * alignments that form a partition. These can be FilteredAlignments *
+	 */
+	List<Alignment> alignments;
+	int nPartitions;
+	GenericTreeLikelihood[] likelihoods;
+	Object[][] tableData;
+	JTable table;
+	JTextField nameEditor;
+	List<JButton> linkButtons;
+	List<JButton> unlinkButtons;
+	JButton splitButton;
+
+    /**
+     * The button for deleting an alignment in the alignment list.
+     */
+    JButton delButton;
+
+	private JScrollPane scrollPane;
+
+	public AlignmentListInputEditor(BeautiDoc doc) {
+		super(doc);
+	}
+
+	@Override
+	public Class<?> type() {
+		return List.class;
+	}
+
+	@Override
+	public Class<?> baseType() {
+		return Alignment.class;
+	}
+
+	@Override
+	public Class<?>[] types() {
+		Class<?>[] types = new Class[2];
+		types[0] = List.class;
+		types[1] = Alignment.class;
+		return types;
+	}
+
+	@SuppressWarnings("unchecked")
+	public void init(Input<?> input, BEASTInterface plugin, int itemNr, ExpandOption bExpandOption, boolean bAddButtons) {
+		this.itemNr = itemNr;
+		if (input.get() instanceof List) {
+			alignments = (List<Alignment>) input.get();
+		} else {
+			// we just have a single Alignment
+			alignments = new ArrayList<Alignment>();
+			alignments.add((Alignment) input.get());
+		}
+		linkButtons = new ArrayList<JButton>();
+		unlinkButtons = new ArrayList<JButton>();
+		nPartitions = alignments.size();
+
+        // override BoxLayout in superclass
+        setLayout(new BorderLayout());
+
+        add(createLinkButtons(), BorderLayout.NORTH);
+        add(createListBox(), BorderLayout.CENTER);
+
+        //Box box = Box.createVerticalBox();
+		//box.add(Box.createVerticalStrut(STRUT_SIZE));
+		//box.add(createLinkButtons());
+		//box.add(Box.createVerticalStrut(STRUT_SIZE));
+		//box.add(createListBox());
+        //box.add(Box.createVerticalStrut(STRUT_SIZE));
+        //box.add(Box.createVerticalGlue());
+		//add(box, BorderLayout.CENTER);
+
+        Color focusColor = UIManager.getColor("Focus.color");
+        Border focusBorder = BorderFactory.createMatteBorder(2, 2, 2, 2, focusColor);
+        new FileDrop(null, scrollPane, focusBorder, new FileDrop.Listener() {
+            public void filesDropped(java.io.File[] files) {
+                addFiles(files);
+            }   // end filesDropped
+        }); // end FileDrop.Listener
+
+        // this should place the add/remove/split buttons at the bottom of the window.
+        add(createAddRemoveSplitButtons(), BorderLayout.SOUTH);
+
+        updateStatus();
+	}
+
+    /**
+     * Creates the link/unlink button component
+     * @return a box containing three link/unlink button pairs.
+     */
+	private JComponent createLinkButtons() {
+
+        Box box = Box.createHorizontalBox();
+		addLinkUnlinkPair(box, "Site Models");
+        box.add(Box.createHorizontalStrut(STRUT_SIZE));
+        addLinkUnlinkPair(box, "Clock Models");
+        box.add(Box.createHorizontalStrut(STRUT_SIZE));
+        addLinkUnlinkPair(box, "Trees");
+		box.add(Box.createHorizontalGlue());
+		return box;
+	}
+
+    private JComponent createAddRemoveSplitButtons() {
+        Box buttonBox = Box.createHorizontalBox();
+
+        addButton = new SmallButton("+", true, SmallButton.ButtonType.square);
+        addButton.setName("+");
+        addButton.setToolTipText("Add item to the list");
+        addButton.addActionListener(e -> addItem());
+        buttonBox.add(Box.createHorizontalStrut(STRUT_SIZE));
+        buttonBox.add(addButton);
+        buttonBox.add(Box.createHorizontalStrut(STRUT_SIZE));
+
+        delButton = new SmallButton("-", true, SmallButton.ButtonType.square);
+        delButton.setName("-");
+        delButton.setToolTipText("Delete selected items from the list");
+        delButton.addActionListener(e -> {
+            if (doc.bHasLinkedAtLeastOnce) {
+                JOptionPane.showMessageDialog(null, "Cannot delete partition while parameters are linked");
+                return;
+            }
+            delItem();
+        });
+        buttonBox.add(delButton);
+        buttonBox.add(Box.createHorizontalStrut(STRUT_SIZE));
+
+        splitButton = new JButton("Split");
+        splitButton.setName("Split");
+        splitButton.setToolTipText("Split alignment into partitions, for example, codon positions");
+        splitButton.addActionListener(e -> splitItem());
+        buttonBox.add(splitButton);
+
+        buttonBox.add(Box.createHorizontalGlue());
+
+        return buttonBox;
+    }
+
+    private void addFiles(File[] fileArray) {
+        List<BEASTInterface> plugins = null;
+
+        List<BeautiAlignmentProvider> providers = doc.beautiConfig.alignmentProvider;
+        BeautiAlignmentProvider selectedProvider = null;
+        if (providers.size() == 1) {
+            selectedProvider = providers.get(0);
+        } else {
+            selectedProvider = (BeautiAlignmentProvider) JOptionPane.showInputDialog(this, "Select what to add",
+                    "Add partition",
+                    JOptionPane.QUESTION_MESSAGE, null, providers.toArray(),
+                    providers.get(0));
+            if (selectedProvider == null) {
+                return;
+            }
+        }
+
+        plugins = selectedProvider.getAlignments(doc, fileArray);
+
+        // create taxon sets, if any
+        if (plugins != null) {
+	        for (BEASTInterface o : plugins) {
+	        	if (o instanceof Alignment) {
+	        		try {
+						BeautiDoc.createTaxonSet((Alignment) o, doc);
+					} catch (Exception e) {
+						e.printStackTrace();
+					}
+	        	}
+	        }
+        }
+
+        // Component c = this;
+        if (plugins != null) {
+            refreshPanel();
+        }
+    }
+
+
+
+	/**
+     * This method just adds the two buttons (with add()) and does not add any glue or struts before or after.
+     * @param box
+     * @param sLabel
+     */
+	private void addLinkUnlinkPair(Box box, String sLabel) {
+
+        //JLabel label = new JLabel(sLabel+":");
+        //box.add(label);
+        JButton linkSModelButton = new JButton("Link " + sLabel);
+		linkSModelButton.setName("Link " + sLabel);
+		linkSModelButton.addActionListener(e -> {
+            JButton button = (JButton) e.getSource();
+            link(columnLabelToNr(button.getText()));
+            table.repaint();
+        });
+		box.add(linkSModelButton);
+		linkSModelButton.setEnabled(!getDoc().bHasLinkedAtLeastOnce);
+		JButton unlinkSModelButton = new JButton("Unlink " + sLabel);
+		unlinkSModelButton.setName("Unlink " + sLabel);
+		unlinkSModelButton.addActionListener(e -> {
+            JButton button = (JButton) e.getSource();
+            unlink(columnLabelToNr(button.getText()));
+            table.repaint();
+        });
+		box.add(unlinkSModelButton);
+		unlinkSModelButton.setEnabled(!getDoc().bHasLinkedAtLeastOnce);
+
+		linkButtons.add(linkSModelButton);
+		unlinkButtons.add(unlinkSModelButton);
+	}
+
+	private int columnLabelToNr(String sColumn) {
+		int nColumn;
+		if (sColumn.contains("Tree")) {
+			nColumn = TREE_COLUMN;
+		} else if (sColumn.contains("Clock")) {
+			nColumn = CLOCKMODEL_COLUMN;
+		} else {
+			nColumn = SITEMODEL_COLUMN;
+		}
+		return nColumn;
+	}
+
+	private void link(int nColumn) {
+		int[] nSelected = getTableRowSelection();
+		// do the actual linking
+		for (int i = 1; i < nSelected.length; i++) {
+			int iRow = nSelected[i];
+			Object old = tableData[iRow][nColumn];
+			tableData[iRow][nColumn] = tableData[nSelected[0]][nColumn];
+			try {
+				updateModel(nColumn, iRow);
+			} catch (Exception ex) {
+				System.err.println(ex.getMessage());
+				// unlink if we could not link
+				tableData[iRow][nColumn] = old;
+				try {
+					updateModel(nColumn, iRow);
+				} catch (Exception ex2) {
+					// ignore
+				}
+			}
+		}
+	}
+
+	private void unlink(int nColumn) {
+		int[] nSelected = getTableRowSelection();
+		for (int i = 1; i < nSelected.length; i++) {
+			int iRow = nSelected[i];
+			tableData[iRow][nColumn] = getDoc().sPartitionNames.get(iRow).partition;
+			try {
+				updateModel(nColumn, iRow);
+			} catch (Exception ex) {
+				System.err.println(ex.getMessage());
+				ex.printStackTrace();
+			}
+		}
+	}
+
+
+    int[] getTableRowSelection() {
+        return table.getSelectedRows();
+	}
+
+	/** set partition of type nColumn to partition model nr iRow **/
+	void updateModel(int nColumn, int iRow) throws Exception {
+		System.err.println("updateModel: " + iRow + " " + nColumn + " " + table.getSelectedRow() + " "
+				+ table.getSelectedColumn());
+		for (int i = 0; i < nPartitions; i++) {
+			System.err.println(i + " " + tableData[i][0] + " " + tableData[i][SITEMODEL_COLUMN] + " "
+					+ tableData[i][CLOCKMODEL_COLUMN] + " " + tableData[i][TREE_COLUMN]);
+		}
+
+		getDoc();
+		String sPartition = (String) tableData[iRow][nColumn];
+
+		// check if partition needs renaming
+		String oldName = null;
+		boolean isRenaming = false;
+		try {
+			switch (nColumn) {
+			case SITEMODEL_COLUMN:
+				if (!doc.pluginmap.containsKey("SiteModel.s:" + sPartition)) {
+					String sID = ((BEASTInterface)likelihoods[iRow].siteModelInput.get()).getID();
+					oldName = BeautiDoc.parsePartition(sID);
+					doc.renamePartition(BeautiDoc.SITEMODEL_PARTITION, oldName, sPartition);
+					isRenaming = true;
+				}
+				break;
+			case CLOCKMODEL_COLUMN: {
+				String sID = likelihoods[iRow].branchRateModelInput.get().getID();
+				String sClockModelName = sID.substring(0, sID.indexOf('.')) + ".c:" + sPartition;
+				if (!doc.pluginmap.containsKey(sClockModelName)) {
+					oldName = BeautiDoc.parsePartition(sID);
+					doc.renamePartition(BeautiDoc.CLOCKMODEL_PARTITION, oldName, sPartition);
+					isRenaming = true;
+				}
+			}
+				break;
+			case TREE_COLUMN:
+				if (!doc.pluginmap.containsKey("Tree.t:" + sPartition)) {
+					String sID = likelihoods[iRow].treeInput.get().getID();
+					oldName = BeautiDoc.parsePartition(sID);
+					doc.renamePartition(BeautiDoc.TREEMODEL_PARTITION, oldName, sPartition);
+					isRenaming = true;
+				}
+				break;
+			}
+		} catch (Exception e) {
+			JOptionPane.showMessageDialog(this, "Cannot rename item: " + e.getMessage());
+			tableData[iRow][nColumn] = oldName;
+			return;
+		}
+		if (isRenaming) {
+			doc.determinePartitions();
+			initTableData();
+			setUpComboBoxes();
+			table.repaint();
+			return;
+		}
+		
+		int partitionID = BeautiDoc.ALIGNMENT_PARTITION;
+		switch (nColumn) {
+		case SITEMODEL_COLUMN:
+			partitionID = BeautiDoc.SITEMODEL_PARTITION;
+			break;
+		case CLOCKMODEL_COLUMN:
+			partitionID = BeautiDoc.CLOCKMODEL_PARTITION;
+			break;
+		case TREE_COLUMN:
+			partitionID = BeautiDoc.TREEMODEL_PARTITION;
+			break;
+		}
+		int nPartition = doc.getPartitionNr(sPartition, partitionID);
+		GenericTreeLikelihood treeLikelihood = null;
+		if (nPartition >= 0) {
+			// we ar linking
+			treeLikelihood = likelihoods[nPartition];
+		}
+		// (TreeLikelihood) doc.pluginmap.get("treeLikelihood." +
+		// tableData[iRow][NAME_COLUMN]);
+
+		boolean needsRePartition = false;
+		
+		PartitionContext oldContext = new PartitionContext(this.likelihoods[iRow]);
+
+		switch (nColumn) {
+		case SITEMODEL_COLUMN: {
+			SiteModelInterface siteModel = null;
+			if (treeLikelihood != null) { // getDoc().getPartitionNr(sPartition,
+											// BeautiDoc.SITEMODEL_PARTITION) !=
+											// iRow) {
+				siteModel = treeLikelihood.siteModelInput.get();
+			} else {
+				siteModel = (SiteModel) doc.pluginmap.get("SiteModel.s:" + sPartition);
+				if (siteModel != likelihoods[iRow].siteModelInput.get()) {
+					PartitionContext context = getPartitionContext(iRow);
+					siteModel = (SiteModel.Base) BeautiDoc.deepCopyPlugin((BEASTInterface) likelihoods[iRow].siteModelInput.get(),
+							likelihoods[iRow], (MCMC) doc.mcmc.get(), context, doc, null);
+				}
+			}
+			SiteModelInterface target = this.likelihoods[iRow].siteModelInput.get();
+			if (target instanceof SiteModel.Base && siteModel instanceof SiteModel.Base) {
+				if (!((SiteModel.Base)target).substModelInput.canSetValue(((SiteModel.Base)siteModel).substModelInput.get(), (SiteModel.Base) target)) {
+					throw new Exception("Cannot link site model: substitution models are incompatible");
+				}
+			} else {
+				throw new Exception("Don't know how to link this site model");
+			}
+			needsRePartition = (this.likelihoods[iRow].siteModelInput.get() != siteModel);
+			this.likelihoods[iRow].siteModelInput.setValue(siteModel, this.likelihoods[iRow]);
+
+			sPartition = ((BEASTInterface)likelihoods[iRow].siteModelInput.get()).getID();
+			sPartition = BeautiDoc.parsePartition(sPartition);
+			getDoc().setCurrentPartition(BeautiDoc.SITEMODEL_PARTITION, iRow, sPartition);
+		}
+			break;
+		case CLOCKMODEL_COLUMN: {
+			BranchRateModel clockModel = null;
+			if (treeLikelihood != null) { // getDoc().getPartitionNr(sPartition,
+											// BeautiDoc.CLOCKMODEL_PARTITION)
+											// != iRow) {
+				clockModel = treeLikelihood.branchRateModelInput.get();
+			} else {
+				clockModel = getDoc().getClockModel(sPartition);
+				if (clockModel != likelihoods[iRow].branchRateModelInput.get()) {
+					PartitionContext context = getPartitionContext(iRow);
+					clockModel = (BranchRateModel) BeautiDoc.deepCopyPlugin(likelihoods[iRow].branchRateModelInput.get(),
+							likelihoods[iRow], (MCMC) doc.mcmc.get(), context, doc, null);
+				}
+			}
+			// make sure that *if* the clock model has a tree as input, it is
+			// the same as
+			// for the likelihood
+			TreeInterface tree = null;
+			for (Input<?> input : ((BEASTInterface) clockModel).listInputs()) {
+				if (input.getName().equals("tree")) {
+					tree = (TreeInterface) input.get();
+				}
+
+			}
+			if (tree != null && tree != this.likelihoods[iRow].treeInput.get()) {
+				throw new Exception("Cannot link clock model with different trees");
+			}
+
+			needsRePartition = (this.likelihoods[iRow].branchRateModelInput.get() != clockModel);
+			this.likelihoods[iRow].branchRateModelInput.setValue(clockModel, this.likelihoods[iRow]);
+			sPartition = likelihoods[iRow].branchRateModelInput.get().getID();
+			sPartition = BeautiDoc.parsePartition(sPartition);
+			getDoc().setCurrentPartition(BeautiDoc.CLOCKMODEL_PARTITION, iRow, sPartition);
+		}
+			break;
+		case TREE_COLUMN: {
+			TreeInterface tree = null;
+			if (treeLikelihood != null) { // getDoc().getPartitionNr(sPartition,
+											// BeautiDoc.TREEMODEL_PARTITION) !=
+											// iRow) {
+				tree = treeLikelihood.treeInput.get();
+			} else {
+				tree = (TreeInterface) doc.pluginmap.get("Tree.t:" + sPartition);
+				if (tree != likelihoods[iRow].treeInput.get()) {
+					PartitionContext context = getPartitionContext(iRow);
+					tree = (TreeInterface) BeautiDoc.deepCopyPlugin((BEASTInterface) likelihoods[iRow].treeInput.get(), likelihoods[iRow],
+							(MCMC) doc.mcmc.get(), context, doc, null);
+					
+					State state = ((MCMC) doc.mcmc.get()).startStateInput.get();
+					List<StateNode> stateNodes = new ArrayList<>();
+					stateNodes.addAll(state.stateNodeInput.get());
+					for (StateNode s : stateNodes) {
+						if (s.getID().endsWith(".t:" + oldContext.tree) && !(s instanceof TreeInterface)) {
+							StateNode copy = (StateNode) BeautiDoc.deepCopyPlugin(s, likelihoods[iRow], (MCMC) doc.mcmc.get(), context, doc, null);
+						}
+					}
+				}
+			}
+			// sanity check: make sure taxon sets are compatible
+			Taxon.assertSameTaxa(tree.getID(), tree.getTaxonset().getTaxaNames(),
+					likelihoods[iRow].dataInput.get().getID(), likelihoods[iRow].dataInput.get().getTaxaNames());
+
+			needsRePartition = (this.likelihoods[iRow].treeInput.get() != tree);
+System.err.println("needsRePartition = " + needsRePartition);			
+			if (needsRePartition) {
+				TreeInterface oldTree = this.likelihoods[iRow].treeInput.get();
+				List<TreeInterface> tModels = new ArrayList<TreeInterface>();
+				for (GenericTreeLikelihood likelihood : likelihoods) {
+					if (likelihood.treeInput.get() == oldTree) {
+						tModels.add(likelihood.treeInput.get());
+					}
+				}
+				if (tModels.size() == 1) {
+					// remove old tree from model
+					((BEASTInterface)oldTree).setInputValue("estimate", false);
+                	// use toArray to prevent ConcurrentModificationException
+					for (Object plugin : BEASTInterface.getOutputs(oldTree).toArray()) { //.toArray(new BEASTInterface[0])) {
+						for (Input<?> input : ((BEASTInterface)plugin).listInputs()) {
+							try {
+							if (input.get() == oldTree) {
+								if (input.getRule() != Input.Validate.REQUIRED) {
+									input.setValue(tree/*null*/, (BEASTInterface) plugin);
+								//} else {
+									//input.setValue(tree, (BEASTInterface) plugin);
+								}
+							} else if (input.get() instanceof List) {
+								List list = (List) input.get();
+								if (list.contains(oldTree)) { // && input.getRule() != Validate.REQUIRED) {
+									list.remove(oldTree);
+									if (!list.contains(tree)) {
+										list.add(tree);
+									}
+								}
+							}
+							} catch (Exception e) {
+								e.printStackTrace();
+							}
+						}
+					}
+				}
+			}
+			likelihoods[iRow].treeInput.setValue(tree, likelihoods[iRow]);
+			// TreeDistribution d = getDoc().getTreePrior(sPartition);
+			// CompoundDistribution prior = (CompoundDistribution)
+			// doc.pluginmap.get("prior");
+			// if (!getDoc().posteriorPredecessors.contains(d)) {
+			// prior.pDistributions.setValue(d, prior);
+			// }
+			sPartition = likelihoods[iRow].treeInput.get().getID();
+			sPartition = BeautiDoc.parsePartition(sPartition);
+			getDoc().setCurrentPartition(BeautiDoc.TREEMODEL_PARTITION, iRow, sPartition);
+		}
+		}
+		tableData[iRow][nColumn] = sPartition;
+		if (needsRePartition) {
+			List<BeautiSubTemplate> templates = new ArrayList<BeautiSubTemplate>();
+			templates.add(doc.beautiConfig.partitionTemplate.get());
+			templates.addAll(doc.beautiConfig.subTemplates);
+			// keep applying rules till model does not change
+			doc.setUpActivePlugins();
+			int n;
+			do {
+				n = doc.posteriorPredecessors.size();
+				doc.applyBeautiRules(templates, false, oldContext);
+				doc.setUpActivePlugins();
+			} while (n != doc.posteriorPredecessors.size());
+			doc.determinePartitions();
+		}
+		if (treeLikelihood == null) {
+			initTableData();
+			setUpComboBoxes();
+		}
+		
+		updateStatus();
+	}
+
+	private PartitionContext getPartitionContext(int iRow) {
+		PartitionContext context = new PartitionContext(
+				tableData[iRow][NAME_COLUMN].toString(),
+				tableData[iRow][SITEMODEL_COLUMN].toString(),
+				tableData[iRow][CLOCKMODEL_COLUMN].toString(),
+				tableData[iRow][TREE_COLUMN].toString());
+		return context;
+	}
+
+	@Override
+	protected void addInputLabel() {
+	}
+
+	void initTableData() {
+		this.likelihoods = new GenericTreeLikelihood[nPartitions];
+		if (tableData == null) {
+			tableData = new Object[nPartitions][NR_OF_COLUMNS];
+		}
+		CompoundDistribution likelihoods = (CompoundDistribution) doc.pluginmap.get("likelihood");
+
+		for (int i = 0; i < nPartitions; i++) {
+			Alignment data = alignments.get(i);
+			// partition name
+			tableData[i][NAME_COLUMN] = data;
+
+			// alignment name
+			if (data instanceof FilteredAlignment) {
+				tableData[i][FILE_COLUMN] = ((FilteredAlignment) data).alignmentInput.get();
+			} else {
+				tableData[i][FILE_COLUMN] = data;
+			}
+			// # taxa
+			tableData[i][TAXA_COLUMN] = data.getTaxonCount();
+			// # sites
+			tableData[i][SITES_COLUMN] = data.getSiteCount();
+			// Data type
+			tableData[i][TYPE_COLUMN] = data.getDataType();
+			// site model
+			GenericTreeLikelihood likelihood = (GenericTreeLikelihood) likelihoods.pDistributions.get().get(i);
+			assert (likelihood != null);
+			this.likelihoods[i] = likelihood;
+			tableData[i][SITEMODEL_COLUMN] = getPartition(likelihood.siteModelInput);
+			// clock model
+			tableData[i][CLOCKMODEL_COLUMN] = getPartition(likelihood.branchRateModelInput);
+			// tree
+			tableData[i][TREE_COLUMN] = getPartition(likelihood.treeInput);
+			// useAmbiguities
+			tableData[i][USE_AMBIGUITIES_COLUMN] = null;
+			try {
+				if (hasUseAmbiguitiesInput(i)) {
+					tableData[i][USE_AMBIGUITIES_COLUMN] = likelihood.getInputValue("useAmbiguities");
+				}
+			} catch (Exception e) {
+				// ignore
+			}
+		}
+	}
+
+	private boolean hasUseAmbiguitiesInput(int i) {
+		try {
+			for (Input<?> input : likelihoods[i].listInputs()) {
+				if (input.getName().equals("useAmbiguities")) {
+					return true;
+				}
+			}
+		} catch (Exception e) {
+			// ignore
+		}
+		return false;
+	}
+
+	private String getPartition(Input<?> input) {
+		BEASTInterface plugin = (BEASTInterface) input.get();
+		String sID = plugin.getID();
+		String sPartition = BeautiDoc.parsePartition(sID);
+		return sPartition;
+	}
+
+	protected Component createListBox() {
+		String[] columnData = new String[] { "Name", "File", "Taxa", "Sites", "Data Type", "Site Model", "Clock Model",
+				"Tree", "Ambiguities" };
+		initTableData();
+
+		// set up table.
+		// special features: background shading of rows
+		// custom editor allowing only Date column to be edited.
+		table = new JTable(tableData, columnData) {
+			private static final long serialVersionUID = 1L;
+
+			// method that induces table row shading
+			@Override
+			public Component prepareRenderer(TableCellRenderer renderer, int Index_row, int Index_col) {
+				Component comp = super.prepareRenderer(renderer, Index_row, Index_col);
+				// even index, selected or not selected
+				if (isCellSelected(Index_row, Index_col)) {
+					comp.setBackground(Color.gray);
+				} else if (Index_row % 2 == 0 && !isCellSelected(Index_row, Index_col)) {
+					comp.setBackground(new Color(237, 243, 255));
+				} else {
+					comp.setBackground(Color.white);
+				}
+			    JComponent jcomp = (JComponent)comp;
+			    if (comp == jcomp) {
+			    	switch (Index_col) {
+			    	case NAME_COLUMN:			    		
+		    		case CLOCKMODEL_COLUMN: 
+		    		case TREE_COLUMN: 
+		    		case SITEMODEL_COLUMN: 
+				        jcomp.setToolTipText("Set " + table.getColumnName(Index_col).toLowerCase() + " for this partition");
+						break;
+		    		case FILE_COLUMN:
+		    		case TAXA_COLUMN:
+		    		case SITES_COLUMN:
+		    		case TYPE_COLUMN:
+				        jcomp.setToolTipText("Report " + table.getColumnName(Index_col).toLowerCase() + " for this partition");
+						break;
+		    		case USE_AMBIGUITIES_COLUMN: 
+						jcomp.setToolTipText("<html>Flag whether to use ambiguities.<br>" +
+								"If not set, the treelikelihood will treat ambiguities in the<br>" +
+								"data as unknowns<br>" +
+								"If set, the treelikelihood will use ambiguities as equally<br>" +
+								"likely values for the tips.<br>" +
+								"This will make the computation twice as slow.</html>");
+						break;
+					default:
+				        jcomp.setToolTipText(null);
+			    	}
+			    }
+				updateStatus();
+				return comp;
+			}
+		};
+		table.setRowHeight(25);
+		table.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
+		table.setColumnSelectionAllowed(false);
+		table.setRowSelectionAllowed(true);
+		table.setName("alignmenttable");
+
+		setUpComboBoxes();
+
+		TableColumn col = table.getColumnModel().getColumn(NAME_COLUMN);
+		nameEditor = new JTextField();
+		nameEditor.getDocument().addDocumentListener(new DocumentListener() {
+			@Override
+			public void removeUpdate(DocumentEvent e) {
+				processPartitionName();
+			}
+
+			@Override
+			public void insertUpdate(DocumentEvent e) {
+				processPartitionName();
+			}
+
+			@Override
+			public void changedUpdate(DocumentEvent e) {
+				processPartitionName();
+			}
+		});
+
+		col.setCellEditor(new DefaultCellEditor(nameEditor));
+
+		// // set up editor that makes sure only doubles are accepted as entry
+		// // and only the Date column is editable.
+		table.setDefaultEditor(Object.class, new TableCellEditor() {
+			JTextField m_textField = new JTextField();
+			int m_iRow, m_iCol;
+
+			@Override
+			public boolean stopCellEditing() {
+				System.err.println("stopCellEditing()");
+				table.removeEditor();
+				String sText = m_textField.getText();
+				try {
+					Double.parseDouble(sText);
+				} catch (Exception e) {
+					return false;
+				}
+				tableData[m_iRow][m_iCol] = sText;
+				return true;
+			}
+
+			@Override
+			public boolean isCellEditable(EventObject anEvent) {
+				System.err.println("isCellEditable()");
+				return table.getSelectedColumn() == 0;
+			}
+
+			@Override
+			public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int iRow,
+					int iCol) {
+				return null;
+			}
+
+			@Override
+			public boolean shouldSelectCell(EventObject anEvent) {
+				return false;
+			}
+
+			@Override
+			public void removeCellEditorListener(CellEditorListener l) {
+			}
+
+			@Override
+			public Object getCellEditorValue() {
+				return null;
+			}
+
+			@Override
+			public void cancelCellEditing() {
+			}
+
+			@Override
+			public void addCellEditorListener(CellEditorListener l) {
+			}
+
+		});
+
+		// show alignment viewer when double clicking a row
+		table.addMouseListener(new MouseListener() {
+
+			@Override
+			public void mouseReleased(MouseEvent e) {
+			}
+
+			@Override
+			public void mousePressed(MouseEvent e) {
+			}
+
+			@Override
+			public void mouseExited(MouseEvent e) {
+			}
+
+			@Override
+			public void mouseEntered(MouseEvent e) {
+			}
+
+			@Override
+			public void mouseClicked(MouseEvent e) {
+				if (e.getClickCount() > 1) {
+					try {
+						int iAlignmemt = table.rowAtPoint(e.getPoint());
+						Alignment alignment = alignments.get(iAlignmemt);
+						int best = 0;
+						BeautiAlignmentProvider provider = null;
+						for (BeautiAlignmentProvider provider2 : doc.beautiConfig.alignmentProvider) {
+							int match = provider2.matches(alignment);
+							if (match > best) {
+								best = match;
+								provider = provider2;
+							}
+						}
+						provider.editAlignment(alignment, doc);
+					} catch (Exception e1) {
+						e1.printStackTrace();
+					}
+					updateStatus();
+				}
+			}
+		});
+
+		scrollPane = new JScrollPane(table);
+
+        int rowsToDisplay = 3;
+        Dimension d = table.getPreferredSize();
+        scrollPane.setPreferredSize(
+                new Dimension(d.width,table.getRowHeight()*rowsToDisplay+table.getTableHeader().getHeight()));
+
+		return scrollPane;
+	} // createListBox
+	
+	void setUpComboBoxes() {
+		// set up comboboxes
+		Set<String>[] partitionNames = new HashSet[3];
+		for (int i = 0; i < 3; i++) {
+			partitionNames[i] = new HashSet<String>();
+		}
+		for (int i = 0; i < nPartitions; i++) {
+			partitionNames[0].add(((BEASTInterface) likelihoods[i].siteModelInput.get()).getID());
+			partitionNames[1].add(likelihoods[i].branchRateModelInput.get().getID());
+			partitionNames[2].add(likelihoods[i].treeInput.get().getID());
+		}
+		String[][] sPartitionNames = new String[3][];
+		for (int i = 0; i < 3; i++) {
+			sPartitionNames[i] = partitionNames[i].toArray(new String[0]);
+		}
+		for (int j = 0; j < 3; j++) {
+			for (int i = 0; i < sPartitionNames[j].length; i++) {
+				sPartitionNames[j][i] = BeautiDoc.parsePartition(sPartitionNames[j][i]);
+			}
+		}
+		TableColumn col = table.getColumnModel().getColumn(SITEMODEL_COLUMN);
+		JComboBox siteModelComboBox = new JComboBox(sPartitionNames[0]);
+		siteModelComboBox.setEditable(true);
+		siteModelComboBox.addActionListener(new ComboActionListener(SITEMODEL_COLUMN));
+
+		col.setCellEditor(new DefaultCellEditor(siteModelComboBox));
+		// If the cell should appear like a combobox in its
+		// non-editing state, also set the combobox renderer
+		col.setCellRenderer(new MyComboBoxRenderer(sPartitionNames[0]));
+		col = table.getColumnModel().getColumn(CLOCKMODEL_COLUMN);
+
+		JComboBox clockModelComboBox = new JComboBox(sPartitionNames[1]);
+		clockModelComboBox.setEditable(true);
+		clockModelComboBox.addActionListener(new ComboActionListener(CLOCKMODEL_COLUMN));
+
+		col.setCellEditor(new DefaultCellEditor(clockModelComboBox));
+		col.setCellRenderer(new MyComboBoxRenderer(sPartitionNames[1]));
+		col = table.getColumnModel().getColumn(TREE_COLUMN);
+
+		JComboBox treeComboBox = new JComboBox(sPartitionNames[2]);
+		treeComboBox.setEditable(true);
+		treeComboBox.addActionListener(new ComboActionListener(TREE_COLUMN));
+		col.setCellEditor(new DefaultCellEditor(treeComboBox));
+		col.setCellRenderer(new MyComboBoxRenderer(sPartitionNames[2]));
+		col = table.getColumnModel().getColumn(TAXA_COLUMN);
+		col.setPreferredWidth(30);
+		col = table.getColumnModel().getColumn(SITES_COLUMN);
+		col.setPreferredWidth(30);
+		
+		col = table.getColumnModel().getColumn(USE_AMBIGUITIES_COLUMN);
+		JCheckBox checkBox = new JCheckBox();
+		checkBox.addActionListener(new ActionListener() {
+			
+			@Override
+			public void actionPerformed(ActionEvent e) {
+				JCheckBox checkBox = (JCheckBox) e.getSource();
+				if (table.getSelectedRow() >= 0 && table.getSelectedColumn() >= 0) {
+					System.err.println(" " + table.getValueAt(table.getSelectedRow(), table.getSelectedColumn()));
+				}
+				try {
+					int row = table.getSelectedRow();
+					if (hasUseAmbiguitiesInput(row)) {
+						likelihoods[row].setInputValue("useAmbiguities", checkBox.isSelected());
+						tableData[row][USE_AMBIGUITIES_COLUMN] = checkBox.isSelected();
+					} else {
+						if (checkBox.isSelected()) {
+							checkBox.setSelected(false);
+						}
+					}
+				} catch (Exception ex) {
+					// TODO: handle exception
+				}
+		
+			}
+		});
+		col.setCellEditor(new DefaultCellEditor(checkBox));
+		col.setCellRenderer(new MyCheckBoxRenderer());
+		col.setPreferredWidth(20);
+		col.setMaxWidth(20);
+	}
+
+	void processPartitionName() {
+		System.err.println("processPartitionName");
+		System.err.println(table.getSelectedColumn() + " " + table.getSelectedRow());
+		String oldName = tableData[table.getSelectedRow()][table.getSelectedColumn()].toString();
+		String newName = nameEditor.getText();
+		if (!oldName.equals(newName) && newName.indexOf(".") >= 0) {
+			// prevent full stops to be used in IDs
+			newName = newName.replaceAll("\\.", "");
+			table.setValueAt(newName, table.getSelectedRow(), table.getSelectedColumn());
+			table.repaint();
+		}
+		if (!oldName.equals(newName)) {
+			try {
+				int partitionID = -2;
+				switch (table.getSelectedColumn()) {
+				case NAME_COLUMN:
+					partitionID = BeautiDoc.ALIGNMENT_PARTITION;
+					break;
+				case SITEMODEL_COLUMN:
+					partitionID = BeautiDoc.SITEMODEL_PARTITION;
+					break;
+				case CLOCKMODEL_COLUMN:
+					partitionID = BeautiDoc.CLOCKMODEL_PARTITION;
+					break;
+				case TREE_COLUMN:
+					partitionID = BeautiDoc.TREEMODEL_PARTITION;
+					break;
+				default:
+					throw new Exception("Cannot rename item in column");
+				}
+				getDoc().renamePartition(partitionID, oldName, newName);
+				table.setValueAt(newName, table.getSelectedRow(), table.getSelectedColumn());
+				setUpComboBoxes();
+			} catch (Exception e) {
+				JOptionPane.showMessageDialog(null, "Renaming failed: " + e.getMessage());
+			}
+		}
+		// debugging code:
+		for (int i = 0; i < nPartitions; i++) {
+			System.err.println(i + " " + tableData[i][0]);
+		}
+	}
+
+	class ComboActionListener implements ActionListener {
+		int m_nColumn;
+
+		public ComboActionListener(int nColumn) {
+			m_nColumn = nColumn;
+		}
+
+		@Override
+		public void actionPerformed(ActionEvent e) {
+//			 SwingUtilities.invokeLater(new Runnable() {
+//			 @Override
+//			 public void run() {
+			System.err.println("actionPerformed ");
+			System.err.println(table.getSelectedRow() + " " + table.getSelectedColumn());
+			if (table.getSelectedRow() >= 0 && table.getSelectedColumn() >= 0) {
+				System.err.println(" " + table.getValueAt(table.getSelectedRow(), table.getSelectedColumn()));
+			}
+			for (int i = 0; i < nPartitions; i++) {
+				try {
+					updateModel(m_nColumn, i);
+				} catch (Exception ex) {
+					System.err.println(ex.getMessage());
+				}
+			}
+//		    }});
+		}
+	}
+
+	public class MyComboBoxRenderer extends JComboBox implements TableCellRenderer {
+		private static final long serialVersionUID = 1L;
+
+		public MyComboBoxRenderer(String[] items) {
+			super(items);
+			setOpaque(true);
+		}
+
+		public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
+				boolean hasFocus, int row, int column) {
+			if (isSelected) {
+				// setForeground(table.getSelectionForeground());
+				super.setBackground(table.getSelectionBackground());
+			} else {
+				setForeground(table.getForeground());
+				setBackground(table.getBackground());
+			}
+
+			// Select the current value
+			setSelectedItem(value);
+			return this;
+		}
+	}
+
+	public class MyCheckBoxRenderer extends JCheckBox implements TableCellRenderer {
+		private static final long serialVersionUID = 1L;
+
+		public MyCheckBoxRenderer() {
+			super();
+			setOpaque(true);
+		}
+
+		public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
+				boolean hasFocus, int row, int column) {
+			if (hasUseAmbiguitiesInput(row)) {
+				if (isSelected) {
+					// setForeground(table.getSelectionForeground());
+					super.setBackground(table.getSelectionBackground());
+				} else {
+					setForeground(table.getForeground());
+					setBackground(table.getBackground());
+				}
+				setEnabled(true);
+				setSelected((Boolean) value);
+			} else {
+				setEnabled(false);
+			}
+			return this;
+		}
+	}
+
+	@Override
+	protected void addSingleItem(BEASTInterface plugin) {
+		initTableData();
+		repaint();
+	}
+
+	@Override
+	protected void addItem() {
+		List<BEASTInterface> plugins = doc.beautiConfig.selectAlignments(doc, this);
+
+		// Component c = this;
+		if (plugins != null) {
+			refreshPanel();
+		}
+	} // addItem
+
+	void delItem() {
+		int[] nSelected = getTableRowSelection();
+		if (nSelected.length == 0) {
+			JOptionPane.showMessageDialog(this, "Select partitions to delete, before hitting the delete button");
+		}
+		// do the actual deleting
+		for (int i = nSelected.length - 1; i >= 0; i--) {
+			int iRow = nSelected[i];
+			
+			// before deleting, unlink site model, clock model and tree
+			
+			// check whether any of the models are linked
+			BranchRateModel.Base clockModel = likelihoods[iRow].branchRateModelInput.get();
+			SiteModelInterface siteModel = likelihoods[iRow].siteModelInput.get();
+			TreeInterface tree = likelihoods[iRow].treeInput.get();
+			List<GenericTreeLikelihood> cModels = new ArrayList<GenericTreeLikelihood>();
+			List<GenericTreeLikelihood> sModels = new ArrayList<GenericTreeLikelihood>();
+			List<GenericTreeLikelihood> tModels = new ArrayList<GenericTreeLikelihood>();
+			for (GenericTreeLikelihood likelihood : likelihoods) {
+				if (likelihood != likelihoods[iRow]) {
+				if (likelihood.branchRateModelInput.get() == clockModel) {
+					cModels.add(likelihood);
+				}
+				if (likelihood.siteModelInput.get() == siteModel) {
+					sModels.add(likelihood);
+				}
+				if (likelihood.treeInput.get() == tree) {
+					tModels.add(likelihood);
+				}
+				}
+			}
+			
+			try {
+				if (cModels.size() > 0) {
+					// clock model is linked, so we need to unlink
+					if (doc.getPartitionNr(clockModel) != iRow) {
+						tableData[iRow][CLOCKMODEL_COLUMN] = getDoc().sPartitionNames.get(iRow).partition;
+					} else {
+						int iFreePartition = doc.getPartitionNr(cModels.get(0));
+						tableData[iRow][CLOCKMODEL_COLUMN] = getDoc().sPartitionNames.get(iFreePartition).partition;
+					}
+					updateModel(CLOCKMODEL_COLUMN, iRow);
+				}
+				
+				if (sModels.size() > 0) {
+					// site model is linked, so we need to unlink
+					if (doc.getPartitionNr((BEASTInterface) siteModel) != iRow) {
+						tableData[iRow][SITEMODEL_COLUMN] = getDoc().sPartitionNames.get(iRow).partition;
+					} else {
+						int iFreePartition = doc.getPartitionNr(sModels.get(0));
+						tableData[iRow][SITEMODEL_COLUMN] = getDoc().sPartitionNames.get(iFreePartition).partition;
+					}
+					updateModel(SITEMODEL_COLUMN, iRow);
+				}
+				
+				if (tModels.size() > 0) {
+					// tree is linked, so we need to unlink
+					if (doc.getPartitionNr((BEASTInterface) tree) != iRow) {
+						tableData[iRow][TREE_COLUMN] = getDoc().sPartitionNames.get(iRow).partition;
+					} else {
+						int iFreePartition = doc.getPartitionNr(tModels.get(0));
+						tableData[iRow][TREE_COLUMN] = getDoc().sPartitionNames.get(iFreePartition).partition;
+					}
+					updateModel(TREE_COLUMN, iRow);
+				}
+				getDoc().delAlignmentWithSubnet(alignments.get(iRow));
+				alignments.remove(iRow);
+			    // remove deleted likelihood from likelihoods array
+				GenericTreeLikelihood[] tmp = new GenericTreeLikelihood[likelihoods.length - 1];
+				int k = 0;
+				for (int j = 0; j < likelihoods.length; j++) {
+					if (j != iRow) {
+						tmp[k] = likelihoods[j];
+						k++;
+					}
+				}
+				likelihoods = tmp;
+				nPartitions--;
+			} catch (Exception e) {
+				JOptionPane.showMessageDialog(null, "Deletion failed: " + e.getMessage());
+				e.printStackTrace();
+			}
+		}
+		refreshPanel();
+	} // delItem
+
+	void splitItem() {
+		int[] nSelected = getTableRowSelection();
+		if (nSelected.length == 0) {
+			JOptionPane.showMessageDialog(this, "Select partitions to split, before hitting the split button");
+			return;
+		}
+		String[] options = { "{1,2} + 3", "{1,2} + 3 frame 2", "{1,2} + 3 frame 3", "1 + 2 + 3", "1 + 2 + 3 frame 2", "1 + 2 + 3 frame 3"};
+
+		String option = (String)JOptionPane.showInputDialog(null, "Split selected alignments into partitions", "Option",
+		                    JOptionPane.WARNING_MESSAGE, null, options, "1 + 2 + 3");
+		if (option == null) {
+			return;
+		}
+		
+		String[] filters = null;
+		String[] ids = null;
+		if (option.equals(options[0])) {
+			filters = new String[] { "1::3,2::3", "3::3" };
+			ids = new String[] { "_1,2", "_3" };
+		} else if (option.equals(options[1])) {
+			filters = new String[] { "1::3,3::3", "2::3" };
+			ids = new String[] { "_1,2", "_3" };
+		} else if (option.equals(options[2])) {
+			filters = new String[] { "2::3,3::3", "1::3" };
+			ids = new String[] { "_1,2", "_3" };
+		} else if (option.equals(options[3])) {
+			filters = new String[] { "1::3", "2::3", "3::3" };
+			ids = new String[] { "_1", "_2", "_3" };
+		} else if (option.equals(options[4])) {
+			filters = new String[] { "2::3", "3::3", "1::3" };
+			ids = new String[] { "_1", "_2", "_3" };
+		} else if (option.equals(options[5])) {
+			filters = new String[] { "3::3", "1::3", "2::3" };
+			ids = new String[] { "_1", "_2", "_3" };
+		} else {
+			return;
+		}
+
+		for (int i = nSelected.length - 1; i >= 0; i--) {
+			int iRow = nSelected[i];
+			Alignment alignment = alignments.remove(iRow);
+			getDoc().delAlignmentWithSubnet(alignment);
+			try {
+				for (int j = 0; j < filters.length; j++) {
+					FilteredAlignment f = new FilteredAlignment();
+					f.initByName("data", alignment, "filter", filters[j], "dataType", alignment.dataTypeInput.get());
+					f.setID(alignment.getID() + ids[j]);
+					getDoc().addAlignmentWithSubnet(f, getDoc().beautiConfig.partitionTemplate.get());
+				}
+			} catch (Exception e) {
+				e.printStackTrace();
+			}
+		}
+
+		refreshPanel();
+	} // splitItem
+
+	/** enable/disable buttons, etc **/
+	void updateStatus() {
+		boolean status = (alignments.size() > 1);
+		if (alignments.size() >= 2 && getTableRowSelection().length == 0) {
+			status = false;
+		}
+		for (JButton button : linkButtons) {
+			button.setEnabled(status);
+		}
+		for (JButton button : unlinkButtons) {
+			button.setEnabled(status);
+		}
+		status = (getTableRowSelection().length > 0);
+		splitButton.setEnabled(status);
+		delButton.setEnabled(status);
+	}
+	
+} // class AlignmentListInputEditor
+
diff --git a/src/beast/app/beauti/AlignmentViewer.java b/src/beast/app/beauti/AlignmentViewer.java
new file mode 100644
index 0000000..e514437
--- /dev/null
+++ b/src/beast/app/beauti/AlignmentViewer.java
@@ -0,0 +1,286 @@
+package beast.app.beauti;
+
+import javax.swing.*;
+import javax.swing.table.*;
+
+import beast.evolution.alignment.Alignment;
+import beast.evolution.datatype.DataType;
+import beast.util.NexusParser;
+
+
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.File;
+import java.util.HashMap;
+import java.util.Map;
+
+
+public class AlignmentViewer extends JPanel {
+    private static final long serialVersionUID = 1L;
+
+    Object[][] tableData;
+    Object[] columnData;
+    boolean useColor = false;
+    // flag to indicate that the most frequently occurring character is shown as a dot
+    boolean useDots = true;
+    Alignment m_alignment;
+    Map<Character, Color> m_customColorMap = new HashMap<Character, Color>();
+
+    /**
+     * define which character maps to which color *
+     */
+    public void setCustomColorMap(Map<Character, Color> colorMap) {
+        for (char c : m_customColorMap.keySet()) {
+            m_customColorMap.put(c, colorMap.get(c));
+        }
+    }
+
+    /**
+     * constructor processes alignment and sets up table with first column fixed *
+     */
+    public AlignmentViewer(Alignment data) throws Exception {
+        m_alignment = data;
+        int nSites = data.getSiteCount();
+        int nTaxa = data.getNrTaxa();
+        tableData = new Object[nTaxa][nSites + 1];
+        char[] headerChar = updateTableData();
+
+        // set up row labels
+        for (int i = 0; i < nTaxa; i++) {
+            tableData[i][0] = data.getTaxaNames().get(i);
+        }
+
+        // set up column labels
+        columnData = new Object[nSites + 1];
+        for (int i = 1; i < nSites + 1; i++) {
+            columnData[i] = "<html>.<br>" + headerChar[i - 1] + "</html>";
+        }
+        columnData[0] = "<html><br>taxon name</html>";
+        columnData[1] = "<html>1<br>" + headerChar[0] + "</html>";
+        for (int i = 10; i < nSites; i += 10) {
+            String s = i + "";
+            for (int j = 0; j < s.length(); j++) {
+            	if (i+j < columnData.length) {
+            		columnData[i + j] = "<html>" + s.charAt(j) + "<br>" + headerChar[i - 1] + "</html>";
+            	}
+            }
+            columnData[i - 5] = "<html>+<br>" + headerChar[i - 1] + "</html>";
+        }
+
+        // create table in scrollpane with first column fixed
+        final TableModel fixedColumnModel = new AbstractTableModel() {
+            private static final long serialVersionUID = 1L;
+
+            public int getColumnCount() {
+                return 1;
+            }
+
+            public String getColumnName(int column) {
+                return columnData[column] + "";
+            }
+
+            public int getRowCount() {
+                return tableData.length;
+            }
+
+            public Object getValueAt(int row, int column) {
+                return tableData[row][column];
+            }
+        };
+
+        final TableModel mainModel = new AbstractTableModel() {
+            private static final long serialVersionUID = 1L;
+
+            public int getColumnCount() {
+                return columnData.length - 1;
+            }
+
+            public String getColumnName(int column) {
+                return columnData[column + 1] + "";
+            }
+
+            public int getRowCount() {
+                return tableData.length;
+            }
+
+            public Object getValueAt(int row, int column) {
+                return tableData[row][column + 1];
+            }
+        };
+
+        JTable fixedTable = new JTable(fixedColumnModel);
+        fixedTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
+        Font font = fixedTable.getFont();
+        font = new Font(font.getFontName(), font.getStyle(), 8);
+        fixedTable.setFont(font);
+        TableColumn col = fixedTable.getColumnModel().getColumn(0);
+        col.setPreferredWidth(200);
+        fixedTable.getTableHeader().setFont(font);
+
+        JTable mainTable = new JTable(mainModel);
+        mainTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
+        mainTable.setFont(font);
+        mainTable.getTableHeader().setFont(font);
+        for (int i = 0; i < nSites; i++) {
+            col = mainTable.getColumnModel().getColumn(i);
+            col.setPreferredWidth(6);
+        }
+
+        ListSelectionModel model = fixedTable.getSelectionModel();
+        mainTable.setSelectionModel(model);
+        mainTable.setShowGrid(false);
+
+        JScrollPane scrollPane = new JScrollPane(mainTable);
+        Dimension fixedSize = fixedTable.getPreferredSize();
+        JViewport viewport = new JViewport();
+        viewport.setView(fixedTable);
+        viewport.setPreferredSize(fixedSize);
+        viewport.setMaximumSize(fixedSize);
+        scrollPane.setCorner(JScrollPane.UPPER_LEFT_CORNER, fixedTable.getTableHeader());
+        scrollPane.setRowHeaderView(viewport);
+
+
+        setLayout(new BorderLayout());
+        add(scrollPane, BorderLayout.CENTER);
+    }
+
+    private char[] updateTableData() {
+        int nSites = m_alignment.getSiteCount();
+        int nTaxa = m_alignment.getNrTaxa();
+
+        // set up table content
+        DataType dataType = m_alignment.getDataType();
+        char[] headerChar = new char[nSites];
+        Object[][] colorMap = setupColorMap();
+        try {
+            for (int i = 0; i < nSites; i++) {
+                int iPattern = m_alignment.getPatternIndex(i);
+                int[] pattern = m_alignment.getPattern(iPattern);
+                String sPattern = dataType.state2string(pattern);
+                headerChar[i] = mostFrequentCharInPattern(sPattern);
+                for (int j = 0; j < nTaxa; j++) {
+                    char c = sPattern.charAt(j);
+                    if (c == headerChar[i]) {
+                        tableData[j][i + 1] = colorMap[0][c];
+                    } else {
+                        tableData[j][i + 1] = colorMap[1][c];
+                    }
+                }
+            }
+        } catch (Exception e) {
+            // ignore
+        }
+        return headerChar;
+    }
+
+    /**
+     * determine content of table cells.
+     * Without color, only Characters are displayed, which can be a bit faster than using color
+     * With color, the color is encoded in HTML
+     *
+     * @return an array of 2x256 where the first entry is for the most frequently occurring character,
+     *         and the second for the others
+     *         *
+     */
+    private Object[][] setupColorMap() {
+        if (useColor) {
+            String[][] colorMap = new String[2][256];
+            for (int k = 'A'; k < 'Z'; k++) {
+                int i = k - 'A';
+                int nRed = ((i & 0x80) >> 7) + ((i & 0x10) >> 4) + ((i & 0x2) << 1);
+                int nGreen = ((i & 0x40) >> 6) + ((i & 0x08) >> 2) + ((i & 0x4));
+                int nBlue = ((i & 0x20) >> 5) + ((i & 0x04) >> 1) + ((i & 0x1) << 2);
+                int nColor = (nRed << 21 + (nGreen << 18)) + (nGreen << 13) + (nBlue << 10) + (nBlue << 5) + (nRed << 2);
+                colorMap[0][k] = "<html><font color='#" + Integer.toString(nColor, 16) + "'><b>.</b></html>";
+                colorMap[1][k] = "<html><font color='#" + Integer.toString(nColor, 16) + "'><b>" + ((char) k) + "</font></html>";
+            }
+            for (char c : m_customColorMap.keySet()) {
+                Color color = m_customColorMap.get(c);
+                colorMap[0][c] = "<html><font color='#" + Integer.toString(color.getRGB(), 16) + "'><b>.</b></html>";
+                colorMap[1][c] = "<html><font color='#" + Integer.toString(color.getRGB(), 16) + "'><b>" + c + "</font></html>";
+            }
+            if (!this.useDots) {
+                colorMap[0] = colorMap[1];
+            }
+            return colorMap;
+        } else {
+            Character[][] colorMap = new Character[2][256];
+            for (int i = 0; i < 256; i++) {
+                colorMap[0][i] = '.';
+                colorMap[1][i] = (char) i;
+            }
+            if (!this.useDots) {
+                colorMap[0] = colorMap[1];
+            }
+            return colorMap;
+        }
+    }
+
+    private char mostFrequentCharInPattern(String sPattern) {
+        char[] counts = new char[256];
+        for (int i = 0; i < sPattern.length(); i++) {
+            counts[sPattern.charAt(i)]++;
+        }
+        int iMax = 0, nMax = 0;
+        for (int i = 0; i < counts.length; i++) {
+            if (counts[i] > nMax) {
+                iMax = i;
+                nMax = counts[i];
+            }
+        }
+        return (char) iMax;
+    }
+
+    public void showInDialog() {
+        JDialog dlg = new JDialog();
+        dlg.setName("AlignmentViewer");
+        dlg.add(this);
+
+        Box buttonBox = Box.createHorizontalBox();
+        JCheckBox useDotsCheckBox = new JCheckBox("Use dots", true);
+        useDotsCheckBox.addActionListener(new ActionListener() {
+
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                JCheckBox _useDots = (JCheckBox) e.getSource();
+                useDots = _useDots.isSelected();
+                updateTableData();
+                repaint();
+            }
+        });
+        buttonBox.add(useDotsCheckBox);
+
+        JCheckBox useColorCheckBox = new JCheckBox("Use Color");
+        useColorCheckBox.setName("UseColor");
+        useColorCheckBox.addActionListener(new ActionListener() {
+
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                JCheckBox hasColor = (JCheckBox) e.getSource();
+                useColor = hasColor.isSelected();
+                updateTableData();
+                repaint();
+            }
+        });
+        buttonBox.add(useColorCheckBox);
+        dlg.add(buttonBox, BorderLayout.SOUTH);
+
+        dlg.setSize(1024, 600);
+        dlg.setModal(true);
+        dlg.setVisible(true);
+        dlg.dispose();
+    }
+
+    public static void main(String[] args) {
+        try {
+            NexusParser parser = new NexusParser();
+            parser.parseFile(new File(args[0]));
+            Alignment data = parser.m_alignment;
+            AlignmentViewer panel = new AlignmentViewer(data);
+            panel.showInDialog();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}
diff --git a/src/beast/app/beauti/Beauti.java b/src/beast/app/beauti/Beauti.java
new file mode 100644
index 0000000..9733ac7
--- /dev/null
+++ b/src/beast/app/beauti/Beauti.java
@@ -0,0 +1,1293 @@
+package beast.app.beauti;
+
+
+import beast.app.BEASTVersion;
+import beast.app.beauti.BeautiDoc.ActionOnExit;
+import beast.app.beauti.BeautiDoc.DOC_STATUS;
+import beast.app.draw.BEASTObjectPanel;
+import beast.app.draw.HelpBrowser;
+import beast.app.draw.ModelBuilder;
+import beast.app.draw.MyAction;
+import beast.app.util.Utils;
+import beast.core.BEASTInterface;
+import beast.core.util.Log;
+import beast.evolution.alignment.Alignment;
+import beast.util.AddOnManager;
+import jam.framework.DocumentFrame;
+
+import org.fest.util.Files;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import javax.swing.*;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import java.awt.*;
+import java.awt.datatransfer.Clipboard;
+import java.awt.datatransfer.ClipboardOwner;
+import java.awt.datatransfer.StringSelection;
+import java.awt.datatransfer.Transferable;
+import java.awt.event.*;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+
+public class Beauti extends JTabbedPane implements BeautiDocListener {
+    private static final long serialVersionUID = 1L;
+    static final String BEAUTI_ICON = "beast/app/draw/icons/beauti.png";
+
+    // ExtensionFileFilter ef0 = new ExtensionFileFilter(".nex", "Nexus files");
+    // ExtensionFileFilter ef1 = new ExtensionFileFilter(".xml", "BEAST files");
+
+    /**
+     * current directory for opening files *
+     */
+    public static String g_sDir = System.getProperty("user.dir");
+    /**
+     * File extension for Beast specifications
+     */
+    static public final String FILE_EXT = ".xml";
+    static public final String FILE_EXT2 = ".json";
+    static final String fileSep = System.getProperty("file.separator");
+    
+    /**
+     * document in document-view pattern. BTW this class is the view
+     */
+    public BeautiDoc doc;
+    public JFrame frame;
+
+    /**
+     * currently selected tab *
+     */
+    public BeautiPanel currentTab;
+
+    public boolean[] bPaneIsVisible;
+    public BeautiPanel[] panels;
+
+    /**
+     * menu for file handling, importing partitions, etc.
+     */
+	JMenu fileMenu;
+    /**
+     * menu for switching templates *
+     */
+    JMenu templateMenu;
+    /**
+     * menu for making showing/hiding tabs *
+     */
+    JMenu viewMenu;
+
+    JCheckBoxMenuItem autoSetClockRate;
+    JCheckBoxMenuItem allowLinking;
+    JCheckBoxMenuItem autoUpdateOperatorWeights;
+    JCheckBoxMenuItem autoUpdateFixMeanSubstRate;
+
+    /**
+     * flag indicating beauti is in the process of being set up and panels
+     * should not sync with current model *
+     */
+    public boolean isInitialising = true;
+
+    public Beauti(BeautiDoc doc) {
+        bPaneIsVisible = new boolean[doc.beautiConfig.panels.size()];
+        Arrays.fill(bPaneIsVisible, true);
+        // m_panels = new BeautiPanel[NR_OF_PANELS];
+        this.doc = doc;
+        this.doc.addBeautiDocListener(this);
+        doc.setBeauti(this);
+    }
+
+    void setTitle() {
+        frame.setTitle("BEAUti 2: " + this.doc.getTemplateName() + " "
+                + doc.getFileName());
+    }
+
+    void toggleVisible(int nPanelNr) {
+        if (bPaneIsVisible[nPanelNr]) {
+            bPaneIsVisible[nPanelNr] = false;
+            int nTabNr = tabNrForPanel(nPanelNr);
+            removeTabAt(nTabNr);
+        } else {
+            bPaneIsVisible[nPanelNr] = true;
+            int nTabNr = tabNrForPanel(nPanelNr);
+            BeautiPanelConfig panel = doc.beautiConfig.panels.get(nPanelNr);
+            insertTab(
+                    doc.beautiConfig.getButtonLabel(this,
+                            panel.sNameInput.get()), null, panels[nPanelNr],
+                    panel.sTipTextInput.get(), nTabNr);
+            // }
+            setSelectedIndex(nTabNr);
+        }
+    }
+
+    int tabNrForPanel(int nPanelNr) {
+        int k = 0;
+        for (int i = 0; i < nPanelNr; i++) {
+            if (bPaneIsVisible[i]) {
+                k++;
+            }
+        }
+        return k;
+    }
+
+    Action a_new = new ActionNew();
+    public Action a_load = new ActionLoad();
+    Action a_template = new ActionTemplate();
+    Action a_addOn = new ActionAddOn();
+//    public Action a_import = new ActionImport();
+    public Action a_save = new ActionSave();
+    Action a_saveas = new ActionSaveAs();
+    Action a_close = new ActionClose();
+    Action a_quit = new ActionQuit();
+    Action a_viewall = new ActionViewAllPanels();
+
+    Action a_help = new ActionHelp();
+    Action a_msgs = new ActionMsgs();
+    Action a_citation = new ActionCitation();
+    Action a_about = new ActionAbout();
+    Action a_viewModel = new ActionViewModel();
+
+    @Override
+    public void docHasChanged() throws Exception {
+        setUpPanels();
+        setUpViewMenu();
+        setTitle();
+    }
+
+    class ActionSave extends MyAction {
+        private static final long serialVersionUID = 1;
+
+        public ActionSave() {
+            super("Save", "Save Model", "save", KeyEvent.VK_S);
+            setEnabled(false);
+        } // c'tor
+
+        public ActionSave(String sName, String sToolTipText, String sIcon,
+                          int acceleratorKey) {
+            super(sName, sToolTipText, sIcon, acceleratorKey);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            if (!doc.getFileName().equals("")) {
+                if (doc.validateModel() != DOC_STATUS.DIRTY) {
+                    JOptionPane.showMessageDialog(null,
+                            "There is no data to save to file");
+                    return;
+                }
+                saveFile(doc.getFileName());
+                // m_doc.isSaved();
+            } else {
+                if (saveAs()) {
+                    // m_doc.isSaved();
+                }
+            }
+        } // actionPerformed
+
+    } // class ActionSave
+
+    class ActionSaveAs extends ActionSave {
+        /**
+         * for serialisation
+         */
+        private static final long serialVersionUID = -20389110859354L;
+
+        public ActionSaveAs() {
+            super("Save As", "Save Model As", "saveas", -1);
+            setEnabled(false);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            saveAs();
+        } // actionPerformed
+    } // class ActionSaveAs
+
+    boolean saveAs() {
+        if (doc.validateModel() == DOC_STATUS.NO_DOCUMENT) {
+            JOptionPane.showMessageDialog(null,
+                    "There is no data to save to file");
+            return false;
+        }
+        String fileSep = System.getProperty("file.separator");
+        if (fileSep.equals("\\")) {
+            fileSep = "\\\\";
+        }
+        String defaultFile = g_sDir + (doc.getFileName().equals("") ? "" : fileSep + new File(doc.getFileName()).getName());
+        File file = beast.app.util.Utils.getSaveFile("Save Model As", new File(
+                defaultFile), null, FILE_EXT, FILE_EXT2);
+        if (file != null) {
+            if (file.exists() && !Utils.isMac()) {
+                if (JOptionPane.showConfirmDialog(null,
+                        "File " + file.getName()
+                                + " already exists. Do you want to overwrite?",
+                        "Overwrite file?", JOptionPane.YES_NO_CANCEL_OPTION) != JOptionPane.YES_OPTION) {
+                    return false;
+                }
+            }
+            // System.out.println("Saving to file \""+
+            // f.getAbsoluteFile().toString()+"\"");
+            doc.setFileName(file.getAbsolutePath());// fc.getSelectedFile().toString();
+            if (doc.getFileName().lastIndexOf(fileSep) > 0) {
+                g_sDir = doc.getFileName().substring(0,
+                        doc.getFileName().lastIndexOf(fileSep));
+            }
+            if (!doc.getFileName().toLowerCase().endsWith(FILE_EXT) && !doc.getFileName().toLowerCase().endsWith(FILE_EXT2))
+                doc.setFileName(doc.getFileName().concat(FILE_EXT));
+            saveFile(doc.getFileName());
+            setTitle();
+            return true;
+        }
+        return false;
+    } // saveAs
+
+    public void saveFile(String sFileName) {
+        try {
+            if (currentTab != null) {
+                currentTab.config.sync(currentTab.iPartition);
+            } else {
+                panels[0].config.sync(0);
+            }
+            doc.save(sFileName);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    } // saveFile
+
+    class ActionNew extends MyAction {
+        private static final long serialVersionUID = 1;
+
+        public ActionNew() {
+            super("New", "Start new analysis", "new", KeyEvent.VK_N);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            main2(new String[0]);
+            // doc.newAnalysis();
+            // a_save.setEnabled(false);
+            // a_saveas.setEnabled(false);
+            // setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
+        }
+    }
+
+    class ActionLoad extends MyAction {
+        private static final long serialVersionUID = 1;
+
+        public ActionLoad() {
+            super("Load", "Load Beast File", "open", KeyEvent.VK_O);
+        }
+
+        public ActionLoad(String sName, String sToolTipText, String sIcon,
+                          int acceleratorKey) {
+            super(sName, sToolTipText, sIcon, acceleratorKey);
+        }
+
+        public void actionPerformed(ActionEvent ae) {
+            File file = beast.app.util.Utils.getLoadFile("Load Beast XML File",
+                    new File(g_sDir), "Beast XML files", "xml");
+            // JFileChooser fileChooser = new JFileChooser(g_sDir);
+            // fileChooser.addChoosableFileFilter(ef1);
+            // fileChooser.setDialogTitle("Load Beast XML File");
+            // if (fileChooser.showOpenDialog(null) ==
+            // JFileChooser.APPROVE_OPTION) {
+            // sFileName = fileChooser.getSelectedFile().toString();
+            if (file != null) {
+                setCursor(new Cursor(Cursor.WAIT_CURSOR));
+                doc.newAnalysis();
+                doc.setFileName(file.getAbsolutePath());
+                String fileSep = System.getProperty("file.separator");
+                if (fileSep.equals("\\")) {
+                    fileSep = "\\\\";
+                }
+                if (doc.getFileName().lastIndexOf(fileSep) > 0) {
+                    g_sDir = doc.getFileName().substring(0,
+                            doc.getFileName().lastIndexOf(fileSep));
+                }
+                try {
+                    doc.loadXML(new File(doc.getFileName()));
+                    a_save.setEnabled(true);
+                    a_saveas.setEnabled(true);
+                    setTitle();
+                } catch (Exception e) {
+                    e.printStackTrace();
+                    JOptionPane.showMessageDialog(
+                            null,
+                            "Something went wrong loading the file: "
+                                    + e.getMessage());
+                }
+            }
+            setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
+        } // actionPerformed
+    }
+
+    class ActionTemplate extends MyAction {
+        private static final long serialVersionUID = 1;
+
+        public ActionTemplate() {
+            super("Other Template", "Load Beast Analysis Template From File",
+                    "template", -1);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            setCursor(new Cursor(Cursor.WAIT_CURSOR));
+            File file = beast.app.util.Utils
+                    .getLoadFile("Load Template XML File");
+            // JFileChooser fileChooser = new
+            // JFileChooser(System.getProperty("user.dir")+"/templates");
+            // fileChooser.addChoosableFileFilter(ef1);
+            // fileChooser.setDialogTitle("Load Template XML File");
+            // if (fileChooser.showOpenDialog(null) ==
+            // JFileChooser.APPROVE_OPTION) {
+            // String sFileName = fileChooser.getSelectedFile().toString();
+            if (file != null) {
+                String sFileName = file.getAbsolutePath();
+                try {
+                    doc.loadNewTemplate(sFileName);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                    JOptionPane.showMessageDialog(
+                            null,
+                            "Something went wrong loading the template: "
+                                    + e.getMessage());
+                }
+            }
+            createFileMenu();
+            setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
+        } // actionPerformed
+    } // ActionTemplate
+
+    class ActionAddOn extends MyAction {
+        private static final long serialVersionUID = 1;
+
+        public ActionAddOn() {
+            super("Manage Packages", "Manage Packages", "package", -1);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+        	JPackageDialog panel = new JPackageDialog();
+        	JDialog dlg = panel.asDialog(frame);
+            dlg.setVisible(true);
+            // refresh template menu item
+            templateMenu.removeAll();
+            List<AbstractAction> templateActions = getTemplateActions();
+            for (AbstractAction a : templateActions) {
+                templateMenu.add(a);
+            }
+            templateMenu.addSeparator();
+            templateMenu.add(a_template);
+            setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
+        } // actionPerformed
+    }
+
+//    class ActionImport extends MyAction {
+//        private static final long serialVersionUID = 1;
+//
+//        public ActionImport() {
+//            super("Import Alignment", "Import Alignment File", "import",
+//                    KeyEvent.VK_I);
+//        }
+//
+//        public ActionImport(String sName, String sToolTipText, String sIcon,
+//                            int acceleratorKey) {
+//            super(sName, sToolTipText, sIcon, acceleratorKey);
+//        }
+//
+//        public void actionPerformed(ActionEvent ae) {
+//
+//            try {
+//                setCursor(new Cursor(Cursor.WAIT_CURSOR));
+//
+//                // get user-specified alignments
+//                doc.beautiConfig.selectAlignments(doc,Beauti.this);
+//
+//                doc.connectModel();
+//                doc.fireDocHasChanged();
+//                a_save.setEnabled(true);
+//                a_saveas.setEnabled(true);
+//            } catch (Exception e) {
+//                e.printStackTrace();
+//
+//                String text = "Something went wrong importing the alignment:\n";
+//                JTextArea textArea = new JTextArea(text);
+//                textArea.setColumns(30);
+//                textArea.setLineWrap(true);
+//                textArea.setWrapStyleWord(true);
+//                textArea.append(e.getMessage());
+//                textArea.setSize(textArea.getPreferredSize().width, 1);
+//                textArea.setOpaque(false);
+//                JOptionPane.showMessageDialog(null, textArea,
+//                        "Error importing alignment",
+//                        JOptionPane.WARNING_MESSAGE);
+//            }
+//            setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
+//            // }
+//        } // actionPerformed
+//    }
+
+    class ActionClose extends ActionSave {
+        /**
+         * for serialisation
+         */
+        private static final long serialVersionUID = -2038911085935515L;
+
+        public ActionClose() {
+            super("Close", "Close Window", "close", KeyEvent.VK_W);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            // if (!m_doc.m_bIsSaved) {
+            if (!quit()) {
+                return;
+            }
+
+            JMenuItem menuItem = (JMenuItem) ae.getSource();
+            JPopupMenu popupMenu = (JPopupMenu) menuItem.getParent();
+            Component invoker = popupMenu.getInvoker();
+            JComponent invokerAsJComponent = (JComponent) invoker;
+            Container topLevel = invokerAsJComponent.getTopLevelAncestor();
+            if (topLevel != null) {
+                ((JFrame) topLevel).dispose();
+            }
+        }
+    } // class ActionClose
+
+    class ActionQuit extends ActionSave {
+        /**
+         * for serialisation
+         */
+        private static final long serialVersionUID = -2038911085935515L;
+
+        public ActionQuit() {
+            super("Exit", "Exit Program", "exit", KeyEvent.VK_F4);
+            putValue(Action.MNEMONIC_KEY, new Integer('x'));
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            // if (!m_doc.m_bIsSaved) {
+            if (!quit()) {
+                return;
+            }
+            System.exit(0);
+        }
+    } // class ActionQuit
+
+    boolean quit() {
+        if (doc.validateModel() == DOC_STATUS.DIRTY) {
+            int result = JOptionPane.showConfirmDialog(null,
+                    "Do you want to save the Beast specification?",
+                    "Save before closing?", JOptionPane.YES_NO_CANCEL_OPTION);
+            System.err.println("result=" + result);
+            if (result == JOptionPane.CANCEL_OPTION) {
+                return false;
+            }
+            if (result == JOptionPane.YES_OPTION) {
+                if (!saveAs()) {
+                    return false;
+                }
+            }
+        }
+        return true;
+    }
+
+    ViewPanelCheckBoxMenuItem[] m_viewPanelCheckBoxMenuItems;
+
+    class ViewPanelCheckBoxMenuItem extends JCheckBoxMenuItem {
+        private static final long serialVersionUID = 1L;
+        int m_iPanel;
+
+        ViewPanelCheckBoxMenuItem(int iPanel) {
+            super("Show "
+                    + doc.beautiConfig.panels.get(iPanel).sNameInput.get()
+                    + " panel",
+                    doc.beautiConfig.panels.get(iPanel).bIsVisibleInput.get());
+            m_iPanel = iPanel;
+            if (m_viewPanelCheckBoxMenuItems == null) {
+                m_viewPanelCheckBoxMenuItems = new ViewPanelCheckBoxMenuItem[doc.beautiConfig.panels
+                        .size()];
+            }
+            m_viewPanelCheckBoxMenuItems[iPanel] = this;
+        } // c'tor
+
+        void doAction() {
+            toggleVisible(m_iPanel);
+        }
+    }
+
+    ;
+
+    /**
+     * makes all panels visible *
+     */
+    class ActionViewAllPanels extends MyAction {
+        private static final long serialVersionUID = -1;
+
+        public ActionViewAllPanels() {
+            super("View all", "View all panels", "viewall", -1);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            for (int nPanelNr = 0; nPanelNr < bPaneIsVisible.length; nPanelNr++) {
+                if (!bPaneIsVisible[nPanelNr]) {
+                    toggleVisible(nPanelNr);
+                    m_viewPanelCheckBoxMenuItems[nPanelNr].setState(true);
+                }
+            }
+        } // actionPerformed
+    } // class ActionViewAllPanels
+
+    class ActionAbout extends MyAction {
+        private static final long serialVersionUID = -1;
+
+        public ActionAbout() {
+            super("About", "Help about", "about", -1);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            BEASTVersion version = new BEASTVersion();
+            JOptionPane.showMessageDialog(null, version.getCredits(),
+                    "About Beauti " + version.getVersionString(), JOptionPane.PLAIN_MESSAGE,
+                    Utils.getIcon(BEAUTI_ICON));
+        }
+    } // class ActionAbout
+
+    class ActionHelp extends MyAction {
+        private static final long serialVersionUID = -1;
+
+        public ActionHelp() {
+            super("Help", "Help on current panel", "help", -1);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            setCursor(new Cursor(Cursor.WAIT_CURSOR));
+            HelpBrowser b = new HelpBrowser(currentTab.config.getType());
+            b.setSize(800, 800);
+            b.setVisible(true);
+            b.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
+            setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
+        }
+    } // class ActionHelp
+    
+    class ActionMsgs extends MyAction {
+        private static final long serialVersionUID = -1;
+
+        public ActionMsgs() {
+            super("Messages", "Show information, warning and error messages", "msgs", -1);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+        	if (doc.baos == null) {
+        		JOptionPane.showMessageDialog(frame, "<html>Error and warning messages are printed to Stdout and Stderr<br>" +
+        				"To show them here, start BEAUti with the -capture argument.</html>");
+        	} else {
+	        	String msgs = doc.baos.toString();
+	        	JTextArea textArea = new JTextArea(msgs);
+	        	textArea.setRows(40);
+	        	textArea.setColumns(50);
+	        	textArea.setEditable(true);
+	        	JScrollPane scroller = new JScrollPane(textArea);
+	        	JOptionPane.showMessageDialog(frame, scroller);
+        	}
+        }    	
+    }
+
+    class ActionCitation extends MyAction implements ClipboardOwner {
+        private static final long serialVersionUID = -1;
+
+        public ActionCitation() {
+            super("Citation",
+                    "Show appropriate citations and copy to clipboard",
+                    "citation", -1);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            String sCitations = doc.mcmc.get().getCitations();
+            try {
+                StringSelection stringSelection = new StringSelection(
+                        sCitations);
+                Clipboard clipboard = Toolkit.getDefaultToolkit()
+                        .getSystemClipboard();
+                clipboard.setContents(stringSelection, this);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            JOptionPane.showMessageDialog(null, sCitations
+                    + "\nCitations copied to clipboard",
+                    "Citation(s) applicable to this model:",
+                    JOptionPane.INFORMATION_MESSAGE);
+
+        } // getCitations
+
+        @Override
+        public void lostOwnership(Clipboard clipboard, Transferable contents) {
+            // do nothing
+        }
+    } // class ActionAbout
+
+    class ActionViewModel extends MyAction {
+        private static final long serialVersionUID = -1;
+
+        public ActionViewModel() {
+            super("View model", "View model graph", "model", -1);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            JFrame frame = new JFrame("Model Builder");
+            ModelBuilder modelBuilder = new ModelBuilder();
+            modelBuilder.init();
+            frame.add(modelBuilder, BorderLayout.CENTER);
+            frame.add(modelBuilder.m_jTbTools2, BorderLayout.NORTH);
+            modelBuilder.setEditable(false);
+            modelBuilder.m_doc.init(doc.mcmc.get());
+            modelBuilder.setDrawingFlag();
+            frame.setSize(600, 800);
+            frame.setVisible(true);
+        }
+    } // class ActionViewModel
+
+    public void refreshPanel() {
+        try {
+            BeautiPanel panel = (BeautiPanel) getSelectedComponent();
+            if (panel != null) {
+                this.doc.determinePartitions();
+                panel.updateList();
+                panel.refreshPanel();
+            }
+            requestFocus();
+        } catch (Exception ex) {
+            ex.printStackTrace();
+        }
+    }
+
+
+    public JMenuBar makeMenuBar() {
+        JMenuBar menuBar = new JMenuBar();
+        fileMenu = new JMenu("File");
+        fileMenu.setMnemonic('F');
+        menuBar.add(fileMenu);
+        createFileMenu();
+
+        JMenu modeMenu = new JMenu("Mode");
+        menuBar.add(modeMenu);
+        modeMenu.setMnemonic('M');
+
+        autoSetClockRate = new JCheckBoxMenuItem(
+                "Automatic set clock rate", this.doc.bAutoSetClockRate);
+        autoSetClockRate.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent ae) {
+                doc.bAutoSetClockRate = autoSetClockRate.getState();
+                refreshPanel();
+            }
+        });
+        modeMenu.add(autoSetClockRate);
+
+        allowLinking = new JCheckBoxMenuItem(
+                "Allow parameter linking", this.doc.bAllowLinking);
+        allowLinking.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent ae) {
+                doc.bAllowLinking = allowLinking.getState();
+                doc.determineLinks();
+                refreshPanel();
+            }
+        });
+        modeMenu.add(allowLinking);
+
+        autoUpdateOperatorWeights = new JCheckBoxMenuItem(
+                "Automatic change operator weights for *BEAST analyses", this.doc.bAutoUpdateOperatorWeights);
+        autoUpdateOperatorWeights.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent ae) {
+                doc.bAutoUpdateOperatorWeights = autoUpdateOperatorWeights.getState();
+                refreshPanel();
+            }
+        });
+        modeMenu.add(autoUpdateOperatorWeights);
+
+        autoUpdateFixMeanSubstRate = new JCheckBoxMenuItem(
+                "Automatic set fix mean substitution rate flag", this.doc.bAutoUpdateFixMeanSubstRate);
+        autoUpdateFixMeanSubstRate.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent ae) {
+                doc.bAutoUpdateFixMeanSubstRate = autoUpdateFixMeanSubstRate.getState();
+                refreshPanel();
+            }
+        });
+        modeMenu.add(autoUpdateFixMeanSubstRate);
+
+        // final JCheckBoxMenuItem muteSound = new
+        // JCheckBoxMenuItem("Mute sound", false);
+        // muteSound.addActionListener(new ActionListener() {
+        // public void actionPerformed(ActionEvent ae) {
+        // BeautiPanel.soundIsPlaying = !muteSound.getState();
+        // refreshPanel();
+        // }
+        // });
+        // modeMenu.add(muteSound);
+
+        viewMenu = new JMenu("View");
+        menuBar.add(viewMenu);
+        viewMenu.setMnemonic('V');
+        setUpViewMenu();
+
+        JMenu helpMenu = new JMenu("Help");
+        menuBar.add(helpMenu);
+        helpMenu.setMnemonic('H');
+        helpMenu.add(a_help);
+        helpMenu.add(a_msgs);
+        helpMenu.add(a_citation);
+        helpMenu.add(a_viewModel);
+        if (!Utils.isMac()) {
+            helpMenu.add(a_about);
+        }
+
+        setMenuVisibiliy("", menuBar);
+
+        return menuBar;
+    } // makeMenuBar
+
+    private void createFileMenu() {
+    	// first clear menu
+   		fileMenu.removeAll();
+
+        fileMenu.add(a_new);
+        fileMenu.add(a_load);
+        fileMenu.addSeparator();
+        addAlignmentProviderMenus(fileMenu);
+        fileMenu.addSeparator();
+        templateMenu = new JMenu("Template");
+        fileMenu.add(templateMenu);
+        List<AbstractAction> templateActions = getTemplateActions();
+        for (AbstractAction a : templateActions) {
+            templateMenu.add(a);
+        }
+        JMenu workDirMenu = new JMenu("Set working dir");
+        fileMenu.add(workDirMenu);
+        List<AbstractAction> workDirMenuActions = getWorkDirActions();
+        for (AbstractAction a : workDirMenuActions) {
+        	workDirMenu.add(a);
+        }
+        templateMenu.addSeparator();
+        templateMenu.add(a_template);
+        fileMenu.add(a_addOn);
+        fileMenu.addSeparator();
+        fileMenu.add(a_save);
+        fileMenu.add(a_saveas);
+        if (!Utils.isMac()) {
+            fileMenu.addSeparator();
+            fileMenu.add(a_close);
+            fileMenu.add(a_quit);
+        }
+	}
+
+	private void addAlignmentProviderMenus(JMenu fileMenu) {
+        List<BeautiAlignmentProvider> providers = doc.beautiConfig.alignmentProvider;
+        for (BeautiAlignmentProvider provider : providers) {
+        	AbstractAction action = new AbstractAction() {
+				private static final long serialVersionUID = 1L;
+
+				@Override
+				public void actionPerformed(ActionEvent e) {
+		            try {
+		                setCursor(new Cursor(Cursor.WAIT_CURSOR));
+
+		                // get user-specified alignments
+				        List<BEASTInterface> plugins = provider.getAlignments(doc);
+				        if (plugins != null) {
+					        for (BEASTInterface o : plugins) {
+					        	if (o instanceof Alignment) {
+					        		try {
+					        			BeautiDoc.createTaxonSet((Alignment) o, doc);
+					        		} catch(Exception ex) {
+					        			ex.printStackTrace();
+					        		}
+					        	}
+					        }
+				        }
+
+		                doc.connectModel();
+		                doc.fireDocHasChanged();
+		                a_save.setEnabled(true);
+		                a_saveas.setEnabled(true);
+		            } catch (Exception exx) {
+		                exx.printStackTrace();
+
+		                String text = "Something went wrong importing the alignment:\n";
+		                JTextArea textArea = new JTextArea(text);
+		                textArea.setColumns(30);
+		                textArea.setLineWrap(true);
+		                textArea.setWrapStyleWord(true);
+		                textArea.append(exx.getMessage());
+		                textArea.setSize(textArea.getPreferredSize().width, 1);
+		                textArea.setOpaque(false);
+		                JOptionPane.showMessageDialog(null, textArea,
+		                        "Error importing alignment",
+		                        JOptionPane.WARNING_MESSAGE);
+		            }
+		            setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
+				}
+			};
+            String providerInfo = provider.toString().replaceAll("Add ", "Add partition for ");
+            action.putValue(Action.SHORT_DESCRIPTION, providerInfo);
+            action.putValue(Action.LONG_DESCRIPTION, providerInfo);
+            action.putValue(Action.NAME, provider.toString());
+        	fileMenu.add(action);
+        }
+	}
+
+	void setUpViewMenu() {
+        m_viewPanelCheckBoxMenuItems = null;
+        viewMenu.removeAll();
+        for (int iPanel = 0; iPanel < doc.beautiConfig.panels.size(); iPanel++) {
+            final ViewPanelCheckBoxMenuItem viewPanelAction = new ViewPanelCheckBoxMenuItem(
+                    iPanel);
+            viewPanelAction.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent ae) {
+                    viewPanelAction.doAction();
+                }
+            });
+            viewMenu.add(viewPanelAction);
+        }
+        viewMenu.addSeparator();
+        viewMenu.add(a_viewall);
+    }
+
+    class TemplateAction extends AbstractAction {
+        private static final long serialVersionUID = 1L;
+
+        String m_sFileName;
+        String templateInfo;
+
+        public TemplateAction(File file) {
+            super("xx");
+            m_sFileName = file.getAbsolutePath();
+            String fileSep = System.getProperty("file.separator");
+            if (fileSep.equals("\\")) {
+                fileSep = "\\";
+            }
+            int i = m_sFileName.lastIndexOf(fileSep) + 1;
+            String sName = m_sFileName.substring(
+                    i, m_sFileName.length() - 4);
+            putValue(Action.NAME, sName);
+            try {
+                DocumentBuilderFactory factory = DocumentBuilderFactory
+                        .newInstance();
+                Document doc = factory.newDocumentBuilder().parse(file);
+                doc.normalize();
+                // get name and version of add-on
+                Element template = doc.getDocumentElement();
+                templateInfo = template.getAttribute("templateinfo");
+                if (templateInfo == null || templateInfo.length() == 0) {
+                    templateInfo = "switch to " + sName + " template";
+                }
+                //templateInfo = "<html>" + templateInfo + "</html>";
+                putValue(Action.SHORT_DESCRIPTION, templateInfo);
+                putValue(Action.LONG_DESCRIPTION, templateInfo);
+            } catch (Exception e) {
+                // ignore
+            }
+        }
+
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            try {
+                if (doc.validateModel() == DOC_STATUS.NO_DOCUMENT) {
+                    doc.loadNewTemplate(m_sFileName);
+                } else if (JOptionPane.showConfirmDialog(frame,
+                        "Changing templates means the information input so far will be lost. "
+                                + "Are you sure you want to change templates?",
+                        "Are you sure?", JOptionPane.YES_NO_CANCEL_OPTION) == JOptionPane.YES_OPTION) {
+                    doc.loadNewTemplate(m_sFileName);
+                }
+                createFileMenu();
+            } catch (Exception ex) {
+                ex.printStackTrace();
+                JOptionPane.showMessageDialog(
+                        null,
+                        "Something went wrong loading the template: "
+                                + ex.getMessage());
+            }
+        }
+
+    }
+
+	private List<AbstractAction> getTemplateActions() {
+        List<AbstractAction> actions = new ArrayList<AbstractAction>();
+        List<String> sBeastDirectories = AddOnManager.getBeastDirectories();
+        for (String sDir : sBeastDirectories) {
+            File dir = new File(sDir + "/templates");
+            getTemplateActionForDir(dir, actions);
+        }
+        return actions;
+    }
+
+    private void getTemplateActionForDir(File dir, List<AbstractAction> actions) {
+        if (dir.exists() && dir.isDirectory()) {
+            File[] files = dir.listFiles();
+            if (files != null) {
+                for (File template : files) {
+                    if (template.getName().toLowerCase().endsWith(".xml")) {
+                        try {
+                            String sXML2 = BeautiDoc.load(template.getAbsolutePath());
+                            if (sXML2.contains("templateinfo=")) {
+                            	String sFileName = template.getName();
+                                sFileName = sFileName.substring(0, sFileName.length() - 4);
+                                boolean duplicate = false;
+                            	for (AbstractAction action : actions) {
+                            		String name = action.getValue(Action.NAME).toString(); 
+                            		if (name.equals(sFileName)) {
+                            			duplicate = true;
+                            		}
+                            	}
+                            	if (!duplicate) {
+                            		actions.add(new TemplateAction(template));
+                            	}
+                            }
+                        } catch (Exception e) {
+                            System.err.println(e.getMessage());
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    private List<AbstractAction> getWorkDirActions() {
+        List<AbstractAction> actions = new ArrayList<AbstractAction>();
+        List<String> beastDirectories = AddOnManager.getBeastDirectories();
+        for (String dir : beastDirectories) {
+        	String exampledir = dir + File.separator+ "examples";
+        	if (new File(exampledir).exists()) {
+	        	AbstractAction action = new AbstractAction() {
+					private static final long serialVersionUID = 1L;
+	
+					@Override
+					public void actionPerformed(ActionEvent e) {
+						g_sDir = dir;
+					}
+	            	
+	            };
+	            String workDirInfo = "Set working directory to " + dir;
+	            String name = dir;
+	            if (name.indexOf(File.separator) >= 0) {
+	            	name = dir.substring(dir.lastIndexOf(File.separator) + 1);
+	            }
+	            action.putValue(Action.SHORT_DESCRIPTION, workDirInfo);
+	            action.putValue(Action.LONG_DESCRIPTION, workDirInfo);
+	            action.putValue(Action.NAME, name);
+	            actions.add(action);
+        	}
+        }
+        return actions;
+    }
+
+    void setMenuVisibiliy(String sParentName, Component c) {
+        String sName = "";
+        if (c instanceof JMenu) {
+            sName = ((JMenu) c).getText();
+        } else if (c instanceof JMenuItem) {
+            sName = ((JMenuItem) c).getText();
+        }
+        if (sName.length() > 0
+                && doc.beautiConfig.menuIsInvisible(sParentName + sName)) {
+            c.setVisible(false);
+        }
+        if (c instanceof JMenu) {
+            for (Component x : ((JMenu) c).getMenuComponents()) {
+                setMenuVisibiliy(sParentName + sName
+                        + (sName.length() > 0 ? "." : ""), x);
+            }
+        } else if (c instanceof Container) {
+            for (int i = 0; i < ((Container) c).getComponentCount(); i++) {
+                setMenuVisibiliy(sParentName, ((Container) c).getComponent(i));
+            }
+        }
+    }
+
+    // hide panels as indicated in the hidepanels attribute in the XML template,
+    // or use default tabs to hide otherwise.
+    public void hidePanels() {
+        // for (int iPanel = 0; iPanel < BeautiConfig.g_panels.size(); iPanel++)
+        // {
+        // BeautiPanelConfig panelConfig = BeautiConfig.g_panels.get(iPanel);
+        // if (!panelConfig.m_bIsVisibleInput.get()) {
+        // toggleVisible(iPanel);
+        // }
+        // }
+    } // hidePanels
+
+    public void setUpPanels() throws Exception {
+        isInitialising = true;
+        // remove any existing tabs
+        if (getTabCount() > 0) {
+            while (getTabCount() > 0) {
+                removeTabAt(0);
+            }
+            bPaneIsVisible = new boolean[doc.beautiConfig.panels.size()];
+            Arrays.fill(bPaneIsVisible, true);
+        }
+        for (int iPanel = 0; iPanel < doc.beautiConfig.panels.size(); iPanel++) {
+            BeautiPanelConfig panelConfig = doc.beautiConfig.panels.get(iPanel);
+            bPaneIsVisible[iPanel] = panelConfig.bIsVisibleInput.get();
+        }
+        // add panels according to BeautiConfig
+        panels = new BeautiPanel[doc.beautiConfig.panels.size()];
+        for (int iPanel = 0; iPanel < doc.beautiConfig.panels.size(); iPanel++) {
+            BeautiPanelConfig panelConfig = doc.beautiConfig.panels.get(iPanel);
+            panels[iPanel] = new BeautiPanel(iPanel, this.doc, panelConfig);
+            addTab(doc.beautiConfig.getButtonLabel(this, panelConfig.getName()),
+                    null, panels[iPanel], panelConfig.getTipText());
+        }
+
+        for (int iPanel = doc.beautiConfig.panels.size() - 1; iPanel >= 0; iPanel--) {
+            if (!bPaneIsVisible[iPanel]) {
+                removeTabAt(iPanel);
+            }
+        }
+        isInitialising = false;
+    }
+
+    /**
+     * record number of frames. If the last frame is closed, exit the app. *
+     */
+    static int BEAUtiIntances = 0;
+
+    public static Beauti main2(String[] args) {
+        try {
+        	ByteArrayOutputStream baos = null;
+            for (String arg : args) {
+            	if (arg.equals("-capture")) {
+            		final PrintStream beautiLog = System.err;
+                	baos = new ByteArrayOutputStream() {
+                		@Override
+                		public synchronized void write(byte[] b, int off, int len) {
+                			super.write(b, off, len);
+                			beautiLog.write(b, off, len);
+                		};
+
+                		@Override
+                		public synchronized void write(int b) {
+                			super.write(b);
+                			beautiLog.write(b);
+                		};
+                		
+                		@Override
+                		public void write(byte[] b) throws java.io.IOException {
+                			super.write(b);
+                			beautiLog.write(b);
+                		};
+                		
+                		@Override
+                		public void flush() throws java.io.IOException {
+                			super.flush();
+                			beautiLog.flush();
+                		};
+                		
+                		@Override
+                		public void close() throws IOException {
+                			super.close();
+                			beautiLog.close();
+                		}
+                	};
+                	
+                	PrintStream p = new PrintStream(baos);
+                	System.setOut(p);
+                	System.setErr(p);
+                	Log.err = p;
+                	Log.warning = p;
+                	Log.info = p;
+                	Log.debug = p;
+                	Log.trace = p;
+            	}
+            }
+        	
+            AddOnManager.loadExternalJars();
+            if (!Utils.isMac()) {
+            	Utils.loadUIManager();
+            }
+            BEASTObjectPanel.init();
+
+            BeautiDoc doc = new BeautiDoc();
+            doc.baos = baos;
+            if (doc.parseArgs(args) == ActionOnExit.WRITE_XML) {
+                return null;
+            }
+
+            final Beauti beauti = new Beauti(doc);
+
+            if (Utils.isMac()) {
+                // set up application about-menu for Mac
+                // Mac-only stuff
+                try {
+                    URL url = ClassLoader.getSystemResource(ModelBuilder.ICONPATH + "beauti.png");
+                    Icon icon = null;
+                    if (url != null) {
+                        icon = new ImageIcon(url);
+                    } else {
+                        System.err.println("Unable to find image: " + ModelBuilder.ICONPATH + "beauti.png");
+                    }
+                    jam.framework.Application application = new jam.framework.MultiDocApplication(null, "BEAUti", "about", icon) {
+
+                        @Override
+                        protected JFrame getDefaultFrame() {
+                            return null;
+                        }
+
+                        @Override
+                        public void doQuit() {
+                            beauti.a_quit.actionPerformed(null);
+                        }
+
+                        @Override
+                        public void doAbout() {
+                            beauti.a_about.actionPerformed(null);
+                        }
+
+                        @Override
+                        public DocumentFrame doOpenFile(File file) {
+                            return null;
+                        }
+
+                        @Override
+                        public DocumentFrame doNew() {
+                            return null;
+                        }
+                    };
+                    jam.mac.Utils.macOSXRegistration(application);
+                } catch (Exception e) {
+                    // ignore
+                }
+                try {
+                    Class<?> class_ = Class.forName("jam.maconly.OSXAdapter");
+                    Method method = class_.getMethod("enablePrefs", boolean.class);
+                    method.invoke(null, false);
+                } catch (java.lang.NoSuchMethodException e) {
+                    // ignore
+                }
+            }
+            beauti.setUpPanels();
+
+            beauti.currentTab = beauti.panels[0];
+            beauti.hidePanels();
+
+            beauti.addChangeListener(new ChangeListener() {
+                @Override
+                public void stateChanged(ChangeEvent e) {
+                    if (beauti.currentTab == null) {
+                        beauti.currentTab = beauti.panels[0];
+                    }
+                    if (beauti.currentTab != null) {
+                        if (!beauti.isInitialising) {
+                            beauti.currentTab.config
+                                    .sync(beauti.currentTab.iPartition);
+                        }
+                        BeautiPanel panel = (BeautiPanel) beauti
+                                .getSelectedComponent();
+                        beauti.currentTab = panel;
+                        beauti.refreshPanel();
+                    }
+                }
+            });
+
+            beauti.setVisible(true);
+            beauti.refreshPanel();
+            JFrame frame = new JFrame("BEAUti 2: " + doc.getTemplateName()
+                    + " " + doc.getFileName());
+            beauti.frame = frame;
+            ImageIcon icon = Utils.getIcon(BEAUTI_ICON);
+            if (icon != null) {
+                frame.setIconImage(icon.getImage());
+            }
+
+            JMenuBar menuBar = beauti.makeMenuBar();
+            frame.setJMenuBar(menuBar);
+
+            if (doc.getFileName() != null || doc.alignments.size() > 0) {
+                beauti.a_save.setEnabled(true);
+                beauti.a_saveas.setEnabled(true);
+            }
+
+            frame.add(beauti);
+            frame.setSize(1024, 768);
+            frame.setLocation(BEAUtiIntances * 10, BEAUtiIntances * 10);
+            frame.setVisible(true);
+
+            // check file needs to be save on closing main frame
+            frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
+            BEAUtiIntances++;
+            frame.addWindowListener(new WindowAdapter() {
+                public void windowClosing(WindowEvent e) {
+                    if (!beauti.quit()) {
+                        return;
+                    }
+                    JFrame frame = (JFrame) e.getSource();
+                    frame.dispose();
+                    BEAUtiIntances--;
+                    if (BEAUtiIntances == 0) {
+                        System.exit(0);
+                    }
+                }
+            });
+
+            // Toolkit toolkit = Toolkit.getDefaultToolkit();
+            // // PropertyChangeListener plistener = new
+            // PropertyChangeListener() {
+            // // @Override
+            // // public void propertyChange(PropertyChangeEvent event) {
+            // // Object o = event.getSource();
+            // // Object o2 = event.getNewValue();
+            // // event.getPropertyName();
+            // // System.err.println(">>> " + event.getPropertyName() + " " +
+            // o.getClass().getName() + "\n" + o2.getClass().getName());
+            // // }
+            // // };
+            // AWTEventListener listener = new AWTEventListener() {
+            // @Override
+            // public void eventDispatched(AWTEvent event) {
+            // Object o = event.getSource();
+            // String label = "";
+            // try {
+            // Method method = o.getClass().getMethod("getText", Object.class);
+            // label = (String) method.invoke(o);
+            // } catch (Exception e) {
+            // // TODO: handle exception
+            // }
+            // if (event.paramString().matches(".*\\([0-9]*,[0-9]*\\).*")) {
+            // String s = event.paramString();
+            // String sx = s.substring(s.indexOf('(') + 1);
+            // String sy = sx;
+            // sx = sx.substring(0, sx.indexOf(','));
+            // sy = sy.substring(sy.indexOf(',') + 1, sy.indexOf(')'));
+            // int x = Integer.parseInt(sx);
+            // int y = Integer.parseInt(sy);
+            // Component c = beauti.findComponentAt(x, y);
+            // if (c != null) {
+            // System.err.println(c.getClass().getName());
+            // }
+            // }
+            //
+            // System.err.println(label + " " + event.paramString() + " " +
+            // o.getClass().getName());
+            //
+            // }
+            // };
+            // toolkit.addAWTEventListener(listener,
+            // AWTEvent.ACTION_EVENT_MASK|AWTEvent.ITEM_EVENT_MASK|AWTEvent.MOUSE_EVENT_MASK);
+            // // beauti.addPropertyChangeListener(plistener);
+
+            return beauti;
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    } // main2
+
+    public static void main(String[] args) {
+        main2(args);
+    }
+
+} // class Beauti
+
diff --git a/src/beast/app/beauti/BeautiAlignmentProvider.java b/src/beast/app/beauti/BeautiAlignmentProvider.java
new file mode 100644
index 0000000..c346df3
--- /dev/null
+++ b/src/beast/app/beauti/BeautiAlignmentProvider.java
@@ -0,0 +1,376 @@
+package beast.app.beauti;
+
+
+
+
+
+import java.io.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.swing.JOptionPane;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.BEASTObject;
+import beast.core.BEASTInterface;
+import beast.core.Input.Validate;
+import beast.evolution.alignment.Alignment;
+import beast.evolution.alignment.FilteredAlignment;
+import beast.evolution.alignment.Sequence;
+import beast.evolution.datatype.DataType;
+import beast.util.NexusParser;
+import beast.util.XMLParser;
+
+
+
+ at Description("Class for creating new alignments to be edited by AlignmentListInputEditor")
+public class BeautiAlignmentProvider extends BEASTObject {
+	
+	public Input<BeautiSubTemplate> template = new Input<BeautiSubTemplate>("template", "template to be used after creating a new alignment. ", Validate.REQUIRED);
+
+	
+	@Override
+	public void initAndValidate() throws Exception {
+	}
+	
+	/** 
+	 * return amount to which the provided matches an alignment 
+	 * The provider with the highest match will be used to edit the alignment 
+	 * */
+	int matches(Alignment alignment) {
+		return 1;
+	}
+	
+	/** 
+	 * return new alignment, return null if not successful 
+	 * **/
+	List<BEASTInterface> getAlignments(BeautiDoc doc) {
+        File [] files = beast.app.util.Utils.getLoadFiles("Load Alignment File",
+                new File(Beauti.g_sDir), "Alignment files", "xml", 
+                "fas","fst","fasta","fna","ffn","faa","frn",
+                "nex","nxs","nexus");
+        if (files != null && files.length > 0) {
+            return getAlignments(doc, files);
+        }
+		return null;
+	}
+
+    /**
+     * return new alignment given files
+     * @param doc
+     * @param files
+     * @return
+     */
+    public List<BEASTInterface> getAlignments(BeautiDoc doc, File[] files) {
+        List<BEASTInterface> selectedPlugins = new ArrayList<BEASTInterface>();
+        for (File file : files) {
+            String fileName = file.getName();
+			String fileExtension = fileName.substring(fileName.lastIndexOf(".")).toLowerCase();
+			Alignment alignment;
+
+			switch (fileExtension) {
+				case ".nex":
+				case ".nxs":
+				case ".nexus":
+					NexusParser parser = new NexusParser();
+					try {
+						parser.parseFile(file);
+						if (parser.filteredAlignments.size() > 0) {
+							/**
+							 * sanity check: make sure the filters do not
+							 * overlap
+							 **/
+							int[] used = new int[parser.m_alignment.getSiteCount()];
+							Set<Integer> overlap = new HashSet<Integer>();
+							int partitionNr = 1;
+							for (Alignment data : parser.filteredAlignments) {
+								int[] indices = ((FilteredAlignment) data).indices();
+								for (int i : indices) {
+									if (used[i] > 0) {
+										overlap.add(used[i] * 10000 + partitionNr);
+									} else {
+										used[i] = partitionNr;
+									}
+								}
+								partitionNr++;
+							}
+							if (overlap.size() > 0) {
+								String overlaps = "<html>Warning: The following partitions overlap:<br/>";
+								for (int i : overlap) {
+									overlaps += parser.filteredAlignments.get(i / 10000 - 1).getID()
+											+ " overlaps with "
+											+ parser.filteredAlignments.get(i % 10000 - 1).getID() + "<br/>";
+								}
+								overlaps += "The first thing you might want to do is delete some of these partitions.</html>";
+								JOptionPane.showMessageDialog(null, overlaps);
+							}
+							/** add alignments **/
+							for (Alignment data : parser.filteredAlignments) {
+								Alignment.sortByTaxonName(data.sequenceInput.get());
+								selectedPlugins.add(data);
+							}
+						} else {
+							selectedPlugins.add(parser.m_alignment);
+						}
+					} catch (Exception ex) {
+						ex.printStackTrace();
+						JOptionPane.showMessageDialog(null, "Loading of " + fileName + " failed: " + ex.getMessage());
+						return null;
+					}
+					break;
+
+				case ".xml":
+					alignment = (Alignment)getXMLData(file);
+					selectedPlugins.add(alignment);
+					break;
+
+				case ".fas":
+				case ".fasta":
+				case ".fst":
+				case ".fna":
+				case ".ffn":
+				case ".faa":
+				case ".frn":
+					alignment = getFASTAData(file);
+					Alignment.sortByTaxonName(alignment.sequenceInput.get());
+					selectedPlugins.add(alignment);
+					break;
+			}
+        }
+        for (BEASTInterface plugin : selectedPlugins) {
+        	// ensure ID of alignment is unique
+        	int k = 0;
+        	String id = plugin.getID();
+        	while (doc.pluginmap.containsKey(id)) {
+        		k++;
+        		id = plugin.getID() + k;
+        	}
+        	plugin.setID(id);
+        	Alignment.sortByTaxonName(((Alignment) plugin).sequenceInput.get());
+            doc.addAlignmentWithSubnet((Alignment) plugin, getStartTemplate());
+        }
+        return selectedPlugins;
+    }
+
+	/** provide GUI for manipulating the alignment **/
+	void editAlignment(Alignment alignment, BeautiDoc doc) {
+		try {
+			AlignmentViewer viewer = new AlignmentViewer(alignment);
+			viewer.showInDialog();
+		} catch (Exception e) {
+			JOptionPane.showMessageDialog(null, "Something went wrong viewing the alignment: " + e.getMessage());
+			e.printStackTrace();
+		}
+	}
+	
+	/** check validity of the alignment, 
+	 * return null if there are no problens, 
+	 * return message string if something is fishy **/
+	String validateAlignment() {
+		return null;
+	}
+	
+	/** return template to apply to this new alignment.
+	 * By default, the partition template of the current beauti template is returned **/
+	BeautiSubTemplate getStartTemplate() {
+		return template.get();
+	}
+
+	static public BEASTInterface getXMLData(File file) {
+		String sXML = "";
+		try {
+			// parse as BEAST 2 xml fragment
+			XMLParser parser = new XMLParser();
+			BufferedReader fin = new BufferedReader(new FileReader(file));
+			while (fin.ready()) {
+				sXML += fin.readLine() + "\n";
+			}
+			fin.close();
+			BEASTInterface runnable = parser.parseBareFragment(sXML, false);
+			BEASTInterface alignment = getAlignment(runnable);
+            alignment.initAndValidate();
+            return alignment;
+		} catch (Exception ex) {
+			// attempt to parse as BEAST 1 xml
+			try {
+				String ID = file.getName();
+				ID = ID.substring(0, ID.lastIndexOf('.')).replaceAll("\\..*", "");
+				BEASTInterface alignment = parseBeast1XML(ID, sXML);
+				if (alignment != null) {
+					alignment.setID(file.getName().substring(0, file.getName().length() - 4).replaceAll("\\..*", ""));
+				}
+				return alignment;
+			} catch (Exception ex2) {
+				ex.printStackTrace();
+				JOptionPane.showMessageDialog(null, "Loading of " + file.getName() + " failed: " + ex.getMessage()
+						+ "\n" + ex2.getMessage());
+			}
+			return null;
+		}
+	}
+	
+    private Alignment getFASTAData(File file) {
+    	try {
+    		// grab alignment data
+        	Map<String, StringBuilder> seqMap = new HashMap<String, StringBuilder>();
+        	List<String> sTaxa = new ArrayList<String>();
+        	String currentTaxon = null;
+			BufferedReader fin = new BufferedReader(new FileReader(file));
+	        String sMissing = "?";
+	        String sGap = "-";
+	        int nTotalCount = 4;
+	        String datatype = "nucleotide";
+	        // According to http://en.wikipedia.org/wiki/FASTA_format lists file formats and their data content
+			// .fna = nucleic acid
+			// .ffn = nucleotide coding regions
+			// .frn = non-coding RNA
+			// .ffa = amino acid
+    		boolean mayBeAminoacid = !(file.getName().toLowerCase().endsWith(".fna") || file.getName().toLowerCase().endsWith(".ffn") || file.getName().toLowerCase().endsWith(".frn"));
+    		
+			while (fin.ready()) {
+				String line = fin.readLine();
+				if (line.startsWith(";")) {
+					// it is a comment, ignore
+				} else 	if (line.startsWith(">")) {
+					// it is a taxon
+					currentTaxon = line.substring(1).trim();
+					// only up to first space
+					currentTaxon = currentTaxon.replaceAll("\\s.*$", "");
+				} else {
+					// it is a data line
+					if (currentTaxon == null) {
+						throw new RuntimeException("Expected taxon defined on first line");
+					}
+					if (seqMap.containsKey(currentTaxon)) {
+						StringBuilder sb = seqMap.get(currentTaxon);
+						sb.append(line);
+					} else {
+						StringBuilder sb = new StringBuilder();
+						seqMap.put(currentTaxon, sb);
+						sb.append(line);
+						sTaxa.add(currentTaxon);
+					}
+				}
+			}
+			fin.close();
+			
+			int nChar = -1;
+			Alignment alignment = new Alignment();
+	        for (final String sTaxon : sTaxa) {
+	            final StringBuilder bsData = seqMap.get(sTaxon);
+	            String sData = bsData.toString();
+	            sData = sData.replaceAll("\\s", "");
+	            seqMap.put(sTaxon, new StringBuilder(sData));
+
+	            if (nChar < 0) {nChar = sData.length();}
+	            if (sData.length() != nChar) {
+	                throw new Exception("Expected sequence of length " + nChar + " instead of " + sData.length() + " for taxon " + sTaxon);
+	            }
+	            // map to standard missing and gap chars
+	            sData = sData.replace(sMissing.charAt(0), DataType.MISSING_CHAR);
+	            sData = sData.replace(sGap.charAt(0), DataType.GAP_CHAR);
+
+	            if (mayBeAminoacid && datatype.equals("nucleotide") && !sData.matches("[ACGTUXNacgtuxn?_-]+")) {
+	            	datatype = "aminoacid";
+	            	nTotalCount = 20;
+	            	for (Sequence seq : alignment.sequenceInput.get()) {
+	            		seq.totalCountInput.setValue(nTotalCount, seq);
+	            	}
+	            }
+	            
+	            final Sequence sequence = new Sequence();
+	            sData = sData.replaceAll("[Xx]", "?");
+	            sequence.init(nTotalCount, sTaxon, sData);
+	            sequence.setID(NexusParser.generateSequenceID(sTaxon));
+	            alignment.sequenceInput.setValue(sequence, alignment);
+	        }
+	        String ID = file.getName();
+	        ID = ID.substring(0, ID.lastIndexOf('.')).replaceAll("\\..*", "");
+	        alignment.setID(ID);
+			alignment.dataTypeInput.setValue(datatype, alignment);
+	        alignment.initAndValidate();
+	        return alignment;
+    	} catch (Exception e) {
+			e.printStackTrace();
+			JOptionPane.showMessageDialog(null, "Loading of " + file.getName() + " failed: " + e.getMessage());
+    	}
+		return null;
+	}
+
+	private static BEASTInterface parseBeast1XML(String ID, String sXML) throws Exception {
+		DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+		Document doc = factory.newDocumentBuilder().parse(new InputSource(new StringReader(sXML)));
+		doc.normalize();
+
+		NodeList alignments = doc.getElementsByTagName("alignment");
+		Alignment alignment = new Alignment();
+		alignment.dataTypeInput.setValue("nucleotide", alignment);
+
+		// parse first alignment
+		org.w3c.dom.Node node = alignments.item(0);
+
+		String sDataType = node.getAttributes().getNamedItem("dataType").getNodeValue();
+		int nTotalCount = 4;
+		if (sDataType == null) {
+			alignment.dataTypeInput.setValue("integer", alignment);
+		} else if (sDataType.toLowerCase().equals("dna") || sDataType.toLowerCase().equals("nucleotide")) {
+			alignment.dataTypeInput.setValue("nucleotide", alignment);
+			nTotalCount = 4;
+		} else if (sDataType.toLowerCase().equals("aminoacid") || sDataType.toLowerCase().equals("protein")) {
+			alignment.dataTypeInput.setValue("aminoacid", alignment);
+			nTotalCount = 20;
+		} else {
+			alignment.dataTypeInput.setValue("integer", alignment);
+		}
+
+		NodeList children = node.getChildNodes();
+		for (int i = 0; i < children.getLength(); i++) {
+			org.w3c.dom.Node child = children.item(i);
+			if (child.getNodeName().equals("sequence")) {
+				Sequence sequence = new Sequence();
+				// find the taxon
+				String taxon = "";
+				NodeList sequenceChildren = child.getChildNodes();
+				for (int j = 0; j < sequenceChildren.getLength(); j++) {
+					org.w3c.dom.Node child2 = sequenceChildren.item(j);
+					if (child2.getNodeName().equals("taxon")) {
+						taxon = child2.getAttributes().getNamedItem("idref").getNodeValue();
+					}
+				}
+				String data = child.getTextContent();
+				sequence.initByName("totalcount", nTotalCount, "taxon", taxon, "value", data);
+				sequence.setID("seq_" + taxon);
+				alignment.sequenceInput.setValue(sequence, alignment);
+
+			}
+		}
+		alignment.setID(ID);
+		alignment.initAndValidate();
+		return alignment;
+	} // parseBeast1XML
+
+
+	static BEASTInterface getAlignment(BEASTInterface plugin) throws IllegalArgumentException, IllegalAccessException {
+		if (plugin instanceof Alignment) {
+			return plugin;
+		}
+		for (BEASTInterface plugin2 : plugin.listActivePlugins()) {
+			plugin2 = getAlignment(plugin2);
+			if (plugin2 != null) {
+				return plugin2;
+			}
+		}
+		return null;
+	}
+
+}
diff --git a/src/beast/app/beauti/BeautiConfig.java b/src/beast/app/beauti/BeautiConfig.java
new file mode 100644
index 0000000..dc51d4d
--- /dev/null
+++ b/src/beast/app/beauti/BeautiConfig.java
@@ -0,0 +1,303 @@
+package beast.app.beauti;
+
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.BEASTObject;
+import beast.core.BEASTInterface;
+import beast.core.Input.Validate;
+import beast.evolution.alignment.Alignment;
+import beast.util.XMLParser;
+
+import javax.swing.*;
+
+ at Description("Beauti configuration object, used to find Beauti configuration " +
+        "information from Beauti template files.")
+public class BeautiConfig extends BEASTObject {
+    public Input<String> inlineInput = new Input<String>("inlinePlugins", "comma separated list of inputs that should " +
+            "go inline, e.g. beast.evolution.sitemodel.SiteModel.substModel");
+    public Input<String> collapsedInput = new Input<String>("collapsedPlugins", "comma separated list of inputs that should " +
+            "go inline, but are initially collapsed, e.g. beast.core.MCMC.logger");
+    public Input<String> suppressInputs = new Input<String>("suppressPlugins", "comma separated list of inputs that should " +
+            "be suppressed. e.g. beast.core.MCMC.operator");
+    public Input<String> inputLabelMapInput = new Input<String>("inputLabelMap", "comma separated list of inputs and their " +
+            "display labels separated by a '=', e.g. beast.core.MCMC.logger=Loggers ");
+    //	public Input<String> m_hidePanels = new Input<String>("hidePanels","comma separated list of panes that should not" +
+//			"be displayed when starting beauti, e.g. TAXON_SETS_PANEL,TIP_DATES_PANEL");
+    public Input<String> buttonLabelMapInput = new Input<String>("buttonLabelMap", "comma separated list of buttons in dialogs and their " +
+            "display labels separated by a '=', e.g. beast.app.beauti.BeautiInitDlg.>> details=Edit parameters");
+    public Input<String> disableMenus = new Input<String>("disableMenus", "comma separated list of menus that should " +
+            "not be visible, e.g., View.Show Data Panel,Mode");
+    public Input<String> disableButtons = new Input<String>("disableButtons", "comma separated list of buttons that should " +
+            "not be visible, e.g., beast.app.beauti.BeautiInitDlg.Analysis template:");
+//	public Input<String> m_editButtonStatus = new Input<String>("editButtonStatus","comma separated list of list-inputs with custom " +
+//	"button status. One of 'none', 'addonly' 'delonly' +, e.g., beast.core.MCMC.operator=addonly");
+
+    public Input<List<BeautiPanelConfig>> panelsInput = new Input<List<BeautiPanelConfig>>("panel", "define custom panels and their properties",
+            new ArrayList<BeautiPanelConfig>());
+    public Input<Boolean> bIsExpertInput = new Input<Boolean>("isExpert", "flag to indicate Beauti should start in expert mode", false);
+
+
+    public Input<BeautiSubTemplate> partitionTemplate = new Input<BeautiSubTemplate>("partitiontemplate", "defines template used when creating a partition", Validate.REQUIRED);
+    public Input<List<BeautiSubTemplate>> subTemplatesInput = new Input<List<BeautiSubTemplate>>("subtemplate", "defines subtemplates for creating selected classes",
+            new ArrayList<BeautiSubTemplate>());
+
+    public Input<List<BeautiAlignmentProvider>> alignmentProviderInput = new Input<List<BeautiAlignmentProvider>>("alignmentProvider", "defines providers for adding new alignments",
+            new ArrayList<BeautiAlignmentProvider>());
+
+    /**
+     * list of inputs for which the input editor should be expanded inline in a dialog
+     * in the format <className>.<inputName>, e.g. beast.evolution.sitemodel.SiteModel.substModel
+     */
+    public Set<String> inlinePlugins = new HashSet<String>();
+    /**
+     * list of inputs for which the input editor should be expanded inline in a dialog but initially collapsed.
+     * e.g. beast.evolution.sitemodel.SiteModel.substModel
+     */
+    public Set<String> collapsedPlugins = new HashSet<String>();
+    /**
+     * list of inputs that should not be shown in a dialog. Same format as for m_inlinePlugins*
+     */
+    public Set<String> suppressPlugins = new HashSet<String>();
+    /**
+     * map that identifies the label to be used for a particular input *
+     */
+    public HashMap<String, String> inputLabelMap = new HashMap<String, String>();
+    public HashMap<String, String> buttonLabelMap = new HashMap<String, String>();
+//	public static HashMap<String, String> g_sEditButtonStatus = new HashMap<String, String>();
+
+    //	public static Set<String> g_sHidePanels = new HashSet<String>();
+    public Set<String> sDisabledMenus = new HashSet<String>();
+    public Set<String> sDisabledButtons = new HashSet<String>();
+
+    public List<BeautiPanelConfig> panels = new ArrayList<BeautiPanelConfig>();
+
+    public List<BeautiSubTemplate> subTemplates;
+    public List<BeautiAlignmentProvider> alignmentProvider;
+
+    public BeautiSubTemplate hyperPriorTemplate = null;
+    
+    @Override
+    public void initAndValidate() {
+        parseSet(inlineInput.get(), null, inlinePlugins);
+        parseSet(collapsedInput.get(), null, collapsedPlugins);
+        inlinePlugins.addAll(collapsedPlugins);
+//		parseSet(m_hidePanels.get(), "TAXON_SETS_PANEL,TIP_DATES_PANEL,PRIORS_PANEL,OPERATORS_PANEL", g_sHidePanels);
+        parseSet(suppressInputs.get(), null, suppressPlugins);
+        parseSet(disableMenus.get(), null, sDisabledMenus);
+        parseSet(disableButtons.get(), null, sDisabledButtons);
+
+        parseMap(inputLabelMapInput.get(), inputLabelMap);
+        parseMap(buttonLabelMapInput.get(), buttonLabelMap);
+//		parseMap(m_editButtonStatus.get(), g_sEditButtonStatus);
+        for (BeautiPanelConfig panel : panelsInput.get()) {
+            panels.add(panel);
+            // check for duplicates
+            for (BeautiPanelConfig panel2 : panels) {
+                if (panel2.sNameInput.get().equals(panel.sNameInput.get()) && panel2 != panel) {
+                    panels.remove(panels.size() - 1);
+                    break;
+                }
+            }
+        }
+        //InputEditor.setExpertMode(bIsExpertInput.get());
+        subTemplates = subTemplatesInput.get();
+        alignmentProvider = alignmentProviderInput.get();
+
+        try {
+            XMLParser parser = new XMLParser();
+        	hyperPriorTemplate = (BeautiSubTemplate) parser.parseBareFragment(HYPER_PRIOR_XML, true);
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+    }
+
+    final static String HYPER_PRIOR_XML = 
+    		"    <beast version='2.0'\n" +
+    		"    	       namespace='beast.app.beauti:beast.core:beast.evolution.branchratemodel:beast.evolution.speciation:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood:beast.evolution:beast.math.distributions'>\n" +
+    		"    	<!-- Parameter Hyper Prior -->\n" +
+    		"    	        <subtemplate id='HyperPrior' class='beast.math.distributions.Prior' mainid='HyperPrior.$(n)'>\n" +
+    		"    	<![CDATA[\n" +
+    		"    	        <plugin id='HyperPrior.$(n)' spec='Prior' x='@parameter.$(n)'>\n" +
+    		"    	            <distr spec='OneOnX'/>\n" +
+    		"    			</plugin>\n" +
+    		"\n" +
+    		"    	        <plugin id='hyperScaler.$(n)' spec='ScaleOperator' scaleFactor='0.5' weight='0.1' parameter='@parameter.$(n)'/>\n" +
+    		"    	]]>\n" +
+    		"    	            <connect srcID='parameter.$(n)'            targetID='state' inputName='stateNode' if='inposterior(parameter.$(n)) and parameter.$(n)/estimate=true'/>\n" +
+    		"\n" +
+    		"    	            <connect srcID='hyperScaler.$(n)'          targetID='mcmc' inputName='operator' if='inposterior(parameter.$(n)) and parameter.$(n)/estimate=true'>Scale hyper parameter $(n)</connect>\n" +
+    		"\n" +
+    		"    	            <connect srcID='parameter.$(n)'            targetID='tracelog' inputName='log'  if='inposterior(parameter.$(n)) and parameter.$(n)/estimate=true'/>\n" +
+    		"    	            <connect srcID='HyperPrior.$(n)'           targetID='tracelog' inputName='log'  if='inposterior(parameter.$(n)) and parameter.$(n)/estimate=true'/>\n" +
+    		"\n" +
+    		"    	            <connect srcID='HyperPrior.$(n)'           targetID='prior' inputName='distribution' if='inposterior(parameter.$(n)) and parameter.$(n)/estimate=true'>Hyper prior for parameter $(n)</connect>\n" +
+    		"    	        </subtemplate>\n" +
+    		"    	</beast>\n";
+    
+    public void setDoc(BeautiDoc doc) {
+        partitionTemplate.get().setDoc(doc);
+        for (BeautiSubTemplate sub : subTemplates) {
+            sub.setDoc(doc);
+        }
+        doc.setExpertMode(bIsExpertInput.get());
+        hyperPriorTemplate.doc = doc;
+    }
+
+    public void clear() {
+        inlinePlugins = new HashSet<String>();
+        collapsedPlugins = new HashSet<String>();
+        suppressPlugins = new HashSet<String>();
+        inputLabelMap = new HashMap<String, String>();
+        buttonLabelMap = new HashMap<String, String>();
+        sDisabledMenus = new HashSet<String>();
+        sDisabledButtons = new HashSet<String>();
+        panels = new ArrayList<BeautiPanelConfig>();
+    }
+
+    /**
+     * @param doc
+     * @param parent
+     * @return a list of alignments based on the user selected alignment provider
+     */
+    public List<BEASTInterface> selectAlignments(BeautiDoc doc, JComponent parent) {
+        List<BeautiAlignmentProvider> providers = alignmentProvider;
+        BeautiAlignmentProvider selectedProvider = null;
+        if (providers.size() == 1) {
+            selectedProvider = providers.get(0);
+        } else {
+            selectedProvider = (BeautiAlignmentProvider) JOptionPane.showInputDialog(parent, "Select what to add",
+                    "Add partition",
+                    JOptionPane.QUESTION_MESSAGE, null, providers.toArray(),
+                    providers.get(0));
+            if (selectedProvider == null) {
+                return null;
+            }
+        }
+        List<BEASTInterface> plugins = selectedProvider.getAlignments(doc);
+        // create taxon sets, if any
+        if (plugins != null) {
+	        for (BEASTInterface o : plugins) {
+	        	if (o instanceof Alignment) {
+	        		try {
+	        			BeautiDoc.createTaxonSet((Alignment) o, doc);
+	        		} catch(Exception e) {
+	        			e.printStackTrace();
+	        		}
+	        	}
+	        }
+        }
+        return plugins;
+    } // selectAlignments
+    
+    public List<BeautiSubTemplate> getInputCandidates(BEASTInterface plugin, Input<?> input, Class<?> type) {
+        List<BeautiSubTemplate> candidates = new ArrayList<BeautiSubTemplate>();
+        for (BeautiSubTemplate template : subTemplates) {
+            if (type.isAssignableFrom(template._class)) {
+                try {
+                    if (input.canSetValue(template.instance, plugin)) {
+                        candidates.add(template);
+                    }
+                } catch (Exception e) {
+                    // ignore: cannot set value
+                }
+            }
+        }
+        return candidates;
+    }
+
+    private void parseMap(String sStr, HashMap<String, String> stringMap) {
+        if (sStr != null) {
+            for (String sStr2 : sStr.split(",")) {
+                String[] sStrs = sStr2.split("=");
+                stringMap.put(normalize(sStrs[0]), normalize(sStrs.length == 1 ? "" : sStrs[1]));
+            }
+        }
+    }
+
+    private void parseSet(String sStr, String sDefault, Set<String> stringSet) {
+        if (sStr == null) {
+            sStr = sDefault;
+        }
+        if (sStr != null) {
+            for (String sStr2 : sStr.split(",")) {
+                stringSet.add(normalize(sStr2));
+            }
+        }
+    }
+
+    // remove leading and tailing spaces
+    String normalize(String sStr) {
+        int i = 0;
+        int n = sStr.length();
+        while (i < n && Character.isWhitespace(sStr.charAt(i))) {
+            i++;
+        }
+        while (n > 0 && Character.isWhitespace(sStr.charAt(n - 1))) {
+            n--;
+        }
+        return sStr.substring(i, n);
+    }
+
+    public String getButtonLabel(String sClass, String sStr) {
+        if (buttonLabelMap.containsKey(sClass + "." + sStr)) {
+            return buttonLabelMap.get(sClass + "." + sStr);
+        }
+        return sStr;
+    }
+
+    public String getButtonLabel(Object o, String sStr) {
+        if (buttonLabelMap.containsKey(o.getClass().getName() + "." + sStr)) {
+            return buttonLabelMap.get(o.getClass().getName() + "." + sStr);
+        }
+        return sStr;
+    }
+
+    public String getInputLabel(BEASTInterface plugin, String sName) {
+        if (inputLabelMap.containsKey(plugin.getClass().getName() + "." + sName)) {
+            sName = inputLabelMap.get(plugin.getClass().getName() + "." + sName);
+        }
+        return sName;
+    }
+
+    public boolean menuIsInvisible(String sMenuName) {
+        return sDisabledMenus.contains(sMenuName);
+    }
+
+    static BeautiSubTemplate NULL_TEMPLATE = new BeautiSubTemplate();
+
+    public static BeautiSubTemplate getNullTemplate(BeautiDoc doc) {
+        NULL_TEMPLATE.setID("[none]");
+        NULL_TEMPLATE._class = Object.class;
+        NULL_TEMPLATE.doc = doc;
+        return NULL_TEMPLATE;
+    }
+
+//	public static boolean hasDeleteButton(String sFullInputName) {
+//		if (!g_sEditButtonStatus.containsKey(sFullInputName)) {
+//			return true;
+//		}
+//		String sStatus = g_sEditButtonStatus.get(sFullInputName);
+//		if (sStatus.equals("none") || sStatus.equals("onlyadd")) {
+//			return false;
+//		}
+//		return true;
+//	}
+//	public static boolean hasAddButton(String sFullInputName) {
+//		if (!g_sEditButtonStatus.containsKey(sFullInputName)) {
+//			return true;
+//		}
+//		String sStatus = g_sEditButtonStatus.get(sFullInputName);
+//		if (sStatus.equals("none") || sStatus.equals("onlydel")) {
+//			return false;
+//		}
+//		return true;
+//	}
+} // class BeautiConfig
diff --git a/src/beast/app/beauti/BeautiConnector.java b/src/beast/app/beauti/BeautiConnector.java
new file mode 100644
index 0000000..05b73de
--- /dev/null
+++ b/src/beast/app/beauti/BeautiConnector.java
@@ -0,0 +1,252 @@
+package beast.app.beauti;
+
+
+import java.lang.reflect.Method;
+import java.util.List;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.MCMC;
+import beast.core.Operator;
+import beast.core.BEASTObject;
+import beast.core.BEASTInterface;
+import beast.core.Input.Validate;
+
+
+
+ at Description("Specifies which part of the template get connected to the main network")
+public class BeautiConnector extends BEASTObject {
+    public Input<String> sMethodnput = new Input<String>("method", "name of static method that should be called with BeautiDoc as " +
+    		"argument. For example beast.app.beauti.SiteModelInputEditor.custmoConnector");
+
+    public Input<String> sSourceIDInput = new Input<String>("srcID", "ID of the plugin to be connected", Validate.XOR, sMethodnput);
+    public Input<String> sTargetIDInput = new Input<String>("targetID", "ID of plugin to connect to", Validate.XOR, sMethodnput);
+    public Input<String> sInputNameInput = new Input<String>("inputName", "name of the input of the plugin to connect to", Validate.XOR, sMethodnput);
+    public Input<String> sTipText = new Input<String>("value", "associate some tip text with the srcID plugin, useful for displaying prior and operator specific information");
+
+    public Input<String> sConditionInput = new Input<String>("if", "condition under which this connector should be executed." +
+            "These should be of the form " +
+            "inposterior(id) or id/input=value, e.g. inposterior(kappa), kappa/estimate=true. " +
+            "inlikelihood(id) to check there is a plugin with suplied id that is predecessor of likelihood. " +
+            "nooperator(id) to check there is no operator with suplied id. " +
+            "isInitialising to execute only when subtemplate is first instantiated. " +
+            "For partition specific ids, use $(n), e.g. e.g. kappa.$(n)/estimate=true. " +
+            "For multiple conditions, separate by 'and', e.g. inposterior(kappa.$(n)) and kappa.$(n)/estimate=true");
+//	public enum ConnectCondition {always, ifunlinked};
+//	public Input<ConnectCondition> connectCondition = new Input<ConnectCondition>("connect","condition when to connect. Default is 'always'. " +
+//			"With ifunlinked, the connector is only activated if the link does not already exists. " +
+//			"Possible values: " + ConnectCondition.values(),
+//			ConnectCondition.always, ConnectCondition.values());
+
+
+    enum Operation {EQUALS, NOT_EQUALS, IS_IN_POSTERIOR, IS_IN_LIKELIHOOD, IS_NOT_AN_OPERTOR, AT_INITIALISATION_ONLY}
+//	final static String IS_IN_POSTERIOR = "x";
+//	final static String AT_INITIALISATION_ONLY = "y";
+
+    String sSourceID;
+    String sTargetID;
+    String sTargetInput;
+
+    String[] sConditionIDs;
+    String[] sConditionInputs;
+    Operation[] conditionOperations;
+    String[] sConditionValues;
+    
+    boolean isRegularConnector = true;
+    
+    Method method = null;
+
+    public BeautiConnector() {}
+
+    public BeautiConnector(String sourceID, String targetID, String inputName, String condition) throws Exception {
+		initByName("srcID", sourceID, "targetID", targetID, "inputName", inputName, 
+				"if", condition);
+    }
+
+
+	@Override
+    public void initAndValidate() throws Exception {
+        sSourceID = sSourceIDInput.get();
+        sTargetID = sTargetIDInput.get();
+        sTargetInput = sInputNameInput.get();
+
+        if (sConditionInput.get() != null) {
+            String[] sConditions = sConditionInput.get().split("\\s+and\\s+");
+            sConditionIDs = new String[sConditions.length];
+            sConditionInputs = new String[sConditions.length];
+            sConditionValues = new String[sConditions.length];
+            conditionOperations = new Operation[sConditions.length];
+            for (int i = 0; i < sConditions.length; i++) {
+                String s = sConditions[i];
+                if (s.startsWith("inposterior(")) {
+                    sConditionIDs[i] = s.substring(s.indexOf("(") + 1, s.lastIndexOf(")"));
+                    sConditionInputs[i] = null;
+                    conditionOperations[i] = Operation.IS_IN_POSTERIOR;
+                    sConditionValues[i] = null;
+                } else if (s.startsWith("inlikelihood(")) {
+                    sConditionIDs[i] = s.substring(s.indexOf("(") + 1, s.lastIndexOf(")"));
+                    sConditionInputs[i] = null;
+                    conditionOperations[i] = Operation.IS_IN_LIKELIHOOD;
+                    sConditionValues[i] = null;
+                } else if (s.startsWith("nooperator")) {
+                    sConditionIDs[i] = s.substring(s.indexOf("(") + 1, s.lastIndexOf(")"));
+                    conditionOperations[i] = Operation.IS_NOT_AN_OPERTOR;
+                    sConditionInputs[i] = null;
+                    sConditionValues[i] = null;
+                } else if (s.startsWith("isInitializing")) {
+                    sConditionIDs[i] = null;
+                    conditionOperations[i] = Operation.AT_INITIALISATION_ONLY;
+                    sConditionInputs[i] = null;
+                    sConditionValues[i] = null;
+                } else {
+                    sConditionIDs[i] = s.substring(0, s.indexOf("/"));
+                    sConditionInputs[i] = s.substring(s.indexOf("/") + 1, s.indexOf("="));
+                    sConditionValues[i] = s.substring(s.indexOf("=") + 1);
+                    conditionOperations[i] = Operation.EQUALS;
+                    if (sConditionInputs[i].endsWith("!")) {
+                        sConditionInputs[i] = sConditionInputs[i].substring(0, sConditionInputs[i].length() - 1);
+                        conditionOperations[i] = Operation.NOT_EQUALS;
+                    }
+                }
+            }
+        } else {
+            sConditionIDs = new String[0];
+            sConditionInputs = new String[0];
+            conditionOperations = new Operation[0];
+            sConditionValues = new String[0];
+        }
+        if (sMethodnput.get() != null) {
+        	String fullMethod = sMethodnput.get();
+        	String className = fullMethod.substring(0, fullMethod.lastIndexOf('.'));
+        	String methodName = fullMethod.substring(fullMethod.lastIndexOf('.') + 1);
+        	Class<?> class_ = Class.forName(className);
+        	method = class_.getMethod(methodName, BeautiDoc.class);
+            isRegularConnector = false;
+        }
+
+    }
+
+
+    public boolean atInitialisationOnly() {
+        if (conditionOperations.length > 0) {
+            return conditionOperations[0].equals(Operation.AT_INITIALISATION_ONLY);
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * check that conditions in the 'if' input are met *
+     */
+    public boolean isActivated(PartitionContext partitionContext, List<BEASTInterface> posteriorPredecessors,
+    		List<BEASTInterface> likelihoodPredecessors, BeautiDoc doc) {
+        if (atInitialisationOnly()) {
+            return false;
+        }
+        if (sMethodnput.get() != null) {
+//        if (method != null) {
+	    	try {
+            	String fullMethod = sMethodnput.get();
+            	String className = fullMethod.substring(0, fullMethod.lastIndexOf('.'));
+            	String methodName = fullMethod.substring(fullMethod.lastIndexOf('.') + 1);
+            	Class<?> class_ = Class.forName(className);
+            	method = class_.getMethod(methodName, BeautiDoc.class);
+        		method.invoke(null, doc);
+        	} catch (Exception e) {
+        		// ignore
+        	}
+        }
+
+        boolean bIsActive = true;
+        for (int i = 0; i < sConditionIDs.length; i++) {
+        	//String sID = sConditionIDs[i].replaceAll("\\$\\(n\\)", sPartition);
+        	String sID = BeautiDoc.translatePartitionNames(sConditionIDs[i], partitionContext);
+            BEASTInterface plugin = doc.pluginmap.get(sID);
+            if (plugin == null) {
+            	if (conditionOperations[i] != Operation.IS_NOT_AN_OPERTOR) {
+                    return false;
+            		
+            	}
+                //System.err.println("isActivated::no plugin found");
+            }
+            //System.err.println("isActivated::found " + sID);
+            try {
+                switch (conditionOperations[i]) {
+                    case IS_IN_POSTERIOR:
+                        if (!posteriorPredecessors.contains(plugin)) {
+                            //System.err.println(posteriorPredecessors);
+                            //System.err.println("isActivated::is not in posterior, return false");
+                            return false;
+                        }
+                        break;
+                    case IS_IN_LIKELIHOOD:
+                        if (!likelihoodPredecessors.contains(plugin)) {
+                            //System.err.println(posteriorPredecessors);
+                            //System.err.println("isActivated::is not in posterior, return false");
+                            return false;
+                        }
+                        break;
+                    //System.err.println("isActivated::is in posterior");
+                    case IS_NOT_AN_OPERTOR:
+        				List<Operator> operators = ((MCMC) doc.mcmc.get()).operatorsInput.get();
+        				if (operators.contains(plugin)) {
+        					return false;
+        				}
+                    	break;
+                    case EQUALS:
+                        Input<?> input = plugin.getInput(sConditionInputs[i]);
+                        //System.err.println("isActivated::input " + input.get().toString() + " expected " + sConditionValues[i]);
+                        if (input.get() == null) {
+                        	if (!sConditionValues[i].equals("null")) {
+                        		return false;
+                        	}
+                        } else if (!input.get().toString().equals(sConditionValues[i])) {
+                            //System.err.println("isActivated::return false");
+                            return false;
+                        }
+                        break;
+                    case NOT_EQUALS:
+                        Input<?> input2 = plugin.getInput(sConditionInputs[i]);
+                        //System.err.println("isActivated::input " + input.get().toString() + " expected " + sConditionValues[i]);
+                        if (input2.get() == null) {
+                        	if (sConditionValues[i].equals("null")) {
+                        		return false;
+                        	}
+                        } else if (input2.get().toString().equals(sConditionValues[i])) {
+                            //System.err.println("isActivated::return false");
+                            return false;
+                        }
+                        break;
+                    default:
+                        throw new Exception("Unexpected operation: " + conditionOperations[i]);
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+                return false;
+            }
+        }
+        //if (sConditionIDs.length > 0) {
+        //	System.err.println("isActivated::return true");
+        //}
+        return bIsActive;
+    }
+
+    public String getTipText() {
+        return sTipText.get();
+    }
+
+    public String toString() {
+    	if (sMethodnput.get() != null) {
+    		return "call " + sMethodnput.get();
+    	}
+        return "@" + sSourceID + " -> @" + sTargetID + "/" + sTargetInput;
+    }
+
+
+    public String toString(PartitionContext context) {
+    	if (sMethodnput.get() != null) {
+    		return toString();
+    	}
+        return "@" + BeautiDoc.translatePartitionNames(sSourceID, context) + " -> @" + sTargetID + "/" + BeautiDoc.translatePartitionNames(sTargetInput, context);
+    }
+}
diff --git a/src/beast/app/beauti/BeautiDoc.java b/src/beast/app/beauti/BeautiDoc.java
new file mode 100644
index 0000000..c86e7b1
--- /dev/null
+++ b/src/beast/app/beauti/BeautiDoc.java
@@ -0,0 +1,2367 @@
+package beast.app.beauti;
+
+
+import beast.app.draw.BEASTObjectPanel;
+import beast.app.draw.InputEditor;
+import beast.app.draw.InputEditorFactory;
+import beast.core.*;
+import beast.core.Input.Validate;
+import beast.core.parameter.Parameter;
+import beast.core.parameter.RealParameter;
+import beast.core.util.CompoundDistribution;
+import beast.core.util.Log;
+import beast.evolution.alignment.Alignment;
+import beast.evolution.alignment.FilteredAlignment;
+import beast.evolution.alignment.Taxon;
+import beast.evolution.alignment.TaxonSet;
+import beast.evolution.branchratemodel.BranchRateModel;
+import beast.evolution.branchratemodel.StrictClockModel;
+import beast.evolution.likelihood.GenericTreeLikelihood;
+import beast.evolution.substitutionmodel.SubstitutionModel;
+import beast.evolution.tree.TraitSet;
+import beast.evolution.tree.Tree;
+import beast.math.distributions.MRCAPrior;
+import beast.util.JSONProducer;
+import beast.util.NexusParser;
+import beast.util.XMLParser;
+import beast.util.XMLParser.RequiredInputProvider;
+import beast.util.XMLProducer;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
+
+import javax.swing.*;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import java.io.*;
+import java.util.*;
+
+
+ at Description("Beauti document in doc-view pattern, not useful in models")
+public class BeautiDoc extends BEASTObject implements RequiredInputProvider {
+    final static String STANDARD_TEMPLATE = "templates/Standard.xml";
+
+    final static int ALIGNMENT_PARTITION = 3;
+    final static int SITEMODEL_PARTITION = 0;
+    final static int CLOCKMODEL_PARTITION = 1;
+    final static int TREEMODEL_PARTITION = 2;
+
+    public enum ActionOnExit {
+        UNKNOWN, SHOW_DETAILS_USE_TEMPLATE, SHOW_DETAILS_USE_XML_SPEC, WRITE_XML, MERGE_AND_WRITE_XML
+    }
+
+    public List<Alignment> alignments = new ArrayList<Alignment>();
+
+    public Input<beast.core.Runnable> mcmc = new Input<beast.core.Runnable>("runnable", "main entry of analysis",
+            Validate.REQUIRED);
+
+    protected List<BranchRateModel> clockModels;
+    // protected List<TreeDistribution> treePriors;
+    /**
+     * contains all loggers from the template *
+     */
+
+    public boolean bAutoSetClockRate = true;
+        
+    public boolean bAutoUpdateOperatorWeights = true;
+
+    public boolean bAutoUpdateFixMeanSubstRate = true;
+    /**
+     * flags for whether parameters can be linked.
+     * Once a parameter is linked, (un)linking in the alignment editor should be disabled
+     */
+    public boolean bAllowLinking = false;
+    public boolean bHasLinkedAtLeastOnce = false;
+
+    /**
+     * [0] = sitemodel [1] = clock model [2] = tree *
+     */
+    List<BEASTInterface>[] pPartitionByAlignments;
+    List<BEASTInterface>[] pPartition;
+    private List<Integer>[] nCurrentPartitions;
+    // partition names
+    List<PartitionContext> sPartitionNames = new ArrayList<PartitionContext>();
+    Set<PartitionContext> possibleContexts = new HashSet<PartitionContext>();
+
+    public BeautiConfig beautiConfig;
+    Beauti beauti;
+
+    private String templateName = null;
+    private String templateFileName = STANDARD_TEMPLATE;
+
+    Map<String, String> tipTextMap = new HashMap<String, String>();
+
+    /**
+     * list of all plugins in the model, mapped by its ID *
+     */
+    public HashMap<String, BEASTInterface> pluginmap = null;
+    /**
+     * list of all plugins in the model that have an impact on the posterior
+     */
+    List<BEASTInterface> posteriorPredecessors = null;
+    List<BEASTInterface> likelihoodPredecessors = null;
+
+    /**
+     * set of all taxa in the model *
+     */
+    public Map<String,Taxon> taxaset = null;
+
+    private boolean isExpertMode = false;
+
+    public Set<InputEditor> currentInputEditors = new HashSet<InputEditor>();
+
+    /**
+     * name of current file, used for saving (as opposed to saveAs) *
+     */
+    private String fileName = "";
+
+
+    public Set<Input<?>> linked;
+
+    InputEditorFactory inputEditorFactory;
+    
+    /** used to capture Stdout and Stderr **/
+    static ByteArrayOutputStream baos = null;
+
+
+    public InputEditorFactory getInputEditorFactory() {
+        return inputEditorFactory;
+    }
+
+    public BeautiDoc() {
+        // g_doc = this;
+        setID("BeautiDoc");
+        clear();
+        inputEditorFactory = new InputEditorFactory(this);
+    }
+
+    public void setFileName(String fileName) {
+        this.fileName = fileName;
+    }
+
+    public String getFileName() {
+        return fileName;
+    }
+
+    public String getTemplateName() {
+        return templateName;
+    }
+    
+    public ActionOnExit parseArgs(String[] args) throws Exception {
+        ActionOnExit endState = ActionOnExit.UNKNOWN;
+        String sOutputFileName = "beast.xml";
+        String sXML = null;
+        String sTemplateXML = null;
+        TraitSet traitset = null;
+
+        int i = 0;
+        try {
+            while (i < args.length) {
+                int iOld = i;
+                if (args[i].equals("")) {
+                    i += 1;
+                } else if (args[i].equals("-h") || args[i].equals("-help")) {
+                    showUsageAndExit();
+                } else if (args[i].equals("-capture")) {
+                	// capture stderr and stdout
+                	// already done in beast.app.beauti.Beauti
+                	i += 1;
+                } else if (args[i].equals("-xml")) {
+                    String sFileName = args[i + 1];
+                    sXML = load(sFileName);
+                    // XMLParser parser = new XMLParser();
+                    // m_doc.m_mcmc.setValue(parser.parseFile(sFileName),
+                    // m_doc);
+                    this.fileName = nameFromFile(sFileName);
+                    i += 2;
+                } else if (args[i].equals("-template")) {
+                    String sFileName = args[i + 1];
+                    sTemplateXML = processTemplate(sFileName);
+                    templateFileName = sFileName;
+                    templateName = nameFromFile(sFileName);
+                    i += 2;
+                } else if (args[i].equals("-nex")) {
+                    // NB: multiple -nex/-xmldata commands can be processed!
+                    String fileName = args[i + 1];
+                    NexusParser parser = new NexusParser();
+                    parser.parseFile(new File(fileName));
+                    if (parser.filteredAlignments.size() > 0) {
+                        for (Alignment data : parser.filteredAlignments) {
+                            alignments.add(data);
+                        }
+                    } else {
+                        alignments.add(parser.m_alignment);
+                    }
+                    i += 2;
+                    traitset = parser.traitSet;
+                } else if (args[i].equals("-xmldata")) {
+                    // NB: multiple -xmldata/-nex commands can be processed!
+                    String fileName = args[i + 1];
+                    Alignment alignment = (Alignment) BeautiAlignmentProvider.getXMLData(new File(fileName));
+                    alignments.add(alignment);
+                    i += 2;
+                } else if (args[i].equals("-exitaction")) {
+                    if (args[i + 1].equals("writexml")) {
+                        endState = ActionOnExit.WRITE_XML;
+                    } else if (args[i + 1].equals("usetemplate")) {
+                        endState = ActionOnExit.SHOW_DETAILS_USE_TEMPLATE;
+                    } else if (args[i + 1].equals("usexml")) {
+                        endState = ActionOnExit.SHOW_DETAILS_USE_XML_SPEC;
+                    } else if (args[i + 1].equals("merge")) {
+                        endState = ActionOnExit.MERGE_AND_WRITE_XML;
+                    } else {
+                        throw new Exception("Expected one of 'writexml','usetemplate' or 'usexml', not " + args[i + 1]);
+                    }
+                    i += 2;
+                } else if (args[i].equals("-out")) {
+                    sOutputFileName = args[i + 1];
+                    i += 2;
+                } else if (args[i].equals("-noerr")) {
+                    System.setErr(new PrintStream(new OutputStream() {
+                        public void write(int b) {
+                        }
+                    }));
+                    i += 1;
+                }
+
+                if (i == iOld) {
+                    throw new Exception("Wrong argument: " + args[i]);
+                }
+            }
+        } catch (Exception e) {
+            JOptionPane.showMessageDialog(null, e.getMessage());
+            e.printStackTrace();
+            System.exit(1);
+        }
+
+        initialize(endState, sXML, sTemplateXML, sOutputFileName);
+        addTraitSet(traitset);
+        return endState;
+    } // parseArgs
+
+    String nameFromFile(String sFileName) {
+        if (sFileName.contains("/")) {
+            return sFileName.substring(sFileName.lastIndexOf("/") + 1, sFileName.length() - 4);
+        } else if (sFileName.contains("\\")) {
+            return sFileName.substring(sFileName.lastIndexOf("\\") + 1, sFileName.length() - 4);
+        }
+        return sFileName.substring(0, sFileName.length() - 4);
+    }
+
+    void showUsageAndExit() {
+        System.out.println(usage());
+        System.exit(0);
+    }
+
+    String usage() {
+        return "java Beauti [options]\n" + "where options can be one of the following:\n"
+                + "-template [template file]\n" + "-nex [nexus data file]\n" + "-xmldat [beast xml file]\n"
+                + "-xml [beast file]\n" + "-out [output file name]\n" + "-exitaction [writexml|usetemplate|usexml]\n";
+    }
+
+    private Set<BeautiDocListener> listeners = new HashSet<BeautiDocListener>();
+
+    public void addBeautiDocListener(BeautiDocListener listener) {
+        listeners.add(listener);
+    }
+
+    @SuppressWarnings("unchecked")
+    void clear() {
+        clockModels = new ArrayList<BranchRateModel>();
+        // treePriors = new ArrayList<TreeDistribution>();
+        alignments = new ArrayList<Alignment>();
+
+        pPartitionByAlignments = new List[3];
+        pPartition = new List[3];
+        nCurrentPartitions = new List[3];
+        sPartitionNames = new ArrayList<PartitionContext>();
+        for (int i = 0; i < 3; i++) {
+            pPartitionByAlignments[i] = new ArrayList<BEASTInterface>();
+            pPartition[i] = new ArrayList<BEASTInterface>();
+            nCurrentPartitions[i] = new ArrayList<Integer>();
+        }
+        tipTextMap = new HashMap<String, String>();
+
+        pluginmap = new HashMap<String, BEASTInterface>();
+        taxaset = new HashMap<String, Taxon>();
+        fileName = "";
+        linked = new HashSet<Input<?>>();
+    }
+
+    public void registerPlugin(BEASTInterface plugin) {
+        // first make sure to remove plug-ins when the id of a plugin changed
+        unregisterPlugin(plugin);
+
+        pluginmap.put(plugin.getID(), plugin);
+        if (plugin instanceof Taxon) {
+        	Taxon taxon = (Taxon) plugin;
+            taxaset.put(taxon.getID(), taxon);
+        }
+    }
+
+    public void unregisterPlugin(BEASTInterface plugin) {
+        String oldID = null;
+        for (String id : pluginmap.keySet()) {
+            if (pluginmap.get(id).equals(plugin)) {
+                oldID = id;
+                break;
+            }
+        }
+        if (oldID != null) {
+            pluginmap.remove(oldID);
+        }
+        taxaset.remove(plugin.getID());
+    }
+
+    /**
+     * remove all alignment data and model, and reload Standard template *
+     */
+    public void newAnalysis() {
+        try {
+            clear();
+            BEASTObjectPanel.init();
+            beautiConfig.clear();
+            String sXML = processTemplate(templateFileName);
+            loadTemplate(sXML);
+
+            for (BeautiDocListener listener : listeners) {
+                listener.docHasChanged();
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    public void loadXML(File file) throws Exception {
+        String sXML = load(file);
+        extractSequences(sXML);
+        scrubAll(true, false);
+        fireDocHasChanged();
+    }
+
+    public void loadNewTemplate(String fileName) throws Exception {
+        templateFileName = fileName;
+        newAnalysis();
+    }
+
+    public void importNexus(File file) throws Exception {
+        NexusParser parser = new NexusParser();
+        parser.parseFile(file);
+        if (parser.filteredAlignments.size() > 0) {
+            for (Alignment data : parser.filteredAlignments) {
+                addAlignmentWithSubnet(data, beautiConfig.partitionTemplate.get());
+            }
+        } else {
+            addAlignmentWithSubnet(parser.m_alignment, beautiConfig.partitionTemplate.get());
+        }
+//      connectModel();
+        addTraitSet(parser.traitSet);
+//      fireDocHasChanged();
+    }
+
+    public void importXMLAlignment(File file) throws Exception {
+        Alignment data = (Alignment) BeautiAlignmentProvider.getXMLData(file);
+        data.initAndValidate();
+        addAlignmentWithSubnet(data, beautiConfig.partitionTemplate.get());
+//      connectModel();
+//      fireDocHasChanged();
+    }
+
+    void fireDocHasChanged() throws Exception {
+        for (BeautiDocListener listener : listeners) {
+            listener.docHasChanged();
+        }
+    }
+
+    void initialize(ActionOnExit endState, String sXML, String sTemplate, String sFileName) throws Exception {
+        // beautiConfig.clear();
+        switch (endState) {
+            case UNKNOWN:
+            case SHOW_DETAILS_USE_TEMPLATE: {
+                mergeSequences(sTemplate);
+                // scrubAll(true, );
+                connectModel();
+                break;
+            }
+            case SHOW_DETAILS_USE_XML_SPEC: {
+                if (sTemplate == null) {
+                    sTemplate = processTemplate(STANDARD_TEMPLATE);
+                }
+                loadTemplate(sTemplate);
+                extractSequences(sXML);
+                connectModel();
+                break;
+            }
+            case WRITE_XML: {
+                mergeSequences(sTemplate);
+                connectModel();
+                save(sFileName);
+                break;
+            }
+            case MERGE_AND_WRITE_XML: {
+                // merge alignment with XML
+//	        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+//	        Document doc = factory.newDocumentBuilder().parse(new InputSource(new StringReader(sXML)));
+//	        doc.normalize();
+//	        NodeList nodes = doc.getElementsByTagName("data");
+//
+//			XMLProducer producer = new XMLProducer();
+//			producer.toRawXML(alignments.get(0));
+//			
+//			Pplugin plugin =  parser.parseFragment(sXML, false);
+//			int i = sXML.indexOf("<data");
+//			for (Plugin plugin : pluginmap.values()) {
+//				if (plugin instanceof Alignment) {
+//					
+//				}
+//			}
+//			save(sFileName);
+                System.exit(1);
+                break;
+            }
+            // // load standard template
+            // String sTemplateXML =
+            // BeautiInitDlg.processTemplate(STANDARD_TEMPLATE);
+            // loadTemplate(sTemplateXML);
+            // connectModel();
+        }
+    }
+
+    /**
+     * public to allow access for unit test *
+     */
+    public String processTemplate(String sFileName) throws Exception {
+        final String MERGE_ELEMENT = "mergepoint";
+        // first gather the set of potential directories with templates
+        Set<String> sDirs = new HashSet<String>();// AddOnManager.getBeastDirectories();
+        String pathSep = System.getProperty("path.separator");
+        String classpath = System.getProperty("java.class.path");
+        String fileSep = System.getProperty("file.separator");
+        if (fileSep.equals("\\")) {
+            fileSep = "\\\\";
+        }
+        sDirs.add(".");
+        for (String path : classpath.split(pathSep)) {
+            path = path.replaceAll(fileSep, "/");
+            if (path.endsWith(".jar")) {
+                path = path.substring(0, path.lastIndexOf("/"));
+            }
+            if (path.indexOf("/") >= 0) {
+                path = path.substring(0, path.lastIndexOf("/"));
+            }
+            if (!sDirs.contains(path)) {
+                sDirs.add(path);
+            }
+        }
+
+        // read main template, try all template directories if necessary
+        File mainTemplate = new File(sFileName);
+        for (String sDir : sDirs) {
+            if (!mainTemplate.exists()) {
+                mainTemplate = new File(sDir + fileSep + sFileName);
+            }
+            if (!mainTemplate.exists()) {
+                mainTemplate = new File(sDir + fileSep + "templates" + fileSep + sFileName);
+            }
+        }
+        System.err.println("Loading template " + mainTemplate.getAbsolutePath());
+        String sTemplateXML = load(mainTemplate.getAbsolutePath());
+
+        // find merge points
+        int i = 0;
+        HashMap<String, String> sMergePoints = new HashMap<String, String>();
+        while (i >= 0) {
+            i = sTemplateXML.indexOf("<" + MERGE_ELEMENT, i + 1);
+            if (i > 0) {
+                int j = sTemplateXML.indexOf('>', i);
+                String sStr = sTemplateXML.substring(i, j);
+                sStr = sStr.replaceAll(".*id=", "");
+                char c = sStr.charAt(0);
+                sStr = sStr.replaceAll(c + "[^" + c + "]*$", "");
+                sStr = sStr.substring(1);
+                sMergePoints.put(sStr, "");
+            }
+        }
+
+        // find XML to merge
+        // ensure processed templates are unique in name.
+        // This prevents loading templates twice, once from the development area
+        // and once from .beast2-addon area
+        Set<String> loadedTemplates = new HashSet<String>();
+        for (String sDir : sDirs) {
+            System.out.println("Investigating " + sDir);
+            File templates = new File(sDir + fileSep + "templates");
+            File[] files = templates.listFiles();
+            if (files != null) {
+                for (File template : files) {
+                    if (!template.getAbsolutePath().equals(mainTemplate.getAbsolutePath())
+                            && template.getName().toLowerCase().endsWith(".xml")) {
+                        if (!loadedTemplates.contains(template.getName())) {
+                            System.err.println("Processing " + template.getAbsolutePath());
+                            loadedTemplates.add(template.getName());
+                            String sXML2 = load(template.getAbsolutePath());
+                            if (!sXML2.contains("<mergepoint ")) {
+                                try {
+
+                                    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+                                    // factory.setValidating(true);
+                                    Document doc = factory.newDocumentBuilder().parse(template);
+                                    doc.normalize();
+
+                                    processBeautiConfig(doc);
+
+                                    // find mergewith elements
+                                    NodeList nodes = doc.getElementsByTagName("mergewith");
+                                    for (int iMergeElement = 0; iMergeElement < nodes.getLength(); iMergeElement++) {
+                                        Node mergeElement = nodes.item(iMergeElement);
+                                        String sMergePoint = mergeElement.getAttributes().getNamedItem("point")
+                                                .getNodeValue();
+                                        if (!sMergePoints.containsKey(sMergePoint)) {
+                                            System.err.println("Cannot find merge point named " + sMergePoint
+                                                    + " from " + template.getName()
+                                                    + " in template. MergeWith ignored.");
+                                        } else {
+                                            String sXML = "";
+                                            NodeList children = mergeElement.getChildNodes();
+                                            for (int iChild = 0; iChild < children.getLength(); iChild++) {
+                                                sXML += nodeToString(children.item(iChild));
+                                            }
+                                            String sStr = sMergePoints.get(sMergePoint);
+                                            sStr += sXML;
+                                            sMergePoints.put(sMergePoint, sStr);
+                                        }
+
+                                    }
+                                } catch (Exception e) {
+                                    if (!e.getMessage().contains("beast.app.beauti.InputConstraint")) {
+                                        System.err.println(e.getMessage());
+                                    }
+                                }
+                            }
+                        } else {
+                            System.err.println("Skipping " + template.getAbsolutePath() + " since "
+                                    + template.getName() + " is already processed");
+                        }
+
+                    }
+                }
+            }
+        }
+
+        // merge XML
+        i = 0;
+        while (i >= 0) {
+            i = sTemplateXML.indexOf("<" + MERGE_ELEMENT, i + 1);
+            if (i > 0) {
+                int j = sTemplateXML.indexOf('>', i);
+                String sStr = sTemplateXML.substring(i, j);
+                sStr = sStr.replaceAll(".*id=", "");
+                char c = sStr.charAt(0);
+                sStr = sStr.replaceAll(c + "[^" + c + "]*$", "");
+                sStr = sStr.substring(1);
+                String sXML = sMergePoints.get(sStr);
+                sTemplateXML = sTemplateXML.substring(0, i) + sXML + sTemplateXML.substring(j + 1);
+            }
+        }
+        templateName = nameFromFile(sFileName);
+
+        if (Boolean.valueOf(System.getProperty("beast.debug"))) {
+            Writer out = new OutputStreamWriter(new FileOutputStream("/tmp/beast.xml"));
+            try {
+                out.write(sTemplateXML);
+            } finally {
+                out.close();
+            }
+        }
+
+        return sTemplateXML;
+    }
+
+    void processBeautiConfig(Document doc) throws Exception {
+        // find configuration elements, process and remove
+        NodeList nodes = doc.getElementsByTagName("beauticonfig");
+        Node topNode = doc.getElementsByTagName("*").item(0);
+        String sNameSpaceStr = XMLParser.getAttribute(topNode, "namespace");
+        for (int iConfigElement = 0; iConfigElement < nodes.getLength(); iConfigElement++) {
+            Node configElement = nodes.item(iConfigElement);
+            String sXML = nodeToString(configElement);
+            XMLParser parser = new XMLParser();
+            parser.setNameSpace(sNameSpaceStr);
+            parser.parseBareFragment(sXML, true);
+            configElement.getParentNode().removeChild(configElement);
+        }
+    }
+
+    String nodeToString(Node node) throws TransformerException {
+        TransformerFactory transFactory = TransformerFactory.newInstance();
+        Transformer transformer = transFactory.newTransformer();
+        StringWriter buffer = new StringWriter();
+        transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
+        transformer.transform(new DOMSource(node), new StreamResult(buffer));
+        return buffer.toString();
+    }
+
+    static public String load(String fileName) throws IOException {
+        return load(new File(fileName));
+    }
+
+    static public String load(File file) throws IOException {
+        BufferedReader fin = new BufferedReader(new FileReader(file));
+        StringBuffer buf = new StringBuffer();
+        String sStr = null;
+        while (fin.ready()) {
+            sStr = fin.readLine();
+            buf.append(sStr);
+            buf.append('\n');
+        }
+        fin.close();
+        return buf.toString();
+    }
+
+    Alignment getPartition(BEASTInterface plugin) {
+        String sPartition = plugin.getID();
+        sPartition = parsePartition(sPartition);
+        for (Alignment data : alignments) {
+            if (data.getID().equals(sPartition)) {
+                return data;
+            }
+        }
+        return null;
+    }
+
+    /**
+     * see whether we have a valid model that can be saved at this point in time
+     */
+    public enum DOC_STATUS {
+        NO_DOCUMENT, SAVED, DIRTY
+    }
+
+    public DOC_STATUS validateModel() {
+        if (mcmc == null || (mcmc.get().hasPartitions() && sPartitionNames.size() == 0)) {
+            return DOC_STATUS.NO_DOCUMENT;
+        }
+        try {
+            // check if file is already saved and not changed wrt file on disk
+            if (fileName != null && fileName.length() > 0) {
+                String sFileXML = load(fileName);
+                String sXML = toXML();
+                if (sFileXML.equals(sXML)) {
+                    return DOC_STATUS.SAVED;
+                }
+            }
+        } catch (Exception e) {
+            // ignore
+        }
+        return DOC_STATUS.DIRTY;
+    } // validateModel
+
+    /**
+     * save specification in file *
+     */
+    public void save(String sFileName) throws Exception {
+        save(new File(sFileName));
+    } // save
+
+    /**
+     * save specification in file *
+     */
+    public void save(File file) throws Exception {
+        determinePartitions();
+        scrubAll(false, false);
+        // String sXML = new XMLProducer().toXML(mcmc.get(), );
+        String spec = null;
+        if (file.getPath().toLowerCase().endsWith(".json")) {
+            spec = toJSON();
+        } else {
+            spec = toXML();
+        }
+        FileWriter outfile = new FileWriter(file);
+        outfile.write(spec);
+        outfile.close();
+    } // save
+
+    private String toJSON() {
+        Set<BEASTInterface> plugins = new HashSet<BEASTInterface>();
+        String json = new JSONProducer().toJSON(mcmc.get(), plugins);
+
+        json = json.replaceFirst("\\{", "{ beautitemplate:\"" + templateName + "\", beautistatus:\"" + getBeautiStatus() + "\", ");
+        return json + "\n";
+    }
+
+    public String toXML() {
+        Set<BEASTInterface> plugins = new HashSet<BEASTInterface>();
+//		for (Plugin plugin : pluginmap.values()) {
+//			String sName = plugin.getClass().getName();
+//			if (!sName.startsWith("beast.app.beauti")) {
+//				plugins.add(plugin);
+//			}
+//		}
+        String sXML = new XMLProducer().toXML(mcmc.get(), plugins);
+
+        sXML = sXML.replaceFirst("<beast ", "<beast beautitemplate='" + templateName + "' beautistatus='" + getBeautiStatus() + "' ");
+        return sXML + "\n";
+    }
+
+    /** get status of mode-flags in BEAUti, so these can be restored when reloading an XML file **/
+    String getBeautiStatus() {
+	    String beautiStatus = "";
+	    if (!bAutoSetClockRate) {
+	        beautiStatus = "noAutoSetClockRate";
+	    }
+	    if (bAllowLinking) {
+	        beautiStatus += (beautiStatus.length() > 0 ? "|" : "") + "allowLinking";
+	    }
+	    if (!bAutoUpdateOperatorWeights) {
+	        beautiStatus += (beautiStatus.length() > 0 ? "|" : "") + "noAutoUpdateOperatorWeights";
+	    }
+	    if (!bAutoUpdateFixMeanSubstRate) {
+	        beautiStatus += (beautiStatus.length() > 0 ? "|" : "") + "noAutoUpdateFixMeanSubstRate";
+	    }
+	    return beautiStatus;
+    }
+
+    void extractSequences(String sXML) throws Exception {
+
+        // parse the XML fragment into a DOM document
+        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+        Document doc = factory.newDocumentBuilder().parse(new InputSource(new StringReader(sXML)));
+        doc.normalize();
+        // find top level beast element
+        NodeList nodes = doc.getElementsByTagName("*");
+        Node topNode = nodes.item(0);
+        String beautiTemplate = XMLParser.getAttribute(topNode, "beautitemplate");
+        if (beautiTemplate == null) {
+            int choice = JOptionPane.showConfirmDialog(getFrame(), "This file does not appear to be generated by BEAUti. If you load it, unexpected behaviour may follow");
+            if (choice != JOptionPane.OK_OPTION) {
+                return;
+            }
+            // load standard template
+            if (beautiConfig == null) {
+                String sTemplateXML = processTemplate(STANDARD_TEMPLATE);
+                loadTemplate(sTemplateXML);
+            }
+        } else {
+            String sTemplateXML = processTemplate(beautiTemplate + ".xml");
+            loadTemplate(sTemplateXML);
+        }
+
+        String beautiStatus = XMLParser.getAttribute(topNode, "beautistatus");
+        if (beautiStatus == null) {
+            beautiStatus = "";
+        }
+        bAutoSetClockRate = !beautiStatus.contains("noAutoSetClockRate");
+        beauti.autoSetClockRate.setSelected(bAutoSetClockRate);
+        bAllowLinking = beautiStatus.contains("allowLinking");
+        beauti.allowLinking.setSelected(bAllowLinking);
+        bAutoUpdateOperatorWeights = !beautiStatus.contains("noAutoUpdateOperatorWeights");
+        beauti.autoUpdateOperatorWeights.setSelected(bAutoUpdateOperatorWeights);
+        bAutoUpdateFixMeanSubstRate = !beautiStatus.contains("noAutoUpdateFixMeanSubstRate"); 
+        beauti.autoUpdateFixMeanSubstRate.setSelected(bAutoUpdateFixMeanSubstRate);
+
+        // parse file
+        XMLParser parser = new XMLParser();
+        BEASTInterface MCMC = parser.parseFragment(sXML, true);
+        mcmc.setValue(MCMC, this);
+        BEASTObjectPanel.addPluginToMap(MCMC, this);
+
+        // reconstruct all objects from templates
+        try {
+            CompoundDistribution posterior = (CompoundDistribution) ((beast.core.MCMC) mcmc.get()).posteriorInput.get();
+            for (Distribution distr : posterior.pDistributions.get()) {
+                if (distr.getID().equals("likelihood")) {
+                    for (Distribution likelihood : ((CompoundDistribution) distr).pDistributions.get()) {
+                        if (likelihood instanceof GenericTreeLikelihood) {
+                            GenericTreeLikelihood treeLikelihood = (GenericTreeLikelihood) likelihood;
+                            PartitionContext context = new PartitionContext(treeLikelihood);
+                            try {
+                                beautiConfig.partitionTemplate.get().createSubNet(context, false);
+                            } catch (Exception e) {
+                                //e.printStackTrace();
+                            }
+                            for (BeautiSubTemplate subTemplate : beautiConfig.subTemplates) {
+                                try {
+                                    subTemplate.createSubNet(context, false);
+                                } catch (Exception e) {
+                                    //e.printStackTrace();
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        } catch (Exception e) {
+            //e.printStackTrace();
+        }
+
+//		MCMC = parser.parseFragment(sXML, true);
+//		mcmc.setValue(MCMC, this);
+//		PluginPanel.addPluginToMap(MCMC, this);
+
+//		if (sXML.indexOf(XMLProducer.DO_NOT_EDIT_WARNING) > 0) {
+//			int iStart = sXML.indexOf(XMLProducer.DO_NOT_EDIT_WARNING);
+//			int iEnd = sXML.lastIndexOf("-->");
+//			sXML = sXML.substring(iStart, iEnd);
+//			sXML = sXML.replaceAll(XMLProducer.DO_NOT_EDIT_WARNING, "");
+//			sXML = "<beast namespace='" + XMLProducer.DEFAULT_NAMESPACE + "'>" + sXML + "</beast>";
+//			List<Plugin> plugins = parser.parseBareFragments(sXML, true);
+//			for (Plugin plugin : plugins) {
+//				PluginPanel.addPluginToMap(plugin, this);
+//			}
+//		}
+
+        // extract alignments
+        determinePartitions();
+    }
+
+    /**
+     * Merge sequence data with sXML specification.
+     */
+    void mergeSequences(String sXML) throws Exception {
+        if (sXML == null) {
+            sXML = processTemplate(STANDARD_TEMPLATE);
+        }
+        loadTemplate(sXML);
+        // create XML for alignments
+        if (beautiConfig != null) {
+            for (Alignment alignment : alignments) {
+                beautiConfig.partitionTemplate.get().createSubNet(alignment, this, true);
+            }
+        } else {
+            // replace alignment
+            for (BEASTInterface plugin : pluginmap.values()) {
+                if (plugin instanceof Alignment) {
+                	// use toArray to prevent ConcurrentModificationException
+                    for (Object output : plugin.getOutputs().toArray()) {
+                        replaceInputs((BEASTInterface) output, plugin, alignments.get(0));
+                    }
+                }
+            }
+            return;
+        }
+        determinePartitions();
+
+    } // mergeSequences
+
+    private void replaceInputs(BEASTInterface plugin, BEASTInterface original, BEASTInterface replacement) {
+        try {
+            for (Input input : plugin.listInputs()) {
+                if (input.get() != null) {
+                    if (input.get() instanceof List) {
+                        List list = (List) input.get();
+                        if (list.contains(original)) {
+                            list.remove(original);
+                            list.add(replacement);
+                        }
+                    } else {
+                        if (input.get().equals(original)) {
+                            input.setValue(replacement, plugin);
+                        }
+                    }
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    void loadTemplate(String sXML) throws Exception {
+        // load the template and its beauti configuration parts
+        XMLParser parser = new XMLParser();
+        BEASTObjectPanel.init();
+        List<BEASTInterface> plugins = parser.parseTemplate(sXML, new HashMap<String, BEASTInterface>(), true);
+        for (BEASTInterface plugin : plugins) {
+            if (plugin instanceof beast.core.Runnable) {
+                mcmc.setValue(plugin, this);
+            } else if (plugin instanceof BeautiConfig) {
+                beautiConfig = (BeautiConfig) plugin;
+                beautiConfig.setDoc(this);
+            } else {
+                System.err.println("template item " + plugin.getID() + " is ignored");
+            }
+            BEASTObjectPanel.addPluginToMap(plugin, this);
+        }
+    }
+
+    /**
+     * assigns trait to first available tree *
+     */
+    void addTraitSet(TraitSet trait) {
+        if (trait != null) {
+            CompoundDistribution likelihood = (CompoundDistribution) pluginmap.get("likelihood");
+            for (Distribution d : likelihood.pDistributions.get()) {
+                if (d instanceof GenericTreeLikelihood) {
+                    try {
+                        // TODO: this might not be a valid type conversion from TreeInterface to Tree
+                        Tree tree = (Tree) ((GenericTreeLikelihood) d).treeInput.get();
+                        tree.m_traitList.setValue(trait, tree);
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    scrubAll(true, false);
+                    return;
+                }
+            }
+        }
+    }
+
+    /**
+     * Connect all inputs to the relevant ancestors of m_runnable.
+     *
+     * @throws Exception *
+     */
+    void connectModel() throws Exception {
+        scrubAll(true, true);
+    }
+
+    private void collectClockModels() {
+        // collect branch rate models from model
+        CompoundDistribution likelihood = (CompoundDistribution) pluginmap.get("likelihood");
+        while (clockModels.size() < sPartitionNames.size()) {
+            try {
+                GenericTreeLikelihood treelikelihood = new GenericTreeLikelihood();
+                treelikelihood.branchRateModelInput.setValue(new StrictClockModel(), treelikelihood);
+                List<BeautiSubTemplate> sAvailablePlugins = inputEditorFactory.getAvailableTemplates(
+                        treelikelihood.branchRateModelInput, treelikelihood, null, this);
+                BEASTInterface plugin = sAvailablePlugins.get(0).createSubNet(sPartitionNames.get(clockModels.size()), true);
+                clockModels.add((BranchRateModel.Base) plugin);
+            } catch (Exception e) {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
+            }
+        }
+        int k = 0;
+        for (Distribution d : likelihood.pDistributions.get()) {
+            BranchRateModel clockModel = ((GenericTreeLikelihood) d).branchRateModelInput.get();
+            // sanity check
+            Tree tree = null;
+            try {
+                for (Input<?> input : ((BEASTInterface) clockModel).listInputs()) {
+                    if (input.getName().equals("tree")) {
+                        tree = (Tree) input.get();
+                    }
+
+                }
+                if (tree != null && tree != ((GenericTreeLikelihood) d).treeInput.get()) {
+                    clockModel = clockModels.get(k);
+                    System.err.println("WARNING: unlinking clock model for " + d.getID());
+                    ((GenericTreeLikelihood) d).branchRateModelInput.setValue(clockModel, d);
+                }
+            } catch (Exception e) {
+                // ignore
+            }
+
+            if (clockModel != null) {
+                String sID = ((BEASTInterface) clockModel).getID();
+                sID = parsePartition(sID);
+                String sPartition = alignments.get(k).getID();
+                if (sID.equals(sPartition)) {
+                    clockModels.set(k, clockModel);
+                }
+                k++;
+            }
+        }
+    }
+
+    // private void collectTreePriors() {
+    // // collect tree priors from model
+    // CompoundDistribution prior = (CompoundDistribution)
+    // pluginmap.get("prior");
+    // while (treePriors.size() < sPartitionNames.size()) {
+    // try {
+    // CompoundDistribution distr = new CompoundDistribution();
+    // distr.pDistributions.setValue(new YuleModel(), distr);
+    // List<BeautiSubTemplate> sAvailablePlugins =
+    // inputEditorFactory.getAvailableTemplates(distr.pDistributions, distr,
+    // null, this);
+    // for (int i = sAvailablePlugins.size() - 1; i >= 0; i--) {
+    // if
+    // (!TreeDistribution.class.isAssignableFrom(sAvailablePlugins.get(i)._class))
+    // {
+    // sAvailablePlugins.remove(i);
+    // }
+    // }
+    // if (sAvailablePlugins.size() > 0) {
+    // Plugin plugin =
+    // sAvailablePlugins.get(0).createSubNet(sPartitionNames.get(treePriors.size()));
+    // treePriors.add((TreeDistribution) plugin);
+    // } else {
+    // treePriors.add(null);
+    // }
+    // } catch (Exception e) {
+    // // TODO Auto-generated catch block
+    // e.printStackTrace();
+    // }
+    // }
+    //
+    // // find tree priors that are in the posterior somewhere
+    // // by inspecting outputs of *[id=likelihood]/TreeLikelihood/Tree
+    // // and match tree prior to partition of tree
+    // CompoundDistribution likelihood = (CompoundDistribution)
+    // pluginmap.get("likelihood");
+    // for (Distribution distr : likelihood.pDistributions.get()) {
+    // if (distr instanceof TreeLikelihood) {
+    // TreeLikelihood tl = (TreeLikelihood) distr;
+    // Tree tree = tl.m_tree.get();
+    // int partition = getPartitionNr(tree);
+    // for (Plugin plugin : tree.outputs) {
+    // if (plugin instanceof TreeDistribution &&
+    // posteriorPredecessors.contains(plugin)) {
+    // treePriors.set(partition, (TreeDistribution) plugin);
+    // }
+    // }
+    // }
+    // }
+    // }
+
+    BranchRateModel getClockModel(String sPartition) {
+        int k = 0;
+        for (Alignment data : alignments) {
+            if (data.getID().equals(sPartition)) {
+                return clockModels.get(k);
+            }
+            k++;
+        }
+        return null;
+    }
+
+    // TreeDistribution getTreePrior(String sPartition) {
+    // int k = 0;
+    // for (Alignment data : alignments) {
+    // if (data.getID().equals(sPartition)) {
+    // return treePriors.get(k);
+    // }
+    // k++;
+    // }
+    // return null;
+    // }
+
+    synchronized public void scrubAll(boolean bUseNotEstimatedStateNodes, boolean bInitial) {
+        try {
+            if (bAutoSetClockRate) {
+                setClockRate();
+            }
+            if (bAutoUpdateFixMeanSubstRate) {
+            	SiteModelInputEditor.customConnector(this);
+            }
+
+            // set estimate flag on tree, only if tree occurs in a partition
+            for (BEASTInterface plugin : pluginmap.values()) {
+                if (plugin instanceof Tree) {
+                    Tree tree = (Tree) plugin;
+                    tree.isEstimatedInput.setValue(false, tree);
+                }
+            }
+            for (BEASTInterface plugin : pPartition[2]) {
+                // TODO: this might not be a valid type conversion from TreeInterface to Tree
+                Tree tree = (Tree) ((GenericTreeLikelihood) plugin).treeInput.get();
+                tree.isEstimatedInput.setValue(true, tree);
+            }
+            if (pluginmap.containsKey("Tree.t:Species")) {
+                Tree tree = (Tree) pluginmap.get("Tree.t:Species");
+                tree.isEstimatedInput.setValue(true, tree);
+            }
+
+            // go through all templates, and process connectors in relevant ones
+            boolean bProgress = true;
+            while (bProgress) {
+                warning("============================ start scrubbing ===========================");
+                bProgress = false;
+                setUpActivePlugins();
+
+                // process MRCA priors
+                for (String sID : pluginmap.keySet()) {
+                    if (sID.endsWith(".prior")) {
+                    	BEASTInterface plugin = pluginmap.get(sID);
+                        if (plugin instanceof MRCAPrior) {
+                            MRCAPrior prior = (MRCAPrior) plugin;
+                            if (prior.treeInput.get().isEstimatedInput.get() == false) {
+                                // disconnect
+                                disconnect(plugin, "prior", "distribution");
+                            } else {
+                                // connect
+                                connect(plugin, "prior", "distribution");
+                            }
+                        }
+                    }
+                }
+
+                List<BeautiSubTemplate> templates = new ArrayList<BeautiSubTemplate>();
+                templates.add(beautiConfig.partitionTemplate.get());
+                templates.addAll(beautiConfig.subTemplates);
+
+                for (PartitionContext context : possibleContexts) {
+                    applyBeautiRules(templates, bInitial, context);
+                }
+                // add 'Species' as special partition name
+                applyBeautiRules(templates, bInitial, new PartitionContext("Species"));
+
+                // if the model changed, some rules that use inposterior() may
+                // not have been triggered properly
+                // so we need to check that the model changed, and if so,
+                // revisit the BeautiConnectors
+                List<BEASTInterface> posteriorPredecessors2 = new ArrayList<BEASTInterface>();
+                collectPredecessors(((MCMC) mcmc.get()).posteriorInput.get(), posteriorPredecessors2);
+                if (posteriorPredecessors.size() != posteriorPredecessors2.size()) {
+                    bProgress = true;
+                } else {
+                    for (BEASTInterface plugin : posteriorPredecessors2) {
+                        if (!posteriorPredecessors.contains(plugin)) {
+                            bProgress = true;
+                            break;
+                        }
+                    }
+                }
+            }
+
+            List<BeautiSubTemplate> templates = new ArrayList<BeautiSubTemplate>();
+            templates.add(beautiConfig.hyperPriorTemplate);
+            for (BEASTInterface plugin : pluginmap.values()) {
+                if (plugin instanceof RealParameter) {
+                    if (plugin.getID().startsWith("parameter.")) {
+                        PartitionContext context = new PartitionContext(plugin.getID().substring("parameter.".length()));
+                        applyBeautiRules(templates, bInitial, context);
+                    }
+                }
+            }
+
+
+            collectClockModels();
+            // collectTreePriors();
+
+            System.err.println("PARTITIONS:\n");
+            System.err.println(Arrays.toString(nCurrentPartitions));
+
+            determineLinks();
+        } catch (Exception e) {
+            System.err.println(e.getMessage());
+        }
+        
+        if (bAutoUpdateOperatorWeights) {
+        	reweightSpeciesPartitionOperators();
+        }
+    } // scrubAll
+
+    protected void setUpActivePlugins() {
+        posteriorPredecessors = new ArrayList<BEASTInterface>();
+        collectPredecessors(((MCMC) mcmc.get()).posteriorInput.get(), posteriorPredecessors);
+        likelihoodPredecessors = new ArrayList<BEASTInterface>();
+        if (pluginmap.containsKey("likelihood")) {
+            collectPredecessors(pluginmap.get("likelihood"), likelihoodPredecessors);
+        }
+        
+                
+        System.err.print("InPosterior=");
+        for (BEASTInterface o : posteriorPredecessors) {
+        	pluginmap.put(o.getID(), o);
+        	System.err.print(o.getID() + " ");
+        	//if (!pluginmap.containsKey(o)) {
+        	//	System.err.println("MISSING: " + o.getID());
+        	//}
+        }
+        System.err.println();
+    }
+
+    public static String translatePartitionNames(String sStr, PartitionContext partition) {
+//        sStr = sStr.replaceAll(".s:\\$\\(n\\)", ".s:" + partition.siteModel);
+//        sStr = sStr.replaceAll(".c:\\$\\(n\\)", ".c:" + partition.clockModel);
+//        sStr = sStr.replaceAll(".t:\\$\\(n\\)", ".t:" + partition.tree);
+//        sStr = sStr.replaceAll("\\$\\(n\\)", partition.partition);
+        // optimised code, based on (probably incorrect) profiler output
+		StringBuilder sb = new StringBuilder();
+		int len = sStr.length();
+		for (int i = 0; i < len; i++) {
+			char c = sStr.charAt(i);
+			if (c == '.' && i < len - 6) {
+				if (sStr.charAt(i + 2) == ':' && sStr.charAt(i + 3) == '$' && 
+						sStr.charAt(i + 4) == '(' && sStr.charAt(i + 5) == 'n' && sStr.charAt(i + 6) == ')') {
+					switch (sStr.charAt(i+1)) {
+					case 's': // .s:$(n)
+						sb.append(".s:").append(partition.siteModel);
+						i += 6;
+						break;
+					case 'c': 
+						sb.append(".c:").append(partition.clockModel);
+						i += 6;
+						break;
+					case 't': 
+						sb.append(".t:").append(partition.tree);
+						i += 6;
+						break;
+					default:
+						sb.append('.');
+					}
+				} else {
+					sb.append('.');
+				}
+			} else if (c == '$' && i < len - 3) {
+				if (sStr.charAt(i + 1) == '(' && sStr.charAt(i + 2) == 'n' && sStr.charAt(i + 3) == ')') {
+					sb.append(partition.partition);
+					i+= 3;
+				} else {
+					sb.append(c);
+				}
+			} else {
+				sb.append(c);
+			}
+		}
+        return sb.toString();
+    }
+
+    void applyBeautiRules(List<BeautiSubTemplate> templates, boolean bInitial, PartitionContext context) throws Exception {
+        for (BeautiSubTemplate template : templates) {
+            String sTemplateID = translatePartitionNames(template.getMainID(), context);
+            BEASTInterface plugin = pluginmap.get(sTemplateID);
+
+            // check if template is in use
+            if (plugin != null) {
+                // if so, run through all connectors
+                for (BeautiConnector connector : template.connectors) {
+
+                    if (connector.atInitialisationOnly()) {
+                        if (bInitial) {
+                            warning("connect: " + connector.toString(context) + "\n");
+                            connect(connector, context);
+                        }
+                    } else if (connector.isActivated(context, posteriorPredecessors,
+                            likelihoodPredecessors, this)) {
+                        warning("connect: " + connector.toString(context) + "\n");
+                        try {
+                            connect(connector, context);
+                        } catch (Exception e) {
+                            warning(e.getMessage());
+                        }
+
+                    } else {
+                        warning("DISconnect: " + connector.toString(context) + "\n");
+                        try {
+                            disconnect(connector, context);
+                        } catch (Exception e) {
+                            warning(e.getMessage() + "\n");
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    void setClockRate() throws Exception {
+    	boolean bNeedsEstimationBySPTree = false;
+        if (pluginmap.containsKey("Tree.t:Species")) {
+        	Tree sptree = (Tree) pluginmap.get("Tree.t:Species");
+	        // check whether there is a calibration
+	        for (Object plugin : sptree.getOutputs()) {
+	            if (plugin instanceof MRCAPrior) {
+	                MRCAPrior prior = (MRCAPrior) plugin;
+	                if (prior.distInput.get() != null) {
+	                    bNeedsEstimationBySPTree = true;
+	                }
+	            }
+	        }
+        }
+    	
+        BEASTInterface likelihood = pluginmap.get("likelihood");
+        if (likelihood instanceof CompoundDistribution) {
+            int i = 0;
+            RealParameter firstClock = null;
+            for (Distribution distr : ((CompoundDistribution) likelihood).pDistributions.get()) {
+                if (distr instanceof GenericTreeLikelihood) {
+                    GenericTreeLikelihood treeLikelihood = (GenericTreeLikelihood) distr;
+                    boolean bNeedsEstimation = bNeedsEstimationBySPTree;
+                    if (i > 0) {
+                        BranchRateModel.Base model = (BranchRateModel.Base) treeLikelihood.branchRateModelInput.get();
+                        bNeedsEstimation = (model.meanRateInput.get() != firstClock) || firstClock.isEstimatedInput.get();
+                    } else {
+                        // TODO: this might not be a valid type conversion from TreeInterface to Tree
+                        Tree tree = (Tree) treeLikelihood.treeInput.get();
+                        // check whether there are tip dates
+                        if (tree.hasDateTrait()) {
+                            bNeedsEstimation = true;
+                        }
+                        // check whether there is a calibration
+                        for (Object plugin : tree.getOutputs()) {
+                            if (plugin instanceof MRCAPrior) {
+                                MRCAPrior prior = (MRCAPrior) plugin;
+                                if (prior.distInput.get() != null) {
+                                    bNeedsEstimation = true;
+                                }
+                            }
+                        }
+                    }
+                    BranchRateModel.Base model = (BranchRateModel.Base) treeLikelihood.branchRateModelInput.get();
+                    if (model != null) {
+                        RealParameter clockRate = model.meanRateInput.get();
+                        clockRate.isEstimatedInput.setValue(bNeedsEstimation, clockRate);
+                        if (firstClock == null) {
+                            firstClock = clockRate;
+                        }
+                    }
+                    i++;
+                }
+            }
+        }
+    }
+
+    public void addPlugin(final BEASTInterface plugin) { // throws Exception {
+        // SwingUtilities.invokeLater(new Runnable() {
+        // @Override
+        // public void run() {
+        //
+        BEASTObjectPanel.addPluginToMap(plugin, this);
+        try {
+            for (Input<?> input : plugin.listInputs()) {
+                if (input.get() != null) {
+                    if (input.get() instanceof BEASTInterface) {
+                        BEASTObjectPanel.addPluginToMap((BEASTInterface) input.get(), this);
+                    }
+                    if (input.get() instanceof List<?>) {
+                        for (Object o : (List<?>) input.get()) {
+                            if (o instanceof BEASTInterface) {
+                                BEASTObjectPanel.addPluginToMap((BEASTInterface) o, this);
+                            }
+                        }
+                    }
+                }
+            }
+        } catch (Exception e) {
+            // ignore
+            System.err.println(e.getClass().getName() + " " + e.getMessage());
+        }
+
+        // }});
+
+        // m_sIDMap.put(plugin.getID(), plugin);
+        // for (Plugin plugin2 : plugin.listActivePlugins()) {
+        // addPlugin(plugin2);
+        // }
+    }
+
+    /**
+     * connect source plugin with target plugin
+     *
+     * @throws Exception *
+     */
+    public void connect(BeautiConnector connector, PartitionContext context) throws Exception {
+        if (!connector.isRegularConnector) {
+            return;
+        }
+        String sSrcID = translatePartitionNames(connector.sSourceID, context);
+        BEASTInterface srcPlugin = pluginmap.get(sSrcID);
+        if (srcPlugin == null) {
+            throw new Exception("Could not find plugin with id " + sSrcID + ". Typo in template perhaps?\n");
+        }
+        String sTargetID = translatePartitionNames(connector.sTargetID, context);
+        connect(srcPlugin, sTargetID, connector.sTargetInput);
+    }
+
+    public void connect(BEASTInterface srcPlugin, String sTargetID, String sInputName) {
+        try {
+        	BEASTInterface target = pluginmap.get(sTargetID);
+            if (target == null) {
+            	Log.trace.println("BeautiDoc: Could not find object " + sTargetID);
+            	return;
+            }
+            // prevent duplication inserts in list
+            Object o = target.getInputValue(sInputName);
+            if (o instanceof List) {
+                // System.err.println("   " + ((List)o).size());
+                if (((List<?>) o).contains(srcPlugin)) {
+                    warning("   " + sTargetID + "/" + sInputName + " already contains " + (srcPlugin == null ? "nulls" : srcPlugin.getID()) + "\n");
+                    return;
+                }
+            }
+
+            target.setInputValue(sInputName, srcPlugin);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * disconnect source plugin with target plugin *
+     */
+    public void disconnect(BeautiConnector connector, PartitionContext context) {
+        if (!connector.isRegularConnector) {
+            return;
+        }
+        BEASTInterface srcPlugin = pluginmap.get(translatePartitionNames(connector.sSourceID, context));
+        String sTargetID = translatePartitionNames(connector.sTargetID, context);
+        disconnect(srcPlugin, sTargetID, connector.sTargetInput);
+    }
+
+    public void disconnect(BEASTInterface srcPlugin, String sTargetID, String sInputName) {
+        try {
+        	BEASTInterface target = pluginmap.get(sTargetID);
+            if (target == null) {
+                return;
+            }
+            Input<?> input = target.getInput(sInputName);
+            Object o = input.get();
+            if (o instanceof List) {
+                List<?> list = (List<?>) o;
+                // System.err.println("   " + ((List)o).size());
+                for (int i = 0; i < list.size(); i++) {
+                    if (list.get(i) == srcPlugin) {
+                        warning("  DEL " + sTargetID + "/" + sInputName + " contains " + (srcPlugin == null ? "null" : srcPlugin.getID()) + "\n");
+                        list.remove(i);
+                    }
+                }
+                if (srcPlugin != null && srcPlugin.getOutputs() != null) {
+                    srcPlugin.getOutputs().remove(target);
+                }
+            } else {
+                if (input.get() != null && input.get() instanceof BEASTInterface &&
+                		input.get() == srcPlugin) {
+                        //((BEASTInterface) input.get()).getID().equals(sTargetID)) {
+                    input.setValue(null, target);
+                }
+            }
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    public void addAlignmentWithSubnet(Alignment data, BeautiSubTemplate template) {
+        alignments.add(data);
+        template.createSubNet(data, this, true);
+        // re-determine partitions
+        determinePartitions();
+    }
+
+    /**
+      * Reweight total weight of operators that work on the Species partition to 20% 
+      * of total operator weights. This helps *BEAST analyses in convergence. For non
+      * *BEAST analyses, this bit of code has no effect. 
+      */
+    private void reweightSpeciesPartitionOperators() {
+    	if (!(mcmc.get() instanceof MCMC)) {
+    		return;
+    	}
+    	List<Operator> speciesOperators = new ArrayList<Operator>(); 
+    	double totalWeight = 0;
+    	double speciesWeight = 0;
+    	for (Operator operator : ((MCMC)mcmc.get()).operatorsInput.get()) {
+			if (operator.getID().endsWith("Species")) {
+				speciesOperators.add(operator);
+				speciesWeight += operator.getWeight();
+			}
+			totalWeight += operator.getWeight();
+    	}
+    	
+    	if (speciesWeight > 0 && speciesWeight < totalWeight) {
+    		// we have a Species-related operator AND an alignment
+    		// rescale weights so that 20% of operator weights is dedicated to Species operators
+    		final double fraction = 0.2;
+    		//double scale = fraction/(1.0 - fraction) / (speciesWeight / (totalWeight - speciesWeight));
+    		double scale = fraction /(1-fraction) * ((totalWeight-speciesWeight) / speciesWeight);
+    		for (Operator operator : speciesOperators) {
+    			operator.m_pWeight.setValue(scale * operator.getWeight(), operator);
+    		}
+    	}
+		
+	}
+
+	public BEASTInterface addAlignmentWithSubnet(PartitionContext context, BeautiSubTemplate template) throws Exception {
+        BEASTInterface data = template.createSubNet(context, true);
+        alignments.add((Alignment) data);
+        // re-determine partitions
+        determinePartitions();
+        return data;
+    }
+
+    public void delAlignmentWithSubnet(Alignment data) {
+        alignments.remove(data);
+        try {
+            PartitionContext context = null;
+            for (PartitionContext context2 : sPartitionNames) {
+                if (context2.partition.equals(data.getID())) {
+                    context = context2;
+                    break;
+                }
+            }
+            BeautiSubTemplate template = beautiConfig.partitionTemplate.get();
+            template.removeSubNet(template, context);
+            for (BeautiSubTemplate template2 : beautiConfig.subTemplates) {
+                template2.removeSubNet(template2, context);
+            }
+
+            // remove from possible contexts
+            PartitionContext[] contexts = possibleContexts.toArray(new PartitionContext[0]);
+            determinePartitions();
+            scrubAll(true, false);
+            for (PartitionContext context2 : contexts) {
+                if (context2.equals(context)) {
+                    possibleContexts.remove(context2);
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        // re-determine partitions
+        determinePartitions();
+        scrubAll(true, true);
+    }
+
+    public void determinePartitions() {
+        CompoundDistribution likelihood = (CompoundDistribution) pluginmap.get("likelihood");
+        if (likelihood == null) {
+            return;
+        }
+        sPartitionNames.clear();
+        possibleContexts.clear();
+        for (Distribution distr : likelihood.pDistributions.get()) {
+            if (distr instanceof GenericTreeLikelihood) {
+                GenericTreeLikelihood treeLikelihood = (GenericTreeLikelihood) distr;
+                alignments.add(treeLikelihood.dataInput.get());
+                PartitionContext context = new PartitionContext(treeLikelihood);
+                sPartitionNames.add(context);
+                boolean found = false;
+                for (PartitionContext context2 : possibleContexts) {
+                    if (context.equals(context2)) {
+                        found = true;
+                    }
+                }
+                if (!found) {
+                    possibleContexts.add(context);
+                }
+            }
+        }
+
+        alignments.clear();
+        for (int i = 0; i < 3; i++) {
+            pPartitionByAlignments[i].clear();
+            pPartition[i].clear();
+            nCurrentPartitions[i].clear();
+        }
+        List<GenericTreeLikelihood> treeLikelihoods = new ArrayList<GenericTreeLikelihood>();
+        for (Distribution distr : likelihood.pDistributions.get()) {
+            if (distr instanceof GenericTreeLikelihood) {
+                GenericTreeLikelihood treeLikelihood = (GenericTreeLikelihood) distr;
+                alignments.add(treeLikelihood.dataInput.get());
+                treeLikelihoods.add(treeLikelihood);
+            }
+        }
+        for (Distribution distr : likelihood.pDistributions.get()) {
+            if (distr instanceof GenericTreeLikelihood) {
+                GenericTreeLikelihood treeLikelihood = (GenericTreeLikelihood) distr;
+                try {
+                    // sync SiteModel, ClockModel and Tree to any changes that
+                    // may have occurred
+                    // this should only affect the clock model in practice
+                    int nPartition = getPartitionNr((BEASTInterface) treeLikelihood.siteModelInput.get());
+                    GenericTreeLikelihood treeLikelihood2 = treeLikelihoods.get(nPartition);
+                    treeLikelihood.siteModelInput.setValue(treeLikelihood2.siteModelInput.get(), treeLikelihood);
+                    nCurrentPartitions[0].add(nPartition);
+
+                    BranchRateModel rateModel = treeLikelihood.branchRateModelInput.get();
+                    if (rateModel != null) {
+                        nPartition = getPartitionNr((BEASTInterface) rateModel);
+                        treeLikelihood2 = treeLikelihoods.get(nPartition);
+                        treeLikelihood.branchRateModelInput.setValue(treeLikelihood2.branchRateModelInput.get(),
+                                treeLikelihood);
+                        nCurrentPartitions[1].add(nPartition);
+                    } else {
+                        nCurrentPartitions[1].add(0);
+                    }
+
+                    nPartition = getPartitionNr((BEASTInterface) treeLikelihood.treeInput.get());
+                    treeLikelihood2 = treeLikelihoods.get(nPartition);
+                    treeLikelihood.treeInput.setValue(treeLikelihood2.treeInput.get(), treeLikelihood);
+                    nCurrentPartitions[2].add(nPartition);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+
+                pPartitionByAlignments[0].add(treeLikelihood);
+                pPartitionByAlignments[1].add(treeLikelihood);
+                pPartitionByAlignments[2].add(treeLikelihood);
+            }
+        }
+
+        int nPartitions = sPartitionNames.size();
+        for (int i = 0; i < 3; i++) {
+            boolean[] bUsedPartition = new boolean[nPartitions];
+            for (int j = 0; j < nPartitions; j++) {
+                int iPartition = nCurrentPartitions[i].get(j);// getPartitionNr(m_pPartitionByAlignments[i].get(j));
+                bUsedPartition[iPartition] = true;
+            }
+            for (int j = 0; j < nPartitions; j++) {
+                if (bUsedPartition[j]) {
+                    pPartition[i].add(pPartitionByAlignments[i].get(j));
+                }
+            }
+        }
+        System.err.println("PARTITIONS0:\n");
+        System.err.println(Arrays.toString(nCurrentPartitions));
+    }
+
+    int getPartitionNr(String partition, int partitionID) {
+        for (int i = 0; i < sPartitionNames.size(); i++) {
+            PartitionContext context = sPartitionNames.get(i);
+            switch (partitionID) {
+                case ALIGNMENT_PARTITION:
+                    if (context.partition.equals(partition)) {
+                        return i;
+                    }
+                    break;
+                case SITEMODEL_PARTITION:
+                    if (context.siteModel.equals(partition)) {
+                        return i;
+                    }
+                    break;
+                case CLOCKMODEL_PARTITION:
+                    if (context.clockModel.equals(partition)) {
+                        return i;
+                    }
+                    break;
+                case TREEMODEL_PARTITION:
+                    if (context.tree.equals(partition)) {
+                        return i;
+                    }
+                    break;
+            }
+        }
+        return -1;
+    }
+
+    int getPartitionNr(BEASTInterface plugin) {
+        String ID = plugin.getID();
+        String partition = ID;
+        if (ID.indexOf('.') >= 0) {
+            partition = ID.substring(ID.indexOf('.') + 1);
+        }
+        int partitionID = ALIGNMENT_PARTITION;
+        if (ID.indexOf(':') >= 0) {
+            char c = ID.charAt(ID.length() - partition.length());
+            switch (c) {
+                case 's':
+                    partitionID = SITEMODEL_PARTITION;
+                    break;
+                case 'c':
+                    partitionID = CLOCKMODEL_PARTITION;
+                    break;
+                case 't':
+                    partitionID = TREEMODEL_PARTITION;
+                    break;
+            }
+            partition = partition.substring(partition.indexOf(':') + 1);
+        }
+        return getPartitionNr(partition, partitionID);
+    }
+
+    public List<BEASTInterface> getPartitions(String sType) {
+        if (sType == null) {
+            return pPartition[2];
+        }
+        if (sType.contains("Partitions")) {
+            List<BEASTInterface> plugins = new ArrayList<BEASTInterface>();
+            plugins.addAll(alignments);
+            return plugins;
+        }
+        if (sType.contains("SiteModel")) {
+            return pPartition[0];
+        }
+        if (sType.contains("ClockModel")) {
+            return pPartition[1];
+        }
+        return pPartition[2];
+    }
+
+    public void setCurrentPartition(int iCol, int iRow, String sPartition) {
+        int nCurrentPartion = getPartitionNr(sPartition, iCol);
+        nCurrentPartitions[iCol].set(iRow, nCurrentPartion);
+    }
+
+    @Override
+    public Object createInput(BEASTInterface plugin, Input<?> input, PartitionContext context) {
+        for (BeautiSubTemplate template : beautiConfig.subTemplates) {
+            try {
+                if (input.canSetValue(template.instance, plugin)) {
+                    String sPartition = plugin.getID();
+                    sPartition = parsePartition(sPartition);
+                    Object o = template.createSubNet(context, plugin, input, true);
+                    return o;
+                }
+            } catch (Exception e) {
+                // ignore, cannot set value
+            }
+        }
+        return null;
+    }
+
+    private void warning(String s) {
+        if (Boolean.valueOf(System.getProperty("beast.debug"))) {
+            System.err.print(s);
+        }
+    }
+
+    public boolean isExpertMode() {
+        return isExpertMode;
+    }
+
+    public void setExpertMode(boolean expertMode) {
+        isExpertMode = expertMode;
+    }
+
+    static public String parsePartition(String sID) {
+        String sPartition = sID.substring(sID.indexOf('.') + 1);
+        if (sPartition.indexOf(':') >= 0) {
+            sPartition = sPartition.substring(sPartition.indexOf(':') + 1);
+        }
+        return sPartition;
+    }
+
+    /**
+     * Create a deep copy of a plugin, but in a different partition context
+     * First, find all plugins that are predecesors of the plugin to be copied
+     * that are ancestors of statenodes
+     *
+     * @param plugin
+     * @param parent
+     * @return
+     * @throws Exception
+     */
+    static public BEASTInterface deepCopyPlugin(BEASTInterface plugin, BEASTInterface parent, MCMC mcmc,
+                                             PartitionContext partitionContext, BeautiDoc doc, List<BEASTInterface> tabooList)
+            throws Exception {
+        /** taboo = list of plugins that should not be copied **/
+        Set<BEASTInterface> taboo = new HashSet<BEASTInterface>();
+        taboo.add(parent);
+        // add state
+        taboo.add(mcmc.startStateInput.get());
+        // add likelihood and prior
+        if (mcmc.posteriorInput.get() instanceof CompoundDistribution) {
+            for (Distribution distr : ((CompoundDistribution) mcmc.posteriorInput.get()).pDistributions.get()) {
+                if (distr instanceof CompoundDistribution) {
+                    taboo.add(distr);
+                }
+            }
+        }
+        // add posterior
+        taboo.add(mcmc.posteriorInput.get());
+        // parent of operators
+        taboo.add(mcmc);
+        // add loggers
+        taboo.addAll(mcmc.loggersInput.get());
+        // add exception for *BEAST logger (perhaps need to be generalised?)
+        if (doc.pluginmap.containsKey("SpeciesTreeLoggerX")) {
+        	taboo.add(doc.pluginmap.get("SpeciesTreeLoggerX"));
+        }
+        // add trees
+        for (StateNode node : mcmc.startStateInput.get().stateNodeInput.get()) {
+            if (node instanceof Tree) {
+                taboo.add(node);
+            }
+        }
+        // add MRCAPriors
+		for (String id : doc.pluginmap.keySet()) {
+			BEASTInterface o = doc.pluginmap.get(id);
+			if (o instanceof MRCAPrior) {
+				taboo.add(o);
+			}
+		}
+        if (tabooList != null) {
+            taboo.addAll(tabooList);
+        }
+
+        // find predecessors of plugin to be copied
+        List<BEASTInterface> predecessors = new ArrayList<BEASTInterface>();
+        collectPredecessors(plugin, predecessors);
+
+        // find ancestors of StateNodes that are predecessors + the plugin
+        // itself
+        Set<BEASTInterface> ancestors = new HashSet<BEASTInterface>();
+        collectAncestors(plugin, ancestors, taboo);
+		System.out.print(Arrays.toString(ancestors.toArray()));
+        for (BEASTInterface plugin2 : predecessors) {
+            if (plugin2 instanceof StateNode) {
+                Set<BEASTInterface> ancestors2 = new HashSet<BEASTInterface>();
+                collectAncestors(plugin2, ancestors2, taboo);
+                ancestors.addAll(ancestors2);
+            } else if (plugin2 instanceof Alignment || plugin2 instanceof FilteredAlignment) {
+                for (Object output : plugin2.getOutputs()) {
+                    if (!taboo.contains(output)) {
+                        Set<BEASTInterface> ancestors2 = new HashSet<BEASTInterface>();
+                        collectAncestors((BEASTInterface)output, ancestors2, taboo);
+                        ancestors.addAll(ancestors2);
+                    }
+                }
+            }
+        }
+
+//		System.out.print(Arrays.toString(predecessors.toArray()));
+//		for (Plugin p : ancestors) {
+//			System.out.print("(");
+//			for (Plugin p2 : p.listActivePlugins()) {
+//				if (ancestors.contains(p2)) {
+//					System.out.print(p2.getID()+ " ");
+//				}
+//			}
+//			System.out.print(") ");
+//			System.out.println(p.getID());
+//		}
+
+        // now the ancestors contain all plugins to be copied
+        // make a copy of all individual Pluings, before connecting them up
+        Map<String, BEASTInterface> copySet = new HashMap<>();
+        for (BEASTInterface plugin2 : ancestors) {
+            String id = plugin2.getID();
+            String copyID = renameId(id, partitionContext);
+            if (!id.equals(copyID)) {
+	            if (doc.pluginmap.containsKey(copyID)) {
+	            	BEASTInterface org = doc.pluginmap.get(copyID);
+	                copySet.put(id, org);
+	            } else {
+	            	BEASTInterface copy = (BEASTInterface) plugin2.getClass().newInstance();
+	            	copy.setID(copyID);
+	                copySet.put(id, copy);
+	            }
+            }
+			System.err.println("Copy: " + id + " -> " + copyID);
+        }
+
+        // set all inputs of copied plugins + outputs to taboo
+		for (BEASTInterface plugin2 : ancestors) {
+            String id = plugin2.getID();
+            BEASTInterface copy = copySet.get(id);
+            if (copy != null) {
+            System.err.println("Processing: " + id + " -> " + copy.getID());
+            // set inputs
+            for (Input<?> input : plugin2.listInputs()) {
+                if (input.get() != null) {
+                    if (input.get() instanceof List) {
+                        // handle lists
+                    	//((List)copy.getInput(input.getName())).clear();
+                        for (Object o : (List<?>) input.get()) {
+                            if (o instanceof BEASTInterface) {
+                            	BEASTInterface value = getCopyValue((BEASTInterface) o, copySet, partitionContext, doc);
+                                copy.setInputValue(input.getName(), value);
+                            } else {
+                                // it is a primitive value
+                            	
+                            	if (copy instanceof Parameter.Base && input.getName().equals("value")) {
+                            	//	// prevent appending to parameter values
+                            		Parameter.Base p = ((Parameter.Base) copy);
+                            		((List) p.valuesInput.get()).clear();
+                            	}
+                                copy.setInputValue(input.getName(), input.get());
+                            }
+                        }
+                    } else if (input.get() instanceof BEASTInterface) {
+                        // handle Plugin
+                    	BEASTInterface value = getCopyValue((BEASTInterface) input.get(), copySet, partitionContext, doc);
+                        copy.setInputValue(input.getName(), value);
+                    } else {
+                        // it is a primitive value
+                        copy.setInputValue(input.getName(), input.get());
+                    }
+                }
+            }
+
+            // set outputs
+            for (Object output : plugin2.getOutputs()) {
+                if (taboo.contains(output) && output != parent) {
+                	BEASTInterface output2 = getCopyValue((BEASTInterface)output, copySet, partitionContext, doc);
+                    for (Input<?> input : ((BEASTInterface)output).listInputs()) {
+                        // do not add state node initialisers automatically
+                        if (input.get() instanceof List &&
+                                // do not update state node initialisers
+                                !(taboo.contains(output2) && input.getName().equals("init"))) {
+                            List<?> list = (List<?>) input.get();
+                            if (list.contains(plugin2)) {
+                            	List<?> list2 = (List<?>)output2.getInput(input.getName()).get();
+                            	if (!list2.contains(copy)) {
+                            		output2.setInputValue(input.getName(), copy);
+                            	}
+                            }
+                        }
+                    }
+
+                }
+            }
+
+            copySet.put(id, copy);
+    		//System.err.println(base.operatorsAsString());
+            }
+        }
+
+		// deep copy must be obtained from copyset, before sorting
+        // since the sorting changes (deletes items) from the copySet map
+        BEASTInterface deepCopy = copySet.get(plugin.getID());
+
+        // first need to sort copySet by topology, before we can initAndValidate
+        // them
+        List<BEASTInterface> sorted = new ArrayList<BEASTInterface>();
+        Collection<BEASTInterface> values = copySet.values();
+        while (values.size() > 0) {
+            for (BEASTInterface copy : values) {
+                boolean found = false;
+                for (BEASTInterface plugin2 : copy.listActivePlugins()) {
+                    if (values.contains(plugin2)) {
+                        found = true;
+                        break;
+                    }
+                }
+                if (!found) {
+                    sorted.add(copy);
+                }
+            }
+            values.remove(sorted.get(sorted.size() - 1));
+        }
+        // initialise copied plugins
+        Set<BEASTInterface> done = new HashSet<BEASTInterface>();
+        for (BEASTInterface copy : sorted) {
+            try {
+                if (!done.contains(copy)) {
+                    copy.initAndValidate();
+                    done.add(copy);
+                }
+            } catch (Exception e) {
+                // ignore
+                System.err.print(e.getMessage());
+            }
+            if (doc != null) {
+                doc.addPlugin(copy);
+            }
+        }
+
+        doc.scrubAll(true, false);
+        return deepCopy;
+    } // deepCopyPlugin
+
+    private static BEASTInterface getCopyValue(BEASTInterface value, Map<String, BEASTInterface> copySet, PartitionContext partitionContext, BeautiDoc doc) {
+        if (copySet.containsKey(value.getID())) {
+            value = copySet.get(value.getID());
+            return value;
+        }
+        String valueID = value.getID();
+        if (valueID == null) {
+            return value;
+        }
+        if (valueID.indexOf('.') >= 0) {
+            String valueCopyID = renameId(valueID, partitionContext);
+            if (doc.pluginmap.containsKey(valueCopyID)) {
+                value = doc.pluginmap.get(valueCopyID);
+            }
+        } else if (doc.pluginmap.get(valueID) instanceof Alignment || doc.pluginmap.get(valueID) instanceof FilteredAlignment) {
+            return doc.pluginmap.get(partitionContext.partition);
+        }
+        return value;
+    }
+
+    public static String renameId(String sID, PartitionContext context) {
+        String sOldPartition = sID.substring(sID.indexOf('.') + 1);
+        String sNewPartition = null;
+        if (sOldPartition.indexOf(':') >= 0) {
+            char c = sOldPartition.charAt(0);
+            switch (c) {
+                case 's':
+                    sNewPartition = context.siteModel;
+                    break;
+                case 'c':
+                    sNewPartition = context.clockModel;
+                    break;
+                case 't':
+                    sNewPartition = context.tree;
+                    break;
+            }
+            sOldPartition = sOldPartition.substring(sOldPartition.indexOf(':') + 1);
+        } else {
+            sNewPartition = context.partition;
+        }
+        sID = sID.substring(0, sID.length() - sOldPartition.length()) + sNewPartition;
+        return sID;
+    }
+
+    static public void collectPredecessors(BEASTInterface plugin, List<BEASTInterface> predecessors) {
+        predecessors.add(plugin);
+        if (plugin instanceof Alignment || plugin instanceof FilteredAlignment) {
+            return;
+        }
+        try {
+            for (BEASTInterface plugin2 : plugin.listActivePlugins()) {
+                if (!predecessors.contains(plugin2)) {
+                    collectPredecessors(plugin2, predecessors);
+                }
+            }
+        } catch (IllegalArgumentException e) {
+            e.printStackTrace();
+        } catch (IllegalAccessException e) {
+            e.printStackTrace();
+        }
+    }
+
+    static public void collectAncestors(BEASTInterface plugin, Set<BEASTInterface> ancestors, Set<BEASTInterface> tabu) {
+        if ((plugin instanceof GenericTreeLikelihood) || (plugin instanceof BeautiPanelConfig)) {
+            return;
+        }
+        ancestors.add(plugin);
+        try {
+            for (Object plugin2 : plugin.getOutputs()) {
+                if (!ancestors.contains(plugin2) && !tabu.contains(plugin2)) {
+                    collectAncestors((BEASTInterface)plugin2, ancestors, tabu);
+                }
+            }
+        } catch (IllegalArgumentException e) {
+            e.printStackTrace();
+        }
+    }
+
+    public void renamePartition(int partitionID, String oldName, String newName) throws Exception {
+        System.err.println("renamePartition: " + partitionID + " " + oldName + " " + newName);
+        // sanity check: make sure newName is not already in use by another partition
+        String newsuffix = null;
+        switch (partitionID) {
+            case ALIGNMENT_PARTITION:
+                newsuffix = "." + newName;
+                break;
+            case SITEMODEL_PARTITION:
+                newsuffix = ".s:" + newName;
+                break;
+            case CLOCKMODEL_PARTITION:
+                newsuffix = ".c:" + newName;
+                break;
+            case TREEMODEL_PARTITION:
+                newsuffix = ".t:" + newName;
+                break;
+            default:
+                throw new IllegalArgumentException();
+        }
+        for (BEASTInterface plugin : pluginmap.values()) {
+            if (plugin.getID().endsWith(newsuffix)) {
+                throw new Exception("Name " + newName + " is already in use");
+            }
+        }
+
+        // do the renaming
+        String oldsuffix = null;
+        switch (partitionID) {
+            case ALIGNMENT_PARTITION:
+                oldsuffix = "." + oldName;
+                break;
+            case SITEMODEL_PARTITION:
+                oldsuffix = ".s:" + oldName;
+                break;
+            case CLOCKMODEL_PARTITION:
+                oldsuffix = ".c:" + oldName;
+                break;
+            case TREEMODEL_PARTITION:
+                oldsuffix = ".t:" + oldName;
+                break;
+            default:
+                throw new IllegalArgumentException();
+        }
+        for (BEASTInterface plugin : pluginmap.values()) {
+            if (plugin.getID().endsWith(oldsuffix)) {
+                String sID = plugin.getID();
+                sID = sID.substring(0, sID.indexOf(oldsuffix)) + newsuffix;
+                plugin.setID(sID);
+            }
+        }
+        if (partitionID == ALIGNMENT_PARTITION) {
+            // make exception for renaming alignment: its ID does not contain a dot
+            for (BEASTInterface plugin : pluginmap.values()) {
+                if (plugin.getID().equals(oldName)) {
+                    plugin.setID(newName);
+                }
+            }
+        }
+
+        // update plugin map
+        String[] keyset = pluginmap.keySet().toArray(new String[0]);
+        for (String key : keyset) {
+            if (key.endsWith(oldsuffix)) {
+            	BEASTInterface plugin = pluginmap.remove(key);
+                key = key.substring(0, key.indexOf(oldsuffix)) + newsuffix;
+                pluginmap.put(key, plugin);
+            }
+        }
+
+        // update tip text map
+        keyset = tipTextMap.keySet().toArray(new String[0]);
+        for (String key : keyset) {
+            if (key.endsWith(oldsuffix)) {
+                String tip = tipTextMap.remove(key);
+                key = key.substring(0, key.indexOf(oldsuffix)) + newsuffix;
+                tip = tip.replaceAll(oldsuffix, newsuffix);
+                tipTextMap.put(key, tip);
+            }
+        }
+
+        // update partition name table
+        determinePartitions();
+    } // renamePartition
+
+    public PartitionContext getContextFor(BEASTInterface plugin) {
+        String sID = plugin.getID();
+        String sPartition = sID.substring(sID.indexOf('.') + 1);
+
+        int partitionID = ALIGNMENT_PARTITION;
+        if (sPartition.indexOf(':') >= 0) {
+            char c = sPartition.charAt(0);
+            switch (c) {
+                case 's':
+                    partitionID = SITEMODEL_PARTITION;
+                    break;
+                case 'c':
+                    partitionID = CLOCKMODEL_PARTITION;
+                    break;
+                case 't':
+                    partitionID = TREEMODEL_PARTITION;
+                    break;
+            }
+            sPartition = parsePartition(sID);
+        }
+
+        for (PartitionContext context : sPartitionNames) {
+            switch (partitionID) {
+                case ALIGNMENT_PARTITION:
+                    if (context.partition.equals(sPartition)) {
+                        return context;
+                    }
+                    break;
+                case SITEMODEL_PARTITION:
+                    if (context.siteModel.equals(sPartition)) {
+                        return context;
+                    }
+                    break;
+                case CLOCKMODEL_PARTITION:
+                    if (context.clockModel.equals(sPartition)) {
+                        return context;
+                    }
+                    break;
+                case TREEMODEL_PARTITION:
+                    if (context.tree.equals(sPartition)) {
+                        return context;
+                    }
+                    break;
+                default:
+                    // should never get here, unless template contains .X$(n) where X is not 'c', 't', or 's'
+                    return null;
+            }
+        }
+        return new PartitionContext(sPartition);
+    }
+
+
+    // methods for dealing with linking
+    void determineLinks() {
+        if (!bAllowLinking) {
+            return;
+        }
+        linked.clear();
+        for (BEASTInterface plugin : posteriorPredecessors) {
+            Map<String, Integer> outputIDs = new HashMap<String, Integer>();
+            for (Object output : plugin.getOutputs()) {
+                if (posteriorPredecessors.contains(output)) {
+                    String sID = ((BEASTInterface)output).getID();
+                    if (sID.indexOf('.') >= 0) {
+                        sID = sID.substring(0, sID.indexOf('.'));
+                        if (outputIDs.containsKey(sID)) {
+                            outputIDs.put(sID, outputIDs.get(sID) + 1);
+                        } else {
+                            outputIDs.put(sID, 1);
+                        }
+                    }
+                }
+            }
+            for (Object output : plugin.getOutputs()) {
+                if (posteriorPredecessors.contains(output)) {
+                    String sID = ((BEASTInterface)output).getID();
+                    if (sID.indexOf('.') >= 0) {
+                        sID = sID.substring(0, sID.indexOf('.'));
+                        if (outputIDs.get(sID) > 1) {
+                            addLink((BEASTInterface)plugin, (BEASTInterface)output);
+                        }
+                    }
+                }
+            }
+            // add parameters that have more than 1 outputs into susbtitution models
+            if (plugin instanceof Parameter<?>) {
+                for (Object output : plugin.getOutputs()) {
+                    if (posteriorPredecessors.contains(output)) {
+                        if (output instanceof SubstitutionModel) {
+                            int nrOfSubstModelsInOutput = 0;
+                            try {
+                                for (Input<?> input : ((BEASTInterface)output).listInputs()) {
+                                    if (input.get() != null && input.get().equals(plugin)) {
+                                        nrOfSubstModelsInOutput++;
+                                    }
+                                }
+                            } catch (Exception e) {
+                                // ignore
+                            }
+                            if (nrOfSubstModelsInOutput > 1) {
+                                addLink((BEASTInterface)plugin, (BEASTInterface)output);
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+        bHasLinkedAtLeastOnce = false;
+        for (Input<?> input : linked) {
+            if (input.getType().isAssignableFrom(RealParameter.class)) {
+                bHasLinkedAtLeastOnce = true;
+                break;
+            }
+        }
+    }
+
+    void addLink(BEASTInterface from, BEASTInterface to) {
+        try {
+            for (Input<?> input : to.listInputs()) {
+                if (input.get() instanceof BEASTInterface) {
+                    if (input.get() == from) {
+                        linked.add(input);
+                        return;
+                    }
+                }
+                // does it make sense to link list inputs?
+//				if (input.get() instanceof List<?>) {
+//					for (Object o : (List<?>) input.get()) {
+//						if (o instanceof Plugin) {
+//							if (o == from) {
+//								addLink(input);
+//								return;
+//							}
+//						}
+//					}
+//				}
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    public void addLink(Input<?> input) {
+        linked.add(input);
+        bHasLinkedAtLeastOnce = true;
+    }
+
+    public void deLink(Input<?> input) {
+        linked.remove(input);
+    }
+
+    public boolean isLinked(Input<?> input) {
+        return linked.contains(input);
+    }
+
+    /**
+     * return all RealParameters that have
+     * the same ID in another partition, or
+     * the same partition with the same substitution model as output
+     *
+     * @param plugin
+     * @return
+     */
+    public List<BEASTInterface> suggestedLinks(BEASTInterface plugin) {
+        String sID = plugin.getID();
+        List<BEASTInterface> list = new ArrayList<BEASTInterface>();
+        String partitionID = null;
+        if (sID.indexOf('.') >= 0) {
+            partitionID = sID.substring(sID.indexOf('.') + 1);
+            sID = sID.substring(0, sID.indexOf('.'));
+        } else {
+            return list;
+        }
+        for (BEASTInterface candidate : posteriorPredecessors) {
+            String sID2 = candidate.getID();
+            if (sID2.indexOf('.') >= 0) {
+                String partitionID2 = sID2.substring(sID2.indexOf('.') + 1);
+                sID2 = sID2.substring(0, sID2.indexOf('.'));
+                if (sID2.equals(sID)) {
+                    list.add(candidate);
+                }
+                if (plugin instanceof Parameter<?> &&
+                        partitionID2.equals(partitionID) &&
+                        candidate.getClass().equals(plugin.getClass())) {
+                    boolean dimensionMatches = true;
+                    if (((Parameter<?>) plugin).getDimension() != ((Parameter<?>) candidate).getDimension()) {
+                        dimensionMatches = false;
+                    }
+                    // ensure they share an output
+                    boolean foundCommonOutput = false;
+                    for (Object out1 : plugin.getOutputs()) {
+                        for (Object out2 : candidate.getOutputs()) {
+                            if (out1 == out2 && out1 instanceof SubstitutionModel) {
+                                foundCommonOutput = true;
+                                break;
+                            }
+                        }
+                    }
+                    if (dimensionMatches && foundCommonOutput) {
+                        list.add(candidate);
+                    }
+                }
+            }
+        }
+        list.remove(plugin);
+        return list;
+    }
+
+    public BEASTInterface getUnlinkCandidate(Input<?> input, BEASTInterface parent) throws Exception {
+        PartitionContext context = getContextFor(parent);
+        BEASTInterface plugin = deepCopyPlugin((BEASTInterface) input.get(), parent, (MCMC) mcmc.get(), context, this, null);
+        return plugin;
+    }
+
+    public void setBeauti(Beauti beauti) {
+        this.beauti = beauti;
+    }
+
+    public JFrame getFrame() {
+        return beauti.frame;
+    }
+
+    @Override
+    public void initAndValidate() throws Exception {
+    }
+
+    /** create taxonset, one taxon for each sequence in the alignment
+     * and assign taxonset to the alignment 
+     * **/
+    static void createTaxonSet(Alignment a, BeautiDoc doc) {
+		List<String> taxaNames = a.getTaxaNames();
+		TaxonSet taxonset = new TaxonSet();
+        for (final String taxaName : taxaNames) {
+        	taxonset.taxonsetInput.get().add(doc.getTaxon(taxaName));
+        }
+        taxonset.setID("TaxonSet0." + a.getID());
+        try {
+			taxonset.initAndValidate();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		doc.registerPlugin(taxonset);
+	}
+
+    /** create Taxon with given name, reuse if a taxon 
+     *  with this name already exists
+     **/
+	public Taxon getTaxon(String taxaName) {
+    	if (taxaset.keySet().contains(taxaName)) {
+    		return taxaset.get(taxaName);
+    	} else {
+    		try {
+    			Taxon taxon = new Taxon(taxaName);
+    			registerPlugin(taxon);
+    			return taxon;
+    		} catch (Exception e) {
+    			e.printStackTrace();
+    		}
+    	}
+		return null;
+	}
+
+
+} // class BeautiDoc
diff --git a/src/beast/app/beauti/BeautiDocListener.java b/src/beast/app/beauti/BeautiDocListener.java
new file mode 100644
index 0000000..871059c
--- /dev/null
+++ b/src/beast/app/beauti/BeautiDocListener.java
@@ -0,0 +1,9 @@
+package beast.app.beauti;
+
+/**
+ * @author Andrew Rambaut
+ * @version $Id$
+ */
+public interface BeautiDocListener {
+    void docHasChanged() throws Exception;
+}
diff --git a/src/beast/app/beauti/BeautiLauncher.java b/src/beast/app/beauti/BeautiLauncher.java
new file mode 100644
index 0000000..90549b9
--- /dev/null
+++ b/src/beast/app/beauti/BeautiLauncher.java
@@ -0,0 +1,23 @@
+package beast.app.beauti;
+
+
+import beast.app.beastapp.BeastLauncher;
+import beast.app.util.Utils6;
+
+/** 
+ * Loads beast.jar and launches BEAUti through the Beauti class
+ * 
+ * This class should be compiled against 1.6 and packaged by itself. 
+ * The remained of BEAST can be compiled against Java 1.8
+ * **/
+public class BeautiLauncher extends BeastLauncher {
+
+	public static void main(String[] args) throws Exception {
+		Utils6.startSplashScreen();
+		if (javaVersionCheck("BEAUti")) {
+			loadBEASTJars();
+			Beauti.main(args);
+		}
+        Utils6.endSplashScreen();
+	}
+}
diff --git a/src/beast/app/beauti/BeautiPanel.java b/src/beast/app/beauti/BeautiPanel.java
new file mode 100644
index 0000000..bcc4e3a
--- /dev/null
+++ b/src/beast/app/beauti/BeautiPanel.java
@@ -0,0 +1,463 @@
+package beast.app.beauti;
+
+import beast.app.beauti.BeautiPanelConfig.Partition;
+import beast.app.draw.InputEditor;
+import beast.app.draw.InputEditor.ExpandOption;
+import beast.app.util.Utils;
+import beast.core.BEASTInterface;
+import beast.core.Input;
+import beast.core.MCMC;
+import beast.core.util.CompoundDistribution;
+import beast.evolution.alignment.Taxon;
+import beast.evolution.branchratemodel.BranchRateModel;
+import beast.evolution.likelihood.GenericTreeLikelihood;
+import beast.evolution.sitemodel.SiteModel;
+import beast.evolution.sitemodel.SiteModelInterface;
+import beast.evolution.tree.TreeInterface;
+
+import javax.swing.*;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+
+import java.awt.*;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * panel making up each of the tabs in Beauti *
+ */
+public class BeautiPanel extends JPanel implements ListSelectionListener {
+
+    private static final long serialVersionUID = 1L;
+    public final static String ICONPATH = "beast/app/beauti/";
+
+    static int partitionListPreferredWidth = 120;
+
+    private JSplitPane splitPane;
+
+    /**
+     * document that this panel applies to *
+     */
+    BeautiDoc doc;
+
+    public BeautiDoc getDoc() {
+        return doc;
+    }
+
+    /**
+     * configuration for this panel *
+     */
+    public BeautiPanelConfig config;
+
+    /**
+     * panel number *
+     */
+    int iPanel;
+
+    /**
+     * partition currently on display *
+     */
+    public int iPartition = 0;
+
+    /**
+     * box containing the list of partitions, to make (in)visible on update *
+     */
+    JComponent partitionComponent;
+    /**
+     * list of partitions in m_listBox *
+     */
+    JList listOfPartitions;
+    /**
+     * model for m_listOfPartitions *
+     */
+    DefaultListModel listModel;
+
+    JScrollPane scroller;
+
+    /**
+     * component containing main input editor *
+     */
+    Component centralComponent = null;
+
+    public BeautiPanel() {
+    }
+
+    public BeautiPanel(int iPanel, BeautiDoc doc, BeautiPanelConfig config) throws Exception {
+        this.doc = doc;
+        this.iPanel = iPanel;
+
+        setLayout(new BorderLayout());
+
+        this.config = config;
+        if (this.config.hasPartition() != Partition.none &&
+                doc.getPartitions(config.bHasPartitionsInput.get().toString()).size() > 1) {
+            splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
+            add(splitPane,BorderLayout.CENTER);
+        } else {
+            splitPane = null;
+        }
+
+        refreshPanel();
+        addPartitionPanel(this.config.hasPartition(), iPanel);
+
+        setOpaque(false);
+    } // c'tor
+
+    void addPartitionPanel(Partition bHasPartition, int iPanel) {
+        Box box = Box.createVerticalBox();
+        if (splitPane != null && bHasPartition != Partition.none) {
+            box.add(createList());
+        } else {
+            return;
+        }
+        box.add(Box.createVerticalGlue());
+        box.add(new JLabel(Utils.getIcon(iPanel, config)));
+
+        splitPane.add(box, JSplitPane.LEFT);
+        if (listOfPartitions != null) {
+            listOfPartitions.setSelectedIndex(iPartition);
+        }
+    }
+
+    /**
+     * Create a list of partitions and return as a JComponent;
+     * @return
+     */
+    JComponent createList() {
+        partitionComponent = new JPanel();
+        partitionComponent.setLayout(new BorderLayout());
+        JLabel partitionLabel = new JLabel("Partition");
+        partitionLabel.setHorizontalAlignment(JLabel.CENTER);
+        partitionComponent.add(partitionLabel, BorderLayout.NORTH);
+        listModel = new DefaultListModel();
+        listOfPartitions = new JList(listModel);
+        listOfPartitions.setName("listOfPartitions");
+        listOfPartitions.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
+
+        Dimension size = new Dimension(partitionListPreferredWidth, 300);
+        //listOfPartitions.setFixedCellWidth(120);
+//    	m_listOfPartitions.setSize(size);
+        //listOfPartitions.setPreferredSize(size);
+    	listOfPartitions.setMinimumSize(size);
+//    	m_listOfPartitions.setBounds(0, 0, 100, 100);
+
+        listOfPartitions.addListSelectionListener(this);
+        updateList();
+
+        // AJD: This is unnecessary and not appropriate for Mac OS X look and feel
+        //listOfPartitions.setBorder(new BevelBorder(BevelBorder.RAISED));
+
+        JScrollPane listPane = new JScrollPane(listOfPartitions);
+        partitionComponent.add(listPane, BorderLayout.CENTER);
+        // AJD: This is unnecessary and not appropriate for Mac OS X look and feel
+        //partitionComponent.setBorder(new EtchedBorder());
+        return partitionComponent;
+    }
+
+    public void updateList() {
+        if (listModel == null) {
+            return;
+        }
+        listModel.clear();
+        if (listModel.size() > 0) {
+            // this is a weird bit of code, since listModel.clear should ensure that size()==0, but it doesn't
+            return;
+        }
+        String type = config.bHasPartitionsInput.get().toString();
+        for (BEASTInterface partition : doc.getPartitions(type)) {
+        	if (type.equals("SiteModel")) {
+        		partition = (BEASTInterface) ((GenericTreeLikelihood) partition).siteModelInput.get();
+        	} else if (type.equals("ClockModel")) {
+        		partition = (BEASTInterface) ((GenericTreeLikelihood) partition).branchRateModelInput.get();
+        	} else if (type.equals("Tree")) {
+        		partition = (BEASTInterface) ((GenericTreeLikelihood) partition).treeInput.get();
+        	}
+            String sPartition = partition.getID();
+            sPartition = sPartition.substring(sPartition.lastIndexOf('.') + 1);
+            if (sPartition.length() > 1 && sPartition.charAt(1) == ':') {
+            	sPartition = sPartition.substring(2);
+            }
+            listModel.addElement(sPartition);
+        }
+        if (iPartition >= 0 && listModel.size() > 0)
+            listOfPartitions.setSelectedIndex(iPartition);
+    }
+
+    
+
+    // AR remove globals (doesn't seem to be used anywhere)...
+//	static BeautiPanel g_currentPanel = null;
+
+    public void refreshPanel() throws Exception {
+        if (doc.alignments.size() == 0) {
+            refreshInputPanel();
+            return;
+        }
+        doc.scrubAll(true, false);
+
+        // toggle splitpane
+        if (splitPane == null && config.hasPartition() != Partition.none &&
+                doc.getPartitions(config.bHasPartitionsInput.get().toString()).size() > 1) {
+            splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
+            add(splitPane,BorderLayout.CENTER);
+            addPartitionPanel(config.hasPartition(), iPanel);
+        }
+        if (splitPane != null && (config.hasPartition() == Partition.none ||
+                doc.getPartitions(config.bHasPartitionsInput.get().toString()).size() <= 1)) {
+            remove(splitPane);
+            splitPane = null;
+        }
+
+        refreshInputPanel();
+        if (partitionComponent != null && config.getType() != null) {
+            partitionComponent.setVisible(doc.getPartitions(config.getType()).size() > 1);
+        }
+
+//		g_currentPanel = this;
+    }
+    
+    void refreshInputPanel(BEASTInterface plugin, Input<?> input, boolean bAddButtons, InputEditor.ExpandOption bForceExpansion) throws Exception {
+        if (centralComponent != null) {
+            remove(centralComponent);
+        }
+        if (input != null && input.get() != null && input.getType() != null) {
+            InputEditor.ButtonStatus bs = config.buttonStatusInput.get();
+            InputEditor inputEditor = doc.getInputEditorFactory().createInputEditor(input, plugin, bAddButtons, bForceExpansion, bs, null, doc);
+
+            JPanel p = new JPanel();
+            p.setLayout(new BorderLayout());
+            if (isToClone()) {
+                ClonePartitionPanel clonePartitionPanel = new ClonePartitionPanel(this);
+                p.add(clonePartitionPanel, BorderLayout.NORTH);
+            } else {
+                p.add(inputEditor.getComponent(), BorderLayout.CENTER);
+            }
+
+            Rectangle bounds = new Rectangle(0,0);
+            if (scroller != null) {
+            	// get lastPaintPosition from viewport
+            	// HACK access it through its string representation
+	            JViewport v = scroller.getViewport();
+	            String vs = v.toString();
+	            int i = vs.indexOf("lastPaintPosition=java.awt.Point[x=");
+	            if (i > -1) {
+	            	i = vs.indexOf("y=", i);
+	            	vs = vs.substring(i+2, vs.indexOf("]", i));
+	            	i = Integer.parseInt(vs);
+	            } else {
+	            	i = 0;
+	            }
+	            bounds.y = -i;
+            }
+            scroller = new JScrollPane(p);
+            scroller.getViewport().scrollRectToVisible(bounds);
+            centralComponent = scroller;
+        } else {
+            centralComponent = new JLabel("No input editors.");
+        }
+        if (splitPane != null) {
+            JPanel panel = new JPanel();
+            panel.setLayout(new BorderLayout());
+            panel.add(centralComponent, BorderLayout.NORTH);
+            splitPane.add(panel, JSplitPane.RIGHT);
+        } else {
+            add(centralComponent);
+        }
+    }
+
+    void refreshInputPanel() throws Exception {
+        doc.currentInputEditors.clear();
+        InputEditor.Base.g_nLabelWidth = config.nLabelWidthInput.get();
+        BEASTInterface plugin = config;
+        Input<?> input = config.resolveInput(doc, iPartition);
+
+        boolean bAddButtons = config.addButtons();
+        ExpandOption bForceExpansion = config.forceExpansion();
+        refreshInputPanel(plugin, input, bAddButtons, bForceExpansion);
+    }
+
+    /** 
+     * Clones partition identified by sourceID to targetID and type (Site/Clock/Tree model)
+     * as stored in config.
+     * @param sourceID
+     * @param targetID
+     */
+    public void cloneFrom(String sourceID, String targetID) {
+    	if (sourceID.equals(targetID)) {
+    		return;
+    	}
+
+    	String type = config.bHasPartitionsInput.get().toString();
+    	java.util.List<BEASTInterface> list = doc.getPartitions(type);
+    	int iSource = -1, iTarget = -1;
+        for (int i = 0; i < list.size(); i++) {
+        	BEASTInterface partition = list.get(i);
+        	if (type.equals("SiteModel")) {
+        		partition = (BEASTInterface) ((GenericTreeLikelihood) partition).siteModelInput.get();
+        	} else if (type.equals("ClockModel")) {
+        		partition = (BEASTInterface) ((GenericTreeLikelihood) partition).branchRateModelInput.get();
+        	} else if (type.equals("Tree")) {
+        		partition = (BEASTInterface) ((GenericTreeLikelihood) partition).treeInput.get();
+        	}
+            String sPartition = partition.getID();
+            sPartition = sPartition.substring(sPartition.lastIndexOf('.') + 1);
+            if (sPartition.length() > 1 && sPartition.charAt(1) == ':') {
+            	sPartition = sPartition.substring(2);
+            }
+            if (sPartition.equals(sourceID)) {
+            	iSource = i;
+            }
+            if (sPartition.equals(targetID)) {
+            	iTarget = i;
+            }
+        } 
+    	if (iTarget == -1) {
+    		throw new RuntimeException("Programmer error: sourceID and targetID should be in list");
+    	}
+    	
+		CompoundDistribution likelihoods = (CompoundDistribution) doc.pluginmap.get("likelihood");
+		
+		GenericTreeLikelihood likelihoodSource = (GenericTreeLikelihood) likelihoods.pDistributions.get().get(iSource);
+		GenericTreeLikelihood likelihood = (GenericTreeLikelihood) likelihoods.pDistributions.get().get(iTarget);
+		PartitionContext context = doc.getContextFor(likelihood);
+		// this ensures the config.sync does not set any input value
+		config._input.setValue(null, config);
+
+    	if (type.equals("SiteModel")) {		
+			SiteModelInterface siteModelSource = likelihoodSource.siteModelInput.get();
+			SiteModelInterface  siteModel = null;
+			try {
+				siteModel = (SiteModel.Base) BeautiDoc.deepCopyPlugin((BEASTInterface) siteModelSource,
+					likelihood, (MCMC) doc.mcmc.get(), context, doc, null);
+			} catch (Exception e) {
+				JOptionPane.showMessageDialog(this, "Could not clone " + sourceID + " to " + targetID + " " + e.getMessage());
+				return;
+			}
+			likelihood.siteModelInput.setValue(siteModel, likelihood);
+			return;
+    	} else if (type.equals("ClockModel")) {
+    		BranchRateModel clockModelSource = likelihoodSource.branchRateModelInput.get();
+    		BranchRateModel clockModel = null;
+			try {
+				clockModel = (BranchRateModel) BeautiDoc.deepCopyPlugin((BEASTInterface) clockModelSource,
+						likelihood, (MCMC) doc.mcmc.get(), context, doc, null);
+			} catch (Exception e) {
+				JOptionPane.showMessageDialog(this, "Could not clone " + sourceID + " to " + targetID + " " + e.getMessage());
+				return;
+			}
+			// make sure that *if* the clock model has a tree as input, it is
+			// the same as for the likelihood
+			TreeInterface tree = null;
+			try {
+				for (Input<?> input : ((BEASTInterface) clockModel).listInputs()) {
+					if (input.getName().equals("tree")) {
+						tree = (TreeInterface) input.get();
+					}
+
+				}
+			} catch (IllegalArgumentException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			} catch (IllegalAccessException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+			if (tree != null && tree != likelihood.treeInput.get()) {
+				//likelihood.treeInput.setValue(tree, likelihood);
+				JOptionPane.showMessageDialog(null, "Cannot clone clock model with different trees");
+				return;
+			}
+
+			likelihood.branchRateModelInput.setValue(clockModel, likelihood);
+			return;
+    	} else if (type.equals("Tree")) {
+			TreeInterface tree = null;
+			TreeInterface treeSource = likelihoodSource.treeInput.get();
+			try {
+			tree = (TreeInterface) BeautiDoc.deepCopyPlugin((BEASTInterface) treeSource, likelihood,
+							(MCMC) doc.mcmc.get(), context, doc, null);
+				} catch (Exception e) {
+					JOptionPane.showMessageDialog(this, "Could not clone " + sourceID + " to " + targetID + " " + e.getMessage());
+					return;
+			}
+			// sanity check: make sure taxon sets are compatible
+            Taxon.assertSameTaxa(tree.getID(), tree.getTaxonset().getTaxaNames(),
+                    likelihood.dataInput.get().getID(), likelihood.dataInput.get().getTaxaNames());
+
+			likelihood.treeInput.setValue(tree, likelihood);
+			return;
+
+    	} else {
+    		throw new RuntimeException("Programmer error calling cloneFrom: Should only clone Site/Clock/Tree model");
+    	}
+    } // cloneFrom
+
+    private boolean isToClone() {
+        return listOfPartitions != null && listOfPartitions.getSelectedIndices().length > 1;
+    }
+
+//    public static boolean soundIsPlaying = false;
+//
+//    public static synchronized void playSound(final String url) {
+//        new Thread(new Runnable() {
+//            public void run() {
+//                try {
+//                    synchronized (this) {
+//                        if (soundIsPlaying) {
+//                            return;
+//                        }
+//                        soundIsPlaying = true;
+//                    }
+//                    Clip clip = AudioSystem.getClip();
+//                    AudioInputStream inputStream = AudioSystem.getAudioInputStream(getClass().getResourceAsStream("/beast/app/beauti/" + url));
+//                    clip.open(inputStream);
+//                    clip.start();
+//                    Thread.sleep(500);
+//                    synchronized (this) {
+//                        soundIsPlaying = false;
+//                    }
+//                } catch (Exception e) {
+//                    soundIsPlaying = false;
+//                    System.err.println(e.getMessage());
+//                }
+//            }
+//        }).start();
+//    }
+
+    @Override
+    public void valueChanged(ListSelectionEvent e) {
+        //System.err.print("BeautiPanel::valueChanged " + m_iPartition + " => ");
+        if (e != null) {
+            config.sync(iPartition);
+            if (listOfPartitions != null) {
+                iPartition = Math.max(0, listOfPartitions.getSelectedIndex());
+            }
+        }
+//        BeautiPanel.playSound("woosh.wav");
+        //System.err.println(m_iPartition);
+        try {
+            refreshPanel();
+
+            centralComponent.repaint();
+            repaint();
+
+            // hack to ensure m_centralComponent is repainted RRB: is there a better way???
+            if (Frame.getFrames().length == 0) {
+                // happens at startup
+                return;
+            }
+            Frame frame = Frame.getFrames()[Frame.getFrames().length - 1];
+            frame.setSize(frame.getSize());
+            //Frame frame = frames[frames.length - 1];
+//			Dimension size = frames[frames.length-1].getSize();
+//			frames[frames.length-1].setSize(size);
+
+//			m_centralComponent.repaint();
+//			m_centralComponent.requestFocusInWindow();
+            centralComponent.requestFocus();
+        } catch (Exception ex) {
+            ex.printStackTrace();
+        }
+    }
+    
+} // class BeautiPanel
diff --git a/src/beast/app/beauti/BeautiPanelConfig.java b/src/beast/app/beauti/BeautiPanelConfig.java
new file mode 100644
index 0000000..05b5b0b
--- /dev/null
+++ b/src/beast/app/beauti/BeautiPanelConfig.java
@@ -0,0 +1,355 @@
+package beast.app.beauti;
+
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import beast.app.draw.InputEditor;
+import beast.app.draw.BEASTObjectPanel;
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.BEASTObject;
+import beast.core.BEASTInterface;
+import beast.core.Input.Validate;
+
+
+
+
+ at Description("Defines properties for custom panels in Beauti")
+public class BeautiPanelConfig extends BEASTObject {
+    public enum Partition {
+        none, Partition, SiteModel, ClockModel, Tree
+    }
+
+    public Input<String> sNameInput = new Input<String>("panelname", "name of the panel, used to label the panel and in the visibility menu", Validate.REQUIRED);
+    public Input<String> sTipTextInput = new Input<String>("tiptext", "tiptext shown when hovering over the tab", Validate.REQUIRED);
+
+    public Input<String> sPathInput = new Input<String>("path", "path of the Plugin to be shown in this panel, in xpath-like format. " +
+            "For example operator to edit the operator input of the top level run element. " +
+            "distribution/distribution[id='prior'] for prior distributions." +
+            "distribution/distribution[id='posterior']/traitset all posterior inputs with name traitset", Validate.REQUIRED);
+
+    public Input<Partition> bHasPartitionsInput = new Input<Partition>("hasPartitions", "flag to indicate the panel has" +
+            "a partition context (and hence a partition list), deafult none.  Possible values: " + Partition.values(), Partition.none, Partition.values());
+
+    public Input<Boolean> bAddButtonsInput = new Input<Boolean>("addButtons", "flag to indicate buttons should be added, default true", true);
+    public Input<Boolean> bIsVisibleInput = new Input<Boolean>("isVisible", "flag to indicate panel is visible on startup, default true", true);
+
+
+    public Input<String> sIconInput = new Input<String>("icon", "icon shown in the panel relative to /beast/app/beauti, default 0.png", "0.png");
+
+    public Input<InputEditor.ExpandOption> forceExpansionInput = new Input<InputEditor.ExpandOption>("forceExpansion", "whether to expand the input(s)" +
+            "This can be " + Arrays.toString(InputEditor.ExpandOption.values()) + " (default 'FALSE')", InputEditor.ExpandOption.FALSE, InputEditor.ExpandOption.values());
+    public Input<String> sTypeInput = new Input<String>("type", "type used for finding the appropriate plugin editor. By default, type is determined " +
+            "by the input type of the last component of the path");
+
+    public Input<Integer> nLabelWidthInput = new Input<Integer>("labelWidth", "width of labels used to show name of inputs in input editors", 150);
+
+    public Input<InputEditor.ButtonStatus> buttonStatusInput = new Input<InputEditor.ButtonStatus>("buttonStatus", "whether to show add and delete buttons. " +
+            "This can be " + Arrays.toString(InputEditor.ButtonStatus.values()) + " (default 'ALL')", InputEditor.ButtonStatus.ALL, InputEditor.ButtonStatus.values());
+
+    String[] sPathComponents;
+    String[] sConditionalAttribute;
+    String[] sConditionalValue;
+    Class<?> type;
+
+    /**
+     * plugins associated with inputs *
+     */
+    List<BEASTInterface> inputs;
+    /**
+     * plugins associated with inputs before editing starts *
+     */
+    List<BEASTInterface> startInputs;
+    /**
+     * plugins that are parents, i.e. contain inputs of m_inputs *
+     */
+    List<BEASTInterface> parentPlugins;
+    List<Input<?>> parentInputs = new ArrayList<Input<?>>();
+    /**
+     * flag to indicate we are dealing with a list input *
+     */
+    boolean bIsList;
+
+
+    FlexibleInput<?> _input;
+
+    class FlexibleInput<T> extends Input<T> {
+        FlexibleInput() {
+            // sets name to something non-trivial This is used by canSetValue()
+            super("xx", "");
+        }
+
+        public FlexibleInput(T arrayList) {
+            super("xx", "", arrayList);
+        }
+
+        public void setType(Class<?> type) {
+            theClass = type;
+        }
+    }
+
+    @Override
+    public void initAndValidate() throws Exception {
+        sPathComponents = sPathInput.get().split("/");
+        if (sPathComponents[0].equals("")) {
+            sPathComponents = new String[0];
+        }
+        sConditionalAttribute = new String[sPathComponents.length];
+        sConditionalValue = new String[sPathComponents.length];
+        for (int i = 0; i < sPathComponents.length; i++) {
+            int j = sPathComponents[i].indexOf('[');
+            if (j >= 0) {
+                String sConditionalComponents = sPathComponents[i].substring(j + 1, sPathComponents[i].lastIndexOf(']'));
+                String[] sStrs = sConditionalComponents.split("=");
+                sConditionalAttribute[i] = sStrs[0];
+                sConditionalValue[i] = sStrs[1].substring(1, sStrs[1].length() - 1);
+                sPathComponents[i] = sPathComponents[i].substring(0, j);
+            }
+        }
+        inputs = new ArrayList<BEASTInterface>();
+        startInputs = new ArrayList<BEASTInterface>();
+        BEASTObjectPanel.getID(this);
+    }
+
+    /**
+     * more elegant getters for resolving Input values*
+     */
+    public String getName() {
+        return sNameInput.get();
+    }
+
+    public Partition hasPartition() {
+        return bHasPartitionsInput.get();
+    }
+
+    public boolean addButtons() {
+        return false;
+    }
+
+    public String getIcon() {
+        return sIconInput.get();
+    }
+
+    public String getTipText() {
+        return sTipTextInput.get();
+    }
+
+    public InputEditor.ExpandOption forceExpansion() {
+        return forceExpansionInput.get();
+    }
+
+    /**
+     * Find the input associated with this panel
+     * based on the path Input.
+     */
+    @SuppressWarnings("unchecked")
+    public Input<?> resolveInput(BeautiDoc doc, int iPartition) {
+        try {
+//            if (parentPlugins != null && parentPlugins.size() > 0 && _input != null)
+//                System.err.println("sync " + parentPlugins.get(iPartition) + "[?] = " + _input.get());
+
+            List<BEASTInterface> plugins;
+            if (bHasPartitionsInput.get() == Partition.none) {
+                plugins = new ArrayList<BEASTInterface>();
+                plugins.add(doc.mcmc.get());
+            } else {
+                plugins = doc.getPartitions(bHasPartitionsInput.get().toString());
+            }
+            parentPlugins = new ArrayList<BEASTInterface>();
+            parentInputs = new ArrayList<Input<?>>();
+
+            parentPlugins.add(doc);
+            parentInputs.add(doc.mcmc);
+            type = doc.mcmc.getType();
+            bIsList = false;
+            for (int i = 0; i < sPathComponents.length; i++) {
+                List<BEASTInterface> oldPlugins = plugins;
+                plugins = new ArrayList<BEASTInterface>();
+                parentPlugins = new ArrayList<BEASTInterface>();
+                parentInputs = new ArrayList<Input<?>>();
+                for (BEASTInterface plugin : oldPlugins) {
+                    Input<?> namedInput = plugin.getInput(sPathComponents[i]);
+                    type = namedInput.getType();
+                    if (namedInput.get() instanceof List<?>) {
+                        bIsList = true;
+                        List<?> list = (List<?>) namedInput.get();
+                        if (sConditionalAttribute[i] == null) {
+                            for (Object o : list) {
+                                BEASTInterface plugin2 = (BEASTInterface) o;
+                                plugins.add(plugin2);
+                                parentPlugins.add(plugin);
+                                parentInputs.add(namedInput);
+                            }
+                            //throw new Exception ("Don't know which element to pick from the list. List component should come with a condition. " + m_sPathComponents[i]);
+                        } else {
+                            int nMatches = 0;
+                            for (int j = 0; j < list.size(); j++) {
+                                BEASTInterface plugin2 = (BEASTInterface) list.get(j);
+                                if (matches(plugin2, sConditionalAttribute[i], sConditionalValue[i])) {
+                                    plugins.add(plugin2);
+                                    parentPlugins.add(plugin);
+                                    parentInputs.add(namedInput);
+                                    nMatches++;
+                                    break;
+                                }
+                            }
+                            if (nMatches == 0) {
+                                parentInputs.add(namedInput);
+                                parentPlugins.add(plugin);
+                            }
+                        }
+                    } else if (namedInput.get() instanceof BEASTInterface) {
+                        bIsList = false;
+                        if (sConditionalAttribute[i] == null) {
+                            plugins.add((BEASTInterface) namedInput.get());
+                            parentPlugins.add(plugin);
+                            parentInputs.add(namedInput);
+                        } else {
+                            if (matches(plugin, sConditionalAttribute[i], sConditionalValue[i])) {
+//							if ((m_sConditionalAttribute[i].equals("id") && plugin.getID().equals(m_sConditionalValue[i])) ||
+//							    (m_sConditionalAttribute[i].equals("type") && plugin.getClass().getName().equals(m_sConditionalValue[i]))) {
+                                plugins.add(plugin);
+                                parentPlugins.add(plugin);
+                                parentInputs.add(namedInput);
+                            }
+                        }
+                    } else {
+                        throw new Exception("input " + sPathComponents[i] + "  is not a plugin or list");
+                    }
+                }
+            }
+            if (sTypeInput.get() != null) {
+                type = Class.forName(sTypeInput.get());
+            }
+            // sanity check
+            if (!bIsList && (bHasPartitionsInput.get() == Partition.none) && plugins.size() > 1) {
+                System.err.println("WARNING: multiple plugins match, but hasPartitions=none");
+                // this makes sure that all mathing plugins are available in one go
+                bIsList = true;
+                // this suppresses syncing
+                parentInputs.clear();
+            }
+            inputs.clear();
+            startInputs.clear();
+            for (BEASTInterface plugin : plugins) {
+                inputs.add(plugin);
+                startInputs.add(plugin);
+            }
+
+            if (!bIsList) {
+                _input = new FlexibleInput<BEASTInterface>();
+            } else {
+                _input = new FlexibleInput<ArrayList<BEASTInterface>>(new ArrayList<BEASTInterface>());
+            }
+            _input.setRule(Validate.REQUIRED);
+            syncTo(iPartition);
+//            if (parentPlugins != null && parentPlugins.size() > 0)
+//                System.err.println("sync " + parentPlugins.get(iPartition) + "[?] = " + _input.get());
+
+
+            if (bIsList) {
+                checkForDups((List<Object>) _input.get());
+            }
+
+            return _input;
+        } catch (Exception e) {
+            System.err.println("Warning: could not find objects in path " + Arrays.toString(sPathComponents));
+        }
+        return null;
+    } // resolveInputs
+
+    private void checkForDups(List<Object> list) {
+        for (int i = 0; i < list.size(); i++) {
+            if (list.lastIndexOf(list.get(i)) != i) {
+                System.err.println("We have a dup: " + list.get(i));
+                list.remove(i);
+                i--;
+            }
+        }
+
+    }
+
+    private boolean matches(BEASTInterface plugin2, String sConditionalAttribute, String sConditionalValue) {
+        if (sConditionalAttribute.equals("id") && plugin2.getID().equals(sConditionalValue)) return true;
+        if (sConditionalAttribute.equals("type") && plugin2.getClass().getName().equals(sConditionalValue)) return true;
+        if (sConditionalAttribute.equals("type!") && !plugin2.getClass().getName().equals(sConditionalValue))
+            return true;
+        return false;
+    }
+
+    @SuppressWarnings("unchecked")
+    public void sync(int iPartition) {
+        if (parentInputs.size() > 0 && _input.get() != null) {
+            Input<?> input = parentInputs.get(iPartition);
+            if (bIsList) {
+                List<Object> list = (List<Object>) _input.get();
+                List<Object> targetList = ((List<Object>) input.get());
+                //targetList.clear();
+                // only clear former members
+                for (BEASTInterface plugin : startInputs) {
+                    targetList.remove(plugin);
+                }
+                targetList.addAll(list);
+                // sync outputs of items in list
+                for (Object o : list) {
+                	if (o instanceof BEASTInterface) {
+                		((BEASTInterface)o).getOutputs().add(parentPlugins.get(iPartition));
+                	}
+                }
+            } else {
+                try {
+                    //System.err.println("sync " + parentPlugins.get(iPartition) + "[" + input.getName() + "] = " + _input.get());
+                    input.setValue(_input.get(), parentPlugins.get(iPartition));
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+    }
+
+    /**
+     * initialise m_input, and either m_plugin or m_pluginList *
+     */
+    public void syncTo(int iPartition) {
+        _input.setType(type);
+        try {
+            if (bIsList) {
+                for (BEASTInterface plugin : inputs) {
+                    _input.setValue(plugin, this);
+                }
+            } else {
+            	if (inputs.size() > 0) {
+	                BEASTInterface plugin = inputs.get(iPartition);
+	                _input.setValue(plugin, this);
+            	}
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    Input<?> getInput() {
+        return _input;
+    }
+
+    /**
+     * returns name of the plugin *
+     */
+    public String getType() {
+        if (bIsList) {
+            return inputs.get(0).getClass().getName();
+        }
+        if (_input == null) {
+            return null;
+        }
+        return _input.get().getClass().getName();
+    }
+
+//	public void addItem(Plugin plugin) {
+//		m_parentInputs.add(m_parentInputs.get(m_parentInputs.size()-1));
+//		m_parentPlugins.add(m_parentPlugins.get(m_parentPlugins.size()-1));
+//	}
+
+}
diff --git a/src/beast/app/beauti/BeautiSubTemplate.java b/src/beast/app/beauti/BeautiSubTemplate.java
new file mode 100644
index 0000000..cf834b9
--- /dev/null
+++ b/src/beast/app/beauti/BeautiSubTemplate.java
@@ -0,0 +1,442 @@
+package beast.app.beauti;
+
+
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.Logger;
+import beast.core.BEASTObject;
+import beast.core.BEASTInterface;
+import beast.core.Input.Validate;
+import beast.core.util.Log;
+import beast.evolution.alignment.Alignment;
+import beast.evolution.alignment.FilteredAlignment;
+import beast.evolution.likelihood.GenericTreeLikelihood;
+import beast.evolution.sitemodel.SiteModel;
+import beast.evolution.substitutionmodel.SubstitutionModel;
+import beast.util.XMLParser;
+
+
+//import beast.app.beauti.BeautiConnector.ConnectCondition;
+
+ at Description("Template that specifies which sub-net needs to be created when " +
+        "a plugin of a paricular class is created.")
+public class BeautiSubTemplate extends BEASTObject {
+    public Input<String> sClassInput = new Input<String>("class", "name of the class (with full class path) to be created", Validate.REQUIRED);
+    public Input<String> sMainInput = new Input<String>("mainid", "specifies id of the main plugin to be created by the template", Validate.REQUIRED);
+    //public Input<XML> sXMLInput = new Input<XML>("value","collection of objects to be created in Beast2 xml format", Validate.REQUIRED);
+    public Input<String> sXMLInput = new Input<String>("value", "collection of objects to be created in Beast2 xml format", Validate.REQUIRED);
+    public Input<List<BeautiConnector>> connectorsInput = new Input<List<BeautiConnector>>("connect", "Specifies which part of the template get connected to the main network", new ArrayList<BeautiConnector>());
+    public Input<String> suppressedInputs = new Input<String>("suppressInputs", "comma separated list of inputs that should not be shown");
+
+    Class<?> _class = null;
+    Object instance;
+    String sXML = null;
+    List<BeautiConnector> connectors;
+
+    BeautiDoc doc;
+
+    //	String [] sSrcIDs;
+//	String [] sTargetIDs;
+//	String [] sTargetInputs;
+//	ConnectCondition [] conditions;
+    String sMainID = "";
+    String sShortClassName;
+
+    @Override
+    public void initAndValidate() throws Exception {
+        _class = Class.forName(sClassInput.get());
+        sShortClassName = sClassInput.get().substring(sClassInput.get().lastIndexOf('.') + 1);
+        instance = _class.newInstance();
+        sXML = sXMLInput.get();//.m_sValue.get();
+        sMainID = sMainInput.get();
+        // sanity check: make sure the XML is parseable
+        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+        Document doc = factory.newDocumentBuilder().parse(new InputSource(new StringReader("<beast xmlns:beauti='http://beast2.org'>" + sXML + "</beast>")));
+        sXML = processDoc(doc);
+        
+        // make sure there are no comments in the XML: this screws up any XML when saved to file
+        if (sXML.contains("<!--")) {
+            while (sXML.contains("<!--")) {
+                int iStart = sXML.indexOf("<!--");
+                // next line is guaranteed to find something, things we already checked this is valid XML
+                int iEnd = sXML.indexOf("-->", iStart);
+                sXML = sXML.substring(0, iStart) + sXML.substring(iEnd + 3);
+            }
+        }
+        //m_sXMLInput.get().m_sValue.setValue("<![CDATA[" + m_sXML + "]]>", m_sXMLInput.get());
+        sXMLInput.setValue("<![CDATA[" + sXML + "]]>", this);
+
+        connectors = connectorsInput.get();
+//		int nConnectors = connections.get().size();
+//		sSrcIDs = new String[nConnectors];
+//		sTargetIDs = new String[nConnectors];
+//		sTargetInputs = new String[nConnectors];
+////		conditions = new ConnectCondition[nConnectors];
+//
+//		for (int i = 0; i < nConnectors; i++) {
+//			BeautiConnector connector = connections.get().get(i);
+//			sSrcIDs[i] = connector.sSourceID.get();
+//			sTargetIDs[i] = connector.sTargetID.get();
+//			sTargetInputs[i] = connector.sInputName.get();
+////			conditions[i] = connector.connectCondition.get(); 
+//		}
+    }
+
+    /* go through DOM document
+     * pick up items that should be translated to BeautiConnectors
+     * Remove any connector related code from DOM and return resulting XML as String
+     */
+    private String processDoc(Document doc) throws Exception {
+        // find top level beast element
+        final NodeList nodes = doc.getElementsByTagName("*");
+        if (nodes == null || nodes.getLength() == 0) {
+            throw new Exception("Expected top level beast element in XML");
+        }
+        final Node topNode = nodes.item(0);
+        // process top level elements
+        NodeList toplevels = topNode.getChildNodes();
+        for (int i = 0; i < toplevels.getLength(); i++) {
+        	Node node = toplevels.item(i);
+        	// find elements with an idref attribute
+        	if (node.getNodeType() == Node.ELEMENT_NODE) {
+        		if (node.getAttributes().getNamedItem("idref") != null) {
+        			String targetID = XMLParser.getAttribute(node, "idref");
+        			topNode.removeChild(node);
+        			i--;
+
+        			// top-level elements with idref either have an if element containing a condition, like so:
+        			// <logger idref="tracelog">
+					//     <if cond="inposterior(HKY) and kappa/estimate=true">
+					//        <log idref="kappa"/>
+					//        <log idref="alpha"/>
+					//     </if>
+					// </logger>
+        			//
+        			// or contain elements, each with their own conditions, like so
+        			//
+					// <logger idref="tracelog">
+					//    <log idref="kappa" beauti:if="inposterior(HKY) and kappa/estimate=true"/>
+					//    <log idref="alpha" beauti:if="inposterior(HKY) and alpha/estimate=true"/>
+					// </logger>
+        			//
+        			// tedious DOM parsing distinguishing these cases follows...
+        			
+        			NodeList children = node.getChildNodes();
+        			for (int j = 0; j < children.getLength(); j++) {
+        				Node child = children.item(j);
+        				if (child.getNodeType() == Node.ELEMENT_NODE) {
+        					// determine target input name
+        					String inputName = child.getNodeName();
+        					String name = XMLParser.getAttribute(child, "name");
+        					if (name != null) {
+        						inputName = name;
+        					}
+        					if (inputName.equals("if")) {
+        						// process if-element e.g.
+        						String condition = XMLParser.getAttribute(child, "cond");
+        						NodeList childrenOfIf = child.getChildNodes();
+        						for (int k = 0; k < childrenOfIf.getLength(); k++) {
+        							Node child2 = childrenOfIf.item(k);
+        							if (child2.getNodeType() == Node.ELEMENT_NODE) {
+        	        					// determine source ID
+        	        					boolean hasIDRef = true;
+        	        					String sourceID = XMLParser.getAttribute(child2, "idref");
+        	        					if (sourceID == null) {
+        	        						sourceID = XMLParser.getAttribute(child2, "id");
+        	        						hasIDRef = false;
+        	        					}
+        	        					if (sourceID == null) {
+        	        						throw new Exception("idref and id not specified on element with name '" + name +"'");
+        	        					}
+        	        					inputName = child2.getNodeName();
+        	        					String name2 = XMLParser.getAttribute(child2, "name");
+        	        					if (name2 != null) {
+        	        						inputName = name2;
+        	        					}
+        	        					BeautiConnector connector = new BeautiConnector(sourceID, targetID, inputName, condition);
+        	        					connectorsInput.get().add(connector);
+
+        	        					if (!hasIDRef) {
+        	            					topNode.appendChild(child2);
+        	            					k--;
+        	        					}
+        								
+        							} else {
+    	            					topNode.appendChild(child2);
+    	            					k--;
+        							}
+        							
+        						}
+        					} else {
+	        					// determine source ID
+	        					boolean hasIDRef = true;
+	        					String sourceID = XMLParser.getAttribute(child, "idref");
+	        					if (sourceID == null) {
+	        						sourceID = XMLParser.getAttribute(child, "id");
+	        						hasIDRef = false;
+	        					}
+	        					if (sourceID == null) {
+	        						throw new Exception("idref and id not specified on element with name '" + name +"'");
+	        					}
+	        					String condition = XMLParser.getAttribute(child, "beauti:if");
+	        					if (condition != null) {
+	        						Node ifNode = child.getAttributes().removeNamedItem("beauti:if");
+	        					}
+	
+	        					BeautiConnector connector = new BeautiConnector(sourceID, targetID, inputName, condition);
+	        					connectorsInput.get().add(connector);
+	        					if (!hasIDRef) {
+	            					topNode.appendChild(child);
+	            					j--;
+	        					}
+        					}
+        				} else {
+        					topNode.appendChild(children.item(j));
+        					j--;
+        				}
+        			}
+        		}
+        	}
+        }
+        
+    	// translate DOM back to String
+        // TODO: move to XMLParserUtils
+	    DOMSource domSource = new DOMSource(doc);
+	    StringWriter writer = new StringWriter();
+	    StreamResult result = new StreamResult(writer);
+	    TransformerFactory tf = TransformerFactory.newInstance();
+	    Transformer transformer = tf.newTransformer();
+	    transformer.setOutputProperty(OutputKeys.INDENT, "yes");
+	    transformer.transform(domSource, result);
+	    String sXML = writer.toString();
+	    sXML = sXML.substring(sXML.indexOf("<beast xmlns:beauti=\"http://beast2.org\">") + 40, sXML.lastIndexOf("</beast>"));
+	    return sXML;
+	}
+
+    public void setDoc(BeautiDoc doc) {
+        this.doc = doc;
+    }
+
+    void removeSubNet(BeautiSubTemplate template, PartitionContext context) throws Exception {
+        // disconnect all connection points in the template
+        for (BeautiConnector connector : template.connectors) {
+            doc.disconnect(connector, context);
+        }
+    }
+    
+    void removeSubNet(Object o) throws Exception {
+        if (o == null) {
+            // nothing to do
+            return;
+        }
+        BEASTInterface plugin = null;
+        if (o instanceof BEASTInterface) {
+            plugin = (BEASTInterface) o;
+        }
+
+        // find template that created this plugin
+        String sID = plugin.getID();
+        //String sPartition = BeautiDoc.parsePartition(sID);
+        sID = sID.substring(0, sID.indexOf("."));
+        BeautiSubTemplate template = null;
+        for (BeautiSubTemplate template2 : doc.beautiConfig.subTemplatesInput.get()) {
+            if (template2.matchesName(sID)) {
+                template = template2;
+                break;
+            }
+        }
+        if (template == null) {
+            throw new Exception("Cannot find template for removing " + plugin.getID());
+        }
+        PartitionContext context = doc.getContextFor(plugin);
+        removeSubNet(template, context);
+    }
+
+    public BEASTInterface createSubNet(PartitionContext partition, BEASTInterface plugin, Input<?> input, boolean init) throws Exception {
+        removeSubNet(input.get());
+        if (sXML == null) {
+            // this is the NULL_TEMPLATE
+            input.setValue(null, plugin);
+            return null;
+        }
+        BEASTInterface o = createSubNet(partition, doc.pluginmap, init);
+        input.setValue(o, plugin);
+        return o;
+    }
+
+    public BEASTInterface createSubNet(PartitionContext partition, List<BEASTInterface> list, int iItem, boolean init) throws Exception {
+        removeSubNet(list.get(iItem));
+        if (sXML == null) {
+            // this is the NULL_TEMPLATE
+            list.set(iItem, null);
+            return null;
+        }
+        BEASTInterface o = createSubNet(partition, doc.pluginmap, init);
+        list.set(iItem, o);
+        return o;
+    }
+
+    public BEASTInterface createSubNet(PartitionContext partition, boolean init) throws Exception {
+        if (sXML == null) {
+            // this is the NULL_TEMPLATE
+            return null;
+        }
+        BEASTInterface o = createSubNet(partition, doc.pluginmap, init);
+        return o;
+    }
+
+
+    BEASTInterface createSubNet(Alignment data, BeautiDoc doc, boolean init) {
+        String sPartition = data.getID();
+        HashMap<String, BEASTInterface> sIDMap = doc.pluginmap;//new HashMap<String, Plugin>();
+        sIDMap.put(sPartition, data);
+        return createSubNet(new PartitionContext(sPartition), sIDMap, init);
+    }
+
+    private BEASTInterface createSubNet(PartitionContext context, /*BeautiDoc doc,*/ HashMap<String, BEASTInterface> sIDMap, boolean init) {
+        // wrap in a beast element with appropriate name spaces
+        String _sXML = "<beast version='2.0' \n" +
+                "namespace='beast.app.beauti:beast.core:beast.evolution.branchratemodel:beast.evolution.speciation:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood:beast.evolution:beast.math.distributions'>\n" +
+                sXML +
+                "</beast>\n";
+
+        // resolve alignment references
+        _sXML = _sXML.replaceAll("idref=[\"']data['\"]", "idref='" + context.partition + "'");
+        _sXML = _sXML.replaceAll("[\"']@data['\"]", "'@" + context.partition + "'");
+        // ensure uniqueness of IDs
+        _sXML = BeautiDoc.translatePartitionNames(_sXML, context);//_sXML.replaceAll("\\$\\(n\\)", sPartition);
+
+        XMLParser parser = new XMLParser();
+        parser.setRequiredInputProvider(doc, context);
+        List<BEASTInterface> plugins = null;
+        try {
+            plugins = parser.parseTemplate(_sXML, sIDMap, true);
+            for (BEASTInterface plugin : plugins) {
+                doc.addPlugin(plugin);
+                try {
+                	System.err.println("Adding " + plugin.getClass().getName() + " " + plugin);
+                } catch (Exception e) {
+                	System.err.println("Adding " + plugin.getClass().getName());
+				}
+            }
+
+            for (BeautiConnector connector : connectors) {
+                if (init && connector.atInitialisationOnly()) {// ||
+                    doc.connect(connector, context);
+                }
+                //System.out.println(connector.sSourceID + " == " + connector.sTargetID);
+                if (connector.sTargetID != null && connector.sTargetID.equals("prior")) {
+                	Log.warning.println(">>> No description for connector " + connector.sSourceID + " == " + connector.sTargetID);
+                }
+                if (connector.getTipText() != null) {
+                	String ID = BeautiDoc.translatePartitionNames(connector.sSourceID, context);
+                	String tipText = BeautiDoc.translatePartitionNames(connector.getTipText(), context).trim().replaceAll("\\s+", " ");
+                	//System.out.println(ID + " -> " + tipText);
+                    doc.tipTextMap.put(ID, tipText);
+                }
+            }
+            if (suppressedInputs.get() != null) {
+                String[] inputs = suppressedInputs.get().split(",");
+                for (String input : inputs) {
+                    input = input.trim();
+                    doc.beautiConfig.suppressPlugins.add(input);
+                }
+            }
+        } catch (Exception e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+
+        if (sMainID.equals("[top]")) {
+            return plugins.get(0);
+        }
+
+        String sID = sMainID;
+        sID = BeautiDoc.translatePartitionNames(sID, context); //sID.replaceAll("\\$\\(n\\)", sPartition);
+        BEASTInterface plugin = doc.pluginmap.get(sID);
+
+        if (this == doc.beautiConfig.partitionTemplate.get()) {
+            // HACK: need to make sure the subst model is of the correct type
+            BEASTInterface treeLikelihood = doc.pluginmap.get("treeLikelihood." + context.partition);
+            if (treeLikelihood != null && ((GenericTreeLikelihood) treeLikelihood).siteModelInput.get() instanceof SiteModel.Base) {
+	            SiteModel.Base siteModel = (SiteModel.Base) ((GenericTreeLikelihood) treeLikelihood).siteModelInput.get();
+	            SubstitutionModel substModel = siteModel.substModelInput.get();
+	            try {
+	                siteModel.canSetSubstModel(substModel);
+	            } catch (Exception e) {
+	                Object o = doc.createInput(siteModel, siteModel.substModelInput, context);
+	                try {
+	                    siteModel.substModelInput.setValue(o, siteModel);
+	                } catch (Exception ex) {
+	                    ex.printStackTrace();
+	                }
+	            }
+            }
+
+            // HACK2: rename file name for trace log if it has the default value
+            Logger logger = (Logger) doc.pluginmap.get("tracelog");
+            if (logger != null) {
+	            String fileName = logger.fileNameInput.get();
+	            if (fileName.startsWith("beast.") && treeLikelihood != null) {
+	            	Alignment data = ((GenericTreeLikelihood)treeLikelihood).dataInput.get();
+	            	while (data instanceof FilteredAlignment) {
+	            		data = ((FilteredAlignment) data).alignmentInput.get();
+	            	}
+	            	fileName = data.getID() + fileName.substring(5);
+	            	try {
+						logger.fileNameInput.setValue(fileName, logger);
+					} catch (Exception e) {
+						e.printStackTrace();
+					}
+	            }
+            }
+        }
+
+        //System.err.println(new XMLProducer().toXML(plugin));
+        return plugin;
+    }
+
+    public String getMainID() {
+        return sMainID;
+    }
+
+
+    @Override
+    public String toString() {
+        String sID = getID();
+        sID = sID.replaceAll("([a-z])([A-Z])", "$1 $2");
+        return sID;
+    }
+
+
+    public boolean matchesName(String sID) {
+        if (getMainID().replaceAll(".\\$\\(n\\)", "").equals(sID)) {
+            return true;
+        }
+        if (getMainID().replaceAll("..:\\$\\(n\\)", "").equals(sID)) {
+            return true;
+        }
+        if (sShortClassName != null && sShortClassName.equals(sID)) {
+            return true;
+        }
+        return false;
+    }
+}
diff --git a/src/beast/app/beauti/ClockModelListInputEditor.java b/src/beast/app/beauti/ClockModelListInputEditor.java
new file mode 100644
index 0000000..92455f3
--- /dev/null
+++ b/src/beast/app/beauti/ClockModelListInputEditor.java
@@ -0,0 +1,182 @@
+package beast.app.beauti;
+
+
+import java.awt.Color;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.Box;
+import javax.swing.JCheckBox;
+import javax.swing.JTextField;
+
+import beast.app.draw.ListInputEditor;
+import beast.app.draw.SmallLabel;
+import beast.core.Input;
+import beast.core.MCMC;
+import beast.core.Operator;
+import beast.core.BEASTObject;
+import beast.core.BEASTInterface;
+import beast.core.parameter.IntegerParameter;
+import beast.core.parameter.RealParameter;
+import beast.evolution.alignment.Alignment;
+import beast.evolution.branchratemodel.BranchRateModel;
+import beast.evolution.operators.DeltaExchangeOperator;
+
+
+
+
+
+public class ClockModelListInputEditor extends ListInputEditor {
+    private static final long serialVersionUID = 1L;
+    List<JTextField> textFields = new ArrayList<JTextField>();
+    List<Operator> operators = new ArrayList<Operator>();
+
+	public ClockModelListInputEditor(BeautiDoc doc) {
+		super(doc);
+	}
+
+    @Override
+    public Class<?> type() {
+        return List.class;
+    }
+
+    @Override
+    public Class<?> baseType() {
+    	// disable this editor
+    	return ClockModelListInputEditor.class;
+        //return BranchRateModel.Base.class;
+    }
+
+    JCheckBox fixMeanRatesCheckBox;
+    
+    DeltaExchangeOperator operator;
+    protected SmallLabel fixMeanRatesValidateLabel;
+    
+    @Override
+    public void init(Input<?> input, BEASTInterface plugin, int itemNr, ExpandOption bExpandOption, boolean bAddButtons) {
+    	fixMeanRatesCheckBox = new JCheckBox("Fix mean rate of clock models");
+    	m_buttonStatus = ButtonStatus.NONE;
+    	super.init(input, plugin, itemNr, bExpandOption, bAddButtons);
+    	
+		List<Operator> operators = ((MCMC) doc.mcmc.get()).operatorsInput.get();
+    	fixMeanRatesCheckBox.addActionListener(new ActionListener() {
+			
+			@Override
+			public void actionPerformed(ActionEvent e) {
+				JCheckBox averageRatesBox = (JCheckBox) e.getSource();
+				boolean averageRates = averageRatesBox.isSelected();
+				List<Operator> operators = ((MCMC) doc.mcmc.get()).operatorsInput.get();
+				if (averageRates) {
+					// connect DeltaExchangeOperator
+					if (!operators.contains(operator)) {
+						operators.add(operator);
+					}
+					// set up relative weights
+					setUpOperator();
+				} else {
+					operators.remove(operator);
+					fixMeanRatesValidateLabel.setVisible(false);
+					repaint();
+				}
+			}
+
+		});
+    	operator = (DeltaExchangeOperator) doc.pluginmap.get("FixMeanRatesOperator");
+    	if (operator == null) {
+    		operator = new DeltaExchangeOperator();
+    		try {
+    			operator.setID("FixMeanRatesOperator");
+				operator.initByName("weight", 2.0, "delta", 0.75);
+			} catch (Exception e1) {
+				// ignore initAndValidate exception
+			}
+    		doc.addPlugin(operator);
+    	}
+		fixMeanRatesCheckBox.setSelected(operators.contains(operator));
+		Box box = Box.createHorizontalBox();
+		box.add(fixMeanRatesCheckBox);
+		box.add(Box.createHorizontalGlue());
+		fixMeanRatesValidateLabel = new SmallLabel("x", Color.GREEN);
+		fixMeanRatesValidateLabel.setVisible(false);
+		box.add(fixMeanRatesValidateLabel);
+		
+    	if (((List<?>) input.get()).size() > 1 && operator != null) {
+    		add(box);
+    	}
+		setUpOperator();
+    }
+    
+    @Override
+    public void validateInput() {
+    	super.validateInput();
+    	System.err.println("validateInput()");
+    }
+    
+    /** set up relative weights and parameter input **/
+    private void setUpOperator() {
+    	String weights = "";
+    	List<RealParameter> parameters = operator.parameterInput.get();
+    	parameters.clear();
+    	double commonClockRate = -1;
+    	boolean bAllClocksAreEqual = true;
+		try {
+	    	for (int i = 0; i < doc.alignments.size(); i++) {
+	    		Alignment data = doc.alignments.get(i); 
+	    		int weight = data.getSiteCount();
+	    		BranchRateModel.Base clockModel = (BranchRateModel.Base) doc.clockModels.get(i);
+	    		RealParameter clockRate = clockModel.meanRateInput.get();
+	    		//clockRate.m_bIsEstimated.setValue(true, clockRate);
+	    		if (clockRate.isEstimatedInput.get()) {
+	    			if (commonClockRate < 0) {
+	    				commonClockRate = clockRate.valuesInput.get().get(0);
+	    			} else {
+	    				if (Math.abs(commonClockRate - clockRate.valuesInput.get().get(0)) > 1e-10) {
+	    					bAllClocksAreEqual = false;
+	    				}
+	    			}
+    				weights += weight + " ";
+	    			parameters.add(clockRate);
+	    		}
+	    		//doc.bAutoSetClockRate = false;
+	    	}
+	    	if (!fixMeanRatesCheckBox.isSelected()) {
+	    		fixMeanRatesValidateLabel.setVisible(false);
+	    		return;
+	    	}
+	    	if (parameters.size() == 0) {
+	    		fixMeanRatesValidateLabel.setVisible(true);
+	    		fixMeanRatesValidateLabel.m_circleColor = Color.red;
+	    		fixMeanRatesValidateLabel.setToolTipText("The model is invalid: At least one clock rate should be estimated.");
+	    		return;
+	    	}
+
+	    	IntegerParameter weightParameter = new IntegerParameter(weights);
+			weightParameter.setID("weightparameter");
+			weightParameter.isEstimatedInput.setValue(false, weightParameter);
+	    	operator.parameterWeightsInput.setValue(weightParameter, operator);
+	    	if (!bAllClocksAreEqual) {
+	    		fixMeanRatesValidateLabel.setVisible(true);
+	    		fixMeanRatesValidateLabel.m_circleColor = Color.orange;
+	    		fixMeanRatesValidateLabel.setToolTipText("Not all clocks are equal. Are you sure this is what you want?");
+	    	} else if (parameters.size() == 1) {
+	    		fixMeanRatesValidateLabel.setVisible(true);
+	    		fixMeanRatesValidateLabel.m_circleColor = Color.orange;
+	    		fixMeanRatesValidateLabel.setToolTipText("At least 2 clock models should have their rate estimated");
+	    	} else if (parameters.size() < doc.alignments.size()) {
+	    		fixMeanRatesValidateLabel.setVisible(true);
+	    		fixMeanRatesValidateLabel.m_circleColor = Color.orange;
+	    		fixMeanRatesValidateLabel.setToolTipText("Not all partitions have their rate estimated");
+	    	} else {
+	    		fixMeanRatesValidateLabel.setVisible(false);
+	    	}
+			repaint();
+    		//doc.bAutoSetClockRate = true;
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+	}
+
+} // OperatorListInputEditor
diff --git a/src/beast/app/beauti/ClonePartitionPanel.java b/src/beast/app/beauti/ClonePartitionPanel.java
new file mode 100644
index 0000000..81c3c03
--- /dev/null
+++ b/src/beast/app/beauti/ClonePartitionPanel.java
@@ -0,0 +1,72 @@
+package beast.app.beauti;
+
+import beast.app.beauti.guiutil.S11InitialSelection;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+
+public class ClonePartitionPanel extends JPanel {
+    private static final long serialVersionUID = 1L;
+
+    final BeautiPanel beautiPanel;
+    final JComboBox cloneFromComboBox;
+    final JButton okButton = new JButton("OK");
+
+	public ClonePartitionPanel(BeautiPanel beautiPanel) {
+        this.beautiPanel = beautiPanel;
+
+        DefaultListModel listModel = beautiPanel.listModel;
+        Object[] models = new Object[listModel.getSize()];
+        for(int i=0; i < listModel.getSize(); i++){
+            models[i] = listModel.getElementAt(i);
+        }
+
+        cloneFromComboBox = new JComboBox(models);
+        // has to be editable
+        cloneFromComboBox.setEditable(true);
+        // change the editor's document
+        new S11InitialSelection(cloneFromComboBox);
+
+        init();
+    }
+
+
+    public void init() {
+        setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
+
+        JPanel jPanel = new JPanel(new FlowLayout());
+
+        JLabel label = new JLabel("Clone from");
+        jPanel.add(label);
+
+        cloneFromComboBox.setMaximumRowCount(10);
+        jPanel.add(cloneFromComboBox);
+
+        add(Box.createRigidArea(new Dimension(0, 10)));
+        add(jPanel);
+        add(Box.createVerticalGlue());
+        add(Box.createVerticalStrut(5));
+
+        okButton.setName("ok");
+        okButton.setToolTipText("Click to clone configuration from the above selected partition " +
+                "into all selected partitions on the left.");
+        okButton.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                clonePartitions();
+            }
+        });
+        add(okButton);
+
+    } // init
+
+    protected void clonePartitions() {
+        String sourceId = cloneFromComboBox.getSelectedItem().toString();
+
+        for (Object targetId : beautiPanel.listOfPartitions.getSelectedValues()) {
+             beautiPanel.cloneFrom(sourceId, targetId.toString());
+        }
+    }
+}
diff --git a/src/beast/app/beauti/Fragment.java b/src/beast/app/beauti/Fragment.java
new file mode 100644
index 0000000..258bb6c
--- /dev/null
+++ b/src/beast/app/beauti/Fragment.java
@@ -0,0 +1,18 @@
+package beast.app.beauti;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import beast.core.BEASTObject;
+import beast.core.Description;
+import beast.core.Input;
+
+ at Description("Dummy container for representing template fragment")
+public class Fragment extends BEASTObject {
+	public Input<String> valueInput = new Input<String>("value","for representing CDATA section");
+	public Input<List<BeautiConnector>> connectorsInput = new Input<List<BeautiConnector>>("connect", "for representing BEAUti connectors", new ArrayList<>());
+
+	@Override
+	public void initAndValidate() throws Exception {
+	}
+}
diff --git a/src/beast/app/beauti/FrequenciesInputEditor.java b/src/beast/app/beauti/FrequenciesInputEditor.java
new file mode 100644
index 0000000..fc63075
--- /dev/null
+++ b/src/beast/app/beauti/FrequenciesInputEditor.java
@@ -0,0 +1,111 @@
+package beast.app.beauti;
+
+
+import java.awt.Component;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.Box;
+import javax.swing.JComboBox;
+import javax.swing.JComponent;
+
+import beast.app.draw.BEASTObjectInputEditor;
+import beast.core.Input;
+import beast.core.BEASTObject;
+import beast.core.BEASTInterface;
+import beast.core.parameter.RealParameter;
+import beast.evolution.alignment.Alignment;
+import beast.evolution.substitutionmodel.Frequencies;
+
+
+
+public class FrequenciesInputEditor extends BEASTObjectInputEditor {
+    RealParameter freqsParameter;
+    Alignment alignment;
+
+    private static final long serialVersionUID = 1L;
+    boolean bUseDefaultBehavior;
+
+	public FrequenciesInputEditor(BeautiDoc doc) {
+		super(doc);
+	}
+
+    @Override
+    public Class<?> type() {
+        return ActionEvent.class;
+        //return Frequencies.class;
+    }
+
+    @Override
+    public void init(Input<?> input, BEASTInterface plugin, int itemNr, ExpandOption bExpandOption, boolean bAddButtons) {
+        super.init(input, plugin, itemNr, bExpandOption, bAddButtons);
+    } // init
+
+
+    @Override
+    /** suppress combobox **/
+    protected void addComboBox(JComponent box, Input<?> input, BEASTInterface plugin) {
+        Frequencies freqs = (Frequencies) input.get();
+
+        JComboBox comboBox = new JComboBox(new String[]{"Estimated", "Empirical", "All equal"});
+        if (freqs.frequenciesInput.get() != null) {
+            comboBox.setSelectedIndex(0);
+            freqsParameter = freqs.frequenciesInput.get();
+            alignment = (Alignment) getCandidate(freqs.dataInput, freqs);
+        } else if (freqs.estimateInput.get()) {
+            comboBox.setSelectedIndex(1);
+            alignment = freqs.dataInput.get();
+            freqsParameter = (RealParameter) getCandidate(freqs.frequenciesInput, freqs);
+        } else {
+            comboBox.setSelectedIndex(2);
+            alignment = freqs.dataInput.get();
+            freqsParameter = (RealParameter) getCandidate(freqs.frequenciesInput, freqs);
+        }
+        comboBox.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                JComboBox comboBox = (JComboBox) e.getSource();
+                int iSelected = comboBox.getSelectedIndex();
+                Frequencies freqs = (Frequencies) m_input.get();
+                try {
+                    switch (iSelected) {
+                        case 0:
+                            freqs.frequenciesInput.setValue(freqsParameter, freqs);
+                            freqs.dataInput.setValue(null, freqs);
+                            break;
+                        case 1:
+                            freqs.frequenciesInput.setValue(null, freqs);
+                            freqs.dataInput.setValue(alignment, freqs);
+                            freqs.estimateInput.setValue(true, freqs);
+                            break;
+                        case 2:
+                            freqs.frequenciesInput.setValue(null, freqs);
+                            freqs.dataInput.setValue(alignment, freqs);
+                            freqs.estimateInput.setValue(false, freqs);
+                            break;
+                    }
+                } catch (Exception e2) {
+                    e2.printStackTrace();
+                }
+                //System.err.println(freqs.frequencies.get() + " " + freqs.m_data.get() + " " + freqs.m_bEstimate.get());
+            }
+        });
+        box.add(comboBox);
+    }
+
+    private BEASTInterface getCandidate(Input<?> input, Frequencies freqs) {
+        return getDoc().getPartition(freqs);
+//		List<String> sCandidates = PluginPanel.getAvailablePlugins(input, freqs, null);
+//		String sID = sCandidates.get(0);
+//		Plugin plugin = PluginPanel.g_plugins.get(sID);
+//		return plugin;
+    }
+
+
+    @Override
+    /** suppress input label**/
+    protected void addInputLabel() {
+        super.addInputLabel();
+    }
+
+}
diff --git a/src/beast/app/beauti/GeneTreeForSpeciesTreeDistributionInputEditor.java b/src/beast/app/beauti/GeneTreeForSpeciesTreeDistributionInputEditor.java
new file mode 100644
index 0000000..4da95a0
--- /dev/null
+++ b/src/beast/app/beauti/GeneTreeForSpeciesTreeDistributionInputEditor.java
@@ -0,0 +1,107 @@
+package beast.app.beauti;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.Box;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+
+import beast.app.draw.InputEditor;
+import beast.core.Input;
+import beast.core.BEASTObject;
+import beast.core.BEASTInterface;
+import beast.evolution.speciation.GeneTreeForSpeciesTreeDistribution;
+
+
+
+public class GeneTreeForSpeciesTreeDistributionInputEditor extends InputEditor.Base {
+	private static final long serialVersionUID = 1L;
+
+	public GeneTreeForSpeciesTreeDistributionInputEditor(BeautiDoc doc) {
+		super(doc);
+	}
+
+	@Override
+	public Class<?> type() {
+		return GeneTreeForSpeciesTreeDistribution.class;
+	}
+
+	@Override
+	public void init(Input<?> input, BEASTInterface plugin, int itemNr, ExpandOption bExpandOption, boolean bAddButtons) {
+        m_bAddButtons = bAddButtons;
+        m_input = input;
+        m_plugin = plugin;
+        this.itemNr= itemNr;
+        String sID = plugin.getID();
+        if (sID.contains(".t:")) {
+        	sID = sID.substring(sID.indexOf(".t:") + 3);
+        }
+        add(new JLabel("Gene Tree " + sID));
+        add(Box.createGlue());
+	}
+	
+	static final int OTHER = 3;
+	String [] sValues = new String[]{"autosomal_nuclear", "X", "Y or mitochondrial", "other"};
+	Double [] fValues = new Double[]{2.0, 1.5, 0.5, -1.0};
+	JComboBox m_selectPluginBox;
+	
+	public InputEditor createPloidyEditor() {
+		InputEditor editor = new InputEditor.Base(doc) {
+			@Override
+			public Class<?> type() {
+				// TODO Auto-generated method stub
+				return null;
+			}
+			
+			@Override
+			public void init(Input<?> input, BEASTInterface plugin, int itemNr, ExpandOption bExpandOption, boolean bAddButtons) {
+				m_plugin = plugin;
+				m_input = input;
+				m_bAddButtons = bAddButtons;
+				this.itemNr = itemNr;
+				addInputLabel();
+				
+	            m_selectPluginBox = new JComboBox(sValues);
+	            setSelection();
+	            String sSelectString = input.get().toString();
+	            m_selectPluginBox.setSelectedItem(sSelectString);
+
+	            m_selectPluginBox.addActionListener(new ActionListener() {
+	                // implements ActionListener
+	                public void actionPerformed(ActionEvent e) {
+	                    int i = m_selectPluginBox.getSelectedIndex();
+	                    if (i == OTHER) {
+	                    	setSelection();
+	                    	return;
+	                    }
+	                    try {
+	                    	setValue(fValues[i]);
+	                        //lm_input.setValue(sSelected, m_plugin);
+	                    } catch (Exception e1) {
+	                        e1.printStackTrace();
+	                    }
+	                }
+	            });
+	            m_selectPluginBox.setToolTipText(input.getHTMLTipText());
+	            add(m_selectPluginBox);
+	            add(Box.createGlue());
+			}
+
+			private void setSelection() {
+				Double value = (Double) m_input.get();
+				m_selectPluginBox.setSelectedIndex(OTHER);
+				for (int i = 0; i < fValues.length; i++) {
+					if (value.equals(fValues[i])) {
+						m_selectPluginBox.setSelectedIndex(i);
+					}
+				}
+			}
+			
+		};
+		editor.init(((GeneTreeForSpeciesTreeDistribution)m_plugin).ploidyInput, 
+			m_plugin, -1, ExpandOption.FALSE, true);
+		return editor;
+	}
+    
+}
diff --git a/src/beast/app/beauti/GuessPatternDialog.java b/src/beast/app/beauti/GuessPatternDialog.java
new file mode 100644
index 0000000..a880f12
--- /dev/null
+++ b/src/beast/app/beauti/GuessPatternDialog.java
@@ -0,0 +1,634 @@
+package beast.app.beauti;
+
+import beast.app.util.Utils;
+
+import javax.swing.*;
+import javax.swing.border.EmptyBorder;
+import javax.swing.event.DocumentEvent;
+import javax.swing.event.DocumentListener;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.regex.PatternSyntaxException;
+
+
+public class GuessPatternDialog extends JDialog {
+    private static final long serialVersionUID = 1L;
+    public static final String EXAMPLE_FORMAT = "<html>A proper trait file is tab delimited. <br>"
+            + "The first row is always <font color=red>traits</font> followed by the keyword <br>"
+            + "(e.g. <font color=red>species</font> in *BEAST) in the second column and separated <br>"
+            + "by <font color=red>tab</font>. The rest rows are mapping taxa to species, which list <br>"
+            + "taxon name in the first column and species name in the second column separated by <br>"
+            + "<font color=red>tab</font>. For example: <br>" + "traits\tspecies<br>" + "taxon1\tspeciesA<br>"
+            + "taxon2\tspeciesA<br>" + "taxon3\tspeciesB<br>" + "... ...<br>"
+            + "Once mapping file is loaded, the trait named by keyword <font color=red>species</font> <br>"
+            + "is displayed in the main panel, and the message of using *BEAST is also displayed on <br>"
+            + "the bottom of main frame.<br>"
+            + "For multi-alignment, the default of *BEAST is unlinking all models: substitution model, <br>"
+            + "clock model, and tree models.</html>";
+
+    public enum Status {
+        canceled, pattern, trait
+    };
+
+    public String trait = null;
+
+    public String getTrait() {
+        return trait;
+    }
+
+    Component m_parent;
+    JPanel guessPanel;
+    ButtonGroup group;
+    JRadioButton bUseEverything = new JRadioButton("use everything");
+    JRadioButton bSplitOnChar = new JRadioButton("split on character");
+    JRadioButton bUseRegexp = new JRadioButton("use regular expression");
+    JRadioButton bReadFromFile = new JRadioButton("read from file");
+
+    int m_location = 0;
+    int m_splitlocation = 0;
+    String m_sDelimiter = ".";
+    JTextField textRegExp;
+    JComboBox combo;
+    JComboBox combo_1;
+    String pattern;
+
+    public String getPattern() {
+        return pattern;
+    }
+
+    private JTextField txtFile;
+    private JTextField textSplitChar;
+    private JTextField textSplitChar2;
+    private JTextField textAddValue;
+    private JTextField textUnlessLessThan;
+    private JTextField textThenAdd;
+    JCheckBox chckbxAddFixedValue;
+    JCheckBox chckbxUnlessLessThan;
+    JLabel lblThenAdd;
+    JLabel lblAndTakeGroups;
+    JButton btnBrowse;
+    private JSeparator separator_2;
+    private JSeparator separator_3;
+    private JSeparator separator_4;
+    private JSeparator separator_5;
+
+    public GuessPatternDialog(Component parent, String pattern) {
+        m_parent = parent;
+        this.pattern = pattern;
+        guessPanel = new JPanel();
+        GridBagLayout gbl_guessPanel = new GridBagLayout();
+        gbl_guessPanel.rowHeights = new int[]{0, 0, 0, 20, 0, 0, 20, 0, 0, 20, 0, 29, 0, 0, 0, 0};
+        gbl_guessPanel.columnWidths = new int[]{0, 0, 0, 0, 0, 0};
+        gbl_guessPanel.rowWeights = new double[]{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};
+        gbl_guessPanel.columnWeights = new double[] { 1.0, 1.0, 1.0, 0.0, 1.0, 0.0 };
+        guessPanel.setLayout(gbl_guessPanel);
+
+        group = new ButtonGroup();
+        group.add(bUseEverything);
+        group.add(bSplitOnChar);
+        group.add(bUseRegexp);
+        group.add(bReadFromFile);
+        group.setSelected(bUseEverything.getModel(), true);
+        bUseEverything.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                updateFields();
+            }
+        });
+        bUseEverything.setName(bUseEverything.getText());
+        bSplitOnChar.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                updateFields();
+            }
+        });
+        bSplitOnChar.setName(bSplitOnChar.getText());
+        bUseRegexp.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                updateFields();
+            }
+        });
+        bUseRegexp.setName(bUseRegexp.getText());
+        bReadFromFile.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                updateFields();
+            }
+        });
+        bReadFromFile.setName(bReadFromFile.getText());
+
+        createDelimiterBox(bUseEverything);
+        createSplitBox(bSplitOnChar);
+        createRegExtpBox(bUseRegexp);
+
+        textRegExp = new JTextField();
+        textRegExp.setText(pattern);
+        textRegExp.setColumns(10);
+        textRegExp.setToolTipText("Enter regular expression to match taxa");
+        textRegExp.setMaximumSize(new Dimension(1024, 25));
+        GridBagConstraints gbc2 = new GridBagConstraints();
+        gbc2.insets = new Insets(0, 0, 5, 5);
+        gbc2.anchor = GridBagConstraints.WEST;
+        gbc2.gridwidth = 4;
+        gbc2.gridx = 1;
+        gbc2.gridy = 7;
+        guessPanel.add(textRegExp, gbc2);
+        textRegExp.getDocument().addDocumentListener(new DocumentListener() {
+            @Override
+            public void removeUpdate(DocumentEvent e) {
+                bUseRegexp.setSelected(true);
+            }
+
+            @Override
+            public void insertUpdate(DocumentEvent e) {
+                bUseRegexp.setSelected(true);
+            }
+
+            @Override
+            public void changedUpdate(DocumentEvent e) {
+                bUseRegexp.setSelected(true);
+            }
+        });
+
+        separator_4 = new JSeparator();
+        separator_4.setPreferredSize(new Dimension(5,1));
+        GridBagConstraints gbc_separator_4 = new GridBagConstraints();
+        gbc_separator_4.gridwidth = 5;
+        gbc_separator_4.insets = new Insets(5, 0, 15, 5);
+        gbc_separator_4.gridx = 0;
+        gbc_separator_4.gridy = 8;
+        gbc_separator_4.fill = GridBagConstraints.HORIZONTAL;
+        guessPanel.add(separator_4, gbc_separator_4);
+
+        GridBagConstraints gbc_rdbtnReadFromFile = new GridBagConstraints();
+        gbc_rdbtnReadFromFile.anchor = GridBagConstraints.WEST;
+        gbc_rdbtnReadFromFile.insets = new Insets(0, 0, 5, 5);
+        gbc_rdbtnReadFromFile.gridx = 0;
+        gbc_rdbtnReadFromFile.gridy = 10;
+        guessPanel.add(bReadFromFile, gbc_rdbtnReadFromFile);
+
+        btnBrowse = new JButton("Browse");
+        btnBrowse.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                File file = Utils.getLoadFile("Load trait from file", new File(Beauti.g_sDir), "Select trait file", "dat","txt");
+                if (file != null) {
+                    txtFile.setText(file.getPath());
+                    bReadFromFile.setSelected(true);
+                    updateFields();
+                }
+            }
+        });
+
+        txtFile = new JTextField();
+        txtFile.setText("File");
+        GridBagConstraints gbc_txtFile = new GridBagConstraints();
+        gbc_txtFile.gridwidth = 2;
+        gbc_txtFile.insets = new Insets(0, 0, 5, 5);
+        gbc_txtFile.fill = GridBagConstraints.HORIZONTAL;
+        gbc_txtFile.gridx = 1;
+        gbc_txtFile.gridy = 10;
+        guessPanel.add(txtFile, gbc_txtFile);
+        txtFile.setColumns(10);
+        GridBagConstraints gbc_btnReadFromFile = new GridBagConstraints();
+        gbc_btnReadFromFile.insets = new Insets(0, 0, 5, 5);
+        gbc_btnReadFromFile.gridx = 3;
+        gbc_btnReadFromFile.gridy = 10;
+        guessPanel.add(btnBrowse, gbc_btnReadFromFile);
+
+        JButton btnHelp = new JButton("?");
+        btnHelp.setToolTipText("Show format of trait file");
+        btnHelp.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                JOptionPane.showMessageDialog(m_parent, EXAMPLE_FORMAT);
+            }
+        });
+        GridBagConstraints gbc_btnHelp = new GridBagConstraints();
+        gbc_btnHelp.insets = new Insets(0, 0, 5, 5);
+        gbc_btnHelp.gridx = 4;
+        gbc_btnHelp.gridy = 10;
+        guessPanel.add(btnHelp, gbc_btnHelp);
+
+
+        chckbxAddFixedValue = new JCheckBox("Add fixed value");
+        chckbxAddFixedValue.setName("Add fixed value");
+        chckbxAddFixedValue.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                updateFields();
+            }
+        });
+
+        separator_5 = new JSeparator();
+        separator_5.setPreferredSize(new Dimension(5,1));
+        GridBagConstraints gbc_separator_5 = new GridBagConstraints();
+        gbc_separator_5.gridwidth = 5;
+        gbc_separator_5.insets = new Insets(5, 0, 15, 5);
+        gbc_separator_5.gridx = 0;
+        gbc_separator_5.gridy = 12;
+        gbc_separator_5.fill = GridBagConstraints.HORIZONTAL;
+        guessPanel.add(separator_5, gbc_separator_5);
+        GridBagConstraints gbc_chckbxAddFixedValue = new GridBagConstraints();
+        gbc_chckbxAddFixedValue.anchor = GridBagConstraints.WEST;
+        gbc_chckbxAddFixedValue.insets = new Insets(0, 0, 5, 5);
+        gbc_chckbxAddFixedValue.gridx = 0;
+        gbc_chckbxAddFixedValue.gridy = 13;
+        guessPanel.add(chckbxAddFixedValue, gbc_chckbxAddFixedValue);
+
+        textAddValue = new JTextField("1900");
+        GridBagConstraints gbc_textField = new GridBagConstraints();
+        gbc_textField.gridwidth = 2;
+        gbc_textField.insets = new Insets(0, 0, 5, 5);
+        gbc_textField.fill = GridBagConstraints.HORIZONTAL;
+        gbc_textField.gridx = 1;
+        gbc_textField.gridy = 13;
+        guessPanel.add(textAddValue, gbc_textField);
+        textAddValue.setColumns(10);
+
+        chckbxUnlessLessThan = new JCheckBox("Unless less than...");
+        chckbxUnlessLessThan.setName("Unless less than");
+        chckbxUnlessLessThan.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                updateFields();
+            }
+        });
+        GridBagConstraints gbc_chckbxUnlessLargerThan = new GridBagConstraints();
+        gbc_chckbxUnlessLargerThan.anchor = GridBagConstraints.WEST;
+        gbc_chckbxUnlessLargerThan.insets = new Insets(0, 0, 5, 5);
+        gbc_chckbxUnlessLargerThan.gridx = 0;
+        gbc_chckbxUnlessLargerThan.gridy = 14;
+        guessPanel.add(chckbxUnlessLessThan, gbc_chckbxUnlessLargerThan);
+
+        textUnlessLessThan = new JTextField("13");
+        GridBagConstraints gbc_textField_1 = new GridBagConstraints();
+        gbc_textField_1.gridwidth = 2;
+        gbc_textField_1.insets = new Insets(0, 0, 5, 5);
+        gbc_textField_1.fill = GridBagConstraints.HORIZONTAL;
+        gbc_textField_1.gridx = 1;
+        gbc_textField_1.gridy = 14;
+        guessPanel.add(textUnlessLessThan, gbc_textField_1);
+        textUnlessLessThan.setColumns(10);
+
+        lblThenAdd = new JLabel("...then add");
+        GridBagConstraints gbc_lblThenAdd = new GridBagConstraints();
+        gbc_lblThenAdd.anchor = GridBagConstraints.EAST;
+        gbc_lblThenAdd.insets = new Insets(0, 0, 0, 5);
+        gbc_lblThenAdd.gridx = 0;
+        gbc_lblThenAdd.gridy = 15;
+        guessPanel.add(lblThenAdd, gbc_lblThenAdd);
+
+        textThenAdd = new JTextField("2000");
+        GridBagConstraints gbc_textField_2 = new GridBagConstraints();
+        gbc_textField_2.gridwidth = 2;
+        gbc_textField_2.insets = new Insets(0, 0, 0, 5);
+        gbc_textField_2.fill = GridBagConstraints.HORIZONTAL;
+        gbc_textField_2.gridx = 1;
+        gbc_textField_2.gridy = 15;
+        guessPanel.add(textThenAdd, gbc_textField_2);
+        textThenAdd.setColumns(10);
+
+
+        chckbxAddFixedValue.setVisible(false);
+        textAddValue.setVisible(false);
+        chckbxUnlessLessThan.setVisible(false);
+        lblThenAdd.setVisible(false);
+        chckbxUnlessLessThan.setVisible(false);
+        textUnlessLessThan.setVisible(false);
+        textThenAdd.setVisible(false);
+    }
+
+    public void allowAddingValues() {
+        chckbxAddFixedValue.setVisible(true);
+        textAddValue.setVisible(true);
+        chckbxUnlessLessThan.setVisible(true);
+        lblThenAdd.setVisible(true);
+        chckbxUnlessLessThan.setVisible(true);
+        textUnlessLessThan.setVisible(true);
+        textThenAdd.setVisible(true);
+    }
+
+    protected void updateFields() {
+        if (chckbxAddFixedValue.isSelected()) {
+            textAddValue.setEnabled(true);
+            chckbxUnlessLessThan.setEnabled(true);
+            lblThenAdd.setEnabled(true);
+            if (chckbxUnlessLessThan.isSelected()) {
+                textUnlessLessThan.setEnabled(true);
+                textThenAdd.setEnabled(true);
+            } else {
+                textUnlessLessThan.setEnabled(false);
+                textThenAdd.setEnabled(false);
+            }
+        } else {
+            textAddValue.setEnabled(false);
+            chckbxUnlessLessThan.setEnabled(false);
+            lblThenAdd.setEnabled(false);
+            textUnlessLessThan.setEnabled(false);
+            textThenAdd.setEnabled(false);
+        }
+
+        txtFile.setEnabled(false);
+        textSplitChar.setEnabled(false);
+        textSplitChar2.setEnabled(false);
+        textRegExp.setEnabled(false);
+        combo.setEnabled(false);
+        combo_1.setEnabled(false);
+        lblAndTakeGroups.setEnabled(false);
+        btnBrowse.setEnabled(false);
+        if (bUseEverything.isSelected()) {
+            textSplitChar.setEnabled(true);
+            combo.setEnabled(true);
+        }
+        if (bSplitOnChar.isSelected()) {
+            textSplitChar2.setEnabled(true);
+            combo_1.setEnabled(true);
+            lblAndTakeGroups.setEnabled(true);
+        }
+        if (bUseRegexp.isSelected()) {
+            textRegExp.setEnabled(true);
+        }
+        if (bReadFromFile.isSelected()) {
+            btnBrowse.setEnabled(true);
+            txtFile.setEnabled(true);
+        }
+    }
+
+    private void createDelimiterBox(JRadioButton b) {
+        GridBagConstraints gbc = new GridBagConstraints();
+        gbc.insets = new Insets(0, 0, 5, 5);
+        gbc.anchor = GridBagConstraints.WEST;
+        gbc.gridx = 0;
+        gbc.gridy = 1;
+        guessPanel.add(b, gbc);
+
+        combo = new JComboBox(new String[] { "after first", "after last", "before first", "before last" });
+        combo.setName("delimiterCombo");
+        GridBagConstraints gbc2 = new GridBagConstraints();
+        gbc2.anchor = GridBagConstraints.WEST;
+        gbc2.gridwidth = 2;
+        gbc2.insets = new Insets(0, 0, 5, 5);
+        gbc2.gridx = 1;
+        gbc2.gridy = 1;
+        guessPanel.add(combo, gbc2);
+        combo.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                JComboBox combo = (JComboBox) e.getSource();
+                m_location = combo.getSelectedIndex();
+                bUseEverything.setSelected(true);
+                updateFields();
+            }
+        });
+    }
+
+    private void createSplitBox(JRadioButton b) {
+
+        textSplitChar = new JTextField("_");
+        textSplitChar.setName("SplitChar");
+        GridBagConstraints gbc_textField = new GridBagConstraints();
+        gbc_textField.anchor = GridBagConstraints.WEST;
+        gbc_textField.insets = new Insets(0, 0, 5, 5);
+        gbc_textField.gridx = 3;
+        gbc_textField.gridy = 1;
+        guessPanel.add(textSplitChar, gbc_textField);
+        textSplitChar.setColumns(2);
+
+        separator_2 = new JSeparator();
+        separator_2.setPreferredSize(new Dimension(5,1));
+        GridBagConstraints gbc_separator_2 = new GridBagConstraints();
+        gbc_separator_2.gridwidth = 5;
+        gbc_separator_2.insets = new Insets(5, 0, 15, 5);
+        gbc_separator_2.gridx = 0;
+        gbc_separator_2.gridy = 2;
+        gbc_separator_2.fill = GridBagConstraints.HORIZONTAL;
+        guessPanel.add(separator_2, gbc_separator_2);
+
+        GridBagConstraints gbc = new GridBagConstraints();
+        gbc.insets = new Insets(0, 0, 5, 5);
+        gbc.anchor = GridBagConstraints.WEST;
+        gbc.gridx = 0;
+        gbc.gridy = 4;
+        guessPanel.add(b, gbc);
+    }
+
+    public void createRegExtpBox(JRadioButton b) {
+
+        textSplitChar2 = new JTextField("_");
+        textSplitChar2.setName("SplitChar2");
+        GridBagConstraints gbc_textField_1 = new GridBagConstraints();
+        gbc_textField_1.anchor = GridBagConstraints.WEST;
+        gbc_textField_1.insets = new Insets(0, 0, 5, 5);
+        gbc_textField_1.gridx = 1;
+        gbc_textField_1.gridy = 4;
+        guessPanel.add(textSplitChar2, gbc_textField_1);
+        textSplitChar2.setColumns(2);
+
+        lblAndTakeGroups = new JLabel("and take group(s):");
+        GridBagConstraints gbc_lblAndTakeGroups = new GridBagConstraints();
+        gbc_lblAndTakeGroups.gridwidth = 2;
+        gbc_lblAndTakeGroups.insets = new Insets(0, 0, 5, 5);
+        gbc_lblAndTakeGroups.gridx = 2;
+        gbc_lblAndTakeGroups.gridy = 4;
+        guessPanel.add(lblAndTakeGroups, gbc_lblAndTakeGroups);
+
+        combo_1 = new JComboBox(new String[] { "1", "2", "3", "4", "1-2", "2-3", "3-4", "1-3", "2-4" });
+        combo_1.setName("splitCombo");
+        GridBagConstraints gbc_combo_1 = new GridBagConstraints();
+        gbc_combo_1.anchor = GridBagConstraints.WEST;
+        gbc_combo_1.insets = new Insets(0, 0, 5, 5);
+        gbc_combo_1.gridx = 4;
+        gbc_combo_1.gridy = 4;
+        guessPanel.add(combo_1, gbc_combo_1);
+        combo_1.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                JComboBox combo = (JComboBox) e.getSource();
+                m_splitlocation = combo.getSelectedIndex();
+                bSplitOnChar.setSelected(true);
+                updateFields();
+            }
+        });
+
+        separator_3 = new JSeparator();
+        separator_3.setPreferredSize(new Dimension(5,1));
+        GridBagConstraints gbc_separator_3 = new GridBagConstraints();
+        gbc_separator_3.gridwidth = 5;
+        gbc_separator_3.insets = new Insets(5, 0, 15, 5);
+        gbc_separator_3.gridx = 0;
+        gbc_separator_3.gridy = 5;
+        gbc_separator_3.fill = GridBagConstraints.HORIZONTAL;
+        guessPanel.add(separator_3, gbc_separator_3);
+
+        GridBagConstraints gbc = new GridBagConstraints();
+        gbc.insets = new Insets(0, 0, 5, 5);
+        gbc.anchor = GridBagConstraints.WEST;
+        gbc.gridx = 0;
+        gbc.gridy = 7;
+        guessPanel.add(b, gbc);
+    }
+
+    public Status showDialog(String title) {
+
+        JOptionPane optionPane = new JOptionPane(guessPanel, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION,
+                null, new String[] { "Cancel", "OK" }, "OK");
+        optionPane.setBorder(new EmptyBorder(12, 12, 12, 12));
+
+        final JDialog dialog = optionPane.createDialog(m_parent, title);
+        dialog.setName("GuessTaxonSets");
+        // dialog.setResizable(true);
+        dialog.pack();
+        updateFields();
+        dialog.setVisible(true);
+
+        if (optionPane.getValue() == null || !optionPane.getValue().equals("OK")) {
+            return Status.canceled;
+        }
+
+        if (bUseEverything.getModel() == group.getSelection()) {
+            String sDelimiter = normalise(textSplitChar.getText());
+            switch (m_location) {
+                case 0: // "after first",
+                    pattern = "^[^" + sDelimiter + "]+" + sDelimiter + "(.*)$";
+                    break;
+                case 1: // "after last",
+                    pattern = "^.*" + sDelimiter + "(.*)$";
+                    break;
+                case 2: // "before first",
+                    pattern = "^([^" + sDelimiter + "]+)" + sDelimiter + ".*$";
+                    break;
+                case 3: // "before last"
+                    pattern = "^(.*)" + sDelimiter + ".*$";
+                    break;
+            }
+        }
+        if (bSplitOnChar.getModel() == group.getSelection()) {
+            String sDelimiter = normalise(textSplitChar2.getText());
+            switch (m_splitlocation) {
+                case 0: // "1"
+                    pattern = "^([^" + sDelimiter + "]+)" + ".*$";
+                    break;
+                case 1: // "2"
+                    pattern = "^[^" + sDelimiter + "]+" + sDelimiter + "([^" + sDelimiter + "]+)" + ".*$";
+                    break;
+                case 2: // "3"
+                    pattern = "^[^" + sDelimiter + "]+" + sDelimiter + "[^" + sDelimiter + "]+" + sDelimiter + "([^"
+                            + sDelimiter + "]+)" + ".*$";
+                    break;
+                case 3: // "4"
+                    pattern = "^[^" + sDelimiter + "]+" + sDelimiter + "[^" + sDelimiter + "]+" + sDelimiter + "[^"
+                            + sDelimiter + "]+" + sDelimiter + "([^" + sDelimiter + "]+)" + ".*$";
+                    break;
+                case 4: // "1-2"
+                    pattern = "^([^" + sDelimiter + "]+" + sDelimiter + "[^" + sDelimiter + "]+)" + ".*$";
+                    break;
+                case 5: // "2-3"
+                    pattern = "^[^" + sDelimiter + "]+" + sDelimiter + "([^" + sDelimiter + "]+" + sDelimiter + "[^"
+                            + sDelimiter + "]+)" + ".*$";
+                    break;
+                case 6: // "3-4"
+                    pattern = "^[^" + sDelimiter + "]+" + sDelimiter + "[^" + sDelimiter + "]+" + sDelimiter + "([^"
+                            + sDelimiter + "]+" + sDelimiter + "[^" + sDelimiter + "]+)" + ".*$";
+                    break;
+                case 7: // "1-3"
+                    pattern = "^([^" + sDelimiter + "]+" + sDelimiter + "[^" + sDelimiter + "]+" + sDelimiter + "[^"
+                            + sDelimiter + "]+)" + ".*$";
+                    break;
+                case 8: // "2-4"
+                    pattern = "^[^" + sDelimiter + "]+" + sDelimiter + "([^" + sDelimiter + "]+" + sDelimiter + "[^"
+                            + sDelimiter + "]+" + sDelimiter + "[^" + sDelimiter + "]+)" + ".*$";
+            }
+        }
+        if (bUseRegexp.getModel() == group.getSelection()) {
+            pattern = textRegExp.getText();
+        }
+        if (bReadFromFile.getModel() == group.getSelection()) {
+            try {
+                BufferedReader fin = new BufferedReader(new FileReader(txtFile.getText()));
+                StringBuffer buf = new StringBuffer();
+                // eat up header
+                fin.readLine();
+                // process data
+                while (fin.ready()) {
+                    String str = fin.readLine();
+                    str = str.replaceFirst("\t", "=") + ",";
+                    // only add entries that are non-empty
+                    if (!str.matches("^\\s+=.*$")) {
+                        buf.append(str);
+                    }
+                }
+                fin.close();
+                trait = buf.toString().trim();
+                while (trait.endsWith(",")) {
+                    trait = trait.substring(0, trait.length() - 1).trim();
+                }
+            } catch (Exception e) {
+                JOptionPane.showMessageDialog(m_parent, "Loading trait from file failed:" + e.getMessage());
+                return Status.canceled;
+            }
+            return Status.trait;
+        }
+
+        // sanity check
+        try {
+            pattern.matches(pattern);
+        } catch (PatternSyntaxException e) {
+            JOptionPane.showMessageDialog(this, "This is not a valid regular expression");
+            return Status.canceled;
+        }
+
+        if (optionPane.getValue() != null && optionPane.getValue().equals("OK")) {
+            System.err.println("Pattern = " + pattern);
+            return Status.pattern;
+        } else {
+            return Status.canceled;
+        }
+    }
+
+    /**
+     * Converts the first character of sDelimiter into a substring suitable for
+     * inclusion in a regexp. This is done by expressing the character as an
+     * octal escape.
+     *
+     * @param sDelimiter first character of this string to be used as delimiter
+     * @return escaped octal representation of character
+     */
+    private String normalise(String sDelimiter) {
+
+        if (sDelimiter.length() == 0) {
+            return ".";
+        }
+
+        return String.format("\\0%o", (int)sDelimiter.charAt(0));
+    }
+
+    public String match(String s) {
+        Pattern _pattern = Pattern.compile(pattern);
+        Matcher matcher = _pattern.matcher(s);
+        if (matcher.find()) {
+            String match = matcher.group(1);
+            if (chckbxAddFixedValue.isSelected()) {
+                try {
+                    Double value = Double.parseDouble(match);
+                    Double addValue = Double.parseDouble(textAddValue.getText());
+                    if (chckbxUnlessLessThan.isSelected()) {
+                        Double threshold = Double.parseDouble(textUnlessLessThan.getText());
+                        Double addValue2 = Double.parseDouble(textThenAdd.getText());
+                        if (value < threshold) {
+                            value += addValue2;
+                        } else {
+                            value += addValue;
+                        }
+                    } else {
+                        value += addValue;
+                    }
+                    return value + "";
+                } catch (Exception e) {
+                    // ignore
+                }
+            }
+            return match;
+        }
+        return null;
+    }
+}
diff --git a/src/beast/app/beauti/JPackageDialog.java b/src/beast/app/beauti/JPackageDialog.java
new file mode 100644
index 0000000..ecf5407
--- /dev/null
+++ b/src/beast/app/beauti/JPackageDialog.java
@@ -0,0 +1,428 @@
+package beast.app.beauti;
+
+import beast.core.Description;
+import beast.util.AddOnManager;
+import beast.util.Package;
+
+import javax.swing.*;
+import javax.swing.event.TableModelEvent;
+import javax.swing.table.AbstractTableModel;
+
+import com.sun.java.swing.SwingUtilities3;
+
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import static beast.util.AddOnManager.*;
+
+/**
+ * dialog for managing Package.
+ * List, install and uninstall Package
+ *
+ * @author  Remco Bouckaert
+ * @author  Walter Xie
+ */
+ at Description("BEAUti package manager")
+public class JPackageDialog extends JPanel {
+    private static final long serialVersionUID = 1L;
+    JScrollPane scrollPane;
+    JLabel jLabel;
+    Box buttonBox;
+    JCheckBox allDepCheckBox = new JCheckBox("install/uninstall all dependencies", null, true);
+    JFrame frame;
+    JTable dataTable = null;
+
+    List<Package> packages = new ArrayList<Package>();
+
+    boolean isRunning;
+    Thread t;
+    
+    public JPackageDialog() {
+        jLabel = new JLabel("List of available packages for BEAST v" + beastVersion.getMajorVersion() + ".*");
+        frame = (JFrame) SwingUtilities.getWindowAncestor(this);
+        setLayout(new BorderLayout());
+
+		createTable();
+        // update pacakges using a 30 second time out
+        isRunning = true;
+        t = new Thread() {
+        	public void run() {
+                resetPackages();
+        		isRunning = false;
+        	}
+        };
+        t.start();
+    	Thread t2 = new Thread() {
+    		public void run() {
+    			try {
+    				// wait 30 seconds
+					sleep(30000);
+	    			if (isRunning) {
+	    				t.interrupt();
+	    				JOptionPane.showMessageDialog(frame, "<html>Download of file " +
+	    						AddOnManager.PACKAGES_XML + " timed out.<br>" +
+	    								"Perhaps this is due to lack of internet access</br>" +
+	    								"or some security settings not allowing internet access.</html>"
+	    						);
+	    			}
+				} catch (InterruptedException e) {
+				}
+    		};
+    	};
+    	t2.start();
+        
+        try {
+			t.join();
+		} catch (InterruptedException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+        	
+        scrollPane = new JScrollPane(dataTable);
+        /*getContentPane().*/add(BorderLayout.CENTER, scrollPane);
+
+        buttonBox = createButtonBox();
+        /*getContentPane().*/add(buttonBox, BorderLayout.SOUTH);
+
+        scrollPane.setPreferredSize(new Dimension(660, 400));
+        Dimension dim = scrollPane.getPreferredSize();
+        Dimension dim2 = buttonBox.getPreferredSize();
+        setSize(dim.width + 30, dim.height + dim2.height + 30);
+    }
+
+
+    private void createTable() {
+        DataTableModel dataTableModel = new DataTableModel();
+        dataTable = new JTable(dataTableModel);
+        
+        double [] widths = new double[dataTable.getColumnCount()];
+        double total = 0;
+        for (int i = 0; i < dataTable.getColumnCount(); i++) {
+        	widths[i] = dataTable.getColumnModel().getColumn(i).getWidth();
+        	total += widths[i]; 
+        }
+        widths[2] /= 4.0;
+        dataTable.getColumnModel().getColumn(2).setPreferredWidth((int) widths[2]);
+        dataTable.getColumnModel().getColumn(2).setMinWidth((int) widths[2]);
+        widths[3] /= 2.0; 
+        dataTable.getColumnModel().getColumn(3).setPreferredWidth((int) widths[3]);
+        widths[4] *= 2.0; 
+        dataTable.getColumnModel().getColumn(4).setPreferredWidth((int) widths[4]);
+        
+        
+        // TODO:
+        // The following would work ...
+        //dataTable.setAutoCreateRowSorter(true);
+        // ...if all processing was done based on the data in the table, 
+        // instead of the row number alone.
+        dataTable.setSelectionMode(DefaultListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
+        dataTable.addMouseListener(new MouseAdapter() {
+            public void mouseClicked(MouseEvent e) {
+                if (e.getClickCount() == 2) {
+                    Package selPackage = getSelectedPackage(dataTable.getSelectedRow());
+                    showDetail(selPackage);
+                }
+            }
+        });
+    }
+
+    private void resetPackages() {
+        packages.clear();
+        try {
+            packages = getPackages();
+        } catch (IOException e) {
+        	final String msg = "<html>" + NO_CONNECTION_MESSAGE.replaceAll("\\.", ".<br>") + "</html>";
+        	try {
+        	SwingUtilities.invokeLater(new Runnable() {
+				@Override
+				public void run() {
+		        	JOptionPane.showMessageDialog(null, msg);
+				}
+			});
+        	} catch (Exception e0) {
+        		e0.printStackTrace();
+        	}
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        dataTable.tableChanged(new TableModelEvent(dataTable.getModel()));
+
+        if (dataTable.getRowCount() > 0)
+            dataTable.setRowSelectionInterval(0, 0);
+
+    }
+
+    private Package getSelectedPackage(int selectedRow) {
+        if (packages.size() <= selectedRow)
+            throw new IllegalArgumentException("Incorrect row " + selectedRow +
+                    " is selected from package list, size = " + packages.size());
+        return packages.get(selectedRow);
+    }
+
+    private void showDetail(Package aPackage) {
+        //custom title, no icon
+        JOptionPane.showMessageDialog(null,
+                aPackage.toHTML(),
+                aPackage.packageName,
+                JOptionPane.PLAIN_MESSAGE);
+    }
+
+    private Box createButtonBox() {
+        Box box = Box.createHorizontalBox();
+        box.add(allDepCheckBox);
+        box.add(Box.createGlue());
+        JButton installButton = new JButton("Install/Upgrade");
+        installButton.addActionListener(new ActionListener() {
+
+            @Override
+            public void actionPerformed(ActionEvent e) {
+            	// first get rid of existing packages
+            	StringBuilder removedPackageNames = new StringBuilder();
+            	doUninstall(removedPackageNames);
+            	
+                int[] selectedRows = dataTable.getSelectedRows();
+                StringBuilder installedPackageNames = new StringBuilder();
+                                
+                for (int selRow : selectedRows) {
+                    Package selPackage = getSelectedPackage(selRow);
+                    if (selPackage != null) {
+                        try {
+//                            if (selPackage.isInstalled()) {
+//                                //TODO upgrade version
+//                            } else {
+                                setCursor(new Cursor(Cursor.WAIT_CURSOR));
+                                if (allDepCheckBox.isSelected()) {
+                                    installPackage(selPackage, false, null, packages);
+                                } else {
+                                    installPackage(selPackage, false, null, null);
+                                }
+                                if (installedPackageNames.length()>0)
+                                    installedPackageNames.append(", ");
+                                installedPackageNames.append("'")
+                                        .append(selPackage.packageName)
+                                        .append("'");
+                                
+                                setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
+//                            }
+                            resetPackages();
+                        } catch (Exception ex) {
+                            JOptionPane.showMessageDialog(null, "Install failed because: " + ex.getMessage());
+                            setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
+                        }
+                    }
+                }
+                
+                if (installedPackageNames.length()>0)
+                    JOptionPane.showMessageDialog(null, "Package(s) "
+                            + installedPackageNames.toString() + " installed. "
+                            + "Note that any changes to the BEAUti "
+                            + "interface will\n not appear until a "
+                            + "new document is created or BEAUti is "
+                            + "restarted.");
+            }
+        });
+        box.add(installButton);
+
+        JButton uninstallButton = new JButton("Uninstall");
+        uninstallButton.addActionListener(new ActionListener() {
+
+            @Override
+            public void actionPerformed(ActionEvent e) {
+            	StringBuilder removedPackageNames = new StringBuilder();
+            	boolean toDeleteFileExists = doUninstall(removedPackageNames);
+                resetPackages();
+
+                if (toDeleteFileExists) {
+                    JOptionPane.showMessageDialog(null, "<html>To complete uninstalling the package, BEAUti need to be restarted<br><br>Exiting now.</html>");
+                    System.exit(0);
+                }
+
+                if (removedPackageNames.length()>0)
+                    JOptionPane.showMessageDialog(null, "Package(s) "
+                            + removedPackageNames.toString() + " removed. "
+                            + "Note that any changes to the BEAUti "
+                            + "interface will\n not appear until a "
+                            + "new document is created or BEAUti is "
+                            + "restarted.");
+            }
+        });
+        box.add(uninstallButton);
+        
+        JButton packageRepoButton = new JButton("Package repositories");
+        packageRepoButton.addActionListener(new ActionListener() {
+
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                JPackageRepositoryDialog dlg = new JPackageRepositoryDialog(frame);
+                dlg.setVisible(true);
+                resetPackages();
+            }
+        });
+        box.add(packageRepoButton);
+
+        JButton closeButton = new JButton("Close");
+        closeButton.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+            	if (dlg != null) {
+            		dlg.setVisible(false);
+            	} else {
+            		setVisible(false);
+            	}
+            }
+        });
+        box.add(Box.createGlue());
+        box.add(closeButton);
+        box.add(Box.createGlue());
+
+        JButton button = new JButton("?");
+        button.setToolTipText(getPackageUserDir() + " " + getPackageSystemDir());
+        button.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                JOptionPane.showMessageDialog(scrollPane, "<html>By default, packages are installed in <br><br><em>" + getPackageUserDir() +
+                        "</em><br><br>and are available only to you.<br>" +
+                        "<br>Packages can also be moved manually to <br><br><em>" + getPackageSystemDir() +
+                        "</em><br><br>which makes them available to all users<br>"
+                        + "on your system.</html>");
+            }
+        });
+        box.add(button);
+        return box;
+    }
+
+    protected boolean doUninstall(StringBuilder removedPackageNames) {
+        int[] selectedRows = dataTable.getSelectedRows();
+        
+        boolean toDeleteFileExists = false;
+        for (int selRow : selectedRows) {
+            Package selPackage = getSelectedPackage(selRow);
+            if (selPackage != null) {
+                try {
+                    if (selPackage.isInstalled()) {
+//                    if (JOptionPane.showConfirmDialog(null, "Are you sure you want to uninstall " +
+//                    AddOnManager.URL2PackageName(package.url) + "?", "Uninstall Add On",
+//                            JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
+                        setCursor(new Cursor(Cursor.WAIT_CURSOR));
+                        uninstallPackage(selPackage, false, null, packages, allDepCheckBox.isSelected());
+                        setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
+
+                        File toDeleteFile = getToDeleteListFile();
+                        if (toDeleteFile.exists()) {
+                            toDeleteFileExists = true;
+                        }
+
+                        if (removedPackageNames.length()>0)
+                            removedPackageNames.append(", ");
+                        removedPackageNames.append("'")
+                                .append(selPackage.packageName)
+                                .append("'");
+//                    }
+                    } else {
+                        //TODO ?
+                    }
+                } catch (Exception ex) {
+                    JOptionPane.showMessageDialog(null, "Uninstall failed because: " + ex.getMessage());
+                    setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
+                }
+            }
+        }	
+        return toDeleteFileExists;
+	}
+
+	class DataTableModel extends AbstractTableModel {
+        String[] columnNames = {"Name", "Status/Version", "Latest", "Dependencies", "Detail"};
+
+        public int getColumnCount() {
+            return columnNames.length;
+        }
+
+        public int getRowCount() {
+            return packages.size();
+        }
+
+        public Object getValueAt(int row, int col) {
+            Package aPackage = packages.get(row);
+            switch (col) {
+                case 0:
+                    return aPackage.packageName;
+                case 1:
+                    return aPackage.getStatus();
+                case 2:
+                    return aPackage.getLatestVersion();
+                case 3:
+                    return aPackage.getDependenciesString();
+                case 4:
+                    return aPackage.description;
+                default:
+                    throw new IllegalArgumentException("unknown column, " + col);
+            }
+        }
+
+        public String getColumnName(int column) {
+            return columnNames[column];
+        }
+
+        public String toString() {
+            StringBuffer buffer = new StringBuffer();
+
+            buffer.append(getColumnName(0));
+            for (int j = 1; j < getColumnCount(); j++) {
+                buffer.append("\t");
+                buffer.append(getColumnName(j));
+            }
+            buffer.append("\n");
+
+            for (int i = 0; i < getRowCount(); i++) {
+                buffer.append(getValueAt(i, 0));
+                for (int j = 1; j < getColumnCount(); j++) {
+                    buffer.append("\t");
+                    buffer.append(getValueAt(i, j));
+                }
+                buffer.append("\n");
+            }
+
+            return buffer.toString();
+        }
+    }
+
+	
+	
+	public JDialog asDialog(JFrame frame) {
+		if (frame == null) {
+	        frame = (JFrame) SwingUtilities.getWindowAncestor(this);
+		}
+		this.frame = frame;
+    	dlg = new JDialog(frame, "BEAST 2 Package Manager", true);
+		dlg.getContentPane().add(scrollPane, BorderLayout.CENTER);  
+		dlg.getContentPane().add(jLabel, BorderLayout.NORTH);  
+		dlg.getContentPane().add(buttonBox, BorderLayout.SOUTH);  
+		dlg.pack();  
+        Point frameLocation = frame.getLocation();
+        Dimension frameSize = frame.getSize();
+        Dimension dim = getPreferredSize();
+		dlg.setSize(690, 430);
+        dlg.setLocation(frameLocation.x + frameSize.width / 2 - dim.width / 2, frameLocation.y + frameSize.height / 2 - dim.height / 2);
+
+        frame.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
+        return dlg;
+	}
+
+
+	JDialog dlg = null;
+	@Override
+	public void setCursor(Cursor cursor) {
+		if (dlg != null) {
+			dlg.setCursor(cursor);
+		} else {
+			super.setCursor(cursor);
+		}
+	}
+}
diff --git a/src/beast/app/beauti/JPackageRepositoryDialog.java b/src/beast/app/beauti/JPackageRepositoryDialog.java
new file mode 100644
index 0000000..6f75297
--- /dev/null
+++ b/src/beast/app/beauti/JPackageRepositoryDialog.java
@@ -0,0 +1,184 @@
+/*
+ * Copyright (C) 2014 Tim Vaughan <tgvaughan at gmail.com>.
+ *
+ * This library 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 library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301  USA
+ */
+package beast.app.beauti;
+
+import beast.util.AddOnManager;
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.Point;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+import javax.swing.Box;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JFrame;
+import javax.swing.JOptionPane;
+import javax.swing.JScrollPane;
+import javax.swing.JTable;
+import javax.swing.table.AbstractTableModel;
+
+/**
+ * @author Tim Vaughan <tgvaughan at gmail.com>
+ */
+public class JPackageRepositoryDialog extends JDialog {
+
+    public JPackageRepositoryDialog(final JFrame frame) {
+        super(frame);
+
+        setModal(true);
+        setTitle("BEAST 2 Package Repository Manager");
+        
+        // Get current list of URLs:
+        List<String> URLs;
+        try {
+            URLs = AddOnManager.getPackagesURL();
+        } catch (MalformedURLException exception) {
+            URLs = new ArrayList<String>();
+            URLs.add(AddOnManager.PACKAGES_XML);
+        }
+
+        // Assemble table
+        final RepoTableModel repoTableModel = new RepoTableModel(URLs);
+        final JTable repoTable = new JTable(repoTableModel);
+        JScrollPane scrollPane = new JScrollPane(repoTable);
+        getContentPane().add(scrollPane, BorderLayout.CENTER);
+        
+        // Add buttons
+        Box box = Box.createHorizontalBox();
+        
+        // ADD URL
+        JButton addURLButton = new JButton("Add URL");
+        addURLButton.addActionListener(new ActionListener() {
+            
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                String newURL = (String)JOptionPane.showInputDialog(frame,
+                        "Enter package repository URL",
+                        "Add repository URL",JOptionPane.PLAIN_MESSAGE, null, null, "http://");
+                
+                if (newURL == null)
+                    return; // User canceled
+                
+                if (!repoTableModel.URLs.contains(newURL)) {
+                    
+                    // Check that URL is accessible:
+                    try {
+                        URL url = new URL(newURL);
+                        if (url.getHost() == null)
+                            return;
+                        
+                        InputStream is = url.openStream();
+                        is.close();
+                      
+                    } catch (MalformedURLException ex) {
+                        JOptionPane.showMessageDialog(frame, "Invalid URL.");
+                        return;
+                    } catch (IOException ex) {
+                        JOptionPane.showMessageDialog(frame, "Could not access URL.");
+                        return;
+                    }
+
+                    // Add to table:                        
+                    repoTableModel.URLs.add(newURL);
+                    repoTableModel.fireTableDataChanged();  
+                } else {
+                    JOptionPane.showMessageDialog(frame, "Repository already exists!");
+                }
+            }
+        });
+        box.add(addURLButton);
+        
+        // DELETE URL
+        JButton deleteURLButton = new JButton("Delete selected URL");
+        deleteURLButton.addActionListener(new ActionListener() {
+
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                if (repoTable.getSelectedRow()>0) {
+                    if (JOptionPane.showConfirmDialog(frame, "Really delete this repository?") ==JOptionPane.YES_OPTION) {
+                        repoTableModel.URLs.remove(repoTable.getSelectedRow());
+                        repoTableModel.fireTableDataChanged();
+                    }
+                }
+            }
+        });
+        box.add(deleteURLButton);
+        
+        // DONE
+        JButton OKButton = new JButton("Done");
+        OKButton.addActionListener(new ActionListener() {
+
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                AddOnManager.savePackageURLs(repoTableModel.URLs);
+                setVisible(false);
+            }
+        });
+        box.add(OKButton);
+        getContentPane().add(box, BorderLayout.PAGE_END);
+
+        // Set size and location of dialog
+        Dimension dim = scrollPane.getPreferredSize();
+        Dimension dim2 = box.getPreferredSize();
+        setSize(dim.width + 30, dim.height + dim2.height + 30);
+        Point frameLocation = frame.getLocation();
+        Dimension frameSize = frame.getSize();
+        setLocation(frameLocation.x + frameSize.width / 2 - dim.width / 2,
+                frameLocation.y + frameSize.height / 2 - dim.height / 2);
+    }
+
+    /**
+     * Class of tables containing the current list of package repositories.
+     */
+    class RepoTableModel extends AbstractTableModel {
+
+        public List<String> URLs;
+
+        public RepoTableModel(List<String> URLs) {
+            this.URLs = URLs;
+        }
+
+        @Override
+        public int getRowCount() {
+            return URLs.size();
+        }
+
+        @Override
+        public int getColumnCount() {
+            return 1;
+        }
+
+        @Override
+        public String getColumnName(int column) {
+            return "Package repository URLs";
+        }
+
+        @Override
+        public Object getValueAt(int rowIndex, int columnIndex) {
+            return URLs.get(rowIndex);
+        }
+    }
+
+}
diff --git a/src/beast/app/beauti/LoggerListInputEditor.java b/src/beast/app/beauti/LoggerListInputEditor.java
new file mode 100644
index 0000000..495f084
--- /dev/null
+++ b/src/beast/app/beauti/LoggerListInputEditor.java
@@ -0,0 +1,61 @@
+package beast.app.beauti;
+
+import java.awt.Dimension;
+import java.util.List;
+
+import javax.swing.JTextField;
+
+import beast.app.draw.InputEditor;
+import beast.app.draw.ListInputEditor;
+import beast.app.draw.StringInputEditor;
+import beast.core.Input;
+import beast.core.Logger;
+import beast.core.BEASTObject;
+import beast.core.BEASTInterface;
+
+
+
+public class LoggerListInputEditor extends ListInputEditor {
+    private static final long serialVersionUID = 1L;
+
+	public LoggerListInputEditor(BeautiDoc doc) {
+		super(doc);
+	}
+
+    @Override
+    public Class<?> type() {
+        return List.class;
+    }
+
+    @Override
+    public Class<?> baseType() {
+        return Logger.class;
+    }
+    
+
+    @Override
+    public void init(Input<?> input, BEASTInterface plugin, int itemNr, ExpandOption bExpandOption, boolean bAddButtons) {
+    	super.init(input, plugin, itemNr, bExpandOption, bAddButtons);
+    }
+    
+    @Override
+    protected void addSingleItem(BEASTInterface plugin) {
+    	currentLogger = (Logger) plugin;
+    	super.addSingleItem(plugin);
+    }
+    
+    public InputEditor createFileNameEditor() throws Exception {
+        Input<?> input = currentLogger.fileNameInput;
+        StringInputEditor fileNameEditor = new StringInputEditor(doc);
+        fileNameEditor.init(input, currentLogger, -1, ExpandOption.FALSE, true);
+
+        // ensure file name entry has larger size than the standard size
+        JTextField fileNameEntry = fileNameEditor.getEntry();
+        Dimension size = new Dimension(400, fileNameEntry.getPreferredSize().height);
+        fileNameEntry.setMinimumSize(size);
+        fileNameEntry.setPreferredSize(size);
+        return fileNameEditor;
+    }
+    
+    Logger currentLogger;
+}
diff --git a/src/beast/app/beauti/MRCAPriorInputEditor.java b/src/beast/app/beauti/MRCAPriorInputEditor.java
new file mode 100644
index 0000000..20223bb
--- /dev/null
+++ b/src/beast/app/beauti/MRCAPriorInputEditor.java
@@ -0,0 +1,184 @@
+package beast.app.beauti;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.swing.Box;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JComboBox;
+
+import beast.app.draw.InputEditor;
+import beast.app.draw.SmallButton;
+import beast.core.Input;
+import beast.core.BEASTInterface;
+import beast.evolution.alignment.Taxon;
+import beast.evolution.alignment.TaxonSet;
+import beast.math.distributions.MRCAPrior;
+import beast.math.distributions.OneOnX;
+
+
+
+public class MRCAPriorInputEditor extends InputEditor.Base {
+	private static final long serialVersionUID = 1L;
+
+	public MRCAPriorInputEditor(BeautiDoc doc) {
+		super(doc);
+	}
+
+	@Override
+	public Class<?> type() {
+		return MRCAPrior.class;
+	}
+
+	@Override
+	public void init(Input<?> input, BEASTInterface plugin, final int listItemNr, ExpandOption bExpandOption, boolean bAddButtons) {
+        m_bAddButtons = bAddButtons;
+        m_input = input;
+        m_plugin = plugin;
+        this.itemNr= listItemNr;
+		
+        Box itemBox = Box.createHorizontalBox();
+
+        MRCAPrior prior = (MRCAPrior) plugin;
+        String sText = prior.getID();
+
+        JButton taxonButton = new JButton(sText);
+        taxonButton.setMinimumSize(PriorInputEditor.PREFERRED_SIZE);
+        taxonButton.setPreferredSize(PriorInputEditor.PREFERRED_SIZE);
+        itemBox.add(taxonButton);
+        taxonButton.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                List<?> list = (List<?>) m_input.get();
+                MRCAPrior prior = (MRCAPrior) list.get(itemNr);
+                try {
+                    TaxonSet taxonset = prior.taxonsetInput.get();
+                    Set<Taxon> candidates = getTaxonCandidates(prior);
+                    TaxonSetDialog dlg = new TaxonSetDialog(taxonset, candidates, doc);
+                    if (dlg.showDialog()) {
+                        prior.setID(dlg.taxonSet.getID());
+                        prior.taxonsetInput.setValue(dlg.taxonSet, prior);
+                    }
+                } catch (Exception e1) {
+                    // TODO Auto-generated catch block
+                    e1.printStackTrace();
+                }
+                refreshPanel();
+            }
+        });
+
+
+        if (prior.distInput.getType() == null) {
+            try {
+                prior.distInput.setValue(new OneOnX(), prior);
+                prior.distInput.setValue(null, prior);
+            } catch (Exception e) {
+                // TODO: handle exception
+            }
+
+        }
+
+        List<BeautiSubTemplate> sAvailablePlugins = doc.getInputEditorFactory().getAvailableTemplates(prior.distInput, prior, null, doc);
+        JComboBox comboBox = new JComboBox(sAvailablePlugins.toArray());
+        comboBox.setName(sText+".distr");
+
+        if (prior.distInput.get() != null) {
+            String sID = prior.distInput.get().getID();
+            //sID = BeautiDoc.parsePartition(sID);
+            sID = sID.substring(0, sID.indexOf('.'));
+            for (BeautiSubTemplate template : sAvailablePlugins) {
+                if (template.sClassInput.get() != null && template.sShortClassName.equals(sID)) {
+                    comboBox.setSelectedItem(template);
+                }
+            }
+        } else {
+            comboBox.setSelectedItem(BeautiConfig.NULL_TEMPLATE);
+        }
+        comboBox.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                JComboBox comboBox = (JComboBox) e.getSource();
+                BeautiSubTemplate template = (BeautiSubTemplate) comboBox.getSelectedItem();
+                List<?> list = (List<?>) m_input.get();
+                MRCAPrior prior = (MRCAPrior) list.get(itemNr);
+
+//System.err.println("PRIOR" + plugin2);
+//            	try {
+//					prior.m_distInput.setValue(plugin2, prior);
+//				} catch (Exception e1) {
+//					// TODO Auto-generated catch block
+//					e1.printStackTrace();
+//				}
+                try {
+                    //Plugin plugin2 =
+                    template.createSubNet(new PartitionContext(""), prior, prior.distInput, true);
+                } catch (Exception e1) {
+                    e1.printStackTrace();
+                }
+                refreshPanel();
+            }
+        });
+        itemBox.add(comboBox);
+
+        JCheckBox isMonophyleticdBox = new JCheckBox(doc.beautiConfig.getInputLabel(prior, prior.isMonophyleticInput.getName()));
+        isMonophyleticdBox.setName(sText+".isMonophyletic");
+        isMonophyleticdBox.setSelected(prior.isMonophyleticInput.get());
+        isMonophyleticdBox.setToolTipText(prior.isMonophyleticInput.getHTMLTipText());
+        isMonophyleticdBox.addActionListener(new MRCAPriorActionListener(prior));
+        itemBox.add(isMonophyleticdBox);
+
+        JButton deleteButton = new SmallButton("-", true);
+        deleteButton.setToolTipText("Delete this calibration");
+        deleteButton.addActionListener(new ActionListener() {
+			@Override
+			public void actionPerformed(ActionEvent e) {
+				System.err.println("Trying to delete a calibration");
+				List<?> list = (List<?>) m_input.get();
+				MRCAPrior prior = (MRCAPrior) list.get(itemNr);
+				doc.disconnect(prior, "prior", "distribution");
+				doc.disconnect(prior, "tracelog", "log");
+				doc.unregisterPlugin(prior);
+				refreshPanel();
+			}        	
+        });
+        itemBox.add(Box.createGlue());
+        itemBox.add(deleteButton);
+
+        add(itemBox);
+	}
+	
+    Set<Taxon> getTaxonCandidates(MRCAPrior prior) {
+        Set<Taxon> candidates = new HashSet<Taxon>();
+        for (String sTaxon : prior.treeInput.get().getTaxaNames()) {
+            Taxon taxon = doc.getTaxon(sTaxon);
+            candidates.add(taxon);
+        }
+        return candidates;
+    }
+
+    /**
+     * class to deal with toggling monophyletic flag on an MRCAPrior *
+     */
+    class MRCAPriorActionListener implements ActionListener {
+        MRCAPrior m_prior;
+
+        MRCAPriorActionListener(MRCAPrior prior) {
+            m_prior = prior;
+        }
+
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            try {
+                m_prior.isMonophyleticInput.setValue(((JCheckBox) e.getSource()).isSelected(), m_prior);
+                refreshPanel();
+            } catch (Exception ex) {
+                System.err.println("PriorListInputEditor " + ex.getMessage());
+            }
+        }
+    }
+
+}
diff --git a/src/beast/app/beauti/OperatorListInputEditor.java b/src/beast/app/beauti/OperatorListInputEditor.java
new file mode 100644
index 0000000..60fd5d6
--- /dev/null
+++ b/src/beast/app/beauti/OperatorListInputEditor.java
@@ -0,0 +1,168 @@
+package beast.app.beauti;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.Box;
+import javax.swing.JLabel;
+import javax.swing.JTextField;
+import javax.swing.event.DocumentEvent;
+import javax.swing.event.DocumentListener;
+
+import beast.app.draw.InputEditor;
+import beast.app.draw.ListInputEditor;
+import beast.core.Input;
+import beast.core.Operator;
+import beast.core.StateNode;
+import beast.core.BEASTObject;
+import beast.core.BEASTInterface;
+
+
+
+public class OperatorListInputEditor extends ListInputEditor {
+    private static final long serialVersionUID = 1L;
+    List<JTextField> textFields = new ArrayList<JTextField>();
+    List<Operator> operators = new ArrayList<Operator>();
+
+	public OperatorListInputEditor(BeautiDoc doc) {
+		super(doc);
+	}
+
+    @Override
+    public Class<?> type() {
+        return List.class;
+    }
+
+    @Override
+    public Class<?> baseType() {
+        return Operator.class;
+    }
+
+    @Override
+    public void init(Input<?> input, BEASTInterface plugin, int itemNr, ExpandOption bExpandOption, boolean bAddButtons) {
+    	Box box = Box.createHorizontalBox();
+    	box.add(Box.createHorizontalStrut(25));
+    	box.add(new JLabel("Operator"));
+    	box.add(Box.createGlue());
+    	box.add(new JLabel("Weight"));
+    	box.add(Box.createHorizontalStrut(20));
+    	add(box);
+    	
+    	m_buttonStatus = ButtonStatus.NONE;
+    	super.init(input, plugin, itemNr, bExpandOption, bAddButtons);
+    }
+    
+    @Override
+    protected InputEditor addPluginItem(Box itemBox, BEASTInterface plugin) {
+        Operator operator = (Operator) plugin;
+
+        JTextField entry = new JTextField(" " + getLabel(operator));
+        entry.setMinimumSize(new Dimension(200, 16));
+        //entry.setMaximumSize(new Dimension(200, 20));
+        m_entries.add(entry);
+        entry.setBackground(getBackground());
+        entry.setBorder(null);
+        itemBox.add(Box.createRigidArea(new Dimension(5, 1)));
+        itemBox.add(entry);
+        entry.setEditable(false);
+
+//        JLabel label = new JLabel(getLabel(operator));
+//        label.setBackground(Color.WHITE);
+//        m_labels.add(label);
+//        m_entries.add(null);
+//        itemBox.add(label);
+
+
+        itemBox.add(Box.createHorizontalGlue());
+        JTextField weightEntry = new JTextField();
+        weightEntry.setToolTipText(operator.m_pWeight.getHTMLTipText());
+        weightEntry.setText(operator.m_pWeight.get() + "");
+        weightEntry.getDocument().addDocumentListener(new OperatorDocumentListener(operator, weightEntry));
+        Dimension size = new Dimension(50, 25);
+        weightEntry.setMinimumSize(size);
+        weightEntry.setPreferredSize(size);
+        weightEntry.setMaximumSize(new Dimension(50, 50));
+        itemBox.add(weightEntry);
+
+        return this;
+    }
+
+
+    /**
+     * class to set weight-input on an operator when it changes in the list *
+     */
+    class OperatorDocumentListener implements DocumentListener {
+        Operator m_operator;
+        JTextField m_weightEntry;
+
+        OperatorDocumentListener(Operator operator, JTextField weightEntry) {
+            m_operator = operator;
+            m_weightEntry = weightEntry;
+            textFields.add(weightEntry);
+            operators.add(operator);
+        }
+
+        @Override
+        public void removeUpdate(DocumentEvent e) {
+            processEntry();
+        }
+
+        @Override
+        public void insertUpdate(DocumentEvent e) {
+            processEntry();
+        }
+
+        @Override
+        public void changedUpdate(DocumentEvent e) {
+            processEntry();
+        }
+
+        void processEntry() {
+            try {
+                Double fWeight = Double.parseDouble(m_weightEntry.getText());
+                m_operator.m_pWeight.setValue(fWeight, m_operator);
+            } catch (Exception e) {
+                // ignore
+            }
+            validate();
+        }
+    }
+
+    ;
+
+    @Override
+    public void updateState() {
+        super.updateState();
+        for (int i = 0; i < textFields.size(); i++) {
+            textFields.get(i).setText(operators.get(i).m_pWeight.get() + "");
+            //m_labels.get(i).setText(getLabel(m_operators.get(i)));
+            m_entries.get(i).setText(getLabel(operators.get(i)));
+        }
+    }
+
+    String getLabel(Operator operator) {
+        String sName = operator.getClass().getName();
+        sName = sName.substring(sName.lastIndexOf('.') + 1);
+        sName = sName.replaceAll("Operator", "");
+        if (sName.matches(".*[A-Z].*")) {
+            sName = sName.replaceAll("(.)([A-Z])", "$1 $2");
+        }
+        sName += ": ";
+        try {
+            for (BEASTInterface plugin2 : operator.listActivePlugins()) {
+                if (plugin2 instanceof StateNode && ((StateNode) plugin2).isEstimatedInput.get()) {
+                    sName += plugin2.getID() + " ";
+                }
+            }
+        } catch (Exception e) {
+            // ignore
+        }
+        String sTipText = getDoc().tipTextMap.get(operator.getID());
+        if (sTipText != null) {
+            sName += " " + sTipText;
+        }
+        return sName;
+    }
+} // OperatorListInputEditor
diff --git a/src/beast/app/beauti/ParametricDistributionInputEditor.java b/src/beast/app/beauti/ParametricDistributionInputEditor.java
new file mode 100644
index 0000000..59921bd
--- /dev/null
+++ b/src/beast/app/beauti/ParametricDistributionInputEditor.java
@@ -0,0 +1,345 @@
+package beast.app.beauti;
+
+
+import beast.app.draw.BEASTObjectInputEditor;
+import beast.core.BEASTInterface;
+import beast.core.Input;
+import beast.evolution.tree.TreeDistribution;
+import beast.math.distributions.MRCAPrior;
+import beast.math.distributions.ParametricDistribution;
+
+import java.awt.*;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+import javax.swing.BorderFactory;
+import javax.swing.Box;
+import javax.swing.JComponent;
+import javax.swing.JPanel;
+
+import org.apache.commons.math.MathException;
+
+public class ParametricDistributionInputEditor extends BEASTObjectInputEditor {
+
+    public ParametricDistributionInputEditor(BeautiDoc doc) {
+		super(doc);
+	}
+
+	private static final long serialVersionUID = 1L;
+    boolean useDefaultBehavior;
+	boolean mayBeUnstable;
+
+    @Override
+    public Class<?> type() {
+        //return ParametricDistributionInputEditor.class;
+        return ParametricDistribution.class;
+    }
+
+    @Override
+    public void init(Input<?> input, BEASTInterface plugin, int itemNr, ExpandOption bExpandOption, boolean bAddButtons) {
+        useDefaultBehavior = !((plugin instanceof beast.math.distributions.Prior) || plugin instanceof MRCAPrior || plugin instanceof TreeDistribution);
+
+//    	if (useDefaultBehavior && false) {
+//    		super.init(input, plugin, bExpandOption, bAddButtons);
+//    	} else {
+        m_bAddButtons = bAddButtons;
+        m_input = input;
+        m_plugin = plugin;
+		this.itemNr = itemNr;
+        if (input.get() != null) {
+            super.init(input, plugin, itemNr, ExpandOption.TRUE, bAddButtons);
+        }
+        add(createGraph());
+//    	}
+    } // init
+
+
+    @Override
+    /** suppress combobox **/
+    protected void addComboBox(JComponent box, Input<?> input, BEASTInterface plugin) {
+        if (useDefaultBehavior) {
+            super.addComboBox(box, input, plugin);
+        }
+    }
+
+    @Override
+    /** suppress input label**/
+    protected void addInputLabel() {
+        if (useDefaultBehavior) {
+            super.addInputLabel();
+        }
+    }
+
+    /**
+     * maps most significant digit to nr of ticks on graph *
+     */
+    final static int[] NR_OF_TICKS = new int[]{5, 10, 8, 6, 8, 10, 6, 7, 8, 9, 10};
+
+    /* class for drawing information for a parametric distribution **/
+    class PDPanel extends JPanel {
+        // the length in pixels of a tick
+        private static final int TICK_LENGTH = 5;
+
+        // the right margin
+        private static final int RIGHT_MARGIN = 20;
+
+        // the margin to the left of y-labels
+        private static final int MARGIN_LEFT_OF_Y_LABELS = 5;
+
+        // the top margin
+        private static final int TOP_MARGIN = 10;
+
+        int m_nTicks;
+        private static final long serialVersionUID = 1L;
+
+        @Override
+        public void paintComponent(java.awt.Graphics g) {
+
+            Graphics2D g2d = (Graphics2D)g;
+            g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+
+            final int width = getWidth();
+            final int height = getHeight();
+            final int labeloffset = 50;
+
+            ParametricDistribution m_distr = (ParametricDistribution)m_input.get();
+            if (m_distr == null) {
+                return;
+            }
+            try {
+                m_distr.initAndValidate();
+            } catch (Exception e1) {
+                // ignore
+            }
+
+            Font font = g.getFont();
+            double fMinValue = 0.1;
+            double fMaxValue = 1;
+            try {
+                fMinValue = m_distr.inverseCumulativeProbability(0.01);
+                fMaxValue = m_distr.inverseCumulativeProbability(0.99);
+            } catch (Exception e) {
+                // use defaults
+            }
+            double fXRange = fMaxValue - fMinValue;
+            // adjust fYMax so that the ticks come out right
+            double fX0 = fMinValue;
+            int k = 0;
+            double f = fXRange;
+            double f2 = fX0;
+            while (f > 10) {
+                f /= 10;
+                f2 /= 10;
+                k++;
+            }
+            while (f < 1 && f > 0) {
+                f *= 10;
+                f2 *= 10;
+                k--;
+            }
+            f = Math.ceil(f);
+            f2 = Math.floor(f2);
+//			final int NR_OF_TICKS_X = NR_OF_TICKS[(int) f];
+            for (int i = 0; i < k; i++) {
+                f *= 10;
+                f2 *= 10;
+            }
+            for (int i = k; i < 0; i++) {
+                f /= 10;
+                f2 /= 10;
+            }
+            //double fAdjXRange = f;
+
+            fXRange = fXRange + fMinValue - f2;
+            fXRange = adjust(fXRange);
+            final int NR_OF_TICKS_X = m_nTicks;
+
+            fMinValue = f2; //fXRange = fAdjXRange;
+
+            int nPoints;
+            if (!m_distr.isIntegerDistribution()) {
+                nPoints = 100;
+            } else {
+                nPoints = (int) (fXRange);
+            }
+            int[] xPoints = new int[nPoints];
+            int[] yPoints = new int[nPoints];
+            double[] fyPoints = new double[nPoints];
+            double fYMax = 0;
+            for (int i = 0; i < nPoints; i++) {
+                //try {
+                    fyPoints[i] = getDensityForPlot(m_distr, fMinValue + (fXRange * i) / nPoints);
+                //}
+                if (Double.isInfinite(fyPoints[i]) || Double.isNaN(fyPoints[i])) {
+                    fyPoints[i] = 0;
+                }
+                //fyPoints[i] = Math.exp(m_distr.logDensity(fMinValue + (fXRange * i)/nPoints));
+                fYMax = Math.max(fYMax, fyPoints[i]);
+            }
+
+            fYMax = adjust(fYMax);
+            final int NR_OF_TICKS_Y = m_nTicks;
+
+            // draw ticks on edge
+            Font smallFont = new Font(font.getName(), font.getStyle(), 8);
+            g.setFont(smallFont);
+
+            // collect the ylabels and the maximum label width in small font
+            String[] ylabels = new String[NR_OF_TICKS_Y+1];
+            int maxLabelWidth = 0;
+            FontMetrics sfm = getFontMetrics(smallFont);
+            for (int i = 0; i <= NR_OF_TICKS_Y; i++) {
+                ylabels[i] = format(fYMax * i / NR_OF_TICKS_Y);
+                int stringWidth = sfm.stringWidth(ylabels[i]);
+                if (stringWidth > maxLabelWidth) maxLabelWidth = stringWidth;
+            }
+
+            // collect the xlabels
+            String[] xlabels = new String[NR_OF_TICKS_X+1];
+            for (int i = 0; i <= NR_OF_TICKS_X; i++) {
+                xlabels[i] = format(fMinValue + fXRange * i / NR_OF_TICKS_X);
+            }
+            int maxLabelHeight = sfm.getMaxAscent()+sfm.getMaxDescent();
+
+            int leftMargin = maxLabelWidth + TICK_LENGTH + 1 + MARGIN_LEFT_OF_Y_LABELS;
+            int bottomMargin = maxLabelHeight + TICK_LENGTH + 1;
+
+            int nGraphWidth = width - leftMargin - RIGHT_MARGIN;
+            int nGraphHeight = height - TOP_MARGIN - bottomMargin - labeloffset;
+
+            // DRAW GRAPH PAPER
+            g.setColor(Color.WHITE);
+            g.fillRect(leftMargin, TOP_MARGIN, nGraphWidth, nGraphHeight);
+            g.setColor(Color.BLACK);
+            g.drawRect(leftMargin, TOP_MARGIN, nGraphWidth, nGraphHeight);
+
+            for (int i = 0; i < nPoints; i++) {
+                xPoints[i] = leftMargin + nGraphWidth * i / nPoints;
+                yPoints[i] = 1 + (int) (TOP_MARGIN + nGraphHeight - nGraphHeight * fyPoints[i] / fYMax);
+            }
+            if (!m_distr.isIntegerDistribution()) {
+                g.drawPolyline(xPoints, yPoints, nPoints);
+            } else {
+                int y0 = 1 + TOP_MARGIN + nGraphHeight;
+                int dotDiameter = nGraphHeight/20;
+                for (int i=0; i<nPoints; i++) {
+                    g.drawLine(xPoints[i], y0, xPoints[i], yPoints[i]);
+                    g.fillOval(xPoints[i]-dotDiameter/2, yPoints[i]-dotDiameter/2, dotDiameter, dotDiameter);
+                }
+            }
+
+            for (int i = 0; i <= NR_OF_TICKS_X; i++) {
+                int x = leftMargin + i * nGraphWidth / NR_OF_TICKS_X;
+                g.drawLine(x, TOP_MARGIN + nGraphHeight, x, TOP_MARGIN + nGraphHeight + TICK_LENGTH);
+                g.drawString(xlabels[i], x-sfm.stringWidth(xlabels[i])/2, TOP_MARGIN + nGraphHeight + TICK_LENGTH + 1 + sfm.getMaxAscent());
+            }
+
+            // draw the y labels and ticks
+            for (int i = 0; i <= NR_OF_TICKS_Y; i++) {
+                int y = TOP_MARGIN + nGraphHeight - i * nGraphHeight / NR_OF_TICKS_Y;
+                g.drawLine(leftMargin - TICK_LENGTH, y, leftMargin, y);
+                g.drawString(ylabels[i], leftMargin - TICK_LENGTH - 1 - sfm.stringWidth(ylabels[i]), y + 3);
+            }
+
+            g.setFont(new Font(font.getName(), font.getStyle(), 10));
+            try {
+                FontMetrics fontMetrics = g.getFontMetrics();
+                String[] sStrs = new String[]{"2.5% Quantile", "5% Quantile", "Median", "95% Quantile", "97.5% Quantile"};
+                Double[] fQuantiles = new Double[]{0.025, 0.05, 0.5, 0.95, 0.975};
+            	mayBeUnstable = false;
+                for (k = 0; k < 5; k++) {
+
+                    int y = TOP_MARGIN + nGraphHeight + bottomMargin + g.getFontMetrics().getMaxAscent() + k * 10;
+
+                	try {
+                        g.drawString(format(m_distr.inverseCumulativeProbability(fQuantiles[k])), nGraphWidth / 2 + leftMargin, y);
+                    } catch (MathException e) {
+                        g.drawString("not available", nGraphWidth / 2 + leftMargin, y);
+                    }
+                    g.drawString(sStrs[k], nGraphWidth / 2 - fontMetrics.stringWidth(sStrs[k]) + leftMargin - 10, y);
+                }
+                if (mayBeUnstable) {
+                	int x = nGraphWidth * 3/ 4 + leftMargin; int y =TOP_MARGIN + nGraphHeight + bottomMargin + 10;
+                    g.drawString("* numbers", x, y + 20); 
+                    g.drawString("may not be", x, y + 30);                	
+                    g.drawString("accurate", x, y + 40);                	
+                }
+            } catch (Exception e) {
+                // probably something wrong with the parameters of the parametric distribution
+                g.drawString("Improper parameters", leftMargin, TOP_MARGIN + nGraphHeight + bottomMargin + g.getFontMetrics().getMaxAscent());
+            }
+        }
+        
+        private String format(double value) {
+            StringWriter writer = new StringWriter();
+            PrintWriter pw = new PrintWriter(writer);
+            pw.printf("%.3g", value);
+            if (value != 0.0 && Math.abs(value) / 1000 < 1e-320) { // 2e-6 = 2 * AbstractContinuousDistribution.solverAbsoluteAccuracy
+            	mayBeUnstable = true;
+            	pw.printf("*");
+            }
+            pw.flush();
+            return writer.toString();
+        }
+        
+        private double adjust(double fYMax) {
+            // adjust fYMax so that the ticks come out right
+            int k = 0;
+            double fY = fYMax;
+            while (fY > 10) {
+                fY /= 10;
+                k++;
+            }
+            while (fY < 1 && fY > 0) {
+                fY *= 10;
+                k--;
+            }
+            fY = Math.ceil(fY);
+            m_nTicks = NR_OF_TICKS[(int) fY];
+            for (int i = 0; i < k; i++) {
+                fY *= 10;
+            }
+            for (int i = k; i < 0; i++) {
+                fY /= 10;
+            }
+            return fY;
+        }
+    }
+    
+    /**
+     * Returns the density of pDistr at x when pDistr is a density of a
+     * continuous variable, but returns the probability of the closest
+     * integer when pDistr is a probability distribution over an integer-valued
+     * parameter.
+     * 
+     * @param pDistr
+     * @param x
+     * @return density at x or probability of closest integer to x
+     */
+    private double getDensityForPlot(ParametricDistribution pDistr, double x) {
+        if (pDistr.isIntegerDistribution()) {
+            return pDistr.density((int) Math.round(x));
+        } else {
+            return pDistr.density(x);
+        }
+    }
+
+    private Component createGraph() {
+        JPanel panel = new PDPanel();
+        Dimension size = new Dimension(200, 200);
+        panel.setSize(size);
+        panel.setPreferredSize(size);
+        panel.setMinimumSize(size);
+        Box box = Box.createHorizontalBox();
+        box.setBorder(BorderFactory.createEmptyBorder());
+        box.add(panel);
+        return box;
+    }
+
+    @Override
+    public void validate() {
+        super.validate();
+        repaint();
+    }
+
+}
diff --git a/src/beast/app/beauti/PartitionContext.java b/src/beast/app/beauti/PartitionContext.java
new file mode 100644
index 0000000..e402f2a
--- /dev/null
+++ b/src/beast/app/beauti/PartitionContext.java
@@ -0,0 +1,70 @@
+package beast.app.beauti;
+
+
+import beast.core.BEASTObject;
+import beast.core.BEASTInterface;
+import beast.evolution.likelihood.GenericTreeLikelihood;
+
+public class PartitionContext {
+	public String partition;
+	public String siteModel;
+	public String clockModel;
+	public String tree;
+
+	public PartitionContext() {}
+	
+	public PartitionContext(String partition) {
+		this.partition = partition;
+		siteModel = partition;
+		clockModel = partition;
+		tree = partition;
+	}
+	
+	public PartitionContext(String partition,
+			String siteModel,
+			String clockModel,
+			String tree
+			) {
+		this.partition = partition;
+		this.siteModel = siteModel;
+		this.clockModel = clockModel;
+		this.tree = tree;
+	}
+	
+	public PartitionContext(GenericTreeLikelihood treeLikelihood) {
+		String sID = treeLikelihood.dataInput.get().getID();
+		sID = BeautiDoc.parsePartition(sID);
+		this.partition = sID;
+		if (treeLikelihood.branchRateModelInput.get() != null) {
+			sID = treeLikelihood.branchRateModelInput.get().getID();
+			sID = BeautiDoc.parsePartition(sID);
+		}
+		this.clockModel = sID;
+		sID = ((BEASTInterface) treeLikelihood.siteModelInput.get()).getID();
+		sID = BeautiDoc.parsePartition(sID);
+		this.siteModel = sID;
+		sID = treeLikelihood.treeInput.get().getID();
+		sID = BeautiDoc.parsePartition(sID);
+		this.tree = sID;
+	}
+	
+	@Override
+	public String toString() {
+		return partition + "," + siteModel + "," + clockModel + "," + tree;
+	}
+	
+	@Override
+	public boolean equals(Object obj) {
+		if (obj == null) {
+			return false;
+		}
+		if (obj instanceof PartitionContext) {
+			PartitionContext other = (PartitionContext) obj;
+			return other.partition.equals(partition) &&
+				other.siteModel.equals(siteModel) &&
+				other.clockModel.equals(clockModel) &&
+				other.tree.equals(tree);
+		}
+		return false;
+	}
+}
diff --git a/src/beast/app/beauti/PriorInputEditor.java b/src/beast/app/beauti/PriorInputEditor.java
new file mode 100644
index 0000000..b6463e0
--- /dev/null
+++ b/src/beast/app/beauti/PriorInputEditor.java
@@ -0,0 +1,126 @@
+package beast.app.beauti;
+
+import java.awt.Dimension;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.swing.Box;
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+
+import beast.app.draw.InputEditor;
+import beast.app.draw.BEASTObjectDialog;
+import beast.core.Input;
+import beast.core.BEASTInterface;
+import beast.core.parameter.RealParameter;
+import beast.math.distributions.Prior;
+
+public class PriorInputEditor extends InputEditor.Base {
+	private static final long serialVersionUID = 1L;
+
+	public PriorInputEditor(BeautiDoc doc) {
+		super(doc);
+	}
+
+	@Override
+	public Class<?> type() {
+		return Prior.class;
+	}
+
+	@Override
+	public void init(Input<?> input, BEASTInterface plugin, int listItemNr, ExpandOption bExpandOption, boolean bAddButtons) {
+        m_bAddButtons = bAddButtons;
+        m_input = input;
+        m_plugin = plugin;
+        this.itemNr= listItemNr;
+		
+        Box itemBox = Box.createHorizontalBox();
+
+        Prior prior = (Prior) plugin;
+        String sText = prior.getParameterName();
+        JLabel label = new JLabel(sText);
+        label.setMinimumSize(PREFERRED_SIZE);
+        label.setPreferredSize(PREFERRED_SIZE);
+        itemBox.add(label);
+
+        List<BeautiSubTemplate> sAvailablePlugins = doc.getInputEditorFactory().getAvailableTemplates(prior.distInput, prior, null, doc);
+        JComboBox comboBox = new JComboBox(sAvailablePlugins.toArray());
+        comboBox.setName(sText+".distr");
+
+        String sID = prior.distInput.get().getID();
+        System.err.println("id=" + sID);
+        sID = sID.substring(0, sID.indexOf('.'));
+        for (BeautiSubTemplate template : sAvailablePlugins) {
+            if (template.sClassInput.get() != null && template.sShortClassName.equals(sID)) {
+                comboBox.setSelectedItem(template);
+            }
+        }
+        comboBox.addActionListener(e -> {
+            JComboBox comboBox1 = (JComboBox) e.getSource();
+
+            List<?> list = (List<?>) m_input.get();
+
+            BeautiSubTemplate template = (BeautiSubTemplate) comboBox1.getSelectedItem();
+            //String sID = ((Plugin) list.get(iItem)).getID();
+            //String sPartition = BeautiDoc.parsePartition(sID);
+            PartitionContext context = doc.getContextFor((BEASTInterface) list.get(itemNr));
+            Prior prior1 = (Prior) list.get(itemNr);
+            try {
+                template.createSubNet(context, prior1, prior1.distInput, true);
+            } catch (Exception e1) {
+                e1.printStackTrace();
+            }
+
+            sync();
+            refreshPanel();
+        });
+        itemBox.add(comboBox);
+
+        if (prior.m_x.get() instanceof RealParameter) {
+            // add range button for real parameters
+            RealParameter p = (RealParameter) prior.m_x.get();
+            JButton rangeButton = new JButton(paramToString(p));
+            rangeButton.addActionListener(new ActionListener() {
+                @Override
+                public void actionPerformed(ActionEvent e) {
+                    JButton rangeButton = (JButton) e.getSource();
+
+                    List<?> list = (List<?>) m_input.get();
+                    Prior prior = (Prior) list.get(itemNr);
+                    RealParameter p = (RealParameter) prior.m_x.get();
+                    BEASTObjectDialog dlg = new BEASTObjectDialog(p, RealParameter.class, doc);
+                    if (dlg.showDialog()) {
+                        dlg.accept(p, doc);
+                        rangeButton.setText(paramToString(p));
+                        refreshPanel();
+                    }
+                }
+            });
+            itemBox.add(Box.createHorizontalStrut(10));
+            itemBox.add(rangeButton);
+        }
+        comboBox.setMaximumSize(new Dimension(1024, 24));
+
+        String sTipText = getDoc().tipTextMap.get(plugin.getID());
+        //System.out.println(plugin.getID());
+        if (sTipText != null) {
+            JLabel tipTextLabel = new JLabel(" " + sTipText);
+            itemBox.add(tipTextLabel);
+        }
+        itemBox.add(Box.createGlue());
+
+        add(itemBox);
+	}
+
+    String paramToString(RealParameter p) {
+        Double lower = p.lowerValueInput.get();
+        Double upper = p.upperValueInput.get();
+        return "initial = " + Arrays.toString(p.valuesInput.get().toArray()) +
+                " [" + (lower == null ? "-\u221E" : lower + "") +
+                "," + (upper == null ? "\u221E" : upper + "") + "]";
+    }
+
+}
diff --git a/src/beast/app/beauti/PriorListInputEditor.java b/src/beast/app/beauti/PriorListInputEditor.java
new file mode 100644
index 0000000..6fdd118
--- /dev/null
+++ b/src/beast/app/beauti/PriorListInputEditor.java
@@ -0,0 +1,272 @@
+package beast.app.beauti;
+
+
+
+import java.awt.Component;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.swing.Box;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JComboBox;
+import javax.swing.JOptionPane;
+
+import beast.app.draw.InputEditor;
+import beast.app.draw.ListInputEditor;
+import beast.app.draw.BEASTObjectPanel;
+import beast.app.draw.SmallButton;
+import beast.core.Distribution;
+import beast.core.Input;
+import beast.core.Logger;
+import beast.core.State;
+import beast.core.StateNode;
+import beast.core.BEASTInterface;
+import beast.core.parameter.RealParameter;
+import beast.evolution.alignment.Taxon;
+import beast.evolution.alignment.TaxonSet;
+import beast.evolution.tree.Tree;
+import beast.evolution.tree.TreeDistribution;
+import beast.evolution.tree.TreeInterface;
+import beast.math.distributions.MRCAPrior;
+import beast.math.distributions.OneOnX;
+import beast.math.distributions.Prior;
+
+
+
+public class PriorListInputEditor extends ListInputEditor {
+    private static final long serialVersionUID = 1L;
+
+    List<JComboBox> comboBoxes;
+    List<JButton> rangeButtons;
+    JComboBox currentComboBox;
+
+    List<JButton> taxonButtons;
+
+	public PriorListInputEditor(BeautiDoc doc) {
+		super(doc);
+	}
+
+    @Override
+    public Class<?> type() {
+        return List.class;
+    }
+
+    @Override
+    public Class<?> baseType() {
+        return Distribution.class;
+    }
+
+    @Override
+    public void init(Input<?> input, BEASTInterface plugin, int itemNr, ExpandOption bExpandOption, boolean bAddButtons) {
+    	List<?> list = (List) input.get();
+    	Collections.sort(list, new Comparator<Object>() {
+			@Override
+			public int compare(Object o1, Object o2) {
+				if (o1 instanceof BEASTInterface && o2 instanceof BEASTInterface) {
+					String sID1 = ((BEASTInterface)o1).getID();
+					String sID2 = ((BEASTInterface)o2).getID();
+					// first the tree priors
+					if (o1 instanceof TreeDistribution) {
+						if (o2 instanceof TreeDistribution) {
+							TreeInterface tree1 = ((TreeDistribution)o1).treeInput.get();
+							if (tree1 == null) {
+								tree1 = ((TreeDistribution)o1).treeIntervalsInput.get().treeInput.get();
+							}
+							TreeInterface tree2 = ((TreeDistribution)o2).treeInput.get();
+							if (tree2 == null) {
+								tree2 = ((TreeDistribution)o2).treeIntervalsInput.get().treeInput.get();
+							}
+							return sID1.compareTo(sID2);
+						} else {
+							return -1;
+						}
+					} else if (o1 instanceof MRCAPrior) {
+						// last MRCA priors
+						if (o2 instanceof MRCAPrior) {
+							return sID1.compareTo(sID2);
+						} else {
+							return 1;
+						}
+					} else {
+						if (o2 instanceof TreeDistribution) {
+							return 1;
+						}
+						if (o2 instanceof MRCAPrior) {
+							return -1;
+						}
+						if (o1 instanceof Prior) {
+							sID1 = ((Prior) o1).getParameterName(); 
+						}
+						if (o2 instanceof Prior) {
+							sID2 = ((Prior) o2).getParameterName(); 
+						}
+						return sID1.compareTo(sID2);
+					}
+				}
+				return 0;
+			}
+		});
+    	
+    	
+        comboBoxes = new ArrayList<JComboBox>();
+        rangeButtons = new ArrayList<JButton>();
+        taxonButtons = new ArrayList<JButton>();
+        
+        //m_buttonStatus = ButtonStatus.NONE;
+        super.init(input, plugin, itemNr, bExpandOption, bAddButtons);
+
+        
+        if (m_buttonStatus == ButtonStatus.ALL || m_buttonStatus == ButtonStatus.ADD_ONLY) {
+	        addButton = new SmallButton("+", true);
+	        addButton.setName("addItem");
+	        addButton.setToolTipText("Add item to the list");
+	        addButton.addActionListener(new ActionListener() {
+	            public void actionPerformed(ActionEvent e) {
+	                addItem();
+	            }
+	        });
+	        buttonBox.add(addButton);
+            buttonBox.add(Box.createHorizontalGlue());
+        }
+    }
+
+
+    /**
+     * add components to box that are specific for the plugin.
+     * By default, this just inserts a label with the plugin ID
+     *
+     * @param itemBox box to add components to
+     * @param plugin  plugin to add
+     */
+    @Override
+    protected InputEditor addPluginItem(Box itemBox, BEASTInterface plugin) {
+		try {
+	    	int listItemNr = ((List) m_input.get()).indexOf(plugin);
+	    	InputEditor editor = doc.getInputEditorFactory().createInputEditor(m_input, listItemNr, plugin, false, ExpandOption.FALSE, ButtonStatus.NONE, null, doc);
+	    	itemBox.add((Component) editor);
+	    	return editor;
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		return this;
+    }	
+
+
+    String paramToString(RealParameter p) {
+        Double lower = p.lowerValueInput.get();
+        Double upper = p.upperValueInput.get();
+        return "initial = " + p.valuesInput.get() +
+                " [" + (lower == null ? "-\u221E" : lower + "") +
+                "," + (upper == null ? "\u221E" : upper + "") + "]";
+    }
+
+    Set<Taxon> getTaxonCandidates(MRCAPrior prior) {
+        Set<Taxon> candidates = new HashSet<Taxon>();
+        Tree tree = prior.treeInput.get();
+        String [] taxa = null;
+        if (tree.m_taxonset.get() != null) {
+        	try {
+            	TaxonSet set = tree.m_taxonset.get();
+        		set.initAndValidate();
+            	taxa = set.asStringList().toArray(new String[0]);
+        	} catch (Exception e) {
+            	taxa = prior.treeInput.get().getTaxaNames();
+			}
+        } else {
+        	taxa = prior.treeInput.get().getTaxaNames();
+        }
+        
+        for (String sTaxon : taxa) {
+            candidates.add(doc.getTaxon(sTaxon));
+        }
+        return candidates;
+    }
+
+    /**
+     * class to deal with toggling monophyletic flag on an MRCAPrior *
+     */
+    class MRCAPriorActionListener implements ActionListener {
+        MRCAPrior m_prior;
+
+        MRCAPriorActionListener(MRCAPrior prior) {
+            m_prior = prior;
+        }
+
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            try {
+                m_prior.isMonophyleticInput.setValue(((JCheckBox) e.getSource()).isSelected(), m_prior);
+                refreshPanel();
+            } catch (Exception ex) {
+                System.err.println("PriorListInputEditor " + ex.getMessage());
+            }
+        }
+    }
+
+    @Override
+    protected void addItem() {
+        super.addItem();
+        sync();
+        refreshPanel();
+    } // addItem
+
+    protected List<BEASTInterface> pluginSelector(Input<?> input, BEASTInterface parent, List<String> tabooList) {
+        MRCAPrior prior = new MRCAPrior();
+        try {
+
+            List<Tree> trees = new ArrayList<Tree>();
+            getDoc().scrubAll(true, false);
+            State state = (State) doc.pluginmap.get("state");
+            for (StateNode node : state.stateNodeInput.get()) {
+                if (node instanceof Tree) { // && ((Tree) node).m_initial.get() != null) {
+                    trees.add((Tree) node);
+                }
+            }
+            int iTree = 0;
+            if (trees.size() > 1) {
+                String[] sTreeIDs = new String[trees.size()];
+                for (int j = 0; j < sTreeIDs.length; j++) {
+                    sTreeIDs[j] = trees.get(j).getID();
+                }
+                iTree = JOptionPane.showOptionDialog(null, "Select a tree", "MRCA selector",
+                        JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null,
+                        sTreeIDs, trees.get(0));
+            }
+            if (iTree < 0) {
+                return null;
+            }
+            prior.treeInput.setValue(trees.get(iTree), prior);
+            TaxonSet taxonSet = new TaxonSet();
+
+            TaxonSetDialog dlg = new TaxonSetDialog(taxonSet, getTaxonCandidates(prior), doc);
+            if (!dlg.showDialog() || dlg.taxonSet.getID() == null || dlg.taxonSet.getID().trim().equals("")) {
+                return null;
+            }
+            taxonSet = dlg.taxonSet;
+            BEASTObjectPanel.addPluginToMap(taxonSet, doc);
+            prior.taxonsetInput.setValue(taxonSet, prior);
+            prior.setID(taxonSet.getID() + ".prior");
+            // this sets up the type
+            prior.distInput.setValue(new OneOnX(), prior);
+            // this removes the parametric distribution
+            prior.distInput.setValue(null, prior);
+
+            Logger logger = (Logger) doc.pluginmap.get("tracelog");
+            logger.loggersInput.setValue(prior, logger);
+        } catch (Exception e) {
+            // TODO: handle exception
+        }
+        List<BEASTInterface> selectedPlugins = new ArrayList<BEASTInterface>();
+        selectedPlugins.add(prior);
+        g_collapsedIDs.add(prior.getID());
+        return selectedPlugins;
+    }
+}
diff --git a/src/beast/app/beauti/SiteModelInputEditor.java b/src/beast/app/beauti/SiteModelInputEditor.java
new file mode 100644
index 0000000..f77a2c2
--- /dev/null
+++ b/src/beast/app/beauti/SiteModelInputEditor.java
@@ -0,0 +1,343 @@
+package beast.app.beauti;
+
+import java.awt.Color;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.Box;
+import javax.swing.JCheckBox;
+import javax.swing.JComponent;
+import javax.swing.JTextField;
+import javax.swing.event.DocumentEvent;
+import javax.swing.event.DocumentListener;
+
+import beast.app.draw.InputEditor;
+import beast.app.draw.IntegerInputEditor;
+import beast.app.draw.ParameterInputEditor;
+import beast.app.draw.SmallLabel;
+import beast.app.draw.BEASTObjectInputEditor;
+import beast.core.Distribution;
+import beast.core.Input;
+import beast.core.MCMC;
+import beast.core.Operator;
+import beast.core.BEASTInterface;
+import beast.core.parameter.IntegerParameter;
+import beast.core.parameter.RealParameter;
+import beast.core.util.CompoundDistribution;
+import beast.evolution.alignment.Alignment;
+import beast.evolution.likelihood.GenericTreeLikelihood;
+import beast.evolution.operators.DeltaExchangeOperator;
+import beast.evolution.sitemodel.SiteModel;
+import beast.evolution.sitemodel.SiteModelInterface;
+
+public class SiteModelInputEditor extends BEASTObjectInputEditor {
+    private static final long serialVersionUID = 1L;
+
+    IntegerInputEditor categoryCountEditor;
+    JTextField categoryCountEntry;
+    InputEditor gammaShapeEditor;
+    ParameterInputEditor inVarEditor;
+
+    // vars for dealing with mean-rate delta exchange operator
+    JCheckBox fixMeanRatesCheckBox;
+    DeltaExchangeOperator operator;
+    protected SmallLabel fixMeanRatesValidateLabel;
+
+	public SiteModelInputEditor(BeautiDoc doc) {
+		super(doc);
+	}
+
+    @Override
+    public Class<?> type() {
+        return SiteModelInterface.Base.class;
+    }
+    
+    @Override
+    public void init(Input<?> input, BEASTInterface plugin, int itemNr,
+    		ExpandOption bExpandOption, boolean bAddButtons) {
+    	fixMeanRatesCheckBox = new JCheckBox("Fix mean substitution rate");
+    	fixMeanRatesCheckBox.setName("FixMeanMutationRate");
+    	fixMeanRatesCheckBox.setEnabled(!doc.bAutoUpdateFixMeanSubstRate);
+    	super.init(input, plugin, itemNr, bExpandOption, bAddButtons);
+
+		List<Operator> operators = ((MCMC) doc.mcmc.get()).operatorsInput.get();
+    	fixMeanRatesCheckBox.addActionListener(new ActionListener() {			
+			@Override
+			public void actionPerformed(ActionEvent e) {
+				JCheckBox averageRatesBox = (JCheckBox) e.getSource();
+				doFixMeanRates(averageRatesBox.isSelected());
+				if (averageRatesBox.isSelected())
+					// set up relative weights
+					setUpOperator();
+			}
+		});
+    	operator = (DeltaExchangeOperator) doc.pluginmap.get("FixMeanMutationRatesOperator");
+    	if (operator == null) {
+    		operator = new DeltaExchangeOperator();
+    		try {
+    			operator.setID("FixMeanMutationRatesOperator");
+				operator.initByName("weight", 2.0, "delta", 0.75);
+			} catch (Throwable e1) {
+				// ignore initAndValidate exception
+			}
+    		doc.addPlugin(operator);
+    	}
+		fixMeanRatesCheckBox.setSelected(operators.contains(operator));
+		Box box = Box.createHorizontalBox();
+		box.add(fixMeanRatesCheckBox);
+		box.add(Box.createHorizontalGlue());
+		fixMeanRatesValidateLabel = new SmallLabel("x", Color.GREEN);
+		fixMeanRatesValidateLabel.setVisible(false);
+		box.add(fixMeanRatesValidateLabel);
+		
+    	if (doc.alignments.size() >= 1 && operator != null) {
+        	JComponent component = (JComponent) getComponents()[0];
+    		component.add(box);
+    	}
+		setUpOperator();
+    }
+    
+//	@Override
+//    public Class<?> [] types() {
+//		Class<?>[] types = {SiteModel.class, SiteModel.Base.class}; 
+//		return types;
+//    }
+
+	private void doFixMeanRates(boolean averageRates) {
+		List<Operator> operators = ((MCMC) doc.mcmc.get()).operatorsInput.get();
+		if (averageRates) {
+			// connect DeltaExchangeOperator
+			if (!operators.contains(operator)) {
+				operators.add(operator);
+			}
+		} else {
+			operators.remove(operator);
+			fixMeanRatesValidateLabel.setVisible(false);
+			repaint();
+		}
+	}
+
+    public InputEditor createMutationRateEditor() throws Exception {
+    	SiteModel sitemodel = ((SiteModel) m_input.get()); 
+        Input<?> input = sitemodel.muParameterInput;
+        ParameterInputEditor mutationRateEditor = new ParameterInputEditor(doc);
+        mutationRateEditor.init(input, sitemodel, -1, ExpandOption.FALSE, true);
+        mutationRateEditor.getEntry().setEnabled(!doc.bAutoUpdateFixMeanSubstRate);
+        return mutationRateEditor;
+    }
+	
+	public InputEditor createGammaCategoryCountEditor() throws Exception {
+    	SiteModel sitemodel = ((SiteModel) m_input.get()); 
+        Input<?> input = sitemodel.gammaCategoryCount;
+        categoryCountEditor = new IntegerInputEditor(doc) {
+			private static final long serialVersionUID = 1L;
+
+			public void validateInput() {
+        		super.validateInput();
+            	SiteModel sitemodel = (SiteModel) m_plugin; 
+                if (sitemodel.gammaCategoryCount.get() < 2 && ((RealParameter)sitemodel.shapeParameterInput.get()).isEstimatedInput.get()) {
+                	m_validateLabel.m_circleColor = Color.orange;
+                	m_validateLabel.setToolTipText("shape parameter is estimated, but not used");
+                	m_validateLabel.setVisible(true);
+                }
+        	};
+        };
+        
+        categoryCountEditor.init(input, sitemodel, -1, ExpandOption.FALSE, true);
+        categoryCountEntry = categoryCountEditor.getEntry();
+        categoryCountEntry.getDocument().addDocumentListener(new DocumentListener() {
+            @Override
+            public void removeUpdate(DocumentEvent e) {
+                processEntry2();
+            }
+
+            @Override
+            public void insertUpdate(DocumentEvent e) {
+                processEntry2();
+            }
+
+            @Override
+            public void changedUpdate(DocumentEvent e) {
+                processEntry2();
+            }
+        });
+        
+       	categoryCountEditor.validateInput();
+        return categoryCountEditor;
+    }
+
+    void processEntry2() {
+        String sCategories = categoryCountEntry.getText();
+        try {
+            int nCategories = Integer.parseInt(sCategories);
+            gammaShapeEditor.getComponent().setVisible(nCategories >= 2);
+            repaint();
+        } catch (java.lang.NumberFormatException e) {
+            // ignore.
+        }
+    }
+
+    public InputEditor createShapeEditor() throws Exception {
+        Input<?> input = ((SiteModel) m_input.get()).shapeParameterInput;
+        gammaShapeEditor = doc.getInputEditorFactory().createInputEditor(input, (BEASTInterface) m_input.get(), doc);
+        gammaShapeEditor.getComponent().setVisible(((SiteModel) m_input.get()).gammaCategoryCount.get() >= 2);
+        return gammaShapeEditor;
+    }
+
+    public InputEditor createProportionInvariantEditor() throws Exception {
+        Input<?> input = ((SiteModel) m_input.get()).invarParameterInput;
+        inVarEditor = new ParameterInputEditor(doc) {
+			private static final long serialVersionUID = 1L;
+
+			@Override
+            public void validateInput() {
+				RealParameter p = (RealParameter) m_input.get();
+				if (p.isEstimatedInput.get() && p.valuesInput.get().get(0) <= 0.0) {
+                    m_validateLabel.setVisible(true);
+                    m_validateLabel.setToolTipText("<html><p>Proportion invariant should be non-zero when estimating</p></html>");
+                    return;
+				}
+				if (p.valuesInput.get().get(0) < 0.0 || p.valuesInput.get().get(0) >= 1.0) {
+                    m_validateLabel.setVisible(true);
+                    m_validateLabel.setToolTipText("<html><p>Proportion invariant should be from 0 to 1 (exclusive 1)</p></html>");
+                    return;
+				}
+            	super.validateInput();
+            }
+        };
+        inVarEditor.init(input, (BEASTInterface) m_input.get(), -1, ExpandOption.FALSE, true);
+        inVarEditor.addValidationListener(this);
+        return inVarEditor;
+    }
+
+    public static boolean customConnector(BeautiDoc doc) {
+ 		try {
+ 	        DeltaExchangeOperator operator = (DeltaExchangeOperator) doc.pluginmap.get("FixMeanMutationRatesOperator");
+ 	        if (operator == null) {
+ 	        	return false;
+ 	        }
+
+ 	       	List<RealParameter> parameters = operator.parameterInput.get();
+ 	    	parameters.clear();
+		   	//String weights = "";
+		    CompoundDistribution likelihood = (CompoundDistribution) doc.pluginmap.get("likelihood");
+		    boolean hasOneEstimatedRate = false;
+		    List<String> rateIDs = new ArrayList<>();
+		    List<Integer> weights = new ArrayList<>();
+			for (Distribution d : likelihood.pDistributions.get()) {
+				GenericTreeLikelihood treelikelihood = (GenericTreeLikelihood) d;
+	    		Alignment data = treelikelihood.dataInput.get(); 
+	    		int weight = data.getSiteCount();
+	    		if (treelikelihood.siteModelInput.get() instanceof SiteModel) {
+		    		SiteModel siteModel = (SiteModel) treelikelihood.siteModelInput.get();
+		    		RealParameter mutationRate = siteModel.muParameterInput.get();
+		    		//clockRate.m_bIsEstimated.setValue(true, clockRate);
+		    		if (mutationRate.isEstimatedInput.get()) {
+		    			hasOneEstimatedRate = true;
+		    			if (rateIDs.indexOf(mutationRate.getID()) == -1) {
+			    			parameters.add(mutationRate);
+			    			weights.add(weight);
+			    			rateIDs.add(mutationRate.getID());
+		    			} else {
+		    				int k = rateIDs.indexOf(mutationRate.getID());
+			    			weights.set(k,  weights.get(k) + weight);
+		    			}
+		    		}
+	    		}
+	    	}
+			
+			
+		    IntegerParameter weightParameter;
+			if (weights.size() == 0) {
+		    	weightParameter = new IntegerParameter();
+			} else {
+				String weightString = "";
+				for (int k : weights) {
+					weightString += k + " ";
+				}
+		    	weightParameter = new IntegerParameter(weightString);
+				weightParameter.setID("weightparameter");
+				
+			}
+			weightParameter.isEstimatedInput.setValue(false, weightParameter);
+	    	operator.parameterWeightsInput.setValue(weightParameter, operator);
+	    	return hasOneEstimatedRate;
+		} catch (Exception e) {
+			
+		}
+		return false;
+    }
+    
+    /** set up relative weights and parameter input **/
+    public void setUpOperator() {
+    	boolean bAllClocksAreEqual = true;
+    	try {
+    		boolean hasOneEstimatedRate = customConnector(doc);
+		    if (doc.bAutoUpdateFixMeanSubstRate) {
+		    	fixMeanRatesCheckBox.setSelected(hasOneEstimatedRate);
+		    	doFixMeanRates(hasOneEstimatedRate);
+		    }
+
+
+     		try {
+     	    	double commonClockRate = -1;
+    		    CompoundDistribution likelihood = (CompoundDistribution) doc.pluginmap.get("likelihood");
+    			for (Distribution d : likelihood.pDistributions.get()) {
+    				GenericTreeLikelihood treelikelihood = (GenericTreeLikelihood) d;
+    	    		if (treelikelihood.siteModelInput.get() instanceof SiteModel) {
+    		    		SiteModel siteModel = (SiteModel) treelikelihood.siteModelInput.get();
+    		    		RealParameter mutationRate = siteModel.muParameterInput.get();
+    		    		//clockRate.m_bIsEstimated.setValue(true, clockRate);
+    		    		if (mutationRate.isEstimatedInput.get()) {
+    		    			if (commonClockRate < 0) {
+    		    				commonClockRate = mutationRate.valuesInput.get().get(0);
+    		    			} else {
+    		    				if (Math.abs(commonClockRate - mutationRate.valuesInput.get().get(0)) > 1e-10) {
+    		    					bAllClocksAreEqual = false;
+    		    				}
+    		    			}
+    		    		}
+    	    		}
+    	    	}
+
+    		} catch (Exception e) {
+    			
+    		}
+   		
+    		List<RealParameter> parameters = operator.parameterInput.get();
+	    	if (!fixMeanRatesCheckBox.isSelected()) {
+	    		fixMeanRatesValidateLabel.setVisible(false);
+				repaint();
+	    		return;
+	    	}
+	    	if (parameters.size() == 0) {
+	    		fixMeanRatesValidateLabel.setVisible(true);
+	    		fixMeanRatesValidateLabel.m_circleColor = Color.red;
+	    		fixMeanRatesValidateLabel.setToolTipText("The model is invalid: At least one substitution rate should be estimated.");
+				repaint();
+	    		return;
+	    	}
+	    	if (!bAllClocksAreEqual) {
+	    		fixMeanRatesValidateLabel.setVisible(true);
+	    		fixMeanRatesValidateLabel.m_circleColor = Color.orange;
+	    		fixMeanRatesValidateLabel.setToolTipText("Not all clocks are equal. Are you sure this is what you want?");
+	    	} else if (parameters.size() == 1) {
+	    		fixMeanRatesValidateLabel.setVisible(true);
+	    		fixMeanRatesValidateLabel.m_circleColor = Color.orange;
+	    		fixMeanRatesValidateLabel.setToolTipText("At least 2 clock models should have their rate estimated");
+	    	} else if (parameters.size() < doc.alignments.size()) {
+	    		fixMeanRatesValidateLabel.setVisible(true);
+	    		fixMeanRatesValidateLabel.m_circleColor = Color.orange;
+	    		fixMeanRatesValidateLabel.setToolTipText("Not all partitions have their rate estimated");
+	    	} else {
+	    		fixMeanRatesValidateLabel.setVisible(false);
+	    	}
+			repaint();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+
+}
diff --git a/src/beast/app/beauti/SpeciesTreePriorInputEditor.java b/src/beast/app/beauti/SpeciesTreePriorInputEditor.java
new file mode 100644
index 0000000..35f46a0
--- /dev/null
+++ b/src/beast/app/beauti/SpeciesTreePriorInputEditor.java
@@ -0,0 +1,38 @@
+package beast.app.beauti;
+
+import javax.swing.Box;
+import javax.swing.JComponent;
+
+import beast.app.draw.BEASTObjectInputEditor;
+import beast.core.Input;
+import beast.core.BEASTObject;
+import beast.core.BEASTInterface;
+import beast.evolution.speciation.SpeciesTreePrior;
+
+
+
+public class SpeciesTreePriorInputEditor extends BEASTObjectInputEditor {
+	private static final long serialVersionUID = 1L;
+
+	public SpeciesTreePriorInputEditor(BeautiDoc doc) {
+		super(doc);
+	}
+
+	@Override
+	public Class<?> type() {
+		return SpeciesTreePrior.class;
+	}
+	
+	@Override
+	public void init(Input<?> input, BEASTInterface plugin, int itemNr, ExpandOption bExpandOption, boolean bAddButtons) {
+		super.init(input, plugin, itemNr, bExpandOption, bAddButtons);
+	}
+
+    protected void addComboBox(JComponent box, Input<?> input, BEASTInterface plugin) {
+    	m_bAddButtons = true;
+    	String label = "Species Tree Population Size";
+    	addInputLabel(label, label);
+    	m_bAddButtons = false;
+    	add(Box.createHorizontalGlue());
+    }
+}
diff --git a/src/beast/app/beauti/StateNodeListInputEditor.java b/src/beast/app/beauti/StateNodeListInputEditor.java
new file mode 100644
index 0000000..97f2498
--- /dev/null
+++ b/src/beast/app/beauti/StateNodeListInputEditor.java
@@ -0,0 +1,36 @@
+package beast.app.beauti;
+
+import java.util.List;
+
+import beast.app.draw.ListInputEditor;
+import beast.core.Input;
+import beast.core.StateNode;
+import beast.core.BEASTObject;
+import beast.core.BEASTInterface;
+
+
+
+public class StateNodeListInputEditor extends ListInputEditor {
+	private static final long serialVersionUID = 1L;
+
+	public StateNodeListInputEditor(BeautiDoc doc) {
+		super(doc);
+	}
+	
+	@Override
+	public Class<?> type() {
+		return List.class;
+	}
+	
+	@Override
+	public Class<?> baseType() {
+		return StateNode.class;
+	}
+	
+	@Override
+	public void init(Input<?> input, BEASTInterface plugin, int itemNr, ExpandOption bExpandOption, boolean bAddButtons) {
+		m_buttonStatus = ButtonStatus.NONE;
+		super.init(input, plugin, itemNr, bExpandOption, bAddButtons);
+	}
+
+}
diff --git a/src/beast/app/beauti/TaxonSetDialog.java b/src/beast/app/beauti/TaxonSetDialog.java
new file mode 100644
index 0000000..186b3a4
--- /dev/null
+++ b/src/beast/app/beauti/TaxonSetDialog.java
@@ -0,0 +1,309 @@
+package beast.app.beauti;
+
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.Frame;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Set;
+
+import javax.swing.BorderFactory;
+import javax.swing.Box;
+import javax.swing.DefaultListCellRenderer;
+import javax.swing.DefaultListModel;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.JOptionPane;
+import javax.swing.JScrollPane;
+import javax.swing.JTextField;
+import javax.swing.ListCellRenderer;
+import javax.swing.border.EmptyBorder;
+import javax.swing.border.EtchedBorder;
+import javax.swing.event.DocumentEvent;
+import javax.swing.event.DocumentListener;
+
+import beast.evolution.alignment.Taxon;
+import beast.evolution.alignment.TaxonSet;
+
+
+
+public class TaxonSetDialog extends JDialog {
+    private static final long serialVersionUID = 1L;
+    public boolean isOK = false;
+    TaxonSet taxonSet;
+    String sID;
+    List<Taxon> _candidates;
+
+    JTextField idEntry;
+
+    JTextField filterEntry;
+
+    JList listOfTaxonCandidates;
+    DefaultListModel listModel1;
+    JList listOfTaxonSet;
+    DefaultListModel listModel2;
+
+
+    Box box;
+    BeautiDoc doc;
+    
+    public TaxonSetDialog(TaxonSet taxonSet, Set<Taxon> candidates, BeautiDoc doc) {
+        // initialize state
+        this.taxonSet = taxonSet;
+        this.doc = doc;
+        sID = taxonSet.getID();
+        // create components
+        box = Box.createVerticalBox();
+        box.add(createIDBox());
+        box.add(createFilterBox());
+        box.add(createTaxonSelector());
+        box.add(Box.createVerticalGlue());
+        //box.add(createCancelOKButtons());
+
+        // initialise lists
+        List<Taxon> taxonset = taxonSet.taxonsetInput.get();
+        Comparator<Taxon> comparator = (o1, o2) -> o1.getID().compareTo(o2.getID());
+        Collections.sort(taxonset, comparator);
+        _candidates = new ArrayList<>();
+        _candidates.addAll(candidates);
+        Collections.sort(_candidates, comparator);
+
+        for (Taxon taxon : taxonset) {
+            listModel2.addElement(taxon);
+        }
+        for (Taxon taxon : _candidates) {
+            listModel1.addElement(taxon);
+        }
+        for (int i = 0; i < listModel2.size(); i++) {
+            listModel1.removeElement(listModel2.get(i));
+        }
+
+        add(box);
+        setSize(new Dimension(400, 600));
+        setModal(true);
+    } // c'tor
+    
+    public boolean showDialog() {
+        JOptionPane optionPane = new JOptionPane(box,
+                JOptionPane.QUESTION_MESSAGE,
+                JOptionPane.OK_CANCEL_OPTION,
+                null,
+                null,
+                null);
+        optionPane.setBorder(new EmptyBorder(12, 12, 12, 12));
+
+        Frame frame = (doc != null ? doc.getFrame(): Frame.getFrames()[0]);
+        final JDialog dialog = optionPane.createDialog(frame, "Taxon set editor");
+        dialog.pack();
+
+        dialog.setVisible(true);
+
+        int result = JOptionPane.CANCEL_OPTION;
+        Integer value = (Integer) optionPane.getValue();
+        if (value != null && value != -1) {
+            result = value;
+        }
+        isOK =  (result != JOptionPane.CANCEL_OPTION);
+        if (isOK) {
+            taxonSet.setID(sID);
+            List<Taxon> taxa = taxonSet.taxonsetInput.get();
+            while (taxa.size() > 0) {
+                taxa.remove(0);
+            }
+            for (int i = 0; i < listModel2.size(); i++) {
+                taxa.add((Taxon) listModel2.get(i));
+            }
+            isOK = true;
+            dispose();
+        }
+        return isOK;
+    }
+
+    
+
+    private Component createFilterBox() {
+        Box box = Box.createHorizontalBox();
+        JLabel label = new JLabel("Filter:");
+        box.add(label);
+        filterEntry = new JTextField();
+        filterEntry.setColumns(17);
+        //Dimension size = new Dimension(100, 20);
+        //filterEntry.setMinimumSize(size);
+        //filterEntry.setPreferredSize(size);
+        //filterEntry.setSize(size);
+        filterEntry.setToolTipText("Enter regular expression to match taxa");
+        filterEntry.setMaximumSize(new Dimension(1024, 50));
+        box.add(filterEntry);
+        box.add(Box.createHorizontalGlue());
+
+        filterEntry.getDocument().addDocumentListener(new DocumentListener() {
+            @Override
+            public void removeUpdate(DocumentEvent e) {
+                processEntry();
+            }
+
+            @Override
+            public void insertUpdate(DocumentEvent e) {
+                processEntry();
+            }
+
+            @Override
+            public void changedUpdate(DocumentEvent e) {
+                processEntry();
+            }
+        });
+        return box;
+    }
+
+    private void processEntry() {
+        String sFilter = ".*" + filterEntry.getText() + ".*";
+
+        listModel1.clear();
+        for (Taxon taxon : _candidates) {
+            if (taxon.getID().matches(sFilter)) {
+                listModel1.addElement(taxon);
+            }
+        }
+        for (int i = 0; i < listModel2.size(); i++) {
+            listModel1.removeElement(listModel2.get(i));
+        }
+    }
+
+    Component createIDBox() {
+        Box box = Box.createHorizontalBox();
+        box.add(new JLabel("Taxon set label:"));
+        idEntry = new JTextField();
+        idEntry.setName("idEntry");
+        idEntry.setText(sID);
+        box.add(idEntry);
+        idEntry.getDocument().addDocumentListener(new DocumentListener() {
+            @Override
+            public void removeUpdate(DocumentEvent e) {
+                sID = idEntry.getText();
+            }
+
+            @Override
+            public void insertUpdate(DocumentEvent e) {
+                sID = idEntry.getText();
+            }
+
+            @Override
+            public void changedUpdate(DocumentEvent e) {
+                sID = idEntry.getText();
+            }
+        });
+
+        box.setMaximumSize(new Dimension(400, 100));
+        return box;
+    }
+    
+    class TaxonCellRenderer extends DefaultListCellRenderer {
+		@Override
+		public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
+				boolean cellHasFocus) {
+			JLabel label = (JLabel)super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
+			label.setText(((Taxon)value).getID());
+			return label;
+		}
+	}
+    
+    Component createTaxonSelector() {
+        Box box = Box.createHorizontalBox();
+
+        // list of taxa to select from
+        listModel1 = new DefaultListModel();
+        listOfTaxonCandidates = new JList(listModel1);
+        listOfTaxonCandidates.setName("listOfTaxonCandidates");
+        listOfTaxonCandidates.setBorder(BorderFactory.createEtchedBorder());
+        listOfTaxonCandidates.setCellRenderer(new TaxonCellRenderer());
+        
+        JScrollPane scroller = new JScrollPane(listOfTaxonCandidates);
+        box.add(scroller);
+
+        // add buttons to select/deselect taxa
+        Box buttonBox = Box.createVerticalBox();
+        buttonBox.add(Box.createGlue());
+        JButton selectButton = new JButton(">>");
+        selectButton.setName(">>");
+        selectButton.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                int[] nSelected = listOfTaxonCandidates.getSelectedIndices();
+                for (int i : nSelected) {
+                    listModel2.addElement(listModel1.get(i));
+                }
+                for (int i = 0; i < listModel2.size(); i++) {
+                    listModel1.removeElement(listModel2.get(i));
+                }
+            }
+        });
+        buttonBox.add(selectButton);
+        JButton deselectButton = new JButton("<<");
+        deselectButton.setName("<<");
+        deselectButton.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                int[] nSelected = listOfTaxonSet.getSelectedIndices();
+                for (int i : nSelected) {
+                    listModel1.addElement(listModel2.get(i));
+                }
+                for (int i = 0; i < listModel1.size(); i++) {
+                    listModel2.removeElement(listModel1.get(i));
+                }
+            }
+        });
+        buttonBox.add(deselectButton);
+        buttonBox.add(Box.createGlue());
+        box.add(buttonBox);
+
+        // list of taxa in taxon set
+        listModel2 = new DefaultListModel();
+        listOfTaxonSet = new JList(listModel2);
+        listOfTaxonSet.setBorder(BorderFactory.createEtchedBorder());
+        listOfTaxonSet.setCellRenderer(new TaxonCellRenderer());
+
+        JScrollPane scroller2 = new JScrollPane(listOfTaxonSet);
+        box.add(scroller2);
+        return box;
+    } // createTaxonSelector
+
+    Component createCancelOKButtons() {
+        Box cancelOkBox = Box.createHorizontalBox();
+        cancelOkBox.setBorder(new EtchedBorder());
+        JButton okButton = new JButton("Ok");
+        okButton.setName("OK");
+        okButton.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                taxonSet.setID(sID);
+                List<Taxon> taxa = taxonSet.taxonsetInput.get();
+                while (taxa.size() > 0) {
+                    taxa.remove(0);
+                }
+                for (int i = 0; i < listModel2.size(); i++) {
+                    taxa.add((Taxon) listModel2.get(i));
+                }
+                isOK = true;
+                dispose();
+            }
+        });
+        JButton cancelButton = new JButton("Cancel");
+        cancelButton.setName("Cancel");
+        cancelButton.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                dispose();
+            }
+        });
+        cancelOkBox.add(Box.createHorizontalGlue());
+        cancelOkBox.add(okButton);
+        cancelOkBox.add(Box.createHorizontalGlue());
+        cancelOkBox.add(cancelButton);
+        cancelOkBox.add(Box.createHorizontalGlue());
+        return cancelOkBox;
+    } // createCancelOKButtons
+
+
+} // class TaxonSetDialog
diff --git a/src/beast/app/beauti/TaxonSetInputEditor.java b/src/beast/app/beauti/TaxonSetInputEditor.java
new file mode 100644
index 0000000..8fe3a57
--- /dev/null
+++ b/src/beast/app/beauti/TaxonSetInputEditor.java
@@ -0,0 +1,585 @@
+package beast.app.beauti;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.regex.PatternSyntaxException;
+
+import javax.swing.*;
+import javax.swing.event.CellEditorListener;
+import javax.swing.event.DocumentEvent;
+import javax.swing.event.DocumentListener;
+import javax.swing.table.DefaultTableModel;
+import javax.swing.table.JTableHeader;
+import javax.swing.table.TableCellEditor;
+import javax.swing.table.TableCellRenderer;
+
+import beast.app.draw.InputEditor;
+import beast.core.Input;
+import beast.core.BEASTObject;
+import beast.core.BEASTInterface;
+import beast.evolution.alignment.Alignment;
+import beast.evolution.alignment.Sequence;
+import beast.evolution.alignment.Taxon;
+import beast.evolution.alignment.TaxonSet;
+
+
+
+public class TaxonSetInputEditor extends InputEditor.Base {
+    private static final long serialVersionUID = 1L;
+    List<Taxon> m_taxonset;
+    List<Taxon> m_lineageset;
+    Map<String, String> m_taxonMap;
+    JTable m_table;
+    DefaultTableModel m_model = new DefaultTableModel();
+
+    JTextField filterEntry;
+    String m_sFilter = ".*";
+    int m_sortByColumn = 0;
+    boolean m_bIsAscending = true;
+
+	public TaxonSetInputEditor(BeautiDoc doc) {
+		super(doc);
+	}
+
+    @Override
+    public Class<?> type() {
+        return TaxonSet.class;
+    }
+
+    @Override
+    public void init(Input<?> input, BEASTInterface plugin, int itemNr, ExpandOption bExpandOption, boolean bAddButtons) {
+        m_input = input;
+        m_plugin = plugin;
+		this.itemNr = itemNr;
+        TaxonSet taxonset = (TaxonSet) m_input.get();
+        if (taxonset == null) {
+            return;
+        }
+        List<Taxon> taxonsets = new ArrayList<Taxon>();
+
+        List<Taxon> taxa = taxonset.taxonsetInput.get();
+        for (Taxon taxon : taxa) {
+            taxonsets.add((TaxonSet) taxon);
+        }
+        add(getContent(taxonsets));
+        if (taxa.size() == 1 && taxa.get(0).getID().equals("Beauti2DummyTaxonSet") || taxa.size() == 0) {
+            taxa.clear();
+            try {
+                // species is first character of taxon
+                guessTaxonSets("(.).*", 0);
+                for (Taxon taxonset2 : m_taxonset) {
+                    for (Taxon taxon : ((TaxonSet) taxonset2).taxonsetInput.get()) {
+                        m_lineageset.add(taxon);
+                        m_taxonMap.put(taxon.getID(), taxonset2.getID());
+                    }
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            taxonSetToModel();
+            modelToTaxonset();
+        }
+    }
+
+    private Component getContent(List<Taxon> taxonset) {
+        m_taxonset = taxonset;
+        m_taxonMap = new HashMap<String, String>();
+        m_lineageset = new ArrayList<Taxon>();
+        for (Taxon taxonset2 : m_taxonset) {
+            for (Taxon taxon : ((TaxonSet) taxonset2).taxonsetInput.get()) {
+                m_lineageset.add(taxon);
+                m_taxonMap.put(taxon.getID(), taxonset2.getID());
+            }
+        }
+
+        // set up table.
+        // special features: background shading of rows
+        // custom editor allowing only Date column to be edited.
+        m_model = new DefaultTableModel();
+        m_model.addColumn("Taxon");
+        m_model.addColumn("Species/Population");
+        taxonSetToModel();
+
+        m_table = new JTable(m_model) {
+            private static final long serialVersionUID = 1L;
+
+            // method that induces table row shading
+            @Override
+            public Component prepareRenderer(TableCellRenderer renderer, int Index_row, int Index_col) {
+                Component comp = super.prepareRenderer(renderer, Index_row, Index_col);
+                // even index, selected or not selected
+                if (isCellSelected(Index_row, Index_col)) {
+                    comp.setBackground(Color.gray);
+                } else if (Index_row % 2 == 0) {
+                    comp.setBackground(new Color(237, 243, 255));
+                } else {
+                    comp.setBackground(Color.white);
+                }
+                return comp;
+            }
+        };
+
+        // set up editor that makes sure only doubles are accepted as entry
+        // and only the Date column is editable.
+        m_table.setDefaultEditor(Object.class, new TableCellEditor() {
+            JTextField m_textField = new JTextField();
+            int m_iRow
+                    ,
+                    m_iCol;
+
+            @Override
+            public boolean stopCellEditing() {
+                m_table.removeEditor();
+                String sText = m_textField.getText();
+                System.err.println(sText);
+                m_model.setValueAt(sText, m_iRow, m_iCol);
+                // try {
+                // Double.parseDouble(sText);
+                // } catch (Exception e) {
+                // return false;
+                // }
+                modelToTaxonset();
+                return true;
+            }
+
+            @Override
+            public boolean isCellEditable(EventObject anEvent) {
+                return m_table.getSelectedColumn() == 1;
+            }
+
+            @Override
+            public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int iRow,
+                                                         int iCol) {
+                if (!isSelected) {
+                    return null;
+                }
+                m_iRow = iRow;
+                m_iCol = iCol;
+                m_textField.setText((String) value);
+                return m_textField;
+            }
+
+            @Override
+            public boolean shouldSelectCell(EventObject anEvent) {
+                return false;
+            }
+
+            @Override
+            public void removeCellEditorListener(CellEditorListener l) {
+            }
+
+            @Override
+            public Object getCellEditorValue() {
+                return null;
+            }
+
+            @Override
+            public void cancelCellEditing() {
+            }
+
+            @Override
+            public void addCellEditorListener(CellEditorListener l) {
+            }
+
+        });
+        m_table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
+        m_table.getColumnModel().getColumn(0).setPreferredWidth(250);
+        m_table.getColumnModel().getColumn(1).setPreferredWidth(250);
+
+        JTableHeader header = m_table.getTableHeader();
+        header.addMouseListener(new ColumnHeaderListener());
+
+        JScrollPane pane = new JScrollPane(m_table);
+        Box tableBox = Box.createHorizontalBox();
+        tableBox.add(Box.createHorizontalGlue());
+        tableBox.add(pane);
+        tableBox.add(Box.createHorizontalGlue());
+
+        Box box = Box.createVerticalBox();
+        box.add(createFilterBox());
+        box.add(tableBox);
+        box.add(createButtonBox());
+        return box;
+    }
+
+    private Component createButtonBox() {
+        Box buttonBox = Box.createHorizontalBox();
+
+        JButton fillDownButton = new JButton("Fill down");
+        fillDownButton.setName("Fill down");
+        fillDownButton.setToolTipText("replaces all taxons in selection with the one that is selected at the top");
+        fillDownButton.addActionListener(new ActionListener() {
+
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                int[] rows = m_table.getSelectedRows();
+                if (rows.length < 2) {
+                    return;
+                }
+                String sTaxon = (String) ((Vector<?>) m_model.getDataVector().elementAt(rows[0])).elementAt(1);
+                for (int i = 1; i < rows.length; i++) {
+                    m_model.setValueAt(sTaxon, rows[i], 1);
+                }
+                modelToTaxonset();
+            }
+        });
+
+        JButton guessButton = new JButton("Guess");
+        guessButton.setName("Guess");
+        guessButton.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                guess();
+            }
+        });
+
+        buttonBox.add(Box.createHorizontalGlue());
+        buttonBox.add(fillDownButton);
+        buttonBox.add(Box.createHorizontalGlue());
+        buttonBox.add(guessButton);
+        buttonBox.add(Box.createHorizontalGlue());
+        return buttonBox;
+    }
+
+    public class ColumnHeaderListener extends MouseAdapter {
+        public void mouseClicked(MouseEvent evt) {
+            // The index of the column whose header was clicked
+            int vColIndex = m_table.getColumnModel().getColumnIndexAtX(evt.getX());
+            if (vColIndex == -1) {
+                return;
+            }
+            if (vColIndex != m_sortByColumn) {
+                m_sortByColumn = vColIndex;
+                m_bIsAscending = true;
+            } else {
+                m_bIsAscending = !m_bIsAscending;
+            }
+            taxonSetToModel();
+        }
+    }
+
+    private void guess() {
+        GuessPatternDialog dlg = new GuessPatternDialog(this, m_sPattern);
+        switch(dlg.showDialog("Guess taxon sets")) {
+        case canceled: return;
+        case pattern: 
+        String sPattern = dlg.getPattern();
+            try {
+                guessTaxonSets(sPattern, 0);
+                m_sPattern = sPattern;
+                break;
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        case trait:
+        	String trait = dlg.getTrait();
+        	parseTrait(trait);
+            break;
+        }
+        m_lineageset.clear();
+        for (Taxon taxonset2 : m_taxonset) {
+            for (Taxon taxon : ((TaxonSet) taxonset2).taxonsetInput.get()) {
+                m_lineageset.add(taxon);
+                m_taxonMap.put(taxon.getID(), taxonset2.getID());
+            }
+        }
+        taxonSetToModel();
+        modelToTaxonset();
+    }
+
+    /**
+     * guesses taxon sets based on pattern in sRegExp based on the taxa in
+     * m_rawData
+     */
+    public int guessTaxonSets(String sRegexp, int nMinSize) throws Exception {
+        m_taxonset.clear();
+        HashMap<String, TaxonSet> map = new HashMap<String, TaxonSet>();
+        Pattern m_pattern = Pattern.compile(sRegexp);
+        Set<Taxon> taxa = new HashSet<Taxon>();
+        Set<String> taxonIDs = new HashSet<String>();
+        for (Alignment alignment : getDoc().alignments) {
+        	for (String sID : alignment.getTaxaNames()) {
+                if (!taxonIDs.contains(sID)) {
+	                Taxon taxon = new Taxon();
+	                taxon.setID(sID);
+	                taxa.add(taxon);
+	                taxonIDs.add(sID);
+        		}
+        	}
+            for (Sequence sequence : alignment.sequenceInput.get()) {
+                String sID = sequence.taxonInput.get();
+                if (!taxonIDs.contains(sID)) {
+                    Taxon taxon = new Taxon();
+                    // ensure sequence and taxon do not get same ID
+                    if (sequence.getID().equals(sequence.taxonInput.get())) {
+                        sequence.setID("_" + sequence.getID());
+                    }
+                    taxon.setID(sequence.taxonInput.get());
+                    taxa.add(taxon);
+                    taxonIDs.add(sID);
+                }
+            }
+        }
+
+        for (Taxon taxon : taxa) {
+            if (!(taxon instanceof TaxonSet)) {
+                Matcher matcher = m_pattern.matcher(taxon.getID());
+                if (matcher.find()) {
+                    String sMatch = matcher.group(1);
+                    try {
+                        if (map.containsKey(sMatch)) {
+                            TaxonSet set = map.get(sMatch);
+                            set.taxonsetInput.setValue(taxon, set);
+                        } else {
+                            TaxonSet set = new TaxonSet();
+                            set.setID(sMatch);
+                            set.taxonsetInput.setValue(taxon, set);
+                            map.put(sMatch, set);
+                        }
+                    } catch (Exception ex) {
+                        ex.printStackTrace();
+                    }
+                }
+            }
+        }
+        // add taxon sets
+        int nIgnored = 0;
+        for (TaxonSet set : map.values()) {
+            if (set.taxonsetInput.get().size() > nMinSize) {
+                m_taxonset.add(set);
+            } else {
+                nIgnored += set.taxonsetInput.get().size();
+            }
+        }
+        return nIgnored;
+    }
+
+    void parseTrait(String trait) {
+    	Map<String,String> traitmap = new HashMap<String, String>();
+    	for (String line : trait.split(",")) {
+    		String [] strs = line.split("=");
+    		if (strs.length == 2) {
+    			traitmap.put(strs[0].trim(), strs[1].trim());
+    		}
+    	}
+    	
+        m_taxonset.clear();
+
+        Set<Taxon> taxa = new HashSet<Taxon>();
+        Set<String> taxonIDs = new HashSet<String>();
+        for (Alignment alignment : getDoc().alignments) {
+            for (Sequence sequence : alignment.sequenceInput.get()) {
+                String sID = sequence.taxonInput.get();
+                if (!taxonIDs.contains(sID)) {
+                    Taxon taxon = new Taxon();
+                    // ensure sequence and taxon do not get same ID
+                    if (sequence.getID().equals(sequence.taxonInput.get())) {
+                        sequence.setID("_" + sequence.getID());
+                    }
+                    taxon.setID(sequence.taxonInput.get());
+                    taxa.add(taxon);
+                    taxonIDs.add(sID);
+                }
+            }
+        }
+
+        HashMap<String, TaxonSet> map = new HashMap<String, TaxonSet>();
+        for (Taxon taxon : taxa) {
+            if (!(taxon instanceof TaxonSet)) {
+                String sMatch = traitmap.get(taxon.getID());
+                if (sMatch != null) {
+                    try {
+                        if (map.containsKey(sMatch)) {
+                            TaxonSet set = map.get(sMatch);
+                            set.taxonsetInput.setValue(taxon, set);
+                        } else {
+                            TaxonSet set = new TaxonSet();
+                            set.setID(sMatch);
+                            set.taxonsetInput.setValue(taxon, set);
+                            map.put(sMatch, set);
+                        }
+                    } catch (Exception ex) {
+                        ex.printStackTrace();
+                    }
+                }
+            }
+        }
+        // add taxon sets
+        int nIgnored = 0;
+        for (TaxonSet set : map.values()) {
+             m_taxonset.add(set);
+        }
+    }
+    
+    String m_sPattern = "^(.+)[-_\\. ](.*)$";
+
+
+    private Component createFilterBox() {
+        Box filterBox = Box.createHorizontalBox();
+        filterBox.add(new JLabel("filter: "));
+        // Dimension size = new Dimension(100,20);
+        filterEntry = new JTextField();
+        filterEntry.setColumns(20);
+        // filterEntry.setMinimumSize(size);
+        // filterEntry.setPreferredSize(size);
+        // filterEntry.setSize(size);
+        filterEntry.setToolTipText("Enter regular expression to match taxa");
+        filterEntry.setMaximumSize(new Dimension(1024, 20));
+        filterBox.add(filterEntry);
+        filterBox.add(Box.createHorizontalGlue());
+        filterEntry.getDocument().addDocumentListener(new DocumentListener() {
+            @Override
+            public void removeUpdate(DocumentEvent e) {
+                processFilter();
+            }
+
+            @Override
+            public void insertUpdate(DocumentEvent e) {
+                processFilter();
+            }
+
+            @Override
+            public void changedUpdate(DocumentEvent e) {
+                processFilter();
+            }
+
+            private void processFilter() {
+                String sFilter = ".*" + filterEntry.getText() + ".*";
+                try {
+                    // sanity check: make sure the filter is legit
+                    sFilter.matches(sFilter);
+                    m_sFilter = sFilter;
+                    taxonSetToModel();
+                    m_table.repaint();
+                } catch (PatternSyntaxException e) {
+                    // ignore
+                }
+            }
+        });
+        return filterBox;
+    }
+
+    /**
+     * for convert taxon sets to table model *
+     */
+    @SuppressWarnings("unchecked")
+    private void taxonSetToModel() {
+        // count number of lineages that match the filter
+        int i = 0;
+        for (String sLineageID : m_taxonMap.keySet()) {
+            if (sLineageID.matches(m_sFilter)) {
+                i++;
+            }
+        }
+
+        // clear table model
+        while (m_model.getRowCount() > 0) {
+            m_model.removeRow(0);
+        }
+
+        // fill table model with lineages matching the filter
+        for (String sLineageID : m_taxonMap.keySet()) {
+            if (sLineageID.matches(m_sFilter)) {
+                Object[] rowData = new Object[2];
+                rowData[0] = sLineageID;
+                rowData[1] = m_taxonMap.get(sLineageID);
+                m_model.addRow(rowData);
+            }
+        }
+
+        @SuppressWarnings("rawtypes")
+        Vector data = m_model.getDataVector();
+        Collections.sort(data, new Comparator<Vector<?>>() {
+            @Override
+            public int compare(Vector<?> v1, Vector<?> v2) {
+                String o1 = (String) v1.get(m_sortByColumn);
+                String o2 = (String) v2.get(m_sortByColumn);
+                if (o1.equals(o2)) {
+                    o1 = (String) v1.get(1 - m_sortByColumn);
+                    o2 = (String) v2.get(1 - m_sortByColumn);
+                }
+                if (m_bIsAscending) {
+                    return o1.compareTo(o2);
+                } else {
+                    return o2.compareTo(o1);
+                }
+            }
+
+        });
+        m_model.fireTableRowsInserted(0, m_model.getRowCount());
+    }
+
+    /**
+     * for convert table model to taxon sets *
+     */
+    private void modelToTaxonset() {
+        // update map
+        for (int i = 0; i < m_model.getRowCount(); i++) {
+            String sLineageID = (String) ((Vector<?>) m_model.getDataVector().elementAt(i)).elementAt(0);
+            String sTaxonSetID = (String) ((Vector<?>) m_model.getDataVector().elementAt(i)).elementAt(1);
+
+            // new taxon set?
+            if (!m_taxonMap.containsValue(sTaxonSetID)) {
+                // create new taxon set
+                TaxonSet taxonset = new TaxonSet();
+                taxonset.setID(sTaxonSetID);
+                m_taxonset.add(taxonset);
+            }
+            m_taxonMap.put(sLineageID, sTaxonSetID);
+        }
+
+        // clear old taxon sets
+        for (Taxon taxon : m_taxonset) {
+            TaxonSet set = (TaxonSet) taxon;
+            set.taxonsetInput.get().clear();
+            doc.registerPlugin(set);
+        }
+
+        // group lineages with their taxon sets
+        for (String sLineageID : m_taxonMap.keySet()) {
+            for (Taxon taxon : m_lineageset) {
+                if (taxon.getID().equals(sLineageID)) {
+                    String sTaxonSet = m_taxonMap.get(sLineageID);
+                    for (Taxon taxon2 : m_taxonset) {
+                        TaxonSet set = (TaxonSet) taxon2;
+                        if (set.getID().equals(sTaxonSet)) {
+                            try {
+                                set.taxonsetInput.setValue(taxon, set);
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+        // remove unused taxon sets
+        for (int i = m_taxonset.size() - 1; i >= 0; i--) {
+            if (((TaxonSet) m_taxonset.get(i)).taxonsetInput.get().size() == 0) {
+                doc.unregisterPlugin(m_taxonset.get(i));
+                m_taxonset.remove(i);
+            }
+        }
+
+        TaxonSet taxonset = (TaxonSet) m_input.get();
+        taxonset.taxonsetInput.get().clear();
+        for (Taxon taxon : m_taxonset) {
+            try {
+                taxonset.taxonsetInput.setValue(taxon, taxonset);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+
+    }
+
+}
diff --git a/src/beast/app/beauti/TipDatesInputEditor.java b/src/beast/app/beauti/TipDatesInputEditor.java
new file mode 100644
index 0000000..65e66c0
--- /dev/null
+++ b/src/beast/app/beauti/TipDatesInputEditor.java
@@ -0,0 +1,613 @@
+package beast.app.beauti;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.EventObject;
+import java.util.List;
+
+import javax.swing.Box;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JScrollPane;
+import javax.swing.JTable;
+import javax.swing.JTextField;
+import javax.swing.event.CellEditorListener;
+import javax.swing.table.TableCellEditor;
+import javax.swing.table.TableCellRenderer;
+
+import beast.app.draw.BEASTObjectInputEditor;
+import beast.core.Input;
+import beast.core.BEASTInterface;
+import beast.evolution.alignment.Taxon;
+import beast.evolution.alignment.TaxonSet;
+import beast.evolution.operators.TipDatesRandomWalker;
+import beast.evolution.tree.TraitSet;
+import beast.evolution.tree.Tree;
+
+public class TipDatesInputEditor extends BEASTObjectInputEditor {
+
+    public TipDatesInputEditor(BeautiDoc doc) {
+        super(doc);
+    }
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public Class<?> type() {
+        return Tree.class;
+    }
+    Tree tree;
+    TraitSet traitSet;
+    JComboBox unitsComboBox;
+    JComboBox relativeToComboBox;
+    List<String> sTaxa;
+    Object[][] tableData;
+    JTable table;
+    String m_sPattern = ".*(\\d\\d\\d\\d).*";
+    JScrollPane scrollPane;
+    List<Taxon> taxonsets;
+
+    @Override
+    public void init(Input<?> input, BEASTInterface plugin, int itemNr, ExpandOption bExpandOption, boolean bAddButtons) {
+        m_bAddButtons = bAddButtons;
+        this.itemNr = itemNr;
+        if (itemNr >= 0) {
+            tree = (Tree) ((List<?>) input.get()).get(itemNr);
+        } else {
+            tree = (Tree) input.get();
+        }
+        if (tree != null) {
+            try {
+                m_input = ((BEASTInterface) tree).getInput("trait");
+            } catch (Exception e1) {
+                // TODO Auto-generated catch block
+                e1.printStackTrace();
+            }
+            m_plugin = (BEASTInterface) tree;
+            traitSet = tree.getDateTrait();
+
+            Box box = Box.createVerticalBox();
+
+            JCheckBox useTipDates = new JCheckBox("Use tip dates", traitSet != null);
+            useTipDates.addActionListener(new ActionListener() {
+                @Override
+                public void actionPerformed(ActionEvent e) {
+                    JCheckBox checkBox = (JCheckBox) e.getSource();
+                    try {
+                        if (checkBox.isSelected()) {
+                            if (traitSet == null) {
+                                traitSet = new TraitSet();
+                                traitSet.initByName("traitname", "date",
+                                        "taxa", tree.getTaxonset(),
+                                        "value", "");
+                                traitSet.setID("dateTrait.t:" + BeautiDoc.parsePartition(tree.getID()));
+                            }
+                            tree.setDateTrait(traitSet);
+                        } else {
+                            tree.setDateTrait(null);
+                        }
+
+                        refreshPanel();
+                    } catch (Exception ex) {
+                        ex.printStackTrace();
+                    }
+
+                }
+            });
+            Box box2 = Box.createHorizontalBox();
+            box2.add(useTipDates);
+            box2.add(Box.createGlue());
+            box.add(box2);
+
+            if (traitSet != null) {
+                box.add(createButtonBox());
+                box.add(createListBox());
+                box.add(createSamplingBox());
+            }
+            add(box);
+        }
+    } // init
+    final static int NO_TIP_SAMPLING = 0;
+    final static int SAMPLE_TIPS_SAME_PRIOR = 1;
+    final static int SAMPLE_TIPS_MULTIPLE_PRIOR = 2;
+    final static String ALL_TAXA = "all";
+    int m_iMode = NO_TIP_SAMPLING;
+
+    private Component createSamplingBox() {
+        Box samplingBox = Box.createHorizontalBox();
+        JComboBox comboBox = new JComboBox(new String[]{"no tips sampling", "sample tips from taxon set:"});// ,"sample tips with individual priors"});
+
+        // determine mode
+        m_iMode = NO_TIP_SAMPLING;
+        // count nr of TipDateScalers with weight > 0
+        String treeID = tree.getID();
+        String operatorID = "allTipDatesRandomWalker.t:" + treeID.substring(treeID.lastIndexOf(":") + 1);
+        TipDatesRandomWalker operator = (TipDatesRandomWalker) doc.pluginmap.get(operatorID);
+        if (operator != null && operator.m_pWeight.get() > 0) {
+            m_iMode = SAMPLE_TIPS_SAME_PRIOR;
+        }
+
+        m_iMode = Math.min(m_iMode, 2);
+        comboBox.setSelectedIndex(m_iMode);
+        comboBox.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                selectMode(e);
+            }
+        });
+        samplingBox.add(comboBox);
+
+        taxonsets = new ArrayList<Taxon>();
+        Taxon allTaxa = new Taxon();
+        allTaxa.setID(ALL_TAXA);
+        taxonsets.add(allTaxa);
+        List<String> taxonSetIDs = new ArrayList<String>();
+        taxonSetIDs.add(ALL_TAXA);
+        for (Taxon taxon : doc.taxaset.values()) {
+            if (taxon instanceof TaxonSet) {
+                taxonsets.add(taxon);
+                taxonSetIDs.add(taxon.getID());
+            }
+        }
+        JComboBox comboBox2 = new JComboBox(taxonSetIDs.toArray());
+        
+        if (operator == null) {
+        	comboBox.setEnabled(false);
+        	comboBox2.setEnabled(false);
+        } else {
+	        // find TipDatesSampler and set TaxonSet input
+	        Taxon set = operator.m_taxonsetInput.get();
+	        if (set != null) {
+	            int i = taxonSetIDs.indexOf(set.getID());
+	            comboBox2.setSelectedIndex(i);
+	        }
+	
+	        comboBox2.addActionListener(new ActionListener() {
+	            @Override
+	            public void actionPerformed(ActionEvent e) {
+	                selectTaxonSet(e);
+	            }
+	        });
+        }
+        samplingBox.add(comboBox2);
+
+        return samplingBox;
+    }
+
+    private void selectTaxonSet(ActionEvent e) {
+        JComboBox comboBox = (JComboBox) e.getSource();
+        String taxonSetID = (String) comboBox.getSelectedItem();
+        Taxon taxonset = null;;
+        for (Taxon taxon : taxonsets) {
+            if (taxon.getID().equals(taxonSetID)) {
+                taxonset = taxon;
+                break;
+            }
+        }
+
+        if (taxonset.getID().equals(ALL_TAXA)) {
+            taxonset = null;
+        }
+        try {
+            // find TipDatesSampler and set TaxonSet input
+
+            String treeID = tree.getID();
+            String operatorID = "allTipDatesRandomWalker.t:" + treeID.substring(treeID.lastIndexOf(":") + 1);
+            TipDatesRandomWalker operator = (TipDatesRandomWalker) doc.pluginmap.get(operatorID);
+            System.err.println("treeID = " + treeID);
+            System.err.println("operatorID = " + operatorID);
+            System.err.println("operator = " + operator);
+            operator.m_taxonsetInput.setValue(taxonset, operator);
+
+//            for (Plugin plugin : traitSet.outputs) {
+//                if (plugin instanceof Tree) {
+//                    for (Plugin plugin2 : plugin.outputs) {
+//                        if (plugin2 instanceof TipDatesScaler) {
+//                            TipDatesScaler operator = (TipDatesScaler) plugin2;
+//                            operator.m_taxonsetInput.setValue(taxonset, operator);
+//                        }
+//                    }
+//                }
+//            }
+//
+//            // TODO: find MRACPriors and set TaxonSet inputs
+//            for (Plugin plugin : traitSet.outputs) {
+//                if (plugin instanceof Tree) {
+//                    for (Plugin plugin2 : plugin.outputs) {
+//                        if (plugin2 instanceof MRCAPrior) {
+//                            MRCAPrior prior = (MRCAPrior) plugin2;
+//                            if (prior.m_bOnlyUseTipsInput.get()) {
+//                                prior.m_taxonset.setValue(taxonset, prior);
+//                            }
+//                        }
+//                    }
+//                }
+//            }
+        } catch (Exception ex) {
+            // TODO: handle exception
+            ex.printStackTrace();
+        }
+    }
+
+    private void selectMode(ActionEvent e) {
+        JComboBox comboBox = (JComboBox) e.getSource();
+        m_iMode = comboBox.getSelectedIndex();
+        try {
+            // clear
+            for (Object plugin : traitSet.getOutputs()) {
+                if (plugin instanceof Tree) {
+                    for (Object plugin2 : BEASTInterface.getOutputs(plugin)) {
+                        if (plugin2 instanceof TipDatesRandomWalker) {
+                            TipDatesRandomWalker operator = (TipDatesRandomWalker) plugin2;
+                            switch (m_iMode) {
+                                case NO_TIP_SAMPLING:
+                                    operator.m_pWeight.setValue(0.0, operator);
+                                    break;
+                                case SAMPLE_TIPS_SAME_PRIOR:
+                                    if (operator.getID().contains("allTipDatesRandomWalker")) {
+                                        operator.m_pWeight.setValue(1.0, operator);
+                                    } else {
+                                        operator.m_pWeight.setValue(0.0, operator);
+                                    }
+                                    break;
+                                case SAMPLE_TIPS_MULTIPLE_PRIOR:
+                                    if (operator.getID().contains("allTipDatesRandomWalker")) {
+                                        operator.m_pWeight.setValue(0.0, operator);
+                                    } else {
+                                        operator.m_pWeight.setValue(0.1, operator);
+                                    }
+                                    break;
+                            }
+                        }
+                    }
+                }
+            }
+        } catch (Exception ex) {
+            // TODO: handle exception
+        }
+    }
+
+    private Component createListBox() {
+        sTaxa = traitSet.taxaInput.get().asStringList();
+        String[] columnData = new String[]{"Name", "Date", "Height"};
+        tableData = new Object[sTaxa.size()][3];
+        convertTraitToTableData();
+        // set up table.
+        // special features: background shading of rows
+        // custom editor allowing only Date column to be edited.
+        table = new JTable(tableData, columnData) {
+            private static final long serialVersionUID = 1L;
+
+            // method that induces table row shading
+            @Override
+            public Component prepareRenderer(TableCellRenderer renderer, int Index_row, int Index_col) {
+                Component comp = super.prepareRenderer(renderer, Index_row, Index_col);
+                //even index, selected or not selected
+                if (isCellSelected(Index_row, Index_col)) {
+                    comp.setBackground(Color.lightGray);
+                } else if (Index_row % 2 == 0 && !isCellSelected(Index_row, Index_col)) {
+                    comp.setBackground(new Color(237, 243, 255));
+                } else {
+                    comp.setBackground(Color.white);
+                }
+                return comp;
+            }
+        };
+
+        // set up editor that makes sure only doubles are accepted as entry
+        // and only the Date column is editable.
+        table.setDefaultEditor(Object.class, new TableCellEditor() {
+            JTextField m_textField = new JTextField();
+            int m_iRow,
+                    m_iCol;
+
+            @Override
+            public boolean stopCellEditing() {
+                table.removeEditor();
+                String sText = m_textField.getText();
+//                try {
+//                    Double.parseDouble(sText);
+//                } catch (Exception e) {
+//                	try {
+//                		Date.parse(sText);
+//                	} catch (Exception e2) {
+//                        return false;
+//					}
+//                }
+                tableData[m_iRow][m_iCol] = sText;
+                convertTableDataToTrait();
+                convertTraitToTableData();
+                return true;
+            }
+
+            @Override
+            public boolean isCellEditable(EventObject anEvent) {
+                return table.getSelectedColumn() == 1;
+            }
+
+            @Override
+            public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int iRow, int iCol) {
+                if (!isSelected) {
+                    return null;
+                }
+                m_iRow = iRow;
+                m_iCol = iCol;
+                m_textField.setText((String) value);
+                return m_textField;
+            }
+
+            @Override
+            public boolean shouldSelectCell(EventObject anEvent) {
+                return false;
+            }
+
+            @Override
+            public void removeCellEditorListener(CellEditorListener l) {
+            }
+
+            @Override
+            public Object getCellEditorValue() {
+                return null;
+            }
+
+            @Override
+            public void cancelCellEditing() {
+            }
+
+            @Override
+            public void addCellEditorListener(CellEditorListener l) {
+            }
+        });
+        table.setRowHeight(24);
+        scrollPane = new JScrollPane(table);
+
+// AJD: This ComponentListener breaks the resizing of the tip dates table, so I have removed it.
+//        scrollPane.addComponentListener(new ComponentListener() {
+//            @Override
+//            public void componentShown(ComponentEvent e) {}
+//
+//            @Override
+//            public void componentResized(ComponentEvent e) {
+//                Component c = (Component) e.getSource();
+//                while (c.getParent() != null && !(c.getParent() instanceof JSplitPane)) {
+//                    c = c.getParent();
+//                }
+//                if (c.getParent() != null) {
+//                    Dimension preferredSize = c.getSize();
+//                    preferredSize.height = Math.max(preferredSize.height - 170, 0);
+//                    preferredSize.width = Math.max(preferredSize.width - 25, 0);
+//                    scrollPane.setPreferredSize(preferredSize);
+//                } else if (doc.getFrame() != null) {
+//                    Dimension preferredSize = doc.getFrame().getSize();
+//                    preferredSize.height = Math.max(preferredSize.height - 170, 0);
+//                    preferredSize.width = Math.max(preferredSize.width - 25, 0);
+//                    scrollPane.setPreferredSize(preferredSize);
+//                }
+//            }
+//
+//            @Override
+//            public void componentMoved(ComponentEvent e) {}
+//
+//            @Override
+//            public void componentHidden(ComponentEvent e) {}
+//        });
+
+        return scrollPane;
+    } // createListBox
+
+    /* synchronise table with data from traitSet Plugin */
+    private void convertTraitToTableData() {
+        for (int i = 0; i < tableData.length; i++) {
+            tableData[i][0] = sTaxa.get(i);
+            tableData[i][1] = "0";
+            tableData[i][2] = "0";
+        }
+        String[] sTraits = traitSet.traitsInput.get().split(",");
+        for (String sTrait : sTraits) {
+            sTrait = sTrait.replaceAll("\\s+", " ");
+            String[] sStrs = sTrait.split("=");
+            if (sStrs.length != 2) {
+                break;
+                //throw new Exception("could not parse trait: " + sTrait);
+            }
+            String sTaxonID = normalize(sStrs[0]);
+            int taxonIndex = sTaxa.indexOf(sTaxonID);
+//            if (iTaxon < 0) {
+//                throw new Exception("Trait (" + sTaxonID + ") is not a known taxon. Spelling error perhaps?");
+//            }
+            if (taxonIndex >= 0) {
+                tableData[taxonIndex][1] = normalize(sStrs[1]);
+                tableData[taxonIndex][0] = sTaxonID;
+            } else {
+                System.err.println("WARNING: File contains taxon " + sTaxonID + " that cannot be found in alignment");
+            }
+        }
+        if (traitSet.traitNameInput.get().equals(TraitSet.DATE_BACKWARD_TRAIT)) {
+            Double fMinDate = Double.MAX_VALUE;
+            for (int i = 0; i < tableData.length; i++) {
+                fMinDate = Math.min(fMinDate, parseDate((String) tableData[i][1]));
+            }
+            for (int i = 0; i < tableData.length; i++) {
+                tableData[i][2] = parseDate((String) tableData[i][1]) - fMinDate;
+            }
+        } else {
+            Double fMaxDate = 0.0;
+            for (int i = 0; i < tableData.length; i++) {
+                fMaxDate = Math.max(fMaxDate, parseDate((String) tableData[i][1]));
+            }
+            for (int i = 0; i < tableData.length; i++) {
+                tableData[i][2] = fMaxDate - parseDate((String) tableData[i][1]);
+            }
+        }
+
+        if (table != null) {
+            for (int i = 0; i < tableData.length; i++) {
+                table.setValueAt(tableData[i][1], i, 1);
+                table.setValueAt(tableData[i][2], i, 2);
+            }
+        }
+    } // convertTraitToTableData
+
+    private double parseDate(String sStr) {
+        // default, try to interpret the string as a number
+        try {
+            return Double.parseDouble(sStr);
+        } catch (NumberFormatException e) {
+            // does not look like a number, try parsing it as a date
+            try {
+                if (sStr.matches(".*[a-zA-Z].*")) {
+                    sStr = sStr.replace('/', '-');
+                }
+                long date = Date.parse(sStr);
+                return 1970.0 + date / (60.0 * 60 * 24 * 365 * 1000);
+            } catch (Exception e2) {
+                // does not look like a date, give up
+            }
+
+        }
+        return 0;
+    } // parseStrings
+
+    private String normalize(String sStr) {
+        if (sStr.charAt(0) == ' ') {
+            sStr = sStr.substring(1);
+        }
+        if (sStr.endsWith(" ")) {
+            sStr = sStr.substring(0, sStr.length() - 1);
+        }
+        return sStr;
+    }
+
+    /**
+     * synchronise traitSet Plugin with table data
+     */
+    private void convertTableDataToTrait() {
+        String sTrait = "";
+        for (int i = 0; i < tableData.length; i++) {
+            sTrait += sTaxa.get(i) + "=" + tableData[i][1];
+            if (i < tableData.length - 1) {
+                sTrait += ",\n";
+            }
+        }
+        try {
+            traitSet.traitsInput.setValue(sTrait, traitSet);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * create box with comboboxes for selectin units and trait name *
+     */
+    private Box createButtonBox() {
+        Box buttonBox = Box.createHorizontalBox();
+
+        JLabel label = new JLabel("Dates specified as: ");
+        label.setMaximumSize(MAX_SIZE);//new Dimension(1024, 22));
+        buttonBox.add(label);
+        unitsComboBox = new JComboBox(TraitSet.Units.values());
+        unitsComboBox.setSelectedItem(traitSet.unitsInput.get());
+        unitsComboBox.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                String sSelected = (String) unitsComboBox.getSelectedItem().toString();
+                try {
+                    traitSet.unitsInput.setValue(sSelected, traitSet);
+                    //System.err.println("Traitset is now: " + m_traitSet.m_sUnits.get());
+                } catch (Exception ex) {
+                    ex.printStackTrace();
+                }
+            }
+        });
+        unitsComboBox.setMaximumSize(MAX_SIZE);//new Dimension(1024, 22));
+        buttonBox.add(unitsComboBox);
+
+        relativeToComboBox = new JComboBox(new String[]{"Since some time in the past", "Before the present"});
+        if (traitSet.traitNameInput.get().equals(TraitSet.DATE_BACKWARD_TRAIT)) {
+            relativeToComboBox.setSelectedIndex(1);
+        } else {
+            relativeToComboBox.setSelectedIndex(0);
+        }
+        relativeToComboBox.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                String sSelected = TraitSet.DATE_BACKWARD_TRAIT;
+                if (relativeToComboBox.getSelectedIndex() == 0) {
+                    sSelected = TraitSet.DATE_FORWARD_TRAIT;
+                }
+                try {
+                    traitSet.traitNameInput.setValue(sSelected, traitSet);
+                    System.err.println("Relative position is now: " + traitSet.traitNameInput.get());
+                } catch (Exception ex) {
+                    ex.printStackTrace();
+                }
+                convertTraitToTableData();
+            }
+        });
+        relativeToComboBox.setMaximumSize(MAX_SIZE);//new Dimension(1024, 20));
+        buttonBox.add(relativeToComboBox);
+        buttonBox.add(Box.createGlue());
+
+        JButton guessButton = new JButton("Guess");
+        guessButton.setName("Guess");
+        guessButton.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                GuessPatternDialog dlg = new GuessPatternDialog(null, m_sPattern);
+                dlg.allowAddingValues();
+                String sTrait = "";
+                switch (dlg.showDialog("Guess dates")) {
+                    case canceled:
+                        return;
+                    case trait:
+                        sTrait = dlg.getTrait();
+                        break;
+                    case pattern:
+                        for (String sTaxon : sTaxa) {
+                            String sMatch = dlg.match(sTaxon);
+                            if (sMatch == null) {
+                                return;
+                            }
+                            double nDate = parseDate(sMatch);
+                            if (sTrait.length() > 0) {
+                                sTrait += ",";
+                            }
+                            sTrait += sTaxon + "=" + nDate;
+                        }
+                        break;
+                }
+                try {
+                    traitSet.traitsInput.setValue(sTrait, traitSet);
+                    convertTraitToTableData();
+                    convertTableDataToTrait();
+                } catch (Exception ex) {
+                    // TODO: handle exception
+                }
+                refreshPanel();
+            }
+        });
+        buttonBox.add(guessButton);
+
+
+        JButton clearButton = new JButton("Clear");
+        clearButton.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                try {
+                    traitSet.traitsInput.setValue("", traitSet);
+                } catch (Exception ex) {
+                    // TODO: handle exception
+                }
+                refreshPanel();
+            }
+        });
+        buttonBox.add(clearButton);
+
+        return buttonBox;
+    } // createButtonBox
+}
diff --git a/src/beast/app/beauti/TreeDistributionInputEditor.java b/src/beast/app/beauti/TreeDistributionInputEditor.java
new file mode 100644
index 0000000..ce725e5
--- /dev/null
+++ b/src/beast/app/beauti/TreeDistributionInputEditor.java
@@ -0,0 +1,155 @@
+package beast.app.beauti;
+
+import java.awt.Color;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.List;
+
+import javax.swing.Box;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.SwingUtilities;
+
+import beast.app.draw.InputEditor;
+import beast.app.draw.SmallLabel;
+import beast.core.Input;
+import beast.core.BEASTInterface;
+import beast.evolution.tree.Tree;
+import beast.evolution.tree.TreeDistribution;
+
+//import beast.evolution.speciation.BirthDeathGernhard08Model;
+//import beast.evolution.speciation.YuleModel;
+public class TreeDistributionInputEditor extends InputEditor.Base {
+
+    private static final long serialVersionUID = 1L;
+
+    public TreeDistributionInputEditor(BeautiDoc doc) {
+        super(doc);
+    }
+
+    @Override
+    public Class<?> type() {
+        return TreeDistribution.class;
+    }
+//	@Override
+//	public Class<?>[] types() {
+//		ArrayList<Class> types = new ArrayList<Class>();
+//		types.add(TreeDistribution.class);
+//		types.add(BirthDeathGernhard08Model.class);
+//		types.add(YuleModel.class);
+//		types.add(Coalescent.class);
+//		types.add(BayesianSkyline.class);
+//		return types.toArray(new Class[0]);
+//	}
+    ActionEvent m_e;
+
+    @Override
+    public void init(Input<?> input, BEASTInterface plugin, int listItemNr, ExpandOption bExpandOption, boolean bAddButtons) {
+        m_bAddButtons = bAddButtons;
+        m_input = input;
+        m_plugin = plugin;
+        this.itemNr = listItemNr;
+
+        Box itemBox = Box.createHorizontalBox();
+
+        TreeDistribution distr = (TreeDistribution) plugin;
+        String sText = ""/* plugin.getID() + ": " */;
+        if (distr.treeInput.get() != null) {
+            sText += distr.treeInput.get().getID();
+        } else {
+            sText += distr.treeIntervalsInput.get().treeInput.get().getID();
+        }
+        JLabel label = new JLabel(sText);
+        label.setMinimumSize(PriorListInputEditor.PREFERRED_SIZE);
+        label.setPreferredSize(PriorListInputEditor.PREFERRED_SIZE);
+        itemBox.add(label);
+        // List<String> sAvailablePlugins =
+        // PluginPanel.getAvailablePlugins(m_input, m_plugin, null);
+
+        List<BeautiSubTemplate> sAvailablePlugins = doc.getInputEditorFactory().getAvailableTemplates(m_input, m_plugin,
+                null, doc); 
+        // make sure we are dealing with a TreeDistribution
+        for (int i = sAvailablePlugins.size() - 1; i >= 0; i--) {
+        	BeautiSubTemplate t = sAvailablePlugins.get(i);
+        	Class<?> c = t._class;
+        	if (!(TreeDistribution.class.isAssignableFrom(c))) {
+        		sAvailablePlugins.remove(i);
+        	}
+        }
+        
+        JComboBox comboBox = new JComboBox(sAvailablePlugins.toArray());
+        comboBox.setName("TreeDistribution");
+
+        for (int i = sAvailablePlugins.size() - 1; i >= 0; i--) {
+            if (!TreeDistribution.class.isAssignableFrom(sAvailablePlugins.get(i)._class)) {
+                sAvailablePlugins.remove(i);
+            }
+        }
+
+        String sID = distr.getID();
+        try {
+            // sID = BeautiDoc.parsePartition(sID);
+            sID = sID.substring(0, sID.indexOf('.'));
+        } catch (Exception e) {
+            throw new RuntimeException("Improperly formatted ID: " + distr.getID());
+        }
+        for (BeautiSubTemplate template : sAvailablePlugins) {
+            if (template.matchesName(sID)) { // getMainID().replaceAll(".\\$\\(n\\)",
+                // "").equals(sID)) {
+                comboBox.setSelectedItem(template);
+            }
+        }
+
+        comboBox.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                m_e = e;
+                SwingUtilities.invokeLater(new Runnable() {
+                    @Override
+                    public void run() {
+                        JComboBox currentComboBox = (JComboBox) m_e.getSource();
+                        @SuppressWarnings("unchecked")
+                        List<BEASTInterface> list = (List<BEASTInterface>) m_input.get();
+                        BeautiSubTemplate template = (BeautiSubTemplate) currentComboBox.getSelectedItem();
+                        PartitionContext partitionContext = doc.getContextFor((BEASTInterface) list.get(itemNr));
+                        try {
+                            template.createSubNet(partitionContext, list, itemNr, true);
+                        } catch (Exception ex) {
+                            ex.printStackTrace();
+                        }
+                        sync();
+                        refreshPanel();
+                    }
+                });
+            }
+        });
+        itemBox.add(comboBox);
+        itemBox.add(Box.createGlue());
+
+        m_validateLabel = new SmallLabel("x", new Color(200, 0, 0));
+        m_validateLabel.setVisible(false);
+        validateInput();
+        itemBox.add(m_validateLabel);
+        add(itemBox);
+    }
+
+    @Override
+    public void validateInput() {
+        TreeDistribution distr = (TreeDistribution) m_plugin;
+        // TODO: robustify for the case the tree is not a simple binary tree
+        Tree tree = (Tree) distr.treeInput.get();
+        if (tree == null) {
+            tree = distr.treeIntervalsInput.get().treeInput.get();
+        }
+        if (tree.hasDateTrait()) {
+            if (!distr.canHandleTipDates()) {
+                m_validateLabel.setToolTipText("This tree prior cannot handle dated tips. Choose another tree prior.");
+                m_validateLabel.m_circleColor = Color.red;
+                m_validateLabel.setVisible(true);
+                return;
+            }
+        }
+
+        super.validateInput();
+    }
+}
diff --git a/src/beast/app/beauti/cancel.png b/src/beast/app/beauti/cancel.png
new file mode 100644
index 0000000..63c3da3
Binary files /dev/null and b/src/beast/app/beauti/cancel.png differ
diff --git a/src/beast/app/beauti/finish.png b/src/beast/app/beauti/finish.png
new file mode 100644
index 0000000..cdf9bc7
Binary files /dev/null and b/src/beast/app/beauti/finish.png differ
diff --git a/src/beast/app/beauti/guiutil/S11InitialSelection.java b/src/beast/app/beauti/guiutil/S11InitialSelection.java
new file mode 100644
index 0000000..29a044b
--- /dev/null
+++ b/src/beast/app/beauti/guiutil/S11InitialSelection.java
@@ -0,0 +1,153 @@
+package beast.app.beauti.guiutil;
+
+//http://www.java2s.com/Code/Java/Swing-Components/JComboBoxaddingautomaticcompletionHandlingtheinitialselection.htm
+//Code from: http://www.orbital-computer.de/JComboBox/
+/*
+Inside JComboBox: adding automatic completion
+
+Author: Thomas Bierhance
+        thomas at orbital-computer.de
+*/
+
+/*
+Handling the initial selection
+
+It is a quiet annoying that the initially selected item is not shown in the combo box. This
+can be easily changed in the constructor of the auto completing document.
+*/
+import javax.swing.*;
+import javax.swing.text.AttributeSet;
+import javax.swing.text.BadLocationException;
+import javax.swing.text.JTextComponent;
+import javax.swing.text.PlainDocument;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+
+public class S11InitialSelection extends PlainDocument {
+    JComboBox comboBox;
+    ComboBoxModel model;
+    JTextComponent editor;
+    // flag to indicate if setSelectedItem has been called
+    // subsequent calls to remove/insertString should be ignored
+    boolean selecting=false;
+
+    public S11InitialSelection(final JComboBox comboBox) {
+        this.comboBox = comboBox;
+        model = comboBox.getModel();
+        editor = (JTextComponent) comboBox.getEditor().getEditorComponent();
+        editor.setDocument(this);
+        comboBox.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                if (!selecting) highlightCompletedText(0);
+            }
+        });
+        editor.addKeyListener(new KeyAdapter() {
+            public void keyPressed(KeyEvent e) {
+                if (comboBox.isDisplayable()) comboBox.setPopupVisible(true);
+            }
+        });
+        // Handle initially selected object
+        Object selected = comboBox.getSelectedItem();
+        if (selected!=null) setText(selected.toString());
+        highlightCompletedText(0);
+    }
+
+    public void remove(int offs, int len) throws BadLocationException {
+        // return immediately when selecting an item
+        if (selecting) return;
+        super.remove(offs, len);
+    }
+
+    public void insertString(int offs, String str, AttributeSet a) throws BadLocationException {
+        // return immediately when selecting an item
+        if (selecting) return;
+        // insert the string into the document
+        super.insertString(offs, str, a);
+        // lookup and select a matching item
+        Object item = lookupItem(getText(0, getLength()));
+        if (item != null) {
+            setSelectedItem(item);
+        } else {
+            // keep old item selected if there is no match
+            item = comboBox.getSelectedItem();
+            // imitate no insert (later on offs will be incremented by str.length(): selection won't move forward)
+            offs = offs-str.length();
+            // provide feedback to the user that his input has been received but can not be accepted
+            comboBox.getToolkit().beep(); // when available use: UIManager.getLookAndFeel().provideErrorFeedback(comboBox);
+        }
+        setText(item.toString());
+        // select the completed part
+        highlightCompletedText(offs+str.length());
+    }
+
+    private void setText(String text) {
+        try {
+            // remove all text and insert the completed string
+            super.remove(0, getLength());
+            super.insertString(0, text, null);
+        } catch (BadLocationException e) {
+            throw new RuntimeException(e.toString());
+        }
+    }
+
+    private void highlightCompletedText(int start) {
+        editor.setCaretPosition(getLength());
+        editor.moveCaretPosition(start);
+    }
+
+    private void setSelectedItem(Object item) {
+        selecting = true;
+        model.setSelectedItem(item);
+        selecting = false;
+    }
+
+    private Object lookupItem(String pattern) {
+        Object selectedItem = model.getSelectedItem();
+        // only search for a different item if the currently selected does not match
+        if (selectedItem != null && startsWithIgnoreCase(selectedItem.toString(), pattern)) {
+            return selectedItem;
+        } else {
+            // iterate over all items
+            for (int i=0, n=model.getSize(); i < n; i++) {
+                Object currentItem = model.getElementAt(i);
+                // current item starts with the pattern?
+                if (startsWithIgnoreCase(currentItem.toString(), pattern)) {
+                    return currentItem;
+                }
+            }
+        }
+        // no item starts with the pattern => return null
+        return null;
+    }
+
+    // checks if str1 starts with str2 - ignores case
+    private boolean startsWithIgnoreCase(String str1, String str2) {
+        return str1.toUpperCase().startsWith(str2.toUpperCase());
+    }
+
+    private static void createAndShowGUI() {
+        // the combo box (add/modify items if you like to)
+        JComboBox comboBox = new JComboBox(new Object[] {"Ester", "Jordi", "Jordina", "Jorge", "Sergi"});
+        // has to be editable
+        comboBox.setEditable(true);
+        // change the editor's document
+        new S11InitialSelection(comboBox);
+
+        // create and show a window containing the combo box
+        JFrame frame = new JFrame();
+        frame.setDefaultCloseOperation(3);
+        frame.getContentPane().add(comboBox);
+        frame.pack(); frame.setVisible(true);
+    }
+
+
+    public static void main(String[] args) {
+        javax.swing.SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                createAndShowGUI();
+            }
+        });
+    }
+}
diff --git a/src/beast/app/beauti/link.png b/src/beast/app/beauti/link.png
new file mode 100644
index 0000000..a7e3431
Binary files /dev/null and b/src/beast/app/beauti/link.png differ
diff --git a/src/beast/app/beauti/unlink.png b/src/beast/app/beauti/unlink.png
new file mode 100644
index 0000000..1adb47e
Binary files /dev/null and b/src/beast/app/beauti/unlink.png differ
diff --git a/src/beast/app/beauti/woosh.wav b/src/beast/app/beauti/woosh.wav
new file mode 100644
index 0000000..9c09d1d
Binary files /dev/null and b/src/beast/app/beauti/woosh.wav differ
diff --git a/src/beast/app/draw/Arrow.java b/src/beast/app/draw/Arrow.java
new file mode 100644
index 0000000..fb3c759
--- /dev/null
+++ b/src/beast/app/draw/Arrow.java
@@ -0,0 +1,264 @@
+/*
+* File Arrow.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+package beast.app.draw;
+
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.Point;
+import java.awt.geom.GeneralPath;
+import java.io.PrintStream;
+import java.util.List;
+
+import javax.swing.JPanel;
+
+import org.w3c.dom.Node;
+
+public class Arrow extends Shape {
+    String m_sHeadID;
+    String m_sTailID;
+    public BEASTObjectShape m_tailShape;
+    public InputShape m_headShape;
+//	String m_sPenStyle;
+
+    /* c'tor for creating arrow while parsing XDL format XML **/
+    public Arrow(Node node, Document doc, boolean bReconstructPlugins) {
+        parse(node, doc, bReconstructPlugins);
+    }
+
+    /* c'tor for creating arrow when starting to draw new one **/
+    public Arrow(BEASTObjectShape tailShape, int x, int y) {
+        m_sTailID = tailShape.getID();
+        m_x = x;
+        m_y = y;
+        m_w = 1;
+        m_h = 1;
+        m_tailShape = tailShape;
+    }
+
+    /* c'tor for creating arrow with all fields set properly
+      * Used when arrows are created by Document.recalcArrows */
+    public Arrow(BEASTObjectShape tailShape, BEASTObjectShape headShape, String sInputName) {
+	        m_sTailID = tailShape.getID();
+	        m_tailShape = tailShape;
+	        InputShape input = headShape.getInputShape(sInputName);
+	        if (input == null) {
+	        	System.err.println("Arrow from " + tailShape.m_plugin.getID() + " to " + headShape.m_plugin.getID() + "." + sInputName + " skipped");	        	
+	        }
+	        m_sHeadID = input.getID();
+	        m_headShape = input;
+	        //m_sHeadID = headShape.m_id;
+	        m_x = 0;
+	        m_y = 0;
+	        m_w = 1;
+	        m_h = 1;
+	        m_pencolor = Color.gray;
+    }
+
+    @Override
+    public void draw(Graphics2D g, JPanel panel) {
+        g.setStroke(new BasicStroke(m_nPenWidth));
+        g.setColor(m_pencolor);
+        g.setColor(Color.gray);
+        GeneralPath path = new GeneralPath();
+        path.moveTo(m_x, m_y);
+        path.curveTo(m_x + 20, m_y, m_x + m_w - 40, m_y + m_h, m_x + m_w, m_y + m_h);
+        g.draw(path);
+        drawLabel(g);
+    }
+
+    /* change head position while dragging by mouse */
+    public void setHead(int w, int h) {
+        m_w = w;
+        m_h = h;
+    }
+
+    /* set all parameters properly at end of dragging when mouse is released */
+    public boolean setHead(InputShape shape, List<Shape> objects, Document doc) throws Exception {
+        m_sHeadID = shape.getID();
+        m_headShape = shape;
+        adjustCoordinates();
+        String sInputName = m_headShape.getInputName();
+        m_headShape.getPlugin().setInputValue(sInputName, m_tailShape.m_plugin);
+        return true;//setFunctionInput(objects, doc);
+    }
+
+    /* parse arrow in XDL format XML **/
+    @Override
+    void parse(Node node, Document doc, boolean bReconstructPlugins) {
+        super.parse(node, doc, bReconstructPlugins);
+        if (node.getAttributes().getNamedItem("headid") != null) {
+            m_sHeadID = node.getAttributes().getNamedItem("headid").getNodeValue();
+        }
+        if (node.getAttributes().getNamedItem("tailid") != null) {
+            m_sTailID = node.getAttributes().getNamedItem("tailid").getNodeValue();
+        }
+//		if (node.getAttributes().getNamedItem("penstyle") != null) {
+//			m_sPenStyle = node.getAttributes().getNamedItem("penstyle").getNodeValue();
+//		}
+    }
+
+    @Override
+    String getAtts() {
+        return
+                " headid='" + m_sHeadID + "'" +
+                        " tailid='" + m_sTailID + "'" +
+//		" penstyle='" + m_sPenStyle + "'" +
+                        super.getAtts();
+    }
+
+    @Override
+    public String getXML() {
+        return "<" + Document.ARROW_ELEMENT + getAtts() + "/>";
+    }
+
+    void adjustCoordinates() {
+        Point tailCenter = new Point((m_tailShape.getX() + m_tailShape.getX2()) / 2, (m_tailShape.getY() + m_tailShape.getY2()) / 2);
+        Point headCenter = new Point((m_headShape.getX() + m_headShape.getX2()) / 2, (m_headShape.getY() + m_headShape.getY2()) / 2);
+        Shape rect = m_tailShape;
+        Point roundness = new Point(0, 0);
+        if (rect instanceof InputShape) {
+            roundness.x = rect.m_w;
+            roundness.y = rect.m_h;
+        }
+        Point tailPoint = CalcIntersectionLineAndNode(
+                tailCenter, headCenter, rect, roundness);
+
+        rect = m_headShape;
+        roundness = new Point(0, 0);
+        if (rect instanceof InputShape) {
+            roundness.x = rect.m_w;
+            roundness.y = rect.m_h;
+        }
+
+        Point headPoint = CalcIntersectionLineAndNode(
+                headCenter, tailCenter, rect, roundness);
+        m_x = tailPoint.x;
+        m_y = tailPoint.y;
+        m_w = headPoint.x - m_x;
+        m_h = headPoint.y - m_y;
+    }
+
+    Point CalcIntersectionLineAndNode(Point p0, Point p1,
+                                      Shape position, Point roundness) {
+//	 Note: a rounded rectangle is a rectangle in which the corners are quarter elipses
+//		.p0			   .
+//					   .
+//					   .
+//					   |
+//		............=-	 <- partly elipse
+        //
+        Point pt = new Point();
+        int w, h, a, b, c; // width, height, elipse width, elipse height, cut position
+        w = Math.abs((position.getX() - position.getX2()) / 2);
+        h = Math.abs((position.getY() - position.getY2()) / 2);
+        a = Math.abs(roundness.x / 2);
+        b = Math.abs(roundness.y / 2);
+
+        // try intersection with horizontal line
+        if (p1.y != p0.y) { // Don't try if Line is horizontal
+            if (p1.y > p0.y) {
+                c = p0.y + h;
+            } else {
+                c = p0.y - h;
+            }
+            pt.y = c;
+            pt.x = p0.x + (p1.x - p0.x) * (c - p0.y) / (p1.y - p0.y);
+            if ((pt.x >= p0.x - w + a) && (pt.x <= p0.x + w - a))
+                return pt;
+        }
+
+        // try intersection with vertical line
+        if (p1.x != p0.x) { // Don't try if Line is vertical
+            if (p1.x > p0.x) {
+                c = p0.x + w;
+            } else {
+                c = p0.x - w;
+            }
+            pt.x = c;
+            pt.y = p0.y + (p1.y - p0.y) * (c - p0.x) / (p1.x - p0.x);
+            if ((pt.y >= p0.y - h + b) && (pt.y <= p0.y + h - b))
+                return pt;
+        }
+
+        // finally try intersection with one of the elips-shaped corners
+        double ar, br, ga, gb, A, B, C, p, q;
+
+        if (p1.x > p0.x)
+            p = (double) (p0.x + w - a);
+        else
+            p = (double) (p0.x - w + a);
+        if (p1.y > p0.y)
+            q = (double) (p0.y + h - b);
+        else
+            q = (double) (p0.y - h + b);
+
+        ar = (double) a;
+        br = (double) b;
+        if (p1.x == p0.x) // cheat to prevent divsion by zero
+        {
+            ga = (double) (p1.y - p0.y) / 1;
+        } else {
+            ga = (double) (p1.y - p0.y) / (double) (p1.x - p0.x);
+        }
+        gb = (double) (p0.y - ga * p0.x);
+        A = 1 / (ar * ar) + (ga * ga) / (br * br);
+        B = -2.0 * p / (ar * ar) + 2.0 * ga * gb / (br * br) - 2.0 * ga * q / (br * br);
+        C = p * p / (ar * ar) + gb * gb / (br * br) - 2.0 * gb * q / (br * br) + q * q / (br * br) - 1.0;
+
+        if (p1.x > p0.x) {
+            pt.x = (int) ((-B + Math.sqrt(B * B - 4.0 * A * C)) / (2.0 * A));
+        } else {
+            pt.x = (int) ((-B - Math.sqrt(B * B - 4.0 * A * C)) / (2.0 * A));
+        }
+        pt.y = (int) (ga * pt.x + gb);
+        return pt;
+
+    }
+
+    String m_sID = null;
+
+    @Override
+    public String getID() {
+        return m_sID;
+    }
+
+    public void setID(String sID) {
+        m_sID = sID;
+    }
+
+    public String toString() {
+        return m_sTailID + "-->" + m_sHeadID;
+    }
+
+    @Override
+    void toSVG(PrintStream out) {
+        out.println("<path d='M " + m_x + " " + m_y +
+                " C " + (m_x + 20) + " " + m_y + " " + (m_x + m_w - 40) + " " + (m_y + m_h) + " " + (m_x + m_w) + " " + (m_y + m_h) + "'" +
+//	    		" q 20 0 " + (m_w-40) + " " + (m_h) + " T 40 0 '" +
+                " stroke='rgb(" + m_pencolor.getRed() + "," + m_pencolor.getGreen() + "," + m_pencolor.getBlue() + ")'" +
+                " stroke-width='" + m_nPenWidth + "' fill='none'/>");
+    }
+} // class Arrow
diff --git a/src/beast/app/draw/BEASTObjectDialog.java b/src/beast/app/draw/BEASTObjectDialog.java
new file mode 100644
index 0000000..2873afb
--- /dev/null
+++ b/src/beast/app/draw/BEASTObjectDialog.java
@@ -0,0 +1,208 @@
+package beast.app.draw;
+
+
+import javax.swing.*;
+import javax.swing.border.EmptyBorder;
+
+import beast.app.beauti.BeautiDoc;
+import beast.core.Input;
+import beast.core.MCMC;
+import beast.core.BEASTObject;
+import beast.core.BEASTInterface;
+import beast.util.XMLProducer;
+
+
+import java.awt.*;
+import java.io.File;
+import java.net.URL;
+import java.util.List;
+import java.util.Scanner;
+
+/**
+ * Dialog for editing Plugins.
+ * <p/>
+ * This dynamically creates a dialog consisting of
+ * InputEditors associated with the inputs of a Plugin.
+ * *
+ */
+
+public class BEASTObjectDialog extends JDialog {
+    private static final long serialVersionUID = 1L;
+    /**
+     * plug in to be edited *
+     */
+
+    private boolean m_bOK = false;
+
+    public BEASTObjectPanel m_panel;
+
+    /**
+     * map that identifies the InputEditor to use for a particular type of Input *
+     */
+
+
+    BeautiDoc doc;
+    
+    public BEASTObjectDialog(BEASTObjectPanel panel, BeautiDoc doc) {
+        init(panel);
+        this.doc = doc;
+    }
+
+    public BEASTObjectDialog(BEASTInterface plugin, Class<? extends BEASTInterface> aClass, List<BEASTInterface> plugins, BeautiDoc doc) {
+        this(new BEASTObjectPanel(plugin, aClass, plugins, doc), doc);
+    }
+
+    public BEASTObjectDialog(BEASTInterface plugin, Class<?> type, BeautiDoc doc) {
+        this(new BEASTObjectPanel(plugin, type, doc), doc);
+    }
+
+    
+    public boolean showDialog() {
+        URL url = ClassLoader.getSystemResource(ModelBuilder.ICONPATH + "beast.png");
+        Icon icon = new ImageIcon(url);
+        JOptionPane optionPane = new JOptionPane(m_panel,
+                JOptionPane.QUESTION_MESSAGE,
+                JOptionPane.OK_CANCEL_OPTION,
+                icon,
+                null,
+                null);
+        optionPane.setBorder(new EmptyBorder(12, 12, 12, 12));
+
+        Frame frame = (doc != null ? doc.getFrame(): Frame.getFrames()[0]);
+        final JDialog dialog = optionPane.createDialog(frame, this.getTitle());
+        dialog.pack();
+
+        dialog.setVisible(true);
+
+        int result = JOptionPane.CANCEL_OPTION;
+        Integer value = (Integer) optionPane.getValue();
+        if (value != null && value != -1) {
+            result = value;
+        }
+        m_bOK = (result != JOptionPane.CANCEL_OPTION);
+        return m_bOK;
+    }
+    
+    /* to be called when OK is pressed **/
+    public void accept(BEASTInterface plugin, BeautiDoc doc) {
+        try {
+            for (Input<?> input : m_panel.m_plugin.listInputs()) {
+            	if (input.get() != null && (input.get() instanceof List)) {
+                    // setInpuValue (below) on lists does not lead to expected result
+            		// it appends values to the list instead, so we have to clear it first
+                    List list = (List)plugin.getInput(input.getName()).get();
+                    list.clear();
+            	}
+            	plugin.setInputValue(input.getName(), input.get());
+            }
+            plugin.setID(m_panel.m_plugin.getID());
+            if (doc != null) {
+            	doc.addPlugin(plugin);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    void init(BEASTObjectPanel panel) {
+        this.m_panel = panel;
+
+        setModal(true);
+
+        add(BorderLayout.CENTER, panel);
+
+        setTitle(panel.m_plugin.getID() + " Editor");
+
+
+//        /* add cancel and ok buttons at the bottom */
+//        Box cancelOkBox = Box.createHorizontalBox();
+//        cancelOkBox.setBorder(new EtchedBorder());
+//        JButton okButton = new JButton("Ok");
+//        okButton.addActionListener(new ActionListener() {
+//
+//            // implementation ActionListener
+//            public void actionPerformed(ActionEvent e) {
+//                m_bOK = true;
+//                dispose();
+//            }
+//        });
+//        JButton cancelButton = new JButton("Cancel");
+//        cancelButton.addActionListener(new ActionListener() {
+//
+//            // implementation ActionListener
+//            public void actionPerformed(ActionEvent e) {
+//                m_bOK = false;
+//                dispose();
+//            }
+//        });
+//        cancelOkBox.add(Box.createHorizontalGlue());
+//        cancelOkBox.add(okButton);
+//        cancelOkBox.add(Box.createHorizontalGlue());
+//        cancelOkBox.add(cancelButton);
+//        cancelOkBox.add(Box.createHorizontalGlue());
+//
+//        add(BorderLayout.SOUTH, cancelOkBox);
+//
+//        Dimension dim = panel.getPreferredSize();
+//        Dimension dim2 = cancelOkBox.getPreferredSize();
+//        setSize(dim.width + 10, dim.height + dim2.height + 30);
+    } // c'tor
+
+    public boolean getOK(BeautiDoc doc) {
+        //PluginDialog.m_position.x -= 30;
+        //PluginDialog.m_position.y -= 30;
+        if (m_bOK) {
+            String sOldID = m_panel.m_plugin.getID();
+            BEASTObjectPanel.g_plugins.remove(sOldID);
+            m_panel.m_plugin.setID(m_panel.m_identry.getText());
+            BEASTObjectPanel.registerPlugin(m_panel.m_plugin.getID(), m_panel.m_plugin, doc);
+        }
+        return m_bOK;
+    }
+
+    /**
+     * rudimentary test *
+     */
+    public static void main(String[] args) {
+        BEASTObjectDialog dlg = null;
+        try {
+            if (args.length == 0) {
+                dlg = new BEASTObjectDialog(new BEASTObjectPanel(new MCMC(), Runnable.class, null), null);
+            } else if (args[0].equals("-x")) {
+                StringBuilder text = new StringBuilder();
+                String NL = System.getProperty("line.separator");
+                Scanner scanner = new Scanner(new File(args[1]));
+                try {
+                    while (scanner.hasNextLine()) {
+                        text.append(scanner.nextLine() + NL);
+                    }
+                } finally {
+                    scanner.close();
+                }
+                BEASTInterface plugin = new beast.util.XMLParser().parseBareFragment(text.toString(), false);
+                dlg = new BEASTObjectDialog(new BEASTObjectPanel(plugin, plugin.getClass(), null), null);
+            } else if (args.length == 1) {
+                dlg = new BEASTObjectDialog(new BEASTObjectPanel((BEASTInterface) Class.forName(args[0]).newInstance(), Class.forName(args[0]), null), null);
+            } else if (args.length == 2) {
+                dlg = new BEASTObjectDialog(new BEASTObjectPanel((BEASTInterface) Class.forName(args[0]).newInstance(), Class.forName(args[1]), null), null);
+            } else {
+                throw new Exception("Incorrect number of arguments");
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            System.err.println("Usage: " + BEASTObjectDialog.class.getName() + " [-x file ] [class [type]]\n" +
+                    "where [class] (optional, default MCMC) is a Plugin to edit\n" +
+                    "and [type] (optional only if class is specified, default Runnable) the type of the Plugin.\n" +
+                    "for example\n" +
+                    "");
+            System.exit(0);
+        }
+        dlg.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
+        if (dlg.showDialog()) {
+            BEASTInterface plugin = dlg.m_panel.m_plugin;
+            String sXML = new XMLProducer().modelToXML(plugin);
+            System.out.println(sXML);
+        }
+    } // main
+} // class PluginDialog
+
diff --git a/src/beast/app/draw/BEASTObjectInputEditor.java b/src/beast/app/draw/BEASTObjectInputEditor.java
new file mode 100644
index 0000000..3838a05
--- /dev/null
+++ b/src/beast/app/draw/BEASTObjectInputEditor.java
@@ -0,0 +1,481 @@
+package beast.app.draw;
+
+
+
+import javax.swing.*;
+import javax.swing.border.EtchedBorder;
+
+import beast.app.beauti.BeautiDoc;
+import beast.app.beauti.BeautiSubTemplate;
+import beast.core.Input;
+import beast.core.BEASTInterface;
+import beast.util.AddOnManager;
+
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.Arrays;
+import java.util.List;
+
+public class BEASTObjectInputEditor extends InputEditor.Base {
+    private static final long serialVersionUID = 1L;
+    JComboBox m_selectPluginBox;
+    SmallButton m_editPluginButton;
+
+    BEASTObjectInputEditor _this;
+
+    //public PluginInputEditor() {}
+    public BEASTObjectInputEditor(BeautiDoc doc) {
+        super(doc);
+        _this = this;
+    }
+
+    @Override
+    public Class<?> type() {
+        return BEASTInterface.class;
+    }
+
+    /**
+     * construct an editor consisting of
+     * o a label
+     * o a combo box for selecting another plug-in
+     * o a button for editing the plug-in
+     * o validation label -- optional, if input is not valid
+     */
+    @Override
+    public void init(Input<?> input, BEASTInterface plugin, int itemNr, ExpandOption bExpandOption, boolean bAddButtons) {
+    	//box.setAlignmentY(LEFT_ALIGNMENT);
+    	
+        m_bAddButtons = bAddButtons;
+        m_input = input;
+        m_plugin = plugin;
+		this.itemNr = itemNr;
+        if (bExpandOption == ExpandOption.FALSE) {
+            simpleInit(input, plugin);
+        } else {
+            expandedInit(input, plugin);
+        }
+    } // init
+
+    /**
+     * add combobox with available plugins
+     * a button to edit that plugin +
+     * a validation icon
+     * *
+     */
+    void simpleInit(Input<?> input, BEASTInterface plugin) {
+
+        addInputLabel();
+
+        addComboBox(this, input, plugin);
+
+        if (m_bAddButtons) {
+            if (BEASTObjectPanel.countInputs((BEASTInterface) m_input.get(), doc) > 0) {
+                m_editPluginButton = new SmallButton("e", true);
+                if (input.get() == null) {
+                    m_editPluginButton.setEnabled(false);
+                }
+                m_editPluginButton.setToolTipText("Edit " + m_inputLabel.getText());
+
+                m_editPluginButton.addActionListener(e -> {
+                    BEASTObjectDialog dlg = new BEASTObjectDialog((BEASTInterface) m_input.get(), m_input.getType(), doc);
+                    if (dlg.showDialog()) {
+                        try {
+                            dlg.accept((BEASTInterface) m_input.get(), doc);
+                        } catch (Exception ex) {
+                            ex.printStackTrace();
+                        }
+                    }
+                    refresh();
+                    validateInput();
+                    refreshPanel();
+                });
+                add(m_editPluginButton);
+            }
+        }
+        addValidationLabel();
+    } // init
+
+    void refresh() {
+    	if (m_selectPluginBox != null) {
+	        String sOldID = (String) m_selectPluginBox.getSelectedItem();
+	        String sID = ((BEASTInterface) m_input.get()).getID();
+	        if (!sID.equals(sOldID)) {
+	            m_selectPluginBox.addItem(sID);
+	            m_selectPluginBox.setSelectedItem(sID);
+	            m_selectPluginBox.removeItem(sOldID);
+	        }
+    	}
+        super.refreshPanel();
+//        Component c = this;
+//        while (((Component) c).getParent() != null) {
+//        	c = ((Component) c).getParent();
+//        	if (c instanceof ListSelectionListener) {
+//        		((ListSelectionListener) c).valueChanged(null);
+//        	}
+//        }
+    }
+
+    void initSelectPluginBox() {
+        List<String> sAvailablePlugins = doc.getInputEditorFactory().getAvailablePlugins(m_input, m_plugin, null, doc);
+        if (sAvailablePlugins.size() > 0) {
+            sAvailablePlugins.add(NO_VALUE);
+            for (int i = 0; i < sAvailablePlugins.size(); i++) {
+                String sPlugin = sAvailablePlugins.get(i);
+                if (sPlugin.startsWith("new ")) {
+                    sPlugin = sPlugin.substring(sPlugin.lastIndexOf('.'));
+                    sAvailablePlugins.set(i, sPlugin);
+                }
+
+            }
+            m_selectPluginBox.removeAllItems();
+            for (String sStr : sAvailablePlugins.toArray(new String[0])) {
+                m_selectPluginBox.addItem(sStr);
+            }
+            m_selectPluginBox.setSelectedItem(m_plugin.getID());
+        }
+    }
+
+    Box m_expansionBox = null;
+
+    void expandedInit(Input<?> input, BEASTInterface plugin) {
+        addInputLabel();
+        Box box = Box.createVerticalBox();
+        // add horizontal box with combobox of Plugins to select from
+        Box combobox = Box.createHorizontalBox();
+        addComboBox(combobox, input, plugin);
+        box.add(combobox);
+
+        doc.getInputEditorFactory().addInputs(box, (BEASTInterface) input.get(), this, this, doc);
+
+        box.setBorder(new EtchedBorder());
+        //box.setBorder(BorderFactory.createLineBorder(Color.BLUE));
+        
+        add(box);
+        m_expansionBox = box;
+    } // expandedInit
+
+
+    /**
+     * add combobox with Plugins to choose from
+     * On choosing a new value, create plugin (if is not already an object)
+     * Furthermore, if expanded, update expanded inputs
+     */
+    protected void addComboBox(JComponent box, Input<?> input, BEASTInterface plugin) {
+    	if (itemNr >= 0) {
+    		box.add(new JLabel(plugin.getID()));
+    		box.add(Box.createGlue());
+    		return;
+    	}
+    	
+        List<BeautiSubTemplate> availableTemplates = doc.getInputEditorFactory().getAvailableTemplates(m_input, m_plugin, null, doc);
+        if (availableTemplates.size() > 0) {
+//        	if (m_input.getRule() != Validate.REQUIRED || plugin == null) {
+//        		sAvailablePlugins.add(NO_VALUE);
+//        	}
+//        	for (int i = 0; i < sAvailablePlugins.size(); i++) {
+//        		String sPlugin = sAvailablePlugins.get(i);
+//        		if (sPlugin.startsWith("new ")) {
+//        			sPlugin = sPlugin.substring(sPlugin.lastIndexOf('.'));
+//        			sAvailablePlugins.set(i, sPlugin);
+//        		}
+//
+//        	}
+            m_selectPluginBox = new JComboBox(availableTemplates.toArray());
+            m_selectPluginBox.setName(input.getName());
+
+            Object o = input.get();
+            if (itemNr >= 0) {
+            	o = ((List)o).get(itemNr);
+            }
+            String sID;
+            if (o == null) {
+                sID = plugin.getID();
+            } else {
+                sID = ((BEASTInterface) o).getID();
+            }
+            if (sID.indexOf('.')>=0) {
+            	sID = sID.substring(0, sID.indexOf('.'));
+            }
+            for (BeautiSubTemplate template : availableTemplates) {
+                if (template.matchesName(sID)) {
+                    m_selectPluginBox.setSelectedItem(template);
+                }
+            }
+
+            m_selectPluginBox.addActionListener(new ActionListener() {
+                // implements ActionListener
+                public void actionPerformed(ActionEvent e) {
+
+//                	SwingUtilities.invokeLater(new Runnable() {
+//						
+//						@Override
+//						public void run() {
+
+                    // get a handle of the selected plugin
+                    BeautiSubTemplate sSelected = (BeautiSubTemplate) m_selectPluginBox.getSelectedItem();
+                    BEASTInterface plugin = (BEASTInterface) m_input.get();
+                    String sID = plugin.getID();
+                    String sPartition = sID.substring(sID.indexOf('.') + 1);
+                    if (sPartition.indexOf(':') >= 0) {
+                    	sPartition = sID.substring(sID.indexOf(':') + 1);
+                    }
+                    //String sNewID = sSelected.getMainID().replaceAll("\\$\\(n\\)", sPartition);
+
+                    if (sSelected.equals(NO_VALUE)) {
+                        plugin = null;
+//                    } else if (PluginPanel.g_plugins.containsKey(sNewID)) {
+//                    	plugin = PluginPanel.g_plugins.get(sNewID);
+                    } else {
+                        try {
+                            plugin = sSelected.createSubNet(doc.getContextFor(plugin), m_plugin, m_input, true);
+                            //PluginPanel.addPluginToMap(plugin);
+                            // tricky: try to connect up new inputs with old inputs of existing name
+//                            Plugin oldPlugin = (Plugin) m_input.get();
+//                            for (Input<?> oldInput: oldPlugin.listInputs()) {
+//                            	String sName = oldInput.getName();
+//                            	try {
+//                            		Input<?> newInput = plugin.getInput(sName);
+//                            		if (newInput.get() instanceof List) {
+//                            			List<?> values = (List<?>) oldInput.get();
+//                            			for (Object value: values) {
+//                                			newInput.setValue(value, plugin);
+//                            			}
+//                            		} else {
+//                            			newInput.setValue(oldInput.get(), plugin);
+//                            		}
+//                            	} catch (Exception ex) {
+//									// ignore
+//								}
+//                            }
+                        } catch (Exception ex) {
+                            JOptionPane.showMessageDialog(null, "Could not select plugin: " +
+                                    ex.getClass().getName() + " " +
+                                    ex.getMessage()
+                            );
+                        }
+                    }
+
+
+                    try {
+                        if (plugin == null) {
+                            m_selectPluginBox.setSelectedItem(NO_VALUE);
+                            // is this input expanded?
+                            if (m_expansionBox != null) {
+                                // remove items from Expansion Box, if any
+                                for (int i = 1; i < m_expansionBox.getComponentCount(); i++) {
+                                    m_expansionBox.remove(i);
+                                }
+                            } else { // not expanded
+                                if (m_bAddButtons && m_editPluginButton != null) {
+                                    m_editPluginButton.setEnabled(false);
+                                }
+                            }
+                        } else {
+                            if (!m_input.canSetValue(plugin, m_plugin)) {
+                                throw new Exception("Cannot set input to this value");
+                            }
+//                        	// get handle on ID of the plugin, and add to combobox if necessary
+//                            String sID = plugin.getID();
+//                            // TODO RRB: have to remove ID first, then add it
+//                            // The addition is necessary to make the items in the expansionBox scale and show up
+//                            // Is there another way?
+//                            m_selectPluginBox.removeItem(sID);
+//                            m_selectPluginBox.addItem(sID);
+//                            m_selectPluginBox.setSelectedItem(sID);
+                            sID = plugin.getID();
+                            sID = sID.substring(0, sID.indexOf('.'));
+                             for (int i = 0; i < m_selectPluginBox.getItemCount(); i++) {
+                                BeautiSubTemplate template = (BeautiSubTemplate) m_selectPluginBox.getItemAt(i);
+                                if (template.getMainID().replaceAll(".\\$\\(n\\)", "").equals(sID) ||
+                                		template.getMainID().replaceAll(".s:\\$\\(n\\)", "").equals(sID) || 
+                                		template.getMainID().replaceAll(".c:\\$\\(n\\)", "").equals(sID) || 
+                                		template.getMainID().replaceAll(".t:\\$\\(n\\)", "").equals(sID)) {
+                                    m_selectPluginBox.setSelectedItem(template);
+                                }
+                            }
+                        }
+
+                        setValue(plugin);
+                        //m_input.setValue(plugin, m_plugin);
+
+                        if (m_expansionBox != null) {
+                            // remove items from Expansion Box
+                            for (int i = 1; i < m_expansionBox.getComponentCount(); ) {
+                                m_expansionBox.remove(i);
+                            }
+                            // add new items to Expansion Box
+                            if (plugin != null) {
+                            	doc.getInputEditorFactory().addInputs(m_expansionBox, plugin, _this, _this, doc);
+                            }
+                        } else {
+                            // it is not expanded, enable the edit button
+                            if (m_bAddButtons && m_editPluginButton != null) {
+                                m_editPluginButton.setEnabled(true);
+                            }
+                            validateInput();
+                        }
+                        sync();
+                        refreshPanel();
+                    } catch (Exception ex) {
+                        sID = ((BEASTInterface) m_input.get()).getID();
+                        m_selectPluginBox.setSelectedItem(sID);
+                        ex.printStackTrace();
+                        JOptionPane.showMessageDialog(null, "Could not change plugin: " +
+                                ex.getClass().getName() + " " +
+                                ex.getMessage() 
+                        );
+                    }
+                }
+
+            }
+            );
+//            }
+//            });
+            m_selectPluginBox.setToolTipText(input.getHTMLTipText());
+            m_selectPluginBox.setMaximumSize(new Dimension(1024, 200));
+            box.add(m_selectPluginBox);
+        }
+    }
+
+//    protected void addComboBox2(Box box, Input <?> input, Plugin plugin) {
+//        List<String> sAvailablePlugins = PluginPanel.getAvailablePlugins(m_input, m_plugin, null);
+//        if (sAvailablePlugins.size() > 0) {
+//        	if (m_input.getRule() != Validate.REQUIRED || plugin == null) {
+//        		sAvailablePlugins.add(NO_VALUE);
+//        	}
+//        	for (int i = 0; i < sAvailablePlugins.size(); i++) {
+//        		String sPlugin = sAvailablePlugins.get(i);
+//        		if (sPlugin.startsWith("new ")) {
+//        			sPlugin = sPlugin.substring(sPlugin.lastIndexOf('.'));
+//        			sAvailablePlugins.set(i, sPlugin);
+//        		}
+//
+//        	}
+//            m_selectPluginBox = new JComboBox(sAvailablePlugins.toArray(new String[0]));
+//            String sSelectString = NO_VALUE;
+//            if (input.get() != null) {
+//                sSelectString = ((Plugin) input.get()).getID();
+//            }
+//            m_selectPluginBox.setSelectedItem(sSelectString);
+//
+//            m_selectPluginBox.addActionListener(new ActionListener() {
+//                // implements ActionListener
+//                public void actionPerformed(ActionEvent e) {
+//                	
+//                	// get a handle of the selected plugin
+//                    String sSelected = (String) m_selectPluginBox.getSelectedItem();
+//                    Plugin plugin = (Plugin) m_input.get();
+//                    if (sSelected.equals(NO_VALUE)) {
+//                        plugin = null;
+//                    } else if (!sSelected.startsWith(".")) {
+//                        plugin = PluginPanel.g_plugins.get(sSelected);
+//                    } else {
+//                        List<String> sAvailablePlugins = PluginPanel.getAvailablePlugins(m_input, m_plugin, null);
+//                        int i = 0;                     
+//                        while (!sAvailablePlugins.get(i).matches(".*\\"+sSelected+"$")) {
+//                        	i++;
+//                        }
+//                    	sSelected = sAvailablePlugins.get(i);                       
+//                        /* create new plugin */
+//                        try {
+//                            plugin = (Plugin) Class.forName(sSelected.substring(4)).newInstance();
+//                            PluginPanel.addPluginToMap(plugin);
+//                            // tricky: try to connect up new inputs with old inputs of existing name
+//                            Plugin oldPlugin = (Plugin) m_input.get();
+//                            for (Input<?> oldInput: oldPlugin.listInputs()) {
+//                            	String sName = oldInput.getName();
+//                            	try {
+//                            		Input<?> newInput = plugin.getInput(sName);
+//                            		if (newInput.get() instanceof List) {
+//                            			List<?> values = (List<?>) oldInput.get();
+//                            			for (Object value: values) {
+//                                			newInput.setValue(value, plugin);
+//                            			}
+//                            		} else {
+//                            			newInput.setValue(oldInput.get(), plugin);
+//                            		}
+//                            	} catch (Exception ex) {
+//									// ignore
+//								}
+//                            }
+//                            
+//                        } catch (Exception ex) {
+//                            JOptionPane.showMessageDialog(null, "Could not select plugin: " +
+//                                    ex.getClass().getName() + " " +
+//                                    ex.getMessage()
+//                            );
+//                        }
+//                    }
+//
+//                    
+//                    try {
+//                        if (plugin == null) {
+//                            m_selectPluginBox.setSelectedItem(NO_VALUE);
+//                            // is this input expanded?
+//                            if (m_expansionBox != null) {
+//                            	// remove items from Expansion Box, if any
+//                            	for (int i = 1; i < m_expansionBox.getComponentCount(); i++) {
+//                            		m_expansionBox.remove(i);
+//                            	}
+//                            } else { // not expanded
+//                            	if (m_bAddButtons) {
+//                            		m_editPluginButton.setEnabled(false);
+//                            	}
+//                            }
+//                        } else {
+//                            if (!m_input.canSetValue(plugin, m_plugin)) {
+//                            	throw new Exception("Cannot set input to this value");
+//                            }
+//                        	// get handle on ID of the plugin, and add to combobox if necessary
+//                            String sID = plugin.getID();
+//                            // TODO RRB: have to remove ID first, then add it
+//                            // The addition is necessary to make the items in the expansionBox scale and show up
+//                            // Is there another way?
+//                            m_selectPluginBox.removeItem(sID);
+//                            m_selectPluginBox.addItem(sID);
+//                            m_selectPluginBox.setSelectedItem(sID);
+//                        }
+//                        
+//                        m_input.setValue(plugin, m_plugin);
+//                        
+//                        if (m_expansionBox != null) {
+//                        	// remove items from Expansion Box
+//                        	for (int i = 1; i < m_expansionBox.getComponentCount(); ) {
+//                        		m_expansionBox.remove(i);
+//                        	}
+//                        	// add new items to Expansion Box
+//                        	if (plugin != null) {
+//                        		PluginPanel.addInputs(m_expansionBox, plugin, _this, _this);
+//                        	}
+//                        } else {
+//                        	// it is not expanded, enable the edit button
+//                        	if (m_bAddButtons) {
+//                        		m_editPluginButton.setEnabled(true);
+//                        	}
+//                            checkValidation();
+//                        }
+//                        
+//                    } catch (Exception ex) {
+//                        String sID = ((Plugin)m_input.get()).getID();
+//                        m_selectPluginBox.setSelectedItem(sID);
+//                    	//ex.printStackTrace();
+//                        JOptionPane.showMessageDialog(null, "Could not change plugin: " +
+//                                ex.getClass().getName() + " " +
+//                                ex.getMessage()
+//                        );
+//                    }
+//                }
+//            });
+//            m_selectPluginBox.setToolTipText(input.getTipText());
+//            m_selectPluginBox.setMaximumSize(new Dimension(1024, 20));
+//            box.add(m_selectPluginBox);
+//        }
+//    }
+
+    String[] getAvailablePlugins() {
+        List<String> sPlugins = AddOnManager.find(m_input.getType(), "beast");
+        return sPlugins.toArray(new String[0]);
+    } // getAvailablePlugins
+
+} // class PluginInputEditor
diff --git a/src/beast/app/draw/BEASTObjectPanel.java b/src/beast/app/draw/BEASTObjectPanel.java
new file mode 100644
index 0000000..b565d86
--- /dev/null
+++ b/src/beast/app/draw/BEASTObjectPanel.java
@@ -0,0 +1,474 @@
+package beast.app.draw;
+
+
+
+
+import javax.swing.*;
+
+import beast.app.beauti.BeautiDoc;
+import beast.core.Input;
+import beast.core.MCMC;
+import beast.core.BEASTInterface;
+import beast.evolution.alignment.Taxon;
+import beast.util.XMLProducer;
+
+
+import java.awt.*;
+import java.io.File;
+import java.util.*;
+import java.util.List;
+
+/**
+ * Panel for editing Plugins.
+ * <p/>
+ * This dynamically creates a Panel consisting of
+ * InputEditors associated with the inputs of a Plugin.
+ * *
+ */
+
+public class BEASTObjectPanel extends JPanel {
+    private static final long serialVersionUID = 1L;
+    /**
+     * plug in to be edited *
+     */
+    public BEASTInterface m_plugin;
+    /**
+     * (super) class of plug-in, this determines the super-class
+     * that is allowable if the plugin class is changed.
+     */
+    Class<?> m_pluginClass;
+    JLabel m_pluginButton;
+    JTextField m_identry;
+
+    private boolean m_bOK = false;
+    /* Set of plugins in the system.
+      * These are the plugins that an input can be connected to **/
+    static public HashMap<String, BEASTInterface> g_plugins = null;
+    //    static public Set<Operator> g_operators = null;
+//    static public Set<StateNode> g_stateNodes = null;
+//    static public Set<Loggable> g_loggers = null;
+//    static public Set<Distribution> g_distributions = null;
+
+    public static Point m_position;
+
+    /**
+     * map that identifies the InputEditor to use for a particular type of Input *
+     */
+//    static HashMap<Class<?>, String> g_inputEditorMap;
+//    static HashMap<Class<?>, String> g_listInputEditorMap;
+
+
+    static {
+        init();
+    } // finished registering input editors
+
+    public static void init() {
+//        // register input editors
+//        g_inputEditorMap = new HashMap<Class<?>, String>();
+//        g_listInputEditorMap = new HashMap<Class<?>, String>();
+//
+////        String [] sKnownEditors = new String [] {"beast.app.draw.DataInputEditor","beast.app.beauti.AlignmentListInputEditor", "beast.app.beauti.FrequenciesInputEditor", "beast.app.beauti.OperatorListInputEditor", "beast.app.beauti.ParametricDistributionInputEditor", "beast.app.beauti.PriorListInputEditor", "beast.app.beauti.SiteModelInputEditor", "beast.app.beauti.TaxonSetInputEditor", "beast.app.beauti.TipDatesInputEditor", "beast.app.draw.BooleanInputEditor", "beast.app.draw.Doubl [...]
+////        		"beast.app.draw.ParameterInputEditor", "beast.app.draw.PluginInputEditor", "beast.app.draw.StringInputEditor"};
+////        registerInputEditors(sKnownEditors);
+//        String[] PACKAGE_DIRS = {"beast.app",};
+//        for (String sPackage : PACKAGE_DIRS) {
+//            List<String> sInputEditors = AddOnManager.find("beast.app.draw.InputEditor", sPackage);
+//            registerInputEditors(sInputEditors.toArray(new String[0]));
+//        }
+
+        m_position = new Point(0, 0);
+        g_plugins = new HashMap<String, BEASTInterface>();
+//        g_operators = new HashSet<Operator>();
+//        g_stateNodes = new HashSet<StateNode>();
+//        g_loggers = new HashSet<Loggable>();
+//        g_distributions = new HashSet<Distribution>();
+    }
+
+
+    public BEASTObjectPanel(BEASTInterface plugin, Class<?> _pluginClass, List<BEASTInterface> plugins, BeautiDoc doc) {
+        //g_plugins = new HashMap<String, Plugin>();
+        for (BEASTInterface plugin2 : plugins) {
+            String sID = getID(plugin2);
+            // ensure IDs are unique
+            if (g_plugins.containsKey(sID)) {
+                plugin2.setID(null);
+                sID = getID(plugin2);
+            }
+            registerPlugin(getID(plugin2), plugin2, doc);
+        }
+        init(plugin, _pluginClass, true, doc);
+    }
+
+    /**
+     * add plugin to plugin map and update related maps
+     *
+     * @return true if it was already registered *
+     */
+    static public boolean registerPlugin(String sID, BEASTInterface plugin, BeautiDoc doc) {
+        if (doc != null) {
+            doc.registerPlugin(plugin);
+        }
+//    	if (plugin instanceof Operator) {
+//    		g_operators.add((Operator)plugin);
+//    	}
+//    	if (plugin instanceof StateNode) {
+//    		g_stateNodes.add((StateNode)plugin);
+//    	}
+//    	if (plugin instanceof Loggable) {
+//    		g_loggers.add((Loggable)plugin);
+//    	}
+//    	if (plugin instanceof Distribution) {
+//    		g_distributions.add((Distribution)plugin);
+//    	}
+        if (g_plugins.containsKey(sID) && g_plugins.get(sID) == plugin) {
+            return true;
+        }
+        g_plugins.put(sID, plugin);
+        return false;
+    }
+
+    public static void renamePluginID(BEASTInterface plugin, String sOldID, String sID, BeautiDoc doc) {
+        if (doc != null) {
+            doc.unregisterPlugin(plugin);
+        }
+        g_plugins.remove(sOldID);
+//		g_operators.remove(sOldID);
+//		g_stateNodes.remove(sOldID);
+//		g_loggers.remove(sOldID);
+//		g_distributions.remove(sOldID);
+        registerPlugin(sID, plugin, doc);
+    }
+
+    public BEASTObjectPanel(BEASTInterface plugin, Class<?> _pluginClass, BeautiDoc doc) {
+        this(plugin, _pluginClass, true, doc);
+    }
+
+    public BEASTObjectPanel(BEASTInterface plugin, Class<?> _pluginClass, boolean bShowHeader, BeautiDoc doc) {
+        initPlugins(plugin, doc);
+        init(plugin, _pluginClass, bShowHeader, doc);
+    }
+
+    void init(BEASTInterface plugin, Class<?> _pluginClass, boolean showHeader, BeautiDoc doc) {
+        try {
+            m_plugin = plugin.getClass().newInstance();
+            for (Input<?> input : plugin.listInputs()) {
+                m_plugin.setInputValue(input.getName(), input.get());
+            }
+            m_plugin.setID(plugin.getID());
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+
+        //setModal(true);
+        //m_plugin = plugin;
+        m_pluginClass = _pluginClass;
+        //setTitle(m_plugin.getID() + " Editor");
+
+        Box mainBox = Box.createVerticalBox();
+        mainBox.add(Box.createVerticalStrut(5));
+
+        if (showHeader) {
+            /* add plugin + help button at the top */
+            Box pluginBox = createPluginBox();
+            mainBox.add(pluginBox);
+            mainBox.add(Box.createVerticalStrut(5));
+            if (doc != null && m_identry != null) {
+            	// we are in Beauti, do not edit IDs
+            	m_identry.setEnabled(false);
+            }
+        }
+
+        doc.getInputEditorFactory().addInputs(mainBox, m_plugin, null, null, doc);
+
+
+        mainBox.add(Box.createVerticalStrut(5));
+
+        this.add(mainBox);
+        Dimension dim = mainBox.getPreferredSize();
+        setSize(dim.width + 10, dim.height + 30);
+
+        BEASTObjectPanel.m_position.x += 30;
+        BEASTObjectPanel.m_position.y += 30;
+        setLocation(BEASTObjectPanel.m_position);
+    } // c'tor
+
+    public boolean getOK() {
+        BEASTObjectPanel.m_position.x -= 30;
+        BEASTObjectPanel.m_position.y -= 30;
+        return m_bOK;
+    }
+
+    /**
+     * add all inputs of a plugin to a box *
+     */
+    public static int countInputs(BEASTInterface plugin, BeautiDoc doc) {
+        int nInputs = 0;
+        try {
+            List<Input<?>> inputs = plugin.listInputs();
+            for (Input<?> input : inputs) {
+                String sFullInputName = plugin.getClass().getName() + "." + input.getName();
+                if (!doc.beautiConfig.suppressPlugins.contains(sFullInputName)) {
+                    nInputs++;
+                }
+            }
+        } catch (Exception e) {
+            // ignore
+        }
+        return nInputs;
+    } // addInputs
+
+
+
+    /**
+     * create box for manipulating the plugin, or ask for help *
+     */
+    Box createPluginBox() {
+        Box box = Box.createHorizontalBox();
+        JLabel icon = new JLabel();
+        box.add(Box.createHorizontalGlue());
+
+        JLabel label = new JLabel(m_pluginClass.getName().replaceAll(".*\\.", "") + ":");
+        box.add(label);
+
+//        m_pluginButton = new JLabel(m_plugin.getID());
+//        m_pluginButton.setToolTipText(m_plugin.getID() + " is of type " + m_plugin.getClass().getName() + " Click to change.");
+        label.setToolTipText(m_plugin.getID() + " is of type " + m_plugin.getClass().getName() + " Click to change.");
+
+//		m_pluginButton.addActionListener(new ActionListener() {
+//			@Override
+//			public void actionPerformed(ActionEvent e) {
+//				List<String> sClasses = ClassDiscovery.find(m_pluginClass, "beast"); 
+//				String sClassName = (String) JOptionPane.showInputDialog(null,
+//						"Select another type of " + m_pluginClass.getName().replaceAll(".*\\.", ""), 
+//						"Select",
+//						JOptionPane.PLAIN_MESSAGE, null,
+//						sClasses.toArray(new String[0]),
+//						null);
+//				if (sClassName.equals(m_plugin.getClass().getName())) {
+//					return;
+//				}
+//				try {
+//					m_plugin = (Plugin) Class.forName(sClassName).newInstance();
+//					m_pluginButton.setText(sClassName.replaceAll(".*\\.", ""));
+//					// TODO: replace InputEditors where appropriate.
+//					
+//				} catch (Exception ex) {
+//					JOptionPane.showMessageDialog(null, "Could not change plugin: " +
+//							ex.getClass().getName() + " " +
+//							ex.getMessage()
+//							);
+//				}
+//			}
+//		});
+//        box.add(Box.createHorizontalStrut(10));
+//        box.add(m_pluginButton);
+
+
+        box.add(new JLabel(" " + m_plugin.getID()));
+        
+//        m_identry = new JTextField();
+//        m_identry.setText(m_plugin.getID());
+//        m_identry.setToolTipText("Name/ID that uniquely identifies this item");
+//
+//        m_identry.getDocument().addDocumentListener(new DocumentListener() {
+//            @Override
+//            public void removeUpdate(DocumentEvent e) {
+//                processID();
+//            }
+//
+//            @Override
+//            public void insertUpdate(DocumentEvent e) {
+//                processID();
+//            }
+//
+//            @Override
+//            public void changedUpdate(DocumentEvent e) {
+//                processID();
+//            }
+//        });
+//        box.add(m_identry);
+
+
+        Box vbox = Box.createVerticalBox();
+        vbox.setBorder(BorderFactory.createEmptyBorder());
+        vbox.add(Box.createVerticalStrut(10));
+        vbox.add(box);
+        vbox.add(Box.createVerticalStrut(10));
+
+        return vbox;
+    } // createPluginBox
+
+    void processID() {
+//		PluginPanel.g_plugins.remove(m_plugin.getID());
+//		m_plugin.setID(m_identry.getText());
+//		PluginPanel.g_plugins.put(m_plugin.getID(), m_plugin);
+    }
+
+
+
+    /**
+     * collect all plugins that can reach this input (actually, it's parent)
+     * and add them to the tabu list.
+     */
+    static List<BEASTInterface> listAscendants(BEASTInterface parent, Collection<BEASTInterface> plugins) {
+        /* First, calculate outputs for each plugin */
+        HashMap<BEASTInterface, List<BEASTInterface>> outputs = getOutputs(plugins);
+        /* process outputs */
+        List<BEASTInterface> ascendants = new ArrayList<BEASTInterface>();
+        ascendants.add(parent);
+        boolean bProgress = true;
+        while (bProgress) {
+            bProgress = false;
+            for (int i = 0; i < ascendants.size(); i++) {
+                BEASTInterface ascendant = ascendants.get(i);
+                if (outputs.containsKey(ascendant)) {
+                    for (BEASTInterface parent2 : outputs.get(ascendant)) {
+                        if (!ascendants.contains(parent2)) {
+                            ascendants.add(parent2);
+                            bProgress = true;
+                        }
+                    }
+                }
+            }
+        }
+        return ascendants;
+    }
+
+    /* calculate outputs for each plugin
+      * and put them as ArrayLists in a Map
+      * so they can be retrieved indexed by plugin like this:
+      * ArrayList<Plugin> output = outputs.get(plugin)*/
+
+    static HashMap<BEASTInterface, List<BEASTInterface>> getOutputs(Collection<BEASTInterface> plugins) {
+        HashMap<BEASTInterface, List<BEASTInterface>> outputs = new HashMap<BEASTInterface, List<BEASTInterface>>();
+        for (BEASTInterface plugin : plugins) {
+            outputs.put(plugin, new ArrayList<BEASTInterface>());
+        }
+        for (BEASTInterface plugin : plugins) {
+            try {
+                for (Input<?> input2 : plugin.listInputs()) {
+                    Object o = input2.get();
+                    if (o != null && o instanceof BEASTInterface) {
+                        List<BEASTInterface> list = outputs.get(o);
+//                    	if (list == null) {
+//                    		int h = 3;
+//                    		h++;
+//                    	} else {
+                        list.add(plugin);
+//                    	}
+                    }
+                    if (o != null && o instanceof List<?>) {
+                        for (Object o2 : (List<?>) o) {
+                            if (o2 != null && o2 instanceof BEASTInterface) {
+                                List<BEASTInterface> list = outputs.get(o2);
+                                if (list == null) {
+                                    int h = 3;
+                                    h++;
+                                } else {
+                                    list.add(plugin);
+                                }
+                            }
+                        }
+                    }
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        return outputs;
+    } // getOutputs
+
+    public void initPlugins(BEASTInterface plugin, BeautiDoc doc) {
+        //g_plugins = new HashMap<String, Plugin>();
+        addPluginToMap(plugin, doc);
+    }
+
+    static public void addPluginToMap(BEASTInterface plugin, BeautiDoc doc) {
+        if (registerPlugin(getID(plugin), plugin, doc)) {
+            return;
+        }
+        try {
+            for (Input<?> input : plugin.listInputs()) {
+                if (input.get() != null) {
+                    if (input.get() instanceof BEASTInterface) {
+                        addPluginToMap((BEASTInterface) input.get(), doc);
+                    }
+                    if (input.get() instanceof List<?>) {
+                        for (Object o : (List<?>) input.get()) {
+                            if (o instanceof BEASTInterface) {
+                                addPluginToMap((BEASTInterface) o, doc);
+                            }
+                        }
+                    }
+                }
+            }
+        } catch (Exception e) {
+            // ignore
+            System.err.println(e.getClass().getName() + " " + e.getMessage());
+        }
+    } // addPluginToMap
+
+    /**
+     * return ID of plugin, if no ID is specified, generate an appropriate ID first
+     */
+    public static String getID(BEASTInterface plugin) {
+        if (plugin.getID() == null || plugin.getID().length() == 0) {
+            String sID = plugin.getClass().getName().replaceAll(".*\\.", "");
+            int i = 0;
+            while (g_plugins.containsKey(sID + i)) {
+                i++;
+            }
+            plugin.setID(sID + "." + i);
+        }
+        return plugin.getID();
+    }
+
+    /**
+     * rudimentary test *
+     */
+    public static void main(String[] args) {
+        init();
+        BEASTObjectPanel pluginPanel = null;
+        try {
+            if (args.length == 0) {
+                pluginPanel = new BEASTObjectPanel(new MCMC(), Runnable.class, null);
+            } else if (args[0].equals("-x")) {
+                StringBuilder text = new StringBuilder();
+                String NL = System.getProperty("line.separator");
+                Scanner scanner = new Scanner(new File(args[1]));
+                try {
+                    while (scanner.hasNextLine()) {
+                        text.append(scanner.nextLine() + NL);
+                    }
+                } finally {
+                    scanner.close();
+                }
+                BEASTInterface plugin = new beast.util.XMLParser().parseBareFragment(text.toString(), false);
+                pluginPanel = new BEASTObjectPanel(plugin, plugin.getClass(), null);
+            } else if (args.length == 1) {
+                pluginPanel = new BEASTObjectPanel((BEASTInterface) Class.forName(args[0]).newInstance(), Class.forName(args[0]), null);
+            } else if (args.length == 2) {
+                pluginPanel = new BEASTObjectPanel((BEASTInterface) Class.forName(args[0]).newInstance(), Class.forName(args[1]), null);
+            } else {
+                throw new Exception("Incorrect number of arguments");
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            System.err.println("Usage: " + BEASTObjectPanel.class.getName() + " [-x file ] [class [type]]\n" +
+                    "where [class] (optional, default MCMC) is a Plugin to edit\n" +
+                    "and [type] (optional only if class is specified, default Runnable) the type of the Plugin.\n" +
+                    "for example\n" +
+                    "");
+            System.exit(0);
+        }
+        pluginPanel.setVisible(true);
+        if (pluginPanel.m_bOK) {
+            BEASTInterface plugin = pluginPanel.m_plugin;
+            String sXML = new XMLProducer().modelToXML(plugin);
+            System.out.println(sXML);
+        }
+    } // main
+
+} // class PluginDialog
+
diff --git a/src/beast/app/draw/BEASTObjectSet.java b/src/beast/app/draw/BEASTObjectSet.java
new file mode 100644
index 0000000..d5b1f9f
--- /dev/null
+++ b/src/beast/app/draw/BEASTObjectSet.java
@@ -0,0 +1,20 @@
+package beast.app.draw;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.BEASTObject;
+import beast.core.BEASTInterface;
+
+
+
+ at Description("Set of plugins to represent partially finished models in GUIs")
+public class BEASTObjectSet extends BEASTObject {
+    public Input<List<BEASTInterface>> m_plugins = new Input<List<BEASTInterface>>("plugin", "set of the plugins in this collection", new ArrayList<BEASTInterface>());
+
+    @Override
+    public void initAndValidate() {
+    }
+}
diff --git a/src/beast/app/draw/BEASTObjectShape.java b/src/beast/app/draw/BEASTObjectShape.java
new file mode 100644
index 0000000..febaac2
--- /dev/null
+++ b/src/beast/app/draw/BEASTObjectShape.java
@@ -0,0 +1,264 @@
+/*
+* File PluginShape.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+package beast.app.draw;
+
+
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.GradientPaint;
+import java.awt.Graphics2D;
+import java.awt.Point;
+import java.io.PrintStream;
+import java.util.List;
+import java.util.ArrayList;
+
+import javax.swing.JPanel;
+
+import org.w3c.dom.Node;
+
+import beast.core.Input;
+import beast.core.BEASTObject;
+import beast.core.BEASTInterface;
+import beast.util.Randomizer;
+
+
+
+
+
+public class BEASTObjectShape extends Shape {
+    static Font g_PluginFont = new Font("arial", Font.PLAIN, 11);
+    public beast.core.BEASTInterface m_plugin;
+    List<InputShape> m_inputs;
+
+
+    public BEASTObjectShape() {
+        super();
+        m_fillcolor = new Color(Randomizer.nextInt(256), 128 + Randomizer.nextInt(128), Randomizer.nextInt(128));
+    }
+
+    public BEASTObjectShape(BEASTInterface plugin, Document doc) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
+        super();
+        m_plugin = plugin;
+        m_fillcolor = new Color(Randomizer.nextInt(256), 128 + Randomizer.nextInt(128), Randomizer.nextInt(128));
+        init(plugin.getClass().getName(), doc);
+    }
+
+    public BEASTObjectShape(Node node, Document doc, boolean bReconstructPlugins) {
+        parse(node, doc, bReconstructPlugins);
+    }
+
+    public void init(String sClassName, Document doc) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
+    	m_doc = doc;
+        if (m_plugin == null) {
+            m_plugin = (beast.core.BEASTInterface) Class.forName(sClassName).newInstance();
+        }
+        m_inputs = new ArrayList<InputShape>();
+        if (m_plugin.getID() == null) {
+        	String sID = m_plugin.getClass().getName();
+        	sID = sID.substring(sID.lastIndexOf('.') + 1);
+        	m_plugin.setID(sID);
+        }
+        //System.err.println("\n>>>>" + m_plugin.getID());        
+        if (m_plugin.getID().equals("mcmc")) {
+        	int h = 3;
+        }
+        List<Input<?>> sInputs = m_plugin.listInputs();
+        for (Input<?> input_ : sInputs) {
+			String longInputName = m_plugin.getClass().getName() + "." + input_.getName(); 
+			//System.err.print(longInputName);
+        	if (doc.showAllInputs() ||
+        			!doc.tabulist.contains(longInputName) && 
+        			input_.get() != null && (
+        			(input_.get() instanceof List && ((List<?>)input_.get()).size()>0) ||  
+        			!input_.get().equals(input_.defaultValue))) {
+	            InputShape input = new InputShape(input_);
+	            input.setPluginShape(this);
+	            input.m_fillcolor = m_fillcolor;
+	            input.m_w = 10;
+	            doc.addNewShape(input);
+	            m_inputs.add(input);
+        		//System.err.println(" shown");
+        	} else {
+        		//System.err.println(" skipped");
+        	}
+        }
+        m_h = Math.max(40, m_inputs.size() * 12);
+        adjustInputs();
+    } // setClassName
+
+    // find input shape associated with input with name sLabel
+    InputShape getInputShape(String sLabel) {
+        for (InputShape shape : m_inputs) {
+            String sLabel2 = shape.getLabel();
+            if (sLabel2 != null) {
+                if (sLabel2.contains("=")) {
+                    sLabel2 = sLabel2.substring(0, sLabel2.indexOf('='));
+                }
+                if (sLabel2.equals(sLabel)) {
+                    return shape;
+                }
+            }
+        }
+        return null;
+    }
+
+    /**
+     * set coordinates of inputs based on location of this PluginShape
+     */
+    void adjustInputs() {
+        if (m_plugin != null) {
+            try {
+                List<Input<?>> inputs = m_plugin.listInputs();
+                for (int i = 0; i < m_inputs.size(); i++) {
+                    InputShape input = m_inputs.get(i);
+                    //input.m_input = inputs.get(i);
+                    int nOffset = i * m_h / (m_inputs.size()) + m_h / (2 * (m_inputs.size()));
+                    input.m_x = m_x - input.m_w;
+                    input.m_y = m_y + nOffset;
+                    //input.m_w = 10;
+                    input.m_h = 10;
+                    input.m_fillcolor = m_fillcolor;
+                    input.m_nPenWidth = 0;
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+
+    @Override
+    public void draw(Graphics2D g, JPanel panel) {
+        if (m_bFilled) {
+            GradientPaint m_gradientPaint = new GradientPaint(new Point(m_x, m_y), Color.WHITE, new Point(m_x + m_w, m_y + m_h), m_fillcolor);
+            g.setPaint(m_gradientPaint);
+            g.fillOval(m_x, m_y, m_w, m_h);
+            g.fillRect(m_x, m_y, m_w / 2, m_h);
+        } else {
+            g.setColor(m_fillcolor);
+            g.drawLine(m_x, m_y, m_x, m_y + m_h);
+            g.drawLine(m_x, m_y, m_x + m_w / 2, m_y);
+            g.drawLine(m_x, m_y + m_h, m_x + m_w / 2, m_y + m_h);
+            g.drawArc(m_x, m_y, m_w, m_h, 0, 90);
+            g.drawArc(m_x, m_y, m_w, m_h, 0, -90);
+        }
+        g.setStroke(new BasicStroke(m_nPenWidth));
+        g.setColor(m_pencolor);
+        g.setFont(g_PluginFont);
+        drawLabel(g);
+        adjustInputs();
+    }
+
+    @Override
+    void parse(Node node, Document doc, boolean bReconstructPlugins) {
+        super.parse(node, doc, bReconstructPlugins);
+        if (bReconstructPlugins) {
+            if (node.getAttributes().getNamedItem("class") != null) {
+                String sClassName = node.getAttributes().getNamedItem("class").getNodeValue();
+                try {
+                    m_plugin = (beast.core.BEASTInterface) Class.forName(sClassName).newInstance();
+                    m_plugin.setID(m_sID);
+                } catch (Exception e) {
+                    // TODO: handle exception
+                }
+            }
+            if (node.getAttributes().getNamedItem("inputids") != null) {
+                String sInputIDs = node.getAttributes().getNamedItem("inputids").getNodeValue();
+                String[] sInputID = sInputIDs.split(" ");
+                m_inputs = new ArrayList<InputShape>();
+                try {
+                    List<Input<?>> inputs = m_plugin.listInputs();
+                    for (int i = 0; i < sInputID.length; i++) {
+                        InputShape ellipse = (InputShape) doc.findObjectWithID(sInputID[i]);
+                        m_inputs.add(ellipse);
+                        ellipse.setPluginShape(this);
+                        //ellipse.m_input = inputs.get(i);
+                    }
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+    }
+
+    @Override
+    public String getXML() {
+        StringBuffer buf = new StringBuffer();
+        buf.append("<" + Document.PLUGIN_SHAPE_ELEMENT);
+        buf.append(" class='");
+        buf.append(m_plugin.getClass().getName());
+        buf.append("'");
+        buf.append(" inputids='");
+        for (int i = 0; i < m_inputs.size(); i++) {
+            buf.append(m_inputs.get(i).getID());
+            buf.append(' ');
+        }
+        buf.append("'");
+
+        buf.append(getAtts());
+        buf.append(">\n");
+        buf.append("</" + Document.PLUGIN_SHAPE_ELEMENT + ">");
+        return buf.toString();
+    }
+
+    @Override
+    void assignFrom(Shape other) {
+        super.assignFrom(other);
+        m_plugin.setID(other.m_sID);
+    }
+
+    @Override
+    boolean intersects(int nX, int nY) {
+        return super.intersects(nX, nY);
+    }
+
+    @Override
+    String getLabel() {
+        return getID();
+    }
+
+    @Override
+    String getID() {
+        if (m_plugin == null) {
+            return null;
+        }
+        return m_plugin.getID();
+    }
+
+    @Override
+    void toSVG(PrintStream out) {
+        out.println("<defs>");
+        out.println("  <linearGradient id='grad" + getID() + "' x1='0%' y1='0%' x2='100%' y2='100%'>");
+        out.println("    <stop offset='0%' style='stop-color:rgb(255,255,255);stop-opacity:1' />");
+        out.println("    <stop offset='100%' style='stop-color:rgb(" + m_fillcolor.getRed() + "," + m_fillcolor.getGreen() + "," + m_fillcolor.getBlue() + ");stop-opacity:1' />");
+        out.println("  </linearGradient>");
+        out.println("</defs>");
+        out.print("<path id='" + getID() + "' d='M " + m_x + " " + (m_y + m_h) + " l " + m_w / 2 + " 0 ");
+        out.print(" a " + m_w / 2 + " " + (-m_h / 2) + " 0 0,0 0," + (-m_h) + " l " + (-m_w / 2) + " 0 z'");
+        out.println(" fill='url(#grad" + getID() + ")' />");
+        drawSVGString(out, g_PluginFont, m_pencolor, "middle");
+    }
+} // class Function
diff --git a/src/beast/app/draw/BooleanInputEditor.java b/src/beast/app/draw/BooleanInputEditor.java
new file mode 100644
index 0000000..927676a
--- /dev/null
+++ b/src/beast/app/draw/BooleanInputEditor.java
@@ -0,0 +1,61 @@
+package beast.app.draw;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.Box;
+import javax.swing.JCheckBox;
+
+import beast.app.beauti.BeautiDoc;
+import beast.core.Input;
+import beast.core.BEASTObject;
+import beast.core.BEASTInterface;
+
+
+
+public class BooleanInputEditor extends InputEditor.Base {
+    public BooleanInputEditor(BeautiDoc doc) {
+		super(doc);
+	}
+    //public BooleanInputEditor() {}
+
+	private static final long serialVersionUID = 1L;
+    JCheckBox m_entry;
+
+
+    @Override
+    public Class<?> type() {
+        return Boolean.class;
+    }
+
+    /**
+     * create input editor containing a check box *
+     */
+    @Override
+    public void init(Input<?> input, BEASTInterface plugin, int itemNr, ExpandOption bExpandOption, boolean bAddButtons) {
+        m_bAddButtons = bAddButtons;
+        m_plugin = plugin;
+        m_input = input;
+		this.itemNr = itemNr;
+        m_entry = new JCheckBox(formatName(m_input.getName()));
+        if (input.get() != null) {
+            m_entry.setSelected((Boolean) input.get());
+        }
+        m_entry.setToolTipText(input.getHTMLTipText());
+        m_entry.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                try {
+                	setValue(m_entry.isSelected());
+                    validateInput();
+                    //m_input.setValue(m_entry.isSelected(), m_plugin);
+                } catch (Exception ex) {
+                    System.err.println("BooleanInputEditor " + ex.getMessage());
+                }
+            }
+        });
+        add(m_entry);
+        add(Box.createHorizontalGlue());
+    } // c'tor
+
+} // class BooleanInputEditor
diff --git a/src/beast/app/draw/Document.java b/src/beast/app/draw/Document.java
new file mode 100644
index 0000000..e3a9bd3
--- /dev/null
+++ b/src/beast/app/draw/Document.java
@@ -0,0 +1,1937 @@
+/*
+* File Document.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+package beast.app.draw;
+
+
+
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import beast.core.Input;
+import beast.core.Runnable;
+import beast.core.BEASTObject;
+import beast.core.BEASTInterface;
+import beast.util.AddOnManager;
+import beast.util.XMLParser;
+import beast.util.XMLProducer;
+
+
+import javax.xml.parsers.DocumentBuilderFactory;
+import java.awt.*;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.StringReader;
+import java.util.*;
+import java.util.List;
+
+/**
+ * The Document class is the Document part in the doc-view pattern of
+ * the Beast ModelBuilder application.
+ */
+public class Document {
+
+    /**
+     * list of PluginShapes, InputShapes and connecting Arrows *
+     */
+    public List<Shape> m_objects = new ArrayList<Shape>();
+    public List<Shape> m_tmpobjects;
+
+    /**
+     * undo/redo related stuff *
+     */
+    List<UndoAction> m_undoStack = new ArrayList<UndoAction>();
+    int m_nCurrentEditAction = -1;
+
+
+    //int m_nSavedPointer = -1;
+    public boolean m_bIsSaved = true;
+    
+    Set<String> tabulist;
+
+    public void isSaved() {
+        m_bIsSaved = true;
+    }
+
+    void iSChanged() {
+        m_bIsSaved = false;
+    }
+
+    /**
+     * list of class names for plug-ins to choose from *
+     */
+    String[] m_sPlugInNames;
+
+    // if false, only non-null and non-default valued inputs are shown
+    // Also inputs from the tabu list will be eliminated
+    boolean m_bShowALlInputs = false;
+    boolean showAllInputs() {
+    	return m_bShowALlInputs;
+    }
+    boolean m_bSanitiseIDs = true;
+    boolean sanitiseIDs() {
+    	return m_bSanitiseIDs;
+    }
+
+    public Document() {
+        // load all parsers
+        List<String> sPlugInNames = AddOnManager.find(beast.core.BEASTInterface.class, AddOnManager.IMPLEMENTATION_DIR);
+        m_sPlugInNames = sPlugInNames.toArray(new String[0]);
+        tabulist = new HashSet<String>();
+        Properties properties = new Properties();
+        try {
+        	
+        	properties.load(getClass().getResourceAsStream("/beast/app/draw/tabulist.properties")); 
+            String list = properties.getProperty("tabulist");
+            for (String str  : list.split("\\s+")) {
+            	tabulist.add(str.trim());
+            }
+        } catch (Exception e) {
+        	e.printStackTrace();
+        }
+
+
+    } // c'tor
+
+//    /** change order of shapes to ensure arrows are drawn before the rest **/
+//    void moveArrowsToBack() {
+//        ArrayList<Shape> arrows = new ArrayList<Shape>();
+//        List<Shape> others = new ArrayList<Shape>();
+//
+//        for (Shape shape : m_objects) {
+//            if (shape instanceof Arrow) {
+//                arrows.add(shape);
+//            } else {
+//                others.add(shape);
+//            }
+//        }
+//        arrows.addAll(others);
+//        m_objects = arrows;
+//    }
+
+    /**
+     * adjust position of inputs to fit with the associated plug in *
+     */
+    void adjustInputs() {
+        for (Shape shape : m_objects) {
+            if (shape instanceof BEASTObjectShape) {
+                ((BEASTObjectShape) shape).adjustInputs();
+            }
+        }
+    }
+
+    /**
+     * adjust position of tail and head of arrows to the
+     * Plug in and input shapes they are attached to
+     * *
+     */
+    void adjustArrows() {
+//        adjustArrows(m_objects);
+//    }
+//
+//    void adjustArrows(List<Shape> objects) {
+        for (Shape shape : m_objects) {
+            if (shape instanceof Arrow) {
+                Arrow arrow = (Arrow) shape;
+                arrow.adjustCoordinates();
+            }
+        }
+    } // adjustArrows
+
+    void readjustArrows(List<Shape> objects) {
+        for (Shape shape : m_objects) {
+            if (shape instanceof Arrow) {
+                Arrow arrow = (Arrow) shape;
+                arrow.m_sHeadID = arrow.m_headShape.getID();
+                ;
+                arrow.m_sTailID = arrow.m_tailShape.getID();
+                ;
+            }
+        }
+    } // readjustArrows
+
+    /**
+     * edit actions on shapes *
+     */
+    public void moveShape(int nX, int nY, int nToX, int nToY, int nPosition) {
+        boolean bNeedsUndoAction = true;
+        if (m_nCurrentEditAction == m_undoStack.size() - 1 && m_nCurrentEditAction >= 0) {
+            UndoAction undoAction = m_undoStack.get(m_nCurrentEditAction);
+            if (undoAction.m_nActionType == UndoAction.MOVE_ACTION && undoAction.isSingleSelection(nPosition)) {
+                bNeedsUndoAction = false;
+            }
+        }
+        if (bNeedsUndoAction) {
+            addUndoAction(new UndoAction(nPosition, UndoAction.MOVE_ACTION));
+        }
+        Shape shape = (Shape) m_objects.get(nPosition);
+        shape.movePosition(nX, nY, nToX, nToY);
+        adjustArrows();
+    } // moveShape
+
+    public void moveShapes(int dX, int dY, List<Integer> nPositions) {
+        boolean bNeedsUndoAction = true;
+        if (m_nCurrentEditAction == m_undoStack.size() - 1 && m_nCurrentEditAction >= 0) {
+            UndoAction undoAction = m_undoStack.get(m_nCurrentEditAction);
+            if (undoAction.m_nActionType == UndoAction.MOVE_ACTION && undoAction.isSelection(nPositions)) {
+                bNeedsUndoAction = false;
+            }
+        }
+        if (bNeedsUndoAction) {
+            addUndoAction(new UndoAction(nPositions, UndoAction.MOVE_ACTION));
+        }
+    } // moveShape
+
+    public void movePoint(int nPoint, int nX, int nY, int nToX, int nToY, int nPosition) {
+        boolean bNeedsUndoAction = true;
+        if (m_nCurrentEditAction == m_undoStack.size() - 1 && m_nCurrentEditAction >= 0) {
+            UndoAction undoAction = m_undoStack.get(m_nCurrentEditAction);
+            if (undoAction.m_nActionType == UndoAction.RESHAPE_ACTION && undoAction.isSingleSelection(nPosition)) {
+                bNeedsUndoAction = false;
+            }
+        }
+        if (bNeedsUndoAction) {
+            addUndoAction(new UndoAction(nPosition, UndoAction.RESHAPE_ACTION));
+        }
+        Shape shape = (Shape) m_objects.get(nPosition);
+        shape.movePoint(nPoint, nX, nY, nToX, nToY);
+        adjustArrows();
+    } // movePoint
+
+    boolean containsID(String sID, List<Shape> objects, List<String> tabulist) {
+        for (Shape shape : m_objects) {
+            if (shape.getID() == null) {
+                int h = 3;
+                h++;
+            }
+            if (shape.getID().equals(sID)) {
+                return true;
+            }
+//            if (shape instanceof Group) {
+//                Group group = (Group) shape;
+//                if (containsID(sID, group.m_objects, tabulist)) {
+//                    return true;
+//                }
+//            }
+        }
+        if (tabulist == null) {
+            return false;
+        }
+        for (String sTabuID : tabulist) {
+            if (sTabuID.equals(sID)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    String getNewID(List<String> tabulist) {
+        int nID = m_objects.size();
+        String sID = "id" + nID;
+        while (containsID(sID, m_objects, tabulist)) {
+            nID++;
+            sID = "id" + nID;
+        }
+        return sID;
+    }
+
+    void setPluginID(BEASTObjectShape shape) {
+        if (shape.m_plugin.getID() != null && shape.m_plugin.getID().length() > 0) {
+            return;
+        }
+        BEASTInterface plugin = shape.m_plugin;
+        String sBase = plugin.getClass().getName().replaceAll(".*\\.", "");
+        int nID = 0;
+        while (containsID(sBase + nID, m_objects, null)) {
+            nID++;
+        }
+        plugin.setID(sBase + nID);
+    }
+
+    Shape getShapeByID(String sID) {
+        for (Shape shape : m_objects) {
+            if (shape.getID().equals(sID)) {
+                return shape;
+            }
+        }
+        return null;
+    }
+
+    public void addNewShape(Shape shape) {
+        if (shape.getID() == null ||
+                shape.getID().equals("") ||
+                containsID(shape.getID(), m_objects, null)) {
+            if (shape instanceof Arrow) {
+                ((Arrow) shape).setID(getNewID(null));
+            }
+            if (shape instanceof BEASTObjectShape) {
+                setPluginID((BEASTObjectShape) shape);
+            }
+        }
+        m_objects.add(shape);
+        if (shape instanceof BEASTObjectShape) {
+            List<Integer> iObjects = new ArrayList<Integer>();
+            iObjects.add(m_objects.size() - 1);
+            checkForOtherPluginShapes(iObjects, (BEASTObjectShape) shape);
+            if (iObjects.size() == 1) {
+                addUndoAction(new PluginAction(m_objects.size() - 1, UndoAction.ADD_PLUGIN_ACTION));
+            } else {
+                addUndoAction(new MultiObjectAction(iObjects, UndoAction.ADD_GROUP_ACTION));
+            }
+        } else if (shape instanceof Arrow) {
+            addUndoAction(new ArrowAction(m_objects.size() - 1, UndoAction.ADD_ARROW_ACTION));
+        }
+    } // addNewShape
+
+    void checkForOtherPluginShapes(List<Integer> iObjects, BEASTObjectShape shape) {
+        // check whether we need to create any input plugins
+        try {
+            List<Input<?>> inputs = ((BEASTObjectShape) shape).m_plugin.listInputs();
+            for (Input<?> input : inputs) {
+                if (input.get() instanceof BEASTInterface) {
+                    BEASTInterface plugin = (BEASTInterface) input.get();
+                    BEASTObjectShape pluginShape = new BEASTObjectShape(plugin, this);
+                    pluginShape.m_x = Math.max(shape.m_x - DX, 0);
+                    pluginShape.m_y = shape.m_y;
+                    pluginShape.m_w = 100;
+                    pluginShape.m_h = 80;
+                    setPluginID(pluginShape);
+                    m_objects.add(pluginShape);
+                    iObjects.add(m_objects.size() - 1);
+                    Arrow arrow = new Arrow(pluginShape, (BEASTObjectShape) shape, input.getName());
+                    m_objects.add(arrow);
+                    iObjects.add(m_objects.size() - 1);
+                    // recurse
+                    checkForOtherPluginShapes(iObjects, pluginShape);
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    List<Integer> getConnectedArrows(List<String> sIDs, List<Integer> selection) {
+        for (int i = 0; i < m_objects.size(); i++) {
+            Shape shape = (Shape) m_objects.get(i);
+            if (shape instanceof Arrow) {
+                Arrow arrow = (Arrow) shape;
+                for (int j = 0; j < sIDs.size(); j++) {
+                    if (arrow.m_sHeadID.startsWith(sIDs.get(j)) || arrow.m_sTailID.equals(sIDs.get(j))) {
+                        if (!selection.contains(new Integer(i))) {
+                            selection.add(new Integer(i));
+                        }
+                    }
+                }
+            }
+        }
+        return selection;
+    }
+
+    List<String> getIncomingArrows(List<String> sIDs) {
+        List<String> selection = new ArrayList<String>();
+        for (int i = 0; i < m_objects.size(); i++) {
+            Shape shape = (Shape) m_objects.get(i);
+            if (shape instanceof Arrow) {
+                Arrow arrow = (Arrow) shape;
+                for (int j = 0; j < sIDs.size(); j++) {
+                    if (arrow.m_sHeadID.equals(sIDs.get(j))) {
+                        if (!selection.contains(arrow.m_sTailID)) {
+                            selection.add(arrow.m_sTailID);
+                        }
+                    }
+                }
+            }
+        }
+        return selection;
+    }
+
+    List<String> getOutgoingArrows(List<String> sIDs) {
+        List<String> selection = new ArrayList<String>();
+        for (int i = 0; i < m_objects.size(); i++) {
+            Shape shape = (Shape) m_objects.get(i);
+            if (shape instanceof Arrow) {
+                Arrow arrow = (Arrow) shape;
+                for (int j = 0; j < sIDs.size(); j++) {
+                    if (arrow.m_sTailID.equals(sIDs.get(j))) {
+                        if (!selection.contains(arrow.m_sTailID)) {
+                            selection.add(arrow.m_sTailID);
+                        }
+                    }
+                }
+            }
+        }
+        return selection;
+    }
+
+    public void deleteShapes(List<Integer> selection) {
+        List<String> sIDs = new ArrayList<String>();
+        for (int j = 0; j < selection.size(); j++) {
+            sIDs.add(((Shape) m_objects.get(((Integer) selection.get(j)).intValue())).getID());
+
+        }
+        selection = getConnectedArrows(sIDs, selection);
+        UndoAction action = new MultiObjectAction(selection, UndoAction.DEL_GROUP_ACTION);
+        addUndoAction(action);
+        action.redo();
+    } // deleteShape
+
+    void ensureUniqueID(Shape shape, List<String> tabulist) {
+        if (shape.getID() == null ||
+                shape.getID().equals("") ||
+                containsID(shape.getID(), m_objects, tabulist)) {
+            if (shape instanceof Arrow) {
+                ((Arrow) shape).setID(getNewID(tabulist));
+            }
+            if (shape instanceof BEASTObjectShape) {
+                setPluginID((BEASTObjectShape) shape);
+            }
+        }
+        tabulist.add(shape.getID());
+    } // ensureUniqueID
+
+    public void pasteShape(String sXML) {
+        List<Shape> shapes = XML2Shapes(sXML, true);
+        if (shapes.size() == 0) {
+            return;
+        }
+        List<Integer> nPositions = new ArrayList<Integer>();
+        for (Shape shape : shapes) {
+            if (shape instanceof Arrow) {
+                ((Arrow) shape).setID(getNewID(null));
+            }
+            if (shape instanceof BEASTObjectShape) {
+                ((BEASTObjectShape) shape).m_plugin.setID(null);
+                setPluginID((BEASTObjectShape) shape);
+                // ensure the new shape does not overlap exactly with an existing shape
+                int nOffset = 0;
+                boolean bMatch = false;
+                do {
+                    bMatch = false;
+                    for (Shape shape2 : m_objects) {
+                        if (shape2.m_x == shape.m_x + nOffset && shape2.m_y == shape.m_y + nOffset &&
+                                shape2.m_w == shape.m_w && shape2.m_h == shape.m_h) {
+                            bMatch = true;
+                            nOffset += 10;
+                        }
+                    }
+                } while (bMatch);
+                shape.m_x += nOffset;
+                shape.m_y += nOffset;
+            }
+            m_objects.add(shape);
+            nPositions.add(m_objects.size() - 1);
+        }
+        addUndoAction(new MultiObjectAction(nPositions, UndoAction.ADD_GROUP_ACTION));
+    } // pasteShape
+
+    /**
+     * move all plug ins connected with selection *
+     */
+    public void collapse(Selection selection) {
+//        // don't group arrows
+//        for (int i = selection.m_Selection.size() - 1; i >= 0; i--) {
+//            if ((Shape) m_objects.get(((Integer) selection.m_Selection.get(i)).intValue()) instanceof Arrow) {
+//                selection.m_Selection.remove(i);
+//            }
+//        }
+//        int nNrOfPrimePositions = selection.m_Selection.size();
+//        if (nNrOfPrimePositions == 0) {
+//            return;
+//        }
+//        for (int i = 0; i < nNrOfPrimePositions; i++) {
+//        	Shape shape = m_objects.get(((Integer) selection.m_Selection.get(i)).intValue());
+//        	findAffectedShapes(shape, selection.m_Selection);
+//        }
+//        if (selection.m_Selection.size() == nNrOfPrimePositions) {
+//        	// nothing to collapse
+//        	return;
+//        }
+//        
+//        UndoAction action = new UndoMultiSelectionAction(selection.m_Selection, nNrOfPrimePositions);
+//        addUndoAction(action);
+//        action.redo();
+//        selection.clear();
+//        selection.m_Selection.add(new Integer(m_objects.size() - 1));
+//        adjustInputs();
+//        adjustArrows();
+    } // collapse
+
+
+    /**
+     * Find inputs to collapse, i.e. PlugInShapes connected to
+     * any input of a given PluginShape.
+     * Shape IDs are recorded in selection. *
+     */
+    void findAffectedShapes(Shape shape, List<Integer> selection) {
+        if (shape instanceof InputShape) {
+            findInputs((InputShape) shape, selection);
+        } else {
+            for (InputShape ellipse : ((BEASTObjectShape) shape).m_inputs) {
+                findInputs(ellipse, selection);
+            }
+        }
+    }
+
+    /**
+     * Find inputs to collapse, i.e. PlugInShapes connected to
+     * given InputShape. Shape IDs are recorded in selection. *
+     */
+    void findInputs(InputShape ellipse, List<Integer> selection) {
+        for (Shape shape : m_objects) {
+            if (shape instanceof Arrow) {
+                Arrow arrow = (Arrow) shape;
+                if (arrow.m_sHeadID.equals(ellipse.getID())) {
+                    String sTailID = arrow.m_sTailID;
+                    for (int i = 0; i < m_objects.size(); i++) {
+                        if (m_objects.get(i).getID().equals(sTailID)) {
+                            selection.add(i);
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+//    public void ungroup(Selection selection) {
+//        UngroupAction action = new UngroupAction(selection);
+//        addUndoAction(action);
+//        action.redo();
+//        int nSize = action.getGroupSize();
+//        selection.clear();
+//        for (int i = 0; i < nSize; i++) {
+//            selection.m_Selection.add(new Integer(m_objects.size() - i - 1));
+//        }
+//    } // ungroup
+
+    public void setFillColor(Color color, Selection selection) {
+        if (selection.isSingleSelection()) {
+            addUndoAction(new UndoAction(selection.getSingleSelection(), UndoAction.FILL_COLOR_ACTION));
+        } else {
+            addUndoAction(new UndoAction(selection.m_Selection, UndoAction.MOVE_ACTION));
+        }
+        for (int i = 0; i < selection.m_Selection.size(); i++) {
+            int iSelection = ((Integer) selection.m_Selection.get(i)).intValue();
+            Shape shape = (Shape) m_objects.get(iSelection);
+            shape.setFillColor(color);
+        }
+    } // setFillColor
+
+    public void setPenColor(Color color, Selection selection) {
+        if (selection.isSingleSelection()) {
+            addUndoAction(new UndoAction(selection.getSingleSelection(), UndoAction.PEN_COLOR_ACTION));
+        } else {
+            addUndoAction(new UndoAction(selection.m_Selection, UndoAction.MOVE_ACTION));
+        }
+        for (int i = 0; i < selection.m_Selection.size(); i++) {
+            int iSelection = ((Integer) selection.m_Selection.get(i)).intValue();
+            Shape shape = (Shape) m_objects.get(iSelection);
+            shape.setPenColor(color);
+        }
+    } // setPenColor
+
+//    public void addUndoGroupAction(Selection selection) {
+//        addUndoAction(new UndoAction(selection.m_Selection));
+//    }
+
+    int getPositionX(int iShape) {
+        Shape shape = (Shape) m_objects.get(iShape);
+        return shape.getX();
+    }
+
+    int getPositionY(int iShape) {
+        Shape shape = (Shape) m_objects.get(iShape);
+        return shape.getY();
+    }
+
+    int getPositionX2(int iShape) {
+        Shape shape = (Shape) m_objects.get(iShape);
+        return shape.getX2();
+    }
+
+    int getPositionY2(int iShape) {
+        Shape shape = (Shape) m_objects.get(iShape);
+        return shape.getY2();
+    }
+
+    void setPositionX(int nX, int iShape) {
+        Shape shape = (Shape) m_objects.get(iShape);
+        shape.setX(nX);
+    }
+
+    void setPositionY(int nY, int iShape) {
+        Shape shape = (Shape) m_objects.get(iShape);
+        shape.setY(nY);
+    }
+
+    void setPositionX2(int nX, int iShape) {
+        Shape shape = (Shape) m_objects.get(iShape);
+        shape.setX2(nX);
+    }
+
+    void setPositionY2(int nY, int iShape) {
+        Shape shape = (Shape) m_objects.get(iShape);
+        shape.setY2(nY);
+    }
+
+    public void setID(String sID, int iObject) {
+        addUndoAction(new UndoAction(iObject, UndoAction.SET_LABEL_ACTION));
+        Shape shape = (Shape) m_objects.get(iObject);
+        ((BEASTObjectShape) shape).m_plugin.setID(sID);
+    }
+
+    public void toggleFilled(int iObject) {
+        addUndoAction(new UndoAction(iObject, UndoAction.TOGGLE_FILL_ACTION));
+        Shape shape = (Shape) m_objects.get(iObject);
+        shape.toggleFilled();
+    }
+
+    void setInputValue(BEASTObjectShape pluginShape, String sInput, String sValue) throws Exception {
+        addUndoAction(new SetInputAction(pluginShape, sInput, sValue));
+        //pluginShape.m_plugin.setInputValue(sInput, sValue);
+    }
+
+    /**
+     * action representing assignment of value to a primitive input *
+     */
+    class SetInputAction extends UndoAction {
+        BEASTObjectShape m_pluginShape;
+        String m_sInput;
+        String m_sValue;
+
+        SetInputAction(BEASTObjectShape pluginShape, String sInput, String sValue) {
+            m_pluginShape = pluginShape;
+            m_sInput = sInput;
+            m_sValue = sValue;
+            doit();
+        }
+
+        void redo() {
+            doit();
+        }
+
+        void undo() {
+            doit();
+        }
+
+        void doit() {
+            try {
+                String sValue = m_pluginShape.m_plugin.getInput(m_sInput).get().toString();
+                m_pluginShape.m_plugin.setInputValue(m_sInput, m_sValue);
+                m_sValue = sValue;
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    } // class SetInputAction
+
+    public void toFront(Selection selection) {
+        if (selection.m_Selection.size() == 0) {
+            return;
+        }
+        int[] newOrder = new int[selection.m_Selection.size()];
+        for (int i = 0; i < newOrder.length; i++) {
+            newOrder[i] = m_objects.size() - 1 - i;
+        }
+        int[] order = new int[selection.m_Selection.size()];
+        for (int i = 0; i < order.length; i++) {
+            order[i] = ((Integer) selection.m_Selection.get(i)).intValue();
+        }
+        Arrays.sort(order);
+        int[] oldOrder = new int[selection.m_Selection.size()];
+        for (int i = 0; i < oldOrder.length; i++) {
+            oldOrder[i] = order[oldOrder.length - 1 - i];
+        }
+        ReorderAction reorderAction = new ReorderAction(oldOrder, newOrder);
+        addUndoAction(reorderAction);
+        reorderAction.reorder(oldOrder, newOrder);
+        selection.setSelection(newOrder);
+    } // toFront
+
+    public void toBack(Selection selection) {
+        if (selection.m_Selection.size() == 0) {
+            return;
+        }
+        int[] newOrder = new int[selection.m_Selection.size()];
+        for (int i = 0; i < selection.m_Selection.size(); i++) {
+            newOrder[i] = i;
+        }
+        int[] oldOrder = new int[selection.m_Selection.size()];
+        for (int i = 0; i < oldOrder.length; i++) {
+            oldOrder[i] = ((Integer) selection.m_Selection.get(i)).intValue();
+        }
+        Arrays.sort(oldOrder);
+        ReorderAction reorderAction = new ReorderAction(oldOrder, newOrder);
+        addUndoAction(reorderAction);
+        reorderAction.reorder(oldOrder, newOrder);
+        selection.setSelection(newOrder);
+    } // toBack
+
+    public void forward(Selection selection) {
+        if (selection.m_Selection.size() == 0) {
+            return;
+        }
+        int[] order = new int[selection.m_Selection.size()];
+        for (int i = 0; i < order.length; i++) {
+            order[i] = ((Integer) selection.m_Selection.get(i)).intValue();
+        }
+        Arrays.sort(order);
+        int[] oldOrder = new int[selection.m_Selection.size()];
+        for (int i = 0; i < oldOrder.length; i++) {
+            oldOrder[i] = order[oldOrder.length - 1 - i];
+        }
+        int[] newOrder = new int[selection.m_Selection.size()];
+        for (int i = 0; i < newOrder.length; i++) {
+            if (oldOrder[i] < m_objects.size() - 1) {
+                newOrder[i] = oldOrder[i] + 1;
+            } else {
+                newOrder[i] = m_objects.size() - 1;
+            }
+        }
+        ReorderAction reorderAction = new ReorderAction(oldOrder, newOrder);
+        addUndoAction(reorderAction);
+        reorderAction.reorder(oldOrder, newOrder);
+        selection.setSelection(newOrder);
+    } // forward
+
+    public void backward(Selection selection) {
+        if (selection.m_Selection.size() == 0) {
+            return;
+        }
+        int[] oldOrder = new int[selection.m_Selection.size()];
+        for (int i = 0; i < oldOrder.length; i++) {
+            oldOrder[i] = ((Integer) selection.m_Selection.get(i)).intValue();
+        }
+        Arrays.sort(oldOrder);
+        int[] newOrder = new int[selection.m_Selection.size()];
+        for (int i = 0; i < selection.m_Selection.size(); i++) {
+            if (oldOrder[i] > 0) {
+                newOrder[i] = oldOrder[i] - 1;
+            }
+        }
+        ReorderAction reorderAction = new ReorderAction(oldOrder, newOrder);
+        addUndoAction(reorderAction);
+        reorderAction.reorder(oldOrder, newOrder);
+        selection.setSelection(newOrder);
+    } // backward
+
+    /**
+     * align set of nodes with the left most node in the list
+     *
+     * @param selection a selection
+     */
+    public void alignLeft(Selection selection) {
+        // update undo stack
+        addUndoAction(new UndoAction(selection.m_Selection, UndoAction.MOVE_ACTION));
+
+        List<Integer> nodes = selection.m_Selection;
+        int nMinX = -1;
+        for (int iNode = 0; iNode < nodes.size(); iNode++) {
+            int nX = getPositionX(((Integer) nodes.get(iNode)).intValue());
+            if (nX < nMinX || iNode == 0) {
+                nMinX = nX;
+            }
+        }
+        for (int iNode = 0; iNode < nodes.size(); iNode++) {
+            int nNode = ((Integer) nodes.get(iNode)).intValue();
+            setPositionX(nMinX, nNode);
+        }
+        adjustArrows();
+    } // alignLeft
+
+    /**
+     * align set of nodes with the right most node in the list
+     *
+     * @param selection a selection
+     */
+    public void alignRight(Selection selection) {
+        // update undo stack
+        addUndoAction(new UndoAction(selection.m_Selection, UndoAction.MOVE_ACTION));
+        List<Integer> nodes = selection.m_Selection;
+        int nMaxX = -1;
+        for (int iNode = 0; iNode < nodes.size(); iNode++) {
+            int nX = getPositionX2(((Integer) nodes.get(iNode)).intValue());
+            if (nX > nMaxX || iNode == 0) {
+                nMaxX = nX;
+            }
+        }
+        for (int iNode = 0; iNode < nodes.size(); iNode++) {
+            int nNode = ((Integer) nodes.get(iNode)).intValue();
+            int dX = getPositionX2(nNode) - getPositionX(nNode);
+            setPositionX(nMaxX - dX, nNode);
+        }
+        adjustArrows();
+    } // alignRight
+
+    /**
+     * align set of nodes with the top most node in the list
+     *
+     * @param selection a selection
+     */
+    public void alignTop(Selection selection) {
+        // update undo stack
+        addUndoAction(new UndoAction(selection.m_Selection, UndoAction.MOVE_ACTION));
+        List<Integer> nodes = selection.m_Selection;
+        int nMinY = -1;
+        for (int iNode = 0; iNode < nodes.size(); iNode++) {
+            int nY = getPositionY(((Integer) nodes.get(iNode)).intValue());
+            if (nY < nMinY || iNode == 0) {
+                nMinY = nY;
+            }
+        }
+        for (int iNode = 0; iNode < nodes.size(); iNode++) {
+            int nNode = ((Integer) nodes.get(iNode)).intValue();
+            setPositionY(nMinY, nNode);
+        }
+        adjustArrows();
+    } // alignTop
+
+    /**
+     * align set of nodes with the bottom most node in the list
+     *
+     * @param selection a selection
+     */
+    public void alignBottom(Selection selection) {
+        // update undo stack
+        addUndoAction(new UndoAction(selection.m_Selection, UndoAction.MOVE_ACTION));
+        List<Integer> nodes = selection.m_Selection;
+        int nMaxY = -1;
+        for (int iNode = 0; iNode < nodes.size(); iNode++) {
+            int nY = getPositionY2(((Integer) nodes.get(iNode)).intValue());
+            if (nY > nMaxY || iNode == 0) {
+                nMaxY = nY;
+            }
+        }
+        for (int iNode = 0; iNode < nodes.size(); iNode++) {
+            int nNode = ((Integer) nodes.get(iNode)).intValue();
+            int dY = getPositionY2(nNode) - getPositionY(nNode);
+            setPositionY(nMaxY - dY, nNode);
+        }
+        adjustArrows();
+    } // alignBottom
+
+    /**
+     * centre set of nodes half way between left and right most node in the list
+     *
+     * @param selection a selection
+     */
+    public void centreHorizontal(Selection selection) {
+        // update undo stack
+        addUndoAction(new UndoAction(selection.m_Selection, UndoAction.MOVE_ACTION));
+        List<Integer> nodes = selection.m_Selection;
+        int nMinY = -1;
+        int nMaxY = -1;
+        for (int iNode = 0; iNode < nodes.size(); iNode++) {
+            int nY = (getPositionY(((Integer) nodes.get(iNode)).intValue()) +
+                    getPositionY2(((Integer) nodes.get(iNode)).intValue())) / 2;
+            if (nY < nMinY || iNode == 0) {
+                nMinY = nY;
+            }
+            if (nY > nMaxY || iNode == 0) {
+                nMaxY = nY;
+            }
+        }
+        for (int iNode = 0; iNode < nodes.size(); iNode++) {
+            int nNode = ((Integer) nodes.get(iNode)).intValue();
+            int dY = (getPositionY2(nNode) - getPositionY(nNode)) / 2;
+            setPositionY((nMinY + nMaxY) / 2 - dY, nNode);
+        }
+        adjustArrows();
+    } // centreHorizontal
+
+    /**
+     * centre set of nodes half way between top and bottom most node in the list
+     *
+     * @param selection a selection
+     */
+    public void centreVertical(Selection selection) {
+        // update undo stack
+        addUndoAction(new UndoAction(selection.m_Selection, UndoAction.MOVE_ACTION));
+        List<Integer> nodes = selection.m_Selection;
+        int nMinX = -1;
+        int nMaxX = -1;
+        for (int iNode = 0; iNode < nodes.size(); iNode++) {
+            int nX = (getPositionX(((Integer) nodes.get(iNode)).intValue()) +
+                    getPositionX2(((Integer) nodes.get(iNode)).intValue())) / 2;
+            if (nX < nMinX || iNode == 0) {
+                nMinX = nX;
+            }
+            if (nX > nMaxX || iNode == 0) {
+                nMaxX = nX;
+            }
+        }
+        for (int iNode = 0; iNode < nodes.size(); iNode++) {
+            int nNode = ((Integer) nodes.get(iNode)).intValue();
+            int dX = (getPositionX2(nNode) - getPositionX(nNode)) / 2;
+            setPositionX((nMinX + nMaxX) / 2 - dX, nNode);
+        }
+        adjustArrows();
+    } // centreVertical
+
+    /**
+     * space out set of nodes evenly between left and right most node in the list
+     *
+     * @param selection a selection
+     */
+    public void spaceHorizontal(Selection selection) {
+        // update undo stack
+        addUndoAction(new UndoAction(selection.m_Selection, UndoAction.MOVE_ACTION));
+        List<Integer> nodes = selection.m_Selection;
+        int nMinX = -1;
+        int nMaxX = -1;
+        for (int iNode = 0; iNode < nodes.size(); iNode++) {
+            int nX = getPositionX(((Integer) nodes.get(iNode)).intValue());
+            if (nX < nMinX || iNode == 0) {
+                nMinX = nX;
+            }
+            if (nX > nMaxX || iNode == 0) {
+                nMaxX = nX;
+            }
+        }
+        for (int iNode = 0; iNode < nodes.size(); iNode++) {
+            int nNode = ((Integer) nodes.get(iNode)).intValue();
+            setPositionX((int) (nMinX + iNode * (nMaxX - nMinX) / (nodes.size() - 1.0)), nNode);
+        }
+        adjustArrows();
+    } // spaceHorizontal
+
+    /**
+     * space out set of nodes evenly between top and bottom most node in the list
+     *
+     * @param selection a selection
+     */
+    public void spaceVertical(Selection selection) {
+        // update undo stack
+        addUndoAction(new UndoAction(selection.m_Selection, UndoAction.MOVE_ACTION));
+        List<Integer> nodes = selection.m_Selection;
+        int nMinY = -1;
+        int nMaxY = -1;
+        for (int iNode = 0; iNode < nodes.size(); iNode++) {
+            int nY = getPositionY(((Integer) nodes.get(iNode)).intValue());
+            if (nY < nMinY || iNode == 0) {
+                nMinY = nY;
+            }
+            if (nY > nMaxY || iNode == 0) {
+                nMaxY = nY;
+            }
+        }
+        for (int iNode = 0; iNode < nodes.size(); iNode++) {
+            int nNode = ((Integer) nodes.get(iNode)).intValue();
+            setPositionY((int) (nMinY + iNode * (nMaxY - nMinY) / (nodes.size() - 1.0)), nNode);
+        }
+        adjustArrows();
+    } // spaceVertical
+
+
+    public class UndoAction {
+        final static int UNDO_ACTION = 0;
+        final static int MOVE_ACTION = 1;
+        final static int RESHAPE_ACTION = 2;
+        final static int ADD_PLUGIN_ACTION = 3;
+        final static int DEL_PLUGIN_ACTION = 4;
+        final static int ADD_ARROW_ACTION = 5;
+        final static int DEL_ARROW_ACTION = 6;
+        final static int FILL_COLOR_ACTION = 5;
+        final static int PEN_COLOR_ACTION = 6;
+        final static int SET_LABEL_ACTION = 7;
+        final static int TOGGLE_FILL_ACTION = 10;
+        final static int ADD_GROUP_ACTION = 20;
+        final static int DEL_GROUP_ACTION = 21;
+
+        int m_nActionType = UNDO_ACTION;
+
+        String m_sXML;
+        List<Integer> m_nPositions;
+
+        /* single selection undo actions **/
+
+        public UndoAction(int nSelection, int nActionType) {
+            if (!(m_objects.get(nSelection) instanceof BEASTObjectShape)) {
+                return;
+            }
+            m_nActionType = nActionType;
+            m_nPositions = new ArrayList<Integer>();
+            m_nPositions.add(nSelection);
+            init();
+        }
+        /* multiple selection undo actions **/
+
+        public UndoAction(List<Integer> selection, int nActionType) {
+            m_nActionType = nActionType;
+            m_nPositions = new ArrayList<Integer>();
+            for (int i = 0; i < selection.size(); i++) {
+                if (m_objects.get(selection.get(i)) instanceof BEASTObjectShape) {
+                    m_nPositions.add(new Integer(((Integer) selection.get(i)).intValue()));
+                }
+            }
+            init();
+        }
+
+        /* undo actions that don't need a selection **/
+
+        public UndoAction() {
+        }
+
+        boolean isSingleSelection(int nPosition) {
+            return (m_nPositions.size() == 1 && m_nPositions.get(0) == nPosition);
+        }
+
+        boolean isSelection(List<Integer> nPositions) {
+            int nMatches = 0;
+            for (Integer i : nPositions) {
+                if (m_objects.get(i) instanceof BEASTObjectShape) {
+                    if (m_nPositions.contains(i)) {
+                        nMatches++;
+                    } else {
+                        return false;
+                    }
+                }
+            }
+            return nMatches == m_nPositions.size();
+        }
+
+        void init() {
+            m_sXML = "<doc>";
+            for (int i = 0; i < m_nPositions.size(); i++) {
+                int iShape = ((Integer) m_nPositions.get(i)).intValue();
+                Shape shape = (Shape) m_objects.get(iShape);
+                m_sXML += shape.getXML();
+            }
+            m_sXML += "</doc>";
+        }
+
+        void undo() {
+            doit();
+        }
+
+        void redo() {
+            doit();
+        }
+
+        void doit() {
+            String sXML = "<doc>";
+            for (int i = 0; i < m_nPositions.size(); i++) {
+                int iShape = ((Integer) m_nPositions.get(i)).intValue();
+                Shape shape = (Shape) m_objects.get(iShape);
+                sXML += shape.getXML();
+            }
+            sXML += "</doc>";
+            List<Shape> shapes = XML2Shapes(m_sXML, false);
+            for (int i = 0; i < m_nPositions.size(); i++) {
+                int iShape = ((Integer) m_nPositions.get(i)).intValue();
+                Shape originalShape = m_objects.get(iShape);
+                Shape shape = (Shape) shapes.get(i);
+                ((BEASTObjectShape) shape).m_plugin = ((BEASTObjectShape) originalShape).m_plugin;
+                originalShape.assignFrom(shape);
+            }
+            m_sXML = sXML;
+        }
+    } // class UndoAction
+
+    /**
+     * action representing addition/deletion of a single plugin.
+     * This does not take connecting arrows in account.
+     * Use MultiObjectAction to add/delete plugin with its connecting arrows.
+     */
+    class PluginAction extends UndoAction {
+        public PluginAction(int nPosition, int nActionType) {
+            // assumes pluginShape + all its inputs has just been added
+            m_nActionType = nActionType;
+            BEASTObjectShape pluginShape = (BEASTObjectShape) m_objects.get(nPosition);
+            m_nPositions = new ArrayList<Integer>();
+            m_nPositions.add(nPosition);
+            nPosition--;
+            while (nPosition >= 0 &&
+                    m_objects.get(nPosition) instanceof InputShape &&
+                    ((InputShape) m_objects.get(nPosition)).getPluginShape() == pluginShape) {
+                m_nPositions.add(0, nPosition--);
+            }
+            // creat XML
+            init();
+        }
+
+        @Override
+        void undo() {
+            switch (m_nActionType) {
+                case ADD_PLUGIN_ACTION:
+                    removePlugin();
+                    return;
+                case DEL_PLUGIN_ACTION:
+                    addPlugin();
+                    return;
+            }
+            System.err.println("Error 101: action type not set properly");
+        }
+
+        @Override
+        void redo() {
+            switch (m_nActionType) {
+                case ADD_PLUGIN_ACTION:
+                    addPlugin();
+                    return;
+                case DEL_PLUGIN_ACTION:
+                    removePlugin();
+                    return;
+            }
+            System.err.println("Error 102: action type not set properly");
+        }
+
+        void removePlugin() {
+            for (int i = m_nPositions.size() - 1; i >= 0; i--) {
+                m_objects.remove((int) m_nPositions.get(i));
+            }
+        }
+
+        void addPlugin() {
+            List<Shape> shapes = XML2Shapes(m_sXML, true);
+            for (int i = 0; i < m_nPositions.size(); i++) {
+                m_objects.add(m_nPositions.get(i), shapes.get(i));
+            }
+        }
+    } // class AddPluginAction
+
+
+    /**
+     * action representing addition/deletion of a single arrow.
+     */
+    class ArrowAction extends UndoAction {
+        public ArrowAction(int nPosition, int nArrowAction) {
+            m_nActionType = nArrowAction;
+            m_nPositions = new ArrayList<Integer>();
+            m_nPositions.add(nPosition);
+            init();
+        }
+
+        @Override
+        void undo() {
+            switch (m_nActionType) {
+                case ADD_ARROW_ACTION:
+                    removeArrow();
+                    return;
+                case DEL_ARROW_ACTION:
+                    addArrow();
+                    return;
+            }
+            System.err.println("Error 103: action type not set properly");
+        }
+
+        @Override
+        void redo() {
+            switch (m_nActionType) {
+                case ADD_ARROW_ACTION:
+                    addArrow();
+                    return;
+                case DEL_ARROW_ACTION:
+                    removeArrow();
+                    return;
+            }
+            System.err.println("Error 104: action type not set properly");
+        }
+
+        void removeArrow() {
+            Arrow arrow = (Arrow) m_objects.get((int) m_nPositions.get(0));
+            m_objects.remove((int) m_nPositions.get(0));
+            // unconnect plug-in and input
+            Input<?> input = arrow.m_headShape.m_input;
+            if (input instanceof List<?>) {
+                ((List<?>) input.get()).remove(arrow.m_tailShape.m_plugin);
+            } else {
+                try {
+                    input.setValue(null, arrow.m_headShape.getPlugin());
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+
+        void addArrow() {
+            List<Shape> shapes = XML2Shapes(m_sXML, true);
+            Arrow arrow = (Arrow) shapes.get(0);
+            m_objects.add((int) m_nPositions.get(0), arrow);
+            // reconnect plug-in with input
+            arrow.m_tailShape = getPluginShapeWithLabel(arrow.m_sTailID);
+            arrow.m_headShape = getInputShapeWithID(arrow.m_sHeadID);
+            try {
+                arrow.m_headShape.m_input.setValue(arrow.m_tailShape.m_plugin, arrow.m_headShape.getPlugin());
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    } // class ArrowAction
+
+    /**
+     * action representing addition or deletion of multiple plugins/arrows
+     */
+    class MultiObjectAction extends UndoAction {
+        List<UndoAction> m_actions;
+
+        MultiObjectAction(List<Integer> nPositions, int nActionType) {
+            m_nActionType = nActionType;
+            m_actions = new ArrayList<UndoAction>();
+            // remove duplicates, if any
+            Collections.sort(nPositions, new Comparator<Integer>() {
+                @Override
+                public int compare(Integer o1, Integer o2) {
+                    return (o2 - o1);
+                }
+            });
+            for (int i = 1; i < nPositions.size(); i++) {
+                if ((int) nPositions.get(i) == (int) nPositions.get(i - 1)) {
+                    nPositions.remove(i);
+                    i--;
+                }
+            }
+            // split in plugins and arrows
+            List<Integer> iArrows = new ArrayList<Integer>();
+            List<Integer> iPluginsShapes = new ArrayList<Integer>();
+            for (int i : nPositions) {
+                Shape shape = m_objects.get(i);
+                if (shape instanceof BEASTObjectShape) {
+                    iPluginsShapes.add(i);
+                } else if (shape instanceof Arrow) {
+                    iArrows.add(i);
+                }
+            }
+            // create appropriate set of undo actions
+            switch (nActionType) {
+                case ADD_GROUP_ACTION:
+                    for (int i : iPluginsShapes) {
+                        m_actions.add(new PluginAction(i, ADD_PLUGIN_ACTION));
+                    }
+                    for (int i : iArrows) {
+                        m_actions.add(new ArrowAction(i, ADD_ARROW_ACTION));
+                    }
+                    break;
+                case DEL_GROUP_ACTION:
+                    for (int i : iArrows) {
+                        m_actions.add(new ArrowAction(i, DEL_ARROW_ACTION));
+                    }
+                    for (int i : iPluginsShapes) {
+                        m_actions.add(new PluginAction(i, DEL_PLUGIN_ACTION));
+                    }
+                    break;
+                default:
+                    System.err.println("Error 105: unrecognized action type");
+            }
+        }
+
+
+        @Override
+        void undo() {
+            for (int i = m_actions.size() - 1; i >= 0; i--) {
+                m_actions.get(i).undo();
+            }
+        }
+
+        @Override
+        void redo() {
+            for (int i = 0; i < m_actions.size(); i++) {
+                m_actions.get(i).redo();
+            }
+        }
+    } // class MultiObjectAction
+
+    class ReorderAction extends UndoAction {
+        int[] m_oldOrder;
+        int[] m_newOrder;
+
+        ReorderAction(int[] oldOrder, int[] newOrder) {
+            super();
+            m_oldOrder = oldOrder;
+            m_newOrder = newOrder;
+        }
+
+        void undo() {
+            reorder(m_oldOrder, m_newOrder);
+        }
+
+        void redo() {
+            for (int i = m_newOrder.length - 1; i >= 0; i--) {
+                int iSelection = m_newOrder[i];
+                Shape shape = (Shape) m_objects.get(iSelection);
+                m_objects.remove(iSelection);
+                m_objects.add(m_oldOrder[i], shape);
+            }
+        }
+
+        void reorder(int[] oldOrder, int[] newOrder) {
+            for (int i = 0; i < oldOrder.length; i++) {
+                int iSelection = oldOrder[i];
+                Shape shape = (Shape) m_objects.get(iSelection);
+                m_objects.remove(iSelection);
+                m_objects.add(newOrder[i], shape);
+            }
+        }
+    } // class ReorderAction
+
+
+    /**
+     * add undo action to the undo stack.
+     *
+     * @param action operation that needs to be added to the undo stack
+     */
+    void addUndoAction(UndoAction action) {
+        int iAction = m_undoStack.size() - 1;
+        while (iAction > m_nCurrentEditAction) {
+            m_undoStack.remove(iAction--);
+        }
+        m_undoStack.add(action);
+        m_nCurrentEditAction++;
+    } // addUndoAction
+
+    /**
+     * remove all actions from the undo stack
+     */
+    public void clearUndoStack() {
+        m_undoStack = new ArrayList<UndoAction>();
+        m_nCurrentEditAction = -1;
+    } // clearUndoStack
+
+    public boolean canUndo() {
+        return m_nCurrentEditAction > -1;
+    } // canUndo
+
+    public boolean canRedo() {
+        return m_nCurrentEditAction < m_undoStack.size() - 1;
+    } // canRedo
+
+    public void undo() {
+        if (!canUndo()) {
+            return;
+        }
+        UndoAction undoAction = m_undoStack.get(m_nCurrentEditAction);
+        undoAction.undo();
+        adjustInputs();
+        recalcArrows();
+        adjustArrows();
+        m_nCurrentEditAction--;
+    } // undo
+
+    public void redo() {
+        if (!canRedo()) {
+            return;
+        }
+        m_nCurrentEditAction++;
+        UndoAction undoAction = m_undoStack.get(m_nCurrentEditAction);
+        undoAction.redo();
+        adjustInputs();
+        recalcArrows();
+        adjustArrows();
+    } // redo
+
+
+    BEASTObjectShape getPluginShapeWithLabel(String sLabel) {
+        for (Shape shape : m_objects) {
+            if (shape instanceof BEASTObjectShape) {
+                if (shape.getLabel() != null && shape.getLabel().equals(sLabel)) {
+                    return (BEASTObjectShape) shape;
+                }
+            }
+        }
+        return null;
+    }
+
+    InputShape getInputShapeWithID(String sLabel) {
+        for (Shape shape : m_objects) {
+            if (shape instanceof InputShape) {
+                if (shape.getID() != null && shape.getID().equals(sLabel)) {
+                    return (InputShape) shape;
+                }
+            }
+        }
+        return null;
+    }
+
+    final static int DX = 120;
+    final static int DY = 80;
+
+    void addInput(BEASTObjectShape shape, Object o2, int nDepth, String sInput) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
+        if (o2 instanceof BEASTInterface) {
+            BEASTObjectShape shape2 = getPluginShapeWithLabel(((BEASTInterface) o2).getID());
+            if (shape2 == null) {
+                shape2 = new BEASTObjectShape((BEASTInterface) o2, this);
+                shape2.m_x = nDepth * DX;
+                shape2.m_w = DY;
+                shape2.m_plugin = (BEASTInterface) o2;
+                setPluginID(shape2);
+                m_objects.add(shape2);
+            }
+            process(shape2, nDepth);
+        }
+    }
+
+    void process(BEASTObjectShape shape, int nDepth) throws IllegalArgumentException, IllegalAccessException, InstantiationException, ClassNotFoundException {
+        BEASTInterface plugin = shape.m_plugin;
+        List<Input<?>> sInputs = plugin.listInputs();
+        for (Input<?> input_ : sInputs) {
+            Object o = input_.get();
+            if (o != null) {
+                if (o instanceof List<?>) {
+                    for (Object o2 : (List<?>) o) {
+                        addInput(shape, o2, nDepth + 1, input_.getName());
+                    }
+                } else if (o instanceof BEASTInterface) {
+                    addInput(shape, o, nDepth + 1, input_.getName());
+                    // } else {
+                    // it is a primitive type
+                }
+            }
+        }
+    }
+
+
+    public void loadFile(String sFileName) {
+        m_objects.clear();
+        XMLParser parser = new XMLParser();
+        try {
+            //sFileName;
+            StringBuilder sXML = new StringBuilder();
+            String NL = System.getProperty("line.separator");
+            Scanner scanner = new Scanner(new File(sFileName));
+            try {
+                while (scanner.hasNextLine()) {
+                    sXML.append(scanner.nextLine() + NL);
+                }
+            } finally {
+                scanner.close();
+            }
+            BEASTInterface plugin0 = parser.parseBareFragment(sXML.toString(), false);
+            init(plugin0);
+        } catch (Exception e) {
+            e.printStackTrace();
+            // TODO: handle exception
+        }
+    }
+    
+    void reinit() {
+    	String sXML = toXML();
+        m_objects.clear();
+        try {
+            XMLParser parser = new XMLParser();
+            BEASTInterface plugin0 = parser.parseBareFragment(sXML, false);
+            init(plugin0);
+        } catch (Exception e) {
+            e.printStackTrace();
+            // TODO: handle exception
+        }
+    }
+
+    public void init(BEASTInterface plugin0) {
+        try {
+            if (plugin0 instanceof BEASTObjectSet) {
+                List<BEASTInterface> set = ((BEASTObjectSet) plugin0).m_plugins.get();
+                if (set == null) {
+                    return;
+                }
+                for (BEASTInterface plugin : set) {
+                    BEASTObjectShape shape = new BEASTObjectShape(plugin, this);
+                    shape.m_plugin = plugin;
+                    setPluginID(shape);
+                    m_objects.add(shape);
+                    process(shape, 1);
+                    shape.m_x = DX;
+                    shape.m_w = 100;
+                    Random random = new Random();
+                    shape.m_y = random.nextInt(800);
+                    shape.m_h = 50;
+                }
+            } else {
+                BEASTObjectShape shape = new BEASTObjectShape(plugin0, this);
+                shape.m_plugin = plugin0;
+                setPluginID(shape);
+                m_objects.add(shape);
+                process(shape, 1);
+                shape.m_x = DX;
+                shape.m_w = 100;
+                Random random = new Random();
+                shape.m_y = random.nextInt(800);
+                shape.m_h = 50;
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            // TODO: handle exception
+        }
+        // clear undo stack after all items have been
+        // added since the stack is affected by parsing...
+        clearUndoStack();
+
+        recalcArrows();
+        layout();
+        adjustArrows();
+    } // init
+
+    List<Shape> XML2Shapes(String sXML, boolean bReconstructPlugins) {
+        List<Shape> shapes = new ArrayList<Shape>();
+        m_tmpobjects = shapes;
+        try {
+            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+            factory.setValidating(false);
+            org.w3c.dom.Document doc = factory.newDocumentBuilder().parse(new org.xml.sax.InputSource(new StringReader(sXML)));
+            doc.normalize();
+            NodeList nodes = doc.getDocumentElement().getChildNodes();
+            for (int iNode = 0; iNode < nodes.getLength(); iNode++) {
+                Node node = nodes.item(iNode);
+                if (node.getNodeType() == Node.ELEMENT_NODE) {
+                    shapes.add(parseNode(node, this, bReconstructPlugins));
+                }
+            }
+        } catch (Throwable t) {
+        }
+        m_tmpobjects = null;
+        return shapes;
+    }
+
+    final static String PLUGIN_SHAPE_ELEMENT = "pluginshape";
+    final static String INPUT_SHAPE_ELEMENT = "inputshape";
+    final static String ARROW_ELEMENT = "arrow";
+
+    /**
+     * parse XDL xml format *
+     */
+    static Shape parseNode(Node node, Document doc, boolean bReconstructPlugins) {
+        Shape shape = null;
+        if (node.getNodeName().equals(INPUT_SHAPE_ELEMENT) && bReconstructPlugins) {
+            shape = new InputShape(node, doc, bReconstructPlugins);
+        } else if (node.getNodeName().equals(ARROW_ELEMENT) && bReconstructPlugins) {
+            shape = new Arrow(node, doc, bReconstructPlugins);
+        } else if (node.getNodeName().equals(PLUGIN_SHAPE_ELEMENT)) {
+            shape = new BEASTObjectShape(node, doc, bReconstructPlugins);
+        }
+        return shape;
+    } // parseNode
+
+    public String toXML() {
+        XMLProducer xmlProducer = new XMLProducer();
+        BEASTObjectSet pluginSet = calcPluginSet();
+        if (pluginSet.m_plugins.get().size() == 1) {
+            return xmlProducer.toXML(pluginSet.m_plugins.get().get(0));
+        }
+        return xmlProducer.toXML(pluginSet);
+    } // toXML
+
+
+    /**
+     * collect all objects and put all top-level plugins in a PluginSet
+     */
+    BEASTObjectSet calcPluginSet() {
+        // collect all plug-ins
+        Collection<BEASTInterface> plugins = getPlugins();
+        // calc outputs
+        HashMap<BEASTInterface, List<BEASTInterface>> outputs = BEASTObjectPanel.getOutputs(plugins);
+        // put all plugins with no ouputs in the PluginSet
+        BEASTObjectSet pluginSet = new BEASTObjectSet();
+        for (BEASTInterface plugin : outputs.keySet()) {
+            if (outputs.get(plugin).size() == 0) {
+                try {
+                    pluginSet.setInputValue("plugin", plugin);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        return pluginSet;
+    } // calcPluginSet
+
+    /**
+     * convert m_objects in set of plugins *
+     */
+    Collection<BEASTInterface> getPlugins() {
+        Collection<BEASTInterface> plugins = new HashSet<BEASTInterface>();
+        for (Shape shape : m_objects) {
+            if (shape instanceof BEASTObjectShape) {
+                plugins.add(((BEASTObjectShape) shape).m_plugin);
+            }
+        }
+        return plugins;
+    }
+
+    /**
+     * return true if source is ascendant of target *
+     */
+    boolean isAscendant(BEASTInterface source, BEASTInterface target) {
+        Collection<BEASTInterface> plugins = getPlugins();
+        List<BEASTInterface> ascendants = BEASTObjectPanel.listAscendants(target, plugins);
+        return ascendants.contains(source);
+    }
+
+    Shape findObjectWithID(String sID) {
+        if (m_tmpobjects != null) {
+            for (int i = 0; i < m_tmpobjects.size(); i++) {
+                if (m_tmpobjects.get(i).getID().equals(sID)) {
+                    return m_tmpobjects.get(i);
+                }
+            }
+        }
+        for (int i = 0; i < m_objects.size(); i++) {
+            if (m_objects.get(i).getID().equals(sID)) {
+                return m_objects.get(i);
+            }
+        }
+        return null;
+    }
+
+
+    /**
+     * simple layout algorithm for placing PluginShapes *
+     */
+    void layout() {
+        // first construct input map for ease of navigation
+        HashMap<BEASTObjectShape, List<BEASTObjectShape>> inputMap = new HashMap<BEASTObjectShape, List<BEASTObjectShape>>();
+        HashMap<BEASTObjectShape, List<BEASTObjectShape>> outputMap = new HashMap<BEASTObjectShape, List<BEASTObjectShape>>();
+        for (Shape shape : m_objects) {
+            if (shape instanceof BEASTObjectShape && shape.m_bNeedsDrawing) {
+                inputMap.put((BEASTObjectShape) shape, new ArrayList<BEASTObjectShape>());
+                outputMap.put((BEASTObjectShape) shape, new ArrayList<BEASTObjectShape>());
+            }
+        }
+        for (Shape shape : m_objects) {
+            if (shape instanceof Arrow && shape.m_bNeedsDrawing) {
+                Shape headShape = ((Arrow) shape).m_headShape;
+                BEASTObjectShape pluginShape = ((InputShape) headShape).m_pluginShape;
+                BEASTObjectShape inputShape = ((Arrow) shape).m_tailShape;
+                inputMap.get(pluginShape).add(inputShape);
+                outputMap.get(inputShape).add(pluginShape);
+            }
+        }
+        // reset all x-coords to minimal x-value
+        for (Shape shape : inputMap.keySet()) {
+            shape.m_x = DX;
+        }
+        // move inputs rightward till they exceed x-coord of their inputs
+        boolean bProgress = true;
+        while (bProgress) {
+            bProgress = false;
+            for (Shape shape : inputMap.keySet()) {
+                int nMaxInputX = -DX;
+                for (Shape input : inputMap.get(shape)) {
+                    nMaxInputX = Math.max(nMaxInputX, input.m_x);
+                }
+                if (shape.m_x < nMaxInputX + DX) {
+                    shape.m_x = nMaxInputX + DX;
+                    bProgress = true;
+                }
+            }
+        }
+        // move inputs rightward till they are stopped by their outputs
+        bProgress = true;
+        while (bProgress) {
+            bProgress = false;
+            for (Shape shape : outputMap.keySet()) {
+                int nMinOutputX = Integer.MAX_VALUE;
+                for (Shape input : outputMap.get(shape)) {
+                    nMinOutputX = Math.min(nMinOutputX, input.m_x);
+                }
+                if (nMinOutputX < Integer.MAX_VALUE && shape.m_x < nMinOutputX - DX) {
+                    shape.m_x = nMinOutputX - DX;
+                    bProgress = true;
+                }
+            }
+        }
+
+
+        layoutAdjustY(inputMap);
+        // relax a bit
+        System.err.print("Relax...");
+        for (int i = 0; i < 250; i++) {
+            relax(false);
+        }
+        System.err.println("Done");
+        layoutAdjustY(inputMap);
+
+        adjustInputs();
+    }
+
+    /**
+     * Adjust y-coordinate of PluginShapes so they don't overlap
+     * and are close to their inputs. Helper method for layout() *
+     */
+    void layoutAdjustY(HashMap<BEASTObjectShape, List<BEASTObjectShape>> inputMap) {
+        // next, optimise top down order
+        boolean bProgress = true;
+        int iX = DX;
+        while (bProgress) {
+            List<BEASTObjectShape> shapes = new ArrayList<BEASTObjectShape>();
+            // find shapes with same x-coordinate
+            for (BEASTObjectShape shape : inputMap.keySet()) {
+                if (shape.m_x == iX) {
+                    shapes.add(shape);
+                }
+            }
+            int k = 1;
+            HashMap<Integer, BEASTObjectShape> ycoordMap = new HashMap<Integer, BEASTObjectShape>();
+            // set y-coordinate as mean of inputs
+            // if there are no inputs, order them top to bottom at DY intervals
+            for (BEASTObjectShape shape : shapes) {
+                List<BEASTObjectShape> inputs = inputMap.get(shape);
+                if (inputs.size() == 0) {
+                    shape.m_y = k * DY;
+                } else {
+                    shape.m_y = 0;
+                    for (Shape input : inputs) {
+                        shape.m_y += input.m_y;
+                    }
+                    shape.m_y /= inputs.size();
+                }
+                while (ycoordMap.containsKey(shape.m_y)) {
+                    shape.m_y++;
+                }
+                ycoordMap.put(shape.m_y, shape);
+                k++;
+            }
+            // ensure shapes are sufficiently far apart - at least DY between them
+            int nPrevY = 0;
+            ArrayList<Integer> yCoords = new ArrayList<Integer>();
+            yCoords.addAll(ycoordMap.keySet());
+            Collections.sort(yCoords);
+            int dY = 0;
+            for (Integer i : yCoords) {
+                BEASTObjectShape shape = ycoordMap.get(i);
+                if (shape.m_y < nPrevY + DY) {
+                    dY = nPrevY + DY - shape.m_y;
+                    shape.m_y = nPrevY + DY;
+                }
+                nPrevY = shape.m_y;
+            }
+            // upwards correction
+            if (dY > 0) {
+                dY /= shapes.size();
+                for (BEASTObjectShape shape : shapes) {
+                    shape.m_y -= dY;
+                }
+            }
+
+
+            bProgress = (shapes.size() > 0);
+            iX += DX;
+        }
+    } // layoutAdjustY
+
+    /**
+     * apply spring model algorithm to the placement of plug-in shapes *
+     */
+    public void relax(boolean bAllowXToMove) {
+        List<Shape> objects = new ArrayList<Shape>();
+        for (Shape shape : m_objects) {
+            if (shape.m_bNeedsDrawing) {
+                objects.add(shape);
+            }
+        }
+
+        // Step 0: determine degrees
+        HashMap<String, Integer> degreeMap = new HashMap<String, Integer>();
+        for (Shape shape : objects) {
+
+            if (shape instanceof Arrow) {
+                Arrow arrow = (Arrow) shape;
+                String sID = arrow.m_tailShape.getID();
+                if (arrow.m_headShape instanceof InputShape) {
+                    String sID2 = ((InputShape) arrow.m_headShape).m_pluginShape.getID();
+                    if (degreeMap.containsKey(sID)) {
+                        degreeMap.put(sID, degreeMap.get(sID) + 1);
+                    } else {
+                        degreeMap.put(sID, 1);
+                    }
+                    if (degreeMap.containsKey(sID2)) {
+                        degreeMap.put(sID2, degreeMap.get(sID2) + 1);
+                    } else {
+                        degreeMap.put(sID2, 1);
+                    }
+                }
+            }
+        }
+
+        // Step 1: relax
+        for (Shape shape : objects) {
+            if (shape instanceof Arrow) {
+                Arrow arrow = (Arrow) shape;
+                Shape source = arrow.m_tailShape;
+                int p1x = source.m_x + source.m_w / 2;
+                int p1y = source.m_y + source.m_h / 2;
+                if (arrow.m_headShape instanceof InputShape) {
+                    Shape target = ((InputShape) arrow.m_headShape).m_pluginShape;
+                    int p2x = target.m_x + target.m_w / 2;
+                    int p2y = target.m_y + target.m_h / 2;
+
+                    double vx = p1x - p2x;
+                    double vy = p1y - p2y;
+                    double len = Math.sqrt(vx * vx + vy * vy);
+
+                    double desiredLen = 150;
+
+                    // round from zero, if needed [zero would be Bad.].
+                    len = (len == 0) ? .0001 : len;
+
+                    double f = 1.0 / 3.0 * (desiredLen - len) / len;
+
+                    int nDegree1 = degreeMap.get(source.getID());
+                    int nDegree2 = degreeMap.get(target.getID());
+
+
+                    f = f * Math.pow(0.99, (nDegree1 + nDegree2 - 2));
+
+
+                    // the actual movement distance 'dx' is the force multiplied by the
+                    // distance to go.
+                    double dx = Math.min(f * vx, 3);
+                    double dy = Math.min(f * vy, 3);
+                    if (vx > -200 && vx < 0) {
+                        dx = -dx;
+                        //f *= Math.abs((vx+200))/40;
+                    }
+                    if (bAllowXToMove) source.m_x = (int) Math.max(100, source.m_x + dx);
+                    source.m_y = (int) Math.max(10, source.m_y + dy);
+                    if (bAllowXToMove) target.m_x = (int) Math.max(100, target.m_x - dx);
+                    target.m_y = (int) Math.max(10, target.m_y - dy);
+
+                }
+            }
+
+        }
+        // Step 2: repulse (pairwise)
+        for (Shape shape1 : objects) {
+            if (shape1 instanceof BEASTObjectShape) {
+                int p1x = shape1.m_x + shape1.m_w / 2;
+                int p1y = shape1.m_y + shape1.m_h / 2;
+                double dx = 0, dy = 0;
+                for (Shape shape2 : objects) {
+                    if (shape2 instanceof BEASTObjectShape) {
+                        int p2x = shape2.m_x + shape2.m_w / 2;
+                        int p2y = shape2.m_y + shape2.m_h / 2;
+                        double vx = p1x - p2x;
+                        double vy = p1y - p2y;
+                        double distanceSq = Math.sqrt(vx * vx + vy * vy);
+                        if (distanceSq == 0) {
+                            dx += Math.random() * 1;
+                            dy += Math.random() * 5;
+                        } else if (distanceSq < 300 /*repulsion_range_sq*/) {
+                            double factor = 500;
+                            dx += factor * vx / distanceSq / distanceSq;
+                            dy += factor * vy / distanceSq / distanceSq;
+                        }
+                    }
+                }
+                if (bAllowXToMove) shape1.m_x = (int) Math.min(800, Math.max(10, shape1.m_x + dx));
+                shape1.m_y = (int) Math.min(800, Math.max(10, shape1.m_y + dy));
+            }
+        }
+
+        // Step 3: move dependent objects in place
+        for (Shape shape : objects) {
+            if (shape instanceof BEASTObjectShape) {
+                ((BEASTObjectShape) shape).adjustInputs();
+            }
+        }
+        adjustArrows();
+    } // relax
+
+
+    /**
+     * sanity check: make sure there are no cycles and there is a Runnable
+     * plug in that is not an input of another plug in
+     */
+    final static int STATUS_OK = 0, STATUS_CYCLE = 1, STATUS_NOT_RUNNABLE = 2,
+            STATUS_EMPTY_MODEL = 3, STATUS_ORPHANS_IN_MODEL = 4;
+
+    int isValidModel() {
+        BEASTObjectSet pluginSet = calcPluginSet();
+        if (pluginSet.m_plugins.get().size() == 0) {
+            return STATUS_EMPTY_MODEL;
+        }
+        if (pluginSet.m_plugins.get().size() > 1) {
+            return STATUS_ORPHANS_IN_MODEL;
+        }
+        boolean hasRunable = false;
+        for (BEASTInterface plugin : pluginSet.m_plugins.get()) {
+            if (plugin instanceof Runnable) {
+                hasRunable = true;
+            }
+        }
+        if (!hasRunable) {
+            return STATUS_NOT_RUNNABLE;
+        }
+        return STATUS_OK;
+    } // isValidModel
+
+    /**
+     * remove all arrows, then add based on the plugin inputs *
+     */
+    void recalcArrows() {
+        // remove all arrows
+        for (int i = m_objects.size() - 1; i >= 0; i--) {
+            Shape shape = m_objects.get(i);
+            if (shape instanceof Arrow) {
+                m_objects.remove(i);
+            }
+        }
+        // build map for quick resolution of PluginShapes
+        HashMap<BEASTInterface, BEASTObjectShape> map = new HashMap<BEASTInterface, BEASTObjectShape>();
+        for (Shape shape : m_objects) {
+            if (shape instanceof BEASTObjectShape) {
+                map.put(((BEASTObjectShape) shape).m_plugin, (BEASTObjectShape) shape);
+            }
+        }
+        // re-insert arrows, if any
+        for (int i = m_objects.size() - 1; i >= 0; i--) {
+            Shape shape = m_objects.get(i);
+            if (shape instanceof BEASTObjectShape) {
+                BEASTObjectShape headShape = ((BEASTObjectShape) shape);
+                BEASTInterface plugin = headShape.m_plugin;
+                try {
+                    List<Input<?>> inputs = plugin.listInputs();
+                    for (Input<?> input : inputs) {
+                        if (input.get() != null) {
+                            if (input.get() instanceof BEASTInterface) {
+                                BEASTObjectShape tailShape = map.get((BEASTInterface) input.get());
+                                try {
+	                                Arrow arrow = new Arrow(tailShape, headShape, input.getName());
+	                                arrow.setID(getNewID(null));
+	                                m_objects.add(arrow);
+                                } catch (Exception e) {
+									// ignore, can happen when not all inputs are to be shown
+								}
+                            }
+                            if (input.get() instanceof List<?>) {
+                                for (Object o : (List<?>) input.get()) {
+                                    if (o != null && o instanceof BEASTInterface) {
+                                        BEASTObjectShape tailShape = map.get((BEASTInterface) o);
+                                        try {
+	                                        Arrow arrow = new Arrow(tailShape, headShape, input.getName());
+	                                        arrow.setID(getNewID(null));
+	                                        m_objects.add(arrow);
+                                        } catch (Exception e) {
+        									// ignore, can happen when not all inputs are to be shown
+        								}
+                                    }
+                                }
+                            }
+                        }
+                    }
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        //moveArrowsToBack();
+    } // recalcArrows
+
+} // class Document
diff --git a/src/beast/app/draw/DoubleInputEditor.java b/src/beast/app/draw/DoubleInputEditor.java
new file mode 100644
index 0000000..39a0170
--- /dev/null
+++ b/src/beast/app/draw/DoubleInputEditor.java
@@ -0,0 +1,17 @@
+package beast.app.draw;
+
+import beast.app.beauti.BeautiDoc;
+
+public class DoubleInputEditor extends InputEditor.Base {
+    private static final long serialVersionUID = 1L;
+
+    public DoubleInputEditor(BeautiDoc doc) {
+        super(doc);
+    }
+    //public DoubleInputEditor() {}
+
+    @Override
+    public Class<?> type() {
+        return Double.class;
+    }
+} // class DoubleInputEditor
diff --git a/src/beast/app/draw/DoubleListInputEditor.java b/src/beast/app/draw/DoubleListInputEditor.java
new file mode 100644
index 0000000..974afc4
--- /dev/null
+++ b/src/beast/app/draw/DoubleListInputEditor.java
@@ -0,0 +1,406 @@
+package beast.app.draw;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.swing.BorderFactory;
+import javax.swing.Box;
+import javax.swing.JLabel;
+import javax.swing.JTextField;
+import javax.swing.border.Border;
+import javax.swing.event.DocumentEvent;
+import javax.swing.event.DocumentListener;
+import javax.swing.event.ListSelectionListener;
+
+import beast.app.beauti.BeautiDoc;
+import beast.app.beauti.BeautiPanel;
+import beast.app.beauti.BeautiPanelConfig;
+import beast.core.BEASTInterface;
+import beast.core.Input;
+
+
+public class DoubleListInputEditor extends ListInputEditor {
+	private static final long serialVersionUID = 1L;
+
+	public DoubleListInputEditor(BeautiDoc doc) {
+		super(doc);
+	}
+
+    @Override
+    public Class<?> type() {
+        return List.class;
+    }
+
+    /**
+     * return type of the list *
+     */
+    public Class<?> baseType() {
+        return Double.class;
+    }
+    
+
+    
+    @SuppressWarnings("unchecked")
+	@Override
+    protected void initEntry() {
+        if (m_input.get() != null) {
+        	String str = "";
+        	for (Double d : (List<Double>) m_input.get()) {
+        		str += d + " ";
+        	}
+        	str = str.substring(0, str.length() - 1);
+            m_entry.setText(str);
+        }
+    }
+    
+        /**
+         * the input to be edited *
+         */
+        protected Input<?> m_input;
+
+        /**
+         * parent plugin *
+         */
+        protected BEASTInterface m_plugin;
+
+        /**
+         * text field used for primitive input editors *
+         */
+        protected JTextField m_entry;
+        
+        protected int itemNr;
+
+        public JTextField getEntry() {
+            return m_entry;
+        }
+
+        JLabel m_inputLabel;
+        protected static Dimension PREFERRED_SIZE = new Dimension(200, 25);
+        protected static Dimension MAX_SIZE = new Dimension(1024, 25);
+
+        /**
+         * flag to indicate label, edit and validate buttons/labels should be added *
+         */
+        protected boolean m_bAddButtons = true;
+
+        /**
+         * label that shows up when validation fails *
+         */
+        protected SmallLabel m_validateLabel;
+
+        /**
+         * document that we are editing *
+         */
+        protected BeautiDoc doc;
+
+        /**
+         * list of objects that want to be notified of the validation state when it changes *
+         */
+        List<InputEditor> m_validateListeners;
+
+        public void addValidationListener(InputEditor validateListener) {
+            if (m_validateListeners == null) {
+                m_validateListeners = new ArrayList<InputEditor>();
+            }
+            m_validateListeners.add(validateListener);
+        }
+
+        public void notifyValidationListeners(ValidationStatus state) {
+            if (m_validateListeners != null) {
+                for (InputEditor listener : m_validateListeners) {
+                    listener.startValidating(state);
+                }
+            }
+        }
+
+    	protected BeautiDoc getDoc() {
+            if (doc == null) {
+                Component c = this;
+                while (c.getParent() != null) {
+                    c = c.getParent();
+                    if (c instanceof BeautiPanel) {
+                        doc = ((BeautiPanel) c).getDoc();
+                    }
+                }
+            }
+            return doc;
+        }
+
+
+        public Class<?>[] types() {
+            Class<?>[] types = new Class<?>[1];
+            types[0] = type();
+            return types;
+        }
+
+        /**
+         * construct an editor consisting of a label and input entry *
+         */
+        public void init(Input<?> input, BEASTInterface plugin, int itemNr, ExpandOption bExpandOption, boolean bAddButtons) {
+            m_bAddButtons = bAddButtons;
+            m_input = input;
+            m_plugin = plugin;
+            this.itemNr= itemNr;
+            
+            addInputLabel();
+
+            setUpEntry();
+
+            add(m_entry);
+            add(Box.createHorizontalGlue());
+            addValidationLabel();
+        } // init
+
+        void setUpEntry() {
+            m_entry = new JTextField();
+            m_entry.setName(m_input.getName());
+            m_entry.setMinimumSize(PREFERRED_SIZE);
+            m_entry.setPreferredSize(PREFERRED_SIZE);
+            m_entry.setSize(PREFERRED_SIZE);
+            initEntry();
+            m_entry.setToolTipText(m_input.getHTMLTipText());
+            m_entry.setMaximumSize(MAX_SIZE);
+
+            m_entry.getDocument().addDocumentListener(new DocumentListener() {
+                @Override
+                public void removeUpdate(DocumentEvent e) {
+                    processEntry();
+                }
+
+                @Override
+                public void insertUpdate(DocumentEvent e) {
+                    processEntry();
+                }
+
+                @Override
+                public void changedUpdate(DocumentEvent e) {
+                    processEntry();
+                }
+            });
+        }
+
+        @SuppressWarnings({ "unchecked", "rawtypes" })
+    	protected void setValue(Object o) throws Exception {
+        	if (itemNr < 0) {
+        		m_input.setValue(o, m_plugin);
+        	} else {
+        		// set value of an item in a list
+        		List list = (List) m_input.get();
+        		Object other = list.get(itemNr);
+        		if (other != o) {
+        			if (other instanceof BEASTInterface) {
+        				BEASTInterface.getOutputs(other).remove(m_plugin);
+        			}
+        			list.set(itemNr, o);
+        			if (o instanceof BEASTInterface) {
+        				BEASTInterface.getOutputs(o).add(m_plugin);
+        			}
+        		}
+        	}
+        }
+        
+        protected void processEntry() {
+            try {
+            	setValue(m_entry.getText());
+                validateInput();
+                m_entry.requestFocusInWindow();
+            } catch (Exception ex) {
+//    			JOptionPane.showMessageDialog(null, "Error while setting " + m_input.getName() + ": " + ex.getMessage() +
+//    					" Leaving value at " + m_input.get());
+//    			m_entry.setText(m_input.get() + "");
+                if (m_validateLabel != null) {
+                    m_validateLabel.setVisible(true);
+                    m_validateLabel.setToolTipText("<html><p>Parsing error: " + ex.getMessage() + ". Value was left at " + m_input.get() + ".</p></html>");
+                    m_validateLabel.m_circleColor = Color.orange;
+                }
+                repaint();
+            }
+        }
+
+        protected void addInputLabel() {
+            if (m_bAddButtons) {
+                String sName = formatName(m_input.getName());
+                addInputLabel(sName, m_input.getHTMLTipText());
+            }
+        }
+
+        protected String formatName(String sName) {
+    	    if (doc.beautiConfig.inputLabelMap.containsKey(m_plugin.getClass().getName() + "." + sName)) {
+    	        sName = doc.beautiConfig.inputLabelMap.get(m_plugin.getClass().getName() + "." + sName);
+    	    } else {
+    	        sName = sName.replaceAll("([a-z])([A-Z])", "$1 $2");
+    	        sName = sName.substring(0, 1).toUpperCase() + sName.substring(1);
+    	    }
+    	    return sName;
+        }
+
+        protected void addInputLabel(String sLabel, String sTipText) {
+            if (m_bAddButtons) {
+                m_inputLabel = new JLabel(sLabel);
+                m_inputLabel.setToolTipText(sTipText);
+                m_inputLabel.setHorizontalTextPosition(JLabel.RIGHT);
+                //Dimension size = new Dimension(g_nLabelWidth, 20);
+                Dimension size = new Dimension(200, 20);
+                m_inputLabel.setMaximumSize(size);
+                m_inputLabel.setMinimumSize(size);
+                m_inputLabel.setPreferredSize(size);
+                m_inputLabel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
+
+//                m_inputLabel.setSize(size);
+//                m_inputLabel.setBorder(BorderFactory.createLineBorder(Color.RED, 2));
+                // RRB: temporary
+                //m_inputLabel.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED));
+                add(m_inputLabel);
+            }
+        }
+
+        protected void addValidationLabel() {
+            if (m_bAddButtons) {
+                m_validateLabel = new SmallLabel("x", new Color(200, 0, 0));
+                add(m_validateLabel);
+                m_validateLabel.setVisible(true);
+                validateInput();
+            }
+        }
+
+        /* check the input is valid, continue checking recursively */
+        protected void validateAllEditors() {
+            for (InputEditor editor : doc.currentInputEditors) {
+                editor.validateInput();
+            }
+        }
+
+        @Override
+        public void validateInput() {
+            try {
+                m_input.validate();
+                if (m_entry != null && !m_input.canSetValue(m_entry.getText(), m_plugin)) {
+                    throw new Exception("invalid value");
+                }
+                // recurse
+                try {
+                    validateRecursively(m_input, new HashSet<Input<?>>());
+                } catch (Exception e) {
+                    notifyValidationListeners(ValidationStatus.HAS_INVALIDMEMBERS);
+                    if (m_validateLabel != null) {
+                        m_validateLabel.setVisible(true);
+                        m_validateLabel.setToolTipText("<html><p>Recursive error in " + e.getMessage() + "</p></html>");
+                        m_validateLabel.m_circleColor = Color.orange;
+                    }
+                    repaint();
+                    return;
+                }
+                if (m_validateLabel != null) {
+                    m_validateLabel.setVisible(false);
+                }
+                notifyValidationListeners(ValidationStatus.IS_VALID);
+            } catch (Exception e) {
+                System.err.println("Validation message: " + e.getMessage());
+                if (m_validateLabel != null) {
+                    m_validateLabel.setToolTipText(e.getMessage());
+                    m_validateLabel.m_circleColor = Color.red;
+                    m_validateLabel.setVisible(true);
+                }
+                notifyValidationListeners(ValidationStatus.IS_INVALID);
+            }
+            repaint();
+        }
+
+        /* Recurse in any of the input plugins
+          * and validate its inputs */
+        void validateRecursively(Input<?> input, Set<Input<?>> done) throws Exception {
+            if (done.contains(input)) {
+                // this prevent cycles to lock up validation
+                return;
+            } else {
+                done.add(input);
+            }
+            if (input.get() != null) {
+                if (input.get() instanceof BEASTInterface) {
+                    BEASTInterface plugin = ((BEASTInterface) input.get());
+                    for (Input<?> input2 : plugin.listInputs()) {
+                        try {
+                            input2.validate();
+                        } catch (Exception e) {
+                            throw new Exception(((BEASTInterface) input.get()).getID() + "</p><p> " + e.getMessage());
+                        }
+                        validateRecursively(input2, done);
+                    }
+                }
+                if (input.get() instanceof List<?>) {
+                    for (Object o : (List<?>) input.get()) {
+                        if (o != null && o instanceof BEASTInterface) {
+                            BEASTInterface plugin = (BEASTInterface) o;
+                            for (Input<?> input2 : plugin.listInputs()) {
+                                try {
+                                    input2.validate();
+                                } catch (Exception e) {
+                                    throw new Exception(((BEASTInterface) o).getID() + " " + e.getMessage());
+                                }
+                                validateRecursively(input2, done);
+                            }
+                        }
+                    }
+                }
+            }
+        } // validateRecursively
+
+        @Override
+        public void startValidating(ValidationStatus state) {
+            validateInput();
+        }
+
+
+        public void refreshPanel() {
+            Component c = this;
+            while (c.getParent() != null) {
+                c = c.getParent();
+                if (c instanceof ListSelectionListener) {
+                    ((ListSelectionListener) c).valueChanged(null);
+                }
+            }
+        }
+
+        /**
+         * synchronise values in panel with current network *
+         */
+        protected void sync() {
+            Component c = this;
+            while (c.getParent() != null) {
+                c = c.getParent();
+                if (c instanceof BeautiPanel) {
+                    BeautiPanel panel = (BeautiPanel) c;
+                    BeautiPanelConfig cfgPanel = panel.config;
+                    cfgPanel.sync(panel.iPartition);
+                }
+            }
+        }
+
+        // we should leave it to the component to set its own border
+        @Deprecated
+        public void setBorder(Border border) {
+    		super.setBorder(border);
+        }
+
+        @Override
+        public void setDoc(BeautiDoc doc) {
+        	this.doc = doc;
+        }
+
+        // what is this method for? We should leave repainting to the standard mechanism
+        @Deprecated
+    	public void repaint() {
+    	this.repaint(0);
+    		super.repaint();
+    	}
+
+    	public Component getComponent() {
+    		return this;
+    	}
+
+}
diff --git a/src/beast/app/draw/EnumInputEditor.java b/src/beast/app/draw/EnumInputEditor.java
new file mode 100644
index 0000000..080ee73
--- /dev/null
+++ b/src/beast/app/draw/EnumInputEditor.java
@@ -0,0 +1,76 @@
+package beast.app.draw;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.Box;
+import javax.swing.JComboBox;
+
+import beast.app.beauti.BeautiDoc;
+import beast.core.Input;
+import beast.core.BEASTObject;
+import beast.core.BEASTInterface;
+
+
+
+/**
+ * Input editor for enumeration inputs *
+ */
+public class EnumInputEditor extends InputEditor.Base {
+    public EnumInputEditor(BeautiDoc doc) {
+		super(doc);
+	}
+    //public EnumInputEditor() {}
+
+	private static final long serialVersionUID = 1L;
+    JComboBox m_selectPluginBox;
+
+    @Override
+    public Class<?> type() {
+        return Enum.class;
+    }
+
+    /**
+     * construct an editor consisting of
+     * o a label
+     * o a combo box for selecting another value in the enumeration
+     */
+    @Override
+    public void init(Input<?> input, BEASTInterface plugin, int itemNr, ExpandOption bExpandOption, boolean bAddButtons) {
+        m_bAddButtons = bAddButtons;
+        m_input = input;
+        m_plugin = plugin;
+		this.itemNr = itemNr;
+
+        addInputLabel();
+        List<String> sAvailableValues = new ArrayList<String>();
+        for (int i = 0; i < input.possibleValues.length; i++) {
+            sAvailableValues.add(input.possibleValues[i].toString());
+        }
+        if (sAvailableValues.size() > 1) {
+            m_selectPluginBox = new JComboBox(sAvailableValues.toArray(new String[0]));
+            String sSelectString = input.get().toString();
+            m_selectPluginBox.setSelectedItem(sSelectString);
+
+            m_selectPluginBox.addActionListener(new ActionListener() {
+                // implements ActionListener
+                public void actionPerformed(ActionEvent e) {
+                    String sSelected = (String) m_selectPluginBox.getSelectedItem();
+                    try {
+                    	setValue(sSelected);
+                        //lm_input.setValue(sSelected, m_plugin);
+                    } catch (Exception e1) {
+                        e1.printStackTrace();
+                    }
+                }
+            });
+            m_selectPluginBox.setToolTipText(input.getHTMLTipText());
+            add(m_selectPluginBox);
+            add(Box.createGlue());
+        }
+    } // init
+
+
+} // class EnumInputEditor
diff --git a/src/beast/app/draw/ExtensionFileFilter.java b/src/beast/app/draw/ExtensionFileFilter.java
new file mode 100644
index 0000000..54e9c90
--- /dev/null
+++ b/src/beast/app/draw/ExtensionFileFilter.java
@@ -0,0 +1,95 @@
+package beast.app.draw;
+
+import java.io.File;
+import java.io.FilenameFilter;
+
+import javax.swing.filechooser.FileFilter;
+
+public class ExtensionFileFilter extends FileFilter implements FilenameFilter {
+
+    /**
+     * The text description of the types of files accepted
+     */
+    protected String m_Description;
+
+    /**
+     * The filename extensions of accepted files
+     */
+    protected String[] m_Extension;
+
+    /**
+     * Creates the ExtensionFileFilter
+     *
+     * @param extension   the extension of accepted files.
+     * @param description a text description of accepted files.
+     */
+    public ExtensionFileFilter(String extension, String description) {
+        m_Extension = new String[1];
+        m_Extension[0] = extension;
+        m_Description = description;
+    }
+
+    /**
+     * Creates an ExtensionFileFilter that accepts files that have any of the
+     * extensions contained in the supplied array.
+     *
+     * @param extensions  an array of acceptable file extensions (as Strings).
+     * @param description a text description of accepted files.
+     */
+    public ExtensionFileFilter(String[] extensions, String description) {
+        m_Extension = extensions;
+        m_Description = description;
+    }
+
+    /**
+     * Gets the description of accepted files.
+     *
+     * @return the description.
+     */
+    public String getDescription() {
+
+        return m_Description;
+    }
+
+    /**
+     * Returns a copy of the acceptable extensions.
+     *
+     * @return the accepted extensions
+     */
+    public String[] getExtensions() {
+        return (String[]) m_Extension.clone();
+    }
+
+    /**
+     * Returns true if the supplied file should be accepted (i.e.: if it has the
+     * required extension or is a directory).
+     *
+     * @param file the file of interest.
+     * @return true if the file is accepted by the filter.
+     */
+    public boolean accept(File file) {
+
+        String name = file.getName().toLowerCase();
+        if (file.isDirectory()) {
+            return true;
+        }
+        for (int i = 0; i < m_Extension.length; i++) {
+            if (name.endsWith(m_Extension[i])) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * Returns true if the file in the given directory with the given name
+     * should be accepted.
+     *
+     * @param dir  the directory where the file resides.
+     * @param name the name of the file.
+     * @return true if the file is accepted.
+     */
+    public boolean accept(File dir, String name) {
+        return accept(new File(dir, name));
+    }
+}
diff --git a/src/beast/app/draw/HelpBrowser.java b/src/beast/app/draw/HelpBrowser.java
new file mode 100644
index 0000000..b522144
--- /dev/null
+++ b/src/beast/app/draw/HelpBrowser.java
@@ -0,0 +1,200 @@
+/*
+* File HTMLHelp.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+
+package beast.app.draw;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.Box;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JEditorPane;
+import javax.swing.JScrollPane;
+import javax.swing.event.HyperlinkEvent;
+import javax.swing.event.HyperlinkListener;
+
+import beast.app.DocMaker;
+
+
+
+/**
+ * Dialog for showing HTML help, with hyperlinks and some browser
+ * functionality to navigate around the Plugin help facilities.
+ */
+public class HelpBrowser extends JDialog implements HyperlinkListener {
+    /**
+     * serialisation *
+     */
+    private static final long serialVersionUID = 1L;
+    /**
+     * generates HTML pages *
+     */
+    static DocMaker m_docMaker;
+    /**
+     * browser stack *
+     */
+    List<String> m_sPlugins = new ArrayList<String>();
+    int m_iCurrentPlugin = 0;
+
+    /**
+     * GUI components *
+     */
+    JEditorPane m_editorPane;
+    JButton m_forwardButton;
+    JButton m_backwardButton;
+
+
+    public HelpBrowser(String sPlugin) {
+        if (m_docMaker == null) {
+            m_docMaker = new DocMaker();
+        }
+
+        // initialise JEditorPane
+        m_editorPane = new JEditorPane();
+        m_editorPane.setEditable(false);
+        m_editorPane.setContentType("text/html");
+        m_editorPane.addHyperlinkListener(this);
+        setModal(true);
+
+        JScrollPane scroller = new JScrollPane(m_editorPane);
+
+        // add the navigation buttons at the top
+        Box buttonBox = Box.createHorizontalBox();
+        buttonBox.setAlignmentX(LEFT_ALIGNMENT);
+        m_forwardButton = new JButton(">");
+        m_forwardButton.setToolTipText("Browse forward");
+        m_forwardButton.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                browseForward();
+            }
+        });
+
+        m_backwardButton = new JButton("<");
+        m_backwardButton.setToolTipText("Browse backward");
+        m_backwardButton.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                browseBackward();
+            }
+        });
+
+
+        JButton closeButton = new JButton("x");
+        closeButton.setToolTipText("Close Help");
+        closeButton.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                dispose();
+            }
+        });
+//		m_backwardButton.setMnemonic(KeyEvent.VK_RIGHT);
+//		m_forwardButton.setMnemonic(KeyEvent.VK_LEFT);
+
+        buttonBox.add(m_backwardButton);
+        buttonBox.add(m_forwardButton);
+        buttonBox.add(closeButton);
+
+        Box box = Box.createVerticalBox();
+        box.add(buttonBox);
+        box.add(scroller);
+
+
+        m_sPlugins.add(sPlugin);
+        updateState();
+        this.add(box);
+    } // c'tor
+
+    void browseForward() {
+        if (m_iCurrentPlugin < m_sPlugins.size() - 1) {
+            m_iCurrentPlugin++;
+        }
+        updateState();
+    }
+
+    void browseBackward() {
+        if (m_iCurrentPlugin > 0) {
+            m_iCurrentPlugin--;
+        }
+        updateState();
+    }
+
+    @Override
+    public void hyperlinkUpdate(HyperlinkEvent link) {
+        try {
+            HyperlinkEvent.EventType type = link.getEventType();
+            if (type == HyperlinkEvent.EventType.ACTIVATED) {
+                String sPlugin = link.getDescription();
+                sPlugin = sPlugin.replaceAll(".html", "");
+                // update browser stack
+                m_iCurrentPlugin++;
+                while (m_iCurrentPlugin < m_sPlugins.size()) {
+                    m_sPlugins.remove(m_iCurrentPlugin);
+                }
+                m_sPlugins.add(sPlugin);
+                updateState();
+            }
+        } catch (Exception e) {
+            // ignore
+            System.err.println(e.getMessage());
+        }
+    } // hyperlinkUpdate
+
+
+    /**
+     * change html text and enable/disable buttons (where appropriate) *
+     */
+    void updateState() {
+        String sPlugin = m_sPlugins.get(m_iCurrentPlugin);
+        try {
+            String sHTML = m_docMaker.getHTML(sPlugin, false);
+            m_editorPane.setText(sHTML);
+        } catch (Exception e) {
+            // ignore
+            System.err.println("HelpBrowser: Something is wrong: " + e.getClass().getName() + " " + e.getMessage());
+        }
+        m_backwardButton.setEnabled(m_iCurrentPlugin > 0);
+        m_forwardButton.setEnabled(m_iCurrentPlugin < m_sPlugins.size() - 1);
+    } // updateState
+
+
+    /**
+     * test *
+     */
+    public static void main(String[] args) {
+        try {
+            HelpBrowser b = new HelpBrowser("beast.core.MCMC");
+            b.setSize(800, 800);
+            b.setVisible(true);
+            b.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    } // main
+
+} // HelpBrowser
diff --git a/src/beast/app/draw/InputEditor.java b/src/beast/app/draw/InputEditor.java
new file mode 100644
index 0000000..f05b4ee
--- /dev/null
+++ b/src/beast/app/draw/InputEditor.java
@@ -0,0 +1,472 @@
+package beast.app.draw;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.swing.BorderFactory;
+import javax.swing.Box;
+import javax.swing.BoxLayout;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+import javax.swing.border.Border;
+import javax.swing.event.DocumentEvent;
+import javax.swing.event.DocumentListener;
+import javax.swing.event.ListSelectionListener;
+
+import beast.app.beauti.BeautiDoc;
+import beast.app.beauti.BeautiPanel;
+import beast.app.beauti.BeautiPanelConfig;
+import beast.core.Input;
+import beast.core.BEASTInterface;
+
+/**
+ * Base class for editors that provide a GUI for manipulating an Input for a Plugin.
+ * The idea is that for every type of Input there will be a dedicated editor, e.g.
+ * for a String Input, there will be an edit field, for a Boolean Input, there will
+ * be a checkbox in the editor.
+ * <p/>
+ * The default just provides an edit field and uses toString() on Input to get its value.
+ * To change the behaviour, override
+ * public void init(Input<?> input, Plugin plugin, int itemNr, ExpandOption bExpandOption, boolean bAddButtons)
+ */
+/** note that it is assumed that any InputEditor is a java.awt.Component **/
+public interface InputEditor {
+
+    final public static String NO_VALUE = "<none>";
+
+    public enum ExpandOption {TRUE, TRUE_START_COLLAPSED, FALSE, IF_ONE_ITEM}
+
+    public enum ButtonStatus {ALL, NONE, DELETE_ONLY, ADD_ONLY}
+    
+    public enum ValidationStatus {
+        IS_VALID,
+        IS_INVALID,
+        HAS_INVALIDMEMBERS
+    }
+
+    /** type of Plugin to which this editor can be used **/ 
+    Class<?> type();
+
+    /** list of types of Plugins to which this editor can be used **/ 
+    Class<?>[] types();
+
+    /** initialise InputEditor
+     * @param input to be edited
+     * @param plugin parent plugin containing the input
+     * @param itemNr if the input is a list, itemNr indicates which item to edit in the list
+     * @param bExpandOption start state of input editor
+     * @param bAddButtons button status of input editor
+     */
+    void init(Input<?> input, BEASTInterface plugin, int itemNr, ExpandOption bExpandOption, boolean bAddButtons);
+
+    /** set document with the model containing the input **/
+    void setDoc(BeautiDoc doc);
+
+    /**
+     * set decoration. This method is deprecated, because decoration can be handled by the JComponent with setBorder method on
+     **/
+    @Deprecated
+    void setBorder(Border border);
+
+    /** prepare to validate input **/
+    void startValidating(ValidationStatus state);
+    
+    /** validate input and update status of input editor if necessary **/
+    void validateInput();
+    
+    /** add input editor to listen for changes **/
+    void addValidationListener(InputEditor validateListener);
+    
+    /** propagate status of predecessor inputs through list of plugins **/
+    void notifyValidationListeners(ValidationStatus state);
+    
+    Component getComponent();
+
+public abstract class Base extends JPanel implements InputEditor {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * the input to be edited *
+     */
+    protected Input<?> m_input;
+
+    /**
+     * parent plugin *
+     */
+    protected BEASTInterface m_plugin;
+
+    /**
+     * text field used for primitive input editors *
+     */
+    protected JTextField m_entry;
+    
+    protected int itemNr;
+
+    public JTextField getEntry() {
+        return m_entry;
+    }
+
+    JLabel m_inputLabel;
+    protected static Dimension PREFERRED_SIZE = new Dimension(200, 25);
+    protected static Dimension MAX_SIZE = new Dimension(1024, 25);
+
+    /**
+     * flag to indicate label, edit and validate buttons/labels should be added *
+     */
+    protected boolean m_bAddButtons = true;
+
+    /**
+     * label that shows up when validation fails *
+     */
+    protected SmallLabel m_validateLabel;
+
+    /**
+     * document that we are editing *
+     */
+    protected BeautiDoc doc;
+
+    /**
+     * list of objects that want to be notified of the validation state when it changes *
+     */
+    List<InputEditor> m_validateListeners;
+
+    public void addValidationListener(InputEditor validateListener) {
+        if (m_validateListeners == null) {
+            m_validateListeners = new ArrayList<InputEditor>();
+        }
+        m_validateListeners.add(validateListener);
+    }
+
+    public void notifyValidationListeners(ValidationStatus state) {
+        if (m_validateListeners != null) {
+            for (InputEditor listener : m_validateListeners) {
+                listener.startValidating(state);
+            }
+        }
+    }
+
+    // TODO this should not be static. Better if it was an instance variable,
+    // TODO since its currently set by an input of BeautiPanelConfig, which can be different for each BeautiPanel.
+    public static int g_nLabelWidth = 150;
+
+	public Base(BeautiDoc doc) {
+		setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
+		this.doc = doc;
+		if (doc != null) {
+			doc.currentInputEditors.add(this);
+		}
+	} // c'tor
+
+	protected BeautiDoc getDoc() {
+        if (doc == null) {
+            Component c = this;
+            while (c.getParent() != null) {
+                c = c.getParent();
+                if (c instanceof BeautiPanel) {
+                    doc = ((BeautiPanel) c).getDoc();
+                }
+            }
+        }
+        return doc;
+    }
+
+    /**
+     * return class the editor is suitable for.
+     * Either implement type() or types() if multiple
+     * types are supported *
+     */
+    abstract public Class<?> type();
+
+    public Class<?>[] types() {
+        Class<?>[] types = new Class<?>[1];
+        types[0] = type();
+        return types;
+    }
+
+    /**
+     * construct an editor consisting of a label and input entry *
+     */
+    public void init(Input<?> input, BEASTInterface plugin, int itemNr, ExpandOption bExpandOption, boolean bAddButtons) {
+        m_bAddButtons = bAddButtons;
+        m_input = input;
+        m_plugin = plugin;
+        this.itemNr= itemNr;
+        
+        addInputLabel();
+
+        setUpEntry();
+
+        add(m_entry);
+        add(Box.createHorizontalGlue());
+        addValidationLabel();
+    } // init
+
+    void setUpEntry() {
+        m_entry = new JTextField();
+        m_entry.setName(m_input.getName());
+        Dimension prefDim = new Dimension(PREFERRED_SIZE.width, m_entry.getPreferredSize().height);
+        Dimension maxDim = new Dimension(MAX_SIZE.width, m_entry.getPreferredSize().height);
+        m_entry.setMinimumSize(prefDim);
+        m_entry.setPreferredSize(prefDim);
+        m_entry.setSize(prefDim);
+        initEntry();
+        m_entry.setToolTipText(m_input.getHTMLTipText());
+        m_entry.setMaximumSize(maxDim);
+
+        m_entry.getDocument().addDocumentListener(new DocumentListener() {
+            @Override
+            public void removeUpdate(DocumentEvent e) {
+                processEntry();
+            }
+
+            @Override
+            public void insertUpdate(DocumentEvent e) {
+                processEntry();
+            }
+
+            @Override
+            public void changedUpdate(DocumentEvent e) {
+                processEntry();
+            }
+        });
+    }
+
+    protected void initEntry() {
+        if (m_input.get() != null) {
+            m_entry.setText(m_input.get().toString());
+        }
+    }
+
+    @SuppressWarnings({ "unchecked", "rawtypes" })
+	protected void setValue(Object o) throws Exception {
+    	if (itemNr < 0) {
+    		m_input.setValue(o, m_plugin);
+    	} else {
+    		// set value of an item in a list
+    		List list = (List) m_input.get();
+    		Object other = list.get(itemNr);
+    		if (other != o) {
+    			if (other instanceof BEASTInterface) {
+    				BEASTInterface.getOutputs(other).remove(m_plugin);
+    			}
+    			list.set(itemNr, o);
+    			if (o instanceof BEASTInterface) {
+    				BEASTInterface.getOutputs(o).add(m_plugin);
+    			}
+    		}
+    	}
+    }
+    
+    protected void processEntry() {
+        try {
+        	setValue(m_entry.getText());
+            validateInput();
+            m_entry.requestFocusInWindow();
+        } catch (Exception ex) {
+//			JOptionPane.showMessageDialog(null, "Error while setting " + m_input.getName() + ": " + ex.getMessage() +
+//					" Leaving value at " + m_input.get());
+//			m_entry.setText(m_input.get() + "");
+            if (m_validateLabel != null) {
+                m_validateLabel.setVisible(true);
+                m_validateLabel.setToolTipText("<html><p>Parsing error: " + ex.getMessage() + ". Value was left at " + m_input.get() + ".</p></html>");
+                m_validateLabel.m_circleColor = Color.orange;
+            }
+            repaint();
+        }
+    }
+
+    protected void addInputLabel() {
+        if (m_bAddButtons) {
+            String sName = formatName(m_input.getName());
+            addInputLabel(sName, m_input.getHTMLTipText());
+        }
+    }
+
+    protected String formatName(String sName) {
+	    if (doc.beautiConfig.inputLabelMap.containsKey(m_plugin.getClass().getName() + "." + sName)) {
+	        sName = doc.beautiConfig.inputLabelMap.get(m_plugin.getClass().getName() + "." + sName);
+	    } else {
+	        sName = sName.replaceAll("([a-z])([A-Z])", "$1 $2");
+	        sName = sName.substring(0, 1).toUpperCase() + sName.substring(1);
+	    }
+	    return sName;
+    }
+
+    protected void addInputLabel(String sLabel, String sTipText) {
+        if (m_bAddButtons) {
+            m_inputLabel = new JLabel(sLabel);
+            m_inputLabel.setToolTipText(sTipText);
+            m_inputLabel.setHorizontalTextPosition(JLabel.RIGHT);
+            //Dimension size = new Dimension(g_nLabelWidth, 20);
+            Dimension size = new Dimension(200, 20);
+            m_inputLabel.setMaximumSize(size);
+            m_inputLabel.setMinimumSize(size);
+            m_inputLabel.setPreferredSize(size);
+            m_inputLabel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
+
+//            m_inputLabel.setSize(size);
+//            m_inputLabel.setBorder(BorderFactory.createLineBorder(Color.RED, 2));
+            // RRB: temporary
+            //m_inputLabel.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED));
+            if (sLabel.equals("Subst Model")) {
+            	int h = 3;
+            	h++;
+            }
+            add(m_inputLabel);
+        }
+    }
+
+    protected void addValidationLabel() {
+        if (m_bAddButtons) {
+            m_validateLabel = new SmallLabel("x", new Color(200, 0, 0));
+            add(m_validateLabel);
+            m_validateLabel.setVisible(true);
+            validateInput();
+        }
+    }
+
+    /* check the input is valid, continue checking recursively */
+    protected void validateAllEditors() {
+        for (InputEditor editor : doc.currentInputEditors) {
+            editor.validateInput();
+        }
+    }
+
+    @Override
+    public void validateInput() {
+        try {
+            m_input.validate();
+            if (m_entry != null && !m_input.canSetValue(m_entry.getText(), m_plugin)) {
+                throw new Exception("invalid value");
+            }
+            // recurse
+            try {
+                validateRecursively(m_input, new HashSet<Input<?>>());
+            } catch (Exception e) {
+                notifyValidationListeners(ValidationStatus.HAS_INVALIDMEMBERS);
+                if (m_validateLabel != null) {
+                    m_validateLabel.setVisible(true);
+                    m_validateLabel.setToolTipText("<html><p>Recursive error in " + e.getMessage() + "</p></html>");
+                    m_validateLabel.m_circleColor = Color.orange;
+                }
+                repaint();
+                return;
+            }
+            if (m_validateLabel != null) {
+                m_validateLabel.setVisible(false);
+            }
+            notifyValidationListeners(ValidationStatus.IS_VALID);
+        } catch (Exception e) {
+            System.err.println("Validation message: " + e.getMessage());
+            if (m_validateLabel != null) {
+                m_validateLabel.setToolTipText(e.getMessage());
+                m_validateLabel.m_circleColor = Color.red;
+                m_validateLabel.setVisible(true);
+            }
+            notifyValidationListeners(ValidationStatus.IS_INVALID);
+        }
+        repaint();
+    }
+
+    /* Recurse in any of the input plugins
+      * and validate its inputs */
+    void validateRecursively(Input<?> input, Set<Input<?>> done) throws Exception {
+        if (done.contains(input)) {
+            // this prevent cycles to lock up validation
+            return;
+        } else {
+            done.add(input);
+        }
+        if (input.get() != null) {
+            if (input.get() instanceof BEASTInterface) {
+                BEASTInterface plugin = ((BEASTInterface) input.get());
+                for (Input<?> input2 : plugin.listInputs()) {
+                    try {
+                        input2.validate();
+                    } catch (Exception e) {
+                        throw new Exception(((BEASTInterface) input.get()).getID() + "</p><p> " + e.getMessage());
+                    }
+                    validateRecursively(input2, done);
+                }
+            }
+            if (input.get() instanceof List<?>) {
+                for (Object o : (List<?>) input.get()) {
+                    if (o != null && o instanceof BEASTInterface) {
+                        BEASTInterface plugin = (BEASTInterface) o;
+                        for (Input<?> input2 : plugin.listInputs()) {
+                            try {
+                                input2.validate();
+                            } catch (Exception e) {
+                                throw new Exception(((BEASTInterface) o).getID() + " " + e.getMessage());
+                            }
+                            validateRecursively(input2, done);
+                        }
+                    }
+                }
+            }
+        }
+    } // validateRecursively
+
+    @Override
+    public void startValidating(ValidationStatus state) {
+        validateInput();
+    }
+
+
+    public void refreshPanel() {
+        Component c = this;
+        while (c.getParent() != null) {
+            c = c.getParent();
+            if (c instanceof ListSelectionListener) {
+                ((ListSelectionListener) c).valueChanged(null);
+            }
+        }
+    }
+
+    /**
+     * synchronise values in panel with current network *
+     */
+    protected void sync() {
+        Component c = this;
+        while (c.getParent() != null) {
+            c = c.getParent();
+            if (c instanceof BeautiPanel) {
+                BeautiPanel panel = (BeautiPanel) c;
+                BeautiPanelConfig cfgPanel = panel.config;
+                cfgPanel.sync(panel.iPartition);
+            }
+        }
+    }
+
+    // we should leave it to the component to set its own border
+    @Deprecated
+    public void setBorder(Border border) {
+		super.setBorder(border);
+    }
+
+    @Override
+    public void setDoc(BeautiDoc doc) {
+    	this.doc = doc;
+    }
+
+    // what is this method for? We should leave repainting to the standard mechanism
+    @Deprecated
+	public void repaint() {
+	this.repaint(0);
+		super.repaint();
+	}
+
+	public Component getComponent() {
+		return this;
+	}
+
+} // class InputEditor.Base
+
+} // InputEditor interface
diff --git a/src/beast/app/draw/InputEditorFactory.java b/src/beast/app/draw/InputEditorFactory.java
new file mode 100644
index 0000000..15fd3a1
--- /dev/null
+++ b/src/beast/app/draw/InputEditorFactory.java
@@ -0,0 +1,349 @@
+package beast.app.draw;
+
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import javax.swing.BorderFactory;
+import javax.swing.Box;
+import javax.swing.JOptionPane;
+
+import beast.app.beauti.BeautiConfig;
+import beast.app.beauti.BeautiDoc;
+import beast.app.beauti.BeautiSubTemplate;
+import beast.app.draw.InputEditor.ButtonStatus;
+import beast.app.draw.InputEditor.ExpandOption;
+import beast.core.Input;
+import beast.core.BEASTObject;
+import beast.core.BEASTInterface;
+import beast.core.BEASTInterface;
+import beast.core.Input.Validate;
+import beast.core.util.Log;
+import beast.util.AddOnManager;
+
+
+
+/** Can create InputEditors for inputs of Plugins 
+ * and there are some associated utility methods **/
+public class InputEditorFactory {
+    /**
+     * map that identifies the InputEditor to use for a particular type of Input *
+     */
+    HashMap<Class<?>, String> inputEditorMap;
+    HashMap<Class<?>, String> listInputEditorMap;
+    BeautiDoc doc;
+    
+	public InputEditorFactory(BeautiDoc doc) {
+		this.doc = doc;
+		init();
+	}
+
+    public void init() {
+        // register input editors
+        inputEditorMap = new HashMap<Class<?>, String>();
+        listInputEditorMap = new HashMap<Class<?>, String>();
+
+//        String [] sKnownEditors = new String [] {"beast.app.draw.DataInputEditor","beast.app.beauti.AlignmentListInputEditor", "beast.app.beauti.FrequenciesInputEditor", "beast.app.beauti.OperatorListInputEditor", "beast.app.beauti.ParametricDistributionInputEditor", "beast.app.beauti.PriorListInputEditor", "beast.app.beauti.SiteModelInputEditor", "beast.app.beauti.TaxonSetInputEditor", "beast.app.beauti.TipDatesInputEditor", "beast.app.draw.BooleanInputEditor", "beast.app.draw.DoubleI [...]
+//        		"beast.app.draw.ParameterInputEditor", "beast.app.draw.PluginInputEditor", "beast.app.draw.StringInputEditor"};
+//        registerInputEditors(sKnownEditors);
+        String[] PACKAGE_DIRS = {"beast.app",};
+        for (String sPackage : PACKAGE_DIRS) {
+            List<String> sInputEditors = AddOnManager.find("beast.app.draw.InputEditor", sPackage);
+            registerInputEditors(sInputEditors.toArray(new String[0]));
+        }
+    }
+
+    private void registerInputEditors(String[] sInputEditors) {
+    	//BeautiDoc doc = new BeautiDoc();
+        for (String sInputEditor : sInputEditors) {
+        	// ignore inner classes, which are marked with $
+        	if (!sInputEditor.contains("$")) {
+	            try {
+	                Class<?> _class = Class.forName(sInputEditor);
+	                
+	                
+	                Constructor<?> con = _class.getConstructor(BeautiDoc.class);
+	                InputEditor editor = (InputEditor) con.newInstance(doc);
+	                
+	                //InputEditor editor = (InputEditor) _class.newInstance();
+	                Class<?>[] types = editor.types();
+	                for (Class<?> type : types) {
+	                    inputEditorMap.put(type, sInputEditor);
+	                    if (editor instanceof ListInputEditor) {
+	                        Class<?> baseType = ((ListInputEditor) editor).baseType();
+	                        listInputEditorMap.put(baseType, sInputEditor);
+	                    }
+	                }
+	            } catch (java.lang.InstantiationException e) {
+	                // ingore input editors that are inner classes
+	            } catch (Exception e) {
+	                // print message
+	                System.err.println(e.getClass().getName() + ": " + e.getMessage());
+	            }
+        	}
+        }
+    }
+
+    /**
+     * add all inputs of a plugin to a box *
+     */
+    public List<InputEditor> addInputs(Box box, BEASTInterface plugin, InputEditor editor, InputEditor validateListener, BeautiDoc doc) {
+        /* add individual inputs **/
+        List<Input<?>> inputs = null;
+        List<InputEditor> editors = new ArrayList<InputEditor>();
+    	
+        try {
+            inputs = plugin.listInputs();
+        } catch (Exception e) {
+            // TODO: handle exception
+        }
+        for (Input<?> input : inputs) {
+            try {
+                String sFullInputName = plugin.getClass().getName() + "." + input.getName();
+                if (!doc.beautiConfig.suppressPlugins.contains(sFullInputName)) {
+                    InputEditor inputEditor = createInputEditor(input, plugin, true, ExpandOption.FALSE, ButtonStatus.ALL, editor, doc);
+                    box.add(inputEditor.getComponent());
+                    box.add(Box.createVerticalStrut(5));
+                    //box.add(Box.createVerticalGlue());
+                    if (validateListener != null) {
+                        inputEditor.addValidationListener(validateListener);
+                    }
+                    editors.add(inputEditor);
+                }
+            } catch (Exception e) {
+                // ignore
+                System.err.println(e.getClass().getName() + ": " + e.getMessage() + "\n" +
+                        "input " + input.getName() + " could not be added.");
+                e.printStackTrace();
+                JOptionPane.showMessageDialog(null, "Could not add entry for " + input.getName());
+            }
+        }
+        box.add(Box.createVerticalGlue());
+        return editors;
+    } // addInputs
+
+
+    public InputEditor createInputEditor(Input<?> input, BEASTInterface plugin, BeautiDoc doc) throws Exception {
+        return createInputEditor(input, plugin, true, InputEditor.ExpandOption.FALSE, ButtonStatus.ALL, null, doc);
+    }
+
+    public InputEditor createInputEditor(Input<?> input, BEASTInterface plugin, boolean bAddButtons,
+                                                ExpandOption bForceExpansion, ButtonStatus buttonStatus,
+                                                InputEditor editor, BeautiDoc doc) throws Exception {
+    	return createInputEditor(input, -1, plugin, bAddButtons, bForceExpansion, buttonStatus, editor, doc);
+    }
+    
+    public InputEditor createInputEditor(Input<?> input, int listItemNr, BEASTInterface plugin, boolean bAddButtons,
+                ExpandOption bForceExpansion, ButtonStatus buttonStatus,
+                InputEditor editor, BeautiDoc doc) throws Exception {
+        if (input.getType() == null) {
+            input.determineClass(plugin);
+        }
+        //Class<?> inputClass = input.get() != null ? input.get().getClass(): input.getType();
+        Class<?> inputClass = input.getType();
+        if (inputClass == null) {
+        	return null;
+        }
+        if (listItemNr >= 0) {
+        	inputClass = ((List<?>)input.get()).get(listItemNr).getClass();
+        } else {
+        	if (input.get() != null && !input.get().getClass().equals(inputClass)
+        			&& !(input.get() instanceof ArrayList)) {
+        		System.err.println(input.get().getClass() + " != " + inputClass);
+        		inputClass = input.get().getClass();
+        	}
+        }
+
+        //Log.trace.print(inputClass.getName() + " => ");
+        InputEditor inputEditor;
+
+        // check whether the super.editor has a custom method for creating an Editor
+        if (editor != null) {        	
+            try {
+                String sName = input.getName();
+                sName = new String(sName.charAt(0) + "").toUpperCase() + sName.substring(1);
+                sName = "create" + sName + "Editor";
+                Class<?> _class = editor.getClass();
+                Method method = _class.getMethod(sName);
+                inputEditor = (InputEditor) method.invoke(editor);
+                //Log.trace.println(inputEditor.getClass().getName() + " (CUSTOM EDITOR)");
+                return inputEditor;
+            } catch (Exception e) {
+                // ignore
+            }
+        }
+        if (listItemNr < 0 && (List.class.isAssignableFrom(inputClass) ||
+                (input.get() != null && input.get() instanceof List<?>))) {
+            // handle list inputs
+            if (listInputEditorMap.containsKey(inputClass)) {
+                // use custom list input editor
+                String sInputEditor = listInputEditorMap.get(inputClass);
+                Constructor<?> con = Class.forName(sInputEditor).getConstructor(BeautiDoc.class);
+                inputEditor = (InputEditor) con.newInstance(doc);
+
+                //inputEditor = (InputEditor) Class.forName(sInputEditor).newInstance();
+            } else {
+                // otherwise, use generic list editor
+                inputEditor = new ListInputEditor(doc);
+            }
+            ((ListInputEditor) inputEditor).setButtonStatus(buttonStatus);
+        } else if (input.possibleValues != null) {
+            // handle enumeration inputs
+            inputEditor = new EnumInputEditor(doc);
+        } else {
+        	Class<?> inputClass2 = inputClass;
+        	while (inputClass2 != null && !inputEditorMap.containsKey(inputClass2)) {
+        		inputClass2 = inputClass2.getSuperclass(); 
+        	}
+        	if (inputClass2 == null) {
+        		inputEditor = new BEASTObjectInputEditor(doc);
+        	} else {
+	            // handle Plugin-input with custom input editors
+	            String sInputEditor = inputEditorMap.get(inputClass2);
+	            
+	            Constructor<?> con = Class.forName(sInputEditor).getConstructor(BeautiDoc.class);
+	            inputEditor = (InputEditor) con.newInstance(doc);
+        	}
+        }        	
+//    	} else if (inputEditorMap.containsKey(inputClass)) {
+//            // handle Plugin-input with custom input editors
+//            String sInputEditor = inputEditorMap.get(inputClass);
+//            
+//            Constructor<?> con = Class.forName(sInputEditor).getConstructor(BeautiDoc.class);
+//            inputEditor = (InputEditor) con.newInstance(doc);
+//            //inputEditor = (InputEditor) Class.forName(sInputEditor).newInstance(doc);
+//            //} else if (inputClass.isEnum()) {
+//            //    inputEditor = new EnumInputEditor();
+//        } else {
+//            // assume it is a general Plugin, so create a default Plugin input editor
+//            inputEditor = new PluginInputEditor(doc);
+//        }
+        String sFullInputName = plugin.getClass().getName() + "." + input.getName();
+        //System.err.println(sFullInputName);
+        ExpandOption expandOption = bForceExpansion;
+        if (doc.beautiConfig.inlinePlugins.contains(sFullInputName) || bForceExpansion == ExpandOption.TRUE_START_COLLAPSED) {
+            expandOption = ExpandOption.TRUE;
+            // deal with initially collapsed plugins
+            if (doc.beautiConfig.collapsedPlugins.contains(sFullInputName) || bForceExpansion == ExpandOption.TRUE_START_COLLAPSED) {
+                if (input.get() != null) {
+                    Object o = input.get();
+                    if (o instanceof ArrayList) {
+                        for (Object o2 : (ArrayList<?>) o) {
+                            if (o2 instanceof BEASTInterface) {
+                                String sID = ((BEASTInterface) o2).getID();
+                                if (!ListInputEditor.g_initiallyCollapsedIDs.contains(sID)) {
+                                    ListInputEditor.g_initiallyCollapsedIDs.add(sID);
+                                    ListInputEditor.g_collapsedIDs.add(sID);
+                                }
+                            }
+                        }
+                    } else if (o instanceof BEASTInterface) {
+                        String sID = ((BEASTInterface) o).getID();
+                        if (!ListInputEditor.g_initiallyCollapsedIDs.contains(sID)) {
+                            ListInputEditor.g_initiallyCollapsedIDs.add(sID);
+                            ListInputEditor.g_collapsedIDs.add(sID);
+                        }
+                    }
+                }
+
+            }
+        }
+        inputEditor.setDoc(doc);
+        inputEditor.init(input, plugin, listItemNr, expandOption, bAddButtons);
+        inputEditor.setBorder(BorderFactory.createEmptyBorder());
+        inputEditor.getComponent().setVisible(true);
+        //Log.trace.println(inputEditor.getClass().getName());
+        return inputEditor;
+    } // createInputEditor
+
+    /**
+     * find plugins that could fit the input
+     * @param input
+     * @param parent plugin containing the input
+     * @param sTabuList list of ids that are not allowed
+     * @param doc
+     * @return
+     */
+    
+    public List<String> getAvailablePlugins(Input<?> input, BEASTInterface parent, List<String> sTabuList, BeautiDoc doc) {
+
+        //List<String> sPlugins = BeautiConfig.getInputCandidates(parent, input);
+        List<String> sPlugins = new ArrayList<String>();
+        if (sPlugins != null) {
+            return sPlugins;
+        }
+
+
+        /* add ascendants to tabu list */
+        if (sTabuList == null) {
+            sTabuList = new ArrayList<String>();
+        }
+        if (!doc.isExpertMode()) {
+            for (BEASTInterface plugin : BEASTObjectPanel.listAscendants(parent, doc.pluginmap.values())) {
+                sTabuList.add(plugin.getID());
+            }
+        }
+        //System.err.println(sTabuList);
+
+        /* collect all plugins in the system, that are not in the tabu list*/
+        sPlugins = new ArrayList<String>();
+        for (BEASTInterface plugin : doc.pluginmap.values()) {
+            if (input.getType().isAssignableFrom(plugin.getClass())) {
+                boolean bIsTabu = false;
+                if (sTabuList != null) {
+                    for (String sTabu : sTabuList) {
+                        if (sTabu.equals(plugin.getID())) {
+                            bIsTabu = true;
+                        }
+                    }
+                }
+                if (!bIsTabu) {
+                    try {
+                        if (input.canSetValue(plugin, parent)) {
+                            sPlugins.add(plugin.getID());
+                        }
+                    } catch (Exception e) {
+                        // ignore
+                    }
+                }
+            }
+        }
+        /* add all plugin-classes of type assignable to the input */
+        if (doc.isExpertMode()) {
+            List<String> sClasses = AddOnManager.find(input.getType(), "beast");
+            for (String sClass : sClasses) {
+                try {
+                    Object o = Class.forName(sClass).newInstance();
+                    if (input.canSetValue(o, parent)) {
+                        sPlugins.add("new " + sClass);
+                    }
+                } catch (Exception e) {
+                    // ignore
+                }
+            }
+        }
+        return sPlugins;
+    } // getAvailablePlugins
+
+    /**
+     * finds beauti templates that can create subnets that fit an input
+     * @param input
+     * @param parent
+     * @param sTabuList
+     * @param doc
+     * @return
+     */
+
+    public List<BeautiSubTemplate> getAvailableTemplates(Input<?> input, BEASTInterface parent, List<String> sTabuList, BeautiDoc doc) {
+        Class<?> type = input.getType();
+        List<BeautiSubTemplate> candidates = doc.beautiConfig.getInputCandidates(parent, input, type);
+        if (input.getRule().equals(Validate.OPTIONAL)) {
+            candidates.add(BeautiConfig.getNullTemplate(doc));
+        }
+        return candidates;
+    }
+
+}
diff --git a/src/beast/app/draw/InputShape.java b/src/beast/app/draw/InputShape.java
new file mode 100644
index 0000000..05271a2
--- /dev/null
+++ b/src/beast/app/draw/InputShape.java
@@ -0,0 +1,188 @@
+/*
+* File Ellipse.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+package beast.app.draw;
+
+import java.awt.BasicStroke;
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.Graphics2D;
+import java.io.PrintStream;
+import java.util.List;
+
+import javax.swing.JPanel;
+
+import org.w3c.dom.Node;
+
+import beast.core.Input;
+import beast.core.BEASTObject;
+import beast.core.BEASTInterface;
+
+
+
+public class InputShape extends Shape {
+    Input<?> m_input;
+    static Font g_InputFont = new Font("arial", Font.PLAIN, 8);
+
+    public InputShape(Input<?> input) {
+        super();
+        m_input = input;
+    }
+
+    public InputShape(Node node, Document doc, boolean bReconstructPlugins) {
+        parse(node, doc, bReconstructPlugins);
+        //TODO: set inputName
+    }
+
+    public BEASTObjectShape m_pluginShape = null;
+
+    BEASTObjectShape getPluginShape() {
+        return m_pluginShape;
+    }
+
+    void setPluginShape(BEASTObjectShape function) {
+        m_pluginShape = function;
+    }
+
+    BEASTInterface getPlugin() {
+        return m_pluginShape.m_plugin;
+    }
+
+    String getInputName() throws Exception {
+        String sName = getLabel();
+        if (sName.indexOf('=') >= 0) {
+            sName = sName.substring(0, sName.indexOf('='));
+        }
+        return sName;
+    }
+
+
+    @Override
+    public void draw(Graphics2D g, JPanel panel) {
+        if (m_pluginShape == null || m_pluginShape.m_bNeedsDrawing) {
+            if (m_bFilled) {
+                g.setColor(m_fillcolor);
+                g.fillOval(m_x, m_y, m_w, m_h);
+            }
+            g.setStroke(new BasicStroke(m_nPenWidth));
+            g.setColor(m_pencolor);
+            //g.drawOval(m_x, m_y, m_w, m_h);
+            g.setFont(g_InputFont);
+            if (getLabel() != null) {
+                FontMetrics fm = g.getFontMetrics(g.getFont());
+                String sLabel = getLabel();
+                int i = 0;
+                g.drawString(sLabel, m_x + m_w / 2 - fm.stringWidth(sLabel), m_y + m_h / 2 + i * fm.getHeight());
+            }
+        }
+    }
+
+    @Override
+    void parse(Node node, Document doc, boolean bReconstructPlugins) {
+        super.parse(node, doc, bReconstructPlugins);
+    }
+
+    @Override
+    public String getXML() {
+        return "<" + Document.INPUT_SHAPE_ELEMENT + getAtts() + "/>";
+    }
+
+    @Override
+    boolean intersects(int nX, int nY) {
+        return (m_x + m_w / 2 - nX) * (m_x + m_w / 2 - nX) + (m_y + m_h / 2 - nY) * (m_y + m_h / 2 - nY) < m_w * m_w / 4 + m_h * m_h / 4;
+    }
+
+    @Override
+    String getLabel() {
+        if (m_input == null) {
+            return "XXX";
+        }
+        String sLabel = m_input.getName();
+        if (m_input.get() != null) {
+            Object o = m_input.get();
+            if (o instanceof String ||
+                    o instanceof Integer ||
+                    o instanceof Double ||
+                    o instanceof Boolean) {
+                sLabel += "=" + o.toString();
+            }
+        }
+        return sLabel;
+    }
+
+    String toString(Object o) {
+        if (o instanceof String ||
+                o instanceof Integer ||
+                o instanceof Double ||
+                o instanceof Boolean) {
+            return o.toString();
+        } else if (o instanceof BEASTInterface) {
+            return ((BEASTInterface) o).getID();
+        }
+        return "";
+    }
+
+    String getLongLabel() {
+        String sLabel = m_input.getName();
+        if (m_input.get() != null) {
+            Object o = m_input.get();
+            if (o instanceof String ||
+                    o instanceof Integer ||
+                    o instanceof Double ||
+                    o instanceof Boolean) {
+                sLabel += "=" + o.toString();
+            } else if (o instanceof BEASTInterface) {
+                sLabel += "=" + ((BEASTInterface) o).getID();
+            } else if (o instanceof List<?>) {
+                sLabel += "=[";
+                boolean bNeedsComma = false;
+                for (Object o2 : (List<?>) o) {
+                    if (bNeedsComma) {
+                        sLabel += ",";
+                    }
+                    sLabel += toString(o2);
+                    bNeedsComma = true;
+                }
+                sLabel += "]";
+            }
+        }
+        return sLabel;
+    }
+
+    @Override
+    String getID() {
+        if (m_pluginShape != null) {
+            return m_pluginShape.m_plugin.getID() + "." + m_input.getName();
+        } else {
+            return m_sID;
+        }
+    }
+
+    @Override
+    void toSVG(PrintStream out) {
+        out.print("<circle cx='" + (m_x + m_w / 2) + "' cy='" + (m_y + m_h / 2) + "' r='" + (m_w / 2) + "' ");
+        out.println("fill='rgb(" + m_fillcolor.getRed() + "," + m_fillcolor.getGreen() + "," + m_fillcolor.getBlue() + ")'/>");
+        drawSVGString(out, g_InputFont, m_pencolor, "end");
+    }
+} // class Ellipse
diff --git a/src/beast/app/draw/IntegerInputEditor.java b/src/beast/app/draw/IntegerInputEditor.java
new file mode 100644
index 0000000..60e9555
--- /dev/null
+++ b/src/beast/app/draw/IntegerInputEditor.java
@@ -0,0 +1,18 @@
+package beast.app.draw;
+
+import beast.app.beauti.BeautiDoc;
+
+public class IntegerInputEditor extends InputEditor.Base {
+    private static final long serialVersionUID = 1L;
+
+    public IntegerInputEditor(BeautiDoc doc) {
+        super(doc);
+    }
+    //public IntegerInputEditor() {}
+
+    @Override
+    public Class<?> type() {
+        return Integer.class;
+    }
+
+} // class IntegerInputEditor
diff --git a/src/beast/app/draw/ListInputEditor.java b/src/beast/app/draw/ListInputEditor.java
new file mode 100644
index 0000000..e49d3be
--- /dev/null
+++ b/src/beast/app/draw/ListInputEditor.java
@@ -0,0 +1,472 @@
+package beast.app.draw;
+
+import javax.imageio.ImageIO;
+import javax.swing.*;
+import javax.swing.event.DocumentEvent;
+import javax.swing.event.DocumentListener;
+
+import beast.app.beauti.BeautiDoc;
+import beast.core.Input;
+import beast.core.BEASTInterface;
+
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+public class ListInputEditor extends InputEditor.Base {
+
+    private static final long serialVersionUID = 1L;
+    static Image DOWN_ICON;
+    static Image RIGHT_ICON;
+
+    {
+        try {
+            java.net.URL downURL = ClassLoader.getSystemResource(ModelBuilder.ICONPATH + "down.png");
+            DOWN_ICON = ImageIO.read(downURL); 
+            java.net.URL leftURL = ClassLoader.getSystemResource(ModelBuilder.ICONPATH + "right.png");
+            RIGHT_ICON = ImageIO.read(leftURL);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    protected ButtonStatus m_buttonStatus = ButtonStatus.ALL;
+
+    /**
+     * buttons for manipulating the list of inputs *
+     */
+    protected SmallButton addButton;
+    protected List<JTextField> m_entries;
+    protected List<SmallButton> delButtonList;
+    protected List<SmallButton> m_editButton;
+    protected List<SmallLabel> m_validateLabels;
+    protected Box m_listBox;
+    protected ExpandOption m_bExpandOption;
+
+    // the box containing any buttons
+    protected Box buttonBox;
+
+    static protected Set<String> g_collapsedIDs = new HashSet<String>();
+    static Set<String> g_initiallyCollapsedIDs = new HashSet<String>();
+
+    public abstract class ActionListenerObject implements ActionListener {
+        public Object m_o;
+
+        public ActionListenerObject(Object o) {
+            super();
+            m_o = o;
+        }
+    }
+
+    public abstract class ExpandActionListener implements ActionListener {
+        Box m_box;
+        BEASTInterface m_plugin;
+
+        public ExpandActionListener(Box box, BEASTInterface plugin) {
+            super();
+            m_box = box;
+            m_plugin = plugin;
+        }
+    }
+
+    //public ListInputEditor() {}
+    public ListInputEditor(BeautiDoc doc) {
+        super(doc);
+        m_entries = new ArrayList<JTextField>();
+        delButtonList = new ArrayList<SmallButton>();
+        m_editButton = new ArrayList<SmallButton>();
+        m_validateLabels = new ArrayList<SmallLabel>();
+        m_bExpandOption = ExpandOption.FALSE;
+        setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
+    }
+
+    @Override
+    public Class<?> type() {
+        return ArrayList.class;
+    }
+
+    /**
+     * return type of the list *
+     */
+    public Class<?> baseType() {
+        return BEASTInterface.class;
+    }
+
+    /**
+     * construct an editor consisting of
+     * o a label
+     * o a button for selecting another plug-in
+     * o a set of buttons for adding, deleting, editing items in the list
+     */
+    @Override
+    public void init(Input<?> input, BEASTInterface plugin, int itemNr, ExpandOption bExpandOption, boolean bAddButtons) {
+        m_bAddButtons = bAddButtons;
+        m_bExpandOption = bExpandOption;
+        m_input = input;
+        m_plugin = plugin;
+        this.itemNr = -1;
+        addInputLabel();
+        if (m_inputLabel != null) {
+            m_inputLabel.setMaximumSize(new Dimension(m_inputLabel.getSize().width, 1000));
+            m_inputLabel.setAlignmentY(1.0f);
+            m_inputLabel.setVerticalAlignment(JLabel.TOP);
+            m_inputLabel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
+        }
+
+        m_listBox = Box.createVerticalBox();
+        // list of inputs 
+        for (Object o : (List<?>) input.get()) {
+            if (o instanceof BEASTInterface) {
+                BEASTInterface plugin2 = (BEASTInterface) o;
+                addSingleItem(plugin2);
+            }
+        }
+
+        setLayout(new BorderLayout());
+        add(m_listBox, BorderLayout.NORTH);
+
+        buttonBox = Box.createHorizontalBox();
+        if (m_buttonStatus == ButtonStatus.ALL || m_buttonStatus == ButtonStatus.ADD_ONLY) {
+            addButton = new SmallButton("+", true);
+            addButton.setName("+");
+            addButton.setToolTipText("Add item to the list");
+            addButton.addActionListener(e -> addItem());
+            buttonBox.add(addButton);
+            if (!doc.isExpertMode()) {
+                // if nothing can be added, make add button invisible
+                List<String> sTabuList = new ArrayList<String>();
+                for (int i = 0; i < m_entries.size(); i++) {
+                    sTabuList.add(m_entries.get(i).getText());
+                }
+                List<String> sPlugins = doc.getInputEditorFactory().getAvailablePlugins(m_input, m_plugin, sTabuList, doc);
+                if (sPlugins.size() == 0) {
+                    addButton.setVisible(false);
+                }
+            }
+        }
+
+        // add validation label at the end of a list
+        m_validateLabel = new SmallLabel("x", new Color(200, 0, 0));
+        if (m_bAddButtons) {
+            buttonBox.add(m_validateLabel);
+            m_validateLabel.setVisible(true);
+            validateInput();
+        }
+        buttonBox.add(Box.createHorizontalGlue());
+        m_listBox.add(buttonBox);
+
+        updateState();
+        
+//        // RRB: is there a better way to ensure lists are not spaced out across all available space?
+//    	JFrame frame = doc.getFrame();
+//    	if (frame != null) {
+//    		m_listBox.add(Box.createVerticalStrut(frame.getHeight() - 150));
+//    	}
+
+    } // init
+
+    protected void addSingleItem(BEASTInterface plugin) {
+        Box itemBox = Box.createHorizontalBox();
+
+        InputEditor editor = addPluginItem(itemBox, plugin);
+        
+        SmallButton editButton = new SmallButton("e", true, SmallButton.ButtonType.square);
+        editButton.setName(plugin.getID() + ".editButton");
+        if (m_bExpandOption == ExpandOption.FALSE || m_bExpandOption == ExpandOption.IF_ONE_ITEM && ((List<?>) m_input.get()).size() > 1) {
+            editButton.setToolTipText("Edit item in the list");
+            editButton.addActionListener(new ActionListenerObject(plugin) {
+                public void actionPerformed(ActionEvent e) {
+                    m_o = editItem(m_o);
+                }
+            });
+        } else {
+            editButton.setText("");
+            editButton.setToolTipText("Expand/collapse item in the list");
+            editButton.setButtonType(SmallButton.ButtonType.toolbar);
+        }
+        m_editButton.add(editButton);
+        itemBox.add(editButton);
+
+
+        SmallLabel validateLabel = new SmallLabel("x", new Color(200, 0, 0));
+        itemBox.add(validateLabel);
+        validateLabel.setVisible(true);
+        m_validateLabels.add(validateLabel);
+
+        // AJD: This is not consistent with Mac OS X look and feel, and its not necessary
+        //itemBox.setBorder(BorderFactory.createEtchedBorder());
+
+        if (m_bExpandOption == ExpandOption.TRUE || m_bExpandOption == ExpandOption.TRUE_START_COLLAPSED ||
+                (m_bExpandOption == ExpandOption.IF_ONE_ITEM && ((List<?>) m_input.get()).size() == 1)) {
+            Box expandBox = Box.createVerticalBox();
+            //box.add(itemBox);
+            doc.getInputEditorFactory().addInputs(expandBox, plugin, editor, null, doc);
+            //System.err.print(expandBox.getComponentCount());
+            if (expandBox.getComponentCount() > 1) {
+                // only go here if it is worth showing expanded box
+                //expandBox.setBorder(BorderFactory.createMatteBorder(1, 5, 1, 1, Color.gray));
+                //itemBox = box;
+                Box box2 = Box.createVerticalBox();
+                box2.add(itemBox);
+                itemBox.add(editButton, 0);
+                box2.add(expandBox);
+//        		expandBox.setVisible(false);
+//        		//itemBox.remove(editButton);
+//        		editButton.setVisible(false);
+//        	} else {
+                itemBox = box2;
+            } else {
+                editButton.setVisible(false);
+            }
+            editButton.addActionListener(new ExpandActionListener(expandBox, plugin) {
+                public void actionPerformed(ActionEvent e) {
+                    SmallButton editButton = (SmallButton) e.getSource();
+                    m_box.setVisible(!m_box.isVisible());
+                    if (m_box.isVisible()) {
+                        try {
+                        editButton.setImg(DOWN_ICON);
+                        }catch (Exception e2) {
+							// TODO: handle exception
+						}
+                        g_collapsedIDs.remove(m_plugin.getID());
+                    } else {
+                    	try {
+                        editButton.setImg(RIGHT_ICON);
+	                    }catch (Exception e2) {
+							// TODO: handle exception
+						}
+                        g_collapsedIDs.add(m_plugin.getID());
+                    }
+                }
+            });
+            String sID = plugin.getID();
+            expandBox.setVisible(!g_collapsedIDs.contains(sID));
+            try {
+            if (expandBox.isVisible()) {
+                editButton.setImg(DOWN_ICON);
+            } else {
+                editButton.setImg(RIGHT_ICON);
+            }
+            } catch (Exception e) {
+				// TODO: handle exception
+			}
+
+
+        } else {
+            if (BEASTObjectPanel.countInputs(plugin, doc) == 0) {
+                editButton.setVisible(false);
+            }
+        }
+
+        if (m_validateLabel == null) {
+            m_listBox.add(itemBox);
+        } else {
+            Component c = m_listBox.getComponent(m_listBox.getComponentCount() - 1);
+            m_listBox.remove(c);
+            m_listBox.add(itemBox);
+            m_listBox.add(c);
+        }
+    } // addSingleItem
+
+    /**
+     * add components to box that are specific for the plugin.
+     * By default, this just inserts a label with the plugin ID
+     *
+     * @param itemBox box to add components to
+     * @param plugin  plugin to add
+     */
+    protected InputEditor addPluginItem(Box itemBox, BEASTInterface plugin) {
+        String sName = plugin.getID();
+        if (sName == null || sName.length() == 0) {
+            sName = plugin.getClass().getName();
+            sName = sName.substring(sName.lastIndexOf('.') + 1);
+        }
+        JLabel label = new JLabel(sName);
+
+        itemBox.add(Box.createRigidArea(new Dimension(5, 1)));
+        itemBox.add(label);
+        itemBox.add(Box.createHorizontalGlue());
+        return this;
+    }
+
+    class IDDocumentListener implements DocumentListener {
+        BEASTInterface m_plugin;
+        JTextField m_entry;
+
+        IDDocumentListener(BEASTInterface plugin, JTextField entry) {
+            m_plugin = plugin;
+            m_entry = entry;
+        }
+
+        @Override
+        public void removeUpdate(DocumentEvent e) {
+            processEntry();
+        }
+
+        @Override
+        public void insertUpdate(DocumentEvent e) {
+            processEntry();
+        }
+
+        @Override
+        public void changedUpdate(DocumentEvent e) {
+            processEntry();
+        }
+
+        void processEntry() {
+            String sOldID = m_plugin.getID();
+            m_plugin.setID(m_entry.getText());
+            BEASTObjectPanel.renamePluginID(m_plugin, sOldID, m_plugin.getID(), doc);
+            validateAllEditors();
+            m_entry.requestFocusInWindow();
+        }
+    }
+
+    protected void addItem() {
+        List<String> sTabuList = new ArrayList<String>();
+        for (int i = 0; i < m_entries.size(); i++) {
+            sTabuList.add(m_entries.get(i).getText());
+        }
+        List<BEASTInterface> plugins = pluginSelector(m_input, m_plugin, sTabuList);
+        if (plugins != null) {
+            for (BEASTInterface plugin : plugins) {
+                try {
+                	setValue(plugin);
+                    //m_input.setValue(plugin, m_plugin);
+                } catch (Exception ex) {
+                    System.err.println(ex.getClass().getName() + " " + ex.getMessage());
+                }
+                addSingleItem(plugin);
+                getDoc().addPlugin(plugin);
+            }
+            validateInput();
+            updateState();
+            repaint();
+        }
+    } // addItem
+
+    protected Object editItem(Object o) {
+        int i = ((List<?>) m_input.get()).indexOf(o);
+        BEASTInterface plugin = (BEASTInterface) ((List<?>) m_input.get()).get(i);
+        BEASTObjectDialog dlg = new BEASTObjectDialog(plugin, m_input.getType(), doc);
+        if (dlg.showDialog()) {
+            //m_labels.get(i).setText(dlg.m_panel.m_plugin.getID());
+            m_entries.get(i).setText(dlg.m_panel.m_plugin.getID());
+            //o = dlg.m_panel.m_plugin;
+            dlg.accept((BEASTInterface) o, doc);
+            refreshPanel();
+        }
+        BEASTObjectPanel.m_position.x -= 20;
+        BEASTObjectPanel.m_position.y -= 20;
+        //checkValidation();
+        validateAllEditors();
+        updateState();
+        doLayout();
+        return o;
+    } // editItem
+
+    protected void deleteItem(Object o) {
+        int i = ((List<?>) m_input.get()).indexOf(o);
+        m_listBox.remove(i);
+        ((List<?>) m_input.get()).remove(i);
+        //safeRemove(m_labels, i);
+        safeRemove(m_entries, i);
+        safeRemove(delButtonList, i);
+        safeRemove(m_editButton, i);
+        safeRemove(m_validateLabels, i);
+        validateInput();
+        updateState();
+        doLayout();
+        repaint();
+    } // deleteItem
+
+    private void safeRemove(List<?> list, int i) {
+        if (list.size() > i) {
+            list.remove(i);
+        }
+    }
+
+    /**
+     * Select existing plug-in, or create a new one.
+     * Suppress existing plug-ins with IDs from the taboo list.
+     * Return null if nothing is selected.
+     */
+    protected List<BEASTInterface> pluginSelector(Input<?> input, BEASTInterface parent, List<String> tabooList) {
+        List<BEASTInterface> selectedPlugins = new ArrayList<BEASTInterface>();
+        List<String> sPlugins = doc.getInputEditorFactory().getAvailablePlugins(input, parent, tabooList, doc);
+        /* select a plugin **/
+        String sClassName = null;
+        if (sPlugins.size() == 1) {
+            // if there is only one candidate, select that one
+            sClassName = sPlugins.get(0);
+        } else if (sPlugins.size() == 0) {
+            // no candidate => we cannot be in expert mode
+            // create a new Plugin
+            doc.setExpertMode(true);
+            sPlugins = doc.getInputEditorFactory().getAvailablePlugins(input, parent, tabooList, doc);
+            doc.setExpertMode(false);
+            sClassName = sPlugins.get(0);
+        } else {
+            // otherwise, pop up a list box
+            sClassName = (String) JOptionPane.showInputDialog(null,
+                    "Select a constant", "select",
+                    JOptionPane.PLAIN_MESSAGE, null,
+                    sPlugins.toArray(new String[0]),
+                    null);
+            if (sClassName == null) {
+                return null;
+            }
+        }
+        if (!sClassName.startsWith("new ")) {
+            /* return existing plugin */
+            selectedPlugins.add(doc.pluginmap.get(sClassName));
+            return selectedPlugins;
+        }
+        /* create new plugin */
+        try {
+            BEASTInterface plugin = (BEASTInterface) Class.forName(sClassName.substring(4)).newInstance();
+            BEASTObjectPanel.addPluginToMap(plugin, doc);
+            selectedPlugins.add(plugin);
+            return selectedPlugins;
+        } catch (Exception ex) {
+            JOptionPane.showMessageDialog(null, "Could not select plugin: " +
+                    ex.getClass().getName() + " " +
+                    ex.getMessage()
+            );
+            return null;
+        }
+    } // pluginSelector
+
+    protected void updateState() {
+        for (int i = 0; i < ((List<?>) m_input.get()).size(); i++) {
+            try {
+                BEASTInterface plugin = (BEASTInterface) ((List<?>) m_input.get()).get(i);
+                plugin.validateInputs();
+                m_validateLabels.get(i).setVisible(false);
+            } catch (Exception e) {
+                if (m_validateLabels.size() > i) {
+                    m_validateLabels.get(i).setToolTipText(e.getMessage());
+                    m_validateLabels.get(i).setVisible(true);
+                }
+            }
+        }
+        validateInput();
+        // this triggers properly re-layouting after an edit action
+        setVisible(false);
+        setVisible(true);
+    } // updateState
+
+    @Override
+    public void startValidating(ValidationStatus state) {
+        updateState();
+    }
+
+    public void setButtonStatus(ButtonStatus buttonStatus) {
+        m_buttonStatus = buttonStatus;
+    }
+
+} // class ListPluginInputEditor
diff --git a/src/beast/app/draw/ModelBuilder.java b/src/beast/app/draw/ModelBuilder.java
new file mode 100644
index 0000000..d243c1a
--- /dev/null
+++ b/src/beast/app/draw/ModelBuilder.java
@@ -0,0 +1,2157 @@
+/*
+ * File ModelBuilder.java
+ *
+ * Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+ *
+ * This file is part of BEAST2.
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership and licensing.
+ *
+ * BEAST 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
+ * of the License, or (at your option) any later version.
+ *
+ *  BEAST 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 BEAST; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+package beast.app.draw;
+
+
+
+import javax.imageio.ImageIO;
+import javax.swing.*;
+import javax.swing.filechooser.FileFilter;
+
+import beast.app.util.Utils;
+import beast.core.BEASTObject;
+import beast.core.BEASTInterface;
+import beast.evolution.alignment.Sequence;
+import beast.util.AddOnManager;
+import beast.util.Randomizer;
+import beast.util.XMLProducer;
+
+
+//import com.itextpdf.awt.PdfGraphics2D;
+//import com.itextpdf.text.pdf.PdfContentByte;
+//import com.itextpdf.text.pdf.PdfWriter;
+
+import java.awt.*;
+import java.awt.event.*;
+import java.awt.image.BufferedImage;
+import java.awt.print.PageFormat;
+import java.awt.print.Printable;
+import java.awt.print.PrinterException;
+import java.awt.print.PrinterJob;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * program for drawing BEAST 2.0 models *
+ */
+
+public class ModelBuilder extends JPanel implements ComponentListener {
+    /**
+     * for serialisation
+     */
+    static final long serialVersionUID = 1L;
+
+    /**
+     * File extension for XML format containing all graphical details (colour,
+     * position, etc) NB This is not the extension for GenerationD model files.
+     */
+    static public final String FILE_EXT = ".xml";
+    final public static String ICONPATH = "beast/app/draw/icons/";
+
+    /**
+     * contains the Panel
+     */
+    JScrollPane m_jScrollPane;
+    public DrawPanel g_panel;
+
+    final static int MODE_SELECT = 0;
+    final static int MODE_MOVE = 1;
+    final static int MODE_ARROW = 7;
+
+    final static int MODE_FUNCTION = 9;
+
+    Shape m_drawShape = null;
+    Rectangle m_selectRect = null;
+    int m_nMode = MODE_SELECT;
+
+    boolean m_bViewOperators = true;
+    boolean m_bViewLoggers = true;
+    boolean m_bViewSequences = true;
+    boolean m_bViewState = true;
+
+    //	boolean m_bViewOperators = false;
+//	boolean m_bViewLoggers = false;
+//	boolean m_bViewSequences = false;
+//	boolean m_bViewState = false;
+    boolean m_bRelax = false;
+
+    // flag to indicate the model can be edited.
+    // set to false for read only view of the model, e.g. from beauti
+    boolean m_bIsEditable = true;
+    
+
+    public void setEditable(boolean bIsEditable) {
+        m_bIsEditable = bIsEditable;
+    }
+
+    /**
+     * number of seconds to 'relax' after loading a file *
+     */
+    int m_nRelaxSeconds = 10;
+    /**
+     * menu item indicating whether to relax or not *
+     */
+    JCheckBoxMenuItem m_viewRelax;
+
+    Action a_new = new ActionNew();
+    Action a_load = new ActionLoad();
+    Action a_save = new ActionSave();
+    Action a_saveas = new ActionSaveAs();
+    ActionExport a_export = new ActionExport();
+    ActionPrint a_print = new ActionPrint();
+    Action a_quit = new ActionQuit();
+
+    Action a_undo = new ActionUndo();
+    Action a_redo = new ActionRedo();
+    Action a_selectall = new ActionSelectAll();
+    Action a_delnode = new ActionDeleteNode();
+    Action a_cutnode = new ActionCutNode();
+    Action a_copynode = new ActionCopyNode();
+    Action a_pastenode = new ActionPasteNode();
+    Action a_group = new ActionCollapse();
+    // Action a_ungroup = new ActionUngroup();
+
+    Action a_select = new ActionSelect();
+    Action a_arrow = new ActionArrow();
+    Action a_function = new ActionFunction();
+
+    Action a_fillcolor = new ActionFillColor();
+    Action a_pencolor = new ActionPenColor();
+    Action a_tofront = new ActionToFront();
+    Action a_forward = new ActionForward();
+    Action a_toback = new ActionToBack();
+    Action a_backward = new ActionBackward();
+
+    Action a_alignleft = new ActionAlignLeft();
+    Action a_alignright = new ActionAlignRight();
+    Action a_aligntop = new ActionAlignTop();
+    Action a_alignbottom = new ActionAlignBottom();
+    Action a_centerhorizontal = new ActionCenterHorizontal();
+    Action a_centervertical = new ActionCenterVertical();
+    Action a_spacehorizontal = new ActionSpaceHorizontal();
+    Action a_spacevertical = new ActionSpaceVertical();
+
+    Action a_about = new ActionAbout();
+
+    Action a_relax = new ActionRelax();
+    Action a_viewOperators = new ActionViewOperators();
+    Action a_viewLoggers = new ActionViewLoggers();
+    Action a_viewSequences = new ActionViewSequences();
+    Action a_layout = new ActionLayout();
+
+
+    ClipBoard m_clipboard = new ClipBoard();
+    /**
+     * name of current file, used for saving (as opposed to saveAs) *
+     */
+    String m_sFileName = "";
+    /**
+     * the document in the model/view pattern *
+     */
+    public Document m_doc = new Document();
+    /**
+     * current directory for opening files *
+     */
+    String m_sDir = System.getProperty("user.dir");
+
+    public ModelBuilder() {
+
+    } // GBDraw c'tor
+
+    class ClipBoard {
+        String m_sText = null;
+
+        public ClipBoard() {
+            if (a_pastenode != null) {
+                a_pastenode.setEnabled(false);
+            }
+        }
+
+        public boolean hasText() {
+            return m_sText != null;
+        }
+
+        public String getText() {
+            return m_sText;
+        }
+
+        public void setText(String sText) {
+            m_sText = sText;
+            a_pastenode.setEnabled(true);
+        }
+    } // class ClipBoard
+
+    Selection m_Selection = new Selection();
+
+
+    ExtensionFileFilter ef1 = new ExtensionFileFilter(".xml", "BEAST files");
+    ExtensionFileFilter ef2 = new ExtensionFileFilter(".gif", "GIF images");
+    ExtensionFileFilter ef3 = new ExtensionFileFilter(".jpg", "JPG images");
+    ExtensionFileFilter ef4 = new ExtensionFileFilter(".bmp", "BMP images");
+    ExtensionFileFilter ef5 = new ExtensionFileFilter(".png", "PNG images");
+
+    boolean validateModel() {
+        int nStatus = m_doc.isValidModel();
+        if (nStatus == Document.STATUS_OK) {
+            return true;
+        }
+        String sMsg = "<html>Document is not valid: ";
+        switch (nStatus) {
+            case Document.STATUS_CYCLE:
+                sMsg += "there is a cycle in the model.";
+                break;
+            case Document.STATUS_EMPTY_MODEL:
+                sMsg += "The model is empty, there is nothing to save.";
+                break;
+            case Document.STATUS_NOT_RUNNABLE:
+                sMsg += "there is no top level runnable item in the model (e.g. an MCMC node).";
+                break;
+            case Document.STATUS_ORPHANS_IN_MODEL:
+                sMsg += "there are orphaned items in the model (i.e. plugins that have no parents).";
+                break;
+        }
+        sMsg += "<br>Do you still want to try to save the model?</html>";
+        if (JOptionPane.showConfirmDialog(this, sMsg, "Model not valid",
+                JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
+            return true;
+        }
+        return false;
+    }
+
+    class ActionSave extends MyAction {
+        /**
+         * for serialisation
+         */
+        private static final long serialVersionUID = -20389110859355156L;
+
+        public ActionSave() {
+            super("Save", "Save Graph", "save", KeyEvent.VK_S);
+        } // c'tor
+
+        public ActionSave(String sName, String sToolTipText, String sIcon,
+                          int acceleratorKey) {
+            super(sName, sToolTipText, sIcon, acceleratorKey);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            if (!m_sFileName.equals("")) {
+                if (!validateModel()) {
+                    return;
+                }
+                saveFile(m_sFileName);
+                m_doc.isSaved();
+            } else {
+                if (saveAs()) {
+                    m_doc.isSaved();
+                }
+            }
+        } // actionPerformed
+
+        boolean saveAs() {
+            if (!validateModel()) {
+                return false;
+            }
+            JFileChooser fc = new JFileChooser(m_sDir);
+            fc.addChoosableFileFilter(ef1);
+            fc.setDialogTitle("Save Model As");
+            if (!m_sFileName.equals("")) {
+                // can happen on actionQuit
+                fc.setSelectedFile(new File(m_sFileName));
+            }
+            int rval = fc.showSaveDialog(g_panel);
+
+            if (rval == JFileChooser.APPROVE_OPTION) {
+                // System.out.println("Saving to file \""+
+                // f.getAbsoluteFile().toString()+"\"");
+                String sFileName = fc.getSelectedFile().toString();
+                if (sFileName.lastIndexOf('/') > 0) {
+                    m_sDir = sFileName.substring(0, sFileName.lastIndexOf('/'));
+                }
+                if (!sFileName.endsWith(FILE_EXT))
+                    sFileName = sFileName.concat(FILE_EXT);
+                saveFile(sFileName);
+                return true;
+            }
+            return false;
+        } // saveAs
+
+        protected void saveFile(String sFileName) {
+            try {
+                FileWriter outfile = new FileWriter(sFileName);
+                outfile.write(m_doc.toXML());
+                outfile.close();
+                m_sFileName = sFileName;
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        } // saveFile
+    } // class ActionSave
+
+    class ActionPrint extends ActionSave {
+        /**
+         * for serialisation
+         */
+        private static final long serialVersionUID = -20389001859354L;
+        boolean m_bIsPrinting = false;
+
+        public ActionPrint() {
+            super("Print", "Print Graph", "print", KeyEvent.VK_P);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            PrinterJob printJob = PrinterJob.getPrinterJob();
+            printJob.setPrintable(g_panel);
+            if (printJob.printDialog())
+                try {
+                    m_bIsPrinting = true;
+                    printJob.print();
+                    m_bIsPrinting = false;
+                } catch (PrinterException pe) {
+                    m_bIsPrinting = false;
+                }
+        } // actionPerformed
+
+        public boolean isPrinting() {
+            return m_bIsPrinting;
+        }
+
+    } // class ActionPrint
+
+    class ActionSaveAs extends ActionSave {
+        /**
+         * for serialisation
+         */
+        private static final long serialVersionUID = -20389110859354L;
+
+        public ActionSaveAs() {
+            super("Save As", "Save Graph As", "saveas", -1);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            saveAs();
+        } // actionPerformed
+    } // class ActionSaveAs
+
+    abstract class MyFileFilter extends FileFilter {
+        public boolean accept(File f) {
+            return f.isDirectory()
+                    || f.getName().toLowerCase().endsWith(getExtention());
+        }
+
+        abstract public String getExtention();
+    }
+
+    class ActionExport extends MyAction {
+        boolean m_bIsExporting = false;
+        /**
+         * for serialisation
+         */
+        private static final long serialVersionUID = -3027642085935519L;
+
+        public ActionExport() {
+            super("Export", "Export to graphics file", "export", -1);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            m_bIsExporting = true;
+
+//            JFileChooser fc = new JFileChooser(m_sDir);
+//            fc.addChoosableFileFilter(new MyFileFilter() {
+//                public String getExtention() {
+//                    return ".bmp";
+//                }
+//
+//                public String getDescription() {
+//                    return "Bitmap files (*.bmp)";
+//                }
+//            });
+//            fc.addChoosableFileFilter(new MyFileFilter() {
+//                public String getExtention() {
+//                    return ".jpg";
+//                }
+//
+//                public String getDescription() {
+//                    return "JPEG bitmap files (*.jpg)";
+//                }
+//            });
+//            fc.addChoosableFileFilter(new MyFileFilter() {
+//                public String getExtention() {
+//                    return ".png";
+//                }
+//
+//                public String getDescription() {
+//                    return "PNG bitmap files (*.png)";
+//                }
+//            });
+//            fc.setDialogTitle("Export Image As");
+//            int rval = fc.showSaveDialog(g_panel);
+//            if (rval == JFileChooser.APPROVE_OPTION) {
+//	            String sFileName = fc.getSelectedFile().toString();
+            try {
+
+                File file = Utils.getSaveFile("Export image (type determined by extention)", new File(m_sDir), "Image files", "png", "bmp", "jpg", "svg", "pdf");
+
+                if (file != null) {
+                    String sFileName = file.getAbsolutePath();
+                    if (sFileName.lastIndexOf('/') > 0) {
+                        m_sDir = sFileName.substring(0, sFileName.lastIndexOf('/'));
+                    }
+                    if (sFileName != null && !sFileName.equals("")) {
+//                    if (!sFileName.toLowerCase().endsWith(".png")
+//                            && sFileName.toLowerCase().endsWith(".jpg")
+//                            && sFileName.toLowerCase().endsWith(".bmp")
+//                            && sFileName.toLowerCase().endsWith(".svg")) {
+//                        sFileName += ((MyFileFilter) fc.getFileFilter())
+//                                .getExtention();
+//                    }
+
+                        if (sFileName.toLowerCase().endsWith(".pdf")) {
+                        	JOptionPane.showMessageDialog(null, "Not implemented yet");
+//                        	com.itextpdf.text.Document doc = new com.itextpdf.text.Document();
+//                        	PdfWriter writer = PdfWriter.getInstance(doc, new FileOutputStream(sFileName));
+//                        	doc.setPageSize(new com.itextpdf.text.Rectangle(g_panel.getWidth(), g_panel.getHeight()));
+//                        	doc.open();
+//                        	PdfContentByte cb = writer.getDirectContent();
+//                        	Graphics2D g2d = new PdfGraphics2D(cb, g_panel.getWidth(), g_panel.getHeight());
+//                        	 
+//                        	g_panel.paint(g2d);
+//
+//                        	g2d.dispose();
+//                        	doc.close();
+                            m_bIsExporting = false;
+                            repaint();
+                        	return;
+                        } else if (sFileName.toLowerCase().endsWith(".png")
+                                || sFileName.toLowerCase().endsWith(".jpg")
+                                || sFileName.toLowerCase().endsWith(".bmp")) {
+                            BufferedImage bi;
+                            Graphics g;
+                            bi = new BufferedImage(g_panel.getWidth(), g_panel
+                                    .getHeight(), BufferedImage.TYPE_INT_RGB);
+                            g = bi.getGraphics();
+                            g.setPaintMode();
+                            g.setColor(getBackground());
+                            g.fillRect(0, 0, g_panel.getWidth(), g_panel
+                                    .getHeight());
+                            g_panel.printAll(g);
+                            try {
+                                if (sFileName.toLowerCase().endsWith(".png")) {
+                                    ImageIO.write(bi, "png", new File(sFileName));
+                                } else if (sFileName.toLowerCase().endsWith(".jpg")) {
+                                    ImageIO.write(bi, "jpg", new File(sFileName));
+                                } else if (sFileName.toLowerCase().endsWith(".bmp")) {
+                                    ImageIO.write(bi, "bmp", new File(sFileName));
+                                }
+                            } catch (Exception e) {
+                                JOptionPane.showMessageDialog(null, sFileName
+                                        + " was not written properly: "
+                                        + e.getMessage());
+                                e.printStackTrace();
+                            }
+                            m_bIsExporting = false;
+                            repaint();
+                            return;
+                        } else if (sFileName.toLowerCase().endsWith(".svg")) {
+                            writeSVG(sFileName);
+                            m_bIsExporting = false;
+                            repaint();
+                            return;
+                        }
+                        JOptionPane.showMessageDialog(null, "Extention of file "
+                                + sFileName
+                                + " not recognized as png,bmp,jpg or svg file");
+                    }
+                }
+            } catch (Exception e) {
+                JOptionPane.showMessageDialog(null, "Something went wrong while exporting image: " + e.getMessage());
+            }
+
+            m_bIsExporting = false;
+            repaint();
+        }
+
+        private void writeSVG(String sFileName) throws Exception {
+            PrintStream out = new PrintStream(sFileName);
+            out.println("<?xml version='1.0'?>\n" + "<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN'\n"
+                    + "  'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'>\n"
+                    + "<svg xmlns='http://www.w3.org/2000/svg' version='1.1'\n" + "      width='" + getWidth()
+                    + "' height='" + getHeight() + "' viewBox='0 0 " + getWidth() + " " + getHeight() + "'>\n"
+                    + "<rect fill='#fff' width='" + getWidth() + "' height='" + getHeight() + "'/>");
+            for (Shape shape : m_doc.m_objects) {
+                shape.toSVG(out);
+            }
+            out.println("</svg>");
+        }
+
+        public boolean isExporting() {
+            return m_bIsExporting;
+        }
+    } // class ActionExport
+
+    class ActionQuit extends ActionSave {
+        /**
+         * for serialisation
+         */
+        private static final long serialVersionUID = -2038911085935515L;
+
+        public ActionQuit() {
+            super("Exit", "Exit Program", "exit", KeyEvent.VK_F4);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            if (!m_doc.m_bIsSaved) {
+                int result = JOptionPane.showConfirmDialog(null,
+                        "Drawing changed. Do you want to save it?",
+                        "Save before closing?",
+                        JOptionPane.YES_NO_CANCEL_OPTION);
+                if (result == JOptionPane.CANCEL_OPTION) {
+                    return;
+                }
+                if (result == JOptionPane.YES_OPTION) {
+                    if (!saveAs()) {
+                        return;
+                    }
+                }
+            }
+            System.exit(0);
+        }
+    } // class ActionQuit
+
+    class ActionNew extends MyAction {
+        /**
+         * for serialisation
+         */
+        private static final long serialVersionUID = -2038911085935515L;
+
+        public ActionNew() {
+            super("New", "New Network", "new", -1);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            m_sFileName = "";
+            m_doc = new Document();
+            m_Selection.setDocument(m_doc);
+            updateStatus();
+            m_doc.clearUndoStack();
+            m_Selection.clear();
+            m_drawShape = null;
+        }
+    } // class ActionNew
+
+    class ActionLoad extends MyAction {
+        /**
+         * for serialisation
+         */
+        private static final long serialVersionUID = -2038911085935515L;
+
+        public ActionLoad() {
+            super("Load", "Load Graph", "open", KeyEvent.VK_O);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            JFileChooser fc = new JFileChooser(m_sDir);
+            fc.addChoosableFileFilter(ef1);
+            fc.setDialogTitle("Load Graph");
+            int rval = fc.showOpenDialog(g_panel);
+
+            if (rval == JFileChooser.APPROVE_OPTION) {
+                String sFileName = fc.getSelectedFile().toString();
+                if (sFileName.lastIndexOf('/') > 0) {
+                    m_sDir = sFileName.substring(0, sFileName.lastIndexOf('/'));
+                }
+                g_panel.setCursor(new Cursor(Cursor.WAIT_CURSOR));
+                m_doc.loadFile(sFileName);
+                m_sFileName = sFileName;
+                g_panel.repaint();
+                try {
+                    Thread.sleep(1000);
+                } catch (Exception e) {
+                }
+                setDrawingFlag();
+                g_panel.repaint();
+                g_panel.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
+            }
+        }
+    } // class ActionLoad
+
+    class ActionUndo extends MyAction {
+        /**
+         * for serialisation
+         */
+        private static final long serialVersionUID = -3038910085935519L;
+
+        public ActionUndo() {
+            super("Undo", "Undo", "undo", KeyEvent.VK_Z);
+            setEnabled(false);
+        } // c'tor
+
+        public boolean isEnabled() {
+            return m_doc.canUndo();
+        }
+
+        public void actionPerformed(ActionEvent ae) {
+            m_doc.undo();
+            m_Selection.clear();
+            setDrawingFlag();
+            updateStatus();
+        }
+    } // ActionUndo
+
+    class ActionRedo extends MyAction {
+        /**
+         * for serialisation
+         */
+        private static final long serialVersionUID = -4038910085935519L;
+
+        public ActionRedo() {
+            super("Redo", "Redo", "redo", KeyEvent.VK_Y);
+            setEnabled(false);
+        } // c'tor
+
+        public boolean isEnabled() {
+            return m_doc.canRedo();
+        }
+
+        public void actionPerformed(ActionEvent ae) {
+            m_doc.redo();
+            m_Selection.clear();
+            setDrawingFlag();
+            updateStatus();
+        }
+    } // ActionRedo
+
+    class ActionSelectAll extends MyAction {
+        /**
+         * for serialisation
+         */
+        private static final long serialVersionUID = -2038912085935519L;
+
+        public ActionSelectAll() {
+            super("Select All", "Select All", "selectall", KeyEvent.VK_A);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            m_Selection.clear();
+            for (int i = 0; i < m_doc.m_objects.size(); i++) {
+                if (m_doc.m_objects.get(i).m_bNeedsDrawing) {
+                    m_Selection.m_Selection.add(new Integer(i));
+                }
+            }
+            m_Selection.refreshTracker();
+            updateStatus();
+        }
+    } // class ActionSelectAll
+
+    class ActionDeleteNode extends MyAction {
+        /**
+         * for serialisation
+         */
+        private static final long serialVersionUID = -2038912085935519L;
+
+        public ActionDeleteNode() {
+            super("Delete Node", "Delete Node", "delnode", KeyEvent.VK_DELETE);
+            setEnabled(false);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            m_doc.deleteShapes(m_Selection.m_Selection);
+            m_Selection.clear();
+            updateStatus();
+        }
+    } // class ActionDeleteNode
+
+    class ActionCopyNode extends MyAction {
+        /**
+         * for serialisation
+         */
+        private static final long serialVersionUID = -2038732085935519L;
+
+        public ActionCopyNode() {
+            super("Copy", "Copy Nodes", "copy", KeyEvent.VK_C);
+            setEnabled(false);
+        } // c'tor
+
+        public ActionCopyNode(String sName, String sToolTipText, String sIcon,
+                              int acceleratorKey) {
+            super(sName, sToolTipText, sIcon, acceleratorKey);
+        } // c'rot
+
+        public void actionPerformed(ActionEvent ae) {
+            copy();
+        }
+
+        public void copy() {
+            if (m_Selection.hasSelection()) {
+                String sXML = "<doc>\n";
+                for (int i : m_Selection.m_Selection) {
+                    sXML += m_doc.m_objects.get(i).getXML() + "\n";
+                }
+                sXML += "</doc>\n";
+                m_clipboard.setText(sXML);
+            }
+        } // copy
+    } // class ActionCopyNode
+
+    class ActionCutNode extends ActionCopyNode {
+        /**
+         * for serialisation
+         */
+        private static final long serialVersionUID = -2038822085935519L;
+
+        public ActionCutNode() {
+            super("Cut", "Cut Nodes", "cut", KeyEvent.VK_X);
+            setEnabled(false);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            copy();
+            m_doc.deleteShapes(m_Selection.m_Selection);
+            m_Selection.clear();
+            updateStatus();
+        }
+    } // class ActionCutNode
+
+    class ActionPasteNode extends MyAction {
+        /**
+         * for serialisation
+         */
+        private static final long serialVersionUID = -2038732085935519L;
+
+        public ActionPasteNode() {
+            super("Paste", "Paste Nodes", "paste", KeyEvent.VK_V);
+            setEnabled(false);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            try {
+                m_doc.pasteShape(m_clipboard.getText());
+                updateStatus();
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+
+        public boolean isEnabled() {
+            return m_clipboard.hasText();
+        }
+    } // class ActionPasteNode
+
+    class ActionCollapse extends MyAction {
+        private static final long serialVersionUID = -1;
+
+        public ActionCollapse() {
+            super("Collapse shapes", "Collapse", "collapse", -1);
+            KeyStroke keyStroke = KeyStroke.getKeyStroke("G");
+            putValue(Action.ACCELERATOR_KEY, keyStroke);
+            setEnabled(false);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            m_doc.collapse(m_Selection);
+            m_Selection.refreshTracker();
+            updateStatus();
+        }
+    } // class ActionGroup
+    // class ActionUngroup extends MyAction {
+    // private static final long serialVersionUID = -1;
+    // public ActionUngroup() {
+    // super("Ungroup shapes", "Ungroup", "ungroup", "Ctrl G");
+    // setEnabled(false);
+    // } // c'tor
+    // public void actionPerformed(ActionEvent ae) {
+    // m_doc.ungroup(m_Selection);
+    // m_Selection.refreshTracker();
+    // updateStatus();
+    // }
+    // } // class ActionUngroup
+
+    class ActionSelect extends MyAction {
+        private static final long serialVersionUID = -1;
+
+        public ActionSelect() {
+            super("Select", "Select", "select", -1);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            m_nMode = MODE_SELECT;
+        }
+    } // class ActionSelect
+
+    class ActionArrow extends MyAction {
+        private static final long serialVersionUID = -1;
+
+        public ActionArrow() {
+            super("Arrow", "Arrow", "arrow", -1);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            m_nMode = MODE_ARROW;
+        }
+    } // class ActionArrow
+
+    class ActionFunction extends MyAction {
+        private static final long serialVersionUID = -1;
+
+        public ActionFunction() {
+            super("Function", "Function", "function", -1);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            m_nMode = MODE_FUNCTION;
+        }
+    } // class ActionFunction
+
+    class ActionFillColor extends MyAction {
+        private static final long serialVersionUID = -1;
+
+        public ActionFillColor() {
+            super("Fill color", "Fill color", "fillcolor", -1);
+            setEnabled(false);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            Shape shape = (Shape) m_doc.m_objects.get(m_Selection
+                    .getSingleSelection());
+            Color color = JColorChooser.showDialog(g_panel,
+                    "Select Fill color", shape.getFillColor());
+            if (color != null) {
+                m_doc.setFillColor(color, m_Selection);
+                g_panel.repaint();
+            }
+        }
+    } // class ActionFillColor
+
+    class ActionPenColor extends MyAction {
+        private static final long serialVersionUID = -1;
+
+        public ActionPenColor() {
+            super("Pen color", "Pen color", "pencolor", -1);
+            setEnabled(false);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            Shape shape = (Shape) m_doc.m_objects.get(m_Selection
+                    .getSingleSelection());
+            Color color = JColorChooser.showDialog(g_panel,
+                    "Select Fill color", shape.getFillColor());
+            if (color != null) {
+                m_doc.setPenColor(color, m_Selection);
+                g_panel.repaint();
+            }
+
+        }
+    } // class ActionPenColor
+
+    class ActionToFront extends MyAction {
+        /**
+         * for serialisation
+         */
+        private static final long serialVersionUID = -1;
+
+        public ActionToFront() {
+            super("Bring to front", "To front", "tofront", KeyEvent.VK_PLUS);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            m_doc.toFront(m_Selection);
+            g_panel.repaint();
+        }
+    } // class ActionToFront
+
+    class ActionForward extends MyAction {
+        /**
+         * for serialisation
+         */
+        private static final long serialVersionUID = -1;
+
+        public ActionForward() {
+            super("Bring forward", "Forward", "forward", -1);
+            KeyStroke keyStroke = KeyStroke.getKeyStroke("plus");
+            putValue(Action.ACCELERATOR_KEY, keyStroke);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            m_doc.forward(m_Selection);
+            g_panel.repaint();
+        }
+    } // class ActionForward
+
+    class ActionToBack extends MyAction {
+        /**
+         * for serialisation
+         */
+        private static final long serialVersionUID = -1;
+
+        public ActionToBack() {
+            super("Bring to back", "To back", "toback", KeyEvent.VK_MINUS);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            m_doc.toBack(m_Selection);
+            g_panel.repaint();
+        }
+    } // class ActionToBack
+
+    class ActionBackward extends MyAction {
+        /**
+         * for serialisation
+         */
+        private static final long serialVersionUID = -1;
+
+        public ActionBackward() {
+            super("Bring backward", "Backward", "backward", -1);
+            KeyStroke keyStroke = KeyStroke.getKeyStroke("minus");
+            putValue(Action.ACCELERATOR_KEY, keyStroke);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            m_doc.backward(m_Selection);
+            g_panel.repaint();
+        }
+    } // class ActionBackward
+
+    class ActionAlignLeft extends MyAction {
+        /**
+         * for serialisation
+         */
+        private static final long serialVersionUID = -3138642085935519L;
+
+        public ActionAlignLeft() {
+            super("Align Left", "Align Left", "alignleft", -1);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            m_doc.alignLeft(m_Selection);
+            m_Selection.refreshTracker();
+            updateStatus();
+        }
+    } // class ActionAlignLeft
+
+    class ActionAlignRight extends MyAction {
+        /**
+         * for serialisation
+         */
+        private static final long serialVersionUID = -4238642085935519L;
+
+        public ActionAlignRight() {
+            super("Align Right", "Align Right", "alignright", -1);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            m_doc.alignRight(m_Selection);
+            m_Selection.refreshTracker();
+            updateStatus();
+        }
+    } // class ActionAlignRight
+
+    class ActionAlignTop extends MyAction {
+        /**
+         * for serialisation
+         */
+        private static final long serialVersionUID = -5338642085935519L;
+
+        public ActionAlignTop() {
+            super("Align Top", "Align Top", "aligntop", -1);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            m_doc.alignTop(m_Selection);
+            m_Selection.refreshTracker();
+            updateStatus();
+        }
+    } // class ActionAlignTop
+
+    class ActionAlignBottom extends MyAction {
+        /**
+         * for serialisation
+         */
+        private static final long serialVersionUID = -6438642085935519L;
+
+        public ActionAlignBottom() {
+            super("Align Bottom", "Align Bottom", "alignbottom", -1);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            m_doc.alignBottom(m_Selection);
+            m_Selection.refreshTracker();
+            updateStatus();
+        }
+    } // class ActionAlignBottom
+
+    class ActionCenterHorizontal extends MyAction {
+        /**
+         * for serialisation
+         */
+        private static final long serialVersionUID = -7538642085935519L;
+
+        public ActionCenterHorizontal() {
+            super("Center Horizontal", "Center Horizontal", "centerhorizontal",
+                    -1);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            m_doc.centreHorizontal(m_Selection);
+            m_Selection.refreshTracker();
+            updateStatus();
+        }
+    } // class ActionCenterHorizontal
+
+    class ActionCenterVertical extends MyAction {
+        /**
+         * for serialisation
+         */
+        private static final long serialVersionUID = -8638642085935519L;
+
+        public ActionCenterVertical() {
+            super("Center Vertical", "Center Vertical", "centervertical", -1);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            m_doc.centreVertical(m_Selection);
+            m_Selection.refreshTracker();
+            updateStatus();
+        }
+    } // class ActionCenterVertical
+
+    class ActionSpaceHorizontal extends MyAction {
+        /**
+         * for serialisation
+         */
+        private static final long serialVersionUID = -9738642085935519L;
+
+        public ActionSpaceHorizontal() {
+            super("Space Horizontal", "Space Horizontal", "spacehorizontal", -1);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            m_doc.spaceHorizontal(m_Selection);
+            m_Selection.refreshTracker();
+            updateStatus();
+        }
+    } // class ActionSpaceHorizontal
+
+    class ActionSpaceVertical extends MyAction {
+        /**
+         * for serialisation
+         */
+        private static final long serialVersionUID = -838642085935519L;
+
+        public ActionSpaceVertical() {
+            super("Space Vertical", "Space Vertical", "spacevertical", -1);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            m_doc.spaceVertical(m_Selection);
+            m_Selection.refreshTracker();
+            updateStatus();
+        }
+    } // class ActionSpaceVertical
+
+    class ActionAbout extends MyAction {
+        /**
+         * for serialisation
+         */
+        private static final long serialVersionUID = -20389110859353L;
+
+        public ActionAbout() {
+            super("About", "Help about", "about", -1);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            JOptionPane
+                    .showMessageDialog(
+                            null,
+                            "GenerationD Draw Tool\nRemco Bouckaert\nrrb at xm.co.nz\n2010",
+                            "About Message", JOptionPane.PLAIN_MESSAGE);
+        }
+    } // class ActionAbout
+
+
+    class ActionRelax extends MyAction {
+        private static final long serialVersionUID = -1;
+
+        public ActionRelax() {
+            super("Relax", "Relax positions", "about", -1);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            m_bRelax = !m_bRelax;
+            m_viewRelax.setState(m_bRelax);
+            g_panel.repaint();
+        }
+    } // class ActionRelax
+
+    class ActionViewLoggers extends MyAction {
+        private static final long serialVersionUID = -1;
+
+        public ActionViewLoggers() {
+            super("View loggers", "View loggers", "about", -1);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            m_bViewLoggers = !m_bViewLoggers;
+            setDrawingFlag();
+            g_panel.repaint();
+        }
+    } // class ActionViewLoggers
+
+    class ActionViewOperators extends MyAction {
+        private static final long serialVersionUID = -1;
+
+        public ActionViewOperators() {
+            super("View Operators", "View Operators", "viewoperators", -1);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            m_bViewOperators = !m_bViewOperators;
+            setDrawingFlag();
+            g_panel.repaint();
+        }
+    } // class ActionViewOperators
+
+    class ActionViewSequences extends MyAction {
+        private static final long serialVersionUID = -1;
+
+        public ActionViewSequences() {
+            super("View Sequences", "View Sequences", "viewsequences", -1);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent ae) {
+            m_bViewSequences = !m_bViewSequences;
+            setDrawingFlag();
+            g_panel.repaint();
+        }
+    } // class ActionViewSequences
+
+    class ActionLayout extends MyAction {
+        private static final long serialVersionUID = -1;
+
+        public ActionLayout() {
+            super("Layout", "Layout graph", "layout", -1);
+        } // c'tor
+
+        public void actionPerformed(ActionEvent e) {
+            g_panel.setCursor(new Cursor(Cursor.WAIT_CURSOR));
+            m_doc.layout();
+            m_doc.adjustArrows();
+            g_panel.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
+            repaint();
+            g_panel.repaint();
+        }
+    } // class ActionViewSequences
+
+
+    void updateStatus() {
+        a_undo.setEnabled(m_doc.canUndo());
+        a_redo.setEnabled(m_doc.canRedo());
+        int nSelectionSize = m_Selection.m_Selection.size();
+        boolean hasSelection = (nSelectionSize > 0);
+        boolean hasGroupSelection = (nSelectionSize > 1);
+
+        a_delnode.setEnabled(hasSelection);
+        a_copynode.setEnabled(hasSelection);
+        a_cutnode.setEnabled(hasSelection);
+        a_pastenode.setEnabled(m_clipboard.hasText());
+
+        a_fillcolor.setEnabled(hasSelection);
+        a_pencolor.setEnabled(hasSelection);
+
+        a_forward.setEnabled(hasSelection);
+        a_backward.setEnabled(hasSelection);
+        a_tofront.setEnabled(hasSelection);
+        a_toback.setEnabled(hasSelection);
+
+        a_group.setEnabled(hasSelection);
+
+        a_alignbottom.setEnabled(hasGroupSelection);
+        a_aligntop.setEnabled(hasGroupSelection);
+        a_alignleft.setEnabled(hasGroupSelection);
+        a_alignright.setEnabled(hasGroupSelection);
+        a_spacehorizontal.setEnabled(hasGroupSelection);
+        a_spacevertical.setEnabled(hasGroupSelection);
+        a_centerhorizontal.setEnabled(hasGroupSelection);
+        a_centervertical.setEnabled(hasGroupSelection);
+
+        g_panel.repaint();
+    }
+
+    public JToolBar m_jTbTools;
+    public JToolBar m_jTbTools2;
+
+    public void init() {
+        m_Selection.setDocument(m_doc);
+        setSize(2048, 2048);
+        g_panel = new DrawPanel();
+        m_jScrollPane = new JScrollPane(g_panel);
+        makeToolbar();
+        makeMenuBar();
+        addComponentListener(this);
+        this.setLayout(new BorderLayout());
+        this.add(m_jScrollPane, BorderLayout.CENTER);
+        g_panel.setPreferredSize(getSize());
+    }
+
+    void makeToolbar() {
+        m_jTbTools = new JToolBar();
+        m_jTbTools.setFloatable(false);
+        // m_jTbTools.setLayout(new GridBagLayout());
+        m_jTbTools.add(a_new);
+        m_jTbTools.add(a_save);
+        m_jTbTools.add(a_load);
+        m_jTbTools.addSeparator(new Dimension(2, 2));
+        m_jTbTools.add(a_cutnode);
+        m_jTbTools.add(a_copynode);
+        m_jTbTools.add(a_pastenode);
+        m_jTbTools.addSeparator(new Dimension(2, 2));
+        m_jTbTools.add(a_undo);
+        m_jTbTools.add(a_redo);
+        m_jTbTools.addSeparator(new Dimension(2, 2));
+
+        m_jTbTools.add(a_select);
+        m_jTbTools.add(a_function);
+        // m_jTbTools.add(a_rect);
+        // m_jTbTools.add(a_rrect);
+        // m_jTbTools.add(a_ellipse);
+        // m_jTbTools.add(a_line);
+        // m_jTbTools.add(a_poly);
+        m_jTbTools.add(a_arrow);
+        m_jTbTools.addSeparator(new Dimension(2, 2));
+        m_jTbTools.add(a_alignleft);
+        m_jTbTools.add(a_alignright);
+        m_jTbTools.add(a_aligntop);
+        m_jTbTools.add(a_alignbottom);
+        m_jTbTools.add(a_centerhorizontal);
+        m_jTbTools.add(a_centervertical);
+        m_jTbTools.add(a_spacehorizontal);
+        m_jTbTools.add(a_spacevertical);
+
+        setLayout(new BorderLayout());
+        // add("North", m_jTbTools);
+        // add("Center", g_panel);
+
+        m_jTbTools2 = new JToolBar();
+        m_jTbTools2.setFloatable(false);
+        m_jTbTools2.add(a_relax);
+        m_jTbTools2.add(a_viewLoggers);
+        m_jTbTools2.add(a_viewOperators);
+        m_jTbTools2.add(a_viewSequences);
+        m_jTbTools2.add(a_layout);
+
+    } // init
+
+    boolean needsDrawing(BEASTInterface plugin) {
+        if (plugin == null) {
+            return true;
+        }
+        if (!m_bViewOperators && plugin instanceof beast.core.Operator) {
+            return false;
+        }
+        if (!m_bViewLoggers && plugin instanceof beast.core.Logger) {
+            return false;
+        }
+        if (!m_bViewSequences && plugin instanceof Sequence) {
+            return false;
+        }
+        if (!m_bViewState && plugin instanceof beast.core.State) {
+            return false;
+        }
+        return true;
+    }
+
+    public void setDrawingFlag() {
+        for (int i = 0; i < m_doc.m_objects.size(); i++) {
+            Shape shape = (Shape) m_doc.m_objects.get(i);
+            shape.m_bNeedsDrawing = false;
+            if (shape.m_bNeedsDrawing) {
+                shape.m_bNeedsDrawing = true;
+            }
+            if (shape instanceof BEASTObjectShape) {
+                BEASTInterface plugin = ((BEASTObjectShape) shape).m_plugin;
+                if (needsDrawing(plugin)) {
+                    shape.m_bNeedsDrawing = true;
+                }
+            } else if (shape instanceof InputShape) {
+                BEASTObjectShape pluginShape = ((InputShape) shape).m_pluginShape;
+                if (pluginShape != null) {
+                    if (needsDrawing(pluginShape.m_plugin)) {
+                        shape.m_bNeedsDrawing = true;
+                    }
+                } else {
+                    shape.m_bNeedsDrawing = true;
+                }
+            } else if (shape instanceof Arrow) {
+                Shape tail = ((Arrow) shape).m_tailShape;
+                boolean bNeedsDrawing = true;
+                if (tail instanceof BEASTObjectShape) {
+                    bNeedsDrawing = needsDrawing(((BEASTObjectShape) tail).m_plugin);
+                }
+                if (bNeedsDrawing) {
+                    Shape head = ((Arrow) shape).m_headShape;
+                    if (head instanceof InputShape) {
+                        BEASTObjectShape pluginShape = ((InputShape) head).m_pluginShape;
+                        if (pluginShape != null) {
+                            bNeedsDrawing = needsDrawing(pluginShape.m_plugin);
+                        }
+                    }
+                    if (bNeedsDrawing) {
+                        shape.m_bNeedsDrawing = true;
+                    }
+                }
+            } else {
+                shape.m_bNeedsDrawing = true;
+            }
+        }
+    }
+
+    class DrawPanel extends JPanel implements Printable {
+        /**
+         * for serialisation
+         */
+        static final long serialVersionUID = 1L;
+
+        public DrawPanel() {
+            setBackground(Color.white);
+            addMouseMotionListener(new GBDrawMouseMotionListener());
+            addMouseListener(new GBDrawMouseEventListener());
+        }
+
+        public void paintComponent(Graphics gr) {
+            Graphics2D g = (Graphics2D) gr;
+            RenderingHints rh = new RenderingHints(
+                    RenderingHints.KEY_ANTIALIASING,
+                    RenderingHints.VALUE_ANTIALIAS_ON);
+            rh.put(RenderingHints.KEY_RENDERING,
+                    RenderingHints.VALUE_RENDER_SPEED);
+            g.setRenderingHints(rh);
+            ((Graphics2D) g).setBackground(Color.WHITE);
+            Rectangle r = g.getClipBounds();
+            g.clearRect(r.x, r.y, r.width, r.height);
+
+            m_doc.adjustInputs();
+            for (int i = 0; i < m_doc.m_objects.size(); i++) {
+                Shape shape = (Shape) m_doc.m_objects.get(i);
+                if (shape.m_bNeedsDrawing) {
+                    shape.draw(g, this);
+                }
+            }
+            if (!a_export.isExporting() && !a_print.isPrinting()) {
+                if (m_drawShape != null) {
+                    m_drawShape.draw(g, this);
+                }
+                if (m_Selection.m_tracker != null) {
+                    g.setColor(Color.BLACK);
+                    for (int i = 0; i < m_Selection.m_tracker.size(); i++) {
+                        TrackPoint p = (TrackPoint) m_Selection.m_tracker
+                                .get(i);
+                        g.fillRect(p.m_nX - 4, p.m_nY - 4, 8, 8);
+                    }
+                }
+                if (m_selectRect != null) {
+                    g.setXORMode(Color.green);
+                    g.draw(m_selectRect);
+                }
+            }
+
+            if (m_bRelax) {
+                m_doc.relax(true);
+                repaint();
+            }
+            m_jScrollPane.revalidate();
+        } // paintComponent
+
+        /**
+         * implementation of Printable, used for printing
+         *
+         * @see Printable
+         */
+        public int print(Graphics g, PageFormat pageFormat, int pageIndex) {
+            if (pageIndex > 0) {
+                return (NO_SUCH_PAGE);
+            } else {
+                Graphics2D g2d = (Graphics2D) g;
+                g2d.translate(pageFormat.getImageableX(), pageFormat
+                        .getImageableY());
+                // Turn off double buffering
+                paint(g2d);
+                // Turn double buffering back on
+                return (PAGE_EXISTS);
+            }
+        } // print
+
+        /**
+         * position clicked on
+         */
+        int m_nPosX = 0, m_nPosY = 0, m_nPoint;
+        boolean m_bIsMoving = false;
+
+        class GBDrawMouseMotionListener extends MouseMotionAdapter {
+
+            public void mouseDragged(MouseEvent me) {
+                switch (m_nMode) {
+                    case MODE_SELECT:
+                        if (m_bIsMoving || m_Selection.isSingleSelection()
+                                && m_Selection.intersects(me.getX(), me.getY())) {
+                            m_bIsMoving = true;
+                            Shape shape = (Shape) m_doc.m_objects.get(m_Selection
+                                    .getSingleSelection());
+                            if (getCursor().getType() == Cursor.DEFAULT_CURSOR) {
+                                // simple move operation
+                                m_doc.moveShape(m_nPosX, m_nPosY, me.getX(), me
+                                        .getY(), m_Selection.getSingleSelection());
+                                m_Selection.m_tracker = shape.getTracker();
+                            } else {
+                                // resize/move point operation
+                                m_doc.movePoint(m_nPoint, m_nPosX, m_nPosY, me
+                                        .getX(), me.getY(), m_Selection
+                                        .getSingleSelection());
+                                m_Selection.m_tracker = shape.getTracker();
+                            }
+                            updateStatus();
+                            break;
+                        } else {
+                            if (m_selectRect == null) {
+                                if (m_Selection.intersects(me.getX(), me.getY())) {
+                                    // move selection
+                                    m_nMode = MODE_MOVE;
+                                    // m_doc.addUndoGroupAction(m_Selection);
+                                    m_nPosX = me.getX();
+                                    m_nPosY = me.getY();
+                                } else {
+                                    // start new Rectangle
+                                    m_selectRect = new Rectangle(me.getX(), me
+                                            .getY(), 1, 1);
+                                }
+                            } else {
+                                m_selectRect.width = me.getX() - m_selectRect.x;
+                                m_selectRect.height = me.getY() - m_selectRect.y;
+                            }
+                            g_panel.repaint();
+                        }
+                        break;
+                    case MODE_MOVE:
+                        int dX = me.getX() - m_nPosX;
+                        int dY = me.getY() - m_nPosY;
+                        m_doc.moveShapes(dX, dY, m_Selection.m_Selection);
+                        m_Selection.offset(dX, dY);
+                        m_doc.adjustArrows();
+                        m_nPosX = me.getX();
+                        m_nPosY = me.getY();
+                        repaint();
+                        break;
+                    case MODE_FUNCTION:
+                        beast.app.draw.BEASTObjectShape function = (beast.app.draw.BEASTObjectShape) m_drawShape;
+
+                        if (m_drawShape == null) {
+                            function = new beast.app.draw.BEASTObjectShape();
+                            function.m_x = me.getX();
+                            function.m_y = me.getY();
+                            function.m_w = 1;
+                            function.m_h = 1;
+                            m_drawShape = function;
+                        } else {
+                            function.m_w = me.getX() - function.m_x;
+                            function.m_h = me.getY() - function.m_y;
+                        }
+                        m_Selection.m_tracker = function.getTracker();
+                        g_panel.repaint();
+                        break;
+                    case MODE_ARROW:
+                        Arrow arrow = (Arrow) m_drawShape;
+                        if (m_drawShape == null) {
+                            int iSelection = -1;
+                            for (int i = 0; iSelection < 0
+                                    && i < m_doc.m_objects.size(); i++) {
+                                Shape shape = (Shape) m_doc.m_objects.get(i);
+                                if (shape.m_bNeedsDrawing
+                                        && shape.intersects(me.getX(), me.getY())) {
+                                    m_nPosX = shape.offsetX(me.getX());
+                                    m_nPosY = shape.offsetY(me.getY());
+                                    iSelection = i;
+                                }
+                            }
+                            if (iSelection < 0) {
+                                return;
+                            }
+                            Shape shape = (Shape) m_doc.m_objects.get(iSelection);
+                            if (shape instanceof Arrow) {
+                                return;
+                            }
+                            if (shape instanceof InputShape) {
+                                shape = ((InputShape) shape).m_pluginShape;
+                            }
+                            arrow = new Arrow((BEASTObjectShape) shape, me.getX(), me
+                                    .getY());
+                            arrow.m_w = 1;
+                            arrow.m_h = 1;
+                            m_drawShape = arrow;
+                        } else {
+                            arrow.setHead(me.getX() - arrow.m_x, me.getY()
+                                    - arrow.m_y);
+                        }
+                        // m_Selection.m_tracker = arrow.getTracker();
+                        g_panel.repaint();
+                        break;
+                }
+            } // mouseDragged
+
+            public void mouseMoved(MouseEvent me) {
+                if (m_Selection.m_tracker != null
+                        && m_Selection.isSingleSelection()) {
+                    if (getCursor().getType() != Cursor.DEFAULT_CURSOR) {
+                        setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
+                    }
+                    for (int i = 0; i < m_Selection.m_tracker.size(); i++) {
+                        TrackPoint p = (TrackPoint) m_Selection.m_tracker
+                                .get(i);
+                        if (me.getX() > p.m_nX - 4 && me.getX() < p.m_nX + 4
+                                && me.getY() > p.m_nY - 4
+                                && me.getY() < p.m_nY + 4) {
+                            m_nPoint = i;
+                            m_nPosX = me.getX() - p.m_nX;
+                            m_nPosY = me.getY() - p.m_nY;
+                            setCursor(new Cursor(p.m_nCursor));
+                            return;
+                        }
+                    }
+                    Shape shape = (Shape) m_doc.m_objects.get(m_Selection
+                            .getSingleSelection());
+                    m_nPosX = me.getX() - shape.m_x;
+                    m_nPosY = me.getY() - shape.m_y;
+                } else {
+                    if (getCursor().getType() != Cursor.DEFAULT_CURSOR) {
+                        setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
+                    }
+                }
+
+                // set up tool tip text
+                for (int i = m_doc.m_objects.size() - 1; i >= 0; i--) {
+                    Shape shape = (Shape) m_doc.m_objects.get(i);
+                    if (shape.m_bNeedsDrawing
+                            && shape.intersects(me.getX(), me.getY())) {
+                        if (shape instanceof BEASTObjectShape) {
+                            BEASTObjectShape plugin = (BEASTObjectShape) shape;
+                            try {
+                                String sToolTip = "<html>";
+                                for (InputShape input : plugin.m_inputs) {
+                                    sToolTip += input.getLongLabel() + "<br>";
+                                }
+                                sToolTip += "</html>";
+                                setToolTipText(sToolTip);
+                            } catch (IllegalArgumentException e) {
+                                // TODO Auto-generated catch block
+                                e.printStackTrace();
+                            }
+                        }
+                        return;
+                    }
+                }
+
+            } // mouseMoved
+
+        } // class GBDrawMouseMotionListener
+
+        class GBDrawMouseEventListener extends MouseAdapter {
+            public void mouseClicked(MouseEvent me) {
+                if (me.getClickCount() == 2) {
+                    handleDoubleClick(me);
+                    return;
+                }
+
+                if (me.getButton() == MouseEvent.BUTTON3) {
+                    handleRightClick(me);
+                    return;
+                }
+                // otherwise, assume left click
+                switch (m_nMode) {
+                    case MODE_SELECT:
+                        int iSelection = -1;
+                        for (int i = m_doc.m_objects.size() - 1; iSelection < 0 && i >= 0; i--) {
+                            Shape shape = (Shape) m_doc.m_objects.get(i);
+                            if (shape.m_bNeedsDrawing && !(shape instanceof Arrow) && shape.intersects(me.getX(), me.getY())) {
+                                m_nPosX = shape.offsetX(me.getX());
+                                m_nPosY = shape.offsetY(me.getY());
+                                iSelection = i;
+                            }
+                        }
+                        if (iSelection < 0) {
+                            for (int i = m_doc.m_objects.size() - 1; iSelection < 0 && i >= 0; i--) {
+                                Shape shape = (Shape) m_doc.m_objects.get(i);
+                                if (shape.m_bNeedsDrawing && shape.intersects(me.getX(), me.getY())) {
+                                    m_nPosX = shape.offsetX(me.getX());
+                                    m_nPosY = shape.offsetY(me.getY());
+                                    iSelection = i;
+                                }
+                            }
+                            if (iSelection < 0) {
+                                return;
+                            }
+                        }
+                        if ((me.getModifiersEx() & MouseEvent.CTRL_DOWN_MASK) != 0) {
+                            m_Selection.toggleSelection(iSelection);
+                        } else if ((me.getModifiersEx() & MouseEvent.SHIFT_DOWN_MASK) != 0) {
+                            m_Selection.addToSelection(iSelection);
+                        } else {
+                            m_Selection.clear();
+                            m_Selection.setSingleSelection(iSelection);
+                        }
+                        updateStatus();
+                        break;
+                }
+            } // mouseClicked
+
+            void handleDoubleClick(MouseEvent me) {
+                // find the shape intersecting the mouse pointer
+                try {
+                    for (int i = m_doc.m_objects.size() - 1; i >= 0; i--) {
+                        Shape shape = m_doc.m_objects.get(i);
+                        if (shape.m_bNeedsDrawing
+                                && shape.intersects(me.getX(), me.getY())) {
+                            if (shape instanceof InputShape) {
+                                // resolve the associated input
+                                InputShape ellipse = (InputShape) shape;
+                                String sInput = ellipse.getInputName();
+                                BEASTInterface plugin = ellipse.getPlugin();
+                                if (plugin.isPrimitive(sInput)) {
+                                    String sValue = "";
+                                    if (plugin.getInputValue(sInput) != null) {
+                                        sValue = plugin.getInputValue(sInput)
+                                                .toString();
+                                    }
+                                    sValue = JOptionPane.showInputDialog(sInput
+                                            + ":", sValue);
+                                    if (sValue != null) {
+                                        m_doc.setInputValue(ellipse.getPluginShape(), sInput, sValue);
+                                        // ellipse.setLabel(sInput + "=" +
+                                        // plugin.getInputValue(sInput).toString());
+                                        g_panel.repaint();
+                                    }
+                                }
+                            }
+                            return;
+                        }
+                    }
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            } // handleDoubleClick
+
+            void handleRightClick(MouseEvent me) {
+                if (!m_bIsEditable) {
+                    return;
+                }
+                JPopupMenu popupMenu = new JPopupMenu("Choose a value");
+
+                if (!m_Selection.hasSelection()) {
+                    int iSelection = -1;
+                    for (int i = 0; iSelection < 0
+                            && i < m_doc.m_objects.size(); i++) {
+                        Shape shape = (Shape) m_doc.m_objects.get(i);
+                        if (shape.m_bNeedsDrawing
+                                && shape.intersects(me.getX(), me.getY())) {
+                            m_nPosX = shape.offsetX(me.getX());
+                            m_nPosY = shape.offsetY(me.getY());
+                            m_Selection.addToSelection(i);
+                            break;
+                        }
+                    }
+                }
+
+                JMenuItem addNodeItem = new JMenuItem("Change label");
+                ActionListener label = new ActionListener() {
+                    public void actionPerformed(ActionEvent ae) {
+                        Shape shape = m_Selection.getSingleSelectionShape();
+                        String sName = (String) JOptionPane.showInputDialog(
+                                null, shape.getID(), "New label",
+                                JOptionPane.OK_CANCEL_OPTION, null, null, shape
+                                .getID());
+                        if (sName == null || sName.equals("")) {
+                            return;
+                        }
+                        while (sName.contains("\\n")) {
+                            int i = sName.indexOf("\\n");
+                            sName = sName.substring(0, i - 1) + '\n'
+                                    + sName.substring(i + 2);
+                        }
+                        m_doc.setID(sName, m_Selection.getSingleSelection());
+                        repaint();
+                    }
+                };
+                addNodeItem.addActionListener(label);
+                addNodeItem.setEnabled(m_Selection.isSingleSelection());
+                popupMenu.add(addNodeItem);
+
+                JMenuItem isFilledMenu = new JMenuItem("Fill object");
+                if (m_Selection.isSingleSelection()) {
+                    Shape shape = m_Selection.getSingleSelectionShape();
+                    if (shape.isFilled()) {
+                        isFilledMenu = new JMenuItem("Don't fill object");
+                    }
+                }
+                isFilledMenu.addActionListener(new ActionListener() {
+                    public void actionPerformed(ActionEvent ae) {
+                        m_doc.toggleFilled(m_Selection.getSingleSelection());
+                        g_panel.repaint();
+                    }
+                });
+                isFilledMenu.setEnabled(m_Selection.isSingleSelection());
+                popupMenu.add(isFilledMenu);
+
+                JMenuItem propertiesItem = new JMenuItem("Properties");
+                propertiesItem.addActionListener(new ActionListener() {
+                    public void actionPerformed(ActionEvent ae) {
+                        Shape shape = m_Selection.getSingleSelectionShape();
+                        if (shape instanceof BEASTObjectShape) {
+                            BEASTInterface plugin = ((BEASTObjectShape) shape).m_plugin;
+
+                            List<BEASTInterface> plugins = new ArrayList<BEASTInterface>();
+                            for (Shape shape2 : m_doc.m_objects) {
+                                if (shape2 instanceof BEASTObjectShape) {
+                                    plugins.add(((BEASTObjectShape) shape2).m_plugin);
+                                }
+                            }
+                            BEASTObjectDialog dlg = new BEASTObjectDialog(plugin, plugin.getClass(), plugins, null);
+                            if (dlg.showDialog()) {
+                                // add newly created Plug-ins
+                                int nNewShapes = 0;
+                                if (plugins.size() < BEASTObjectPanel.g_plugins.size()) {
+                                    for (BEASTInterface plugin2 : BEASTObjectPanel.g_plugins.values()) {
+                                        if (!plugins.contains(plugin2)) {
+                                            try {
+                                                nNewShapes++;
+                                                Shape shape2 = new BEASTObjectShape(plugin2, m_doc);
+                                                shape2.m_x = 10;
+                                                shape2.m_y = nNewShapes * 50;
+                                                shape2.m_w = 80;
+                                                m_doc.addNewShape(shape2);
+                                                updateStatus();
+                                            } catch (Exception e) {
+                                                e.printStackTrace();
+                                            }
+                                        }
+                                    }
+                                }
+                                // re-attach all arrows
+                                m_Selection.clear();
+                                m_doc.recalcArrows();
+                                m_doc.adjustArrows();
+                            }
+                            repaint();
+                        }
+                    }
+                });
+                propertiesItem.setEnabled(m_Selection.isSingleSelection());
+                popupMenu.add(propertiesItem);
+
+                JMenuItem saveAsItem = new JMenuItem("Save as");
+                saveAsItem.addActionListener(new ActionListener() {
+                    public void actionPerformed(ActionEvent ae) {
+                        Shape shape = m_Selection.getSingleSelectionShape();
+                        BEASTInterface plugin = ((BEASTObjectShape) shape).m_plugin;
+                        JFileChooser fc = new JFileChooser(m_sDir);
+                        fc.addChoosableFileFilter(ef1);
+                        fc.setDialogTitle("Save Plugin As");
+                        if (!m_sFileName.equals("")) {
+                            // can happen on actionQuit
+                            fc.setSelectedFile(new File(m_sFileName));
+                        }
+                        int rval = fc.showSaveDialog(g_panel);
+
+                        if (rval == JFileChooser.APPROVE_OPTION) {
+                            // System.out.println("Saving to file \""+
+                            // f.getAbsoluteFile().toString()+"\"");
+                            String sFileName = fc.getSelectedFile().toString();
+                            if (sFileName.lastIndexOf('/') > 0) {
+                                m_sDir = sFileName.substring(0, sFileName
+                                        .lastIndexOf('/'));
+                            }
+                            if (!sFileName.endsWith(FILE_EXT))
+                                sFileName = sFileName.concat(FILE_EXT);
+                            try {
+                                FileWriter outfile = new FileWriter(sFileName);
+                                outfile.write(new XMLProducer().modelToXML(plugin));
+                                outfile.close();
+                            } catch (Exception e) {
+                                JOptionPane.showMessageDialog(null,
+                                        "Something went wrong when writing the file: "
+                                                + e.getClass().getName() + " "
+                                                + e.getMessage());
+                            }
+                            m_sFileName = sFileName;
+                        }
+                        repaint();
+                    }
+                });
+                saveAsItem.setEnabled(m_Selection.isSingleSelection());
+                popupMenu.add(saveAsItem);
+
+                popupMenu.setLocation(me.getX(), me.getY());
+                popupMenu.show(g_panel, me.getX(), me.getY());
+            } // handleRightClick
+
+            public void mouseReleased(MouseEvent me) {
+                if (m_drawShape != null) {
+                    m_drawShape.normalize();
+                }
+                m_bIsMoving = false;
+                boolean bAdded = true;
+                switch (m_nMode) {
+                    case MODE_SELECT:
+                        if (m_selectRect != null) {
+
+                            if ((me.getModifiersEx() & MouseEvent.CTRL_DOWN_MASK) == 0
+                                    && (me.getModifiersEx() & MouseEvent.SHIFT_DOWN_MASK) == 0) {
+                                // fresh selection
+                                m_Selection.clear();
+                            }
+
+                            for (int i = 0; i < m_doc.m_objects.size(); i++) {
+                                if (((Shape) m_doc.m_objects.get(i))
+                                        .intersects(m_selectRect)
+                                        && ((Shape) m_doc.m_objects.get(i)).m_bNeedsDrawing) {
+                                    if ((me.getModifiersEx() & MouseEvent.CTRL_DOWN_MASK) != 0) {
+                                        m_Selection.toggleSelection(i);
+                                    } else {
+                                        m_Selection.addToSelection(i);
+                                    }
+                                }
+                            }
+                            m_selectRect = null;
+                            updateStatus();
+                        }
+                        return;
+                    case MODE_MOVE:
+                        m_nMode = MODE_SELECT;
+                        updateStatus();
+                        return;
+                    case MODE_FUNCTION:
+                        BEASTObjectShape function = (BEASTObjectShape) m_drawShape;
+                        if (function == null) {
+                            return;
+                        }
+                        if (function.m_w > 0 && function.m_h > 0) {
+                            String sFunctionClassName = (String) JOptionPane
+                                    .showInputDialog(g_panel, "Select a constant",
+                                            "select", JOptionPane.PLAIN_MESSAGE,
+                                            null, m_doc.m_sPlugInNames, null);
+                            if (sFunctionClassName != null) {
+                                try {
+                                    function.init(sFunctionClassName, m_doc);
+                                    m_doc.addNewShape(function);
+                                    updateStatus();
+                                } catch (Exception e) {
+                                    // TODO: handle exception
+                                    e.printStackTrace();
+                                }
+                            } else {
+                                bAdded = false;
+                            }
+                        } else {
+                            bAdded = false;
+                        }
+                        break;
+                    case MODE_ARROW:
+                        Arrow arrow = (Arrow) m_drawShape;
+                        if (m_drawShape != null) {
+                            int iSelection = -1;
+                            for (int i = 0; iSelection < 0
+                                    && i < m_doc.m_objects.size(); i++) {
+                                Shape shape = (Shape) m_doc.m_objects.get(i);
+                                if (shape.m_bNeedsDrawing
+                                        && shape.intersects(me.getX(), me.getY())) {
+                                    m_nPosX = shape.offsetX(me.getX());
+                                    m_nPosY = shape.offsetY(me.getY());
+                                    iSelection = i;
+                                }
+                            }
+                            if (iSelection < 0) {
+                                m_drawShape = null;
+                                repaint();
+                                return;
+                            }
+                            Shape target = m_doc.m_objects.get(iSelection);
+                            if (!(target instanceof InputShape)) {
+                                // only connect to inputs of functions
+                                m_drawShape = null;
+                                repaint();
+                                return;
+                            }
+
+                            // check no cycle is introduced
+                            InputShape target2 = (InputShape) target;
+                            if (m_doc.isAscendant(arrow.m_tailShape.m_plugin,
+                                    target2.getPlugin())) {
+                                JOptionPane
+                                        .showMessageDialog(null,
+                                                "Cannot make this connection since this creates a cycle in the model");
+                                return;
+                            }
+
+                            try {
+                                // try to add connection
+                                // this links the input of the target plugin
+                                // to the source plugin. If types mismatch,
+                                // an exception is thrown and no arrow added.
+                                arrow.setHead(target2, m_doc.m_objects, m_doc);
+                                m_doc.addNewShape(arrow);
+                            } catch (Exception e) {
+                                JOptionPane.showMessageDialog(null, e.getMessage());
+                                repaint();
+                            }
+                        }
+                        break;
+                }
+                m_drawShape = null;
+                m_nMode = MODE_SELECT;
+                if (bAdded) {
+                    m_Selection.setSingleSelection(m_doc.m_objects.size() - 1);
+                    g_panel.repaint();
+                } else {
+                    m_Selection.clear();
+                    g_panel.repaint();
+                }
+            } // mouseReleased
+        } // GBDrawMouseEventListener
+    } // class DrawPanel
+
+    public JMenuBar makeMenuBar() {
+        JMenuBar menuBar = new JMenuBar();
+        JMenu fileMenu = new JMenu("File");
+        fileMenu.setMnemonic('F');
+        menuBar.add(fileMenu);
+        fileMenu.add(a_new);
+        fileMenu.add(a_load);
+        fileMenu.add(a_save);
+        fileMenu.add(a_saveas);
+        fileMenu.addSeparator();
+        fileMenu.add(a_export);
+        fileMenu.add(a_print);
+        fileMenu.addSeparator();
+        fileMenu.add(a_quit);
+
+        JMenu editMenu = new JMenu("Edit");
+        editMenu.setMnemonic('E');
+        menuBar.add(editMenu);
+        editMenu.add(a_undo);
+        editMenu.add(a_redo);
+        editMenu.addSeparator();
+        editMenu.add(a_selectall);
+        editMenu.add(a_delnode);
+        editMenu.add(a_cutnode);
+        editMenu.add(a_copynode);
+        editMenu.add(a_pastenode);
+        editMenu.addSeparator();
+        editMenu.add(a_alignleft);
+        editMenu.add(a_alignright);
+        editMenu.add(a_aligntop);
+        editMenu.add(a_alignbottom);
+        editMenu.add(a_centerhorizontal);
+        editMenu.add(a_centervertical);
+        editMenu.add(a_spacehorizontal);
+        editMenu.add(a_spacevertical);
+        editMenu.addSeparator();
+        editMenu.add(a_group);
+        // editMenu.add(a_ungroup);
+        editMenu.addSeparator();
+
+        JMenu drawMenu = new JMenu("Draw");
+        drawMenu.setMnemonic('D');
+        menuBar.add(drawMenu);
+        drawMenu.add(a_select);
+        drawMenu.add(a_function);
+        drawMenu.add(a_arrow);
+
+        JMenu objectMenu = new JMenu("Object");
+        objectMenu.setMnemonic('O');
+        menuBar.add(objectMenu);
+        objectMenu.add(a_fillcolor);
+        objectMenu.add(a_pencolor);
+        objectMenu.addSeparator();
+        objectMenu.add(a_tofront);
+        objectMenu.add(a_forward);
+        objectMenu.add(a_toback);
+        objectMenu.add(a_backward);
+
+        JMenu viewMenu = new JMenu("View");
+        viewMenu.setMnemonic('V');
+        menuBar.add(viewMenu);
+        final JCheckBoxMenuItem viewOperators = new JCheckBoxMenuItem(
+                "Show Operators", m_bViewOperators);
+        viewOperators.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent ae) {
+                m_bViewOperators = viewOperators.getState();
+                setDrawingFlag();
+                g_panel.repaint();
+            }
+        });
+        viewMenu.add(viewOperators);
+        final JCheckBoxMenuItem viewLoggers = new JCheckBoxMenuItem(
+                "Show Loggers", m_bViewLoggers);
+        viewLoggers.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent ae) {
+                m_bViewLoggers = viewLoggers.getState();
+                setDrawingFlag();
+                g_panel.repaint();
+            }
+        });
+        viewMenu.add(viewLoggers);
+        final JCheckBoxMenuItem viewSequences = new JCheckBoxMenuItem(
+                "Show Sequences", m_bViewSequences);
+        viewSequences.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent ae) {
+                m_bViewSequences = viewSequences.getState();
+                setDrawingFlag();
+                g_panel.repaint();
+            }
+        });
+        viewMenu.add(viewSequences);
+        final JCheckBoxMenuItem viewState = new JCheckBoxMenuItem("Show State",
+                m_bViewState);
+        viewState.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent ae) {
+                m_bViewState = viewState.getState();
+                setDrawingFlag();
+                g_panel.repaint();
+            }
+        });
+        viewMenu.add(viewState);
+        m_viewRelax = new JCheckBoxMenuItem("Relax", m_bRelax);
+        m_viewRelax.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent ae) {
+                m_bRelax = m_viewRelax.getState();
+                g_panel.repaint();
+            }
+        });
+        viewMenu.add(m_viewRelax);
+
+        JMenuItem layoutMenu = new JMenuItem("Layout Visible Items");
+        layoutMenu.setMnemonic('L');
+        layoutMenu.addActionListener(new ActionListener() {
+            // implement ActionListener
+            public void actionPerformed(ActionEvent e) {
+                g_panel.setCursor(new Cursor(Cursor.WAIT_CURSOR));
+                m_doc.layout();
+                m_doc.adjustArrows();
+                repaint();
+                g_panel.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
+            }
+        });
+        viewMenu.add(layoutMenu);
+        viewMenu.addSeparator();
+
+        final JCheckBoxMenuItem viewAllInputs = new JCheckBoxMenuItem("Show All Inputs",
+                m_doc.m_bShowALlInputs);
+        viewAllInputs.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent ae) {
+            	m_doc.m_bShowALlInputs = viewAllInputs.getState();
+            	m_doc.reinit();
+                setDrawingFlag();
+                g_panel.repaint();
+            }
+        });
+        viewMenu.add(viewAllInputs);
+
+        final JCheckBoxMenuItem sanitseIDs = new JCheckBoxMenuItem("Sanitise IDs",
+                m_doc.m_bSanitiseIDs);
+        sanitseIDs.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent ae) {
+            	m_doc.m_bSanitiseIDs = sanitseIDs.getState();
+                setDrawingFlag();
+                g_panel.repaint();
+            }
+        });
+        viewMenu.add(sanitseIDs);
+        
+        
+        JMenu helpMenu = new JMenu("Help");
+        helpMenu.setMnemonic('H');
+        menuBar.add(helpMenu);
+        helpMenu.add(a_about);
+
+        return menuBar;
+    } // makeMenuBar
+
+    public static void main(String args[]) {
+        Randomizer.setSeed(127);
+        try {
+            AddOnManager.loadExternalJars();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        JFrame f = new JFrame("Model Builder");
+        ModelBuilder drawTest = new ModelBuilder();
+        drawTest.init();
+        JMenuBar menuBar = drawTest.makeMenuBar();
+        f.setJMenuBar(menuBar);
+
+        f.add(drawTest.m_jTbTools, BorderLayout.NORTH);
+        f.add(drawTest, BorderLayout.CENTER);
+
+        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        java.net.URL tempURL = ClassLoader
+                .getSystemResource(ModelBuilder.ICONPATH + "/GenerationD.png");
+        try {
+            f.setIconImage(ImageIO.read(tempURL));
+        } catch (Exception e) {
+            e.printStackTrace();
+            // ignore
+        }
+        if (args.length > 0) {
+            drawTest.m_doc.loadFile(args[0]);
+            drawTest.setDrawingFlag();
+        }
+        f.setSize(600, 800);
+        f.setVisible(true);
+    } // main
+
+    // implements ComponentListener
+
+    public void componentHidden(ComponentEvent e) {
+        m_jScrollPane.revalidate();
+    }
+
+    // implements ComponentListener
+
+    public void componentMoved(ComponentEvent e) {
+        m_jScrollPane.revalidate();
+    }
+
+    // implements ComponentListener
+
+    public void componentResized(ComponentEvent e) {
+        m_jScrollPane.revalidate();
+    }
+
+    // implements ComponentListener
+
+    public void componentShown(ComponentEvent e) {
+        m_jScrollPane.revalidate();
+    }
+
+} // class ModelBuilder
diff --git a/src/beast/app/draw/MyAction.java b/src/beast/app/draw/MyAction.java
new file mode 100644
index 0000000..f41bcc1
--- /dev/null
+++ b/src/beast/app/draw/MyAction.java
@@ -0,0 +1,67 @@
+package beast.app.draw;
+
+import java.awt.Toolkit;
+import java.awt.event.ActionEvent;
+import java.awt.image.BufferedImage;
+
+import javax.swing.AbstractAction;
+import javax.swing.Action;
+import javax.swing.ImageIcon;
+import javax.swing.KeyStroke;
+
+import beast.app.util.Utils;
+
+
+
+/**
+ * Base class used for definining actions with a name, tool tip text, possibly
+ * an icon and accelerator key.
+ */
+public abstract class MyAction extends AbstractAction {
+    /**
+     * for serialisation
+     */
+    private static final long serialVersionUID = -1L;
+
+    /**
+     * path for icons
+     */
+
+    public MyAction(String sName, String sToolTipText, String sIcon, int acceleratorKey) {
+        this(sName, sToolTipText, sIcon, KeyStroke.getKeyStroke(acceleratorKey, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
+    } // c'tor
+
+    public MyAction(String sName, String sToolTipText, String sIcon, String sAcceleratorKey) {
+        this(sName, sToolTipText, sIcon, KeyStroke.getKeyStroke(sAcceleratorKey));
+    } // c'tor
+
+    public MyAction(String sName, String sToolTipText, String sIcon, KeyStroke acceleratorKeystroke) {
+        super(sName);
+        // setToolTipText(sToolTipText);
+        putValue(Action.SHORT_DESCRIPTION, sToolTipText);
+        putValue(Action.LONG_DESCRIPTION, sToolTipText);
+        if (acceleratorKeystroke != null && acceleratorKeystroke.getKeyCode() >= 0) {
+            putValue(Action.ACCELERATOR_KEY, acceleratorKeystroke);
+        }
+        putValue(Action.MNEMONIC_KEY, new Integer(sName.charAt(0)));
+        java.net.URL tempURL = ClassLoader.getSystemResource(ModelBuilder.ICONPATH + sIcon + ".png");
+        if (!Utils.isMac()) {
+	        if (tempURL != null) {
+	            putValue(Action.SMALL_ICON, new ImageIcon(tempURL));
+	        } else {
+	            putValue(Action.SMALL_ICON, new ImageIcon(new BufferedImage(20, 20, BufferedImage.TYPE_4BYTE_ABGR)));
+	        }
+        }
+    } // c'tor
+
+
+
+    /*
+      * Place holder. Should be implemented by derived classes. (non-Javadoc)
+      * @see
+      * java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent
+      * )
+      */
+    abstract public void actionPerformed(ActionEvent ae);
+
+} // class MyAction
diff --git a/src/beast/app/draw/ParameterInputEditor.java b/src/beast/app/draw/ParameterInputEditor.java
new file mode 100644
index 0000000..7649008
--- /dev/null
+++ b/src/beast/app/draw/ParameterInputEditor.java
@@ -0,0 +1,281 @@
+package beast.app.draw;
+
+
+import java.awt.Color;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.List;
+
+import javax.swing.BorderFactory;
+import javax.swing.Box;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JComboBox;
+import javax.swing.JComponent;
+import javax.swing.JOptionPane;
+
+import beast.app.beauti.BeautiDoc;
+import beast.app.beauti.BeautiPanel;
+import beast.app.beauti.PartitionContext;
+import beast.app.util.Utils;
+import beast.core.Distribution;
+import beast.core.Input;
+import beast.core.Operator;
+import beast.core.BEASTObject;
+import beast.core.BEASTInterface;
+import beast.core.parameter.RealParameter;
+import beast.evolution.branchratemodel.BranchRateModel;
+import beast.math.distributions.ParametricDistribution;
+
+
+
+
+
+public class ParameterInputEditor extends BEASTObjectInputEditor {
+	boolean isParametricDistributionParameter = false;
+	
+    //public ParameterInputEditor() {}
+    public ParameterInputEditor(BeautiDoc doc) {
+		super(doc);
+	}
+
+	private static final long serialVersionUID = 1L;
+    JCheckBox m_isEstimatedBox;
+
+    @Override
+    public Class<?> type() {
+        return RealParameter.class;
+    }
+    
+    
+    @Override
+    public void init(Input<?> input, BEASTInterface plugin, int itemNr, ExpandOption bExpandOption, boolean bAddButtons) {
+    	super.init(input, plugin, itemNr, bExpandOption, bAddButtons);
+    	m_plugin = plugin;
+    }
+
+    @Override
+    protected void initEntry() {
+        if (m_input.get() != null) {
+        	if (itemNr < 0) {
+        		RealParameter parameter = (RealParameter) m_input.get();
+        		String s = "";
+        		for (Double d : parameter.valuesInput.get()) {
+        			s += d + " ";
+        		}
+        		m_entry.setText(s);
+        	} else {
+        		RealParameter parameter = (RealParameter) ((List)m_input.get()).get(itemNr);
+        		String s = "";
+        		for (Double d : parameter.valuesInput.get()) {
+        			s += d + " ";
+        		}
+        		m_entry.setText(s);
+        	}
+        }
+    }
+
+    @Override
+    protected void processEntry() {
+        try {
+            String sValue = m_entry.getText();
+            RealParameter parameter = (RealParameter) m_input.get();
+        	String oldValue = "";
+    		for (Double d : parameter.valuesInput.get()) {
+    			oldValue += d + " ";
+    		}
+            int oldDim = parameter.getDimension();
+            parameter.valuesInput.setValue(sValue, parameter);
+            parameter.initAndValidate();
+            int newDim = parameter.getDimension();
+            if (oldDim != newDim) {
+            	parameter.setDimension(oldDim);
+                parameter.valuesInput.setValue(oldValue, parameter);
+                parameter.initAndValidate();
+                throw new Exception("Entry caused change in dimension");
+            }
+            validateInput();
+        } catch (Exception ex) {
+            m_validateLabel.setVisible(true);
+            m_validateLabel.setToolTipText("<html><p>Parsing error: " + ex.getMessage() + ". Value was left at " + m_input.get() + ".</p></html>");
+            m_validateLabel.m_circleColor = Color.orange;
+            repaint();
+        }
+    }
+
+
+    @Override
+    protected void addComboBox(JComponent box, Input<?> input, BEASTInterface plugin) {
+        Box paramBox = Box.createHorizontalBox();
+        RealParameter parameter = null;
+        if (itemNr >= 0) {
+        	parameter = (RealParameter) ((List) input.get()).get(itemNr);
+        } else {
+        	parameter = (RealParameter) input.get();
+        }
+
+        if (parameter == null) {
+            super.addComboBox(box, input, plugin);
+        } else {
+            setUpEntry();
+            paramBox.add(m_entry);
+            if (doc.bAllowLinking) {
+	            boolean isLinked = doc.isLinked(m_input);
+				if (isLinked || doc.suggestedLinks((BEASTInterface) m_input.get()).size() > 0) {
+		            JButton linkbutton = new JButton(Utils.getIcon(BeautiPanel.ICONPATH + 
+		            		(isLinked ? "link.png" : "unlink.png")));
+		            linkbutton.setBorder(BorderFactory.createEmptyBorder());
+		            linkbutton.setToolTipText("link/unlink this parameter with another compatible parameter");
+		            linkbutton.addActionListener(new ActionListener() {
+						@Override
+						public void actionPerformed(ActionEvent e) {
+							if (doc.isLinked(m_input)) {
+								// unlink
+								try {
+									BEASTInterface candidate = doc.getUnlinkCandidate(m_input, m_plugin);
+									m_input.setValue(candidate, m_plugin);
+									doc.deLink(m_input);
+								} catch (Exception e2) {
+									e2.printStackTrace();
+								}
+								
+							} else {
+								// create a link
+								List<BEASTInterface> candidates = doc.suggestedLinks((BEASTInterface) m_input.get());
+								JComboBox jcb = new JComboBox(candidates.toArray());
+								JOptionPane.showMessageDialog( null, jcb, "select parameter to link with", JOptionPane.QUESTION_MESSAGE);
+								BEASTInterface candidate = (BEASTInterface) jcb.getSelectedItem();
+								if (candidate != null) {
+									try {
+										m_input.setValue(candidate, m_plugin);
+										doc.addLink(m_input);
+									} catch (Exception e2) {
+										e2.printStackTrace();
+									}
+								}
+							}
+							refreshPanel();
+						}
+					});
+		            paramBox.add(linkbutton);
+				}
+            }            
+            
+            paramBox.add(Box.createHorizontalGlue());
+
+            m_isEstimatedBox = new JCheckBox(doc.beautiConfig.getInputLabel(parameter, parameter.isEstimatedInput.getName()));
+            m_isEstimatedBox.setName(input.getName() + ".isEstimated");
+            if (input.get() != null) {
+                m_isEstimatedBox.setSelected(parameter.isEstimatedInput.get());
+            }
+            m_isEstimatedBox.setToolTipText(parameter.isEstimatedInput.getHTMLTipText());
+
+            boolean bIsClockRate = false;
+            for (Object output : parameter.getOutputs()) {
+                if (output instanceof BranchRateModel.Base) {
+                    bIsClockRate |= ((BranchRateModel.Base) output).meanRateInput.get() == parameter;
+                }
+            }
+            m_isEstimatedBox.setEnabled(!bIsClockRate || !getDoc().bAutoSetClockRate);
+
+
+            m_isEstimatedBox.addActionListener(new ActionListener() {
+                @Override
+                public void actionPerformed(ActionEvent e) {
+                    try {
+                        RealParameter parameter = (RealParameter) m_input.get();
+                        parameter.isEstimatedInput.setValue(m_isEstimatedBox.isSelected(), parameter);
+                        if (isParametricDistributionParameter) {
+                        	String sID = parameter.getID();
+                        	
+
+                        	if (sID.startsWith("RealParameter")) {
+                            	ParametricDistribution parent = null; 
+                	            for (Object plugin2 : parameter.getOutputs()) {
+                	                if (plugin2 instanceof ParametricDistribution) {
+                                		parent = (ParametricDistribution) plugin2; 
+                	                    break;
+                	                }
+                	            }
+                	            Distribution grandparent = null; 
+                	            for (Object plugin2 : parent.getOutputs()) {
+                	                if (plugin2 instanceof Distribution) {
+                                		grandparent = (Distribution) plugin2; 
+                	                    break;
+                	                }
+                	            }
+                        		sID = "parameter.hyper" + parent.getClass().getSimpleName() + "-" + 
+                        				m_input.getName() + "-" + grandparent.getID();
+                        		doc.pluginmap.remove(parameter.getID());
+                        		parameter.setID(sID);
+                        		doc.addPlugin(parameter);
+                        	}
+                        	
+                        	
+                        	PartitionContext context = new PartitionContext(sID.substring("parameter.".length()));
+                        	System.err.println(context + " " + sID);
+                        	doc.beautiConfig.hyperPriorTemplate.createSubNet(context, true);
+                        }
+                        refreshPanel();
+                    } catch (Exception ex) {
+                        System.err.println("ParameterInputEditor " + ex.getMessage());
+                    }
+                }
+            });
+            paramBox.add(m_isEstimatedBox);
+
+            // only show the estimate flag if there is an operator that works on this parameter
+            m_isEstimatedBox.setVisible(doc.isExpertMode());
+            m_isEstimatedBox.setToolTipText("Estimate value of this parameter in the MCMC chain");
+            //m_editPluginButton.setVisible(false);
+            //m_bAddButtons = false;
+            if (itemNr < 0) {
+	            for (Object plugin2 : ((BEASTInterface) m_input.get()).getOutputs()) {
+	                if (plugin2 instanceof ParametricDistribution) {
+	                    m_isEstimatedBox.setVisible(true);
+	                	isParametricDistributionParameter = true;
+	                    break;
+	                }
+	            }
+	            for (Object plugin2 : ((BEASTInterface) m_input.get()).getOutputs()) {
+	                if (plugin2 instanceof Operator) {
+	                    m_isEstimatedBox.setVisible(true);
+	                    //m_editPluginButton.setVisible(true);
+	                    break;
+	                }
+	            }
+            } else {
+	            for (Object plugin2 : ((BEASTInterface) ((List)m_input.get()).get(itemNr)).getOutputs()) {
+	                if (plugin2 instanceof Operator) {
+	                    m_isEstimatedBox.setVisible(true);
+	                    //m_editPluginButton.setVisible(true);
+	                    break;
+	                }
+	            }
+            }
+
+            box.add(paramBox);
+        }
+    }
+
+    @Override
+    protected void addValidationLabel() {
+        super.addValidationLabel();
+        // make edit button invisible (if it exists) when this parameter is not estimateable
+        if (m_editPluginButton != null)
+            m_editPluginButton.setVisible(m_isEstimatedBox.isVisible());
+    }
+
+    @Override
+    void refresh() {
+        RealParameter parameter = (RealParameter) m_input.get();
+		String s = "";
+		for (Double d : parameter.valuesInput.get()) {
+			s += d + " ";
+		}
+		m_entry.setText(s);
+        m_isEstimatedBox.setSelected(parameter.isEstimatedInput.get());
+        repaint();
+    }
+
+}
diff --git a/src/beast/app/draw/Selection.java b/src/beast/app/draw/Selection.java
new file mode 100644
index 0000000..10b460c
--- /dev/null
+++ b/src/beast/app/draw/Selection.java
@@ -0,0 +1,169 @@
+/*
+* File Selection.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+package beast.app.draw;
+
+import java.util.List;
+import java.util.ArrayList;
+
+public class Selection {
+    public List<TrackPoint> m_tracker = null;
+    List<Integer> m_Selection;
+    Document m_doc = null;
+
+    public Selection() {
+        m_Selection = new ArrayList<Integer>(1);
+    } // c'tor
+
+    public void setDocument(Document doc) {
+        m_doc = doc;
+    }
+
+    public boolean isSingleSelection() {
+        return m_Selection.size() == 1;
+    }
+
+    boolean hasSelection() {
+        return m_Selection.size() > 0;
+    }
+
+    public int getSingleSelection() {
+        return ((Integer) m_Selection.get(0)).intValue();
+    }
+
+    Shape getSingleSelectionShape() {
+        return (Shape) m_doc.m_objects.get(getSingleSelection());
+    }
+
+    void setSingleSelection(int nSelection) {
+        m_Selection.removeAll(m_Selection);
+        m_Selection.add(new Integer(nSelection));
+        if (nSelection >= 0) {
+            m_tracker = ((Shape) m_doc.m_objects.get(nSelection)).getTracker();
+        }
+    }
+
+    //    void setSingleSelection(int nSelection, Document doc) {
+//    	m_Selection.removeAllElements();
+//    	m_Selection.add(nSelection);
+//    	m_tracker = ((Shape) doc.m_objects.get(nSelection)).getTracker();
+//    }
+    boolean contains(int iSelection) {
+        for (int i = 0; i < m_Selection.size(); i++) {
+            if (iSelection == ((Integer) m_Selection.get(i)).intValue()) {
+                return true;
+            }
+        }
+        return false;
+    } // contains
+
+    void addToSelection(int iSelection) {
+        if (contains(iSelection)) {
+            return;
+        }
+        m_Selection.add(new Integer(iSelection));
+        List<TrackPoint> tracker = ((Shape) m_doc.m_objects.get(iSelection)).getTracker();
+        if (m_tracker == null) {
+            m_tracker = new ArrayList<TrackPoint>();
+        }
+        m_tracker.addAll(tracker);
+    } // addToSelection
+
+    void toggleSelection(int iSelection) {
+        if (!contains(iSelection)) {
+            addToSelection(iSelection);
+        } else {
+            m_tracker.removeAll(m_tracker);
+            for (int i = 0; i < m_Selection.size(); i++) {
+                if (iSelection == ((Integer) m_Selection.get(i)).intValue()) {
+                    m_Selection.remove(i);
+                    i--;
+                } else {
+                    List<TrackPoint> tracker = ((Shape) m_doc.m_objects.get(((Integer) m_Selection.get(i)).intValue())).getTracker();
+                    m_tracker.addAll(tracker);
+                }
+            }
+        }
+        for (int i = 0; i < m_Selection.size(); i++) {
+            System.err.print((Integer) m_Selection.get(i) + " ");
+        }
+        System.err.println();
+    } // toggleSelection
+
+    public void clear() {
+        m_Selection.removeAll(m_Selection);
+        m_tracker = null;
+    } // clear
+
+    boolean intersects(int nX, int nY) {
+        for (int i = 0; i < m_Selection.size(); i++) {
+            int iShape = ((Integer) m_Selection.get(i)).intValue();
+            if (((Shape) m_doc.m_objects.get(iShape)).intersects(nX, nY)) {
+                return true;
+            }
+        }
+        if (m_tracker != null) {
+            for (int i = 0; i < m_tracker.size(); i++) {
+                TrackPoint p = (TrackPoint) m_tracker.get(i);
+                if (nX > p.m_nX - 5 && nX < p.m_nX + 5 && nY > p.m_nY - 5 && nY < p.m_nY + 5) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    } // intersects
+
+    void offset(int dX, int dY) {
+        for (int i = 0; i < m_tracker.size(); i++) {
+            TrackPoint p = (TrackPoint) m_tracker.get(i);
+            p.m_nX += dX;
+            p.m_nY += dY;
+        }
+        for (int i = 0; i < m_Selection.size(); i++) {
+            int iShape = ((Integer) m_Selection.get(i)).intValue();
+            Shape shape = (Shape) m_doc.m_objects.get(iShape);
+            shape.offset(dX, dY);
+        }
+    }
+
+    public void refreshTracker() {
+        if (m_tracker == null) {
+            m_tracker = new ArrayList<TrackPoint>();
+        }
+        m_tracker.removeAll(m_tracker);
+        for (int i = 0; i < m_Selection.size(); i++) {
+            int iSelection = ((Integer) m_Selection.get(i)).intValue();
+            List<TrackPoint> tracker = ((Shape) m_doc.m_objects.get(iSelection)).getTracker();
+            m_tracker.addAll(tracker);
+        }
+    }
+
+    void setSelection(int[] selection) {
+        m_Selection.removeAll(m_Selection);
+        for (int i = 0; i < selection.length; i++) {
+            m_Selection.add(new Integer(i));
+        }
+
+    }
+} // class Selection
diff --git a/src/beast/app/draw/Shape.java b/src/beast/app/draw/Shape.java
new file mode 100644
index 0000000..f9e62b2
--- /dev/null
+++ b/src/beast/app/draw/Shape.java
@@ -0,0 +1,410 @@
+/*
+* File Shape.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+package beast.app.draw;
+
+import java.awt.Color;
+import java.awt.Cursor;
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.Graphics2D;
+
+import java.awt.Rectangle;
+import java.io.PrintStream;
+import java.util.List;
+import java.util.ArrayList;
+
+import javax.swing.JPanel;
+
+import org.w3c.dom.Node;
+
+abstract public class Shape {
+    int m_x = 0;
+    int m_y = 0;
+    int m_w = 1;
+    int m_h = 1;
+
+    int m_nPenWidth = 1;
+    boolean m_bFilled = true;
+    Color m_fillcolor = DEFUALT_FILL_COLOR;
+    Color m_pencolor = DEFUALT_PEN_COLOR;
+
+    public boolean m_bNeedsDrawing = true;
+
+    final static Color DEFUALT_FILL_COLOR = new Color(128, 128, 128);
+    final static Color DEFUALT_PEN_COLOR = new Color(0, 0, 0);
+    String m_sID;
+
+    Document m_doc;
+    
+    String getID() {
+        return m_sID;
+    }
+
+    public Shape() {
+    }
+
+    public Shape(Node node, Document doc) {
+    	m_doc = doc;
+    }
+
+    public void draw(Graphics2D g, JPanel panel) {
+    }
+
+    void drawLabel(Graphics2D g) {
+        if (getLabel() != null) {
+            FontMetrics fm = g.getFontMetrics(g.getFont());
+            String sLabel = getLabel();
+            if (m_doc != null && m_doc.sanitiseIDs()) {
+            	if (sLabel.contains(".")) {
+            		sLabel = sLabel.substring(0, sLabel.indexOf('.'));
+            	}
+            }
+            int i = 0;
+            while (sLabel.indexOf('\n') >= 0) {
+                String sStr = sLabel.substring(0, sLabel.indexOf('\n'));
+                g.drawString(sStr, m_x + m_w / 2 - fm.stringWidth(sStr) / 2, m_y + m_h / 2 + i * fm.getHeight());
+                sLabel = sLabel.substring(sStr.length() + 1);
+                i++;
+            }
+            g.drawString(sLabel, m_x + m_w / 2 - fm.stringWidth(sLabel) / 2, m_y + m_h / 2 + i * fm.getHeight());
+        }
+    } // drawLabel
+
+    List<TrackPoint> getTracker() {
+        List<TrackPoint> tracker = new ArrayList<TrackPoint>(8);
+        tracker.add(new TrackPoint(m_x, m_y, Cursor.NW_RESIZE_CURSOR));
+        tracker.add(new TrackPoint(m_x + m_w, m_y, Cursor.NE_RESIZE_CURSOR));
+        tracker.add(new TrackPoint(m_x, m_y + m_h, Cursor.SW_RESIZE_CURSOR));
+        tracker.add(new TrackPoint(m_x + m_w, m_y + m_h, Cursor.SE_RESIZE_CURSOR));
+
+        tracker.add(new TrackPoint(m_x, m_y + m_h / 2, Cursor.W_RESIZE_CURSOR));
+        tracker.add(new TrackPoint(m_x + m_w, m_y + m_h / 2, Cursor.E_RESIZE_CURSOR));
+        tracker.add(new TrackPoint(m_x + m_w / 2, m_y, Cursor.N_RESIZE_CURSOR));
+        tracker.add(new TrackPoint(m_x + m_w / 2, m_y + m_h, Cursor.S_RESIZE_CURSOR));
+        return tracker;
+    }
+
+    void parse(Node node, Document doc, boolean bReconstructPlugins) {
+        if (node.getAttributes().getNamedItem("id") != null) {
+            m_sID = node.getAttributes().getNamedItem("id").getNodeValue();
+        }
+        if (node.getAttributes().getNamedItem("x") != null) {
+            m_x = (new Integer(node.getAttributes().getNamedItem("x").getNodeValue())).intValue();
+            m_x += 400;
+        }
+        if (node.getAttributes().getNamedItem("y") != null) {
+            m_y = (new Integer(node.getAttributes().getNamedItem("y").getNodeValue())).intValue();
+            if (node.getAttributes().getNamedItem("h") != null) {
+                m_h = (new Integer(node.getAttributes().getNamedItem("h").getNodeValue())).intValue();
+            }
+            m_y = 550 - m_y - m_h;
+        }
+        if (node.getAttributes().getNamedItem("w") != null) {
+            m_w = (new Integer(node.getAttributes().getNamedItem("w").getNodeValue())).intValue();
+        }
+        if (node.getAttributes().getNamedItem("penwidth") != null) {
+            m_nPenWidth = (new Integer(node.getAttributes().getNamedItem("penwidth").getNodeValue())).intValue();
+        }
+        if (node.getAttributes().getNamedItem("fillcolor") != null) {
+            m_fillcolor = string2Color(node.getAttributes().getNamedItem("fillcolor").getNodeValue());
+        }
+        if (node.getAttributes().getNamedItem("pencolor") != null) {
+            m_pencolor = string2Color(node.getAttributes().getNamedItem("pencolor").getNodeValue());
+        }
+        if (node.getAttributes().getNamedItem("filled") != null) {
+            m_bFilled = !node.getAttributes().getNamedItem("filled").getNodeValue().equals("no");
+        }
+    }
+
+    String XMLnormalizeAtt(String sStr) {
+        StringBuffer sStr2 = new StringBuffer();
+        for (int iStr = 0; iStr < sStr.length(); iStr++) {
+            switch (sStr.charAt(iStr)) {
+                case '<':
+                    sStr2.append("<");
+                    break;
+                case '>':
+                    sStr2.append(">");
+                    break;
+                case '\"':
+                    sStr2.append(""");
+                    break;
+                case '\'':
+                    sStr2.append("'");
+                    break;
+                case '&':
+                    sStr2.append("&");
+                    break;
+                case 13:
+                    break;
+                case '\n':
+                    sStr2.append("&#xD;&#xA;");
+                    break;
+                default:
+                    sStr2.append(sStr.charAt(iStr));
+            }
+        }
+        return sStr2.toString();
+    } // XMLnormalizeAtt
+
+    String getAtts() {
+        return " id='" + getID() + "'" +
+                " x='" + (m_x - 400) + "'" +
+                " y='" + (550 - m_y - m_h) + "'" +
+                " w='" + m_w + "'" +
+                " h='" + m_h + "'" +
+                (m_nPenWidth != 1 ? " penwidth='" + m_nPenWidth + "'" : "") +
+                (!m_bFilled ? " filled='no'" : "") +
+                (m_fillcolor.equals(DEFUALT_FILL_COLOR) ? "" : " fillcolor='" + m_fillcolor.getRed() + " " + m_fillcolor.getGreen() + " " + m_fillcolor.getBlue() + "'") +
+                (m_pencolor.equals(DEFUALT_PEN_COLOR) ? "" : " pencolor='" + m_pencolor.getRed() + " " + m_pencolor.getGreen() + " " + m_pencolor.getBlue() + "'")
+                ;
+    }
+
+    void assignFrom(Shape other) {
+        m_x = other.m_x;
+        m_y = other.m_y;
+        m_w = other.m_w;
+        m_h = other.m_h;
+        m_nPenWidth = other.m_nPenWidth;
+        m_bFilled = other.m_bFilled;
+        m_fillcolor = other.m_fillcolor;
+        m_pencolor = other.m_pencolor;
+    }
+
+    Color string2Color(String sColor) {
+        int iSpace = sColor.indexOf(' ');
+        if (iSpace < 0) {
+            return new Color(128, 128, 128);
+        }
+        int iStart = 0;
+        String sR = sColor.substring(iStart, iSpace);
+        int r = (new Integer(sR)).intValue();
+        iStart = iSpace + 1;
+        iSpace = sColor.indexOf(' ', iStart);
+        if (iSpace < 0) {
+            return new Color(128, 128, 128);
+        }
+        String sG = sColor.substring(iStart, iSpace);
+        int g = (new Integer(sG)).intValue();
+        iStart = iSpace + 1;
+        iSpace = sColor.indexOf(' ', iStart);
+        if (iSpace < 0) {
+            iSpace = sColor.length();
+        }
+        String sB = sColor.substring(iStart, iSpace);
+        int b = (new Integer(sB)).intValue();
+        return new Color(r, g, b);
+    } // string2Color
+
+    public String getXML() {
+        return "<shape" + getAtts() + "/>";
+    }
+
+    boolean intersects(int nX, int nY) {
+        return (nX >= m_x - 1 && nX <= m_x + m_w + 1 && nY >= m_y - 1 && nY <= m_y + m_h + 1);
+    }
+
+    boolean intersects(Rectangle rect) {
+        return rect.intersects(m_x - 1, m_y - 1, m_w + 2, m_h + 2);
+    }
+//	boolean intersects(int nX, int nY) {
+//		return false;
+//	}
+//	boolean intersects(Rectangle rect) {
+//		return false;
+//	}
+
+    int offsetX(int nX) {
+        return nX - m_x;
+    }
+
+    int offsetY(int nY) {
+        return nY - m_y;
+    }
+
+    void offset(int dX, int dY) {
+        m_x += dX;
+        m_y += dY;
+    }
+
+    void movePosition(int nOffsetX, int nOffsetY, int nToX, int nToY) {
+        m_x = nToX - nOffsetX;
+        m_y = nToY - nOffsetY;
+    } // movePosition
+
+    void movePoint(int nPoint, int nOffsetX, int nOffsetY, int nToX, int nToY) {
+        switch (nPoint) {
+            case 0:
+                m_w = m_w + m_x - nToX + nOffsetX;
+                m_x = nToX - nOffsetX;
+                m_h = m_h + m_y - nToY + nOffsetY;
+                m_y = nToY - nOffsetY;
+                break;
+            case 1:
+                m_w = nToX - nOffsetX - m_x;
+                m_h = m_h + m_y - nToY + nOffsetY;
+                m_y = nToY - nOffsetY;
+                break;
+            case 2:
+                m_w = m_w + m_x - nToX + nOffsetX;
+                m_x = nToX - nOffsetX;
+                m_h = nToY - nOffsetY - m_y;
+                break;
+            case 3:
+                m_w = nToX - nOffsetX - m_x;
+                m_h = nToY - nOffsetY - m_y;
+                break;
+            case 5:
+                m_w = nToX - nOffsetX - m_x;
+                break;
+            case 4:
+                m_w = m_w + m_x - nToX + nOffsetX;
+                m_x = nToX - nOffsetX;
+                break;
+            case 7:
+                m_h = nToY - nOffsetY - m_y;
+                break;
+            case 6:
+                m_h = m_h + m_y - nToY + nOffsetY;
+                m_y = nToY - nOffsetY;
+                break;
+        }
+    } // movePoint
+
+    void normalize() {
+        int nX1 = m_x;
+        int nX2 = m_x + m_w;
+        int nY1 = m_y;
+        int nY2 = m_y + m_h;
+        m_x = Math.min(nX1, nX2);
+        m_w = Math.max(nX1, nX2) - m_x;
+        m_y = Math.min(nY1, nY2);
+        m_h = Math.max(nY1, nY2) - m_y;
+    }
+
+    public Color getFillColor() {
+        return m_fillcolor;
+    }
+
+    void setFillColor(Color color) {
+        m_fillcolor = color;
+    }
+
+    Color getPenColor() {
+        return m_pencolor;
+    }
+
+    void setPenColor(Color color) {
+        m_pencolor = color;
+    }
+
+    int getX() {
+        return m_x;
+    }
+
+    int getY() {
+        return m_y;
+    }
+
+    int getX2() {
+        return m_x + m_w;
+    }
+
+    int getY2() {
+        return m_y + m_h;
+    }
+
+    void setX(int nX) {
+        m_x = nX;
+    }
+
+    void setY(int nY) {
+        m_y = nY;
+    }
+
+    void setX2(int nX2) {
+        m_w = nX2 - m_x;
+    }
+
+    void setY2(int nY2) {
+        m_h = nY2 - m_y;
+    }
+
+    //void setLabel(String sLabel) {}
+    String getLabel() {
+        return "";
+    }
+
+    boolean isFilled() {
+        return m_bFilled;
+    }
+
+    void toggleFilled() {
+        m_bFilled = !m_bFilled;
+    }
+
+    int getPenWidth() {
+        return m_nPenWidth;
+    }
+
+    void setPenWidth(int nPenWidth) {
+        m_nPenWidth = nPenWidth;
+    }
+
+    abstract void toSVG(PrintStream out);
+
+    void drawSVGString(PrintStream out, Font font, Color color, String sTextAnchor) {
+        if (getLabel() != null) {
+
+            String sLabel = getLabel();
+            int i = 0;
+            while (sLabel.indexOf('\n') >= 0) {
+                String sStr = sLabel.substring(0, sLabel.indexOf('\n'));
+                out.println("<text x='"
+                        + (m_x + m_w / 2)
+                        + "' y='"
+                        + (m_y + m_h / 2)
+                        + "' font-family='" + font.getFamily() + "' "
+                        + "font-size='" + font.getSize() + "pt' " + "font-style='"
+                        + (font.isBold() ? "oblique" : "") + (font.isItalic() ? "italic" : "") + "' "
+                        +
+                        "stroke='rgb(" + color.getRed() + "," + color.getGreen()
+                        + "," + color.getBlue() + ")' text-anchor='" + sTextAnchor + "'>" + sStr + "</text>\n");
+                sLabel = sLabel.substring(sStr.length() + 1);
+                i++;
+            }
+            out.println("<text x='"
+                    + (m_x + m_w / 2)
+                    + "' y='"
+                    + (m_y + m_h / 2)
+                    + "' font-family='" + font.getFamily() + "' "
+                    + "font-size='" + font.getSize() + "pt' " + "font-style='"
+                    + (font.isBold() ? "oblique" : "") + (font.isItalic() ? "italic" : "") + "' "
+                    +
+                    "stroke='rgb(" + color.getRed() + "," + color.getGreen() + "," + color.getBlue() + ")' " +
+                    "text-anchor='" + sTextAnchor + "'>" + sLabel + "</text>\n");
+        }
+    }
+}
diff --git a/src/beast/app/draw/SmallButton.java b/src/beast/app/draw/SmallButton.java
new file mode 100644
index 0000000..3fc0f81
--- /dev/null
+++ b/src/beast/app/draw/SmallButton.java
@@ -0,0 +1,45 @@
+package beast.app.draw;
+
+import javax.swing.*;
+
+import java.awt.*;
+import java.net.URL;
+
+/**
+ * @author Alexei Drummond
+ */
+public class SmallButton extends JButton {
+
+    public enum ButtonType {roundRect, square, toolbar}
+    
+    public SmallButton(String label, boolean isEnabled) {
+        this(label, isEnabled, ButtonType.square);
+        setIcon(label);
+    }
+
+	public SmallButton(String label, boolean isEnabled, ButtonType buttonType) {
+        super(label);
+        setEnabled(isEnabled);
+        setButtonType(buttonType);
+        setIcon(label);
+    }
+
+	private void setIcon(String label) {
+        if (label.equals("e")) {
+        	setLabel("");
+            URL url = ClassLoader.getSystemResource(ModelBuilder.ICONPATH + "edit.png");
+            Icon icon = new ImageIcon(url);
+        	setIcon(icon);
+            setBorder(BorderFactory.createEmptyBorder());
+        }
+	}
+
+    public void setButtonType(ButtonType buttonType) {
+        putClientProperty("JButton.buttonType", buttonType.toString());    
+    }
+    
+    public void setImg(Image image) {
+        setIcon(new ImageIcon(image));
+    }
+
+}
diff --git a/src/beast/app/draw/SmallButtonOld.java b/src/beast/app/draw/SmallButtonOld.java
new file mode 100644
index 0000000..5dc6043
--- /dev/null
+++ b/src/beast/app/draw/SmallButtonOld.java
@@ -0,0 +1,106 @@
+package beast.app.draw;
+
+
+import java.awt.AWTEvent;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.GradientPaint;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Image;
+import java.awt.Point;
+import java.awt.event.MouseEvent;
+
+import javax.swing.JButton;
+
+/**
+ * Miniature round button
+ */
+public class SmallButtonOld extends JButton {
+    private static final long serialVersionUID = 1L;
+    /**
+     * flag to indicate the button is pressed
+     */
+    protected boolean m_bPressed = false;
+
+    Image image = null;
+
+    public void setImg(Image image) {
+        this.image = image;
+    }
+
+    public SmallButtonOld(String label, boolean bIsEnabled) {
+        super(label);
+        //this.label = label;
+        enableEvents(AWTEvent.MOUSE_EVENT_MASK);
+        setBackground(new Color(128, 128, 255));
+        setPreferredSize(new Dimension(15, 15));
+        setSize(15, 15);
+        setMinimumSize(new Dimension(15, 15));
+        setMaximumSize(new Dimension(15, 15));
+        setEnabled(bIsEnabled);
+    } // c'tor
+
+    /**
+     * paints the SmallButton
+     */
+    public void paint(Graphics g) {
+        if (image != null) {
+            g.drawImage(image, 0, 0, null);
+            return;
+        }
+        //super.paint(g);
+        int s = 14;
+        if (isEnabled()) {
+            if (m_bPressed) {
+                GradientPaint m_gradientPaint = new GradientPaint(new Point(5, 5), Color.WHITE, new Point(getWidth(), getHeight()), getBackground().darker().darker());
+                ((Graphics2D) g).setPaint(m_gradientPaint);
+            } else {
+                //g.setColor(getBackground());
+                GradientPaint m_gradientPaint = new GradientPaint(new Point(0, 0), Color.WHITE, new Point(getWidth(), getHeight()), getBackground());
+                ((Graphics2D) g).setPaint(m_gradientPaint);
+            }
+        } else {
+            g.setColor(new Color(240, 240, 240));
+        }
+        g.fillArc(0, 0, s, s, 0, 360);
+        g.setColor(getBackground().darker().darker().darker());
+        g.drawArc(0, 0, s, s, 0, 360);
+        getBorder().paintBorder(this, g, 0, 0, 15, 15);
+        Font f = getFont();
+        if (f != null) {
+            FontMetrics fm = getFontMetrics(getFont());
+            g.setColor(getForeground());
+            g.drawString(getText(),
+                    s / 2 - fm.stringWidth(getText()) / 2 + 0,
+                    s / 2 + fm.getMaxDescent() + 1);
+        }
+    } // paint
+
+
+    @Override
+    public void processMouseEvent(MouseEvent e) {
+        switch (e.getID()) {
+            case MouseEvent.MOUSE_PRESSED:
+                m_bPressed = true;
+                break;
+            case MouseEvent.MOUSE_RELEASED:
+                if (m_bPressed == true) {
+                    m_bPressed = false;
+                }
+                break;
+//		case MouseEvent.MOUSE_ENTERED:
+//			break;
+            case MouseEvent.MOUSE_EXITED:
+                if (m_bPressed == true) {
+                    m_bPressed = false;
+                }
+                break;
+        }
+        super.processMouseEvent(e);
+        repaint();
+    } // processMouseEvent
+
+} // class SmallButton
diff --git a/src/beast/app/draw/SmallLabel.java b/src/beast/app/draw/SmallLabel.java
new file mode 100644
index 0000000..9e9ba9a
--- /dev/null
+++ b/src/beast/app/draw/SmallLabel.java
@@ -0,0 +1,66 @@
+package beast.app.draw;
+
+
+import java.awt.AWTEvent;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.GradientPaint;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Point;
+
+import javax.swing.JLabel;
+
+/**
+ * Miniature round label
+ */
+public class SmallLabel extends JLabel {
+    private static final long serialVersionUID = 1L;
+    public Color m_circleColor = Color.blue;
+
+    public SmallLabel(String label, Color circleColor) {
+        super(label);
+        //this.label = label;
+        enableEvents(AWTEvent.MOUSE_EVENT_MASK);
+        setBackground(new Color(208, 208, 255));
+        setPreferredSize(new Dimension(15, 15));
+        setSize(15, 15);
+        setMinimumSize(new Dimension(15, 15));
+        setMaximumSize(new Dimension(15, 15));
+        m_circleColor = circleColor;
+        super.setVisible(true);
+    } // c'tor
+
+    /**
+     * paints the SmallButton
+     */
+    public void paint(Graphics g) {
+        if (m_bIsEnabled) {
+            int s = 14;
+            GradientPaint m_gradientPaint = new GradientPaint(new Point(0, 0), Color.WHITE, new Point(getWidth(), getHeight()), m_circleColor);
+            ((Graphics2D) g).setPaint(m_gradientPaint);
+            //g.setColor(m_circleColor);
+            g.fillArc(0, 0, s, s, 0, 360);
+            g.setColor(getBackground().darker().darker().darker());
+            g.drawArc(0, 0, s, s, 0, 360);
+            Font f = getFont();
+            if (f != null) {
+                FontMetrics fm = getFontMetrics(getFont());
+                g.setColor(getForeground());
+                g.drawString(getText(),
+                        s / 2 - fm.stringWidth(getText()) / 2 + 0,
+                        s / 2 + fm.getMaxDescent() + 1);
+            }
+        }
+    } // paint
+
+    boolean m_bIsEnabled = true;
+
+    @Override
+    public void setVisible(boolean bIsEnabled) {
+        m_bIsEnabled = bIsEnabled;
+    }
+
+} // class SmallButton
diff --git a/src/beast/app/draw/StringInputEditor.java b/src/beast/app/draw/StringInputEditor.java
new file mode 100644
index 0000000..51d9379
--- /dev/null
+++ b/src/beast/app/draw/StringInputEditor.java
@@ -0,0 +1,28 @@
+package beast.app.draw;
+
+import beast.app.beauti.BeautiDoc;
+
+public class StringInputEditor extends InputEditor.Base {
+    private static final long serialVersionUID = 1L;
+
+    //public StringInputEditor()) {}
+    public StringInputEditor(BeautiDoc doc) {
+        super(doc);
+    }
+
+    @Override
+    public Class<?> type() {
+        return String.class;
+    }
+
+
+    @Override
+    void setUpEntry() {
+        super.setUpEntry();
+        //Dimension size = new Dimension(200,20);
+        //m_entry.setMinimumSize(size);
+//		m_entry.setPreferredSize(size);
+//		m_entry.setSize(size);
+    }
+
+} // class StringInputEditor
diff --git a/src/beast/app/draw/TrackPoint.java b/src/beast/app/draw/TrackPoint.java
new file mode 100644
index 0000000..4de76e7
--- /dev/null
+++ b/src/beast/app/draw/TrackPoint.java
@@ -0,0 +1,36 @@
+/*
+* File TrackPoint.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+package beast.app.draw;
+
+public class TrackPoint {
+    public int m_nX;
+    public int m_nY, m_nCursor;
+
+    public TrackPoint(int nX, int nY, int nCursor) {
+        m_nX = nX;
+        m_nY = nY;
+        m_nCursor = nCursor;
+    }
+}
diff --git a/src/beast/app/draw/icons/GenerationD.png b/src/beast/app/draw/icons/GenerationD.png
new file mode 100644
index 0000000..9465aaf
Binary files /dev/null and b/src/beast/app/draw/icons/GenerationD.png differ
diff --git a/src/beast/app/draw/icons/add.png b/src/beast/app/draw/icons/add.png
new file mode 100644
index 0000000..c0cc5a0
Binary files /dev/null and b/src/beast/app/draw/icons/add.png differ
diff --git a/src/beast/app/draw/icons/alignbottom.png b/src/beast/app/draw/icons/alignbottom.png
new file mode 100644
index 0000000..2448f7a
Binary files /dev/null and b/src/beast/app/draw/icons/alignbottom.png differ
diff --git a/src/beast/app/draw/icons/alignleft.png b/src/beast/app/draw/icons/alignleft.png
new file mode 100644
index 0000000..25f05b6
Binary files /dev/null and b/src/beast/app/draw/icons/alignleft.png differ
diff --git a/src/beast/app/draw/icons/alignright.png b/src/beast/app/draw/icons/alignright.png
new file mode 100644
index 0000000..2328dfa
Binary files /dev/null and b/src/beast/app/draw/icons/alignright.png differ
diff --git a/src/beast/app/draw/icons/aligntop.png b/src/beast/app/draw/icons/aligntop.png
new file mode 100644
index 0000000..cc178c8
Binary files /dev/null and b/src/beast/app/draw/icons/aligntop.png differ
diff --git a/src/beast/app/draw/icons/arrow.bmp b/src/beast/app/draw/icons/arrow.bmp
new file mode 100644
index 0000000..7b91e29
Binary files /dev/null and b/src/beast/app/draw/icons/arrow.bmp differ
diff --git a/src/beast/app/draw/icons/arrow.png b/src/beast/app/draw/icons/arrow.png
new file mode 100644
index 0000000..6cf2002
Binary files /dev/null and b/src/beast/app/draw/icons/arrow.png differ
diff --git a/src/beast/app/draw/icons/beast.png b/src/beast/app/draw/icons/beast.png
new file mode 100644
index 0000000..585b4d1
Binary files /dev/null and b/src/beast/app/draw/icons/beast.png differ
diff --git a/src/beast/app/draw/icons/beauti.png b/src/beast/app/draw/icons/beauti.png
new file mode 100644
index 0000000..3052af8
Binary files /dev/null and b/src/beast/app/draw/icons/beauti.png differ
diff --git a/src/beast/app/draw/icons/bigger.png b/src/beast/app/draw/icons/bigger.png
new file mode 100644
index 0000000..b9b4a0e
Binary files /dev/null and b/src/beast/app/draw/icons/bigger.png differ
diff --git a/src/beast/app/draw/icons/bold.png b/src/beast/app/draw/icons/bold.png
new file mode 100644
index 0000000..e506901
Binary files /dev/null and b/src/beast/app/draw/icons/bold.png differ
diff --git a/src/beast/app/draw/icons/center.png b/src/beast/app/draw/icons/center.png
new file mode 100644
index 0000000..3f138f2
Binary files /dev/null and b/src/beast/app/draw/icons/center.png differ
diff --git a/src/beast/app/draw/icons/centerhorizontal.png b/src/beast/app/draw/icons/centerhorizontal.png
new file mode 100644
index 0000000..0181f62
Binary files /dev/null and b/src/beast/app/draw/icons/centerhorizontal.png differ
diff --git a/src/beast/app/draw/icons/centervertical.png b/src/beast/app/draw/icons/centervertical.png
new file mode 100644
index 0000000..b033824
Binary files /dev/null and b/src/beast/app/draw/icons/centervertical.png differ
diff --git a/src/beast/app/draw/icons/color.png b/src/beast/app/draw/icons/color.png
new file mode 100644
index 0000000..3320993
Binary files /dev/null and b/src/beast/app/draw/icons/color.png differ
diff --git a/src/beast/app/draw/icons/constant.png b/src/beast/app/draw/icons/constant.png
new file mode 100644
index 0000000..7cce686
Binary files /dev/null and b/src/beast/app/draw/icons/constant.png differ
diff --git a/src/beast/app/draw/icons/copy.png b/src/beast/app/draw/icons/copy.png
new file mode 100644
index 0000000..158e35f
Binary files /dev/null and b/src/beast/app/draw/icons/copy.png differ
diff --git a/src/beast/app/draw/icons/cut.png b/src/beast/app/draw/icons/cut.png
new file mode 100644
index 0000000..f26bc97
Binary files /dev/null and b/src/beast/app/draw/icons/cut.png differ
diff --git a/src/beast/app/draw/icons/del.png b/src/beast/app/draw/icons/del.png
new file mode 100644
index 0000000..62bec6e
Binary files /dev/null and b/src/beast/app/draw/icons/del.png differ
diff --git a/src/beast/app/draw/icons/down.png b/src/beast/app/draw/icons/down.png
new file mode 100644
index 0000000..0f5be63
Binary files /dev/null and b/src/beast/app/draw/icons/down.png differ
diff --git a/src/beast/app/draw/icons/edit.png b/src/beast/app/draw/icons/edit.png
new file mode 100644
index 0000000..5cff574
Binary files /dev/null and b/src/beast/app/draw/icons/edit.png differ
diff --git a/src/beast/app/draw/icons/ellipse.bmp b/src/beast/app/draw/icons/ellipse.bmp
new file mode 100644
index 0000000..e95a332
Binary files /dev/null and b/src/beast/app/draw/icons/ellipse.bmp differ
diff --git a/src/beast/app/draw/icons/ellipse.png b/src/beast/app/draw/icons/ellipse.png
new file mode 100644
index 0000000..4e5e5e5
Binary files /dev/null and b/src/beast/app/draw/icons/ellipse.png differ
diff --git a/src/beast/app/draw/icons/font.png b/src/beast/app/draw/icons/font.png
new file mode 100644
index 0000000..3ae8946
Binary files /dev/null and b/src/beast/app/draw/icons/font.png differ
diff --git a/src/beast/app/draw/icons/function.png b/src/beast/app/draw/icons/function.png
new file mode 100644
index 0000000..5a89475
Binary files /dev/null and b/src/beast/app/draw/icons/function.png differ
diff --git a/src/beast/app/draw/icons/help.png b/src/beast/app/draw/icons/help.png
new file mode 100644
index 0000000..5a61b18
Binary files /dev/null and b/src/beast/app/draw/icons/help.png differ
diff --git a/src/beast/app/draw/icons/italic.png b/src/beast/app/draw/icons/italic.png
new file mode 100644
index 0000000..30becef
Binary files /dev/null and b/src/beast/app/draw/icons/italic.png differ
diff --git a/src/beast/app/draw/icons/left.png b/src/beast/app/draw/icons/left.png
new file mode 100644
index 0000000..4df8214
Binary files /dev/null and b/src/beast/app/draw/icons/left.png differ
diff --git a/src/beast/app/draw/icons/line.bmp b/src/beast/app/draw/icons/line.bmp
new file mode 100644
index 0000000..69369b5
Binary files /dev/null and b/src/beast/app/draw/icons/line.bmp differ
diff --git a/src/beast/app/draw/icons/line.png b/src/beast/app/draw/icons/line.png
new file mode 100644
index 0000000..cb4b620
Binary files /dev/null and b/src/beast/app/draw/icons/line.png differ
diff --git a/src/beast/app/draw/icons/new.png b/src/beast/app/draw/icons/new.png
new file mode 100644
index 0000000..cb8771a
Binary files /dev/null and b/src/beast/app/draw/icons/new.png differ
diff --git a/src/beast/app/draw/icons/open.png b/src/beast/app/draw/icons/open.png
new file mode 100644
index 0000000..42ef388
Binary files /dev/null and b/src/beast/app/draw/icons/open.png differ
diff --git a/src/beast/app/draw/icons/paste.png b/src/beast/app/draw/icons/paste.png
new file mode 100644
index 0000000..c5b80c7
Binary files /dev/null and b/src/beast/app/draw/icons/paste.png differ
diff --git a/src/beast/app/draw/icons/poly.bmp b/src/beast/app/draw/icons/poly.bmp
new file mode 100644
index 0000000..b46d4e8
Binary files /dev/null and b/src/beast/app/draw/icons/poly.bmp differ
diff --git a/src/beast/app/draw/icons/poly.png b/src/beast/app/draw/icons/poly.png
new file mode 100644
index 0000000..9ce1271
Binary files /dev/null and b/src/beast/app/draw/icons/poly.png differ
diff --git a/src/beast/app/draw/icons/print.png b/src/beast/app/draw/icons/print.png
new file mode 100644
index 0000000..abfef37
Binary files /dev/null and b/src/beast/app/draw/icons/print.png differ
diff --git a/src/beast/app/draw/icons/rect.bmp b/src/beast/app/draw/icons/rect.bmp
new file mode 100644
index 0000000..a9aa62c
Binary files /dev/null and b/src/beast/app/draw/icons/rect.bmp differ
diff --git a/src/beast/app/draw/icons/rect.png b/src/beast/app/draw/icons/rect.png
new file mode 100644
index 0000000..c0865f0
Binary files /dev/null and b/src/beast/app/draw/icons/rect.png differ
diff --git a/src/beast/app/draw/icons/redo.png b/src/beast/app/draw/icons/redo.png
new file mode 100644
index 0000000..41ed0be
Binary files /dev/null and b/src/beast/app/draw/icons/redo.png differ
diff --git a/src/beast/app/draw/icons/right.png b/src/beast/app/draw/icons/right.png
new file mode 100644
index 0000000..c99318f
Binary files /dev/null and b/src/beast/app/draw/icons/right.png differ
diff --git a/src/beast/app/draw/icons/rrect.bmp b/src/beast/app/draw/icons/rrect.bmp
new file mode 100644
index 0000000..539aac3
Binary files /dev/null and b/src/beast/app/draw/icons/rrect.bmp differ
diff --git a/src/beast/app/draw/icons/rrect.png b/src/beast/app/draw/icons/rrect.png
new file mode 100644
index 0000000..7f03ea2
Binary files /dev/null and b/src/beast/app/draw/icons/rrect.png differ
diff --git a/src/beast/app/draw/icons/save.png b/src/beast/app/draw/icons/save.png
new file mode 100644
index 0000000..8748379
Binary files /dev/null and b/src/beast/app/draw/icons/save.png differ
diff --git a/src/beast/app/draw/icons/select.bmp b/src/beast/app/draw/icons/select.bmp
new file mode 100644
index 0000000..0e1d649
Binary files /dev/null and b/src/beast/app/draw/icons/select.bmp differ
diff --git a/src/beast/app/draw/icons/select.gif b/src/beast/app/draw/icons/select.gif
new file mode 100644
index 0000000..168f4d7
Binary files /dev/null and b/src/beast/app/draw/icons/select.gif differ
diff --git a/src/beast/app/draw/icons/select.jpg b/src/beast/app/draw/icons/select.jpg
new file mode 100644
index 0000000..345309d
Binary files /dev/null and b/src/beast/app/draw/icons/select.jpg differ
diff --git a/src/beast/app/draw/icons/select.png b/src/beast/app/draw/icons/select.png
new file mode 100644
index 0000000..306c30b
Binary files /dev/null and b/src/beast/app/draw/icons/select.png differ
diff --git a/src/beast/app/draw/icons/smaller.png b/src/beast/app/draw/icons/smaller.png
new file mode 100644
index 0000000..522af5b
Binary files /dev/null and b/src/beast/app/draw/icons/smaller.png differ
diff --git a/src/beast/app/draw/icons/spacehorizontal.png b/src/beast/app/draw/icons/spacehorizontal.png
new file mode 100644
index 0000000..fbe9479
Binary files /dev/null and b/src/beast/app/draw/icons/spacehorizontal.png differ
diff --git a/src/beast/app/draw/icons/spacevertical.png b/src/beast/app/draw/icons/spacevertical.png
new file mode 100644
index 0000000..fb6aad0
Binary files /dev/null and b/src/beast/app/draw/icons/spacevertical.png differ
diff --git a/src/beast/app/draw/icons/tcolor.png b/src/beast/app/draw/icons/tcolor.png
new file mode 100644
index 0000000..3e8d283
Binary files /dev/null and b/src/beast/app/draw/icons/tcolor.png differ
diff --git a/src/beast/app/draw/icons/undo.png b/src/beast/app/draw/icons/undo.png
new file mode 100644
index 0000000..78c252a
Binary files /dev/null and b/src/beast/app/draw/icons/undo.png differ
diff --git a/src/beast/app/seqgen/MergeDataWith.java b/src/beast/app/seqgen/MergeDataWith.java
new file mode 100644
index 0000000..46a70e8
--- /dev/null
+++ b/src/beast/app/seqgen/MergeDataWith.java
@@ -0,0 +1,76 @@
+package beast.app.seqgen;
+
+import java.io.*;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import beast.app.beauti.BeautiDoc;
+import beast.core.*;
+import beast.core.Input.*;
+import beast.evolution.alignment.*;
+import beast.util.*;
+
+ at Description("Helper for Sequence Simulator, allows specifying template input file and destination output file")
+public class MergeDataWith extends BEASTObject {
+	public Input<String> templateFileInput = new Input<String>("template","name of template file. " +
+			"The template file should be a valid beast2 XML file with a single (possibly empty) alignment. " +
+			"This alignment will be replaced by the alignment generated by the SequenceSimulator. " +
+			"Any occurrance of $(n) will be replaced by the iteration number of the SequenceSimulator. " +
+			"For example, calling a log filename \"output$(n).log\" will be replaced by " +
+			"\"output1.log\" at first iteration, \"output2.log\" at seccond iteration, etc..", Validate.REQUIRED);
+	public Input<String> outputFileInput = new Input<String>("output","name of the output file. " +
+			"Instances of $(n) are replaced by iteration number.", Validate.REQUIRED);
+
+	File templateFile;
+	
+	@Override
+	public void initAndValidate() throws Exception {
+		templateFile = new File(templateFileInput.get());
+		if (!(templateFile.exists())) {
+			throw new RuntimeException("Template file " + templateFileInput.get() + " does not exist"); 
+		}
+	} // initAndValidate
+	
+	
+	void process(Alignment data, int iteration) throws Exception {
+		// read template
+		String templateXML = BeautiDoc.load(templateFile);
+		templateXML = templateXML.replaceAll("\\$\\(n\\)", iteration+"");
+		XMLParser parser = new XMLParser();
+		BEASTInterface b = parser.parseBareFragment(templateXML, false);
+
+		// repalce alignment
+		Alignment a = getAlignment(b);
+		List<Sequence> sequences = a.sequenceInput.get();
+		sequences.clear();
+		sequences.addAll(data.sequenceInput.get());
+
+		// write file
+		String outputFile = outputFileInput.get();
+		outputFile = outputFile.replaceAll("\\$\\(n\\)", iteration+"");
+		FileWriter outfile = new FileWriter(outputFile);
+		
+		Set<BEASTInterface> plugins = new HashSet<BEASTInterface>();
+		String sXML = new XMLProducer().toXML(b, plugins);
+        outfile.write(sXML);
+        outfile.close();
+	} // process
+
+
+	private Alignment getAlignment(BEASTInterface b) throws IllegalArgumentException, IllegalAccessException {
+		Alignment a = null;
+		for (BEASTInterface i : b.listActivePlugins()) {
+			if (i.getClass().equals(Alignment.class)){
+				return (Alignment) i;
+			} else {
+				a = getAlignment(i);
+				if (a != null) {
+					return a;
+				}
+			}
+		}
+		return null;
+	} // getAlignment
+	
+}
diff --git a/src/beast/app/seqgen/SequenceSimulator.java b/src/beast/app/seqgen/SequenceSimulator.java
new file mode 100644
index 0000000..d26317d
--- /dev/null
+++ b/src/beast/app/seqgen/SequenceSimulator.java
@@ -0,0 +1,321 @@
+package beast.app.seqgen;
+
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.BEASTInterface;
+import beast.core.Input.Validate;
+import beast.evolution.alignment.Alignment;
+import beast.evolution.alignment.Sequence;
+import beast.evolution.branchratemodel.BranchRateModel;
+import beast.evolution.datatype.DataType;
+import beast.evolution.likelihood.TreeLikelihood;
+import beast.evolution.sitemodel.SiteModel;
+import beast.evolution.tree.Node;
+import beast.evolution.tree.Tree;
+import beast.util.Randomizer;
+import beast.util.XMLParser;
+import beast.util.XMLProducer;
+
+
+
+/**
+ * @author remco at cs.waikato.ac.nz
+ */
+ at Description("Performs random sequence generation for a given site model. " +
+        "Sequences for the leave nodes in the tree are returned as an alignment.")
+public class SequenceSimulator extends beast.core.Runnable {
+    public Input<Alignment> m_data = new Input<Alignment>("data", "alignment data which specifies datatype and taxa of the beast.tree", Validate.REQUIRED);
+    public Input<Tree> m_treeInput = new Input<Tree>("tree", "phylogenetic beast.tree with sequence data in the leafs", Validate.REQUIRED);
+    public Input<SiteModel.Base> m_pSiteModelInput = new Input<SiteModel.Base>("siteModel", "site model for leafs in the beast.tree", Validate.REQUIRED);
+    public Input<BranchRateModel.Base> m_pBranchRateModelInput = new Input<BranchRateModel.Base>("branchRateModel",
+            "A model describing the rates on the branches of the beast.tree.");
+    public Input<Integer> m_sequenceLengthInput = new Input<Integer>("sequencelength", "nr of samples to generate (default 1000).", 1000);
+    public Input<String> m_outputFileNameInput = new Input<String>(
+            "outputFileName",
+            "If provided, simulated alignment is written to this file rather "
+            + "than to standard out.");
+
+    public Input<List<MergeDataWith>> mergeListInput = new Input<List<MergeDataWith>>("merge", "specifies template used to merge the generated alignment with", new ArrayList<MergeDataWith>());
+    public Input<Integer> iterationsInput = new Input<Integer>("iterations","number of times the data is generated", 1);
+    
+    /**
+     * nr of samples to generate *
+     */
+    protected int m_sequenceLength;
+    /**
+     * tree used for generating samples *
+     */
+    protected Tree m_tree;
+    /**
+     * site model used for generating samples *
+     */
+    protected SiteModel.Base m_siteModel;
+    /**
+     * branch rate model used for generating samples *
+     */
+    protected BranchRateModel m_branchRateModel;
+    /**
+     * nr of categories in site model *
+     */
+    int m_categoryCount;
+    /**
+     * nr of states in site model *
+     */
+    int m_stateCount;
+    
+    /**
+     * name of output file *
+     */
+    String m_outputFileName;
+
+    /**
+     * an array used to transfer transition probabilities
+     */
+    protected double[][] m_probabilities;
+
+    @Override
+    public void initAndValidate() {
+        m_tree = m_treeInput.get();
+        m_siteModel = m_pSiteModelInput.get();
+        m_branchRateModel = m_pBranchRateModelInput.get();
+        m_sequenceLength = m_sequenceLengthInput.get();
+        m_stateCount = m_data.get().getMaxStateCount();
+        m_categoryCount = m_siteModel.getCategoryCount();
+        m_probabilities = new double[m_categoryCount][m_stateCount * m_stateCount];
+        m_outputFileName = m_outputFileNameInput.get();
+    }
+
+    @Override
+    public void run() throws Exception {
+    	for (int i = 0; i < iterationsInput.get(); i++) {
+	        Alignment alignment = simulate();
+	        
+	        // Write output to stdout or file
+	        PrintStream pstream;
+	        if (m_outputFileName == null)
+	            pstream = System.out;
+	        else
+	            pstream = new PrintStream(m_outputFileName);
+	        pstream.println(new XMLProducer().toRawXML(alignment));
+	        for (MergeDataWith merge : mergeListInput.get()) {
+	        	merge.process(alignment, i);
+	        }
+    	}
+    }
+
+    /**
+     * Convert integer representation of sequence into a Sequence
+     *
+     * @param seq  integer representation of the sequence
+     * @param node used to determine taxon for sequence
+     * @return Sequence
+     * @throws Exception
+     */
+    Sequence intArray2Sequence(int[] seq, Node node) throws Exception {
+        DataType dataType = m_data.get().getDataType();
+        String sSeq = dataType.state2string(seq);
+//    	StringBuilder sSeq = new StringBuilder();
+//    	String sMap = m_data.get().getMap();
+//    	if (sMap != null) {
+//    		for (int i  = 0; i < m_sequenceLength; i++) {
+//    			sSeq.append(sMap.charAt(seq[i]));
+//    		}
+//    	} else {
+//    		for (int i  = 0; i < m_sequenceLength-1; i++) {
+//    			sSeq.append(seq[i] + ",");
+//    		}
+//			sSeq.append(seq[m_sequenceLength-1] + "");
+//    	}
+        List<Sequence> taxa = m_data.get().sequenceInput.get();
+        String sTaxon = taxa.get(node.getNr()).taxonInput.get();
+        return new Sequence(sTaxon, sSeq.toString());
+    } // intArray2Sequence
+
+    /**
+     * perform the actual sequence generation
+     *
+     * @return alignment containing randomly generated sequences for the nodes in the
+     *         leaves of the tree
+     * @throws Exception
+     */
+    public Alignment simulate() throws Exception {
+        Node root = m_tree.getRoot();
+
+
+        double[] categoryProbs = m_siteModel.getCategoryProportions(root);
+        int[] category = new int[m_sequenceLength];
+        for (int i = 0; i < m_sequenceLength; i++) {
+            category[i] = Randomizer.randomChoicePDF(categoryProbs);
+        }
+
+        double[] frequencies = m_siteModel.getSubstitutionModel().getFrequencies();
+        int[] seq = new int[m_sequenceLength];
+        for (int i = 0; i < m_sequenceLength; i++) {
+            seq[i] = Randomizer.randomChoicePDF(frequencies);
+        }
+
+
+        Alignment alignment = new Alignment();
+        alignment.userDataTypeInput.setValue(m_data.get().getDataType(), alignment);
+        alignment.setID("SequenceSimulator");
+
+        traverse(root, seq, category, alignment);
+
+
+        return alignment;
+    } // simulate
+
+    /**
+     * recursively walk through the tree top down, and add sequence to alignment whenever
+     * a leave node is reached.
+     *
+     * @param node           reference to the current node, for which we visit all children
+     * @param parentSequence randomly generated sequence of the parent node
+     * @param category       array of categories for each of the sites
+     * @param alignment
+     * @throws Exception
+     */
+    void traverse(Node node, int[] parentSequence, int[] category, Alignment alignment) throws Exception {
+        for (int iChild = 0; iChild < 2; iChild++) {
+            Node child = (iChild == 0 ? node.getLeft() : node.getRight());
+            for (int i = 0; i < m_categoryCount; i++) {
+                getTransitionProbabilities(m_tree, child, i, m_probabilities[i]);
+            }
+
+            int[] seq = new int[m_sequenceLength];
+            double[] cProb = new double[m_stateCount];
+            for (int i = 0; i < m_sequenceLength; i++) {
+                System.arraycopy(m_probabilities[category[i]], parentSequence[i] * m_stateCount, cProb, 0, m_stateCount);
+                seq[i] = Randomizer.randomChoicePDF(cProb);
+            }
+
+            if (child.isLeaf()) {
+                alignment.sequenceInput.setValue(intArray2Sequence(seq, child), alignment);
+            } else {
+                traverse(child, seq, category, alignment);
+            }
+        }
+    } // traverse
+
+    /**
+     * get transition probability matrix for particular rate category *
+     */
+    void getTransitionProbabilities(Tree tree, Node node, int rateCategory, double[] probs) {
+
+        Node parent = node.getParent();
+        double branchRate = (m_branchRateModel == null ? 1.0 : m_branchRateModel.getRateForBranch(node));
+        branchRate *= m_siteModel.getRateForCategory(rateCategory, node);
+
+        // Get the operational time of the branch
+        //final double branchTime = branchRate * (parent.getHeight() - node.getHeight());
+
+        //if (branchTime < 0.0) {
+        //    throw new RuntimeException("Negative branch length: " + branchTime);
+        //}
+
+        //double branchLength = m_siteModel.getRateForCategory(rateCategory) * branchTime;
+
+//        // TODO Hack until SiteRateModel issue is resolved
+//        if (m_siteModel.getSubstitutionModel() instanceof SubstitutionEpochModel) {
+//            ((SubstitutionEpochModel)m_siteModel.getSubstitutionModel()).getTransitionProbabilities(tree.getNodeHeight(node),
+//                    tree.getNodeHeight(parent),branchLength, probs);
+//            return;
+//        }
+        //m_siteModel.getSubstitutionModel().getTransitionProbabilities(branchLength, probs);
+        m_siteModel.getSubstitutionModel().getTransitionProbabilities(node, parent.getHeight(), node.getHeight(), branchRate, probs);
+
+    } // getTransitionProbabilities
+
+
+    /**
+     * find a treelikelihood object among the plug-ins by recursively inspecting plug-ins *
+     */
+    static TreeLikelihood getTreeLikelihood(BEASTInterface plugin) throws Exception {
+        for (BEASTInterface plugin2 : plugin.listActivePlugins()) {
+            if (plugin2 instanceof TreeLikelihood) {
+                return (TreeLikelihood) plugin2;
+            } else {
+                TreeLikelihood likelihood = getTreeLikelihood(plugin2);
+                if (likelihood != null) {
+                    return likelihood;
+                }
+            }
+        }
+        return null;
+    }
+
+    /**
+     * helper method *
+     */
+    public static void printUsageAndExit() {
+        System.out.println("Usage: java " + SequenceSimulator.class.getName() + " <beast file> <nr of instantiations> [<output file>]");
+        System.out.println("simulates from a treelikelihood specified in the beast file.");
+        System.out.println("<beast file> is name of the path beast file containing the treelikelihood.");
+        System.out.println("<nr of instantiations> is the number of instantiations to be replicated.");
+        System.out.println("<output file> optional name of the file to write the sequence to. By default, the sequence is written to standard output.");
+        System.exit(0);
+    } // printUsageAndExit
+
+
+    @SuppressWarnings("unchecked")
+    public static void main(String[] args) {
+        try {
+            // parse arguments
+            if (args.length < 2) {
+                printUsageAndExit();
+            }
+            String sFile = args[0];
+            int nReplications = Integer.parseInt(args[1]);
+            PrintStream out = System.out;
+            if (args.length == 3) {
+                File file = new File(args[2]);
+                out = new PrintStream(file);
+            }
+
+            // grab the file
+            String sXML = "";
+            BufferedReader fin = new BufferedReader(new FileReader(sFile));
+            while (fin.ready()) {
+                sXML += fin.readLine();
+            }
+            fin.close();
+
+            // parse the xml
+            XMLParser parser = new XMLParser();
+            BEASTInterface plugin = parser.parseFragment(sXML, true);
+
+            // find relevant objects from the model
+            TreeLikelihood treeLikelihood = getTreeLikelihood(plugin);
+            if (treeLikelihood == null) {
+                throw new Exception("No treelikelihood found in file. Giving up now.");
+            }
+            Alignment data = ((Input<Alignment>) treeLikelihood.getInput("data")).get();
+            Tree tree = ((Input<Tree>) treeLikelihood.getInput("tree")).get();
+            SiteModel pSiteModel = ((Input<SiteModel>) treeLikelihood.getInput("siteModel")).get();
+            BranchRateModel pBranchRateModel = ((Input<BranchRateModel>) treeLikelihood.getInput("branchRateModel")).get();
+
+
+            // feed to sequence simulator and generate leaves
+            SequenceSimulator treeSimulator = new SequenceSimulator();
+            treeSimulator.init(data, tree, pSiteModel, pBranchRateModel, nReplications);
+            XMLProducer producer = new XMLProducer();
+            Alignment alignment = treeSimulator.simulate();
+            sXML = producer.toRawXML(alignment);
+            out.println("<beast version='2.0'>");
+            out.println(sXML);
+            out.println("</beast>");
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    } // main
+
+} // class SequenceSimulator
+
diff --git a/src/beast/app/seqgen/SimulatedAlignment.java b/src/beast/app/seqgen/SimulatedAlignment.java
new file mode 100644
index 0000000..39d9fa0
--- /dev/null
+++ b/src/beast/app/seqgen/SimulatedAlignment.java
@@ -0,0 +1,221 @@
+package beast.app.seqgen;
+
+import java.io.PrintStream;
+import java.util.List;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.Input.Validate;
+import beast.evolution.alignment.Alignment;
+import beast.evolution.alignment.Sequence;
+import beast.evolution.branchratemodel.BranchRateModel;
+import beast.evolution.datatype.DataType;
+import beast.evolution.sitemodel.SiteModel;
+import beast.evolution.tree.Node;
+import beast.evolution.tree.Tree;
+import beast.util.Randomizer;
+import beast.util.XMLProducer;
+
+
+/**
+ * @author remco at cs.waikato.ac.nz
+ */
+ at Description("An alignment containing sequences randomly generated using a"
+        + "given site model down a given tree.")
+public class SimulatedAlignment extends Alignment {
+    public Input<Alignment> m_data = new Input<Alignment>("data", "alignment data which specifies datatype and taxa of the beast.tree", Validate.REQUIRED);
+    public Input<Tree> m_treeInput = new Input<Tree>("tree", "phylogenetic beast.tree with sequence data in the leafs", Validate.REQUIRED);
+    public Input<SiteModel.Base> m_pSiteModelInput = new Input<SiteModel.Base>("siteModel", "site model for leafs in the beast.tree", Validate.REQUIRED);
+    public Input<BranchRateModel.Base> m_pBranchRateModelInput = new Input<BranchRateModel.Base>("branchRateModel",
+            "A model describing the rates on the branches of the beast.tree.");
+    public Input<Integer> m_sequenceLengthInput = new Input<Integer>("sequencelength", "nr of samples to generate (default 1000).", 1000);
+    public Input<String> m_outputFileNameInput = new Input<String>(
+            "outputFileName",
+            "If provided, simulated alignment is additionally written to this file.");    
+
+    /**
+     * nr of samples to generate *
+     */
+    protected int m_sequenceLength;
+    /**
+     * tree used for generating samples *
+     */
+    protected Tree m_tree;
+    /**
+     * site model used for generating samples *
+     */
+    protected SiteModel.Base m_siteModel;
+    /**
+     * branch rate model used for generating samples *
+     */
+    protected BranchRateModel m_branchRateModel;
+    /**
+     * nr of categories in site model *
+     */
+    int m_categoryCount;
+    /**
+     * nr of states in site model *
+     */
+    int m_stateCount;
+
+    /**
+     * name of output file *
+     */
+    String m_outputFileName;    
+
+    /**
+     * an array used to transfer transition probabilities
+     */
+    protected double[][] m_probabilities;
+    
+    public SimulatedAlignment() {
+        
+        // Override the sequence input requirement.
+        sequenceInput.setRule(Validate.OPTIONAL);
+    }
+
+    @Override
+    public void initAndValidate() throws Exception {
+        m_tree = m_treeInput.get();
+        m_siteModel = m_pSiteModelInput.get();
+        m_branchRateModel = m_pBranchRateModelInput.get();
+        m_sequenceLength = m_sequenceLengthInput.get();
+        m_stateCount = m_data.get().getMaxStateCount();
+        m_categoryCount = m_siteModel.getCategoryCount();
+        m_probabilities = new double[m_categoryCount][m_stateCount * m_stateCount];
+        m_outputFileName = m_outputFileNameInput.get();
+        
+        sequenceInput.get().clear();
+        
+        simulate();        
+        
+        // Write simulated alignment to disk if requested:
+        if (m_outputFileName != null) {
+            PrintStream pstream = new PrintStream(m_outputFileName);
+            pstream.println(new XMLProducer().toRawXML(this));
+        }
+        
+        super.initAndValidate();
+    }
+
+    /**
+     * Convert integer representation of sequence into a Sequence
+     *
+     * @param seq  integer representation of the sequence
+     * @param node used to determine taxon for sequence
+     * @return Sequence
+     * @throws Exception
+     */
+    Sequence intArray2Sequence(int[] seq, Node node) throws Exception {
+        DataType dataType = m_data.get().getDataType();
+        String sSeq = dataType.state2string(seq);
+//    	StringBuilder sSeq = new StringBuilder();
+//    	String sMap = m_data.get().getMap();
+//    	if (sMap != null) {
+//    		for (int i  = 0; i < m_sequenceLength; i++) {
+//    			sSeq.append(sMap.charAt(seq[i]));
+//    		}
+//    	} else {
+//    		for (int i  = 0; i < m_sequenceLength-1; i++) {
+//    			sSeq.append(seq[i] + ",");
+//    		}
+//			sSeq.append(seq[m_sequenceLength-1] + "");
+//    	}
+        String sTaxon = m_data.get().getTaxaNames().get(node.getNr());
+        return new Sequence(sTaxon, sSeq.toString());
+    } // intArray2Sequence
+
+    /**
+     * perform the actual sequence generation
+     *
+     * @return alignment containing randomly generated sequences for the nodes in the
+     *         leaves of the tree
+     * @throws Exception
+     */
+    public void simulate() throws Exception {
+        Node root = m_tree.getRoot();
+
+
+        double[] categoryProbs = m_siteModel.getCategoryProportions(root);
+        int[] category = new int[m_sequenceLength];
+        for (int i = 0; i < m_sequenceLength; i++) {
+            category[i] = Randomizer.randomChoicePDF(categoryProbs);
+        }
+
+        double[] frequencies = m_siteModel.getSubstitutionModel().getFrequencies();
+        int[] seq = new int[m_sequenceLength];
+        for (int i = 0; i < m_sequenceLength; i++) {
+            seq[i] = Randomizer.randomChoicePDF(frequencies);
+        }
+
+
+        //alignment.setDataType(m_siteModel.getFrequencyModel().getDataType());
+
+        traverse(root, seq, category);
+
+    } // simulate
+
+    /**
+     * recursively walk through the tree top down, and add sequence to alignment whenever
+     * a leave node is reached.
+     *
+     * @param node           reference to the current node, for which we visit all children
+     * @param parentSequence randomly generated sequence of the parent node
+     * @param category       array of categories for each of the sites
+     * @param alignment
+     * @throws Exception
+     */
+    void traverse(Node node, int[] parentSequence, int[] category) throws Exception {
+        for (int iChild = 0; iChild < 2; iChild++) {
+            Node child = (iChild == 0 ? node.getLeft() : node.getRight());
+            for (int i = 0; i < m_categoryCount; i++) {
+                getTransitionProbabilities(m_tree, child, i, m_probabilities[i]);
+            }
+
+            int[] seq = new int[m_sequenceLength];
+            double[] cProb = new double[m_stateCount];
+            for (int i = 0; i < m_sequenceLength; i++) {
+                System.arraycopy(m_probabilities[category[i]], parentSequence[i] * m_stateCount, cProb, 0, m_stateCount);
+                seq[i] = Randomizer.randomChoicePDF(cProb);
+            }
+
+            if (child.isLeaf()) {
+                sequenceInput.setValue(intArray2Sequence(seq, child), this);
+            } else {
+                traverse(child, seq, category);
+            }
+        }
+    } // traverse
+
+    /**
+     * get transition probability matrix for particular rate category *
+     */
+    void getTransitionProbabilities(Tree tree, Node node, int rateCategory, double[] probs) {
+
+        Node parent = node.getParent();
+        double branchRate = (m_branchRateModel == null ? 1.0 : m_branchRateModel.getRateForBranch(node));
+        branchRate *= m_siteModel.getRateForCategory(rateCategory, node);
+
+        // Get the operational time of the branch
+        //final double branchTime = branchRate * (parent.getHeight() - node.getHeight());
+
+        //if (branchTime < 0.0) {
+        //    throw new RuntimeException("Negative branch length: " + branchTime);
+        //}
+
+        //double branchLength = m_siteModel.getRateForCategory(rateCategory) * branchTime;
+
+//        // TODO Hack until SiteRateModel issue is resolved
+//        if (m_siteModel.getSubstitutionModel() instanceof SubstitutionEpochModel) {
+//            ((SubstitutionEpochModel)m_siteModel.getSubstitutionModel()).getTransitionProbabilities(tree.getNodeHeight(node),
+//                    tree.getNodeHeight(parent),branchLength, probs);
+//            return;
+//        }
+        //m_siteModel.getSubstitutionModel().getTransitionProbabilities(branchLength, probs);
+        m_siteModel.getSubstitutionModel().getTransitionProbabilities(node, parent.getHeight(), node.getHeight(), branchRate, probs);
+
+    } // getTransitionProbabilities
+
+
+} // class SequenceAlignment
+
diff --git a/src/beast/app/tools/AppStore.java b/src/beast/app/tools/AppStore.java
new file mode 100644
index 0000000..2bfe220
--- /dev/null
+++ b/src/beast/app/tools/AppStore.java
@@ -0,0 +1,479 @@
+package beast.app.tools;
+
+
+import beast.app.util.Utils;
+import beast.util.AddOnManager;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+import javax.swing.*;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.InputStreamReader;
+import java.io.PrintStream;
+import java.lang.reflect.Method;
+import java.util.*;
+import java.util.List;
+
+
+/**
+ * launch applications specific to add-ons installed, for example utilities for
+ * post-processing add-on specific data.
+ *
+ * @author  Remco Bouckaert
+ * @author  Walter Xie
+ */
+public class AppStore {
+    private static final long serialVersionUID = 1L;
+    public static final String DEFAULT_ICON = "beast/app/tools/images/utility.png";
+
+    private final String ALL = "-all-";
+    JComboBox<String> packageComboBox;
+    DefaultListModel<PackageApp> model = new DefaultListModel<>();
+    JList<PackageApp> listApps;
+    JButton launchButton = new JButton("Launch");
+    JDialog mainDialog;
+
+    public AppStore() {
+    }
+
+    public JDialog launchGUI() {
+
+        mainDialog = new JDialog();
+        mainDialog.setTitle("BEAST 2 Package Application Launcher");
+
+        Box top = Box.createHorizontalBox();
+        JLabel label = new JLabel("Filter: ");
+        packageComboBox = new JComboBox<>(new String[]{ALL});
+        packageComboBox.setToolTipText("Show application of the installed package(s)");
+        packageComboBox.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                JComboBox cb = (JComboBox)e.getSource();
+                if (cb.getSelectedItem() != null) {
+                    resetAppList(cb.getSelectedItem().toString());
+                }
+            }
+        });
+        label.setLabelFor(packageComboBox);
+        top.add(label);
+        top.add(packageComboBox);
+        mainDialog.getContentPane().add(BorderLayout.NORTH, top);
+
+        Component pluginListBox = createList();
+        mainDialog.getContentPane().add(BorderLayout.CENTER, pluginListBox);
+
+        Box buttonBox = createButtonBox();
+        mainDialog.getContentPane().add(buttonBox, BorderLayout.SOUTH);
+
+//      Dimension dim = panel.getPreferredSize();
+//      Dimension dim2 = buttonBox.getPreferredSize();
+//		setSize(dim.width + 10, dim.height + dim2.height + 30);
+        mainDialog.setSize(new Dimension(660, 400));
+        mainDialog.setLocationRelativeTo(null);
+
+        return mainDialog;
+    }
+
+    private Component createList() {
+        Box box = Box.createVerticalBox();
+        box.add(Box.createGlue());
+
+        listApps = new JList<PackageApp>(model) {
+            //Subclass JList to workaround bug 4832765, which can cause the
+            //scroll pane to not let the user easily scroll up to the beginning
+            //of the list.  An alternative would be to set the unitIncrement
+            //of the JScrollBar to a fixed value. You wouldn't get the nice
+            //aligned scrolling, but it should work.
+            public int getScrollableUnitIncrement(Rectangle visibleRect,
+                                                  int orientation,
+                                                  int direction) {
+                int row;
+                if (orientation == SwingConstants.VERTICAL &&
+                        direction < 0 && (row = getFirstVisibleIndex()) != -1) {
+                    Rectangle r = getCellBounds(row, row);
+                    if ((r.y == visibleRect.y) && (row != 0))  {
+                        Point loc = r.getLocation();
+                        loc.y--;
+                        int prevIndex = locationToIndex(loc);
+                        Rectangle prevR = getCellBounds(prevIndex, prevIndex);
+
+                        if (prevR == null || prevR.y >= r.y) {
+                            return 0;
+                        }
+                        return prevR.height;
+                    }
+                }
+                return super.getScrollableUnitIncrement(
+                        visibleRect, orientation, direction);
+            }
+        };
+        listApps.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+        listApps.setCellRenderer(new DefaultListCellRenderer() {
+            @Override
+            public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
+                                                          boolean cellHasFocus) {
+                JLabel label = (JLabel) super
+                        .getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
+                label.setIcon(((PackageApp) value).icon);
+                label.setHorizontalTextPosition(JLabel.CENTER);
+                label.setVerticalTextPosition(JLabel.BOTTOM);
+                return label;
+            }
+        });
+        listApps.setLayoutOrientation(JList.HORIZONTAL_WRAP);
+        listApps.setVisibleRowCount(-1);
+        listApps.addMouseListener(new MouseAdapter() {
+            public void mouseClicked(MouseEvent e) {
+                if (e.getClickCount() == 2) {
+                    launchButton.doClick();
+                }
+            }
+        });
+
+//        if (model.getSize() > 0) { // TODO not working
+//            listApps.setPrototypeCellValue(model.firstElement()); //get extra space
+//        }
+
+        resetAppList();
+
+        JScrollPane listScroller = new JScrollPane(listApps);
+        listScroller.setPreferredSize(new Dimension(660, 400));
+        listScroller.setAlignmentX(JDialog.LEFT_ALIGNMENT);
+
+        JLabel label = new JLabel("List of available package applications");
+        label.setLabelFor(listApps);
+
+        box.add(label);
+        box.add(listScroller);
+
+        return box;
+    }
+
+    private void resetAppList() {
+        Set<String> packages = new TreeSet<>();
+        model.clear();
+        try {
+            List<PackageApp> packageApps = getPackageApps();
+            for (PackageApp packageApp : packageApps) {
+                model.addElement(packageApp);
+                packages.add(packageApp.packageName);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        listApps.setSelectedIndex(0);
+
+        packageComboBox.removeAllItems();
+        packageComboBox.addItem(ALL);
+        for (String p : packages) {
+            packageComboBox.addItem(p);
+        }
+    }
+
+
+    private void resetAppList(String packageName) {
+        model.clear();
+        try {
+            List<PackageApp> packageApps = getPackageApps();
+            for (PackageApp packageApp : packageApps) {
+                if (packageName.equals(ALL) || packageName.equalsIgnoreCase(packageApp.packageName))
+                    model.addElement(packageApp);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        listApps.setSelectedIndex(0);
+    }
+
+
+    private Box createButtonBox() {
+        Box box = Box.createHorizontalBox();
+        box.add(Box.createGlue());
+
+        launchButton.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                PackageApp packageApp = listApps.getSelectedValue();
+                if (packageApp != null) {
+                    try {
+                        new PackageAppThread(packageApp).start();
+
+                    } catch (Exception ex) {
+                        JOptionPane.showMessageDialog(null, "Launch failed because: " + ex.getMessage());
+                    }
+                }
+            }
+        });
+        box.add(launchButton);
+
+        JButton closeButton = new JButton("Close");
+        closeButton.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+//				setVisible(false);
+                mainDialog.dispose();
+            }
+        });
+        box.add(Box.createGlue());
+        box.add(closeButton);
+        box.add(Box.createGlue());
+        return box;
+    }
+
+    List<PackageApp> getPackageApps() {
+        List<PackageApp> packageApps = new ArrayList<>();
+        List<String> dirs = AddOnManager.getBeastDirectories();
+        for (String sJarDir : dirs) {
+            File versionFile = new File(sJarDir + "/version.xml");
+            if (versionFile.exists() && versionFile.isFile()) {
+                DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+                Document doc;
+                try {
+                    doc = factory.newDocumentBuilder().parse(versionFile);
+                    doc.normalize();
+                    // get addonapp info from version.xml
+                    Element addon = doc.getDocumentElement();
+                    NodeList nodes = doc.getElementsByTagName("addonapp");
+                    for (int j = 0; j < nodes.getLength(); j++) {
+                        Element addOnAppElement = (Element) nodes.item(j);
+                        PackageApp packageApp = new PackageApp();
+                        packageApp.packageName = addon.getAttribute("name");
+                        packageApp.jarDir = sJarDir;
+                        packageApp.className = addOnAppElement.getAttribute("class");
+                        packageApp.description = addOnAppElement.getAttribute("description");
+                        packageApp.argumentsString = addOnAppElement.getAttribute("args");
+
+                        String iconLocation = addOnAppElement.getAttribute("icon");
+                        packageApp.icon = Utils.getIcon(iconLocation);
+                        if (packageApp.icon == null || iconLocation.trim().isEmpty())
+                            packageApp.icon = Utils.getIcon(DEFAULT_ICON);
+
+                        packageApps.add(packageApp);
+                    }
+                } catch (Exception e) {
+                    // ignore
+                    System.err.println(e.getMessage());
+                }
+            }
+        }
+        return packageApps;
+    }
+
+    /**
+     * package application information required for launching the app and
+     * displaying in list box
+     **/
+    class PackageApp {
+        String packageName;
+        String jarDir;
+        String description;
+        String className;
+        String argumentsString;
+        ImageIcon icon;
+
+        public String[] getArgs() {
+            if (argumentsString == null || argumentsString.trim().isEmpty()) {
+                return new String[]{};
+            } else {
+                String[] args = argumentsString.split(" ", -1);
+//                System.out.println("package = " + packageName + ", class = " + className + ", args = " + Arrays.toString(args));
+                return args;
+            }
+        }
+
+        @Override
+        public String toString() {
+            return description;
+        }
+    }
+
+    /** thread for launching add on application **/
+    class PackageAppThread extends Thread {
+        PackageApp packageApp;
+
+        PackageAppThread(PackageApp packageApp) {
+            this.packageApp = packageApp;
+        }
+
+        @Override
+        public void run() {
+            // invoke package application
+//            AppStore.runAppFromJar(packageApp.className, packageApp.getArgs());
+            runAppFromCMD(packageApp, null);
+        }
+    }
+
+    public void runAppFromCMD(PackageApp packageApp, String[] additionalArgs) {
+        try {
+            AddOnManager.loadExternalJars();
+
+            List<String> cmd = new ArrayList<>();
+            if (System.getenv("JAVA_HOME") != null) {
+                cmd.add(System.getenv("JAVA_HOME") + File.separatorChar
+                        + "bin" + File.separatorChar + "java");
+            } else
+                cmd.add("java");
+            // TODO: deal with java directives like -Xmx -Xms here
+
+            if (System.getProperty("java.library.path") != null && System.getProperty("java.library.path").length() > 0) {
+            	cmd.add("-Djava.library.path=" + sanitise(System.getProperty("java.library.path")));
+            }
+            cmd.add("-cp");
+            final String strClassPath = sanitise(System.getProperty("java.class.path"));
+            cmd.add(strClassPath);
+            cmd.add(packageApp.className);
+
+            for (String arg : packageApp.getArgs()) {
+                cmd.add(arg);
+            }
+
+            if (additionalArgs != null) {
+                for (String arg : additionalArgs)
+                    cmd.add(arg);
+            }
+
+
+            final ProcessBuilder pb = new ProcessBuilder(cmd);
+
+            System.err.println(pb.command());
+
+            File log = new File("log");
+            pb.redirectErrorStream(true);
+            
+            // Start the process and wait for it to finish.
+            final Process process = pb.start();
+            int c;
+            BufferedReader input = new BufferedReader(new InputStreamReader(process.getInputStream()));
+            while ((c = input.read()) != -1) {
+                System.out.print((char)c);
+            }
+            input.close();
+            final int exitStatus = process.waitFor();
+
+            if (exitStatus != 0) {
+                System.err.println(Utils.toString(process.getErrorStream()));
+            } else {
+//                System.out.println(Utils.toString(process.getInputStream()));
+            }
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+    }
+    
+	private String sanitise(String property) {
+		// sanitise for windows
+		if (beast.app.util.Utils.isWindows()) {
+			String cwd = System.getProperty("user.dir");
+			cwd = cwd.replace("\\", "/");
+			property = property.replaceAll(";\\.", ";" +  cwd + ".");
+			property = property.replace("\\", "/");
+		}
+		return property;
+	}
+
+    private void printUsage(PrintStream ps) {
+        ps.println("\nAppStore: Run installed BEAST 2 package apps.\n" +
+                        "\n" +
+                        "Usage:\n" +
+                        "\tappstore\n" +
+                        "\tappstore -help\n" +
+                        "\tappstore -list [package_name]\n" +
+                        "\tappstore <app_class_name|app_description>");
+    }
+
+    private void printAppList(List<PackageApp> appList, PrintStream ps) {
+        ps.println("Package         | Class Name      | Description");
+        ps.println("----------------|-----------------|-----------------");
+        for (PackageApp app : appList) {
+            String[] fullClassName = app.className.split("\\.");
+            String className = fullClassName[fullClassName.length-1];
+            ps.format("%-15.15s | %-15.15s | %s\n",
+                    app.packageName, className, app.description);
+        }
+    }
+
+    public static void main(String[] args) {
+        AppStore appStore = new AppStore();
+
+        if (args.length == 0) {
+            SwingUtilities.invokeLater(() -> appStore.launchGUI().setVisible(true));
+        } else {
+
+            if (args[0].startsWith("-")) {
+                switch(args[0]) {
+                    case "-help":
+                        appStore.printUsage(System.out);
+                        System.exit(0);
+
+                    case "-list":
+                        System.out.println("\nAvailable package apps:\n");
+                        if (args.length>1) {
+                            String packageNameFilter = args[1].toLowerCase();
+
+                            List<PackageApp> filteredAppList = new ArrayList<>();
+                            for (PackageApp app : appStore.getPackageApps()) {
+                                if (!app.packageName.toLowerCase().contains(packageNameFilter))
+                                    filteredAppList.add(app);
+                            }
+                            appStore.printAppList(filteredAppList, System.out);
+                        } else {
+                            appStore.printAppList(appStore.getPackageApps(), System.out);
+                        }
+                        System.exit(0);
+
+                    default:
+                        System.err.print("\nUnsupported option.");
+                        appStore.printUsage(System.err);
+                        System.exit(1);
+                }
+            } else {
+
+                // Find apps with class name or description that matches
+                // command line.
+                List<PackageApp> partialMatchingApps = new ArrayList<>();
+                PackageApp exactMatchApp = null;
+                for (PackageApp app : appStore.getPackageApps()) {
+                    if (app.className.equals(args[0]) || app.description.equals(args[0]))
+                        exactMatchApp = app;
+                    else {
+                        if (app.className.toLowerCase().contains(args[0].toLowerCase())
+                                || app.description.toLowerCase().contains(args[0].toLowerCase()))
+                            partialMatchingApps.add(app);
+                    }
+                }
+
+                String[] packageArgs = Arrays.copyOfRange(args, 1, args.length);
+
+                if (exactMatchApp != null)
+                    appStore.runAppFromCMD(exactMatchApp, packageArgs);
+                else {
+                    if (partialMatchingApps.size()==1) {
+                        appStore.runAppFromCMD(partialMatchingApps.get(0), packageArgs);
+                    } else {
+                        if (partialMatchingApps.isEmpty()) {
+                            System.err.println("\nNo apps match.");
+                            appStore.printUsage(System.err);
+                            System.exit(1);
+                        } else {
+                            System.err.println("\nMultiple apps match:\n");
+                            appStore.printAppList(partialMatchingApps, System.err);
+                        }
+                        System.exit(1);
+                    }
+                }
+            }
+        }
+    }
+}
diff --git a/src/beast/app/tools/AppStoreLauncher.java b/src/beast/app/tools/AppStoreLauncher.java
new file mode 100644
index 0000000..70806f3
--- /dev/null
+++ b/src/beast/app/tools/AppStoreLauncher.java
@@ -0,0 +1,19 @@
+package beast.app.tools;
+
+import beast.app.beastapp.BeastLauncher;
+
+public class AppStoreLauncher extends BeastLauncher {
+	/**
+	 * Loads beast.jar and launches AppStore 
+	 * 
+	 * This class should be compiled against 1.6 and packaged by itself. The
+	 * remained of BEAST can be compiled against Java 1.7 or higher
+	 * **/
+	public static void main(String[] args) throws Exception {
+		if (javaVersionCheck("AppStore")) {
+			loadBEASTJars();
+			AppStore.main(args);
+		}
+	}
+
+}
diff --git a/src/beast/app/tools/EBSPAnalyser.java b/src/beast/app/tools/EBSPAnalyser.java
new file mode 100644
index 0000000..96f387b
--- /dev/null
+++ b/src/beast/app/tools/EBSPAnalyser.java
@@ -0,0 +1,447 @@
+package beast.app.tools;
+
+import jam.console.ConsoleApplication;
+import jam.panels.OptionsPanel;
+
+import java.awt.BorderLayout;
+import java.awt.Font;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.swing.Icon;
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JDialog;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+import javax.swing.border.EmptyBorder;
+
+import beast.app.BEASTVersion;
+import beast.app.util.Utils;
+import beast.app.util.WholeNumberField;
+import beast.evolution.tree.coalescent.CompoundPopulationFunction;
+import beast.evolution.tree.coalescent.CompoundPopulationFunction.Type;
+import beast.math.statistic.DiscreteStatistics;
+
+
+
+public class EBSPAnalyser {
+    String m_sFileOut;
+    PrintStream m_out = System.out;
+    CompoundPopulationFunction.Type m_type = Type.LINEAR;
+    String m_sInputFile;
+    int m_nBurninPercentage = 10;
+
+    private void run() throws Exception {
+        parse(m_sInputFile, m_nBurninPercentage, m_type, m_out);
+    }
+
+    void parse(String sFile, int nBurnInPercentage, CompoundPopulationFunction.Type type, PrintStream out) throws Exception {
+        logln("Processing " + sFile);
+        BufferedReader fin = new BufferedReader(new FileReader(sFile));
+        String sStr;
+        int nData = 0;
+        // first, sweep through the log file to determine size of the log
+        while (fin.ready()) {
+            sStr = fin.readLine();
+            // terrible hackish code, must improve later
+            if( sStr.charAt(0) == '#' ) {
+                int i = sStr.indexOf("spec=");
+                if( i > 0 ) {
+                   if( sStr.indexOf("type=\"stepwise\"") > 0 ) {
+                      m_type = Type.STEPWISE;
+                   }  else if( sStr.indexOf("type=\"linear\"") > 0 ) {
+                      m_type = Type.LINEAR;
+                   }
+                }
+            }
+            if (sStr.indexOf('#') < 0 && sStr.matches(".*[0-9a-zA-Z].*")) {
+                nData++;
+            }
+        }
+        final int nBurnIn = nData * nBurnInPercentage / 100;
+        logln(" skipping " + nBurnIn + " line\n\n");
+        nData = -nBurnIn - 1;
+        fin = new BufferedReader(new FileReader(sFile));
+
+        // process log
+        final List<List<Double>> times = new ArrayList<List<Double>>();
+        final List<List<Double>> popSizes = new ArrayList<List<Double>>();
+        double[] alltimes = null;
+        while (fin.ready()) {
+            sStr = fin.readLine();
+            if (sStr.indexOf('#') < 0 && sStr.matches(".*[0-9a-zA-Z].*")) {
+                if (++nData > 0) {
+                    final String[] sStrs = sStr.split("\t");
+                    final List<Double> times2 = new ArrayList<Double>();
+                    final List<Double> popSizes2 = new ArrayList<Double>();
+                    if (alltimes == null) {
+                        alltimes = new double[sStrs.length - 1];
+                    }
+                    for (int i = 1; i < sStrs.length; i++) {
+                        final String[] sStrs2 = sStrs[i].split(":");
+                        final Double time = Double.parseDouble(sStrs2[0]);
+                        alltimes[i - 1] += time;
+                        if (sStrs2.length > 1) {
+                            times2.add(time);
+                            popSizes2.add(Double.parseDouble(sStrs2[1]));
+                        }
+                    }
+                    times.add(times2);
+                    popSizes.add(popSizes2);
+
+                }
+            }
+        }
+
+        if (alltimes == null) {
+            //burn-in too large?
+            return;
+        }
+
+        // take average of coalescent times
+        for (int i = 0; i < alltimes.length; i++) {
+            alltimes[i] /= times.size();
+        }
+
+        // generate output
+        out.println("time\tmean\tmedian\t95HPD lower\t95HPD upper");
+        final double[] popSizeAtTimeT = new double[times.size()];
+        for (final double time : alltimes) {
+            for (int j = 0; j < popSizeAtTimeT.length; j++) {
+                popSizeAtTimeT[j] = calcPopSize(type, times.get(j), popSizes.get(j), time);
+            }
+            Arrays.sort(popSizeAtTimeT);
+            out.print(time + "\t");
+            out.print(DiscreteStatistics.mean(popSizeAtTimeT) + "\t");
+            out.print(DiscreteStatistics.median(popSizeAtTimeT) + "\t");
+            out.print(DiscreteStatistics.quantile(0.025, popSizeAtTimeT) + "\t");
+            out.print(DiscreteStatistics.quantile(0.975, popSizeAtTimeT) + "\t");
+            out.println();
+        }
+    }
+
+    private double calcPopSize(CompoundPopulationFunction.Type type, List<Double> xs, List<Double> ys, double d) {
+        // TODO completely untested
+        // assume linear
+        //assert sType.equals("Linear");
+
+        final int n = xs.size();
+        final double xn = xs.get(n - 1);
+        if (d >= xn) {
+            return ys.get(n - 1);
+        }
+        assert d >= xs.get(0);
+
+        int i = 1;
+        while (d >= xs.get(i)) {
+            ++i;
+        }
+        // d < xs.get(i)
+
+        double x0 = xs.get(i-1);
+        double x1 = xs.get(i);
+        double y0 = ys.get(i-1);
+        double y1 = ys.get(i);
+        assert x0 <= d && d <= x1 : "" + x0 + "," + x1 + "," + d;
+        switch (type) {
+            case LINEAR:
+                final double p = (d * (y1 - y0) + (y0 * x1 - y1 * x0)) / (x1 - x0);
+                assert p > 0;
+                return p;
+            case STEPWISE:
+                assert y1 > 0;
+                return y1;
+        }
+        return 0;
+    }
+
+    private void parseArgs(String[] args) throws Exception {
+        int i = 0;
+        try {
+            while (i < args.length) {
+                int iOld = i;
+                if (i < args.length) {
+                    if (args[i].equals("")) {
+                        i += 1;
+                    } else if (args[i].equals("-help") || args[i].equals("-h") || args[i].equals("--help")) {
+                        System.out.println(getUsage());
+                        System.exit(0);
+                    } else if (args[i].equals("-i")) {
+                        m_sInputFile = args[i + 1];
+                        i += 2;
+                    } else if (args[i].equals("-o")) {
+                        m_sFileOut = args[i + 1];
+                        m_out = new PrintStream(m_sFileOut);
+                        i += 2;
+                    } else if (args[i].equals("-type")) {
+                        if (args[i + 1].equals("linear")) {
+                            m_type = Type.LINEAR;
+                        } else if (args[i + 1].equals("stepwise")) {
+                            m_type = Type.STEPWISE;
+                        } else {
+                            throw new Exception("Expected linear of stepwise, not " + args[i + 1]);
+                        }
+                        i += 2;
+                    } else if (args[i].equals("-burnin")) {
+                        m_nBurninPercentage = Integer.parseInt(args[i + 1]);
+                        i += 2;
+                    }
+                    if (i == iOld) {
+                        throw new Exception("Unrecognised argument (argument " + i + ": " + args[i] + ")");
+                    }
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new Exception("Error parsing command line arguments: " + Arrays.toString(args) + "\nArguments ignored\n\n" + getUsage());
+        }
+        if (m_sFileOut == null) {
+            System.err.println("No output file specified");
+        }
+
+    }
+
+    static String getUsage() {
+        return "EBSPAnalyse -i <inputfile> [options]\n" +
+                "analyses trace file generated by EBSP analysis\n" +
+                "Options are:\n" +
+                "-i <inputfile> name of input file (required)\n" +
+                "-burnin <percentage> percent of log to consider burn in, default 10\n" +
+                "-type [linear|step] type of population function\n" +
+                "-o <outputfile> name of output file, default to output on stdout\n" +
+                "";
+    }
+
+    protected void log(String s) {
+        System.err.print(s);
+    }
+
+    protected void logln(String s) {
+        System.err.println(s);
+    }
+
+    private void printTitle(String aboutString) {
+        aboutString = "LogCombiner" + aboutString.replaceAll("</p>", "\n\n");
+        aboutString = aboutString.replaceAll("<br>", "\n");
+        aboutString = aboutString.replaceAll("<[^>]*>", " ");
+        String[] sStrs = aboutString.split("\n");
+        for (String sStr : sStrs) {
+            int n = 80 - sStr.length();
+            int n1 = n / 2;
+            for (int i = 0; i < n1; i++) {
+                log(" ");
+            }
+            logln(sStr);
+        }
+    }
+
+    public class EBSPAnalyserDialog {
+        private final JFrame frame;
+
+        private final OptionsPanel optionPanel;
+
+        private final JTextField inputFileNameText = new JTextField("not selected", 16);
+        private final JComboBox typeCombo = new JComboBox(new String[]{"linear", "stepwise"});
+
+        final WholeNumberField burninText = new WholeNumberField((long) 0, Long.MAX_VALUE);
+        private final JTextField outputFileNameText = new JTextField("not selected", 16);
+
+        private File outputFile = null;
+        private File inputFile = null;
+
+        public EBSPAnalyserDialog(final JFrame frame, String titleString, Icon icon) {
+            this.frame = frame;
+
+            optionPanel = new OptionsPanel(12, 12);
+
+            final JLabel titleText = new JLabel(titleString);
+            titleText.setIcon(icon);
+            optionPanel.addSpanningComponent(titleText);
+            titleText.setFont(new Font("sans-serif", 0, 12));
+
+            JPanel panel = new JPanel(new BorderLayout());
+            panel.setOpaque(false);
+
+            JButton button = new JButton("Choose Input File...");
+            button.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent ae) {
+                    File file = Utils.getLoadFile("Select input file...");
+                    if (file == null) {
+                        // the dialog was cancelled...
+                        return;
+                    }
+
+                    inputFile = file;
+                    inputFileNameText.setText(inputFile.getName());
+
+                }
+            });
+            inputFileNameText.setEditable(false);
+
+            JButton button2 = new JButton("Choose Output File...");
+            button2.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent ae) {
+                    File file = Utils.getSaveFile("Select output file...");
+                    if (file == null) {
+                        // the dialog was cancelled...
+                        return;
+                    }
+
+                    outputFile = file;
+                    outputFileNameText.setText(outputFile.getName());
+
+                }
+            });
+            outputFileNameText.setEditable(false);
+
+            JPanel panel1 = new JPanel(new BorderLayout(0, 0));
+            panel1.add(inputFileNameText, BorderLayout.CENTER);
+            panel1.add(button, BorderLayout.EAST);
+            optionPanel.addComponentWithLabel("Input File: ", panel1);
+
+            optionPanel.addComponentWithLabel("File type: ", typeCombo);
+
+            burninText.setColumns(12);
+            burninText.setValue(10);
+            optionPanel.addComponentWithLabel("Burn in percentage: ", burninText);
+
+            optionPanel.addSpanningComponent(panel);
+
+            JPanel panel3 = new JPanel(new BorderLayout(0, 0));
+            panel3.add(outputFileNameText, BorderLayout.CENTER);
+            panel3.add(button2, BorderLayout.EAST);
+            optionPanel.addComponentWithLabel("Output File: ", panel3);
+        }
+
+        public boolean showDialog(String title) {
+
+            JOptionPane optionPane = new JOptionPane(optionPanel,
+                    JOptionPane.PLAIN_MESSAGE,
+                    JOptionPane.OK_CANCEL_OPTION,
+                    null,
+                    new String[]{"Run", "Quit"},
+                    null);
+            optionPane.setBorder(new EmptyBorder(12, 12, 12, 12));
+
+            final JDialog dialog = optionPane.createDialog(frame, title);
+            //dialog.setResizable(true);
+            dialog.pack();
+
+            dialog.setVisible(true);
+
+            return optionPane.getValue().equals("Run");
+        }
+
+        public String getOutputFileName() {
+            if (outputFile == null) return null;
+            return outputFile.getPath();
+        }
+
+        public String[] getArgs() {
+            java.util.List<String> args = new ArrayList<String>();
+            if (inputFile != null) {
+                args.add("-i");
+                args.add(inputFile.getPath());
+            }
+            args.add("-burnin");
+            args.add(burninText.getText());
+            args.add("-type");
+            args.add(typeCombo.getSelectedItem().toString());
+            if (outputFile != null) {
+                args.add("-o");
+                args.add(outputFile.getPath());
+            }
+            return args.toArray(new String[0]);
+        }
+
+    }
+
+
+    /**
+     * @param args
+     */
+    public static void main(String[] args) {
+        BEASTVersion version = new BEASTVersion();
+        final String versionString = version.getVersionString();
+        String nameString = "EBSP Analyser " + versionString;
+        String aboutString = "<html><center><p>" + versionString + ", " + version.getDateString() + "</p>" +
+                "<p>by<br>" +
+                "<p>Joseph Heled and Remco Bouckaert</p>" +
+                "<p>Department of Computer Science, University of Auckland<br>" +
+                "<a href=\"mailto:jheled at gmail.com\">jheled at gmail.com</a></p>" +
+                "<a href=\"mailto:remco at cs.auckland.ac.nz\">remco at cs.auckland.ac.nz</a></p>" +
+                "<p>Part of the BEAST 2 package:<br>" +
+                "<a href=\"http://beast2.cs.auckland.ac.nz/\">http://beast2.cs.auckland.ac.nz/</a></p>" +
+                "</center></html>";
+
+
+        try {
+            EBSPAnalyser analyser = new EBSPAnalyser();
+            if (args.length == 0) {
+                System.setProperty("com.apple.macos.useScreenMenuBar", "true");
+                System.setProperty("apple.laf.useScreenMenuBar", "true");
+                System.setProperty("apple.awt.showGrowBox", "true");
+
+                // TODO: set up ICON
+                java.net.URL url = EBSPAnalyser.class.getResource("images/EBSPAnalyser.png");
+                javax.swing.Icon icon = null;
+
+                if (url != null) {
+                    icon = new javax.swing.ImageIcon(url);
+                }
+
+
+                //ConsoleApplication consoleApp =
+                new ConsoleApplication(nameString, aboutString, icon, true);
+
+                analyser.printTitle(aboutString);
+
+                String titleString = "<html><center><p>EBSPAnalyser<br>" +
+                        "Version " + version.getVersionString() + ", " + version.getDateString() + "</p></center></html>";
+
+                EBSPAnalyserDialog dialog = analyser.new EBSPAnalyserDialog(new JFrame(), titleString, icon);
+
+                if (!dialog.showDialog(nameString)) {
+                    return;
+                }
+                String[] args2 = dialog.getArgs();
+
+                try {
+                    analyser.parseArgs(args2);
+                    analyser.run();
+
+                } catch (Exception ex) {
+                    System.err.println("Exception: " + ex.getMessage());
+                    ex.printStackTrace();
+                }
+                System.out.println("Finished - Quit program to exit.");
+                while (true) {
+                    try {
+                        Thread.sleep(1000);
+                    } catch (InterruptedException e) {
+                        e.printStackTrace();
+                    }
+                }
+            } else {
+                analyser.printTitle(aboutString);
+                analyser.parseArgs(args);
+                analyser.run();
+            }
+        } catch (Exception e) {
+            System.out.println(getUsage());
+            e.printStackTrace();
+        }
+
+    }
+}
diff --git a/src/beast/app/tools/LogCombiner.java b/src/beast/app/tools/LogCombiner.java
new file mode 100644
index 0000000..43ec931
--- /dev/null
+++ b/src/beast/app/tools/LogCombiner.java
@@ -0,0 +1,495 @@
+package beast.app.tools;
+
+
+import beast.app.BEASTVersion;
+import beast.util.LogAnalyser;
+import jam.console.ConsoleApplication;
+
+import javax.swing.*;
+import java.io.*;
+import java.text.DecimalFormat;
+import java.text.DecimalFormatSymbols;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Locale;
+
+
+/**
+ * combines log files produced by a ParticleFilter for
+ * combined analysis*
+ */
+public class LogCombiner extends LogAnalyser {
+
+    List<String> m_sLogFileName = new ArrayList<String>();
+    String m_sParticleDir;
+    int m_nParticles = -1;
+    String m_sFileOut;
+    PrintStream m_out = System.out;
+    int m_nBurninPercentage = 10;
+
+    boolean m_bIsTreeLog = false;
+    List<String> m_sTrees;
+    // Sample interval as it appears in the combined log file.
+    // To use the interval of the log files, use the -renumber option
+    int m_nSampleInterval = 1;
+    // whether to use decimal or scientific format to print doubles
+    boolean m_bUseDecimalFormat = false;
+    DecimalFormat format = new DecimalFormat("#.############E0", new DecimalFormatSymbols(Locale.US));
+
+    // resample the log files to this frequency (the original sampling frequency must be a factor of this value)
+    int m_nResample = 1;
+
+    private void parseArgs(String[] args) throws Exception {
+        int i = 0;
+        format = new DecimalFormat("#.############E0", new DecimalFormatSymbols(Locale.US));
+        m_sLogFileName = new ArrayList<String>();
+        try {
+            while (i < args.length) {
+                int iOld = i;
+                if (i < args.length) {
+                    if (args[i].equals("")) {
+                        i += 1;
+                    } else if (args[i].equals("-help") || args[i].equals("-h") || args[i].equals("--help")) {
+                        System.out.println(getUsage());
+                        System.exit(0);
+                    } else if (args[i].equals("-o")) {
+                        m_sFileOut = args[i + 1];
+                        m_out = new PrintStream(m_sFileOut);
+                        i += 2;
+                    } else if (args[i].equals("-b") || args[i].equals("-burnin") || args[i].equals("--burnin")) {
+                        m_nBurninPercentage = Integer.parseInt(args[i + 1]);
+                        if (m_nBurninPercentage < 0 || m_nBurninPercentage > 100) {
+                            System.err.println("Error: Burn-in percentage must be between 0 and 100.");
+                            System.exit(1);
+                        }
+                        i += 2;
+                    } else if (args[i].equals("-n")) {
+                        m_nParticles = Integer.parseInt(args[i + 1]);
+                        i += 2;
+                    } else if (args[i].equals("-log")) {
+                        m_sLogFileName.add(args[i + 1]);
+                        i += 2;
+                        while (i < args.length && !args[i].startsWith("-")) {
+                            m_sLogFileName.add(args[i++]);
+                        }
+                    } else if (args[i].equals("-dir")) {
+                        m_sParticleDir = args[i + 1];
+                        i += 2;
+                    } else if (args[i].equals("-decimal")) {
+                        m_bUseDecimalFormat = true;
+                        format = new DecimalFormat("#.############", new DecimalFormatSymbols(Locale.US));
+                        i++;
+                    } else if (args[i].equals("-resample")) {
+                        m_nResample = Integer.parseInt(args[i + 1]);
+                        i += 2;
+                    } else if (args[i].equals("-renumber")) {
+                        m_nSampleInterval = -1;
+                        i++;
+                    }
+                    if (i == iOld) {
+                        throw new Exception("Unrecognised argument");
+                    }
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new Exception("Error parsing command line arguments: " + Arrays.toString(args) + "\nArguments ignored\n\n" + getUsage());
+        }
+    }
+
+
+    /**
+     * data from log file with burn-in removed *
+     */
+    Double[][] m_fCombinedTraces;
+
+    private void combineParticleLogs() throws Exception {
+        List<String> sLogs = new ArrayList<String>();
+        for (int i = 0; i < m_nParticles; i++) {
+            String sDir = m_sParticleDir + "/particle" + i;
+            File dir = new File(sDir);
+            if (!dir.exists() || !dir.isDirectory()) {
+                throw new Exception("Could not process particle " + i + ". Expected " + sDir + " to be a directory, but it is not.");
+            }
+            sLogs.add(sDir + "/" + m_sLogFileName.get(0));
+        }
+        int[] nBurnIns = new int[sLogs.size()];
+        Arrays.fill(nBurnIns, m_nBurninPercentage);
+        combineLogs(sLogs.toArray(new String[0]), nBurnIns);
+    }
+
+    private void combineLogs(String[] sLogs, int[] nBurbIns) throws Exception {
+        m_fCombinedTraces = null;
+        // read logs
+        int nColumns = 0;
+        int k = 0;
+        for (String sFile : sLogs) {
+            BufferedReader fin = new BufferedReader(new FileReader(sFile));
+            String sStr = fin.readLine();
+            if (sStr.toUpperCase().startsWith("#NEXUS")) {
+                m_bIsTreeLog = true;
+                readTreeLogFile(sFile, nBurbIns[k]);
+            } else {
+                readLogFile(sFile, nBurbIns[k]);
+            }
+
+            if (m_fCombinedTraces == null) {
+                m_fCombinedTraces = m_fTraces;
+                if (!m_bIsTreeLog) {
+                    nColumns = m_sLabels.length;
+                }
+            } else {
+                if (nColumns != m_sLabels.length) {
+                    throw new Exception("ERROR: The number of columns in file " + sFile + " does not match that of the first file");
+                }
+                for (int i = 0; i < m_fTraces.length; i++) {
+                    Double[] logLine = m_fTraces[i];
+                    Double[] oldTrace = m_fCombinedTraces[i];
+                    Double[] newTrace = new Double[oldTrace.length + logLine.length];
+                    System.arraycopy(oldTrace, 0, newTrace, 0, oldTrace.length);
+                    System.arraycopy(logLine, 0, newTrace, oldTrace.length, logLine.length);
+                    m_fCombinedTraces[i] = newTrace;
+                }
+            }
+            k++;
+        }
+        if (!m_bIsTreeLog) {
+            // reset sample column
+            if (m_fCombinedTraces[0].length > 2) {
+                if (m_nSampleInterval < 0) {
+                    // need to renumber
+                    m_nSampleInterval = (int) (m_fCombinedTraces[0][1] - m_fCombinedTraces[0][0]);
+                }
+                for (int i = 0; i < m_fCombinedTraces[0].length; i++) {
+                    m_fCombinedTraces[0][i] = (double) (m_nSampleInterval * i);
+                }
+            }
+        }
+    }
+
+    protected void readTreeLogFile(String sFile, int nBurnInPercentage) throws Exception {
+        log("\nLoading " + sFile);
+        BufferedReader fin = new BufferedReader(new FileReader(sFile));
+        String sStr = null;
+        m_sPreAmble = "";
+        int nData = 0;
+        // first, sweep through the log file to determine size of the log
+        while (fin.ready()) {
+            sStr = fin.readLine();
+            if (sStr.matches("^tree STATE.*")) {
+                nData++;
+            } else {
+                if (nData == 0) {
+                    m_sPreAmble += sStr + "\n";
+                }
+            }
+        }
+        int nLines = nData / 80;
+        // reserve memory
+        int nBurnIn = nData * nBurnInPercentage / 100;
+        logln(" skipping " + nBurnIn + " trees\n\n" + BAR);
+        if (m_sTrees == null) {
+            m_sTrees = new ArrayList<String>();
+        }
+        fin = new BufferedReader(new FileReader(sFile));
+        nData = -nBurnIn - 1;
+        // grab data from the log, ignoring burn in samples
+        int nSample0 = -1;
+
+        while (fin.ready()) {
+            sStr = fin.readLine();
+            if (sStr.matches("^tree STATE_.*")) {
+                if (++nData >= 0) {
+                    if (m_nSampleInterval < 0) {
+                        String sStr2 = sStr.substring(11, sStr.indexOf("=")).trim();
+                        sStr2 = sStr2.split("\\s")[0];
+                        if (nSample0 < 0) {
+                            nSample0 = Integer.parseInt(sStr2);
+                        } else {
+                            m_nSampleInterval = Integer.parseInt(sStr2) - nSample0;
+                        }
+
+                    }
+                    sStr = sStr.replaceAll("^tree STATE_[^\\s=]*", "");
+                    m_sTrees.add(sStr);
+                }
+            }
+            if (nData % nLines == 0) {
+                log("*");
+            }
+        }
+        logln("");
+    } // readTreeLogFile
+
+    private void printCombinedLogs() {
+        int nData = (m_bIsTreeLog ? m_sTrees.size() : m_fCombinedTraces[0].length);
+        logln("Collected " + nData + " lines in combined log");
+        if (m_sFileOut != null) {
+            log("Writing to file " + m_sFileOut);
+            try {
+                m_out = new PrintStream(new File(m_sFileOut));
+            } catch (FileNotFoundException e) {
+                log("Could not open file " + m_sFileOut + " for writing: " + e.getMessage());
+                return;
+            }
+        }
+        logln("\n\n" + BAR);
+        // preamble
+        m_out.println(m_sPreAmble);
+
+        int nLines = 0;
+        if (m_bIsTreeLog) {
+            for (int i = 0; i < m_sTrees.size(); i++) {
+                if ((m_nSampleInterval * i) % m_nResample == 0) {
+                    String sTree = m_sTrees.get(i);
+                    sTree = format(sTree);
+                    m_out.println("tree STATE_" + (m_nSampleInterval * i) + (Character.isSpaceChar(sTree.charAt(0)) ? "" : " ") + sTree);
+                    nLines++;
+                }
+                if (i % (nData / 80) == 0) {
+                    log("*");
+                }
+            }
+            m_out.println("End;");
+        } else {
+            // header
+            for (int i = 0; i < m_sLabels.length; i++) {
+                m_out.print(m_sLabels[i] + "\t");
+            }
+            m_out.println();
+            for (int i = 0; i < m_fCombinedTraces[0].length; i++) {
+                if (((int) (double) m_fCombinedTraces[0][i]) % m_nResample == 0) {
+                    for (int j = 0; j < m_types.length; j++) {
+                        switch (m_types[j]) {
+                            case INTEGER:
+                                m_out.print((int) (double) m_fCombinedTraces[j][i] + "\t");
+                                break;
+                            case REAL:
+                                m_out.print(format.format(m_fCombinedTraces[j][i]) + "\t");
+                                break;
+                            case NOMINAL:
+                            case BOOL:
+                                m_out.print(m_ranges[(int) (double) m_fCombinedTraces[j][i]] + "\t");
+                                break;
+                        }
+                    }
+                    m_out.print("\n");
+                    nLines++;
+                }
+                if ((nData / 80 > 0) && i % (nData / 80) == 0) {
+                    log("*");
+                }
+            }
+        }
+        logln("\n" + nLines + " lines in combined log");
+    }
+
+    protected String format(String sTree) {
+        if (m_bUseDecimalFormat) {
+            // convert scientific to decimal format
+            if (sTree.matches(".*[0-9]+\\.[0-9]+[0-9-]+E[0-9-]+.*")) {
+                int k = 0;
+                while (k < sTree.length()) {
+                    char c = sTree.charAt(k);
+                    if (Character.isDigit(c)) {
+                        int iStart = k;
+                        while (++k < sTree.length() && Character.isDigit(sTree.charAt(k))) {
+                        }
+                        if (k < sTree.length() && sTree.charAt(k) == '.') {
+                            while (++k < sTree.length() && Character.isDigit(sTree.charAt(k))) {
+                            }
+                            if (k < sTree.length() && (sTree.charAt(k) == 'E' || sTree.charAt(k) == 'e')) {
+                                k++;
+                                if (k < sTree.length() && sTree.charAt(k) == '-') {
+                                    k++;
+                                }
+                                if (k < sTree.length() && Character.isDigit(sTree.charAt(k))) {
+                                    while (++k < sTree.length() && Character.isDigit(sTree.charAt(k))) {
+                                    }
+                                    int iEnd = k;
+                                    String sNumber = sTree.substring(iStart, iEnd);
+                                    double d = Double.parseDouble(sNumber);
+                                    sNumber = format.format(d);
+                                    sTree = sTree.substring(0, iStart) + sNumber + sTree.substring(iEnd);
+                                    k = iStart + sNumber.length();
+                                }
+                            }
+                        }
+                    } else {
+                        k++;
+                    }
+                }
+            }
+        } else {
+            // convert decimal to scientific format
+            if (sTree.matches(".*[0-9]+\\.[0-9]+[^E-].*")) {
+                int k = 0;
+                while (k < sTree.length()) {
+                    char c = sTree.charAt(k);
+                    if (Character.isDigit(c)) {
+                        int iStart = k;
+                        while (++k < sTree.length() && Character.isDigit(sTree.charAt(k))) {
+                        }
+                        if (k < sTree.length() && sTree.charAt(k) == '.') {
+                            while (++k < sTree.length() && Character.isDigit(sTree.charAt(k))) {
+                            }
+                            if (k < sTree.length() && sTree.charAt(k) != '-' && sTree.charAt(k) != 'E' && sTree.charAt(k) != 'e') {
+                                int iEnd = k;
+                                String sNumber = sTree.substring(iStart, iEnd);
+                                double d = Double.parseDouble(sNumber);
+                                sNumber = format.format(d);
+                                sTree = sTree.substring(0, iStart) + sNumber + sTree.substring(iEnd);
+                                k = iStart + sNumber.length();
+                            }
+                        }
+                    } else {
+                        k++;
+                    }
+                }
+            }
+        }
+        return sTree;
+    }
+
+    private static String getUsage() {
+        return "Usage: LogCombiner -log <file> -n <int> [<options>]\n" +
+                "combines multiple (trace or tree) log files into a single log file.\n" +
+                "options:\n" +
+                "-log <file>      specify the name of the log file, each log file must be specified with separate -log option\n" +
+                "-o <output.log>  specify log file to write into (default output is stdout)\n" +
+                "-b <burnin>      specify the number PERCANTAGE of lines in the log file considered to be burnin (default 10)\n" +
+                "-dir <directory> specify particle directory -- used for particle filtering in BEASTii only -- if defined only one log must be specified and the -n option specified\n" +
+                "-n <int>         specify the number of particles, ignored if -dir is not defined\n" +
+                "-resample <int>  specify number of states to resample\n" +
+                "-decimal         flag to indicate numbers should converted from scientific into decimal format\n" +
+                "-renumber        flag to indicate ouput states should be renumbered\n" +
+                "-help            print this message\n";
+    }
+
+    private void printTitle(String aboutString) {
+        aboutString = "LogCombiner" + aboutString.replaceAll("</p>", "\n\n");
+        aboutString = aboutString.replaceAll("<br>", "\n");
+        aboutString = aboutString.replaceAll("<[^>]*>", " ");
+        String[] sStrs = aboutString.split("\n");
+        for (String sStr : sStrs) {
+            int n = 80 - sStr.length();
+            int n1 = n / 2;
+            for (int i = 0; i < n1; i++) {
+                log(" ");
+            }
+            logln(sStr);
+        }
+    }
+
+
+    /**
+     * @param args
+     */
+    public static void main(String[] args) {
+        BEASTVersion version = new BEASTVersion();
+        final String versionString = version.getVersionString();
+        String nameString = "LogCombiner " + versionString;
+        String aboutString = "<html><center><p>" + versionString + ", " + version.getDateString() + "</p>" +
+                "<p>by<br>" +
+                "<p>Andrew Rambaut and Alexei J. Drummond</p>" +
+                "<p>Institute of Evolutionary Biology, University of Edinburgh<br>" +
+                "<a href=\"mailto:a.rambaut at ed.ac.uk\">a.rambaut at ed.ac.uk</a></p>" +
+                "<p>Department of Computer Science, University of Auckland<br>" +
+                "<a href=\"mailto:alexei at cs.auckland.ac.nz\">alexei at cs.auckland.ac.nz</a></p>" +
+                "<p>Part of the BEAST 2 package:<br>" +
+                "<a href=\"http://beast2.cs.auckland.ac.nz/\">http://beast2.cs.auckland.ac.nz/</a></p>" +
+                "</center></html>";
+
+
+        LogCombiner combiner = new LogCombiner();
+        try {
+            if (args.length == 0) {
+                System.setProperty("com.apple.macos.useScreenMenuBar", "true");
+                System.setProperty("apple.laf.useScreenMenuBar", "true");
+                System.setProperty("apple.awt.showGrowBox", "true");
+
+                // TODO: set up ICON
+                java.net.URL url = LogCombiner.class.getResource("images/logcombiner.png");
+                javax.swing.Icon icon = null;
+
+                if (url != null) {
+                    icon = new javax.swing.ImageIcon(url);
+                }
+
+                String titleString = "<html><center><p>LogCombiner<br>" +
+                        "Version " + version.getVersionString() + ", " + version.getDateString() + "</p></center></html>";
+
+                //ConsoleApplication consoleApp =
+                new ConsoleApplication(nameString, aboutString, icon, true);
+
+                combiner.printTitle(aboutString);
+
+                LogCombinerDialog dialog = new LogCombinerDialog(new JFrame(), titleString, icon);
+
+                if (!dialog.showDialog(nameString)) {
+                    return;
+                }
+
+                combiner.m_bIsTreeLog = dialog.isTreeFiles();
+                combiner.m_bUseDecimalFormat = dialog.convertToDecimal();
+                if (combiner.m_bUseDecimalFormat) {
+                    combiner.format = new DecimalFormat("#.############", new DecimalFormatSymbols(Locale.US));
+                }
+                if (!dialog.renumberOutputStates()) {
+                    combiner.m_nSampleInterval = -1;
+                }
+                if (dialog.isResampling()) {
+                    combiner.m_nResample = dialog.getResampleFrequency();
+                }
+
+                String[] inputFiles = dialog.getFileNames();
+                int[] burnins = dialog.getBurnins();
+
+                combiner.m_sFileOut = dialog.getOutputFileName();
+
+                if (combiner.m_sFileOut == null) {
+                    System.err.println("No output file specified");
+                }
+
+                try {
+                    combiner.combineLogs(inputFiles, burnins);
+                    combiner.printCombinedLogs();
+
+                } catch (Exception ex) {
+                    System.err.println("Exception: " + ex.getMessage());
+                    ex.printStackTrace();
+                }
+                System.out.println("Finished - Quit program to exit.");
+                while (true) {
+                    try {
+                        Thread.sleep(1000);
+                    } catch (InterruptedException e) {
+                        e.printStackTrace();
+                    }
+                }
+            } else {
+                combiner.printTitle(aboutString);
+
+                combiner.parseArgs(args);
+                if (combiner.m_sParticleDir == null) {
+                    // classical log combiner
+                    String[] sLogFiles = combiner.m_sLogFileName.toArray(new String[0]);
+                    int[] nBurnIns = new int[sLogFiles.length];
+                    Arrays.fill(nBurnIns, combiner.m_nBurninPercentage);
+                    combiner.combineLogs(sLogFiles, nBurnIns);
+
+                } else {
+                    // particle log combiner
+                    combiner.combineParticleLogs();
+                }
+                combiner.printCombinedLogs();
+            }
+        } catch (Exception e) {
+            System.out.println(getUsage());
+            e.printStackTrace();
+        }
+    } // main
+
+
+}
diff --git a/src/beast/app/tools/LogCombinerDialog.java b/src/beast/app/tools/LogCombinerDialog.java
new file mode 100644
index 0000000..99d54b2
--- /dev/null
+++ b/src/beast/app/tools/LogCombinerDialog.java
@@ -0,0 +1,390 @@
+/*
+ * LogCombinerDialog.java
+ *
+ * Copyright (C) 2002-2006 Alexei Drummond and Andrew Rambaut
+ *
+ * This file is part of BEAST.
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership and licensing.
+ *
+ * BEAST 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
+ * of the License, or (at your option) any later version.
+ *
+ *  BEAST 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 BEAST; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+package beast.app.tools;
+
+
+//import dr.app.gui.FileDrop;
+
+//import dr.app.gui.table.TableEditorStopper;
+//import dr.app.gui.components.WholeNumberField;
+import jam.panels.ActionPanel;
+import jam.panels.OptionsPanel;
+import jam.table.TableRenderer;
+
+import javax.swing.*;
+import javax.swing.border.Border;
+import javax.swing.border.EmptyBorder;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+import javax.swing.table.AbstractTableModel;
+
+import beast.app.beauti.Beauti;
+import beast.app.util.FileDrop;
+import beast.app.util.Utils;
+import beast.app.util.WholeNumberField;
+
+
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+public class LogCombinerDialog {
+    private final JFrame frame;
+
+    private final OptionsPanel optionPanel;
+
+    private JTable filesTable = null;
+    private FilesTableModel filesTableModel = null;
+
+    private final JComboBox fileTypeCombo = new JComboBox(new String[]{"Log Files", "Tree Files"});
+    private final JCheckBox decimalCheck = new JCheckBox("Convert numbers from scientific to decimal notation");
+    private final JCheckBox renumberOutput = new JCheckBox("Renumber ouput states");
+    private final JCheckBox resampleCheck = new JCheckBox("Resample states at lower frequency: ");
+    private final WholeNumberField resampleText = new WholeNumberField(0, Integer.MAX_VALUE);
+
+    private final List<FileInfo> files = new ArrayList<FileInfo>();
+
+    private final JTextField fileNameText = new JTextField("not selected", 16);
+    private File outputFile = null;
+
+    public LogCombinerDialog(final JFrame frame, String titleString, Icon icon) {
+        this.frame = frame;
+
+        optionPanel = new OptionsPanel(12, 12);
+
+        final JLabel titleText = new JLabel(titleString);
+        titleText.setIcon(icon);
+        optionPanel.addSpanningComponent(titleText);
+        titleText.setFont(new Font("sans-serif", 0, 12));
+
+        JPanel panel = new JPanel(new BorderLayout());
+        panel.setOpaque(false);
+
+        // Taxon Sets
+        filesTableModel = new FilesTableModel();
+        filesTable = new JTable(filesTableModel);
+
+        filesTable.getColumnModel().getColumn(0).setCellRenderer(
+                new TableRenderer(SwingConstants.LEFT, new Insets(0, 4, 0, 4)));
+        filesTable.getColumnModel().getColumn(0).setPreferredWidth(120);
+        filesTable.getColumnModel().getColumn(0).setPreferredWidth(80);
+
+        // This causes superfluous TabelModel.setValue events to fire.
+        // Is this still needed?  I guess we'll see...
+        //TableEditorStopper.ensureEditingStopWhenTableLosesFocus(filesTable);
+
+        filesTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
+            public void valueChanged(ListSelectionEvent evt) {
+                filesTableSelectionChanged();
+            }
+        });
+
+        JScrollPane scrollPane1 = new JScrollPane(filesTable,
+                JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
+                JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
+        //scrollPane1.setMaximumSize(new Dimension(10000, 10));
+        scrollPane1.setPreferredSize(new Dimension(500, 285));
+
+        ActionPanel actionPanel1 = new ActionPanel(false);
+        actionPanel1.setAddAction(addFileAction);
+        actionPanel1.setRemoveAction(removeFileAction);
+        removeFileAction.setEnabled(false);
+
+        JPanel controlPanel1 = new JPanel(new FlowLayout(FlowLayout.LEFT));
+        controlPanel1.add(actionPanel1);
+
+        panel.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));
+        panel.add(new JLabel("Select input files:"), BorderLayout.NORTH);
+        panel.add(scrollPane1, BorderLayout.CENTER);
+        panel.add(actionPanel1, BorderLayout.SOUTH);
+
+        Color focusColor = UIManager.getColor("Focus.color");
+        Border focusBorder = BorderFactory.createMatteBorder(2, 2, 2, 2, focusColor);
+        new FileDrop(null, scrollPane1, focusBorder, new FileDrop.Listener() {
+            public void filesDropped(java.io.File[] files) {
+                addFiles(files);
+            }   // end filesDropped
+        }); // end FileDrop.Listener
+
+        resampleText.setEnabled(false);
+        resampleText.setColumns(12);
+        resampleCheck.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                resampleText.setEnabled(resampleCheck.isSelected());
+            }
+        });
+
+        ActionListener buttonListener = new ActionListener() {
+            public void actionPerformed(ActionEvent ae) {
+                File file = Utils.getSaveFile("Select output file...", new File(Beauti.g_sDir), "Beast log and tree files", "log", "trees");
+                if (file == null) {
+                    // the dialog was cancelled...
+                    return;
+                }
+                outputFile = file;
+                String sFileName = file.getAbsolutePath();
+                String fileSep = System.getProperty("file.separator");
+                if (fileSep.equals("\\")) {
+                	fileSep = "\\\\";
+                }
+                if (sFileName.lastIndexOf(fileSep) > 0) {
+                    Beauti.g_sDir = sFileName.substring(0, sFileName.lastIndexOf(fileSep));
+                }
+                fileNameText.setText(outputFile.getName());
+
+            }
+        };
+
+        JButton button = new JButton("Choose File...");
+        button.addActionListener(buttonListener);
+
+        JPanel panel2 = new JPanel(new BorderLayout(0, 0));
+        panel2.add(resampleCheck, BorderLayout.CENTER);
+        panel2.add(resampleText, BorderLayout.EAST);
+        optionPanel.addComponentWithLabel("File type: ", fileTypeCombo);
+        optionPanel.addComponent(decimalCheck);
+        optionPanel.addComponent(renumberOutput);
+        optionPanel.addComponent(panel2);
+
+        optionPanel.addSpanningComponent(panel);
+
+        fileNameText.setEditable(false);
+
+        JPanel panel3 = new JPanel(new BorderLayout(0, 0));
+        panel3.add(fileNameText, BorderLayout.CENTER);
+        panel3.add(button, BorderLayout.EAST);
+        optionPanel.addComponentWithLabel("Output File: ", panel3);
+    }
+
+    public boolean showDialog(String title) {
+
+        addFileAction.setEnabled(true);
+        removeFileAction.setEnabled(false);
+
+        filesTableModel.fireTableDataChanged();
+
+        JOptionPane optionPane = new JOptionPane(optionPanel,
+                JOptionPane.PLAIN_MESSAGE,
+                JOptionPane.OK_CANCEL_OPTION,
+                null,
+                new String[]{"Run", "Quit"},
+                null);
+        optionPane.setBorder(new EmptyBorder(12, 12, 12, 12));
+
+        final JDialog dialog = optionPane.createDialog(frame, title);
+        //dialog.setResizable(true);
+        dialog.pack();
+
+        dialog.setVisible(true);
+
+        return optionPane.getValue().equals("Run");
+    }
+
+    public String[] getFileNames() {
+        String[] fileArray = new String[files.size()];
+        for (int i = 0; i < files.size(); i++) {
+            FileInfo fileInfo = files.get(i);
+            fileArray[i] = fileInfo.file.getPath();
+        }
+        return fileArray;
+    }
+
+    public int[] getBurnins() {
+        int[] burnins = new int[files.size()];
+        for (int i = 0; i < files.size(); i++) {
+            FileInfo fileInfo = files.get(i);
+            burnins[i] = fileInfo.burnin;
+        }
+        return burnins;
+    }
+
+    public boolean isTreeFiles() {
+        return fileTypeCombo.getSelectedIndex() == 1;
+    }
+
+    public boolean convertToDecimal() {
+        return decimalCheck.isSelected();
+    }
+
+    public boolean renumberOutputStates() {
+        return renumberOutput.isSelected();
+    }
+
+    public boolean isResampling() {
+        return resampleCheck.isSelected();
+    }
+
+    public int getResampleFrequency() {
+        return resampleText.getValue();
+    }
+
+    public String getOutputFileName() {
+        if (outputFile == null) return null;
+        return outputFile.getPath();
+    }
+
+    private void filesTableSelectionChanged() {
+        if (filesTable.getSelectedRowCount() == 0) {
+            removeFileAction.setEnabled(false);
+        } else {
+            removeFileAction.setEnabled(true);
+        }
+    }
+
+    private void addFiles(File[] fileArray) {
+        int sel1 = files.size();
+        for (File file : fileArray) {
+            FileInfo fileInfo = new FileInfo();
+            fileInfo.file = file;
+            fileInfo.burnin = 0;
+
+            files.add(fileInfo);
+
+            String sFileName = file.getAbsolutePath();
+            String fileSep = System.getProperty("file.separator");
+            if (fileSep.equals("\\")) {
+            	fileSep = "\\\\";
+            }
+
+            if (sFileName.lastIndexOf(fileSep) > 0) {
+                Beauti.g_sDir = sFileName.substring(0, sFileName.lastIndexOf(fileSep));
+            }
+        }
+
+        filesTableModel.fireTableDataChanged();
+
+        int sel2 = files.size() - 1;
+        filesTable.setRowSelectionInterval(sel1, sel2);
+
+    }
+
+    Action addFileAction = new AbstractAction("+") {
+
+        /**
+         *
+         */
+        private static final long serialVersionUID = 7602227478402204088L;
+
+        public void actionPerformed(ActionEvent ae) {
+            File[] files = Utils.getLoadFiles("Select log file", new File(Beauti.g_sDir), "Trace or tree log files", "log", "trees");
+            if (files != null) {
+                addFiles(files);
+            }
+        }
+    };
+
+    Action removeFileAction = new AbstractAction("-") {
+
+        /**
+         *
+         */
+        private static final long serialVersionUID = 5934278375005327047L;
+
+        public void actionPerformed(ActionEvent ae) {
+            int row = filesTable.getSelectedRow();
+            if (row != -1) {
+                files.remove(row);
+            }
+
+            filesTableModel.fireTableDataChanged();
+
+            if (row >= files.size()) row = files.size() - 1;
+            if (row >= 0) {
+                filesTable.setRowSelectionInterval(row, row);
+            }
+        }
+    };
+
+
+    class FilesTableModel extends AbstractTableModel {
+        /**
+         *
+         */
+        private static final long serialVersionUID = 4153326364833213013L;
+        private final String[] columns = {"File", "Burnin (percentage)"};
+
+        public FilesTableModel() {
+        }
+
+        public int getColumnCount() {
+            return columns.length;
+        }
+
+        public int getRowCount() {
+            return files.size();
+        }
+
+        public Object getValueAt(int rowIndex, int columnIndex) {
+            FileInfo fileInfo = files.get(rowIndex);
+            if (columnIndex == 0) {
+                return fileInfo.file.getName();
+            } else {
+                return fileInfo.burnin;
+            }
+        }
+
+        public boolean isCellEditable(int rowIndex, int columnIndex) {
+            return (columnIndex == 1);
+        }
+
+        /**
+         * This empty implementation is provided so users don't have to implement
+         * this method if their data model is not editable.
+         *
+         * @param aValue      value to assign to cell
+         * @param rowIndex    row of cell
+         * @param columnIndex column of cell
+         */
+        public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
+            FileInfo fileInfo = files.get(rowIndex);
+            if (columnIndex == 1) {
+                int newBurnin = (int)aValue;
+                if (newBurnin<0 || newBurnin>100)
+                    JOptionPane.showMessageDialog(frame,
+                            "Burn-in percentage must be between 0 and 100.",
+                            "Error", JOptionPane.ERROR_MESSAGE);
+                else
+                    fileInfo.burnin = newBurnin;
+            }
+        }
+
+        public String getColumnName(int columnIndex) {
+            return columns[columnIndex];
+        }
+
+        public Class<?> getColumnClass(int columnIndex) {
+            return getValueAt(0, columnIndex).getClass();
+        }
+    }
+
+    class FileInfo {
+        File file;
+        Integer burnin;
+    }
+}
diff --git a/src/beast/app/tools/LogCombinerLauncher.java b/src/beast/app/tools/LogCombinerLauncher.java
new file mode 100644
index 0000000..a2f45b7
--- /dev/null
+++ b/src/beast/app/tools/LogCombinerLauncher.java
@@ -0,0 +1,17 @@
+package beast.app.tools;
+
+import beast.app.beastapp.BeastLauncher;
+import beast.app.beastapp.BeastMain;
+
+/** Launches log-combiner 
+ * @see BeastLauncher 
+ * **/
+public class LogCombinerLauncher extends BeastLauncher {
+
+	public static void main(String[] args) throws Exception {
+		if (javaVersionCheck("LogCombiner")) {
+			loadBEASTJars();
+			LogCombiner.main(args);
+		}
+	}
+}
diff --git a/src/beast/app/tools/TableEditorStopper.java b/src/beast/app/tools/TableEditorStopper.java
new file mode 100644
index 0000000..b9cccb6
--- /dev/null
+++ b/src/beast/app/tools/TableEditorStopper.java
@@ -0,0 +1,80 @@
+package beast.app.tools;
+
+import java.awt.Component;
+import java.awt.event.FocusAdapter;
+import java.awt.event.FocusEvent;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import javax.swing.JTable;
+import javax.swing.table.TableCellEditor;
+
+// TODO: check whetehr this is still relevant. Last complaint was at 16-JUN-2011! 
+
+/**
+ * This class is a workaround for a bug in Java (4503845)
+ * see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4503845
+ * Although the state appears as fixed, it does not yet work on 1.5
+ * (see the comments at the end on the previous page)
+ * <p/>
+ * The bug refers to tables with editing cells. When the user interacts
+ * with other UI element -or other cell in the table-, the editor component
+ * should receive a stopCellEditing call.
+ * This does not happen if the user selects a UI element outside the table.
+ * <p/>
+ * For example:
+ * - A dialog contains a table and a Cancel button that, before closing,
+ * verifies whether there are changes to save.
+ * -The user is modifying one cell and then presses the Cancel button
+ * -Then the cell editor does not receive an stopCellEditing call, so
+ * there seems to be no changes to save!
+ * <p/>
+ * A basic solution for this last example would be to call to
+ * table.getCellEditor().stopCellEditing() when reacting to events on the
+ * Cancel button, but this call should be made on every event handler for
+ * each UI element!
+ * <p/>
+ * This class works by listening to focus events when a cell editor is selected.
+ * If the focus is transfered to any place outside the table, it calls to
+ * stopCellEditing()
+ * Why is it not enough to check the focus on just the editor component?
+ * => Because the TableCellEditor could be composed of multiple Components
+ */
+public class TableEditorStopper extends FocusAdapter implements PropertyChangeListener {
+    public static void ensureEditingStopWhenTableLosesFocus(JTable table) {
+        new TableEditorStopper(table);
+    }
+
+    private TableEditorStopper(JTable table) {
+        this.table = table;
+        table.addPropertyChangeListener("tableCellEditor", this);
+    }
+
+    public void propertyChange(PropertyChangeEvent evt) {
+        if (focused != null) {
+            focused.removeFocusListener(this);
+        }
+        focused = table.getEditorComponent();
+        if (focused != null) {
+            focused.addFocusListener(this);
+        }
+    }
+
+    public void focusLost(FocusEvent e) {
+        if (focused != null) {
+            focused.removeFocusListener(this);
+            focused = e.getOppositeComponent();
+            if (table == focused || table.isAncestorOf(focused)) {
+                focused.addFocusListener(this);
+            } else {
+                focused = null;
+                TableCellEditor editor = table.getCellEditor();
+                if (editor != null) {
+                    editor.stopCellEditing();
+                }
+            }
+        }
+    }
+
+    private Component focused;
+    private JTable table;
+}
diff --git a/src/beast/app/tools/images/EBSPAnalyser.png b/src/beast/app/tools/images/EBSPAnalyser.png
new file mode 100644
index 0000000..fa54a6e
Binary files /dev/null and b/src/beast/app/tools/images/EBSPAnalyser.png differ
diff --git a/src/beast/app/tools/images/logcombiner.png b/src/beast/app/tools/images/logcombiner.png
new file mode 100644
index 0000000..fbe610a
Binary files /dev/null and b/src/beast/app/tools/images/logcombiner.png differ
diff --git a/src/beast/app/tools/images/utility.png b/src/beast/app/tools/images/utility.png
new file mode 100644
index 0000000..f008380
Binary files /dev/null and b/src/beast/app/tools/images/utility.png differ
diff --git a/src/beast/app/treeannotator/CladeSystem.java b/src/beast/app/treeannotator/CladeSystem.java
new file mode 100644
index 0000000..d99f1f1
--- /dev/null
+++ b/src/beast/app/treeannotator/CladeSystem.java
@@ -0,0 +1,386 @@
+package beast.app.treeannotator;
+
+import beast.evolution.tree.Node;
+import beast.evolution.tree.Tree;
+
+import java.util.*;
+
+/**
+ * extracted from TreeAnnotator
+ */
+//TODO merge with CladeSet?
+public class CladeSystem {
+
+    protected Map<BitSet, Clade> cladeMap = new HashMap<>();
+
+    public CladeSystem() { }
+
+    public CladeSystem(Tree targetTree) {
+        add(targetTree, true);
+    }
+
+    /**
+     * adds all the clades in the tree
+     */
+    public void add(Tree tree, boolean includeTips) {
+        // Recurse over the tree and add all the clades (or increment their
+        // frequency if already present). The root clade is added too (for
+        // annotation purposes).
+        addClades(tree.getRoot(), includeTips);
+    }
+
+    private BitSet addClades(Node node, boolean includeTips) {
+
+        BitSet bits = new BitSet();
+
+        if (node.isLeaf()) {
+
+            int index = getTaxonIndex(node);
+            bits.set(2*index);
+
+            if (includeTips) {
+                addClade(bits);
+            }
+
+        } else {
+
+            for (int i = 0; i < node.getChildCount(); i++) {
+
+                Node node1 = node.getChild(i);
+
+                bits.or(addClades(node1, includeTips));
+            }
+
+            for (int i=1; i<bits.length(); i=i+2) {
+                bits.set(i, false);
+            }
+            if (node.isFake()) {
+                int index = getTaxonIndex(node.getDirectAncestorChild());
+                bits.set(2 * index + 1);
+            }
+            addClade(bits);
+        }
+
+        return bits;
+    }
+
+    private void addClade(BitSet bits) {
+        Clade clade = cladeMap.get(bits);
+        if (clade == null) {
+            clade = new Clade(bits);
+            cladeMap.put(bits, clade);
+        }
+        clade.setCount(clade.getCount() + 1);
+    }
+
+    public void collectAttributes(Tree tree, Set<String> attributeNames) {
+        collectAttributes(tree.getRoot(), attributeNames);
+    }
+
+    private BitSet collectAttributes(Node node, Set<String> attributeNames) {
+
+        BitSet bits = new BitSet();
+
+        if (node.isLeaf()) {
+
+            int index = getTaxonIndex(node);
+            if (index < 0) {
+                throw new IllegalArgumentException("Taxon, " + node.getID() + ", not found in target tree");
+            }
+            bits.set(2*index);
+
+        } else {
+
+            for (int i = 0; i < node.getChildCount(); i++) {
+
+                Node node1 = node.getChild(i);
+
+                bits.or(collectAttributes(node1, attributeNames));
+            }
+
+            for (int i=1; i<bits.length(); i=i+2) {
+                bits.set(i, false);
+            }
+            if (node.isFake()) {
+                int index = getTaxonIndex(node.getDirectAncestorChild());
+                bits.set(2 * index + 1);
+            }
+        }
+
+        collectAttributesForClade(bits, node, attributeNames);
+
+        return bits;
+    }
+
+    private void collectAttributesForClade(BitSet bits, Node node, Set<String> attributeNames) {
+        Clade clade = cladeMap.get(bits);
+        if (clade != null) {
+
+            if (clade.attributeValues == null) {
+                clade.attributeValues = new ArrayList<>();
+            }
+
+            int i = 0;
+            Object[] values = new Object[attributeNames.size()];
+            for (String attributeName : attributeNames) {
+
+                Object value;
+                switch (attributeName) {
+                    case "height":
+                        value = node.getHeight();
+                        break;
+                    case "length":
+                        value = getBranchLength(node);
+                        break;
+                    default:
+                        value = node.getMetaData(attributeName);
+                        if (value instanceof String && ((String) value).startsWith("\"")) {
+                            value = ((String) value).replaceAll("\"", "");
+                        }
+                        break;
+                }
+
+                values[i] = value;
+
+                i++;
+            }
+            clade.attributeValues.add(values);
+
+            clade.setCount(clade.getCount() + 1);
+        }
+    }
+
+    private Object getBranchLength(Node node) {
+        if (node.isRoot()) {
+            return 0;
+        }
+        return node.getParent().getHeight() - node.getHeight();
+    }
+
+    public Map<BitSet, Clade> getCladeMap() {
+        return cladeMap;
+    }
+
+    public void calculateCladeCredibilities(int totalTreesUsed) {
+        for (Clade clade : cladeMap.values()) {
+
+            if (clade.getCount() > totalTreesUsed) {
+
+                throw new AssertionError("clade.getCount=(" + clade.getCount() +
+                        ") should be <= totalTreesUsed = (" + totalTreesUsed + ")");
+            }
+
+            clade.setCredibility(((double) clade.getCount()) / (double) totalTreesUsed);
+        }
+    }
+
+    public double getSumCladeCredibility(Node node, BitSet bits) {
+
+        double sum = 0.0;
+
+        if (node.isLeaf()) {
+
+            int index = getTaxonIndex(node);
+            bits.set(2*index);
+        } else {
+
+            BitSet bits2 = new BitSet();
+            for (int i = 0; i < node.getChildCount(); i++) {
+
+                Node node1 = node.getChild(i);
+
+                sum += getSumCladeCredibility(node1, bits2);
+            }
+
+            for (int i=1; i<bits2.length(); i=i+2) {
+                bits2.set(i, false);
+            }
+
+            if (node.isFake()) {
+                int index = getTaxonIndex(node.getDirectAncestorChild());
+                bits2.set(2 * index + 1);
+            }
+
+            sum += getCladeCredibility(bits2);
+
+            if (bits != null) {
+                bits.or(bits2);
+            }
+        }
+
+        return sum;
+    }
+
+    public double getLogCladeCredibility(Node node, BitSet bits) {
+
+        double logCladeCredibility = 0.0;
+
+        if (node.isLeaf()) {
+
+            int index = getTaxonIndex(node);
+            bits.set(2*index);
+        } else {
+
+            BitSet bits2 = new BitSet();
+            for (int i = 0; i < node.getChildCount(); i++) {
+
+                Node node1 = node.getChild(i);
+
+                logCladeCredibility += getLogCladeCredibility(node1, bits2);
+            }
+
+            for (int i=1; i<bits2.length(); i=i+2) {
+                bits2.set(i, false);
+            }
+
+            if (node.isFake()) {
+                int index = getTaxonIndex(node.getDirectAncestorChild());
+                bits2.set(2 * index + 1);
+            }
+
+            logCladeCredibility += Math.log(getCladeCredibility(bits2));
+
+            if (bits != null) {
+                bits.or(bits2);
+            }
+        }
+
+        return logCladeCredibility;
+    }
+
+    private double getCladeCredibility(BitSet bits) {
+        Clade clade = cladeMap.get(bits);
+        if (clade == null) {
+            return 0.0;
+        }
+        return clade.getCredibility();
+    }
+
+    public BitSet removeClades(Node node, boolean includeTips) {
+
+        BitSet bits = new BitSet();
+
+        if (node.isLeaf()) {
+
+            int index = getTaxonIndex(node);
+            bits.set(2*index);
+
+            if (includeTips) {
+                removeClade(bits);
+            }
+
+        } else {
+
+            for (int i = 0; i < node.getChildCount(); i++) {
+
+                Node node1 = node.getChild(i);
+
+                bits.or(removeClades(node1, includeTips));
+            }
+
+            for (int i=1; i<bits.length(); i=i+2) {
+                bits.set(i, false);
+            }
+            if (node.isFake()) {
+                int index = getTaxonIndex(node.getDirectAncestorChild());
+                bits.set(2 * index + 1);
+            }
+
+            removeClade(bits);
+        }
+
+        return bits;
+    }
+
+    private void removeClade(BitSet bits) {
+        Clade clade = cladeMap.get(bits);
+        if (clade != null) {
+            clade.setCount(clade.getCount() - 1);
+        }
+
+    }
+
+    // Get tree clades as bitSets on target taxa
+    // codes is an array of existing BitSet objects, which are reused
+
+    void getTreeCladeCodes(Tree tree, BitSet[] codes) {
+        getTreeCladeCodes(tree.getRoot(), codes);
+    }
+
+    int getTreeCladeCodes(Node node, BitSet[] codes) {
+        final int inode = node.getNr();
+        codes[inode].clear();
+        if (node.isLeaf()) {
+            int index = getTaxonIndex(node);//getTaxonIndex(node);
+            codes[inode].set(index);
+        } else {
+            for (int i = 0; i < node.getChildCount(); i++) {
+                final Node child = node.getChild(i);
+                final int childIndex = getTreeCladeCodes(child, codes);
+
+                codes[inode].or(codes[childIndex]);
+            }
+        }
+        return inode;
+    }
+
+    public int getTaxonIndex(Node node) {
+        return node.getNr();
+    }
+
+    public class Clade {
+        public Clade(BitSet bits) {
+            this.bits = bits;
+            count = 0;
+            credibility = 0.0;
+        }
+
+        public int getCount() {
+            return count;
+        }
+
+        public void setCount(int count) {
+            this.count = count;
+        }
+
+        public double getCredibility() {
+            return credibility;
+        }
+
+        public void setCredibility(double credibility) {
+            this.credibility = credibility;
+        }
+
+        public List<Object[]> getAttributeValues() {
+            return attributeValues;
+        }
+
+        @Override
+        public boolean equals(Object o) {
+            if (this == o) return true;
+            if (o == null || getClass() != o.getClass()) return false;
+
+            final Clade clade = (Clade) o;
+
+            return !(bits != null ? !bits.equals(clade.bits) : clade.bits != null);
+
+        }
+
+        @Override
+        public int hashCode() {
+            return (bits != null ? bits.hashCode() : 0);
+        }
+
+        @Override
+        public String toString() {
+            return "clade " + bits.toString();
+        }
+
+        int count;
+        double credibility;
+        BitSet bits;
+        List<Object[]> attributeValues = null;
+    }
+
+
+}
diff --git a/src/beast/app/treeannotator/ContourAttrib.java b/src/beast/app/treeannotator/ContourAttrib.java
new file mode 100644
index 0000000..92c294e
--- /dev/null
+++ b/src/beast/app/treeannotator/ContourAttrib.java
@@ -0,0 +1,79 @@
+package beast.app.treeannotator;
+
+
+/**
+*  <p> This object represents the attributes assigned to a
+*      contour path.  Typically, the same attributes are
+*      assigned to all the contour paths of a given contour
+*      level.
+*  </p>
+*
+*  <p> Right now, the only attribute used is "level", but
+*      in the future I may add more.
+*  </p>
+*
+*  <p>  Modified by:  Joseph A. Huwaldt  </p>
+*
+*  @author  Joseph A. Huwaldt   Date:  November 11, 2000
+*  @version November 17, 2000
+*
+*
+*  @author Marc Suchard
+**/
+public class ContourAttrib implements Cloneable, java.io.Serializable {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+	//	The level (altitude) of a contour path.
+	private double level;
+
+
+	/**
+	*  Create a contour attribute object where only
+	*  the contour level is specified.
+	**/
+	public ContourAttrib(double level) {
+		this.level = level;
+	}
+
+	/**
+	*  Return the level stored in this contour attribute.
+	**/
+	public double getLevel() {
+		return level;
+	}
+
+	/**
+	*  Set or change the level stored in this contour attribute.
+	**/
+	public void setLevel(double level) {
+		this.level = level;
+	}
+
+	/**
+	*  Make a copy of this ContourAttrib object.
+	*
+	*  @return  Returns a clone of this object.
+	**/
+	public Object clone() {
+		ContourAttrib newObject = null;
+
+		try {
+			// Make a shallow copy of this object.
+			newObject = (ContourAttrib) super.clone();
+
+			// There is no "deep" data to be cloned.
+
+		} catch (CloneNotSupportedException e) {
+			// Can't happen.
+			e.printStackTrace();
+		}
+
+		// Output the newly cloned object.
+		return newObject;
+	}
+
+}
+
diff --git a/src/beast/app/treeannotator/ContourGenerator.java b/src/beast/app/treeannotator/ContourGenerator.java
new file mode 100644
index 0000000..64e77b1
--- /dev/null
+++ b/src/beast/app/treeannotator/ContourGenerator.java
@@ -0,0 +1,896 @@
+package beast.app.treeannotator;
+
+import java.util.*;
+
+
+/**
+*  <p> An object used to generate a list of contour lines
+*      or paths from a set of gridded three dimensional data.
+*  </p>
+*
+*  <p> Based on contour_plot.c from NeXTcontour1.4 by Thomas H. Pulliam,
+*      pulliam at rft29.nas.nasa.gov, MS 202A-1 NASA Ames Research Center,
+*      Moffett Field, CA 94035.
+*      I don't know how the original Fortran code looked like or where it came from,
+*      other than that NeXTcontour1.4 is based on Pieter Bunings' PLOT3D package
+*      for Computational Fluid Dynamics.
+*  </p>
+*
+*  <p> Ported from C to Java by Joseph A. Huwaldt, November 16, 2000.  </p>
+*
+*  <p>  Modified by:  Joseph A. Huwaldt  </p>
+*
+*  @author  Joseph A. Huwaldt   Date:  November 11, 2000
+*  @version November 23, 2000
+*
+*  @author Marc Suchard
+*
+**/
+public class ContourGenerator {
+
+	//	Debug flag.
+	private static final boolean DEBUG = false;
+
+	//	Error messages.
+	private static final String kCancelMsg = "Method ContourGenerator.getContours() canceled by user.";
+	private static final String kInconsistantArrMsg = "Inconsistant array sizes.";
+	private static final String kArrSizeMsg = "Data arrays must have more than one row or column.";
+	private static final String kNegLogDataMsg = "Function data must be > 0 for logarithmic intervals.";
+
+	//	Path buffer size.
+	private static final int kBufSize = 1000;
+
+	//	The minimum number of points allowed in a contour path.
+	private static final int kMinNumPoints = 3;
+
+	//	A list of contour paths.
+	private List<ContourPath> pathList = new ArrayList<ContourPath>();
+
+	//	A flag to indicate that the contours have been computed or not.
+	private boolean cCalculated = false;
+
+	//	Data arrays used for generating the contours.
+	private double[][] xArray, yArray, funcArray;
+
+	//	Data arrays used when generating contours for 1D X & Y arrays.
+	private double[] xArr1D, yArr1D;
+
+	//	Array of contour attributes, one for each contour level.
+	private ContourAttrib[] cAttr;
+
+	//	The fraction of the task that is completed.
+	private float fracComplete = 0;
+
+	/**
+	*  Used to indicate that the user wishes to cancel the calculation
+	*  of contours.
+	**/
+	private boolean isCanceled = false;
+
+
+	//	Variables in the original FORTRAN program.
+	private double[] pathbufxt, pathbufyt;
+	private int[] pathbufia;
+	private int lnstrt;				//	lnstrt=1 indicates starting a new line.
+	private int ignext;
+	private int icont;				//	Current contour level index.
+	private double cont;			//	The current contour level.
+	private int iss, iee, jss, jee;	//	i & j start and end index values.
+	private int ima;				//	ima tells which boundary region we are on.
+	private int iae;				//	Index to last element in the IA list.
+	private int ibeg, jbeg;
+	private int gi, gj;				//	Indexes into data arrays.
+	private double fij;				//	Data value at i,j in data array.
+	private int idir;				//	Indicates current direction.
+	private int np=0;				//	Number of points in current contour line.
+	private double wx=0, wy=0;		//	Starting point of a contour line.
+
+
+	/**
+	*  Construct a ContourGenerator object using the specified data arrays
+	*  and the specified attribute array.  This constructor allows you
+	*  to use data on an uneven X, Y grid.
+	*
+	*  @param  xArr   2D array containing the grid x coordinate data.
+	*  @param  yArr   2D array containing the grid y coordinate data.
+	*  @param  fArr   2D array containing the grid function (z) data.
+	*  @param  cAttr  Array containing attributes of the contour levels.
+	**/
+	public ContourGenerator(double[][] xArr, double[][] yArr, double[][] fArr, ContourAttrib[] cAttr) {
+
+		//	Make sure input data is reasonable.
+		if (yArr.length != xArr.length || yArr.length != fArr.length)
+			throw new IllegalArgumentException(kInconsistantArrMsg);
+		if (yArr[0].length != xArr[0].length || yArr[0].length != fArr[0].length)
+			throw new IllegalArgumentException(kInconsistantArrMsg);
+		if (xArr.length <= 1 || xArr[0].length <= 1)
+			throw new IllegalArgumentException(kArrSizeMsg);
+
+		this.cAttr = cAttr;
+		xArray = xArr;
+		yArray = yArr;
+		funcArray = fArr;
+
+	}
+
+	/**
+	*  Construct a ContourGenerator object using the specified data arrays
+	*  and the specified attribute array.  This constructor allows you
+	*  to use data on an evenly spaced grid where "X" values are invarient
+	*  with "Y" and "Y" values are invarient with "X".  This often occures
+	*  where the data is on an evenly spaced cartesian grid.
+	*
+	*  @param  xArr   1D array containing the grid x coordinate data.
+	*  @param  yArr   1D array containing the grid y coordinate data.
+	*  @param  fArr   2D array containing the grid function (z) data.
+	*  @param  cAttr  Array containing attributes of the contour levels.
+	**/
+	public ContourGenerator(double[] xArr, double[] yArr, double[][] fArr, ContourAttrib[] cAttr) {
+
+		//	Make sure input data is reasonable.
+		if (yArr.length != fArr.length || xArr.length != fArr[0].length)
+			throw new IllegalArgumentException(kInconsistantArrMsg);
+		if (xArr.length <= 1)
+			throw new IllegalArgumentException(kArrSizeMsg);
+
+		this.cAttr = cAttr;
+		xArr1D = xArr;
+		yArr1D = yArr;
+		funcArray = fArr;
+	}
+
+	/**
+	*  Construct a ContourGenerator object using the specified data arrays.
+	*  Contour attributes, including the interval, are generated
+	*  automatically.  This constructor allows you to use data on an
+	*  uneven X, Y grid.
+	*
+	*  @param  xArr   2D array containing the grid x coordinate data.
+	*  @param  yArr   2D array containing the grid y coordinate data.
+	*  @param  fArr   2D array containing the grid function (z) data.
+	*  @param  nc     The number of contour levels to generate.
+	*  @param  logInterval  Uses a logarithmic contour interval if true, and
+	*                       uses a linear interval if false.
+	**/
+	public ContourGenerator(double[][] xArr, double[][] yArr, double[][] fArr,
+								int nc, boolean logInterval) {
+
+		//	Make sure input data is reasonable.
+		if (yArr.length != xArr.length || yArr.length != fArr.length)
+			throw new IllegalArgumentException(kInconsistantArrMsg);
+		if (yArr[0].length != xArr[0].length || yArr[0].length != fArr[0].length)
+			throw new IllegalArgumentException(kInconsistantArrMsg);
+		if (xArr.length <= 1 || xArr[0].length <= 1)
+			throw new IllegalArgumentException(kArrSizeMsg);
+
+		xArray = xArr;
+		yArray = yArr;
+		funcArray = fArr;
+
+		if (logInterval)
+			findLogIntervals(nc);
+		else
+			findLinearIntervals(nc);
+	}
+
+	/**
+	*  Construct a ContourGenerator object using the specified data arrays.
+	*  Contour attributes, including the interval, are generated
+	*  automatically.  This constructor allows you
+	*  to use data on an evenly spaced grid where "X" values are invarient
+	*  with "Y" and "Y" values are invarient with "X".  This often occures
+	*  where the data is on an evenly spaced cartesian grid.
+	*
+	*  @param  xArr   1D array containing the grid x coordinate data.
+	*  @param  yArr   1D array containing the grid y coordinate data.
+	*  @param  fArr   2D array containing the grid function (z) data.
+	*  @param  nc     The number of contour levels to generate.
+	*  @param  logInterval  Uses a logarithmic contour interval if true, and
+	*                       uses a linear interval if false.
+	**/
+	public ContourGenerator(double[] xArr, double[] yArr, double[][] fArr,
+								int nc, boolean logInterval) {
+
+		//	Make sure input data is reasonable.
+		if (yArr.length != fArr.length || xArr.length != fArr[0].length)
+			throw new IllegalArgumentException(kInconsistantArrMsg);
+		if (xArr.length <= 1)
+			throw new IllegalArgumentException(kArrSizeMsg);
+
+		xArr1D = xArr;
+		yArr1D = yArr;
+		funcArray = fArr;
+
+		if (logInterval)
+			findLogIntervals(nc);
+		else
+			findLinearIntervals(nc);
+	}
+
+
+	/**
+	*  Generate the contour paths and return them as an array
+	*  of ContourPath objects. If there is a lot of data, this method
+	*  method may take a long time, so be patient.  Progress can be
+	*  checked from another thread by calling "getProgress()".
+	*
+	*  @return An array of contour path objects.
+	*  @throws InterruptedException if the user cancels this process
+	*          (by calling "cancel()" from another thread).
+	**/
+	public ContourPath[] getContours() throws InterruptedException {
+
+		if (!cCalculated) {
+			isCanceled = false;
+			pathList.clear();
+
+			//	Go off an compute the contour paths.
+			computeContours();
+
+			//	Now turn loose all our data arrays to be garbage collected.
+			cAttr = null;
+			xArray = yArray = funcArray = null;
+			xArr1D = yArr1D = null;
+
+			//	Set our "done" flags.
+			cCalculated = true;
+			fracComplete = 1;
+		}
+
+		//	Turn our pathList into an array and return the array.
+		int size = pathList.size();
+		ContourPath[] arr = new ContourPath[size];
+		for (int i=0; i < size; ++i)
+			arr[i] = pathList.get(i);
+
+		return arr;
+	}
+
+	/**
+	*  Returns true if the contour generation process is done.  False if it is not.
+	**/
+	public boolean done() {
+		return cCalculated;
+	}
+
+	/**
+	*  Call this method to cancel the generation of contours.
+	**/
+	public void cancel() {
+		isCanceled = true;
+	}
+
+	/**
+	*  Returns the progress of the currently executing contour generation
+	*  process: 0.0 (just starting) to 1.0 (done).
+	**/
+	public float getProgress() {
+		return fracComplete;
+	}
+
+
+	/**
+	*  Find contour intervals that are linearly spaced through the data.
+	**/
+	private void findLinearIntervals(int nc) {
+
+		//	Find min and max Z values.
+		double zMin = Double.MAX_VALUE;
+		double zMax = -zMin;
+		int ni = funcArray.length;
+		for (int i=0; i < ni; ++i) {
+			int nj = funcArray[i].length;
+			for (int j=0; j < nj; ++j) {
+				double zVal = funcArray[i][j];
+				zMin = Math.min(zMin, zVal);
+				zMax = Math.max(zMax, zVal);
+			}
+		}
+
+		//	Allocate memory for contour attribute array.
+		cAttr = new ContourAttrib[nc];
+
+		//	Determine contour levels.
+		double delta = (zMax-zMin)/(nc+1);
+		for (int i=0; i < nc; i++) {
+			cAttr[i] = new ContourAttrib( zMin + (i+1)*delta );
+			if (DEBUG)
+				System.out.println("level[" + i + "] = " + (zMin + (i+1)*delta));
+		}
+
+	}
+
+	/**
+	*  Find contour intervals that are logarithmically spaced through the data.
+	**/
+	private void findLogIntervals(int nc) {
+
+		//	Find min and max Z values.
+		double zMin = Double.MAX_VALUE;
+		double zMax = -zMin;
+		int ni = funcArray.length;
+		for (int i=0; i < ni; ++i) {
+			int nj = funcArray[i].length;
+			for (int j=0; j < nj; ++j) {
+				double zVal = funcArray[i][j];
+				zMin = Math.min(zMin, zVal);
+				zMax = Math.max(zMax, zVal);
+			}
+		}
+
+		if (zMin < 0)
+			throw new IllegalArgumentException(kNegLogDataMsg);
+
+		//	Allocate memory for contour attribute array.
+		cAttr = new ContourAttrib[nc];
+
+		//	Determine contour levels.
+		double temp = Math.log(zMin);
+		double delta = (Math.log(zMax) - temp)/(nc+1);
+		for (int i=0; i < nc; i++)
+			cAttr[i] = new ContourAttrib( Math.exp(temp + (i+1)*delta) );
+
+	}
+
+
+	/**
+	*  Computes contour lines for gridded data and stores information about
+	*  those contours.  The result of this routine is a list of contour lines
+	*  or paths.
+	**/
+	private void computeContours() throws InterruptedException {
+
+		int ncont = cAttr.length;		//	Number of contour levels.
+
+		//	Find the number of data points in "I" and "J" directions.
+		int nx=0, ny=0;
+		if (xArray != null) {
+			ny = xArray.length;
+			nx = xArray[0].length;
+		} else {
+			nx = xArr1D.length;
+			ny = yArr1D.length;
+		}
+
+		//	Allocate temporary storage space for path buffers.
+		pathbufxt = new double[kBufSize];
+		pathbufyt = new double[kBufSize];
+		pathbufia = new int[kBufSize*3];
+
+		//	lnstrt=1 (line start) means we're starting a new line.
+		lnstrt = 1;
+		ignext = 0;
+
+		//	Loop through each contour level.
+		for (icont = 0; icont < ncont; ++icont) {
+
+			//	Check to see if the user has canceled.
+			if (isCanceled)
+				throw new InterruptedException(kCancelMsg);
+
+			//	Begin working on this contour level.
+			cont = cAttr[icont].getLevel();
+			iss = 1;
+			iee = nx;
+			jss = 1;
+			jee = ny;
+
+			boolean subDivFlg = false;
+/*L110*/	do {
+				//	Find where function increases through the contour level.
+				FlagContourPassings();
+
+				boolean L10flg = false;
+/*L210*/		do {
+
+					if (!L10flg) {
+						/*	Search along the boundaries for contour line starts.
+						*	IMA tells which boundary of the region we're on.
+						*/
+						ima = 1;
+						ibeg = iss - 1;
+						jbeg = jss;
+					}
+
+/*L6*/				imaLoop:
+					do {
+
+						if (!L10flg) {
+							boolean imb = false;
+							boolean doneFlg = false;
+							do {
+
+								switch(ima) {
+									case 1:
+										++ibeg;
+										if (ibeg == iee)
+											ima = 2;
+										break;
+
+									case 2:
+										++jbeg;
+										if (jbeg == jee)
+											ima = 3;
+										break;
+
+									case 3:
+										--ibeg;
+										if (ibeg == iss)
+											ima = 4;
+										break;
+
+									case 4:
+										--jbeg;
+										if (jbeg == jss)
+											ima = 5;
+										break;
+
+									case 5:
+										continue imaLoop;
+								}
+
+								if (funcArray[jbeg -1][ibeg -1] <= cont) {
+									imb = true;
+									doneFlg = false;
+
+								} else if (imb == true)
+									doneFlg = true;
+
+							} while (!doneFlg);
+
+							//	Got a start point.
+							gi = ibeg;							//	x index of starting point.
+							gj = jbeg;							//	y index of starting point.
+							fij = funcArray[jbeg -1][ibeg -1];	//	z value of starting point.
+
+							//	Round the corner if necessary.
+							/*	Look different directions to see which way the contour line
+							*	went:
+							*			  4
+							*			1-|-3
+							*			  2
+							*/
+							switch (ima) {
+								case 1:
+									Routine_L21();
+									break;
+
+								case 2:
+									if (gj != jss) {
+										if (!Routine_L31())
+											Routine_L21();
+									} else
+										Routine_L21();
+									break;
+
+								case 3:
+									if (gi != iee) {
+										if (!Routine_L41())
+											Routine_L21();
+									} else {
+										if (!Routine_L31())
+											Routine_L21();
+									}
+									break;
+
+								case 4:
+									if (gj != jee) {
+										if (!Routine_L51())
+											Routine_L21();
+									} else {
+										if (!Routine_L41())
+											Routine_L21();
+									}
+									break;
+
+								case 5:
+									if (!Routine_L51())
+										Routine_L21();
+									break;
+							}
+
+						}	//	end if(!L10flg)
+
+
+						//	This is the end of a contour line.  After this, we'll start a
+						//	new line.
+						L10flg = false;
+/*L90*/					lnstrt = 1;						//	Contour line start flag.
+						ignext = 0;
+						accumContour(np, icont, pathbufxt, pathbufyt, cAttr[icont]);
+
+						//	If we're not done looking along the boundaries,
+						//	go look there some more.
+					} while (ima != 5);
+
+
+					//	Otherwise, get the next start out of IA.
+/*L91*/				if (iae != 0) {
+						int ntmp3 = iae;
+						for (int iia = 1; iia <= ntmp3; ++iia) {
+							if (pathbufia[iia -1] != 0) {
+								//	This is how we start in the middle of the region, using IA.
+								gi = pathbufia[iia - 1]/1000;
+								gj = pathbufia[iia - 1] - gi*1000;
+								fij = funcArray[gj -1][gi -1];
+								pathbufia[iia - 1] = 0;
+
+								Routine_L21();
+
+								L10flg = true;
+								break;
+							}
+						}
+					}
+
+				} while ( L10flg );
+
+				/*	And if there are no more of these, we're done with this region.
+				*   If we've subdivided, update the region pointers and go back for more.
+				*/
+				subDivFlg = false;
+				if (iee == nx) {
+					if (jee != ny) {
+						jss = jee;
+						jee = ny;
+						subDivFlg = true;
+					}
+				} else {
+					iss = iee;
+					iee = nx;
+					subDivFlg = true;
+				}
+
+			} while (subDivFlg);
+
+
+			//	Update progress information.
+			fracComplete = (float)(icont+1)/(float)(ncont);
+
+			//	Loop back for the next contour level.
+		}	// Next icont
+
+
+		//	Turn loose temporary arrays used to generate contours.
+		pathbufxt = null;
+		pathbufyt = null;
+		pathbufia = null;
+
+	}
+
+
+	/**
+	*  Flag points in IA where the the function increases through the contour
+	*  level, not including the boundaries.  This is so we have a list of at least
+	*  one point on each contour line that doesn't intersect a boundary.
+	**/
+	private void FlagContourPassings() {
+
+		iae = 0;
+		int ntmp2 = jee - 1;
+		for (int j=jss + 1; j <= ntmp2; ++j) {
+			boolean imb = false;
+			int iaend = iae;
+			int ntmp3 = iee;
+			for (int i=iss; i <= ntmp3; ++i) {
+				if (funcArray[j -1][i -1] <= cont)
+					imb = true;
+				else if (imb == true) {
+					++iae;
+					pathbufia[iae - 1] = i*1000 + j;
+					imb = false;
+
+					/*  Check if the IA array is full.  If so, the subdividing
+					*   algorithm goes like this:  if we've marked at least one
+					*   J row, drop back to the last completed J and call that
+					*   the region.  If we haven't even finished one J row, our
+					*   region just extends to this I location.
+					*/
+					if (iae == kBufSize*3) {
+						if (j > jss + 1) {
+							iae = iaend;
+							jee = j;
+						} else {
+							//	Compute minimum.
+							jee = Math.min(j+1, jee);
+							iee = i;
+						}
+
+						//	Break out of i & j loops.
+						return;
+					}
+				}
+			}	//	Next i
+		}	//	Next j
+
+	}
+
+	/**
+	*  This function represents the block of code in the original
+	*  FORTRAN program that comes after line 21.
+	**/
+	private void Routine_L21() {
+		while (true) {
+			--gi;
+			if (gi < iss)
+				return;						//	Goto L90.
+
+			idir = 1;
+			if (funcArray[gj -1][gi -1] <= cont) {
+				//	Wipe this point out of IA if it's in the list.
+/*L52*/			if (iae != 0) {
+					int ij = gi*1000 + gj + 1000;
+					int ntmp3 = iae;
+					for (int iia = 1; iia <= ntmp3; ++iia) {
+						if (pathbufia[iia - 1] == ij) {
+							pathbufia[iia - 1] = 0;
+							break;
+						}
+					}
+				}
+				doInterpolation();
+				return;						//	Goto L90.
+			}
+
+			fij = funcArray[gj -1][gi -1];
+
+			if (Routine_L31())	return;		//	Goto L90
+		}
+	}
+
+	/**
+	*  This function represents the block of code in the original
+	*  FORTRAN program that comes after line 31.
+	**/
+	private boolean Routine_L31() {
+		--gj;
+		if (gj < jss)
+			return true;
+
+		idir = 2;
+		if (funcArray[gj -1][gi -1] <= cont) {
+			doInterpolation();
+			return true;
+		}
+
+		fij = funcArray[gj -1][gi -1];
+
+		return (Routine_L41());
+	}
+
+	/**
+	*  This function represents the block of code in the original
+	*  FORTRAN program that comes after line 41.
+	**/
+	private boolean Routine_L41() {
+		++gi;
+		if (gi > iee)
+			return true;
+
+		idir = 3;
+		if (funcArray[gj -1][gi -1] <= cont) {
+			doInterpolation();
+			return true;
+		}
+
+		fij = funcArray[gj -1][gi -1];
+
+		return (Routine_L51());
+	}
+
+	/**
+	*  This function represents the block of code in the original
+	*  FORTRAN program that comes after line 51.
+	**/
+	private boolean Routine_L51() {
+		++gj;
+		idir = 4;
+		if (gj > jee)
+			return true;
+
+		if (funcArray[gj -1][gi -1] <= cont) {
+			doInterpolation();
+			return true;
+		}
+
+		fij = funcArray[gj -1][gi -1];
+
+		return false;
+	}
+
+	/**
+	*  Do interpolation for X, Y coordinates.
+	*
+	*  This function represents the block of code in the original
+	*  FORTRAN program that comes after line 60.
+	**/
+	private void doInterpolation() {
+
+		//	Do interpolation for X,Y coordinates.
+		double func = funcArray[gj -1][gi -1];
+		double xyf = (cont - func)/(fij - func);
+
+		/*  This tests for a contour point coinciding with a grid point.  In this case
+		 *  the contour routine comes up with the same physical coordinate twice.  If
+		 *  If we don't trap it, it can (in some cases significantly) increase the
+		 *  number of points in a contour line.  Also, if this happens on the first
+		 *  point in a line, the second point could be misinterpreted as the end of a
+		 *   (circling) contour line.
+		 */
+		if (xyf == 0)
+			++ignext;
+
+		double wxx=0, wyy=0;
+		double xVal=0, yVal=0;
+		if (xArray != null) {
+			//	We have 2D arrays for the X & Y grid points.
+			xVal = xArray[gj -1][gi -1];
+			yVal = yArray[gj -1][gi -1];
+			switch (idir) {
+				case 1:				//	East
+					wxx = xVal + xyf*(xArray[gj -1][gi + 1 -1] - xVal);
+					wyy = yVal + xyf*(yArray[gj -1][gi + 1 -1] - yVal);
+					break;
+
+				case 2:				//	North
+					wxx = xVal + xyf*(xArray[gj + 1 -1][gi -1] - xVal);
+					wyy = yVal + xyf*(yArray[gj + 1 -1][gi -1] - yVal);
+					break;
+
+				case 3:				//	West
+					wxx = xVal + xyf*(xArray[gj -1][gi - 1 -1] - xVal);
+					wyy = yVal + xyf*(yArray[gj -1][gi - 1 -1] - yVal);
+					break;
+
+				case 4:				//	South
+					wxx = xVal + xyf*(xArray[gj - 1 -1][gi -1] - xVal);
+					wyy = yVal + xyf*(yArray[gj - 1 -1][gi -1] - yVal);
+					break;
+			}
+
+		} else {
+			//	We have 1D arrays for the X & Y grid points.
+			xVal = xArr1D[gi -1];
+			yVal = yArr1D[gj -1];
+			switch (idir) {
+				case 1:				//	East
+					wxx = xVal + xyf*(xArr1D[gi + 1 -1] - xVal);
+					wyy = yVal;
+					break;
+
+				case 2:				//	North
+					wxx = xVal;
+					wyy = yVal + xyf*(yArr1D[gj + 1 -1] - yVal);
+					break;
+
+				case 3:				//	West
+					wxx = xVal + xyf*(xArr1D[gi - 1 -1] - xVal);
+					wyy = yVal;
+					break;
+
+				case 4:				//	South
+					wxx = xVal;
+					wyy = yVal + xyf*(yArr1D[gj - 1 -1] - yVal);
+					break;
+			}
+		}
+
+		if (DEBUG) {
+			System.out.println("i, j = " + gi + "," + gj);
+			System.out.println("cont = " + (float)cont + ",  fij = " + (float)fij +
+									",  func = " + (float)func + ",  xyf = " + (float)xyf);
+			System.out.println("xVal = " + (float)xVal + ",  yVal = " + (float)yVal);
+			System.out.println("wxx = " + (float)wxx + ",  wyy = " + (float)wyy);
+		}
+
+		//	Figure out what to do with this point.
+		if (lnstrt == 1) {
+			//	This is the 1st point in the contour line.
+
+			np = 1;
+			pathbufxt[np -1] = wxx;
+			pathbufyt[np -1] = wyy;
+
+			//	Save starting point as wx, wy.
+			wx = wxx;
+			wy = wyy;
+
+			//	Clear the first point flag, we've got one now.
+			lnstrt = 0;
+
+		} else {
+
+			boolean skipFlg = false;
+
+			//	Second point and after comes here.
+			//	Add a point to this line.  Check for duplicate point first.
+			if (ignext == 2) {
+				if (wxx == pathbufxt[np -1] && wyy == pathbufyt[np -1]) {
+					ignext = 0;
+					skipFlg = true;
+
+				} else
+					ignext = 1;
+			}
+
+			if (!skipFlg) {
+
+				//	Increment # of points in contour.
+				++np;
+				pathbufxt[np -1] = wxx;
+				pathbufyt[np -1] = wyy;
+
+				//	See if the temporary array xt, yt are full.
+				if (np == kBufSize) {
+					accumContour(np, icont, pathbufxt, pathbufyt, cAttr[icont]);
+
+					//	Last point becomes 1st point to continue.
+					pathbufxt[0] = pathbufxt[np -1];
+					pathbufyt[0] = pathbufyt[np -1];
+					np =1;
+				}
+
+				//	Check to see if we're back to the intial point.
+				if (wxx == wx && wyy == wy)
+					return;
+			}
+
+		}
+
+		//	Search for the next point on this line.
+/*L67*/		switch(idir) {
+			case 1:
+				++gi;
+				if (!Routine_L51())
+					Routine_L21();
+				break;
+
+			case 2:
+				++gj;
+				Routine_L21();
+				break;
+
+			case 3:
+				--gi;
+				if (!Routine_L31())
+					Routine_L21();
+				break;
+
+			case 4:
+				--gj;
+				if (!Routine_L41())
+					Routine_L21();
+				break;
+		}
+
+		return;
+	}
+
+	/**
+	*  Accumulate contour paths, as they are generated, into
+	*  an overall list of contours.
+	*
+	*  @param  np      The number of points in the contour path buffers.
+	*  @param  icont   The index to the current contour level.
+	*  @param  x,y     Buffers containing x & y coordinates of contour points.
+	*  @param  cAttr   The attributes for this particular contour level.
+	**/
+	private void accumContour(int np, int icont, double[] x, double[] y, ContourAttrib cAttr) {
+
+		//	To few points for a contour line.
+		if (np < kMinNumPoints)	return;
+
+		//	Copy over coordinate points from buffers to their own arrays.
+		double[] xArr = new double[np];
+		double[] yArr = new double[np];
+		System.arraycopy(x, 0, xArr, 0, np);
+		System.arraycopy(y, 0, yArr, 0, np);
+
+		//	Create a new contour path and add it to the list.
+		ContourPath path = new ContourPath(cAttr, icont, xArr, yArr);
+		pathList.add(path);
+
+	}
+
+}
+
diff --git a/src/beast/app/treeannotator/ContourMaker.java b/src/beast/app/treeannotator/ContourMaker.java
new file mode 100644
index 0000000..513a75b
--- /dev/null
+++ b/src/beast/app/treeannotator/ContourMaker.java
@@ -0,0 +1,11 @@
+package beast.app.treeannotator;
+
+/**
+ * @author Marc Suchard
+ */
+
+public interface ContourMaker {
+
+    ContourPath[] getContourPaths(double level);
+
+}
diff --git a/src/beast/app/treeannotator/ContourPath.java b/src/beast/app/treeannotator/ContourPath.java
new file mode 100644
index 0000000..5633287
--- /dev/null
+++ b/src/beast/app/treeannotator/ContourPath.java
@@ -0,0 +1,129 @@
+package beast.app.treeannotator;
+
+
+/**
+*  <p> This object represents a single contour line or
+*      path and all the data that is associated with
+*      it.
+*  </p>
+*
+*  <p>  Modified by:  Joseph A. Huwaldt  </p>
+*
+*  @author  Joseph A. Huwaldt   Date:  November 11, 2000
+*  @version November 17, 2000
+*
+*
+*  @author Marc Suchard
+**/
+public class ContourPath implements Cloneable, java.io.Serializable {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+	//	Tolerance for path closure.
+	private static final double kSmallX = 0.001;
+	private static final double kSmallY = kSmallX;
+
+	//	X & Y coordinate arrays.
+	private double[] xArr, yArr;
+
+	//	The level index for this contour path.
+	private int levelIndex;
+
+	//	Indicates if this path is open or closed.
+	private boolean closed = false;
+
+	//	The attributes assigned to this contour level.
+	private ContourAttrib attributes;
+
+
+	/**
+	*  Construct a contour path or line using the given arrays
+	*  of X & Y values.
+	*
+	*  @param  attr       Attributes assigned to this contour path.
+	*  @param  levelIndex The index to then level this path belongs to.
+	*  @param  x          Array of X coordinate values.
+	*  @param  y          Array of Y coordinate values.
+	**/
+	public ContourPath(ContourAttrib attr, int levelIndex, double[] x, double[] y) {
+
+		xArr = x;
+		yArr = y;
+		this.levelIndex = levelIndex;
+		attributes = attr;
+		int np = xArr.length;
+
+		//	Determine if the contour path is open or closed.
+		if (Math.abs(x[0] - x[np-1]) < kSmallX && Math.abs(y[0] - y[np-1]) < kSmallY) {
+			closed = true;
+			x[np-1] = x[0];  y[np-1] = y[0];	//	Guarantee closure.
+		} else
+			closed = false;						//	Contour not closed.
+
+	}
+
+
+	/**
+	*  Return the X coordinate values for this contour path.
+	**/
+	public double[] getAllX() {
+		return xArr;
+	}
+
+	/**
+	*  Return the Y coordinate values for this contour path.
+	**/
+	public double[] getAllY() {
+		return yArr;
+	}
+
+	/**
+	*  Return the level index for this contour path.  The level index
+	*  is an index to the level that this path belongs to:  the i'th level.
+	**/
+	public int getLevelIndex() {
+		return levelIndex;
+	}
+
+	/**
+	*  Return the attributes assigned to this contour path.
+	**/
+	public ContourAttrib getAttributes() {
+		return attributes;
+	}
+
+	/**
+	*  Returns true if this contour path is closed (loops back
+	*  on itself) or false if it is not.
+	**/
+	public boolean isClosed() {
+		return closed;
+	}
+
+	/**
+	*  Make a copy of this ContourPath object.
+	*
+	*  @return  Returns a clone of this object.
+	**/
+	public Object clone() {
+		ContourPath newObject = null;
+
+		try {
+			// Make a shallow copy of this object.
+			newObject = (ContourPath) super.clone();
+
+			// There is no "deep" data to be cloned.
+
+		} catch (CloneNotSupportedException e) {
+			// Can't happen.
+			e.printStackTrace();
+		}
+
+		// Output the newly cloned object.
+		return newObject;
+	}
+
+
+}
diff --git a/src/beast/app/treeannotator/ContourWithSynder.java b/src/beast/app/treeannotator/ContourWithSynder.java
new file mode 100644
index 0000000..059aa99
--- /dev/null
+++ b/src/beast/app/treeannotator/ContourWithSynder.java
@@ -0,0 +1,61 @@
+package beast.app.treeannotator;
+
+import java.util.*;
+import java.awt.geom.Point2D;
+
+
+/**
+ * @author Marc A. Suchard
+ */
+public class ContourWithSynder extends KernelDensityEstimator2D  {
+
+    public ContourWithSynder(final double[] x, final double[] y, final double[] h, final int n, final double[] lims) {
+        super(x, y, h, n, lims);
+    }
+
+    public ContourWithSynder(final double[] x, final double[] y, boolean bandwidthLimit) {
+        super(x, y, bandwidthLimit);
+    }
+
+    public ContourWithSynder(final double[] x, final double[] y) {
+        super(x, y);
+    }
+
+    public ContourWithSynder(final double[] x, final double[] y, int n) {
+        super(x, y, n);
+    }
+
+    public ContourPath[] getContourPaths(double hpdValue) {
+
+        if (contourPaths == null) {
+
+            double thresholdDensity = findLevelCorrespondingToMass(hpdValue);
+
+            SnyderContour contourPlot = new SnyderContour(getXGrid().length,getYGrid().length);
+            contourPlot.setDeltas(getXGrid()[1]-getXGrid()[0],getYGrid()[1]-getYGrid()[0] );
+            contourPlot.setOffsets(getXGrid()[0],getYGrid()[0]);
+
+            List<LinkedList<Point2D>> allPaths = new ArrayList<LinkedList<Point2D>>();
+            contourPlot.ContourKernel(getKDE(),allPaths,thresholdDensity);
+
+            contourPaths = new ContourPath[allPaths.size()];
+            for(int i=0; i<allPaths.size(); i++) {
+                LinkedList<Point2D> path = allPaths.get(i);
+                int len = path.size();
+                double[] x = new double[len];
+                double[] y = new double[len];
+                for(int j=0; j<len; j++) {
+                    Point2D pt = path.get(j);
+                    x[j] = pt.getX();
+                    y[j] = pt.getY();
+                }
+                contourPaths[i] = new ContourPath(new ContourAttrib(thresholdDensity),1,x,y);
+            }
+        }
+
+        return contourPaths;
+    }
+
+    private ContourPath[] contourPaths = null;
+
+}
diff --git a/src/beast/app/treeannotator/FileDrop.java b/src/beast/app/treeannotator/FileDrop.java
new file mode 100644
index 0000000..df48e17
--- /dev/null
+++ b/src/beast/app/treeannotator/FileDrop.java
@@ -0,0 +1,900 @@
+package beast.app.treeannotator;
+
+import java.awt.datatransfer.DataFlavor;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.io.Reader;
+
+/**
+ * This class makes it easy to drag and drop files from the operating
+ * system to a Java program. Any <tt>java.awt.Component</tt> can be
+ * dropped onto, but only <tt>javax.swing.JComponent</tt>s will indicate
+ * the drop event with a changed border.
+ * <p/>
+ * To use this class, construct a new <tt>FileDrop</tt> by passing
+ * it the target component and a <tt>Listener</tt> to receive notification
+ * when file(s) have been dropped. Here is an example:
+ * <p/>
+ * <code><pre>
+ *      JPanel myPanel = new JPanel();
+ *      new FileDrop( myPanel, new FileDrop.Listener()
+ *      {   public void filesDropped( java.io.File[] files )
+ *          {
+ *              // handle file drop
+ *              ...
+ *          }   // end filesDropped
+ *      }); // end FileDrop.Listener
+ * </pre></code>
+ * <p/>
+ * You can specify the border that will appear when files are being dragged by
+ * calling the constructor with a <tt>javax.swing.border.Border</tt>. Only
+ * <tt>JComponent</tt>s will show any indication with a border.
+ * <p/>
+ * You can turn on some debugging features by passing a <tt>PrintStream</tt>
+ * object (such as <tt>System.out</tt>) into the full constructor. A <tt>null</tt>
+ * value will result in no extra debugging information being output.
+ * <p/>
+ * <p/>
+ * <p>I'm releasing this code into the Public Domain. Enjoy.
+ * </p>
+ * <p><em>Original author: Robert Harder, rharder at usa.net</em></p>
+ * <p>2007-09-12 Nathan Blomquist -- Linux (KDE/Gnome) support added.</p>
+ *
+ * @author Robert Harder
+ * @author rharder at users.sf.net
+ * @version 1.0.1
+ */
+public class FileDrop {
+    private transient javax.swing.border.Border normalBorder;
+    private transient java.awt.dnd.DropTargetListener dropListener;
+
+
+    /**
+     * Discover if the running JVM is modern enough to have drag and drop.
+     */
+    private static Boolean supportsDnD;
+
+    // Default border color
+    private static java.awt.Color defaultBorderColor = new java.awt.Color(0f, 0f, 1f, 0.25f);
+
+    /**
+     * Constructs a {@link FileDrop} with a default light-blue border
+     * and, if <var>c</var> is a {@link java.awt.Container}, recursively
+     * sets all elements contained within as drop targets, though only
+     * the top level container will change borders.
+     *
+     * @param c        Component on which files will be dropped.
+     * @param listener Listens for <tt>filesDropped</tt>.
+     * @since 1.0
+     */
+    public FileDrop(
+            final java.awt.Component c,
+            final Listener listener) {
+        this(null,  // Logging stream
+                c,     // Drop target
+                javax.swing.BorderFactory.createMatteBorder(2, 2, 2, 2, defaultBorderColor), // Drag border
+                true, // Recursive
+                listener);
+    }   // end constructor
+
+
+    /**
+     * Constructor with a default border and the option to recursively set drop targets.
+     * If your component is a <tt>java.awt.Container</tt>, then each of its children
+     * components will also listen for drops, though only the parent will change borders.
+     *
+     * @param c         Component on which files will be dropped.
+     * @param recursive Recursively set children as drop targets.
+     * @param listener  Listens for <tt>filesDropped</tt>.
+     * @since 1.0
+     */
+    public FileDrop(
+            final java.awt.Component c,
+            final boolean recursive,
+            final Listener listener) {
+        this(null,  // Logging stream
+                c,     // Drop target
+                javax.swing.BorderFactory.createMatteBorder(2, 2, 2, 2, defaultBorderColor), // Drag border
+                recursive, // Recursive
+                listener);
+    }   // end constructor
+
+
+    /**
+     * Constructor with a default border and debugging optionally turned on.
+     * With Debugging turned on, more status messages will be displayed to
+     * <tt>out</tt>. A common way to use this constructor is with
+     * <tt>System.out</tt> or <tt>System.err</tt>. A <tt>null</tt> value for
+     * the parameter <tt>out</tt> will result in no debugging output.
+     *
+     * @param out      PrintStream to record debugging info or null for no debugging.
+     * @param out
+     * @param c        Component on which files will be dropped.
+     * @param listener Listens for <tt>filesDropped</tt>.
+     * @since 1.0
+     */
+    public FileDrop(
+            final java.io.PrintStream out,
+            final java.awt.Component c,
+            final Listener listener) {
+        this(out,  // Logging stream
+                c,    // Drop target
+                javax.swing.BorderFactory.createMatteBorder(2, 2, 2, 2, defaultBorderColor),
+                false, // Recursive
+                listener);
+    }   // end constructor
+
+
+    /**
+     * Constructor with a default border, debugging optionally turned on
+     * and the option to recursively set drop targets.
+     * If your component is a <tt>java.awt.Container</tt>, then each of its children
+     * components will also listen for drops, though only the parent will change borders.
+     * With Debugging turned on, more status messages will be displayed to
+     * <tt>out</tt>. A common way to use this constructor is with
+     * <tt>System.out</tt> or <tt>System.err</tt>. A <tt>null</tt> value for
+     * the parameter <tt>out</tt> will result in no debugging output.
+     *
+     * @param out       PrintStream to record debugging info or null for no debugging.
+     * @param out
+     * @param c         Component on which files will be dropped.
+     * @param recursive Recursively set children as drop targets.
+     * @param listener  Listens for <tt>filesDropped</tt>.
+     * @since 1.0
+     */
+    public FileDrop(
+            final java.io.PrintStream out,
+            final java.awt.Component c,
+            final boolean recursive,
+            final Listener listener) {
+        this(out,  // Logging stream
+                c,    // Drop target
+                javax.swing.BorderFactory.createMatteBorder(2, 2, 2, 2, defaultBorderColor), // Drag border
+                recursive, // Recursive
+                listener);
+    }   // end constructor
+
+
+    /**
+     * Constructor with a specified border
+     *
+     * @param c          Component on which files will be dropped.
+     * @param dragBorder Border to use on <tt>JComponent</tt> when dragging occurs.
+     * @param listener   Listens for <tt>filesDropped</tt>.
+     * @since 1.0
+     */
+    public FileDrop(
+            final java.awt.Component c,
+            final javax.swing.border.Border dragBorder,
+            final Listener listener) {
+        this(
+                null,   // Logging stream
+                c,      // Drop target
+                dragBorder, // Drag border
+                false,  // Recursive
+                listener);
+    }   // end constructor
+
+
+    /**
+     * Constructor with a specified border and the option to recursively set drop targets.
+     * If your component is a <tt>java.awt.Container</tt>, then each of its children
+     * components will also listen for drops, though only the parent will change borders.
+     *
+     * @param c          Component on which files will be dropped.
+     * @param dragBorder Border to use on <tt>JComponent</tt> when dragging occurs.
+     * @param recursive  Recursively set children as drop targets.
+     * @param listener   Listens for <tt>filesDropped</tt>.
+     * @since 1.0
+     */
+    public FileDrop(
+            final java.awt.Component c,
+            final javax.swing.border.Border dragBorder,
+            final boolean recursive,
+            final Listener listener) {
+        this(
+                null,
+                c,
+                dragBorder,
+                recursive,
+                listener);
+    }   // end constructor
+
+
+    /**
+     * Constructor with a specified border and debugging optionally turned on.
+     * With Debugging turned on, more status messages will be displayed to
+     * <tt>out</tt>. A common way to use this constructor is with
+     * <tt>System.out</tt> or <tt>System.err</tt>. A <tt>null</tt> value for
+     * the parameter <tt>out</tt> will result in no debugging output.
+     *
+     * @param out        PrintStream to record debugging info or null for no debugging.
+     * @param c          Component on which files will be dropped.
+     * @param dragBorder Border to use on <tt>JComponent</tt> when dragging occurs.
+     * @param listener   Listens for <tt>filesDropped</tt>.
+     * @since 1.0
+     */
+    public FileDrop(
+            final java.io.PrintStream out,
+            final java.awt.Component c,
+            final javax.swing.border.Border dragBorder,
+            final Listener listener) {
+        this(
+                out,    // Logging stream
+                c,      // Drop target
+                dragBorder, // Drag border
+                false,  // Recursive
+                listener);
+    }   // end constructor
+
+
+    /**
+     * Full constructor with a specified border and debugging optionally turned on.
+     * With Debugging turned on, more status messages will be displayed to
+     * <tt>out</tt>. A common way to use this constructor is with
+     * <tt>System.out</tt> or <tt>System.err</tt>. A <tt>null</tt> value for
+     * the parameter <tt>out</tt> will result in no debugging output.
+     *
+     * @param out        PrintStream to record debugging info or null for no debugging.
+     * @param c          Component on which files will be dropped.
+     * @param dragBorder Border to use on <tt>JComponent</tt> when dragging occurs.
+     * @param recursive  Recursively set children as drop targets.
+     * @param listener   Listens for <tt>filesDropped</tt>.
+     * @since 1.0
+     */
+    public FileDrop(
+            final java.io.PrintStream out,
+            final java.awt.Component c,
+            final javax.swing.border.Border dragBorder,
+            final boolean recursive,
+            final Listener listener) {
+
+        if (supportsDnD()) {   // Make a drop listener
+            dropListener = new java.awt.dnd.DropTargetListener() {
+                public void dragEnter(java.awt.dnd.DropTargetDragEvent evt) {
+                    log(out, "FileDrop: dragEnter event.");
+
+                    // Is this an acceptable drag event?
+                    if (isDragOk(out, evt)) {
+                        // If it's a Swing component, set its border
+                        if (c instanceof javax.swing.JComponent) {
+                            javax.swing.JComponent jc = (javax.swing.JComponent) c;
+                            normalBorder = jc.getBorder();
+                            log(out, "FileDrop: normal border saved.");
+                            jc.setBorder(dragBorder);
+                            log(out, "FileDrop: drag border set.");
+                        }   // end if: JComponent
+
+                        // Acknowledge that it's okay to enter
+                        //evt.acceptDrag( java.awt.dnd.DnDConstants.ACTION_COPY_OR_MOVE );
+                        evt.acceptDrag(java.awt.dnd.DnDConstants.ACTION_COPY);
+                        log(out, "FileDrop: event accepted.");
+                    }   // end if: drag ok
+                    else {   // Reject the drag event
+                        evt.rejectDrag();
+                        log(out, "FileDrop: event rejected.");
+                    }   // end else: drag not ok
+                }   // end dragEnter
+
+                public void dragOver(java.awt.dnd.DropTargetDragEvent evt) {   // This is called continually as long as the mouse is
+                    // over the drag target.
+                }   // end dragOver
+
+                public void drop(java.awt.dnd.DropTargetDropEvent evt) {
+                    log(out, "FileDrop: drop event.");
+                    try {   // Get whatever was dropped
+                        java.awt.datatransfer.Transferable tr = evt.getTransferable();
+
+                        // Is it a file list?
+                        if (tr.isDataFlavorSupported(java.awt.datatransfer.DataFlavor.javaFileListFlavor)) {
+                            // Say we'll take it.
+                            //evt.acceptDrop ( java.awt.dnd.DnDConstants.ACTION_COPY_OR_MOVE );
+                            evt.acceptDrop(java.awt.dnd.DnDConstants.ACTION_COPY);
+                            log(out, "FileDrop: file list accepted.");
+
+                            // Get a useful list
+                            java.util.List<?> fileList = (java.util.List<?>)
+                                    tr.getTransferData(java.awt.datatransfer.DataFlavor.javaFileListFlavor);
+                            //java.util.Iterator iterator = fileList.iterator();
+
+                            // Convert list to array
+                            java.io.File[] filesTemp = new java.io.File[fileList.size()];
+                            fileList.toArray(filesTemp);
+                            final java.io.File[] files = filesTemp;
+
+                            // Alert listener to drop.
+                            if (listener != null)
+                                listener.filesDropped(files);
+
+                            // Mark that drop is completed.
+                            evt.getDropTargetContext().dropComplete(true);
+                            log(out, "FileDrop: drop complete.");
+                        }   // end if: file list
+                        else // this section will check for a reader flavor.
+                        {
+                            // Thanks, Nathan!
+                            // BEGIN 2007-09-12 Nathan Blomquist -- Linux (KDE/Gnome) support added.
+                            DataFlavor[] flavors = tr.getTransferDataFlavors();
+                            boolean handled = false;
+                            for (int zz = 0; zz < flavors.length; zz++) {
+                                if (flavors[zz].isRepresentationClassReader()) {
+                                    // Say we'll take it.
+                                    //evt.acceptDrop ( java.awt.dnd.DnDConstants.ACTION_COPY_OR_MOVE );
+                                    evt.acceptDrop(java.awt.dnd.DnDConstants.ACTION_COPY);
+                                    log(out, "FileDrop: reader accepted.");
+
+                                    Reader reader = flavors[zz].getReaderForText(tr);
+
+                                    BufferedReader br = new BufferedReader(reader);
+
+                                    if (listener != null)
+                                        listener.filesDropped(createFileArray(br, out));
+
+                                    // Mark that drop is completed.
+                                    evt.getDropTargetContext().dropComplete(true);
+                                    log(out, "FileDrop: drop complete.");
+                                    handled = true;
+                                    break;
+                                }
+                            }
+                            if (!handled) {
+                                log(out, "FileDrop: not a file list or reader - abort.");
+                                evt.rejectDrop();
+                            }
+                            // END 2007-09-12 Nathan Blomquist -- Linux (KDE/Gnome) support added.
+                        }   // end else: not a file list
+                    }   // end try
+                    catch (java.io.IOException io) {
+                        log(out, "FileDrop: IOException - abort:");
+                        io.printStackTrace(out);
+                        evt.rejectDrop();
+                    }   // end catch IOException
+                    catch (java.awt.datatransfer.UnsupportedFlavorException ufe) {
+                        log(out, "FileDrop: UnsupportedFlavorException - abort:");
+                        ufe.printStackTrace(out);
+                        evt.rejectDrop();
+                    }   // end catch: UnsupportedFlavorException
+                    finally {
+                        // If it's a Swing component, reset its border
+                        if (c instanceof javax.swing.JComponent) {
+                            javax.swing.JComponent jc = (javax.swing.JComponent) c;
+                            jc.setBorder(normalBorder);
+                            log(out, "FileDrop: normal border restored.");
+                        }   // end if: JComponent
+                    }   // end finally
+                }   // end drop
+
+                public void dragExit(java.awt.dnd.DropTargetEvent evt) {
+                    log(out, "FileDrop: dragExit event.");
+                    // If it's a Swing component, reset its border
+                    if (c instanceof javax.swing.JComponent) {
+                        javax.swing.JComponent jc = (javax.swing.JComponent) c;
+                        jc.setBorder(normalBorder);
+                        log(out, "FileDrop: normal border restored.");
+                    }   // end if: JComponent
+                }   // end dragExit
+
+                public void dropActionChanged(java.awt.dnd.DropTargetDragEvent evt) {
+                    log(out, "FileDrop: dropActionChanged event.");
+                    // Is this an acceptable drag event?
+                    if (isDragOk(out, evt)) {   //evt.acceptDrag( java.awt.dnd.DnDConstants.ACTION_COPY_OR_MOVE );
+                        evt.acceptDrag(java.awt.dnd.DnDConstants.ACTION_COPY);
+                        log(out, "FileDrop: event accepted.");
+                    }   // end if: drag ok
+                    else {
+                        evt.rejectDrag();
+                        log(out, "FileDrop: event rejected.");
+                    }   // end else: drag not ok
+                }   // end dropActionChanged
+            }; // end DropTargetListener
+
+            // Make the component (and possibly children) drop targets
+            makeDropTarget(out, c, recursive);
+        }   // end if: supports dnd
+        else {
+            log(out, "FileDrop: Drag and drop is not supported with this JVM");
+        }   // end else: does not support DnD
+    }   // end constructor
+
+
+    private static boolean supportsDnD() {   // Static Boolean
+        if (supportsDnD == null) {
+            boolean support = false;
+            try {
+                @SuppressWarnings("unused")
+				Class<?> arbitraryDndClass = Class.forName("java.awt.dnd.DnDConstants");
+                support = true;
+            }   // end try
+            catch (Exception e) {
+                support = false;
+            }   // end catch
+            supportsDnD = new Boolean(support);
+        }   // end if: first time through
+        return supportsDnD.booleanValue();
+    }   // end supportsDnD
+
+
+    // BEGIN 2007-09-12 Nathan Blomquist -- Linux (KDE/Gnome) support added.
+    private static String ZERO_CHAR_STRING = "" + (char) 0;
+
+    private static File[] createFileArray(BufferedReader bReader, PrintStream out) {
+        try {
+            java.util.List<File> list = new java.util.ArrayList<File>();
+            java.lang.String line = null;
+            while ((line = bReader.readLine()) != null) {
+                try {
+                    // kde seems to append a 0 char to the end of the reader
+                    if (ZERO_CHAR_STRING.equals(line)) continue;
+
+                    java.io.File file = new java.io.File(new java.net.URI(line));
+                    list.add(file);
+                } catch (Exception ex) {
+                    log(out, "Error with " + line + ": " + ex.getMessage());
+                }
+            }
+
+            return (java.io.File[]) list.toArray(new File[list.size()]);
+        } catch (IOException ex) {
+            log(out, "FileDrop: IOException");
+        }
+        return new File[0];
+    }
+    // END 2007-09-12 Nathan Blomquist -- Linux (KDE/Gnome) support added.
+
+
+    private void makeDropTarget(final java.io.PrintStream out, final java.awt.Component c, boolean recursive) {
+        // Make drop target
+        final java.awt.dnd.DropTarget dt = new java.awt.dnd.DropTarget();
+        try {
+            dt.addDropTargetListener(dropListener);
+        }   // end try
+        catch (java.util.TooManyListenersException e) {
+            e.printStackTrace();
+            log(out, "FileDrop: Drop will not work due to previous error. Do you have another listener attached?");
+        }   // end catch
+
+        // Listen for hierarchy changes and remove the drop target when the parent gets cleared out.
+        c.addHierarchyListener(new java.awt.event.HierarchyListener() {
+            public void hierarchyChanged(java.awt.event.HierarchyEvent evt) {
+                log(out, "FileDrop: Hierarchy changed.");
+                java.awt.Component parent = c.getParent();
+                if (parent == null) {
+                    c.setDropTarget(null);
+                    log(out, "FileDrop: Drop target cleared from component.");
+                }   // end if: null parent
+                else {
+                    new java.awt.dnd.DropTarget(c, dropListener);
+                    log(out, "FileDrop: Drop target added to component.");
+                }   // end else: parent not null
+            }   // end hierarchyChanged
+        }); // end hierarchy listener
+        if (c.getParent() != null)
+            new java.awt.dnd.DropTarget(c, dropListener);
+
+        if (recursive && (c instanceof java.awt.Container)) {
+            // Get the container
+            java.awt.Container cont = (java.awt.Container) c;
+
+            // Get it's components
+            java.awt.Component[] comps = cont.getComponents();
+
+            // Set it's components as listeners also
+            for (int i = 0; i < comps.length; i++)
+                makeDropTarget(out, comps[i], recursive);
+        }   // end if: recursively set components as listener
+    }   // end dropListener
+
+
+    /**
+     * Determine if the dragged data is a file list.
+     */
+    private boolean isDragOk(final java.io.PrintStream out, final java.awt.dnd.DropTargetDragEvent evt) {
+        boolean ok = false;
+
+        // Get data flavors being dragged
+        java.awt.datatransfer.DataFlavor[] flavors = evt.getCurrentDataFlavors();
+
+        // See if any of the flavors are a file list
+        int i = 0;
+        while (!ok && i < flavors.length) {
+            // BEGIN 2007-09-12 Nathan Blomquist -- Linux (KDE/Gnome) support added.
+            // Is the flavor a file list?
+            final DataFlavor curFlavor = flavors[i];
+            if (curFlavor.equals(java.awt.datatransfer.DataFlavor.javaFileListFlavor) ||
+                    curFlavor.isRepresentationClassReader()) {
+                ok = true;
+            }
+            // END 2007-09-12 Nathan Blomquist -- Linux (KDE/Gnome) support added.
+            i++;
+        }   // end while: through flavors
+
+        // If logging is enabled, show data flavors
+        if (out != null) {
+            if (flavors.length == 0)
+                log(out, "FileDrop: no data flavors.");
+            for (i = 0; i < flavors.length; i++)
+                log(out, flavors[i].toString());
+        }   // end if: logging enabled
+
+        return ok;
+    }   // end isDragOk
+
+
+    /**
+     * Outputs <tt>message</tt> to <tt>out</tt> if it's not null.
+     */
+    private static void log(java.io.PrintStream out, String message) {   // Log message if requested
+        if (out != null)
+            out.println(message);
+    }   // end log
+
+
+    /**
+     * Removes the drag-and-drop hooks from the component and optionally
+     * from the all children. You should call this if you add and remove
+     * components after you've set up the drag-and-drop.
+     * This will recursively unregister all components contained within
+     * <var>c</var> if <var>c</var> is a {@link java.awt.Container}.
+     *
+     * @param c The component to unregister as a drop target
+     * @since 1.0
+     */
+    public static boolean remove(java.awt.Component c) {
+        return remove(null, c, true);
+    }   // end remove
+
+
+    /**
+     * Removes the drag-and-drop hooks from the component and optionally
+     * from the all children. You should call this if you add and remove
+     * components after you've set up the drag-and-drop.
+     *
+     * @param out       Optional {@link java.io.PrintStream} for logging drag and drop messages
+     * @param c         The component to unregister
+     * @param recursive Recursively unregister components within a container
+     * @since 1.0
+     */
+    public static boolean remove(java.io.PrintStream out, java.awt.Component c, boolean recursive) {   // Make sure we support dnd.
+        if (supportsDnD()) {
+            log(out, "FileDrop: Removing drag-and-drop hooks.");
+            c.setDropTarget(null);
+            if (recursive && (c instanceof java.awt.Container)) {
+                java.awt.Component[] comps = ((java.awt.Container) c).getComponents();
+                for (int i = 0; i < comps.length; i++)
+                    remove(out, comps[i], recursive);
+                return true;
+            }   // end if: recursive
+            else return false;
+        }   // end if: supports DnD
+        else return false;
+    }   // end remove
+
+
+/* ********  I N N E R   I N T E R F A C E   L I S T E N E R  ******** */
+
+
+    /**
+     * Implement this inner interface to listen for when files are dropped. For example
+     * your class declaration may begin like this:
+     * <code><pre>
+     *      public class MyClass implements FileDrop.Listener
+     *      ...
+     *      public void filesDropped( java.io.File[] files )
+     *      {
+     *          ...
+     *      }   // end filesDropped
+     *      ...
+     * </pre></code>
+     *
+     * @since 1.1
+     */
+    public static interface Listener {
+
+        /**
+         * This method is called when files have been successfully dropped.
+         *
+         * @param files An array of <tt>File</tt>s that were dropped.
+         * @since 1.0
+         */
+        public abstract void filesDropped(java.io.File[] files);
+
+
+    }   // end inner-interface Listener
+
+
+/* ********  I N N E R   C L A S S  ******** */
+
+
+    /**
+     * This is the event that is passed to the
+     * {@link FileDropListener#filesDropped filesDropped(...)} method in
+     * your {@link FileDropListener} when files are dropped onto
+     * a registered drop target.
+     * <p/>
+     * <p>I'm releasing this code into the Public Domain. Enjoy.</p>
+     *
+     * @author Robert Harder
+     * @author rob at iharder.net
+     * @version 1.2
+     */
+    public static class Event extends java.util.EventObject {
+
+        /**
+		 * 
+		 */
+		private static final long serialVersionUID = 1L;
+		private java.io.File[] files;
+
+        /**
+         * Constructs an {@link Event} with the array
+         * of files that were dropped and the
+         * {@link FileDrop} that initiated the event.
+         *
+         * @param files The array of files that were dropped
+         * @source The event source
+         * @since 1.1
+         */
+        public Event(java.io.File[] files, Object source) {
+            super(source);
+            this.files = files;
+        }   // end constructor
+
+        /**
+         * Returns an array of files that were dropped on a
+         * registered drop target.
+         *
+         * @return array of files that were dropped
+         * @since 1.1
+         */
+        public java.io.File[] getFiles() {
+            return files;
+        }   // end getFiles
+
+    }   // end inner class Event
+
+
+/* ********  I N N E R   C L A S S  ******** */
+
+
+    /**
+     * At last an easy way to encapsulate your custom objects for dragging and dropping
+     * in your Java programs!
+     * When you need to create a {@link java.awt.datatransfer.Transferable} object,
+     * use this class to wrap your object.
+     * For example:
+     * <pre><code>
+     *      ...
+     *      MyCoolClass myObj = new MyCoolClass();
+     *      Transferable xfer = new TransferableObject( myObj );
+     *      ...
+     * </code></pre>
+     * Or if you need to know when the data was actually dropped, like when you're
+     * moving data out of a list, say, you can use the {@link TransferableObject.Fetcher}
+     * inner class to return your object Just in Time.
+     * For example:
+     * <pre><code>
+     *      ...
+     *      final MyCoolClass myObj = new MyCoolClass();
+     * <p/>
+     *      TransferableObject.Fetcher fetcher = new TransferableObject.Fetcher()
+     *      {   public Object getObject(){ return myObj; }
+     *      }; // end fetcher
+     * <p/>
+     *      Transferable xfer = new TransferableObject( fetcher );
+     *      ...
+     * </code></pre>
+     * <p/>
+     * The {@link java.awt.datatransfer.DataFlavor} associated with
+     * {@link TransferableObject} has the representation class
+     * <tt>net.iharder.dnd.TransferableObject.class</tt> and MIME type
+     * <tt>application/x-net.iharder.dnd.TransferableObject</tt>.
+     * This data flavor is accessible via the static
+     * {@link #DATA_FLAVOR} property.
+     * <p/>
+     * <p/>
+     * <p>I'm releasing this code into the Public Domain. Enjoy.</p>
+     *
+     * @author Robert Harder
+     * @author rob at iharder.net
+     * @version 1.2
+     */
+    public static class TransferableObject implements java.awt.datatransfer.Transferable {
+        /**
+         * The MIME type for {@link #DATA_FLAVOR} is
+         * <tt>application/x-net.iharder.dnd.TransferableObject</tt>.
+         *
+         * @since 1.1
+         */
+        public final static String MIME_TYPE = "application/x-net.iharder.dnd.TransferableObject";
+
+
+        /**
+         * The default {@link java.awt.datatransfer.DataFlavor} for
+         * {@link TransferableObject} has the representation class
+         * <tt>net.iharder.dnd.TransferableObject.class</tt>
+         * and the MIME type
+         * <tt>application/x-net.iharder.dnd.TransferableObject</tt>.
+         *
+         * @since 1.1
+         */
+        public final static java.awt.datatransfer.DataFlavor DATA_FLAVOR =
+                new java.awt.datatransfer.DataFlavor(FileDrop.TransferableObject.class, MIME_TYPE);
+
+
+        private Fetcher fetcher;
+        private Object data;
+
+        private java.awt.datatransfer.DataFlavor customFlavor;
+
+
+        /**
+         * Creates a new {@link TransferableObject} that wraps <var>data</var>.
+         * Along with the {@link #DATA_FLAVOR} associated with this class,
+         * this creates a custom data flavor with a representation class
+         * determined from <code>data.getClass()</code> and the MIME type
+         * <tt>application/x-net.iharder.dnd.TransferableObject</tt>.
+         *
+         * @param data The data to transfer
+         * @since 1.1
+         */
+        public TransferableObject(Object data) {
+            this.data = data;
+            this.customFlavor = new java.awt.datatransfer.DataFlavor(data.getClass(), MIME_TYPE);
+        }   // end constructor
+
+
+        /**
+         * Creates a new {@link TransferableObject} that will return the
+         * object that is returned by <var>fetcher</var>.
+         * No custom data flavor is set other than the default
+         * {@link #DATA_FLAVOR}.
+         *
+         * @param fetcher The {@link Fetcher} that will return the data object
+         * @see Fetcher
+         * @since 1.1
+         */
+        public TransferableObject(Fetcher fetcher) {
+            this.fetcher = fetcher;
+        }   // end constructor
+
+
+        /**
+         * Creates a new {@link TransferableObject} that will return the
+         * object that is returned by <var>fetcher</var>.
+         * Along with the {@link #DATA_FLAVOR} associated with this class,
+         * this creates a custom data flavor with a representation class <var>dataClass</var>
+         * and the MIME type
+         * <tt>application/x-net.iharder.dnd.TransferableObject</tt>.
+         *
+         * @param dataClass The {@link java.lang.Class} to use in the custom data flavor
+         * @param fetcher   The {@link Fetcher} that will return the data object
+         * @see Fetcher
+         * @since 1.1
+         */
+        public TransferableObject(Class<?> dataClass, Fetcher fetcher) {
+            this.fetcher = fetcher;
+            this.customFlavor = new java.awt.datatransfer.DataFlavor(dataClass, MIME_TYPE);
+        }   // end constructor
+
+        /**
+         * Returns the custom {@link java.awt.datatransfer.DataFlavor} associated
+         * with the encapsulated object or <tt>null</tt> if the {@link Fetcher}
+         * constructor was used without passing a {@link java.lang.Class}.
+         *
+         * @return The custom data flavor for the encapsulated object
+         * @since 1.1
+         */
+        public java.awt.datatransfer.DataFlavor getCustomDataFlavor() {
+            return customFlavor;
+        }   // end getCustomDataFlavor
+
+
+        /* ********  T R A N S F E R A B L E   M E T H O D S  ******** */
+
+
+        /**
+         * Returns a two- or three-element array containing first
+         * the custom data flavor, if one was created in the constructors,
+         * second the default {@link #DATA_FLAVOR} associated with
+         * {@link TransferableObject}, and third the
+         * {@link java.awt.datatransfer.DataFlavor.stringFlavor}.
+         *
+         * @return An array of supported data flavors
+         * @since 1.1
+         */
+        public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors() {
+            if (customFlavor != null)
+                return new java.awt.datatransfer.DataFlavor[]
+                        {customFlavor,
+                                DATA_FLAVOR,
+                                java.awt.datatransfer.DataFlavor.stringFlavor
+                        };  // end flavors array
+            else
+                return new java.awt.datatransfer.DataFlavor[]
+                        {DATA_FLAVOR,
+                                java.awt.datatransfer.DataFlavor.stringFlavor
+                        };  // end flavors array
+        }   // end getTransferDataFlavors
+
+
+        /**
+         * Returns the data encapsulated in this {@link TransferableObject}.
+         * If the {@link Fetcher} constructor was used, then this is when
+         * the {@link Fetcher#getObject getObject()} method will be called.
+         * If the requested data flavor is not supported, then the
+         * {@link Fetcher#getObject getObject()} method will not be called.
+         *
+         * @param flavor The data flavor for the data to return
+         * @return The dropped data
+         * @since 1.1
+         */
+        public Object getTransferData(java.awt.datatransfer.DataFlavor flavor)
+                throws java.awt.datatransfer.UnsupportedFlavorException, java.io.IOException {
+            // Native object
+            if (flavor.equals(DATA_FLAVOR))
+                return fetcher == null ? data : fetcher.getObject();
+
+            // String
+            if (flavor.equals(java.awt.datatransfer.DataFlavor.stringFlavor))
+                return fetcher == null ? data.toString() : fetcher.getObject().toString();
+
+            // We can't do anything else
+            throw new java.awt.datatransfer.UnsupportedFlavorException(flavor);
+        }   // end getTransferData
+
+
+        /**
+         * Returns <tt>true</tt> if <var>flavor</var> is one of the supported
+         * flavors. Flavors are supported using the <code>equals(...)</code> method.
+         *
+         * @param flavor The data flavor to check
+         * @return Whether or not the flavor is supported
+         * @since 1.1
+         */
+        public boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor) {
+            // Native object
+            if (flavor.equals(DATA_FLAVOR))
+                return true;
+
+            // String
+            if (flavor.equals(java.awt.datatransfer.DataFlavor.stringFlavor))
+                return true;
+
+            // We can't do anything else
+            return false;
+        }   // end isDataFlavorSupported
+
+
+        /* ********  I N N E R   I N T E R F A C E   F E T C H E R  ******** */
+
+        /**
+         * Instead of passing your data directly to the {@link TransferableObject}
+         * constructor, you may want to know exactly when your data was received
+         * in case you need to remove it from its source (or do anyting else to it).
+         * When the {@link #getTransferData getTransferData(...)} method is called
+         * on the {@link TransferableObject}, the {@link Fetcher}'s
+         * {@link #getObject getObject()} method will be called.
+         *
+         * @author Robert Harder
+         * @version 1.1
+         * @copyright 2001
+         * @since 1.1
+         */
+        public static interface Fetcher {
+            /**
+             * Return the object being encapsulated in the
+             * {@link TransferableObject}.
+             *
+             * @return The dropped object
+             * @since 1.1
+             */
+            public abstract Object getObject();
+        }   // end inner interface Fetcher
+
+
+    }   // end class TransferableObject
+
+
+}   // end class FileDrop
diff --git a/src/beast/app/treeannotator/KernelDensityEstimator2D.java b/src/beast/app/treeannotator/KernelDensityEstimator2D.java
new file mode 100644
index 0000000..03cf8cb
--- /dev/null
+++ b/src/beast/app/treeannotator/KernelDensityEstimator2D.java
@@ -0,0 +1,280 @@
+package beast.app.treeannotator;
+
+import beast.math.statistic.DiscreteStatistics;
+import cern.colt.list.DoubleArrayList;
+import cern.jet.stat.Descriptive;
+
+import java.util.Arrays;
+
+
+/**
+ * KernelDensityEstimator2D creates a bi-variate kernel density smoother for data
+ * @author Marc A. Suchard
+ * @author Philippe Lemey
+ */
+
+public class KernelDensityEstimator2D implements ContourMaker {
+
+//    kde2d =
+//    function (x, y, h, n = 25, lims = c(range(x), range(y)))
+//    {
+//        nx <- length(x)
+//        if (length(y) != nx)
+//            stop("data vectors must be the same length")
+//        if (any(!is.finite(x)) || any(!is.finite(y)))
+//            stop("missing or infinite values in the data are not allowed")
+//        if (any(!is.finite(lims)))
+//            stop("only finite values are allowed in 'lims'")
+//        gx <- seq.int(lims[1], lims[2], length.out = n)
+//        gy <- seq.int(lims[3], lims[4], length.out = n)
+//        if (missing(h))
+//            h <- c(bandwidth.nrd(x), bandwidth.nrd(y))
+//        h <- h/4
+//        ax <- outer(gx, x, "-")/h[1]
+//        ay <- outer(gy, y, "-")/h[2]
+//        z <- matrix(dnorm(ax), n, nx) %*% t(matrix(dnorm(ay), n,
+//            nx))/(nx * h[1] * h[2])
+//        return(list(x = gx, y = gy, z = z))
+//    }
+
+    /*
+     * @param x x-coordinates of observations
+     * @param y y-coordinates of observations
+     * @param h bi-variate smoothing bandwidths
+     * @param n smoothed grid size
+     * @param lims bi-variate min/max for grid
+     */
+    public KernelDensityEstimator2D(final double[] x, final double[] y, final double[] h, final int n, final double[] lims) {
+        this(x, y, h, n, lims, false);
+    }
+
+    public KernelDensityEstimator2D(final double[] x, final double[] y, final double[] h, final int n, final double[] lims, boolean bandwdithLimited) {
+        this.x = x;
+        this.y = y;
+        if (x.length != y.length)
+            throw new RuntimeException("data vectors must be the same length");
+
+        this.nx = x.length;
+
+        if (n <= 0)
+            throw new RuntimeException("must have a positive number of grid points");
+        this.n = n;
+
+        if (lims != null)
+            this.lims = lims;
+        else
+            setupLims();
+
+        this.limitBandwidth = bandwdithLimited;
+        if (h != null)
+            this.h = h;
+        else
+            setupH();
+
+        doKDE2D();
+    }
+    
+    public KernelDensityEstimator2D(final double[] x, final double[] y, boolean limitBandwidth) {
+        this(x,y,null,50,null,limitBandwidth);
+    }
+
+    public KernelDensityEstimator2D(final double[] x, final double[] y) {
+        this(x,y,null,50,null);
+    }
+
+    public KernelDensityEstimator2D(final double[] x, final double[] y, final int n) {
+        this(x,y,null,n,null);
+    }
+
+    public void doKDE2D() {
+        gx = makeSequence(lims[0], lims[1], n);
+        gy = makeSequence(lims[2], lims[3], n);
+        double[][] ax = outerMinusScaled(gx, x, h[0]);
+        double[][] ay = outerMinusScaled(gy, y, h[1]);
+        normalize(ax);
+        normalize(ay);
+        z = new double[n][n];
+        double scale = nx * h[0] * h[1];
+        for (int i = 0; i < n; i++) {
+            for (int j = 0; j < n; j++) {
+                double value = 0;
+                for (int k = 0; k < nx; k++) {
+                    value += ax[i][k] * ay[j][k];
+                }
+                z[i][j] = value / scale;
+            }
+        }
+    }
+
+    public double findLevelCorrespondingToMass(double probabilityMass) {
+        double level = 0;
+        double[] sz = new double[n*n];
+        double[] c1 = new double[n*n];
+        for(int i=0; i<n; i++)
+            System.arraycopy(z[i],0,sz,i*n,n);
+        Arrays.sort(sz);
+        final double dx = gx[1] - gx[0];
+        final double dy = gy[1] - gy[0];
+        final double dxdy = dx * dy;
+        c1[0] = sz[0] * dxdy;
+        final double criticalValue = 1.0 - probabilityMass;
+        if (criticalValue < c1[0] || criticalValue >= 1.0)
+                throw new RuntimeException();
+        // do linearInterpolation on density (y) as function of cumulative sum (x)
+        for(int i=1; i<n*n; i++) {
+            c1[i] = sz[i] * dxdy + c1[i-1];
+            if (c1[i] > criticalValue) { // first largest point
+                final double diffC1 = c1[i] - c1[i-1];
+                final double diffSz = sz[i] - sz[i-1];
+                level = sz[i] - (c1[i]-criticalValue) / diffC1 * diffSz;
+                break;
+            }
+        }
+        return level;
+    }
+
+    public ContourPath[] getContourPaths(double hpdValue) {
+
+        double thresholdDensity = findLevelCorrespondingToMass(hpdValue);
+        ContourGenerator contour = new ContourGenerator(getXGrid(), getYGrid(), getKDE(),
+                new ContourAttrib[]{new ContourAttrib(thresholdDensity)});
+
+        ContourPath[] paths = null;
+        try {
+            paths = contour.getContours();
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
+        return paths;
+    }
+
+    public double[][] getKDE() {
+        return z;
+    }
+
+    public double[] getXGrid() {
+        return gx;
+    }
+
+    public double[] getYGrid() {
+        return gy;
+    }
+
+    public void normalize(double[][] X) {
+        for (int i = 0; i < X.length; i++) {
+            for (int j = 0; j < X[0].length; j++)
+                X[i][j] = pdf(X[i][j], 0, 1);
+        }
+    }
+    
+    public static double pdf(double x, double m, double sd) {
+        double a = 1.0 / (Math.sqrt(2.0 * Math.PI) * sd);
+        double b = -(x - m) * (x - m) / (2.0 * sd * sd);
+
+        return a * Math.exp(b);
+    }
+
+
+    public double[][] outerMinusScaled(double[] X, double[] Y, double scale) {
+        double[][] A = new double[X.length][Y.length];
+        for (int indexX = 0; indexX < X.length; indexX++) {
+            for (int indexY = 0; indexY < Y.length; indexY++)
+                A[indexX][indexY] = (X[indexX] - Y[indexY]) / scale;
+        }
+        return A;
+    }
+
+    public double[] makeSequence(double start, double end, int length) {
+        double[] seq = new double[length];
+        double by = (end - start) / (length - 1);
+        double value = start;
+        for (int i = 0; i < length; i++, value += by) {
+            seq[i] = value;
+        }
+        return seq;
+    }
+
+    private double margin = 0.1;
+
+    private void setupLims() {
+        lims = new double[4];
+        lims[0] = DiscreteStatistics.min(x);
+        lims[1] = DiscreteStatistics.max(x);
+        lims[2] = DiscreteStatistics.min(y);
+        lims[3] = DiscreteStatistics.max(y);
+
+        double xDelta = (lims[1] - lims[0]) * margin;
+        double yDelta = (lims[3] - lims[2]) * margin;
+        lims[0] -= xDelta;
+        lims[1] += xDelta;
+        lims[2] -= yDelta;
+        lims[3] += yDelta;
+    }
+
+    private void setupH() {
+        h = new double[2];
+        h[0] = bandwidthNRD(x) / 4;
+        h[1] = bandwidthNRD(y) / 4;
+
+        if (limitBandwidth) {
+            if (h[0] >  0.5) {
+                h[0] = 0.5;
+            }
+            if (h[1] > 0.5) {
+                h[1] = 0.5;
+            }
+        }
+    }
+
+
+//   bandwidth.nrd =
+//   function (x)
+//   {
+//       r <- quantile(x, c(0.25, 0.75))
+//       h <- (r[2] - r[1])/1.34
+//       4 * 1.06 * min(sqrt(var(x)), h) * length(x)^(-1/5)
+
+    //   }
+    public double bandwidthNRD(double[] in) {
+
+        DoubleArrayList inList = new DoubleArrayList(in.length);
+        for (double d : in)
+            inList.add(d);
+        inList.sort();
+
+        final double h = (Descriptive.quantile(inList, 0.75) - Descriptive.quantile(inList, 0.25)) / 1.34;
+
+        return 4 * 1.06 *
+                Math.min(Math.sqrt(DiscreteStatistics.variance(in)), h) *
+                Math.pow(in.length, -0.2);
+    }
+
+    public static void main(String[] arg) {
+
+        double[] x = {3.4, 1.2, 5.6, 2.2, 3.1};
+        double[] y = {1.0, 2.0, 1.0, 2.0, 1.0};
+
+        KernelDensityEstimator2D kde = new KernelDensityEstimator2D(x, y, 4);
+
+//        System.out.println(new Vector(kde.getXGrid()));
+//        System.out.println(new Vector(kde.getYGrid()));
+//        System.out.println(new Matrix(kde.getKDE()));
+        System.exit(-1);
+
+    }
+
+    public double[] getLims() { return lims; }
+
+    private final double[] x; // x coordinates
+    private final double[] y; // y coordinates
+    private double[] h; // h[0] x-bandwidth, h[1] y-bandwidth
+    private final int n; // grid size
+    private double[] lims; // x,y limits
+    private int nx; // length of vectors
+    private double[] gx; // x-grid points
+    private double[] gy; // y-grid points
+    private double[][] z; // KDE estimate;
+
+    private final boolean limitBandwidth;
+
+}
diff --git a/src/beast/app/treeannotator/RealNumberField.java b/src/beast/app/treeannotator/RealNumberField.java
new file mode 100644
index 0000000..ec7238e
--- /dev/null
+++ b/src/beast/app/treeannotator/RealNumberField.java
@@ -0,0 +1,332 @@
+/*
+ * RealNumberField.java
+ *
+ * Copyright (c) 2009 JAM Development Team
+ *
+ * This package is distributed under the Lesser Gnu Public Licence (LGPL)
+ *
+ */
+
+package beast.app.treeannotator;
+
+import javax.swing.*;
+import javax.swing.event.*;
+import javax.swing.text.AttributeSet;
+import javax.swing.text.BadLocationException;
+import javax.swing.text.Document;
+import javax.swing.text.PlainDocument;
+import java.awt.*;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
+
+public class RealNumberField extends JTextField implements FocusListener, DocumentListener {
+	private static final long serialVersionUID = 1L;
+	
+	public static String NaN = "NaN";
+    public static String POSITIVE_INFINITY = "+INF";
+    public static String NEGATIVE_INFINITY = "-INF";
+    public static String MAX_VALUE = "MAX";
+    public static String MIN_VALUE = "MIN";
+
+    protected static char MINUS = '-';
+    protected static char PERIOD = '.';
+    protected EventListenerList changeListeners = new EventListenerList();
+    protected double min;
+    protected double max;
+    protected final boolean includeMin;
+    protected final boolean includeMax;
+    protected boolean range_check = false;
+    protected boolean range_checked = false;
+    protected String label; // make sensible error message
+
+    private boolean isValueValid = true;
+
+    protected boolean allowEmpty = false;
+
+    public RealNumberField() { // no FocusListener
+        super();
+        setLabel("Value");
+        includeMin = true;
+        includeMax = true;
+    }
+
+    public RealNumberField(double min, double max) {
+        this(min, max, "Value");
+        this.addFocusListener(this);
+    }
+
+    public RealNumberField(double min, double max, String label) { // no FocusListener
+        this(min, true, max, true, label);
+    }
+
+    public RealNumberField(double min, boolean includeMin, double max, boolean includeMax, String label) { // no FocusListener
+        super();
+        this.min = min;
+        this.max = max;
+        this.includeMin = includeMin;
+        this.includeMax = includeMax;
+        setLabel(label);
+        range_check = true;
+    }
+
+    public void setAllowEmpty(boolean allowEmpty) {
+        this.allowEmpty = allowEmpty;
+    }
+
+    public void focusGained(FocusEvent evt) {
+    }
+
+    public void focusLost(FocusEvent evt) {
+        validateField();
+    }
+
+    public void validateField() {
+        if (range_check && !range_checked) {
+            range_checked = true;
+            isValueValid = isValueValid();
+            if (!isValueValid) {
+                displayErrorMessage();
+                // regain focus for this component
+                this.requestFocus();
+            }
+        }
+
+    }
+
+    public boolean isValueValid() {
+        if (getText().trim().equals("") && allowEmpty) {
+            return true;
+        }
+        if (range_check) {
+            try {
+                double value = getValue();
+                if (value < min || value > max) {
+                    return false;
+                }
+                if (!includeMin && value == min) {
+                    return false;
+                }
+                if (!includeMax && value == max) {
+                    return false;
+                }
+            } catch (NumberFormatException e) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    public void setText(Double value) {
+        if (value == null && allowEmpty) {
+            setText("");
+        }
+        if (value == Double.NaN) {
+            setText(NaN);
+        } else if (value == Double.POSITIVE_INFINITY) {
+            setText(POSITIVE_INFINITY);
+        } else if (value == Double.NEGATIVE_INFINITY) {
+            setText(NEGATIVE_INFINITY);
+        } else if (value == Double.MAX_VALUE) {
+            setText(MAX_VALUE);
+        } else if (value == Double.MIN_VALUE) {
+            setText(MIN_VALUE);
+        } else {
+            setText(Double.toString(value));
+        }
+    }
+
+    public void setText(Integer obj) {
+        setText(obj.toString()); // where used?
+    }
+
+    public void setText(Long obj) {
+        setText(obj.toString()); // where used?
+    }
+
+    public String getErrorMessage() {
+        String message = "";
+        if (min == Double.MIN_VALUE) {
+            message = " greater than 0";
+        } else if (!Double.isInfinite(min) && min != -Double.MAX_VALUE) {
+            message = " greater than " + min;
+        }
+        if (max == -Double.MIN_VALUE) {
+            message = " less than 0";
+        } else if (!Double.isInfinite(max) && max != Double.MAX_VALUE) {
+            if (message.length() > 0) {
+                message += " and";
+            }
+            message = " less than " + max;
+        }
+
+        return label + " must be" + message;
+    }
+
+    private void displayErrorMessage() {
+        JOptionPane.showMessageDialog(null,
+                getErrorMessage(), "Invalid value", JOptionPane.ERROR_MESSAGE);
+    }
+
+    public void setRange(double min, double max) {
+        this.min = min;
+        this.max = max;
+        range_check = true;
+    }
+
+    public void setValue(double value) {
+        if (range_check) {
+            if (value < min || value > max) {
+                displayErrorMessage();
+                return;
+            }
+            if (!includeMin && value == min) {
+                displayErrorMessage();
+                return;
+            }
+            if (!includeMax && value == max) {
+                displayErrorMessage();
+                return;
+            }
+        }
+        setText(value);
+    }
+
+    public void setLabel(String label) {
+        this.label = label;
+    }
+
+    public Double getValue() {
+        try {
+            if (allowEmpty && getText().trim().equals("")) {
+                return null;
+            } else if (getText().equals(POSITIVE_INFINITY)) {
+                return Double.POSITIVE_INFINITY;
+            } else if (getText().equals(NEGATIVE_INFINITY)) {
+                return Double.NEGATIVE_INFINITY;
+            } else if (getText().equals(MAX_VALUE)) {
+                return Double.MAX_VALUE;
+            } else if (getText().equals(MIN_VALUE)) {
+                return Double.MIN_VALUE;
+            } else if (getText().equals(NaN)) {
+                return Double.NaN;
+            } else {
+//                System.out.println("=" + getText() + "=");
+                return new Double(getText());
+            }
+        } catch (NumberFormatException e) {
+            JOptionPane.showMessageDialog(null, "Unable to parse number correctly",
+                    "Number Format Exception",
+                    JOptionPane.ERROR_MESSAGE);
+            isValueValid = false;
+            return null;
+        }
+    }
+
+    protected Document createDefaultModel() {
+        Document doc = new RealNumberField.RealNumberFieldDocument();
+        doc.addDocumentListener(this);
+        return doc;
+    }
+
+    public void insertUpdate(DocumentEvent e) {
+        fireChanged();
+    }
+
+    public void removeUpdate(DocumentEvent e) {
+        fireChanged();
+    }
+
+    public void changedUpdate(DocumentEvent e) {
+        fireChanged();
+    }
+
+    static char[] numberSet = {
+            '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'
+    };
+
+    class RealNumberFieldDocument extends PlainDocument {
+		private static final long serialVersionUID = 1L;
+
+		public void insertString(int offs, String str, AttributeSet a)
+                throws BadLocationException {
+
+            if (str == "" || str == null) return;
+            if (str.equals("+INF") || str.equals("-INF") || str.equals("NaN")
+                    || str.equals("MAX_VALUE") || str.equals("MIN_VALUE")) {
+                super.insertString(offs, str, a);
+                return;
+            }
+
+            str = str.trim();
+
+            int length = getLength();
+            String buf = getText(0, offs) + str + getText(offs, length - offs);
+            buf = buf.trim().toUpperCase();
+            char[] array = buf.toCharArray();
+
+            if (array.length > 0) {
+                if (array[0] != MINUS && !member(array[0], numberSet) &&
+                        array[0] != PERIOD) {
+                    Toolkit.getDefaultToolkit().beep();
+                    return;
+                }
+            }
+
+            boolean period_found = (array.length > 0 && array[0] == PERIOD);
+            boolean exponent_found = false;
+            int exponent_index = -1;
+            boolean exponent_sign_found = false;
+
+            for (int i = 1; i < array.length; i++) {
+                if (!member(array[i], numberSet)) {
+                    if (!period_found && array[i] == PERIOD) {
+                        period_found = true;
+                    } else if (!exponent_found && array[i] == 'E') {
+                        exponent_found = true;
+                        exponent_index = i;
+                    } else if (exponent_found && i == (exponent_index + 1) && !exponent_sign_found && array[i] == '-') {
+                        exponent_sign_found = true;
+                    } else {
+                        Toolkit.getDefaultToolkit().beep();
+                        return;
+                    }
+                }
+            }
+            super.insertString(offs, str, a);
+        }
+    }
+
+    static boolean member(char item, char[] array) {
+        for (char anArray : array) {
+            if (anArray == item) {
+                return true;
+            }
+        }
+        return false;
+    }
+    //------------------------------------------------------------------------
+    // Event Methods
+    //------------------------------------------------------------------------
+
+    public void addChangeListener(ChangeListener x) {
+        changeListeners.add(ChangeListener.class, x);
+    }
+
+    public void removeChangeListener(ChangeListener x) {
+        changeListeners.remove(ChangeListener.class, x);
+    }
+
+    protected void fireChanged() {
+        range_checked = false;
+        isValueValid = true;
+
+        ChangeEvent c = new ChangeEvent(this);
+        Object[] listeners = changeListeners.getListenerList();
+        for (int i = listeners.length - 2; i >= 0; i -= 2) {
+            if (listeners[i] == ChangeListener.class) {
+                ChangeListener cl = (ChangeListener) listeners[i + 1];
+                cl.stateChanged(c);
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/beast/app/treeannotator/SnyderContour.java b/src/beast/app/treeannotator/SnyderContour.java
new file mode 100644
index 0000000..4cbd525
--- /dev/null
+++ b/src/beast/app/treeannotator/SnyderContour.java
@@ -0,0 +1,496 @@
+package beast.app.treeannotator;
+
+import java.awt.*;
+import java.awt.geom.Point2D;
+import java.util.LinkedList;
+import java.util.List;
+
+
+/* This class provides 2D contouring functionality.  This code is adapted from
+ * ContourPlot.java by David Rand (1997) "Contour Plotting in Java" MacTech, volume 13.
+ * Rand, in turn, ported to Java from Fortan:
+ *
+ *      Snyder WV (1978) "Algorithm 531, Contour Plotting [J6]", ACM Trans. Math. Softw., 4, 290-294.
+ *
+ * @author Marc Suchard
+ */
+
+public class SnyderContour {
+
+    // Below, constant data members:
+    final static boolean SHOW_NUMBERS = true;
+    final static int BLANK = 32,
+            OPEN_SUITE = (int) '{',
+            CLOSE_SUITE = (int) '}',
+            BETWEEN_ARGS = (int) ',',
+            N_CONTOURS = 1,
+            PLOT_MARGIN = 20,
+            WEE_BIT = 3,
+            NUMBER_LENGTH = 3;
+    final static double Z_MAX_MAX = 1.0E+10,
+            Z_MIN_MIN = -Z_MAX_MAX;
+    final static String EOL =
+            System.getProperty("line.separator");
+
+    // Below, data members which store the grid steps,
+    // the z values, the interpolation flag, the dimensions
+    // of the contour plot and the increments in the grid:
+    int xSteps, ySteps;
+    float z[][];
+    boolean logInterpolation = false;
+    Dimension d;
+    double deltaX, deltaY;
+
+    // Below, data members, most of which are adapted from
+    // Fortran variables in Snyder's code:
+    int ncv = N_CONTOURS;
+    int l1[] = new int[4];
+    int l2[] = new int[4];
+    int ij[] = new int[2];
+    int i1[] = new int[2];
+    int i2[] = new int[2];
+    int i3[] = new int[6];
+    int ibkey, icur, jcur, ii, jj, elle, ix, iedge, iflag, ni, ks;
+    int cntrIndex, prevIndex;
+    int idir, nxidir, k;
+    double z1, z2, cval, zMax, zMin;
+    double intersect[] = new double[4];
+    double xy[] = new double[2];
+    double prevXY[] = new double[2];
+    float cv[] = new float[ncv];
+    boolean jump;
+
+    //-------------------------------------------------------
+    // A constructor method.
+    //-------------------------------------------------------
+    public SnyderContour(int x, int y) {
+        super();
+        xSteps = x;
+        ySteps = y;
+    }
+
+    public void setDeltas(double xDelta, double yDelta) {
+        this.deltaX = xDelta;
+        this.deltaY = yDelta;
+    }
+
+    double offsetX, offsetY;
+
+    public void setOffsets(double xOffset, double yOffset) {
+        this.offsetX = xOffset;
+        this.offsetY = yOffset;
+    }
+
+
+    //-------------------------------------------------------
+    int sign(int a, int b) {
+        a = Math.abs(a);
+        if (b < 0) return -a;
+        else return a;
+    }
+
+    //-------------------------------------------------------
+    // "DrawKernel" is the guts of drawing and is called
+    // directly or indirectly by "ContourPlotKernel" in order
+    // to draw a segment of a contour or to set the pen
+    // position "prevXY". Its action depends on "iflag":
+    //
+    // iflag == 1 means Continue a contour
+    // iflag == 2 means Start a contour at a boundary
+    // iflag == 3 means Start a contour not at a boundary
+    // iflag == 4 means Finish contour at a boundary
+    // iflag == 5 means Finish closed contour not at boundary
+    // iflag == 6 means Set pen position
+    //
+    // If the constant "SHOW_NUMBERS" is true then when
+    // completing a contour ("iflag" == 4 or 5) the contour
+    // index is drawn adjacent to where the contour ends.
+    //-------------------------------------------------------
+
+    void DrawKernel(List<LinkedList<Point2D>> allPaths) {
+        double          //prevU,prevV,
+                u, v;
+
+        if ((iflag == 1) || (iflag == 4) || (iflag == 5)) {         // continue drawing ...
+            if (cntrIndex != prevIndex) { // Must change colour
+                //SetColour(g);
+                prevIndex = cntrIndex;
+            }
+//			prevU = ((prevXY[0] - 1.0) * deltaX);
+//			prevV = ((prevXY[1] - 1.0) * deltaY);
+            u = ((xy[0] - 1.0) * deltaX) + offsetX;
+            v = ((xy[1] - 1.0) * deltaY) + offsetY;
+
+            // Interchange horizontal & vertical
+//			g.drawLine(PLOT_MARGIN+prevV,PLOT_MARGIN+prevU,
+//				   PLOT_MARGIN+v, PLOT_MARGIN+u);
+            LinkedList<Point2D> path = allPaths.get(allPaths.size() - 1);
+            path.add(new Point2D.Double(u, v));
+//			if ((SHOW_NUMBERS) && ((iflag==4) || (iflag==5))) {
+//				if      (u == 0)	u = u - WEE_BIT;
+//				else if	(u == d.width)  u = u + PLOT_MARGIN/2;
+//				else if	(v == 0)	v = v - PLOT_MARGIN/2;
+//				else if	(v == d.height) v = v + WEE_BIT;
+//				g.drawString(Integer.toString(cntrIndex),
+//					PLOT_MARGIN+v, PLOT_MARGIN+u);
+//			}
+            // TODO If end at boundary, close path.
+        }
+        if ((iflag == 2) || (iflag == 3)) { // start new path
+            u = ((xy[0] - 1.0) * deltaX) + offsetX;
+            v = ((xy[1] - 1.0) * deltaY) + offsetY;
+            LinkedList<Point2D> path = new LinkedList<Point2D>();
+            path.add(new Point2D.Double(u, v));
+            allPaths.add(path);
+        }
+        prevXY[0] = xy[0];
+        prevXY[1] = xy[1];
+    }
+
+    //-------------------------------------------------------
+    // "DetectBoundary"
+    //-------------------------------------------------------
+    void DetectBoundary() {
+        ix = 1;
+        if (ij[1 - elle] != 1) {
+            ii = ij[0] - i1[1 - elle];
+            jj = ij[1] - i1[elle];
+            if (z[ii - 1][jj - 1] <= Z_MAX_MAX) {
+                ii = ij[0] + i2[elle];
+                jj = ij[1] + i2[1 - elle];
+                if (z[ii - 1][jj - 1] < Z_MAX_MAX) ix = 0;
+            }
+            if (ij[1 - elle] >= l1[1 - elle]) {
+                ix = ix + 2;
+                return;
+            }
+        }
+        ii = ij[0] + i1[1 - elle];
+        jj = ij[1] + i1[elle];
+        if (z[ii - 1][jj - 1] > Z_MAX_MAX) {
+            ix = ix + 2;
+            return;
+        }
+        if (z[ij[0]][ij[1]] >= Z_MAX_MAX) ix = ix + 2;
+    }
+
+    //-------------------------------------------------------
+    // "Routine_label_020" corresponds to a block of code
+    // starting at label 20 in Synder's subroutine "GCONTR".
+    //-------------------------------------------------------
+    boolean Routine_label_020() {
+        l2[0] = ij[0];
+        l2[1] = ij[1];
+        l2[2] = -ij[0];
+        l2[3] = -ij[1];
+        idir = 0;
+        nxidir = 1;
+        k = 1;
+        ij[0] = Math.abs(ij[0]);
+        ij[1] = Math.abs(ij[1]);
+        if (z[ij[0] - 1][ij[1] - 1] > Z_MAX_MAX) {
+            elle = idir % 2;
+            ij[elle] = sign(ij[elle], l1[k - 1]);
+            return true;
+        }
+        elle = 0;
+        return false;
+    }
+
+    //-------------------------------------------------------
+    // "Routine_label_050" corresponds to a block of code
+    // starting at label 50 in Synder's subroutine "GCONTR".
+    //-------------------------------------------------------
+    boolean Routine_label_050() {
+        while (true) {
+            if (ij[elle] >= l1[elle]) {
+                if (++elle <= 1) continue;
+                elle = idir % 2;
+                ij[elle] = sign(ij[elle], l1[k - 1]);
+                if (Routine_label_150()) return true;
+                continue;
+            }
+            ii = ij[0] + i1[elle];
+            jj = ij[1] + i1[1 - elle];
+            if (z[ii - 1][jj - 1] > Z_MAX_MAX) {
+                if (++elle <= 1) continue;
+                elle = idir % 2;
+                ij[elle] = sign(ij[elle], l1[k - 1]);
+                if (Routine_label_150()) return true;
+                continue;
+            }
+            break;
+        }
+        jump = false;
+        return false;
+    }
+
+    //-------------------------------------------------------
+    // "Routine_label_150" corresponds to a block of code
+    // starting at label 150 in Synder's subroutine "GCONTR".
+    //-------------------------------------------------------
+    boolean Routine_label_150() {
+        while (true) {
+            //------------------------------------------------
+            // Lines from z[ij[0]-1][ij[1]-1]
+            //	   to z[ij[0]  ][ij[1]-1]
+            //	  and z[ij[0]-1][ij[1]]
+            // are not satisfactory. Continue the spiral.
+            //------------------------------------------------
+            if (ij[elle] < l1[k - 1]) {
+                ij[elle]++;
+                if (ij[elle] > l2[k - 1]) {
+                    l2[k - 1] = ij[elle];
+                    idir = nxidir;
+                    nxidir = idir + 1;
+                    k = nxidir;
+                    if (nxidir > 3) nxidir = 0;
+                }
+                ij[0] = Math.abs(ij[0]);
+                ij[1] = Math.abs(ij[1]);
+                if (z[ij[0] - 1][ij[1] - 1] > Z_MAX_MAX) {
+                    elle = idir % 2;
+                    ij[elle] = sign(ij[elle], l1[k - 1]);
+                    continue;
+                }
+                elle = 0;
+                return false;
+            }
+            if (idir != nxidir) {
+                nxidir++;
+                ij[elle] = l1[k - 1];
+                k = nxidir;
+                elle = 1 - elle;
+                ij[elle] = l2[k - 1];
+                if (nxidir > 3) nxidir = 0;
+                continue;
+            }
+
+            if (ibkey != 0) return true;
+            ibkey = 1;
+            ij[0] = icur;
+            ij[1] = jcur;
+            if (Routine_label_020()) continue;
+            return false;
+        }
+    }
+
+    //-------------------------------------------------------
+    // "Routine_label_200" corresponds to a block of code
+    // starting at label 200 in Synder's subroutine "GCONTR".
+    // It has return values 0, 1 or 2.
+    //-------------------------------------------------------
+    short Routine_label_200(//Graphics g
+                            List<LinkedList<Point2D>> allPaths
+            , boolean workSpace[]) {
+        while (true) {
+            xy[elle] = 1.0 * ij[elle] + intersect[iedge - 1];
+            xy[1 - elle] = 1.0 * ij[1 - elle];
+            workSpace[2 * (xSteps * (ySteps * cntrIndex + ij[1] - 1)
+                    + ij[0] - 1) + elle] = true;
+            DrawKernel(allPaths);
+            if (iflag >= 4) {
+                icur = ij[0];
+                jcur = ij[1];
+                return 1;
+            }
+            ContinueContour();
+            if (!workSpace[2 * (xSteps * (ySteps * cntrIndex
+                    + ij[1] - 1) + ij[0] - 1) + elle]) return 2;
+            iflag = 5;                    // 5. Finish a closed contour
+            iedge = ks + 2;
+            if (iedge > 4) iedge = iedge - 4;
+            intersect[iedge - 1] = intersect[ks - 1];
+        }
+    }
+
+    //-------------------------------------------------------
+    // "CrossedByContour" is true iff the current segment in
+    // the grid is crossed by one of the contour values and
+    // has not already been processed for that value.
+    //-------------------------------------------------------
+    boolean CrossedByContour(boolean workSpace[]) {
+        ii = ij[0] + i1[elle];
+        jj = ij[1] + i1[1 - elle];
+        z1 = z[ij[0] - 1][ij[1] - 1];
+        z2 = z[ii - 1][jj - 1];
+        for (cntrIndex = 0; cntrIndex < ncv; cntrIndex++) {
+            int i = 2 * (xSteps * (ySteps * cntrIndex + ij[1] - 1) + ij[0] - 1) + elle;
+
+            if (!workSpace[i]) {
+                float x = cv[cntrIndex];
+                if ((x > Math.min(z1, z2)) && (x <= Math.max(z1, z2))) {
+                    workSpace[i] = true;
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
+    //-------------------------------------------------------
+    // "ContinueContour" continues tracing a contour. Edges
+    // are numbered clockwise, the bottom edge being # 1.
+    //-------------------------------------------------------
+    void ContinueContour() {
+        short local_k;
+
+        ni = 1;
+        if (iedge >= 3) {
+            ij[0] = ij[0] - i3[iedge - 1];
+            ij[1] = ij[1] - i3[iedge + 1];
+        }
+        for (local_k = 1; local_k < 5; local_k++)
+            if (local_k != iedge) {
+                ii = ij[0] + i3[local_k - 1];
+                jj = ij[1] + i3[local_k];
+                z1 = z[ii - 1][jj - 1];
+                ii = ij[0] + i3[local_k];
+                jj = ij[1] + i3[local_k + 1];
+                z2 = z[ii - 1][jj - 1];
+                if ((cval > Math.min(z1, z2) && (cval <= Math.max(z1, z2)))) {
+                    if ((local_k == 1) || (local_k == 4)) {
+                        double zz = z2;
+
+                        z2 = z1;
+                        z1 = zz;
+                    }
+                    intersect[local_k - 1] = (cval - z1) / (z2 - z1);
+                    ni++;
+                    ks = local_k;
+                }
+            }
+        if (ni != 2) {
+            //-------------------------------------------------
+            // The contour crosses all 4 edges of cell being
+            // examined. Choose lines top-to-left & bottom-to-
+            // right if interpolation point on top edge is
+            // less than interpolation point on bottom edge.
+            // Otherwise, choose the other pair. This method
+            // produces the same results if axes are reversed.
+            // The contour may close at any edge, but must not
+            // cross itself inside any cell.
+            //-------------------------------------------------
+            ks = 5 - iedge;
+            if (intersect[2] >= intersect[0]) {
+                ks = 3 - iedge;
+                if (ks <= 0) ks = ks + 4;
+            }
+        }
+        //----------------------------------------------------
+        // Determine whether the contour will close or run
+        // into a boundary at edge ks of the current cell.
+        //----------------------------------------------------
+        elle = ks - 1;
+        iflag = 1;                    // 1. Continue a contour
+        jump = true;
+        if (ks >= 3) {
+            ij[0] = ij[0] + i3[ks - 1];
+            ij[1] = ij[1] + i3[ks + 1];
+            elle = ks - 3;
+        }
+    }
+
+
+    void ContourKernel(double[][] data, List<LinkedList<Point2D>> allPaths, double level) {
+
+        ncv = 1;
+        cv[0] = (float) level;
+
+        int workLength = 2 * xSteps * ySteps * ncv;
+        boolean workSpace[]; // Allocate below if data valid
+
+        z = new float[data.length][data[0].length];
+        for (int i = 0; i < data.length; i++) {
+            for (int j = 0; j < data[i].length; j++)
+                z[i][j] = (float) data[i][j];
+        }
+
+        workSpace = new boolean[workLength];
+        ContourPlotKernel(allPaths, workSpace);
+
+    }
+
+    //-------------------------------------------------------
+    // "ContourPlotKernel" is the guts of this class and
+    // corresponds to Synder's subroutine "GCONTR".
+    //-------------------------------------------------------
+    void ContourPlotKernel(List<LinkedList<Point2D>> allPaths,
+                           boolean workSpace[]) {
+        short val_label_200;
+
+        l1[0] = xSteps;
+        l1[1] = ySteps;
+        l1[2] = -1;
+        l1[3] = -1;
+        i1[0] = 1;
+        i1[1] = 0;
+        i2[0] = 1;
+        i2[1] = -1;
+        i3[0] = 1;
+        i3[1] = 0;
+        i3[2] = 0;
+        i3[3] = 1;
+        i3[4] = 1;
+        i3[5] = 0;
+        prevXY[0] = 0.0;
+        prevXY[1] = 0.0;
+        xy[0] = 1.0;
+        xy[1] = 1.0;
+        cntrIndex = 0;
+        prevIndex = -1;
+        iflag = 6;
+//		DrawKernel(g);
+        icur = Math.max(1, Math.min((int) Math.floor(xy[0]), xSteps));
+        jcur = Math.max(1, Math.min((int) Math.floor(xy[1]), ySteps));
+        ibkey = 0;
+        ij[0] = icur;
+        ij[1] = jcur;
+        if (Routine_label_020() &&
+                Routine_label_150()) return;
+        if (Routine_label_050()) return;
+        while (true) {
+            DetectBoundary();
+            if (jump) {
+                if (ix != 0) iflag = 4; // Finish contour at boundary
+                iedge = ks + 2;
+                if (iedge > 4) iedge = iedge - 4;
+                intersect[iedge - 1] = intersect[ks - 1];
+                val_label_200 = Routine_label_200(allPaths, workSpace);
+                if (val_label_200 == 1) {
+                    if (Routine_label_020() && Routine_label_150()) return;
+                    if (Routine_label_050()) return;
+                    continue;
+                }
+                if (val_label_200 == 2) continue;
+                return;
+            }
+            if ((ix != 3) && (ix + ibkey != 0) && CrossedByContour(workSpace)) {
+                //
+                // An acceptable line segment has been found.
+                // Follow contour until it hits a
+                // boundary or closes.
+                //
+                iedge = elle + 1;
+                cval = cv[cntrIndex];
+                if (ix != 1) iedge = iedge + 2;
+                iflag = 2 + ibkey;
+                intersect[iedge - 1] = (cval - z1) / (z2 - z1);
+                val_label_200 = Routine_label_200(allPaths, workSpace);
+                if (val_label_200 == 1) {
+                    if (Routine_label_020() && Routine_label_150()) return;
+                    if (Routine_label_050()) return;
+                    continue;
+                }
+                if (val_label_200 == 2) continue;
+                return;
+            }
+            if (++elle > 1) {
+                elle = idir % 2;
+                ij[elle] = sign(ij[elle], l1[k - 1]);
+                if (Routine_label_150()) return;
+            }
+            if (Routine_label_050()) return;
+        }
+    }
+}
diff --git a/src/beast/app/treeannotator/TreeAnnotator.java b/src/beast/app/treeannotator/TreeAnnotator.java
new file mode 100644
index 0000000..9b2aaa0
--- /dev/null
+++ b/src/beast/app/treeannotator/TreeAnnotator.java
@@ -0,0 +1,1536 @@
+/*
+ * TreeAnnotator.java
+ *
+ * Copyright (C) 2002-2010 Alexei Drummond and Andrew Rambaut
+ *
+ * This file is part of BEAST.
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership and licensing.
+ *
+ * BEAST 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
+ * of the License, or (at your option) any later version.
+ *
+ * BEAST 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 BEAST; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+package beast.app.treeannotator;
+
+import beast.app.BEASTVersion;
+import beast.app.beauti.BeautiDoc;
+import beast.app.tools.LogCombiner;
+import beast.app.util.Arguments;
+import beast.core.util.Log;
+import beast.evolution.alignment.TaxonSet;
+import beast.evolution.tree.Node;
+import beast.evolution.tree.Tree;
+import beast.evolution.tree.TreeUtils;
+import beast.math.statistic.DiscreteStatistics;
+import beast.util.CollectionUtils;
+import beast.util.HeapSort;
+import beast.util.NexusParser;
+import beast.util.TreeParser;
+import jam.console.ConsoleApplication;
+
+import javax.swing.*;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.util.*;
+
+//import org.rosuda.JRI.REXP;
+//import org.rosuda.JRI.RVector;
+//import org.rosuda.JRI.Rengine;
+
+/**
+ * @author Alexei Drummond
+ * @author Andrew Rambaut
+ * 
+ * TreeAnnotator ported from BEAST 1
+ */
+public class TreeAnnotator {
+
+    private final static BEASTVersion version = new BEASTVersion();
+
+    private final static boolean USE_R = false;
+
+    private static boolean forceIntegerToDiscrete = false;
+
+    private boolean SAmode = false;
+
+    
+    abstract class TreeSet {
+    	abstract boolean hasNext();
+    	abstract Tree next() throws Exception;
+    	abstract void reset() throws Exception ;
+    }    
+    
+    class FastTreeSet extends TreeSet {
+    	int current = 0;
+    	Tree [] trees;
+    	
+    	public FastTreeSet(String inputFileName, int burninPercentage) throws Exception {
+            progressStream.println("0              25             50             75            100");
+            progressStream.println("|--------------|--------------|--------------|--------------|");
+    		TreeSetParser parser = new TreeSetParser(burninPercentage, false);
+	      	Node [] roots = parser.parseFile(inputFileName);
+	      	trees = new Tree[roots.length];
+	      	int i = 0;
+	      	for (Node root : roots) {
+	      		trees[i++] = new Tree(root);
+	      	}
+		}
+
+		@Override
+		boolean hasNext() {
+			return current < trees.length;
+		}
+
+		@Override
+		Tree next() throws Exception {
+			return trees[current++];
+		}
+
+		@Override
+		void reset() throws Exception {
+			current = 0;
+		}
+    }
+    
+    class MemoryFriendlyTreeSet extends TreeSet {
+//    	Tree [] trees;
+    	int current = 0;
+    	int lineNr;
+        public Map<String, String> translationMap = null;
+        public List<String> taxa;
+    	
+        int burninCount = 0;
+        int totalTrees = 0;
+        boolean isNexus = true;
+        BufferedReader fin;
+        String inputFileName;
+        // label count origin for NEXUS trees
+        int origin = -1;
+       
+        MemoryFriendlyTreeSet(String inputFileName, int burninPercentage) throws Exception {
+    		this.inputFileName = inputFileName;
+    		init(burninPercentage);
+        	progressStream.println("Processing " + (totalTrees - burninCount) + " trees from file" +
+                    (burninPercentage > 0 ? " after ignoring first " + burninPercentage + "% = " + burninCount + " trees." : "."));
+    		
+    		
+    	}
+
+    	/** determine number of trees in the file,
+    	 * and number of trees to skip as burnin 
+    	 * @throws FileNotFoundException **/
+    	private void init(int burninPercentage) throws Exception {
+            fin = new BufferedReader(new FileReader(new File(inputFileName)));
+            if (!fin.ready()) {
+            	throw new Exception("File appears empty");
+            }
+        	String str = nextLine();
+            if (!str.toUpperCase().trim().startsWith("#NEXUS")) {
+            	// the file contains a list of Newick trees instead of a list in Nexus format
+            	isNexus = false;
+            	if (str.trim().length() > 0) {
+            		totalTrees = 1;
+            	}
+            }
+            while (fin.ready()) {
+            	str = nextLine();
+                if (isNexus) {
+                    if (str.trim().toLowerCase().startsWith("tree ")) {
+                    	totalTrees++;
+                    }
+                } else if (str.trim().length() > 0) {
+            		totalTrees++;
+                }            	
+            }
+            fin.close();
+            
+            burninCount = Math.max(0, (burninPercentage * totalTrees)/100);
+		}
+
+    	void reset() throws Exception {
+    		current = 0;
+            fin = new BufferedReader(new FileReader(new File(inputFileName)));
+            lineNr = 0;
+            try {
+                while (fin.ready()) {
+                    final String sStr = nextLine();
+                    if (sStr == null) {
+                        return;
+                    }
+                    final String sLower = sStr.toLowerCase();
+                    if (sLower.matches("^\\s*begin\\s+trees;\\s*$")) {
+                        parseTreesBlock();
+                        return;
+                    }
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+                throw new Exception("Around line " + lineNr + "\n" + e.getMessage());
+            }
+        } // parseFile
+
+        /**
+         * read next line from Nexus file that is not a comment and not empty *
+         */
+        String nextLine() throws Exception {
+            String sStr = readLine();
+            if (sStr == null) {
+                return null;
+            }
+            if (sStr.contains("[")) {
+                final int iStart = sStr.indexOf('[');
+                int iEnd = sStr.indexOf(']', iStart);
+                while (iEnd < 0) {
+                    sStr += readLine();
+                    iEnd = sStr.indexOf(']', iStart);
+                }
+                sStr = sStr.substring(0, iStart) + sStr.substring(iEnd + 1);
+                if (sStr.matches("^\\s*$")) {
+                    return nextLine();
+                }
+            }
+            if (sStr.matches("^\\s*$")) {
+                return nextLine();
+            }
+            return sStr;
+        }
+
+        /**
+         * read line from nexus file *
+         */
+        String readLine() throws IOException {
+            if (!fin.ready()) {
+                return null;
+            }
+            lineNr++;
+            return fin.readLine();
+        }
+
+        private void parseTreesBlock() throws Exception {
+            // read to first non-empty line within trees block
+            String sStr = fin.readLine().trim();
+            while (sStr.equals("")) {
+                sStr = fin.readLine().trim();
+            }
+
+            // if first non-empty line is "translate" then parse translate block
+            if (sStr.toLowerCase().contains("translate")) {
+                translationMap = parseTranslateBlock();
+                origin = getIndexedTranslationMapOrigin(translationMap);
+                if (origin != -1) {
+                    taxa = getIndexedTranslationMap(translationMap, origin);
+                }
+            }
+            // we got to the end of the translate block
+            // read bunrinCount trees
+            current = 0;
+            while (current < burninCount && fin.ready()) {
+    			sStr = nextLine();
+                if (sStr.toLowerCase().startsWith("tree ")) {
+                	current++;
+                }
+            }
+        }
+
+        private List<String> getIndexedTranslationMap(final Map<String, String> translationMap, final int origin) {
+
+            //System.out.println("translation map size = " + translationMap.size());
+
+            final String[] taxa = new String[translationMap.size()];
+
+            for (final String key : translationMap.keySet()) {
+                taxa[Integer.parseInt(key) - origin] = translationMap.get(key);
+            }
+            return Arrays.asList(taxa);
+        }
+
+        /**
+         * @param translationMap
+         * @return minimum key value if keys are a contiguous set of integers starting from zero or one, -1 otherwise
+         */
+        private int getIndexedTranslationMapOrigin(final Map<String, String> translationMap) {
+
+            final SortedSet<Integer> indices = new java.util.TreeSet<>();
+
+            int count = 0;
+            for (final String key : translationMap.keySet()) {
+                final int index = Integer.parseInt(key);
+                indices.add(index);
+                count += 1;
+            }
+            if ((indices.last() - indices.first() == count - 1) && (indices.first() == 0 || indices.first() == 1)) {
+                return indices.first();
+            }
+            return -1;
+        }
+
+        /**
+         * @return a map of taxa translations, keys are generally integer node number starting from 1
+         *         whereas values are generally descriptive strings.
+         * @throws IOException
+         */
+        private Map<String, String> parseTranslateBlock() throws IOException {
+
+            final Map<String, String> translationMap = new HashMap<String, String>();
+
+            String line = readLine();
+            final StringBuilder translateBlock = new StringBuilder();
+            while (line != null && !line.trim().toLowerCase().equals(";")) {
+                translateBlock.append(line.trim());
+                line = readLine();
+            }
+            final String[] taxaTranslations = translateBlock.toString().split(",");
+            for (final String taxaTranslation : taxaTranslations) {
+                final String[] translation = taxaTranslation.split("[\t ]+");
+                if (translation.length == 2) {
+                    translationMap.put(translation[0], translation[1]);
+//                    System.out.println(translation[0] + " -> " + translation[1]);
+                } else {
+                    Log.err.println("Ignoring translation:" + Arrays.toString(translation));
+                }
+            }
+            return translationMap;
+        }
+
+    	
+    	
+    	boolean hasNext() {
+    		return current < totalTrees;
+    	}
+    	
+    	Tree next() throws Exception {
+			String sStr = nextLine();
+    		if (!isNexus) {
+                TreeParser treeParser;
+
+                if (origin != -1) {
+                    treeParser = new TreeParser(taxa, sStr, origin, false);
+                } else {
+                    try {
+                        treeParser = new TreeParser(taxa, sStr, 0, false);
+                    } catch (ArrayIndexOutOfBoundsException e) {
+                        treeParser = new TreeParser(taxa, sStr, 1, false);
+                    }
+                }
+                return treeParser;
+    		}
+    		
+            // read trees from NEXUS file
+            if (sStr.toLowerCase().startsWith("tree ")) {
+            	current++;
+                final int i = sStr.indexOf('(');
+                if (i > 0) {
+                    sStr = sStr.substring(i);
+                }
+                TreeParser treeParser;
+
+                if (origin != -1) {
+                    treeParser = new TreeParser(taxa, sStr, origin, false);
+                } else {
+                    try {
+                        treeParser = new TreeParser(taxa, sStr, 0, false);
+                    } catch (ArrayIndexOutOfBoundsException e) {
+                        treeParser = new TreeParser(taxa, sStr, 1, false);
+                    }
+                }
+
+                if (translationMap != null) treeParser.translateLeafIds(translationMap);
+
+                return treeParser;
+            }
+    		return null;
+    	}
+    }
+    TreeSet treeSet;
+
+
+    enum Target {
+        MAX_CLADE_CREDIBILITY("Maximum clade credibility tree"),
+        MAX_SUM_CLADE_CREDIBILITY("Maximum sum of clade credibilities"),
+        USER_TARGET_TREE("User target tree");
+
+        String desc;
+
+        Target(String s) {
+            desc = s;
+        }
+
+        public String toString() {
+            return desc;
+        }
+    }
+
+    enum HeightsSummary {
+        CA_HEIGHTS("Common Ancestor heights"),
+        MEDIAN_HEIGHTS("Median heights"),
+        MEAN_HEIGHTS("Mean heights"),
+        KEEP_HEIGHTS("Keep target heights");
+
+        String desc;
+
+        HeightsSummary(String s) {
+            desc = s;
+        }
+
+        public String toString() {
+            return desc;
+        }
+    }
+
+
+    // Messages to stderr, output to stdout
+    private static PrintStream progressStream = Log.err;
+
+//    private final String location1Attribute = "longLat1";
+//    private final String location2Attribute = "longLat2";
+//    private final String locationOutputAttribute = "location";
+
+    public TreeAnnotator() { }
+
+    public TreeAnnotator(final int burninPercentage,
+    					 boolean lowMemory, // bAllowSingleChild was defunct (always set to false), now replaced by flag to say how much 
+                         HeightsSummary heightsOption,
+                         double posteriorLimit,
+                         double hpd2D,
+                         Target targetOption,
+                         String targetTreeFileName,
+                         String inputFileName,
+                         String outputFileName
+    ) throws Exception {
+
+        this.posteriorLimit = posteriorLimit;
+        this.hpd2D = hpd2D;
+
+        attributeNames.add("height");
+        attributeNames.add("length");
+
+        CladeSystem cladeSystem = new CladeSystem();
+
+        totalTrees = 10000;
+        totalTreesUsed = 0;
+
+        //progressStream.println("Reading trees (bar assumes 10,000 trees)...");
+
+        int stepSize = Math.max(totalTrees / 60, 1);
+
+        try {
+        	if (lowMemory) {
+        		treeSet = new MemoryFriendlyTreeSet(inputFileName, burninPercentage);
+        	} else {
+        		treeSet = new FastTreeSet(inputFileName, burninPercentage);
+        	}
+        } catch (Exception e) {
+        	e.printStackTrace();
+        	Log.err.println("Error Parsing Input Tree: " + e.getMessage());
+        	return;
+        }
+
+        
+        if (targetOption != Target.USER_TARGET_TREE) {
+            try {
+            	treeSet.reset();
+            	while (treeSet.hasNext()) {
+            		Tree tree = treeSet.next();
+                    tree.getLeafNodeCount();
+                    if (tree.getDirectAncestorNodeCount() > 0 && !SAmode) {
+                        SAmode = true;
+                        Log.err.println("A tree with a sampled ancestor is found. Turning on\n the sampled ancestor " +
+                                "summary analysis.");
+                        if (heightsOption == HeightsSummary.CA_HEIGHTS) {
+                            throw new RuntimeException("The common ancestor height is not \n available for trees with sampled " +
+                                    "ancestors. Please choose \n another height summary option");
+                        }
+                    }
+	            	cladeSystem.add(tree, false);
+	                totalTreesUsed++;
+	            }
+	            totalTrees = totalTreesUsed * 100 / (100-Math.max(burninPercentage, 0));
+            } catch (Exception e) {
+            	Log.err.println(e.getMessage());
+                return;
+            }
+
+            progressStream.println();
+            progressStream.println();
+
+            if (totalTrees < 1) {
+            	Log.err.println("No trees");
+                return;
+            }
+            if (totalTreesUsed <= 1) {
+                if (burninPercentage > 0) {
+                    Log.err.println("No trees to use: burnin too high");
+                    return;
+                }
+            }
+            cladeSystem.calculateCladeCredibilities(totalTreesUsed);
+
+            progressStream.println("Total trees have " + totalTrees + ", where " + totalTreesUsed + " are used.");
+//            if (burninPercentage > 0) {
+//                progressStream.println("Ignoring first " + burninPercentage + "% trees.");
+//            }
+
+            progressStream.println("Total unique clades: " + cladeSystem.getCladeMap().keySet().size());
+            progressStream.println();
+        }
+
+        Tree targetTree = null;
+
+        switch (targetOption) {
+            case USER_TARGET_TREE: {
+                if (targetTreeFileName != null) {
+                    progressStream.println("Reading user specified target tree, " + targetTreeFileName);
+                    
+                    String sTree = BeautiDoc.load(targetTreeFileName);
+                    
+                    if (sTree.startsWith("#NEXUS")) {
+                    	NexusParser parser2 = new NexusParser();
+                    	parser2.parseFile(new File(targetTreeFileName));
+                    	targetTree = parser2.trees.get(0);
+                    } else {
+	                    try {
+		                    TreeParser parser2 = new TreeParser();
+		                    parser2.initByName("IsLabelledNewick", true, "newick", sTree);
+		                    targetTree = parser2;
+	                    } catch (Exception e) {
+	                        Log.err.println("Error Parsing Target Tree: " + e.getMessage());
+	                        return;
+	                    }
+                    }
+                } else {
+                    Log.err.println("No user target tree specified.");
+                    return;
+                }
+                break;
+            }
+            case MAX_CLADE_CREDIBILITY: {
+                progressStream.println("Finding maximum credibility tree...");
+                targetTree = summarizeTrees(cladeSystem, false).copy();
+                break;
+            }
+            case MAX_SUM_CLADE_CREDIBILITY: {
+                progressStream.println("Finding maximum sum clade credibility tree...");
+                targetTree = summarizeTrees(cladeSystem, true).copy();
+                break;
+            }
+        }
+
+        progressStream.println("Collecting node information...");
+        progressStream.println("0              25             50             75            100");
+        progressStream.println("|--------------|--------------|--------------|--------------|");
+
+        stepSize = Math.max(totalTrees / 60, 1);
+        int reported = 0;
+
+        // this call increments the clade counts and it shouldn't
+        // this is remedied with removeClades call after while loop below
+        cladeSystem = new CladeSystem(targetTree);
+        totalTreesUsed = 0;
+        try {
+            int counter = 0;
+            treeSet.reset();
+            while (treeSet.hasNext()) {
+            	Tree tree = treeSet.next();
+            	if (counter == 0) {
+                    setupAttributes(tree);
+            	}
+                cladeSystem.collectAttributes(tree, attributeNames);
+                if (counter > 0 && counter % stepSize == 0 && reported < 61) {
+                    progressStream.print("*");
+                    progressStream.flush();
+                    reported++;
+                }
+                totalTreesUsed++;
+                counter++;
+        	}
+        	
+            cladeSystem.removeClades(targetTree.getRoot(), true);
+            //progressStream.println("totalTreesUsed=" + totalTreesUsed);
+            cladeSystem.calculateCladeCredibilities(totalTreesUsed);
+        } catch (Exception e) {
+            Log.err.println("Error Parsing Input Tree: " + e.getMessage());
+            return;
+        }
+        progressStream.println();
+        progressStream.println();
+
+        progressStream.println("Annotating target tree...");
+
+        try {
+            annotateTree(cladeSystem, targetTree.getRoot(), null, heightsOption);
+
+            if( heightsOption == HeightsSummary.CA_HEIGHTS ) {
+                setTreeHeightsByCA(targetTree);
+            }
+        } catch (Exception e) {
+        	e.printStackTrace();
+            Log.err.println("Error to annotate tree: " + e.getMessage() + "\nPlease check the tree log file format.");
+            return;
+        }
+
+        progressStream.println("Writing annotated tree....");
+
+        
+        processMetaData(targetTree.getRoot());
+        try {
+            final PrintStream stream = outputFileName != null ?
+                    new PrintStream(new FileOutputStream(outputFileName)) :
+                    System.out;
+            targetTree.init(stream);
+            stream.println();
+            
+            stream.print("tree TREE1 = ");
+            int[] dummy = new int[1];
+            String sNewick = targetTree.getRoot().toSortedNewick(dummy, true);
+            stream.print(sNewick);
+            stream.println(";");
+//            stream.println(targetTree.getRoot().toShortNewick(false));
+//            stream.println();
+            targetTree.close(stream);
+            stream.println();
+        } catch (Exception e) {
+            Log.err.println("Error to write annotated tree file: " + e.getMessage());
+            return;
+        }
+
+    }
+
+    private void processMetaData(Node node) {
+		for (Node child : node.getChildren()) {
+			processMetaData(child);
+		}
+		Set<String> metaDataNames = node.getMetaDataNames(); 
+		if (metaDataNames != null) {
+			String metadata = "";
+			for (String name : metaDataNames) {
+				Object value = node.getMetaData(name);
+				metadata += name + "=";
+				if (value instanceof Object[]) {
+					Object [] values = (Object[]) value;
+					metadata += "{";
+					for (int i = 0; i < values.length; i++) {
+						metadata += values[i].toString();
+						if (i < values.length - 1) {
+							metadata += ",";
+						}
+					}
+					metadata += "}";
+				} else {
+					 metadata += value.toString();
+				}
+				metadata += ",";
+			}
+			metadata = metadata.substring(0, metadata.length() - 1);
+			node.metaDataString = metadata;
+		}		
+	}
+
+	private void setupAttributes(Tree tree) {
+        for (int i = 0; i < tree.getNodeCount(); i++) {
+            Node node = tree.getNode(i);
+            Set<String> iter = node.getMetaDataNames();
+            if (iter != null) {
+            	for (String name : iter) {
+                    attributeNames.add(name);
+                }
+            }
+        }
+
+        for (TreeAnnotationPlugin plugin : plugins) {
+            Set<String> claimed = plugin.setAttributeNames(attributeNames);
+            attributeNames.removeAll(claimed);
+        }
+    }
+
+    private Tree summarizeTrees(CladeSystem cladeSystem, boolean useSumCladeCredibility) throws Exception {
+
+        Tree bestTree = null;
+        double bestScore = Double.NEGATIVE_INFINITY;
+
+        progressStream.println("Analyzing " + totalTreesUsed + " trees...");
+        progressStream.println("0              25             50             75            100");
+        progressStream.println("|--------------|--------------|--------------|--------------|");
+
+        int stepSize = Math.max(totalTrees / 60, 1);
+        int reported = 0;
+
+        int counter = 0;
+        treeSet.reset();
+        while (treeSet.hasNext()) {
+        	Tree tree = treeSet.next();
+            double score = scoreTree(tree, cladeSystem, useSumCladeCredibility);
+          if (score > bestScore) {
+              bestTree = tree;
+              bestScore = score;
+          }
+          if (counter > 0 && counter % stepSize == 0 && reported < 61) {
+              progressStream.print("*");
+              progressStream.flush();
+              reported++;
+          }
+          counter++;
+        }
+        progressStream.println();
+        progressStream.println();
+        if (useSumCladeCredibility) {
+            progressStream.println("Highest Sum Clade Credibility: " + bestScore);
+        } else {
+            progressStream.println("Highest Log Clade Credibility: " + bestScore);
+        }
+
+        return bestTree;
+    }
+
+    public double scoreTree(Tree tree, CladeSystem cladeSystem, boolean useSumCladeCredibility) {
+        if (useSumCladeCredibility) {
+            return cladeSystem.getSumCladeCredibility(tree.getRoot(), null);
+        } else {
+            return cladeSystem.getLogCladeCredibility(tree.getRoot(), null);
+        }
+    }
+
+
+    private void annotateTree(CladeSystem cladeSystem, Node node, BitSet bits, HeightsSummary heightsOption) {
+
+        BitSet bits2 = new BitSet();
+
+        if (node.isLeaf()) {
+
+            int index = cladeSystem.getTaxonIndex(node);
+            bits2.set(2*index);
+
+            annotateNode(cladeSystem, node, bits2, true, heightsOption);
+        } else {
+
+            for (int i = 0; i < node.getChildCount(); i++) {
+
+                Node node1 = node.getChild(i);
+
+                annotateTree(cladeSystem, node1, bits2, heightsOption);
+            }
+
+            for (int i=1; i<bits2.length(); i=i+2) {
+                bits2.set(i, false);
+            }
+            if (node.isFake()) {
+                int index = cladeSystem.getTaxonIndex(node.getDirectAncestorChild());
+                bits2.set(2 * index + 1);
+            }
+
+            annotateNode(cladeSystem, node, bits2, false, heightsOption);
+        }
+
+        if (bits != null) {
+            bits.or(bits2);
+        }
+    }
+
+    private void annotateNode(CladeSystem cladeSystem, Node node, BitSet bits, boolean isTip, HeightsSummary heightsOption) {
+        CladeSystem.Clade clade = cladeSystem.cladeMap.get(bits);
+        assert clade != null : "Clade missing?";
+
+        boolean filter = false;
+        if (!isTip) {
+            final double posterior = clade.getCredibility();
+            node.setMetaData("posterior", posterior);
+            if (posterior < posteriorLimit) {
+                filter = true;
+            }
+        }
+
+        int i = 0;
+        for (String attributeName : attributeNames) {
+
+            if (clade.attributeValues != null && clade.attributeValues.size() > 0) {
+                double[] values = new double[clade.attributeValues.size()];
+
+                HashMap<Object, Integer> hashMap = new HashMap<Object, Integer>();
+
+                Object[] v = clade.attributeValues.get(0);
+                if (v[i] != null) {
+
+                    final boolean isHeight = attributeName.equals("height");
+                    boolean isBoolean = v[i] instanceof Boolean;
+
+                    boolean isDiscrete = v[i] instanceof String;
+
+                    if (forceIntegerToDiscrete && v[i] instanceof Integer) isDiscrete = true;
+
+                    double minValue = Double.MAX_VALUE;
+                    double maxValue = -Double.MAX_VALUE;
+
+                    final boolean isArray = v[i] instanceof Object[];
+                    boolean isDoubleArray = isArray && ((Object[]) v[i])[0] instanceof Double;
+                    // This is Java, friends - first value type does not imply all.
+                    if (isDoubleArray) {
+                        for (Object n : (Object[]) v[i]) {
+                            if (!(n instanceof Double)) {
+                                isDoubleArray = false;
+                                break;
+                            }
+                        }
+                    }
+                    // todo Handle other types of arrays
+
+                    double[][] valuesArray = null;
+                    double[] minValueArray = null;
+                    double[] maxValueArray = null;
+                    int lenArray = 0;
+
+                    if (isDoubleArray) {
+                        lenArray = ((Object[]) v[i]).length;
+
+                        valuesArray = new double[lenArray][clade.attributeValues.size()];
+                        minValueArray = new double[lenArray];
+                        maxValueArray = new double[lenArray];
+
+                        for (int k = 0; k < lenArray; k++) {
+                            minValueArray[k] = Double.MAX_VALUE;
+                            maxValueArray[k] = -Double.MAX_VALUE;
+                        }
+                    }
+
+                    for (int j = 0; j < clade.attributeValues.size(); j++) {
+                        Object value = clade.attributeValues.get(j)[i];
+                        if (isDiscrete) {
+                            final Object s = value;
+                            if (hashMap.containsKey(s)) {
+                                hashMap.put(s, hashMap.get(s) + 1);
+                            } else {
+                                hashMap.put(s, 1);
+                            }
+                        } else if (isBoolean) {
+                            values[j] = (((Boolean) value) ? 1.0 : 0.0);
+                        } else if (isDoubleArray) {
+                            // Forcing to Double[] causes a cast exception. MAS
+                            try {
+                                Object[] array = (Object[]) value;
+                                for (int k = 0; k < lenArray; k++) {
+                                    valuesArray[k][j] = ((Double) array[k]);
+                                    if (valuesArray[k][j] < minValueArray[k]) minValueArray[k] = valuesArray[k][j];
+                                    if (valuesArray[k][j] > maxValueArray[k]) maxValueArray[k] = valuesArray[k][j];
+                                }
+                            } catch (Exception e) {
+                                // ignore
+                            }
+                        } else {
+                            // Ignore other (unknown) types
+                            if (value instanceof Number) {
+                                values[j] = ((Number) value).doubleValue();
+                                if (values[j] < minValue) minValue = values[j];
+                                if (values[j] > maxValue) maxValue = values[j];
+                            }
+                        }
+                    }
+                    if (isHeight) {
+                        if (heightsOption == HeightsSummary.MEAN_HEIGHTS) {
+                            final double mean = DiscreteStatistics.mean(values);
+                            if (node.isDirectAncestor()) {
+                                node.getParent().setHeight(mean);
+                            }
+                            if (node.isFake()) {
+                                node.getDirectAncestorChild().setHeight(mean);
+                            }
+                            node.setHeight(mean);
+                        } else if (heightsOption == HeightsSummary.MEDIAN_HEIGHTS) {
+                            final double median = DiscreteStatistics.median(values);
+                            if (node.isDirectAncestor()) {
+                                node.getParent().setHeight(median);
+                            }
+                            if (node.isFake()) {
+                                node.getDirectAncestorChild().setHeight(median);
+                            }
+                            node.setHeight(median);
+                        } else {
+                            // keep the existing height
+                        }
+                    }
+
+                    if (!filter) {
+                        boolean processed = false;
+                        for (TreeAnnotationPlugin plugin : plugins) {
+                            if (plugin.handleAttribute(node, attributeName, values)) {
+                                processed = true;
+                            }
+                        }
+
+                        if (!processed) {
+                            if (!isDiscrete) {
+                                if (!isDoubleArray)
+                                    annotateMeanAttribute(node, attributeName, values);
+                                else {
+                                    for (int k = 0; k < lenArray; k++) {
+                                        annotateMeanAttribute(node, attributeName + (k + 1), valuesArray[k]);
+                                    }
+                                }
+                            } else {
+                                annotateModeAttribute(node, attributeName, hashMap);
+                                annotateFrequencyAttribute(node, attributeName, hashMap);
+                            }
+                            if (!isBoolean && minValue < maxValue && !isDiscrete && !isDoubleArray) {
+                                // Basically, if it is a boolean (0, 1) then we don't need the distribution information
+                                // Likewise if it doesn't vary.
+                                annotateMedianAttribute(node, attributeName + "_median", values);
+                                annotateHPDAttribute(node, attributeName + "_95%_HPD", 0.95, values);
+                                annotateRangeAttribute(node, attributeName + "_range", values);
+                            }
+
+                            if (isDoubleArray) {
+                                String name = attributeName;
+                                // todo
+//                                    if (name.equals(location1Attribute)) {
+//                                        name = locationOutputAttribute;
+//                                    }
+                                boolean want2d = processBivariateAttributes && lenArray == 2;
+                                if (name.equals("dmv")) {  // terrible hack
+                                    want2d = false;
+                                }
+                                for (int k = 0; k < lenArray; k++) {
+                                    if (minValueArray[k] < maxValueArray[k]) {
+                                        annotateMedianAttribute(node, name + (k + 1) + "_median", valuesArray[k]);
+                                        annotateRangeAttribute(node, name + (k + 1) + "_range", valuesArray[k]);
+                                        if (!want2d)
+                                            annotateHPDAttribute(node, name + (k + 1) + "_95%_HPD", 0.95, valuesArray[k]);
+                                    }
+                                }
+                                // 2D contours
+                                if (want2d) {
+
+                                    boolean variationInFirst = (minValueArray[0] < maxValueArray[0]);
+                                    boolean variationInSecond = (minValueArray[1] < maxValueArray[1]);
+
+                                    if (variationInFirst && !variationInSecond)
+                                        annotateHPDAttribute(node, name + "1" + "_95%_HPD", 0.95, valuesArray[0]);
+
+                                    if (variationInSecond && !variationInFirst)
+                                        annotateHPDAttribute(node, name + "2" + "_95%_HPD", 0.95, valuesArray[1]);
+
+                                    if (variationInFirst && variationInSecond)
+                                        annotate2DHPDAttribute(node, name, "_" + (int) (100 * hpd2D) + "%HPD", hpd2D, valuesArray);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            i++;
+        }
+    }
+
+    private void annotateMeanAttribute(Node node, String label, double[] values) {
+        double mean = DiscreteStatistics.mean(values);
+        node.setMetaData(label, mean);
+    }
+
+    private void annotateMedianAttribute(Node node, String label, double[] values) {
+        double median = DiscreteStatistics.median(values);
+        node.setMetaData(label, median);
+
+    }
+
+    private void annotateModeAttribute(Node node, String label, HashMap<Object, Integer> values) {
+        Object mode = null;
+        int maxCount = 0;
+        int totalCount = 0;
+        int countInMode = 1;
+
+        for (Object key : values.keySet()) {
+            int thisCount = values.get(key);
+            if (thisCount == maxCount) {
+                // I hope this is the intention
+                mode = mode.toString().concat("+" + key);
+                countInMode++;
+            } else if (thisCount > maxCount) {
+                mode = key;
+                maxCount = thisCount;
+                countInMode = 1;
+            }
+            totalCount += thisCount;
+        }
+        double freq = (double) maxCount / (double) totalCount * countInMode;
+        node.setMetaData(label, mode);
+        node.setMetaData(label + ".prob", freq);
+    }
+
+    private void annotateFrequencyAttribute(Node node, String label, HashMap<Object, Integer> values) {
+        double totalCount = 0;
+        Set<?> keySet = values.keySet();
+        int length = keySet.size();
+        String[] name = new String[length];
+        Double[] freq = new Double[length];
+        int index = 0;
+        for (Object key : values.keySet()) {
+            name[index] = key.toString();
+            freq[index] = new Double(values.get(key));
+            totalCount += freq[index];
+            index++;
+        }
+        for (int i = 0; i < length; i++)
+            freq[i] /= totalCount;
+
+        node.setMetaData(label + ".set", name);
+        node.setMetaData(label + ".set.prob", freq);
+    }
+
+    private void annotateRangeAttribute(Node node, String label, double[] values) {
+        double min = DiscreteStatistics.min(values);
+        double max = DiscreteStatistics.max(values);
+        node.setMetaData(label, new Object[]{min, max});
+    }
+
+    private void annotateHPDAttribute(Node node, String label, double hpd, double[] values) {
+        int[] indices = new int[values.length];
+        HeapSort.sort(values, indices);
+
+        double minRange = Double.MAX_VALUE;
+        int hpdIndex = 0;
+
+        int diff = (int) Math.round(hpd * (double) values.length);
+        for (int i = 0; i <= (values.length - diff); i++) {
+            double minValue = values[indices[i]];
+            double maxValue = values[indices[i + diff - 1]];
+            double range = Math.abs(maxValue - minValue);
+            if (range < minRange) {
+                minRange = range;
+                hpdIndex = i;
+            }
+        }
+        double lower = values[indices[hpdIndex]];
+        double upper = values[indices[hpdIndex + diff - 1]];
+        node.setMetaData(label, new Object[]{lower, upper});
+    }
+
+    // todo Move rEngine to outer class; create once.
+//        Rengine rEngine = null;
+//
+//        private final String[] rArgs = {"--no-save"};
+//
+//
+//        private final String[] rBootCommands = {
+//                "library(MASS)",
+//                "makeContour = function(var1, var2, prob=0.95, n=50, h=c(1,1)) {" +
+//                        "post1 = kde2d(var1, var2, n = n, h=h); " +    // This had h=h in argument
+//                        "dx = diff(post1$x[1:2]); " +
+//                        "dy = diff(post1$y[1:2]); " +
+//                        "sz = sort(post1$z); " +
+//                        "c1 = cumsum(sz) * dx * dy; " +
+//                        "levels = sapply(prob, function(x) { approx(c1, sz, xout = 1 - x)$y }); " +
+//                        "line = contourLines(post1$x, post1$y, post1$z, level = levels); " +
+//                        "return(line) }"
+//        };
+//
+//        private String makeRString(double[] values) {
+//            StringBuffer sb = new StringBuffer("c(");
+//            sb.append(values[0]);
+//            for (int i = 1; i < values.length; i++) {
+//                sb.append(",");
+//                sb.append(values[i]);
+//            }
+//            sb.append(")");
+//            return sb.toString();
+//        }
+
+    public static final String CORDINATE = "cordinates";
+
+//		private String formattedLocation(double loc1, double loc2) {
+//			return formattedLocation(loc1) + "," + formattedLocation(loc2);
+//		}
+
+    private String formattedLocation(double x) {
+        return String.format("%5.2f", x);
+    }
+
+    private void annotate2DHPDAttribute(Node node, String preLabel, String postLabel,
+                                        double hpd, double[][] values) {
+        if (USE_R) {
+
+            // Uses R-Java interface, and the HPD routines from 'emdbook' and 'coda'
+
+//                int N = 50;
+//                if (rEngine == null) {
+//
+//                    if (!Rengine.versionCheck()) {
+//                        throw new RuntimeException("JRI library version mismatch");
+//                    }
+//
+//                    rEngine = new Rengine(rArgs, false, null);
+//
+//                    if (!rEngine.waitForR()) {
+//                        throw new RuntimeException("Cannot load R");
+//                    }
+//
+//                    for (String command : rBootCommands) {
+//                        rEngine.eval(command);
+//                    }
+//                }
+//
+//                // todo Need a good method to pick grid size
+//
+//
+//                REXP x = rEngine.eval("makeContour(" +
+//                        makeRString(values[0]) + "," +
+//                        makeRString(values[1]) + "," +
+//                        hpd + "," +
+//                        N + ")");
+//
+//                RVector contourList = x.asVector();
+//                int numberContours = contourList.size();
+//
+//                if (numberContours > 1) {
+//                    Log.err.println("Warning: a node has a disjoint " + 100 * hpd + "% HPD region.  This may be an artifact!");
+//                    Log.err.println("Try decreasing the enclosed mass or increasing the number of samples.");
+//                }
+//
+//
+//                node.setMetaData(preLabel + postLabel + "_modality", numberContours);
+//
+//                StringBuffer output = new StringBuffer();
+//                for (int i = 0; i < numberContours; i++) {
+//                    output.append("\n<" + CORDINATE + ">\n");
+//                    RVector oneContour = contourList.at(i).asVector();
+//                    double[] xList = oneContour.at(1).asDoubleArray();
+//                    double[] yList = oneContour.at(2).asDoubleArray();
+//                    StringBuffer xString = new StringBuffer("{");
+//                    StringBuffer yString = new StringBuffer("{");
+//                    for (int k = 0; k < xList.length; k++) {
+//                        xString.append(formattedLocation(xList[k])).append(",");
+//                        yString.append(formattedLocation(yList[k])).append(",");
+//                    }
+//                    xString.append(formattedLocation(xList[0])).append("}");
+//                    yString.append(formattedLocation(yList[0])).append("}");
+//
+//                    node.setMetaData(preLabel + "1" + postLabel + "_" + (i + 1), xString);
+//                    node.setMetaData(preLabel + "2" + postLabel + "_" + (i + 1), yString);
+//                }
+
+
+        } else { // do not use R
+
+
+//                KernelDensityEstimator2D kde = new KernelDensityEstimator2D(values[0], values[1], N);
+            //ContourMaker kde = new ContourWithSynder(values[0], values[1], N);
+            boolean bandwidthLimit = false;
+
+            ContourMaker kde = new ContourWithSynder(values[0], values[1], bandwidthLimit);
+
+            ContourPath[] paths = kde.getContourPaths(hpd);
+
+            node.setMetaData(preLabel + postLabel + "_modality", paths.length);
+
+            if (paths.length > 1) {
+                Log.err.println("Warning: a node has a disjoint " + 100 * hpd + "% HPD region.  This may be an artifact!");
+                Log.err.println("Try decreasing the enclosed mass or increasing the number of samples.");
+            }
+
+            StringBuffer output = new StringBuffer();
+            int i = 0;
+            for (ContourPath p : paths) {
+                output.append("\n<" + CORDINATE + ">\n");
+                double[] xList = p.getAllX();
+                double[] yList = p.getAllY();
+                StringBuffer xString = new StringBuffer("{");
+                StringBuffer yString = new StringBuffer("{");
+                for (int k = 0; k < xList.length; k++) {
+                    xString.append(formattedLocation(xList[k])).append(",");
+                    yString.append(formattedLocation(yList[k])).append(",");
+                }
+                xString.append(formattedLocation(xList[0])).append("}");
+                yString.append(formattedLocation(yList[0])).append("}");
+
+                node.setMetaData(preLabel + "1" + postLabel + "_" + (i + 1), xString);
+                node.setMetaData(preLabel + "2" + postLabel + "_" + (i + 1), yString);
+                i++;
+
+            }
+        }
+    }
+
+    int totalTrees = 0;
+    int totalTreesUsed = 0;
+    double posteriorLimit = 0.0;
+    double hpd2D = 0.80;
+
+    private final List<TreeAnnotationPlugin> plugins = new ArrayList<TreeAnnotationPlugin>();
+
+    Set<String> attributeNames = new HashSet<String>();
+    TaxonSet taxa = null;
+
+    static boolean processBivariateAttributes = false;
+
+//    static {
+//        try {
+//            System.loadLibrary("jri");
+//            processBivariateAttributes = true;
+//            Log.err.println("JRI loaded. Will process bivariate attributes");
+//        } catch (UnsatisfiedLinkError e) {
+//            Log.err.print("JRI not available. ");
+//            if (!USE_R) {
+//                processBivariateAttributes = true;
+//                Log.err.println("Using Java bivariate attributes");
+//            } else {
+//                Log.err.println("Will not process bivariate attributes");
+//            }
+//        }
+//    }
+
+    public static void printTitle() {
+        progressStream.println();
+        centreLine("TreeAnnotator " + version.getVersionString() + ", " + version.getDateString(), 60);
+        centreLine("MCMC Output analysis", 60);
+        centreLine("by", 60);
+        centreLine("Andrew Rambaut and Alexei J. Drummond", 60);
+        progressStream.println();
+        centreLine("Institute of Evolutionary Biology", 60);
+        centreLine("University of Edinburgh", 60);
+        centreLine("a.rambaut at ed.ac.uk", 60);
+        progressStream.println();
+        centreLine("Department of Computer Science", 60);
+        centreLine("University of Auckland", 60);
+        centreLine("alexei at cs.auckland.ac.nz", 60);
+        progressStream.println();
+        progressStream.println();
+    }
+
+    public static void centreLine(String line, int pageWidth) {
+        int n = pageWidth - line.length();
+        int n1 = n / 2;
+        for (int i = 0; i < n1; i++) {
+            progressStream.print(" ");
+        }
+        progressStream.println(line);
+    }
+
+
+    public static void printUsage(Arguments arguments) {
+
+        arguments.printUsage("treeannotator", "<input-file-name> [<output-file-name>]");
+        progressStream.println();
+        progressStream.println("  Example: treeannotator test.trees out.txt");
+        progressStream.println("  Example: treeannotator -burnin 10 -heights mean test.trees out.txt");
+        progressStream.println("  Example: treeannotator -burnin 20 -target map.tree test.trees out.txt");
+        progressStream.println();
+    }
+
+    //Main method
+    public static void main(String[] args) throws IOException {
+
+        // There is a major issue with languages that use the comma as a decimal separator.
+        // To ensure compatibility between programs in the package, enforce the US locale.
+        Locale.setDefault(Locale.US);
+
+        String targetTreeFileName = null;
+        String inputFileName = null;
+        String outputFileName = null;
+
+        if (args.length == 0) {
+            System.setProperty("com.apple.macos.useScreenMenuBar", "true");
+            System.setProperty("apple.laf.useScreenMenuBar", "true");
+            System.setProperty("apple.awt.showGrowBox", "true");
+
+            java.net.URL url = LogCombiner.class.getResource("/images/utility.png");
+            javax.swing.Icon icon = null;
+
+            if (url != null) {
+                icon = new javax.swing.ImageIcon(url);
+            }
+
+            final String versionString = version.getVersionString();
+            String nameString = "TreeAnnotator " + versionString;
+            String aboutString = "<html><center><p>" + versionString + ", " + version.getDateString() + "</p>" +
+                    "<p>by<br>" +
+                    "Andrew Rambaut and Alexei J. Drummond</p>" +
+                    "<p>Institute of Evolutionary Biology, University of Edinburgh<br>" +
+                    "<a href=\"mailto:a.rambaut at ed.ac.uk\">a.rambaut at ed.ac.uk</a></p>" +
+                    "<p>Department of Computer Science, University of Auckland<br>" +
+                    "<a href=\"mailto:alexei at cs.auckland.ac.nz\">alexei at cs.auckland.ac.nz</a></p>" +
+                    "<p>Part of the BEAST package:<br>" +
+                    "<a href=\"http://beast.bio.ed.ac.uk/\">http://beast.bio.ed.ac.uk/</a></p>" +
+                    "</center></html>";
+
+            new ConsoleApplication(nameString, aboutString, icon, true);
+
+            // The ConsoleApplication will have overridden System.out so set progressStream
+            // to capture the output to the window:
+            progressStream = System.out;
+
+            printTitle();
+
+            TreeAnnotatorDialog dialog = new TreeAnnotatorDialog(new JFrame());
+
+            if (!dialog.showDialog("TreeAnnotator " + versionString)) {
+                return;
+            }
+
+            int burninPercentage = dialog.getBurninPercentage();
+            double posteriorLimit = dialog.getPosteriorLimit();
+            double hpd2D = 0.80;
+            Target targetOption = dialog.getTargetOption();
+            HeightsSummary heightsOption = dialog.getHeightsOption();
+
+            targetTreeFileName = dialog.getTargetFileName();
+            if (targetOption == Target.USER_TARGET_TREE && targetTreeFileName == null) {
+                Log.err.println("No target file specified");
+                return;
+            }
+
+            inputFileName = dialog.getInputFileName();
+            if (inputFileName == null) {
+                Log.err.println("No input file specified");
+                return;
+            }
+
+            outputFileName = dialog.getOutputFileName();
+            if (outputFileName == null) {
+                Log.err.println("No output file specified");
+                return;
+            }
+        	boolean lowMem = dialog.useLowMem();
+
+            try {
+                new TreeAnnotator(burninPercentage,
+                		lowMem,
+                        heightsOption,
+                        posteriorLimit,
+                        hpd2D,
+                        targetOption,
+                        targetTreeFileName,
+                        inputFileName,
+                        outputFileName);
+
+            } catch (Exception ex) {
+                Log.err.println("Exception: " + ex.getMessage());
+            }
+
+            progressStream.println("Finished - Quit program to exit.");
+            while (true) {
+                try {
+                    Thread.sleep(1000);
+                } catch (InterruptedException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+
+        printTitle();
+
+        Arguments arguments = new Arguments(
+                new Arguments.Option[]{
+                        //new Arguments.StringOption("target", new String[] { "maxclade", "maxtree" }, false, "an option of 'maxclade' or 'maxtree'"),
+                        new Arguments.StringOption("heights", new String[]{"keep", "median", "mean", "ca"}, false,
+                                "an option of 'keep' (default), 'median', 'mean' or 'ca'"),
+                        new Arguments.IntegerOption("burnin", 0, 99, "the percentage of states to be considered as 'burn-in'"),
+                        // allow -b as burnin option, just like other apps
+                        new Arguments.IntegerOption("b", 0, 99, "the percentage of states to be considered as 'burn-in'"),
+                        new Arguments.RealOption("limit", "the minimum posterior probability for a node to be annotated"),
+                        new Arguments.StringOption("target", "target_file_name", "specifies a user target tree to be annotated"),
+                        new Arguments.Option("help", "option to print this message"),
+                        new Arguments.Option("forceDiscrete", "forces integer traits to be treated as discrete traits."),
+                        new Arguments.Option("lowMem", "use less memory, which is a bit slower."),
+                        new Arguments.RealOption("hpd2D", "the HPD interval to be used for the bivariate traits")
+                });
+
+        try {
+            arguments.parseArguments(args);
+        } catch (Arguments.ArgumentException ae) {
+            progressStream.println(ae);
+            printUsage(arguments);
+            System.exit(1);
+        }
+
+        if (arguments.hasOption("forceDiscrete")) {
+            Log.info.println("  Forcing integer traits to be treated as discrete traits.");
+            forceIntegerToDiscrete = true;
+        }
+
+        if (arguments.hasOption("help")) {
+            printUsage(arguments);
+            System.exit(0);
+        }
+        
+        boolean lowMem = false;
+        if (arguments.hasOption("lowMem")) {
+        	lowMem = true;
+        }
+
+        HeightsSummary heights = HeightsSummary.CA_HEIGHTS;
+        if (arguments.hasOption("heights")) {
+            String value = arguments.getStringOption("heights");
+            if (value.equalsIgnoreCase("mean")) {
+                heights = HeightsSummary.MEAN_HEIGHTS;
+            } else if (value.equalsIgnoreCase("median")) {
+                heights = HeightsSummary.MEDIAN_HEIGHTS;
+            } else if (value.equalsIgnoreCase("ca")) {
+                heights = HeightsSummary.CA_HEIGHTS;
+                Log.info.println("Please cite: Heled and Bouckaert: Looking for trees in the forest:\n" +
+                                        "summary tree from posterior samples. BMC Evolutionary Biology 2013 13:221.");
+            }
+        }
+
+        int burnin = -1;
+        if (arguments.hasOption("burnin")) {
+            burnin = arguments.getIntegerOption("burnin");
+        } else  if (arguments.hasOption("b")) {
+            burnin = arguments.getIntegerOption("b");        	
+        }
+        if (burnin >= 100) {
+        	Log.err.println("burnin is a percentage and should be less than 100.");
+        	System.exit(0);
+        }
+
+        double posteriorLimit = 0.0;
+        if (arguments.hasOption("limit")) {
+            posteriorLimit = arguments.getRealOption("limit");
+        }
+
+        double hpd2D = 0.80;
+        if (arguments.hasOption("hpd2D")) {
+            hpd2D = arguments.getRealOption("hpd2D");
+            if (hpd2D <= 0 || hpd2D >=1) {
+            	Log.err.println("hpd2D is a fraction and should be in between 0.0 and 1.0.");
+            	System.exit(0);            	
+            }
+            processBivariateAttributes = true;
+        }
+
+        Target target = Target.MAX_CLADE_CREDIBILITY;
+        if (arguments.hasOption("target")) {
+            target = Target.USER_TARGET_TREE;
+            targetTreeFileName = arguments.getStringOption("target");
+        }
+
+        final String[] args2 = arguments.getLeftoverArguments();
+
+        switch (args2.length) {
+            case 2:
+                outputFileName = args2[1];
+                // fall to
+            case 1:
+                inputFileName = args2[0];
+                break;
+            default: {
+                Log.err.println("Unknown option: " + args2[2]);
+                Log.err.println();
+                printUsage(arguments);
+                System.exit(1);
+            }
+        }
+        
+        try {
+        	new TreeAnnotator(burnin, lowMem, heights, posteriorLimit, hpd2D, target, targetTreeFileName, inputFileName, outputFileName);
+        } catch (IOException e) {
+        	throw e;
+        } catch (Exception e) {
+			e.printStackTrace();
+		}
+
+        System.exit(0);
+    }
+
+    /**
+     * @author Andrew Rambaut
+     * @version $Id$
+     */
+    //TODO code review: it seems not necessary
+    public static interface TreeAnnotationPlugin {
+        Set<String> setAttributeNames(Set<String> attributeNames);
+
+        boolean handleAttribute(Node node, String attributeName, double[] values);
+    }
+
+    boolean setTreeHeightsByCA(Tree targetTree)
+            throws Exception {
+        progressStream.println("Setting node heights...");
+        progressStream.println("0              25             50             75            100");
+        progressStream.println("|--------------|--------------|--------------|--------------|");
+
+        int reportStepSize = totalTrees / 60;
+        if (reportStepSize < 1) reportStepSize = 1;
+        int reported = 0;
+
+
+        // this call increments the clade counts and it shouldn't
+        // this is remedied with removeClades call after while loop below
+        CladeSystem cladeSystem = new CladeSystem(targetTree);
+        final int nClades = cladeSystem.getCladeMap().size();
+
+        // allocate posterior tree nodes order once
+        int[] postOrderList = new int[nClades];
+        BitSet[] ctarget = new BitSet[nClades];
+        BitSet[] ctree = new BitSet[nClades];
+
+        for (int k = 0; k < nClades; ++k) {
+            ctarget[k] = new BitSet();
+            ctree[k] = new BitSet();
+        }
+
+        cladeSystem.getTreeCladeCodes(targetTree, ctarget);
+
+        // temp collecting heights inside loop allocated once
+        double[] hs = new double[nClades];
+
+        // heights total sum from posterior trees
+        double[] ths = new double[nClades];
+
+        totalTreesUsed = 0;
+
+        int counter = 0;
+        treeSet.reset();
+        while (treeSet.hasNext()) {
+        	Tree tree = treeSet.next();
+            TreeUtils.preOrderTraversalList(tree, postOrderList);
+            cladeSystem.getTreeCladeCodes(tree, ctree);
+            for (int k = 0; k < nClades; ++k) {
+                int j = postOrderList[k];
+                for (int i = 0; i < nClades; ++i) {
+                    if( CollectionUtils.isSubSet(ctarget[i], ctree[j]) ) {
+                        hs[i] = tree.getNode(j).getHeight();
+                    }
+                }
+            }
+            for (int k = 0; k < nClades; ++k) {
+                ths[k] += hs[k];
+            }
+            totalTreesUsed += 1;
+            if (counter > 0 && counter % reportStepSize == 0 && reported < 61) {
+                progressStream.print("*");
+                progressStream.flush();
+                reported++;
+            }
+            counter++;
+
+        }
+        targetTree.initAndValidate();
+        cladeSystem.removeClades(targetTree.getRoot(), true);
+        for (int k = 0; k < nClades; ++k) {
+            ths[k] /= totalTreesUsed;
+            final Node node = targetTree.getNode(k);
+            node.setHeight(ths[k]);
+        }
+
+        progressStream.println();
+        progressStream.println();
+
+        return true;
+    }
+
+}
+
diff --git a/src/beast/app/treeannotator/TreeAnnotatorDialog.java b/src/beast/app/treeannotator/TreeAnnotatorDialog.java
new file mode 100644
index 0000000..783c304
--- /dev/null
+++ b/src/beast/app/treeannotator/TreeAnnotatorDialog.java
@@ -0,0 +1,241 @@
+/*
+ * TreeAnnotatorDialog.java
+ *
+ * Copyright (C) 2002-2006 Alexei Drummond and Andrew Rambaut
+ *
+ * This file is part of BEAST.
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership and licensing.
+ *
+ * BEAST 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
+ * of the License, or (at your option) any later version.
+ *
+ *  BEAST 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 BEAST; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+package beast.app.treeannotator;
+
+import beast.app.util.WholeNumberField;
+import jam.panels.OptionsPanel;
+
+import javax.swing.*;
+import javax.swing.border.Border;
+import javax.swing.border.EmptyBorder;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.io.File;
+
+public class TreeAnnotatorDialog {
+	private JFrame frame;
+
+	private OptionsPanel optionPanel;
+
+    private WholeNumberField burninText = new WholeNumberField(0, Integer.MAX_VALUE);
+	private RealNumberField limitText = new RealNumberField(0.0, 1.0);
+
+    private JComboBox summaryTreeCombo = new JComboBox(TreeAnnotator.Target.values());
+
+    private JComboBox nodeHeightsCombo = new JComboBox(TreeAnnotator.HeightsSummary.values());
+
+    private JCheckBox lowMemCheckbox = new JCheckBox();
+    
+	private File targetFile = null;
+	private File inputFile = null;
+	private File outputFile = null;
+
+	public TreeAnnotatorDialog(final JFrame frame) {
+		this.frame = frame;
+
+		optionPanel = new OptionsPanel(12, 12);
+
+		this.frame = frame;
+
+		JPanel panel = new JPanel(new BorderLayout());
+		panel.setOpaque(false);
+
+        burninText.setColumns(12);
+        burninText.setValue(0);
+        optionPanel.addComponentWithLabel("Burnin percentage: ", burninText);
+
+		limitText.setColumns(12);
+		limitText.setValue(0.0);
+		optionPanel.addComponentWithLabel("Posterior probability limit: ", limitText);
+
+        optionPanel.addComponentWithLabel("Target tree type: ", summaryTreeCombo);
+        optionPanel.addComponentWithLabel("Node heights: ", nodeHeightsCombo);
+
+        optionPanel.addSeparator();
+
+        final JButton targetFileButton = new JButton("Choose File...");
+		final JTextField targetFileNameText = new JTextField("not selected", 16);
+
+		targetFileButton.addActionListener( new ActionListener() {
+			public void actionPerformed(ActionEvent ae) {
+				FileDialog dialog = new FileDialog(frame,
+						"Select target file...",
+						FileDialog.LOAD);
+
+				dialog.setVisible(true);
+				if (dialog.getFile() == null) {
+					// the dialog was cancelled...
+					return;
+				}
+
+				targetFile = new File(dialog.getDirectory(), dialog.getFile());
+				targetFileNameText.setText(targetFile.getName());
+
+			}});
+		targetFileNameText.setEditable(false);
+
+		JPanel panel1 = new JPanel(new BorderLayout(0,0));
+		panel1.add(targetFileNameText, BorderLayout.CENTER);
+		panel1.add(targetFileButton, BorderLayout.EAST);
+		final JLabel label1 = optionPanel.addComponentWithLabel("Target Tree File: ", panel1);
+
+		JButton inputFileButton = new JButton("Choose File...");
+		final JTextField inputFileNameText = new JTextField("not selected", 16);
+
+		inputFileButton.addActionListener( new ActionListener() {
+			public void actionPerformed(ActionEvent ae) {
+				FileDialog dialog = new FileDialog(frame,
+						"Select input tree file...",
+						FileDialog.LOAD);
+
+				dialog.setVisible(true);
+				if (dialog.getFile() == null) {
+					// the dialog was cancelled...
+					return;
+				}
+
+				inputFile = new File(dialog.getDirectory(), dialog.getFile());
+				inputFileNameText.setText(inputFile.getName());
+
+			}});
+		inputFileNameText.setEditable(false);
+
+        label1.setEnabled(false);
+        targetFileNameText.setEnabled(false);
+        targetFileButton.setEnabled(false);
+
+        summaryTreeCombo.addItemListener(new ItemListener() {
+            public void itemStateChanged(ItemEvent itemEvent) {
+                boolean selected = summaryTreeCombo.getSelectedItem().toString().equals("User target tree");
+                label1.setEnabled(selected);
+                targetFileNameText.setEnabled(selected);
+                targetFileButton.setEnabled(selected);
+            }
+        });
+
+        JPanel panel2 = new JPanel(new BorderLayout(0,0));
+		panel2.add(inputFileNameText, BorderLayout.CENTER);
+		panel2.add(inputFileButton, BorderLayout.EAST);
+
+        Color focusColor = UIManager.getColor("Focus.color");
+        Border focusBorder = BorderFactory.createMatteBorder( 2, 2, 2, 2, focusColor );
+        new FileDrop( null, inputFileNameText, focusBorder, new FileDrop.Listener()
+        {   public void filesDropped( java.io.File[] files )
+            {
+                inputFile = files[0];
+                inputFileNameText.setText(inputFile.getName());
+            }   // end filesDropped
+        }); // end FileDrop.Listener
+
+        optionPanel.addComponentWithLabel("Input Tree File: ", panel2);
+
+		JButton outputFileButton = new JButton("Choose File...");
+		final JTextField outputFileNameText = new JTextField("not selected", 16);
+
+		outputFileButton.addActionListener( new ActionListener() {
+			public void actionPerformed(ActionEvent ae) {
+				FileDialog dialog = new FileDialog(frame,
+						"Select output file...",
+						FileDialog.SAVE);
+
+				dialog.setVisible(true);
+				if (dialog.getFile() == null) {
+					// the dialog was cancelled...
+					return;
+				}
+
+				outputFile = new File(dialog.getDirectory(), dialog.getFile());
+				outputFileNameText.setText(outputFile.getName());
+
+			}});
+		outputFileNameText.setEditable(false);
+
+		JPanel panel3 = new JPanel(new BorderLayout(0,0));
+		panel3.add(outputFileNameText, BorderLayout.CENTER);
+		panel3.add(outputFileButton, BorderLayout.EAST);
+		optionPanel.addComponentWithLabel("Output File: ", panel3);
+
+		optionPanel.addComponentWithLabel("Low memory: ", lowMemCheckbox);
+	}
+
+	public boolean showDialog(String title) {
+
+		JOptionPane optionPane = new JOptionPane(optionPanel,
+				JOptionPane.PLAIN_MESSAGE,
+				JOptionPane.OK_CANCEL_OPTION,
+				null,
+				new String[] { "Run", "Quit" },
+				null);
+		optionPane.setBorder(new EmptyBorder(12, 12, 12, 12));
+
+		final JDialog dialog = optionPane.createDialog(frame, title);
+		//dialog.setResizable(true);
+		dialog.pack();
+
+		dialog.setVisible(true);
+
+		return optionPane.getValue().equals("Run");
+	}
+
+    public int getBurninPercentage() {
+        return burninText.getValue();
+    }
+
+	public double getPosteriorLimit() {
+		return limitText.getValue();
+	}
+
+    public TreeAnnotator.Target getTargetOption() {
+        return (TreeAnnotator.Target)summaryTreeCombo.getSelectedItem();
+    }
+
+    public TreeAnnotator.HeightsSummary getHeightsOption() {
+        return (TreeAnnotator.HeightsSummary)nodeHeightsCombo.getSelectedItem();
+    }
+
+    public String getTargetFileName() {
+		if (targetFile == null) return null;
+		return targetFile.getPath();
+	}
+
+	public String getInputFileName() {
+		if (inputFile == null) return null;
+		return inputFile.getPath();
+	}
+
+	public String getOutputFileName() {
+		if (outputFile == null) return null;
+		return outputFile.getPath();
+	}
+
+	public boolean useLowMem() {
+		return lowMemCheckbox.isSelected();
+	}
+
+}
diff --git a/src/beast/app/treeannotator/TreeAnnotatorLauncher.java b/src/beast/app/treeannotator/TreeAnnotatorLauncher.java
new file mode 100644
index 0000000..6c1ff92
--- /dev/null
+++ b/src/beast/app/treeannotator/TreeAnnotatorLauncher.java
@@ -0,0 +1,22 @@
+package beast.app.treeannotator;
+
+
+import beast.app.beastapp.BeastLauncher;
+
+
+/**
+ * Loads beast.jar and launches TreeAnnotator 
+ * 
+ * This class should be compiled against 1.6 and packaged by itself. The
+ * remained of BEAST can be compiled against Java 1.7 or higher
+ * **/
+public class TreeAnnotatorLauncher extends BeastLauncher  {
+
+	public static void main(String[] args) throws Exception {
+		if (javaVersionCheck("TreeAnnotator")) {
+			loadBEASTJars();
+			TreeAnnotator.main(args);
+		}
+	}
+
+}
diff --git a/src/beast/app/treeannotator/TreeSetParser.java b/src/beast/app/treeannotator/TreeSetParser.java
new file mode 100644
index 0000000..ed62833
--- /dev/null
+++ b/src/beast/app/treeannotator/TreeSetParser.java
@@ -0,0 +1,618 @@
+/*
+
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+/*
+ * TreeFileParser.java
+ * Copyright Remco Bouckaert remco at cs.auckland.ac.nz (C) 2011 
+*/
+package beast.app.treeannotator;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Vector;
+
+import beast.evolution.tree.Node;
+
+public class TreeSetParser {
+	/**
+	 * default tree branch length, used when that info is not in the Newick tree
+	 **/
+	final static float DEFAULT_LENGTH = 0.001f;
+
+	int m_nOffset = 0;
+	/** labels of leafs **/
+	List<String> m_sLabels;
+	/** position information for the leafs (if available) **/
+	List<Float> m_fLongitude;
+	List<Float> m_fLatitude;
+	/** extreme values for position information **/
+	float m_fMaxLong, m_fMaxLat, m_fMinLong, m_fMinLat;
+	/** nr of labels in dataset **/
+	int m_nNrOfLabels;
+	/** burn in = nr of trees ignored at the start of tree file, can be set by command line option **/
+	int m_nBurnInPercentage = 0;
+	//DensiTree m_densiTree;
+	/** for memory saving, set to true **/
+	boolean m_bSurpressMetadata = true;
+	/** if there is no translate block. This solves issues where the taxa labels are numbers e.g. in generated tree data **/
+	boolean m_bIsLabelledNewick = false;
+	/** flag to indicate that single child nodes are allowed **/
+	boolean m_bAllowSingleChild = false;
+	
+	public TreeSetParser(int nBurnInPercentage, boolean bAllowSingleChild) {
+		m_sLabels = new ArrayList<String>();
+		m_fLongitude = new ArrayList<Float>();
+		m_fLatitude = new ArrayList<Float>();
+		m_nBurnInPercentage = Math.max(nBurnInPercentage, 0);
+		m_fMinLat = 90; m_fMinLong = 180;
+		m_fMaxLat = -90; m_fMaxLong = -180;
+		m_bAllowSingleChild = bAllowSingleChild;
+	} // c'tor
+	
+	public TreeSetParser(List<String> sLabels, List<Float> fLongitude, List<Float> fLatitude, int nBurnInPercentage) {
+		m_sLabels = sLabels;
+		if (m_sLabels != null) {
+			m_bIsLabelledNewick = true;
+			m_nNrOfLabels = m_sLabels.size();
+		}
+		m_fLongitude = fLongitude;
+		m_fLatitude = fLatitude;
+		m_nBurnInPercentage = Math.max(nBurnInPercentage, 0);
+		m_fMinLat = 90; m_fMinLong = 180;
+		m_fMaxLat = -90; m_fMaxLong = -180;
+	}
+	
+	long fileStep;
+	long fileRead = 0;
+	long fileMarked = 0;
+
+	
+	public Node [] parseFile(String sFile) throws Exception {
+		//List<String> sNewickTrees = new List<String>();
+		List<Node> trees = new ArrayList<Node>();
+		m_nOffset = 0;
+		// parse Newick tree file
+		File file = new File(sFile);
+		fileStep = Math.max(file.length() / 61, 1);
+		fileRead = 0;
+		fileMarked = 0;
+		
+		BufferedReader fin = new BufferedReader(new FileReader(sFile));
+		
+        int nrOfTrees = 0;
+        // first, sweep through the log file to determine the number of trees
+        while (fin.ready()) {
+            if (fin.readLine().toLowerCase().startsWith("tree ")) {
+            	nrOfTrees++;
+            }
+        }
+        fin.close();
+        
+        fin = new BufferedReader(new FileReader(sFile));
+		String sStr = readLine(fin);
+		// grab translate block
+		while (fin.ready() && sStr.toLowerCase().indexOf("translate") < 0) {
+			sStr = readLine(fin);
+		}
+		m_bIsLabelledNewick = false;
+		m_nNrOfLabels = m_sLabels.size();
+		boolean bAddLabels = (m_nNrOfLabels == 0);
+		if (sStr.toLowerCase().indexOf("translate") < 0) {
+			m_bIsLabelledNewick = true;
+			// could not find translate block, assume it is a list of Newick trees instead of Nexus file
+			fin.close();
+			fileRead = 0;
+			fileMarked = 0;
+			fin = new BufferedReader(new FileReader(sFile));
+			while (fin.ready() && m_nNrOfLabels == 0) {
+				sStr = readLine(fin);
+				fileRead += sStr.length();
+				if (sStr.length() > 2 && sStr.indexOf("(") >= 0) {
+					String sStr2 = sStr;
+					sStr2 = sStr2.substring(sStr2.indexOf("("));
+					while (sStr2.indexOf('[') >= 0) {
+						int i0 = sStr2.indexOf('[');
+						int i1 = sStr2.indexOf(']');
+						sStr2 = sStr2.substring(0, i0) + sStr2.substring(i1 + 1);
+					}
+					sStr2 = sStr2.replaceAll("[;\\(\\),]"," ");
+					sStr2 = sStr2.replaceAll(":[0-9\\.Ee-]+"," ");
+					String [] sLabels = sStr2.split("\\s+");
+					if (bAddLabels) {
+						m_nNrOfLabels = 0;
+						for (int i = 0; i < sLabels.length; i++) {
+							if (sLabels[i].length() > 0) {
+									m_sLabels.add(sLabels[i]);
+								m_nNrOfLabels++;
+							}
+						}
+					}
+					Node tree = parseNewick(sStr);
+					tree.sort();
+					tree.labelInternalNodes(m_nNrOfLabels);
+					trees.add(tree);
+//					sNewickTrees.add(sStr);
+				}
+			}
+
+			while (fin.ready()) {
+				sStr = readLine(fin);
+				if (sStr.length() > 2 && sStr.indexOf("(") >= 0) {
+					Node tree = parseNewick(sStr);
+					tree.sort();
+					tree.labelInternalNodes(m_nNrOfLabels);
+					trees.add(tree);
+					if (trees.size() % 100 ==0) {if (m_nNrOfLabels>=100||trees.size() % 1000 ==0) {System.err.print(trees.size() + " ");}}
+//					sNewickTrees.add(sStr);
+				}
+			}
+			
+		} else {
+			// read tree set from file, and store in individual strings
+			sStr = readLine(fin);
+			//m_nNrOfLabels = 0;
+			boolean bLastLabel = false;
+			while (fin.ready() && !bLastLabel) {
+				if (sStr.indexOf(";") >= 0) {
+					sStr = sStr.replace(';',' ');
+					sStr = sStr.trim();
+					if (sStr.isEmpty()) {
+						break;
+					}
+					bLastLabel = true;
+				}
+				sStr = sStr.replaceAll(",", "");
+				sStr = sStr.replaceAll("^\\s+", "");
+				String[] sStrs = sStr.split("\\s+");
+				int iLabel = new Integer(sStrs[0]).intValue();
+				String sLabel = sStrs[1];
+				if (m_sLabels.size() < iLabel) {
+					//m_sLabels.add("__dummy__");
+					m_nOffset = 1;
+				}
+				// check if there is geographic info in the name
+				if (sLabel.contains("(")) {
+					int iStr = sLabel.indexOf('(');
+					int iStr2 = sLabel.indexOf('x', iStr);
+					if (iStr2 >= 0) {
+						int iStr3 = sLabel.indexOf(')', iStr2);
+						if (iStr3 >= 0) {
+							float fLat = Float.parseFloat(sLabel.substring(iStr+1, iStr2));// + 180;
+							float fLong = Float.parseFloat(sLabel.substring(iStr2+1, iStr3));// + 360)%360;
+							if (fLat!=0 || fLong!=0) {
+								m_fMinLat = Math.min(m_fMinLat, fLat);
+								m_fMaxLat = Math.max(m_fMaxLat, fLat);
+								m_fMinLong = Math.min(m_fMinLong, fLong);
+								m_fMaxLong = Math.max(m_fMaxLong, fLong);
+							}
+							while (m_fLatitude.size() < m_sLabels.size()) {
+								m_fLatitude.add(0f);
+								m_fLongitude.add(0f);
+							}
+							m_fLatitude.add(fLat);
+							m_fLongitude.add(fLong);
+						}
+					}
+					sLabel = sLabel.substring(0, sLabel.indexOf("("));
+				}
+				if (bAddLabels) {
+					m_sLabels.add(sLabel);
+					m_nNrOfLabels++;
+				}
+				if (!bLastLabel) {
+					sStr = readLine(fin);
+				}
+			}
+			
+			// read trees
+			// read trees
+            int nBurnIn = m_nBurnInPercentage * nrOfTrees / 100;
+            //int k = 0;                    
+            while (fin.ready()) {
+                    sStr = readLine(fin);
+                    sStr = sStr.trim();
+                    if (sStr.length() > 5) {
+                            String sTree = sStr.substring(0,5);
+                            if (sTree.toLowerCase().startsWith("tree ")) {
+                                    //k++;
+                                    if (nBurnIn <= 0) {
+                                            int i = sStr.indexOf('(');
+                                            if (i > 0) {
+                                                    sStr = sStr.substring(i);
+                                            }
+                                            Node tree = parseNewick(sStr);
+                                            tree.sort();
+                                            tree.labelInternalNodes(m_nNrOfLabels);
+                                            trees.add(tree);
+                                            //if (trees.size() % 100 ==0) {if (m_nNrOfLabels>=100||trees.size() % 1000 ==0) {System.err.print(trees.size() + " ");}}
+                                    } else {
+                                            nBurnIn--;
+                                    }
+                            }
+                    }
+            }
+            fin.close();
+		}
+		
+		// discard burn-in percentage
+//		int burnIn = m_nBurnInPercentage * trees.size() / 100;
+//		for (int i = 0; i < burnIn; i++) {
+//			trees.remove(i);
+//		}
+		
+		
+		// convert lengths (stored as node heights) to heights
+		double fMaxHeight = 0;
+		double [] heights = new double[trees.size()];
+		for (int i = 0; i < trees.size(); i++) {
+			heights[i] = lengthToHeight(trees.get(i), 0);
+			fMaxHeight = Math.max(fMaxHeight, heights[i]);
+		}
+		for (int i = 0; i < trees.size(); i++) {
+			offsetHeight(trees.get(i), heights[i]);
+		}
+
+		System.err.println();
+		//System.err.println("Geo: " +m_fMinLong + "x" + m_fMinLat + " " + m_fMaxLong + "x" + m_fMaxLat);
+		return trees.toArray(new Node[1]);
+	} // parseFile
+
+	
+	int k = 0;
+	private String readLine(BufferedReader fin) throws IOException {
+		String s = fin.readLine();
+		fileRead += s.length();
+		if (fileRead > fileMarked - 10) {
+			System.err.print("*");
+			fileMarked += fileStep;
+			k++;
+		}
+//		System.err.println(fileRead + " " + fileMarked + " " + k);
+		return s;
+	}
+
+	/** move y-position of a tree with offset f **/
+	public void offsetHeight(Node node, double f) {
+		if (!node.isLeaf()) {
+			offsetHeight(node.getLeft(), f);
+			if (node.getRight() != null) {
+				offsetHeight(node.getRight(), f);
+			}
+		}
+		node.setHeight(node.getHeight() + f);
+	}
+
+	/** convert length to height
+	 *  and set ID of leafs
+	 */
+	private double lengthToHeight(Node node, double fOffSet) {
+		if (node.isLeaf()) {
+			node.setHeight(-fOffSet - node.getHeight());
+			node.setID(m_sLabels.get(node.getNr()));
+			return -node.getHeight();
+		} else {
+			double fPosY = fOffSet + node.getHeight();
+			double fYMax = 0;
+			fYMax = Math.max(fYMax, lengthToHeight(node.getLeft(), fPosY));
+			if (node.getRight() != null) {
+				fYMax = Math.max(fYMax, lengthToHeight(node.getRight(), fPosY));
+			}
+			node.setHeight(-fPosY);
+			return fYMax;
+		}
+	}
+
+	/** Try to map sStr into an index. First, assume it is a number.
+	 * If that does not work, look in list of labels to see whether it is there.
+	 */
+	private int getLabelIndex(String sStr) throws Exception {
+		if (!m_bIsLabelledNewick) {
+			try {
+				return Integer.parseInt(sStr) - m_nOffset;
+			} catch (Exception e) {
+			}
+		}
+		for (int i = 0; i < m_nNrOfLabels; i++) {
+			if (sStr.equals(m_sLabels.get(i))) {
+				return i;
+			}
+		}
+		// sStr may have (double) qoutes missing
+		for (int i = 0; i < m_nNrOfLabels; i++) {
+			String sLabel = m_sLabels.get(i);
+			if (sLabel.startsWith("'") && sLabel.endsWith("'") ||
+					sLabel.startsWith("\"") && sLabel.endsWith("\"")) {
+				sLabel = sLabel.substring(1, sLabel.length()-1);
+				if (sStr.equals(sLabel)) {
+					return i;
+				}
+			}
+		}
+		// sStr may have extra (double) qoutes
+		if (sStr.startsWith("'") && sStr.endsWith("'") ||
+				sStr.startsWith("\"") && sStr.endsWith("\"")) {
+			sStr = sStr.substring(1, sStr.length()-1);
+			return getLabelIndex(sStr);
+		}
+		throw new Exception("Label '" + sStr + "' in Newick tree could not be identified");
+	}
+	
+
+	 double height(Node node) {
+		 if (node.isLeaf()) {
+			 return node.getLength();
+		 } else {
+			 return node.getLength() + Math.max(height(node.getLeft()), height(node.getRight()));
+		 }
+	 }
+	 
+	 char [] m_chars;
+	 int m_iTokenStart;
+	 int m_iTokenEnd;
+	 final static int COMMA = 1;
+	 final static int BRACE_OPEN = 3;
+	 final static int BRACE_CLOSE = 4;
+	 final static int COLON = 5;
+	 final static int SEMI_COLON = 8;
+	 final static int META_DATA = 6;
+	 final static int TEXT = 7;
+	 final static int UNKNOWN = 0;
+	 
+	 int nextToken() {
+		 m_iTokenStart = m_iTokenEnd;
+		 while (m_iTokenEnd < m_chars.length) {
+			 // skip spaces
+			 while (m_iTokenEnd < m_chars.length && (m_chars[m_iTokenEnd] == ' ' || m_chars[m_iTokenEnd] == '\t')) {
+				 m_iTokenStart++;
+				 m_iTokenEnd++;
+			 }
+			 if (m_chars[m_iTokenEnd] == '(') {
+				 m_iTokenEnd++;
+				 return BRACE_OPEN;
+			 }
+			 if (m_chars[m_iTokenEnd] == ':') {
+				 m_iTokenEnd++;
+				 return COLON;
+			 }
+			 if (m_chars[m_iTokenEnd] == ';') {
+				 m_iTokenEnd++;
+				 return SEMI_COLON;
+			 }
+			 if (m_chars[m_iTokenEnd] == ')') {
+				 m_iTokenEnd++;
+				 return BRACE_CLOSE;
+			 }
+			 if (m_chars[m_iTokenEnd] == ',') {
+				 m_iTokenEnd++;
+				 return COMMA;
+			 }
+			 if (m_chars[m_iTokenEnd] == '[') {
+				 m_iTokenEnd++;
+				 while (m_iTokenEnd < m_chars.length && m_chars[m_iTokenEnd-1] != ']') {
+					 m_iTokenEnd++;
+				 }
+				 return META_DATA;
+			 }
+			 while (m_iTokenEnd < m_chars.length && (m_chars[m_iTokenEnd] != ' ' && m_chars[m_iTokenEnd] != '\t'
+				 && m_chars[m_iTokenEnd] != '('  && m_chars[m_iTokenEnd] != ')'  && m_chars[m_iTokenEnd] != '['
+					 && m_chars[m_iTokenEnd] != ':'&& m_chars[m_iTokenEnd] != ','&& m_chars[m_iTokenEnd] != ';')) {
+				 m_iTokenEnd++;
+			 }
+			 return TEXT;
+		 }
+		 return UNKNOWN;
+	 }
+
+	 public Node parseNewick(String sStr) throws Exception {
+		 try {
+		if (sStr == null || sStr.length() == 0) {
+			return null;
+		}
+		
+		m_chars = sStr.toCharArray();
+		m_iTokenStart = sStr.indexOf('(');
+		if (m_iTokenStart < 0) {
+			return null;
+		}
+		m_iTokenEnd = m_iTokenStart;
+		Vector<Node> stack = new Vector<Node>();
+		Vector<Boolean> isFirstChild =  new Vector<Boolean>();
+		Vector<String> sMetaData =  new Vector<String>();
+		stack.add(new Node());
+		isFirstChild.add(true);
+		stack.lastElement().setHeight(DEFAULT_LENGTH);
+		sMetaData.add(null);
+		boolean bIsLabel = true;
+		while (m_iTokenEnd < m_chars.length) {
+			switch (nextToken()) {
+			case BRACE_OPEN:
+			{
+				Node node2 = new Node();
+				node2.setHeight(DEFAULT_LENGTH);
+				stack.add(node2);
+				isFirstChild.add(true);
+				sMetaData.add(null);
+				bIsLabel = true;
+			}
+				break;
+			case BRACE_CLOSE:
+			{
+				if (isFirstChild.lastElement()) {
+					if (m_bAllowSingleChild) {
+						// process single child nodes
+						Node left = stack.lastElement();
+						stack.remove(stack.size()-1);
+						isFirstChild.remove(isFirstChild.size()-1);
+						Node dummyparent = new Node();
+						dummyparent.setHeight(DEFAULT_LENGTH);
+						dummyparent.setLeft(left);
+						left.setParent(dummyparent);
+						dummyparent.setRight(null);
+						Node parent = stack.lastElement();
+						parent.setLeft(left);
+						left.setParent(parent);
+						String metaData = sMetaData.remove(sMetaData.size() - 1);
+						left.metaDataString = metaData;
+						parseMetaData(left, metaData);
+						break;
+					} else {
+						// don't know how to process single child nodes
+						throw new Exception("Node with single child found.");
+					}
+				}
+				// process multi(i.e. more than 2)-child nodes by pairwise merging.
+				while (isFirstChild.elementAt(isFirstChild.size()-2) == false) {
+					Node right = stack.lastElement();
+					stack.remove(stack.size()-1);
+					isFirstChild.remove(isFirstChild.size()-1);
+					Node left = stack.lastElement();
+					stack.remove(stack.size()-1);
+					isFirstChild.remove(isFirstChild.size()-1);
+					Node dummyparent = new Node();
+					dummyparent.setHeight(DEFAULT_LENGTH);
+					dummyparent.setLeft(left);
+					left.setParent (dummyparent);
+					dummyparent.setRight(right);
+					right.setParent(dummyparent);
+					stack.add(dummyparent);
+					isFirstChild.add(false);
+					String metaData = sMetaData.remove(sMetaData.size() - 1);
+					parseMetaData(left, metaData);
+				}
+				// last two nodes on stack merged into single parent node 
+				Node right = stack.lastElement();
+				stack.remove(stack.size()-1);
+				isFirstChild.remove(isFirstChild.size()-1);
+				String metaData = sMetaData.remove(sMetaData.size() - 1);
+				parseMetaData(right, metaData);
+
+				Node left = stack.lastElement();
+				stack.remove(stack.size()-1);
+				isFirstChild.remove(isFirstChild.size()-1);
+				metaData = sMetaData.remove(sMetaData.size() - 1);
+				parseMetaData(left, metaData);
+
+				Node parent = stack.lastElement();
+				parent.setLeft(left);
+				left.setParent(parent);
+				parent.setRight(right);
+				right.setParent(parent);
+				metaData = sMetaData.lastElement();
+				parseMetaData(parent, metaData);
+			}
+				break;
+			case COMMA:
+			{
+				Node node2 = new Node();
+				node2.setHeight(DEFAULT_LENGTH);
+				stack.add(node2);
+				isFirstChild.add(false);
+				sMetaData.add(null);
+				bIsLabel = true;
+			}
+				break;
+			case COLON:
+				bIsLabel = false;
+				break;
+			case TEXT:
+				if (bIsLabel) {
+					String sLabel = sStr.substring(m_iTokenStart, m_iTokenEnd);
+					stack.lastElement().setNr(getLabelIndex(sLabel)); 
+				} else {
+					String sLength = sStr.substring(m_iTokenStart, m_iTokenEnd);
+					stack.lastElement().setHeight(Float.parseFloat(sLength)); 
+				}
+				break;
+			case META_DATA:
+				if (sMetaData.lastElement() == null) {
+					sMetaData.set(sMetaData.size()-1, sStr.substring(m_iTokenStart+1, m_iTokenEnd-1));
+				} else {
+					sMetaData.set(sMetaData.size()-1, sMetaData.lastElement() 
+					 + ("," +sStr.substring(m_iTokenStart+1, m_iTokenEnd-1)));
+				}
+				break;
+			case SEMI_COLON:
+				//System.err.println(stack.lastElement().toString());
+				parseMetaData(stack.lastElement(), sMetaData.lastElement());
+				return stack.lastElement();
+			default:
+				throw new Exception("parseNewick: unknown token");	
+			}
+		}
+		return stack.lastElement();
+		 } catch (Exception e) {
+			 e.printStackTrace();
+			 throw new Exception(e.getMessage() + ": " + sStr.substring(Math.max(0, m_iTokenStart-100), m_iTokenStart) + " >>>" + sStr.substring(m_iTokenStart, m_iTokenEnd) + " <<< ..."); 
+		 }
+		//return node;
+	 }
+	 
+	 
+		public void parseMetaData(Node node, String sMetaData) {
+			node.metaDataString = sMetaData;
+			if (sMetaData == null) {
+				return;
+			}
+			// parse by key=value pairs
+			int i = 0;
+			int start = 1;
+			try {
+				while ((i = sMetaData.indexOf('=', i)) >= 0) {
+					String key = sMetaData.substring(start, i).trim();
+					String value = null;
+					int k = 0;
+					if ((k = sMetaData.indexOf('=', i+1)) >= 0) {
+						int j = sMetaData.lastIndexOf(',', k);
+						value = sMetaData.substring(i + 1, j);
+						start = j + 1;
+					} else {
+						value = sMetaData.substring(i+1);
+					}
+					if (value.length() > 0 && value.charAt(0) != '{') {
+						try {
+							Double dvalue = Double.parseDouble(value);
+							node.setMetaData(key, dvalue);
+							
+						} catch (Exception e) {
+							node.setMetaData(key, value);
+						}
+					} else 	if (value.length() > 0 && value.charAt(0) == '{' && value.charAt(value.length() - 1) == '}') {
+						try {
+							String str = value.substring(1, value.length() - 1); 
+							String [] strs = str.split(",");
+							Double [] values = new Double[strs.length];
+							for (int j = 0; j < strs.length; j++) {
+								values[j] = Double.parseDouble(strs[j]); 
+							}
+							node.setMetaData(key, values);
+						} catch (Exception e) {
+							node.setMetaData(key, value);
+						}
+					} else {
+						node.setMetaData(key, value);
+					}
+					i++;
+				}
+			} catch (Exception e) {
+				// TODO: handle exception
+			}
+		}
+
+} // class TreeFileParser
diff --git a/src/beast/app/util/Arguments.java b/src/beast/app/util/Arguments.java
new file mode 100644
index 0000000..095a3c2
--- /dev/null
+++ b/src/beast/app/util/Arguments.java
@@ -0,0 +1,611 @@
+package beast.app.util;
+
+import java.util.StringTokenizer;
+
+/**
+ * @author Andrew Rambaut
+ */
+public class Arguments {
+
+    public static final String ARGUMENT_CHARACTER = "-";
+
+    public static class ArgumentException extends Exception {
+        /**
+         *
+         */
+        public ArgumentException() {
+            super();
+        }
+
+        public ArgumentException(String message) {
+            super(message);
+        }
+    }
+
+    public static class Option {
+
+        public Option(String label, String description) {
+            this.label = label;
+            this.description = description;
+        }
+
+        String label;
+        String description;
+        boolean isAvailable = false;
+    }
+
+    public static class StringOption extends Option {
+        /**
+         * @param label       Option name:
+         * @param tag         Descriptive name of option argument.
+         *                    Example - tag "file-name" will show '-save <file-name>' in the usage.
+         * @param description
+         */
+        public StringOption(String label, String tag, String description) {
+            super(label, description);
+            this.tag = tag;
+        }
+
+        public StringOption(String label, String[] options, boolean caseSensitive, String description) {
+            super(label, description);
+            this.options = options;
+            this.caseSensitive = caseSensitive;
+        }
+
+        String[] options = null;
+        String tag = null;
+        boolean caseSensitive = false;
+
+        String value = null;
+    }
+    
+    public static class IntegerOption extends Option {
+
+        public IntegerOption(String label, String description) {
+            super(label, description);
+        }
+
+        public IntegerOption(String label, int minValue, int maxValue, String description) {
+            super(label, description);
+            this.minValue = minValue;
+            this.maxValue = maxValue;
+        }
+
+        int minValue = Integer.MIN_VALUE;
+        int maxValue = Integer.MAX_VALUE;
+
+        int value = 0;
+    }
+
+    public static class IntegerArrayOption extends IntegerOption {
+
+        public IntegerArrayOption(String label, String description) {
+            this(label, 0, Integer.MIN_VALUE, Integer.MAX_VALUE, description);
+        }
+
+        public IntegerArrayOption(String label, int count, String description) {
+            this(label, count, Integer.MIN_VALUE, Integer.MAX_VALUE, description);
+        }
+
+        public IntegerArrayOption(String label, int minValue, int maxValue, String description) {
+            this(label, 0, minValue, maxValue, description);
+        }
+
+        public IntegerArrayOption(String label, int count, int minValue, int maxValue, String description) {
+            super(label, minValue, maxValue, description);
+            this.count = count;
+        }
+
+        int count;
+
+        int[] values = null;
+    }
+
+    public static class LongOption extends Option {
+
+        public LongOption(String label, String description) {
+            super(label, description);
+        }
+
+        public LongOption(String label, long minValue, long maxValue, String description) {
+            super(label, description);
+            this.minValue = minValue;
+            this.maxValue = maxValue;
+        }
+
+        long minValue = Long.MIN_VALUE;
+        long maxValue = Long.MAX_VALUE;
+
+        long value = 0;
+    }
+
+    public static class RealOption extends Option {
+
+        public RealOption(String label, String description) {
+            super(label, description);
+        }
+
+        public RealOption(String label, double minValue, double maxValue, String description) {
+            super(label, description);
+            this.minValue = minValue;
+            this.maxValue = maxValue;
+        }
+
+        double minValue = Double.NEGATIVE_INFINITY;
+        double maxValue = Double.POSITIVE_INFINITY;
+
+        double value = 0;
+    }
+
+    public static class RealArrayOption extends RealOption {
+
+        //        public RealArrayOption(String label, String description) {
+//            this(label, 0, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, description);
+//        }
+        // A count of -1 means any length
+        public RealArrayOption(String label, int count, String description) {
+            this(label, count, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, description);
+        }
+
+//        public RealArrayOption(String label, double minValue, double maxValue, String description) {
+//            this(label, 0, minValue, maxValue, description);
+//        }
+
+        public RealArrayOption(String label, int count, double minValue, double maxValue, String description) {
+            super(label, minValue, maxValue, description);
+            this.count = count;
+        }
+
+        private int count;
+
+        double[] values = null;
+    }
+
+    /**
+     * Parse a list of arguments ready for accessing
+     */
+    public Arguments(Option[] options) {
+        this.options = options;
+    }
+
+    public Arguments(Option[] options, boolean caseSensitive) {
+        this.options = options;
+        this.caseSensitive = caseSensitive;
+    }
+
+    /**
+     * Parse a list of arguments ready for accessing
+     */
+    public void parseArguments(String[] arguments) throws ArgumentException {
+
+        int[] optionIndex = new int[arguments.length];
+        for (int i = 0; i < optionIndex.length; i++) {
+            optionIndex[i] = -1;
+        }
+
+        for (int i = 0; i < options.length; i++) {
+            Option option = options[i];
+
+            int index = findArgument(arguments, option.label);
+            if (index != -1) {
+
+                if (optionIndex[index] != -1) {
+                    throw new ArgumentException("Argument, " + arguments[index] + " overlaps with another argument");
+                }
+
+                // the first value may be appended to the option label (e.g., '-t1.0'):
+                String arg = arguments[index].substring(option.label.length() + 1);
+                optionIndex[index] = i;
+                option.isAvailable = true;
+
+                if (option instanceof IntegerArrayOption) {
+
+                    IntegerArrayOption o = (IntegerArrayOption) option;
+                    o.values = new int[o.count];
+                    int k = index;
+                    int j = 0;
+
+                    while (j < o.count) {
+                        if (arg.length() > 0) {
+                            StringTokenizer tokenizer = new StringTokenizer(arg, ",\t ");
+                            while (tokenizer.hasMoreTokens()) {
+                                String token = tokenizer.nextToken();
+                                if (token.length() > 0) {
+                                    try {
+                                        o.values[j] = Integer.parseInt(token);
+                                    } catch (NumberFormatException nfe) {
+                                        throw new ArgumentException("Argument, " + arguments[index] +
+                                                " has a bad integer value: " + token);
+                                    }
+                                    if (o.values[j] > o.maxValue || o.values[j] < o.minValue) {
+                                        throw new ArgumentException("Argument, " + arguments[index] +
+                                                " has a bad integer value: " + token);
+                                    }
+                                    j++;
+                                }
+                            }
+                        }
+
+                        k++;
+
+                        if (j < o.count) {
+                            if (k >= arguments.length) {
+                                throw new ArgumentException("Argument, " + arguments[index] +
+                                        " is missing one or more values: expecting " + o.count + " integers");
+                            }
+
+                            if (optionIndex[k] != -1) {
+                                throw new ArgumentException("Argument, " + arguments[index] + " overlaps with another argument");
+                            }
+
+                            arg = arguments[k];
+                            optionIndex[k] = i;
+                        }
+                    }
+                } else if (option instanceof IntegerOption) {
+
+                    IntegerOption o = (IntegerOption) option;
+                    if (arg.length() == 0) {
+                        int k = index + 1;
+                        if (k >= arguments.length) {
+                            throw new ArgumentException("Argument, " + arguments[index] +
+                                    " is missing its value: expecting an integer");
+                        }
+
+                        if (optionIndex[k] != -1) {
+                            throw new ArgumentException("Argument, " + arguments[index] + " overlaps with another argument");
+                        }
+                        arg = arguments[k];
+                        optionIndex[k] = i;
+                    }
+
+                    try {
+                        o.value = Integer.parseInt(arg);
+                    } catch (NumberFormatException nfe) {
+                        throw new ArgumentException("Argument, " + arguments[index] +
+                                " has a bad integer value: " + arg);
+                    }
+                    if (o.value > o.maxValue || o.value < o.minValue) {
+                        throw new ArgumentException("Argument, " + arguments[index] +
+                                " has a bad integer value: " + arg);
+                    }
+                } else if (option instanceof LongOption) {
+
+                    LongOption o = (LongOption) option;
+                    if (arg.length() == 0) {
+                        int k = index + 1;
+                        if (k >= arguments.length) {
+                            throw new ArgumentException("Argument, " + arguments[index] +
+                                    " is missing its value: expecting a long integer");
+                        }
+
+                        if (optionIndex[k] != -1) {
+                            throw new ArgumentException("Argument, " + arguments[index] + " overlaps with another argument");
+                        }
+                        arg = arguments[k];
+                        optionIndex[k] = i;
+                    }
+
+                    try {
+                        o.value = Long.parseLong(arg);
+                    } catch (NumberFormatException nfe) {
+                        throw new ArgumentException("Argument, " + arguments[index] +
+                                " has a bad integer value: " + arg);
+                    }
+                    if (o.value > o.maxValue || o.value < o.minValue) {
+                        throw new ArgumentException("Argument, " + arguments[index] +
+                                " has a bad long integer value: " + arg);
+                    }
+                } else if (option instanceof RealArrayOption) {
+                    // I fixed only the real case to handle a variable sized array
+                    // I don't have the time to figure out the right way, so I duplicated some code so
+                    // that I do not break code by mistake
+                    RealArrayOption o = (RealArrayOption) option;
+                    if (o.count >= 0) {
+                        final int count = o.count;
+                        o.values = new double[count];
+                        int k = index;
+                        int j = 0;
+
+                        while (j < count) {
+                            if (arg.length() > 0) {
+                                StringTokenizer tokenizer = new StringTokenizer(arg, ",\t ");
+                                while (tokenizer.hasMoreTokens()) {
+                                    String token = tokenizer.nextToken();
+                                    if (token.length() > 0) {
+                                        try {
+                                            o.values[j] = Double.parseDouble(token);
+                                        } catch (NumberFormatException nfe) {
+                                            throw new ArgumentException("Argument, " + arguments[index] +
+                                                    " has a bad real value: " + token);
+                                        }
+                                        if (o.values[j] > o.maxValue || o.values[j] < o.minValue) {
+                                            throw new ArgumentException("Argument, " + arguments[index] +
+                                                    " has a bad real value: " + token);
+                                        }
+                                        j++;
+                                    }
+                                }
+                            }
+
+                            k++;
+
+                            if (j < count) {
+                                if (k >= arguments.length) {
+                                    throw new ArgumentException("Argument, " + arguments[index] +
+                                            " is missing one or more values: expecting " + count + " integers");
+                                }
+
+                                if (optionIndex[k] != -1) {
+                                    throw new ArgumentException("Argument, " + arguments[index] + " overlaps with another argument");
+                                }
+
+                                arg = arguments[k];
+                                optionIndex[k] = i;
+                            }
+                        }
+                    } else {
+
+                        double[] values = new double[100];
+                        index += 1;
+                        arg = arguments[index];
+                        optionIndex[index] = i;
+
+                        int j = 0;
+
+                        if (arg.length() > 0) {
+                            StringTokenizer tokenizer = new StringTokenizer(arg, ",\t ");
+                            while (tokenizer.hasMoreTokens()) {
+                                String token = tokenizer.nextToken();
+                                if (token.length() > 0) {
+                                    try {
+                                        values[j] = Double.parseDouble(token);
+                                    } catch (NumberFormatException nfe) {
+                                        throw new ArgumentException("Argument, " + arguments[index] +
+                                                " has a bad real value: " + token);
+                                    }
+                                    if (values[j] > o.maxValue || values[j] < o.minValue) {
+                                        throw new ArgumentException("Argument, " + arguments[index] +
+                                                " has a bad real value: " + token);
+                                    }
+                                    j++;
+                                }
+                            }
+                        }
+                        o.values = new double[j];
+                        System.arraycopy(values, 0, o.values, 0, j);
+                    }
+                } else if (option instanceof RealOption) {
+
+                    RealOption o = (RealOption) option;
+                    if (arg.length() == 0) {
+                        int k = index + 1;
+                        if (k >= arguments.length) {
+                            throw new ArgumentException("Argument, " + arguments[index] +
+                                    " is missing its value: expecting a real number");
+                        }
+
+                        if (optionIndex[k] != -1) {
+                            throw new ArgumentException("Argument, " + arguments[index] + " overlaps with another argument");
+                        }
+                        arg = arguments[k];
+                        optionIndex[k] = i;
+                    }
+
+                    try {
+                        o.value = Double.parseDouble(arg);
+                    } catch (NumberFormatException nfe) {
+                        throw new ArgumentException("Argument, " + arguments[index] +
+                                " has a bad real value: " + arg);
+                    }
+                    if (o.value > o.maxValue || o.value < o.minValue) {
+                        throw new ArgumentException("Argument, " + arguments[index] +
+                                " has a bad real value: " + arg);
+                    }
+                } else if (option instanceof StringOption) {
+
+                    StringOption o = (StringOption) option;
+                    if (arg.length() == 0) {
+                        int k = index + 1;
+                        if (k >= arguments.length) {
+                            throw new ArgumentException("Argument, " + arguments[index] +
+                                    " is missing its value: expecting a string");
+                        }
+
+                        if (optionIndex[k] != -1) {
+                            throw new ArgumentException("Argument, " + arguments[index] + " overlaps with another argument");
+                        }
+                        arg = arguments[k];
+                        optionIndex[k] = i;
+                    }
+
+                    o.value = arg;
+
+                    if (o.options != null) {
+                        boolean found = false;
+                        for (String option1 : o.options) {
+                            if ((!caseSensitive && option1.equalsIgnoreCase(o.value)) || option1.equals(o.value)) {
+                                found = true;
+                                break;
+                            }
+                        }
+                        if (!found) {
+                            throw new ArgumentException("Argument, " + arguments[index] +
+                                    " has a bad string value: " + arg);
+                        }
+                    }
+                } else { // is simply an Option - nothing to do...
+                }
+            }
+        }
+
+        int n = 0;
+        int i = arguments.length - 1;
+        while (i >= 0 && optionIndex[i] == -1 && !arguments[i].startsWith(ARGUMENT_CHARACTER)) {
+            n++;
+            i--;
+        }
+        leftoverArguments = new String[n];
+        for (i = 0; i < n; i++) {
+            leftoverArguments[i] = arguments[arguments.length - n + i];
+        }
+
+        for (i = 0; i < arguments.length - n; i++) {
+            if (optionIndex[i] == -1) {
+                throw new ArgumentException("Unrecognized argument: " + arguments[i]);
+            }
+        }
+
+    }
+
+    private int findArgument(String[] arguments, String label) {
+        for (int i = 0; i < arguments.length; i++) {
+
+            if (arguments[i].length() - 1 >= label.length()) {
+                if (arguments[i].startsWith(ARGUMENT_CHARACTER)) {
+//					String l = arguments[i].substring(1, label.length() + 1);
+//                                                String l = arguments[i];
+                    String l = arguments[i].substring(1, arguments[i].length());
+                    if ((!caseSensitive && label.equalsIgnoreCase(l)) || label.equals(l)) {
+                        return i;
+                    }
+
+                }
+            }
+        }
+        return -1;
+    }
+
+    /**
+     * Does an argument with label exist?
+     */
+    public boolean hasOption(String label) {
+        int n = findOption(label);
+        if (n == -1) {
+            return false;
+        }
+
+        return options[n].isAvailable;
+    }
+
+    /**
+     * Return the value of an integer option
+     */
+    public int getIntegerOption(String label) {
+        IntegerOption o = (IntegerOption) options[findOption(label)];
+        return o.value;
+    }
+
+    /**
+     * Return the value of an integer array option
+     */
+    public int[] getIntegerArrayOption(String label) {
+        IntegerArrayOption o = (IntegerArrayOption) options[findOption(label)];
+        return o.values;
+    }
+
+    /**
+     * Return the value of an integer option
+     */
+    public long getLongOption(String label) {
+        LongOption o = (LongOption) options[findOption(label)];
+        return o.value;
+    }
+
+    /**
+     * Return the value of an real number option
+     */
+    public double getRealOption(String label) {
+        RealOption o = (RealOption) options[findOption(label)];
+        return o.value;
+    }
+
+    /**
+     * Return the value of an real array option
+     */
+    public double[] getRealArrayOption(String label) {
+        RealArrayOption o = (RealArrayOption) options[findOption(label)];
+        return o.values;
+    }
+
+    /**
+     * Return the value of an string option
+     */
+    public String getStringOption(String label) {
+        StringOption o = (StringOption) options[findOption(label)];
+        return o.value;
+    }
+
+    /**
+     * Return any arguments leftover after the options
+     */
+    public String[] getLeftoverArguments() {
+        return leftoverArguments;
+    }
+
+    public void printUsage(String name, String commandLine) {
+
+        System.out.print("  Usage: " + name);
+        for (Option option : options) {
+            System.out.print(" [-" + option.label);
+
+            if (option instanceof IntegerArrayOption) {
+
+                IntegerArrayOption o = (IntegerArrayOption) option;
+                for (int j = 1; j <= o.count; j++) {
+                    System.out.print(" <i" + j + ">");
+                }
+                System.out.print("]");
+            } else if (option instanceof IntegerOption) {
+
+                System.out.print(" <i>]");
+            } else if (option instanceof RealArrayOption) {
+
+                RealArrayOption o = (RealArrayOption) option;
+                for (int j = 1; j <= o.count; j++) {
+                    System.out.print(" <r" + j + ">");
+                }
+                System.out.print("]");
+            } else if (option instanceof RealOption) {
+
+                System.out.print(" <r>]");
+            } else if (option instanceof StringOption) {
+
+                StringOption o = (StringOption) option;
+                if (o.options != null) {
+                    System.out.print(" <" + o.options[0]);
+                    for (int j = 1; j < o.options.length; j++) {
+                        System.out.print("|" + o.options[j]);
+                    }
+                    System.out.print(">]");
+                } else {
+                    System.out.print(" <" + o.tag + ">]");
+                }
+            } else {
+                System.out.print("]");
+            }
+        }
+        System.out.println(" " + commandLine);
+
+        for (Option option : options) {
+            System.out.println("    -" + option.label + " " + option.description);
+        }
+    }
+
+    private int findOption(String label) {
+        for (int i = 0; i < options.length; i++) {
+            String l = options[i].label;
+            if ((!caseSensitive && label.equalsIgnoreCase(l)) || label.equals(l)) {
+                return i;
+            }
+        }
+        return -1;
+    }
+
+    private Option[] options = null;
+
+    private String[] leftoverArguments = null;
+
+    private boolean caseSensitive = false;
+}
+
diff --git a/src/beast/app/util/ErrorLogHandler.java b/src/beast/app/util/ErrorLogHandler.java
new file mode 100644
index 0000000..053432c
--- /dev/null
+++ b/src/beast/app/util/ErrorLogHandler.java
@@ -0,0 +1,71 @@
+package beast.app.util;
+
+import java.util.logging.Formatter;
+import java.util.logging.Level;
+import java.util.logging.LogRecord;
+import java.util.logging.StreamHandler;
+
+public class ErrorLogHandler extends StreamHandler {
+
+    public ErrorLogHandler(int maxErrorCount) {
+        setOutputStream(System.err);
+        setFormatter(new MessageLogFormatter());
+
+        this.maxErrorCount = maxErrorCount;
+    }
+
+
+    public void publish(LogRecord record) {
+        super.publish(record);
+        flush();
+
+        if (record.getLevel() == Level.SEVERE) {
+            errorCount++;
+
+            if (errorCount > maxErrorCount) {
+                if (errorCount > 1) {
+                    throw new RuntimeException("ErrorLog: Maximum number of errors (" + (maxErrorCount + 1) + ") reached. Terminating BEAST");
+                } else {
+                    throw new RuntimeException("An error was encounted. Terminating BEAST");
+                }
+            }
+        }
+    }
+
+    public void close() {
+        flush();
+    }
+
+    public int getErrorCount() {
+        return errorCount;
+    }
+
+    private class MessageLogFormatter extends Formatter {
+
+        // Line separator string.  This is the value of the line.separator
+        // property at the moment that the SimpleFormatter was created.
+        private final String lineSeparator = System.getProperty("line.separator");
+
+        // AR - is there a reason why this was used? It causes warnings at compile
+//        private final String lineSeparator = (String) java.security.AccessController.doPrivileged(
+//                new sun.security.action.GetPropertyAction("line.separator"));
+
+        /**
+         * Format the given LogRecord.
+         *
+         * @param record the log record to be formatted.
+         * @return a formatted log record
+         */
+        public synchronized String format(LogRecord record) {
+            StringBuffer sb = new StringBuffer();
+            String message = formatMessage(record);
+            sb.append(message);
+            sb.append(lineSeparator);
+            return sb.toString();
+        }
+    }
+
+
+    private final int maxErrorCount;
+    private int errorCount = 0;
+}
\ No newline at end of file
diff --git a/src/beast/app/util/FileDrop.java b/src/beast/app/util/FileDrop.java
new file mode 100644
index 0000000..2641656
--- /dev/null
+++ b/src/beast/app/util/FileDrop.java
@@ -0,0 +1,895 @@
+package beast.app.util;
+
+import java.awt.datatransfer.DataFlavor;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.io.Reader;
+
+/**
+ * This class makes it easy to drag and drop files from the operating
+ * system to a Java program. Any <tt>java.awt.Component</tt> can be
+ * dropped onto, but only <tt>javax.swing.JComponent</tt>s will indicate
+ * the drop event with a changed border.
+ * <p/>
+ * To use this class, construct a new <tt>FileDrop</tt> by passing
+ * it the target component and a <tt>Listener</tt> to receive notification
+ * when file(s) have been dropped. Here is an example:
+ * <p/>
+ * <code><pre>
+ *      JPanel myPanel = new JPanel();
+ *      new FileDrop( myPanel, new FileDrop.Listener()
+ *      {   public void filesDropped( java.io.File[] files )
+ *          {
+ *              // handle file drop
+ *              ...
+ *          }   // end filesDropped
+ *      }); // end FileDrop.Listener
+ * </pre></code>
+ * <p/>
+ * You can specify the border that will appear when files are being dragged by
+ * calling the constructor with a <tt>javax.swing.border.Border</tt>. Only
+ * <tt>JComponent</tt>s will show any indication with a border.
+ * <p/>
+ * You can turn on some debugging features by passing a <tt>PrintStream</tt>
+ * object (such as <tt>System.out</tt>) into the full constructor. A <tt>null</tt>
+ * value will result in no extra debugging information being output.
+ * <p/>
+ * <p/>
+ * <p>I'm releasing this code into the Public Domain. Enjoy.
+ * </p>
+ * <p><em>Original author: Robert Harder, rharder at usa.net</em></p>
+ * <p>2007-09-12 Nathan Blomquist -- Linux (KDE/Gnome) support added.</p>
+ *
+ * @author Robert Harder
+ * @author rharder at users.sf.net
+ * @version 1.0.1
+ */
+public class FileDrop {
+    private transient javax.swing.border.Border normalBorder;
+    private transient java.awt.dnd.DropTargetListener dropListener;
+
+
+    /**
+     * Discover if the running JVM is modern enough to have drag and drop.
+     */
+    private static Boolean supportsDnD;
+
+    // Default border color
+    private static java.awt.Color defaultBorderColor = new java.awt.Color(0f, 0f, 1f, 0.25f);
+
+    /**
+     * Constructs a {@link FileDrop} with a default light-blue border
+     * and, if <var>c</var> is a {@link java.awt.Container}, recursively
+     * sets all elements contained within as drop targets, though only
+     * the top level container will change borders.
+     *
+     * @param c        Component on which files will be dropped.
+     * @param listener Listens for <tt>filesDropped</tt>.
+     * @since 1.0
+     */
+    public FileDrop(
+            final java.awt.Component c,
+            final Listener listener) {
+        this(null,  // Logging stream
+                c,     // Drop target
+                javax.swing.BorderFactory.createMatteBorder(2, 2, 2, 2, defaultBorderColor), // Drag border
+                true, // Recursive
+                listener);
+    }   // end constructor
+
+
+    /**
+     * Constructor with a default border and the option to recursively set drop targets.
+     * If your component is a <tt>java.awt.Container</tt>, then each of its children
+     * components will also listen for drops, though only the parent will change borders.
+     *
+     * @param c         Component on which files will be dropped.
+     * @param recursive Recursively set children as drop targets.
+     * @param listener  Listens for <tt>filesDropped</tt>.
+     * @since 1.0
+     */
+    public FileDrop(
+            final java.awt.Component c,
+            final boolean recursive,
+            final Listener listener) {
+        this(null,  // Logging stream
+                c,     // Drop target
+                javax.swing.BorderFactory.createMatteBorder(2, 2, 2, 2, defaultBorderColor), // Drag border
+                recursive, // Recursive
+                listener);
+    }   // end constructor
+
+
+    /**
+     * Constructor with a default border and debugging optionally turned on.
+     * With Debugging turned on, more status messages will be displayed to
+     * <tt>out</tt>. A common way to use this constructor is with
+     * <tt>System.out</tt> or <tt>System.err</tt>. A <tt>null</tt> value for
+     * the parameter <tt>out</tt> will result in no debugging output.
+     *
+     * @param out      PrintStream to record debugging info or null for no debugging.
+     * @param out
+     * @param c        Component on which files will be dropped.
+     * @param listener Listens for <tt>filesDropped</tt>.
+     * @since 1.0
+     */
+    public FileDrop(
+            final java.io.PrintStream out,
+            final java.awt.Component c,
+            final Listener listener) {
+        this(out,  // Logging stream
+                c,    // Drop target
+                javax.swing.BorderFactory.createMatteBorder(2, 2, 2, 2, defaultBorderColor),
+                false, // Recursive
+                listener);
+    }   // end constructor
+
+
+    /**
+     * Constructor with a default border, debugging optionally turned on
+     * and the option to recursively set drop targets.
+     * If your component is a <tt>java.awt.Container</tt>, then each of its children
+     * components will also listen for drops, though only the parent will change borders.
+     * With Debugging turned on, more status messages will be displayed to
+     * <tt>out</tt>. A common way to use this constructor is with
+     * <tt>System.out</tt> or <tt>System.err</tt>. A <tt>null</tt> value for
+     * the parameter <tt>out</tt> will result in no debugging output.
+     *
+     * @param out       PrintStream to record debugging info or null for no debugging.
+     * @param out
+     * @param c         Component on which files will be dropped.
+     * @param recursive Recursively set children as drop targets.
+     * @param listener  Listens for <tt>filesDropped</tt>.
+     * @since 1.0
+     */
+    public FileDrop(
+            final java.io.PrintStream out,
+            final java.awt.Component c,
+            final boolean recursive,
+            final Listener listener) {
+        this(out,  // Logging stream
+                c,    // Drop target
+                javax.swing.BorderFactory.createMatteBorder(2, 2, 2, 2, defaultBorderColor), // Drag border
+                recursive, // Recursive
+                listener);
+    }   // end constructor
+
+
+    /**
+     * Constructor with a specified border
+     *
+     * @param c          Component on which files will be dropped.
+     * @param dragBorder Border to use on <tt>JComponent</tt> when dragging occurs.
+     * @param listener   Listens for <tt>filesDropped</tt>.
+     * @since 1.0
+     */
+    public FileDrop(
+            final java.awt.Component c,
+            final javax.swing.border.Border dragBorder,
+            final Listener listener) {
+        this(
+                null,   // Logging stream
+                c,      // Drop target
+                dragBorder, // Drag border
+                false,  // Recursive
+                listener);
+    }   // end constructor
+
+
+    /**
+     * Constructor with a specified border and the option to recursively set drop targets.
+     * If your component is a <tt>java.awt.Container</tt>, then each of its children
+     * components will also listen for drops, though only the parent will change borders.
+     *
+     * @param c          Component on which files will be dropped.
+     * @param dragBorder Border to use on <tt>JComponent</tt> when dragging occurs.
+     * @param recursive  Recursively set children as drop targets.
+     * @param listener   Listens for <tt>filesDropped</tt>.
+     * @since 1.0
+     */
+    public FileDrop(
+            final java.awt.Component c,
+            final javax.swing.border.Border dragBorder,
+            final boolean recursive,
+            final Listener listener) {
+        this(
+                null,
+                c,
+                dragBorder,
+                recursive,
+                listener);
+    }   // end constructor
+
+
+    /**
+     * Constructor with a specified border and debugging optionally turned on.
+     * With Debugging turned on, more status messages will be displayed to
+     * <tt>out</tt>. A common way to use this constructor is with
+     * <tt>System.out</tt> or <tt>System.err</tt>. A <tt>null</tt> value for
+     * the parameter <tt>out</tt> will result in no debugging output.
+     *
+     * @param out        PrintStream to record debugging info or null for no debugging.
+     * @param c          Component on which files will be dropped.
+     * @param dragBorder Border to use on <tt>JComponent</tt> when dragging occurs.
+     * @param listener   Listens for <tt>filesDropped</tt>.
+     * @since 1.0
+     */
+    public FileDrop(
+            final java.io.PrintStream out,
+            final java.awt.Component c,
+            final javax.swing.border.Border dragBorder,
+            final Listener listener) {
+        this(
+                out,    // Logging stream
+                c,      // Drop target
+                dragBorder, // Drag border
+                false,  // Recursive
+                listener);
+    }   // end constructor
+
+
+    /**
+     * Full constructor with a specified border and debugging optionally turned on.
+     * With Debugging turned on, more status messages will be displayed to
+     * <tt>out</tt>. A common way to use this constructor is with
+     * <tt>System.out</tt> or <tt>System.err</tt>. A <tt>null</tt> value for
+     * the parameter <tt>out</tt> will result in no debugging output.
+     *
+     * @param out        PrintStream to record debugging info or null for no debugging.
+     * @param c          Component on which files will be dropped.
+     * @param dragBorder Border to use on <tt>JComponent</tt> when dragging occurs.
+     * @param recursive  Recursively set children as drop targets.
+     * @param listener   Listens for <tt>filesDropped</tt>.
+     * @since 1.0
+     */
+    public FileDrop(
+            final java.io.PrintStream out,
+            final java.awt.Component c,
+            final javax.swing.border.Border dragBorder,
+            final boolean recursive,
+            final Listener listener) {
+
+        if (supportsDnD()) {   // Make a drop listener
+            dropListener = new java.awt.dnd.DropTargetListener() {
+                public void dragEnter(java.awt.dnd.DropTargetDragEvent evt) {
+                    log(out, "FileDrop: dragEnter event.");
+
+                    // Is this an acceptable drag event?
+                    if (isDragOk(out, evt)) {
+                        // If it's a Swing component, set its border
+                        if (c instanceof javax.swing.JComponent) {
+                            javax.swing.JComponent jc = (javax.swing.JComponent) c;
+                            normalBorder = jc.getBorder();
+                            log(out, "FileDrop: normal border saved.");
+                            jc.setBorder(dragBorder);
+                            log(out, "FileDrop: drag border set.");
+                        }   // end if: JComponent
+
+                        // Acknowledge that it's okay to enter
+                        //evt.acceptDrag( java.awt.dnd.DnDConstants.ACTION_COPY_OR_MOVE );
+                        evt.acceptDrag(java.awt.dnd.DnDConstants.ACTION_COPY);
+                        log(out, "FileDrop: event accepted.");
+                    }   // end if: drag ok
+                    else {   // Reject the drag event
+                        evt.rejectDrag();
+                        log(out, "FileDrop: event rejected.");
+                    }   // end else: drag not ok
+                }   // end dragEnter
+
+                public void dragOver(java.awt.dnd.DropTargetDragEvent evt) {   // This is called continually as long as the mouse is
+                    // over the drag target.
+                }   // end dragOver
+
+                public void drop(java.awt.dnd.DropTargetDropEvent evt) {
+                    log(out, "FileDrop: drop event.");
+                    try {   // Get whatever was dropped
+                        java.awt.datatransfer.Transferable tr = evt.getTransferable();
+
+                        // Is it a file list?
+                        if (tr.isDataFlavorSupported(java.awt.datatransfer.DataFlavor.javaFileListFlavor)) {
+                            // Say we'll take it.
+                            //evt.acceptDrop ( java.awt.dnd.DnDConstants.ACTION_COPY_OR_MOVE );
+                            evt.acceptDrop(java.awt.dnd.DnDConstants.ACTION_COPY);
+                            log(out, "FileDrop: file list accepted.");
+
+                            // Get a useful list
+                            java.util.List fileList = (java.util.List)
+                                    tr.getTransferData(java.awt.datatransfer.DataFlavor.javaFileListFlavor);
+                            java.util.Iterator iterator = fileList.iterator();
+
+                            // Convert list to array
+                            java.io.File[] filesTemp = new java.io.File[fileList.size()];
+                            fileList.toArray(filesTemp);
+                            final java.io.File[] files = filesTemp;
+
+                            // Alert listener to drop.
+                            if (listener != null)
+                                listener.filesDropped(files);
+
+                            // Mark that drop is completed.
+                            evt.getDropTargetContext().dropComplete(true);
+                            log(out, "FileDrop: drop complete.");
+                        }   // end if: file list
+                        else // this section will check for a reader flavor.
+                        {
+                            // Thanks, Nathan!
+                            // BEGIN 2007-09-12 Nathan Blomquist -- Linux (KDE/Gnome) support added.
+                            DataFlavor[] flavors = tr.getTransferDataFlavors();
+                            boolean handled = false;
+                            for (int zz = 0; zz < flavors.length; zz++) {
+                                if (flavors[zz].isRepresentationClassReader()) {
+                                    // Say we'll take it.
+                                    //evt.acceptDrop ( java.awt.dnd.DnDConstants.ACTION_COPY_OR_MOVE );
+                                    evt.acceptDrop(java.awt.dnd.DnDConstants.ACTION_COPY);
+                                    log(out, "FileDrop: reader accepted.");
+
+                                    Reader reader = flavors[zz].getReaderForText(tr);
+
+                                    BufferedReader br = new BufferedReader(reader);
+
+                                    if (listener != null)
+                                        listener.filesDropped(createFileArray(br, out));
+
+                                    // Mark that drop is completed.
+                                    evt.getDropTargetContext().dropComplete(true);
+                                    log(out, "FileDrop: drop complete.");
+                                    handled = true;
+                                    break;
+                                }
+                            }
+                            if (!handled) {
+                                log(out, "FileDrop: not a file list or reader - abort.");
+                                evt.rejectDrop();
+                            }
+                            // END 2007-09-12 Nathan Blomquist -- Linux (KDE/Gnome) support added.
+                        }   // end else: not a file list
+                    }   // end try
+                    catch (java.io.IOException io) {
+                        log(out, "FileDrop: IOException - abort:");
+                        io.printStackTrace(out);
+                        evt.rejectDrop();
+                    }   // end catch IOException
+                    catch (java.awt.datatransfer.UnsupportedFlavorException ufe) {
+                        log(out, "FileDrop: UnsupportedFlavorException - abort:");
+                        ufe.printStackTrace(out);
+                        evt.rejectDrop();
+                    }   // end catch: UnsupportedFlavorException
+                    finally {
+                        // If it's a Swing component, reset its border
+                        if (c instanceof javax.swing.JComponent) {
+                            javax.swing.JComponent jc = (javax.swing.JComponent) c;
+                            jc.setBorder(normalBorder);
+                            log(out, "FileDrop: normal border restored.");
+                        }   // end if: JComponent
+                    }   // end finally
+                }   // end drop
+
+                public void dragExit(java.awt.dnd.DropTargetEvent evt) {
+                    log(out, "FileDrop: dragExit event.");
+                    // If it's a Swing component, reset its border
+                    if (c instanceof javax.swing.JComponent) {
+                        javax.swing.JComponent jc = (javax.swing.JComponent) c;
+                        jc.setBorder(normalBorder);
+                        log(out, "FileDrop: normal border restored.");
+                    }   // end if: JComponent
+                }   // end dragExit
+
+                public void dropActionChanged(java.awt.dnd.DropTargetDragEvent evt) {
+                    log(out, "FileDrop: dropActionChanged event.");
+                    // Is this an acceptable drag event?
+                    if (isDragOk(out, evt)) {   //evt.acceptDrag( java.awt.dnd.DnDConstants.ACTION_COPY_OR_MOVE );
+                        evt.acceptDrag(java.awt.dnd.DnDConstants.ACTION_COPY);
+                        log(out, "FileDrop: event accepted.");
+                    }   // end if: drag ok
+                    else {
+                        evt.rejectDrag();
+                        log(out, "FileDrop: event rejected.");
+                    }   // end else: drag not ok
+                }   // end dropActionChanged
+            }; // end DropTargetListener
+
+            // Make the component (and possibly children) drop targets
+            makeDropTarget(out, c, recursive);
+        }   // end if: supports dnd
+        else {
+            log(out, "FileDrop: Drag and drop is not supported with this JVM");
+        }   // end else: does not support DnD
+    }   // end constructor
+
+
+    private static boolean supportsDnD() {   // Static Boolean
+        if (supportsDnD == null) {
+            boolean support = false;
+            try {
+                Class arbitraryDndClass = Class.forName("java.awt.dnd.DnDConstants");
+                support = true;
+            }   // end try
+            catch (Exception e) {
+                support = false;
+            }   // end catch
+            supportsDnD = new Boolean(support);
+        }   // end if: first time through
+        return supportsDnD.booleanValue();
+    }   // end supportsDnD
+
+
+    // BEGIN 2007-09-12 Nathan Blomquist -- Linux (KDE/Gnome) support added.
+    private static String ZERO_CHAR_STRING = "" + (char) 0;
+
+    private static File[] createFileArray(BufferedReader bReader, PrintStream out) {
+        try {
+            java.util.List list = new java.util.ArrayList();
+            java.lang.String line = null;
+            while ((line = bReader.readLine()) != null) {
+                try {
+                    // kde seems to append a 0 char to the end of the reader
+                    if (ZERO_CHAR_STRING.equals(line)) continue;
+
+                    java.io.File file = new java.io.File(new java.net.URI(line));
+                    list.add(file);
+                } catch (Exception ex) {
+                    log(out, "Error with " + line + ": " + ex.getMessage());
+                }
+            }
+
+            return (java.io.File[]) list.toArray(new File[list.size()]);
+        } catch (IOException ex) {
+            log(out, "FileDrop: IOException");
+        }
+        return new File[0];
+    }
+    // END 2007-09-12 Nathan Blomquist -- Linux (KDE/Gnome) support added.
+
+
+    private void makeDropTarget(final java.io.PrintStream out, final java.awt.Component c, boolean recursive) {
+        // Make drop target
+        final java.awt.dnd.DropTarget dt = new java.awt.dnd.DropTarget();
+        try {
+            dt.addDropTargetListener(dropListener);
+        }   // end try
+        catch (java.util.TooManyListenersException e) {
+            e.printStackTrace();
+            log(out, "FileDrop: Drop will not work due to previous error. Do you have another listener attached?");
+        }   // end catch
+
+        // Listen for hierarchy changes and remove the drop target when the parent gets cleared out.
+        c.addHierarchyListener(new java.awt.event.HierarchyListener() {
+            public void hierarchyChanged(java.awt.event.HierarchyEvent evt) {
+                log(out, "FileDrop: Hierarchy changed.");
+                java.awt.Component parent = c.getParent();
+                if (parent == null) {
+                    c.setDropTarget(null);
+                    log(out, "FileDrop: Drop target cleared from component.");
+                }   // end if: null parent
+                else {
+                    new java.awt.dnd.DropTarget(c, dropListener);
+                    log(out, "FileDrop: Drop target added to component.");
+                }   // end else: parent not null
+            }   // end hierarchyChanged
+        }); // end hierarchy listener
+        if (c.getParent() != null)
+            new java.awt.dnd.DropTarget(c, dropListener);
+
+        if (recursive && (c instanceof java.awt.Container)) {
+            // Get the container
+            java.awt.Container cont = (java.awt.Container) c;
+
+            // Get it's components
+            java.awt.Component[] comps = cont.getComponents();
+
+            // Set it's components as listeners also
+            for (int i = 0; i < comps.length; i++)
+                makeDropTarget(out, comps[i], recursive);
+        }   // end if: recursively set components as listener
+    }   // end dropListener
+
+
+    /**
+     * Determine if the dragged data is a file list.
+     */
+    private boolean isDragOk(final java.io.PrintStream out, final java.awt.dnd.DropTargetDragEvent evt) {
+        boolean ok = false;
+
+        // Get data flavors being dragged
+        java.awt.datatransfer.DataFlavor[] flavors = evt.getCurrentDataFlavors();
+
+        // See if any of the flavors are a file list
+        int i = 0;
+        while (!ok && i < flavors.length) {
+            // BEGIN 2007-09-12 Nathan Blomquist -- Linux (KDE/Gnome) support added.
+            // Is the flavor a file list?
+            final DataFlavor curFlavor = flavors[i];
+            if (curFlavor.equals(java.awt.datatransfer.DataFlavor.javaFileListFlavor) ||
+                    curFlavor.isRepresentationClassReader()) {
+                ok = true;
+            }
+            // END 2007-09-12 Nathan Blomquist -- Linux (KDE/Gnome) support added.
+            i++;
+        }   // end while: through flavors
+
+        // If logging is enabled, show data flavors
+        if (out != null) {
+            if (flavors.length == 0)
+                log(out, "FileDrop: no data flavors.");
+            for (i = 0; i < flavors.length; i++)
+                log(out, flavors[i].toString());
+        }   // end if: logging enabled
+
+        return ok;
+    }   // end isDragOk
+
+
+    /**
+     * Outputs <tt>message</tt> to <tt>out</tt> if it's not null.
+     */
+    private static void log(java.io.PrintStream out, String message) {   // Log message if requested
+        if (out != null)
+            out.println(message);
+    }   // end log
+
+
+    /**
+     * Removes the drag-and-drop hooks from the component and optionally
+     * from the all children. You should call this if you add and remove
+     * components after you've set up the drag-and-drop.
+     * This will recursively unregister all components contained within
+     * <var>c</var> if <var>c</var> is a {@link java.awt.Container}.
+     *
+     * @param c The component to unregister as a drop target
+     * @since 1.0
+     */
+    public static boolean remove(java.awt.Component c) {
+        return remove(null, c, true);
+    }   // end remove
+
+
+    /**
+     * Removes the drag-and-drop hooks from the component and optionally
+     * from the all children. You should call this if you add and remove
+     * components after you've set up the drag-and-drop.
+     *
+     * @param out       Optional {@link java.io.PrintStream} for logging drag and drop messages
+     * @param c         The component to unregister
+     * @param recursive Recursively unregister components within a container
+     * @since 1.0
+     */
+    public static boolean remove(java.io.PrintStream out, java.awt.Component c, boolean recursive) {   // Make sure we support dnd.
+        if (supportsDnD()) {
+            log(out, "FileDrop: Removing drag-and-drop hooks.");
+            c.setDropTarget(null);
+            if (recursive && (c instanceof java.awt.Container)) {
+                java.awt.Component[] comps = ((java.awt.Container) c).getComponents();
+                for (int i = 0; i < comps.length; i++)
+                    remove(out, comps[i], recursive);
+                return true;
+            }   // end if: recursive
+            else return false;
+        }   // end if: supports DnD
+        else return false;
+    }   // end remove
+
+
+/* ********  I N N E R   I N T E R F A C E   L I S T E N E R  ******** */
+
+
+    /**
+     * Implement this inner interface to listen for when files are dropped. For example
+     * your class declaration may begin like this:
+     * <code><pre>
+     *      public class MyClass implements FileDrop.Listener
+     *      ...
+     *      public void filesDropped( java.io.File[] files )
+     *      {
+     *          ...
+     *      }   // end filesDropped
+     *      ...
+     * </pre></code>
+     *
+     * @since 1.1
+     */
+    public static interface Listener {
+
+        /**
+         * This method is called when files have been successfully dropped.
+         *
+         * @param files An array of <tt>File</tt>s that were dropped.
+         * @since 1.0
+         */
+        public abstract void filesDropped(java.io.File[] files);
+
+
+    }   // end inner-interface Listener
+
+
+/* ********  I N N E R   C L A S S  ******** */
+
+
+    /**
+     * This is the event that is passed to the
+     * {@link FileDropListener#filesDropped filesDropped(...)} method in
+     * your {@link FileDropListener} when files are dropped onto
+     * a registered drop target.
+     * <p/>
+     * <p>I'm releasing this code into the Public Domain. Enjoy.</p>
+     *
+     * @author Robert Harder
+     * @author rob at iharder.net
+     * @version 1.2
+     */
+    public static class Event extends java.util.EventObject {
+
+        private java.io.File[] files;
+
+        /**
+         * Constructs an {@link Event} with the array
+         * of files that were dropped and the
+         * {@link FileDrop} that initiated the event.
+         *
+         * @param files The array of files that were dropped
+         * @source The event source
+         * @since 1.1
+         */
+        public Event(java.io.File[] files, Object source) {
+            super(source);
+            this.files = files;
+        }   // end constructor
+
+        /**
+         * Returns an array of files that were dropped on a
+         * registered drop target.
+         *
+         * @return array of files that were dropped
+         * @since 1.1
+         */
+        public java.io.File[] getFiles() {
+            return files;
+        }   // end getFiles
+
+    }   // end inner class Event
+
+
+/* ********  I N N E R   C L A S S  ******** */
+
+
+    /**
+     * At last an easy way to encapsulate your custom objects for dragging and dropping
+     * in your Java programs!
+     * When you need to create a {@link java.awt.datatransfer.Transferable} object,
+     * use this class to wrap your object.
+     * For example:
+     * <pre><code>
+     *      ...
+     *      MyCoolClass myObj = new MyCoolClass();
+     *      Transferable xfer = new TransferableObject( myObj );
+     *      ...
+     * </code></pre>
+     * Or if you need to know when the data was actually dropped, like when you're
+     * moving data out of a list, say, you can use the {@link TransferableObject.Fetcher}
+     * inner class to return your object Just in Time.
+     * For example:
+     * <pre><code>
+     *      ...
+     *      final MyCoolClass myObj = new MyCoolClass();
+     * <p/>
+     *      TransferableObject.Fetcher fetcher = new TransferableObject.Fetcher()
+     *      {   public Object getObject(){ return myObj; }
+     *      }; // end fetcher
+     * <p/>
+     *      Transferable xfer = new TransferableObject( fetcher );
+     *      ...
+     * </code></pre>
+     * <p/>
+     * The {@link java.awt.datatransfer.DataFlavor} associated with
+     * {@link TransferableObject} has the representation class
+     * <tt>net.iharder.dnd.TransferableObject.class</tt> and MIME type
+     * <tt>application/x-net.iharder.dnd.TransferableObject</tt>.
+     * This data flavor is accessible via the static
+     * {@link #DATA_FLAVOR} property.
+     * <p/>
+     * <p/>
+     * <p>I'm releasing this code into the Public Domain. Enjoy.</p>
+     *
+     * @author Robert Harder
+     * @author rob at iharder.net
+     * @version 1.2
+     */
+    public static class TransferableObject implements java.awt.datatransfer.Transferable {
+        /**
+         * The MIME type for {@link #DATA_FLAVOR} is
+         * <tt>application/x-net.iharder.dnd.TransferableObject</tt>.
+         *
+         * @since 1.1
+         */
+        public final static String MIME_TYPE = "application/x-net.iharder.dnd.TransferableObject";
+
+
+        /**
+         * The default {@link java.awt.datatransfer.DataFlavor} for
+         * {@link TransferableObject} has the representation class
+         * <tt>net.iharder.dnd.TransferableObject.class</tt>
+         * and the MIME type
+         * <tt>application/x-net.iharder.dnd.TransferableObject</tt>.
+         *
+         * @since 1.1
+         */
+        public final static java.awt.datatransfer.DataFlavor DATA_FLAVOR =
+                new java.awt.datatransfer.DataFlavor(FileDrop.TransferableObject.class, MIME_TYPE);
+
+
+        private Fetcher fetcher;
+        private Object data;
+
+        private java.awt.datatransfer.DataFlavor customFlavor;
+
+
+        /**
+         * Creates a new {@link TransferableObject} that wraps <var>data</var>.
+         * Along with the {@link #DATA_FLAVOR} associated with this class,
+         * this creates a custom data flavor with a representation class
+         * determined from <code>data.getClass()</code> and the MIME type
+         * <tt>application/x-net.iharder.dnd.TransferableObject</tt>.
+         *
+         * @param data The data to transfer
+         * @since 1.1
+         */
+        public TransferableObject(Object data) {
+            this.data = data;
+            this.customFlavor = new java.awt.datatransfer.DataFlavor(data.getClass(), MIME_TYPE);
+        }   // end constructor
+
+
+        /**
+         * Creates a new {@link TransferableObject} that will return the
+         * object that is returned by <var>fetcher</var>.
+         * No custom data flavor is set other than the default
+         * {@link #DATA_FLAVOR}.
+         *
+         * @param fetcher The {@link Fetcher} that will return the data object
+         * @see Fetcher
+         * @since 1.1
+         */
+        public TransferableObject(Fetcher fetcher) {
+            this.fetcher = fetcher;
+        }   // end constructor
+
+
+        /**
+         * Creates a new {@link TransferableObject} that will return the
+         * object that is returned by <var>fetcher</var>.
+         * Along with the {@link #DATA_FLAVOR} associated with this class,
+         * this creates a custom data flavor with a representation class <var>dataClass</var>
+         * and the MIME type
+         * <tt>application/x-net.iharder.dnd.TransferableObject</tt>.
+         *
+         * @param dataClass The {@link java.lang.Class} to use in the custom data flavor
+         * @param fetcher   The {@link Fetcher} that will return the data object
+         * @see Fetcher
+         * @since 1.1
+         */
+        public TransferableObject(Class dataClass, Fetcher fetcher) {
+            this.fetcher = fetcher;
+            this.customFlavor = new java.awt.datatransfer.DataFlavor(dataClass, MIME_TYPE);
+        }   // end constructor
+
+        /**
+         * Returns the custom {@link java.awt.datatransfer.DataFlavor} associated
+         * with the encapsulated object or <tt>null</tt> if the {@link Fetcher}
+         * constructor was used without passing a {@link java.lang.Class}.
+         *
+         * @return The custom data flavor for the encapsulated object
+         * @since 1.1
+         */
+        public java.awt.datatransfer.DataFlavor getCustomDataFlavor() {
+            return customFlavor;
+        }   // end getCustomDataFlavor
+
+
+        /* ********  T R A N S F E R A B L E   M E T H O D S  ******** */
+
+
+        /**
+         * Returns a two- or three-element array containing first
+         * the custom data flavor, if one was created in the constructors,
+         * second the default {@link #DATA_FLAVOR} associated with
+         * {@link TransferableObject}, and third the
+         * {@link java.awt.datatransfer.DataFlavor.stringFlavor}.
+         *
+         * @return An array of supported data flavors
+         * @since 1.1
+         */
+        public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors() {
+            if (customFlavor != null)
+                return new java.awt.datatransfer.DataFlavor[]
+                        {customFlavor,
+                                DATA_FLAVOR,
+                                java.awt.datatransfer.DataFlavor.stringFlavor
+                        };  // end flavors array
+            else
+                return new java.awt.datatransfer.DataFlavor[]
+                        {DATA_FLAVOR,
+                                java.awt.datatransfer.DataFlavor.stringFlavor
+                        };  // end flavors array
+        }   // end getTransferDataFlavors
+
+
+        /**
+         * Returns the data encapsulated in this {@link TransferableObject}.
+         * If the {@link Fetcher} constructor was used, then this is when
+         * the {@link Fetcher#getObject getObject()} method will be called.
+         * If the requested data flavor is not supported, then the
+         * {@link Fetcher#getObject getObject()} method will not be called.
+         *
+         * @param flavor The data flavor for the data to return
+         * @return The dropped data
+         * @since 1.1
+         */
+        public Object getTransferData(java.awt.datatransfer.DataFlavor flavor)
+                throws java.awt.datatransfer.UnsupportedFlavorException, java.io.IOException {
+            // Native object
+            if (flavor.equals(DATA_FLAVOR))
+                return fetcher == null ? data : fetcher.getObject();
+
+            // String
+            if (flavor.equals(java.awt.datatransfer.DataFlavor.stringFlavor))
+                return fetcher == null ? data.toString() : fetcher.getObject().toString();
+
+            // We can't do anything else
+            throw new java.awt.datatransfer.UnsupportedFlavorException(flavor);
+        }   // end getTransferData
+
+
+        /**
+         * Returns <tt>true</tt> if <var>flavor</var> is one of the supported
+         * flavors. Flavors are supported using the <code>equals(...)</code> method.
+         *
+         * @param flavor The data flavor to check
+         * @return Whether or not the flavor is supported
+         * @since 1.1
+         */
+        public boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor) {
+            // Native object
+            if (flavor.equals(DATA_FLAVOR))
+                return true;
+
+            // String
+            if (flavor.equals(java.awt.datatransfer.DataFlavor.stringFlavor))
+                return true;
+
+            // We can't do anything else
+            return false;
+        }   // end isDataFlavorSupported
+
+
+        /* ********  I N N E R   I N T E R F A C E   F E T C H E R  ******** */
+
+        /**
+         * Instead of passing your data directly to the {@link TransferableObject}
+         * constructor, you may want to know exactly when your data was received
+         * in case you need to remove it from its source (or do anyting else to it).
+         * When the {@link #getTransferData getTransferData(...)} method is called
+         * on the {@link TransferableObject}, the {@link Fetcher}'s
+         * {@link #getObject getObject()} method will be called.
+         *
+         * @author Robert Harder
+         * @version 1.1
+         * @copyright 2001
+         * @since 1.1
+         */
+        public static interface Fetcher {
+            /**
+             * Return the object being encapsulated in the
+             * {@link TransferableObject}.
+             *
+             * @return The dropped object
+             * @since 1.1
+             */
+            public abstract Object getObject();
+        }   // end inner interface Fetcher
+
+
+    }   // end class TransferableObject
+
+
+}   // end class FileDrop
diff --git a/src/beast/app/util/MessageLogHandler.java b/src/beast/app/util/MessageLogHandler.java
new file mode 100644
index 0000000..9e909ff
--- /dev/null
+++ b/src/beast/app/util/MessageLogHandler.java
@@ -0,0 +1,46 @@
+package beast.app.util;
+
+import java.util.logging.*;
+
+public class MessageLogHandler extends StreamHandler {
+
+    public MessageLogHandler() {
+        setOutputStream(System.out);
+        setFormatter(new MessageLogFormatter());
+    }
+
+
+    public void publish(LogRecord record) {
+        super.publish(record);
+        flush();
+    }
+
+    public void close() {
+        flush();
+    }
+
+    private class MessageLogFormatter extends Formatter {
+
+        // Line separator string.  This is the value of the line.separator
+        // property at the moment that the SimpleFormatter was created.
+        private final String lineSeparator = System.getProperty("line.separator");
+
+        // AR - is there a reason why this was used? It causes warnings at compile
+//        private final String lineSeparator = (String) java.security.AccessController.doPrivileged(
+//                new sun.security.action.GetPropertyAction("line.separator"));
+
+        /**
+         * Format the given LogRecord.
+         *
+         * @param record the log record to be formatted.
+         * @return a formatted log record
+         */
+        public synchronized String format(LogRecord record) {
+            final StringBuffer sb = new StringBuffer();
+            sb.append(formatMessage(record));
+            sb.append(lineSeparator);
+            return sb.toString();
+        }
+    }
+}
+
diff --git a/src/beast/app/util/Utils.java b/src/beast/app/util/Utils.java
new file mode 100644
index 0000000..d7c7158
--- /dev/null
+++ b/src/beast/app/util/Utils.java
@@ -0,0 +1,310 @@
+package beast.app.util;
+
+import javax.swing.*;
+import javax.swing.UIManager.LookAndFeelInfo;
+import javax.swing.filechooser.FileNameExtensionFilter;
+
+import beast.app.beauti.BeautiPanel;
+import beast.app.beauti.BeautiPanelConfig;
+
+import java.awt.*;
+import java.io.*;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * @author Andrew Rambaut
+ * @author Alexei Drummond
+ */
+public class Utils {
+
+    /**
+     * This function takes a file name and an array of extensions (specified
+     * without the leading '.'). If the file name ends with one of the extensions
+     * then it is returned with this trimmed off. Otherwise the file name is
+     * return as it is.
+     *
+     * @param fileName   String
+     * @param extensions String[]
+     * @return the trimmed filename
+     */
+    public static String trimExtensions(String fileName, String[] extensions) {
+
+        String newName = null;
+
+        for (String extension : extensions) {
+            final String ext = "." + extension;
+            if (fileName.toUpperCase().endsWith(ext.toUpperCase())) {
+                newName = fileName.substring(0, fileName.length() - ext.length());
+            }
+        }
+
+        return (newName != null) ? newName : fileName;
+    }
+
+    /**
+     * @param caller Object
+     * @param name   String
+     * @return a named image from file or resource bundle.
+     */
+    public static Image getImage(Object caller, String name) {
+
+        java.net.URL url = caller.getClass().getResource(name);
+        if (url != null) {
+            return Toolkit.getDefaultToolkit().createImage(url);
+        } else {
+            if (caller instanceof Component) {
+                Component c = (Component) caller;
+                Image i = c.createImage(100, 20);
+                Graphics g = c.getGraphics();
+                g.drawString("Not found!", 1, 15);
+                return i;
+            } else return null;
+        }
+    }
+
+    public static File getCWD() {
+        final String f = System.getProperty("user.dir");
+        return new File(f);
+    }
+
+
+    public static void loadUIManager() {
+
+        if (isMac()) {
+            System.setProperty("apple.awt.graphics.UseQuartz", "true");
+            System.setProperty("apple.awt.antialiasing", "true");
+            System.setProperty("apple.awt.rendering", "VALUE_RENDER_QUALITY");
+
+            System.setProperty("apple.laf.useScreenMenuBar", "true");
+            System.setProperty("apple.awt.draggableWindowBackground", "true");
+            System.setProperty("apple.awt.showGrowBox", "true");
+
+            LookAndFeel laf = UIManager.getLookAndFeel();
+
+            try {
+
+                try {
+                    // We need to do this using dynamic class loading to avoid other platforms
+                    // having to link to this class. If the Quaqua library is not on the classpath
+                    // it simply won't be used.
+                    Class<?> qm = Class.forName("ch.randelshofer.quaqua.QuaquaManager");
+                    Method method = qm.getMethod("setExcludedUIs", Set.class);
+
+                    Set<String> excludes = new HashSet<String>();
+                    excludes.add("Button");
+                    excludes.add("ToolBar");
+                    method.invoke(null, excludes);
+
+                } catch (Throwable e) {
+                }
+
+                //set the Quaqua Look and Feel in the UIManager
+                UIManager.setLookAndFeel(
+                        "ch.randelshofer.quaqua.QuaquaLookAndFeel"
+                );
+
+                UIManager.put("SystemFont", new Font("Lucida Grande", Font.PLAIN, 13));
+                UIManager.put("SmallSystemFont", new Font("Lucida Grande", Font.PLAIN, 11));
+
+
+            } catch (Exception e) {
+                System.err.println(e.getMessage());
+                try {
+                    UIManager.setLookAndFeel(laf);
+                } catch (UnsupportedLookAndFeelException e1) {
+                    e1.printStackTrace();
+                }
+            }
+
+        }
+
+// APART FROM THE ABOVE CODE FOR OLD MAC OS X, WE SHOULD LEAVE THE UIManager to the defaults, rather than mess it up
+// DEFAULT is almost always the most appropriate thing to use!
+//        try {
+//
+//            if (!lafLoaded) {
+//            	if (System.getProperty("beast.laf") != null && !System.getProperty("beast.laf").equals("")) {
+//                    UIManager.setLookAndFeel(System.getProperty("beast.laf"));
+//            	} else if (isMac()) {
+//                   	UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
+//                } else { // If Windows or Linux
+//                    try {
+//                        UIManager.setLookAndFeel("javax.swing.plaf.nimbus.NimbusLookAndFeel");
+//                    } catch (Exception e) {
+//                        UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
+//                    }
+//                }
+//            }
+//        } catch (Exception e) {
+//        }
+    }
+
+    public static boolean isMac() {
+        return System.getProperty("os.name").toLowerCase().startsWith("mac");
+    }
+
+    public static boolean isWindows() {
+        return System.getProperty("os.name").toLowerCase().startsWith("windows");
+    }
+
+    public static boolean isLinux() {
+        return System.getProperty("os.name").toLowerCase().startsWith("linux");
+    }
+
+    public static File getLoadFile(String message) {
+        return getLoadFile(message, null, null, (String[]) null);
+    }
+
+    public static File getSaveFile(String message) {
+        return getSaveFile(message, null, null, (String[]) null);
+    }
+
+    public static File getLoadFile(String message, File defaultFileOrDir, String description, final String... extensions) {
+        File[] files = getFile(message, true, defaultFileOrDir, false, description, extensions);
+        if (files == null) {
+            return null;
+        } else {
+            return files[0];
+        }
+    }
+
+    public static File getSaveFile(String message, File defaultFileOrDir, String description, final String... extensions) {
+        File[] files = getFile(message, false, defaultFileOrDir, false, description, extensions);
+        if (files == null) {
+            return null;
+        } else {
+            return files[0];
+        }
+    }
+
+    public static File[] getLoadFiles(String message, File defaultFileOrDir, String description, final String... extensions) {
+        return getFile(message, true, defaultFileOrDir, true, description, extensions);
+    }
+
+    public static File[] getSaveFiles(String message, File defaultFileOrDir, String description, final String... extensions) {
+        return getFile(message, false, defaultFileOrDir, true, description, extensions);
+    }
+
+    public static File[] getFile(String message, boolean bLoadNotSave, File defaultFileOrDir, boolean bAllowMultipleSelection, String description, final String... extensions) {
+        if (isMac()) {
+            java.awt.Frame frame = new java.awt.Frame();
+            java.awt.FileDialog chooser = new java.awt.FileDialog(frame, message,
+                    (bLoadNotSave ? java.awt.FileDialog.LOAD : java.awt.FileDialog.SAVE));
+            if (defaultFileOrDir != null) {
+                if (defaultFileOrDir.isDirectory()) {
+                    chooser.setDirectory(defaultFileOrDir.getAbsolutePath());
+                } else {
+                    chooser.setDirectory(defaultFileOrDir.getParentFile().getAbsolutePath());
+                    chooser.setFile(defaultFileOrDir.getName());
+                }
+            }
+            if (description != null) {
+                FilenameFilter filter = new FilenameFilter() {
+                    @Override
+                    public boolean accept(File dir, String name) {
+                        for (int i = 0; i < extensions.length; i++) {
+                            if (name.toLowerCase().endsWith(extensions[i].toLowerCase())) {
+                                return true;
+                            }
+                        }
+                        return false;
+                    }
+                };
+                chooser.setFilenameFilter(filter);
+            }
+
+            chooser.setMultipleMode(bAllowMultipleSelection);
+            chooser.setVisible(true);
+            if (chooser.getFile() == null) return null;
+            if (bAllowMultipleSelection) {
+            	return chooser.getFiles();
+            }
+            File file = new java.io.File(chooser.getDirectory(), chooser.getFile());
+            chooser.dispose();
+            frame.dispose();
+            return new File[]{file};
+        } else {
+            // No file name in the arguments so throw up a dialog box...
+            java.awt.Frame frame = new java.awt.Frame();
+            frame.setTitle(message);
+            final JFileChooser chooser = new JFileChooser(defaultFileOrDir);
+            chooser.setMultiSelectionEnabled(bAllowMultipleSelection);
+            //chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
+
+            if (description != null) {
+                FileNameExtensionFilter filter = new FileNameExtensionFilter(description, extensions);
+                chooser.setFileFilter(filter);
+            }
+
+            if (bLoadNotSave) {
+                if (chooser.showOpenDialog(frame) == JFileChooser.APPROVE_OPTION) {
+                    frame.dispose();
+                    if (bAllowMultipleSelection) {
+                        return chooser.getSelectedFiles();
+                    } else {
+                        if (chooser.getSelectedFile() == null) {
+                            return null;
+                        }
+                        return new File[]{chooser.getSelectedFile()};
+                    }
+                }
+            } else {
+                if (chooser.showSaveDialog(frame) == JFileChooser.APPROVE_OPTION) {
+                    frame.dispose();
+                    if (bAllowMultipleSelection) {
+                        return chooser.getSelectedFiles();
+                    } else {
+                        if (chooser.getSelectedFile() == null) {
+                            return null;
+                        }
+                        return new File[]{chooser.getSelectedFile()};
+                    }
+                }
+            }
+        }
+        return null;
+    }
+
+    public static String toString(InputStream in) throws IOException {
+        BufferedReader reader = new BufferedReader(new InputStreamReader(in));
+        StringBuilder out = new StringBuilder();
+        String line;
+        while ((line = reader.readLine()) != null) {
+            out.append(line);
+        }
+        reader.close();
+        return out.toString();
+    }
+	public static ImageIcon getIcon(int iPanel, BeautiPanelConfig config) {
+	    String sIconLocation = BeautiPanel.ICONPATH + iPanel + ".png";
+	    if (config != null) {
+	        sIconLocation = BeautiPanel.ICONPATH + config.getIcon();
+	    }
+	    return Utils.getIcon(sIconLocation);
+	}
+
+    /**
+     * Retrieve icon.
+     *
+     * @param sIconLocation location of icon
+     * @return icon or null if no icon found
+     */
+	public static ImageIcon getIcon(String sIconLocation) {
+	    try {
+	        URL url = (URL) ClassLoader.getSystemResource(sIconLocation);
+	        if (url == null) {
+//	            System.err.println("Cannot find icon " + sIconLocation);
+	            return null;
+	        }
+	        ImageIcon icon = new ImageIcon(url);
+	        return icon;
+	    } catch (Exception e) {
+	        System.err.println("Cannot load icon " + sIconLocation + " " + e.getMessage());
+	        return null;
+	    }
+	
+	}
+}
diff --git a/src/beast/app/util/Utils6.java b/src/beast/app/util/Utils6.java
new file mode 100644
index 0000000..e962608
--- /dev/null
+++ b/src/beast/app/util/Utils6.java
@@ -0,0 +1,98 @@
+package beast.app.util;
+
+import java.awt.Dimension;
+import java.awt.Frame;
+import java.awt.Graphics;
+import java.awt.Image;
+import java.awt.MediaTracker;
+import java.awt.Toolkit;
+import java.awt.Window;
+import java.net.URL;
+
+import javax.swing.ImageIcon;
+import javax.swing.JComponent;
+
+import beast.app.beauti.BeautiPanel;
+import beast.app.beauti.BeautiPanelConfig;
+
+/** Utils that work with Java6 **/
+public class Utils6 {
+
+    public static class Canvas extends JComponent {
+        Image imageBuffer;
+        public Canvas() { }
+
+        public void paintComponent( Graphics g ) {
+            // copy buffered image
+            if ( imageBuffer != null )
+                g.drawImage(imageBuffer, 0,0, this);
+        }
+
+        /**
+         Get a buffered (persistent) image for drawing on this component
+         */
+        public Graphics getBufferedGraphics() {
+            Dimension dim = getSize();
+            imageBuffer = createImage( dim.width, dim.height );
+            return imageBuffer.getGraphics();
+        }
+
+        public void setBounds( int x, int y, int width, int height ) {
+            setPreferredSize( new Dimension(width, height) );
+            setMinimumSize( new Dimension(width, height) );
+            super.setBounds( x, y, width, height );
+        }
+    }
+
+    //Splash
+    static Window splashScreen;
+    /*
+        This could live in the desktop script.
+        However we'd like to get it on the screen as quickly as possible.
+    */
+    public static void startSplashScreen()
+    {
+        Image img = getIcon("beast/app/draw/icons/beauti.png").getImage();
+        int width=img.getWidth(null), height=img.getHeight(null);
+        Window win=new Window( new Frame() );
+        win.pack();
+        Canvas can = new Canvas();
+        can.setSize( width, height ); // why is this necessary?
+        Toolkit tk=Toolkit.getDefaultToolkit();
+        Dimension dim=tk.getScreenSize();
+        win.setBounds(
+                dim.width/2-width/2, dim.height/2-height/2, width, height );
+        win.add("Center", can);
+//        Image img=tk.getImage(
+//                Utils.class.getResource("beast.png") ); //what
+        MediaTracker mt=new MediaTracker(can);
+        mt.addImage(img,0);
+        try { mt.waitForAll(); } catch ( Exception e ) { }
+        Graphics gr=can.getBufferedGraphics();
+        gr.drawImage(img, 0, 0, can);
+        win.setVisible(true);
+        win.toFront();
+        splashScreen = win;
+    }
+
+    public static void endSplashScreen() {
+        if ( splashScreen != null )
+            splashScreen.dispose();
+    }
+
+
+	public static ImageIcon getIcon(String sIconLocation) {
+	    try {
+	        URL url = (URL) ClassLoader.getSystemResource(sIconLocation);
+	        if (url == null) {
+	            System.err.println("Cannot find icon " + sIconLocation);
+	            return null;
+	        }
+	        ImageIcon icon = new ImageIcon(url);
+	        return icon;
+	    } catch (Exception e) {
+	        System.err.println("Cannot load icon " + sIconLocation + " " + e.getMessage());
+	        return null;
+	    }
+	}
+}
diff --git a/src/beast/app/util/Version.java b/src/beast/app/util/Version.java
new file mode 100644
index 0000000..e346ede
--- /dev/null
+++ b/src/beast/app/util/Version.java
@@ -0,0 +1,34 @@
+package beast.app.util;
+
+/**
+ * Version last changed 2004/05/07 by AER
+ *
+ * @author Alexei Drummond
+ * @author Andrew Rambaut
+ * @version $Id: Version.java,v 1.13 2005/07/11 14:06:25 rambaut Exp $
+ */
+public abstract class Version {
+
+    public abstract String getVersion();
+
+    public abstract String getVersionString();
+
+    public abstract String getDateString();
+
+    public abstract String[] getCredits();
+
+    public String getHTMLCredits() {
+        String sStr = "";
+        for (String s : getCredits()) {
+            if (s.contains("@")) {
+                sStr += "<a href=\"mailto:" + s + "\">" + s + "</a><br>";
+            }
+            if (s.contains("http")) {
+                sStr += "<a href=\"" + s + "\">" + s + "</a><br>";
+            } else {
+                sStr += "<p>" + s + "</p>";
+            }
+        }
+        return sStr;
+    }
+}
diff --git a/src/beast/app/util/WholeNumberField.java b/src/beast/app/util/WholeNumberField.java
new file mode 100644
index 0000000..93a534c
--- /dev/null
+++ b/src/beast/app/util/WholeNumberField.java
@@ -0,0 +1,202 @@
+package beast.app.util;
+
+import javax.swing.*;
+import javax.swing.event.*;
+import javax.swing.text.AttributeSet;
+import javax.swing.text.BadLocationException;
+import javax.swing.text.Document;
+import javax.swing.text.PlainDocument;
+import java.awt.*;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
+
+
+public class WholeNumberField extends JTextField
+        implements FocusListener, DocumentListener {
+
+    protected static char MINUS_CHAR = '-';
+    protected EventListenerList changeListeners = new EventListenerList();
+    protected long min;
+    protected long max;
+    protected boolean range_check = false;
+    protected boolean range_checked = false;
+
+    public WholeNumberField() {
+        this(Integer.MIN_VALUE, Integer.MAX_VALUE);
+    }
+
+    public WholeNumberField(int min, int max) {
+        super();
+        this.min = min;
+        this.max = max;
+        range_check = true;
+        this.addFocusListener(this);
+    }
+
+    public WholeNumberField(long min, long max) {
+        super();
+        this.min = min;
+        this.max = max;
+        range_check = true;
+        this.addFocusListener(this);
+    }
+
+    public void focusGained(FocusEvent evt) {
+    }
+
+    public void focusLost(FocusEvent evt) {
+        if (range_check && !range_checked) {
+            range_checked = true;
+            try {
+                long value = Long.valueOf(getText());
+                if (value < min || value > max) {
+                    errorMsg();
+                }
+            } catch (NumberFormatException e) {
+                errorMsg();
+            }
+        }
+    }
+
+    public void setText(Integer obj) {
+        setText(obj.toString());
+    }
+
+    protected void errorMsg() {
+        JOptionPane.showMessageDialog(this,
+                "Illegal entry\nValue must be between " + min + " and " +
+                        max + " inclusive", "Error", JOptionPane.ERROR_MESSAGE);
+    }
+
+    public void setValue(int value) {
+        if (range_check) {
+            if (value < min || value > max) {
+                errorMsg();
+                return;
+            }
+        }
+        setText(Integer.toString(value));
+    }
+
+    public void setValue(long value) {
+        if (range_check) {
+            if (value < min || value > max) {
+                errorMsg();
+                return;
+            }
+        }
+        setText(Long.toString(value));
+    }
+
+    public Integer getValue() {
+        try {
+            return new Integer(getText());
+        } catch (NumberFormatException e) {
+            return null;
+        }
+    }
+
+    public Long getLongValue() {
+        try {
+            return new Long(getText());
+        } catch (NumberFormatException e) {
+            return null;
+        }
+    }
+
+    public Integer getValue(int default_value) {
+        Integer value = getValue();
+        if (value == null)
+            return default_value;
+        else
+            return value;
+    }
+
+    public Long getValue(long default_value) {
+        Long value = getLongValue();
+        if (value == null)
+            return default_value;
+        else
+            return value;
+    }
+
+    protected Document createDefaultModel() {
+        Document doc = new WholeNumberFieldDocument();
+        doc.addDocumentListener(this);
+        return doc;
+    }
+
+    public void insertUpdate(DocumentEvent e) {
+        range_checked = false;
+        fireChanged();
+    }
+
+    public void removeUpdate(DocumentEvent e) {
+        range_checked = false;
+        fireChanged();
+    }
+
+    public void changedUpdate(DocumentEvent e) {
+        range_checked = false;
+        fireChanged();
+    }
+
+    static char[] numberSet = {
+            '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'
+    };
+
+    class WholeNumberFieldDocument extends PlainDocument {
+        public void insertString(int offs, String str, AttributeSet a)
+                throws BadLocationException {
+
+            if (str == null) return;
+            str = str.trim();
+
+            String buf = getText(0, offs) + str;
+            char[] array = buf.toCharArray();
+
+            if (array.length > 0) {
+                if (array[0] != MINUS_CHAR && !member(array[0], numberSet)) {
+                    Toolkit.getDefaultToolkit().beep();
+                    return;
+                }
+            }
+
+            for (int i = 1; i < array.length; i++) {
+                if (!member(array[i], numberSet)) {
+                    Toolkit.getDefaultToolkit().beep();
+                    return;
+                }
+            }
+            super.insertString(offs, str, a);
+        }
+    }
+
+    static boolean member(char item, char[] array) {
+        for (int i = 0; i < array.length; i++)
+            if (array[i] == item) return true;
+        return false;
+    }
+    //------------------------------------------------------------------------
+    // Event Methods
+    //------------------------------------------------------------------------
+
+    public void addChangeListener(ChangeListener x) {
+        changeListeners.add(ChangeListener.class, x);
+    }
+
+    public void removeChangeListener(ChangeListener x) {
+        changeListeners.remove(ChangeListener.class, x);
+    }
+
+    protected void fireChanged() {
+        ChangeEvent c = new ChangeEvent(this);
+        Object[] listeners = changeListeners.getListenerList();
+        for (int i = listeners.length - 2; i >= 0; i -= 2) {
+            if (listeners[i] == ChangeListener.class) {
+                ChangeListener cl = (ChangeListener) listeners[i + 1];
+                cl.stateChanged(c);
+            }
+        }
+    }
+}
diff --git a/src/beast/app/util/images/beast.png b/src/beast/app/util/images/beast.png
new file mode 100644
index 0000000..585b4d1
Binary files /dev/null and b/src/beast/app/util/images/beast.png differ
diff --git a/src/beast/core/BEASTInterface.java b/src/beast/core/BEASTInterface.java
new file mode 100644
index 0000000..e9939e6
--- /dev/null
+++ b/src/beast/core/BEASTInterface.java
@@ -0,0 +1,377 @@
+/*
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+package beast.core;
+
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+public interface BEASTInterface {
+    public void initAndValidate() throws Exception;
+
+	/** identifiable **/
+	public String getID();
+	public void setID(String ID);
+	/** return set of Outputs, that is Objects for which this object is an Input **/
+	public Set getOutputs();
+
+	
+	
+    /* Utility for testing purposes only.
+     * This cannot be done in a constructor, since the
+     * inputs will not exist yet at that point in time
+     * and listInputs returns a list of nulls!
+     * Assigns objects to inputs in order in which the
+     * inputs are declared in the class, then calls
+     * initAndValidate().
+     */
+   default public void init(final Object... objects) throws Exception {
+       final List<Input<?>> inputs = listInputs();
+       int i = 0;
+       for (final Object object : objects) {
+           inputs.get(i++).setValue(object, this);
+       }
+       initAndValidate();
+   } // init
+
+   /* Utility for testing purposes
+    * The arguments are alternating input names and values,
+    * and values are assigned to the input with the particular name.
+    * For example initByName("kappa", 2.0, "lambda", true)
+    * assigns 2 to input kappa and true to input lambda.
+    * After assigning inputs, initAndValidate() is called.
+    */
+  default public void initByName(final Object... objects) throws Exception {
+      if (objects.length % 2 == 1) {
+          throw new RuntimeException("Expected even number of arguments, name-value pairs");
+      }
+      for (int i = 0; i < objects.length; i += 2) {
+          if (objects[i] instanceof String) {
+              final String sName = (String) objects[i];
+              setInputValue(sName, objects[i + 1]);
+          } else {
+              throw new RuntimeException("Expected a String in " + i + "th argument ");
+          }
+      }
+      try {
+          initAndValidate();
+      } catch (Exception e) {
+          e.printStackTrace();
+          throw new RuntimeException("initAndValidate() failed! " + e.getMessage());
+      }
+  } // initByName
+
+	
+	//@SuppressWarnings("rawtypes") 
+	static Set getOutputs(Object object) {
+    	try {
+            Method method = object.getClass().getMethod("getOutputs");
+            Object outputs = method.invoke(object);
+            return (Set) outputs;
+    	} catch (Exception e) {
+    		throw new RuntimeException("could not call getID() on object: " + e.getMessage());
+    	}
+	}
+
+    /**
+     * @return description from @Description annotation
+     */
+	default public String getDescription() {
+        final Annotation[] classAnnotations = this.getClass().getAnnotations();
+        for (final Annotation annotation : classAnnotations) {
+            if (annotation instanceof Description) {
+                final Description description = (Description) annotation;
+                return description.value();
+            }
+        }
+        return "Not documented!!!";
+    }
+
+    /**
+     * @return citation from @Citation annotation *
+     */
+    default public Citation getCitation() {
+        final Annotation[] classAnnotations = this.getClass().getAnnotations();
+        for (final Annotation annotation : classAnnotations) {
+            if (annotation instanceof Citation) {
+                return (Citation) annotation;
+            }
+        }
+        return null;
+    }
+
+    /**
+     * @return references for this plug in and all its inputs *
+     */
+    default public String getCitations() {
+        return getCitations(new HashSet<String>(), new HashSet<String>());
+    }
+
+    default String getCitations(final HashSet<String> citations, final HashSet<String> IDs) {
+        if (getID() != null) {
+            if (IDs.contains(getID())) {
+                return "";
+            }
+            IDs.add(getID());
+        }
+        final StringBuilder buf = new StringBuilder();
+        if (getCitation() != null) {
+            // only add citation if it is not already processed
+            if (!citations.contains(getCitation().value())) {
+                // and there is actually a citation to add
+                buf.append("\n");
+                buf.append(getCitation().value());
+                buf.append("\n");
+                citations.add(getCitation().value());
+            }
+            //return buf.toString();
+        }
+        try {
+            for (final BEASTInterface plugin : listActivePlugins()) {
+                buf.append(plugin.getCitations(citations, IDs));
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return buf.toString();
+    } // getCitations
+
+
+    /**
+     * create list of inputs to this plug-in *
+     */
+    default public List<Input<?>> listInputs() throws IllegalArgumentException, IllegalAccessException {
+        final List<Input<?>> inputs = new ArrayList<Input<?>>();
+        final Field[] fields = getClass().getFields();
+        for (final Field field : fields) {
+            if (field.getType().isAssignableFrom(Input.class)) {
+                final Input<?> input = (Input<?>) field.get(this);
+                inputs.add(input);
+            }
+        }
+        return inputs;
+    } // listInputs
+
+    /**
+     * create array of all plug-ins in the inputs that are instantiated.
+     * If the input is a List of plug-ins, these individual plug-ins are
+     * added to the list.
+     *
+     * @return list of all active plug-ins
+     * @throws IllegalAccessException
+     * @throws IllegalArgumentException
+     */
+    default public List<BEASTInterface> listActivePlugins() throws IllegalArgumentException, IllegalAccessException {
+        final List<BEASTInterface> plugins = new ArrayList<BEASTInterface>();
+        final Field[] fields = getClass().getFields();
+        for (final Field field : fields) {
+            if (field.getType().isAssignableFrom(Input.class)) {
+                final Input<?> input = (Input<?>) field.get(this);
+                if (input.get() != null) {
+                    if (input.get() instanceof List<?>) {
+                        final List<?> vector = (List<?>) input.get();
+                        for (final Object o : vector) {
+                            if (o instanceof BEASTInterface) {
+                                plugins.add((BEASTInterface) o);
+                            }
+                        }
+                    } else if (input.get() != null && input.get() instanceof BEASTInterface) {
+                        plugins.add((BEASTInterface) input.get());
+                    }
+                }
+            }
+        }
+        return plugins;
+    } // listActivePlugins
+
+    /**
+     * get description of an input
+     *
+     * @param name of the input
+     * @return list of inputs
+     */
+    default public String getTipText(final String name) throws IllegalArgumentException, IllegalAccessException {
+        final Field[] fields = getClass().getDeclaredFields();
+        for (final Field field : fields) {
+            if (field.getType().isAssignableFrom(Input.class)) {
+                final Input<?> input = (Input<?>) field.get(this);
+                if (input.getName().equals(name)) {
+                    return input.getTipText();
+                }
+            }
+        }
+        return null;
+    } // getTipText
+
+
+    /**
+     * check whether the input is an Integer, Double, Boolean or String *
+     */
+    default public boolean isPrimitive(final String name) throws Exception {
+        final Input<?> input = getInput(name);
+        final Class<?> inputType = input.getType();
+
+        if (inputType == null) {
+            input.determineClass(this);
+        }
+
+        assert inputType != null;
+        for (final Class c : new Class[]{Integer.class, Double.class, Boolean.class, String.class}) {
+            if (inputType.isAssignableFrom(c)) {
+                return true;
+            }
+        }
+//        if (inputType.isAssignableFrom(Integer.class)) {
+//            return true;
+//        }
+//        if (inputType.isAssignableFrom(Double.class)) {
+//            return true;
+//        }
+//        if (inputType.isAssignableFrom(Boolean.class)) {
+//            return true;
+//        }
+//        if (inputType.isAssignableFrom(String.class)) {
+//            return true;
+//        }
+        return false;
+    } // isPrimitive
+
+    /**
+     * get value of an input by input name *
+     */
+    default public Object getInputValue(final String name) throws Exception {
+        final Input<?> input = getInput(name);
+        return input.get();
+    } // getInputValue
+
+    /**
+     * set value of an input by input name *
+     */
+    default public void setInputValue(final String name, final Object value) throws Exception {
+        final Input<?> input = getInput(name);
+        if (!input.canSetValue(value, this)) {
+            throw new RuntimeException("Cannot set input value of " + name);
+        }
+        input.setValue(value, this);
+    } // setInputValue
+
+    /**
+     * get input by input name *
+     */
+    default public Input<?> getInput(final String name) throws Exception {
+        final Field[] fields = getClass().getFields();
+        for (final Field field : fields) {
+            if (field.getType().isAssignableFrom(Input.class)) {
+                final Input<?> input = (Input<?>) field.get(this);
+                if (input.getName().equals(name)) {
+                    return input;
+                }
+            }
+        }
+
+
+        String inputNames = " "; // <- space here to prevent error in .substring below
+        for (final Input<?> input : listInputs()) {
+            inputNames += input.getName() + ",";
+        }
+        throw new Exception("This BEASTInterface (" + (this.getID() == null ? this.getClass().getName() : this.getID()) + ") has no input with name " + name + ". " +
+                "Choose one of these inputs:" + inputNames.substring(0, inputNames.length() - 1));
+    } // getInput
+
+
+    /**
+     * check validation rules for all its inputs *
+     *
+     * @throws Exception when validation fails
+     */
+    default public void validateInputs() throws Exception {
+        for (final Input<?> input : listInputs()) {
+            input.validate();
+        }
+    }
+
+    /**
+     * Collect all predecessors in the graph where inputs
+     * represent incoming edges and plug-ins nodes.
+     *
+     * @param predecessors in partial order such that if
+     *                     x is after y in the list then x is not an ancestor of y
+     *                     (but x need not necessarily be a predecesor of y)
+     */
+
+    default public void getPredecessors(final List<BEASTInterface> predecessors) {
+        predecessors.add(this);
+        try {
+            for (final BEASTInterface plugin2 : listActivePlugins()) {
+                if (!predecessors.contains(plugin2)) {
+                    plugin2.getPredecessors(predecessors);
+                }
+            }
+        } catch (IllegalArgumentException | IllegalAccessException e) {
+            e.printStackTrace();
+        }
+    }
+
+
+// // This class was formerly called 'Plugin'
+//    @Description(
+//            value = "Base class for all BEAST objects, which is pretty much every class " +
+//                    "you want to incorporate in a model.",
+//            isInheritable = false
+//    )
+//    abstract public class Core implements BEASTInterface {
+//        /**
+//         * set of Objects that have this Object in one of its Inputs *
+//         * @deprecate use getOuputs() or BEASTInterface.getOuputs(object) instead
+//         */
+//    	@Deprecated
+//        public Set<BEASTInterface> outputs = new HashSet<BEASTInterface>();
+//    	
+//        /**
+//         * @return set of Objects that have this Object in one of its Inputs
+//         */
+//    	@SuppressWarnings("rawtypes")
+//    	public Set getOutputs() {
+//    		return outputs;
+//    	};
+//
+//        // identifiable
+//        protected String ID;
+//
+//        public String getID() {
+//            return ID;
+//        }
+//
+//        public void setID(final String ID) {
+//            this.ID = ID;
+//        }
+//    }
+}
+
+
diff --git a/src/beast/core/BEASTObject.java b/src/beast/core/BEASTObject.java
new file mode 100644
index 0000000..bde194f
--- /dev/null
+++ b/src/beast/core/BEASTObject.java
@@ -0,0 +1,76 @@
+/*
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+package beast.core;
+
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+// This class was formerly called 'Plugin'
+ at Description(
+        value = "Base class for all BEAST objects, which is pretty much every class " +
+                "you want to incorporate in a model.",
+        isInheritable = false
+)
+abstract public class BEASTObject implements BEASTInterface{
+    /**
+     * set of Objects that have this Object in one of its Inputs *
+     * @deprecate use getOuputs() or BEASTObject.getOuputs(object) instead
+     */
+	@Deprecated
+    public Set<BEASTObject> outputs = new HashSet<BEASTObject>();
+	
+    /**
+     * @return set of Objects that have this Object in one of its Inputs
+     */
+	@SuppressWarnings("rawtypes")
+	public Set getOutputs() {
+		return outputs;
+	};
+
+    // identifiable
+    protected String ID;
+
+    public String getID() {
+        return ID;
+    }
+
+    public void setID(final String ID) {
+        this.ID = ID;
+    }
+
+    // A default method in BEASTInterface cannot override
+    // a method in Object, so it needs to be in BEASTObject
+    public String toString() {
+    	return getID();
+    }
+    
+    
+    
+} // class BEASTObject
diff --git a/src/beast/core/BEASTObjectAnnotation.java b/src/beast/core/BEASTObjectAnnotation.java
new file mode 100644
index 0000000..9571377
--- /dev/null
+++ b/src/beast/core/BEASTObjectAnnotation.java
@@ -0,0 +1,12 @@
+package beast.core;
+
+import java.lang.annotation.*;
+
+/**
+ * An annotation used for specifying a BEAST object without needing to extend BEASTObject directly.
+ * Useful when one wants to extend a different object, since there is no multiple inheritance in Java.
+ */
+ at Target({ElementType.TYPE})
+ at Retention(RetentionPolicy.RUNTIME)
+ at Inherited
+public @interface BEASTObjectAnnotation {}
diff --git a/src/beast/core/CalculationNode.java b/src/beast/core/CalculationNode.java
new file mode 100644
index 0000000..ceeb5c2
--- /dev/null
+++ b/src/beast/core/CalculationNode.java
@@ -0,0 +1,129 @@
+package beast.core;
+
+/**
+ * A CalculationNode is a BEAST Object that perform calculations based on the State.
+ * CalculationNodes differ from  StateNodes in that they
+ * 1. Calculate something
+ * 2. can not be changed by Operators.
+ *
+ * Calculations are functions,  StateNodes are variables.
+ *
+ * @author Andrew Rambaut
+ */
+ at Description("Plugin that performs calculations based on the State.")
+public abstract class CalculationNode extends BEASTObject {
+
+    //=================================================================
+    // The API of CalculationNode. These 3 functions (store/restore/requireCalculation)
+    // can be overridden to increase efficiency by caching internal calculations.
+    // General default implementations are provided.
+    //=================================================================
+
+    /**
+     * Store internal calculations. Called before a calculation node
+     * is asked to perform any calculations, but after some part of the
+     * state has changed through a operator proposal.
+     * <p/>
+     * This is not meant to be used to calculate anything, just store
+     * intermediate results of calculations. Input values should not
+     * be accessed because some StateNodes may have been changed.
+     */
+    protected void store() {
+        isDirty = false;
+    }
+
+
+    /**
+     * Check whether internal calculations need to be updated
+     * <p/>
+     * This is called after a proposal of a new state.
+     * A CalculationNode that needs a custom implementation should
+     * override requiresRecalculation()
+     */
+    final void checkDirtiness() {
+        isDirty = requiresRecalculation();
+    }
+
+    /**
+     * @return whether the API for the particular Plugin returns different
+     *         answers than before the operation was applied.
+     *         <p/>
+     *         This method is called before the CalculationNode do their calculations.
+     *         Called in order of the partial order defined by Input-Plugin relations.
+     *         Called only on those CalculationNodes potentially affected by a
+     *         StateNode change.
+     *         <p/>
+     *         Default implementation return 'true', since requiresRecalculation is
+     *         called for a node only if one of its arguments has changed.
+     */
+    protected boolean requiresRecalculation() {
+        return true;
+
+
+//        *         <p/>
+//        *         Default implementation inspects all input plugins
+//        *         and checks if there is any dirt anywhere.
+//        *         Derived classes can provide a more efficient implementation
+//        *         by checking which part of any input StateNode or Plugin has changed.
+//        *         <p/>
+//        *         Note this default implementation is relative expensive since it uses
+//        *         introspection, so overrides should be preferred.
+//        *         After the operation has changed the state.state
+        // this is a prototypical implementation of requiresRecalculation()
+//        try {
+//            for (Plugin plugin : listActivePlugins()) {
+//                if (plugin instanceof StateNode && ((StateNode)plugin).somethingIsDirty()) {
+//                	return true;
+//                }
+//
+//                if (plugin instanceof CalculationNode && ((CalculationNode)plugin).isDirtyCalculation()) {
+//                    return true;
+//                }
+//            }
+//        } catch (IllegalAccessException e) {
+//            e.printStackTrace();
+//        }
+//
+//        return false;
+    }
+
+    /**
+     * Restore internal calculations
+     * <p/>
+     * This is called when a proposal is rejected
+     */
+    protected void restore() {
+        isDirty = false;
+    }
+
+    /**
+     * Accept internal state and mark internal calculations as current
+     * <p/>
+     * This is called when a proposal is accepted
+     */
+    protected void accept() {
+        isDirty = false;
+    }
+
+    /**
+     * @return true if the node became dirty - that is needs to recalculate due to
+     *         changes in the inputs.
+     *         <p/>
+     *         CalcalationNodes typically know whether an input is a CalculationNode or StateNode
+     *         and also know whether the input is Validate.REQUIRED, hence cannot be null.
+     *         Further, for CalculationNodes, a shadow parameter can be kept so that a
+     *         call to Input.get() can be saved.
+     *         Made public to squeeze out a few cycles and save a few seconds in
+     *         calculation time by calling this directly instead of calling isDirty()
+     *         on the associated input.
+     */
+    final public boolean isDirtyCalculation() {
+        return isDirty;
+    }
+
+    /**
+     * flag to indicate whether this node will be updating its calculations
+     */
+    private boolean isDirty = false;
+
+} // class CalculationNode
diff --git a/src/beast/core/Citation.java b/src/beast/core/Citation.java
new file mode 100644
index 0000000..c7f191b
--- /dev/null
+++ b/src/beast/core/Citation.java
@@ -0,0 +1,56 @@
+/*
+* File Description.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+
+package beast.core;
+
+import java.lang.annotation.*;
+
+/**
+ * This is an annotation that can be used to add a reference
+ * to a class.
+ * <p/>
+ * Example: @Citation("Darwin & Wallace (1858) 'On the Tendency
+ * of Species to form Varieties and on the Perpetuation of Varieties
+ * and Species by Natural Means of Selection.' Linnean Society")
+ * just before class declarations of plug-ins. Applications
+ * like DocMaker then can pick it up through introspection.
+ * <p/>
+ */
+ at Target({ElementType.TYPE})
+ at Retention(RetentionPolicy.RUNTIME)
+ at Inherited
+public @interface Citation {
+
+    /**
+     * @return the citation for the class
+     */
+    String value();
+
+    String DOI() default "";
+
+    int year() default 0;
+    
+    String firstAuthorSurname() default "";
+}
\ No newline at end of file
diff --git a/src/beast/core/Description.java b/src/beast/core/Description.java
new file mode 100644
index 0000000..6db58c8
--- /dev/null
+++ b/src/beast/core/Description.java
@@ -0,0 +1,61 @@
+/*
+* File Description.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+
+package beast.core;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * This is an annotation that can be used to both
+ * + document a class at the top of the code and
+ * + create user documentation for XML Beast files.
+ * <p/>
+ * The idea is to add @Description("bla bla bla")
+ * just before class declarations of plug-ins. Applications
+ * like DocMaker then can pick it up through introspection.
+ * <p/>
+ * To indicate that the description applies to all derived
+ * classes, the isInheritable flag is set true by default.
+ * This does not always apply, for instance when the description
+ * contains text like "Should not be used directly, but by
+ * implementations".
+ */
+ at Target({ElementType.TYPE})
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface Description {
+
+    /**
+     * @return the description of the class
+     */
+    String value();
+
+    /**
+     * @return true to indicate this description applies to all its inherited classes as well, false otherwise
+     */
+    boolean isInheritable() default true;
+}
diff --git a/src/beast/core/Distribution.java b/src/beast/core/Distribution.java
new file mode 100644
index 0000000..7c18d37
--- /dev/null
+++ b/src/beast/core/Distribution.java
@@ -0,0 +1,172 @@
+/*
+* File Distribution.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+package beast.core;
+
+import java.io.PrintStream;
+import java.util.List;
+import java.util.Random;
+
+ at Description("Probabilistic representation that can produce " +
+        "a log probability for instance for running an MCMC chain.")
+public abstract class Distribution extends CalculationNode implements Loggable, Function {
+
+    /**
+     * current and stored log probability/log likelihood/log distribution *
+     */
+    protected double logP = Double.NaN;
+    protected double storedLogP = Double.NaN;
+
+    /**
+     * @return the normalised probability (density) for this distribution.
+     *         Note that some efficiency can be gained by testing whether the
+     *         Distribution is dirty, and if not, call getCurrentLogP() instead
+     *         of recalculating.
+     * @throws Exception an exception
+     */
+    public double calculateLogP() throws Exception {
+        logP = 0;
+        return logP;
+    }
+
+    /** The plugin implements f( arguments | conditionals) **/
+
+    /**
+     * @return a list of unique ids for the state nodes that form the argument
+     */
+    public abstract List<String> getArguments();
+
+    /**
+     * @return a list of unique ids for the state nodes that make up the conditions
+     */
+    public abstract List<String> getConditions();
+
+    /**
+     * This method draws new values for the arguments conditional on the current value(s) of the conditionals.
+     * <p/>
+     * The new values are overwrite the argument values in the provided state.
+     *
+     * @param state  the state
+     * @param random random number generator
+     */
+    public abstract void sample(State state, Random random);
+
+    /**
+     * get result from last known calculation, useful for logging
+     *
+     * @return log probability
+     */
+    public double getCurrentLogP() {
+        return logP;
+    }
+
+    @Override
+    public void initAndValidate() throws Exception {
+        // nothing to do
+    }
+
+    /**
+     * CalculationNode methods *
+     */
+    @Override
+    public void store() {
+        storedLogP = logP;
+        super.store();
+    }
+
+    @Override
+    public void restore() {
+        logP = storedLogP;
+        super.restore();
+    }
+
+    /**
+     * Loggable interface implementation follows *
+     */
+    @Override
+    public void init(final PrintStream out) throws Exception {
+        out.print(getID() + "\t");
+    }
+
+    @Override
+    public void log(final int nSample, final PrintStream out) {
+        out.print(getCurrentLogP() + "\t");
+    }
+
+    @Override
+    public void close(final PrintStream out) {
+        // nothing to do
+    }
+
+    /**
+     * Valuable interface implementation follows *
+     */
+    @Override
+    public int getDimension() {
+        return 1;
+    }
+
+    @Override
+    public double getArrayValue() {
+        return logP;
+    }
+
+    @Override
+    public double getArrayValue(final int iDim) {
+        if (iDim == 0) return getArrayValue();
+        return 0;
+    }
+    
+    /**
+     * Intended to be overridden by stochastically estimated distributions.
+     * Used to disable target distribution consistency checks implemented in
+     * the MCMC class which do not apply to stochastic distributions.
+     * 
+     * @return true if stochastic.
+     */
+    public boolean isStochastic() {
+        return false;
+    }
+
+    
+    /** 
+     * Return non-stochastic part of a distribution recalculate, if required. 
+     * This can be used for debugging purposes to verify that the non-stochastic 
+     * part of a distribution is calculated correctly e.g. inside the MCMC loop
+     * 
+     * @return logP if not stochastic, zero otherwise
+     */
+	public double getNonStochasticLogP() throws Exception {
+		if (isStochastic()) {
+			return 0;
+		} else {
+            if (isDirtyCalculation()) {
+            	return calculateLogP();
+            } else {
+            	return getCurrentLogP();
+            }
+		}
+	}
+
+} // class Distribution
diff --git a/src/beast/core/Evaluator.java b/src/beast/core/Evaluator.java
new file mode 100644
index 0000000..b955990
--- /dev/null
+++ b/src/beast/core/Evaluator.java
@@ -0,0 +1,9 @@
+package beast.core;
+
+/**
+ * @author Andrew Rambaut
+ * @version $Id$
+ */
+public interface Evaluator {
+    double evaluate();
+}
diff --git a/src/beast/core/Function.java b/src/beast/core/Function.java
new file mode 100644
index 0000000..3964d30
--- /dev/null
+++ b/src/beast/core/Function.java
@@ -0,0 +1,29 @@
+package beast.core;
+
+/**
+ * Allows a YABBYObject, in particular a StateNode or CalculationNode to present itself as
+ * an array of values. This is particular handy for generic calculations on a YABBYObject,
+ * like calculation of ESS, posterior of a distribution or in the SpreadSheet interface
+ * where the possibilities of calculations are limitless.
+ * *
+ */
+public interface Function {
+
+    /**
+     * @return dimension of the Function *
+     */
+    public int getDimension();
+
+    /**
+     * @return main value. For a 1 dimensional Function, this is the only
+     *         value, but for a Tree this can be the root height, while the individual
+     *         values obtained from getValue(iDim) return the node heights.
+     */
+    public double getArrayValue();
+
+    /**
+     * @param iDim requested dimention
+     * @return iDim'th value (if any)
+     */
+    public double getArrayValue(int iDim);
+}
diff --git a/src/beast/core/Input.java b/src/beast/core/Input.java
new file mode 100644
index 0000000..4b12bd7
--- /dev/null
+++ b/src/beast/core/Input.java
@@ -0,0 +1,732 @@
+/*
+* File Input.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+package beast.core;
+
+
+import beast.core.parameter.RealParameter;
+import beast.core.util.Log;
+
+import java.io.File;
+import java.lang.reflect.*;
+import java.util.Arrays;
+import java.util.List;
+
+
+/**
+ * Represents input of a BEASTObject class.
+ * Inputs connect BEASTObjects with outputs of other BEASTObjects,
+ * e.g. a Logger can get the result it needs to log from a
+ * BEASTObject that actually performs a calculation.
+ */
+public class Input<T> {
+    /**
+     * input name, used for identification when getting/setting values of a plug-in *
+     */
+    String name = "";
+
+    /**
+     * short description of the function of this particular input *
+     */
+    String tipText = "";
+
+    /**
+     * value represented by this input
+     */
+    T value;
+
+    /**
+     * Type of T, automatically determined when setting a new value.
+     * Used for type checking.
+     */
+    protected Class<?> theClass;
+
+    /**
+     * validation rules *
+     */
+    public enum Validate {
+        OPTIONAL, REQUIRED, XOR, FORBIDDEN
+    }
+
+    // (Q2R) I am surprised the default is not required ....
+
+    Validate rule = Validate.OPTIONAL;
+    /**
+     * used only if validation rule is XOR *
+     */
+    Input<?> other;
+    public T defaultValue;
+    /**
+     * Possible values for enumerations, e.g. if
+     * an input can be any of "constant", "linear", "quadratic"
+     * this array contains these values. Used for validation and user interfaces.
+     */
+    public T[] possibleValues;
+
+    /**
+     * constructors *
+     */
+    public Input() {
+    }
+
+    /**
+     * simple constructor, requiring only the input name and tiptext
+     */
+    public Input(String sName, String sTipText) {
+        name = sName;
+        tipText = sTipText;
+        value = null;
+        checkName();
+    } // c'tor
+
+    /**
+     * simple constructor as above but with type pre-specified.
+     * This allows inputs of types that cannot be determined through
+     * introspection, such as template class inputs, e.g. Input<Parameter<?>>
+     */
+    public Input(String sName, String sTipText, Class<?> theClass) {
+        this(sName, sTipText);
+        this.theClass = theClass;
+    } // c'tor
+
+    /**
+     * constructor for List<>
+     */
+    public Input(String sName, String sTipText, T startValue) {
+        this(sName, sTipText);
+        value = startValue;
+        defaultValue = startValue;
+    } // c'tor
+
+    /**
+     * constructor for List<> with type specified
+     */
+    public Input(String sName, String sTipText, T startValue, Class<?> theClass) {
+        this(sName, sTipText, startValue);
+        this.theClass = theClass;
+    } // c'tor
+
+    /**
+     * constructor for List<> with XOR rules
+     */
+    public Input(String sName, String sTipText, T startValue, Validate rule, Input<?> other) {
+        this(sName, sTipText, startValue);
+        if (rule != Validate.XOR) {
+            System.err.println("Programmer error: input rule should be XOR for this Input constructor");
+        }
+        this.rule = rule;
+        this.other = other;
+        this.other.other = this;
+        this.other.rule = rule;
+        checkName();
+    } // c'tor
+
+    /**
+     * constructor for List<> with XOR rules with type specified
+     */
+    public Input(String sName, String sTipText, T startValue, Validate rule, Input<?> other, Class<?> theClass) {
+        this(sName, sTipText, startValue, rule, other);
+        this.theClass = theClass;
+    } // c'tor
+
+
+    /**
+     * Constructor for REQUIRED rules for List-inputs, i.e. lists that require
+     * at least one value to be specified.
+     * If optional (i.e. no value need to be specified), leave the rule out
+     */
+    public Input(String sName, String sTipText, T startValue, Validate rule) {
+        this(sName, sTipText, startValue);
+        /*if (rule != Validate.REQUIRED) {
+            System.err.println("Programmer error: input rule should be REQUIRED for this Input constructor"
+                    + " (" + sName + ")");
+        }*/
+        this.rule = rule;
+    } // c'tor
+
+    /**
+     * constructor for REQUIRED rules for List-inputs, with type pre-specified
+     */
+    public Input(String sName, String sTipText, T startValue, Validate rule, Class<?> type) {
+        this(sName, sTipText, startValue, rule);
+        theClass = type;
+    } // c'tor
+
+    /**
+     * constructor for REQUIRED rules
+     */
+    public Input(String sName, String sTipText, Validate rule) {
+        this(sName, sTipText);
+        if (rule != Validate.REQUIRED) {
+            System.err.println("Programmer error: input rule should be REQUIRED for this Input constructor"
+                    + " (" + sName + ")");
+        }
+        this.rule = rule;
+    } // c'tor
+
+    /**
+     * constructor for REQUIRED rules, with type pre-specified
+     */
+    public Input(String sName, String sTipText, Validate rule, Class<?> type) {
+        this(sName, sTipText, rule);
+        this.theClass = type;
+    }
+
+    /**
+     * constructor for XOR rules *
+     */
+    public Input(String sName, String sTipText, Validate rule, Input<?> other) {
+        this(sName, sTipText);
+        if (rule != Validate.XOR) {
+            System.err.println("Programmer error: input rule should be XOR for this Input constructor");
+        }
+        this.rule = rule;
+        this.other = other;
+        this.other.other = this;
+        this.other.rule = rule;
+    } // c'tor
+
+    /**
+     * constructor for XOR rules, with type pre-specified
+     */
+    public Input(String sName, String sTipText, Validate rule, Input<?> other, Class<?> type) {
+        this(sName, sTipText, rule, other);
+        this.theClass = type;
+    }
+
+    /**
+     * constructor for enumeration.
+     * Typical usage is with an array of possible String values, say ["constant","exponential","lognormal"]
+     * Furthermore, a default value is required (should we have another constructor that could leave
+     * the value optional? When providing a 'no-input' entry in the list and setting that as the default,
+     * that should cover that situation.)
+     */
+    public Input(String sName, String sTipText, T startValue, T[] sPossibleValues) {
+        name = sName;
+        tipText = sTipText;
+        value = startValue;
+        defaultValue = startValue;
+        possibleValues = sPossibleValues;
+        checkName();
+    } // c'tor
+
+    /**
+     * check name is not one of the reserved ones *
+     */
+    private void checkName() {
+        if (name.toLowerCase().equals("id") ||
+                name.toLowerCase().equals("idref") ||
+                name.toLowerCase().equals("spec") ||
+                name.toLowerCase().equals("name")) {
+            System.err.println("Found an input with invalid name: " + name);
+            System.err.println("'id', 'idref', 'spec' and 'name' are reserved and cannot be used");
+            System.exit(0);
+        }
+    }
+
+    /**
+     * various setters and getters
+     */
+    public String getName() {
+        return name;
+    }
+
+    public String getTipText() {
+        return tipText;
+    }
+
+    public String getHTMLTipText() {
+        return "<html>" + tipText.replaceAll("\n", "<br>") + "</html>";
+    }
+
+    public String getValueTipText() {
+        if (theClass == Boolean.class) {
+            return ("[true|false]");
+        }
+        if (theClass == Integer.class) {
+            return ("<integer>");
+        }
+        if (theClass == Long.class) {
+            return ("<long>");
+        }
+        if (theClass == Double.class) {
+            return ("<double>");
+        }
+        if (theClass == String.class) {
+            return "<string>";
+        }
+        if (theClass == File.class) {
+            return "<filename>";
+        }
+        if (theClass.isEnum()) {
+            return Arrays.toString(possibleValues).replaceAll(",", "|");
+        }
+        return "";
+    }
+
+    public Class<?> getType() {
+        return theClass;
+    }
+
+    public void setType(Class<?> theClass) {
+        this.theClass = theClass;
+    }
+
+    public Validate getRule() {
+        return rule;
+    }
+
+    public void setRule(final Validate rule) {
+        this.rule = rule;
+    }
+
+    public Input<?> getOther() {
+        return other;
+    }
+
+    /**
+     * Get the value of this input -- not to be called from operators!!!
+     * If this is a StateNode input, instead of returning
+     * the actual value, the current value of the StateNode
+     * is returned. This is defined as the current StateNode
+     * in the State, or itself if it is not part of the state.
+     *
+     * @return value of this input
+     */
+    public T get() {
+        return value;
+    }
+
+    /**
+     * As get() but with this difference that the State can manage
+     * whether to make a copy and register the operator.
+     * <p/>
+     * Only Operators should call this method.
+     * Also Operators should never call Input.get(), always Input.get(operator).
+     *
+     * @param operator
+     * @return
+     */
+    @SuppressWarnings("unchecked")
+    public T get(final Operator operator) {
+        return (T) ((StateNode) value).getCurrentEditable(operator);
+    }
+
+    /**
+     * Return the dirtiness state for this input.
+     * For a StateNode or list of StateNodes, report whether for any something is dirty,
+     * for a CalcationNode or list of CalculationNodes, report whether any is dirty.
+     * Otherwise, return false.
+     * *
+     */
+    public boolean isDirty() {
+        final T value = get();
+
+        if (value == null) {
+            return false;
+        }
+
+        if (value instanceof StateNode) {
+            return ((StateNode) value).somethingIsDirty();
+        }
+
+        if (value instanceof CalculationNode) {
+            return ((CalculationNode) value).isDirtyCalculation();
+        }
+
+        if (value instanceof List<?>) {
+            for (final Object obj : (List<?>) value) {
+                if (obj instanceof CalculationNode && ((CalculationNode) obj).isDirtyCalculation()) {
+                    return true;
+                } else if (obj instanceof StateNode && ((StateNode) obj).somethingIsDirty()) {
+                    return true;
+                }
+            }
+        }
+
+        return false;
+    }
+
+    /**
+     * Sets value to this input.
+     * If class is not determined yet, first determine class of declaration of
+     * this input so that we can do type checking.
+     * If value is of type String, try to parse the value if this input is
+     * Integer, Double or Boolean.
+     * If this input is a List, instead of setting this value, the value is
+     * added to the vector.
+     * Otherwise, m_value is assigned to value.
+     *
+     * @param value
+     * @param plugin
+     * @throws Exception
+     */
+    @SuppressWarnings("unchecked")
+    public void setValue(final Object value, final BEASTInterface plugin) {
+        if (value == null) {
+            if (this.value != null) {
+                if (this.value instanceof BEASTInterface) {
+                    ((BEASTInterface) this.value).getOutputs().remove(plugin);
+                }
+            }
+            this.value = null;
+            return;
+        }
+        if (theClass == null) {
+            try {
+                determineClass(plugin);
+            } catch (Exception e) {
+                e.printStackTrace();
+                throw new RuntimeException("Failed to determine class of beastobject id=" + plugin.getID());
+            }
+        }
+        if (value instanceof String) {
+            try {
+                setStringValue((String) value, plugin);
+            } catch (Exception e) {
+                e.printStackTrace();
+            	Log.warning.println("Failed to set the string value to '" + value + "' for beastobject id=" + plugin.getID());
+                throw new RuntimeException("Failed to set the string value to '" + value + "' for beastobject id=" + plugin.getID());
+            }
+        } else if (this.value != null && this.value instanceof List<?>) {
+            if (theClass.isAssignableFrom(value.getClass())) {
+                @SuppressWarnings("rawtypes") final
+                List vector = (List) this.value;
+//              // don't insert duplicates
+                // RRB: DO insert duplicates: this way CompoundValuable can be set up to 
+                // contain rate matrices with dependent variables/parameters.
+                // There does not seem to be an example where a duplicate insertion is a problem...
+//                for (Object o : vector) {
+//                    if (o.equals(value)) {
+//                        return;
+//                    }
+//                }
+                vector.add(value);
+                if (value instanceof BEASTInterface) {
+                    ((BEASTInterface) value).getOutputs().add(plugin);
+                }
+            } else if (value instanceof List<?> && theClass.isAssignableFrom(((List<?>) value).get(0).getClass())) {
+                // add all elements in given list to input list.
+                @SuppressWarnings("rawtypes")
+                final List<Object> vector = (List) this.value;
+                for (Object v : ((List<?>) value)) {
+                    vector.add(v);
+                    if (v instanceof BEASTInterface) {
+                        ((BEASTInterface) v).getOutputs().add(plugin);
+                    }
+                }
+            } else {
+                throw new RuntimeException("Input 101: type mismatch for input " + getName() +
+                        ". " + theClass.getName() + ".isAssignableFrom(" + value.getClass() + ")=false");
+            }
+
+        } else {
+            if (theClass.isAssignableFrom(value.getClass())) {
+                if (value instanceof BEASTInterface) {
+                    if (this.value != null) {
+                        ((BEASTInterface) this.value).getOutputs().remove(plugin);
+                    }
+                    ((BEASTInterface) value).getOutputs().add(plugin);
+                }
+                this.value = (T) value;
+            } else {
+                throw new RuntimeException("Input 102: type mismatch for input " + getName());
+            }
+        }
+    }
+
+    /**
+     * Call custom input validation.
+     * For an input with name "name", the method canSetName will be invoked,
+     * that is, 'canSet' + the name of the input with first letter capitalised.
+     * The canSetName(Object o) method should have one argument of type Object.
+     * <p/>
+     * It is best for Beauti to throw an Exception from canSetName() with some
+     * diagnostic info when the value cannot be set.
+     */
+    public boolean canSetValue(Object value, BEASTInterface plugin) {
+        String inputName = new String(name.charAt(0) + "").toUpperCase() + name.substring(1);
+        try {
+            Method method = plugin.getClass().getMethod("canSet" + inputName, Object.class);
+            //System.err.println("Calling method " + plugin.getClass().getName() +"."+ method.getName());
+            Object o = method.invoke(plugin, value);
+            return (Boolean) o;
+        } catch (java.lang.NoSuchMethodException e) {
+            return true;
+        } catch (java.lang.reflect.InvocationTargetException e) {
+            System.err.println(plugin.getClass().getName() + "." + getName() + ": " + e.getCause());
+
+            if (e.getCause() != null) {
+                throw new RuntimeException(e.getCause().getMessage());
+            }
+            return false;
+        } catch (IllegalAccessException e) {
+            e.printStackTrace();
+            throw new RuntimeException("Illegal method access attempted on beastobject id=" + plugin.getID());
+        }
+    }
+
+    /**
+     * Determine class through introspection,
+     * This sets the theClass member of Input<T> to the actual value of T.
+     * If T is a vector, i.e. Input<List<S>>, the actual value of S
+     * is assigned instead
+     *
+     * @param plugin whose type is to be determined
+     * @throws Exception
+     */
+    public void determineClass(final Object plugin) throws Exception {
+        try {
+            final Field[] fields = plugin.getClass().getFields();
+            // find this input in the plugin
+            for (int i = 0; i < fields.length; i++) {
+                if (fields[i].getType().isAssignableFrom(Input.class)) {
+                    Input<?> input = (Input<?>) fields[i].get(plugin);
+                    if (input == this) {
+                        // found the input, now determine the type of the input
+                        Type t = fields[i].getGenericType();
+                        Type[] genericTypes = ((ParameterizedType) t).getActualTypeArguments();
+                        // check if it is a List
+                        // NB: if the List is not initialised, there is no way 
+                        // to determine the type (that I know of...)
+                        if (value != null && value instanceof List<?>) {
+                            Type[] genericTypes2 = ((ParameterizedType) genericTypes[0]).getActualTypeArguments();
+                            theClass = (Class<?>) genericTypes2[0];
+                            // gettting type of map is not possible?!?
+                            //} else if (value != null && value instanceof Map<?,?>) {
+                            //    Type[] genericTypes2 = ((ParameterizedType) genericTypes[0]).getActualTypeArguments();
+                            //    theClass = (Class<?>) genericTypes2[0];
+                        } else {
+                            // it is not a list (or if it is, this will fail)
+                            try {
+                            	Object o = genericTypes[0];
+                            	if (o instanceof ParameterizedType) {
+                                    Type rawType = ((ParameterizedType) genericTypes[0]).getRawType();
+                                    System.err.println(rawType.getTypeName());
+                            		if (rawType.getTypeName().equals("java.util.List")) {
+                            			// if we got here, value==null
+                            			throw new Exception("Programming error: Input<List> not initialised");
+                            		}
+                            	}
+                                theClass = (Class<?>) o;
+                            } catch (Exception e) {
+                                // resolve ID
+                                String id = "";
+                                Method method = plugin.getClass().getMethod("getID");
+                                if (method != null) {
+                                    id = (String) method.invoke(plugin);
+                                }
+                                // assemble error message
+                                System.err.println(plugin.getClass().getName() + " " + id + " failed. " +
+                                        "Possibly template or abstract Plugin used " +
+                                        "or if it is a list, the list was not initilised???");
+                                System.err.println("class is " + plugin.getClass());
+                                e.printStackTrace(System.err);
+                                System.exit(0);
+                            }
+                        }
+                        break;
+                    }
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    } // determineClass
+
+    /**
+     * Try to parse value of string into Integer, Double or Boolean,
+     * or it this types differs, just assign as string.
+     *
+     * @param sValue value representation
+     * @throws Exception when all conversions fail
+     */
+    @SuppressWarnings({"unchecked", "rawtypes"})
+    private void setStringValue(final String sValue, final BEASTInterface plugin) throws Exception {
+        // figure out the type of T and create object based on T=Integer, T=Double, T=Boolean, T=Valuable
+        if (value instanceof List<?>) {
+            List list = (List) value;
+            list.clear();
+            // remove start and end spaces
+            String sValue2 = sValue.replaceAll("^\\s+", "");
+            sValue2 = sValue2.replaceAll("\\s+$", "");
+            // split into space-separated bits
+            String[] sValues = sValue2.split("\\s+");
+            for (int i = 0; i < sValues.length; i++) {
+                if (theClass.equals(Integer.class)) {
+                    list.add(new Integer(sValues[i % sValues.length]));
+                } else if (theClass.equals(Double.class)) {
+                    list.add(new Double(sValues[i % sValues.length]));
+                } else if (theClass.equals(Boolean.class)) {
+                    String str = sValues[i % sValues.length].toLowerCase();
+                    list.add(str.equals("1") || str.equals("true") || str.equals("yes"));
+                } else if (theClass.equals(String.class)) {
+                    list.add(new String(sValues[i % sValues.length]));
+                }
+            }
+            return;
+        }
+
+        if (theClass.equals(Integer.class)) {
+            value = (T) new Integer(sValue);
+            return;
+        }
+        if (theClass.equals(Double.class)) {
+            value = (T) new Double(sValue);
+            return;
+        }
+        if (theClass.equals(Boolean.class)) {
+            final String sValue2 = sValue.toLowerCase();
+            if (sValue2.equals("yes") || sValue2.equals("true")) {
+                value = (T) Boolean.TRUE;
+                return;
+            } else if (sValue2.equals("no") || sValue2.equals("false")) {
+                value = (T) Boolean.FALSE;
+                return;
+            }
+        }
+        if (theClass.equals(Function.class)) {
+            final RealParameter param = new RealParameter();
+            param.initByName("value", sValue, "upper", 0.0, "lower", 0.0, "dimension", 1);
+            param.initAndValidate();
+            if (value != null && value instanceof List) {
+                ((List) value).add(param);
+            } else {
+                value = (T) param;
+            }
+            param.getOutputs().add(plugin);
+            return;
+        }
+
+        if (theClass.isEnum()) {
+        	if (possibleValues == null) {
+        		possibleValues = (T[]) theClass.getDeclaringClass().getEnumConstants();
+        	}
+            for (final T t : possibleValues) {
+                if (sValue.equals(t.toString())) {
+                    value = t;
+                    return;
+                }
+            }
+            throw new Exception("Input 104: value " + sValue + " not found. Select one of " + Arrays.toString(possibleValues));
+        }
+
+        // call a string constructor of theClass
+        try {
+            Constructor ctor;
+            Object v = sValue;
+            try {
+            	ctor = theClass.getDeclaredConstructor(String.class);
+            } catch (NoSuchMethodException e) {
+            	// we get here if there is not String constructor
+            	// try integer constructor instead
+            	try {
+            		if (sValue.startsWith("0x")) {
+            			v = Integer.parseInt(sValue.substring(2), 16);
+            		} else {
+            			v = Integer.parseInt(sValue);
+            		}
+                	ctor = theClass.getDeclaredConstructor(int.class);
+                	
+            	} catch (NumberFormatException e2) {
+                	// could not parse as integer, try double instead
+            		v = Double.parseDouble(sValue);
+                	ctor = theClass.getDeclaredConstructor(double.class);
+            	}
+            }
+            ctor.setAccessible(true);
+            final Object o = ctor.newInstance(v);
+            if (value != null && value instanceof List) {
+                ((List) value).add(o);
+            } else {
+                value = (T) o;
+            }
+            if (o instanceof BEASTInterface) {
+                ((BEASTInterface) o).getOutputs().add(plugin);
+            }
+        } catch (Exception e) {
+            throw new Exception("Input 103: type mismatch, cannot initialize input '" + getName() +
+                    "' with value '" + sValue + "'.\nExpected something of type " + getType().getName() +
+                    ". " + (e.getMessage() != null ? e.getMessage() : ""));
+        }
+    } // setStringValue
+
+    /**
+     * validate input according to validation rule *
+     *
+     * @throws Exception when validation fails. why not return a string?
+     */
+    public void validate() throws Exception {
+        if (possibleValues != null) {
+            // it is an enumeration, check the value is in the list
+            boolean bFound = false;
+            for (final T value : possibleValues) {
+                if (value.equals(this.value)) {
+                    bFound = true;
+                }
+            }
+            if (!bFound) {
+                throw new Exception("Expected one of " + Arrays.toString(possibleValues) + " but got " + this.value);
+            }
+        }
+
+        switch (rule) {
+            case OPTIONAL:
+                // noting to do
+                break;
+            case REQUIRED:
+                if (get() == null) {
+                    throw new Exception("Input '" + getName() + "' must be specified.");
+                }
+                if (get() instanceof List<?>) {
+                    if (((List<?>) get()).size() == 0) {
+                        throw new Exception("At least one input of name '" + getName() + "' must be specified.");
+                    }
+                }
+                break;
+            case XOR:
+                if (get() == null) {
+                    if (other.get() == null) {
+                        throw new Exception("Either input '" + getName() + "' or '" + other.getName() + "' needs to be specified");
+                    }
+                } else {
+                    if (other.get() != null) {
+                        throw new Exception("Only one of input '" + getName() + "' and '" + other.getName() + "' must be specified (not both)");
+                    }
+                }
+                // noting to do
+                break;
+            case FORBIDDEN:
+                if (get() instanceof List<?>) {
+                    if (((List<?>) get()).size() > 0) {
+                        throw new Exception("No input of name '" + getName() + "' must be specified.");
+                    }
+                } else if (get() != null) {
+                    throw new Exception("Input '" + getName() + "' must not be specified.");
+                }
+                break;
+        }
+    } // validate
+
+} // class Input
diff --git a/src/beast/core/Loggable.java b/src/beast/core/Loggable.java
new file mode 100644
index 0000000..67735fe
--- /dev/null
+++ b/src/beast/core/Loggable.java
@@ -0,0 +1,39 @@
+package beast.core;
+
+import java.io.PrintStream;
+
+/**
+ * @author Andrew Rambaut
+ * @version $Id$
+ */
+
+/**
+ * interface for items that can be logged through a Logger *
+ */
+public interface Loggable {
+
+    /**
+     * write header information, e.g. labels of a parameter,
+     * or Nexus tree preamble
+     *
+     * @param out log stream
+     * @throws Exception
+     */
+    void init(PrintStream out) throws Exception;
+
+    /**
+     * log this sample for current state to PrintStream,
+     * e.g. value of a parameter, list of parameters or Newick tree
+     *
+     * @param nSample chain sample number
+     * @param out     log stream
+     */
+    void log(int nSample, PrintStream out);
+
+    /**
+     * close log. An end of log message can be left (as in End; for Nexus trees)
+     *
+     * @param out log stream
+     */
+    void close(PrintStream out);
+}
diff --git a/src/beast/core/Logger.java b/src/beast/core/Logger.java
new file mode 100644
index 0000000..8a9f97d
--- /dev/null
+++ b/src/beast/core/Logger.java
@@ -0,0 +1,592 @@
+/*
+* File Logger.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+package beast.core;
+
+
+
+import beast.core.Input.Validate;
+import beast.core.util.Log;
+import beast.evolution.tree.Tree;
+import beast.util.XMLProducer;
+
+import java.io.*;
+import java.nio.file.Files;
+import java.nio.file.StandardCopyOption;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+
+ at Description("Logs results of a calculation processes on regular intervals.")
+public class Logger extends BEASTObject {
+    /**
+     * currently supported modes *
+     */
+    public enum LOGMODE {
+        autodetect, compound, tree
+    }
+
+    public enum SORTMODE {
+        none, alphabetic, smart
+    }
+
+    public Input<String> fileNameInput = new Input<String>("fileName", "Name of the file, or stdout if left blank");
+
+    public Input<Integer> everyInput = new Input<Integer>("logEvery", "Number of the samples logged", 1);
+    public Input<BEASTObject> modelInput = new Input<BEASTObject>("model", "Model to log at the top of the log. " +
+            "If specified, XML will be produced for the model, commented out by # at the start of a line. " +
+            "Alignments are suppressed. This way, the log file documents itself. ");
+    public Input<LOGMODE> modeInput = new Input<LOGMODE>("mode", "logging mode, one of " + LOGMODE.values(), LOGMODE.autodetect, LOGMODE.values());
+    public Input<SORTMODE> sortModeInput = new Input<SORTMODE>("sort", "sort items to be logged, one of " + SORTMODE.values(), SORTMODE.none, SORTMODE.values());
+    public Input<Boolean> sanitiseHeadersInput = new Input<Boolean>("sanitiseHeaders", "whether to remove any clutter introduced by Beauti" , false);
+
+    public Input<List<BEASTObject>> loggersInput = new Input<List<BEASTObject>>("log",
+            "Element in a log. This can be any plug in that is Loggable.",
+            new ArrayList<BEASTObject>(), Validate.REQUIRED, Loggable.class);
+
+    // the file name to log to, or null, or "" if logging to stdout
+    private String fileName;
+
+    /**
+     * list of loggers, if any
+     */
+    List<Loggable> loggerList;
+    public enum LogFileMode {
+    	only_new, overwrite, resume, only_new_or_exit
+    }
+    public static LogFileMode FILE_MODE = LogFileMode.only_new;
+    
+    /**
+     * Compound loggers get a sample number printed at the beginning of the line,
+     * while tree loggers don't.
+     */
+    public LOGMODE mode = LOGMODE.compound;
+    
+    /**
+     * offset for the sample number, which is non-zero when a chain is resumed *
+     */
+    static int sampleOffset = -1;
+
+    /**
+     * number of samples between logs *
+     */
+    int every = 1;
+
+    /**
+     * stream to log to
+     */
+    PrintStream m_out;
+
+    /**
+     * keep track of time taken between logs to estimate speed *
+     */
+    long startLogTime = -5;
+    int startSample;
+
+    @Override
+    public void initAndValidate() throws Exception {
+
+        fileName = fileNameInput.get();
+
+        final List<BEASTObject> loggers = loggersInput.get();
+        final int nLoggers = loggers.size();
+        if (nLoggers == 0) {
+            throw new Exception("Logger with nothing to log specified");
+        }
+
+        loggerList = new ArrayList<Loggable>();
+        for (final BEASTObject logger : loggers) {
+            loggerList.add((Loggable) logger);
+        }
+
+        // determine logging mode
+        final LOGMODE sMode = modeInput.get();
+        if (sMode.equals(LOGMODE.autodetect)) {
+            mode = LOGMODE.compound;
+            if (nLoggers == 1 && loggerList.get(0) instanceof Tree) {
+                mode = LOGMODE.tree;
+            }
+        } else if (sMode.equals(LOGMODE.tree)) {
+            mode = LOGMODE.tree;
+        } else if (sMode.equals(LOGMODE.compound)) {
+            mode = LOGMODE.compound;
+        } else {
+            throw new Exception("Mode '" + sMode + "' is not supported. Choose one of " + LOGMODE.values());
+        }
+
+        if (everyInput.get() != null) {
+            every = everyInput.get();
+        }
+        
+        if (mode == LOGMODE.compound) {
+        	switch (sortModeInput.get()) {
+        	case none:
+        		// nothing to do
+       			break;
+        	case alphabetic:
+        		// sort loggers by id
+        		Collections.sort(loggerList, new Comparator<Loggable>() {
+					@Override
+					public int compare(final Loggable o1, final Loggable o2) {
+						final String id1 = ((BEASTObject)o1).getID();
+						final String id2 = ((BEASTObject)o2).getID();  //was o1, probably a bug, found by intelliJ
+						if (id1 == null || id2 == null) {return 0;}
+						return id1.compareTo(id2);
+					}
+				});
+    			break;
+        	case smart:
+        		// Group loggers with same id-prefix, where the prefix of an id is
+        		// defined as the part of an id before the first full stop.
+        		// This way, multi-partition analysis generated by BEAUti get all  
+        		// related log items together in Tracer
+        		final List<String> ids = new ArrayList<String>();
+                for (final Loggable aLoggerList : loggerList) {
+                    String id = ((BEASTObject) aLoggerList).getID();
+                    if (id == null) {
+                        id = "";
+                    }
+                    if (id.indexOf('.') > 0) {
+                        id = id.substring(0, id.indexOf('.'));
+                    }
+                    ids.add(id);
+                }
+        		for (int i = 0; i < loggerList.size(); i++) {
+        			int k = 1;
+        			final String id = ids.get(i);
+        			for (int j = i + 1; j < loggerList.size(); j++) {
+        				if (ids.get(j).equals(id)) {
+        					ids.remove(j);
+        					ids.add(i + k, id);
+        					final Loggable l = loggerList.remove(j);
+        					loggerList.add(i + k, l);
+        					k++;
+        				}
+        			}
+        		}
+    			break;
+        	}
+        }
+    } // initAndValidate
+
+    /**
+     * @return true if this logger is logging to stdout.
+     */
+    public boolean isLoggingToStdout() {
+        return (fileName == null || fileName.length() == 0);
+    }
+
+    /**
+     * initialise log, open file (if necessary) and produce header of log
+     */
+    public void init() throws Exception {
+        final boolean needsHeader = openLogFile();
+        if (needsHeader) {
+            if (modelInput.get() != null) {
+                // print model at top of log
+                String sXML = new XMLProducer().modelToXML(modelInput.get());
+                sXML = "#" + sXML.replaceAll("\\n", "\n#");
+                m_out.println("#\n#model:\n#");
+                m_out.println(sXML);
+                m_out.println("#");
+            }
+            ByteArrayOutputStream baos = null;
+            PrintStream tmp = null;
+            if (m_out == System.out) {
+                tmp = m_out;
+                baos = new ByteArrayOutputStream();
+                m_out = new PrintStream(baos);
+            }
+            final ByteArrayOutputStream rawbaos = new ByteArrayOutputStream();
+            final PrintStream out = new PrintStream(rawbaos);
+            if (mode == LOGMODE.compound) {
+                out.print("Sample\t");
+            }
+            for (final Loggable m_logger : loggerList) {
+                m_logger.init(out);
+            }
+            if (sanitiseHeadersInput.get()) {
+            	m_out.print(sanitiseHeader(rawbaos.toString()));
+            } else {
+            	m_out.print(rawbaos.toString());
+            }
+            
+            if ( baos != null ) {
+                assert tmp == System.out;
+                m_out = tmp;
+                try {
+                    String logContent = baos.toString("ASCII");
+                    logContent = prettifyLogLine(logContent);
+                    m_out.print(logContent);
+                } catch (UnsupportedEncodingException e) {
+                    e.printStackTrace();
+                }
+            }
+            m_out.println();
+        }
+    } // init
+
+    /** remove indicators of partition context from header of a log file **/
+    private String sanitiseHeader(String header) {
+    	// collect partitions
+    	String partitionPrefix = null, clockPrefix = null, sitePrefix = null, treePrefix = null;
+    	for (int i = 0; i < header.length(); i++) {
+    		char c = header.charAt(i);
+    		if (c == '.') {
+    			if (header.charAt(i+2) == ':') {
+    				final char c2 = header.charAt(++i);
+    				i++;
+    				String prefix = "";
+    				while (i < header.length() - 1 && c != '\t') {
+        				c = header.charAt(++i);
+        				if (c != '\t') {
+        					prefix += c;
+        				}
+    				}
+    				switch (c2) {
+    				case 'c':
+    					clockPrefix = getprefix(clockPrefix, prefix);
+    					break;
+    				case 's':
+    					sitePrefix = getprefix(sitePrefix, prefix);
+    					break;
+    				case 't':
+    					treePrefix = getprefix(treePrefix, prefix);
+    					break;
+    				}
+    			} else {
+    				String prefix = "";
+    				while (i < header.length() - 1 && c != '\t') {
+        				c = header.charAt(++i);
+        				if (c != '\t') {
+        					prefix += c;
+        				}
+    				}
+					partitionPrefix = getprefix(partitionPrefix, prefix);
+    			}
+    		}
+    	}
+
+    	// remove clock/site/tree info
+    	header = header.replaceAll("\\." + partitionPrefix, ".");
+    	header = header.replaceAll("\\.c:" + clockPrefix, ".");
+    	header = header.replaceAll("\\.t:" + treePrefix, ".");
+    	header = header.replaceAll("\\.s:" + sitePrefix, ".");
+    	// remove trailing dots on labels
+    	header = header.replaceAll("\\.\\.", ".");
+    	header = header.replaceAll("\\.\t", "\t");
+		return header;
+	}
+
+    /** return longest common prefix of two strings, except when the first
+     * on is null, then it returns the second string.
+     */
+	private String getprefix(final String str1, final String str2) {
+		if (str1 == null) {
+			return str2;
+		} else {
+			String prefix = "";
+			int i = 0;
+			while (i < str1.length() && i < str2.length() && 
+					str1.charAt(i) == str2.charAt(i)) {
+				prefix += str1.charAt(i++);
+			}
+			return prefix;
+		}
+	}
+
+
+	boolean openLogFile() throws Exception {
+        if (isLoggingToStdout()) {
+            m_out = System.out;
+            return true;
+        } else {
+            if (fileName.contains("$(tree)")) {
+            	String treeName = "tree";
+            	for (final Loggable logger : loggerList) {
+            		if (logger instanceof BEASTObject) {
+            			final String id = ((BEASTObject) logger).getID();
+            			if (id.indexOf(".t:") > 0) {
+            				treeName = id.substring(id.indexOf(".t:") + 3); 
+            			}
+            		}
+            	}
+                fileName = fileName.replace("$(tree)", treeName);
+                fileNameInput.setValue(fileName, this);
+            }
+            if (System.getProperty("file.name.prefix") != null) {
+                fileName = System.getProperty("file.name.prefix") + "/" + fileName;
+            }
+            switch (FILE_MODE) {
+                case only_new:// only open file if the file does not already exists
+                case only_new_or_exit: {
+                    final File file = new File(fileName);
+                    if (file.exists()) {
+                        if (FILE_MODE == LogFileMode.only_new_or_exit) {
+                            Log.err.println("Trying to write file " + fileName + " but the file already exists. Exiting now.");
+                            throw new RuntimeException("Use overwrite or resume option, or remove the file");
+                            //System.exit(0);
+                        }
+                        // Check with user what to do next
+                        System.out.println("Trying to write file " + fileName + " but the file already exists (perhaps use the -overwrite flag?).");
+                        System.out.println("Overwrite (Y/N)?:");
+                        System.out.flush();
+                        final BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
+                        final String sMsg = stdin.readLine();
+                        if (!sMsg.toLowerCase().equals("y")) {
+                            System.out.println("Exiting now.");
+                            System.exit(0);
+                        }
+                    }
+                    m_out = new PrintStream(fileName);
+                    Log.info.println("Writing file " + fileName);
+                    return true;
+                }
+                case overwrite:// (over)write log file
+                {
+                    String sMsg = "Writing";
+                    if (new File(fileName).exists()) {
+                        sMsg = "Warning: Overwriting";
+                    }
+                    m_out = new PrintStream(fileName);
+                    Log.warning.println(sMsg + " file " + fileName);
+                    return true;
+                }
+                case resume:// append log file, pick up SampleOffset by reading existing log
+                {
+                    final File file = new File(fileName);
+                    if (file.exists()) {
+                        if (mode == LOGMODE.compound) {
+                            // first find the sample nr offset
+                            final BufferedReader fin = new BufferedReader(new FileReader(fileName));
+                            String sStr = null;
+                            while (fin.ready()) {
+                                sStr = fin.readLine();
+                            }
+                            fin.close();
+                            assert sStr != null;
+                            final int nSampleOffset = Integer.parseInt(sStr.split("\\s")[0]);
+                            if (sampleOffset > 0 && nSampleOffset != sampleOffset) {
+                                throw new Exception("Error 400: Cannot resume: log files do not end in same sample number");
+                            }
+                            sampleOffset = nSampleOffset;
+                            // open the file for appending
+                            final FileOutputStream out2 = new FileOutputStream(fileName, true);
+                            m_out = new PrintStream(out2);
+                        } else {
+                            // it is a tree logger, we may need to get rid of the last line!
+
+                            // back up file in case something goes wrong (e.g. an out of memory error occurs)
+                            final File treeFileBackup = new File(fileName);
+                            
+                            //final boolean ok = treeFileBackup.renameTo(new File(fileName + ".bu"));    assert ok;
+                            Files.move(treeFileBackup.toPath(), new File(fileName+".bu").toPath(), StandardCopyOption.ATOMIC_MOVE);
+                            // open the file and write back all but the last line
+                            final BufferedReader fin = new BufferedReader(new FileReader(fileName+".bu"));
+
+                            final FileOutputStream out2 = new FileOutputStream(fileName);
+                            m_out = new PrintStream(out2);
+
+                            //final StringBuilder buf = new StringBuilder();
+                            String sStrLast = null;
+                            //String sStr = fin.readLine();
+                            boolean endSeen = false;
+                            while (fin.ready()) {
+                                if( endSeen ) {
+                                    m_out.println("End;");
+                                    endSeen = false;
+                                }
+                                final String sStr = fin.readLine();
+                                if (!sStr.equals("End;")) {
+                                	m_out.println(sStr);
+                                    sStrLast = sStr;
+                                } else {
+                                    endSeen = true;
+                                }
+                            }
+                            fin.close();
+
+                            // determine number of the last sample
+                            if( sStrLast == null ) {
+                                // empty log file?
+                                 throw new Exception("Error 402: empty tree log file " + fileName + "? (check if there is a back up file " + fileName + ".bu)");
+                            }
+                            final String sStr = sStrLast.split("\\s+")[1];
+                            final int nSampleOffset = Integer.parseInt(sStr.substring(6));
+                            if (sampleOffset > 0 && nSampleOffset != sampleOffset) {
+                                //final boolean ok1 = treeFileBackup.renameTo(new File(fileName));        assert ok1;
+                                Files.move(treeFileBackup.toPath(), new File(fileName).toPath(), StandardCopyOption.ATOMIC_MOVE);
+                                throw new Exception("Error 401: Cannot resume: log files do not end in same sample number");
+                            }
+                            sampleOffset = nSampleOffset;
+                            // it is safe to remove the backup file now
+                            new File(fileName + ".bu").delete();
+                        }
+                        Log.info.println("Appending file " + fileName);
+                        return false;
+                    } else {
+                        m_out = new PrintStream(fileName);
+                        Log.info.println("Writing file " + fileName);
+                        return true;
+                    }
+                }
+                default:
+                    throw new Exception("DEVELOPER ERROR: unknown file mode for logger " + FILE_MODE);
+            }
+        }
+    } // openLogFile
+
+    /**
+     * log the state for given sample nr
+     * *
+     * * @param nSample
+     */
+    public void log(int nSample) {
+        if ((nSample < 0) || (nSample % every > 0)) {
+            return;
+        }
+        if (sampleOffset >= 0) {
+            if (nSample == 0) {
+                // don't need to duplicate the last line in the log
+                return;
+            }
+            nSample += sampleOffset;
+        }
+        ByteArrayOutputStream baos = null;
+        PrintStream tmp = null;
+        if (m_out == System.out) {
+            tmp = m_out;
+            baos = new ByteArrayOutputStream();
+            m_out = new PrintStream(baos);
+        }
+        if (mode == LOGMODE.compound) {
+            m_out.print((nSample) + "\t");
+        }
+        for (final Loggable m_logger : loggerList) {
+            m_logger.log(nSample, m_out);
+        }
+        if ( baos != null ) {
+            assert tmp == System.out ;
+
+            m_out = tmp;
+            try {
+                String logContent = baos.toString("ASCII");
+                logContent = prettifyLogLine(logContent);
+                m_out.print(logContent);
+            } catch (UnsupportedEncodingException e) {
+                e.printStackTrace();
+            }
+            if (startLogTime < 0) {
+                if (nSample - sampleOffset > 6000) {
+                    startLogTime++;
+                    if (startLogTime == 0) {
+                        startLogTime = System.currentTimeMillis();
+                        startSample = nSample;
+                    }
+                }
+                m_out.print(" --");
+            } else {
+
+                final long nLogTime = System.currentTimeMillis();
+                final int nSecondsPerMSamples = (int) ((nLogTime - startLogTime) * 1000.0 / (nSample - startSample + 1.0));
+                final String sTimePerMSamples =
+                        (nSecondsPerMSamples >= 3600 ? nSecondsPerMSamples / 3600 + "h" : "") +
+                                (nSecondsPerMSamples >= 60 ? (nSecondsPerMSamples % 3600) / 60 + "m" : "") +
+                                (nSecondsPerMSamples % 60 + "s");
+                m_out.print(" " + sTimePerMSamples + "/Msamples");
+            }
+        }
+        m_out.println();
+    } // log
+
+
+    private String prettifyLogLine(String logContent) {
+        final String[] sStrs = logContent.split("\t");
+        logContent = "";
+        for (final String sStr : sStrs) {
+            logContent += prettifyLogEntry(sStr);
+        }
+        return logContent;
+    }
+
+    private String prettifyLogEntry(String sStr) {
+        // TODO Q2R intelliJ says \\ can't be used in a range ...
+        if (sStr.matches("[\\d-E]+\\.[\\d-E]+")) {
+            // format as double
+            if (sStr.contains("E")) {
+                if (sStr.length() > 15) {
+                    final String[] sStrs = sStr.split("E");
+                    return " " + sStrs[0].substring(0, 15 - sStrs[1].length() - 2) + "E" + sStrs[1];
+                } else {
+                    return "               ".substring(sStr.length()) + sStr;
+                }
+            }
+            final String s1 = sStr.substring(0, sStr.indexOf("."));
+            String s2 = sStr.substring(sStr.indexOf(".") + 1);
+            while (s2.length() < 4) {
+                s2 = s2 + " ";
+            }
+            s2 = s2.substring(0, 4);
+            sStr = s1 + "." + s2;
+            sStr = "               ".substring(sStr.length()) + sStr;
+        } else if (sStr.length() < 15) {
+            // format integer, boolean
+            sStr = "               ".substring(sStr.length()) + sStr;
+        } else {
+            sStr = " " + sStr;
+        }
+        int nOverShoot = sStr.length() - 15;
+        while (nOverShoot > 0 && sStr.length() > 2 && sStr.charAt(1) == ' ') {
+            sStr = sStr.substring(1);
+            nOverShoot--;
+        }
+        if (nOverShoot > 0) {
+            sStr = sStr.substring(0, 8) + "_" + sStr.substring(sStr.length() - 6);
+        }
+        return sStr;
+    }
+
+
+    /**
+     * stop logging, produce end of log message and close file (if necessary) *
+     */
+    public void close() {
+        for (final Loggable m_logger : loggerList) {
+            m_logger.close(m_out);
+        }
+
+        if (m_out != System.out) {
+            // close all file, except stdout
+            m_out.close();
+        }
+    } // close
+
+
+    public static int getSampleOffset() {
+        return sampleOffset < 0 ? 0 : sampleOffset;
+    }
+
+} // class Logger
diff --git a/src/beast/core/MCMC.java b/src/beast/core/MCMC.java
new file mode 100644
index 0000000..be60f0d
--- /dev/null
+++ b/src/beast/core/MCMC.java
@@ -0,0 +1,575 @@
+/*
+* File MCMC.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+package beast.core;
+
+import beast.core.util.CompoundDistribution;
+import beast.core.util.Evaluator;
+import beast.core.util.Log;
+import beast.util.Randomizer;
+
+import java.util.*;
+
+ at Description("MCMC chain. This is the main element that controls which posterior " +
+        "to calculate, how long to run the chain and all other properties, " +
+        "which operators to apply on the state space and where to log results.")
+ at Citation(value=
+        "Bouckaert RR, Heled J, Kuehnert D, Vaughan TG, Wu C-H, Xie D, Suchard MA,\n" +
+                "  Rambaut A, Drummond AJ (2014) BEAST 2: A software platform for Bayesian\n" +
+                "  evolutionary analysis. PLoS Computational Biology 10(4): e1003537"
+        , year = 2014, firstAuthorSurname = "bouckaert",
+        DOI="10.1371/journal.pcbi.1003537")
+public class MCMC extends Runnable {
+
+    public Input<Integer> chainLengthInput =
+            new Input<Integer>("chainLength", "Length of the MCMC chain i.e. number of samples taken in main loop",
+                    Input.Validate.REQUIRED);
+
+    public Input<State> startStateInput =
+            new Input<State>("state", "elements of the state space");
+
+    public Input<List<StateNodeInitialiser>> initialisersInput =
+            new Input<List<StateNodeInitialiser>>("init", "one or more state node initilisers used for determining " +
+                    "the start state of the chain",
+                    new ArrayList<StateNodeInitialiser>());
+
+    public Input<Integer> storeEveryInput =
+            new Input<Integer>("storeEvery", "store the state to disk every X number of samples so that we can " +
+                    "resume computation later on if the process failed half-way.", -1);
+
+    public Input<Integer> burnInInput =
+            new Input<Integer>("preBurnin", "Number of burn in samples taken before entering the main loop", 0);
+
+
+    public Input<Integer> numInitializationAttempts =
+            new Input<Integer>("numInitializationAttempts", "Number of initialization attempts before failing (default=10)", 10);
+
+    public Input<Distribution> posteriorInput =
+            new Input<Distribution>("distribution", "probability distribution to sample over (e.g. a posterior)",
+                    Input.Validate.REQUIRED);
+
+    public Input<List<Operator>> operatorsInput =
+            new Input<List<Operator>>("operator", "operator for generating proposals in MCMC state space",
+                    new ArrayList<Operator>());//, Input.Validate.REQUIRED);
+
+    public Input<List<Logger>> loggersInput =
+            new Input<List<Logger>>("logger", "loggers for reporting progress of MCMC chain",
+                    new ArrayList<Logger>(), Input.Validate.REQUIRED);
+
+    public Input<Boolean> sampleFromPriorInput = new Input<Boolean>("sampleFromPrior", "whether to ignore the likelihood when sampling (default false). " +
+            "The distribution with id 'likelihood' in the posterior input will be ignored when this flag is set.", false);
+
+    public Input<OperatorSchedule> operatorScheduleInput = new Input<OperatorSchedule>("operatorschedule", "specify operator selection and optimisation schedule", new OperatorSchedule());
+
+    /**
+     * Alternative representation of operatorsInput that allows random selection
+     * of operators and calculation of statistics.
+     */
+    protected OperatorSchedule operatorSchedule;
+
+    /**
+     * The state that takes care of managing StateNodes,
+     * operations on StateNodes and propagates store/restore/requireRecalculation
+     * calls to the appropriate Plugins.
+     */
+    protected State state;
+
+    /**
+     * number of samples taken where calculation is checked against full
+     * recalculation of the posterior. Note that after every proposal that
+     * is checked, there are 2 that are not checked. This allows errors
+     * in store/restore to be detected that cannot be found when every single
+     * consecutive sample is checked.
+     * So, only after 3*NR_OF_DEBUG_SAMPLES samples checking is stopped.
+     */
+    final protected int NR_OF_DEBUG_SAMPLES = 2000;
+
+    /**
+     * Interval for storing state to disk, if negative the state will not be stored periodically *
+     * Mirrors m_storeEvery input, or if this input is negative, the State.m_storeEvery input
+     */
+    protected int storeEvery;
+
+    public MCMC() {
+    }
+
+    /**
+     * Constructor for MCMC chain.
+     *
+     * @param chainLength
+     * @param state
+     * @param storeEvery
+     * @param preBurnin
+     * @param posterior
+     * @param operators
+     * @param loggers
+     * @throws Exception
+     */
+    public MCMC(
+            @Param(name = "chainLength", description = "Length of the MCMC chain i.e. number of samples taken in main loop") int chainLength,
+            @Param(name = "state", description = "elements of the state space") State state,
+            @Param(name = "initialisers", description = "one or more state node initilisers used for determining the start state of the chain") List<StateNodeInitialiser> initialisers,
+            @Param(name = "storeEvery", description = "store the state to disk every X number of samples so that we can resume computation later on if the process failed half-way.") int storeEvery,
+            @Param(name = "preBurnin", description = "Number of burn in samples taken before entering the main loop", defaultValue = "0") int preBurnin,
+            @Param(name = "posterior", description = "probability distribution to sample over (e.g. a posterior)") Distribution posterior,
+            @Param(name = "operators", description = "operator for generating proposals in MCMC state space") List<Operator> operators,
+            @Param(name = "loggers", description = "loggers for reporting progress of MCMC chain") List<Logger> loggers,
+            @Param(name = "sampleFromPrior", description = "whether to ignore the likelihood when sampling (default false). The distribution with id 'likelihood' in the posterior input will be ignored when this flag is set.", defaultValue = "false") boolean sampleFromPrior,
+            @Param(name = "operatorSchedule", description = "specify operator selection and optimisation schedule", optional = true) OperatorSchedule operatorSchedule) {
+
+        try {
+            initByName(
+                    "chainLength", chainLength,
+                    "state", state,
+                    "initialisers", initialisers,
+                    "storeEvery", storeEvery,
+                    "preBurnin", preBurnin,
+                    "distribution", posterior,
+                    "operator", operators,
+                    "logger", loggers,
+                    "sampleFromPrior", sampleFromPrior,
+                    "operatorSchedule", operatorSchedule
+            );
+        } catch (Exception e) {
+            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+            throw new RuntimeException();
+        }
+    }
+
+    @Override
+    public void initAndValidate() throws Exception {
+        Log.info.println("===============================================================================");
+        Log.info.println("Citations for this model:");
+        Log.info.println(getCitations());
+        Log.info.println("===============================================================================");
+
+        operatorSchedule = operatorScheduleInput.get();
+        for (final Operator op : operatorsInput.get()) {
+            operatorSchedule.addOperator(op);
+        }
+
+        if (sampleFromPriorInput.get()) {
+            // remove plugin with id likelihood from posterior, if it is a CompoundDistribution
+            if (posteriorInput.get() instanceof CompoundDistribution) {
+                final CompoundDistribution posterior = (CompoundDistribution) posteriorInput.get();
+                final List<Distribution> distrs = posterior.pDistributions.get();
+                final int nDistr = distrs.size();
+                for (int i = 0; i < nDistr; i++) {
+                    final Distribution distr = distrs.get(i);
+                    final String sID = distr.getID();
+                    if (sID != null && sID.equals("likelihood")) {
+                        distrs.remove(distr);
+                        break;
+                    }
+                }
+                if (distrs.size() == nDistr) {
+                    throw new Exception("Sample from prior flag is set, but distribution with id 'likelihood' is " +
+                            "not an input to posterior.");
+                }
+            } else {
+                throw new Exception("Don't know how to sample from prior since posterior is not a compound distribution. " +
+                        "Suggestion: set sampleFromPrior flag to false.");
+            }
+        }
+
+
+        // StateNode initialisation, only required when the state is not read from file
+        if (restoreFromFile) {
+            final HashSet<StateNode> initialisedStateNodes = new HashSet<StateNode>();
+            for (final StateNodeInitialiser initialiser : initialisersInput.get()) {
+                // make sure that the initialiser does not re-initialises a StateNode
+                final List<StateNode> list = new ArrayList<StateNode>(1);
+                initialiser.getInitialisedStateNodes(list);
+                for (final StateNode stateNode : list) {
+                    if (initialisedStateNodes.contains(stateNode)) {
+                        throw new Exception("Trying to initialise stateNode (id=" + stateNode.getID() + ") more than once. " +
+                                "Remove an initialiser from MCMC to fix this.");
+                    }
+                }
+                initialisedStateNodes.addAll(list);
+                // do the initialisation
+                //initialiser.initStateNodes();
+            }
+        }
+
+        // State initialisation
+        final HashSet<StateNode> operatorStateNodes = new HashSet<StateNode>();
+        for (final Operator op : operatorsInput.get()) {
+            for (final StateNode stateNode : op.listStateNodes()) {
+                operatorStateNodes.add(stateNode);
+            }
+        }
+        if (startStateInput.get() != null) {
+            this.state = startStateInput.get();
+            if (storeEveryInput.get() > 0) {
+                this.state.m_storeEvery.setValue(storeEveryInput.get(), this.state);
+            }
+        } else {
+            // create state from scratch by collecting StateNode inputs from Operators
+            this.state = new State();
+            for (final StateNode stateNode : operatorStateNodes) {
+                this.state.stateNodeInput.setValue(stateNode, this.state);
+            }
+            this.state.m_storeEvery.setValue(storeEveryInput.get(), this.state);
+        }
+
+        // grab the interval for storing the state to file
+        if (storeEveryInput.get() > 0) {
+            storeEvery = storeEveryInput.get();
+        } else {
+            storeEvery = state.m_storeEvery.get();
+        }
+
+        this.state.initialise();
+        this.state.setPosterior(posteriorInput.get());
+
+        // sanity check: all operator state nodes should be in the state
+        final List<StateNode> stateNodes = this.state.stateNodeInput.get();
+        for (final Operator op : operatorsInput.get()) {
+            for (final StateNode stateNode : op.listStateNodes()) {
+                if (!stateNodes.contains(stateNode)) {
+                    throw new Exception("Operator " + op.getID() + " has a statenode " + stateNode.getID() + " in its inputs that is missing from the state.");
+                }
+            }
+        }
+        // sanity check: all state nodes should be operated on
+        for (final StateNode stateNode : stateNodes) {
+            if (!operatorStateNodes.contains(stateNode)) {
+                System.out.println("Warning: state contains a node " + stateNode.getID() + " for which there is no operator.");
+            }
+        }
+    } // init
+
+    public void log(final int sampleNr) {
+        for (final Logger log : loggers) {
+            log.log(sampleNr);
+        }
+    } // log
+
+    public void close() {
+        for (final Logger log : loggers) {
+            log.close();
+        }
+    } // close
+
+    protected double logAlpha;
+    protected boolean debugFlag;
+    protected double oldLogLikelihood;
+    protected double newLogLikelihood;
+    protected int burnIn;
+    protected int chainLength;
+    protected Distribution posterior;
+
+    protected List<Logger> loggers;
+
+    @Override
+    public void run() throws Exception {
+        // set up state (again). Other plugins may have manipulated the
+        // StateNodes, e.g. set up bounds or dimensions
+        state.initAndValidate();
+        // also, initialise state with the file name to store and set-up whether to resume from file
+        state.setStateFileName(stateFileName);
+        operatorSchedule.setStateFileName(stateFileName);
+
+        burnIn = burnInInput.get();
+        chainLength = chainLengthInput.get();
+        int nInitialisationAttempts = 0;
+        state.setEverythingDirty(true);
+        posterior = posteriorInput.get();
+
+        if (restoreFromFile) {
+            state.restoreFromFile();
+            operatorSchedule.restoreFromFile();
+            burnIn = 0;
+            oldLogLikelihood = state.robustlyCalcPosterior(posterior);
+        } else {
+            do {
+                for (final StateNodeInitialiser initialiser : initialisersInput.get()) {
+                    initialiser.initStateNodes();
+                }
+                oldLogLikelihood = state.robustlyCalcPosterior(posterior);
+                nInitialisationAttempts += 1;
+            } while (Double.isInfinite(oldLogLikelihood) && nInitialisationAttempts < numInitializationAttempts.get());
+        }
+        final long startTime = System.currentTimeMillis();
+
+        // do the sampling
+        logAlpha = 0;
+        debugFlag = Boolean.valueOf(System.getProperty("beast.debug"));
+
+
+//        System.err.println("Start state:");
+//        System.err.println(state.toString());
+
+        System.err.println("Start likelihood: " + oldLogLikelihood + " " + (nInitialisationAttempts > 1 ? "after " + nInitialisationAttempts + " initialisation attempts" : ""));
+        if (Double.isInfinite(oldLogLikelihood) || Double.isNaN(oldLogLikelihood)) {
+            reportLogLikelihoods(posterior, "");
+            throw new Exception("Could not find a proper state to initialise. Perhaps try another seed.");
+        }
+
+        loggers = loggersInput.get();
+
+        // put the loggers logging to stdout at the bottom of the logger list so that screen output is tidier.
+        Collections.sort(loggers, (o1, o2) -> {
+            if (o1.isLoggingToStdout()) {
+                return o2.isLoggingToStdout() ? 0 : 1;
+            } else {
+                return o2.isLoggingToStdout() ? -1 : 0;
+            }
+        });
+        // warn if none of the loggers is to stdout, so no feedback is given on screen
+        boolean hasStdOutLogger = false;
+        boolean hasScreenLog = false;
+        for (Logger l : loggers) {
+        	if (l.isLoggingToStdout()) {
+        		hasStdOutLogger = true;
+        	}
+        	if (l.getID() != null && l.getID().equals("screenlog")) {
+        		hasScreenLog = true;
+        	}
+        }
+        if (!hasStdOutLogger) {
+        	Log.warning.println("WARNING: If nothing seems to be happening on screen this is because none of the loggers give feedback to screen.");
+        	if (hasScreenLog) {
+        		Log.warning.println("WARNING: This happens when a filename  is specified for the 'screenlog' logger.");
+        		Log.warning.println("WARNING: To get feedback to screen, leave the filename for screenlog blank.");
+        		Log.warning.println("WARNING: Otherwise, the screenlog is saved into the specified file.");
+        	}
+        }
+
+        // initialises log so that log file headers are written, etc.
+        for (final Logger log : loggers) {
+            log.init();
+        }
+
+        doLoop();
+
+        System.out.println();
+        operatorSchedule.showOperatorRates(System.out);
+
+        System.out.println();
+        final long endTime = System.currentTimeMillis();
+        System.out.println("Total calculation time: " + (endTime - startTime) / 1000.0 + " seconds");
+        close();
+
+        System.err.println("End likelihood: " + oldLogLikelihood);
+//        System.err.println(state);
+        state.storeToFile(chainLength);
+        operatorSchedule.storeToFile();
+        //Randomizer.storeToFile(stateFileName);
+    } // run;
+
+
+    /**
+     * main MCMC loop *
+     */
+    protected void doLoop() throws Exception {
+        int corrections = 0;
+        if (burnIn > 0) {
+        	Log.warning.println("Please wait while BEAST takes " + burnIn + " pre-burnin samples");
+        }
+        for (int sampleNr = -burnIn; sampleNr <= chainLength; sampleNr++) {
+            final int currentState = sampleNr;
+
+            state.store(currentState);
+//            if (m_nStoreEvery > 0 && iSample % m_nStoreEvery == 0 && iSample > 0) {
+//                state.storeToFile(iSample);
+//            	operatorSchedule.storeToFile();
+//            }
+
+            final Operator operator = operatorSchedule.selectOperator();
+            //System.out.print("\n" + sampleNr + " " + operator.getName()+ ":");
+
+            final Distribution evaluatorDistribution = operator.getEvaluatorDistribution();
+            Evaluator evaluator = null;
+
+            if (evaluatorDistribution != null) {
+                evaluator = new Evaluator() {
+                    @Override
+                    public double evaluate() {
+                        double logP = 0.0;
+
+                        state.storeCalculationNodes();
+                        state.checkCalculationNodesDirtiness();
+
+                        try {
+                            logP = evaluatorDistribution.calculateLogP();
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                            System.exit(1);
+                        }
+
+                        state.restore();
+                        state.store(currentState);
+
+                        return logP;
+                    }
+                };
+            }
+
+            final double logHastingsRatio = operator.proposal(evaluator);
+
+            if (logHastingsRatio != Double.NEGATIVE_INFINITY) {
+
+            	if (operator.requiresStateInitialisation()) {
+            		state.storeCalculationNodes();
+            		state.checkCalculationNodesDirtiness();
+            	}
+
+                newLogLikelihood = posterior.calculateLogP();
+
+                logAlpha = newLogLikelihood - oldLogLikelihood + logHastingsRatio; //CHECK HASTINGS
+                //System.out.println(logAlpha + " " + newLogLikelihood + " " + oldLogLikelihood);
+                if (logAlpha >= 0 || Randomizer.nextDouble() < Math.exp(logAlpha)) {
+                    // accept
+                    oldLogLikelihood = newLogLikelihood;
+                    state.acceptCalculationNodes();
+
+                    if (sampleNr >= 0) {
+                        operator.accept();
+                    }
+                    //System.out.print(" accept");
+                } else {
+                    // reject
+                    if (sampleNr >= 0) {
+                        operator.reject(newLogLikelihood == Double.NEGATIVE_INFINITY ? -1 : 0);
+                    }
+                    state.restore();
+                    state.restoreCalculationNodes();
+                    //System.out.print(" reject");
+                }
+                state.setEverythingDirty(false);
+            } else {
+                // operation failed
+                if (sampleNr >= 0) {
+                    operator.reject(-2);
+                }
+                state.restore();
+				if (!operator.requiresStateInitialisation()) {
+                    state.setEverythingDirty(false);
+                    state.restoreCalculationNodes();
+				}
+                //System.out.print(" direct reject");
+            }
+            log(sampleNr);
+
+            if (debugFlag && sampleNr % 3 == 0 || sampleNr % 10000 == 0) {
+                // check that the posterior is correctly calculated at every third
+                // sample, as long as we are in debug mode
+            	final double fNonStochasticLogP = posterior.getNonStochasticLogP();
+                final double fLogLikelihood = state.robustlyCalcNonStochasticPosterior(posterior);
+                if (Math.abs(fLogLikelihood - fNonStochasticLogP) > 1e-6) {
+                    reportLogLikelihoods(posterior, "");
+                    System.err.println("At sample " + sampleNr + "\nLikelihood incorrectly calculated: " + fNonStochasticLogP + " != " + fLogLikelihood
+                            + " Operator: " + operator.getClass().getName());
+                }
+                if (sampleNr > NR_OF_DEBUG_SAMPLES * 3) {
+                    // switch off debug mode once a sufficient large sample is checked
+                    debugFlag = false;
+                    if (Math.abs(fLogLikelihood - fNonStochasticLogP) > 1e-6) {
+                        // incorrect calculation outside debug period.
+                        // This happens infrequently enough that it should repair itself after a robust posterior calculation
+                        corrections++;
+                        if (corrections > 100) {
+                            // after 100 repairs, there must be something seriously wrong with the implementation
+                            System.err.println("Too many corrections. There is something seriously wrong that cannot be corrected");
+                            state.storeToFile(sampleNr);
+                            operatorSchedule.storeToFile();
+                            System.exit(0);
+                        }
+                        oldLogLikelihood = state.robustlyCalcPosterior(posterior);;
+                    }
+                } else {
+                    if (Math.abs(fLogLikelihood - fNonStochasticLogP) > 1e-6) {
+                        // halt due to incorrect posterior during intial debug period
+                        state.storeToFile(sampleNr);
+                        operatorSchedule.storeToFile();
+                        System.exit(0);
+                    }
+                }
+            } else {
+                if (sampleNr >= 0) {
+                	operator.optimize(logAlpha);
+                }
+            }
+            callUserFunction(sampleNr);
+
+            // make sure we always save just before exiting
+            if (storeEvery > 0 && (sampleNr + 1) % storeEvery == 0 || sampleNr == chainLength) {
+                /*final double fLogLikelihood = */
+                state.robustlyCalcNonStochasticPosterior(posterior);
+                state.storeToFile(sampleNr);
+                operatorSchedule.storeToFile();
+            }
+        }
+        if (corrections > 0) {
+            System.err.println("\n\nNB: " + corrections + " posterior calculation corrections were required. This analysis may not be valid!\n\n");
+        }
+    }
+
+    /**
+     * report posterior and subcomponents recursively, for debugging
+     * incorrectly recalculated posteriors *
+     */
+    protected void reportLogLikelihoods(final Distribution distr, final String tabString) {
+        System.err.println(tabString + "P(" + distr.getID() + ") = " + distr.logP + " (was " + distr.storedLogP + ")");
+        if (distr instanceof CompoundDistribution) {
+            for (final Distribution distr2 : ((CompoundDistribution) distr).pDistributions.get()) {
+                reportLogLikelihoods(distr2, tabString + "\t");
+            }
+        }
+    }
+
+    protected void callUserFunction(final int iSample) {
+    }
+
+
+    /**
+     * Calculate posterior by setting all StateNodes and CalculationNodes dirty.
+     * Clean everything afterwards.
+     */
+    public double robustlyCalcPosterior(final Distribution posterior) throws Exception {
+        return state.robustlyCalcPosterior(posterior);
+    }
+
+    
+    /**
+     * Calculate posterior by setting all StateNodes and CalculationNodes dirty.
+     * Clean everything afterwards.
+     */
+    public double robustlyCalcNonStochasticPosterior(final Distribution posterior) throws Exception {
+        return state.robustlyCalcNonStochasticPosterior(posterior);
+    }
+    //        state.store(-1);
+//        state.setEverythingDirty(true);
+//        //state.storeCalculationNodes();
+//        state.checkCalculationNodesDirtiness();
+//        double fLogLikelihood = posterior.calculateLogP();
+//        state.setEverythingDirty(false);
+//        state.acceptCalculationNodes();
+//        return fLogLikelihood;
+//    }
+
+} // class MCMC
+
diff --git a/src/beast/core/Operator.java b/src/beast/core/Operator.java
new file mode 100644
index 0000000..5100c50
--- /dev/null
+++ b/src/beast/core/Operator.java
@@ -0,0 +1,309 @@
+/*
+* File Operator.java
+*
+* Copyright (C) 2011 BEAST2 Core Team
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+package beast.core;
+
+
+import beast.core.Input.Validate;
+import beast.core.util.Evaluator;
+import org.json.JSONObject;
+import org.json.JSONWriter;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.List;
+
+ at Description("Proposes a move in state space.")
+public abstract class Operator extends BEASTObject {
+    public Input<Double> m_pWeight = new Input<Double>("weight", "weight with which this operator is selected", Validate.REQUIRED);
+
+    private final String STANDARD_OPERATOR_PACKAGE = "beast.evolution.operators";
+
+    /**
+     * the schedule used for auto optimisation *
+     */
+    OperatorSchedule operatorSchedule;
+
+    public void setOperatorSchedule(final OperatorSchedule operatorSchedule) {
+        this.operatorSchedule = operatorSchedule;
+    }
+
+    /**
+     * Implement this for proposing new states based on evaluations of
+     * a distribution. By default it returns null but can be overridden
+     * to implement more complex proposals.
+     *
+     * @return a distribution or null if not required
+     */
+    public Distribution getEvaluatorDistribution() {
+        return null;
+    }
+
+    /**
+     * Implement this for proposing a new State.
+     * The proposal is responsible for keeping the State valid,
+     * and if the State becomes invalid (e.g. a parameter goes out
+     * of its range) Double.NEGATIVE_INFINITY should be returned.
+     * <p>
+     * If the operator is a Gibbs operator, hence the proposal should
+     * always be accepted, the method should return Double.POSITIVE_INFINITY.
+     *
+     * @param evaluator An evaluator object that can be use to repetitively
+     *                  used to evaluate the distributribution returned by getEvaluatorDistribution().
+     * @return log of Hastings Ratio, or Double.NEGATIVE_INFINITY if proposal
+     * should not be accepted (because the proposal is invalid) or
+     * Double.POSITIVE_INFINITY if the proposal should always be accepted
+     * (for Gibbs operators).
+     */
+    public double proposal(final Evaluator evaluator) {
+        return proposal();
+    }
+
+    /**
+     * Implement this for proposing a new State.
+     * The proposal is responsible for keeping the State valid,
+     * and if the State becomes invalid (e.g. a parameter goes out
+     * of its range) Double.NEGATIVE_INFINITY should be returned.
+     * <p>
+     * If the operator is a Gibbs operator, hence the proposal should
+     * always be accepted, the method should return Double.POSITIVE_INFINITY.
+     *
+     * @return log of Hastings Ratio, or Double.NEGATIVE_INFINITY if proposal
+     * should not be accepted (because the proposal is invalid) or
+     * Double.POSITIVE_INFINITY if the proposal should always be accepted
+     * (for Gibbs operators).
+     */
+    abstract public double proposal();
+
+    /**
+     * @return the relative weight which determines the probability this proposal is chosen
+     * from among all the available proposals
+     */
+    public double getWeight() {
+        return m_pWeight.get();
+    }
+
+    public String getName() {
+
+        String className = this.getClass().getName();
+        if (className.startsWith(STANDARD_OPERATOR_PACKAGE)) {
+            className = className.substring(STANDARD_OPERATOR_PACKAGE.length() + 1);
+        }
+        return className + "(" + (getID() != null ? getID() : "") + ")";
+    }
+
+    /**
+     * keep statistics of how often this operator was used, accepted or rejected *
+     */
+    protected int m_nNrRejected = 0;
+    protected int m_nNrAccepted = 0;
+    protected int m_nNrRejectedForCorrection = 0;
+    protected int m_nNrAcceptedForCorrection = 0;
+
+    private final boolean detailedRejection = false;
+    // rejected because likelihood is infinite
+    protected int m_nNrRejectedInvalid = 0;
+    // rejected because operator failed (sub-group of above)
+    protected int m_nNrRejectedOperator = 0;
+
+    public void accept() {
+        m_nNrAccepted++;
+        if (operatorSchedule.autoOptimizeDelayCount >= operatorSchedule.autoOptimizeDelay) {
+            m_nNrAcceptedForCorrection++;
+        }
+    }
+
+    public void reject() {
+        reject(0); // silly hack
+    }
+
+    // 0 like finite  -1 like -inf -2 operator failed
+    public void reject(final int reason) {
+        m_nNrRejected++;
+        if (reason < 0) {
+            ++m_nNrRejectedInvalid;
+            if (reason == -2) {
+                ++m_nNrRejectedOperator;
+            }
+        }
+        if (operatorSchedule.autoOptimizeDelayCount >= operatorSchedule.autoOptimizeDelay) {
+            m_nNrRejectedForCorrection++;
+        }
+    }
+
+    /**
+     * called after every invocation of this operator to see whether
+     * a parameter can be optimised for better acceptance hence faster
+     * mixing
+     *
+     * @param logAlpha difference in posterior between previous state & proposed state + hasting ratio
+     */
+    public void optimize(final double logAlpha) {
+        // must be overridden by operator implementation to have an effect
+    }
+
+    /**
+     * @param logAlpha difference in posterior between previous state & proposed state + hasting ratio
+     * @return change of value of a parameter for MCMC chain optimisation
+     */
+    protected double calcDelta(final double logAlpha) {
+        return operatorSchedule.calcDelta(this, logAlpha);
+    } // calcDelta
+
+    /**
+     * @return target for automatic operator optimisation
+     */
+    public double getTargetAcceptanceProbability() {
+        return 0.234;
+    }
+
+    /**
+     * @return value changed through automatic operator optimisation
+     */
+    public double getCoercableParameterValue() {
+        return Double.NaN;
+    }
+
+    /**
+     * set value that changed through automatic operator optimisation
+     *
+     * @param fValue
+     */
+    public void setCoercableParameterValue(final double fValue) {
+    }
+
+    /**
+     * return directions on how to set operator parameters, if any *
+     *
+     * @return
+     */
+    public String getPerformanceSuggestion() {
+        return "";
+    }
+
+    /**
+     * return list of state nodes that this operator operates on.
+     * state nodes that are input to the operator but are never changed
+     * in a proposal should not be listed
+     */
+    public List<StateNode> listStateNodes() throws Exception {
+        // pick up all inputs that are stateNodes that are estimated
+        final List<StateNode> list = new ArrayList<StateNode>();
+        for (BEASTInterface o : listActivePlugins()) {
+            if (o instanceof StateNode) {
+                final StateNode stateNode = (StateNode) o;
+                if (stateNode.isEstimatedInput.get()) {
+                    list.add(stateNode);
+                }
+            }
+        }
+        return list;
+    }
+
+    public String toString() {
+        return OperatorSchedule.prettyPrintOperator(this, 70, 10, 4, 0.0, detailedRejection);
+    }
+
+    /**
+     * Store to state file, so on resume the parameter tuning is restored.
+     * By default, it stores information in JSON for example
+     * <p>
+     * {"id":"kappaScaler", "p":0.5, "accept":39, "reject":35, "acceptFC":0, "rejectFC":0}
+     * <p>
+     * Meta-operators (operators that have one or more operators as inputs)
+     * need to override this method to store the tuning information associated
+     * with their sub-operators by generating nested JSON, for example
+     * <p>
+     * {"id":"metaoperator", "p":0.5, "accept":396, "reject":355, "acceptFC":50, "rejectFC":45,
+     * operators [
+     * {"id":"kappaScaler1", "p":0.5, "accept":39, "reject":35, "acceptFC":0, "rejectFC":0}
+     * {"id":"kappaScaler2", "p":0.5, "accept":39, "reject":35, "acceptFC":0, "rejectFC":0}
+     * ]
+     * }
+     * *
+     */
+    public void storeToFile(final PrintWriter out) {
+
+        StringWriter writer = new StringWriter();
+        JSONWriter json = new JSONWriter(writer);
+        json.object();
+
+        if (getID()==null)
+           setID("unknown");
+
+        json.key("id").value(getID());
+
+        double p = getCoercableParameterValue();
+        if (Double.isNaN(p)) {
+            json.key("p").value("NaN");
+        } else if (Double.isInfinite(p)) {
+        	if (p > 0) {
+        		json.key("p").value("Infinity");
+        	} else {
+        		json.key("p").value("-Infinity");
+        	}
+        } else {
+            json.key("p").value(p);
+        }
+        json.key("accept").value(m_nNrAccepted);
+        json.key("reject").value(m_nNrRejected);
+        json.key("acceptFC").value(m_nNrAcceptedForCorrection);
+        json.key("rejectFC").value(m_nNrRejectedForCorrection);
+        json.key("rejectIv").value(m_nNrRejectedInvalid);
+        json.key("rejectOp").value(m_nNrRejectedOperator);
+        json.endObject();
+        out.print(writer.toString());
+    }
+
+    /**
+     * Restore tuning information from file
+     * Override this method fo meta-operators (see also storeToFile).
+     */
+    public void restoreFromFile(JSONObject o) {
+        if (!Double.isNaN(o.getDouble("p"))) {
+            setCoercableParameterValue(o.getDouble("p"));
+        }
+        m_nNrAccepted = o.getInt("accept");
+        m_nNrRejected = o.getInt("reject");
+        m_nNrAcceptedForCorrection = o.getInt("acceptFC");
+        m_nNrRejectedForCorrection = o.getInt("rejectFC");
+
+        m_nNrRejectedInvalid = o.has("rejectIv") ? o.getInt("rejectIv") : 0;
+        m_nNrRejectedOperator = o.has("rejectOp") ? o.getInt("rejectOp") : 0;
+    }
+
+
+    /**
+     * indicates that the state needs to be initialises so that
+     * BEASTObjects can be identified that need updating. This
+     * almost always needs to happen, except for cases where the
+     * operator already initialised the state, e.g. for delayed
+     * acceptance operators.
+     */
+    public boolean requiresStateInitialisation() {
+        return true;
+    }
+
+} // class Operator
diff --git a/src/beast/core/OperatorSchedule.java b/src/beast/core/OperatorSchedule.java
new file mode 100644
index 0000000..6529a82
--- /dev/null
+++ b/src/beast/core/OperatorSchedule.java
@@ -0,0 +1,325 @@
+package beast.core;
+
+import java.io.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Formatter;
+import java.util.List;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import beast.core.util.Log;
+import beast.util.Randomizer;
+
+ at Description("Specify operator selection and optimisation schedule")
+public class OperatorSchedule extends BEASTObject {
+
+    enum OptimisationTransform {none, log, sqrt}
+
+    public Input<OptimisationTransform> transformInput = new Input<OperatorSchedule.OptimisationTransform>("transform",
+            "transform optimisation schedule (default none) This can be "
+                    + Arrays.toString(OptimisationTransform.values()) + " (default 'none')",
+            OptimisationTransform.none, OptimisationTransform.values());
+    public Input<Boolean> autoOptimiseInput = new Input<Boolean>("autoOptimize", "whether to automatically optimise operator settings", true);
+
+    public Input<Boolean> detailedRejectionInput = new Input<Boolean>("detailedRejection", "true if detailed rejection statistics should be included. (default=false)", false);
+
+    public Input<Integer> autoOptimizeDelayInput = new Input<Integer>("autoOptimizeDelay", "number of samples to skip before auto optimisation kicks in (default=10000)", 10000);
+
+    /**
+     * list of operators in the schedule *
+     */
+    // temporary for play
+    public List<Operator> operators = new ArrayList<Operator>();
+
+    /**
+     * sum of weight of operators *
+     */
+    double totalWeight = 0;
+
+    /**
+     * cumulative weights, with unity as max value *
+     */
+    double[] cumulativeProbs;
+
+    /**
+     * name of the file to store operator related info *
+     */
+    String stateFileName;
+
+    /**
+     * Don't start optimisation at the start of the chain, but wait till
+     * autoOptimizeDelay has been reached.
+     */
+    protected int autoOptimizeDelay = 10000;
+    protected int autoOptimizeDelayCount = 0;
+    OptimisationTransform transform = OptimisationTransform.none;
+    boolean autoOptimise = true;
+    boolean detailedRejection = false;
+
+    @Override
+    public void initAndValidate() throws Exception {
+        transform = transformInput.get();
+        autoOptimise = autoOptimiseInput.get();
+        autoOptimizeDelay = autoOptimizeDelayInput.get();
+        detailedRejection = detailedRejectionInput.get();
+    }
+
+    public void setStateFileName(final String name) {
+        this.stateFileName = name;
+    }
+
+    /**
+     * add operator to the schedule *
+     * @param p
+     */
+    public void addOperator(final Operator p) {
+        operators.add(p);
+        p.setOperatorSchedule(this);
+        totalWeight += p.getWeight();
+        cumulativeProbs = new double[operators.size()];
+        cumulativeProbs[0] = operators.get(0).getWeight() / totalWeight;
+        for (int i = 1; i < operators.size(); i++) {
+            cumulativeProbs[i] = operators.get(i).getWeight() / totalWeight + cumulativeProbs[i - 1];
+        }
+    }
+
+    /**
+     * randomly select an operator with probability proportional to the weight
+     * of the operator
+     * @return
+     */
+    public Operator selectOperator() {
+        final int iOperator = Randomizer.randomChoice(cumulativeProbs);
+        return operators.get(iOperator);
+    }
+
+    private static final String TUNING = "Tuning";
+    private static final String NUM_ACCEPT = "#accept";
+    private static final String NUM_REJECT = "#reject";
+    private static final String PR_M = "Pr(m)";
+    private static final String PR_ACCEPT = "Pr(acc|m)";
+
+    /**
+     * report operator statistics *
+     * @param out
+     */
+    public void showOperatorRates(final PrintStream out) {
+
+        Formatter formatter = new Formatter(out);
+
+        int longestName = 0;
+        for (final Operator operator : operators) {
+            if (operator.getName().length() > longestName) {
+                longestName = operator.getName().length();
+            }
+        }
+
+        formatter.format("%-" + longestName + "s", "Operator");
+
+        int colWidth = 10;
+        String headerFormat = " %" + colWidth + "s";
+
+        formatter.format(headerFormat, TUNING);
+        formatter.format(headerFormat, NUM_ACCEPT);
+        formatter.format(headerFormat, NUM_REJECT);
+        if (detailedRejection) {
+            formatter.format(headerFormat, "rej.inv");
+            formatter.format(headerFormat, "rej.op");
+        }
+        formatter.format(headerFormat, PR_M);
+        formatter.format(headerFormat, PR_ACCEPT);
+        out.println();
+        for (final Operator operator : operators) {
+            out.println(prettyPrintOperator(operator, longestName, colWidth, 4, totalWeight, detailedRejection));
+        }
+        out.println();
+
+        formatter.format(headerFormat,TUNING);
+        out.println(": The value of the operator's tuning parameter, or '-' if the operator can't be optimized.");
+        formatter.format(headerFormat, NUM_ACCEPT);
+        out.println(": The total number of times a proposal by this operator has been accepted.");
+        formatter.format(headerFormat, NUM_REJECT);
+        out.println(": The total number of times a proposal by this operator has been rejected.");
+        formatter.format(headerFormat, PR_M);
+        out.println(": The probability this operator is chosen in a step of the MCMC (i.e. the normalized weight).");
+        formatter.format(headerFormat, PR_ACCEPT);
+        out.println(": The acceptance probability (" + NUM_ACCEPT + " as a fraction of the total proposals for this operator).");
+        out.println();
+    }
+
+    protected static String prettyPrintOperator(
+            Operator op,
+            int nameColWidth,
+            int colWidth,
+            int dp,
+            double totalWeight,
+            boolean detailedRejection) {
+
+        double tuning = op.getCoercableParameterValue();
+        double accRate = (double) op.m_nNrAccepted / (double) (op.m_nNrAccepted + op.m_nNrRejected);
+
+        StringBuilder sb = new StringBuilder();
+        Formatter formatter = new Formatter(sb);
+
+        String intFormat = " %" + colWidth + "d";
+        String doubleFormat = " %" + colWidth + "." + dp + "f";
+
+        formatter.format("%-" + nameColWidth + "s", op.getName());
+        if (!Double.isNaN(tuning)) {
+            formatter.format(doubleFormat, tuning);
+        } else {
+            formatter.format(" %" + colWidth + "s", "-");
+        }
+
+        formatter.format(intFormat, op.m_nNrAccepted);
+        formatter.format(intFormat, op.m_nNrRejected);
+        if (detailedRejection) {
+            formatter.format(doubleFormat, (double) op.m_nNrRejectedInvalid / (double) op.m_nNrRejected);
+            formatter.format(doubleFormat, (double) op.m_nNrRejectedOperator / (double) op.m_nNrRejected);
+        }
+        if (totalWeight > 0.0) {
+            formatter.format(doubleFormat, op.getWeight() / totalWeight);
+        }
+        formatter.format(doubleFormat, accRate);
+
+        sb.append(" " + op.getPerformanceSuggestion());
+
+        return sb.toString();
+    }
+
+    /**
+     * store operator optimisation specific information to file *
+     * @throws Exception
+     */
+    public void storeToFile() throws Exception {
+        // appends state of operator set to state file
+        File aFile = new File(stateFileName);
+        PrintWriter out = new PrintWriter(new FileWriter(aFile, true));
+
+        out.println("<!--");
+        out.println("{\"operators\":[");
+        int k = 0;
+        for (Operator operator: operators) {
+            operator.storeToFile(out);
+            if (k++ < operators.size() - 1) {
+            	out.println(",");
+            }
+        }
+        out.println("\n]}");
+        out.println("-->");
+        out.flush();
+        out.close();
+    }
+
+    /**
+     * restore operator optimisation specific information from file *
+     * @throws Exception
+     */
+    public void restoreFromFile() throws Exception {
+        // reads state of operator set from state file
+        String sXML = "";
+        final BufferedReader fin = new BufferedReader(new FileReader(stateFileName));
+        while (fin.ready()) {
+            sXML += fin.readLine() + "\n";
+        }
+        fin.close();
+        int start = sXML.indexOf("</itsabeastystatewerein>") + 25 + 5;
+        if (start >= sXML.length() - 4) {
+        	return;
+        }
+        sXML = sXML.substring(sXML.indexOf("</itsabeastystatewerein>") + 25 + 5, sXML.length() - 4);
+        try {
+	        JSONObject o = new JSONObject(sXML);
+	        JSONArray operatorlist = o.getJSONArray("operators");
+	        autoOptimizeDelayCount = 0;
+	        for (int i = 0; i < operatorlist.length(); i++) {
+	            JSONObject item = operatorlist.getJSONObject(i);
+	            String id = item.getString("id");
+	    		boolean found = false;
+	            if (!id.equals("null")) {
+	            	for (Operator operator: operators) {
+	            		if (id.equals(operator.getID())) {
+	                    	operator.restoreFromFile(item);
+	                        autoOptimizeDelayCount += operator.m_nNrAccepted + operator.m_nNrRejected;
+	                        found = true;
+	            			break;
+	            		}
+	            	}
+	            }
+	        	if (!found) {
+	        		Log.warning.println("Operator (" + id + ") found in state file that is not in operator list any more");
+	        	}
+	        }
+	    	for (Operator operator: operators) {
+	    		if (operator.getID() == null) {
+	        		Log.warning.println("Operator (" + operator.getClass() + ") found in BEAST file that could not be restored because it has not ID");
+	    		}
+	    	}    
+        } catch (JSONException e) {
+        	// it is not a JSON file -- probably a version 2.0.X state file
+	        String[] sStrs = sXML.split("\n");
+            autoOptimizeDelayCount = 0;
+	        for (int i = 0; i < operators.size() && i + 2 < sStrs.length; i++) {
+	            String[] sStrs2 = sStrs[i + 1].split(" ");
+	            Operator operator = operators.get(i);
+	            if ((operator.getID() == null && sStrs2[0].equals("null")) || operator.getID().equals(sStrs2[0])) {
+	                cumulativeProbs[i] = Double.parseDouble(sStrs2[1]);
+	                if (!sStrs2[2].equals("NaN")) {
+	                    operator.setCoercableParameterValue(Double.parseDouble(sStrs2[2]));
+	                }
+	                operator.m_nNrAccepted = Integer.parseInt(sStrs2[3]);
+	                operator.m_nNrRejected = Integer.parseInt(sStrs2[4]);
+	                autoOptimizeDelayCount += operator.m_nNrAccepted + operator.m_nNrRejected;
+	                operator.m_nNrAcceptedForCorrection = Integer.parseInt(sStrs2[5]);
+	                operator.m_nNrRejectedForCorrection = Integer.parseInt(sStrs2[6]);
+	            } else {
+	                throw new Exception("Cannot resume: operator order or set changed from previous run");
+	            }
+	        }
+	    }
+        showOperatorRates(System.err);
+    }
+
+    /**
+     * Calculate change of coerceable parameter for operators that allow
+     * optimisation
+     *
+     * @param operator
+     * @param logAlpha difference in posterior between previous state & proposed
+     *                 state + hasting ratio
+     * @return change of value of a parameter for MCMC chain optimisation
+     */
+    public double calcDelta(final Operator operator, final double logAlpha) {
+        // do no optimisation for the first N optimisable operations
+        if (autoOptimizeDelayCount < autoOptimizeDelay || !autoOptimise) {
+            autoOptimizeDelayCount++;
+            return 0;
+        }
+        final double target = operator.getTargetAcceptanceProbability();
+
+        double count = (operator.m_nNrRejectedForCorrection + operator.m_nNrAcceptedForCorrection + 1.0);
+        switch (transform) {
+            case log:
+                count = Math.log(count + 1.0);
+                break;
+            case sqrt:
+                count = Math.sqrt(count);
+                break;
+            case none:
+            	break;
+            default:
+            	break;
+        }
+
+        final double deltaP = ((1.0 / count) * (Math.exp(Math.min(logAlpha, 0)) - target));
+
+        if (deltaP > -Double.MAX_VALUE && deltaP < Double.MAX_VALUE) {
+            return deltaP;
+        }
+        return 0;
+    }
+
+} // class OperatorSchedule
diff --git a/src/beast/core/Param.java b/src/beast/core/Param.java
new file mode 100644
index 0000000..6cc9e2b
--- /dev/null
+++ b/src/beast/core/Param.java
@@ -0,0 +1,43 @@
+package beast.core;
+
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * This annotation should be used to provide information about parameters in the constructor of a BEAST object,
+ * as an alternative way to represent inputs -- still under development!
+ */
+ at Target({ElementType.PARAMETER})
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface Param {
+
+    /**
+     * The name of this parameter
+     *
+     * @return
+     */
+    String name();
+
+
+    /**
+     * The description of this parameter
+     *
+     * @return
+     */
+    String description();
+
+    /**
+     * @return the default value as a string
+     */
+    String defaultValue() default "";
+
+    boolean optional() default false;
+
+    /**
+     * @return true to indicate this description applies to all its inherited classes as well, false otherwise
+     */
+    boolean isInheritable() default true;
+}
\ No newline at end of file
diff --git a/src/beast/core/Runnable.java b/src/beast/core/Runnable.java
new file mode 100644
index 0000000..5c20cd5
--- /dev/null
+++ b/src/beast/core/Runnable.java
@@ -0,0 +1,45 @@
+package beast.core;
+
+
+ at Description("Entry point for running a Beast task, for instance an MCMC or other probabilistic " +
+        "analysis, a simulation, etc.")
+public abstract class Runnable extends BEASTObject {	
+	
+	/** entry point for anything runnable **/
+	abstract public void run() throws Exception;
+
+    /**
+     * Set up information related to the file for (re)storing the State.
+     * The Runnable implementation is responsible for making its
+     * State synchronising with the file *
+     * @param sFileName
+     * @param bRestoreFromFile
+     */
+    public void setStateFile(final String sFileName, final boolean bRestoreFromFile) {
+    	if (System.getProperty("state.file.name") != null) {
+    		stateFileName = System.getProperty("state.file.name");
+    	} else {
+            if (System.getProperty("file.name.prefix") != null) {
+            	stateFileName = System.getProperty("file.name.prefix") + "/" + sFileName;
+            } else {
+            	stateFileName = sFileName;
+            }
+    	}
+        restoreFromFile = bRestoreFromFile;
+    }
+
+    /**
+     * flag to indicate that the State should be restored from File at the start of the analysis *
+     */
+    protected boolean restoreFromFile = false;
+
+    /**
+     * name of the file store the state in *
+     */
+    protected String stateFileName = "state.backup.xml";
+    
+    /** 
+     * indicate whether this runnable distinguishes partitions, like MCMC, or not 
+     * **/
+    public boolean hasPartitions() {return true;}
+}
diff --git a/src/beast/core/State.java b/src/beast/core/State.java
new file mode 100644
index 0000000..4df6b68
--- /dev/null
+++ b/src/beast/core/State.java
@@ -0,0 +1,632 @@
+/*
+* File State.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+package beast.core;
+
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import beast.core.Input;
+
+
+
+
+ at Description("The state represents the current point in the state space, and " +
+        "maintains values of a set of StateNodes, such as parameters and trees. " +
+        "Furthermore, the state manages which parts of the model need to be stored/restored " +
+        "and notified that recalculation is appropriate.")
+public class State extends BEASTObject {
+
+    public final Input<List<StateNode>> stateNodeInput =
+            new Input<List<StateNode>>("stateNode", "anything that is part of the state", new ArrayList<StateNode>());
+    public Input<Integer> m_storeEvery =
+            new Input<Integer>("storeEvery", "store the state to disk every X number of samples so that we can " +
+                    "resume computation later on if the process failed half-way.", -1);
+//    public Input<Boolean> m_checkPoint =
+//            new Input<Boolean>("checkpoint", "keep saved states (every X samples).", false);
+
+    /**
+     * The components of the state, for instance tree & parameters.
+     * This represents the current state, but a copy is kept so that when
+     * an operation is applied to the State but the proposal is not accepted,
+     * the state can be restored. This is currently implemented by having
+     * Operators call getEditableStateNode() at which point the requested
+     * StateNode is copied.
+     * Access through getNrStatNodes() and getStateNode(.).
+     */
+    protected StateNode[] stateNode;
+
+    /**
+     * number of state nodes *
+     */
+    private int nrOfStateNodes;
+
+    public int getNrOfStateNodes() {
+        return nrOfStateNodes;
+    }
+
+    /**
+     * pointers to memory allocated to stateNodes and storedStateNodes *
+     */
+    private StateNode[] stateNodeMem;
+
+    /**
+     * File name used for storing the state, either periodically or at the end of an MCMC chain
+     * so that the chain can be resumed.
+     */
+    private String stateFileName = "state.backup.xml";
+
+
+    /** The following members are involved in calculating the set of
+     * CalculatioNodes that need to be notified when an operation
+     * has been applied to the State. The Calculation nodes are then
+     * store/restore/accepted/check dirtiness in partial order.
+     */
+
+    /**
+     * Maps a Plugin to a list of Outputs.
+     * This map only contains those plug-ins that have a path to the posterior *
+     */
+    private HashMap<BEASTInterface, List<BEASTInterface>> outputMap;
+
+    /**
+     * Same as m_outputMap, but only for StateNodes indexed by the StateNode number
+     * We need this since the StateNode changes regularly, so unlike the output map
+     * for Plugins cannot be accessed by the current StateNode as key.
+     */
+    private List<CalculationNode>[] stateNodeOutputs;
+
+    /**
+     * Code that represents configuration of StateNodes that have changed
+     * during an operation.
+     * <p/>
+     * Every time an operation requests a StateNode, an entry is added to changeStateNodes
+     * nChangeStateNodes records how many StateNodes are changed.
+     * The code is reset when the state is stored, and every time a StateNode
+     * is requested by an operator, changeStateNodes is updated.
+     */
+    private int[] changeStateNodes;
+    private int nrOfChangedStateNodes;
+
+    /**
+     * Maps the changed states node code to
+     * the set of calculation nodes that is potentially affected by an operation *
+     */
+    Trie trie;
+
+    /**
+     * class for quickly finding which calculation nodes need to be updated
+     * due to state-node changes
+     */
+    class Trie {
+        List<CalculationNode> list;
+        final Trie[] children;
+
+        Trie() {
+            children = new Trie[stateNode.length];
+        }
+
+        /**
+         * get entry from Trie, return null if no entry is present yet *
+         * @param iPos
+         */
+        List<CalculationNode> get(final int iPos) {
+            if (iPos == 0) {
+                return list;
+            }
+            final Trie child = children[changeStateNodes[iPos - 1]];
+            if (child == null) {
+                return null;
+            }
+            return child.get(iPos - 1);
+        }
+
+        /**
+         * set entry int Trie, create new entries if no entry is present yet *
+         */
+        void set(final List<CalculationNode> list, final int iPos) {
+            if (iPos == 0) {
+                this.list = list;
+                return;
+            }
+            Trie child = children[changeStateNodes[iPos - 1]];
+            if (child == null) {
+                child = new Trie();
+                children[changeStateNodes[iPos - 1]] = child;
+            }
+            child.set(list, iPos - 1);
+        }
+    }
+
+
+    @Override
+    public void initAndValidate() {
+    }
+
+    public void initialise() {
+        stateNode = stateNodeInput.get().toArray(new StateNode[0]);
+
+        for (int i = 0; i < stateNode.length; i++) {
+            stateNode[i].index = i;
+        }
+        // make itself known
+        for (StateNode state : stateNode) {
+            state.state = this;
+        }
+
+        nrOfStateNodes = stateNode.length;
+        // allocate memory for StateNodes and a copy.
+        stateNodeMem = new StateNode[nrOfStateNodes * 2];
+        for (int i = 0; i < nrOfStateNodes; i++) {
+            stateNodeMem[i] = stateNode[i];
+            stateNodeMem[nrOfStateNodes + i] = stateNodeMem[i].copy();
+        }
+
+        // set up data structure for encoding which StateNodes change by an operation
+        changeStateNodes = new int[stateNode.length];
+        //Arrays.fill(changeStateNodes, -1);
+        nrOfChangedStateNodes = 0;
+        trie = new Trie();
+        // add the empty list for the case none of the StateNodes have changed
+        trie.list = new ArrayList<CalculationNode>();
+    } // initAndValidate
+
+
+    /**
+     * return currently valid state node. This is typically called from a
+     * CalculationNode for inspecting the value of a StateNode, not for
+     * changing it. To change a StateNode, say from an Operator,
+     * getEditableStateNode() should be called. *
+     */
+    public StateNode getStateNode(final int nID) {
+        return stateNode[nID];
+    }
+
+    /**
+     * Return StateNode that can be changed, but later restored
+     * if necessary. If there is no copy stored already, a copy is
+     * made first, and the StateNode is marked as being dirty.
+     * <p/>
+     * NB This should only be called from an Operator that wants to
+     * change the particular StateNode through the Input.get(Operator)
+     * method on the input associated with this StateNode.
+     */
+    protected StateNode getEditableStateNode(int nID, Operator operator) {
+        for (int i = 0; i < nrOfChangedStateNodes; i++) {
+            if (changeStateNodes[i] == nID) {
+                return stateNode[nID];
+            }
+        }
+        changeStateNodes[nrOfChangedStateNodes++] = nID;
+        return stateNode[nID];
+    }
+
+    /**
+     * Store a State before applying an operation proposal to the state.
+     * This copies the state for possible later restoration
+     * but does not affect any inputs, which are all still connected
+     * to the original StateNodes
+     * <p/>
+     * Also, store the state to disk for resumption of analysis later on.
+     *
+     * @param iSample chain state number
+     * @return  true if stored  to disk
+     */
+    public void store(final int iSample) {
+        //Arrays.fill(changeStateNodes, -1);
+        nrOfChangedStateNodes = 0;
+    }
+
+    /**
+     * Restore a State after rejecting the operation proposal.
+     * This assigns the state to the stored state.
+     * NB this does not affect any Inputs connected to any stateNode. *
+     */
+    public void restore() {
+        for (int i = 0; i < nrOfChangedStateNodes; i++) {
+            stateNode[changeStateNodes[i]].restore();
+        }
+    }
+
+    /**
+     * Visit all calculation nodes in partial order determined by the Plugin-input relations
+     * (i.e. if A is input of B then A < B). There are 4 operations that can be propagated this
+     * way:
+     * <p/>
+     * store() makes sure all calculation nodes store their internal state
+     * <p/>
+     * checkDirtiness() makes all calculation nodes check whether they give a different answer
+     * when interrogated by one of its outputs
+     * <p/>
+     * accept() allows all calculation nodes to mark themselves as being clean without further
+     * calculation
+     * <p/>
+     * restore() if a proposed state is not accepted, all calculation nodes need to restore
+     * themselves
+     */
+    public void storeCalculationNodes() {
+        final List<CalculationNode> currentSetOfCalculationNodes = getCurrentCalculationNodes();
+        for (final CalculationNode calculationNode : currentSetOfCalculationNodes) {
+            calculationNode.store();
+        }
+    }
+
+    public void checkCalculationNodesDirtiness() {
+        final List<CalculationNode> currentSetOfCalculationNodes = getCurrentCalculationNodes();
+        for (final CalculationNode calculationNode : currentSetOfCalculationNodes) {
+            calculationNode.checkDirtiness();
+        }
+    }
+
+    public void restoreCalculationNodes() {
+        final List<CalculationNode> currentSetOfCalculationNodes = getCurrentCalculationNodes();
+        for (final CalculationNode calculationNode : currentSetOfCalculationNodes) {
+            calculationNode.restore();
+        }
+    }
+
+    public void acceptCalculationNodes() {
+        final List<CalculationNode> currentSetOfCalculationNodes = getCurrentCalculationNodes();
+        for (final CalculationNode calculationNode : currentSetOfCalculationNodes) {
+            calculationNode.accept();
+        }
+    }
+
+    /**
+     * set name of state file, used when storing/restoring the state to disk *
+     */
+    public void setStateFileName(final String sFileName) {
+        if (sFileName != null) {
+            stateFileName = sFileName;
+        }
+    }
+
+    /**
+     * Print state to file. This is called either periodically or at the end
+     * of an MCMC chain, so that the state can be resumed later on.
+     *
+     * @param iSample TODO
+     */
+    public void storeToFile(final int iSample) {
+        try {
+            PrintStream out = new PrintStream(stateFileName + ".new");
+            out.print(toXML(iSample));
+            //out.print(new XMLProducer().toXML(this));
+            out.close();
+            File newStateFile = new File(stateFileName + ".new");
+            File oldStateFile = new File(stateFileName);
+            oldStateFile.delete();
+            newStateFile.renameTo(oldStateFile);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * convert state to XML string,
+     * The state can be reconstructed using the fromXML() method
+     *
+     * @param iSample TODO*
+     */
+    public String toXML(final int iSample) {
+        final StringBuilder buf = new StringBuilder();
+        buf.append("<itsabeastystatewerein version='2.0' sample='").append(iSample).append("'>\n");
+        for (final StateNode node : stateNode) {
+            buf.append(node.toXML());
+        }
+        buf.append("</itsabeastystatewerein>\n");
+        return buf.toString();
+    }
+
+    /**
+     * Restore state from an XML fragment *
+     */
+    public void fromXML(final String sXML) {
+        try {
+            final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+            final Document doc = factory.newDocumentBuilder().parse(new ByteArrayInputStream(sXML.getBytes()));
+            doc.normalize();
+            final NodeList nodes = doc.getElementsByTagName("*");
+            final Node topNode = nodes.item(0);
+            final NodeList children = topNode.getChildNodes();
+            for (int iChild = 0; iChild < children.getLength(); iChild++) {
+                final Node child = children.item(iChild);
+                if (child.getNodeType() == Node.ELEMENT_NODE) {
+                    final String sID = child.getAttributes().getNamedItem("id").getNodeValue();
+                    int iStateNode = 0;
+                    while (!stateNode[iStateNode].getID().equals(sID)) {
+                        iStateNode++;
+                    }
+                    final StateNode stateNode2 = stateNode[iStateNode].copy();
+                    stateNode2.fromXML(child);
+                    stateNode[iStateNode].assignFromFragile(stateNode2);
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            System.exit(0);
+        }
+    }
+
+    /**
+     * restore a state from file for resuming an MCMC chain *
+     */
+    public void restoreFromFile() throws Exception {
+        System.out.println("Restoring from file");
+        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+        Document doc = factory.newDocumentBuilder().parse(new File(stateFileName));
+        doc.normalize();
+        final NodeList nodes = doc.getElementsByTagName("*");
+        final Node topNode = nodes.item(0);
+        final NodeList children = topNode.getChildNodes();
+        for (int iChild = 0; iChild < children.getLength(); iChild++) {
+            final Node child = children.item(iChild);
+            if (child.getNodeType() == Node.ELEMENT_NODE) {
+                final String sID = child.getAttributes().getNamedItem("id").getNodeValue();
+                int iStateNode = 0;
+
+                // An init node without ID - should not bring the house down, does it?
+                // I have not checked if the state is restored correctly or not (JH)
+                while (stateNode[iStateNode].getID() != null &&
+                        !stateNode[iStateNode].getID().equals(sID)) {
+                    iStateNode++;
+                    if (iStateNode >= stateNode.length) {
+                    	System.err.println("Cannot resotre statenode sID");
+                    	break;
+                    }
+                }
+                if (iStateNode < stateNode.length) {
+	                final StateNode stateNode2 = stateNode[iStateNode].copy();
+	                stateNode2.fromXML(child);
+	                stateNode[iStateNode].assignFromFragile(stateNode2);
+                }
+            }
+        }
+    }
+
+    @Override
+    public String toString() {
+        if (stateNode == null) {
+            return "";
+        }
+        final StringBuilder buf = new StringBuilder();
+        for (final StateNode node : stateNode) {
+            buf.append(node.toString());
+            buf.append("\n");
+        }
+        return buf.toString();
+    }
+
+
+    /**
+     * Set dirtiness to all StateNode, this means that
+     * apart from marking all StateNode.someThingIsDirty as isDirty
+     * parameters mark all their dimension as isDirty and
+     * trees mark all their nodes as isDirty.
+     */
+    public void setEverythingDirty(final boolean isDirty) {
+        for (final StateNode node : stateNode) {
+            node.setEverythingDirty(isDirty);
+        }
+
+        if (isDirty) {
+            // happens only during debugging and start of MCMC chain
+            for (int i = 0; i < stateNode.length; i++) {
+                changeStateNodes[i] = i;
+            }
+            nrOfChangedStateNodes = stateNode.length;
+        }
+    }
+
+    /**
+     * Sets the posterior, needed to calculate paths of CalculationNode
+     * that need store/restore/requireCalculation checks.
+     * As a side effect, outputs for every plugin in the model are calculated.
+     * NB the output map only contains outputs on a path to the posterior Plugin!
+     */
+    @SuppressWarnings("unchecked")
+    public void setPosterior(BEASTObject posterior) throws Exception {
+        // first, calculate output map that maps Plugins on a path
+        // to the posterior to the list of output Plugins. Strictly
+        // speaking, this is a bit of overkill, since only
+        // CalculationNodes need to be taken in account, but for
+        // debugging purposes (developer forgot to derive from CalculationNode)
+        // we keep track of the lot.
+        outputMap = new HashMap<BEASTInterface, List<BEASTInterface>>();
+        outputMap.put(posterior, new ArrayList<BEASTInterface>());
+        boolean bProgress = true;
+        List<BEASTInterface> plugins = new ArrayList<BEASTInterface>();
+        plugins.add(posterior);
+        while (bProgress) {
+            bProgress = false;
+            // loop over plug-ins, till no more plug-ins can be added
+            // efficiency is no issue here
+            for (int iPlugin = 0; iPlugin < plugins.size(); iPlugin++) {
+            	BEASTInterface plugin = plugins.get(iPlugin);
+                try {
+                    for (BEASTInterface inputPlugin : plugin.listActivePlugins()) {
+                        if (!outputMap.containsKey(inputPlugin)) {
+                            outputMap.put(inputPlugin, new ArrayList<BEASTInterface>());
+                            plugins.add(inputPlugin);
+                            bProgress = true;
+                        }
+                        if (!outputMap.get(inputPlugin).contains(plugin)) {
+                            outputMap.get(inputPlugin).add(plugin);
+                            bProgress = true;
+                        }
+                    }
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        // Set of array of StateNode outputs. Since the StateNodes have a potential
+        // to be changing objects (when store/restore is applied) it is necessary
+        // to use another method to find the outputs, an array in this case.
+        stateNodeOutputs = new List[stateNode.length];
+        for (int i = 0; i < stateNode.length; i++) {
+            stateNodeOutputs[i] = new ArrayList<CalculationNode>();
+            if (outputMap.containsKey(stateNode[i])) {
+                for (BEASTInterface plugin : outputMap.get(stateNode[i])) {
+                    if (plugin instanceof CalculationNode) {
+                        stateNodeOutputs[i].add((CalculationNode) plugin);
+                    } else {
+                        throw new Exception("DEVELOPER ERROR: output of StateNode (" + stateNode[i].getID() + ") should be a CalculationNode, but " + plugin.getClass().getName() + " is not.");
+                    }
+                }
+            } else {
+                System.out.println("\nWARNING: StateNode (" + stateNode[i].getID() + ") found that has no effect on posterior!\n");
+            }
+        }
+    } // setPosterior
+
+    /**
+     * return current set of calculation nodes based on the set of StateNodes that have changed *
+     */
+    private List<CalculationNode> getCurrentCalculationNodes() {
+        List<CalculationNode> calcNodes = trie.get(nrOfChangedStateNodes);
+        if (calcNodes != null) {
+            // the list is pre-calculated
+            return calcNodes;
+        }
+        // we need to calculate the list of CalculationNodes now
+        try {
+            calcNodes = calculateCalcNodePath();
+        } catch (Exception e) {
+            e.printStackTrace();
+            System.exit(1);
+        }
+
+        trie.set(calcNodes, nrOfChangedStateNodes);
+
+//    	System.err.print(Arrays.toString(changeStateNodes) + ":");
+//    	for (CalculationNode node : calcNodes) {
+//    		System.err.print(node.m_sID + " ");
+//    	}
+//    	System.err.println();
+
+        return calcNodes;
+    } // getCurrentCalculationNodes
+
+
+    /**
+     * Collect all CalculationNodes on a path from any StateNode that is changed (as
+     * indicated by m_changedStateNodeCode) to the posterior. Return the list in
+     * partial order as determined by the Plugins input relations.
+     */
+    private List<CalculationNode> calculateCalcNodePath() throws Exception {
+        final List<CalculationNode> calcNodes = new ArrayList<CalculationNode>();
+//    	for (int i = 0; i < stateNode.length; i++) {
+//    		if (m_changedStateNodeCode.get(i)) {
+        for (int k = 0; k < nrOfChangedStateNodes; k++) {
+            int i = changeStateNodes[k];
+            // go grab the path to the Runnable
+            // first the outputs of the StateNodes that is changed
+            boolean bProgress = false;
+            for (CalculationNode node : stateNodeOutputs[i]) {
+                if (!calcNodes.contains(node)) {
+                    calcNodes.add(node);
+                    bProgress = true;
+                }
+            }
+            // next the path following the outputs
+            while (bProgress) {
+                bProgress = false;
+                // loop over plugins till no more plugins can be added
+                // efficiency is no issue here, assuming the graph remains 
+                // constant
+                for (int iCalcNode = 0; iCalcNode < calcNodes.size(); iCalcNode++) {
+                    CalculationNode node = calcNodes.get(iCalcNode);
+                    for (BEASTInterface output : outputMap.get(node)) {
+                        if (output instanceof CalculationNode) {
+                            final CalculationNode calcNode = (CalculationNode) output;
+                            if (!calcNodes.contains(calcNode)) {
+                                calcNodes.add(calcNode);
+                                bProgress = true;
+                            }
+                        } else {
+                            throw new Exception("DEVELOPER ERROR: found a"
+                                    + " non-CalculatioNode ("
+                                    +output.getClass().getName()
+                                    +") on path between StateNode and Runnable");
+                        }
+                    }
+                }
+            }
+//    		}
+        }
+
+        // put calc nodes in partial order
+        for (int i = 0; i < calcNodes.size(); i++) {
+            CalculationNode node = calcNodes.get(i);
+            List<BEASTInterface> inputList = node.listActivePlugins();
+            for (int j = calcNodes.size() - 1; j > i; j--) {
+                if (inputList.contains(calcNodes.get(j))) {
+                    // swap
+                    final CalculationNode node2 = calcNodes.get(j);
+                    calcNodes.set(j, node);
+                    calcNodes.set(i, node2);
+                    j = 0;
+                    i--;
+                }
+            }
+        }
+
+        return calcNodes;
+    } // calculateCalcNodePath
+
+
+    public double robustlyCalcPosterior(final Distribution posterior) throws Exception {
+        store(-1);
+        setEverythingDirty(true);
+        //state.storeCalculationNodes();
+        checkCalculationNodesDirtiness();
+        final double fLogLikelihood = posterior.calculateLogP();
+        setEverythingDirty(false);
+        acceptCalculationNodes();
+        return fLogLikelihood;
+    }
+
+	public double robustlyCalcNonStochasticPosterior(Distribution posterior) throws Exception {
+        store(-1);
+        setEverythingDirty(true);
+        //state.storeCalculationNodes();
+        checkCalculationNodesDirtiness();
+        final double fLogLikelihood = posterior.getNonStochasticLogP();
+        setEverythingDirty(false);
+        acceptCalculationNodes();
+        return fLogLikelihood;
+	}
+} // class State
diff --git a/src/beast/core/StateNode.java b/src/beast/core/StateNode.java
new file mode 100644
index 0000000..4fba54f
--- /dev/null
+++ b/src/beast/core/StateNode.java
@@ -0,0 +1,227 @@
+package beast.core;
+
+import org.w3c.dom.Node;
+
+import java.io.PrintStream;
+
+/**
+ * This class represents a node of the state. Concrete classes include Parameters and Trees.
+ * StateNodes differ from CalculationNodes in that they
+ * 1. Do not calculate anything, with the exception of initialisation time
+ * 2. can be changed by Operators
+ *
+ * @author Alexei Drummond
+ */
+ at Description("A node that can be part of the state.")
+public abstract class StateNode extends CalculationNode implements Loggable, Cloneable, Function {
+    /**
+     * Flag to indicate the StateNode is not constant.
+     * This is particularly useful for Beauti *
+     */
+    public Input<Boolean> isEstimatedInput = new Input<Boolean>("estimate", "whether to estimate this item or keep constant to its initial value", true);
+
+    /**
+     * @return this StateNode if it is not in the State.
+     *         If it is in the State, return the version that is currently valid
+     *         (i.e. not the stored one).
+     */
+    public StateNode getCurrent() {
+        if (state == null) {
+            return this;
+        }
+        return state.getStateNode(index);
+    }
+
+    /**
+     * @param operator explain here why operator is useful
+     * @return StateNode for an operation to do its magic on.
+     *         The State will make a copy first, if there is not already
+     *         one available.
+     */
+    public StateNode getCurrentEditable(final Operator operator) {
+        startEditing(operator);
+        return this;
+    }
+
+    /**
+     * Getting/setting global dirtiness state for this StateNode.
+     * Every StateNode has a flag (somethingIsDirty) that represents whether anything
+     * in the state has changed. StateNode implementations like Parameters and Trees
+     * have their own internal flag to represent which part of a StateNode (e.g.
+     * an element in an array, or a node in a tree) has changed.
+     * *
+     */
+    public boolean somethingIsDirty() {
+        return this.hasStartedEditing;
+    }
+
+    public void setSomethingIsDirty(final boolean isDirty) {
+        this.hasStartedEditing = isDirty;
+    }
+
+    /**
+     * mark every internal element of a StateNode as isDirty.
+     * So both the global flag for this StateNode (somethingIsDirty) should be set as
+     * well as all the local flags.
+     *
+     * @param isDirty
+     */
+    abstract public void setEverythingDirty(final boolean isDirty);
+
+    /**
+     * @return a deep copy of this node in the state.
+     *         This will generally be called only for stochastic nodes.
+     */
+    public abstract StateNode copy();
+
+    /**
+     * other := this
+     * Assign all values of this to other
+     * NB: Should only be used for initialisation!
+     */
+    public abstract void assignTo(StateNode other);
+
+    /**
+     * this := other
+     * Assign all values of other to this
+     * NB: Should only be used for initialisation!
+     */
+    public abstract void assignFrom(StateNode other);
+
+    /**
+     * As assignFrom, but without copying the ID
+     * NB: Should only be used for initialisation!
+     */
+    public void assignFromWithoutID(StateNode other) {
+        final String sID = getID();
+        assignFrom(other);
+        setID(sID);
+    }
+
+    /**
+     * As assignFrom, but only those parts are assigned that
+     * are variable, for instance for parameters bounds and dimension
+     * do not need to be copied.
+     */
+    public abstract void assignFromFragile(StateNode other);
+
+    /**
+     * for storing a state *
+     */
+    final public void toXML(PrintStream out) {
+        out.print("<statenode id='" + getID() + "'>");
+        out.print(toString());
+        out.print("</statenode>\n");
+    }
+
+    /**
+     * stores a state node in XML format, to be restored by fromXML() *
+     */
+    final public String toXML() {
+        return "<statenode id='" + getID() + "'>" +
+                toString() +
+                "</statenode>\n";
+    }
+
+    /**
+     * for restoring a state that was stored using toXML() above
+     * from a DOM Node. *
+     */
+    public abstract void fromXML(Node node);
+
+
+//    /**
+//     * @return true if this node is acting as a random variable, false if this node is fixed and effectively data.
+//     */
+//    public final boolean isStochastic() {
+//        return this.isStochastic;
+//    }
+//
+//    /**
+//     * @param isStochastic true if this need should be treated as stochastic, false if this node should be fixed
+//     *                     and treated as data
+//     */
+//    final void setStochastic(boolean isStochastic) {
+//        this.isStochastic = isStochastic;
+//    }
+//
+//    boolean isStochastic = true;
+
+    /**
+     * Scale StateNode with amount fScale and
+     *
+     * @param fScale scaling factor
+     * @return the number of degrees of freedom used in this operation. This number varies
+     *         for the different types of StateNodes. For example, for real
+     *         valued n-dimensional parameters, it is n, for a tree it is the
+     *         number of internal nodes being scaled.
+     * @throws Exception when StateNode become not valid, e.g. has
+     *                   values outside bounds or negative branch lengths.
+     */
+    abstract public int scale(double fScale) throws Exception;
+
+    /**
+     * Pointer to state, null if not part of a State.
+     */
+    protected State state = null;
+
+    public State getState() {
+        return state;
+    }
+
+    /**
+     * flag to indicate some value has changed after operation is performed on state
+     * For multidimensional parameters, there is an internal flag to indicate which
+     * dimension is dirty
+     */
+    protected boolean hasStartedEditing = false;
+
+    /**
+     * The index of the parameter for identifying this StateNode
+     * in the State.
+     */
+    public int index = -1;
+
+    public int getIndex() {
+        return index;
+    }
+
+    /**
+     * should be called before an Operator proposes a new State *
+     *
+     * @param operator
+     */
+    public void startEditing(final Operator operator) {
+        assert (isCalledFromOperator(4));
+        if (hasStartedEditing) {
+            // we are already editing
+            return;
+        }
+        hasStartedEditing = true;
+        // notify the state
+        state.getEditableStateNode(this.index, operator);
+        store();
+    }
+
+    private boolean isCalledFromOperator(int level) {
+        // TODO: sun.reflect.Reflection.getCallerClass is not available in JDK7
+        // and alternative methods are really slow according to
+        // http://stackoverflow.com/questions/421280/in-java-how-do-i-find-the-caller-of-a-method-using-stacktrace-or-reflection
+
+//    	Class<?> caller = sun.reflect.Reflection.getCallerClass(level);
+//    	while (caller != null) {
+//    		if (Operator.class.isAssignableFrom(caller)) {
+//    			return true;
+//    		}
+//    		caller = sun.reflect.Reflection.getCallerClass(++level);
+//    	}
+//    	return false;
+
+        return true;
+    }
+
+    abstract protected void store();
+
+    abstract public void restore();
+
+} // class StateNode
diff --git a/src/beast/core/StateNodeInitialiser.java b/src/beast/core/StateNodeInitialiser.java
new file mode 100644
index 0000000..5afa4f6
--- /dev/null
+++ b/src/beast/core/StateNodeInitialiser.java
@@ -0,0 +1,36 @@
+package beast.core;
+
+import java.util.List;
+
+/**
+ * Typically, StateNodes are initialised through their inputs. However, there are initialisation scenarios
+ * too complex for this approach to work. For example, initialisation may require additional information not
+ * provided by the inputs, or several dependent plugins need to initialise together,
+ * such as gene trees and a species tree.
+ * <p/>
+ * StateNodeInitialisers take one or more StateNodes as input and  initializes them in initStateNodes().
+ * getInitialisedStateNodes() reports back which nodes has been initialized, but this is currently only used to
+ * check for multiple initialiser for the same object.
+ *  <p/>
+ * Like any other iBEASTObject, a state initialiser must have an initAndValidate(), which is called once.
+ * getInitialisedStateNodes(), on the other hand,  may be called multiple times as its inputs change while the system
+ * tries to establish a valid starting state. initAndValidate is executed in order that the XML parser see objects,
+ * so the inputs are not guaranteed to be initialized at this time. initStateNodes is executed in order of appearance
+ * in MCMC, so inputs requiring initialization are properly initialized when initStateNodes is called.
+ *
+ * @author remco
+ */
+public interface StateNodeInitialiser {
+
+    /**
+     * Called to set up start state. May be called multiple times. *
+     */
+    void initStateNodes() throws Exception;
+
+    /**
+     * @return list of StateNodes that are initialised
+     *         This information is used to ensure StateNode are not initialised more than once.
+     * @param stateNodes
+     */
+    void getInitialisedStateNodes(List<StateNode> stateNodes);
+}
diff --git a/src/beast/core/parameter/BooleanParameter.java b/src/beast/core/parameter/BooleanParameter.java
new file mode 100644
index 0000000..556c00f
--- /dev/null
+++ b/src/beast/core/parameter/BooleanParameter.java
@@ -0,0 +1,117 @@
+/*
+* File BooleanParameter.java
+*
+* Copyright (C) 2010 Joseph Heled jheled at gmail.com
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+package beast.core.parameter;
+
+
+import beast.core.Description;
+
+import java.io.PrintStream;
+
+
+/**
+ * @author Joseph Heled
+ */
+ at Description("A Boolean-valued parameter represents a value (or array of values if the dimension is larger than one) " +
+        "in the state space that can be changed by operators.")
+public class BooleanParameter extends Parameter.Base<java.lang.Boolean> {
+    public BooleanParameter() {
+        m_fUpper = true;
+    }
+
+    public BooleanParameter(Boolean[] fValues) {
+        super(fValues);
+        m_fUpper = true;
+    }
+
+    /**
+     * Constructor used by Input.setValue(String) *
+     */
+    public BooleanParameter(String sValue) throws Exception {
+        init(sValue, 1);
+        m_fUpper = true;
+    }
+
+
+    @Override
+    Boolean getMax() {
+        return true;
+    }
+
+    @Override
+    Boolean getMin() {
+        return false;
+    }
+
+    /** Valuable implementation follows **/
+    /**
+     * we need this here, because the base implementation (public T getValue()) fails
+     * for some reason
+     */
+    @Override
+    public Boolean getValue() {
+        return values[0];
+    }
+
+    @Override
+    public double getArrayValue() {
+        return (values[0] ? 1 : 0);
+    }
+
+    @Override
+    public double getArrayValue(int iValue) {
+        return (values[iValue] ? 1 : 0);
+    }
+
+    /**
+     * Loggable implementation follows *
+     */
+    @Override
+    public void log(int nSample, PrintStream out) {
+        BooleanParameter var = (BooleanParameter) getCurrent();
+        int nValues = var.getDimension();
+        for (int iValue = 0; iValue < nValues; iValue++) {
+            // Output 0/1 for tracer
+            out.print((var.getValue(iValue) ? '1' : '0') + "\t");
+        }
+    }
+
+    /**
+     * StateNode methods *
+     */
+    @Override
+    public int scale(double fScale) {
+        // nothing to do
+        System.err.println("Attempt to scale Boolean parameter " + getID() + "  has no effect");
+        return 0;
+    }
+
+    @Override
+    void fromXML(int nDimension, String sLower, String sUpper, String[] sValues) {
+        values = new Boolean[nDimension];
+        for (int i = 0; i < sValues.length; i++) {
+            values[i] = Boolean.parseBoolean(sValues[i]);
+        }
+    }
+}
diff --git a/src/beast/core/parameter/BooleanParameterList.java b/src/beast/core/parameter/BooleanParameterList.java
new file mode 100644
index 0000000..309fd3a
--- /dev/null
+++ b/src/beast/core/parameter/BooleanParameterList.java
@@ -0,0 +1,44 @@
+package beast.core.parameter;
+
+import beast.core.Description;
+import beast.core.Input;
+import java.util.List;
+
+/**
+ * @author Tim Vaughan <tgvaughan at gmail.com>
+ */
+ at Description("State node describing a list of boolean parameters.")
+public class BooleanParameterList extends GeneralParameterList<Boolean> {
+    
+    @Override
+    public void initAndValidate() {
+        lowerBound = false;
+        upperBound = true;
+        
+        super.initAndValidate();
+    }
+
+    @Override
+    protected void readStateFromString(String[] boundsString,
+            List<String[]> parameterValueStrings,
+            List<Integer> keys) {
+        
+        lowerBound = Boolean.parseBoolean(boundsString[0]);
+        upperBound = Boolean.parseBoolean(boundsString[1]);
+        
+        pList.clear();
+        
+        for (int pidx=0; pidx<parameterValueStrings.size(); pidx++) {
+            String [] pValueString = parameterValueStrings.get(pidx);
+            
+            QuietParameter param = new QuietParameter();
+            param.key = keys.get(pidx);
+            
+            for (int vidx=0; vidx<pValueString.length; vidx++)
+                param.values[vidx] = Boolean.parseBoolean(pValueString[vidx]);
+            
+            pList.add(param);
+        }
+    }
+    
+}
diff --git a/src/beast/core/parameter/CompoundValuable.java b/src/beast/core/parameter/CompoundValuable.java
new file mode 100644
index 0000000..35e8304
--- /dev/null
+++ b/src/beast/core/parameter/CompoundValuable.java
@@ -0,0 +1,104 @@
+package beast.core.parameter;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import beast.core.CalculationNode;
+import beast.core.Description;
+import beast.core.Function;
+import beast.core.Input;
+import beast.core.StateNode;
+import beast.core.BEASTObject;
+import beast.core.Input.Validate;
+
+
+
+ at Description("Summarizes a set of valuables so that for example a rate matrix can be " +
+        "specified that uses a parameter in various places in the matrix.")
+public class CompoundValuable extends CalculationNode implements Function {
+    public Input<List<BEASTObject>> m_values = new Input<List<BEASTObject>>("var", "reference to a valuable",
+            new ArrayList<BEASTObject>(), Validate.REQUIRED, Function.class);
+
+    boolean m_bRecompute = true;
+    /**
+     * contains values of the inputs *
+     */
+    double[] m_fValues;
+
+    @Override
+    public void initAndValidate() throws Exception {
+        // determine dimension
+        int nDimension = 0;
+        for (BEASTObject plugin : m_values.get()) {
+            if (!(plugin instanceof Function)) {
+                throw new Exception("Input does not implement Valuable");
+            }
+            nDimension += ((Function) plugin).getDimension();
+        }
+        m_fValues = new double[nDimension];
+    }
+
+    /**
+     * Valuable implementation follows *
+     */
+    @Override
+    public int getDimension() {
+        return m_fValues.length;
+    }
+
+    @Override
+    public double getArrayValue() {
+        if (m_bRecompute) {
+            recompute();
+        }
+        return m_fValues[0];
+    }
+
+    @Override
+    public double getArrayValue(int iDim) {
+        if (m_bRecompute) {
+            recompute();
+        }
+        return m_fValues[iDim];
+    }
+
+    /**
+     * collect values of the compounds into an array *
+     */
+    private void recompute() {
+        int k = 0;
+        for (BEASTObject plugin : m_values.get()) {
+            Function valuable = (Function) plugin;
+            if (plugin instanceof StateNode) {
+                valuable = ((StateNode) plugin).getCurrent();
+            }
+            int nDimension = valuable.getDimension();
+            for (int i = 0; i < nDimension; i++) {
+                m_fValues[k++] = valuable.getArrayValue(i);
+            }
+        }
+        m_bRecompute = false;
+    }
+
+    /**
+     * CalculationNode methods *
+     */
+    @Override
+    public void store() {
+        m_bRecompute = true;
+        super.store();
+    }
+
+    @Override
+    public void restore() {
+        m_bRecompute = true;
+        super.restore();
+    }
+
+    @Override
+    public boolean requiresRecalculation() {
+        m_bRecompute = true;
+        return true;
+    }
+
+}
diff --git a/src/beast/core/parameter/GeneralParameterList.java b/src/beast/core/parameter/GeneralParameterList.java
new file mode 100644
index 0000000..a44bd63
--- /dev/null
+++ b/src/beast/core/parameter/GeneralParameterList.java
@@ -0,0 +1,654 @@
+/*
+ * Copyright (C) 2013 Tim Vaughan <tgvaughan at gmail.com>.
+ *
+ * This library 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 library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301  USA
+ */
+package beast.core.parameter;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.StateNode;
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.TreeSet;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import org.w3c.dom.Node;
+
+/**
+ * @author Tim Vaughan <tgvaughan at gmail.com>
+ * @param <T> Type of parameters in list.
+ */
+ at Description("State node representing a list of parameter objects, used for "
+        + "model selection problems. The parameters involved are not instances "
+        + "of Parameter.Base, but are instead instances of a local class "
+        + "QuietParameter which is not itself a StateNode.  All constituent "
+        + "parameters must have identical dimensions and bounds.")
+public abstract class GeneralParameterList<T> extends StateNode {
+    
+    public Input<List<Parameter.Base>> initialParamsInput = new Input<List<Parameter.Base>>(
+            "initialParam",
+            "Parameter whose value will initially be in parameter list.",
+            new ArrayList<Parameter.Base>());
+    
+    public Input<Integer> dimensionInput = new Input<Integer>("dimension",
+            "Dimension of individual parameters in list.  Default 1.", 1);
+    
+    public Input<Integer> minorDimensionInput = new Input<Integer>("minordimension",
+            "Minor dimension of individual parameters in list. Default 1.", 1);
+    
+
+    
+    protected List<QuietParameter> pList, pListStored;
+    
+    protected TreeSet<Integer> deallocatedKeys, deallocatedKeysStored;
+    protected int nextUnallocatedKey, nextUnallocatedKeyStored;
+    
+    protected int dimension, minorDimension;
+    protected T lowerBound, upperBound;
+
+    public GeneralParameterList() { };
+    
+    @Override
+    public void initAndValidate() {
+        pList = new ArrayList<QuietParameter>();
+        pListStored = new ArrayList<QuietParameter>();
+        deallocatedKeys = new TreeSet<Integer>();
+        deallocatedKeysStored = new TreeSet<Integer>();
+        nextUnallocatedKey = 0;
+        nextUnallocatedKeyStored = 0;
+        
+        dimension = dimensionInput.get();
+        minorDimension = minorDimensionInput.get();
+        
+        for (Parameter param : initialParamsInput.get()) {
+            if (param.getDimension() != dimension)
+                throw new IllegalArgumentException("Parameter dimension does not equal"
+                        + " dimension specified in enclosing ParameterList.");
+            QuietParameter qParam = new QuietParameter(param);
+            allocateKey(qParam);
+            pList.add(qParam);
+        }
+
+        store();
+        setSomethingIsDirty(false);
+    }
+   
+    /**
+     * Retrieve number of parameters in parameter list.
+     * 
+     * @return size of parameter list.
+     */
+    public int size() {
+        return pList.size();
+    }
+    
+    /**
+     * Retrieve parameter from list.
+     * 
+     * @param index index of parameter to retrieve
+     * @return parameter
+     */
+    public QuietParameter get(int index) {
+        return pList.get(index);
+    }
+    
+    /**
+     * Assign parameter to position in list.
+     * 
+     * @param index
+     * @param param 
+     */
+    public void set(int index, QuietParameter param) {
+        startEditing(null);
+        pList.set(index, param);
+    }
+    
+    /**
+     * Append parameter to end of list.
+     * 
+     * @param param 
+     */
+    public void add(QuietParameter param) {
+        startEditing(null);
+        pList.add(param);
+    }
+    
+    /**
+     * Insert parameter at position index in list, incrementing the index of
+     * all parameters already at and to the right of that position.
+     * 
+     * @param index
+     * @param param 
+     */
+    public void add(int index, QuietParameter param) {
+        startEditing(null);
+        pList.add(index, param);
+    }
+    
+    /**
+     * Remove parameter from list.
+     * 
+     * @param param 
+     */
+    public void remove(QuietParameter param) {
+        startEditing(null);
+        deallocatedKeys.add(param.key);
+        pList.remove(param);
+    }
+    
+    /**
+     * Remove parameter at index from list.
+     * 
+     * @param index 
+     */
+    public void remove(int index) {
+        startEditing(null);
+        deallocatedKeys.add(pList.get(index).key);
+        pList.remove(index);
+    }
+    
+    /**
+     * Create new parameter, without appending it to the list.  This only
+     * makes sense if the parameter is eventually added to the list.  This
+     * call does not itself affect the ParameterList's dirty status (it
+     * will be marked as dirty when/if add() is called).
+     * 
+     * @return New parameter.
+     */
+    public QuietParameter createNewParam() {
+        QuietParameter param = new QuietParameter();
+        allocateKey(param);
+        return param;
+    }
+    
+    /**
+     * Create new parameter from existing Parameter, without appending it to
+     * the list.  This only makes sense if the parameter is eventually added
+     * to the list.  This call does not itself affect the ParameterList's
+     * dirty status (it will be marked as dirty when/if add() is called).
+     * 
+     * @param otherParam
+     * @return New parameter.
+     */
+    public QuietParameter createNewParam(Parameter otherParam) {
+        QuietParameter param = new QuietParameter(otherParam);
+        allocateKey(param);
+        return param;
+    }
+
+    /**
+     * Create new parameter and append to list.
+     * 
+     * @return New parameter.
+     */
+    public QuietParameter addNewParam() {
+        startEditing(null);
+        QuietParameter param = new QuietParameter();
+        allocateKey(param);
+        pList.add(param);
+        return param;
+    }
+    
+    /**
+     * Create new parameter from existing Parameter and append to list.
+     * 
+     * @param otherParam
+     * @return New parameter.
+     */
+    public QuietParameter addNewParam(Parameter otherParam) {
+        startEditing(null);
+        QuietParameter param = new QuietParameter(otherParam);
+        allocateKey(param);
+        pList.add(param);
+        return param;
+    }
+    
+    /**
+     * Assign unique ID to this parameter.
+     * @param param 
+     */
+    private void allocateKey(QuietParameter param) {
+        if (deallocatedKeys.size()>0) {
+            param.key = deallocatedKeys.first();
+            deallocatedKeys.remove(param.key);
+        } else {
+            param.key = nextUnallocatedKey;
+            nextUnallocatedKey += 1;
+        }
+    }
+    
+    @Override
+    public StateNode copy() {
+
+        try {
+            GeneralParameterList<T> copy = (GeneralParameterList<T>) this.clone();
+            copy.initAndValidate();
+                    
+            copy.pList.clear();
+            for (QuietParameter param : pList) {
+                QuietParameter paramCopy = param.copy();
+                copy.pList.add(paramCopy);
+            }
+        
+            copy.dimension = dimension;
+            copy.minorDimension = minorDimension;
+            copy.lowerBound = lowerBound;
+            copy.upperBound = upperBound;
+            copy.deallocatedKeys.addAll(deallocatedKeys);
+            copy.nextUnallocatedKey = nextUnallocatedKey;
+            
+            return copy;
+        
+        } catch (CloneNotSupportedException ex) {
+            Logger.getLogger(GeneralParameterList.class.getName()).log(Level.SEVERE, null, ex);
+        }
+        
+        return null;
+    }
+
+    @Override
+    public void assignTo(StateNode other) {
+        if (!(other instanceof GeneralParameterList))
+            throw new RuntimeException("Incompatible statenodes in assignTo "
+                    + "call.");
+        
+        GeneralParameterList otherParamList = (GeneralParameterList)other;
+        
+        otherParamList.pList.clear();
+        for (QuietParameter param : pList)
+            otherParamList.pList.add(param.copy());
+        
+        otherParamList.dimension = dimension;
+        otherParamList.minorDimension = minorDimension;
+        otherParamList.lowerBound = lowerBound;
+        otherParamList.upperBound = upperBound;
+        otherParamList.deallocatedKeys = new TreeSet<Integer>(deallocatedKeys);
+        otherParamList.nextUnallocatedKey = nextUnallocatedKey;
+    }
+
+    @Override
+    public void assignFrom(StateNode other) {
+        if (!(other instanceof GeneralParameterList))
+            throw new RuntimeException("Incompatible statenodes in assignFrom "
+                    + "call.");
+        
+        GeneralParameterList<T> otherParamList = (GeneralParameterList<T>)other;
+        
+        pList.clear();
+        for (Object paramObj : otherParamList.pList)
+            pList.add((QuietParameter)paramObj);
+        
+        dimension = otherParamList.dimension;
+        minorDimension = otherParamList.minorDimension;
+        lowerBound = otherParamList.lowerBound;
+        upperBound = otherParamList.upperBound;
+        deallocatedKeys = new TreeSet<Integer>(otherParamList.deallocatedKeys);
+        nextUnallocatedKey = otherParamList.nextUnallocatedKey;
+    }
+
+    @Override
+    public void assignFromFragile(StateNode other) {
+        assignFrom(other);
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        
+        sb.append(String.format("Dimension: [%d, %d], Bounds: [%s,%s], ",
+                dimension,
+                minorDimension,
+                String.valueOf(lowerBound),
+                String.valueOf(upperBound)));
+        
+        sb.append("AvailableKeys: [");
+        boolean first = true;
+        for (int key : deallocatedKeys) {
+            if (!first)
+                sb.append(",");
+            else
+                first = false;
+            
+            sb.append(key);
+        }
+        sb.append("], ");
+        
+        sb.append("NextKey: ").append(nextUnallocatedKey).append(", ");
+        
+        sb.append("Parameters: [");
+        for (int i=0; i<pList.size(); i++) {
+            if (i>0)
+                sb.append(",");
+            sb.append(pList.get(i));
+        }
+        sb.append("], ");
+        
+        sb.append("ParameterKeys: [");
+        for (int i=0; i<pList.size(); i++) {
+            if (i>0)
+                sb.append(",");
+            sb.append(pList.get(i).key);
+        }
+        sb.append("]");
+        
+        return sb.toString();
+    }
+    
+    
+    @Override
+    public void fromXML(Node node) {
+        String str = node.getTextContent();
+        
+        Pattern pattern = Pattern.compile("^"
+                + " *Dimension: *\\[([^]]*)] *,"
+                + " *Bounds: *\\[([^]]*)] *,"
+                + " *AvailableKeys: *\\[([^]]*)] *,"
+                + " *NextKey: *([^, ]*) *,"
+                + " *Parameters: *\\[(.*)] *,"
+                + " *ParameterKeys: *\\[(.*)] *$");
+        Matcher matcher = pattern.matcher(str);
+        
+        if (!matcher.find())
+            throw new RuntimeException("Error parsing ParameterList state string.");
+        
+        // Parse dimension strings
+        String [] dimStr = matcher.group(1).split(",");
+        dimension = Integer.parseInt(dimStr[0].trim());
+        minorDimension = Integer.parseInt(dimStr[1].trim());
+        
+        // Parse dealocated key strings
+        deallocatedKeys.clear();
+        for (String keyStr : matcher.group(3).trim().split(",") ) {
+            if (keyStr.trim().length()>0)
+                deallocatedKeys.add(Integer.parseInt(keyStr));
+        }
+        
+        // Parse next allocated key string
+        nextUnallocatedKey = Integer.parseInt(matcher.group(4));
+        
+        // Prepare bounds and parameter value strings for parsing by methods in
+        // non-abstract classes (where type T is known).
+        String [] boundsStr = matcher.group(2).split(",");
+        
+        List<String[]> parameterValueStrings = new ArrayList<String[]>();
+        String parameterListString = matcher.group(5).trim();
+        
+        pattern = Pattern.compile("\\[([^]]*)]");
+        Matcher parameterMatcher = pattern.matcher(parameterListString);
+        
+        while(parameterMatcher.find())
+            parameterValueStrings.add(parameterMatcher.group(1).split(","));
+        
+        // Parse key strings:
+        List<Integer> keys = new ArrayList<Integer>();
+        for (String keyString : matcher.group(6).split(","))
+            keys.add(Integer.parseInt(keyString.trim()));
+        
+        readStateFromString(boundsStr, parameterValueStrings, keys);
+    }
+    
+    /**
+     * Reads upper and lower parameter element bounds and parameter values from
+     * strings and uses these to populate the corresponding GeneralParameterList
+     * fields.
+     * 
+     * @param boundsStrings Two-element array containing lower and upper bounds.
+     * @param parameterValueStrings List of arrays of reps of parameter values
+     * @param keys List of keys to assign to parameters
+     */
+    protected abstract void readStateFromString(String [] boundsStrings,
+            List<String[]> parameterValueStrings,
+            List<Integer> keys);
+
+    @Override
+    public int scale(double fScale) throws Exception {
+        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+    }
+
+    @Override
+    protected void store() {
+        pListStored.clear();
+        for (QuietParameter param : pList)
+            pListStored.add(param.copy());
+
+        deallocatedKeysStored.clear();
+        deallocatedKeysStored.addAll(deallocatedKeys);
+        nextUnallocatedKeyStored = nextUnallocatedKey;
+    }
+
+    @Override
+    public void restore() {
+        pList.clear();
+        for (QuietParameter param: pListStored)
+            pList.add(param.copy());
+        
+        deallocatedKeys.clear();
+        deallocatedKeys.addAll(deallocatedKeysStored);
+        nextUnallocatedKey = nextUnallocatedKeyStored;
+        
+        hasStartedEditing = false;
+    }
+    
+    
+    @Override
+    public void setEverythingDirty(boolean isDirty) {
+        setSomethingIsDirty(isDirty);
+    }
+
+    /*
+    * The following methods are here because Functions are Loggable.  This
+    * doesn't seem to make sense for ParameterLists though, so at the moment
+    * these methods just log the ParameterLists's size.
+    */
+    
+    @Override
+    public void init(PrintStream out) throws Exception {
+        out.print(getID() + ".size\t");
+    }
+
+    @Override
+    public void log(int nSample, PrintStream out) {
+        out.print(pList.size() + "\t");
+    }
+
+    @Override
+    public void close(PrintStream out) { }
+
+    /*
+     * The following methods are here because all StateNodes are Functions.
+     * They don't seem to make sense for ParameterLists though, so at the
+     * moment these methods just probe the ParameterList's size.
+     */
+    
+    @Override
+    public int getDimension() {
+        return 1;
+    }
+
+    @Override
+    public double getArrayValue() {
+        return pList.size();
+    }
+
+    @Override
+    public double getArrayValue(int i) {
+        if (i==0)
+            return pList.size();
+        else
+            return Double.NaN;
+    }
+
+    
+
+    /**
+     * Jessie's QuietParameter.  Objects of this class make sense
+     * only in the context of ParameterLists.  They behave very much like
+     * Parameter<T>.Base objects, but are not StateNodes.
+     */
+    public class QuietParameter implements Parameter<T> {
+
+        Object[] values;
+        int key = -1;
+        
+        /**
+         * Construct a new QuietParameter.
+         */
+        QuietParameter() {
+            values = new Object[dimension];
+        }
+
+        /**
+         * Create new QuietParameter from existing parameter.
+         * 
+         * @param param 
+         */
+        QuietParameter(Parameter param) {
+            if (param.getDimension() != dimension)
+                throw new IllegalArgumentException("Cannot construct "
+                        + "ParameterList parameter with a dimension not equal "
+                        + "to that specified in the enclosing list.");
+            
+            values = new Object[dimension];
+            for (int i=0; i<param.getValues().length; i++) {
+                values[i] = param.getValue(i);
+            }
+            
+        }
+        
+        public int getKey() {
+            return key;
+        }
+        
+        @Override
+        public T getValue(int i) {
+            return (T)values[i];
+        }
+
+        @Override
+        public T getValue() {
+            return (T)values[0];
+        }
+
+        @Override
+        public void setValue(int i, T value) {
+            startEditing(null); // ParameterList's startEditing()
+            values[i] = value;
+        }
+        
+        @Override
+        public void setValue(T value) {
+            startEditing(null); // ParameterList's startEditing()
+            values[0] = value;
+        }
+
+        @Override
+        public T getLower() {
+            return lowerBound;
+        }
+
+        @Override
+        public void setLower(T lower) {
+            lowerBound = lower;
+        }
+
+        @Override
+        public T getUpper() {
+            return upperBound;
+        }
+
+        @Override
+        public void setUpper(T upper) {
+            upperBound = upper;
+        }
+
+        @Override
+        public T[] getValues() {
+            return (T[])values;
+        }
+
+        @Override
+        public String getID() {
+            throw new UnsupportedOperationException("Not supported yet.");
+        }
+
+        @Override
+        public int getMinorDimension1() {
+            return minorDimension;
+        }
+        
+        @Override
+        public int getMinorDimension2() {
+            return dimension/minorDimension;
+        }
+        
+        
+        @Override
+        public T getMatrixValue(int i, int j) {
+            return (T)values[i*minorDimension+j];
+        }
+
+        @Override
+        public void swap(int i, int j) {
+            startEditing(null);
+            Object tmp = values[i];
+            values[i] = values[j];
+            values[j] = tmp;
+        }
+
+        @Override
+        public int getDimension() {
+            return values.length;
+        }
+
+        @Override
+        public double getArrayValue() {
+            return (Double)values[0];
+        }
+
+        @Override
+        public double getArrayValue(int i) {
+            return (Double)values[0];
+        }
+
+        @Override
+        public String toString() {
+            StringBuilder sb = new StringBuilder("[");
+            for (int i=0; i<values.length; i++) {
+                if (i>0)
+                    sb.append(",");
+                sb.append(values[i]);
+            }            
+            sb.append("]");
+            
+            return sb.toString();
+        }
+        
+        /**
+         * @return deep copy of parameter.
+         */
+        public QuietParameter copy() {
+            QuietParameter copy = new QuietParameter(this);
+            copy.key = this.key;
+            return copy;
+        }
+
+    }
+    
+}
diff --git a/src/beast/core/parameter/IntegerParameter.java b/src/beast/core/parameter/IntegerParameter.java
new file mode 100644
index 0000000..688f397
--- /dev/null
+++ b/src/beast/core/parameter/IntegerParameter.java
@@ -0,0 +1,112 @@
+package beast.core.parameter;
+
+
+import beast.core.Description;
+import beast.core.Input;
+
+import java.io.PrintStream;
+
+
+/**
+ * @author Alexei Drummond
+ */
+
+ at Description("An integer-valued parameter represents a value (or array of values if the dimension is larger than one) " +
+        "in the state space that can be changed by operators.")
+public class IntegerParameter extends Parameter.Base<java.lang.Integer> {
+    public Input<Integer> lowerValueInput = new Input<Integer>("lower", "lower value for this parameter (default -infinity)");
+    public Input<Integer> upperValueInput = new Input<Integer>("upper", "upper value for this parameter  (default +infinity)");
+
+    public IntegerParameter() {
+    }
+
+    public IntegerParameter(Integer[] fValues) {
+        super(fValues);
+    }
+
+    /**
+     * Constructor used by Input.setValue(String) *
+     */
+    public IntegerParameter(String sValue) throws Exception {
+        init(0, 0, sValue, 1);
+    }
+
+    @Override
+    public void initAndValidate() throws Exception {
+        if (lowerValueInput.get() != null) {
+            m_fLower = lowerValueInput.get();
+        } else {
+            m_fLower = Integer.MIN_VALUE + 1;
+        }
+        if (upperValueInput.get() != null) {
+            m_fUpper = upperValueInput.get();
+        } else {
+            m_fUpper = Integer.MAX_VALUE - 1;
+        }
+        super.initAndValidate();
+    }
+
+    Integer getMax() {
+        return Integer.MAX_VALUE - 1;
+    }
+
+    Integer getMin() {
+        return Integer.MIN_VALUE + 1;
+    }
+
+    /** Valuable implementation follows **/
+    /**
+     * we need this here, because the base implementation (public T getValue()) fails
+     * for some reason
+     */
+    @Override
+    public Integer getValue() {
+        return values[0];
+    }
+
+    @Override
+    public double getArrayValue() {
+        return (double) values[0];
+    }
+
+    public int getNativeValue(final int iValue) {
+        return values[iValue];
+    }
+
+    @Override
+    public double getArrayValue(int iValue) {
+        return (double) values[iValue];
+    }
+
+    /**
+     * Loggable implementation follows *
+     */
+    @Override
+    public void log(int nSample, PrintStream out) {
+        IntegerParameter var = (IntegerParameter) getCurrent();
+        int nValues = var.getDimension();
+        for (int iValue = 0; iValue < nValues; iValue++) {
+            out.print(var.getValue(iValue) + "\t");
+        }
+    }
+
+    /**
+     * StateNode methods *
+     */
+    @Override
+    public int scale(double fScale) {
+        // nothing to do
+        System.err.println("Attempt to scale Integer parameter " + getID() + "  has no effect");
+        return 0;
+    }
+
+    @Override
+    void fromXML(int nDimension, String sLower, String sUpper, String[] sValues) {
+        setLower(Integer.parseInt(sLower));
+        setUpper(Integer.parseInt(sUpper));
+        values = new Integer[nDimension];
+        for (int i = 0; i < sValues.length; i++) {
+            values[i] = Integer.parseInt(sValues[i]);
+        }
+    }
+}
diff --git a/src/beast/core/parameter/IntegerParameterList.java b/src/beast/core/parameter/IntegerParameterList.java
new file mode 100644
index 0000000..638d424
--- /dev/null
+++ b/src/beast/core/parameter/IntegerParameterList.java
@@ -0,0 +1,49 @@
+package beast.core.parameter;
+
+import beast.core.Description;
+import beast.core.Input;
+import java.util.List;
+
+/**
+ * @author Tim Vaughan <tgvaughan at gmail.com>
+ */
+ at Description("State node describing a list of integer-valued parameters.")
+public class IntegerParameterList extends GeneralParameterList<Integer> {
+    
+    public Input<Integer> lowerBoundInput = new Input<Integer>("lower",
+            "Lower bound on parameter values.", Integer.MIN_VALUE+1);
+    public Input<Integer> upperBoundInput = new Input<Integer>("upper",
+            "Upper bound on parameter values.", Integer.MAX_VALUE-1);
+    
+    @Override
+    public void initAndValidate() {
+        lowerBound = lowerBoundInput.get();
+        upperBound = upperBoundInput.get();
+        
+        super.initAndValidate();
+    }
+
+    @Override
+    protected void readStateFromString(String[] boundsString,
+            List<String[]> parameterValueStrings,
+            List<Integer> keys) {
+        
+        lowerBound = Integer.parseInt(boundsString[0]);
+        upperBound = Integer.parseInt(boundsString[1]);
+        
+        pList.clear();
+        
+        for (int pidx=0; pidx<parameterValueStrings.size(); pidx++) {
+            String [] pValueString = parameterValueStrings.get(pidx);
+            
+            QuietParameter param = new QuietParameter();
+            param.key = keys.get(pidx);
+            
+            for (int vidx=0; vidx<pValueString.length; vidx++)
+                param.values[vidx] = Integer.parseInt(pValueString[vidx]);
+            
+            pList.add(param);
+        }
+    }
+    
+}
diff --git a/src/beast/core/parameter/Map.java b/src/beast/core/parameter/Map.java
new file mode 100644
index 0000000..cf43218
--- /dev/null
+++ b/src/beast/core/parameter/Map.java
@@ -0,0 +1,93 @@
+package beast.core.parameter;
+
+import beast.core.CalculationNode;
+import beast.core.Description;
+import beast.core.Input;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+
+ at Description("Unordered set mapping keys to values")
+abstract public class Map<T> extends CalculationNode {
+
+    public Input<java.util.Map<java.lang.String, T>> defaultInput = new Input<java.util.Map<java.lang.String, T>>("*",
+            "Input containing the map", new LinkedHashMap<java.lang.String, T>());
+
+    public java.util.Map<java.lang.String, T> map;
+
+    public Map() {
+        // set up type of default input, since it cannot be discovered through introspection
+        defaultInput.setType(mapType());
+    }
+
+    abstract protected Class<?> mapType();
+
+    @Override
+    public void initAndValidate() throws Exception {
+        map = defaultInput.get();
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    public void setInputValue(java.lang.String name, Object value) {
+        try {
+            for (Input<?> input : listInputs()) {
+                if (input != defaultInput && input.getName().equals(name)) {
+                    input.setValue(value, this);
+                    return;
+                }
+            }
+        } catch (IllegalAccessException e) {
+            e.printStackTrace();
+            throw new RuntimeException("Failed to set input named '" + name + "' with value '" + value + "'");
+        }
+        map = defaultInput.get();
+        if (defaultInput.getType().equals(List.class)) {
+            if (defaultInput.get().containsKey(name)) {
+                List list = (List) defaultInput.get().get(name);
+                list.add(value);
+            } else {
+                List list = new ArrayList();
+                list.add(value);
+                defaultInput.get().put(name, (T) list);
+            }
+
+        } else {
+            defaultInput.get().put(name, (T) value);
+        }
+    }
+
+    ;
+
+    @Override
+    public Input<?> getInput(java.lang.String name) {
+        try {
+            for (Input<?> input : listInputs()) {
+                if (input != defaultInput && input.getName().equals(name)) {
+                    return input;
+                }
+            }
+        } catch (IllegalAccessException e) {
+            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+            throw new RuntimeException("Failed to get input named '" + name + "'");
+        }
+        return defaultInput;
+    }
+
+    /**
+     * some utility methods *
+     */
+
+    public T get(String key) {
+        return map.get(key);
+    }
+
+    public boolean contains(String key) {
+        return map.containsKey(key);
+    }
+
+    public T remove(String key) {
+        return map.remove(key);
+    }
+}
diff --git a/src/beast/core/parameter/Parameter.java b/src/beast/core/parameter/Parameter.java
new file mode 100644
index 0000000..7d320ec
--- /dev/null
+++ b/src/beast/core/parameter/Parameter.java
@@ -0,0 +1,472 @@
+package beast.core.parameter;
+
+import java.io.PrintStream;
+import java.lang.reflect.Array;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+
+import beast.core.*;
+
+public interface Parameter<T> extends Function {
+
+    public T getValue(int i);
+
+    public T getValue();
+
+    public void setValue(int i, T value);
+    
+    public void setValue(T fValue);
+
+    public T getLower();
+
+    public void setLower(final T fLower);
+
+    public T getUpper();
+
+    public void setUpper(final T fUpper);
+
+    public T[] getValues();
+
+    public String getID();
+
+    public int getMinorDimension1();
+
+    public int getMinorDimension2();
+
+    public T getMatrixValue(int i, int j);
+
+    /**
+     * swap values of element i and j
+     *
+     * @param i
+     * @param j
+     */
+    public void swap(int i, int j);
+
+    @Description("A parameter represents a value in the state space that can be changed "
+            + "by operators.")
+    public abstract class Base<T> extends StateNode implements Parameter<T> {
+
+        /**
+         * value is a required input since it is very hard to ensure any
+         * internal consistency when no value is specified. When	another class
+         * wants to set the dimension, say, this will make it the responsibility
+         * of the other class to maintain internal consistency of the parameter.
+         */
+        public Input<List<T>> valuesInput = new Input<List<T>>("value", "start value(s) for this parameter. If multiple values are specified, they should be separated by whitespace.", new ArrayList<T>(), beast.core.Input.Validate.REQUIRED, getMax().getClass());
+        public final Input<java.lang.Integer> dimensionInput =
+                new Input<java.lang.Integer>("dimension", "dimension of the parameter (default 1, i.e scalar)", 1);
+        public final Input<Integer> minorDimensionInput = new Input<Integer>("minordimension", "minor-dimension when the parameter is interpreted as a matrix (default 1)", 1);
+
+        /**
+         * constructors *
+         */
+        public Base() {
+        }
+
+        public Base(final T[] values) {
+            this.values = values.clone();
+            this.storedValues = values.clone();
+            m_fUpper = getMax();
+            m_fLower = getMin();
+            m_bIsDirty = new boolean[values.length];
+            for (T value : values) {
+            	valuesInput.get().add(value);
+            }
+        }
+
+        @Override
+        public void initAndValidate() throws Exception {
+            T[] sValues = valuesInput.get().toArray((T[]) Array.newInstance(getMax().getClass(), 0));
+
+            int nDimension = Math.max(dimensionInput.get(), sValues.length);
+            dimensionInput.setValue(nDimension, this);
+            values = (T[]) Array.newInstance(getMax().getClass(), nDimension);
+            storedValues = (T[]) Array.newInstance(getMax().getClass(), nDimension);
+            for (int i = 0; i < values.length; i++) {
+                values[i] = sValues[i % sValues.length];
+            }
+
+            m_bIsDirty = new boolean[dimensionInput.get()];
+
+            minorDimension = minorDimensionInput.get();
+            if (minorDimension > 0 && dimensionInput.get() % minorDimension > 0) {
+                throw new Exception("Dimension must be divisible by stride");
+            }
+            this.storedValues = values.clone();
+        }
+        /**
+         * upper & lower bound These are located before the inputs (instead of
+         * after the inputs, as usual) so that valuesInput can determines the
+         * class
+         */
+        protected T m_fUpper;
+        protected T m_fLower;
+
+        abstract T getMax();
+
+        abstract T getMin();
+        /**
+         * the actual values of this parameter
+         */
+        protected T[] values;
+        protected T[] storedValues;
+        /**
+         * sub-dimension when parameter is considered a matrix
+         */
+        protected int minorDimension = 1;
+        /**
+         * isDirty flags for individual elements in high dimensional parameters
+         */
+        protected boolean[] m_bIsDirty;
+        /**
+         * last element to be changed *
+         */
+        protected int m_nLastDirty;
+
+        /**
+         * @param iParam dimention to check
+         * @return true if the iParam-th element has changed
+         */
+        public boolean isDirty(final int iParam) {
+            return m_bIsDirty[iParam];
+        }
+
+        /**
+         * Returns index of entry that was changed last. Useful if it is known
+         * only a single value has changed in the array. *
+         */
+        public int getLastDirty() {
+            return m_nLastDirty;
+        }
+
+        @Override
+        public void setEverythingDirty(final boolean isDirty) {
+            setSomethingIsDirty(isDirty);
+            Arrays.fill(m_bIsDirty, isDirty);
+        }
+
+        /*
+         * various setters & getters *
+         */
+        @Override
+        public int getDimension() {
+            return values.length;
+        }
+
+        /**
+         * Change the dimension of a parameter
+         * <p/>
+         * This should only be called from initAndValidate() when a parent
+         * plugin can easily calculate the dimension of a parameter, but it is
+         * awkward to do this by hand.
+         * <p/>
+         * Values are sourced from the original parameter values.
+         *
+         * @param nDimension
+         */
+        @SuppressWarnings("unchecked")
+        public void setDimension(final int nDimension) {
+            if (getDimension() != nDimension) {
+                final T[] values2 = (T[]) Array.newInstance(getMax().getClass(), nDimension);
+                for (int i = 0; i < nDimension; i++) {
+                    values2[i] = values[i % getDimension()];
+                }
+                values = (T[]) values2;
+                //storedValues = (T[]) Array.newInstance(m_fUpper.getClass(), nDimension);
+            }
+            m_bIsDirty = new boolean[nDimension];
+            try {
+                dimensionInput.setValue(nDimension, this);
+            } catch (Exception e) {
+                // ignore
+            }
+        }
+
+        public void setMinorDimension(final int nDimension) throws Exception {
+            minorDimension = nDimension;
+            if (minorDimension > 0 && dimensionInput.get() % minorDimension > 0) {
+                throw new Exception("Dimension must be divisible by stride");
+            }
+        }
+
+        @Override
+        public T getValue() {
+            return values[0];
+        }
+
+        @Override
+        public T getLower() {
+            return m_fLower;
+        }
+
+        @Override
+        public void setLower(final T fLower) {
+            m_fLower = fLower;
+        }
+
+        @Override
+        public T getUpper() {
+            return m_fUpper;
+        }
+
+        @Override
+        public void setUpper(final T fUpper) {
+            m_fUpper = fUpper;
+        }
+
+        @Override
+        public T getValue(final int iParam) {
+            return values[iParam];
+        }
+
+        @Override
+        public T[] getValues() {
+            return Arrays.copyOf(values, values.length);
+        }
+
+        public void setBounds(final T fLower, final T fUpper) {
+            m_fLower = fLower;
+            m_fUpper = fUpper;
+        }
+
+        @Override
+        public void setValue(final T fValue) {
+            startEditing(null);
+
+            values[0] = fValue;
+            m_bIsDirty[0] = true;
+            m_nLastDirty = 0;
+        }
+
+        @Override
+        public void setValue(final int iParam, final T fValue) {
+            startEditing(null);
+
+            values[iParam] = fValue;
+            m_bIsDirty[iParam] = true;
+            m_nLastDirty = iParam;
+
+        }
+
+        @Override
+        public void swap(final int iLeft, final int iRight) {
+            startEditing(null);
+            final T tmp = values[iLeft];
+            values[iLeft] = values[iRight];
+            values[iRight] = tmp;
+            m_bIsDirty[iLeft] = true;
+            m_bIsDirty[iRight] = true;
+        }
+
+        /**
+         * Note that changing toString means fromXML needs to be changed as
+         * well, since it parses the output of toString back into a parameter.
+         */
+        @Override
+        public String toString() {
+            final StringBuilder buf = new StringBuilder();
+            buf.append(getID()).append("[").append(values.length);
+            if (minorDimension > 0) {
+                buf.append(" ").append(minorDimension);
+            }
+            buf.append("] ");
+            buf.append("(").append(m_fLower).append(",").append(m_fUpper).append("): ");
+            for (final T value : values) {
+                buf.append(value).append(" ");
+            }
+            return buf.toString();
+        }
+
+        @Override
+        public Base<T> copy() {
+            try {
+                @SuppressWarnings("unchecked")
+                final Parameter.Base<T> copy = (Parameter.Base<T>) this.clone();
+                copy.values = values.clone();//new Boolean[values.length];
+                copy.m_bIsDirty = new boolean[values.length];
+                return copy;
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            return null;
+        }
+
+        @Override
+        public void assignTo(final StateNode other) {
+            @SuppressWarnings("unchecked")
+            final Parameter.Base<T> copy = (Parameter.Base<T>) other;
+            copy.setID(getID());
+            copy.index = index;
+            copy.values = values.clone();
+            //System.arraycopy(values, 0, copy.values, 0, values.length);
+            copy.m_fLower = m_fLower;
+            copy.m_fUpper = m_fUpper;
+            copy.m_bIsDirty = new boolean[values.length];
+        }
+
+        @Override
+        public void assignFrom(final StateNode other) {
+            @SuppressWarnings("unchecked")
+            final Parameter.Base<T> source = (Parameter.Base<T>) other;
+            setID(source.getID());
+            values = source.values.clone();
+            storedValues = source.storedValues.clone();
+            System.arraycopy(source.values, 0, values, 0, values.length);
+            m_fLower = source.m_fLower;
+            m_fUpper = source.m_fUpper;
+            m_bIsDirty = new boolean[source.values.length];
+        }
+
+        @Override
+        public void assignFromFragile(final StateNode other) {
+            @SuppressWarnings("unchecked")
+            final Parameter.Base<T> source = (Parameter.Base<T>) other;
+            System.arraycopy(source.values, 0, values, 0, values.length);
+            Arrays.fill(m_bIsDirty, false);
+        }
+
+        /**
+         * Loggable interface implementation follows (partly, the actual logging
+         * of values happens in derived classes) *
+         */
+        @Override
+        public void init(final PrintStream out) throws Exception {
+            final int nValues = getDimension();
+            if (nValues == 1) {
+                out.print(getID() + "\t");
+            } else {
+                for (int iValue = 0; iValue < nValues; iValue++) {
+                    out.print(getID() + (iValue + 1) + "\t");
+                }
+            }
+        }
+
+        @Override
+        public void close(final PrintStream out) {
+            // nothing to do
+        }
+
+        /**
+         * StateNode implementation *
+         */
+        @Override
+        public void fromXML(final Node node) {
+            final NamedNodeMap atts = node.getAttributes();
+            setID(atts.getNamedItem("id").getNodeValue());
+            final String sStr = node.getTextContent();
+            Pattern pattern = Pattern.compile(".*\\[(.*) (.*)\\].*\\((.*),(.*)\\): (.*) ");
+            Matcher matcher = pattern.matcher(sStr);
+
+            if (matcher.matches()) {
+                final String sDimension = matcher.group(1);
+                final String sStride = matcher.group(2);
+                final String sLower = matcher.group(3);
+                final String sUpper = matcher.group(4);
+                final String sValuesAsString = matcher.group(5);
+                final String[] sValues = sValuesAsString.split(" ");
+                minorDimension = Integer.parseInt(sStride);
+                fromXML(Integer.parseInt(sDimension), sLower, sUpper, sValues);
+            } else {
+                pattern = Pattern.compile(".*\\[(.*)\\].*\\((.*),(.*)\\): (.*) ");
+                matcher = pattern.matcher(sStr);
+                if (matcher.matches()) {
+                    final String sDimension = matcher.group(1);
+                    final String sLower = matcher.group(2);
+                    final String sUpper = matcher.group(3);
+                    final String sValuesAsString = matcher.group(4);
+                    final String[] sValues = sValuesAsString.split(" ");
+                    minorDimension = 0;
+                    fromXML(Integer.parseInt(sDimension), sLower, sUpper, sValues);
+                } else {
+                    throw new RuntimeException("parameter could not be parsed");
+                }
+            }
+        }
+
+        /**
+         * Restore a saved parameter from string representation. This cannot be
+         * a template method since it requires creation of an array of T...
+         *
+         * @param nDimension parameter dimension
+         * @param sLower lower bound
+         * @param sUpper upper bound
+         * @param sValues values
+         */
+        abstract void fromXML(int nDimension, String sLower, String sUpper, String[] sValues);
+
+        /**
+         * matrix implementation *
+         */
+        @Override
+        public int getMinorDimension1() {
+            return minorDimension;
+        }
+
+        @Override
+        public int getMinorDimension2() {
+            return getDimension() / minorDimension;
+        }
+
+        @Override
+        public T getMatrixValue(final int i, final int j) {
+            return values[i * minorDimension + j];
+        }
+
+        public void setMatrixValue(final int i, final int j, final T value) {
+            setValue(i * minorDimension + j, value);
+        }
+
+        public void getMatrixValues1(final int i, final T[] row) {
+            assert (row.length == minorDimension);
+            System.arraycopy(values, i * minorDimension, row, 0, minorDimension);
+        }
+
+        public void getMatrixValues1(final int i, final double[] row) {
+            assert (row.length == minorDimension);
+            for (int j = 0; j < minorDimension; j++) {
+                row[j] = getArrayValue(i * minorDimension + j);
+            }
+        }
+
+        public void getMatrixValues2(final int j, final T[] col) {
+            assert (col.length == getMinorDimension2());
+            for (int i = 0; i < getMinorDimension2(); i++) {
+                col[i] = values[i * minorDimension + j];
+            }
+        }
+
+        public void getMatrixValues2(final int j, final double[] col) {
+            assert (col.length == getMinorDimension2());
+            for (int i = 0; i < getMinorDimension2(); i++) {
+                col[i] = getArrayValue(i * minorDimension + j);
+            }
+        }
+
+        @SuppressWarnings("unchecked")
+        @Override
+        protected void store() {
+            if (storedValues.length != values.length) {
+                storedValues = (T[]) Array.newInstance(m_fUpper.getClass(), values.length);
+            }
+            System.arraycopy(values, 0, storedValues, 0, values.length);
+        }
+
+        @Override
+        public void restore() {
+            final T[] tmp = storedValues;
+            storedValues = values;
+            values = tmp;
+            hasStartedEditing = false;
+            if (m_bIsDirty.length != values.length) {
+                m_bIsDirty = new boolean[values.length];
+            }
+        }
+    } // class Parameter
+}
diff --git a/src/beast/core/parameter/RealParameter.java b/src/beast/core/parameter/RealParameter.java
new file mode 100644
index 0000000..236a645
--- /dev/null
+++ b/src/beast/core/parameter/RealParameter.java
@@ -0,0 +1,119 @@
+package beast.core.parameter;
+
+
+import beast.core.Description;
+import beast.core.Input;
+
+import java.io.PrintStream;
+
+
+/**
+ * @author Alexei Drummond
+ */
+
+ at Description("A real-valued parameter represents a value (or array of values if the dimension is larger than one) " +
+        "in the state space that can be changed by operators.")
+public class RealParameter extends Parameter.Base<Double> {
+    public Input<Double> lowerValueInput = new Input<Double>("lower", "lower value for this parameter (default -infinity)");
+    public Input<Double> upperValueInput = new Input<Double>("upper", "upper value for this parameter (default +infinity)");
+
+    public RealParameter() {
+    }
+
+    public RealParameter(final Double[] fValues) {
+        super(fValues);
+    }
+
+    /**
+     * Constructor used by Input.setValue(String) *
+     */
+    public RealParameter(final String sValue) throws Exception {
+        init(0.0, 0.0, sValue, 1);
+    }
+
+    @Override
+    public void initAndValidate() throws Exception {
+        if (lowerValueInput.get() != null) {
+            m_fLower = lowerValueInput.get();
+        } else {
+            m_fLower = Double.NEGATIVE_INFINITY;
+        }
+        if (upperValueInput.get() != null) {
+            m_fUpper = upperValueInput.get();
+        } else {
+            m_fUpper = Double.POSITIVE_INFINITY;
+        }
+        super.initAndValidate();
+    }
+
+    @Override
+    Double getMax() {
+        return Double.POSITIVE_INFINITY;
+    }
+
+    @Override
+    Double getMin() {
+        return Double.NEGATIVE_INFINITY;
+    }
+    /** Valuable implementation follows **/
+
+    /**
+     * RRB: we need this here, because the base implementation (public T getValue()) fails
+     * for some reason. Why?
+     */
+    @Override
+    public Double getValue() {
+        return values[0];
+    }
+
+    @Override
+    public double getArrayValue() {
+        return values[0];
+    }
+
+    @Override
+    public double getArrayValue(final int iValue) {
+        return values[iValue];
+    }
+
+    /**
+     * Loggable implementation *
+     */
+    @Override
+    public void log(final int nSample, final PrintStream out) {
+        final RealParameter var = (RealParameter) getCurrent();
+        final int nValues = var.getDimension();
+        for (int iValue = 0; iValue < nValues; iValue++) {
+            out.print(var.getValue(iValue) + "\t");
+        }
+    }
+
+    /**
+     * StateNode methods *
+     */
+    @Override
+    public int scale(final double fScale) throws Exception {
+        for (int i = 0; i < values.length; i++) {
+            values[i] *= fScale;
+            if (values[i] < m_fLower || values[i] > m_fUpper) {
+                throw new Exception("parameter scaled our of range");
+            }
+        }
+        return values.length;
+    }
+
+
+    @Override
+    void fromXML(final int nDimension, final String sLower, final String sUpper, final String[] sValues) {
+        setLower(Double.parseDouble(sLower));
+        setUpper(Double.parseDouble(sUpper));
+        values = new Double[nDimension];
+        for (int i = 0; i < sValues.length; i++) {
+            values[i] = Double.parseDouble(sValues[i]);
+        }
+    }
+
+
+}
+
+
diff --git a/src/beast/core/parameter/RealParameterList.java b/src/beast/core/parameter/RealParameterList.java
new file mode 100644
index 0000000..d71cb0d
--- /dev/null
+++ b/src/beast/core/parameter/RealParameterList.java
@@ -0,0 +1,49 @@
+package beast.core.parameter;
+
+import beast.core.Description;
+import beast.core.Input;
+import java.util.List;
+
+/**
+ * @author Tim Vaughan <tgvaughan at gmail.com>
+ */
+ at Description("State node describing a list of real-valued parameters.")
+public class RealParameterList extends GeneralParameterList<Double> {
+    
+    public Input<Double> lowerBoundInput = new Input<Double>("lower",
+            "Lower bound on parameter values.", Double.NEGATIVE_INFINITY);
+    public Input<Double> upperBoundInput = new Input<Double>("upper",
+            "Upper bound on parameter values.", Double.POSITIVE_INFINITY);
+    
+    @Override
+    public void initAndValidate() {
+        lowerBound = lowerBoundInput.get();
+        upperBound = upperBoundInput.get();
+        
+        super.initAndValidate();
+    }
+
+    @Override
+    protected void readStateFromString(String[] boundsString,
+            List<String[]> parameterValueStrings,
+            List<Integer> keys) {
+        
+        lowerBound = Double.parseDouble(boundsString[0]);
+        upperBound = Double.parseDouble(boundsString[1]);
+        
+        pList.clear();
+        
+        for (int pidx=0; pidx<parameterValueStrings.size(); pidx++) {
+            String [] pValueString = parameterValueStrings.get(pidx);
+            
+            QuietParameter param = new QuietParameter();
+            param.key = keys.get(pidx);
+            
+            for (int vidx=0; vidx<pValueString.length; vidx++)
+                param.values[vidx] = Double.parseDouble(pValueString[vidx]);
+            
+            pList.add(param);
+        }
+    }
+    
+}
diff --git a/src/beast/core/util/CompoundDistribution.java b/src/beast/core/util/CompoundDistribution.java
new file mode 100644
index 0000000..31b4b3b
--- /dev/null
+++ b/src/beast/core/util/CompoundDistribution.java
@@ -0,0 +1,238 @@
+/*
+* File CompoundProbabilityDistribution.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+package beast.core.util;
+
+
+
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.RejectedExecutionException;
+
+import beast.app.BeastMCMC;
+import beast.core.Description;
+import beast.core.Distribution;
+import beast.core.Input;
+import beast.core.State;
+import beast.core.BEASTObject;
+import beast.core.BEASTInterface;
+
+
+ at Description("Takes a collection of distributions, typically a number of likelihoods " +
+        "and priors and combines them into the compound of these distributions " +
+        "typically interpreted as the posterior.")
+public class CompoundDistribution extends Distribution {
+    // no need to make this input REQUIRED. If no distribution input is
+    // specified the class just returns probability 1.
+    public Input<List<Distribution>> pDistributions =
+            new Input<List<Distribution>>("distribution",
+                    "individual probability distributions, e.g. the likelihood and prior making up a posterior",
+                    new ArrayList<Distribution>());
+    public Input<Boolean> useThreadsInput = new Input<Boolean>("useThreads", "calculated the distributions in parallel using threads (default false)", false);
+    public Input<Integer> maxNrOfThreadsInput = new Input<Integer>("threads","maximum number of threads to use, if less than 1 the number of threads in BeastMCMC is used (default -1)", -1);
+    public Input<Boolean> ignoreInput = new Input<Boolean>("ignore", "ignore all distributions and return 1 as distribution (default false)", false);
+    
+    /**
+     * flag to indicate threads should be used. Only effective if the useThreadsInput is
+     * true and BeasMCMC.nrOfThreads > 1
+     */
+    boolean useThreads;
+    int nrOfThreads;
+    boolean ignore;
+    public static ExecutorService exec;
+    
+    @Override
+    public void initAndValidate() throws Exception {
+        super.initAndValidate();
+        useThreads = useThreadsInput.get() && (BeastMCMC.m_nThreads > 1);
+		nrOfThreads = useThreads ? BeastMCMC.m_nThreads : 1;
+		if (useThreads && maxNrOfThreadsInput.get() > 0) {
+			nrOfThreads = Math.min(maxNrOfThreadsInput.get(), BeastMCMC.m_nThreads);
+		}
+		if (useThreads) {
+		     exec = Executors.newFixedThreadPool(nrOfThreads);
+		}
+
+        ignore = ignoreInput.get();
+
+        if (pDistributions.get().size() == 0) {
+            logP = 0;
+        }
+//        for(Distribution dists : pDistributions.get()) {
+//        	logP += dists.calculateLogP();
+//        }
+    }
+
+
+    /**
+     * Distribution implementation follows *
+     */
+    @Override
+    public double calculateLogP() throws Exception {
+        logP = 0;
+        if (ignore) {
+        	return logP;
+        }
+        if (useThreads) {
+            logP = calculateLogPUsingThreads();
+        } else {
+            for (Distribution dists : pDistributions.get()) {
+                if (dists.isDirtyCalculation()) {
+                    logP += dists.calculateLogP();
+                } else {
+                    logP += dists.getCurrentLogP();
+                }
+                if (Double.isInfinite(logP) || Double.isNaN(logP)) {
+                    return logP;
+                }
+            }
+        }
+        return logP;
+    }
+
+    class CoreRunnable implements Runnable {
+        Distribution distr;
+
+        CoreRunnable(Distribution core) {
+            distr = core;
+        }
+
+        public void run() {
+            try {
+                if (distr.isDirtyCalculation()) {
+                    logP += distr.calculateLogP();
+                } else {
+                    logP += distr.getCurrentLogP();
+                }
+            } catch (Exception e) {
+                System.err.println("Something went wrong in a calculation of " + distr.getID());
+                e.printStackTrace();
+                System.exit(0);
+            }
+            countDown.countDown();
+        }
+
+    } // CoreRunnable
+
+    CountDownLatch countDown;
+
+    private double calculateLogPUsingThreads() throws Exception {
+        try {
+
+            int nrOfDirtyDistrs = 0;
+            for (Distribution dists : pDistributions.get()) {
+                if (dists.isDirtyCalculation()) {
+                    nrOfDirtyDistrs++;
+                }
+            }
+            countDown = new CountDownLatch(nrOfDirtyDistrs);
+            // kick off the threads
+            for (Distribution dists : pDistributions.get()) {
+                if (dists.isDirtyCalculation()) {
+                    CoreRunnable coreRunnable = new CoreRunnable(dists);
+                    exec.execute(coreRunnable);
+                }
+            }
+            countDown.await();
+            logP = 0;
+            for (Distribution distr : pDistributions.get()) {
+                logP += distr.getCurrentLogP();
+            }
+            return logP;
+        } catch (RejectedExecutionException e) {
+            useThreads = false;
+            System.err.println("Stop using threads: " + e.getMessage());
+            return calculateLogP();
+        }
+    }
+
+
+    @Override
+    public void sample(State state, Random random) {
+        for (Distribution distribution : pDistributions.get()) {
+            distribution.sample(state, random);
+        }
+    }
+
+    @Override
+    public List<String> getArguments() {
+        List<String> arguments = new ArrayList<String>();
+        for (Distribution distribution : pDistributions.get()) {
+            arguments.addAll(distribution.getArguments());
+        }
+        return arguments;
+    }
+
+    @Override
+    public List<String> getConditions() {
+        List<String> conditions = new ArrayList<String>();
+        for (Distribution distribution : pDistributions.get()) {
+            conditions.addAll(distribution.getConditions());
+        }
+        return conditions;
+    }
+
+    @Override
+    public List<BEASTInterface> listActivePlugins() throws IllegalArgumentException, IllegalAccessException {
+    	if (ignoreInput.get()) {
+    		return new ArrayList<BEASTInterface>();
+    	} else {
+    		return super.listActivePlugins();
+    	}
+    }
+
+    @Override
+    public boolean isStochastic() {
+        for (Distribution distribution : pDistributions.get()) {
+            if (distribution.isStochastic())
+                return true;
+        }
+        
+        return false;
+    }
+    
+    @Override
+    public double getNonStochasticLogP() throws Exception {
+        double logP = 0;
+        if (ignore) {
+        	return logP;
+        }
+        // The loop could gain a little bit from being multithreaded
+        // though getNonStochasticLogP is called for debugging purposes only
+        // so efficiency is not an immediate issue.
+        for (Distribution dists : pDistributions.get()) {
+            logP += dists.getNonStochasticLogP();
+            if (Double.isInfinite(logP) || Double.isNaN(logP)) {
+                return logP;
+            }
+        }
+        return logP;
+    }
+    
+} // class CompoundDistribution
diff --git a/src/beast/core/util/ESS.java b/src/beast/core/util/ESS.java
new file mode 100644
index 0000000..1bc3f6c
--- /dev/null
+++ b/src/beast/core/util/ESS.java
@@ -0,0 +1,260 @@
+package beast.core.util;
+
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import beast.core.Description;
+import beast.core.Function;
+import beast.core.Input;
+import beast.core.Loggable;
+import beast.core.BEASTObject;
+import beast.core.Input.Validate;
+
+
+//import beast.core.Distribution;
+
+ at Description("Report effective sample size of a parameter or log values from a distribution. " +
+        "This uses the same criterion as Tracer and assumes 10% burn in.")
+public class ESS extends BEASTObject implements Loggable {
+    public Input<Function> functionInput =
+            new Input<Function>("arg", "value (e.g. parameter or distribution) to report ESS for", Validate.REQUIRED);
+
+    /**
+     * values from which the ESS is calculated *
+     */
+    List<Double> trace;
+    /**
+     * sum of trace, excluding burn-in *
+     */
+    double sum = 0;
+    /**
+     * keep track of sums of trace(i)*trace(i_+ lag) for all lags, excluding burn-in  *
+     */
+    List<Double> squareLaggedSums;
+
+    @Override
+    public void initAndValidate() {
+        trace = new ArrayList<Double>();
+        squareLaggedSums = new ArrayList<Double>();
+    }
+
+    @Override
+    public void init(PrintStream out) throws Exception {
+        final String sID = ((BEASTObject) functionInput.get()).getID();
+        out.print("ESS(" + sID + ")\t");
+    }
+
+    final static int MAX_LAG = 2000;
+
+//  We determine the Effective Sample Size (ESS) based on the auto correlation (AC) between the sequence and the same
+//  sequence delayed by some amount.  For a highly correlated sequence the AC will be high for a small delay,
+//  and is expected to drop to around zero when the delay is large enough. The delay when the AC is zero is the ACT (auto
+//  correlation time), and the ESS is the number of samples remaining when keeping only one sample out of every ACT.
+//
+//  The (squared) auto correlation between two sequences is the covariance divided by the product of the individual
+//  variances. Since both sequences are essentially the same sequence we do not bother to scale.
+//
+//  The simplest criteria to use to find the point where the AC "gets" to zero is to take the first time it becomes
+//  negative. This is deemed too simple and instead we first find the approximate point - the first time where the sum of
+//  two consecutive values is negative, and then determine the ACT by assuming the AC - as a function of the delay - is
+//  roughly linear and so the ACT (the point on the X axis) is approximately equal to twice the area under the curve divided
+//  by the value at x=0 (the AC of the sequence). This is the reason for summing up twice the variances inside the loop - a
+//  basic numerical integration technique.
+
+    @Override
+    public void log(final int nSample, PrintStream out) {
+//		final Double fNewValue = (m_distribution == null? m_pParam.get().getValue() : m_distribution.getCurrentLogP());
+        final Double fNewValue = functionInput.get().getArrayValue();
+        trace.add(fNewValue);
+        sum += fNewValue;
+
+        final int nTotalSamples = trace.size();
+
+        // take 10% burn in
+        final int iStart = nTotalSamples / 10;
+        if (iStart != ((nTotalSamples - 1) / 10)) {
+            // compensate for 10% burnin
+            sum -= trace.get((nTotalSamples - 1) / 10);
+        }
+        final int nSamples = nTotalSamples - iStart;
+        final int nMaxLag = Math.min(nSamples, MAX_LAG);
+
+        // calculate mean
+        final double fMean = sum / nSamples;
+
+        if (iStart != ((nTotalSamples - 1) / 10)) {
+            // compensate for 10% burnin
+            int iTrace = ((nTotalSamples - 1) / 10);
+            for (int iLag = 0; iLag < squareLaggedSums.size(); iLag++) {
+                squareLaggedSums.set(iLag, squareLaggedSums.get(iLag) - trace.get(iTrace) * trace.get(iTrace + iLag));
+            }
+        }
+
+        while (squareLaggedSums.size() < nMaxLag) {
+            squareLaggedSums.add(0.0);
+        }
+
+        // calculate auto correlation for selected lag times
+        double[] fAutoCorrelation = new double[nMaxLag];
+        // fSum1 = \sum_{iStart ... nTotalSamples-iLag-1} trace
+        double fSum1 = sum;
+        // fSum1 = \sum_{iStart+iLag ... nTotalSamples-1} trace
+        double fSum2 = sum;
+        for (int iLag = 0; iLag < nMaxLag; iLag++) {
+            squareLaggedSums.set(iLag, squareLaggedSums.get(iLag) + trace.get(nTotalSamples - iLag - 1) * trace.get(nTotalSamples - 1));
+            // The following line is the same approximation as in Tracer 
+            // (valid since fMean *(nSamples - iLag), fSum1, and fSum2 are approximately the same)
+            // though a more accurate estimate would be
+            // fAutoCorrelation[iLag] = m_fSquareLaggedSums.get(iLag) - fSum1 * fSum2
+            fAutoCorrelation[iLag] = squareLaggedSums.get(iLag) - (fSum1 + fSum2) * fMean + fMean * fMean * (nSamples - iLag);
+            fAutoCorrelation[iLag] /= ((double) (nSamples - iLag));
+            fSum1 -= trace.get(nTotalSamples - 1 - iLag);
+            fSum2 -= trace.get(iStart + iLag);
+        }
+
+        double integralOfACFunctionTimes2 = 0.0;
+        for (int iLag = 0; iLag < nMaxLag; iLag++) {
+            if (iLag == 0) {
+                integralOfACFunctionTimes2 = fAutoCorrelation[0];
+            } else if (iLag % 2 == 0) {
+                // fancy stopping criterion - see main comment
+                if (fAutoCorrelation[iLag - 1] + fAutoCorrelation[iLag] > 0) {
+                    integralOfACFunctionTimes2 += 2.0 * (fAutoCorrelation[iLag - 1] + fAutoCorrelation[iLag]);
+                } else {
+                    // stop
+                    break;
+                }
+            }
+        }
+
+        // auto correlation time
+        final double fACT = integralOfACFunctionTimes2 / fAutoCorrelation[0];
+
+        // effective sample size
+        final double fESS = nSamples / fACT;
+        String sStr = fESS + "";
+        sStr = sStr.substring(0, sStr.indexOf('.') + 2);
+        out.print(sStr + "\t");
+    } // log
+
+    @Override
+    public void close(PrintStream out) {
+        // nothing to do
+    }
+
+
+    /**
+     * return ESS time of a sample, batch version.
+     * Can be used to calculate effective sample size
+     *
+     * @param fTrace:         values from which the ACT is calculated
+     * @param nSampleInterval time between samples *
+     */
+    public static double calcESS(List<Double> fTrace) {
+        return calcESS(fTrace.toArray(new Double[0]), 1);
+    }
+
+    public static double calcESS(Double[] fTrace, int nSampleInterval) {
+        return fTrace.length / (ACT(fTrace, nSampleInterval) / nSampleInterval);
+    }
+
+    public static double ACT(Double[] fTrace, int nSampleInterval) {
+        /** sum of trace, excluding burn-in **/
+        double fSum = 0.0;
+        /** keep track of sums of trace(i)*trace(i_+ lag) for all lags, excluding burn-in  **/
+        double[] fSquareLaggedSums = new double[MAX_LAG];
+        double[] fAutoCorrelation = new double[MAX_LAG];
+        for (int i = 0; i < fTrace.length; i++) {
+            fSum += fTrace[i];
+            // calculate mean
+            final double fMean = fSum / (i + 1);
+
+            // calculate auto correlation for selected lag times
+            // fSum1 = \sum_{iStart ... nTotalSamples-iLag-1} trace
+            double fSum1 = fSum;
+            // fSum1 = \sum_{iStart+iLag ... nTotalSamples-1} trace
+            double fSum2 = fSum;
+            for (int iLag = 0; iLag < Math.min(i + 1, MAX_LAG); iLag++) {
+                fSquareLaggedSums[iLag] = fSquareLaggedSums[iLag] + fTrace[i - iLag] * fTrace[i];
+                // The following line is the same approximation as in Tracer
+                // (valid since fMean *(nSamples - iLag), fSum1, and fSum2 are approximately the same)
+                // though a more accurate estimate would be
+                // fAutoCorrelation[iLag] = m_fSquareLaggedSums.get(iLag) - fSum1 * fSum2
+                fAutoCorrelation[iLag] = fSquareLaggedSums[iLag] - (fSum1 + fSum2) * fMean + fMean * fMean * (i + 1 - iLag);
+                fAutoCorrelation[iLag] /= ((double) (i + 1 - iLag));
+                fSum1 -= fTrace[i - iLag];
+                fSum2 -= fTrace[iLag];
+            }
+        }
+
+        final int nMaxLag = Math.min(fTrace.length, MAX_LAG);
+        double fIntegralOfACFunctionTimes2 = 0.0;
+        for (int iLag = 0; iLag < nMaxLag; iLag++) //{
+            if (iLag == 0) //{
+                fIntegralOfACFunctionTimes2 = fAutoCorrelation[0];
+            else if (iLag % 2 == 0)
+                // fancy stopping criterion - see main comment in Tracer code of BEAST 1
+                if (fAutoCorrelation[iLag - 1] + fAutoCorrelation[iLag] > 0) //{
+                    fIntegralOfACFunctionTimes2 += 2.0 * (fAutoCorrelation[iLag - 1] + fAutoCorrelation[iLag]);
+                else
+                    // stop
+                    break;
+        //}
+        //}
+        //}
+
+        // auto correlation time
+        return nSampleInterval * fIntegralOfACFunctionTimes2 / fAutoCorrelation[0];
+    }
+
+    public static double stdErrorOfMean(Double[] fTrace, int nSampleInterval) {
+        /** sum of trace, excluding burn-in **/
+        double fSum = 0.0;
+        /** keep track of sums of trace(i)*trace(i_+ lag) for all lags, excluding burn-in  **/
+        double[] fSquareLaggedSums = new double[MAX_LAG];
+        double[] fAutoCorrelation = new double[MAX_LAG];
+        for (int i = 0; i < fTrace.length; i++) {
+            fSum += fTrace[i];
+            // calculate mean
+            final double fMean = fSum / (i + 1);
+
+            // calculate auto correlation for selected lag times
+            // fSum1 = \sum_{iStart ... nTotalSamples-iLag-1} trace
+            double fSum1 = fSum;
+            // fSum1 = \sum_{iStart+iLag ... nTotalSamples-1} trace
+            double fSum2 = fSum;
+            for (int iLag = 0; iLag < Math.min(i + 1, MAX_LAG); iLag++) {
+                fSquareLaggedSums[iLag] = fSquareLaggedSums[iLag] + fTrace[i - iLag] * fTrace[i];
+                // The following line is the same approximation as in Tracer
+                // (valid since fMean *(nSamples - iLag), fSum1, and fSum2 are approximately the same)
+                // though a more accurate estimate would be
+                // fAutoCorrelation[iLag] = m_fSquareLaggedSums.get(iLag) - fSum1 * fSum2
+                fAutoCorrelation[iLag] = fSquareLaggedSums[iLag] - (fSum1 + fSum2) * fMean + fMean * fMean * (i + 1 - iLag);
+                fAutoCorrelation[iLag] /= ((double) (i + 1 - iLag));
+                fSum1 -= fTrace[i - iLag];
+                fSum2 -= fTrace[iLag];
+            }
+        }
+
+        final int nMaxLag = Math.min(fTrace.length, MAX_LAG);
+        double fIntegralOfACFunctionTimes2 = 0.0;
+        for (int iLag = 0; iLag < nMaxLag; iLag++) //{
+            if (iLag == 0) //{
+                fIntegralOfACFunctionTimes2 = fAutoCorrelation[0];
+            else if (iLag % 2 == 0)
+                // fancy stopping criterion - see main comment in Tracer code of BEAST 1
+                if (fAutoCorrelation[iLag - 1] + fAutoCorrelation[iLag] > 0) //{
+                    fIntegralOfACFunctionTimes2 += 2.0 * (fAutoCorrelation[iLag - 1] + fAutoCorrelation[iLag]);
+                else
+                    // stop
+                    break;
+        //}
+        //}
+        //}
+
+        // auto correlation time
+        return Math.sqrt(fIntegralOfACFunctionTimes2 / fTrace.length);
+    }
+
+} // class ESS
diff --git a/src/beast/core/util/Evaluator.java b/src/beast/core/util/Evaluator.java
new file mode 100644
index 0000000..4079aff
--- /dev/null
+++ b/src/beast/core/util/Evaluator.java
@@ -0,0 +1,9 @@
+package beast.core.util;
+
+/**
+ * @author Andrew Rambaut
+ * @version $Id$
+ */
+public interface Evaluator {
+    double evaluate();
+}
diff --git a/src/beast/core/util/Log.java b/src/beast/core/util/Log.java
new file mode 100644
index 0000000..6dec2fe
--- /dev/null
+++ b/src/beast/core/util/Log.java
@@ -0,0 +1,115 @@
+package beast.core.util;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintStream;
+import java.util.Arrays;
+
+/** class used for logging messages from programs 
+ * Comes with 5 levels:
+ * error, 
+ * warning, 
+ * info, 
+ * debug, 
+ * trace
+ **/ 
+public class Log {
+	static PrintStream nullStream = new PrintStream(new OutputStream() {
+		@Override
+		public void write(int b) throws IOException {
+		}
+	});
+	
+    public enum Level {
+        error, warning, info, debug, trace
+    }
+
+    static Level level = Level.info;
+    
+    /** return log levels as array of Strings **/
+    static public String [] values() {
+    	String [] values = new String[Level.values().length];
+    	for (int i = 0; i < values.length; i++) {
+			values[i] = Level.values()[i].toString();
+		}
+    	return values;
+    }
+	
+	static public PrintStream err;
+	static public PrintStream warning;
+	static public PrintStream info;
+	static public PrintStream debug;
+	static public PrintStream trace;
+
+	static private PrintStream errIfOpen;
+	static private PrintStream warningIfOpen;
+	static private PrintStream infoIfOpen;
+	static private PrintStream debugIfOpen;
+	static private PrintStream traceIfOpen;
+
+	static {
+		// Initialise streams here instead of when declaring the variables.
+		// This is a static method and these are static members. 
+		//  These can suffer from different orders of initialisation, depending on JVM
+		err= System.err;
+		warning= System.err;
+		info = System.out;
+		debug = System.out;
+		trace = System.out;
+
+		errIfOpen = System.err;
+		warningIfOpen = System.err;
+		infoIfOpen = System.out;
+		debugIfOpen = System.out;
+		traceIfOpen = System.out;
+		if (System.getProperty("beast.log.level") != null) {
+			try {
+				level = Level.valueOf(System.getProperty("beast.log.level"));
+			} catch (IllegalArgumentException e) {
+				System.err.println("beast.log.level is set to " + System.getProperty("beast.log.level") + " "
+						+"but should be one of " + Arrays.toString(Level.values()));
+			}
+		}
+		setLevel(level);
+	}
+	
+	final static public int ERROR = 0;
+	final static public int WARNING = 1;
+	final static public int INFO = 2;
+	final static public int DEBUG = 3;
+	final static public int TRACE = 4;
+	
+	/** Determines the level of logging that actually
+	 * reaches output. Only newLevel and below will 
+	 * be shown, the rest is suppressed.
+	 */
+	static public void setLevel(Level newLevel) {
+		level = newLevel;
+		
+		errIfOpen = (err == nullStream ? errIfOpen : err);
+		warningIfOpen = (warning == nullStream ? warningIfOpen : warning);
+		infoIfOpen = (info == nullStream ? infoIfOpen : info);
+		debugIfOpen = (debug == nullStream ? debugIfOpen : debug);
+		traceIfOpen = (trace == nullStream ? traceIfOpen : trace);
+
+		err = nullStream;
+		warning = nullStream;
+		info = nullStream;
+		debug = nullStream;
+		trace = nullStream;
+		
+		switch (level) {
+		case trace:
+			trace  = traceIfOpen;
+		case debug:
+			debug = debugIfOpen; 
+		case info:
+			info = infoIfOpen;
+		case warning:
+			warning = warningIfOpen;
+		case error:
+			err = errIfOpen;
+		}
+	}
+	
+} // Log
diff --git a/src/beast/core/util/Sum.java b/src/beast/core/util/Sum.java
new file mode 100644
index 0000000..db294b1
--- /dev/null
+++ b/src/beast/core/util/Sum.java
@@ -0,0 +1,121 @@
+package beast.core.util;
+
+import java.io.PrintStream;
+
+import beast.core.CalculationNode;
+import beast.core.Description;
+import beast.core.Function;
+import beast.core.Input;
+import beast.core.Loggable;
+import beast.core.BEASTObject;
+import beast.core.Input.Validate;
+import beast.core.parameter.BooleanParameter;
+import beast.core.parameter.IntegerParameter;
+
+
+
+ at Description("calculates sum of a valuable")
+public class Sum extends CalculationNode implements Function, Loggable {
+    public Input<Function> functionInput = new Input<Function>("arg", "argument to be summed", Validate.REQUIRED);
+
+    enum Mode {integer_mode, double_mode}
+
+    Mode mode;
+
+    boolean needsRecompute = true;
+    double sum = 0;
+    double storedSum = 0;
+
+    @Override
+    public void initAndValidate() {
+        Function valuable = functionInput.get();
+        if (valuable instanceof IntegerParameter || valuable instanceof BooleanParameter) {
+            mode = Mode.integer_mode;
+        } else {
+            mode = Mode.double_mode;
+        }
+    }
+
+    @Override
+    public int getDimension() {
+        return 1;
+    }
+
+    @Override
+    public double getArrayValue() {
+        if (needsRecompute) {
+            compute();
+        }
+        return sum;
+    }
+
+    /**
+     * do the actual work, and reset flag *
+     */
+    void compute() {
+        sum = 0;
+        final Function v = functionInput.get();
+        for (int i = 0; i < v.getDimension(); i++) {
+            sum += v.getArrayValue(i);
+        }
+        needsRecompute = false;
+    }
+
+    @Override
+    public double getArrayValue(int iDim) {
+        if (iDim == 0) {
+            return getArrayValue();
+        }
+        return Double.NaN;
+    }
+
+    /**
+     * CalculationNode methods *
+     */
+    @Override
+    public void store() {
+        storedSum = sum;
+        super.store();
+    }
+
+    @Override
+    public void restore() {
+        sum = storedSum;
+        super.restore();
+    }
+
+    @Override
+    public boolean requiresRecalculation() {
+        needsRecompute = true;
+        return true;
+    }
+
+    /**
+     * Loggable interface implementation follows
+     */
+    @Override
+    public void init(PrintStream out) throws Exception {
+        out.print("sum(" + ((BEASTObject) functionInput.get()).getID() + ")\t");
+    }
+
+    @Override
+    public void log(int nSample, PrintStream out) {
+        Function valuable = functionInput.get();
+        final int nDimension = valuable.getDimension();
+        double fSum = 0;
+        for (int iValue = 0; iValue < nDimension; iValue++) {
+            fSum += valuable.getArrayValue(iValue);
+        }
+        if (mode == Mode.integer_mode) {
+            out.print((int) fSum + "\t");
+        } else {
+            out.print(fSum + "\t");
+        }
+    }
+
+    @Override
+    public void close(PrintStream out) {
+        // nothing to do
+    }
+
+} // class Sum
diff --git a/src/beast/evolution/alignment/Alignment.java b/src/beast/evolution/alignment/Alignment.java
new file mode 100644
index 0000000..57d55c8
--- /dev/null
+++ b/src/beast/evolution/alignment/Alignment.java
@@ -0,0 +1,737 @@
+/*
+* File Alignment.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+package beast.evolution.alignment;
+
+import java.util.*;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.Input.Validate;
+import beast.core.parameter.Map;
+import beast.core.util.Log;
+import beast.evolution.datatype.DataType;
+import beast.evolution.datatype.StandardData;
+import beast.util.AddOnManager;
+
+ at Description("Class representing alignment data")
+public class Alignment extends Map<String> {
+
+    protected Class<?> mapType() {
+        return String.class;
+    }
+
+    /**
+     * default data type *
+     */
+    protected final static String NUCLEOTIDE = "nucleotide";
+
+    /**
+     * directory to pick up data types from *
+     */
+    final static String[] IMPLEMENTATION_DIR = {"beast.evolution.datatype"};
+
+    /**
+     * list of data type descriptions, obtained from DataType classes *
+     */
+    static List<String> types = new ArrayList<String>();
+
+    static {
+        findDataTypes();
+    }
+
+    static public void findDataTypes() {
+        // build up list of data types
+        List<String> m_sDataTypes = AddOnManager.find(beast.evolution.datatype.DataType.class, IMPLEMENTATION_DIR);
+        for (String sDataType : m_sDataTypes) {
+            try {
+                DataType dataType = (DataType) Class.forName(sDataType).newInstance();
+                if (dataType.isStandard()) {
+                    String sDescription = dataType.getTypeDescription();
+                    if (!types.contains(sDescription)) {
+                        types.add(sDescription);
+                    }
+                }
+            } catch (Exception e) {
+                // TODO: handle exception
+            }
+        }
+    }
+
+    public Input<List<Sequence>> sequenceInput =
+            new Input<>("sequence", "sequence and meta data for particular taxon", new ArrayList<>(), Validate.OPTIONAL);
+
+    public Input<TaxonSet> taxonSetInput =
+            new Input<>("taxa", "An optional taxon-set used only to sort the sequences into the same order as they appear in the taxon-set.", new TaxonSet(), Validate.OPTIONAL);
+
+    public Input<Integer> stateCountInput = new Input<>("statecount", "maximum number of states in all sequences");
+    public Input<String> dataTypeInput = new Input<>("dataType", "data type, one of " + types, NUCLEOTIDE, types.toArray(new String[0]));
+    public Input<DataType.Base> userDataTypeInput = new Input<>("userDataType", "non-standard, user specified data type, if specified 'dataType' is ignored");
+    public Input<Boolean> stripInvariantSitesInput = new Input<>("strip", "sets weight to zero for sites that are invariant (e.g. all 1, all A or all unkown)", false);
+    public Input<String> siteWeightsInput = new Input<>("weights", "comma separated list of weights, one for each site in the sequences. If not specified, each site has weight 1");
+
+    public Input<Boolean> isAscertainedInput = new Input<>("ascertained", "is true if the alignment allows ascertainment correction, i.e., conditioning the " +
+            "Felsenstein likelihood on excluding constant sites from the alignment", false);
+    /**
+     * Inputs from AscertainedAlignment
+     */
+    public Input<Integer> excludefromInput = new Input<>("excludefrom", "first site to condition on, default 0", 0);
+    public Input<Integer> excludetoInput = new Input<>("excludeto", "last site to condition on (but excluding this site), default 0", 0);
+    public Input<Integer> excludeeveryInput = new Input<>("excludeevery", "interval between sites to condition on (default 1)", 1);
+
+    /**
+     * list of sequences in the alignment *
+     */
+    protected List<Sequence> sequences = new ArrayList<>();
+
+    /**
+     * list of taxa names defined through the sequences in the alignment *
+     */
+    protected List<String> taxaNames = new ArrayList<>();
+
+    /**
+     * list of state counts for each of the sequences, typically these are
+     * constant throughout the whole alignment.
+     */
+    protected List<Integer> stateCounts = new ArrayList<>();
+
+    /**
+     * maximum of m_nStateCounts *
+     */
+    protected int maxStateCount;
+
+    /**
+     * state codes for the sequences *
+     */
+    protected List<List<Integer>> counts = new ArrayList<>();
+
+    /**
+     * data type, useful for converting String sequence to Code sequence, and back *
+     */
+    protected DataType m_dataType;
+
+    /**
+     * weight over the columns of a matrix *
+     */
+    protected int[] patternWeight;
+
+    /**
+     * weights of sites -- assumed 1 for each site if not specified
+     */
+    protected int[] siteWeights = null;
+
+    /**
+     * Probabilities associated with each tip of the tree, for use when the
+     * characters are uncertain.
+     */
+    public List<double[][]> tipLikelihoods = new ArrayList<double[][]>(); // #taxa x #sites x #states
+    private boolean usingTipLikelihoods = false;
+    
+    /**
+     * pattern state encodings *
+     */
+    protected int [][] sitePatterns; // #patterns x #taxa
+
+    /**
+     * maps site nr to pattern nr *
+     */
+    protected int[] patternIndex;
+
+    /**
+     * From AscertainedAlignment
+     */
+    Set<Integer> excludedPatterns;
+
+    /**
+     * A flag to indicate if the alignment is ascertained
+     */
+    public boolean isAscertained;
+
+    public Alignment() {
+    }
+
+    /**
+     * Constructor for testing purposes.
+     *
+     * @param sequences
+     * @param stateCount
+     * @param dataType
+     * @throws Exception when validation fails
+     * @deprecated This is the deprecated legacy form and will be removed
+     * at some point. Use {@link #Alignment(List, String)} instead.
+     */
+    @Deprecated
+    public Alignment(List<Sequence> sequences, Integer stateCount, String dataType) throws Exception {
+        this(sequences, dataType);
+    }
+
+    /**
+     * Constructor for testing purposes.
+     *
+     * @param sequences
+     * @param dataType
+     * @throws Exception when validation fails
+     */
+    public Alignment(List<Sequence> sequences, String dataType) throws Exception {
+
+        for (Sequence sequence : sequences) {
+            sequenceInput.setValue(sequence, this);
+        }
+        dataTypeInput.setValue(dataType, this);
+        initAndValidate();
+    }
+
+    @Override
+    public void initAndValidate() throws Exception {
+
+        if (sequenceInput.get().size() == 0 && defaultInput.get().size() == 0) {
+            throw new Exception("Either a sequence input must be specified, or a map of strings must be specified");
+        }
+
+        if (siteWeightsInput.get() != null) {
+            String sStr = siteWeightsInput.get().trim();
+            String[] strs = sStr.split(",");
+            siteWeights = new int[strs.length];
+            for (int i = 0; i < strs.length; i++) {
+                siteWeights[i] = Integer.parseInt(strs[i].trim());
+            }
+        }
+
+        // determine data type, either user defined or one of the standard ones
+        if (userDataTypeInput.get() != null) {
+            m_dataType = userDataTypeInput.get();
+        } else {
+            if (types.indexOf(dataTypeInput.get()) < 0) {
+                throw new Exception("data type + '" + dataTypeInput.get() + "' cannot be found. " +
+                        "Choose one of " + Arrays.toString(types.toArray(new String[0])));
+            }
+            // seems to spend forever in there??
+            List<String> sDataTypes = AddOnManager.find(beast.evolution.datatype.DataType.class, IMPLEMENTATION_DIR);
+            for (String sDataType : sDataTypes) {
+                DataType dataType = (DataType) Class.forName(sDataType).newInstance();
+                if (dataTypeInput.get().equals(dataType.getTypeDescription())) {
+                    m_dataType = dataType;
+                    break;
+                }
+            }
+        }
+
+        // initialize the sequence list
+        if (sequenceInput.get().size() > 0) {
+            sequences = sequenceInput.get();
+        } else {
+            // alignment defined by a map of id -> sequence
+            List<String> taxa = new ArrayList<>();
+            taxa.addAll(map.keySet());
+            sequences.clear();
+            for (String key : taxa) {
+                String sequence = map.get(key);
+                sequences.add(new Sequence(key, sequence));
+            }
+        }
+
+        // initialize the alignment from the given list of sequences
+        initializeWithSequenceList(sequences, true);
+
+        if (taxonSetInput.get() != null && taxonSetInput.get().getTaxonCount() > 0) {
+            sortByTaxonSet(taxonSetInput.get());
+        }
+        Log.info.println(toString(false));
+    }
+
+    /**
+     * Initializes the alignment given the provided list of sequences and no other information.
+     * It site weights and/or data type have been previously set up with initAndValidate then they
+     * remain in place. This method is used mainly to re-order the sequences to a new taxon order
+     * when an analysis of multiple alignments on the same taxa are undertaken.
+     *
+     * @param sequences
+     */
+    private void initializeWithSequenceList(List<Sequence> sequences, boolean log) {
+        this.sequences = sequences;
+        taxaNames.clear();
+        stateCounts.clear();
+        counts.clear();
+        try {
+            for (Sequence seq : sequences) {
+
+                counts.add(seq.getSequence(m_dataType));
+                if (taxaNames.contains(seq.getTaxon())) {
+                    throw new RuntimeException("Duplicate taxon found in alignment: " + seq.getTaxon());
+                }
+                taxaNames.add(seq.getTaxon());
+                tipLikelihoods.add(seq.getLikelihoods());
+                // if seq.isUncertain() == false then the above line adds 'null'
+	            // to the list, indicating that this particular sequence has no tip likelihood information
+                usingTipLikelihoods |= (seq.getLikelihoods() != null);	            
+
+                if (seq.totalCountInput.get() != null) {
+                    stateCounts.add(seq.totalCountInput.get());
+                } else {
+                    stateCounts.add(m_dataType.getStateCount());
+                }
+            }
+            if (counts.size() == 0) {
+                // no sequence data
+                throw new RuntimeException("Sequence data expected, but none found");
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            System.exit(0);
+        }
+        sanityCheckCalcPatternsSetUpAscertainment(log);
+    }
+
+    /**
+     * Checks that sequences are all the same length, calculates patterns and sets up ascertainment.
+     */
+    private void sanityCheckCalcPatternsSetUpAscertainment(boolean log) {
+        // Sanity check: make sure sequences are of same length
+        int nLength = counts.get(0).size();
+        if (!(m_dataType instanceof StandardData)) {
+            for (List<Integer> seq : counts) {
+                if (seq.size() != nLength) {
+                    throw new RuntimeException("Two sequences with different length found: " + nLength + " != " + seq.size());
+                }
+            }
+        }
+        if (siteWeights != null && siteWeights.length != nLength) {
+            throw new RuntimeException("Number of weights (" + siteWeights.length + ") does not match sequence length (" + nLength + ")");
+        }
+
+        calcPatterns(log);
+        setupAscertainment();
+    }
+
+    /**
+     * Sorts an alignment by a provided TaxonSet, so that the sequence/taxon pairs in the alignment match the order
+     * that the taxa appear in the TaxonSet (i.e. not necessarily alphabetically).
+     *
+     * @param toSortBy the taxon set that species the order on the taxa.
+     */
+    public void sortByTaxonSet(TaxonSet toSortBy) {
+
+        List<Sequence> sortedSeqs = new ArrayList<>();
+        sortedSeqs.addAll(sequences);
+        Collections.sort(sortedSeqs, new Comparator<Sequence>() {
+            @Override
+            public int compare(Sequence o1, Sequence o2) {
+                return Integer.compare(toSortBy.getTaxonIndex(o1.getTaxon()), toSortBy.getTaxonIndex(o2.getTaxon()));
+            }
+        });
+        initializeWithSequenceList(sortedSeqs, false);
+    }
+
+    void setupAscertainment() {
+        isAscertained = isAscertainedInput.get();
+
+        if (isAscertained) {
+            //From AscertainedAlignment
+            int iFrom = excludefromInput.get();
+            int iTo = excludetoInput.get();
+            int iEvery = excludeeveryInput.get();
+            excludedPatterns = new HashSet<Integer>();
+            for (int i = iFrom; i < iTo; i += iEvery) {
+                int iPattern = patternIndex[i];
+                // reduce weight, so it does not confuse the tree likelihood
+                patternWeight[iPattern] = 0;
+                excludedPatterns.add(iPattern);
+            }
+        } else {
+        	// sanity check
+            int iFrom = excludefromInput.get();
+            int iTo = excludetoInput.get();
+            if (iFrom != excludefromInput.defaultValue || iTo != excludetoInput.defaultValue) {
+            	Log.warning.println("WARNING: excludefrom or excludeto is specified, but 'ascertained' flag is not set to true");
+            	Log.warning.println("WARNING: to suppress this warning, remove the excludefrom or excludeto attributes (if no astertainment correction is required)");
+            	Log.warning.println("WARNING: or set the 'ascertained' flag to true on element with id=" + getID());
+            }
+        }
+
+    } // initAndValidate
+
+    static String getSequence(Alignment data, int taxonIndex) {
+
+        int[] nStates = new int[data.getPatternCount()];
+        for (int i = 0; i < data.getPatternCount(); i++) {
+            int[] sitePattern = data.getPattern(i);
+            nStates[i] = sitePattern[taxonIndex];
+        }
+        try {
+            return data.getDataType().state2string(nStates);
+        } catch (Exception e) {
+            e.printStackTrace();
+            System.exit(0);
+        }
+        return null;
+    }
+
+
+    /*
+     * assorted getters and setters *
+     */
+    public List<String> getTaxaNames() {
+        if (taxaNames.size() == 0) {
+            try {
+                initAndValidate();
+            } catch (Exception e) {
+                e.printStackTrace();
+                throw new RuntimeException(e);
+            }
+        }
+        return taxaNames;
+    }
+
+    public List<Integer> getStateCounts() {
+        return stateCounts;
+    }
+
+    /**
+     * Returns a List of Integer Lists where each Integer List represents
+     * the sequence corresponding to a taxon.  The taxon is identified by
+     * the position of the Integer List in the outer List, which corresponds
+     * to the nodeNr of the corresponding leaf node and the position of the
+     * taxon name in the taxaNames list.
+     *
+     * @return integer representation of sequence alignment
+     */
+    public List<List<Integer>> getCounts() {
+        return counts;
+    }
+
+    public DataType getDataType() {
+        return m_dataType;
+    }
+
+    /**
+     * @return number of taxa in Alignment.
+     */
+    public int getTaxonCount() {
+        //if (taxonsetInput.get() != null) {
+        //	return taxonsetInput.get().getTaxonCount();
+        //}
+        return taxaNames.size();
+    }
+
+    /**
+     * @return number of taxa in Alignment.
+     * @deprecated Use getTaxonCount() instead.
+     */
+    @Deprecated
+    public int getNrTaxa() {
+        return getTaxonCount();
+    }
+
+    public int getTaxonIndex(String sID) {
+        return taxaNames.indexOf(sID);
+    }
+
+    /**
+     * @return Number of unique character patterns in alignment.
+     */
+    public int getPatternCount() {
+        return sitePatterns.length;
+    }
+
+    public int[] getPattern(int iPattern) {
+        return sitePatterns[iPattern];
+    }
+
+    public int getPattern(int taxonIndex, int iPattern) {
+        return sitePatterns[iPattern][taxonIndex];
+    }
+
+    /**
+     * Retrieve the "weight" of a particular pattern: the number of sites
+     * having that pattern.
+     *
+     * @param iPattern Index into pattern array.
+     * @return pattern weight
+     */
+    public int getPatternWeight(int iPattern) {
+        return patternWeight[iPattern];
+    }
+
+    public int getMaxStateCount() {
+        return maxStateCount;
+    }
+
+    /**
+     * Retrieve index of pattern corresponding to a particular site.
+     *
+     * @param iSite Index of site.
+     * @return Index of pattern.
+     */
+    public int getPatternIndex(int iSite) {
+        return patternIndex[iSite];
+    }
+
+    /**
+     * @return Total number of sites in alignment.
+     */
+    public int getSiteCount() {
+        return patternIndex.length;
+    }
+
+    /**
+     * Retrieve an array containing the number of times each character pattern
+     * occurs in the alignment.
+     *
+     * @return Pattern weight array.
+     */
+    public int[] getWeights() {
+        return patternWeight;
+    }
+
+
+    /**
+     * SiteComparator is used for ordering the sites,
+     * which makes it easy to identify patterns.
+     */
+    class SiteComparator implements Comparator<int[]> {
+        public int compare(int[] o1, int[] o2) {
+            for (int i = 0; i < o1.length; i++) {
+                if (o1[i] > o2[i]) {
+                    return 1;
+                }
+                if (o1[i] < o2[i]) {
+                    return -1;
+                }
+            }
+            return 0;
+        }
+    } // class SiteComparator
+
+
+    protected void calcPatterns() {
+        calcPatterns(true);
+    }
+
+        /**
+         * calculate patterns from sequence data
+         * *
+         */
+    private void calcPatterns(boolean log) {
+        int nTaxa = counts.size();
+        int nSites = counts.get(0).size();
+
+        // convert data to transposed int array
+        int[][] nData = new int[nSites][nTaxa];
+        for (int i = 0; i < nTaxa; i++) {
+            List<Integer> sites = counts.get(i);
+            for (int j = 0; j < nSites; j++) {
+                nData[j][i] = sites.get(j);
+            }
+        }
+
+        // sort data
+        SiteComparator comparator = new SiteComparator();
+        Arrays.sort(nData, comparator);
+
+        // count patterns in sorted data
+        // if (siteWeights != null) the weights are recalculated below
+        int nPatterns = 1;
+        int[] weights = new int[nSites];
+        weights[0] = 1;
+        for (int i = 1; i < nSites; i++) {
+            if (usingTipLikelihoods || comparator.compare(nData[i - 1], nData[i]) != 0) {
+            	// In the case where we're using tip probabilities, we need to treat each 
+            	// site as a unique pattern, because it could have a unique probability vector.
+                nPatterns++;
+                nData[nPatterns - 1] = nData[i];
+            }
+            weights[nPatterns - 1]++;
+        }
+
+        // reserve memory for patterns
+        patternWeight = new int[nPatterns];
+        sitePatterns = new int[nPatterns][nTaxa];
+        for (int i = 0; i < nPatterns; i++) {
+            patternWeight[i] = weights[i];
+            sitePatterns[i] = nData[i];
+        }
+
+        // find patterns for the sites
+        patternIndex = new int[nSites];
+        for (int i = 0; i < nSites; i++) {
+            int[] sites = new int[nTaxa];
+            for (int j = 0; j < nTaxa; j++) {
+                sites[j] = counts.get(j).get(i);
+            }
+            patternIndex[i] = Arrays.binarySearch(sitePatterns, sites, comparator);
+        }
+
+        if (siteWeights != null) {
+            Arrays.fill(patternWeight, 0);
+            for (int i = 0; i < nSites; i++) {
+                patternWeight[patternIndex[i]] += siteWeights[i];
+            }
+        }
+
+        // determine maximum state count
+        // Usually, the state count is equal for all sites,
+        // though for SnAP analysis, this is typically not the case.
+        maxStateCount = 0;
+        for (int m_nStateCount1 : stateCounts) {
+            maxStateCount = Math.max(maxStateCount, m_nStateCount1);
+        }
+        // report some statistics
+        if (log && taxaNames.size() < 30) {
+            for (int i = 0; i < taxaNames.size(); i++) {
+                Log.info.println(taxaNames.get(i) + ": " + counts.get(i).size() + " " + stateCounts.get(i));
+            }
+        }
+
+        if (stripInvariantSitesInput.get()) {
+            // don't add patterns that are invariant, e.g. all gaps
+            if (log) Log.info.println("Stripping invariant sites");
+
+            int removedSites = 0;
+            for (int i = 0; i < nPatterns; i++) {
+                int[] nPattern = sitePatterns[i];
+                int iValue = nPattern[0];
+                boolean bIsInvariant = true;
+                for (int k = 1; k < nPattern.length; k++) {
+                    if (nPattern[k] != iValue) {
+                        bIsInvariant = false;
+                        break;
+                    }
+                }
+                if (bIsInvariant) {
+                    removedSites += patternWeight[i];
+                    patternWeight[i] = 0;
+
+                    if (log) Log.info.print(" <" + iValue + "> ");
+                }
+            }
+            if (log) Log.info.println(" removed " + removedSites + " sites ");
+        }
+    } // calcPatterns
+
+    /**
+     * @return the total weight of all the patterns (this is the effective number of sites)
+     */
+    private long getTotalWeight() {
+        long totalWeight = 0;
+        for (int weight : patternWeight) {
+            totalWeight += weight;
+        }
+        return totalWeight;
+    }
+
+    /**
+     * Pretty printing of vital statistics of an alignment including id, #taxa, #sites, #patterns and totalweight
+     *
+     * @param singleLine true if the string should fit on one line
+     * @return string representing this alignment
+     */
+    public String toString(boolean singleLine) {
+        long totalWeight = getTotalWeight();
+        StringBuilder builder = new StringBuilder();
+        builder.append(getClass().getSimpleName() + "(" + getID() + ")");
+
+        if (singleLine) {
+            builder.append(": [taxa, patterns, sites] = [" + getTaxonCount() + ", " + getPatternCount());
+            builder.append(", " + getTotalWeight() + "]");
+        } else {
+
+            long siteCount = getSiteCount();
+
+            builder.append('\n');
+            builder.append("  " + getTaxonCount() + " taxa");
+            builder.append('\n');
+            builder.append("  " + siteCount + (siteCount == 1 ? " site" : " sites") + (totalWeight == getSiteCount() ? "" : " with weight " + totalWeight + ""));
+            builder.append('\n');
+            if (siteCount > 1) {
+                builder.append("  " + getPatternCount() + " patterns");
+                builder.append('\n');
+            }
+        }
+        return builder.toString();
+    }
+
+    public double[] getTipLikelihoods(int iTaxon, int iPattern) {
+    	if (iTaxon >= tipLikelihoods.size() || tipLikelihoods.get(iTaxon) == null) { 
+    		return null; 
+    	} else { 
+    		return tipLikelihoods.get(iTaxon)[iPattern];
+    	}
+    	
+    }
+    /**
+     * returns an array containing the non-ambiguous states that this state represents.
+     */
+    public boolean[] getStateSet(int iState) {
+        return m_dataType.getStateSet(iState);
+//        if (!isAmbiguousState(iState)) {
+//            boolean[] stateSet = new boolean[m_nMaxStateCount];
+//            stateSet[iState] = true;
+//            return stateSet;
+//        } else {
+//        }
+    }
+
+    boolean isAmbiguousState(int state) {
+        return (state >= 0 && state < maxStateCount);
+    }
+
+    //Methods from AscertainedAlignment
+    public Set<Integer> getExcludedPatternIndices() {
+        return excludedPatterns;
+    }
+
+    public int getExcludedPatternCount() {
+        return excludedPatterns.size();
+    }
+
+    public double getAscertainmentCorrection(double[] patternLogProbs) {
+        double excludeProb = 0, includeProb = 0, returnProb = 1.0;
+
+        for (int i : excludedPatterns) {
+            excludeProb += Math.exp(patternLogProbs[i]);
+        }
+
+        if (includeProb == 0.0) {
+            returnProb -= excludeProb;
+        } else if (excludeProb == 0.0) {
+            returnProb = includeProb;
+        } else {
+            returnProb = includeProb - excludeProb;
+        }
+        return Math.log(returnProb);
+    } // getAscertainmentCorrection
+
+    /**
+     * Should not be used. No special order of taxa are assumed. Taxa order should be left to user input.
+     */
+    @Deprecated
+    static public void sortByTaxonName(List<Sequence> seqs) {
+        Collections.sort(seqs, new Comparator<Sequence>() {
+            @Override
+            public int compare(Sequence o1, Sequence o2) {
+                return o1.taxonInput.get().compareTo(o2.taxonInput.get());
+            }
+        });
+    }
+} // class Data
diff --git a/src/beast/evolution/alignment/AscertainedAlignment.java b/src/beast/evolution/alignment/AscertainedAlignment.java
new file mode 100644
index 0000000..8002fb8
--- /dev/null
+++ b/src/beast/evolution/alignment/AscertainedAlignment.java
@@ -0,0 +1,95 @@
+package beast.evolution.alignment;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import beast.core.Description;
+import beast.core.Input;
+
+
+
+ at Description("Alignemnt that allows ascertainment correction")
+/**
+ * This class has merged with Alignment
+ * @deprecated use Alignment() instead setting isAscertainedInput to true.
+ */
+ at Deprecated
+public class AscertainedAlignment extends Alignment {
+//    public Input<Integer> excludefromInput = new Input<Integer>("excludefrom", "first site to condition on, default 0", 0);
+//    public Input<Integer> excludetoInput = new Input<Integer>("excludeto", "last site to condition on (but excluding this site), default 0", 0);
+//    public Input<Integer> excludeeveryInput = new Input<Integer>("excludeevery", "interval between sites to condition on (default 1)", 1);
+
+// RRB: Note that all commented code is stuff to support inclusion-sites,
+// so don't delete them.
+//	public Input<Integer> m_includefrom = new Input<Integer>("includefrom","first site to condition on, default 0", 0);
+//	public Input<Integer> m_includeto = new Input<Integer>("includeto","last site to condition on, default 0", 0);
+//	public Input<Integer> m_includeevery = new Input<Integer>("includeevery","interval between sites to condition on (default 1)", 1);
+
+    /**
+     * indices of patterns that are excluded from the likelihood calculation
+     * and used for ascertainment correction
+     */
+    Set<Integer> excludedPatterns;
+//	List<Integer> m_nIncluded;
+
+    @Override
+    public void initAndValidate() throws Exception {
+        super.initAndValidate();
+
+        int iFrom = excludefromInput.get();
+        int iTo = excludetoInput.get();
+        int iEvery = excludeeveryInput.get();
+        excludedPatterns = new HashSet<Integer>();
+        for (int i = iFrom; i < iTo; i += iEvery) {
+            int iPattern = patternIndex[i];
+            // reduce weight, so it does not confuse the tree likelihood
+            patternWeight[iPattern] = 0;
+            excludedPatterns.add(iPattern);
+        }
+
+//		iFrom = m_includefrom.get();
+//		iTo = m_includeto.get();
+//		iEvery = m_includeevery.get();
+//		m_nIncluded = new ArrayList<Integer>();
+//		for (int i = iFrom; i < iTo; i += iEvery) {
+//			int iPattern = m_nPatternIndex[i];
+//			// reduce weight, so it does not confuse the tree likelihood
+//			m_nWeight[iPattern] = 0;
+//			m_nIncluded.add(iPattern);
+//		}
+    } // initAndValidate
+
+    public Set<Integer> getExcludedPatternIndices() {
+        return excludedPatterns;
+    }
+
+    public int getExcludedPatternCount() {
+        return excludedPatterns.size();
+    }
+
+//	public List<Integer> getIncludesIndices() {
+//		return m_nIncluded;
+//	}
+
+    public double getAscertainmentCorrection(double[] patternLogProbs) {
+        double excludeProb = 0, includeProb = 0, returnProb = 1.0;
+
+//        for (int i = 0; i < m_nIncluded.size(); i++) {
+//        	includeProb += Math.exp(patternLogProbs[m_nIncluded.get(i)]);
+//        }
+
+        for (int i : excludedPatterns) {
+            excludeProb += Math.exp(patternLogProbs[i]);
+        }
+
+        if (includeProb == 0.0) {
+            returnProb -= excludeProb;
+        } else if (excludeProb == 0.0) {
+            returnProb = includeProb;
+        } else {
+            returnProb = includeProb - excludeProb;
+        }
+        return Math.log(returnProb);
+    } // getAscertainmentCorrection
+
+} // class AscertainedAlignment
diff --git a/src/beast/evolution/alignment/FilteredAlignment.java b/src/beast/evolution/alignment/FilteredAlignment.java
new file mode 100644
index 0000000..3f77a74
--- /dev/null
+++ b/src/beast/evolution/alignment/FilteredAlignment.java
@@ -0,0 +1,332 @@
+package beast.evolution.alignment;
+
+
+import java.util.Arrays;
+import java.util.List;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.Input.Validate;
+import beast.core.parameter.IntegerParameter;
+import beast.core.util.Log;
+import beast.evolution.datatype.DataType;
+
+
+
+ at Description("Alignemnt based on a filter operation on another alignment")
+public class FilteredAlignment extends Alignment {
+    public Input<String> filterInput = new Input<String>("filter", "specifies which of the sites in the input alignment should be selected " +
+            "First site is 1." +
+            "Filter specs are comma separated, either a singleton, a range [from]-[to] or iteration [from]:[to]:[step]; " +
+            "1-100 defines a range, " +
+            "1-100\3 or 1:100:3 defines every third in range 1-100, " +
+            "1::3,2::3 removes every third site. " +
+            "Default for range [1]-[last site], default for iterator [1]:[last site]:[1]", Validate.REQUIRED);
+    public Input<Alignment> alignmentInput = new Input<Alignment>("data", "alignment to be filtered", Validate.REQUIRED);
+    public Input<IntegerParameter> constantSiteWeightsInput = new Input<IntegerParameter>("constantSiteWeights", "if specified, constant " +
+    		"sites will be added with weights specified by the input. The dimension and order of weights must match the datatype. " +
+    		"For example for nucleotide data, a 4 dimensional " +
+    		"parameter with weights for A, C, G and T respectively need to be specified.");
+
+    // these triples specify a range for(i=From; i <= To; i += Step)
+    int[] from;
+    int[] to;
+    int[] step;
+    /**
+     * list of indices filtered from input alignment *
+     */
+    int[] filter;
+    
+    boolean convertDataType = false;
+
+    public FilteredAlignment() {
+        sequenceInput.setRule(Validate.OPTIONAL);
+        // it does not make sense to set weights on sites, since they can be scrambled by the filter
+        siteWeightsInput.setRule(Validate.FORBIDDEN);
+    }
+
+    @Override
+    public void initAndValidate() throws Exception {
+        parseFilterSpec();
+        calcFilter();
+        Alignment data = alignmentInput.get();
+        m_dataType = data.m_dataType;
+        // see if this filter changes data type
+        if (userDataTypeInput.get() != null) {
+            m_dataType = userDataTypeInput.get();
+            convertDataType = true;
+        }
+
+        if (constantSiteWeightsInput.get() != null) {
+        	if (constantSiteWeightsInput.get().getDimension() != m_dataType.getStateCount()) {
+        		throw new Exception("constantSiteWeights should be of the same dimension as the datatype " +
+        				"(" + constantSiteWeightsInput.get().getDimension() + "!="+ m_dataType.getStateCount() +")");
+        	}
+    	}
+        
+        counts = data.counts;
+        taxaNames = data.taxaNames;
+        stateCounts = data.stateCounts;
+        if (convertDataType && m_dataType.getStateCount() > 0) {
+        	for (int i = 0; i < stateCounts.size(); i++) {
+                stateCounts.set(i, m_dataType.getStateCount());
+        	}
+        }
+
+        if (alignmentInput.get().siteWeightsInput.get() != null) {
+    		String sStr = alignmentInput.get().siteWeightsInput.get().trim();
+    		String [] strs = sStr.split(",");
+    		siteWeights = new int[strs.length];
+    		for (int i = 0; i< strs.length; i++) {
+    			siteWeights[i] = Integer.parseInt(strs[i].trim());
+    		}    		
+        }
+
+        calcPatterns();
+        setupAscertainment();
+    }
+
+    private void parseFilterSpec() throws Exception {
+        // parse filter specification
+        String filterString = filterInput.get();
+        String[] filters = filterString.split(",");
+        from = new int[filters.length];
+        to = new int[filters.length];
+        step = new int[filters.length];
+        for (int i = 0; i < filters.length; i++) {
+            filterString = " " + filters[i] + " ";
+            if (filterString.matches(".*-.*")) {
+                // range, e.g. 1-100/3
+                if (filterString.indexOf('\\') >= 0) {
+                	String str2 = filterString.substring(filterString.indexOf('\\') + 1); 
+                	step[i] = parseInt(str2, 1);
+                	filterString = filterString.substring(0, filterString.indexOf('\\'));
+                } else {
+                	step[i] = 1;
+                }
+                String[] strs = filterString.split("-");
+                from[i] = parseInt(strs[0], 1) - 1;
+                to[i] = parseInt(strs[1], alignmentInput.get().getSiteCount()) - 1;
+            } else if (filterString.matches(".*:.*:.+")) {
+                // iterator, e.g. 1:100:3
+                String[] strs = filterString.split(":");
+                from[i] = parseInt(strs[0], 1) - 1;
+                to[i] = parseInt(strs[1], alignmentInput.get().getSiteCount()) - 1;
+                step[i] = parseInt(strs[2], 1);
+            } else if (filterString.trim().matches("[0-9]*")) {
+                from[i] = parseInt(filterString.trim(), 1) - 1;
+                to[i] = from[i];
+            	step[i] = 1;
+            } else {
+                throw new Exception("Don't know how to parse filter " + filterString);
+            }
+        }
+    }
+
+    int parseInt(String str, int defaultValue) {
+        str = str.replaceAll("\\s+", "");
+        try {
+            return Integer.parseInt(str);
+        } catch (Exception e) {
+            return defaultValue;
+        }
+    }
+
+    private void calcFilter() {
+        boolean[] isUsed = new boolean[alignmentInput.get().getSiteCount()];
+        for (int i = 0; i < to.length; i++) {
+            for (int k = from[i]; k <= to[i]; k += step[i]) {
+                isUsed[k] = true;
+            }
+        }
+        // count
+        int k = 0;
+        for (int i = 0; i < isUsed.length; i++) {
+            if (isUsed[i]) {
+                k++;
+            }
+        }
+        // set up index set
+        filter = new int[k];
+        k = 0;
+        for (int i = 0; i < isUsed.length; i++) {
+            if (isUsed[i]) {
+                filter[k++] = i;
+            }
+        }
+    }
+
+    @Override
+    protected void calcPatterns() {
+        int nrOfTaxa = counts.size();
+        int nrOfSites = filter.length;
+        
+        DataType baseType = alignmentInput.get().m_dataType;
+        
+        
+        
+        // convert data to transposed int array
+        int[][] data = new int[nrOfSites][nrOfTaxa];
+        for (int i = 0; i < nrOfTaxa; i++) {
+            List<Integer> sites = counts.get(i);
+            for (int j = 0; j < nrOfSites; j++) {
+                data[j][i] = sites.get(filter[j]);
+                if (convertDataType) {
+                	try {
+                		String code = baseType.getCode(data[j][i]);
+						data[j][i] = m_dataType.string2state(code).get(0);
+                	} catch (Exception e) {
+                		e.printStackTrace();
+                	}
+                }
+            }
+        }
+        
+        // add constant sites, if specified
+        if (constantSiteWeightsInput.get() != null) {
+        	int dim = constantSiteWeightsInput.get().getDimension();
+        	// add constant patterns
+        	int [][] data2 = new int[nrOfSites + dim][];
+            System.arraycopy(data, 0, data2, 0, nrOfSites);
+        	for (int i = 0; i < dim; i++) {
+        		data2[nrOfSites + i] = new int[nrOfTaxa];
+        		for (int j = 0; j < nrOfTaxa; j++) {
+        			data2[nrOfSites+ i][j] = i;
+				}
+        	}
+        	data = data2;
+        	nrOfSites += dim; 
+        }
+        
+        // sort data
+        SiteComparator comparator = new SiteComparator();
+        Arrays.sort(data, comparator);
+
+        // count patterns in sorted data
+        int[] weights = new int[nrOfSites];
+        int nrOfPatterns = 1;
+        if (nrOfSites > 0) {
+	        weights[0] = 1;
+	        for (int i = 1; i < nrOfSites; i++) {
+	            if (comparator.compare(data[i - 1], data[i]) != 0) {
+	                nrOfPatterns++;
+	                data[nrOfPatterns - 1] = data[i];
+	            }
+	            weights[nrOfPatterns - 1]++;
+	        }
+        } else {
+            nrOfPatterns = 0;
+        }
+        
+        // addjust weight of invariant sites, if stripInvariantSitesInput i sspecified
+        if (stripInvariantSitesInput.get()) {
+            // don't add patterns that are invariant, e.g. all gaps
+            Log.info.print("Stripping invariant sites");
+            int removedSites = 0;
+            
+        	for (int i = 0; i < nrOfPatterns; i++) {
+        		boolean isContant = true;
+        		for (int j = 1; j < nrOfTaxa; j++) {
+        			if (data[i][j] != data[i][0]) {
+        				isContant = false;
+        				break;
+        			}
+        		}
+        		// if this is a constant site, and it is not an ambiguous site
+        		if (isContant) {
+                    System.err.print(" <" + data[i][0] + "> ");
+                   	removedSites += weights[i]; 
+            		weights[i] = 0;
+        		}
+        	}
+            System.err.println(" removed " + removedSites + " sites ");
+        }
+        
+        // addjust weight of constant sites, if specified
+        if (constantSiteWeightsInput.get() != null) {
+        	Integer [] constantWeights = constantSiteWeightsInput.get().getValues(); 
+        	for (int i = 0; i < nrOfPatterns; i++) {
+        		boolean isContant = true;
+        		for (int j = 1; j < nrOfTaxa; j++) {
+        			if (data[i][j] != data[i][0]) {
+        				isContant = false;
+        				break;
+        			}
+        		}
+        		// if this is a constant site, and it is not an ambiguous site
+        		if (isContant && data[i][0] >= 0 && data[i][0] < constantWeights.length) {
+        			// take weights in data in account as well
+        			// by adding constant patterns, we added a weight of 1, which now gets corrected
+        			// but if filtered by stripping constant sites, that weight is already set to zero
+            		weights[i] = (stripInvariantSitesInput.get() ? 0 : weights[i] - 1) + constantWeights[data[i][0]];
+        		}
+        	}
+        	
+        	// need to decrease nSites for mapping sites to patterns in m_nPatternIndex
+        	nrOfSites -= constantWeights.length; 
+        }        
+        
+        // reserve memory for patterns
+        patternWeight = new int[nrOfPatterns];
+        sitePatterns = new int[nrOfPatterns][nrOfTaxa];
+        for (int i = 0; i < nrOfPatterns; i++) {
+            patternWeight[i] = weights[i];
+            sitePatterns[i] = data[i];
+        }
+
+        // find patterns for the sites
+        patternIndex = new int[nrOfSites];
+        for (int i = 0; i < nrOfSites; i++) {
+            int[] sites = new int[nrOfTaxa];
+            for (int j = 0; j < nrOfTaxa; j++) {
+                sites[j] = counts.get(j).get(filter[i]);
+                if (convertDataType) {
+                	try {
+                		sites[j] = m_dataType.string2state(baseType.getCode(sites[j])).get(0);
+                	} catch (Exception e) {
+                		e.printStackTrace();
+                	}
+                }
+            }
+            patternIndex[i] = Arrays.binarySearch(sitePatterns, sites, comparator);
+        }
+
+        if (siteWeights != null) {
+        	// TODO: fill in weights with siteweights.
+        	throw new RuntimeException("Cannot handle site weights in FilteredAlignment. Remove \"weights\" from data input.");
+        }
+
+        // determine maximum state count
+        // Usually, the state count is equal for all sites,
+        // though for SnAP analysis, this is typically not the case.
+        maxStateCount = 0;
+        for (int stateCount1 : stateCounts) {
+            maxStateCount = Math.max(maxStateCount, stateCount1);
+        }
+        if (convertDataType) {
+        	maxStateCount = Math.max(maxStateCount, m_dataType.getStateCount());
+        }
+        // report some statistics
+        //for (int i = 0; i < m_sTaxaNames.size(); i++) {
+        //    System.err.println(m_sTaxaNames.get(i) + ": " + m_counts.get(i).size() + " " + m_nStateCounts.get(i));
+        //}
+        Log.info.println("Filter " + filterInput.get());
+        Log.info.println(getTaxonCount() + " taxa");
+        if (constantSiteWeightsInput.get() != null) {
+        	Integer [] constantWeights = constantSiteWeightsInput.get().getValues();
+        	int sum = 0; 
+        	for (int i : constantWeights) { 
+        		sum += i;
+        	}
+        	Log.info.println(getSiteCount() + " sites + " + sum + " constant sites");
+        } else {
+        	Log.info.println(getSiteCount() + " sites");
+        }
+        Log.info.println(getPatternCount() + " patterns");
+    }
+    
+    /** return indices of the sites that the filter uses **/
+    public int [] indices() {
+    	return filter.clone();
+    }
+}
diff --git a/src/beast/evolution/alignment/Sequence.java b/src/beast/evolution/alignment/Sequence.java
new file mode 100644
index 0000000..154afbd
--- /dev/null
+++ b/src/beast/evolution/alignment/Sequence.java
@@ -0,0 +1,165 @@
+/*
+* File Sequence.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+package beast.evolution.alignment;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Collection;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.BEASTObject;
+import beast.evolution.datatype.DataType;
+
+ at Description("Single sequence in an alignment.")
+public class Sequence extends BEASTObject {
+    public Input<Integer> totalCountInput = new Input<Integer>("totalcount", "number of states or the number of lineages for this species in SNAPP analysis");
+    public Input<String> taxonInput = new Input<String>("taxon", "name of this species", Input.Validate.REQUIRED);
+    public Input<String> dataInput = new Input<String>("value",
+            "sequence data, either encoded as a string or as comma separated list of integers, or comma separated likelihoods/probabilities for each site if uncertain=true." +
+                    "In either case, whitespace is ignored.", Input.Validate.REQUIRED);
+    public Input<Boolean> uncertainInput = new Input<Boolean>("uncertain", "if true, sequence is provided as comma separated probabilities for each character, with sites separated by a semi-colons. In this formulation, gaps are coded as 1/K,...,1/K, where K is the number of states in the model.");
+
+    protected boolean uncertain = false;
+    protected double[][] likelihoods = null;    
+    public double[][] getLikelihoods() {
+    	return likelihoods;
+    }
+    
+    public Sequence() {
+    }
+
+    /**
+     * Constructor for testing.
+     *
+     * @param taxon
+     * @param sequence
+     * @throws Exception
+     */
+    public Sequence(String taxon, String sequence) throws Exception {
+        taxonInput.setValue(taxon, this);
+        dataInput.setValue(sequence, this);
+        initAndValidate();
+    }
+
+    @Override
+    public void initAndValidate() throws Exception {
+    	if (uncertainInput.get() != null)  {
+    		uncertain = uncertainInput.get();    		
+    		if (uncertain) initProbabilities();    		
+    	}
+    } // initAndValidate
+    
+    public void initProbabilities() throws Exception {
+    	   	
+    	String data = dataInput.get();
+        // remove spaces
+        data = data.replaceAll("\\s", "");
+        
+        String sStr = data.trim();		
+		String[] strs = sStr.split(";");		
+		for (int i=0; i<strs.length; i++) {
+			String[] pr = strs[i].split(",");
+			//double total = 0;
+    		for (int j=0; j<pr.length; j++) {    			
+    			if (likelihoods == null) likelihoods = new double[strs.length][pr.length];
+    			likelihoods[i][j] = Double.parseDouble(pr[j].trim());
+    			//total += likelihoods[i][j]; 
+    		}    		
+		}
+    }
+
+    public List<Integer> getSequence(DataType dataType) throws Exception {
+        
+    	List<Integer> sequence;
+    	if (uncertain) {
+            sequence = new ArrayList<Integer>();
+            for (int i=0; i<likelihoods.length; i++) {
+            	double m = likelihoods[i][0];
+            	int index = 0;
+            	for (int j=0; j<likelihoods[i].length; j++) {
+            		if (likelihoods[i][j] > m ) {
+            			m = likelihoods[i][j];
+            			index = j;
+            		}        		
+            	}
+            	sequence.add(index);
+            }
+    	}
+    	else {
+	    	String data = dataInput.get();
+	        // remove spaces
+	        data = data.replaceAll("\\s", "");
+	        sequence = dataType.string2state(data);
+    	}
+
+        if (totalCountInput.get() == null) {
+            // derive default from char-map
+            totalCountInput.setValue(dataType.getStateCount(), this);
+        }
+        return sequence;
+    }
+
+    /**
+     * @return the taxon of this sequence as a string.
+     */
+    public final String getTaxon() {
+        return taxonInput.get();
+    }
+
+    /**
+     * @return the data of this sequence as a string.
+     */
+    public final String getData() {
+        return dataInput.get();
+    }
+
+
+    int mapCharToData(String dataMap, char c) {
+        int i = dataMap.indexOf(c);
+        if (i >= 0) {
+            return i;
+        }
+        return dataMap.length();
+    } // mapCharToData
+
+    /**
+     * @param id of target sequence
+     * @param sequences a collection of sequences
+     * @return the sequence in the collection with the given ID, or null if its not in the collection.
+     */
+    public static Sequence getSequenceByTaxon(String id, Collection<Sequence> sequences) {
+        for (Sequence seq : sequences) {
+            if (seq.getTaxon().equals(id)) return seq;
+        }
+        return null;
+    }
+
+    public String toString() {
+        return getTaxon() + ":" + getData();
+    }
+
+
+} // class Sequence
diff --git a/src/beast/evolution/alignment/Taxon.java b/src/beast/evolution/alignment/Taxon.java
new file mode 100644
index 0000000..e6401fb
--- /dev/null
+++ b/src/beast/evolution/alignment/Taxon.java
@@ -0,0 +1,89 @@
+package beast.evolution.alignment;
+
+
+
+import java.util.*;
+
+import beast.core.Description;
+import beast.core.BEASTObject;
+
+
+ at Description("For identifying a single taxon")
+public class Taxon extends BEASTObject {
+    // we can use the ID to identify a taxon name/taxon label
+    // if there are multiple taxaset with the same taxa, use
+    // idref to refer to the single taxon.
+//	public Input<String> m_sLabel = new Input<String>("label", "name of the taxon", Validate.REQUIRED);
+
+    public Taxon(final String id) throws Exception {
+        setID(id);
+        initAndValidate();
+    }
+
+    public Taxon() {
+    }
+
+    @Override
+    public void initAndValidate() throws Exception {
+
+    }
+
+    protected String toString(final String indent) {
+    	return indent + getID() + "\n";
+    }
+
+    /**
+     * Convenience method to produce a list of taxon objects
+     * @param taxaNames a list of taxa names
+     * @return a list of Taxon objects with corresponding names
+     */
+    public static List<Taxon> createTaxonList(final List<String> taxaNames) throws Exception {
+        final List<Taxon> taxa = new ArrayList<>();
+        for (final String taxaName : taxaNames) {
+            taxa.add(new Taxon(taxaName));
+        }
+        return taxa;
+    }
+
+//    /**
+//     * Convenience method to produce a list of taxon objects sorted alphabetically
+//     * @param taxaNames a list of taxa names
+//     * @return a list of Taxon objects with corresponding names
+//     */
+//    @Deprecated
+//    public static List<Taxon> createSortedTaxonList(final List<String> taxaNames) throws Exception {
+//        final List<Taxon> taxa = new ArrayList<>();
+//        for (final String taxaName : taxaNames) {
+//            taxa.add(new Taxon(taxaName));
+//        }
+//        Collections.sort(taxa, new Comparator<Taxon>() {
+//            @Override // assumes IDs are not null
+//            public int compare(Taxon o1, Taxon o2) {
+//                return o1.getID().compareTo(o2.getID());
+//            }
+//        });
+//        return taxa;
+//    }
+
+    /**
+     * @param taxa1 a collection of taxa name strings
+     * @param taxa2 a second collection of taxa name strings
+     * Throws a runtime exception if the two collections do not have the same taxa.
+     */
+    public static void assertSameTaxa(String id1, Collection<String> taxa1, String id2, Collection<String> taxa2) {
+        if (taxa1.size() != taxa2.size()) {
+            throw new RuntimeException("Incompatible taxon sets in " + id1 + " and " + id2);
+        }
+        for (String taxon : taxa1) {
+            boolean found = false;
+            for (String taxon2 : taxa2) {
+                if (taxon.equals(taxon2)) {
+                    found = true;
+                    break;
+                }
+            }
+            if (!found) {
+                throw new RuntimeException("Taxon" + taxon + "is not in " + id2);
+            }
+        }    }
+}
diff --git a/src/beast/evolution/alignment/TaxonSet.java b/src/beast/evolution/alignment/TaxonSet.java
new file mode 100644
index 0000000..49980d3
--- /dev/null
+++ b/src/beast/evolution/alignment/TaxonSet.java
@@ -0,0 +1,171 @@
+package beast.evolution.alignment;
+
+
+
+import beast.core.Description;
+import beast.core.Input;
+
+import java.util.*;
+
+
+ at Description("A TaxonSet is an ordered set of taxa. The order on the taxa is provided at the time of construction" +
+        " either from a list of taxon objects or an alignment.")
+public class TaxonSet extends Taxon {
+
+    public Input<List<Taxon>> taxonsetInput = new Input<>("taxon", "list of taxa making up the set", new ArrayList<>());
+
+    public Input<Alignment> alignmentInput = new Input<Alignment>("alignment", "alignment where each sequence represents a taxon");
+
+    protected List<String> taxaNames;
+    protected List<Taxon> taxonList;
+
+    public TaxonSet() {
+    }
+
+    public TaxonSet(final List<Taxon> taxa) throws Exception {
+        taxonsetInput.setValue(taxa, this);
+        initAndValidate();
+    }
+    
+    public TaxonSet(final Alignment alignment) throws Exception {
+        alignmentInput.setValue(alignment, this);
+        initAndValidate();
+    }
+
+    // for testing purposes (Huw)
+    public TaxonSet(final String id, final List<Taxon> taxa) throws Exception {
+        setID(id);
+        taxonsetInput.setValue(taxa, this);
+        initAndValidate();
+    }
+
+    @Override
+    public void initAndValidate() throws Exception {
+        taxonList = taxonsetInput.get();
+        if (alignmentInput.get() != null) {
+            if (taxonList.size() > 0) {
+                throw new Exception("Only one of taxon and alignment should be specified, not both.");
+            }
+            taxaNames = alignmentInput.get().taxaNames;
+        } else {
+            if (taxonList.size() == 0) {
+                throw new Exception("Either taxon or alignment should be specified.");
+            }
+            taxaNames = new ArrayList<>();
+            for (final Taxon taxon : taxonList) {
+            	taxaNames.add(taxon.getID());
+            }
+        }
+    }
+
+    public Set<Taxon> getTaxonSet() {
+        final Set<Taxon> unorderedTaxa = new HashSet<>(taxonList);
+        return unorderedTaxa;
+    }
+
+    /**
+     * @return an unmodifiable list of taxa names as strings.
+     */
+    public List<String> asStringList() {
+        if (taxaNames == null) return null;
+        return Collections.unmodifiableList(taxaNames);
+    }
+
+    /**
+     * @return the taxa names as a set of strings.
+     */
+    public Set<String> getTaxaNames() {
+        return new TreeSet<>(taxaNames);
+    }
+
+    /**
+     * @return the ID of the i'th taxon.
+     */
+    public String getTaxonId(int taxonIndex) {
+        return taxaNames.get(taxonIndex);
+    }
+
+    /**
+     * return index of given Taxon name
+     * @param id
+     * @return  -1 if not found
+     */
+    public int getTaxonIndex(String id) {
+        for (int i = 0; i < taxaNames.size(); i++) {
+            if (getTaxonId(i).contentEquals(id)) return i;
+        }
+        return -1;
+    }
+
+    //  convenience methods
+
+    public boolean containsAny(final Collection<String> taxa) {
+        final List<String> me = asStringList();
+        for (final String taxon : taxa ) {
+            if (me.contains(taxon)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    public boolean containsAll(final Collection<String> taxa) {
+        final List<String> me = asStringList();
+        for (final String taxon : taxa ) {
+            if (!me.contains(taxon)) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    /**
+     * @return true if at least 1 member of taxa contained in this set.
+     * @param taxa a collection of taxa
+     */
+    public boolean containsAny(final TaxonSet taxa) {
+        return containsAny(taxa.asStringList());
+    }
+
+    /**
+     * @return true if taxa is a subset of this set
+     * @param    taxa
+     */
+    public boolean containsAll(final TaxonSet taxa) {
+        return containsAll(taxa.asStringList());
+    }
+    
+    /**
+     * @return number of taxa in this taxon set
+     */
+    public int getTaxonCount() {
+        if (taxaNames == null) return 0;
+        return taxaNames.size();
+    }
+    
+    /**
+     * @return number of taxa in this taxon set
+     * @deprecated Exists only for consistency with method in Alignment. Use
+     * getTaxonCount() instead.
+     */
+    @Deprecated
+    public int getNrTaxa() {
+        return getTaxonCount();
+    }
+    
+    @Override
+    public String toString() {
+    	return toString("\t");
+    }
+
+    @Override
+	protected String toString(String indent) {
+		final StringBuilder buf = new StringBuilder();
+		buf.append(indent).append(getID()).append("\n");
+		indent += "\t";
+		for (final Taxon taxon : taxonList) {
+			buf.append(taxon.toString(indent));
+		}
+		return buf.toString();
+	}
+}
diff --git a/src/beast/evolution/alignment/distance/Distance.java b/src/beast/evolution/alignment/distance/Distance.java
new file mode 100644
index 0000000..0896cb8
--- /dev/null
+++ b/src/beast/evolution/alignment/distance/Distance.java
@@ -0,0 +1,90 @@
+package beast.evolution.alignment.distance;
+
+import beast.core.Description;
+import beast.core.BEASTObject;
+import beast.evolution.alignment.Alignment;
+import beast.evolution.alignment.TaxonSet;
+import beast.evolution.datatype.DataType;
+
+ at Description("Provides distance between taxa")
+public interface Distance {
+	
+	/** return distance of two taxa, identified by their indices **/
+	double pairwiseDistance(int taxon1, int taxon2);
+	
+	
+	@Description("Provides distance between two sequences in an alignment")
+	public class Base extends BEASTObject implements Distance {
+	
+	    //public static final double MAX_DISTANCE = 1000.0;
+	    public static final double MAX_DISTANCE = 5.0;
+	
+	    @Override
+	    public void initAndValidate() throws Exception {
+	        // nothing to do
+	    }
+	
+	    /**
+	     * set the pattern source
+	     */
+	    public void setPatterns(Alignment patterns) {
+	        this.taxa = new TaxonSet();
+	        try {
+	            this.taxa.alignmentInput.setValue(patterns, this.taxa);
+	        } catch (Exception e) {
+	            e.printStackTrace();
+	        }
+	        this.patterns = patterns;
+	        dimension = patterns.getNrTaxa();
+	        dataType = patterns.getDataType();
+	        distancesKnown = false;
+	    }
+	
+	
+	    /**
+	     * Calculate a pairwise distance
+	     */
+	    @Override
+	    public double pairwiseDistance(int taxon1, int taxon2) {
+	        int state1, state2;
+	
+	        int n = patterns.getPatternCount();
+	        double weight, distance;
+	        double sumDistance = 0.0;
+	        double sumWeight = 0.0;
+	
+	        int[] pattern;
+	
+	        for (int i = 0; i < n; i++) {
+	            pattern = patterns.getPattern(i);
+	
+	            state1 = pattern[taxon1];
+	            state2 = pattern[taxon2];
+	
+	            weight = patterns.getPatternWeight(i);
+	//			sumDistance += dataType.getObservedDistance(state1, state2) * weight;
+	            if (!dataType.isAmbiguousState(state1) && !dataType.isAmbiguousState(state2) &&
+	                    state1 != state2) {
+	                sumDistance += weight;
+	            }
+	            sumWeight += weight;
+	        }
+	
+	        distance = sumDistance / sumWeight;
+	
+	        return distance;
+	    }
+	
+	
+	    //
+	    // Private stuff
+	    //
+	
+	    protected DataType dataType = null;
+	    int dimension = 0;
+	    boolean distancesKnown;
+	    //    private double[][] distances = null;
+	    protected Alignment patterns = null;
+	    private TaxonSet taxa = null;
+	}
+}
diff --git a/src/beast/evolution/alignment/distance/F84Distance.java b/src/beast/evolution/alignment/distance/F84Distance.java
new file mode 100644
index 0000000..6be4286
--- /dev/null
+++ b/src/beast/evolution/alignment/distance/F84Distance.java
@@ -0,0 +1,137 @@
+/*
+ * F84DistanceMatrix.java
+ *
+ * Copyright (C) 2002-2006 Alexei Drummond and Andrew Rambaut
+ *
+ * This file is part of BEAST.
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership and licensing.
+ *
+ * BEAST 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
+ * of the License, or (at your option) any later version.
+ *
+ *  BEAST 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 BEAST; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+package beast.evolution.alignment.distance;
+
+import beast.core.Description;
+import beast.evolution.alignment.Alignment;
+import beast.evolution.substitutionmodel.Frequencies;
+
+
+/**
+ * compute HKY corrected distance matrix
+ *
+ * @author Andrew Rambaut
+ * @version $Id: F84DistanceMatrix.java,v 1.3 2005/05/24 20:25:56 rambaut Exp $
+ */
+ at Description("compute HKY corrected distance")
+public class F84Distance extends Distance.Base {
+
+    /**
+     * set the pattern source
+     */
+    @Override
+    public void setPatterns(Alignment patterns) {
+        super.setPatterns(patterns);
+
+        Frequencies frequencies = new Frequencies();
+        try {
+            frequencies.initByName("data", patterns, "estimate", true);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        double[] freqs = frequencies.getFreqs();
+        stateCount = dataType.getStateCount();
+        if (stateCount != 4) {
+            throw new IllegalArgumentException("F84DistanceMatrix must have nucleotide patterns");
+        }
+
+        double freqA = freqs[0];
+        double freqC = freqs[1];
+        double freqG = freqs[2];
+        double freqT = freqs[3];
+
+        double freqR = freqA + freqG;
+        double freqY = freqC + freqT;
+
+        constA = ((freqA * freqG) / freqR) + ((freqC * freqT) / freqY);
+        constB = (freqA * freqG) + (freqC * freqT);
+        constC = (freqR * freqY);
+    }
+
+    /**
+     * Calculate a pairwise distance
+     */
+    @Override
+    public double pairwiseDistance(int taxon1, int taxon2) {
+        int state1, state2;
+
+        int n = patterns.getPatternCount();
+        double weight, distance;
+        double sumTs = 0.0;
+        double sumTv = 0.0;
+        double sumWeight = 0.0;
+
+        int[] pattern;
+
+        for (int i = 0; i < n; i++) {
+            pattern = patterns.getPattern(i);
+
+            state1 = pattern[taxon1];
+            state2 = pattern[taxon2];
+
+            weight = patterns.getPatternWeight(i);
+            if (!dataType.isAmbiguousState(state1) && !dataType.isAmbiguousState(state2) && state1 != state2) {
+
+                if ((state1 == 0 && state2 == 2) || (state1 == 2 && state2 == 0)) {
+                    // it's a transition
+                    sumTs += weight;
+                } else {
+                    // it's a transversion
+                    sumTv += weight;
+                }
+            }
+            sumWeight += weight;
+        }
+
+        double P = sumTs / sumWeight;
+        double Q = sumTv / sumWeight;
+
+        double tmp1 = Math.log(1.0 - (P / (2.0 * constA)) -
+                (((constA - constB) * Q) / (2.0 * constA * constC)));
+
+        double tmp2 = Math.log(1.0 - (Q / (2.0 * constC)));
+
+        distance = -(2.0 * constA * tmp1) +
+                (2.0 * (constA - constB - constC) * tmp2);
+
+        if (distance < MAX_DISTANCE) {
+            return distance;
+        } else {
+            return MAX_DISTANCE;
+        }
+    }
+
+    //
+    // Private stuff
+    //
+
+    private int stateCount;
+
+    //used in correction formula
+    private double constA, constB, constC;
+
+}
diff --git a/src/beast/evolution/alignment/distance/HammingDistance.java b/src/beast/evolution/alignment/distance/HammingDistance.java
new file mode 100644
index 0000000..efeeaa9
--- /dev/null
+++ b/src/beast/evolution/alignment/distance/HammingDistance.java
@@ -0,0 +1,21 @@
+package beast.evolution.alignment.distance;
+
+import beast.core.Description;
+
+
+ at Description("Hamming distance is the mean number of characters that differ between sequences. " +
+        "Note that unknowns are not ignored, so if both are unknowns '?' the distance is zero.")
+public class HammingDistance extends Distance.Base {
+
+    @Override
+    public double pairwiseDistance(int taxon1, int taxon2) {
+        double fDist = 0;
+        for (int i = 0; i < patterns.getPatternCount(); i++) {
+            if (patterns.getPattern(taxon1, i) != patterns.getPattern(taxon2, i)) {
+                fDist += patterns.getPatternWeight(i);
+            }
+        }
+        return fDist / patterns.getSiteCount();
+    }
+
+}
diff --git a/src/beast/evolution/alignment/distance/JukesCantorDistance.java b/src/beast/evolution/alignment/distance/JukesCantorDistance.java
new file mode 100644
index 0000000..07eba62
--- /dev/null
+++ b/src/beast/evolution/alignment/distance/JukesCantorDistance.java
@@ -0,0 +1,81 @@
+/*
+ * JukesCantorDistanceMatrix.java
+ *
+ * Copyright (C) 2002-2006 Alexei Drummond and Andrew Rambaut
+ *
+ * This file is part of BEAST.
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership and licensing.
+ *
+ * BEAST 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
+ * of the License, or (at your option) any later version.
+ *
+ *  BEAST 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 BEAST; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+package beast.evolution.alignment.distance;
+
+import beast.core.Description;
+import beast.evolution.alignment.Alignment;
+
+/**
+ * @author Andrew Rambaut
+ * @author Korbinian Strimmer
+ * @version $Id: JukesCantorDistanceMatrix.java,v 1.4 2005/05/24 20:25:56 rambaut Exp $
+ */
+ at Description("compute jukes-cantor corrected distance")
+public class JukesCantorDistance extends Distance.Base {
+
+
+    /**
+     * set the pattern source
+     */
+    @Override
+    public void setPatterns(Alignment patterns) {
+        super.setPatterns(patterns);
+
+        final int stateCount = dataType.getStateCount();
+
+        const1 = ((double) stateCount - 1) / stateCount;
+        const2 = ((double) stateCount) / (stateCount - 1);
+    }
+
+    /**
+     * Calculate a pairwise distance
+     */
+    @Override
+    public double pairwiseDistance(int i, int j) {
+        final double obsDist = super.pairwiseDistance(i, j);
+
+        if (obsDist == 0.0) return 0.0;
+
+        if (obsDist >= const1) {
+            return MAX_DISTANCE;
+        }
+
+        final double expDist = -const1 * Math.log(1.0 - (const2 * obsDist));
+
+        if (expDist < MAX_DISTANCE) {
+            return expDist;
+        } else {
+            return MAX_DISTANCE;
+        }
+    }
+
+    //
+    // Private stuff
+    //
+
+    //used in correction formula
+    private double const1, const2;
+}
diff --git a/src/beast/evolution/alignment/distance/SMMDistance.java b/src/beast/evolution/alignment/distance/SMMDistance.java
new file mode 100644
index 0000000..d1aa780
--- /dev/null
+++ b/src/beast/evolution/alignment/distance/SMMDistance.java
@@ -0,0 +1,31 @@
+package beast.evolution.alignment.distance;
+
+import beast.core.Description;
+
+
+/**
+ * @author Chieh-Hsi Wu
+ */
+ at Description("Calculate the distance between different microsatellite alleles")
+public class SMMDistance extends Distance.Base {
+
+    /**
+     * constructor taking a pattern source
+     *
+     * @param patterns a pattern of a microsatellite locus
+     */
+    @Override
+    public double pairwiseDistance(int taxon1, int taxon2) {
+
+        int[] pattern = patterns.getPattern(0);
+        int state1 = pattern[taxon1];
+
+        int state2 = pattern[taxon2];
+        double distance = 0.0;
+
+        if (!dataType.isAmbiguousState(state1) && !dataType.isAmbiguousState(state2))
+            distance = Math.abs(state1 - state2);
+
+        return distance;
+    }
+}
diff --git a/src/beast/evolution/branchratemodel/BranchRateModel.java b/src/beast/evolution/branchratemodel/BranchRateModel.java
new file mode 100644
index 0000000..b98b404
--- /dev/null
+++ b/src/beast/evolution/branchratemodel/BranchRateModel.java
@@ -0,0 +1,23 @@
+package beast.evolution.branchratemodel;
+
+import beast.core.CalculationNode;
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.parameter.RealParameter;
+import beast.evolution.tree.Node;
+
+/**
+ * @author Alexei Drummond
+ */
+ at Description("Defines a mean rate for each branch in the beast.tree.")
+public interface BranchRateModel {
+
+    public double getRateForBranch(Node node);
+
+    @Description(value = "Base implementation of a clock model.", isInheritable = false)
+    public abstract class Base extends CalculationNode implements BranchRateModel {
+        public Input<RealParameter> meanRateInput = new Input<RealParameter>("clock.rate", "mean clock rate (defaults to 1.0)");
+
+        // empty at the moment but brings together the required interfaces
+    }
+}
diff --git a/src/beast/evolution/branchratemodel/RandomLocalClockModel.java b/src/beast/evolution/branchratemodel/RandomLocalClockModel.java
new file mode 100644
index 0000000..661fffa
--- /dev/null
+++ b/src/beast/evolution/branchratemodel/RandomLocalClockModel.java
@@ -0,0 +1,172 @@
+package beast.evolution.branchratemodel;
+
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.parameter.BooleanParameter;
+import beast.core.parameter.RealParameter;
+import beast.evolution.tree.Node;
+import beast.evolution.tree.Tree;
+
+/**
+ * @author Alexei Drummond
+ */
+ at Description("Random Local Clock Model, whatever that is....")
+public class RandomLocalClockModel extends BranchRateModel.Base {
+
+    public Input<BooleanParameter> indicatorParamInput =
+            new Input<BooleanParameter>("indicators",
+                    "the indicators associated with nodes in the tree for sampling of individual rate changes among branches.",
+                    Input.Validate.REQUIRED);
+    public Input<RealParameter> rateParamInput =
+            new Input<RealParameter>("rates",
+                    "the rate parameters associated with nodes in the tree for sampling of individual rates among branches.",
+                    Input.Validate.REQUIRED);
+    //    public Input<RealParameter> meanRateInput =
+//            new Input<RealParameter>("meanRate",
+//                    "an optional parameter to set the mean rate across the whole tree");
+    public Input<Tree> treeInput =
+            new Input<Tree>("tree", "the tree this relaxed clock is associated with.", Input.Validate.REQUIRED);
+    public Input<Boolean> ratesAreMultipliersInput =
+            new Input<Boolean>("ratesAreMultipliers", "true if the rates should be treated as multipliers (default false).", false);
+
+    Tree m_tree;
+    RealParameter meanRate;
+
+    @Override
+    public void initAndValidate() throws Exception {
+        m_tree = treeInput.get();
+
+        BooleanParameter indicators = indicatorParamInput.get();
+
+        if (indicators.getDimension() != m_tree.getNodeCount() - 1) {
+            System.out.println("RandomLocalClockModel::Setting dimension of indicators to " + (m_tree.getNodeCount() - 1));
+            indicators.setDimension(m_tree.getNodeCount() - 1);
+        }
+
+        unscaledBranchRates = new double[m_tree.getNodeCount()];
+
+        RealParameter rates = rateParamInput.get();
+        if (rates.lowerValueInput.get() == null || rates.lowerValueInput.get() < 0.0) {
+            rates.setLower(0.0);
+        }
+        if (rates.upperValueInput.get() == null || rates.upperValueInput.get() < 0.0) {
+            rates.setUpper(Double.MAX_VALUE);
+        }
+        if (rates.getDimension() != m_tree.getNodeCount() - 1) {
+            System.out.println("RandomLocalClockModel::Setting dimension of rates to " + (m_tree.getNodeCount() - 1));
+            rates.setDimension(m_tree.getNodeCount() - 1);
+        }
+
+
+        ratesAreMultipliers = ratesAreMultipliersInput.get();
+
+        meanRate = meanRateInput.get();
+        if (meanRate == null) {
+            meanRate = new RealParameter("1.0");
+        }
+    }
+
+    /**
+     * This is a recursive function that does the work of
+     * calculating the unscaled branch rates across the tree
+     * taking into account the indicator variables.
+     *
+     * @param node the node
+     * @param rate the rate of the parent node
+     */
+    private void calculateUnscaledBranchRates(Node node, double rate, BooleanParameter indicators, RealParameter rates) {
+
+        int nodeNumber = getNr(node);
+
+        if (!node.isRoot()) {
+            if (indicators.getValue(nodeNumber)) {
+                if (ratesAreMultipliers) {
+                    rate *= rates.getValue(nodeNumber);
+                } else {
+                    rate = rates.getValue(nodeNumber);
+                }
+            }
+        }
+        unscaledBranchRates[nodeNumber] = rate;
+
+        if (!node.isLeaf()) {
+            calculateUnscaledBranchRates(node.getLeft(), rate, indicators, rates);
+            calculateUnscaledBranchRates(node.getRight(), rate, indicators, rates);
+        }
+    }
+
+    private void recalculateScaleFactor() {
+
+        BooleanParameter indicators = indicatorParamInput.get();
+        RealParameter rates = rateParamInput.get();
+
+        calculateUnscaledBranchRates(m_tree.getRoot(), 1.0, indicators, rates);
+
+        double timeTotal = 0.0;
+        double branchTotal = 0.0;
+
+        for (int i = 0; i < m_tree.getNodeCount(); i++) {
+            Node node = m_tree.getNode(i);
+            if (!node.isRoot()) {
+
+                double branchInTime = node.getParent().getHeight() - node.getHeight();
+
+                double branchLength = branchInTime * unscaledBranchRates[node.getNr()];
+
+                timeTotal += branchInTime;
+                branchTotal += branchLength;
+            }
+        }
+
+        scaleFactor = timeTotal / branchTotal;
+
+        scaleFactor *= meanRate.getValue();
+    }
+
+    @Override
+    public double getRateForBranch(Node node) {
+        // this must be synchronized to avoid being called simultaneously by
+        // two different likelihood threads
+    	synchronized (this) {
+    		if (recompute) {
+                recalculateScaleFactor();
+                recompute = false;
+			}
+        }
+
+        return unscaledBranchRates[getNr(node)] * scaleFactor;
+    }
+
+    private int getNr(Node node) {
+        int nNodeNr = node.getNr();
+        if (nNodeNr > m_tree.getRoot().getNr()) {
+            nNodeNr--;
+        }
+        return nNodeNr;
+    }
+
+    @Override
+    protected boolean requiresRecalculation() {
+        // this is only called if any of its inputs is dirty, hence we need to recompute
+        recompute = true;
+        return true;
+    }
+
+    @Override
+    protected void store() {
+        recompute = true;
+        super.store();
+    }
+
+    @Override
+    protected void restore() {
+        recompute = true;
+        super.restore();
+    }
+
+    private boolean recompute = true;
+    double[] unscaledBranchRates;
+    double scaleFactor;
+    boolean ratesAreMultipliers = false;
+}
diff --git a/src/beast/evolution/branchratemodel/RateStatistic.java b/src/beast/evolution/branchratemodel/RateStatistic.java
new file mode 100644
index 0000000..10051be
--- /dev/null
+++ b/src/beast/evolution/branchratemodel/RateStatistic.java
@@ -0,0 +1,191 @@
+/*
+ * RateStatistic.java
+ *
+ * Copyright (C) 2002-2006 Alexei Drummond and Andrew Rambaut
+ *
+ * This file is part of BEAST.
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership and licensing.
+ *
+ * BEAST 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
+ * of the License, or (at your option) any later version.
+ *
+ *  BEAST 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 BEAST; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+package beast.evolution.branchratemodel;
+
+
+import java.io.PrintStream;
+
+import beast.core.Description;
+import beast.core.Function;
+import beast.core.Input;
+import beast.core.Loggable;
+import beast.core.BEASTObject;
+import beast.core.Input.Validate;
+import beast.evolution.likelihood.GenericTreeLikelihood;
+import beast.evolution.tree.Node;
+import beast.evolution.tree.Tree;
+import beast.math.statistic.DiscreteStatistics;
+
+
+
+
+ at Description("A statistic that tracks the mean, variance and coefficent of variation of rates. " +
+        "It has three dimensions, one for each statistic.")
+public class RateStatistic extends BEASTObject implements Loggable, Function {
+	
+    public Input<GenericTreeLikelihood> likelihoodInput = new Input<GenericTreeLikelihood>("treeLikelihood", "TreeLikelihood containing branch rate model that provides rates for a tree");
+    public Input<BranchRateModel> branchRateModelInput = new Input<BranchRateModel>("branchratemodel", "model that provides rates for a tree", Validate.XOR, likelihoodInput);
+    public Input<Tree> treeInput = new Input<Tree>("tree", "tree for which the rates apply");
+    public Input<Boolean> internalInput = new Input<Boolean>("internal", "consider internal nodes, default true", true);
+    public Input<Boolean> externalInput = new Input<Boolean>("external", "consider external nodes, default true", true);
+
+    private Tree tree = null;
+    private BranchRateModel branchRateModel = null;
+    private boolean internal = true;
+    private boolean external = true;
+
+    final static int MEAN = 0;
+    final static int VARIANCE = 1;
+    final static int COEFFICIENT_OF_VARIATION = 2;
+
+    @Override
+    public void initAndValidate() throws Exception {
+        tree = treeInput.get();
+        branchRateModel = branchRateModelInput.get();
+        if (branchRateModel == null) {
+            branchRateModel = likelihoodInput.get().branchRateModelInput.get();
+        }
+        this.internal = internalInput.get();
+        this.external = externalInput.get();
+    }
+
+    /**
+     * calculate the three statistics from scratch *
+     */
+    public double[] calcValues() {
+        int length = 0;
+        int offset = 0;
+
+        final int nrOfLeafs = tree.getLeafNodeCount();
+
+        if (external) {
+            length += nrOfLeafs;
+        }
+        if (internal) {
+            length += tree.getInternalNodeCount() - 1;
+        }
+
+        final double[] rates = new double[length];
+        // need those only for mean
+        final double[] branchLengths = new double[length];
+
+        final Node[] nodes = tree.getNodesAsArray();
+
+        /** handle leaf nodes **/
+        if (external) {
+            for (int i = 0; i < nrOfLeafs; i++) {
+                final Node child = nodes[i];
+                final Node parent = child.getParent();
+                branchLengths[i] = parent.getHeight() - child.getHeight();
+                rates[i] = branchRateModel.getRateForBranch(child);
+            }
+            offset = nrOfLeafs;
+        }
+
+        /** handle internal nodes **/
+        if (internal) {
+            final int n = tree.getNodeCount();
+            int k = offset;
+            for (int i = nrOfLeafs; i < n; i++) {
+                final Node child = nodes[i];
+                if (!child.isRoot()) {
+                    final Node parent = child.getParent();
+                    branchLengths[k] = parent.getHeight() - child.getHeight();
+                    rates[k] = branchRateModel.getRateForBranch(child);
+                    k++;
+                }
+            }
+        }
+
+        final double[] values = new double[3];
+        double totalWeightedRate = 0.0;
+        double totalTreeLength = 0.0;
+        for (int i = 0; i < rates.length; i++) {
+            totalWeightedRate += rates[i] * branchLengths[i];
+            totalTreeLength += branchLengths[i];
+        }
+        values[MEAN] = totalWeightedRate / totalTreeLength;
+        // Q2R why not?
+//  final double mean = DiscreteStatistics.mean(rates);
+//        values[VARIANCE] = DiscreteStatistics.variance(rates, mean);
+//        values[COEFFICIENT_OF_VARIATION] = Math.sqrt(D values[VARIANCE]) / mean;
+        values[VARIANCE] = DiscreteStatistics.variance(rates);
+        final double mean = DiscreteStatistics.mean(rates);
+        values[COEFFICIENT_OF_VARIATION] = Math.sqrt(DiscreteStatistics.variance(rates, mean)) / mean;
+        return values;
+    }
+
+
+    /**
+     * Valuable implementation *
+     */
+
+    @Override
+    public int getDimension() {
+        return 3;
+    }
+
+    @Override
+    public double getArrayValue() {
+        return calcValues()[0];
+    }
+
+    @Override
+    public double getArrayValue(final int iDim) {
+        if (iDim > 3) {
+            throw new IllegalArgumentException();
+        }
+        return calcValues()[iDim];
+    }
+
+
+    /**
+     * Loggable implementation *
+     */
+
+    @Override
+    public void init(final PrintStream out) throws Exception {
+        String sID = getID();
+        if (sID == null) {
+            sID = "";
+        }
+        out.print(sID + ".mean\t" + sID + ".variance\t" + sID + ".coefficientOfVariation\t");
+    }
+
+
+    @Override
+    public void log(final int nSample, final PrintStream out) {
+        final double[] values = calcValues();
+        out.print(values[0] + "\t" + values[1] + "\t" + values[2] + "\t");
+    }
+
+
+    @Override
+    public void close(final PrintStream out) {
+        // nothing to do
+    }
+
+}
diff --git a/src/beast/evolution/branchratemodel/StrictClockModel.java b/src/beast/evolution/branchratemodel/StrictClockModel.java
new file mode 100644
index 0000000..45eb85e
--- /dev/null
+++ b/src/beast/evolution/branchratemodel/StrictClockModel.java
@@ -0,0 +1,51 @@
+package beast.evolution.branchratemodel;
+
+import beast.core.Description;
+import beast.core.parameter.RealParameter;
+import beast.evolution.tree.Node;
+
+/**
+ * @author Alexei Drummond
+ */
+
+ at Description("Defines a mean rate for each branch in the beast.tree.")
+public class StrictClockModel extends BranchRateModel.Base {
+
+    //public Input<RealParameter> muParameterInput = new Input<RealParameter>("clock.rate", "the clock rate (defaults to 1.0)");
+
+    RealParameter muParameter;
+
+    @Override
+    public void initAndValidate() throws Exception {
+        muParameter = meanRateInput.get();
+        if (muParameter != null) {
+            muParameter.setBounds(Math.max(0.0, muParameter.getLower()), muParameter.getUpper());
+            mu = muParameter.getValue();
+        }
+    }
+
+    @Override
+    public double getRateForBranch(final Node node) {
+        return mu;
+    }
+
+    @Override
+    public boolean requiresRecalculation() {
+        mu = muParameter.getValue();
+        return true;
+    }
+
+    @Override
+    protected void restore() {
+        mu = muParameter.getValue();
+        super.restore();
+    }
+
+    @Override
+    protected void store() {
+        mu = muParameter.getValue();
+        super.store();
+    }
+
+    private double mu = 1.0;
+}
diff --git a/src/beast/evolution/branchratemodel/UCRelaxedClockModel.java b/src/beast/evolution/branchratemodel/UCRelaxedClockModel.java
new file mode 100644
index 0000000..9e8c819
--- /dev/null
+++ b/src/beast/evolution/branchratemodel/UCRelaxedClockModel.java
@@ -0,0 +1,406 @@
+package beast.evolution.branchratemodel;
+
+
+import beast.core.Citation;
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.parameter.IntegerParameter;
+import beast.core.parameter.RealParameter;
+import beast.core.util.Log;
+import beast.evolution.tree.Node;
+import beast.evolution.tree.Tree;
+import beast.math.distributions.ParametricDistribution;
+import beast.util.Randomizer;
+import org.apache.commons.math.MathException;
+
+import java.util.Arrays;
+
+/**
+ * @author Alexei Drummond
+ */
+
+ at Description("Defines an uncorrelated relaxed molecular clock.")
+ at Citation(value =
+        "Drummond AJ, Ho SYW, Phillips MJ, Rambaut A (2006) Relaxed Phylogenetics and\n" +
+        "  Dating with Confidence. PLoS Biol 4(5): e88", DOI = "10.1371/journal.pbio.0040088",
+        year = 2006, firstAuthorSurname = "drummond")
+public class UCRelaxedClockModel extends BranchRateModel.Base {
+
+    public Input<ParametricDistribution> rateDistInput = new Input<ParametricDistribution>("distr", "the distribution governing the rates among branches. Must have mean of 1. The clock.rate parameter can be used to change the mean rate.", Input.Validate.REQUIRED);
+    public Input<IntegerParameter> categoryInput = new Input<IntegerParameter>("rateCategories", "the rate categories associated with nodes in the tree for sampling of individual rates among branches.", Input.Validate.REQUIRED);
+
+    public Input<Integer> numberOfDiscreteRates = new Input<Integer>("numberOfDiscreteRates", "the number of discrete rate categories to approximate the rate distribution by. A value <= 0 will cause the number of categories to be set equal to the number of branches in the tree. (default = -1)", -1);
+
+    public Input<RealParameter> quantileInput = new Input<RealParameter>("rateQuantiles", "the rate quantiles associated with nodes in the tree for sampling of individual rates among branches.", Input.Validate.XOR, categoryInput);
+
+    public Input<Tree> treeInput = new Input<Tree>("tree", "the tree this relaxed clock is associated with.", Input.Validate.REQUIRED);
+    public Input<Boolean> normalizeInput = new Input<Boolean>("normalize", "Whether to normalize the average rate (default false).", false);
+//    public Input<Boolean> initialiseInput = new Input<Boolean>("initialise", "Whether to initialise rates by a heuristic instead of random (default false).", false);
+
+    RealParameter meanRate;
+//    boolean initialise;
+
+    int LATTICE_SIZE_FOR_DISCRETIZED_RATES = 100;
+
+    // true if quantiles are used, false if discrete rate categories are used.
+    boolean usingQuantiles;
+
+    private int branchCount;
+
+    @Override
+    public void initAndValidate() throws Exception {
+
+        tree = treeInput.get();
+        branchCount = tree.getNodeCount() - 1;
+
+        categories = categoryInput.get();
+        usingQuantiles = (categories == null);
+
+        if (!usingQuantiles) {
+            LATTICE_SIZE_FOR_DISCRETIZED_RATES = numberOfDiscreteRates.get();
+            if (LATTICE_SIZE_FOR_DISCRETIZED_RATES <= 0) LATTICE_SIZE_FOR_DISCRETIZED_RATES = branchCount;
+            Log.info.println("  UCRelaxedClockModel: using " + LATTICE_SIZE_FOR_DISCRETIZED_RATES + " rate " +
+                    "categories to approximate rate distribution across branches.");
+        } else {
+            if (numberOfDiscreteRates.get() != -1) {
+                throw new RuntimeException("Can't specify both numberOfDiscreteRates and rateQuantiles inputs.");
+            }
+            Log.info.println("  UCRelaxedClockModel: using quantiles for rate distribution across branches.");
+        }
+
+        if (usingQuantiles) {
+            quantiles = quantileInput.get();
+            quantiles.setDimension(branchCount);
+            Double[] initialQuantiles = new Double[branchCount];
+            for (int i = 0; i < branchCount; i++) {
+                initialQuantiles[i] = Randomizer.nextDouble();
+            }
+            RealParameter other = new RealParameter(initialQuantiles);
+            quantiles.assignFromWithoutID(other);
+            quantiles.setLower(0.0);
+            quantiles.setUpper(1.0);
+        } else {
+            categories.setDimension(branchCount);
+            Integer[] initialCategories = new Integer[branchCount];
+            for (int i = 0; i < branchCount; i++) {
+                initialCategories[i] = Randomizer.nextInt(LATTICE_SIZE_FOR_DISCRETIZED_RATES);
+            }
+            // set initial values of rate categories
+            IntegerParameter other = new IntegerParameter(initialCategories);
+            categories.assignFromWithoutID(other);
+            categories.setLower(0);
+            categories.setUpper(LATTICE_SIZE_FOR_DISCRETIZED_RATES - 1);
+        }
+
+        distribution = rateDistInput.get();
+
+        if (!usingQuantiles) {
+            // rates are initially zero and are computed by getRawRate(int i) as needed
+            rates = new double[LATTICE_SIZE_FOR_DISCRETIZED_RATES];
+            storedRates = new double[LATTICE_SIZE_FOR_DISCRETIZED_RATES];
+
+            //System.arraycopy(rates, 0, storedRates, 0, rates.length);
+        }
+        normalize = normalizeInput.get();
+
+        meanRate = meanRateInput.get();
+        if (meanRate == null) {
+            meanRate = new RealParameter("1.0");
+        }
+
+        try {
+            double mean = rateDistInput.get().getMean();
+            if (Math.abs(mean - 1.0) > 1e-6) {
+                Log.warning.println("WARNING: mean of distribution for relaxed clock model is not 1.0.");
+            }
+        } catch (RuntimeException e) {
+            // ignore
+        }
+    }
+
+    public double getRateForBranch(Node node) {
+        if (node.isRoot()) {
+            // root has no rate
+            return 1;
+        }
+
+   		if (recompute) {
+   	        // this must be synchronized to avoid being called simultaneously by
+   	        // two different likelihood threads
+   	    	synchronized (this) {
+    			prepare();
+    			recompute = false;
+    		}
+    	}
+
+        if (renormalize) {
+            if (normalize) {
+            	synchronized (this) {
+            		computeFactor();
+            	}
+            }
+            renormalize = false;
+        }
+
+        return getRawRate(node) * scaleFactor * meanRate.getValue();
+    }
+
+    /**
+     * Computes a scale factor for normalization. Only called if normalize=true.
+     */
+    private void computeFactor() {
+
+        //scale mean rate to 1.0 or separate parameter
+
+        double treeRate = 0.0;
+        double treeTime = 0.0;
+
+        if (!usingQuantiles) {
+            for (int i = 0; i < tree.getNodeCount(); i++) {
+                Node node = tree.getNode(i);
+                if (!node.isRoot()) {
+                    treeRate += getRawRateForCategory(node) * node.getLength();
+                    treeTime += node.getLength();
+                }
+            }
+        } else {
+            for (int i = 0; i < tree.getNodeCount(); i++) {
+                Node node = tree.getNode(i);
+                if (!node.isRoot()) {
+                    treeRate += getRawRateForQuantile(node) * node.getLength();
+                    treeTime += node.getLength();
+                }
+            }
+        }
+
+        scaleFactor = 1.0 / (treeRate / treeTime);
+    }
+
+    private double getRawRate(Node node) {
+        if (usingQuantiles) {
+            return getRawRateForQuantile(node);
+        }
+        return getRawRateForCategory(node);
+    }
+
+    /**
+     * @param node the node to get the rate of
+     * @return the rate of the branch
+     */
+    private double getRawRateForCategory(Node node) {
+
+        int nodeNumber = node.getNr();
+        if (nodeNumber == branchCount) {
+            // root node has nr less than #categories, so use that nr
+            nodeNumber = node.getTree().getRoot().getNr();
+        }
+
+        int category = categories.getValue(nodeNumber);
+
+        if (rates[category] == 0.0) {
+            try {
+                rates[category] = distribution.inverseCumulativeProbability((category + 0.5) / rates.length);
+            } catch (MathException e) {
+                throw new RuntimeException("Failed to compute inverse cumulative probability!");
+            }
+        }
+        return rates[category];
+    }
+
+    private double getRawRateForQuantile(Node node) {
+
+        int nodeNumber = node.getNr();
+        if (nodeNumber == branchCount) {
+            // root node has nr less than #categories, so use that nr
+            nodeNumber = node.getTree().getRoot().getNr();
+        }
+
+        try {
+            return distribution.inverseCumulativeProbability(quantiles.getValue(nodeNumber));
+        } catch (MathException e) {
+            throw new RuntimeException("Failed to compute inverse cumulative probability!");
+        }
+    }
+
+    private void prepare() {
+
+        categories = categoryInput.get();
+
+        usingQuantiles = (categories == null);
+
+        distribution = rateDistInput.get();
+
+        tree = treeInput.get();
+
+        if (!usingQuantiles) {
+            // rates array initialized to correct length in initAndValidate
+            // here we just reset rates to zero and they are computed by getRawRate(int i) as needed
+            Arrays.fill(rates, 0.0);
+        }
+    }
+
+    /**
+     * initialise rate categories by matching rates to tree using JC69 *
+     */
+//    private void initialise() {
+//    	try {
+//			for (BEASTObject output : outputs) {
+//				if (output.getInput("data") != null && output.getInput("tree") != null) {
+//					
+//					// set up treelikelihood with Jukes Cantor no gamma, no inv, strict clock
+//					Alignment data = (Alignment) output.getInput("data").get();
+//					Tree tree = (Tree) output.getInput("tree").get();
+//					TreeLikelihoodD likelihood = new TreeLikelihoodD();
+//					SiteModel siteModel = new SiteModel();
+//					JukesCantor substitutionModel = new JukesCantor();
+//					substitutionModel.initAndValidate();
+//					siteModel.initByName("substModel", substitutionModel);
+//					likelihood.initByName("data", data, "tree", tree, "siteModel", siteModel);
+//					likelihood.calculateLogP();
+//					
+//					// calculate distances
+//					Node [] nodes = tree.getNodesAsArray();
+//					double [] distance = new double[nodes.length];
+//					for (int i = 0; i < distance.length - 1; i++) {
+//						double len = nodes[i].getLength();
+//						double dist = likelihood.calcDistance(nodes[i]);
+//						distance[i] = len / dist;
+//					}
+//					
+//					// match category to distance
+//					double min = distance[0], max = min;
+//					for (int i = 1; i < distance.length - 1; i++) {
+//						if (!Double.isNaN(distance[i]) && !Double.isInfinite(distance[i])) {
+//							min = Math.min(min, distance[i]);
+//							max = Math.max(max, distance[i]);
+//						}
+//					}
+//					IntegerParameter categoriesParameter = categoryInput.get();
+//					Integer[] categories = new Integer[categoriesParameter.getDimension()];
+//					for (int i = 0; i < distance.length - 1; i++) {
+//						if (!Double.isNaN(distance[i]) && !Double.isInfinite(distance[i])) {
+//							categories[i] = (int)((distance.length - 2) * (distance[i]-min)/(max-min));
+//						} else {
+//							categories[i] = distance.length / 2;
+//						}
+//					}
+//					IntegerParameter other = new IntegerParameter(categories);
+//					other.setBounds(categoriesParameter.getLower(), categoriesParameter.getUpper());
+//					categoriesParameter.assignFromWithoutID(other);
+//				}
+//			}
+//    	} catch (Exception e) {
+//			// ignore
+//    		System.err.println("WARNING: UCRelaxedClock heuristic initialisation failed");
+//		}
+//	}
+//
+//    @Description("Treelikelihood used to guesstimate rates on branches by using the JC69 model on the data")
+//    class TreeLikelihoodD extends TreeLikelihood {
+//    
+//    	double calcDistance(Node node) {
+//    		int iNode = node.getNr();
+//    		int patterncount = dataInput.get().getPatternCount();
+//    		int statecount = dataInput.get().getDataType().getStateCount();
+//            double [] fParentPartials = new double[patterncount * statecount];
+//    		likelihoodCore.getNodePartials(node.getParent().getNr(), fParentPartials);
+//    		if (node.isLeaf()) {
+//        		// distance of leaf to its parent, ignores ambiguities
+//    			int [] nStates = new int[patterncount ];
+//        		likelihoodCore.getNodeStates(iNode, nStates);
+//        		double distance = 0;
+//        		for (int i = 0; i < patterncount; i++) {
+//        			int k = nStates[i];
+//        			double d = 0;
+//        			for (int j = 0; j < statecount; j++) {
+//        				if (j == k) {
+//        					d += 1.0 - fParentPartials[i * statecount + j];
+//        				} else {
+//        					d += fParentPartials[i * statecount + j];
+//        				}
+//        			}
+//        			distance += d * dataInput.get().getPatternWeight(i);
+//        		}
+//    			return distance;
+//    		} else {
+//        		// L1 distance of internal node partials to its parent partials
+//                double [] fPartials = new double[fParentPartials.length];
+//        		likelihoodCore.getNodePartials(iNode, fPartials);
+//        		double distance = 0;
+//        		for (int i = 0; i < patterncount; i++) {
+//        			double d = 0;
+//        			for (int j = 0; j < statecount; j++) {
+//       					d += Math.abs(fPartials[i * statecount + j] - fParentPartials[i * statecount + j]);
+//        			}
+//        			distance += d * dataInput.get().getPatternWeight(i);
+//        		}
+//    			return distance;
+//    		}
+//    	}
+//    	
+//    }
+    @Override
+    protected boolean requiresRecalculation() {
+        recompute = false;
+        renormalize = true;
+
+//        if (treeInput.get().somethingIsDirty()) {
+//        	recompute = true;
+//            return true;
+//        }
+        // rateDistInput cannot be dirty?!?
+        if (rateDistInput.get().isDirtyCalculation()) {
+            recompute = true;
+            return true;
+        }
+        // NOT processed as trait on the tree, so DO mark as dirty
+        if (categoryInput.get() != null && categoryInput.get().somethingIsDirty()) {
+            //recompute = true;
+            return true;
+        }
+
+        if (quantileInput.get() != null && quantileInput.get().somethingIsDirty()) {
+            return true;
+        }
+
+        if (meanRate.somethingIsDirty()) {
+            return true;
+        }
+
+        return recompute;
+    }
+
+    @Override
+    public void store() {
+        if (!usingQuantiles) System.arraycopy(rates, 0, storedRates, 0, rates.length);
+
+        storedScaleFactor = scaleFactor;
+        super.store();
+    }
+
+    @Override
+    public void restore() {
+        if (!usingQuantiles) {
+            double[] tmp = rates;
+            rates = storedRates;
+            storedRates = tmp;
+        }
+        scaleFactor = storedScaleFactor;
+        super.restore();
+    }
+
+    ParametricDistribution distribution;
+    IntegerParameter categories;
+    RealParameter quantiles;
+    Tree tree;
+
+    private boolean normalize = false;
+    private boolean recompute = true;
+    private boolean renormalize = true;
+
+    private double[] rates;
+    private double[] storedRates;
+    private double scaleFactor = 1.0;
+    private double storedScaleFactor = 1.0;
+
+}
\ No newline at end of file
diff --git a/src/beast/evolution/datatype/Aminoacid.java b/src/beast/evolution/datatype/Aminoacid.java
new file mode 100644
index 0000000..e196fb6
--- /dev/null
+++ b/src/beast/evolution/datatype/Aminoacid.java
@@ -0,0 +1,33 @@
+package beast.evolution.datatype;
+
+import beast.core.Description;
+import beast.evolution.datatype.DataType.Base;
+
+ at Description("DataType for amino acids.")
+public class Aminoacid extends Base {
+
+    public Aminoacid() {
+        stateCount = 20;
+        codeLength = 1;
+        codeMap = "ACDEFGHIKLMNPQRSTVWY" + "X" + GAP_CHAR + MISSING_CHAR;
+
+        mapCodeToStateSet = new int[23][];
+        for (int i = 0; i < 20; i++) {
+            mapCodeToStateSet[i] = new int[1];
+            mapCodeToStateSet[i][0] = i;
+        }
+        int[] all = new int[20];
+        for (int i = 0; i < 20; i++) {
+            all[i] = i;
+        }
+        mapCodeToStateSet[20] = all;
+        mapCodeToStateSet[21] = all;
+        mapCodeToStateSet[22] = all;
+    }
+
+    @Override
+    public String getTypeDescription() {
+        return "aminoacid";
+    }
+
+}
diff --git a/src/beast/evolution/datatype/Binary.java b/src/beast/evolution/datatype/Binary.java
new file mode 100644
index 0000000..9295562
--- /dev/null
+++ b/src/beast/evolution/datatype/Binary.java
@@ -0,0 +1,38 @@
+package beast.evolution.datatype;
+
+import beast.core.Description;
+import beast.evolution.datatype.DataType.Base;
+
+ at Description("Datatype for binary sequences")
+public class Binary extends Base {
+    int[][] x = {
+            {0},  // 0
+            {1},  // 1
+            {0, 1}, // -
+            {0, 1}, // ?
+    };
+
+    public Binary() {
+        stateCount = 2;
+        mapCodeToStateSet = x;
+        codeLength = 1;
+        codeMap = "01" + GAP_CHAR + MISSING_CHAR;
+    }
+
+    @Override
+    public String getTypeDescription() {
+        return "binary";
+    }
+
+    @Override
+    public char getChar(int state) {
+    	switch (state) {
+    	case 0: return '0';
+    	case 1: return '1';
+    	case 2: return GAP_CHAR;
+    	case 3: return MISSING_CHAR;
+    	}
+    	return MISSING_CHAR;
+    }
+
+}
diff --git a/src/beast/evolution/datatype/DataType.java b/src/beast/evolution/datatype/DataType.java
new file mode 100644
index 0000000..12b4211
--- /dev/null
+++ b/src/beast/evolution/datatype/DataType.java
@@ -0,0 +1,291 @@
+package beast.evolution.datatype;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import beast.core.BEASTObject;
+import beast.core.Description;
+
+
+
+public interface DataType {
+    final static public char GAP_CHAR = '-';
+    final static public char MISSING_CHAR = '?';
+
+    /**
+     * @return number of states for this data type.
+     *         Assuming there is a finite number of states, or -1 otherwise.
+     */
+    int getStateCount();
+
+    /**
+     * Convert a sequence represented by a string into a sequence of integers
+     * representing the state for this data type.
+     * Ambiguous states should be represented by integer numbers higher than getStateCount()
+     * throws exception when parsing error occur *
+     */
+    List<Integer> string2state(String sSequence) throws Exception;
+
+    /**
+     * Convert an array of states into a sequence represented by a string.
+     * This is the inverse of string2state()
+     * throws exception when State cannot be mapped *
+     */
+    String state2string(List<Integer> nStates) throws Exception;
+
+    String state2string(int[] nStates) throws Exception;
+
+    /**
+     * returns an array of length getStateCount() containing the (possibly ambiguous) states
+     * that this state represents.
+     */
+    public boolean[] getStateSet(int iState);
+
+    /**
+     * returns an array with all non-ambiguous states represented by
+     * a state.
+     */
+    public int[] getStatesForCode(int iState);
+
+    boolean isAmbiguousState(int state);
+
+    /**
+     * true if the class is completely self contained and does not need any
+     * further initialisation. Notable exception: GeneralDataype
+     */
+    boolean isStandard();
+
+    /**
+     * data type description, e.g. nucleotide, codon *
+     */
+    public String getTypeDescription();
+
+    /**
+     * Get character corresponding to a given state
+     *
+     * @param state state
+     *              <p/>
+     *              return corresponding character
+     */
+    public char getChar(int state);
+
+    /**
+     * Get a string code corresponding to a given state. By default this
+     * calls getChar but overriding classes may return multicharacter codes.
+     *
+     * @param state state
+     *              <p/>
+     *              return corresponding code
+     */
+    public String getCode(int state);
+
+    @Description(value = "Base class bringing class and interfaces together", isInheritable = false)
+    public abstract class Base extends BEASTObject implements DataType {
+        /**
+         * size of the state space *
+         */
+        protected int stateCount;
+
+        /**
+         * maps string encoding to state codes *
+         */
+        protected String codeMap;
+
+        public String getCodeMap() {
+            return codeMap;
+        }
+
+        /**
+         * length of the encoding, e.g. 1 for nucleotide, 3 for codons *
+         */
+        protected int codeLength;
+
+        /**
+         * mapping codes to sets of states *
+         */
+        protected int[][] mapCodeToStateSet;
+
+        @Override
+        public void initAndValidate() throws Exception {
+            if (mapCodeToStateSet != null) {
+                if (mapCodeToStateSet.length != codeMap.length() / codeLength) {
+                    throw new Exception("m_sCodeMap and m_mapCodeToStateSet have incompatible lengths");
+                }
+            }
+        }
+
+        @Override
+        public int getStateCount() {
+            return stateCount;
+        }
+
+        /**
+         * implementation for single character per state encoding *
+         */
+        @Override
+        public List<Integer> string2state(String data) throws Exception {
+            List<Integer> sequence;
+            sequence = new ArrayList<Integer>();
+            // remove spaces
+            data = data.replaceAll("\\s", "");
+            data = data.toUpperCase();
+            if (codeMap == null) {
+                if (data.contains(",")) {
+                    // assume it is a comma separated string of integers
+                    String[] sStrs = data.split(",");
+                    for (String sStr : sStrs) {
+                    	try {
+                    		sequence.add(Integer.parseInt(sStr));
+                    	} catch (NumberFormatException e) {
+                    		sequence.add(-1);
+                    	}
+                    }
+                } else {
+                    // assume it is a string where each character is a state
+                    for (byte c : data.getBytes()) {
+                    	switch (c) {
+                    	case GAP_CHAR:
+                    	case MISSING_CHAR:
+                            sequence.add(-1);
+                            break;
+                    	default:
+                    		sequence.add(Integer.parseInt((char) c + ""));
+                    	}
+                    }
+                }
+            } else {
+                if (codeLength == 1) {
+                    // single character codes
+                    for (int i = 0; i < data.length(); i++) {
+                        char cCode = data.charAt(i);
+                        int nState = codeMap.indexOf(cCode);
+                        if (nState < 0) {
+                            throw new Exception("Unknown code found in sequence: " + cCode);
+                        }
+                        sequence.add(nState);
+                    }
+                } else if (codeLength > 1) {
+                    // multi-character codes of fixed length
+
+                    // use code map to resolve state codes
+                    Map<String, Integer> map = new HashMap<String, Integer>();
+                    // fixed length code
+                    for (int i = 0; i < codeMap.length(); i += codeLength) {
+                        String code = codeMap.substring(i, i + codeLength);
+                        map.put(code, i / codeLength);
+                    }
+
+                    for (int i = 0; i < data.length(); i += codeLength) {
+                        String code = data.substring(i, i + codeLength).toUpperCase();
+                        if (map.containsKey(code)) {
+                            sequence.add(map.get(code));
+                        } else {
+                            throw new Exception("Unknown code found in sequence: " + code);
+                        }
+                    }
+                } else {
+                    // variable length code of strings
+                    String[] codes = codeMap.toUpperCase().split(",");
+                    for (String code : data.split(",")) {
+                        boolean isFound = false;
+                        for (int iCode = 0; iCode < codes.length; iCode++) {
+                            if (code.equals(codes[iCode])) {
+                                sequence.add(iCode);
+                                isFound = true;
+                                break;
+                            }
+                        }
+                        if (!isFound) {
+                            throw new Exception("Could not find code " + code + " in codemap");
+                        }
+                    }
+                }
+            }
+            return sequence;
+        } // string2state
+
+        @Override
+        public String state2string(List<Integer> nrOfStates) {
+            int[] nrOfStates2 = new int[nrOfStates.size()];
+            for (int i = 0; i < nrOfStates2.length; i++) {
+                nrOfStates2[i] = nrOfStates.get(i);
+            }
+            return state2string(nrOfStates2);
+        }
+
+        /**
+         * implementation for single character per state encoding *
+         */
+        @Override
+        public String state2string(int[] nrOfStates) {
+            StringBuffer buf = new StringBuffer();
+            if (codeMap != null) {
+                for (int iState : nrOfStates) {
+                    String sCode = codeMap.substring(iState * codeLength, iState * codeLength + codeLength);
+                    buf.append(sCode);
+                }
+            } else {
+                // produce a comma separated string of integers
+                for (int i = 0; i < nrOfStates.length - 1; i++) {
+                    buf.append(nrOfStates[i] + ",");
+                }
+                buf.append(nrOfStates[nrOfStates.length - 1] + "");
+            }
+            return buf.toString();
+        } // state2string
+
+
+        @Override
+        public int[] getStatesForCode(int iState) {
+            return mapCodeToStateSet[iState];
+        }
+
+        @Override
+        public boolean[] getStateSet(int state) {
+            boolean[] stateSet = new boolean[stateCount];
+            int[] stateNumbers = getStatesForCode(state);
+            for (int i : stateNumbers) {
+                stateSet[i] = true;
+            }
+            return stateSet;
+        } // getStateSet
+
+        /** Default implementations represent non-ambiguous states as numbers
+         * 0 ... stateCount-1, and ambiguous characters as numbers >= stateCount 
+         * For data types that count something -- like microsattelites, or number 
+         * of lineages in SNAPP -- a stateCount < 0 represents missing data. 
+         */
+        @Override
+        public boolean isAmbiguousState(int state) {
+            return (state < 0 || state >= stateCount);
+        }
+
+        @Override
+        public boolean isStandard() {
+            return true;
+        }
+
+        @Override
+        public char getChar(int state) {
+            return (char) (state + 'A');
+        }
+
+        @Override
+        public String getCode(int state) {
+            return String.valueOf(getChar(state));
+        }
+
+        @Override
+        public String toString() {
+            return getTypeDescription();
+        }
+        
+        /** return state associated with a character */
+        public Integer char2state(String character) throws Exception {
+        	return string2state(character).get(0);
+        }
+    } // class Base
+
+} // class DataType
diff --git a/src/beast/evolution/datatype/IntegerData.java b/src/beast/evolution/datatype/IntegerData.java
new file mode 100644
index 0000000..136d82d
--- /dev/null
+++ b/src/beast/evolution/datatype/IntegerData.java
@@ -0,0 +1,34 @@
+package beast.evolution.datatype;
+
+import beast.core.Description;
+import beast.evolution.datatype.DataType.Base;
+
+ at Description("Datatype for integer sequences")
+public class IntegerData extends Base {
+
+    public IntegerData() {
+        stateCount = -1;
+        mapCodeToStateSet = null;
+        codeLength = -1;
+        codeMap = null;
+    }
+
+    @Override
+    public String getTypeDescription() {
+        return "integer";
+    }
+    
+    @Override
+    public boolean isAmbiguousState(int state) {
+    	return state < 0;
+    }
+    
+    @Override
+    public char getChar(int state) {
+    	if (state < 0) {
+    		return '?';
+    	}
+        return (char)('0'+state);
+    }
+
+}
diff --git a/src/beast/evolution/datatype/Nucleotide.java b/src/beast/evolution/datatype/Nucleotide.java
new file mode 100644
index 0000000..337b8d1
--- /dev/null
+++ b/src/beast/evolution/datatype/Nucleotide.java
@@ -0,0 +1,42 @@
+package beast.evolution.datatype;
+
+import beast.core.Description;
+import beast.evolution.datatype.DataType.Base;
+
+ at Description("Nucleotide datatype for DNA sequences")
+public class Nucleotide extends Base {
+    int[][] x = {
+            {0},  // A
+            {1},  // C
+            {2},  // G
+            {3},  // T
+            {3},  // U
+            {0, 2}, // R
+            {1, 3}, // Y
+            {0, 1}, // M
+            {0, 3}, // W
+            {1, 2}, // S
+            {2, 3}, // K
+            {1, 2, 3}, // B
+            {0, 2, 3}, // D
+            {0, 1, 3}, // H
+            {0, 1, 2}, // V
+            {0, 1, 2, 3}, // N
+            {0, 1, 2, 3}, // X
+            {0, 1, 2, 3}, // -
+            {0, 1, 2, 3}, // ?
+    };
+
+    public Nucleotide() {
+        stateCount = 4;
+        mapCodeToStateSet = x;
+        codeLength = 1;
+        codeMap = "ACGTURYMWSKBDHVNX" + GAP_CHAR + MISSING_CHAR;
+    }
+
+    @Override
+    public String getTypeDescription() {
+        return "nucleotide";
+    }
+
+}
diff --git a/src/beast/evolution/datatype/StandardData.java b/src/beast/evolution/datatype/StandardData.java
new file mode 100644
index 0000000..3c653d8
--- /dev/null
+++ b/src/beast/evolution/datatype/StandardData.java
@@ -0,0 +1,188 @@
+package beast.evolution.datatype;
+
+
+
+import beast.core.Description;
+import beast.core.Input;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+ at Description("Integer data type to describe discrete morphological characters with polymorphisms")
+public class StandardData extends DataType.Base {
+
+    public Input<Integer> maxNrOfStatesInput = new Input<Integer>("nrOfStates", "specifies the maximum number of " +
+            "character states in data matrix or in the filtered alignment");
+    public Input<String> listOfAmbiguitiesInput = new Input<String>("ambiguities", "all possible ambiguities presented " +
+            "as space separated sets of ordered elements. Elements are digits 0..9.");
+    public Input<List<UserDataType>> charStateLabelsInput = new Input<List<UserDataType>>("charstatelabels",
+            "list of morphological character descriptions. Position in the list corresponds to the position of the" +
+                    "character in the alignment", new ArrayList<>());
+
+    private String[] ambiguities = {};
+    private ArrayList<String> codeMapping;
+
+    private int ambCount;
+
+
+	@Override
+	public void initAndValidate() throws Exception {
+        if (maxNrOfStatesInput.get() != null && maxNrOfStatesInput.get() != 0) {
+            stateCount = maxNrOfStatesInput.get();
+        } else {
+            stateCount = -1;
+        }
+
+        mapCodeToStateSet = null;
+        codeLength = -1;
+        codeMap = null;
+        createCodeMapping();
+	}
+
+    private void createCodeMapping() {
+        if (listOfAmbiguitiesInput.get() != null) {
+            ambiguities = listOfAmbiguitiesInput.get().split(" ");
+        }
+
+        ambCount = ambiguities.length;
+        codeMapping = new ArrayList<String>();
+        for (int i=0; i<stateCount; i++) {
+            codeMapping.add(Integer.toString(i));
+        }
+        for (int i=0; i< ambCount; i++) {
+            codeMapping.add(ambiguities[i]);
+        }
+        codeMapping.add(Character.toString(GAP_CHAR));
+        codeMapping.add(Character.toString(MISSING_CHAR));
+
+        mapCodeToStateSet = new int[codeMapping.size()][];
+        for (int i = 0; i < codeMapping.size() - 2; i++) {
+        	int [] stateSet = new int[codeMapping.get(i).length()];
+        	for (int k = 0; k < stateSet.length; k++) {
+        		stateSet[k] = (codeMapping.get(i).charAt(k) - '0');
+        	}
+        	mapCodeToStateSet[i] = stateSet;
+        }
+        
+    	// TODO: is this the correct way to deal with stateCount == -1?
+    	int n = stateCount >= 0 ? stateCount : 10;
+        int [] stateSet = new int[n];
+        for (int i = 0; i < n; i++) {
+        	stateSet[i] = i;
+        }
+        // GAP_CHAR
+        mapCodeToStateSet[mapCodeToStateSet.length - 2] = stateSet;
+        // MISSING_CHAR
+        mapCodeToStateSet[mapCodeToStateSet.length - 1] = stateSet;
+    }
+    
+    @Override
+    public int[] getStatesForCode(int iState) {
+    	if (iState >= 0) {
+    		return mapCodeToStateSet[iState];
+    	} else {
+    		return mapCodeToStateSet[mapCodeToStateSet.length - 1];
+    	}
+    }
+
+
+    @Override
+    public List<Integer> string2state(String data) throws Exception {
+        List<Integer> sequence;
+        sequence = new ArrayList<Integer>();
+        // remove spaces
+        data = data.replaceAll("\\s", "");
+
+        ArrayList<Integer> amb = new ArrayList<Integer>();
+        boolean readingAmb=false;
+        for (byte c : data.getBytes()) {
+            if (!readingAmb) {
+                switch (c) {
+                    case GAP_CHAR:
+                    case MISSING_CHAR:
+                    	String missing = Character.toString(MISSING_CHAR);
+                   		sequence.add(codeMapping.indexOf(missing));
+                        break;
+                    case '{':
+                        readingAmb = true;
+                        amb.clear();
+                        break;
+                    default:
+                        sequence.add(Integer.parseInt((char) c + ""));
+                }
+            } else {
+                if (c != '}') {
+                    amb.add(Integer.parseInt((char) c + "") );
+                } else {
+                    readingAmb = false;
+                    Collections.sort(amb);
+                    String ambStr = "";
+                    for (Integer a : amb) {
+                        ambStr += Integer.toString(a);
+                    }
+                    sequence.add(codeMapping.indexOf(ambStr));
+                }
+
+            }
+
+        }
+
+        return sequence;
+    } // string2state
+
+    @Override
+    public String getTypeDescription() {
+        return "standard";
+    }
+
+    @Override
+    public char getChar(int state) {
+        if (state < 0) {
+            return '?';
+        }
+        return (char)('0'+state);
+    }
+    
+    @Override
+    public String getCode(int state) {
+    	return codeMapping.get(state);
+    }
+
+//    @Description("A class to store the description of a character")
+//    public class CharStateLabels extends BEASTObject {
+//
+//        public Input<Integer> nrOfStatesInput = new Input<Integer>("states", "number of states fro this character");
+//        public Input<String> characterNameInput = new Input<>("characterName", "the name of the charcter");
+//        public Input<List<String>> stateNamesInput = new Input<>("stateNames", "the list of the state names ordered " +
+//                "according to codes given, that is the first in the list is coded by 0, second, by 1 and so forth.", new ArrayList<>());
+//
+//        private int nrOfStates;
+//        private String charName;
+//        private ArrayList<String> stateNames;
+//
+//        public CharStateLabels(String newCharName, ArrayList<String> newStateNames) {
+//            characterNameInput.setValue(newCharName, this);
+//            charName = newCharName;
+//            stateNamesInput.setValue(newStateNames, this);
+//            stateNames = newStateNames;
+//            nrOfStates = stateNames.size();
+//            nrOfStatesInput.setValue(nrOfStates, this);
+//        }
+//
+//        public int getNrOfStates() {
+//            return nrOfStates;
+//        }
+//
+//        public String getCharacterName() {
+//            return charName;
+//        }
+//
+//        public ArrayList<String> getStateNames() { return stateNames; }
+//
+//        @Override
+//        public void initAndValidate() throws Exception {
+//        }
+//
+//    }
+}
diff --git a/src/beast/evolution/datatype/TwoStateCovarion.java b/src/beast/evolution/datatype/TwoStateCovarion.java
new file mode 100644
index 0000000..f4ac727
--- /dev/null
+++ b/src/beast/evolution/datatype/TwoStateCovarion.java
@@ -0,0 +1,35 @@
+package beast.evolution.datatype;
+
+import beast.core.Description;
+import beast.evolution.datatype.DataType.Base;
+
+ at Description("Datatype for two state covarion sequences")
+public class TwoStateCovarion extends Base {
+    int[][] x = {
+            {0, 2},  // 0
+            {1, 3},  // 1
+            {0},  // a
+            {1},  // b
+            {2},  // c
+            {3},  // d
+            {0, 1, 2, 3},  // -
+            {0, 1, 2, 3},  // ?
+    };
+
+    public TwoStateCovarion() {
+        stateCount = 4;
+        mapCodeToStateSet = x;
+        codeLength = 1;
+        codeMap = "01abcd" + GAP_CHAR + MISSING_CHAR;
+    }
+
+    @Override
+    public String getTypeDescription() {
+        return "twoStateCovarion";
+    }
+
+    @Override
+    public char getChar(int state) {
+        return codeMap.charAt(state);
+    }
+}
diff --git a/src/beast/evolution/datatype/UserDataType.java b/src/beast/evolution/datatype/UserDataType.java
new file mode 100644
index 0000000..8fdd295
--- /dev/null
+++ b/src/beast/evolution/datatype/UserDataType.java
@@ -0,0 +1,110 @@
+package beast.evolution.datatype;
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.Input.Validate;
+import beast.evolution.datatype.DataType.Base;
+
+
+
+ at Description("User defined datatype. Allows custom symbols to map onto statesets.")
+public class UserDataType extends Base {
+    public Input<Integer> stateCountInput = new Input<Integer>("states", "total number of states", Validate.REQUIRED);
+    public Input<Integer> codeLengthInput = new Input<Integer>("codelength", "length of code, if negative a variable length code is assumed, default 1", 1);
+    public Input<String> codeMapInput = new Input<String>("codeMap", "mapping of codes to states. " +
+            "A comma separated string of codes with a subset of states. " +
+            "A state set is a space separates list of zero based integers, up to the number of states, " +
+            "e.g. A=0, C=1, R=0 2, ? = 0 1 2 3", Validate.REQUIRED);
+    
+    public Input<String> characterNameInput = new Input<>("characterName", "the name of the character");
+    public Input<String> stateNamesInput = new Input<>("value", "the list of the state names ordered " +
+    		"according to codes given, that is the first in the list is coded by 0, second, by 1 and so forth.");
+
+    public UserDataType() {} // default c'tor
+    public UserDataType(String newCharName, ArrayList<String> newStateNames) {
+        characterNameInput.setValue(newCharName, this);
+        if (newStateNames.size() > 0) {
+            StringBuilder buf = new StringBuilder();
+            for (int i = 0; i < newStateNames.size(); i++) {
+                buf.append(i + "=" + i +", ");
+            }
+            buf.append("? =");
+            for (int i = 0; i < newStateNames.size(); i++) {
+                buf.append(i +" ");
+            }
+            codeMapInput.setValue(buf.toString(), this);
+            buf = new StringBuilder();
+            for (int i = 0; i < newStateNames.size(); i++) {
+                buf.append(newStateNames.get(i) +", ");
+            }
+            buf.delete(buf.length()-2, buf.length());
+            stateNamesInput.setValue(buf.toString(), this);
+            stateCountInput.setValue(newStateNames.size(), this);
+        } else {
+            codeMapInput.setValue("", this);
+            stateNamesInput.setValue("", this);
+            stateCountInput.setValue(-1, this);
+        }
+    }
+    
+    @Override
+    public void initAndValidate() throws Exception {
+        stateCount = stateCountInput.get();
+        codeLength = codeLengthInput.get();
+
+        String sCodeMap = codeMapInput.get();
+        if (!codeMapInput.get().equals("")) {
+            String[] sStrs = sCodeMap.split(",");
+            codeMap = "";
+            mapCodeToStateSet = new int[sStrs.length][];
+            int k = 0;
+            for (String sStr : sStrs) {
+                String[] sStrs2 = sStr.split("=");
+                // parse the code
+                String sCode = sStrs2[0].replaceAll("\\s", "");
+
+                codeMap += sCode;
+                if (codeLength > 0) {
+                    if (sCode.length() != codeLength) {
+                        throw new Exception("Invalide code '" + sCode + "'. Expected code of length " + codeLength);
+                    }
+                } else {
+                    codeMap += ",";
+                }
+                // parse the state set
+                List<Integer> stateSet = new ArrayList<Integer>();
+                sStrs2 = sStrs2[1].split("\\s+");
+                for (String sStr2 : sStrs2) {
+                    if (sStr2.length() > 0) {
+                        int i = Integer.parseInt(sStr2);
+                        if (i < 0 || (stateCount > 0 && i >= stateCount)) {
+                            throw new Exception("state index should be from 0 to statecount, not " + i);
+                        }
+                        stateSet.add(i);
+                    }
+                }
+
+                int[] stateSet2 = new int[stateSet.size()];
+                for (int i = 0; i < stateSet.size(); i++) {
+                    stateSet2[i] = stateSet.get(i);
+                }
+                mapCodeToStateSet[k++] = stateSet2;
+            }
+        }
+    }
+
+    @Override
+    public String getCode(int state) {
+        return String.valueOf(codeMap.split(",")[state]);
+    }
+
+    @Override
+    public String getTypeDescription() {
+        return "user defined";
+    }
+
+}
\ No newline at end of file
diff --git a/src/beast/evolution/likelihood/BeagleTreeLikelihood.java b/src/beast/evolution/likelihood/BeagleTreeLikelihood.java
new file mode 100644
index 0000000..6250d8c
--- /dev/null
+++ b/src/beast/evolution/likelihood/BeagleTreeLikelihood.java
@@ -0,0 +1,1032 @@
+/*
+ * TreeLikelihood.java
+ *
+ * Copyright (C) 2002-2006 Alexei Drummond and Andrew Rambaut
+ *
+ * This file is part of BEAST.
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership and licensing.
+ *
+ * BEAST 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
+ * of the License, or (at your option) any later version.
+ *
+ *  BEAST 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 BEAST; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+package beast.evolution.likelihood;
+
+import beagle.*;
+import beast.core.Description;
+import beast.evolution.alignment.Alignment;
+import beast.evolution.branchratemodel.StrictClockModel;
+import beast.evolution.sitemodel.SiteModel;
+import beast.evolution.substitutionmodel.EigenDecomposition;
+import beast.evolution.tree.Node;
+import beast.evolution.tree.Tree;
+
+import java.util.*;
+
+
+/**
+ * BeagleTreeLikelihoodModel - implements a Likelihood Function for sequences on a tree.
+ *
+ * @author Andrew Rambaut
+ * @author Alexei Drummond
+ * @author Marc Suchard
+ * @version $Id$
+ */
+
+ at Description("Uses Beagle library to calculate Tree likelihood")
+public class BeagleTreeLikelihood extends TreeLikelihood {
+
+    // This property is a comma-delimited list of resource numbers (0 == CPU) to
+    // allocate each BEAGLE instance to. If less than the number of instances then
+    // will wrap around.
+    // note: to use a different device, say device 2, start beast with
+    // java -Dbeagle.resource.order=2 beast.app.BeastMCMC
+    private static final String RESOURCE_ORDER_PROPERTY = "beagle.resource.order";
+    private static final String PREFERRED_FLAGS_PROPERTY = "beagle.preferred.flags";
+    private static final String REQUIRED_FLAGS_PROPERTY = "beagle.required.flags";
+    private static final String SCALING_PROPERTY = "beagle.scaling";
+    private static final String RESCALE_FREQUENCY_PROPERTY = "beagle.rescale";
+    // Which scheme to use if choice not specified (or 'default' is selected):
+    private static final PartialsRescalingScheme DEFAULT_RESCALING_SCHEME = PartialsRescalingScheme.DYNAMIC;
+
+    private static int instanceCount = 0;
+    private static List<Integer> resourceOrder = null;
+    private static List<Integer> preferredOrder = null;
+    private static List<Integer> requiredOrder = null;
+    private static List<String> scalingOrder = null;
+
+    private static final int RESCALE_FREQUENCY = 10000;
+    private static final int RESCALE_TIMES = 1;
+
+    boolean m_bUseAmbiguities, m_bUseTipLikelihoods;
+    int m_nStateCount;
+    int m_nNodeCount;
+
+    @Override
+    public void initAndValidate() throws Exception {
+        boolean forceJava = Boolean.valueOf(System.getProperty("java.only"));
+        if (forceJava) {
+        	return;
+        }
+        initialize();
+    }
+
+    private boolean initialize() throws Exception {
+        m_nNodeCount = treeInput.get().getNodeCount();
+        m_bUseAmbiguities = m_useAmbiguities.get();
+        m_bUseTipLikelihoods = m_useTipLikelihoods.get();
+        if (!(siteModelInput.get() instanceof SiteModel.Base)) {
+        	throw new Exception ("siteModel input should be of type SiteModel.Base");
+        }
+        m_siteModel = (SiteModel.Base) siteModelInput.get();
+        m_siteModel.setDataType(dataInput.get().getDataType());
+        substitutionModel = m_siteModel.substModelInput.get();
+        branchRateModel = branchRateModelInput.get();
+        if (branchRateModel == null) {
+        	branchRateModel = new StrictClockModel();
+        }
+        m_branchLengths = new double[m_nNodeCount];
+        storedBranchLengths = new double[m_nNodeCount];
+
+        m_nStateCount = dataInput.get().getMaxStateCount();
+        patternCount = dataInput.get().getPatternCount();
+
+        //System.err.println("Attempt to load BEAGLE TreeLikelihood");
+
+        eigenCount = 1;//this.branchSubstitutionModel.getEigenCount();
+
+        this.categoryCount = m_siteModel.getCategoryCount();
+        tipCount = treeInput.get().getLeafNodeCount();
+
+        internalNodeCount = m_nNodeCount - tipCount;
+
+        int compactPartialsCount = tipCount;
+        if (m_bUseAmbiguities) {
+            // if we are using ambiguities then we don't use tip partials
+            compactPartialsCount = 0;
+        }
+
+        // one partials buffer for each tip and two for each internal node (for store restore)
+        partialBufferHelper = new BufferIndexHelper(m_nNodeCount, tipCount);
+
+        // two eigen buffers for each decomposition for store and restore.
+        eigenBufferHelper = new BufferIndexHelper(eigenCount, 0);
+
+        // two matrices for each node less the root
+        matrixBufferHelper = new BufferIndexHelper(m_nNodeCount, 0);
+
+        // one scaling buffer for each internal node plus an extra for the accumulation, then doubled for store/restore
+        scaleBufferHelper = new BufferIndexHelper(getScaleBufferCount(), 0);
+
+        // Attempt to get the resource order from the System Property
+        if (resourceOrder == null) {
+            resourceOrder = parseSystemPropertyIntegerArray(RESOURCE_ORDER_PROPERTY);
+        }
+        if (preferredOrder == null) {
+            preferredOrder = parseSystemPropertyIntegerArray(PREFERRED_FLAGS_PROPERTY);
+        }
+        if (requiredOrder == null) {
+            requiredOrder = parseSystemPropertyIntegerArray(REQUIRED_FLAGS_PROPERTY);
+        }
+        if (scalingOrder == null) {
+            scalingOrder = parseSystemPropertyStringArray(SCALING_PROPERTY);
+        }
+
+        // first set the rescaling scheme to use from the parser
+        rescalingScheme = PartialsRescalingScheme.DEFAULT;// = rescalingScheme;
+        rescalingScheme = DEFAULT_RESCALING_SCHEME;
+        int[] resourceList = null;
+        long preferenceFlags = 0;
+        long requirementFlags = 0;
+
+        if (scalingOrder.size() > 0) {
+            this.rescalingScheme = PartialsRescalingScheme.parseFromString(
+                    scalingOrder.get(instanceCount % scalingOrder.size()));
+        }
+
+        if (resourceOrder.size() > 0) {
+            // added the zero on the end so that a CPU is selected if requested resource fails
+            resourceList = new int[]{resourceOrder.get(instanceCount % resourceOrder.size()), 0};
+            if (resourceList[0] > 0) {
+                preferenceFlags |= BeagleFlag.PROCESSOR_GPU.getMask(); // Add preference weight against CPU
+            }
+        }
+
+        if (preferredOrder.size() > 0) {
+            preferenceFlags = preferredOrder.get(instanceCount % preferredOrder.size());
+        }
+
+        if (requiredOrder.size() > 0) {
+            requirementFlags = requiredOrder.get(instanceCount % requiredOrder.size());
+        }
+
+        if (scaling.get().equals(Scaling.always)) {
+        	this.rescalingScheme = PartialsRescalingScheme.ALWAYS;
+        }
+        if (scaling.get().equals(Scaling.none)) {
+        	this.rescalingScheme = PartialsRescalingScheme.NONE;
+        }
+        
+        // Define default behaviour here
+        if (this.rescalingScheme == PartialsRescalingScheme.DEFAULT) {
+            //if GPU: the default is^H^Hwas dynamic scaling in BEAST, now NONE
+            if (resourceList != null && resourceList[0] > 1) {
+                //this.rescalingScheme = PartialsRescalingScheme.DYNAMIC;
+                this.rescalingScheme = PartialsRescalingScheme.NONE;
+            } else { // if CPU: just run as fast as possible
+                //this.rescalingScheme = PartialsRescalingScheme.NONE;
+                // Dynamic should run as fast as none until first underflow
+                this.rescalingScheme = PartialsRescalingScheme.DYNAMIC;
+            }
+        }
+
+        if (this.rescalingScheme == PartialsRescalingScheme.AUTO) {
+            preferenceFlags |= BeagleFlag.SCALING_AUTO.getMask();
+            useAutoScaling = true;
+        } else {
+//                preferenceFlags |= BeagleFlag.SCALING_MANUAL.getMask();
+        }
+        String r = System.getProperty(RESCALE_FREQUENCY_PROPERTY);
+        if (r != null) {
+            rescalingFrequency = Integer.parseInt(r);
+            if (rescalingFrequency < 1) {
+                rescalingFrequency = RESCALE_FREQUENCY;
+            }
+        }
+
+        if (preferenceFlags == 0 && resourceList == null) { // else determine dataset characteristics
+            if (m_nStateCount == 4 && patternCount < 10000) // TODO determine good cut-off
+                preferenceFlags |= BeagleFlag.PROCESSOR_CPU.getMask();
+        }
+
+        if (substitutionModel.canReturnComplexDiagonalization()) {
+            requirementFlags |= BeagleFlag.EIGEN_COMPLEX.getMask();
+        }
+
+        instanceCount++;
+
+        try {
+	        beagle = BeagleFactory.loadBeagleInstance(
+	                tipCount,
+	                partialBufferHelper.getBufferCount(),
+	                compactPartialsCount,
+	                m_nStateCount,
+	                patternCount,
+	                eigenBufferHelper.getBufferCount(),            // eigenBufferCount
+	                matrixBufferHelper.getBufferCount(),
+	                categoryCount,
+	                scaleBufferHelper.getBufferCount(), // Always allocate; they may become necessary
+	                resourceList,
+	                preferenceFlags,
+	                requirementFlags
+	        );
+        } catch (Exception e) {
+        	beagle = null;
+        }
+        if (beagle == null) {
+            return false;
+        }
+
+        InstanceDetails instanceDetails = beagle.getDetails();
+        ResourceDetails resourceDetails = null;
+
+        if (instanceDetails != null) {
+            resourceDetails = BeagleFactory.getResourceDetails(instanceDetails.getResourceNumber());
+            if (resourceDetails != null) {
+                StringBuilder sb = new StringBuilder("  Using BEAGLE version: " + BeagleInfo.getVersion()
+                		+ " resource ");
+                sb.append(resourceDetails.getNumber()).append(": ");
+                sb.append(resourceDetails.getName()).append("\n");
+                if (resourceDetails.getDescription() != null) {
+                    String[] description = resourceDetails.getDescription().split("\\|");
+                    for (String desc : description) {
+                        if (desc.trim().length() > 0) {
+                            sb.append("    ").append(desc.trim()).append("\n");
+                        }
+                    }
+                }
+                sb.append("    with instance flags: ").append(instanceDetails.toString());
+                System.out.println(sb.toString());
+            } else {
+                System.err.println("  Error retrieving BEAGLE resource for instance: " + instanceDetails.toString());
+                beagle = null;
+                return false;
+            }
+        } else {
+            System.err.println("  No external BEAGLE resources available, or resource list/requirements not met, using Java implementation");
+            beagle = null;
+            return false;
+        }
+        System.err.println("  " + (m_bUseAmbiguities ? "Using" : "Ignoring") + " ambiguities in tree likelihood.");
+        System.err.println("  " + (m_bUseTipLikelihoods ? "Using" : "Ignoring") + " character uncertainty in tree likelihood.");
+        System.err.println("  With " + patternCount + " unique site patterns.");
+
+        
+        Node [] nodes = treeInput.get().getNodesAsArray();
+        for (int i = 0; i < tipCount; i++) {
+        	int taxon = dataInput.get().getTaxonIndex(nodes[i].getID()); 
+            if (m_bUseAmbiguities || m_bUseTipLikelihoods) {
+                setPartials(beagle, i, taxon);
+            } else {
+                setStates(beagle, i, taxon);
+            }
+        }
+
+        if (dataInput.get().isAscertained) {
+            ascertainedSitePatterns = true;
+        }
+
+        double[] fPatternWeights = new double[patternCount];
+        for (int i = 0; i < patternCount; i++) {
+            fPatternWeights[i] = dataInput.get().getPatternWeight(i);
+        }
+        beagle.setPatternWeights(fPatternWeights);
+
+        if (this.rescalingScheme == PartialsRescalingScheme.AUTO &&
+                resourceDetails != null &&
+                (resourceDetails.getFlags() & BeagleFlag.SCALING_AUTO.getMask()) == 0) {
+            // If auto scaling in BEAGLE is not supported then do it here
+            this.rescalingScheme = PartialsRescalingScheme.DYNAMIC;
+            System.err.println("  Auto rescaling not supported in BEAGLE, using : " + this.rescalingScheme.getText());
+        } else {
+            System.err.println("  Using rescaling scheme : " + this.rescalingScheme.getText());
+        }
+
+        if (this.rescalingScheme == PartialsRescalingScheme.DYNAMIC) {
+            everUnderflowed = false; // If false, BEAST does not rescale until first under-/over-flow.
+        }
+
+        updateSubstitutionModel = true;
+        updateSiteModel = true;
+        // some subst models (e.g. WAG) never become dirty, so set up subst models right now
+        setUpSubstModel();
+        // set up sitemodel
+        double[] categoryRates = m_siteModel.getCategoryRates(null);
+        beagle.setCategoryRates(categoryRates);
+
+
+//            m_fProportionInvariant = m_siteModel.getProportianInvariant();
+//            double [] fProportionInvariantCorrection = new double[m_nPatternCount * m_nStateCount];
+//            if (!SiteModel.g_bUseOriginal && m_fProportionInvariant > 0) {
+//            	calcConstantPatternIndices(m_nPatternCount, m_nStateCount);
+//            	for (int i : m_iConstantPattern) {
+//            		fProportionInvariantCorrection[i] = m_fProportionInvariant;
+//            	}
+//            }
+//            beagle.setProportionInvariantCorrection(fProportionInvariantCorrection);
+        return true;
+    }
+
+    private static List<Integer> parseSystemPropertyIntegerArray(String propertyName) {
+        List<Integer> order = new ArrayList<Integer>();
+        String r = System.getProperty(propertyName);
+        if (r != null) {
+            String[] parts = r.split(",");
+            for (String part : parts) {
+                try {
+                    int n = Integer.parseInt(part.trim());
+                    order.add(n);
+                } catch (NumberFormatException nfe) {
+                    System.err.println("Invalid entry '" + part + "' in " + propertyName);
+                }
+            }
+        }
+        return order;
+    }
+
+    private static List<String> parseSystemPropertyStringArray(String propertyName) {
+
+        List<String> order = new ArrayList<String>();
+
+        String r = System.getProperty(propertyName);
+        if (r != null) {
+            String[] parts = r.split(",");
+            for (String part : parts) {
+                try {
+                    String s = part.trim();
+                    order.add(s);
+                } catch (NumberFormatException nfe) {
+                    System.err.println("Invalid getEigenDecompositionentry '" + part + "' in " + propertyName);
+                }
+            }
+        }
+        return order;
+    }
+    
+    
+    protected int getScaleBufferCount() {
+        return internalNodeCount + 1;
+    }
+
+    /**
+     * Sets the partials from a sequence in an alignment.
+     *
+     * @param beagle        beagle
+     * @param nodeIndex     nodeIndex
+     * @param taxon the taxon
+     */
+    protected final void setPartials(Beagle beagle,
+                                     int nodeIndex, int taxon) {
+        Alignment data = dataInput.get();
+
+        double[] partials = new double[patternCount * m_nStateCount * categoryCount];
+
+        int v = 0;
+        for (int i = 0; i < patternCount; i++) {
+
+        	double[] tipProbabilities = data.getTipLikelihoods(taxon,i);
+            if (tipProbabilities != null) {
+            	for (int iState = 0; iState < m_nStateCount; iState++) {
+            		partials[v++] = tipProbabilities[iState];
+            	}
+            }
+            else {
+            	int nState = data.getPattern(taxon, i);
+                boolean[] stateSet = data.getStateSet(nState);
+                for (int iState = 0; iState < m_nStateCount; iState++) {
+                	 partials[v++] = (stateSet[iState] ? 1.0 : 0.0);                
+                }
+            }
+        }
+
+        // if there is more than one category then replicate the partials for each
+        int n = patternCount * m_nStateCount;
+        int k = n;
+        for (int i = 1; i < categoryCount; i++) {
+            System.arraycopy(partials, 0, partials, k, n);
+            k += n;
+        }
+
+        beagle.setPartials(nodeIndex, partials);
+    }
+
+    public int getPatternCount() {
+        return patternCount;
+    }
+
+    void setUpSubstModel() {
+        // we are currently assuming a no-category model...
+        // TODO More efficient to update only the substitution model that changed, instead of all
+        for (int i = 0; i < eigenCount; i++) {
+            //EigenDecomposition ed = m_substitutionModel.getEigenDecomposition(i, 0);
+            EigenDecomposition ed = substitutionModel.getEigenDecomposition(null);
+
+            eigenBufferHelper.flipOffset(i);
+
+            beagle.setEigenDecomposition(
+                    eigenBufferHelper.getOffsetIndex(i),
+                    ed.getEigenVectors(),
+                    ed.getInverseEigenVectors(),
+                    ed.getEigenValues());
+        }
+    }
+
+    /**
+     * Sets the partials from a sequence in an alignment.
+     *
+     * @param beagle        beagle
+     * @param nodeIndex     nodeIndex
+     * @param taxon         the taxon
+     */
+    protected final void setStates(Beagle beagle,
+                                   int nodeIndex, int taxon) {
+        Alignment data = dataInput.get();
+        int i;
+
+        int[] states = new int[patternCount];
+
+        for (i = 0; i < patternCount; i++) {
+            int state = data.getPattern(taxon, i);
+            states[i] = state;
+        }
+
+        beagle.setTipStates(nodeIndex, states);
+    }
+
+
+//    public void setStates(int tipIndex, int[] states) {
+//        System.err.println("BTL:setStates");
+//        beagle.setTipStates(tipIndex, states);
+//        makeDirty();
+//    }
+//
+//    public void getStates(int tipIndex, int[] states) {
+//        System.err.println("BTL:getStates");
+//        beagle.getTipStates(tipIndex, states);
+//    }
+
+
+    /**
+     * check state for changed variables and update temp results if necessary *
+     */
+    @Override
+    protected boolean requiresRecalculation() {
+        hasDirt = Tree.IS_CLEAN;
+
+        updateSiteModel |= m_siteModel.isDirtyCalculation();
+        updateSubstitutionModel |= substitutionModel.isDirtyCalculation();
+
+        if (dataInput.get().isDirtyCalculation()) {
+            hasDirt = Tree.IS_FILTHY;
+            return true;
+        }
+        if (m_siteModel.isDirtyCalculation()) {
+            hasDirt = Tree.IS_DIRTY;
+            return true;
+        }
+        if (branchRateModel != null && branchRateModel.isDirtyCalculation()) {
+            //m_nHasDirt = Tree.IS_FILTHY;
+            return true;
+        }
+
+        return treeInput.get().somethingIsDirty();
+    }
+
+    /**
+     * Stores the additional state other than model components
+     */
+    @Override
+    public void store() {
+        partialBufferHelper.storeState();
+        eigenBufferHelper.storeState();
+        matrixBufferHelper.storeState();
+
+        if (useScaleFactors || useAutoScaling) { // Only store when actually used
+            scaleBufferHelper.storeState();
+            System.arraycopy(scaleBufferIndices, 0, storedScaleBufferIndices, 0, scaleBufferIndices.length);
+//            storedRescalingCount = rescalingCount;
+        }
+        super.store();
+        System.arraycopy(m_branchLengths, 0, storedBranchLengths, 0, m_branchLengths.length);
+    }
+
+    @Override
+    public void restore() {
+        updateSiteModel = true; // this is required to upload the categoryRates to BEAGLE after the restore
+
+        partialBufferHelper.restoreState();
+        eigenBufferHelper.restoreState();
+        matrixBufferHelper.restoreState();
+
+        if (useScaleFactors || useAutoScaling) {
+            scaleBufferHelper.restoreState();
+            int[] tmp2 = storedScaleBufferIndices;
+            storedScaleBufferIndices = scaleBufferIndices;
+            scaleBufferIndices = tmp2;
+//            rescalingCount = storedRescalingCount;
+        }
+
+//        updateRestrictedNodePartials = true;
+        super.restore();
+        //double[] tmp = m_branchLengths;
+        //m_branchLengths = storedBranchLengths;
+        //storedBranchLengths = tmp;
+    }
+
+    // **************************************************************
+    // Likelihood IMPLEMENTATION
+    // **************************************************************
+
+    /**
+     * Calculate the log likelihood of the current state.
+     *
+     * @return the log likelihood.
+     */
+    @Override
+    public double calculateLogP() throws Exception {
+
+        if (patternLogLikelihoods == null) {
+            patternLogLikelihoods = new double[patternCount];
+        }
+
+        if (matrixUpdateIndices == null) {
+            matrixUpdateIndices = new int[eigenCount][m_nNodeCount];
+            branchLengths = new double[eigenCount][m_nNodeCount];
+            branchUpdateCount = new int[eigenCount];
+            scaleBufferIndices = new int[internalNodeCount];
+            storedScaleBufferIndices = new int[internalNodeCount];
+        }
+
+        if (operations == null) {
+            operations = new int[1][internalNodeCount * Beagle.OPERATION_TUPLE_SIZE];
+            operationCount = new int[1];
+        }
+
+        recomputeScaleFactors = false;
+
+        if (this.rescalingScheme == PartialsRescalingScheme.ALWAYS) {
+            useScaleFactors = true;
+            recomputeScaleFactors = true;
+        } else if (this.rescalingScheme == PartialsRescalingScheme.DYNAMIC && everUnderflowed) {
+            useScaleFactors = true;
+            if (rescalingCountInner < RESCALE_TIMES) {
+                recomputeScaleFactors = true;
+                hasDirt = Tree.IS_FILTHY;// makeDirty();
+//                System.err.println("Recomputing scale factors");
+            }
+
+            rescalingCountInner++;
+            rescalingCount++;
+            if (rescalingCount > RESCALE_FREQUENCY) {
+                rescalingCount = 0;
+                rescalingCountInner = 0;
+            }
+        } else if (this.rescalingScheme == PartialsRescalingScheme.DELAYED && everUnderflowed) {
+            useScaleFactors = true;
+            recomputeScaleFactors = true;
+            hasDirt = Tree.IS_FILTHY;
+            rescalingCount++;
+        }
+
+        for (int i = 0; i < eigenCount; i++) {
+            branchUpdateCount[i] = 0;
+        }
+        operationListCount = 0;
+
+        operationCount[0] = 0;
+
+        final Node root = treeInput.get().getRoot();
+        traverse(root, null, true);
+
+        if (updateSubstitutionModel) {
+            setUpSubstModel();
+        }
+
+        if (updateSiteModel) {
+            double[] categoryRates = m_siteModel.getCategoryRates(null);
+            beagle.setCategoryRates(categoryRates);
+        }
+
+        for (int i = 0; i < eigenCount; i++) {
+            if (branchUpdateCount[i] > 0) {
+                beagle.updateTransitionMatrices(
+                        eigenBufferHelper.getOffsetIndex(i),
+                        matrixUpdateIndices[i],
+                        null,
+                        null,
+                        branchLengths[i],
+                        branchUpdateCount[i]);
+            }
+        }
+
+//        if (COUNT_TOTAL_OPERATIONS) {
+//            for (int i = 0; i < eigenCount; i++) {
+//                totalMatrixUpdateCount += branchUpdateCount[i];
+//            }
+//            
+//            for (int i = 0; i <= numRestrictedPartials; i++) {
+//                totalOperationCount += operationCount[i];
+//            }
+//        }
+
+        double logL;
+        boolean done;
+        boolean firstRescaleAttempt = true;
+
+        do {
+
+            beagle.updatePartials(operations[0], operationCount[0], Beagle.NONE);
+
+            int rootIndex = partialBufferHelper.getOffsetIndex(root.getNr());
+
+            double[] categoryWeights = m_siteModel.getCategoryProportions(null);
+            double[] frequencies = substitutionModel.getFrequencies();
+
+            int cumulateScaleBufferIndex = Beagle.NONE;
+            if (useScaleFactors) {
+
+                if (recomputeScaleFactors) {
+                    scaleBufferHelper.flipOffset(internalNodeCount);
+                    cumulateScaleBufferIndex = scaleBufferHelper.getOffsetIndex(internalNodeCount);
+                    beagle.resetScaleFactors(cumulateScaleBufferIndex);
+                    beagle.accumulateScaleFactors(scaleBufferIndices, internalNodeCount, cumulateScaleBufferIndex);
+                } else {
+                    cumulateScaleBufferIndex = scaleBufferHelper.getOffsetIndex(internalNodeCount);
+                }
+            } else if (useAutoScaling) {
+                beagle.accumulateScaleFactors(scaleBufferIndices, internalNodeCount, Beagle.NONE);
+            }
+
+            // these could be set only when they change but store/restore would need to be considered
+            beagle.setCategoryWeights(0, categoryWeights);
+            beagle.setStateFrequencies(0, frequencies);
+
+            double[] sumLogLikelihoods = new double[1];
+
+            beagle.calculateRootLogLikelihoods(new int[]{rootIndex}, new int[]{0}, new int[]{0},
+                    new int[]{cumulateScaleBufferIndex}, 1, sumLogLikelihoods);
+
+            logL = sumLogLikelihoods[0];
+
+            if (ascertainedSitePatterns) {
+                // Need to correct for ascertainedSitePatterns
+                beagle.getSiteLogLikelihoods(patternLogLikelihoods);
+                logL = getAscertainmentCorrectedLogLikelihood(dataInput.get(),
+                        patternLogLikelihoods, dataInput.get().getWeights());
+            }
+
+            if (Double.isNaN(logL) || Double.isInfinite(logL)) {
+                everUnderflowed = true;
+                logL = Double.NEGATIVE_INFINITY;
+
+                if (firstRescaleAttempt && (rescalingScheme == PartialsRescalingScheme.DYNAMIC || rescalingScheme == PartialsRescalingScheme.DELAYED)) {
+                    // we have had a potential under/over flow so attempt a rescaling                	
+                	useScaleFactors = true;
+                    recomputeScaleFactors = true;
+
+                    for (int i = 0; i < eigenCount; i++) {
+                        branchUpdateCount[i] = 0;
+                    }
+
+                    operationCount[0] = 0;
+
+                    // traverse again but without flipping partials indices as we
+                    // just want to overwrite the last attempt. We will flip the
+                    // scale buffer indices though as we are recomputing them.
+                    traverse(root, null, false);
+
+                    done = false; // Run through do-while loop again
+                    firstRescaleAttempt = false; // Only try to rescale once
+                } else {
+                    // we have already tried a rescale, not rescaling or always rescaling
+                    // so just return the likelihood...
+                    done = true;
+                }
+            } else {
+                done = true; // No under-/over-flow, then done
+            }
+
+        } while (!done);
+
+        // If these are needed...
+        //beagle.getSiteLogLikelihoods(patternLogLikelihoods);
+
+        //********************************************************************
+        // after traverse all nodes and patterns have been updated --
+        //so change flags to reflect this.
+//        for (int i = 0; i < m_nNodeCount; i++) {
+//            updateNode[i] = false;
+//        }
+
+        updateSubstitutionModel = false;
+        updateSiteModel = false;
+        //********************************************************************
+
+        logP = logL;
+        return logL;
+    }
+
+//    protected void getPartials(int number, double[] partials) {
+//        int cumulativeBufferIndex = Beagle.NONE;
+//        /* No need to rescale partials */
+//        beagle.getPartials(partialBufferHelper.getOffsetIndex(number), cumulativeBufferIndex, partials);
+//    }
+
+    protected void setPartials(int number, double[] partials) {
+        beagle.setPartials(partialBufferHelper.getOffsetIndex(number), partials);
+    }
+
+    private double getAscertainmentCorrectedLogLikelihood(Alignment patternList,
+                                                          double[] patternLogLikelihoods,
+                                                          int[] patternWeights) {
+        double logL = 0.0;
+        double ascertainmentCorrection = patternList.getAscertainmentCorrection(patternLogLikelihoods);
+        for (int i = 0; i < patternCount; i++) {
+            logL += (patternLogLikelihoods[i] - ascertainmentCorrection) * patternWeights[i];
+        }
+        return logL;
+    }
+
+    /**
+     * Traverse the tree calculating partial likelihoods.
+     *
+     * @param node           node
+     * @param operatorNumber operatorNumber
+     * @param flip           flip
+     * @return boolean
+     */
+    private int traverse(Node node, int[] operatorNumber, boolean flip) {
+
+        int nodeNum = node.getNr();
+
+        Node parent = node.getParent();
+
+        if (operatorNumber != null) {
+            operatorNumber[0] = -1;
+        }
+
+        // First update the transition probability matrix(ices) for this branch
+        int update = (node.isDirty() | hasDirt);
+//        if (parent!=null) {
+//        	update |= parent.isDirty();
+//        }
+        final double branchRate = branchRateModel.getRateForBranch(node);
+        final double branchTime = node.getLength() * branchRate;
+        if (!node.isRoot() && (update != Tree.IS_CLEAN || branchTime != m_branchLengths[nodeNum])) {
+            m_branchLengths[nodeNum] = branchTime;
+            if (branchTime < 0.0) {
+                throw new RuntimeException("Negative branch length: " + branchTime);
+            }
+
+            if (flip) {
+                // first flip the matrixBufferHelper
+                matrixBufferHelper.flipOffset(nodeNum);
+            }
+
+            // then set which matrix to update
+            final int eigenIndex = 0;// = m_substitutionModel.getBranchIndex(node);
+            final int updateCount = branchUpdateCount[eigenIndex];
+            matrixUpdateIndices[eigenIndex][updateCount] = matrixBufferHelper.getOffsetIndex(nodeNum);
+
+//            if (!m_substitutionModel.canReturnDiagonalization()) {
+//            	m_substitutionModel.getTransitionProbabilities(node, parent.getHeight(), node.getHeight(), branchRate, m_fProbabilities);
+//            	int matrixIndex = matrixBufferHelper.getOffsetIndex(nodeNum);
+//            	beagle.setTransitionMatrix(matrixIndex, m_fProbabilities, 1);
+//            }
+
+            branchLengths[eigenIndex][updateCount] = branchTime;
+            branchUpdateCount[eigenIndex]++;
+
+            update |= Tree.IS_DIRTY;
+        }
+
+        // If the node is internal, update the partial likelihoods.
+        if (!node.isLeaf()) {
+
+            // Traverse down the two child nodes
+            Node child1 = node.getLeft();
+            final int[] op1 = {-1};
+            final int update1 = traverse(child1, op1, flip);
+
+            Node child2 = node.getRight();
+            final int[] op2 = {-1};
+            final int update2 = traverse(child2, op2, flip);
+
+            // If either child node was updated then update this node too
+            if (update1 != Tree.IS_CLEAN || update2 != Tree.IS_CLEAN) {
+
+                int x = operationCount[operationListCount] * Beagle.OPERATION_TUPLE_SIZE;
+
+                if (flip) {
+                    // first flip the partialBufferHelper
+                    partialBufferHelper.flipOffset(nodeNum);
+                }
+
+                final int[] operations = this.operations[operationListCount];
+
+                operations[x] = partialBufferHelper.getOffsetIndex(nodeNum);
+
+                if (useScaleFactors) {
+                    // get the index of this scaling buffer
+                    int n = nodeNum - tipCount;
+
+                    if (recomputeScaleFactors) {
+                        // flip the indicator: can take either n or (internalNodeCount + 1) - n
+                        scaleBufferHelper.flipOffset(n);
+
+                        // store the index
+                        scaleBufferIndices[n] = scaleBufferHelper.getOffsetIndex(n);
+
+                        operations[x + 1] = scaleBufferIndices[n]; // Write new scaleFactor
+                        operations[x + 2] = Beagle.NONE;
+
+                    } else {
+                        operations[x + 1] = Beagle.NONE;
+                        operations[x + 2] = scaleBufferIndices[n]; // Read existing scaleFactor
+                    }
+
+                } else {
+
+                    if (useAutoScaling) {
+                        scaleBufferIndices[nodeNum - tipCount] = partialBufferHelper.getOffsetIndex(nodeNum);
+                    }
+                    operations[x + 1] = Beagle.NONE; // Not using scaleFactors
+                    operations[x + 2] = Beagle.NONE;
+                }
+
+                operations[x + 3] = partialBufferHelper.getOffsetIndex(child1.getNr()); // source node 1
+                operations[x + 4] = matrixBufferHelper.getOffsetIndex(child1.getNr()); // source matrix 1
+                operations[x + 5] = partialBufferHelper.getOffsetIndex(child2.getNr()); // source node 2
+                operations[x + 6] = matrixBufferHelper.getOffsetIndex(child2.getNr()); // source matrix 2
+
+                operationCount[operationListCount]++;
+
+                update |= (update1 | update2);
+
+            }
+        }
+
+        return update;
+
+    }
+
+    // **************************************************************
+    // INSTANCE VARIABLES
+    // **************************************************************
+
+    private int eigenCount;
+    private int[][] matrixUpdateIndices;
+    private double[][] branchLengths;
+    private int[] branchUpdateCount;
+    private int[] scaleBufferIndices;
+    private int[] storedScaleBufferIndices;
+
+    private int[][] operations;
+    private int operationListCount;
+    private int[] operationCount;
+
+    protected BufferIndexHelper partialBufferHelper;
+    private /*final*/ BufferIndexHelper eigenBufferHelper;
+    protected BufferIndexHelper matrixBufferHelper;
+    protected BufferIndexHelper scaleBufferHelper;
+
+    protected /*final*/ int tipCount;
+    protected /*final*/ int internalNodeCount;
+    protected /*final*/ int patternCount;
+
+    private PartialsRescalingScheme rescalingScheme = DEFAULT_RESCALING_SCHEME;
+    private int rescalingFrequency = RESCALE_FREQUENCY;
+    protected boolean useScaleFactors = false;
+    private boolean useAutoScaling = false;
+    private boolean recomputeScaleFactors = false;
+    private boolean everUnderflowed = false;
+    private int rescalingCount = 0;
+    private int rescalingCountInner = 0;
+
+    
+    /**
+     * the pattern likelihoods
+     */
+    protected double[] patternLogLikelihoods = null;
+
+    /**
+     * the number of rate categories
+     */
+    protected int categoryCount;
+
+    /**
+     * an array used to transfer tip partials
+     */
+    protected double[] tipPartials;
+
+    /**
+     * the BEAGLE library instance
+     */
+    protected Beagle beagle;
+
+    /**
+     * Flag to specify that the substitution model has changed
+     */
+    protected boolean updateSubstitutionModel;
+    protected boolean storedUpdateSubstitutionModel;
+
+    /**
+     * Flag to specify that the site model has changed
+     */
+    protected boolean updateSiteModel;
+    protected boolean storedUpdateSiteModel;
+
+    /**
+     * Flag to specify if site patterns are acertained
+     */
+
+    private boolean ascertainedSitePatterns = false;
+
+    protected class BufferIndexHelper {
+        /**
+         * @param maxIndexValue the number of possible input values for the index
+         * @param minIndexValue the minimum index value to have the mirrored buffers
+         */
+        BufferIndexHelper(int maxIndexValue, int minIndexValue) {
+            this.maxIndexValue = maxIndexValue;
+            this.minIndexValue = minIndexValue;
+
+            offsetCount = maxIndexValue - minIndexValue;
+            indexOffsets = new int[offsetCount];
+            storedIndexOffsets = new int[offsetCount];
+        }
+
+        public int getBufferCount() {
+            return 2 * offsetCount + minIndexValue;
+        }
+
+        void flipOffset(int i) {
+            if (i >= minIndexValue) {
+                indexOffsets[i - minIndexValue] = offsetCount - indexOffsets[i - minIndexValue];
+            } // else do nothing
+        }
+
+        int getOffsetIndex(int i) {
+            if (i < minIndexValue) {
+                return i;
+            }
+            return indexOffsets[i - minIndexValue] + i;
+        }
+
+        void getIndices(int[] outIndices) {
+            for (int i = 0; i < maxIndexValue; i++) {
+                outIndices[i] = getOffsetIndex(i);
+            }
+        }
+
+        void storeState() {
+            System.arraycopy(indexOffsets, 0, storedIndexOffsets, 0, indexOffsets.length);
+
+        }
+
+        void restoreState() {
+            int[] tmp = storedIndexOffsets;
+            storedIndexOffsets = indexOffsets;
+            indexOffsets = tmp;
+        }
+
+        private final int maxIndexValue;
+        private final int minIndexValue;
+        private final int offsetCount;
+
+        private int[] indexOffsets;
+        private int[] storedIndexOffsets;
+
+    } // class BufferIndexHelper
+
+    public enum PartialsRescalingScheme {
+        DEFAULT("default"), // whatever our current favourite default is
+        NONE("none"),       // no scaling
+        DYNAMIC("dynamic"), // rescale when needed and reuse scaling factors
+        ALWAYS("always"),   // rescale every node, every site, every time - slow but safe
+        DELAYED("delayed"), // postpone until first underflow then switch to 'always'
+        AUTO("auto");       // BEAGLE automatic scaling - currently playing it safe with 'always'
+//        KICK_ASS("kickAss"),// should be good, probably still to be discovered
+
+        PartialsRescalingScheme(String text) {
+            this.text = text;
+        }
+
+        public String getText() {
+            return text;
+        }
+
+        private final String text;
+
+        public static PartialsRescalingScheme parseFromString(String text) {
+            for (PartialsRescalingScheme scheme : PartialsRescalingScheme.values()) {
+                if (scheme.getText().compareToIgnoreCase(text) == 0)
+                    return scheme;
+            }
+            return DEFAULT;
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/beast/evolution/likelihood/BeerLikelihoodCore.java b/src/beast/evolution/likelihood/BeerLikelihoodCore.java
new file mode 100644
index 0000000..a277c6c
--- /dev/null
+++ b/src/beast/evolution/likelihood/BeerLikelihoodCore.java
@@ -0,0 +1,891 @@
+package beast.evolution.likelihood;
+
+
+/**
+ * standard likelihood core, uses no caching *
+ */
+public class BeerLikelihoodCore extends LikelihoodCore {
+    protected int nrOfStates;
+    protected int nrOfNodes;
+    protected int nrOfPatterns;
+    protected int partialsSize;
+    protected int matrixSize;
+    protected int nrOfMatrices;
+
+    protected boolean integrateCategories;
+
+    protected double[][][] partials;
+
+    protected int[][] states;
+
+    protected double[][][] matrices;
+
+    protected int[] currentMatrixIndex;
+    protected int[] storedMatrixIndex;
+    protected int[] currentPartialsIndex;
+    protected int[] storedPartialsIndex;
+
+    protected boolean useScaling = false;
+
+    protected double[][][] scalingFactors;
+
+    private double scalingThreshold = 1.0E-100;
+    double SCALE = 2;
+
+    public BeerLikelihoodCore(int nrOfStates) {
+        this.nrOfStates = nrOfStates;
+    } // c'tor
+
+
+    /**
+     * Calculates partial likelihoods at a node when both children have states.
+     */
+    protected void calculateStatesStatesPruning(int[] iStates1, double[] fMatrices1,
+                                                int[] iStates2, double[] fMatrices2,
+                                                double[] fPartials3) {
+        int v = 0;
+
+        for (int l = 0; l < nrOfMatrices; l++) {
+
+            for (int k = 0; k < nrOfPatterns; k++) {
+
+                int state1 = iStates1[k];
+                int state2 = iStates2[k];
+
+                int w = l * matrixSize;
+
+                if (state1 < nrOfStates && state2 < nrOfStates) {
+
+                    for (int i = 0; i < nrOfStates; i++) {
+
+                        fPartials3[v] = fMatrices1[w + state1] * fMatrices2[w + state2];
+
+                        v++;
+                        w += nrOfStates;
+                    }
+
+                } else if (state1 < nrOfStates) {
+                    // child 2 has a gap or unknown state so treat it as unknown
+
+                    for (int i = 0; i < nrOfStates; i++) {
+
+                        fPartials3[v] = fMatrices1[w + state1];
+
+                        v++;
+                        w += nrOfStates;
+                    }
+                } else if (state2 < nrOfStates) {
+                    // child 2 has a gap or unknown state so treat it as unknown
+
+                    for (int i = 0; i < nrOfStates; i++) {
+
+                        fPartials3[v] = fMatrices2[w + state2];
+
+                        v++;
+                        w += nrOfStates;
+                    }
+                } else {
+                    // both children have a gap or unknown state so set partials to 1
+
+                    for (int j = 0; j < nrOfStates; j++) {
+                        fPartials3[v] = 1.0;
+                        v++;
+                    }
+                }
+            }
+        }
+    }
+
+    /**
+     * Calculates partial likelihoods at a node when one child has states and one has partials.
+     */
+    protected void calculateStatesPartialsPruning(int[] iStates1, double[] fMatrices1,
+                                                  double[] fPartials2, double[] fMatrices2,
+                                                  double[] fPartials3) {
+
+        double sum, tmp;
+
+        int u = 0;
+        int v = 0;
+
+        for (int l = 0; l < nrOfMatrices; l++) {
+            for (int k = 0; k < nrOfPatterns; k++) {
+
+                int state1 = iStates1[k];
+
+                int w = l * matrixSize;
+
+                if (state1 < nrOfStates) {
+
+
+                    for (int i = 0; i < nrOfStates; i++) {
+
+                        tmp = fMatrices1[w + state1];
+
+                        sum = 0.0;
+                        for (int j = 0; j < nrOfStates; j++) {
+                            sum += fMatrices2[w] * fPartials2[v + j];
+                            w++;
+                        }
+
+                        fPartials3[u] = tmp * sum;
+                        u++;
+                    }
+
+                    v += nrOfStates;
+                } else {
+                    // Child 1 has a gap or unknown state so don't use it
+
+                    for (int i = 0; i < nrOfStates; i++) {
+
+                        sum = 0.0;
+                        for (int j = 0; j < nrOfStates; j++) {
+                            sum += fMatrices2[w] * fPartials2[v + j];
+                            w++;
+                        }
+
+                        fPartials3[u] = sum;
+                        u++;
+                    }
+
+                    v += nrOfStates;
+                }
+            }
+        }
+    }
+
+    /**
+     * Calculates partial likelihoods at a node when both children have partials.
+     */
+    protected void calculatePartialsPartialsPruning(double[] fPartials1, double[] fMatrices1,
+                                                    double[] fPartials2, double[] fMatrices2,
+                                                    double[] fPartials3) {
+        double sum1, sum2;
+
+        int u = 0;
+        int v = 0;
+
+        for (int l = 0; l < nrOfMatrices; l++) {
+
+            for (int k = 0; k < nrOfPatterns; k++) {
+
+                int w = l * matrixSize;
+
+                for (int i = 0; i < nrOfStates; i++) {
+
+                    sum1 = sum2 = 0.0;
+
+                    for (int j = 0; j < nrOfStates; j++) {
+                        sum1 += fMatrices1[w] * fPartials1[v + j];
+                        sum2 += fMatrices2[w] * fPartials2[v + j];
+
+                        w++;
+                    }
+
+                    fPartials3[u] = sum1 * sum2;
+                    u++;
+                }
+                v += nrOfStates;
+            }
+        }
+    }
+
+    /**
+     * Calculates partial likelihoods at a node when both children have states.
+     */
+    protected void calculateStatesStatesPruning(int[] iStates1, double[] fMatrices1,
+                                                int[] iStates2, double[] fMatrices2,
+                                                double[] fPartials3, int[] iMatrixMap) {
+        int v = 0;
+
+        for (int k = 0; k < nrOfPatterns; k++) {
+
+            int state1 = iStates1[k];
+            int state2 = iStates2[k];
+
+            int w = iMatrixMap[k] * matrixSize;
+
+            if (state1 < nrOfStates && state2 < nrOfStates) {
+
+                for (int i = 0; i < nrOfStates; i++) {
+
+                    fPartials3[v] = fMatrices1[w + state1] * fMatrices2[w + state2];
+
+                    v++;
+                    w += nrOfStates;
+                }
+
+            } else if (state1 < nrOfStates) {
+                // child 2 has a gap or unknown state so treat it as unknown
+
+                for (int i = 0; i < nrOfStates; i++) {
+
+                    fPartials3[v] = fMatrices1[w + state1];
+
+                    v++;
+                    w += nrOfStates;
+                }
+            } else if (state2 < nrOfStates) {
+                // child 2 has a gap or unknown state so treat it as unknown
+
+                for (int i = 0; i < nrOfStates; i++) {
+
+                    fPartials3[v] = fMatrices2[w + state2];
+
+                    v++;
+                    w += nrOfStates;
+                }
+            } else {
+                // both children have a gap or unknown state so set partials to 1
+
+                for (int j = 0; j < nrOfStates; j++) {
+                    fPartials3[v] = 1.0;
+                    v++;
+                }
+            }
+        }
+    }
+
+    /**
+     * Calculates partial likelihoods at a node when one child has states and one has partials.
+     */
+    protected void calculateStatesPartialsPruning(int[] iStates1, double[] fMatrices1,
+                                                  double[] fPartials2, double[] fMatrices2,
+                                                  double[] fPartials3, int[] iMatrixMap) {
+
+        double sum, tmp;
+
+        int u = 0;
+        int v = 0;
+
+        for (int k = 0; k < nrOfPatterns; k++) {
+
+            int state1 = iStates1[k];
+
+            int w = iMatrixMap[k] * matrixSize;
+
+            if (state1 < nrOfStates) {
+
+                for (int i = 0; i < nrOfStates; i++) {
+
+                    tmp = fMatrices1[w + state1];
+
+                    sum = 0.0;
+                    for (int j = 0; j < nrOfStates; j++) {
+                        sum += fMatrices2[w] * fPartials2[v + j];
+                        w++;
+                    }
+
+                    fPartials3[u] = tmp * sum;
+                    u++;
+                }
+
+                v += nrOfStates;
+            } else {
+                // Child 1 has a gap or unknown state so don't use it
+
+                for (int i = 0; i < nrOfStates; i++) {
+
+                    sum = 0.0;
+                    for (int j = 0; j < nrOfStates; j++) {
+                        sum += fMatrices2[w] * fPartials2[v + j];
+                        w++;
+                    }
+
+                    fPartials3[u] = sum;
+                    u++;
+                }
+
+                v += nrOfStates;
+            }
+        }
+    }
+
+    /**
+     * Calculates partial likelihoods at a node when both children have partials.
+     */
+    protected void calculatePartialsPartialsPruning(double[] fPartials1, double[] fMatrices1,
+                                                    double[] fPartials2, double[] fMatrices2,
+                                                    double[] fPartials3, int[] iMatrixMap) {
+        double sum1, sum2;
+
+        int u = 0;
+        int v = 0;
+
+        for (int k = 0; k < nrOfPatterns; k++) {
+
+            int w = iMatrixMap[k] * matrixSize;
+
+            for (int i = 0; i < nrOfStates; i++) {
+
+                sum1 = sum2 = 0.0;
+
+                for (int j = 0; j < nrOfStates; j++) {
+                    sum1 += fMatrices1[w] * fPartials1[v + j];
+                    sum2 += fMatrices2[w] * fPartials2[v + j];
+
+                    w++;
+                }
+
+                fPartials3[u] = sum1 * sum2;
+                u++;
+            }
+            v += nrOfStates;
+        }
+    }
+
+    /**
+     * Integrates partials across categories.
+     *
+     * @param fInPartials  the array of partials to be integrated
+     * @param fProportions the proportions of sites in each category
+     * @param fOutPartials an array into which the partials will go
+     */
+    protected void calculateIntegratePartials(double[] fInPartials, double[] fProportions, double[] fOutPartials) {
+
+        int u = 0;
+        int v = 0;
+        for (int k = 0; k < nrOfPatterns; k++) {
+
+            for (int i = 0; i < nrOfStates; i++) {
+
+                fOutPartials[u] = fInPartials[v] * fProportions[0];
+                u++;
+                v++;
+            }
+        }
+
+
+        for (int l = 1; l < nrOfMatrices; l++) {
+            u = 0;
+
+            for (int k = 0; k < nrOfPatterns; k++) {
+
+                for (int i = 0; i < nrOfStates; i++) {
+
+                    fOutPartials[u] += fInPartials[v] * fProportions[l];
+                    u++;
+                    v++;
+                }
+            }
+        }
+    }
+
+    /**
+     * Calculates pattern log likelihoods at a node.
+     *
+     * @param fPartials          the partials used to calculate the likelihoods
+     * @param fFrequencies       an array of state frequencies
+     * @param fOutLogLikelihoods an array into which the likelihoods will go
+     */
+    public void calculateLogLikelihoods(double[] fPartials, double[] fFrequencies, double[] fOutLogLikelihoods) {
+        int v = 0;
+        for (int k = 0; k < nrOfPatterns; k++) {
+
+            double sum = 0.0;
+            for (int i = 0; i < nrOfStates; i++) {
+
+                sum += fFrequencies[i] * fPartials[v];
+                v++;
+            }
+            fOutLogLikelihoods[k] = Math.log(sum) + getLogScalingFactor(k);
+        }
+    }
+
+
+    /**
+     * initializes partial likelihood arrays.
+     *
+     * @param nNodeCount           the number of nodes in the tree
+     * @param nPatternCount        the number of patterns
+     * @param nMatrixCount         the number of matrices (i.e., number of categories)
+     * @param bIntegrateCategories whether sites are being integrated over all matrices
+     */
+    public void initialize(int nNodeCount, int nPatternCount, int nMatrixCount, boolean bIntegrateCategories, boolean bUseAmbiguities) {
+
+        this.nrOfNodes = nNodeCount;
+        this.nrOfPatterns = nPatternCount;
+        this.nrOfMatrices = nMatrixCount;
+
+        this.integrateCategories = bIntegrateCategories;
+
+        if (bIntegrateCategories) {
+            partialsSize = nPatternCount * nrOfStates * nMatrixCount;
+        } else {
+            partialsSize = nPatternCount * nrOfStates;
+        }
+
+        partials = new double[2][nNodeCount][];
+
+        currentMatrixIndex = new int[nNodeCount];
+        storedMatrixIndex = new int[nNodeCount];
+
+        currentPartialsIndex = new int[nNodeCount];
+        storedPartialsIndex = new int[nNodeCount];
+
+        states = new int[nNodeCount][];
+
+        for (int i = 0; i < nNodeCount; i++) {
+            partials[0][i] = null;
+            partials[1][i] = null;
+
+            states[i] = null;
+        }
+
+        matrixSize = nrOfStates * nrOfStates;
+
+        matrices = new double[2][nNodeCount][nMatrixCount * matrixSize];
+    }
+
+    /**
+     * cleans up and deallocates arrays.
+     */
+    public void finalize() throws java.lang.Throwable {
+        nrOfNodes = 0;
+        nrOfPatterns = 0;
+        nrOfMatrices = 0;
+
+        partials = null;
+        currentPartialsIndex = null;
+        storedPartialsIndex = null;
+        states = null;
+        matrices = null;
+        currentMatrixIndex = null;
+        storedMatrixIndex = null;
+
+        scalingFactors = null;
+    }
+
+    @Override
+    public void setUseScaling(double fScale) {
+        useScaling = (fScale != 1.0);
+
+        if (useScaling) {
+            scalingFactors = new double[2][nrOfNodes][nrOfPatterns];
+        }
+    }
+
+    /**
+     * Allocates partials for a node
+     */
+    public void createNodePartials(int iNodeIndex) {
+
+        this.partials[0][iNodeIndex] = new double[partialsSize];
+        this.partials[1][iNodeIndex] = new double[partialsSize];
+    }
+
+    /**
+     * Sets partials for a node
+     */
+    public void setNodePartials(int iNodeIndex, double[] fPartials) {
+
+        if (this.partials[0][iNodeIndex] == null) {
+            createNodePartials(iNodeIndex);
+        }
+        if (fPartials.length < partialsSize) {
+            int k = 0;
+            for (int i = 0; i < nrOfMatrices; i++) {
+                System.arraycopy(fPartials, 0, this.partials[0][iNodeIndex], k, fPartials.length);
+                k += fPartials.length;
+            }
+        } else {
+            System.arraycopy(fPartials, 0, this.partials[0][iNodeIndex], 0, fPartials.length);
+        }
+    }
+
+    @Override
+    public void getNodePartials(int iNodeIndex, double[] fPartials) {
+        System.arraycopy(partials[currentPartialsIndex[iNodeIndex]][iNodeIndex], 0, fPartials, 0, fPartials.length);
+    }
+
+    /**
+     * Allocates states for a node
+     */
+    public void createNodeStates(int iNodeIndex) {
+
+        this.states[iNodeIndex] = new int[nrOfPatterns];
+    }
+
+    /**
+     * Sets states for a node
+     */
+    public void setNodeStates(int iNodeIndex, int[] iStates) {
+
+        if (this.states[iNodeIndex] == null) {
+            createNodeStates(iNodeIndex);
+        }
+        System.arraycopy(iStates, 0, this.states[iNodeIndex], 0, nrOfPatterns);
+    }
+
+    /**
+     * Gets states for a node
+     */
+    public void getNodeStates(int iNodeIndex, int[] iStates) {
+        System.arraycopy(this.states[iNodeIndex], 0, iStates, 0, nrOfPatterns);
+    }
+
+    @Override
+    public void setNodeMatrixForUpdate(int iNodeIndex) {
+        currentMatrixIndex[iNodeIndex] = 1 - currentMatrixIndex[iNodeIndex];
+
+    }
+
+
+    /**
+     * Sets probability matrix for a node
+     */
+    public void setNodeMatrix(int iNodeIndex, int iMatrixIndex, double[] fMatrix) {
+        System.arraycopy(fMatrix, 0, matrices[currentMatrixIndex[iNodeIndex]][iNodeIndex],
+                iMatrixIndex * matrixSize, matrixSize);
+    }
+
+    public void setPaddedNodeMatrices(int iNode, double[] fMatrix) {
+        System.arraycopy(fMatrix, 0, matrices[currentMatrixIndex[iNode]][iNode],
+                0, nrOfMatrices * matrixSize);
+    }
+
+
+    /**
+     * Gets probability matrix for a node
+     */
+    public void getNodeMatrix(int iNodeIndex, int iMatrixIndex, double[] fMatrix) {
+        System.arraycopy(matrices[currentMatrixIndex[iNodeIndex]][iNodeIndex],
+                iMatrixIndex * matrixSize, fMatrix, 0, matrixSize);
+    }
+
+    @Override
+    public void setNodePartialsForUpdate(int iNodeIndex) {
+        currentPartialsIndex[iNodeIndex] = 1 - currentPartialsIndex[iNodeIndex];
+    }
+
+    /**
+     * Sets the currently updating node partials for node nodeIndex. This may
+     * need to repeatedly copy the partials for the different category partitions
+     */
+    public void setCurrentNodePartials(int iNodeIndex, double[] fPartials) {
+        if (fPartials.length < partialsSize) {
+            int k = 0;
+            for (int i = 0; i < nrOfMatrices; i++) {
+                System.arraycopy(fPartials, 0, this.partials[currentPartialsIndex[iNodeIndex]][iNodeIndex], k, fPartials.length);
+                k += fPartials.length;
+            }
+        } else {
+            System.arraycopy(fPartials, 0, this.partials[currentPartialsIndex[iNodeIndex]][iNodeIndex], 0, fPartials.length);
+        }
+    }
+
+    /**
+     * Calculates partial likelihoods at a node.
+     *
+     * @param iNodeIndex1 the 'child 1' node
+     * @param iNodeIndex2 the 'child 2' node
+     * @param iNodeIndex3 the 'parent' node
+     */
+    public void calculatePartials(int iNodeIndex1, int iNodeIndex2, int iNodeIndex3) {
+        if (states[iNodeIndex1] != null) {
+            if (states[iNodeIndex2] != null) {
+                calculateStatesStatesPruning(
+                        states[iNodeIndex1], matrices[currentMatrixIndex[iNodeIndex1]][iNodeIndex1],
+                        states[iNodeIndex2], matrices[currentMatrixIndex[iNodeIndex2]][iNodeIndex2],
+                        partials[currentPartialsIndex[iNodeIndex3]][iNodeIndex3]);
+            } else {
+                calculateStatesPartialsPruning(states[iNodeIndex1], matrices[currentMatrixIndex[iNodeIndex1]][iNodeIndex1],
+                        partials[currentPartialsIndex[iNodeIndex2]][iNodeIndex2], matrices[currentMatrixIndex[iNodeIndex2]][iNodeIndex2],
+                        partials[currentPartialsIndex[iNodeIndex3]][iNodeIndex3]);
+            }
+        } else {
+            if (states[iNodeIndex2] != null) {
+                calculateStatesPartialsPruning(states[iNodeIndex2], matrices[currentMatrixIndex[iNodeIndex2]][iNodeIndex2],
+                        partials[currentPartialsIndex[iNodeIndex1]][iNodeIndex1], matrices[currentMatrixIndex[iNodeIndex1]][iNodeIndex1],
+                        partials[currentPartialsIndex[iNodeIndex3]][iNodeIndex3]);
+            } else {
+                calculatePartialsPartialsPruning(partials[currentPartialsIndex[iNodeIndex1]][iNodeIndex1], matrices[currentMatrixIndex[iNodeIndex1]][iNodeIndex1],
+                        partials[currentPartialsIndex[iNodeIndex2]][iNodeIndex2], matrices[currentMatrixIndex[iNodeIndex2]][iNodeIndex2],
+                        partials[currentPartialsIndex[iNodeIndex3]][iNodeIndex3]);
+            }
+        }
+
+        if (useScaling) {
+            scalePartials(iNodeIndex3);
+        }
+
+//
+//        int k =0;
+//        for (int i = 0; i < patternCount; i++) {
+//            double f = 0.0;
+//
+//            for (int j = 0; j < stateCount; j++) {
+//                f += partials[currentPartialsIndices[nodeIndex3]][nodeIndex3][k];
+//                k++;
+//            }
+//            if (f == 0.0) {
+//                Logger.getLogger("error").severe("A partial likelihood (node index = " + nodeIndex3 + ", pattern = "+ i +") is zero for all states.");
+//            }
+//        }
+    }
+
+    /**
+     * Calculates partial likelihoods at a node.
+     *
+     * @param iNodeIndex1 the 'child 1' node
+     * @param iNodeIndex2 the 'child 2' node
+     * @param iNodeIndex3 the 'parent' node
+     * @param iMatrixMap  a map of which matrix to use for each pattern (can be null if integrating over categories)
+     */
+    public void calculatePartials(int iNodeIndex1, int iNodeIndex2, int iNodeIndex3, int[] iMatrixMap) {
+        if (states[iNodeIndex1] != null) {
+            if (states[iNodeIndex2] != null) {
+                calculateStatesStatesPruning(
+                        states[iNodeIndex1], matrices[currentMatrixIndex[iNodeIndex1]][iNodeIndex1],
+                        states[iNodeIndex2], matrices[currentMatrixIndex[iNodeIndex2]][iNodeIndex2],
+                        partials[currentPartialsIndex[iNodeIndex3]][iNodeIndex3], iMatrixMap);
+            } else {
+                calculateStatesPartialsPruning(
+                        states[iNodeIndex1], matrices[currentMatrixIndex[iNodeIndex1]][iNodeIndex1],
+                        partials[currentPartialsIndex[iNodeIndex2]][iNodeIndex2], matrices[currentMatrixIndex[iNodeIndex2]][iNodeIndex2],
+                        partials[currentPartialsIndex[iNodeIndex3]][iNodeIndex3], iMatrixMap);
+            }
+        } else {
+            if (states[iNodeIndex2] != null) {
+                calculateStatesPartialsPruning(
+                        states[iNodeIndex2], matrices[currentMatrixIndex[iNodeIndex2]][iNodeIndex2],
+                        partials[currentPartialsIndex[iNodeIndex1]][iNodeIndex1], matrices[currentMatrixIndex[iNodeIndex1]][iNodeIndex1],
+                        partials[currentPartialsIndex[iNodeIndex3]][iNodeIndex3], iMatrixMap);
+            } else {
+                calculatePartialsPartialsPruning(
+                        partials[currentPartialsIndex[iNodeIndex1]][iNodeIndex1], matrices[currentMatrixIndex[iNodeIndex1]][iNodeIndex1],
+                        partials[currentPartialsIndex[iNodeIndex2]][iNodeIndex2], matrices[currentMatrixIndex[iNodeIndex2]][iNodeIndex2],
+                        partials[currentPartialsIndex[iNodeIndex3]][iNodeIndex3], iMatrixMap);
+            }
+        }
+
+        if (useScaling) {
+            scalePartials(iNodeIndex3);
+        }
+    }
+
+
+    public void integratePartials(int iNodeIndex, double[] fProportions, double[] fOutPartials) {
+        calculateIntegratePartials(partials[currentPartialsIndex[iNodeIndex]][iNodeIndex], fProportions, fOutPartials);
+    }
+
+
+    /**
+     * Scale the partials at a given node. This uses a scaling suggested by Ziheng Yang in
+     * Yang (2000) J. Mol. Evol. 51: 423-432
+     * <p/>
+     * This function looks over the partial likelihoods for each state at each pattern
+     * and finds the largest. If this is less than the scalingThreshold (currently set
+     * to 1E-40) then it rescales the partials for that pattern by dividing by this number
+     * (i.e., normalizing to between 0, 1). It then stores the log of this scaling.
+     * This is called for every internal node after the partials are calculated so provides
+     * most of the performance hit. Ziheng suggests only doing this on a proportion of nodes
+     * but this sounded like a headache to organize (and he doesn't use the threshold idea
+     * which improves the performance quite a bit).
+     *
+     * @param iNodeIndex
+     */
+    protected void scalePartials(int iNodeIndex) {
+//        int v = 0;
+//    	double [] fPartials = m_fPartials[m_iCurrentPartialsIndices[iNodeIndex]][iNodeIndex];
+//        for (int i = 0; i < m_nPatternCount; i++) {
+//            for (int k = 0; k < m_nMatrixCount; k++) {
+//                for (int j = 0; j < m_nStateCount; j++) {
+//                	fPartials[v] *= SCALE;
+//                	v++;
+//                }
+//            }
+//        }
+        int u = 0;
+
+        for (int i = 0; i < nrOfPatterns; i++) {
+
+            double scaleFactor = 0.0;
+            int v = u;
+            for (int k = 0; k < nrOfMatrices; k++) {
+                for (int j = 0; j < nrOfStates; j++) {
+                    if (partials[currentPartialsIndex[iNodeIndex]][iNodeIndex][v] > scaleFactor) {
+                        scaleFactor = partials[currentPartialsIndex[iNodeIndex]][iNodeIndex][v];
+                    }
+                    v++;
+                }
+                v += (nrOfPatterns - 1) * nrOfStates;
+            }
+
+            if (scaleFactor < scalingThreshold) {
+
+                v = u;
+                for (int k = 0; k < nrOfMatrices; k++) {
+                    for (int j = 0; j < nrOfStates; j++) {
+                        partials[currentPartialsIndex[iNodeIndex]][iNodeIndex][v] /= scaleFactor;
+                        v++;
+                    }
+                    v += (nrOfPatterns - 1) * nrOfStates;
+                }
+                scalingFactors[currentPartialsIndex[iNodeIndex]][iNodeIndex][i] = Math.log(scaleFactor);
+
+            } else {
+                scalingFactors[currentPartialsIndex[iNodeIndex]][iNodeIndex][i] = 0.0;
+            }
+            u += nrOfStates;
+
+
+        }
+    }
+
+    /**
+     * This function returns the scaling factor for that pattern by summing over
+     * the log scalings used at each node. If scaling is off then this just returns
+     * a 0.
+     *
+     * @return the log scaling factor
+     */
+    public double getLogScalingFactor(int iPattern) {
+//    	if (m_bUseScaling) {
+//    		return -(m_nNodeCount/2) * Math.log(SCALE);
+//    	} else {
+//    		return 0;
+//    	}        
+        double logScalingFactor = 0.0;
+        if (useScaling) {
+            for (int i = 0; i < nrOfNodes; i++) {
+                logScalingFactor += scalingFactors[currentPartialsIndex[i]][i][iPattern];
+            }
+        }
+        return logScalingFactor;
+    }
+
+    /**
+     * Gets the partials for a particular node.
+     *
+     * @param iNodeIndex   the node
+     * @param fOutPartials an array into which the partials will go
+     */
+    public void getPartials(int iNodeIndex, double[] fOutPartials) {
+        double[] partials1 = partials[currentPartialsIndex[iNodeIndex]][iNodeIndex];
+
+        System.arraycopy(partials1, 0, fOutPartials, 0, partialsSize);
+    }
+
+    /**
+     * Store current state
+     */
+    @Override
+    public void restore() {
+        // Rather than copying the stored stuff back, just swap the pointers...
+        int[] iTmp1 = currentMatrixIndex;
+        currentMatrixIndex = storedMatrixIndex;
+        storedMatrixIndex = iTmp1;
+
+        int[] iTmp2 = currentPartialsIndex;
+        currentPartialsIndex = storedPartialsIndex;
+        storedPartialsIndex = iTmp2;
+    }
+
+    public void unstore() {
+        System.arraycopy(storedMatrixIndex, 0, currentMatrixIndex, 0, nrOfNodes);
+        System.arraycopy(storedPartialsIndex, 0, currentPartialsIndex, 0, nrOfNodes);
+    }
+
+    /**
+     * Restore the stored state
+     */
+    @Override
+    public void store() {
+        System.arraycopy(currentMatrixIndex, 0, storedMatrixIndex, 0, nrOfNodes);
+        System.arraycopy(currentPartialsIndex, 0, storedPartialsIndex, 0, nrOfNodes);
+    }
+
+
+//	@Override
+//    public void calcRootPsuedoRootPartials(double[] fFrequencies, int iNode, double [] fPseudoPartials) {
+//		int u = 0;
+//		double [] fInPartials = m_fPartials[m_iCurrentPartials[iNode]][iNode];
+//		for (int k = 0; k < m_nPatterns; k++) {
+//			for (int l = 0; l < m_nMatrices; l++) {
+//				for (int i = 0; i < m_nStates; i++) {
+//					fPseudoPartials[u] = fInPartials[u] * fFrequencies[i];
+//					u++;
+//				}
+//			}
+//		}
+//    }
+//	@Override
+//    public void calcNodePsuedoRootPartials(double[] fInPseudoPartials, int iNode, double [] fOutPseudoPartials) {
+//		double [] fPartials = m_fPartials[m_iCurrentPartials[iNode]][iNode];
+//		double [] fOldPartials = m_fPartials[m_iStoredPartials[iNode]][iNode];
+//		int nMaxK = m_nPatterns * m_nMatrices * m_nStates; 
+//		for (int k = 0; k < nMaxK; k++) {
+//			fOutPseudoPartials[k] = fInPseudoPartials[k] * fPartials[k] / fOldPartials[k];
+//		}
+//	}
+//    
+//	@Override
+//    public void calcPsuedoRootPartials(double [] fParentPseudoPartials, int iNode, double [] fPseudoPartials) {
+//		int v = 0;
+//		int u = 0;
+//		double [] fMatrices = m_fMatrices[m_iCurrentMatrices[iNode]][iNode];
+//		for (int k = 0; k < m_nPatterns; k++) {
+//			for (int l = 0; l < m_nMatrices; l++) {
+//				for (int i = 0; i < m_nStates; i++) {
+//					int w = 0;
+//					double fSum = 0;
+//					for (int j = 0; j < m_nStates; j++) {
+//					      fSum += fParentPseudoPartials[u+j] * fMatrices[w + i];
+//					      w+=m_nStates;
+//					}
+//					fPseudoPartials[v] = fSum;
+//					v++;
+////					int w = l * m_nMatrixSize;
+////					double fSum = 0;
+////					for (int j = 0; j < m_nStates; j++) {
+////					      fSum += fParentPseudoPartials[u+j] * fMatrices[w+j];
+////					}
+////					fPseudoPartials[v] = fSum;
+////					v++;
+//				}
+//				u += m_nStates;
+//			}
+//		}
+//    }
+//
+//
+//    @Override
+//    void integratePartialsP(double [] fInPartials, double [] fProportions, double [] m_fRootPartials) {
+//		int nMaxK = m_nPatterns * m_nStates;
+//		for (int k = 0; k < nMaxK; k++) {
+//			m_fRootPartials[k] = fInPartials[k] * fProportions[0];
+//		}
+//
+//		for (int l = 1; l < m_nMatrices; l++) {
+//			int n = nMaxK * l;
+//			for (int k = 0; k < nMaxK; k++) {
+//				m_fRootPartials[k] += fInPartials[n+k] * fProportions[l];
+//			}
+//		}
+//    } // integratePartials
+//
+//	/**
+//	 * Calculates pattern log likelihoods at a node.
+//	 * @param fPartials the partials used to calculate the likelihoods
+//	 * @param fFrequencies an array of state frequencies
+//	 * @param fOutLogLikelihoods an array into which the likelihoods will go
+//	 */
+//    @Override
+//	public void calculateLogLikelihoodsP(double[] fPartials,double[] fOutLogLikelihoods)
+//	{
+//        int v = 0;
+//		for (int k = 0; k < m_nPatterns; k++) {
+//            double sum = 0.0;
+//			for (int i = 0; i < m_nStates; i++) {
+//				sum += fPartials[v];
+//				v++;
+//			}
+//            fOutLogLikelihoods[k] = Math.log(sum) + getLogScalingFactor(k);
+//		}
+//	}
+//	
+//	
+//	//    @Override
+////    LikelihoodCore feelsGood() {return null;}
+} // class BeerLikelihoodCore
diff --git a/src/beast/evolution/likelihood/BeerLikelihoodCore4.java b/src/beast/evolution/likelihood/BeerLikelihoodCore4.java
new file mode 100644
index 0000000..5812b6e
--- /dev/null
+++ b/src/beast/evolution/likelihood/BeerLikelihoodCore4.java
@@ -0,0 +1,311 @@
+package beast.evolution.likelihood;
+
+/**
+ * nucleotide implementation of standard likelihood core *
+ */
+public class BeerLikelihoodCore4 extends BeerLikelihoodCore {
+
+    public BeerLikelihoodCore4() {
+        super(4);
+    }
+
+    /**
+     * Calculates partial likelihoods at a node when both children have states.
+     */
+    protected void calculateStatesStatesPruning(int[] iStates1, double[] fMatrices1,
+                                                int[] iStates2, double[] fMatrices2,
+                                                double[] fPartials3) {
+        int v = 0;
+
+        for (int l = 0; l < nrOfMatrices; l++) {
+
+            for (int k = 0; k < nrOfPatterns; k++) {
+
+                int state1 = iStates1[k];
+                int state2 = iStates2[k];
+
+                int w = l * matrixSize;
+
+                if (state1 < 4 && state2 < 4) {
+
+                    fPartials3[v] = fMatrices1[w + state1] * fMatrices2[w + state2];
+                    v++;
+                    w += 4;
+                    fPartials3[v] = fMatrices1[w + state1] * fMatrices2[w + state2];
+                    v++;
+                    w += 4;
+                    fPartials3[v] = fMatrices1[w + state1] * fMatrices2[w + state2];
+                    v++;
+                    w += 4;
+                    fPartials3[v] = fMatrices1[w + state1] * fMatrices2[w + state2];
+                    v++;
+                    w += 4;
+
+                } else if (state1 < 4) {
+                    // child 2 has a gap or unknown state so don't use it
+
+                    fPartials3[v] = fMatrices1[w + state1];
+                    v++;
+                    w += 4;
+                    fPartials3[v] = fMatrices1[w + state1];
+                    v++;
+                    w += 4;
+                    fPartials3[v] = fMatrices1[w + state1];
+                    v++;
+                    w += 4;
+                    fPartials3[v] = fMatrices1[w + state1];
+                    v++;
+                    w += 4;
+
+                } else if (state2 < 4) {
+                    // child 2 has a gap or unknown state so don't use it
+                    fPartials3[v] = fMatrices2[w + state2];
+                    v++;
+                    w += 4;
+                    fPartials3[v] = fMatrices2[w + state2];
+                    v++;
+                    w += 4;
+                    fPartials3[v] = fMatrices2[w + state2];
+                    v++;
+                    w += 4;
+                    fPartials3[v] = fMatrices2[w + state2];
+                    v++;
+                    w += 4;
+
+                } else {
+                    // both children have a gap or unknown state so set partials to 1
+                    fPartials3[v] = 1.0;
+                    v++;
+                    fPartials3[v] = 1.0;
+                    v++;
+                    fPartials3[v] = 1.0;
+                    v++;
+                    fPartials3[v] = 1.0;
+                    v++;
+                }
+            }
+        }
+    }
+
+    /**
+     * Calculates partial likelihoods at a node when one child has states and one has partials.
+     */
+    protected void calculateStatesPartialsPruning(int[] iStates1, double[] fMatrices1,
+                                                  double[] fPartials2, double[] fMatrices2,
+                                                  double[] fPartials3) {
+
+        double sum;//, tmp;
+
+        int u = 0;
+        int v = 0;
+
+        for (int l = 0; l < nrOfMatrices; l++) {
+            for (int k = 0; k < nrOfPatterns; k++) {
+
+                int state1 = iStates1[k];
+
+                int w = l * matrixSize;
+
+                if (state1 < 4) {
+
+
+                    sum = fMatrices2[w] * fPartials2[v];
+                    sum += fMatrices2[w + 1] * fPartials2[v + 1];
+                    sum += fMatrices2[w + 2] * fPartials2[v + 2];
+                    sum += fMatrices2[w + 3] * fPartials2[v + 3];
+                    fPartials3[u] = fMatrices1[w + state1] * sum;
+                    u++;
+
+                    sum = fMatrices2[w + 4] * fPartials2[v];
+                    sum += fMatrices2[w + 5] * fPartials2[v + 1];
+                    sum += fMatrices2[w + 6] * fPartials2[v + 2];
+                    sum += fMatrices2[w + 7] * fPartials2[v + 3];
+                    fPartials3[u] = fMatrices1[w + 4 + state1] * sum;
+                    u++;
+
+                    sum = fMatrices2[w + 8] * fPartials2[v];
+                    sum += fMatrices2[w + 9] * fPartials2[v + 1];
+                    sum += fMatrices2[w + 10] * fPartials2[v + 2];
+                    sum += fMatrices2[w + 11] * fPartials2[v + 3];
+                    fPartials3[u] = fMatrices1[w + 8 + state1] * sum;
+                    u++;
+
+                    sum = fMatrices2[w + 12] * fPartials2[v];
+                    sum += fMatrices2[w + 13] * fPartials2[v + 1];
+                    sum += fMatrices2[w + 14] * fPartials2[v + 2];
+                    sum += fMatrices2[w + 15] * fPartials2[v + 3];
+                    fPartials3[u] = fMatrices1[w + 12 + state1] * sum;
+                    u++;
+
+                    v += 4;
+
+                } else {
+                    // Child 1 has a gap or unknown state so don't use it
+
+
+                    sum = fMatrices2[w] * fPartials2[v];
+                    sum += fMatrices2[w + 1] * fPartials2[v + 1];
+                    sum += fMatrices2[w + 2] * fPartials2[v + 2];
+                    sum += fMatrices2[w + 3] * fPartials2[v + 3];
+                    fPartials3[u] = sum;
+                    u++;
+
+                    sum = fMatrices2[w + 4] * fPartials2[v];
+                    sum += fMatrices2[w + 5] * fPartials2[v + 1];
+                    sum += fMatrices2[w + 6] * fPartials2[v + 2];
+                    sum += fMatrices2[w + 7] * fPartials2[v + 3];
+                    fPartials3[u] = sum;
+                    u++;
+
+                    sum = fMatrices2[w + 8] * fPartials2[v];
+                    sum += fMatrices2[w + 9] * fPartials2[v + 1];
+                    sum += fMatrices2[w + 10] * fPartials2[v + 2];
+                    sum += fMatrices2[w + 11] * fPartials2[v + 3];
+                    fPartials3[u] = sum;
+                    u++;
+
+                    sum = fMatrices2[w + 12] * fPartials2[v];
+                    sum += fMatrices2[w + 13] * fPartials2[v + 1];
+                    sum += fMatrices2[w + 14] * fPartials2[v + 2];
+                    sum += fMatrices2[w + 15] * fPartials2[v + 3];
+                    fPartials3[u] = sum;
+                    u++;
+
+                    v += 4;
+                }
+            }
+        }
+    }
+
+    /**
+     * Calculates partial likelihoods at a node when both children have partials.
+     */
+    protected void calculatePartialsPartialsPruning(double[] fPartials1, double[] fMatrices1,
+                                                    double[] fPartials2, double[] fMatrices2,
+                                                    double[] fPartials3) {
+        double sum1, sum2;
+
+        int u = 0;
+        int v = 0;
+
+        for (int l = 0; l < nrOfMatrices; l++) {
+
+            for (int k = 0; k < nrOfPatterns; k++) {
+
+                int w = l * matrixSize;
+
+                sum1 = fMatrices1[w] * fPartials1[v];
+                sum2 = fMatrices2[w] * fPartials2[v];
+                sum1 += fMatrices1[w + 1] * fPartials1[v + 1];
+                sum2 += fMatrices2[w + 1] * fPartials2[v + 1];
+                sum1 += fMatrices1[w + 2] * fPartials1[v + 2];
+                sum2 += fMatrices2[w + 2] * fPartials2[v + 2];
+                sum1 += fMatrices1[w + 3] * fPartials1[v + 3];
+                sum2 += fMatrices2[w + 3] * fPartials2[v + 3];
+                fPartials3[u] = sum1 * sum2;
+                u++;
+
+                sum1 = fMatrices1[w + 4] * fPartials1[v];
+                sum2 = fMatrices2[w + 4] * fPartials2[v];
+                sum1 += fMatrices1[w + 5] * fPartials1[v + 1];
+                sum2 += fMatrices2[w + 5] * fPartials2[v + 1];
+                sum1 += fMatrices1[w + 6] * fPartials1[v + 2];
+                sum2 += fMatrices2[w + 6] * fPartials2[v + 2];
+                sum1 += fMatrices1[w + 7] * fPartials1[v + 3];
+                sum2 += fMatrices2[w + 7] * fPartials2[v + 3];
+                fPartials3[u] = sum1 * sum2;
+                u++;
+
+                sum1 = fMatrices1[w + 8] * fPartials1[v];
+                sum2 = fMatrices2[w + 8] * fPartials2[v];
+                sum1 += fMatrices1[w + 9] * fPartials1[v + 1];
+                sum2 += fMatrices2[w + 9] * fPartials2[v + 1];
+                sum1 += fMatrices1[w + 10] * fPartials1[v + 2];
+                sum2 += fMatrices2[w + 10] * fPartials2[v + 2];
+                sum1 += fMatrices1[w + 11] * fPartials1[v + 3];
+                sum2 += fMatrices2[w + 11] * fPartials2[v + 3];
+                fPartials3[u] = sum1 * sum2;
+                u++;
+
+                sum1 = fMatrices1[w + 12] * fPartials1[v];
+                sum2 = fMatrices2[w + 12] * fPartials2[v];
+                sum1 += fMatrices1[w + 13] * fPartials1[v + 1];
+                sum2 += fMatrices2[w + 13] * fPartials2[v + 1];
+                sum1 += fMatrices1[w + 14] * fPartials1[v + 2];
+                sum2 += fMatrices2[w + 14] * fPartials2[v + 2];
+                sum1 += fMatrices1[w + 15] * fPartials1[v + 3];
+                sum2 += fMatrices2[w + 15] * fPartials2[v + 3];
+                fPartials3[u] = sum1 * sum2;
+                u++;
+
+                v += 4;
+            }
+        }
+    }
+
+
+//
+//	@Override
+//    public void calcRootPseudoRootPartials(double[] fFrequencies, int iNode, double [] fPseudoPartials) {
+//		int u = 0;
+//		double [] fInPartials = m_fPartials[m_iCurrentPartials[iNode]][iNode];
+//		for (int k = 0; k < m_nPatterns * m_nMatrices; k++) {
+//			fPseudoPartials[u] = fInPartials[u] * fFrequencies[0];
+//			fPseudoPartials[u+1] = fInPartials[u+1] * fFrequencies[1];
+//			fPseudoPartials[u+2] = fInPartials[u+2] * fFrequencies[2];
+//			fPseudoPartials[u+3] = fInPartials[u+3] * fFrequencies[3];
+//			u+=4;
+//		}
+//    }
+//    
+//	@Override
+//    public void calcPseudoRootPartials(double [] fParentPseudoPartials, int iNode, double [] fPseudoPartials) {
+//		int v = 0;
+//		int u = 0;
+//		double [] fMatrices = m_fMatrices[m_iCurrentMatrices[iNode]][iNode];
+//		for (int k = 0; k < m_nPatterns; k++) {
+//			for (int l = 0; l < m_nMatrices; l++) {
+//				int w = l * m_nMatrixSize;
+//				fPseudoPartials[v] = fParentPseudoPartials[u] * fMatrices[w] +
+//					fParentPseudoPartials[u+1] * fMatrices[w+1] +
+//					fParentPseudoPartials[u+2] * fMatrices[w+2] +
+//					fParentPseudoPartials[u+3] * fMatrices[w+3];
+//				w += 4;
+//				fPseudoPartials[v+1] = fParentPseudoPartials[u] * fMatrices[w] +
+//						fParentPseudoPartials[u+1] * fMatrices[w+1] +
+//						fParentPseudoPartials[u+2] * fMatrices[w+2] +
+//						fParentPseudoPartials[u+3] * fMatrices[w+3];
+//				w += 4;
+//				fPseudoPartials[v+1] = fParentPseudoPartials[u] * fMatrices[w] +
+//					fParentPseudoPartials[u+1] * fMatrices[w+1] +
+//					fParentPseudoPartials[u+2] * fMatrices[w+2] +
+//					fParentPseudoPartials[u+3] * fMatrices[w+3];
+//				w += 4;
+//				fPseudoPartials[v+1] = fParentPseudoPartials[u] * fMatrices[w] +
+//					fParentPseudoPartials[u+1] * fMatrices[w+1] +
+//					fParentPseudoPartials[u+2] * fMatrices[w+2] +
+//					fParentPseudoPartials[u+3] * fMatrices[w+3];
+//				v += 4;
+//				u += 4;
+//			}
+//		}
+//    }
+//
+//	/**
+//	 * Calculates pattern log likelihoods at a node.
+//	 * @param fPartials the partials used to calculate the likelihoods
+//	 * @param fFrequencies an array of state frequencies
+//	 * @param fOutLogLikelihoods an array into which the likelihoods will go
+//	 */
+//    @Override
+//	public void calculateLogLikelihoodsP(double[] fPartials,double[] fOutLogLikelihoods)
+//	{
+//        int v = 0;
+//		for (int k = 0; k < m_nPatterns; k++) {
+//            double sum = fPartials[v] + fPartials[v+1] + fPartials[v + 2] + fPartials[v + 3];
+//            v +=4;
+//            fOutLogLikelihoods[k] = Math.log(sum) + getLogScalingFactor(k);
+//		}
+//	}
+
+}
diff --git a/src/beast/evolution/likelihood/GenericTreeLikelihood.java b/src/beast/evolution/likelihood/GenericTreeLikelihood.java
new file mode 100644
index 0000000..f24c86f
--- /dev/null
+++ b/src/beast/evolution/likelihood/GenericTreeLikelihood.java
@@ -0,0 +1,50 @@
+package beast.evolution.likelihood;
+
+
+import java.util.List;
+import java.util.Random;
+
+import beast.core.Description;
+import beast.core.Distribution;
+import beast.core.Input;
+import beast.core.State;
+import beast.core.Input.Validate;
+import beast.evolution.alignment.Alignment;
+import beast.evolution.branchratemodel.BranchRateModel;
+import beast.evolution.sitemodel.SiteModelInterface;
+import beast.evolution.tree.TreeInterface;
+
+
+
+
+
+ at Description("Generic tree likelihood for an alignment given a generic SiteModel, " +
+		"a beast tree and a branch rate model")
+// Use this as base class to define any non-standard TreeLikelihood.
+// Override Distribution.calculatLogP() to make this class functional.
+//
+// TODO: This could contain a generic traverse() method that takes dirty trees in account.
+//
+public class GenericTreeLikelihood extends Distribution {
+    
+    public Input<Alignment> dataInput = new Input<Alignment>("data", "sequence data for the beast.tree", Validate.REQUIRED);
+
+    public Input<TreeInterface> treeInput = new Input<TreeInterface>("tree", "phylogenetic beast.tree with sequence data in the leafs", Validate.REQUIRED);
+
+    public Input<SiteModelInterface> siteModelInput = new Input<SiteModelInterface>("siteModel", "site model for leafs in the beast.tree", Validate.REQUIRED);
+    
+    public Input<BranchRateModel.Base> branchRateModelInput = new Input<BranchRateModel.Base>("branchRateModel",
+            "A model describing the rates on the branches of the beast.tree.");
+
+    
+    
+	@Override
+	public List<String> getArguments() {return null;}
+
+	@Override
+	public List<String> getConditions() {return null;}
+
+	@Override
+	public void sample(State state, Random random) {}
+
+}
diff --git a/src/beast/evolution/likelihood/LikelihoodCore.java b/src/beast/evolution/likelihood/LikelihoodCore.java
new file mode 100644
index 0000000..cd0c0fd
--- /dev/null
+++ b/src/beast/evolution/likelihood/LikelihoodCore.java
@@ -0,0 +1,181 @@
+/*
+* File LikelihoodCore.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+package beast.evolution.likelihood;
+
+/**
+ * The likelihood core is the class that performs the calculations
+ * in the peeling algorithm (see Felsenstein, Joseph (1981).
+ * Evolutionary trees from DNA sequences: a maximum likelihood approach.
+ * J Mol Evol 17 (6): 368-376.). It does this by calculating the partial
+ * results for all sites, node by node. The order in which the nodes
+ * are visited is controlled by the TreeLikelihood. T
+ * <p/>
+ * In order to reuse computations of previous likelihood calculations,
+ * a current state, and a stored state are maintained. Again, the TreeLikelihood
+ * controls when to update from current to stored and vice versa. So, in
+ * LikelihoodCore implementations, duplicates need to be kept for all partials.
+ * Also, a set of indices to indicate which of the data is stored state and which
+ * is current state is commonly the most efficient way to sort out which is which.
+ */
+
+abstract public class LikelihoodCore {
+
+    /**
+     * reserve memory for partials, indices and other
+     * data structures required by the core *
+     */
+    abstract public void initialize(int nNodeCount, int nPatternCount, int nMatrixCount, boolean bIntegrateCategories, boolean bUseAmbiguities);
+
+    /**
+     * clean up after last likelihood calculation, if at all required *
+     */
+    abstract public void finalize() throws java.lang.Throwable;
+
+    /**
+     * reserve memory for partials for node with number iNode *
+     */
+    abstract public void createNodePartials(int iNode);
+
+
+    /**
+     * indicate that the partials for node
+     * iNode is about the be changed, that is, that the stored
+     * state for node iNode cannot be reused *
+     */
+    abstract public void setNodePartialsForUpdate(int iNode);
+
+    /**
+     * assign values of partials for node with number iNode *
+     */
+    abstract public void setNodePartials(int iNode, double[] fPartials);
+
+    abstract public void getNodePartials(int iNode, double[] fPartials);
+    //abstract public void setCurrentNodePartials(int iNode, double[] fPartials);
+
+    /** reserve memory for states for node with number iNode **/
+    //abstract public void createNodeStates(int iNode);
+
+    /**
+     * assign values of states for node with number iNode *
+     */
+    abstract public void setNodeStates(int iNode, int[] iStates);
+
+    abstract public void getNodeStates(int iNode, int[] iStates);
+
+    /**
+     * indicate that the probability transition matrix for node
+     * iNode is about the be changed, that is, that the stored
+     * state for node iNode cannot be reused *
+     */
+    abstract public void setNodeMatrixForUpdate(int iNode);
+
+    /**
+     * assign values of states for probability transition matrix for node with number iNode *
+     */
+    abstract public void setNodeMatrix(int iNode, int iMatrixIndex, double[] fMatrix);
+
+    abstract public void getNodeMatrix(int iNode, int iMatrixIndex, double[] fMatrix);
+    /** assign values of states for probability transition matrices 
+     * padded with 1s for dealing with unknown characters for node with number iNode **/
+//	abstract public void setPaddedNodeMatrices(int iNode, double[] fMatrix);
+
+
+    /**
+     * indicate that the topology of the tree chanced so the cache
+     * data structures cannot be reused *
+     */
+    public void setNodeStatesForUpdate(int iNode) {
+    }
+
+    ;
+
+
+    /**
+     * flag to indicate whether scaling should be used in the
+     * likelihood calculation. Scaling can help in dealing with
+     * numeric issues (underflow).
+     */
+    boolean m_bUseScaling = false;
+
+    abstract public void setUseScaling(double fScale);
+
+    public boolean getUseScaling() {
+        return m_bUseScaling;
+    }
+
+    /**
+     * return the cumulative scaling effect. Should be zero if no scaling is used *
+     */
+    abstract public double getLogScalingFactor(int iPattern);
+
+    /**
+     * Calculate partials for node iNode3, with children iNode1 and iNode2.
+     * NB Depending on whether the child nodes contain states or partials, the
+     * calculation differs-*
+     */
+    abstract public void calculatePartials(int iNode1, int iNode2, int iNode3);
+    //abstract public void calculatePartials(int iNode1, int iNode2, int iNode3, int[] iMatrixMap);
+
+    /**
+     * integrate partials over categories (if any). *
+     */
+    abstract public void integratePartials(int iNode, double[] fProportions, double[] fOutPartials);
+
+    /**
+     * calculate log likelihoods at the root of the tree,
+     * using fFrequencies as root node distribution.
+     * fOutLogLikelihoods contains the resulting probabilities for each of
+     * the patterns *
+     */
+    abstract public void calculateLogLikelihoods(double[] fPartials, double[] fFrequencies, double[] fOutLogLikelihoods);
+
+
+    public void processStack() {
+    }
+
+    abstract protected void calculateIntegratePartials(double[] fInPartials, double[] fProportions, double[] fOutPartials);
+//    abstract public void calcRootPsuedoRootPartials(double[] fFrequencies, int iNode, double [] fPseudoPartials);
+//    abstract public void calcNodePsuedoRootPartials(double[] fInPseudoPartials, int iNode, double [] fOutPseudoPartials);
+//    abstract public void calcPsuedoRootPartials(double [] fParentPseudoPartials, int iNode, double [] fPseudoPartials);
+//    abstract void integratePartialsP(double [] fInPartials, double [] fProportions, double [] m_fRootPartials);
+//    abstract void calculateLogLikelihoodsP(double[] fPartials,double[] fOutLogLikelihoods);
+
+    /**
+     * store current state *
+     */
+    abstract public void store();
+
+    /**
+     * reset current state to stored state, only used when switching from non-scaled to scaled or vice versa *
+     */
+    abstract public void unstore();
+
+    /**
+     * restore state *
+     */
+    abstract public void restore();
+//    /** do internal diagnosics, and suggest an alternative core if appropriate **/ 
+//    abstract LikelihoodCore feelsGood();
+}
diff --git a/src/beast/evolution/likelihood/TreeLikelihood.java b/src/beast/evolution/likelihood/TreeLikelihood.java
new file mode 100644
index 0000000..e3a28da
--- /dev/null
+++ b/src/beast/evolution/likelihood/TreeLikelihood.java
@@ -0,0 +1,542 @@
+/*
+* File TreeLikelihood.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+
+
+package beast.evolution.likelihood;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Random;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.State;
+import beast.core.util.Log;
+import beast.evolution.alignment.Alignment;
+import beast.evolution.branchratemodel.BranchRateModel;
+import beast.evolution.branchratemodel.StrictClockModel;
+import beast.evolution.sitemodel.SiteModel;
+import beast.evolution.substitutionmodel.SubstitutionModel;
+import beast.evolution.tree.Node;
+import beast.evolution.tree.Tree;
+import beast.evolution.tree.TreeInterface;
+
+ at Description("Calculates the probability of sequence data on a beast.tree given a site and substitution model using " +
+        "a variant of the 'peeling algorithm'. For details, see" +
+        "Felsenstein, Joseph (1981). Evolutionary trees from DNA sequences: a maximum likelihood approach. J Mol Evol 17 (6): 368-376.")
+public class TreeLikelihood extends GenericTreeLikelihood {
+
+    public Input<Boolean> m_useAmbiguities = new Input<Boolean>("useAmbiguities", "flag to indicate that sites containing ambiguous states should be handled instead of ignored (the default)", false);
+    public Input<Boolean> m_useTipLikelihoods = new Input<Boolean>("useTipLikelihoods", "flag to indicate that partial likelihoods are provided at the tips", false);
+    
+    
+    public static enum Scaling {none, always, _default};
+    public Input<Scaling> scaling = new Input<TreeLikelihood.Scaling>("scaling", "type of scaling to use, one of " + Arrays.toString(Scaling.values()) + ". If not specified, the -beagle_scaling flag is used.", Scaling._default, Scaling.values());
+    
+
+    /**
+     * calculation engine *
+     */
+    protected LikelihoodCore likelihoodCore;
+    BeagleTreeLikelihood beagle;
+
+    /**
+     * Plugin associated with inputs. Since none of the inputs are StateNodes, it
+     * is safe to link to them only once, during initAndValidate.
+     */
+    SubstitutionModel.Base substitutionModel;
+    protected SiteModel.Base m_siteModel;
+    protected BranchRateModel.Base branchRateModel;
+
+    /**
+     * flag to indicate the
+     * // when CLEAN=0, nothing needs to be recalculated for the node
+     * // when DIRTY=1 indicates a node partial needs to be recalculated
+     * // when FILTHY=2 indicates the indices for the node need to be recalculated
+     * // (often not necessary while node partial recalculation is required)
+     */
+    protected int hasDirt;
+
+    /**
+     * Lengths of the branches in the tree associated with each of the nodes
+     * in the tree through their node  numbers. By comparing whether the
+     * current branch length differs from stored branch lengths, it is tested
+     * whether a node is dirty and needs to be recomputed (there may be other
+     * reasons as well...).
+     * These lengths take branch rate models in account.
+     */
+    protected double[] m_branchLengths;
+    protected double[] storedBranchLengths;
+
+    /**
+     * memory allocation for likelihoods for each of the patterns *
+     */
+    protected double[] patternLogLikelihoods;
+    /**
+     * memory allocation for the root partials *
+     */
+    protected double[] m_fRootPartials;
+    /**
+     * memory allocation for probability tables obtained from the SiteModel *
+     */
+    double[] probabilities;
+
+    int matrixSize;
+
+    /**
+     * flag to indicate ascertainment correction should be applied *
+     */
+    boolean useAscertainedSitePatterns = false;
+
+    /**
+     * dealing with proportion of site being invariant *
+     */
+    double proportionInvariant = 0;
+    List<Integer> constantPattern = null;
+
+    @Override
+    public void initAndValidate() throws Exception {
+        // sanity check: alignment should have same #taxa as tree
+        if (dataInput.get().getTaxonCount() != treeInput.get().getLeafNodeCount()) {
+            throw new Exception("The number of nodes in the tree does not match the number of sequences");
+        }
+        beagle = null;
+        beagle = new BeagleTreeLikelihood();
+        try {
+	        beagle.initByName(
+                    "data", dataInput.get(), "tree", treeInput.get(), "siteModel", siteModelInput.get(),
+                    "branchRateModel", branchRateModelInput.get(), "useAmbiguities", m_useAmbiguities.get(), 
+                    "useTipLikelihoods", m_useTipLikelihoods.get(),"scaling", scaling.get().toString());
+	        if (beagle.beagle != null) {
+	            //a Beagle instance was found, so we use it
+	            return;
+	        }
+        } catch (Exception e) {
+			// ignore
+		}
+        // No Beagle instance was found, so we use the good old java likelihood core
+        beagle = null;
+
+        int nodeCount = treeInput.get().getNodeCount();
+        if (!(siteModelInput.get() instanceof SiteModel.Base)) {
+        	throw new Exception ("siteModel input should be of type SiteModel.Base");
+        }
+        m_siteModel = (SiteModel.Base) siteModelInput.get();
+        m_siteModel.setDataType(dataInput.get().getDataType());
+        substitutionModel = m_siteModel.substModelInput.get();
+
+        if (branchRateModelInput.get() != null) {
+            branchRateModel = branchRateModelInput.get();
+        } else {
+            branchRateModel = new StrictClockModel();
+        }
+        m_branchLengths = new double[nodeCount];
+        storedBranchLengths = new double[nodeCount];
+
+        int nStateCount = dataInput.get().getMaxStateCount();
+        int nPatterns = dataInput.get().getPatternCount();
+        if (nStateCount == 4) {
+            likelihoodCore = new BeerLikelihoodCore4();
+        } else {
+            likelihoodCore = new BeerLikelihoodCore(nStateCount);
+        }
+
+        String className = getClass().getSimpleName();
+
+        Alignment alignment = dataInput.get();
+
+        Log.info.println(className + "(" + getID() + ") uses " + likelihoodCore.getClass().getSimpleName());
+        Log.info.println("  " + alignment.toString(true));
+        // print startup messages via Log.print*
+
+        proportionInvariant = m_siteModel.getProportionInvariant();
+        m_siteModel.setPropInvariantIsCategory(false);
+        if (proportionInvariant > 0) {
+            calcConstantPatternIndices(nPatterns, nStateCount);
+        }
+
+        initCore();
+
+        patternLogLikelihoods = new double[nPatterns];
+        m_fRootPartials = new double[nPatterns * nStateCount];
+        matrixSize = (nStateCount + 1) * (nStateCount + 1);
+        probabilities = new double[(nStateCount + 1) * (nStateCount + 1)];
+        Arrays.fill(probabilities, 1.0);
+
+        if (dataInput.get().isAscertained) {
+            useAscertainedSitePatterns = true;
+        }
+    }
+
+
+    /**
+     * Determine indices of m_fRootProbabilities that need to be updates
+     * // due to sites being invariant. If none of the sites are invariant,
+     * // the 'site invariant' category does not contribute anything to the
+     * // root probability. If the site IS invariant for a certain character,
+     * // taking ambiguities in account, there is a contribution of 1 from
+     * // the 'site invariant' category.
+     */
+    void calcConstantPatternIndices(final int nPatterns, final int nStateCount) {
+        constantPattern = new ArrayList<Integer>();
+        for (int i = 0; i < nPatterns; i++) {
+            final int[] pattern = dataInput.get().getPattern(i);
+            final boolean[] bIsInvariant = new boolean[nStateCount];
+            Arrays.fill(bIsInvariant, true);
+            for (final int state : pattern) {
+                final boolean[] bStateSet = dataInput.get().getStateSet(state);
+                if (m_useAmbiguities.get() || !dataInput.get().getDataType().isAmbiguousState(state)) {
+                    for (int k = 0; k < nStateCount; k++) {
+                        bIsInvariant[k] &= bStateSet[k];
+                    }
+                }
+            }
+            for (int k = 0; k < nStateCount; k++) {
+                if (bIsInvariant[k]) {
+                    constantPattern.add(i * nStateCount + k);
+                }
+            }
+        }
+    }
+
+    protected void initCore() {
+        final int nodeCount = treeInput.get().getNodeCount();
+        likelihoodCore.initialize(
+                nodeCount,
+                dataInput.get().getPatternCount(),
+                m_siteModel.getCategoryCount(),
+                true, m_useAmbiguities.get()
+        );
+
+        final int extNodeCount = nodeCount / 2 + 1;
+        final int intNodeCount = nodeCount / 2;
+
+        if (m_useAmbiguities.get() || m_useTipLikelihoods.get()) {
+            setPartials(treeInput.get().getRoot(), dataInput.get().getPatternCount());
+        } else {
+            setStates(treeInput.get().getRoot(), dataInput.get().getPatternCount());
+        }
+        hasDirt = Tree.IS_FILTHY;
+        for (int i = 0; i < intNodeCount; i++) {
+            likelihoodCore.createNodePartials(extNodeCount + i);
+        }
+    }
+
+    /**
+     * This method samples the sequences based on the tree and site model.
+     */
+    public void sample(State state, Random random) {
+        throw new UnsupportedOperationException("Can't sample a fixed alignment!");
+    }
+
+    /**
+     * set leaf states in likelihood core *
+     */
+    protected void setStates(Node node, int patternCount) {
+        if (node.isLeaf()) {
+            Alignment data = dataInput.get();
+            int i;
+            int[] states = new int[patternCount];
+            int taxonIndex = getTaxonIndex(node.getID(), data);
+            for (i = 0; i < patternCount; i++) {
+                int code = data.getPattern(taxonIndex, i);
+                int[] statesForCode = data.getDataType().getStatesForCode(code);
+                if (statesForCode.length==1)
+                    states[i] = statesForCode[0];
+                else
+                    states[i] = code; // Causes ambiguous states to be ignored.
+            }
+            likelihoodCore.setNodeStates(node.getNr(), states);
+
+        } else {
+            setStates(node.getLeft(), patternCount);
+            setStates(node.getRight(), patternCount);
+        }
+    }
+
+    /**
+     *
+     * @param taxon the taxon name as a string
+     * @param data the alignment
+     * @return the taxon index of the given taxon name for accessing its sequence data in the given alignment,
+     *         or -1 if the taxon is not in the alignment.
+     */
+    private int getTaxonIndex(String taxon, Alignment data) {
+        int taxonIndex = data.getTaxonIndex(taxon);
+        if (taxonIndex == -1) {
+        	if (taxon.startsWith("'") || taxon.startsWith("\"")) {
+                taxonIndex = data.getTaxonIndex(taxon.substring(1, taxon.length() - 1));
+            }
+            if (taxonIndex == -1) {
+            	throw new RuntimeException("Could not find sequence " + taxon + " in the alignment");
+            }
+        }
+        return taxonIndex;
+	}
+
+	/**
+     * set leaf partials in likelihood core *
+     */
+    protected void setPartials(Node node, int patternCount) {
+        if (node.isLeaf()) {
+            Alignment data = dataInput.get();
+            int nStates = data.getDataType().getStateCount();
+            double[] partials = new double[patternCount * nStates];
+            int k = 0;
+            int iTaxon = getTaxonIndex(node.getID(), data);
+            for (int iPattern = 0; iPattern < patternCount; iPattern++) {                
+                double[] tipLikelihoods = data.getTipLikelihoods(iTaxon,iPattern);
+                if (tipLikelihoods != null) {
+                	for (int iState = 0; iState < nStates; iState++) {
+                		partials[k++] = tipLikelihoods[iState];
+                	}
+                }
+                else {
+                	int nState = data.getPattern(iTaxon, iPattern);
+	                boolean[] stateSet = data.getStateSet(nState);
+	                for (int iState = 0; iState < nStates; iState++) {
+	                	 partials[k++] = (stateSet[iState] ? 1.0 : 0.0);                
+	                }
+                }
+            }
+            likelihoodCore.setNodePartials(node.getNr(), partials);
+
+        } else {
+            setPartials(node.getLeft(), patternCount);
+            setPartials(node.getRight(), patternCount);
+        }
+    }
+
+    /**
+     * Calculate the log likelihood of the current state.
+     *
+     * @return the log likelihood.
+     */
+    double m_fScale = 1.01;
+    int m_nScale = 0;
+    int X = 100;
+
+    @Override
+    public double calculateLogP() throws Exception {
+        if (beagle != null) {
+            logP = beagle.calculateLogP();
+            return logP;
+        }
+        final TreeInterface tree = treeInput.get();
+
+        if (traverse(tree.getRoot()) != Tree.IS_CLEAN)
+            calcLogP();
+
+        m_nScale++;
+        if (logP > 0 || (likelihoodCore.getUseScaling() && m_nScale > X)) {
+//            System.err.println("Switch off scaling");
+//            m_likelihoodCore.setUseScaling(1.0);
+//            m_likelihoodCore.unstore();
+//            m_nHasDirt = Tree.IS_FILTHY;
+//            X *= 2;
+//            traverse(tree.getRoot());
+//            calcLogP();
+//            return logP;
+        } else if (logP == Double.NEGATIVE_INFINITY && m_fScale < 10 && !scaling.get().equals(Scaling.none)) { // && !m_likelihoodCore.getUseScaling()) {
+            m_nScale = 0;
+            m_fScale *= 1.01;
+            System.err.println("Turning on scaling to prevent numeric instability " + m_fScale);
+            likelihoodCore.setUseScaling(m_fScale);
+            likelihoodCore.unstore();
+            hasDirt = Tree.IS_FILTHY;
+            traverse(tree.getRoot());
+            calcLogP();
+            return logP;
+        }
+        return logP;
+    }
+
+    void calcLogP() throws Exception {
+        logP = 0.0;
+        if (useAscertainedSitePatterns) {
+            final double ascertainmentCorrection = dataInput.get().getAscertainmentCorrection(patternLogLikelihoods);
+            for (int i = 0; i < dataInput.get().getPatternCount(); i++) {
+                logP += (patternLogLikelihoods[i] - ascertainmentCorrection) * dataInput.get().getPatternWeight(i);
+            }
+        } else {
+            for (int i = 0; i < dataInput.get().getPatternCount(); i++) {
+                logP += patternLogLikelihoods[i] * dataInput.get().getPatternWeight(i);
+            }
+        }
+    }
+
+    /* Assumes there IS a branch rate model as opposed to traverse() */
+    int traverse(final Node node) throws Exception {
+
+        int update = (node.isDirty() | hasDirt);
+
+        final int iNode = node.getNr();
+
+        final double branchRate = branchRateModel.getRateForBranch(node);
+        final double branchTime = node.getLength() * branchRate;
+
+        // First update the transition probability matrix(ices) for this branch
+        //if (!node.isRoot() && (update != Tree.IS_CLEAN || branchTime != m_StoredBranchLengths[iNode])) {
+        if (!node.isRoot() && (update != Tree.IS_CLEAN || branchTime != m_branchLengths[iNode])) {
+            m_branchLengths[iNode] = branchTime;
+            final Node parent = node.getParent();
+            likelihoodCore.setNodeMatrixForUpdate(iNode);
+            for (int i = 0; i < m_siteModel.getCategoryCount(); i++) {
+                final double jointBranchRate = m_siteModel.getRateForCategory(i, node) * branchRate;
+                substitutionModel.getTransitionProbabilities(node, parent.getHeight(), node.getHeight(), jointBranchRate, probabilities);
+                //System.out.println(node.getNr() + " " + Arrays.toString(m_fProbabilities));
+                likelihoodCore.setNodeMatrix(iNode, i, probabilities);
+            }
+            update |= Tree.IS_DIRTY;
+        }
+
+        // If the node is internal, update the partial likelihoods.
+        if (!node.isLeaf()) {
+
+            // Traverse down the two child nodes
+            final Node child1 = node.getLeft(); //Two children
+            final int update1 = traverse(child1);
+
+            final Node child2 = node.getRight();
+            final int update2 = traverse(child2);
+
+            // If either child node was updated then update this node too
+            if (update1 != Tree.IS_CLEAN || update2 != Tree.IS_CLEAN) {
+
+                final int childNum1 = child1.getNr();
+                final int childNum2 = child2.getNr();
+
+                likelihoodCore.setNodePartialsForUpdate(iNode);
+                update |= (update1 | update2);
+                if (update >= Tree.IS_FILTHY) {
+                    likelihoodCore.setNodeStatesForUpdate(iNode);
+                }
+
+                if (m_siteModel.integrateAcrossCategories()) {
+                    likelihoodCore.calculatePartials(childNum1, childNum2, iNode);
+                } else {
+                    throw new Exception("Error TreeLikelihood 201: Site categories not supported");
+                    //m_pLikelihoodCore->calculatePartials(childNum1, childNum2, nodeNum, siteCategories);
+                }
+
+                if (node.isRoot()) {
+                    // No parent this is the root of the beast.tree -
+                    // calculate the pattern likelihoods
+                    final double[] frequencies = //m_pFreqs.get().
+                            substitutionModel.getFrequencies();
+
+                    final double[] proportions = m_siteModel.getCategoryProportions(node);
+                    likelihoodCore.integratePartials(node.getNr(), proportions, m_fRootPartials);
+
+                    if (constantPattern != null) { // && !SiteModel.g_bUseOriginal) {
+                        proportionInvariant = m_siteModel.getProportionInvariant();
+                        // some portion of sites is invariant, so adjust root partials for this
+                        for (final int i : constantPattern) {
+                            m_fRootPartials[i] += proportionInvariant;
+                        }
+                    }
+
+                    likelihoodCore.calculateLogLikelihoods(m_fRootPartials, frequencies, patternLogLikelihoods);
+                }
+
+            }
+        }
+        return update;
+    } // traverseWithBRM
+
+    /** CalculationNode methods **/
+
+    /**
+     * check state for changed variables and update temp results if necessary *
+     */
+    @Override
+    protected boolean requiresRecalculation() {
+        if (beagle != null) {
+            return beagle.requiresRecalculation();
+        }
+        hasDirt = Tree.IS_CLEAN;
+
+        if (dataInput.get().isDirtyCalculation()) {
+            hasDirt = Tree.IS_FILTHY;
+            return true;
+        }
+        if (m_siteModel.isDirtyCalculation()) {
+            hasDirt = Tree.IS_DIRTY;
+            return true;
+        }
+        if (branchRateModel != null && branchRateModel.isDirtyCalculation()) {
+            //m_nHasDirt = Tree.IS_DIRTY;
+            return true;
+        }
+        return treeInput.get().somethingIsDirty();
+    }
+
+    @Override
+    public void store() {
+        if (beagle != null) {
+            beagle.store();
+            super.store();
+            return;
+        }
+        if (likelihoodCore != null) {
+            likelihoodCore.store();
+        }
+        super.store();
+        System.arraycopy(m_branchLengths, 0, storedBranchLengths, 0, m_branchLengths.length);
+    }
+
+    @Override
+    public void restore() {
+        if (beagle != null) {
+            beagle.restore();
+            super.restore();
+            return;
+        }
+        if (likelihoodCore != null) {
+            likelihoodCore.restore();
+        }
+        super.restore();
+        double[] tmp = m_branchLengths;
+        m_branchLengths = storedBranchLengths;
+        storedBranchLengths = tmp;
+    }
+
+    /**
+     * @return a list of unique ids for the state nodes that form the argument
+     */
+    public List<String> getArguments() {
+        return Collections.singletonList(dataInput.get().getID());
+    }
+
+    /**
+     * @return a list of unique ids for the state nodes that make up the conditions
+     */
+    public List<String> getConditions() {
+        return m_siteModel.getConditions();
+    }
+
+} // class TreeLikelihood
diff --git a/src/beast/evolution/operators/BitFlipOperator.java b/src/beast/evolution/operators/BitFlipOperator.java
new file mode 100644
index 0000000..cf366ac
--- /dev/null
+++ b/src/beast/evolution/operators/BitFlipOperator.java
@@ -0,0 +1,99 @@
+/*
+* File BitFlipOperator.java
+*
+* Copyright (C) 2010 Joseph Heled jheled at gmail.com
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+
+package beast.evolution.operators;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.Operator;
+import beast.core.Input.Validate;
+import beast.core.parameter.BooleanParameter;
+import beast.util.Randomizer;
+
+/**
+ * @author Joseph Heled
+ */
+
+ at Description("Flip one bit in an array of boolean bits. The hastings ratio is designed so that all subsets of vectors with the" +
+        " same number of 'on' bits are equiprobable.")
+public class BitFlipOperator extends Operator {
+    public Input<Boolean> uniformInput = new Input<Boolean>("uniform", "when on, total probability of combinations with k" +
+            " 'on' bits is equal. Otherwise uniform on all combinations (default true)", true);
+
+    public Input<BooleanParameter> parameterInput = new Input<BooleanParameter>("parameter", "the parameter to operate a flip on.", Validate.REQUIRED);
+
+    private boolean usesPriorOnSum = true;
+
+    public void initAndValidate() {
+        final Boolean b = uniformInput.get();
+        if (b != null) {
+            usesPriorOnSum = b;
+        }
+    }
+
+    /**
+     * Change the parameter and return the hastings ratio.
+     * Flip (Switch a 0 to 1 or 1 to 0) for a random bit in a bit vector.
+     * Return the hastings ratio which makes all subsets of vectors with the same number of 1 bits
+     * equiprobable, unless !usesPriorOnSum , then all configurations are equiprobable
+     */
+
+    @Override
+    public double proposal() {
+
+        final BooleanParameter p = parameterInput.get(this);
+
+        final int dim = p.getDimension();
+
+        double sum = 0.0;
+        if (usesPriorOnSum) {
+            for (int i = 0; i < dim; i++) {
+                if (p.getValue(i)) sum += 1;
+            }
+        }
+
+        final int pos = Randomizer.nextInt(dim);
+
+        final boolean value = p.getValue(pos);
+
+        double logq = 0.0;
+        if (!value) {
+            p.setValue(pos, true);
+
+            if (usesPriorOnSum) {
+                logq = -Math.log((dim - sum) / (sum + 1));
+            }
+
+        } else {
+            //assert value;
+
+            p.setValue(pos, false);
+            if (usesPriorOnSum) {
+                logq = -Math.log(sum / (dim - sum + 1));
+            }
+        }
+        return logq;
+    }
+}
+
diff --git a/src/beast/evolution/operators/CompoundParameterHelper.java b/src/beast/evolution/operators/CompoundParameterHelper.java
new file mode 100644
index 0000000..c7d8505
--- /dev/null
+++ b/src/beast/evolution/operators/CompoundParameterHelper.java
@@ -0,0 +1,81 @@
+package beast.evolution.operators;
+
+
+import java.util.List;
+
+import beast.core.Description;
+import beast.core.parameter.Parameter;
+
+
+ at Description("A temporary helper class to solve compound state nodes for operators, " +
+        "but it cannot be used as input, before the framework is modified.")
+public class CompoundParameterHelper<T> {
+    protected int[] parameterIndex; // store the index of parameter list
+
+    final List<Parameter<T>> parameterList;
+
+    public CompoundParameterHelper(final List<Parameter<T>> parameterList) {
+        this.parameterList = parameterList;
+
+        if (parameterList == null || parameterList.size() < 1) {
+            throw new IllegalArgumentException("There is no parameter inputted into CompoundParameter !");
+        }
+
+        int dim = 0;
+        for (final Parameter<T> para : parameterList) {
+            dim += para.getDimension();
+        }
+
+        parameterIndex = new int[dim];
+
+        for (int y = 0; y < parameterList.size(); y++) {
+            final Parameter<T> para = parameterList.get(y);
+            for (int d = 0; d < para.getDimension(); d++) {
+                parameterIndex[y + d] = y;
+            }
+        }
+    }
+
+    public int getDimension() {
+        return parameterIndex.length;
+    }
+
+    public void setValue(final int iParam, final T fValue) {
+        final Parameter<T> para = parameterList.get(getY(iParam));
+        para.setValue(getX(iParam), fValue);
+    }
+
+    public T getValue(final int iParam) {
+        return parameterList.get(getY(iParam)).getValue(getX(iParam));
+    }
+
+    public T getLower(final int iParam) {
+        return parameterList.get(getY(iParam)).getLower();
+    }
+
+    public T getUpper(final int iParam) {
+        return parameterList.get(getY(iParam)).getUpper();
+    }
+
+    // given {{?,?,?,?}{?,?}{?,?,?}}, parameterIndex[] is 0 0 0 0 1 1 2 2 2, iParam starts from 0;
+    // if iParam < 4, then getX(iParam) = iParam;
+    // if iParam >= 4, then getX(iParam) = iParam - the sum of previous dimensions
+    // for example, iParam = 7, then getX = 7 - (4 + 2) = 1
+    protected int getX(final int iParam) {
+        int sumPrevDim = parameterList.get(0).getDimension();
+        if (iParam < sumPrevDim) {
+            return iParam;
+        }
+        for (int y = 1; y < getY(iParam); y++) {
+            sumPrevDim += parameterList.get(y).getDimension();
+        }
+
+        return iParam - sumPrevDim;
+    }
+
+    // the index of parameter list
+    protected int getY(final int iParam) {
+        return parameterIndex[iParam];
+    }
+
+}
diff --git a/src/beast/evolution/operators/DeltaExchangeOperator.java b/src/beast/evolution/operators/DeltaExchangeOperator.java
new file mode 100644
index 0000000..eb0f412
--- /dev/null
+++ b/src/beast/evolution/operators/DeltaExchangeOperator.java
@@ -0,0 +1,344 @@
+package beast.evolution.operators;
+
+
+
+import java.text.DecimalFormat;
+import java.util.ArrayList;
+import java.util.List;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.Operator;
+import beast.core.parameter.IntegerParameter;
+import beast.core.parameter.RealParameter;
+import beast.core.util.Log;
+import beast.util.Randomizer;
+
+
+/**
+ * A generic operator for use with a sum-constrained (possibly weighted) vector parameter.
+ *
+ * @author Alexei Drummond
+ * @author Andrew Rambaut
+ *         <p/>
+ *         Migrated to BEAST 2 by CHW and Walter
+ */
+ at Description("A generic operator for use with a sum-constrained (possibly weighted) vector parameter.")
+public class DeltaExchangeOperator extends Operator {
+    //public Input<Tree> m_pTree = new Input<Tree>("tree", "if specified, all beast.tree branch length are scaled");
+
+    public final Input<List<RealParameter>> parameterInput = new Input<List<RealParameter>>("parameter",
+            "if specified, this parameter is operated on", new ArrayList<RealParameter>());
+    public final Input<List<IntegerParameter>> intparameterInput = new Input<List<IntegerParameter>>("intparameter",
+            "if specified, this parameter is operated on", new ArrayList<IntegerParameter>());
+
+    public final Input<Double> deltaInput = new Input<Double>("delta", "Magnitude of change for two randomly picked values.", 1.0);
+    public final Input<Boolean> autoOptimizeiInput =
+            new Input<Boolean>("autoOptimize", "if true, window size will be adjusted during the MCMC run to improve mixing.", true);
+    public final Input<Boolean> sIntegerOperatorInput = new Input<Boolean>("integer", "if true, changes are all integers.", false);
+    public final Input<IntegerParameter> parameterWeightsInput = new Input<IntegerParameter>("weightvector", "weights on a vector parameter");
+
+    private boolean autoOptimize;
+    private double delta;
+    private boolean isIntegerOperator;
+    private int[] parameterWeights;
+    private CompoundParameterHelper compoundParameter = null;
+    // because CompoundParameter cannot derive from parameter due to framework, the code complexity is doubled
+
+    public void initAndValidate() {
+
+        autoOptimize = autoOptimizeiInput.get();
+        delta = deltaInput.get();
+        isIntegerOperator = sIntegerOperatorInput.get();
+
+        if (parameterInput.get().isEmpty()) {
+            if (intparameterInput.get().size() > 1) {
+            	// sanity check
+            	for (int i = 0; i < intparameterInput.get().size(); i++) {
+            		for (int j = i + 1; j < intparameterInput.get().size(); j++) {
+            			if (intparameterInput.get().get(i) == intparameterInput.get().get(j)) {
+            				throw new RuntimeException("Dublicate intparameter (" + intparameterInput.get().get(j).getID() + ") found in operator " + getID());
+            			}
+            		}
+            	}
+            	// create single parameter from the list of int-parameters
+                compoundParameter = new CompoundParameterHelper((intparameterInput.get()));
+            }
+        } else {
+            if (parameterInput.get().size() > 1) {
+            	// sanity check
+            	for (int i = 0; i < parameterInput.get().size(); i++) {
+            		for (int j = i + 1; j < parameterInput.get().size(); j++) {
+            			if (parameterInput.get().get(i) == parameterInput.get().get(j)) {
+            				throw new RuntimeException("Dublicate intparameter (" + parameterInput.get().get(j).getID() + ") found in operator " + getID());
+            			}
+            		}
+            	}
+            	// create single parameter from the list of parameters
+                compoundParameter = new CompoundParameterHelper(parameterInput.get());
+            }
+        }
+
+        if (compoundParameter == null) { // one parameter case
+            if (parameterInput.get().isEmpty()) {
+            	if (intparameterInput.get().size() > 0) {
+            		parameterWeights = new int[intparameterInput.get().get(0).getDimension()];
+            	} else {
+            		// happens when BEAUti is setting things up
+            		parameterWeights = new int[0];
+            	}
+            } else {
+                parameterWeights = new int[parameterInput.get().get(0).getDimension()];
+            }
+        } else {
+            if (compoundParameter.getDimension() < 1)
+                throw new IllegalArgumentException("Compound parameter is not created properly, dimension = " + compoundParameter.getDimension());
+
+            parameterWeights = new int[compoundParameter.getDimension()];
+        }
+
+        if (parameterWeightsInput.get() != null) {
+            if (parameterWeights.length != parameterWeightsInput.get().getDimension())
+                throw new IllegalArgumentException("Weights vector should have the same length as parameter dimension");
+
+            for (int i = 0; i < parameterWeights.length; i++) {
+                parameterWeights[i] = parameterWeightsInput.get().getValue(i);
+            }
+        } else {
+            for (int i = 0; i < parameterWeights.length; i++) {
+                parameterWeights[i] = 1;
+            }
+        }
+
+        if (isIntegerOperator && delta != Math.round(delta)) {
+            throw new IllegalArgumentException("Can't be an integer operator if delta is not integer");
+        }
+
+        // dimension sanity check
+        int dim = -1;
+        if (compoundParameter == null) { // one parameter case
+        	dim = (!parameterInput.get().isEmpty() ? parameterInput.get().get(0).getDimension() : intparameterInput.get().get(0).getDimension());
+        } else {
+            dim = compoundParameter.getDimension();
+        }
+    	if (dim <= 1) {
+    		Log.warning.println("WARNING: the dimension of the parameter is " + dim + " at the start of the run.\n"
+    				+ "         The operator " + getID() + " has no effect (if this does not change).");
+    	}
+
+    }
+
+    @Override
+    public final double proposal() {
+        double logq = 0.0;
+
+        if (compoundParameter == null) { // one parameter case
+            // get two dimensions
+            RealParameter realparameter = null;
+            IntegerParameter intparameter = null;
+
+            if (parameterInput.get().isEmpty()) {
+                intparameter = intparameterInput.get().get(0);
+            } else {
+                realparameter = parameterInput.get().get(0);
+            }
+
+            final int dim = (realparameter != null ? realparameter.getDimension() : intparameter.getDimension());
+            if (dim <= 1) {
+            	// it is impossible to select two distinct entries in this case, so there is nothing to propose 
+            	return 0.0;
+            }
+
+            final int dim1 = Randomizer.nextInt(dim);
+            int dim2 = dim1;
+            while (dim1 == dim2) {
+                dim2 = Randomizer.nextInt(dim);
+            }
+
+            if (intparameter == null) {
+                // operate on real parameter
+                double scalar1 = realparameter.getValue(dim1);
+                double scalar2 = realparameter.getValue(dim2);
+
+                if (isIntegerOperator) {
+                    final int d = Randomizer.nextInt((int) Math.round(delta)) + 1;
+
+                    if (parameterWeights[dim1] != parameterWeights[dim2]) throw new RuntimeException();
+                    scalar1 = Math.round(scalar1 - d);
+                    scalar2 = Math.round(scalar2 + d);
+                } else {
+
+                    // exchange a random delta
+                    final double d = Randomizer.nextDouble() * delta;
+                    scalar1 -= d;
+                    if (parameterWeights[dim1] != parameterWeights[dim2]) {
+                        scalar2 += d * (double) parameterWeights[dim1] / (double) parameterWeights[dim2];
+                    } else {
+                        scalar2 += d;
+                    }
+
+                }
+
+                if (scalar1 < realparameter.getLower() || scalar1 > realparameter.getUpper() ||
+                        scalar2 < realparameter.getLower() || scalar2 > realparameter.getUpper()) {
+                    logq = Double.NEGATIVE_INFINITY;
+                } else {
+                    realparameter.setValue(dim1, scalar1);
+                    realparameter.setValue(dim2, scalar2);
+                }
+            } else {
+                // operate on int parameter
+                int scalar1 = intparameter.getValue(dim1);
+                int scalar2 = intparameter.getValue(dim2);
+
+                final int d = Randomizer.nextInt((int) Math.round(delta)) + 1;
+
+                if (parameterWeights[dim1] != parameterWeights[dim2]) throw new RuntimeException();
+                scalar1 = Math.round(scalar1 - d);
+                scalar2 = Math.round(scalar2 + d);
+
+
+                if (scalar1 < intparameter.getLower() || scalar1 > intparameter.getUpper() ||
+                        scalar2 < intparameter.getLower() || scalar2 > intparameter.getUpper()) {
+                    logq = Double.NEGATIVE_INFINITY;
+                } else {
+                    intparameter.setValue(dim1, scalar1);
+                    intparameter.setValue(dim2, scalar2);
+                }
+
+            }
+
+        } else { // compound parameter case
+
+            // get two dimensions
+            final int dim = compoundParameter.getDimension();
+            if (dim <= 1) {
+            	// it is impossible to select two distinct entries in this case, so there is nothing to propose 
+            	return 0.0;
+            }
+
+            final int dim1 = Randomizer.nextInt(dim);
+            int dim2 = dim1;
+            while (dim1 == dim2) {
+                dim2 = Randomizer.nextInt(dim);
+            }
+
+            if (intparameterInput.get().isEmpty()) {
+                // operate on real parameter
+                double scalar1 = (Double) compoundParameter.getValue(dim1);
+                double scalar2 = (Double) compoundParameter.getValue(dim2);
+
+                if (isIntegerOperator) {
+                    final int d = Randomizer.nextInt((int) Math.round(delta)) + 1;
+
+                    if (parameterWeights[dim1] != parameterWeights[dim2]) throw new RuntimeException();
+                    scalar1 = Math.round(scalar1 - d);
+                    scalar2 = Math.round(scalar2 + d);
+                } else {
+
+                    // exchange a random delta
+                    final double d = Randomizer.nextDouble() * delta;
+                    scalar1 -= d;
+                    if (parameterWeights[dim1] != parameterWeights[dim2]) {
+                        scalar2 += d * (double) parameterWeights[dim1] / (double) parameterWeights[dim2];
+                    } else {
+                        scalar2 += d;
+                    }
+
+                }
+
+                if (scalar1 < (Double) compoundParameter.getLower(dim1) ||
+                        scalar1 > (Double) compoundParameter.getUpper(dim1) ||
+                        scalar2 < (Double) compoundParameter.getLower(dim2) ||
+                        scalar2 > (Double) compoundParameter.getUpper(dim2)) {
+                    logq = Double.NEGATIVE_INFINITY;
+                } else {
+                    compoundParameter.setValue(dim1, scalar1);
+                    compoundParameter.setValue(dim2, scalar2);
+                }
+            } else {
+                // operate on int parameter
+                int scalar1 = (Integer) compoundParameter.getValue(dim1);
+                int scalar2 = (Integer) compoundParameter.getValue(dim2);
+
+                final int d = Randomizer.nextInt((int) Math.round(delta)) + 1;
+
+                if (parameterWeights[dim1] != parameterWeights[dim2]) throw new RuntimeException();
+                scalar1 = Math.round(scalar1 - d);
+                scalar2 = Math.round(scalar2 + d);
+
+
+                if (scalar1 < (Integer) compoundParameter.getLower(dim1) ||
+                        scalar1 > (Integer) compoundParameter.getUpper(dim1) ||
+                        scalar2 < (Integer) compoundParameter.getLower(dim2) ||
+                        scalar2 > (Integer) compoundParameter.getUpper(dim2)) {
+                    logq = Double.NEGATIVE_INFINITY;
+                } else {
+                    compoundParameter.setValue(dim1, scalar1);
+                    compoundParameter.setValue(dim2, scalar2);
+                }
+
+            }
+
+        }
+
+        //System.err.println("apply deltaEx");
+        // symmetrical move so return a zero hasting ratio
+        return logq;
+    }
+
+    @Override
+    public double getCoercableParameterValue() {
+        return delta;
+    }
+
+    @Override
+    public void setCoercableParameterValue(final double fValue) {
+        delta = fValue;
+    }
+
+    /**
+     * called after every invocation of this operator to see whether
+     * a parameter can be optimised for better acceptance hence faster
+     * mixing
+     *
+     * @param logAlpha difference in posterior between previous state & proposed state + hasting ratio
+     */
+    @Override
+    public void optimize(final double logAlpha) {
+        // must be overridden by operator implementation to have an effect
+        if (autoOptimize) {
+            double fDelta = calcDelta(logAlpha);
+            fDelta += Math.log(delta);
+            delta = Math.exp(fDelta);
+            if (isIntegerOperator) {
+            	// when delta < 0.5
+            	// Randomizer.nextInt((int) Math.round(delta)) becomes
+            	// Randomizer.nextInt(0) which results in an exception
+            	delta = Math.max(0.5000000001, delta);
+            }
+        }
+
+    }
+
+    @Override
+    public final String getPerformanceSuggestion() {
+        final double prob = m_nNrAccepted / (m_nNrAccepted + m_nNrRejected + 0.0);
+        final double targetProb = getTargetAcceptanceProbability();
+
+        double ratio = prob / targetProb;
+        if (ratio > 2.0) ratio = 2.0;
+        if (ratio < 0.5) ratio = 0.5;
+
+        // new scale factor
+        final double newDelta = delta * ratio;
+
+        final DecimalFormat formatter = new DecimalFormat("#.###");
+        if (prob < 0.10) {
+            return "Try setting delta to about " + formatter.format(newDelta);
+        } else if (prob > 0.40) {
+            return "Try setting delta to about " + formatter.format(newDelta);
+        } else return "";
+    }
+    
+}
diff --git a/src/beast/evolution/operators/Exchange.java b/src/beast/evolution/operators/Exchange.java
new file mode 100644
index 0000000..a2cad80
--- /dev/null
+++ b/src/beast/evolution/operators/Exchange.java
@@ -0,0 +1,244 @@
+/*
+* File Exchange.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+/*
+ * ExchangeOperator.java
+ *
+ * Copyright (C) 2002-2006 Alexei Drummond and Andrew Rambaut
+ *
+ * This file is part of BEAST.
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership and licensing.
+ *
+ * BEAST 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
+ * of the License, or (at your option) any later version.
+ *
+ *  BEAST 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 BEAST; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+package beast.evolution.operators;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.evolution.tree.Node;
+import beast.evolution.tree.Tree;
+import beast.util.Randomizer;
+
+
+/*
+ * KNOWN BUGS: WIDE operator cannot be used on trees with 4 or less tips!
+ */
+
+ at Description("Implements branch exchange operations. There is a NARROW and WIDE variety. " +
+        "The narrow exchange is very similar to a rooted-beast.tree nearest-neighbour " +
+        "interchange but with the restriction that node height must remain consistent.")
+public class Exchange extends TreeOperator {
+    public Input<Boolean> isNarrowInput = new Input<Boolean>("isNarrow", "if true (default) a narrow exchange is performed, otherwise a wide exchange", true);
+
+    @Override
+    public void initAndValidate() {
+    }
+
+    /**
+     * override this for proposals,
+     *
+     * @return log of Hastings Ratio, or Double.NEGATIVE_INFINITY if proposal should not be accepted *
+     */
+    @Override
+    public double proposal() {
+        final Tree tree = treeInput.get(this);
+
+        double fLogHastingsRatio = 0;
+
+        if (isNarrowInput.get()) {
+            fLogHastingsRatio = narrow(tree);
+        } else {
+            fLogHastingsRatio = wide(tree);
+        }
+
+        return fLogHastingsRatio;
+    }
+
+    private int isg(final Node n) {
+      return (n.getLeft().isLeaf() && n.getRight().isLeaf()) ? 0 : 1;
+    }
+
+    private int sisg(final Node n) {
+        return n.isLeaf() ? 0 : isg(n);
+    }
+
+    /**
+     * WARNING: Assumes strictly bifurcating beast.tree.
+     */
+    public double narrow(final Tree tree) {
+
+        if( true ) {
+            //        Alternative implementation that has less risk of rejection due to
+            //    	  selecting an invalid initial node
+            //
+            final int nInternalNodes = tree.getInternalNodeCount();
+            if (nInternalNodes <= 1) {
+                return Double.NEGATIVE_INFINITY;
+            }
+
+            Node iGrandParent = tree.getNode(nInternalNodes + 1 + Randomizer.nextInt(nInternalNodes));
+            while (iGrandParent.getLeft().isLeaf() && iGrandParent.getRight().isLeaf()) {
+                iGrandParent = tree.getNode(nInternalNodes + 1 + Randomizer.nextInt(nInternalNodes));
+            }
+
+            Node iParent = iGrandParent.getLeft();
+            Node iUncle = iGrandParent.getRight();
+            if (iParent.getHeight() < iUncle.getHeight()) {
+                iParent = iGrandParent.getRight();
+                iUncle = iGrandParent.getLeft();
+            }
+
+            if( iParent.isLeaf() ) {
+                // tree with dated tips
+                return Double.NEGATIVE_INFINITY;
+            }
+
+            int validGP = 0;
+            {
+                for(int i = nInternalNodes + 1; i < 1 + 2*nInternalNodes; ++i) {
+                    validGP += isg(tree.getNode(i));
+                }
+            }
+
+            final int c2 = sisg(iParent) + sisg(iUncle);
+
+            final Node i = (Randomizer.nextBoolean() ? iParent.getLeft() : iParent.getRight());
+            exchangeNodes(i, iUncle, iParent, iGrandParent);
+
+            final int validGPafter = validGP - c2 + sisg(iParent) + sisg(iUncle);
+
+            return Math.log((float)validGP/validGPafter);
+        } else {
+
+            final int nNodes = tree.getNodeCount();
+
+            Node i = tree.getRoot();
+
+            while (i.isRoot() || i.getParent().isRoot()) {
+                i = tree.getNode(Randomizer.nextInt(nNodes));
+            }
+
+            final Node iParent = i.getParent();
+            final Node iGrandParent = iParent.getParent();
+            Node iUncle = iGrandParent.getLeft();
+            if (iUncle.getNr() == iParent.getNr()) {
+                iUncle = iGrandParent.getRight();
+                assert (iUncle.getNr() != iParent.getNr());
+            }
+            assert iUncle == getOtherChild(iGrandParent, iParent);
+
+            assert i.getHeight() <= iGrandParent.getHeight();
+
+            if (//i.getHeight() < iUncle.getHeight() &&
+                    iUncle.getHeight() < iParent.getHeight()) {
+                exchangeNodes(i, iUncle, iParent, iGrandParent);
+                return 0;
+            } else {
+                // Couldn't find valid narrow move on this beast.tree!!
+                return Double.NEGATIVE_INFINITY;
+            }
+        }
+    }
+
+    /**
+     * WARNING: Assumes strictly bifurcating beast.tree.
+     * @param tree
+     */
+    public double wide(final Tree tree) {
+
+        final int nodeCount = tree.getNodeCount();
+
+        Node i = tree.getRoot();
+
+        while (i.isRoot()) {
+            i = tree.getNode(Randomizer.nextInt(nodeCount));
+        }
+
+        Node j = i;
+        while (j.getNr() == i.getNr() || j.isRoot()) {
+            j = tree.getNode(Randomizer.nextInt(nodeCount));
+        }
+
+        final Node iP = i.getParent();
+        final Node jP = j.getParent();
+
+        if ((iP != jP) && (i != jP) && (j != iP)
+                && (j.getHeight() < iP.getHeight())
+                && (i.getHeight() < jP.getHeight())
+//                && ((iP.getHeight() < jP.getHeight() && i.getHeight() < j.getHeight()) ||
+//                (iP.getHeight() > jP.getHeight() && i.getHeight() > j.getHeight()))
+                ) {
+            exchangeNodes(i, j, iP, jP);
+
+            // All the nodes on the path from i/j to the common ancestor of i/j parents had a topology change,
+            // so they need to be marked FILTHY.
+            if( markCladesInput.get() ) {
+                Node iup = iP;
+                Node jup = jP;
+                while (iup != jup) {
+                    if( iup.getHeight() < jup.getHeight() ) {
+                        assert !iup.isRoot();
+                        iup = iup.getParent();
+                        iup.makeDirty(Tree.IS_FILTHY);
+                    } else {
+                        assert !jup.isRoot();
+                        jup = jup.getParent();
+                        jup.makeDirty(Tree.IS_FILTHY);
+                    }
+                }
+            }
+            return 0;
+        }
+
+        // Randomly selected nodes i and j are not valid candidates for a wide exchange.
+        // reject instead of counting (like we do for narrow).
+        return Double.NEGATIVE_INFINITY;
+    }
+
+
+    /* exchange sub-trees whose root are i and j */
+
+    protected void exchangeNodes(Node i, Node j,
+                                 Node iP, Node jP) {
+        // precondition iP -> i & jP -> j
+        replace(iP, i, j);
+        replace(jP, j, i);
+        // postcondition iP -> j & iP -> i
+    }
+}
diff --git a/src/beast/evolution/operators/IntRandomWalkOperator.java b/src/beast/evolution/operators/IntRandomWalkOperator.java
new file mode 100644
index 0000000..3f51d38
--- /dev/null
+++ b/src/beast/evolution/operators/IntRandomWalkOperator.java
@@ -0,0 +1,57 @@
+package beast.evolution.operators;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.Operator;
+import beast.core.Input.Validate;
+import beast.core.parameter.IntegerParameter;
+import beast.util.Randomizer;
+
+
+ at Description("A random walk operator that selects a random dimension of the integer parameter and perturbs the value a " +
+        "random amount within +/- windowSize.")
+public class IntRandomWalkOperator extends Operator {
+    public Input<Integer> windowSizeInput =
+            new Input<Integer>("windowSize", "the size of the window both up and down", Validate.REQUIRED);
+    public Input<IntegerParameter> parameterInput =
+            new Input<IntegerParameter>("parameter", "the parameter to operate a random walk on.", Validate.REQUIRED);
+
+    int windowSize = 1;
+
+    public void initAndValidate() {
+        windowSize = windowSizeInput.get();
+    }
+
+    /**
+     * override this for proposals,
+     * returns log of hastingRatio, or Double.NEGATIVE_INFINITY if proposal should not be accepted *
+     */
+    @Override
+    public double proposal() {
+
+        final IntegerParameter param = parameterInput.get(this);
+
+        final int i = Randomizer.nextInt(param.getDimension());
+        final int value = param.getValue(i);
+        final int newValue = value + Randomizer.nextInt(2 * windowSize + 1) - windowSize;
+
+        if (newValue < param.getLower() || newValue > param.getUpper()) {
+            // invalid move, can be rejected immediately
+            return Double.NEGATIVE_INFINITY;
+        }
+        if (newValue == value) {
+            // this saves calculating the posterior
+            return Double.NEGATIVE_INFINITY;
+        }
+
+        param.setValue(i, newValue);
+
+        return 0.0;
+    }
+
+    @Override
+    public void optimize(final double logAlpha) {
+        // nothing to optimise
+    }
+
+} // class IntRandomWalkOperator
\ No newline at end of file
diff --git a/src/beast/evolution/operators/IntUniformOperator.java b/src/beast/evolution/operators/IntUniformOperator.java
new file mode 100644
index 0000000..e3aefdf
--- /dev/null
+++ b/src/beast/evolution/operators/IntUniformOperator.java
@@ -0,0 +1,43 @@
+package beast.evolution.operators;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.Operator;
+import beast.core.Input.Validate;
+import beast.core.parameter.IntegerParameter;
+import beast.util.Randomizer;
+
+
+ at Description("A uniform random operator that selects a random dimension of the integer parameter and picks a new random value within the bounds.")
+ at Deprecated
+public class IntUniformOperator extends Operator {
+    public Input<IntegerParameter> parameterInput = new Input<IntegerParameter>("parameter", "the parameter to operate a random walk on.", Validate.REQUIRED);
+
+
+    public void initAndValidate() {
+        System.err.println("\n\nIntUniformOperator is depracated. Use UniformOperator instead.\n\n");
+    }
+
+    /**
+     * override this for proposals,
+     * returns log of hastingRatio, or Double.NEGATIVE_INFINITY if proposal should not be accepted *
+     */
+    @Override
+    public double proposal() {
+
+        IntegerParameter param = parameterInput.get(this);
+
+        int i = Randomizer.nextInt(param.getDimension());
+        int newValue = Randomizer.nextInt(param.getUpper() - param.getLower() + 1) + param.getLower();
+
+        param.setValue(i, newValue);
+
+        return 0.0;
+    }
+
+    @Override
+    public void optimize(double logAlpha) {
+        // nothing to optimise
+    }
+
+} // class IntUniformOperator
\ No newline at end of file
diff --git a/src/beast/evolution/operators/JointOperator.java b/src/beast/evolution/operators/JointOperator.java
new file mode 100644
index 0000000..1f033ed
--- /dev/null
+++ b/src/beast/evolution/operators/JointOperator.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2013 Tim Vaughan <tgvaughan at gmail.com>
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+package beast.evolution.operators;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.Operator;
+import beast.core.StateNode;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * @author Tim Vaughan <tgvaughan at gmail.com>
+ */
+ at Description("Operator which allows multiple operators to be chained together."
+        + " This is only correct when each operator acts on a different part"
+        + " of the state.")
+public class JointOperator extends Operator {
+    
+    public Input<List<Operator>> operatorsInput = new Input<List<Operator>>(
+            "operator",
+            "List of operators to combine into one operation.",
+            new ArrayList<Operator>());
+
+    @Override
+    public void initAndValidate() { }
+    
+    @Override
+    public double proposal() {
+        double logHR = 0;
+       
+        for (Operator op : operatorsInput.get()) {
+
+            logHR += op.proposal();
+            
+            // Stop here if the move is going to be rejected anyway
+            if (logHR == Double.NEGATIVE_INFINITY)
+                break;
+            
+            // Update calculation nodes as subsequent operators may depend on
+            // state nodes made dirty by this operation.
+            try {
+                if (!op.listStateNodes().isEmpty())
+                    op.listStateNodes().get(0).getState().checkCalculationNodesDirtiness();
+            } catch (Exception ex) {
+                Logger.getLogger(JointOperator.class.getName()).log(Level.SEVERE, null, ex);
+            }
+        }
+        
+        return logHR;
+    }
+    
+    @Override
+    public List<StateNode> listStateNodes() throws Exception {
+        List<StateNode> stateNodeList = new ArrayList<StateNode>();
+        
+        for (Operator op : operatorsInput.get())
+            stateNodeList.addAll(op.listStateNodes());
+        
+        return stateNodeList;
+    }
+}
diff --git a/src/beast/evolution/operators/NodeReheight.java b/src/beast/evolution/operators/NodeReheight.java
new file mode 100644
index 0000000..8866818
--- /dev/null
+++ b/src/beast/evolution/operators/NodeReheight.java
@@ -0,0 +1,301 @@
+package beast.evolution.operators;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.Input.Validate;
+import beast.evolution.alignment.Taxon;
+import beast.evolution.alignment.TaxonSet;
+import beast.evolution.tree.Node;
+import beast.evolution.tree.Tree;
+import beast.util.Randomizer;
+
+
+
+ at Description("Tree operator which randomly changes the height of a node, " +
+        "then reconstructs the tree from node heights.")
+public class NodeReheight extends TreeOperator {
+    public final Input<TaxonSet> taxonSetInput = new Input<TaxonSet>("taxonset", "taxon set describing species tree taxa and their gene trees", Validate.REQUIRED);
+    public final Input<List<Tree>> geneTreesInput = new Input<List<Tree>>("genetree", "list of gene trees that constrain species tree movement", new ArrayList<Tree>());
+    Node[] m_nodes;
+
+
+    /**
+     * map node number of leafs in gene trees to leaf nr in species tree *
+     */
+    List<Map<Integer, Integer>> m_taxonMap;
+    int nrOfGeneTrees;
+    int nrOfSpecies;
+
+    @Override
+    public void initAndValidate() throws Exception {
+        /** maps gene taxa names to species number **/
+        final Map<String, Integer> taxonMap = new HashMap<String, Integer>();
+        final List<Taxon> list = taxonSetInput.get().taxonsetInput.get();
+        for (int i = 0; i < list.size(); i++) {
+            final Taxon taxa = list.get(i);
+            // cast should be ok if taxon-set is the set for the species tree
+            final TaxonSet set = (TaxonSet) taxa;
+            for (final Taxon taxon : set.taxonsetInput.get()) {
+                taxonMap.put(taxon.getID(), i);
+            }
+        }
+
+        /** build the taxon map for each gene tree **/
+        m_taxonMap = new ArrayList<Map<Integer, Integer>>();
+        for (final Tree tree : geneTreesInput.get()) {
+            final Map<Integer, Integer> map = new HashMap<Integer, Integer>();
+            setupTaxaMap(tree.getRoot(), map, taxonMap);
+            m_taxonMap.add(map);
+        }
+
+        nrOfGeneTrees = geneTreesInput.get().size();
+        nrOfSpecies = treeInput.get().getLeafNodeCount();
+    }
+
+    // initialisation code: create node number in gene tree to node number in species tree map
+    private void setupTaxaMap(final Node node, final Map<Integer, Integer> map, final Map<String, Integer> taxonMap) {
+        if (node.isLeaf()) {
+            map.put(node.getNr(), taxonMap.get(node.getID()));
+        } else {
+            setupTaxaMap(node.getLeft(), map, taxonMap);
+            setupTaxaMap(node.getRight(), map, taxonMap);
+        }
+    }
+
+    @Override
+    public double proposal() {
+        final Tree tree = treeInput.get();
+        m_nodes = tree.getNodesAsArray();
+        final int nNodes = tree.getNodeCount();
+        // randomly change left/right order
+        tree.startEditing(this);  // we change the tree
+        reorder(tree.getRoot());
+        // collect heights
+        final double[] fHeights = new double[nNodes];
+        final int[] iReverseOrder = new int[nNodes];
+        collectHeights(tree.getRoot(), fHeights, iReverseOrder, 0);
+        // change height of an internal node
+        int iNode = Randomizer.nextInt(fHeights.length);
+        while (m_nodes[iReverseOrder[iNode]].isLeaf()) {
+            iNode = Randomizer.nextInt(fHeights.length);
+        }
+        final double fMaxHeight = calcMaxHeight(iReverseOrder, iNode);
+        fHeights[iNode] = Randomizer.nextDouble() * fMaxHeight;
+        m_nodes[iReverseOrder[iNode]].setHeight(fHeights[iNode]);
+        // reconstruct tree from heights
+        final Node root = reconstructTree(fHeights, iReverseOrder, 0, fHeights.length, new boolean[fHeights.length]);
+
+        assert checkConsistency(root, new boolean[fHeights.length]) ;
+//            System.err.println("Inconsisten tree");
+//        }
+        root.setParent(null);
+        tree.setRoot(root);
+        return 0;
+    }
+
+    private boolean checkConsistency(final Node node, final boolean[] bUsed) {
+        if (bUsed[node.getNr()]) {
+            // used twice? tha's bad
+            return false;
+        }
+        bUsed[node.getNr()] = true;
+        if ( node.isLeaf() ) {
+            return true;
+        }
+        return checkConsistency(node.getLeft(), bUsed) && checkConsistency(node.getRight(), bUsed);
+    }
+
+    /**
+     * calculate maximum height that node iNode can become restricted
+     * by nodes on the left and right
+     */
+    private double calcMaxHeight(final int[] iReverseOrder, final int iNode) {
+        // find maximum height between two species. Only upper right part is populated
+        final double[][] fMaxHeight = new double[nrOfSpecies][nrOfSpecies];
+        for (int i = 0; i < nrOfSpecies; i++) {
+            Arrays.fill(fMaxHeight[i], Double.POSITIVE_INFINITY);
+        }
+
+        // calculate for every species tree the maximum allowable merge point
+        for (int i = 0; i < nrOfGeneTrees; i++) {
+            final Tree tree = geneTreesInput.get().get(i);
+            findMaximaInGeneTree(tree.getRoot(), new boolean[nrOfSpecies], m_taxonMap.get(i), fMaxHeight);
+        }
+
+        // find species on the left of selected node
+        final boolean[] bLowerSpecies = new boolean[nrOfSpecies];
+        final Node[] nodes = treeInput.get().getNodesAsArray();
+        for (int i = 0; i < iNode; i++) {
+            final Node node = nodes[iReverseOrder[i]];
+            if (node.isLeaf()) {
+                bLowerSpecies[node.getNr()] = true;
+            }
+        }
+        // find species on the right of selected node
+        final boolean[] bUpperSpecies = new boolean[nrOfSpecies];
+        for (int i = iNode + 1; i < nodes.length; i++) {
+            final Node node = nodes[iReverseOrder[i]];
+            if (node.isLeaf()) {
+                bUpperSpecies[node.getNr()] = true;
+            }
+        }
+
+        // find max
+        double fMax = Double.POSITIVE_INFINITY;
+        for (int i = 0; i < nrOfSpecies; i++) {
+            if (bLowerSpecies[i]) {
+                for (int j = 0; j < nrOfSpecies; j++) {
+                    if (j != i && bUpperSpecies[j]) {
+                        final int x = Math.min(i, j);
+                        final int y = Math.max(i, j);
+                        fMax = Math.min(fMax, fMaxHeight[x][y]);
+                    }
+                }
+            }
+        }
+        return fMax;
+    } // calcMaxHeight
+
+
+    /**
+     * for every species in the left on the gene tree and for every species in the right
+     * cap the maximum join height by the lowest place the two join in the gene tree
+     */
+    private void findMaximaInGeneTree(final Node node, final boolean[] taxonSet, final Map<Integer, Integer> taxonMap, final double[][] fMaxHeight) {
+        if (node.isLeaf()) {
+            final int iSpecies = taxonMap.get(node.getNr());
+            taxonSet[iSpecies] = true;
+        } else {
+            final boolean[] bLeftTaxonSet = new boolean[nrOfSpecies];
+            findMaximaInGeneTree(node.getLeft(), bLeftTaxonSet, taxonMap, fMaxHeight);
+            final boolean[] bRightTaxonSet = new boolean[nrOfSpecies];
+            findMaximaInGeneTree(node.getRight(), bRightTaxonSet, taxonMap, fMaxHeight);
+            for (int i = 0; i < nrOfSpecies; i++) {
+                if (bLeftTaxonSet[i]) {
+                    for (int j = 0; j < nrOfSpecies; j++) {
+                        if (j != i && bRightTaxonSet[j]) {
+                            final int x = Math.min(i, j);
+                            final int y = Math.max(i, j);
+                            fMaxHeight[x][y] = Math.min(fMaxHeight[x][y], node.getHeight());
+                        }
+                    }
+                }
+            }
+            for (int i = 0; i < nrOfSpecies; i++) {
+                taxonSet[i] = bLeftTaxonSet[i] | bRightTaxonSet[i];
+            }
+        }
+    }
+
+    /**
+     * construct tree top down by joining heighest left and right nodes *
+     */
+
+
+    private Node reconstructTree(final double[] fHeights, final int[] iReverseOrder, final int iFrom, final int iTo, final boolean[] bHasParent) {
+        //iNode = maxIndex(fHeights, 0, fHeights.length);
+        int iNode = -1;
+        double fMax = Double.NEGATIVE_INFINITY;
+        for (int j = iFrom; j < iTo; j++) {
+            if (fMax < fHeights[j] && !m_nodes[iReverseOrder[j]].isLeaf()) {
+                fMax = fHeights[j];
+                iNode = j;
+            }
+        }
+        if (iNode < 0) {
+            return null;
+        }
+        final Node node = m_nodes[iReverseOrder[iNode]];
+
+        //int iLeft = maxIndex(fHeights, 0, iNode);
+        int iLeft = -1;
+        fMax = Double.NEGATIVE_INFINITY;
+        for (int j = iFrom; j < iNode; j++) {
+            if (fMax < fHeights[j] && !bHasParent[j]) {
+                fMax = fHeights[j];
+                iLeft = j;
+            }
+        }
+
+        //int iRight = maxIndex(fHeights, iNode+1, fHeights.length);
+        int iRight = -1;
+        fMax = Double.NEGATIVE_INFINITY;
+        for (int j = iNode + 1; j < iTo; j++) {
+            if (fMax < fHeights[j] && !bHasParent[j]) {
+                fMax = fHeights[j];
+                iRight = j;
+            }
+        }
+
+        node.setLeft(m_nodes[iReverseOrder[iLeft]]);
+        node.getLeft().setParent(node);
+        node.setRight(m_nodes[iReverseOrder[iRight]]);
+        node.getRight().setParent(node);
+        if (node.getLeft().isLeaf()) {
+            fHeights[iLeft] = Double.NEGATIVE_INFINITY;
+        }
+        if (node.getRight().isLeaf()) {
+            fHeights[iRight] = Double.NEGATIVE_INFINITY;
+        }
+        bHasParent[iLeft] = true;
+        bHasParent[iRight] = true;
+        fHeights[iNode] = Double.NEGATIVE_INFINITY;
+
+
+        reconstructTree(fHeights, iReverseOrder, iFrom, iNode, bHasParent);
+        reconstructTree(fHeights, iReverseOrder, iNode, iTo, bHasParent);
+        return node;
+    }
+
+    // helper for reconstructTree, to find maximum in range
+//    private int maxIndex(final double[] fHeights, final int iFrom, final int iTo) {
+//        int iMax = -1;
+//        double fMax = Double.NEGATIVE_INFINITY;
+//        for (int i = iFrom; i < iTo; i++) {
+//            if (fMax < fHeights[i]) {
+//                fMax = fHeights[i];
+//                iMax = i;
+//            }
+//        }
+//        return iMax;
+//    }
+
+   /**
+      ** gather height of each node, and the node index associated with the height.*
+      **/
+    private int collectHeights(final Node node, final double[] fHeights, final int[] iReverseOrder, int iCurrent) {
+        if (node.isLeaf()) {
+            fHeights[iCurrent] = node.getHeight();
+            iReverseOrder[iCurrent] = node.getNr();
+            iCurrent++;
+        } else {
+            iCurrent = collectHeights(node.getLeft(), fHeights, iReverseOrder, iCurrent);
+            fHeights[iCurrent] = node.getHeight();
+            iReverseOrder[iCurrent] = node.getNr();
+            iCurrent++;
+            iCurrent = collectHeights(node.getRight(), fHeights, iReverseOrder, iCurrent);
+        }
+        return iCurrent;
+    }
+
+    /**
+     * randomly changes left and right children in every internal node *
+     */
+    private void reorder(final Node node) {
+        if (!node.isLeaf()) {
+            if (Randomizer.nextBoolean()) {
+                final Node tmp = node.getLeft();
+                node.setLeft(node.getRight());
+                node.setRight(tmp);
+            }
+            reorder(node.getLeft());
+            reorder(node.getRight());
+        }
+    }
+} // class NodeReheight
diff --git a/src/beast/evolution/operators/RealRandomWalkOperator.java b/src/beast/evolution/operators/RealRandomWalkOperator.java
new file mode 100644
index 0000000..803d2fd
--- /dev/null
+++ b/src/beast/evolution/operators/RealRandomWalkOperator.java
@@ -0,0 +1,110 @@
+package beast.evolution.operators;
+
+import java.text.DecimalFormat;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.Operator;
+import beast.core.Input.Validate;
+import beast.core.parameter.RealParameter;
+import beast.util.Randomizer;
+
+
+
+
+ at Description("A random walk operator that selects a random dimension of the real parameter and perturbs the value a " +
+        "random amount within +/- windowSize.")
+public class RealRandomWalkOperator extends Operator {
+    public Input<Double> windowSizeInput =
+            new Input<Double>("windowSize", "the size of the window both up and down when using uniform interval OR standard deviation when using Gaussian", Input.Validate.REQUIRED);
+    public Input<RealParameter> parameterInput =
+            new Input<RealParameter>("parameter", "the parameter to operate a random walk on.", Validate.REQUIRED);
+    public Input<Boolean> useGaussianInput =
+            new Input<Boolean>("useGaussian", "Use Gaussian to move instead of uniform interval. Default false.", false);
+
+    double windowSize = 1;
+    boolean useGaussian;
+
+    public void initAndValidate() {
+        windowSize = windowSizeInput.get();
+        useGaussian = useGaussianInput.get();
+    }
+
+    /**
+     * override this for proposals,
+     * returns log of hastingRatio, or Double.NEGATIVE_INFINITY if proposal should not be accepted *
+     */
+    @Override
+    public double proposal() {
+
+        RealParameter param = parameterInput.get(this);
+
+        int i = Randomizer.nextInt(param.getDimension());
+        double value = param.getValue(i);
+        double newValue = value;
+        if (useGaussian) {
+            newValue += Randomizer.nextGaussian() * windowSize;
+        } else {
+            newValue += Randomizer.nextDouble() * 2 * windowSize - windowSize;
+        }
+
+        if (newValue < param.getLower() || newValue > param.getUpper()) {
+            return Double.NEGATIVE_INFINITY;
+        }
+        if (newValue == value) {
+            // this saves calculating the posterior
+            return Double.NEGATIVE_INFINITY;
+        }
+
+        param.setValue(i, newValue);
+
+        return 0.0;
+    }
+
+
+    @Override
+    public double getCoercableParameterValue() {
+        return windowSize;
+    }
+
+    @Override
+    public void setCoercableParameterValue(double fValue) {
+        windowSize = fValue;
+    }
+
+    /**
+     * called after every invocation of this operator to see whether
+     * a parameter can be optimised for better acceptance hence faster
+     * mixing
+     *
+     * @param logAlpha difference in posterior between previous state & proposed state + hasting ratio
+     */
+    @Override
+    public void optimize(double logAlpha) {
+        // must be overridden by operator implementation to have an effect
+        double fDelta = calcDelta(logAlpha);
+
+        fDelta += Math.log(windowSize);
+        windowSize = Math.exp(fDelta);
+    }
+
+    @Override
+    public final String getPerformanceSuggestion() {
+        double prob = m_nNrAccepted / (m_nNrAccepted + m_nNrRejected + 0.0);
+        double targetProb = getTargetAcceptanceProbability();
+
+        double ratio = prob / targetProb;
+        if (ratio > 2.0) ratio = 2.0;
+        if (ratio < 0.5) ratio = 0.5;
+
+        // new scale factor
+        double newWindowSize = windowSize * ratio;
+
+        DecimalFormat formatter = new DecimalFormat("#.###");
+        if (prob < 0.10) {
+            return "Try setting window size to about " + formatter.format(newWindowSize);
+        } else if (prob > 0.40) {
+            return "Try setting window size to about " + formatter.format(newWindowSize);
+        } else return "";
+    }
+} // class RealRandomWalkOperator
\ No newline at end of file
diff --git a/src/beast/evolution/operators/ScaleOperator.java b/src/beast/evolution/operators/ScaleOperator.java
new file mode 100644
index 0000000..8af180a
--- /dev/null
+++ b/src/beast/evolution/operators/ScaleOperator.java
@@ -0,0 +1,317 @@
+/*
+* File ScaleOperator.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+package beast.evolution.operators;
+
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.Operator;
+import beast.core.parameter.BooleanParameter;
+import beast.core.parameter.RealParameter;
+import beast.evolution.tree.Node;
+import beast.evolution.tree.Tree;
+import beast.util.Randomizer;
+
+import java.text.DecimalFormat;
+
+
+ at Description("Scales a parameter or a complete beast.tree (depending on which of the two is specified.")
+public class ScaleOperator extends Operator {
+
+    public final Input<Tree> treeInput = new Input<Tree>("tree", "if specified, all beast.tree divergence times are scaled");
+
+    public final Input<RealParameter> parameterInput = new Input<RealParameter>("parameter", "if specified, this parameter is scaled",
+            Input.Validate.XOR, treeInput);
+
+    public final Input<Double> scaleFactorInput = new Input<Double>("scaleFactor", "scaling factor: larger means more bold proposals", 1.0);
+    public final Input<Boolean> scaleAllInput =
+            new Input<Boolean>("scaleAll", "if true, all elements of a parameter (not beast.tree) are scaled, otherwise one is randomly selected",
+                    false);
+    public final Input<Boolean> scaleAllIndependentlyInput =
+            new Input<Boolean>("scaleAllIndependently", "if true, all elements of a parameter (not beast.tree) are scaled with " +
+                    "a different factor, otherwise a single factor is used", false);
+
+    public Input<Integer> degreesOfFreedomInput = new Input<Integer>("degreesOfFreedom", "Degrees of freedom used when " +
+            "scaleAllIndependently=false and scaleAll=true to override default in calculation of Hasting ratio. " +
+            "Ignored when less than 1, default 0.", 0);
+    public Input<BooleanParameter> indicatorInput = new Input<BooleanParameter>("indicator", "indicates which of the dimension " +
+            "of the parameters can be scaled. Only used when scaleAllIndependently=false and scaleAll=false. If not specified " +
+            "it is assumed all dimensions are allowed to be scaled.");
+    public Input<Boolean> rootOnlyInput = new Input<Boolean>("rootOnly", "scale root of a tree only, ignored if tree is not specified (default false)", false);
+    public Input<Boolean> optimiseInput = new Input<Boolean>("optimise", "flag to indicate that the scale factor is automatically changed in order to achieve a good acceptance rate (default true)", true);
+
+    public Input<Double> scaleUpperLimit = new Input<Double>("upper", "Upper Limit of scale factor", 1.0 - 1e-8);
+    public Input<Double> scaleLowerLimit = new Input<Double>("lower", "Lower limit of scale factor", 1e-8);
+
+    /**
+     * shadows input *
+     */
+    private double m_fScaleFactor;
+
+    private double upper, lower;
+    /**
+     * flag to indicate this scales trees as opposed to scaling a parameter *
+     */
+    boolean m_bIsTreeScaler = true;
+
+    @Override
+    public void initAndValidate() throws Exception {
+        m_fScaleFactor = scaleFactorInput.get();
+        m_bIsTreeScaler = (treeInput.get() != null);
+        upper = scaleUpperLimit.get();
+        lower = scaleLowerLimit.get();
+
+        final BooleanParameter indicators = indicatorInput.get();
+        if (indicators != null) {
+            if (m_bIsTreeScaler) {
+                throw new Exception("indicator is specified which has no effect for scaling a tree");
+            }
+            final int dataDim = parameterInput.get().getDimension();
+            final int indsDim = indicators.getDimension();
+            if (!(indsDim == dataDim || indsDim + 1 == dataDim)) {
+                throw new Exception("indicator dimension not compatible from parameter dimension");
+            }
+        }
+    }
+
+
+    protected boolean outsideBounds(final double value, final RealParameter param) {
+        final Double l = param.getLower();
+        final Double h = param.getUpper();
+
+        return (value < l || value > h);
+        //return (l != null && value < l || h != null && value > h);
+    }
+
+    protected double getScaler() {
+        return (m_fScaleFactor + (Randomizer.nextDouble() * ((1.0 / m_fScaleFactor) - m_fScaleFactor)));
+    }
+
+    /**
+     * override this for proposals,
+     *
+     * @return log of Hastings Ratio, or Double.NEGATIVE_INFINITY if proposal should not be accepted *
+     */
+    @Override
+    public double proposal() {
+
+        try {
+
+            double hastingsRatio;
+            final double scale = getScaler();
+
+            if (m_bIsTreeScaler) {
+
+                final Tree tree = treeInput.get(this);
+                if (rootOnlyInput.get()) {
+                    final Node root = tree.getRoot();
+                    final double fNewHeight = root.getHeight() * scale;
+
+                    if (fNewHeight < Math.max(root.getLeft().getHeight(), root.getRight().getHeight())) {
+                        return Double.NEGATIVE_INFINITY;
+                    }
+                    root.setHeight(fNewHeight);
+                    return -Math.log(scale);
+                } else {
+                    // scale the beast.tree
+                    final int nInternalNodes = tree.scale(scale);
+                    return Math.log(scale) * (nInternalNodes - 2);
+                }
+            }
+
+            // not a tree scaler, so scale a parameter
+            final boolean bScaleAll = scaleAllInput.get();
+            final int nDegreesOfFreedom = degreesOfFreedomInput.get();
+            final boolean bScaleAllIndependently = scaleAllIndependentlyInput.get();
+
+            final RealParameter param = parameterInput.get(this);
+
+            assert param.getLower() != null && param.getUpper() != null;
+
+            final int dim = param.getDimension();
+
+            if (bScaleAllIndependently) {
+                // update all dimensions independently.
+                hastingsRatio = 0;
+                final BooleanParameter indicators = indicatorInput.get();
+                if (indicators != null) {
+                    final int nDim = indicators.getDimension();
+                    final Boolean[] indicator = indicators.getValues();
+                    final boolean impliedOne = nDim == (dim - 1);
+                    for (int i = 0; i < dim; i++) {
+                        if( (impliedOne && (i == 0 || indicator[i-1])) || (!impliedOne && indicator[i]) )  {
+                            final double scaleOne = getScaler();
+                            final double newValue = scaleOne * param.getValue(i);
+
+                            hastingsRatio -= Math.log(scaleOne);
+
+                            if (outsideBounds(newValue, param)) {
+                                return Double.NEGATIVE_INFINITY;
+                            }
+
+                            param.setValue(i, newValue);
+                        }
+                    }
+                }  else {
+
+                    for (int i = 0; i < dim; i++) {
+
+                        final double scaleOne = getScaler();
+                        final double newValue = scaleOne * param.getValue(i);
+
+                        hastingsRatio -= Math.log(scaleOne);
+
+                        if( outsideBounds(newValue, param) ) {
+                            return Double.NEGATIVE_INFINITY;
+                        }
+
+                        param.setValue(i, newValue);
+                    }
+                }
+            } else if (bScaleAll) {
+                // update all dimensions
+                // hasting ratio is dim-2 times of 1dim case. would be nice to have a reference here
+                // for the proof. It is supposed to be somewhere in an Alexei/Nicholes article.
+                final int df = (nDegreesOfFreedom > 0) ? nDegreesOfFreedom - 2 : dim - 2;
+                hastingsRatio = df * Math.log(scale);
+
+                // all Values assumed independent!
+                for (int i = 0; i < dim; i++) {
+                    final double newValue = param.getValue(i) * scale;
+
+                    if (outsideBounds(newValue, param)) {
+                        return Double.NEGATIVE_INFINITY;
+                    }
+                    param.setValue(i, newValue);
+                }
+            } else {
+                hastingsRatio = -Math.log(scale);
+
+                // which position to scale
+                final int index;
+                final BooleanParameter indicators = indicatorInput.get();
+                if (indicators != null) {
+                    final int nDim = indicators.getDimension();
+                    final Boolean[] indicator = indicators.getValues();
+                    final boolean impliedOne = nDim == (dim - 1);
+
+                    // available bit locations. there can be hundreds of them. scan list only once.
+                    final int[] loc = new int[nDim + 1];
+                    int nLoc = 0;
+
+                    if (impliedOne) {
+                        loc[nLoc] = 0;
+                        ++nLoc;
+                    }
+                    for (int i = 0; i < nDim; i++) {
+                        if (indicator[i]) {
+                            loc[nLoc] = i + (impliedOne ? 1 : 0);
+                            ++nLoc;
+                        }
+                    }
+
+                    if (nLoc > 0) {
+                        final int rand = Randomizer.nextInt(nLoc);
+                        index = loc[rand];
+                    } else {
+                        return Double.NEGATIVE_INFINITY; // no active indicators
+                    }
+
+                } else {
+                    // any is good
+                    index = Randomizer.nextInt(dim);
+                }
+
+                final double oldValue = param.getValue(index);
+
+                if (oldValue == 0) {
+                    // Error: parameter has value 0 and cannot be scaled
+                    return Double.NEGATIVE_INFINITY;
+                }
+
+                final double newValue = scale * oldValue;
+
+                if (outsideBounds(newValue, param)) {
+                    // reject out of bounds scales
+                    return Double.NEGATIVE_INFINITY;
+                }
+
+                param.setValue(index, newValue);
+                // provides a hook for subclasses
+                //cleanupOperation(newValue, oldValue);
+            }
+
+            return hastingsRatio;
+
+        } catch (Exception e) {
+            // whatever went wrong, we want to abort this operation...
+            return Double.NEGATIVE_INFINITY;
+        }
+    }
+
+
+    /**
+     * automatic parameter tuning *
+     */
+    @Override
+    public void optimize(final double logAlpha) {
+        if (optimiseInput.get()) {
+            double fDelta = calcDelta(logAlpha);
+            fDelta += Math.log(1.0 / m_fScaleFactor - 1.0);
+            setCoercableParameterValue(1.0 / (Math.exp(fDelta) + 1.0));
+        }
+    }
+
+    @Override
+    public double getCoercableParameterValue() {
+        return m_fScaleFactor;
+    }
+
+    @Override
+    public void setCoercableParameterValue(final double fValue) {
+        m_fScaleFactor = Math.max(Math.min(fValue, upper), lower);
+    }
+
+    @Override
+    public String getPerformanceSuggestion() {
+        final double prob = m_nNrAccepted / (m_nNrAccepted + m_nNrRejected + 0.0);
+        final double targetProb = getTargetAcceptanceProbability();
+
+        double ratio = prob / targetProb;
+        if (ratio > 2.0) ratio = 2.0;
+        if (ratio < 0.5) ratio = 0.5;
+
+        // new scale factor
+        final double sf = Math.pow(m_fScaleFactor, ratio);
+
+        final DecimalFormat formatter = new DecimalFormat("#.###");
+        if (prob < 0.10) {
+            return "Try setting scaleFactor to about " + formatter.format(sf);
+        } else if (prob > 0.40) {
+            return "Try setting scaleFactor to about " + formatter.format(sf);
+        } else return "";
+    }
+
+} // class ScaleOperator
diff --git a/src/beast/evolution/operators/SliceOperator.java b/src/beast/evolution/operators/SliceOperator.java
new file mode 100644
index 0000000..47d3c38
--- /dev/null
+++ b/src/beast/evolution/operators/SliceOperator.java
@@ -0,0 +1,246 @@
+package beast.evolution.operators;
+
+import java.text.DecimalFormat;
+
+import beast.core.Description;
+import beast.core.Distribution;
+import beast.core.Input;
+import beast.core.Operator;
+import beast.core.Input.Validate;
+import beast.core.parameter.RealParameter;
+import beast.core.util.Evaluator;
+import beast.util.Randomizer;
+
+
+
+
+ at Description("A random walk operator that selects a random dimension of the real parameter and perturbs the value a " +
+        "random amount within +/- windowSize.")
+public class SliceOperator extends Operator {
+    public Input<RealParameter> parameterInput =
+            new Input<RealParameter>("parameter", "the parameter to operate a random walk on.", Validate.REQUIRED);
+    public Input<Double> windowSizeInput =
+            new Input<Double>("windowSize", "the size of the step for finding the slice boundaries", Input.Validate.REQUIRED);
+    public Input<Distribution> sliceDensityInput =
+            new Input<Distribution>("sliceDensity", "The density to sample from using slice sampling.", Input.Validate.REQUIRED);
+
+    Double totalDelta;
+    int totalNumber;
+    int n_learning_iterations;
+    double W;
+
+    double windowSize = 1;
+    Distribution sliceDensity;
+
+    public void initAndValidate() {
+        totalDelta = 0.0;
+        totalNumber = 0;
+        n_learning_iterations = 100;
+        W = 0.0;
+        windowSize = windowSizeInput.get();
+        sliceDensity = sliceDensityInput.get();
+    }
+
+    boolean in_range(RealParameter X, double x) {
+        return (X.getLower() < x && x < X.getUpper());
+    }
+
+    boolean below_lower_bound(RealParameter X, double x) {
+        return (x < X.getLower());
+    }
+
+    boolean above_upper_bound(RealParameter X, double x) {
+        return (x > X.getUpper());
+    }
+
+    public Distribution getEvaluatorDistribution() {
+        return sliceDensity;
+    }
+
+    Double evaluate(Evaluator E) {
+        return E.evaluate();
+    }
+
+    Double evaluate(Evaluator E, RealParameter X, double x) {
+        X.setValue(0, x);
+        return evaluate(E);
+    }
+
+    Double[] find_slice_boundaries_stepping_out(Evaluator E, RealParameter X, double logy, double w, int m) {
+        double x0 = X.getValue(0);
+
+        assert in_range(X, x0);
+
+        double u = Randomizer.nextDouble() * w;
+        Double L = x0 - u;
+        Double R = x0 + (w - u);
+
+        // Expand the interval until its ends are outside the slice, or until
+        // the limit on steps is reached.
+
+        if (m > 1) {
+            int J = (int) Math.floor(Randomizer.nextDouble() * m);
+            int K = (m - 1) - J;
+
+            while (J > 0 && (!below_lower_bound(X, L)) && evaluate(E, X, L) > logy) {
+                L -= w;
+                J--;
+            }
+
+            while (K > 0 && (!above_upper_bound(X, R)) && evaluate(E, X, R) > logy) {
+                R += w;
+                K--;
+            }
+        } else {
+            while ((!below_lower_bound(X, L)) && evaluate(E, X, L) > logy)
+                L -= w;
+
+            while ((!above_upper_bound(X, R)) && evaluate(E, X, R) > logy)
+                R += w;
+        }
+
+        // Shrink interval to lower and upper bounds.
+
+        if (below_lower_bound(X, L))
+            L = X.getLower();
+        if (above_upper_bound(X, R))
+            R = X.getUpper();
+
+        assert L < R;
+
+        Double[] range = {L, R};
+        return range;
+    }
+
+    // Does this x0 really need to be the original point?
+    // I think it just serves to let you know which way the interval gets shrunk...
+
+    double search_interval(Evaluator E, double x0, RealParameter X, Double L, Double R, double logy) {
+        //	assert evaluate(E,x0) > evaluate(E,L) && evaluate(E,x0) > evaluate(E,R);
+
+        assert evaluate(E, X, x0) >= logy;
+        assert L < R;
+        assert L <= x0 && x0 <= R;
+
+        double L0 = L, R0 = R;
+
+        double gx0 = evaluate(E, X, x0);
+        assert logy < gx0;
+
+        double x1 = x0;
+        for (int i = 0; i < 200; i++) {
+            x1 = L + Randomizer.nextDouble() * (R - L);
+            double gx1 = evaluate(E, X, x1);
+
+            //	    System.err.println("    L0 = " + L0 + "   x0 = " + x0 + "   R0 = " + R0 + "   gx0 = " + gx0);
+            //	    System.err.println("    L  = " + L  + "   x1 = " + x1 + "   R  = " + R0 + "   gx1 = " + gx1);
+            //	    System.err.println("    logy  = " + logy);
+
+            if (gx1 >= logy) return x1;
+
+            if (x1 > x0)
+                R = x1;
+            else
+                L = x1;
+        }
+        System.err.println("Warning!  Is size of the interval really ZERO?");
+        //	double logy_x0 = evaluate(E,X,x0);
+        System.err.println("    L0 = " + L0 + "   x0 = " + x0 + "   R0 = " + R0 + "   gx0 = " + gx0);
+        System.err.println("    L  = " + L + "   x1 = " + x1 + "   R  = " + R0 + "   gx1 = " + evaluate(E));
+
+        return x0;
+    }
+
+
+    @Override
+    public double proposal() {
+        return 0;
+    }
+
+    /**
+     * override this for proposals,
+     * returns log of hastingRatio, or Double.NEGATIVE_INFINITY if proposal should not be accepted *
+     */
+    @Override
+    public double proposal(Evaluator E) {
+
+        int m = 100;
+
+        RealParameter X = parameterInput.get();
+
+        // Find the density at the current point
+        Double gx0 = evaluate(E);
+
+        //	System.err.println("gx0 = " + gx0);
+        // Get the 1st element
+        Double x0 = X.getValue(0);
+        //	System.err.println("x0 = " + x0);
+
+        // Determine the slice level, in log terms.
+        double logy = gx0 - Randomizer.nextExponential(1);
+
+        // Find the initial interval to sample from.
+        Double[] range = find_slice_boundaries_stepping_out(E, X, logy, windowSize, m);
+        Double L = range[0];
+        Double R = range[1];
+
+        // Sample from the interval, shrinking it on each rejection
+        double x_new = search_interval(E, x0, X, L, R, logy);
+        X.setValue(x_new);
+
+        if (n_learning_iterations > 0) {
+            n_learning_iterations--;
+
+            totalDelta += Math.abs(x_new - x0);
+            totalNumber++;
+
+            double W_predicted = totalDelta / totalNumber * 4.0;
+            if (totalNumber > 3) {
+                W = 0.95 * W + 0.05 * W_predicted;
+                windowSize = W;
+            }
+            //	    System.err.println("W = " + W);
+        }
+
+        return Double.POSITIVE_INFINITY;
+    }
+
+
+    @Override
+    public double getCoercableParameterValue() {
+        return windowSize;
+    }
+
+    @Override
+    public void setCoercableParameterValue(double fValue) {
+        windowSize = fValue;
+    }
+
+    /**
+     * called after every invocation of this operator to see whether
+     * a parameter can be optimised for better acceptance hence faster
+     * mixing
+     *
+     * @param logAlpha difference in posterior between previous state & proposed state + hasting ratio
+     */
+    @Override
+    public void optimize(double logAlpha) {
+        // must be overridden by operator implementation to have an effect
+        double fDelta = calcDelta(logAlpha);
+
+        fDelta += Math.log(windowSize);
+        windowSize = Math.exp(fDelta);
+    }
+
+    @Override
+    public final String getPerformanceSuggestion() {
+        // new scale factor
+        double newWindowSize = totalDelta / totalNumber * 4;
+
+        if (newWindowSize / windowSize < 0.8 || newWindowSize / windowSize > 1.2) {
+            DecimalFormat formatter = new DecimalFormat("#.###");
+            return "Try setting window size to about " + formatter.format(newWindowSize);
+        } else
+            return "";
+    }
+} // class IntRandomWalkOperator
\ No newline at end of file
diff --git a/src/beast/evolution/operators/SubtreeSlide.java b/src/beast/evolution/operators/SubtreeSlide.java
new file mode 100644
index 0000000..90eeffd
--- /dev/null
+++ b/src/beast/evolution/operators/SubtreeSlide.java
@@ -0,0 +1,287 @@
+/*
+* File SubtreeSlide.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+/*
+ * SubtreeSlideOperator.java
+ *
+ * Copyright (C) 2002-2006 Alexei Drummond and Andrew Rambaut
+ *
+ * This file is part of BEAST.
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership and licensing.
+ *
+ * BEAST 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
+ * of the License, or (at your option) any later version.
+ *
+ *  BEAST 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 BEAST; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+package beast.evolution.operators;
+
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.evolution.tree.Node;
+import beast.evolution.tree.Tree;
+import beast.util.Randomizer;
+
+import java.text.DecimalFormat;
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * Implements the subtree slide move.
+ */
+ at Description("Moves the height of an internal node along the branch. " +
+        "If it moves up, it can exceed the root and become a new root. " +
+        "If it moves down, it may need to make a choice which branch to " +
+        "slide down into.")
+public class SubtreeSlide extends TreeOperator {
+
+    public Input<Double> sizeInput = new Input<Double>("size", "size of the slide, default 1.0", 1.0);
+    public Input<Boolean> gaussianInput = new Input<Boolean>("gaussian", "Gaussian (=true=default) or uniform delta", true);
+    public Input<Boolean> optimiseInput = new Input<Boolean>("optimise", "flag to indicate that the scale factor is automatically changed in order to achieve a good acceptance rate (default true)", true);
+
+    // shadows size
+    double fSize;
+
+    @Override
+    public void initAndValidate() {
+        fSize = sizeInput.get();
+    }
+
+    /**
+     * Do a probabilistic subtree slide move.
+     *
+     * @return log of Hastings Ratio, or Double.NEGATIVE_INFINITY if proposal should not be accepted *
+     */
+    @Override
+    public double proposal() {
+        final Tree tree = treeInput.get(this);
+
+        double logq;
+
+        Node i;
+        final boolean  markClades = markCladesInput.get();
+        // 1. choose a random node avoiding root
+        final int nNodes = tree.getNodeCount();
+        do {
+            i = tree.getNode(Randomizer.nextInt(nNodes));
+        } while (i.isRoot());
+
+        final Node iP = i.getParent();
+        final Node CiP = getOtherChild(iP, i);
+        final Node PiP = iP.getParent();
+
+        // 2. choose a delta to move
+        final double delta = getDelta();
+        final double oldHeight = iP.getHeight();
+        final double newHeight = oldHeight + delta;
+
+        // 3. if the move is up
+        if (delta > 0) {
+
+            // 3.1 if the topology will change
+            if (PiP != null && PiP.getHeight() < newHeight) {
+                // find new parent
+                Node newParent = PiP;
+                Node newChild = iP;
+                while (newParent.getHeight() < newHeight) {
+                    newChild = newParent;
+                    if( markClades ) newParent.makeDirty(Tree.IS_FILTHY); // JH
+                    newParent = newParent.getParent();
+                    if (newParent == null) break;
+                }
+                // the moved node 'iP' would become a child of 'newParent'
+                //
+
+                // 3.1.1 if creating a new root
+                if (newChild.isRoot()) {
+                    replace(iP, CiP, newChild);
+                    replace(PiP, iP, CiP);
+
+                    iP.setParent(null);
+                    tree.setRoot(iP);
+                }
+                // 3.1.2 no new root
+                else {
+                    replace(iP, CiP, newChild);
+                    replace(PiP, iP, CiP);
+                    replace(newParent, newChild, iP);
+                }
+
+                iP.setHeight(newHeight);
+
+                // 3.1.3 count the hypothetical sources of this destination.
+                final int possibleSources = intersectingEdges(newChild, oldHeight, null);
+                //System.out.println("possible sources = " + possibleSources);
+
+                logq = -Math.log(possibleSources);
+
+            } else {
+                // just change the node height
+                iP.setHeight(newHeight);
+                logq = 0.0;
+            }
+        }
+        // 4 if we are sliding the subtree down.
+        else {
+
+            // 4.0 is it a valid move?
+            if (i.getHeight() > newHeight) {
+                return Double.NEGATIVE_INFINITY;
+            }
+
+            // 4.1 will the move change the topology
+            if (CiP.getHeight() > newHeight) {
+
+                final List<Node> newChildren = new ArrayList<Node>();
+                final int possibleDestinations = intersectingEdges(CiP, newHeight, newChildren);
+
+                // if no valid destinations then return a failure
+                if (newChildren.size() == 0) {
+                    return Double.NEGATIVE_INFINITY;
+                }
+
+                // pick a random parent/child destination edge uniformly from options
+                final int childIndex = Randomizer.nextInt(newChildren.size());
+                final Node newChild = newChildren.get(childIndex);
+                final Node newParent = newChild.getParent();
+
+                // 4.1.1 if iP was root
+                if (iP.isRoot()) {
+                    // new root is CiP
+                    replace(iP, CiP, newChild);
+                    replace(newParent, newChild, iP);
+
+                    CiP.setParent(null);
+                    tree.setRoot(CiP);
+
+                } else {
+                    replace(iP, CiP, newChild);
+                    replace(PiP, iP, CiP);
+                    replace(newParent, newChild, iP);
+                }
+
+                iP.setHeight(newHeight);
+                if( markClades ) {
+                    // make dirty the path from the (down) moved node back up to former parent.
+                    Node n = iP;
+                    while( n != CiP ) {
+                        n.makeDirty(Tree.IS_FILTHY); // JH
+                        n = n.getParent();
+                    }
+                }
+
+                logq = Math.log(possibleDestinations);
+            } else {
+                iP.setHeight(newHeight);
+                logq = 0.0;
+            }
+        }
+        return logq;
+    }
+
+    private double getDelta() {
+        if (!gaussianInput.get()) {
+            return (Randomizer.nextDouble() * fSize) - (fSize / 2.0);
+        } else {
+            return Randomizer.nextGaussian() * fSize;
+        }
+    }
+
+    private int intersectingEdges(Node node, double height, List<Node> directChildren) {
+        final Node parent = node.getParent();
+
+        if (parent.getHeight() < height) return 0;
+
+        if (node.getHeight() < height) {
+            if (directChildren != null) directChildren.add(node);
+            return 1;
+        }
+
+        if (node.isLeaf()) {
+            // TODO: verify that this makes sense
+            return 0;
+        } else {
+            final int count = intersectingEdges(node.getLeft(), height, directChildren) +
+                    intersectingEdges(node.getRight(), height, directChildren);
+            return count;
+        }
+    }
+
+    /**
+     * automatic parameter tuning *
+     */
+    @Override
+    public void optimize(final double logAlpha) {
+        if (optimiseInput.get()) {
+            double fDelta = calcDelta(logAlpha);
+            fDelta += Math.log(fSize);
+            fSize = Math.exp(fDelta);
+        }
+    }
+
+    @Override
+    public double getCoercableParameterValue() {
+        return fSize;
+    }
+
+    @Override
+    public void setCoercableParameterValue(final double fValue) {
+        fSize = fValue;
+    }
+
+    @Override
+    public String getPerformanceSuggestion() {
+        final double prob = m_nNrAccepted / (m_nNrAccepted + m_nNrRejected + 0.0);
+        final double targetProb = getTargetAcceptanceProbability();
+
+        double ratio = prob / targetProb;
+
+        if (ratio > 2.0) ratio = 2.0;
+        if (ratio < 0.5) ratio = 0.5;
+
+        final double newDelta = fSize * ratio;
+
+        final DecimalFormat formatter = new DecimalFormat("#.###");
+        if (prob < 0.10) {
+            return "Try decreasing size to about " + formatter.format(newDelta);
+        } else if (prob > 0.40) {
+            return "Try increasing size to about " + formatter.format(newDelta);
+        } else return "";
+    }
+
+}
diff --git a/src/beast/evolution/operators/SwapOperator.java b/src/beast/evolution/operators/SwapOperator.java
new file mode 100644
index 0000000..4d05009
--- /dev/null
+++ b/src/beast/evolution/operators/SwapOperator.java
@@ -0,0 +1,63 @@
+package beast.evolution.operators;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.Operator;
+import beast.core.Input.Validate;
+import beast.core.parameter.IntegerParameter;
+import beast.core.parameter.Parameter;
+import beast.core.parameter.RealParameter;
+import beast.util.Randomizer;
+
+
+
+ at Description("A generic operator swapping a one or more pairs in a multi-dimensional parameter")
+public class SwapOperator extends Operator {
+    public Input<RealParameter> parameterInput = new Input<RealParameter>("parameter", "a real parameter to swap individual values for");
+    public Input<IntegerParameter> intparameterInput = new Input<IntegerParameter>("intparameter", "an integer parameter to swap individual values for", Validate.XOR, parameterInput);
+    public Input<Integer> howManyInput = new Input<Integer>("howMany", "number of items to swap, default 1, must be less than half the dimension of the parameter", 1);
+
+
+    int howMany;
+    Parameter<?> parameter;
+    private List<Integer> masterList = null;
+
+    @Override
+    public void initAndValidate() throws Exception {
+        if (parameterInput.get() != null) {
+            parameter = parameterInput.get();
+        } else {
+            parameter = intparameterInput.get();
+        }
+
+        howMany = howManyInput.get();
+        if (howMany * 2 > parameter.getDimension()) {
+            throw new Exception("howMany it too large: must be less than half the dimension of the parameter");
+        }
+
+        List<Integer> list = new ArrayList<Integer>();
+        for (int i = 0; i < parameter.getDimension(); i++) {
+            list.add(i);
+        }
+        masterList = Collections.unmodifiableList(list);
+    }
+
+    @Override
+    public double proposal() {
+        List<Integer> allIndices = new ArrayList<Integer>(masterList);
+        int left, right;
+
+        for (int i = 0; i < howMany; i++) {
+            left = allIndices.remove(Randomizer.nextInt(allIndices.size()));
+            right = allIndices.remove(Randomizer.nextInt(allIndices.size()));
+            parameter.swap(left, right);
+        }
+
+        return 0.0;
+    }
+
+}
diff --git a/src/beast/evolution/operators/TipDatesRandomWalker.java b/src/beast/evolution/operators/TipDatesRandomWalker.java
new file mode 100644
index 0000000..4cfbc02
--- /dev/null
+++ b/src/beast/evolution/operators/TipDatesRandomWalker.java
@@ -0,0 +1,186 @@
+package beast.evolution.operators;
+
+import java.text.DecimalFormat;
+import java.util.ArrayList;
+import java.util.List;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.evolution.alignment.TaxonSet;
+import beast.evolution.tree.Node;
+import beast.util.Randomizer;
+
+
+
+ at Description("Randomly moves tip dates on a tree by randomly selecting one from (a subset of) taxa")
+public class TipDatesRandomWalker extends TreeOperator {
+    // perhaps multiple trees may be necessary if they share the same taxon?
+    // public Input<List<Tree>> m_treesInput = new Input<List<Tree>>("tree" ,"tree to operate on", new ArrayList<Tree>(), Validate.REQUIRED);
+
+    public Input<Double> windowSizeInput =
+            new Input<Double>("windowSize", "the size of the window both up and down when using uniform interval OR standard deviation when using Gaussian", Input.Validate.REQUIRED);
+    public Input<TaxonSet> m_taxonsetInput = new Input<TaxonSet>("taxonset", "limit scaling to a subset of taxa. By default all tips are scaled.");
+    public Input<Boolean> useGaussianInput =
+            new Input<Boolean>("useGaussian", "Use Gaussian to move instead of uniform interval. Default false.", false);
+
+    /**
+     * node indices of taxa to choose from *
+     */
+    int[] taxonIndices;
+
+    double windowSize = 1;
+    boolean useGaussian;
+
+    /**
+     * whether to reflect random values from boundaries or absorb *
+     */
+    boolean reflectValue = true;
+
+    @Override
+    public void initAndValidate() throws Exception {
+        windowSize = windowSizeInput.get();
+        useGaussian = useGaussianInput.get();
+
+        // determine taxon set to choose from
+        if (m_taxonsetInput.get() != null) {
+            List<String> sTaxaNames = new ArrayList<String>();
+            for (String sTaxon : treeInput.get().getTaxaNames()) {
+                sTaxaNames.add(sTaxon);
+            }
+
+            List<String> set = m_taxonsetInput.get().asStringList();
+            int nNrOfTaxa = set.size();
+            taxonIndices = new int[nNrOfTaxa];
+            int k = 0;
+            for (String sTaxon : set) {
+                int iTaxon = sTaxaNames.indexOf(sTaxon);
+                if (iTaxon < 0) {
+                    throw new Exception("Cannot find taxon " + sTaxon + " in tree");
+                }
+                taxonIndices[k++] = iTaxon;
+            }
+        } else {
+            taxonIndices = new int[treeInput.get().getTaxaNames().length];
+            for (int i = 0; i < taxonIndices.length; i++) {
+                taxonIndices[i] = i;
+            }
+        }
+    }
+
+    @Override
+    public double proposal() {
+        // randomly select leaf node
+        int i = Randomizer.nextInt(taxonIndices.length);
+        Node node = treeInput.get().getNode(taxonIndices[i]);
+
+        double value = node.getHeight();
+        double newValue = value;
+        if (useGaussian) {
+            newValue += Randomizer.nextGaussian() * windowSize;
+        } else {
+            newValue += Randomizer.nextDouble() * 2 * windowSize - windowSize;
+        }
+
+
+        if (newValue > node.getParent().getHeight()) { // || newValue < 0.0) {
+            if (reflectValue) {
+                newValue = reflectValue(newValue, 0.0, node.getParent().getHeight());
+            } else {
+                return Double.NEGATIVE_INFINITY;
+            }
+        }
+        if (newValue == value) {
+            // this saves calculating the posterior
+            return Double.NEGATIVE_INFINITY;
+        }
+        node.setHeight(newValue);
+
+        return 0.0;
+    }
+
+
+    public double reflectValue(double value, double lower, double upper) {
+
+        double newValue = value;
+
+        if (value < lower) {
+            if (Double.isInfinite(upper)) {
+                // we are only going to reflect once as the upper bound is at infinity...
+                newValue = lower + (lower - value);
+            } else {
+                double remainder = lower - value;
+
+                int widths = (int) Math.floor(remainder / (upper - lower));
+                remainder -= (upper - lower) * widths;
+
+                // even reflections
+                if (widths % 2 == 0) {
+                    newValue = lower + remainder;
+                    // odd reflections
+                } else {
+                    newValue = upper - remainder;
+                }
+            }
+        } else if (value > upper) {
+            if (Double.isInfinite(lower)) {
+                // we are only going to reflect once as the lower bound is at -infinity...
+                newValue = upper - (newValue - upper);
+            } else {
+
+                double remainder = value - upper;
+
+                int widths = (int) Math.floor(remainder / (upper - lower));
+                remainder -= (upper - lower) * widths;
+
+                // even reflections
+                if (widths % 2 == 0) {
+                    newValue = upper - remainder;
+                    // odd reflections
+                } else {
+                    newValue = lower + remainder;
+                }
+            }
+        }
+
+        return newValue;
+    }
+
+
+    @Override
+    public double getCoercableParameterValue() {
+        return windowSize;
+    }
+
+    @Override
+    public void setCoercableParameterValue(double fValue) {
+        windowSize = fValue;
+    }
+
+    @Override
+    public void optimize(double logAlpha) {
+        // must be overridden by operator implementation to have an effect
+        double fDelta = calcDelta(logAlpha);
+        fDelta += Math.log(windowSize);
+        windowSize = Math.exp(fDelta);
+    }
+
+    @Override
+    public final String getPerformanceSuggestion() {
+        double prob = m_nNrAccepted / (m_nNrAccepted + m_nNrRejected + 0.0);
+        double targetProb = getTargetAcceptanceProbability();
+
+        double ratio = prob / targetProb;
+        if (ratio > 2.0) ratio = 2.0;
+        if (ratio < 0.5) ratio = 0.5;
+
+        // new scale factor
+        double newWindowSize = windowSize * ratio;
+
+        DecimalFormat formatter = new DecimalFormat("#.###");
+        if (prob < 0.10) {
+            return "Try setting window size to about " + formatter.format(newWindowSize);
+        } else if (prob > 0.40) {
+            return "Try setting window size to about " + formatter.format(newWindowSize);
+        } else return "";
+    }
+}
diff --git a/src/beast/evolution/operators/TipDatesScaler.java b/src/beast/evolution/operators/TipDatesScaler.java
new file mode 100644
index 0000000..f3b1d5c
--- /dev/null
+++ b/src/beast/evolution/operators/TipDatesScaler.java
@@ -0,0 +1,125 @@
+package beast.evolution.operators;
+
+import java.text.DecimalFormat;
+import java.util.ArrayList;
+import java.util.List;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.evolution.alignment.TaxonSet;
+import beast.evolution.tree.Node;
+import beast.evolution.tree.Tree;
+import beast.util.Randomizer;
+
+
+
+ at Description("Scales tip dates on a tree by randomly selecting one from (a subset of) taxa")
+public class TipDatesScaler extends TreeOperator {
+    // perhaps multiple trees may be necessary if they share the same taxon?
+    // public Input<List<Tree>> m_treesInput = new Input<List<Tree>>("tree" ,"tree to operate on", new ArrayList<Tree>(), Validate.REQUIRED);
+
+    public Input<Double> scaleFactorInput = new Input<Double>("scaleFactor", "scaling factor: larger means more bold proposals", 1.0);
+    public Input<TaxonSet> taxonsetInput = new Input<TaxonSet>("taxonset", "limit scaling to a subset of taxa. By default all tips are scaled.");
+
+    /**
+     * shadows input *
+     */
+    double scaleFactor;
+    /**
+     * node indices of taxa to choose from *
+     */
+    int[] taxonIndices;
+
+    @Override
+    public void initAndValidate() throws Exception {
+        scaleFactor = scaleFactorInput.get();
+
+        // determine taxon set to choose from
+        if (taxonsetInput.get() != null) {
+            List<String> sTaxaNames = new ArrayList<String>();
+            for (String sTaxon : treeInput.get().getTaxaNames()) {
+                sTaxaNames.add(sTaxon);
+            }
+
+            List<String> set = taxonsetInput.get().asStringList();
+            int nNrOfTaxa = set.size();
+            taxonIndices = new int[nNrOfTaxa];
+            int k = 0;
+            for (String sTaxon : set) {
+                int iTaxon = sTaxaNames.indexOf(sTaxon);
+                if (iTaxon < 0) {
+                    throw new Exception("Cannot find taxon " + sTaxon + " in tree");
+                }
+                taxonIndices[k++] = iTaxon;
+            }
+        } else {
+            taxonIndices = new int[treeInput.get().getTaxaNames().length];
+            for (int i = 0; i < taxonIndices.length; i++) {
+                taxonIndices[i] = i;
+            }
+        }
+    }
+
+    @Override
+    public double proposal() {
+        Tree tree = treeInput.get(this);
+
+        // randomly select leaf node
+        int i = Randomizer.nextInt(taxonIndices.length);
+        Node node = tree.getNode(taxonIndices[i]);
+        double fUpper = node.getParent().getHeight();
+        //double fLower = 0.0;
+        //final double newValue = (Randomizer.nextDouble() * (fUpper -fLower)) + fLower;
+
+        // scale node
+        double fScale = (scaleFactor + (Randomizer.nextDouble() * ((1.0 / scaleFactor) - scaleFactor)));
+        final double newValue = node.getHeight() * fScale;
+
+        // check the tree does not get negative branch lengths
+        if (newValue > fUpper) {
+            return Double.NEGATIVE_INFINITY;
+        }
+        node.setHeight(newValue);
+
+        return -Math.log(fScale);
+    }
+
+    @Override
+    public double getCoercableParameterValue() {
+        return scaleFactor;
+    }
+
+    @Override
+    public void setCoercableParameterValue(double fValue) {
+        scaleFactor = fValue;
+    }
+
+
+    @Override
+    public void optimize(double logAlpha) {
+        double fDelta = calcDelta(logAlpha);
+        fDelta += Math.log(1.0 / scaleFactor - 1.0);
+        scaleFactor = 1.0 / (Math.exp(fDelta) + 1.0);
+    }
+
+    @Override
+    public String getPerformanceSuggestion() {
+        double prob = m_nNrAccepted / (m_nNrAccepted + m_nNrRejected + 0.0);
+        double targetProb = getTargetAcceptanceProbability();
+
+        double ratio = prob / targetProb;
+        if (ratio > 2.0) ratio = 2.0;
+        if (ratio < 0.5) ratio = 0.5;
+
+        // new scale factor
+        double sf = Math.pow(scaleFactor, ratio);
+
+        DecimalFormat formatter = new DecimalFormat("#.###");
+        if (prob < 0.10) {
+            return "Try setting scaleFactor to about " + formatter.format(sf);
+        } else if (prob > 0.40) {
+            return "Try setting scaleFactor to about " + formatter.format(sf);
+        } else return "";
+    }
+
+}
diff --git a/src/beast/evolution/operators/TreeOperator.java b/src/beast/evolution/operators/TreeOperator.java
new file mode 100644
index 0000000..6493c30
--- /dev/null
+++ b/src/beast/evolution/operators/TreeOperator.java
@@ -0,0 +1,69 @@
+/*
+* File TreeOperator.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+package beast.evolution.operators;
+
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.Operator;
+import beast.core.Input.Validate;
+import beast.evolution.tree.Node;
+import beast.evolution.tree.Tree;
+
+
+ at Description("This operator changes a beast.tree.")
+abstract public class TreeOperator extends Operator {
+    public Input<Tree> treeInput = new Input<Tree>("tree", "beast.tree on which this operation is performed", Validate.REQUIRED);
+    public Input<Boolean> markCladesInput = new Input<>("markclades", "Mark nodes whose clade (tips of the " +
+            "subtree under the node) has changed by the move", false);
+
+    /**
+     * @param parent the parent
+     * @param child  the child that you want the sister of
+     * @return the other child of the given parent.
+     */
+    protected Node getOtherChild(final Node parent, final Node child) {
+        if (parent.getLeft().getNr() == child.getNr()) {
+            return parent.getRight();
+        } else {
+            return parent.getLeft();
+        }
+    }
+
+    /**
+     * replace child with another node
+     *
+     * @param node
+     * @param child
+     * @param replacement
+     */
+    public void replace(final Node node, final Node child, final Node replacement) {
+    	node.removeChild(child);
+    	node.addChild(replacement);
+        node.makeDirty(Tree.IS_FILTHY);
+        replacement.makeDirty(Tree.IS_FILTHY);
+    }
+
+}
diff --git a/src/beast/evolution/operators/Uniform.java b/src/beast/evolution/operators/Uniform.java
new file mode 100644
index 0000000..6042fa1
--- /dev/null
+++ b/src/beast/evolution/operators/Uniform.java
@@ -0,0 +1,108 @@
+/*
+* File Uniform.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+/*
+ * UniformOperator.java
+ *
+ * Copyright (C) 2002-2006 Alexei Drummond and Andrew Rambaut
+ *
+ * This file is part of BEAST.
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership and licensing.
+ *
+ * BEAST 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
+ * of the License, or (at your option) any later version.
+ *
+ *  BEAST 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 BEAST; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+package beast.evolution.operators;
+
+import beast.core.Description;
+import beast.evolution.tree.Node;
+import beast.evolution.tree.Tree;
+import beast.util.Randomizer;
+
+
+ at Description("Randomly selects true internal tree node (i.e. not the root) and move node height uniformly in interval " +
+        "restricted by the nodes parent and children.")
+public class Uniform extends TreeOperator {
+
+    // empty constructor to facilitate construction by XML + initAndValidate
+    public Uniform() {
+    }
+
+    public Uniform(Tree tree) {
+        try {
+            initByName(treeInput.getName(), tree);
+        } catch (Exception e) {
+            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+            throw new RuntimeException("Failed to construct Uniform Tree Operator.");
+        }
+    }
+
+    @Override
+    public void initAndValidate() {
+    }
+
+    /**
+     * change the parameter and return the hastings ratio.
+     *
+     * @return log of Hastings Ratio, or Double.NEGATIVE_INFINITY if proposal should not be accepted *
+     */
+    @Override
+    public double proposal() {
+        final Tree tree = treeInput.get(this);
+
+        // randomly select internal node
+        final int nNodeCount = tree.getNodeCount();
+        
+        // Abort if no non-root internal nodes
+        if (tree.getInternalNodeCount()==1)
+            return Double.NEGATIVE_INFINITY;
+        
+        Node node;
+        do {
+            final int iNodeNr = nNodeCount / 2 + 1 + Randomizer.nextInt(nNodeCount / 2);
+            node = tree.getNode(iNodeNr);
+        } while (node.isRoot() || node.isLeaf());
+        final double fUpper = node.getParent().getHeight();
+        final double fLower = Math.max(node.getLeft().getHeight(), node.getRight().getHeight());
+        final double newValue = (Randomizer.nextDouble() * (fUpper - fLower)) + fLower;
+        node.setHeight(newValue);
+
+        return 0.0;
+    }
+
+}
diff --git a/src/beast/evolution/operators/UniformOperator.java b/src/beast/evolution/operators/UniformOperator.java
new file mode 100644
index 0000000..6aa7923
--- /dev/null
+++ b/src/beast/evolution/operators/UniformOperator.java
@@ -0,0 +1,60 @@
+package beast.evolution.operators;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.Operator;
+import beast.core.Input.Validate;
+import beast.core.parameter.IntegerParameter;
+import beast.core.parameter.Parameter;
+import beast.core.parameter.RealParameter;
+import beast.util.Randomizer;
+
+ at Description("Assign one or more parameter values to a uniformly selected value in its range.")
+public class UniformOperator extends Operator {
+    public Input<Parameter<?>> parameterInput = new Input<Parameter<?>>("parameter", "a real or integer parameter to sample individual values for", Validate.REQUIRED, Parameter.class);
+    public Input<Integer> howManyInput = new Input<Integer>("howMany", "number of items to sample, default 1, must be less than the dimension of the parameter", 1);
+
+    int howMany;
+    Parameter<?> parameter;
+    double fLower, fUpper;
+    int iLower, iUpper;
+
+    @Override
+    public void initAndValidate() throws Exception {
+        parameter = parameterInput.get();
+        if (parameter instanceof RealParameter) {
+            fLower = (Double) parameter.getLower();
+            fUpper = (Double) parameter.getUpper();
+        } else if (parameter instanceof IntegerParameter) {
+            iLower = (Integer) parameter.getLower();
+            iUpper = (Integer) parameter.getUpper();
+        } else {
+            throw new Exception("parameter should be a RealParameter or IntergerParameter, not " + parameter.getClass().getName());
+        }
+
+        howMany = howManyInput.get();
+        if (howMany > parameter.getDimension()) {
+            throw new Exception("howMany it too large: must be less than the dimension of the parameter");
+        }
+    }
+
+    @Override
+    public double proposal() {
+        for (int n = 0; n < howMany; ++n) {
+            // do not worry about duplication, does not matter
+            int index = Randomizer.nextInt(parameter.getDimension());
+
+            if (parameter instanceof IntegerParameter) {
+                int newValue = Randomizer.nextInt(iUpper - iLower + 1) + iLower; // from 0 to n-1, n must > 0,
+                ((IntegerParameter) parameter).setValue(index, newValue);
+            } else {
+                double newValue = Randomizer.nextDouble() * (fUpper - fLower) + fLower;
+                ((RealParameter) parameter).setValue(index, newValue);
+            }
+
+        }
+
+        return 0.0;
+    }
+
+}
diff --git a/src/beast/evolution/operators/UpDownOperator.java b/src/beast/evolution/operators/UpDownOperator.java
new file mode 100644
index 0000000..58e0133
--- /dev/null
+++ b/src/beast/evolution/operators/UpDownOperator.java
@@ -0,0 +1,192 @@
+package beast.evolution.operators;
+
+
+import java.text.DecimalFormat;
+import java.util.ArrayList;
+import java.util.List;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.Operator;
+import beast.core.StateNode;
+import beast.core.Input.Validate;
+import beast.core.parameter.Parameter;
+import beast.core.parameter.RealParameter;
+import beast.util.Randomizer;
+
+
+ at Description("This element represents an operator that scales two parameters in different directions. " +
+        "Each operation involves selecting a scale uniformly at random between scaleFactor and 1/scaleFactor. " +
+        "The up parameter is multiplied by this scale and the down parameter is divided by this scale.")
+public class UpDownOperator extends Operator {
+
+    public Input<Double> scaleFactorInput = new Input<Double>("scaleFactor",
+            "magnitude factor used for scaling", Validate.REQUIRED);
+    public Input<List<StateNode>> upInput = new Input<List<StateNode>>("up",
+            "zero or more items to scale upwards", new ArrayList<StateNode>());
+    public Input<List<StateNode>> downInput = new Input<List<StateNode>>("down",
+            "zero or more items to scale downwards", new ArrayList<StateNode>());
+    public Input<Boolean> optimiseInput = new Input<Boolean>("optimise", "flag to indicate that the scale factor is automatically changed in order to acheive a good acceptance rate (default true)", true);
+    public Input<Boolean> elementWiseInput = new Input<Boolean>("elementWise", "flag to indicate that the scaling is applied to a random index in multivariate parameters (default false)", false);
+
+    public Input<Double> scaleUpperLimit = new Input<Double>("upper", "Upper Limit of scale factor", 1.0);
+    public Input<Double> scaleLowerLimit = new Input<Double>("lower", "Lower limit of scale factor", 0.0);
+
+    double scaleFactor;
+    private double upper,lower;
+
+    @Override
+    public void initAndValidate() throws Exception {
+        scaleFactor = scaleFactorInput.get();
+        // sanity checks
+        if (upInput.get().size() + downInput.get().size() == 0) {
+            System.err.println("WARNING: At least one up or down item must be specified");
+        }
+        if (upInput.get().size() == 0 || downInput.get().size() == 0) {
+            System.err.println("WARNING: no " + (upInput.get().size() == 0 ? "up" : "down") + " item specified in UpDownOperator");
+        }
+        upper = scaleUpperLimit.get();
+        lower = scaleLowerLimit.get();
+    }
+
+    /**
+     * override this for proposals,
+     *
+     * @return log of Hastings Ratio, or Double.NEGATIVE_INFINITY if proposal
+     *         should not be accepted
+     */
+    @Override
+    public final double proposal() {
+
+        final double scale = (scaleFactor + (Randomizer.nextDouble() * ((1.0 / scaleFactor) - scaleFactor)));
+        int goingUp = 0, goingDown = 0;
+
+
+        if (elementWiseInput.get()) {
+            int size = 0;
+            for (StateNode up : upInput.get()) {
+                if (size == 0) size = up.getDimension();
+                if (size > 0 && up.getDimension() != size) {
+                    throw new RuntimeException("elementWise=true but parameters of differing lengths!");
+                }
+                goingUp += 1;
+            }
+
+            for (StateNode down : downInput.get()) {
+                if (size == 0) size = down.getDimension();
+                if (size > 0 && down.getDimension() != size) {
+                    throw new RuntimeException("elementWise=true but parameters of differing lengths!");
+                }
+                goingDown += 1;
+            }
+
+            int index = Randomizer.nextInt(size);
+
+            for (StateNode up : upInput.get()) {
+                if (up instanceof RealParameter) {
+                    RealParameter p = (RealParameter) up;
+                    p.setValue(p.getValue(index) * scale);
+                }
+                if (outsideBounds(up)) {
+                    return Double.NEGATIVE_INFINITY;
+                }
+            }
+
+            for (StateNode down : downInput.get()) {
+                if (down instanceof RealParameter) {
+                    RealParameter p = (RealParameter) down;
+                    p.setValue(p.getValue(index) / scale);
+                }
+                if (outsideBounds(down)) {
+                    return Double.NEGATIVE_INFINITY;
+                }
+            }
+        } else {
+
+            try {
+                for (StateNode up : upInput.get()) {
+                    up = up.getCurrentEditable(this);
+                    goingUp += up.scale(scale);
+                }
+                // separated this into second loop because the outsideBounds might return true transiently with
+                // related variables which would be BAD. Note current implementation of outsideBounds isn't dynamic,
+                // so not currently a problem, but this became a problem in BEAST1 so this is preemptive strike.
+                // Same below for down
+                for (StateNode up : upInput.get()) {
+                    if (outsideBounds(up)) {
+                        return Double.NEGATIVE_INFINITY;
+                    }
+                }
+
+                for (StateNode down : downInput.get()) {
+                    down = down.getCurrentEditable(this);
+                    goingDown += down.scale(1.0 / scale);
+                }
+                for (StateNode down : downInput.get()) {
+                    if (outsideBounds(down)) {
+                        return Double.NEGATIVE_INFINITY;
+                    }
+                }
+            } catch (Exception e) {
+                // scale resulted in invalid StateNode, abort proposal
+                return Double.NEGATIVE_INFINITY;
+            }
+        }
+        return (goingUp - goingDown - 2) * Math.log(scale);
+    }
+
+    private boolean outsideBounds(final StateNode node) {
+        if (node instanceof Parameter<?>) {
+            final Parameter<?> p = (Parameter) node;
+            final Double lower = (Double) p.getLower();
+            final Double upper = (Double) p.getUpper();
+            final Double value = (Double) p.getValue();
+            if (value < lower || value > upper) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * automatic parameter tuning *
+     */
+    @Override
+    public void optimize(final double logAlpha) {
+        if (optimiseInput.get()) {
+            double fDelta = calcDelta(logAlpha);
+            fDelta += Math.log(1.0 / scaleFactor - 1.0);
+            setCoercableParameterValue(1.0 / (Math.exp(fDelta) + 1.0) );
+        }
+    }
+
+    @Override
+    public double getCoercableParameterValue() {
+        return scaleFactor;
+    }
+
+    @Override
+    public void setCoercableParameterValue(final double fValue) {
+        scaleFactor = Math.max(Math.min(fValue,upper),lower);
+    }
+
+    @Override
+    public String getPerformanceSuggestion() {
+        final double prob = m_nNrAccepted / (m_nNrAccepted + m_nNrRejected + 0.0);
+        final double targetProb = getTargetAcceptanceProbability();
+
+        double ratio = prob / targetProb;
+        if (ratio > 2.0) ratio = 2.0;
+        if (ratio < 0.5) ratio = 0.5;
+
+        // new scale factor
+        final double sf = Math.pow(scaleFactor, ratio);
+
+        final DecimalFormat formatter = new DecimalFormat("#.###");
+        if (prob < 0.10) {
+            return "Try setting scaleFactor to about " + formatter.format(sf);
+        } else if (prob > 0.40) {
+            return "Try setting scaleFactor to about " + formatter.format(sf);
+        } else return "";
+    }
+} // class UpDownOperator
diff --git a/src/beast/evolution/operators/WilsonBalding.java b/src/beast/evolution/operators/WilsonBalding.java
new file mode 100644
index 0000000..a5a057b
--- /dev/null
+++ b/src/beast/evolution/operators/WilsonBalding.java
@@ -0,0 +1,198 @@
+/*
+* File WilsonBalding.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+/*
+ * WilsonBalding.java
+ *
+ * Copyright (C) 2002-2006 Alexei Drummond and Andrew Rambaut
+ *
+ * This file is part of BEAST.
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership and licensing.
+ *
+ * BEAST 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
+ * of the License, or (at your option) any later version.
+ *
+ *  BEAST 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 BEAST; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+package beast.evolution.operators;
+
+import beast.core.Description;
+import beast.evolution.tree.Node;
+import beast.evolution.tree.Tree;
+import beast.util.Randomizer;
+
+/**
+ * WILSON, I. J. and D. J. BALDING, 1998  Genealogical inference from microsatellite data.
+ * Genetics 150:499-51
+ * http://www.genetics.org/cgi/ijlink?linkType=ABST&journalCode=genetics&resid=150/1/499
+ */
+ at Description("Implements the unweighted Wilson-Balding branch swapping move. " +
+        "This move is similar to one proposed by WILSON and BALDING 1998  " +
+        "and involves removing a subtree and re-attaching it on a new parent branch. " +
+        "See <a href='http://www.genetics.org/cgi/content/full/161/3/1307/F1'>picture</a>.")
+public class WilsonBalding extends TreeOperator {
+
+    @Override
+    public void initAndValidate() {
+    }
+
+    /**
+     * WARNING: Assumes strictly bifurcating beast.tree.
+     */
+    /**
+     * override this for proposals,
+     *
+     * @return log of Hastings Ratio, or Double.NEGATIVE_INFINITY if proposal should not be accepted *
+     */
+    @Override
+    public double proposal() {
+        Tree tree = treeInput.get(this);
+
+        double oldMinAge, newMinAge, newRange, oldRange, newAge, fHastingsRatio;
+
+        // choose a random node avoiding root
+        final int nodeCount = tree.getNodeCount();
+        Node i;
+        do {
+            i = tree.getNode(Randomizer.nextInt(nodeCount));
+        } while (i.isRoot());
+        final Node iP = i.getParent();
+
+        // choose another random node to insert i above
+        Node j;
+        Node jP;
+
+        // make sure that the target branch <k, j> is above the subtree being moved
+        do {
+            j = tree.getNode(Randomizer.nextInt(nodeCount));
+            jP = j.getParent();
+        } while ((jP != null && jP.getHeight() <= i.getHeight()) || (i.getNr() == j.getNr()));
+
+        // disallow moves that change the root.
+        if (j.isRoot() || iP.isRoot()) {
+            return Double.NEGATIVE_INFINITY;
+        }
+
+        assert jP != null;  // j != root tested above
+        final int iPnr = iP.getNr();
+        final int jPnr = jP.getNr();
+        if ( jPnr == iPnr || j.getNr() == iPnr || jPnr == i.getNr())
+            return Double.NEGATIVE_INFINITY;
+
+        final Node CiP = getOtherChild(iP, i);
+
+        final Node PiP = iP.getParent();
+
+        newMinAge = Math.max(i.getHeight(), j.getHeight());
+        newRange = jP.getHeight() - newMinAge;
+        newAge = newMinAge + (Randomizer.nextDouble() * newRange);
+        oldMinAge = Math.max(i.getHeight(), CiP.getHeight());
+        oldRange = PiP.getHeight() - oldMinAge;
+        fHastingsRatio = newRange / Math.abs(oldRange);
+
+        if (oldRange == 0 || newRange == 0) {
+            // This happens when some branch lengths are zero.
+            // If oldRange = 0, fHastingsRatio == Double.POSITIVE_INFINITY and
+            // node i can be catapulted anywhere in the tree, resulting in
+            // very bad trees that are always accepted.
+            // For symmetry, newRange = 0 should therefore be ruled out as well
+            return Double.NEGATIVE_INFINITY;
+        }
+
+        // root changing moves disallowed earlier. Comment out just like in BEAST 1
+
+        //update
+//        if (j.isRoot()) {
+//            // 1. remove edges <iP, CiP>
+//            // 2. add edges <k, iP>, <iP, j>, <PiP, CiP>
+//
+//            replace(iP, CiP, j);
+//            replace(PiP, iP, CiP);
+//
+//            // iP is the new root
+//            iP.setParent(null);
+//            tree.setRoot(iP);
+//
+//        } else if (iP.isRoot()) {
+//            // 1. remove edges <k, j>, <iP, CiP>, <PiP, iP>
+//            // 2. add edges <k, iP>, <iP, j>, <PiP, CiP>
+//
+//            replace(jP, j, iP);
+//            //replace(iP, CiP, iP);
+//            replace(iP, CiP, j);
+//
+//            // CiP is the new root
+//            CiP.setParent(null);
+//            tree.setRoot(CiP);
+//
+//        } else {
+//            // 1. remove edges <k, j>, <iP, CiP>, <PiP, iP>
+            // 2. add edges <k, iP>, <iP, j>, <PiP, CiP>
+
+            // disconnect iP
+            final Node iPP = iP.getParent();
+            replace(iPP, iP, CiP);
+            // re-attach, first child node to iP
+            replace(iP, CiP, j);
+            // then parent node of j to iP
+            replace(jP, j, iP);
+
+        // mark paths to common ancestor as changed
+            if( markCladesInput.get() ) {
+                Node iup = iPP;
+                Node jup = iP;
+                while (iup != jup) {
+                    if( iup.getHeight() < jup.getHeight() ) {
+                        assert !iup.isRoot();
+                        iup = iup.getParent();
+                        iup.makeDirty(Tree.IS_FILTHY);
+                    } else {
+                        assert !jup.isRoot();
+                        jup = jup.getParent();
+                        jup.makeDirty(Tree.IS_FILTHY);
+                    }
+                }
+            }
+
+//        }
+
+        iP.setHeight(newAge);
+
+        return Math.log(fHastingsRatio);
+    }
+
+
+} // class WilsonBalding
diff --git a/src/beast/evolution/sitemodel/SiteModel.java b/src/beast/evolution/sitemodel/SiteModel.java
new file mode 100644
index 0000000..730de94
--- /dev/null
+++ b/src/beast/evolution/sitemodel/SiteModel.java
@@ -0,0 +1,612 @@
+/*
+* File SiteModel.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+package beast.evolution.sitemodel;
+
+
+
+
+import org.apache.commons.math.distribution.GammaDistribution;
+import org.apache.commons.math.distribution.GammaDistributionImpl;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.parameter.RealParameter;
+import beast.evolution.substitutionmodel.SubstitutionModel;
+import beast.evolution.tree.Node;
+
+
+
+/**
+ * Site model with
+ * o gamma site model,
+ * o proportion of sites that are invariant
+ * *
+ */
+ at Description("Defines mutation rate " +
+        "and gamma distributed rates across sites (optional) " +
+        "and proportion of the sites invariant (also optional).")
+public class SiteModel extends SiteModelInterface.Base {
+
+
+    public Input<RealParameter> muParameterInput = new Input<RealParameter>("mutationRate", "mutation rate (defaults to 1.0)");
+    public Input<Integer> gammaCategoryCount =
+            new Input<Integer>("gammaCategoryCount", "gamma category count (default=zero for no gamma)", 0);
+    public Input<RealParameter> shapeParameterInput =
+            new Input<RealParameter>("shape", "shape parameter of gamma distribution. Ignored if gammaCategoryCount 1 or less");
+    public Input<RealParameter> invarParameterInput =
+            new Input<RealParameter>("proportionInvariant", "proportion of sites that is invariant: should be between 0 (default) and 1");
+    //public Input<Boolean> useBeast1StyleGammaInput = new Input<Boolean>("useBeast1Gamma", "use BEAST1 style gamma categories -- for backward compatibility testing", false);
+
+    RealParameter muParameter;
+    RealParameter shapeParameter;
+    RealParameter invarParameter;
+    boolean useBeast1StyleGamma;
+    
+    @Override
+    public void initAndValidate() throws Exception {
+    	useBeast1StyleGamma = true; //useBeast1StyleGammaInput.get();
+        muParameter = muParameterInput.get();
+        if (muParameter == null) {
+            muParameter = new RealParameter("1.0");
+        }
+        shapeParameter = shapeParameterInput.get();
+        invarParameter = invarParameterInput.get();
+        if (invarParameter == null) {
+            invarParameter = new RealParameter("0.0");
+            invarParameter.setBounds(Math.max(0.0, invarParameter.getLower()), Math.min(1.0, invarParameter.getUpper()));
+        }
+
+        //if (muParameter != null) {
+        muParameter.setBounds(Math.max(muParameter.getLower(), 0.0), Math.min(muParameter.getUpper(), Double.POSITIVE_INFINITY));
+        //}
+        if (shapeParameter != null) {
+            // The quantile calculator fails when the shape parameter goes much below
+            // 1E-3 so we have put a hard lower bound on it. If this is not there then
+            // the category rates can go to 0 and cause a -Inf likelihood (whilst this
+            // is not a problem as the state will be rejected, it could mask other issues
+            // and this seems the better approach.
+            shapeParameter.setBounds(Math.max(shapeParameter.getLower(), 1.0E-3), Math.min(shapeParameter.getUpper(), 1.0E3));
+        }
+
+
+        if (/*invarParameter != null && */(invarParameter.getValue() < 0 || invarParameter.getValue() > 1)) {
+            throw new Exception("proportion invariant should be between 0 and 1");
+        }
+        refresh();
+
+        addCondition(muParameterInput);
+        addCondition(invarParameterInput);
+        addCondition(shapeParameterInput);
+    }
+
+    @Override
+    protected void refresh() {
+        if (shapeParameter != null) {
+            categoryCount = gammaCategoryCount.get();
+            if (categoryCount < 1) {
+            	if (categoryCount < 0) {
+            		System.out.println("SiteModel: Invalid category count (" + categoryCount + ") Setting category count to 1");
+            	}
+                categoryCount = 1;
+            }
+        } else {
+            categoryCount = 1;
+        }
+
+        if (/*invarParameter != null && */invarParameter.getValue() > 0) {
+            if (invarParameter.getValue() >= 1.0) {
+            	throw new RuntimeException("Wrong value for parameter " + invarParameter.getID() +
+            			". Proportion invariant should be in bewteen 0 and 1 (exclusive)");
+            }
+            if (hasPropInvariantCategory) {
+                categoryCount += 1;
+            }
+        }
+
+        categoryRates = new double[categoryCount];
+        categoryProportions = new double[categoryCount];
+        calculateCategoryRates(null);
+        //ratesKnown = false;
+    }
+
+
+    // *****************************************************************
+    // Interface SiteModel
+    // *****************************************************************
+
+    @Override
+    public boolean integrateAcrossCategories() {
+        return true;
+    }
+
+    @Override
+    public int getCategoryCount() {
+        return categoryCount;
+    }
+
+    @Override
+    public int getCategoryOfSite(final int site, final Node node) {
+        throw new IllegalArgumentException("Integrating across categories");
+    }
+
+    @Override
+    public double getRateForCategory(final int category, final Node node) {
+        synchronized (this) {
+            if (!ratesKnown) {
+                calculateCategoryRates(node);
+            }
+        }
+
+        //final double mu = (muParameter != null) ? muParameter.getValue() : 1.0;
+
+        return categoryRates[category] * muParameter.getValue();
+    }
+
+
+    /**
+     * return category rates
+     *
+     * @param node rates to which the rates apply. Typically, the rates will be uniform
+     *             throughout the tree and the node argument is ignored.
+     */
+    @Override
+    public double[] getCategoryRates(final Node node) {
+        synchronized (this) {
+            if (!ratesKnown) {
+                calculateCategoryRates(node);
+            }
+        }
+
+        final double mu = muParameter.getValue();//(muParameter != null) ? muParameter.getValue() : 1.0;
+
+        final double[] rates = new double[categoryRates.length];
+        for (int i = 0; i < rates.length; i++) {
+            rates[i] = categoryRates[i] * mu;
+        }
+
+        return rates;
+    }
+
+    /**
+     * @return substitution model *
+     */
+    @Override
+    public SubstitutionModel getSubstitutionModel() {
+        return substModelInput.get();
+    }
+
+    /**
+     * Get the expected proportion of sites in this category.
+     *
+     * @param category the category number
+     * @param node     node to which the proportions apply. Typically, proportions
+     *                 will be uniform throughout the tree and this argument is ignored.
+     * @return the proportion.
+     */
+    @Override
+    public double getProportionForCategory(final int category, final Node node) {
+        synchronized (this) {
+            if (!ratesKnown) {
+                calculateCategoryRates(node);
+            }
+        }
+
+        return categoryProportions[category];
+    }
+
+    /**
+     * Get an array of the expected proportion of sites in this category.
+     *
+     * @return an array of the proportion.
+     */
+    @Override
+    public double[] getCategoryProportions(final Node node) {
+        synchronized (this) {
+            if (!ratesKnown) {
+                calculateCategoryRates(node);
+            }
+        }
+
+        return categoryProportions;
+    }
+
+    /**
+     * discretisation of gamma distribution with equal proportions in each
+     * category
+     * @param node
+     */
+    protected void calculateCategoryRates(final Node node) {
+        double propVariable = 1.0;
+        int cat = 0;
+
+        if (/*invarParameter != null && */invarParameter.getValue() > 0) {
+            if (hasPropInvariantCategory) {
+                categoryRates[0] = 0.0;
+                categoryProportions[0] = invarParameter.getValue();
+            }
+            propVariable = 1.0 - invarParameter.getValue();
+            if (hasPropInvariantCategory) {
+                cat = 1;
+            }
+        }
+
+        if (shapeParameter != null) {
+
+            final double a = shapeParameter.getValue();
+            double mean = 0.0;
+            final int gammaCatCount = categoryCount - cat;
+
+            final GammaDistribution g = new GammaDistributionImpl(a, 1.0 / a);
+            for (int i = 0; i < gammaCatCount; i++) {
+                try {
+                    // RRB: alternative implementation that seems equally good in
+                    // the first 5 significant digits, but uses a standard distribution object
+                	if (useBeast1StyleGamma) {
+                        categoryRates[i + cat] = GammaDistributionQuantile((2.0 * i + 1.0) / (2.0 * gammaCatCount), a, 1.0 / a);
+                	} else {
+                		categoryRates[i + cat] = g.inverseCumulativeProbability((2.0 * i + 1.0) / (2.0 * gammaCatCount));
+                	}
+
+                } catch (Exception e) {
+                    e.printStackTrace();
+                    System.err.println("Something went wrong with the gamma distribution calculation");
+                    System.exit(-1);
+                }
+                mean += categoryRates[i + cat];
+
+                categoryProportions[i + cat] = propVariable / gammaCatCount;
+            }
+
+            mean = (propVariable * mean) / gammaCatCount;
+
+            for (int i = 0; i < gammaCatCount; i++) {
+
+                categoryRates[i + cat] /= mean;
+            }
+        } else {
+            categoryRates[cat] = 1.0 / propVariable;
+            categoryProportions[cat] = propVariable;
+        }
+
+
+        ratesKnown = true;
+    }
+
+
+    /**
+     * CalculationNode methods *
+     */
+    @Override
+    public void store() {
+        super.store();
+    } // no additional state needs storing
+
+    @Override
+    public void restore() {
+        super.restore();
+        ratesKnown = false;
+    }
+
+    @Override
+    protected boolean requiresRecalculation() {
+        // do explicit check whether any of the non-substitution model parameters changed
+        if (categoryCount > 1) {
+            if (shapeParameter != null && shapeParameter.somethingIsDirty() ||
+                    muParameter.somethingIsDirty() ||
+                    invarParameter.somethingIsDirty()) {
+                ratesKnown = false;
+            }
+        } else {
+            if (muParameter.somethingIsDirty() || !hasPropInvariantCategory && invarParameter.somethingIsDirty()) {
+                ratesKnown = false;
+            }
+        }
+//    	ratesKnown = false;
+        // we only get here if something is dirty in its inputs, so always return true
+        return true;
+    }
+
+    protected boolean ratesKnown;
+
+    protected int categoryCount;
+
+    protected double[] categoryRates;
+
+    protected double[] categoryProportions;
+
+
+    /**
+     * quantile (inverse cumulative density function) of the Gamma distribution
+     *
+     * @param y     argument
+     * @param shape shape parameter
+     * @param scale scale parameter
+     * @return icdf value
+     * @throws Exception if arguments out of range
+     */
+    protected double GammaDistributionQuantile(double y, double shape, double scale) throws Exception {
+        return 0.5 * scale * pointChi2(y, 2.0 * shape);
+    }
+
+    double pointChi2(double prob, double v) throws Exception {
+        // Returns z so that Prob{x<z}=prob where x is Chi2 distributed with df
+        // = v
+        // RATNEST FORTRAN by
+        // Best DJ & Roberts DE (1975) The percentage points of the
+        // Chi2 distribution. Applied Statistics 24: 385-388. (AS91)
+
+        double e = 0.5e-6, aa = 0.6931471805, g;
+        double xx, c, ch, a, q, p1, p2, t, x, b, s1, s2, s3, s4, s5, s6;
+
+        if (prob < 0.000002 || prob > 0.999998 || v <= 0) {
+            throw new Exception("Error SiteModel 102: Arguments out of range");
+        }
+        g = GammaFunctionlnGamma(v / 2);
+        xx = v / 2;
+
+        c = xx - 1;
+        if (v < -1.24 * Math.log(prob)) {
+            ch = Math.pow((prob * xx * Math.exp(g + xx * aa)), 1 / xx);
+            if (ch - e < 0) {
+                return ch;
+            }
+        } else {
+            if (v > 0.32) {
+                x = NormalDistributionQuantile(prob, 0, 1);
+                p1 = 0.222222 / v;
+                ch = v * Math.pow((x * Math.sqrt(p1) + 1 - p1), 3.0);
+                if (ch > 2.2 * v + 6) {
+                    ch = -2 * (Math.log(1 - prob) - c * Math.log(.5 * ch) + g);
+                }
+            } else {
+                ch = 0.4;
+                a = Math.log(1 - prob);
+
+                do {
+                    q = ch;
+                    p1 = 1 + ch * (4.67 + ch);
+                    p2 = ch * (6.73 + ch * (6.66 + ch));
+                    t = -0.5 + (4.67 + 2 * ch) / p1
+                            - (6.73 + ch * (13.32 + 3 * ch)) / p2;
+                    ch -= (1 - Math.exp(a + g + .5 * ch + c * aa) * p2 / p1)
+                            / t;
+                } while (Math.abs(q / ch - 1) - .01 > 0);
+            }
+        }
+        do {
+            q = ch;
+            p1 = 0.5 * ch;
+            if ((t = GammaFunctionincompleteGammaP(xx, p1, g)) < 0) {
+                throw new Exception("Error SiteModel 101: Arguments out of range: t < 0");
+            }
+            p2 = prob - t;
+            t = p2 * Math.exp(xx * aa + g + p1 - c * Math.log(ch));
+            b = t / ch;
+            a = 0.5 * t - b * c;
+
+            s1 = (210 + a * (140 + a * (105 + a * (84 + a * (70 + 60 * a))))) / 420;
+            s2 = (420 + a * (735 + a * (966 + a * (1141 + 1278 * a)))) / 2520;
+            s3 = (210 + a * (462 + a * (707 + 932 * a))) / 2520;
+            s4 = (252 + a * (672 + 1182 * a) + c * (294 + a * (889 + 1740 * a))) / 5040;
+            s5 = (84 + 264 * a + c * (175 + 606 * a)) / 2520;
+            s6 = (120 + c * (346 + 127 * c)) / 5040;
+            ch += t
+                    * (1 + 0.5 * t * s1 - b
+                    * c
+                    * (s1 - b
+                    * (s2 - b
+                    * (s3 - b
+                    * (s4 - b * (s5 - b * s6))))));
+        } while (Math.abs(q / ch - 1) > e);
+
+        return (ch);
+    }
+
+    /**
+     * log Gamma function: ln(gamma(alpha)) for alpha>0, accurate to 10 decimal places
+     *
+     * @param alpha argument
+     * @return the log of the gamma function of the given alpha
+     */
+    double GammaFunctionlnGamma(final double alpha) {
+        // Pike MC & Hill ID (1966) Algorithm 291: Logarithm of the gamma function.
+        // Communications of the Association for Computing Machinery, 9:684
+
+        double x = alpha, f = 0.0, z;
+
+        if (x < 7) {
+            f = 1;
+            z = x - 1;
+            while (++z < 7) {
+                f *= z;
+            }
+            x = z;
+            f = -Math.log(f);
+        }
+        z = 1 / (x * x);
+
+        return
+                f + (x - 0.5) * Math.log(x) - x + 0.918938533204673 +
+                        (((-0.000595238095238 * z + 0.000793650793651) *
+                                z - 0.002777777777778) * z + 0.083333333333333) / x;
+    }
+
+    /**
+     * Incomplete Gamma function P(a,x) = 1-Q(a,x)
+     * (a cleanroom implementation of Numerical Recipes gammp(a,x);
+     * in Mathematica this function is 1-GammaRegularized)
+     *
+     * @param a        parameter
+     * @param x        argument
+     * @param lnGammaA precomputed lnGamma(a)
+     * @return function value
+     * @throws Exception if illegal arguments given
+     */
+    double GammaFunctionincompleteGammaP(double a, double x, double lnGammaA) throws Exception {
+        return incompleteGamma(x, a, lnGammaA);
+    }
+
+
+    /**
+     * Returns the incomplete gamma ratio I(x,alpha) where x is the upper
+     * limit of the integration and alpha is the shape parameter.
+     *
+     * @param x              upper limit of integration
+     * @param alpha          shape parameter
+     * @param ln_gamma_alpha the log gamma function for alpha
+     * @return the incomplete gamma ratio
+     * @throws Exception if illegal arguments given
+     */
+    double incompleteGamma(double x, double alpha, double ln_gamma_alpha) throws Exception {
+        // (1) series expansion     if (alpha>x || x<=1)
+        // (2) continued fraction   otherwise
+        // RATNEST FORTRAN by
+        // Bhattacharjee GP (1970) The incomplete gamma integral.  Applied Statistics,
+        // 19: 285-287 (AS32)
+
+        double accurate = 1e-8, overflow = 1e30;
+        double factor, gin, rn, a, b, an, dif, term;
+        double pn0, pn1, pn2, pn3, pn4, pn5;
+
+        if (x == 0.0) {
+            return 0.0;
+        }
+        if (x < 0.0 || alpha <= 0.0) {
+            throw new Exception("Error SiteModel 103: Arguments out of bounds");
+        }
+
+        factor = Math.exp(alpha * Math.log(x) - x - ln_gamma_alpha);
+
+        if (x > 1 && x >= alpha) {
+            // continued fraction
+            a = 1 - alpha;
+            b = a + x + 1;
+            term = 0;
+            pn0 = 1;
+            pn1 = x;
+            pn2 = x + 1;
+            pn3 = x * b;
+            gin = pn2 / pn3;
+
+            do {
+                a++;
+                b += 2;
+                term++;
+                an = a * term;
+                pn4 = b * pn2 - an * pn0;
+                pn5 = b * pn3 - an * pn1;
+
+                if (pn5 != 0) {
+                    rn = pn4 / pn5;
+                    dif = Math.abs(gin - rn);
+                    if (dif <= accurate) {
+                        if (dif <= accurate * rn) {
+                            break;
+                        }
+                    }
+
+                    gin = rn;
+                }
+                pn0 = pn2;
+                pn1 = pn3;
+                pn2 = pn4;
+                pn3 = pn5;
+                if (Math.abs(pn4) >= overflow) {
+                    pn0 /= overflow;
+                    pn1 /= overflow;
+                    pn2 /= overflow;
+                    pn3 /= overflow;
+                }
+            } while (true);
+            gin = 1 - factor * gin;
+        } else {
+            // series expansion
+            gin = 1;
+            term = 1;
+            rn = alpha;
+            do {
+                rn++;
+                term *= x / rn;
+                gin += term;
+            }
+            while (term > accurate);
+            gin *= factor / alpha;
+        }
+        return gin;
+    }
+
+    double NormalDistributionQuantile(double z, double m, double sd) throws Exception {
+        return m + Math.sqrt(2.0) * sd * ErrorFunctionInverseErf(2.0 * z - 1.0);
+    }
+
+    /**
+     * inverse error function
+     *
+     * @param z argument
+     * @return function value
+     * @throws Exception argument out of range
+     */
+    double ErrorFunctionInverseErf(double z) throws Exception {
+        return ErrorFunctionPointNormal(0.5 * z + 0.5) / Math.sqrt(2.0);
+    }
+
+
+    // Private
+
+    // Returns z so that Prob{x<z}=prob where x ~ N(0,1) and (1e-12) < prob<1-(1e-12)
+
+    double ErrorFunctionPointNormal(double prob) throws Exception {
+        // Odeh RE & Evans JO (1974) The percentage points of the normal distribution.
+        // Applied Statistics 22: 96-97 (AS70)
+
+        // Newer methods:
+        // Wichura MJ (1988) Algorithm AS 241: the percentage points of the
+        // normal distribution.  37: 477-484.
+        // Beasley JD & Springer SG  (1977).  Algorithm AS 111: the percentage
+        // points of the normal distribution.  26: 118-121.
+
+        double a0 = -0.322232431088, a1 = -1, a2 = -0.342242088547, a3 = -0.0204231210245;
+        double a4 = -0.453642210148e-4, b0 = 0.0993484626060, b1 = 0.588581570495;
+        double b2 = 0.531103462366, b3 = 0.103537752850, b4 = 0.0038560700634;
+        double y, z, p1;
+
+        p1 = (prob < 0.5 ? prob : 1 - prob);
+        if (p1 < 1e-20) {
+            throw new Exception("Error SiteModel 104: Argument prob out of range");
+        }
+
+        y = Math.sqrt(Math.log(1 / (p1 * p1)));
+        z = y + ((((y * a4 + a3) * y + a2) * y + a1) * y + a0) / ((((y * b4 + b3) * y + b2) * y + b1) * y + b0);
+        return (prob < 0.5 ? -z : z);
+    }
+
+    public double getProportionInvariant() {
+        //if (invarParameter == null) {
+        //	return 0;
+        //}
+        return invarParameter.getValue();
+    }
+
+} // class SiteModel
\ No newline at end of file
diff --git a/src/beast/evolution/sitemodel/SiteModelInterface.java b/src/beast/evolution/sitemodel/SiteModelInterface.java
new file mode 100644
index 0000000..a364038
--- /dev/null
+++ b/src/beast/evolution/sitemodel/SiteModelInterface.java
@@ -0,0 +1,188 @@
+package beast.evolution.sitemodel;
+
+import beast.core.CalculationNode;
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.Input.Validate;
+import beast.core.StateNode;
+import beast.evolution.datatype.DataType;
+import beast.evolution.likelihood.TreeLikelihood;
+import beast.evolution.substitutionmodel.SubstitutionModel;
+import beast.evolution.tree.Node;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+
+
+/**
+ * SiteModel - Specifies how rates and substitution models vary across sites.
+ *
+ * @author Andrew Rambaut
+ * @author Alexei Drummond
+ * @version $Id: SiteModel.java,v 1.77 2005/05/24 20:25:58 rambaut Exp $
+ */
+
+public interface SiteModelInterface {
+
+    /**
+     * set DataType so it can validate the Substitution model can handle it *
+     * @param dataType
+     */
+    void setDataType(DataType dataType);
+
+
+    @Description(value = "Base implementation of a site model with substitution model and rate categories.", isInheritable = false)
+    public abstract class Base extends CalculationNode implements SiteModelInterface {
+    	public Input<SubstitutionModel.Base> substModelInput =
+                new Input<SubstitutionModel.Base>("substModel", "substitution model along branches in the beast.tree", null, Validate.REQUIRED);
+
+    	/**
+         * Specifies whether SiteModel should integrate over the different categories at
+         * each site. If true, the SiteModel will calculate the likelihood of each site
+         * for each category. If false it will assume that there is each site can have a
+         * different category.
+         *
+         * @return the boolean
+         */
+        abstract public boolean integrateAcrossCategories();
+
+        /**
+         * @return the number of categories of substitution processes
+         */
+        abstract public int getCategoryCount();
+
+        /**
+         * Get the category of a particular site. If integrateAcrossCategories is true.
+         * then throws an IllegalArgumentException.
+         *
+         * @param site the index of the site
+         * @param node
+         * @return the index of the category
+         */
+        abstract public int getCategoryOfSite(int site, Node node);
+
+        /**
+         * Get the rate for a particular category. This will include the 'mu' parameter, an overall
+         * scaling of the siteModel.
+         *
+         * @param category the category number
+         * @param node
+         * @return the rate.
+         */
+        abstract public double getRateForCategory(int category, Node node);
+
+        /**
+         * Get an array of the rates for all categories.
+         *
+         * @param node
+         * @return an array of rates.
+         */
+        abstract public double[] getCategoryRates(Node node);
+
+        /**
+         * Get the expected proportion of sites in this category.
+         *
+         * @param category the category number
+         * @param node
+         * @return the proportion.
+         */
+        abstract public double getProportionForCategory(int category, Node node);
+
+        /**
+         * Get an array of the expected proportion of sites for all categories.
+         *
+         * @param node
+         * @return an array of proportions.
+         */
+        abstract public double[] getCategoryProportions(Node node);
+    
+        public boolean canSetSubstModel(Object o) {
+            final SubstitutionModel substModel = (SubstitutionModel) o;
+            if (m_dataType == null) {
+            	// try to find out the data type from the data in a treelikelihood in an output
+            	for (Object plugin : getOutputs()) {
+            		if (plugin instanceof TreeLikelihood) {
+            			TreeLikelihood likelihood = (TreeLikelihood) plugin;
+            			m_dataType = likelihood.dataInput.get().getDataType();
+            			break;
+            		}
+            	}
+            }
+            if (m_dataType != null) {
+                if (!substModel.canHandleDataType(m_dataType)) {
+                    return false;
+                    //throw new Exception("substitution model cannot handle data type");
+                }
+            }
+            return true;
+        }
+
+        DataType m_dataType;
+        /**
+         * Flag indicating proportional invariant is treated as a separate
+         * category. If set to false, only gamma-categories are returned and
+         * a TreeLikelihood has to deal with the proportional invariant category
+         * separately -- and potentially much more efficiently.
+         */
+        public boolean hasPropInvariantCategory = true;
+
+        public void setPropInvariantIsCategory(final boolean bPropInvariantIsCategory) {
+            hasPropInvariantCategory = bPropInvariantIsCategory;
+            refresh();
+        }
+
+        /**
+         * set up categories, reserve appropriately sized memory *
+         */
+        protected void refresh() {
+        }
+
+        /**
+         * Get this site model's substitution model
+         *
+         * @return the substitution model
+         */
+        public SubstitutionModel getSubstitutionModel() {
+            return substModelInput.get();
+        }
+
+
+        /**
+         * list of IDs onto which SiteModel is conditioned *
+         */
+        protected List<String> conditions = null;
+
+        /**
+         * return the list, useful for ... *
+         * @return
+         */
+        public List<String> getConditions() {
+            return conditions;
+        }
+
+        /**
+         * add item to the list *
+         * @param stateNode
+         */
+        public void addCondition(final Input<? extends StateNode> stateNode) {
+            if (stateNode.get() == null) return;
+
+            if (conditions == null) conditions = new ArrayList<String>();
+
+            conditions.add(stateNode.get().getID());
+        }
+
+        @Override
+        public void setDataType(final DataType dataType) {
+            m_dataType = dataType;
+        }
+
+        public double getProportionInvariant() {
+            return 0;
+        }
+
+    } // class SiteModelInterface.Base
+
+} // SiteModelInterface
diff --git a/src/beast/evolution/speciation/BirthDeathGernhard08Model.java b/src/beast/evolution/speciation/BirthDeathGernhard08Model.java
new file mode 100644
index 0000000..5902562
--- /dev/null
+++ b/src/beast/evolution/speciation/BirthDeathGernhard08Model.java
@@ -0,0 +1,138 @@
+/*
+ * BirthDeathGernhard08Model.java
+ *
+ * Copyright (C) 2002-2009 Alexei Drummond and Andrew Rambaut
+ *
+ * This file is part of BEAST.
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership and licensing.
+ *
+ * BEAST 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
+ * of the License, or (at your option) any later version.
+ *
+ * BEAST 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 BEAST; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+package beast.evolution.speciation;
+
+
+import beast.core.Citation;
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.Input.Validate;
+import beast.core.parameter.RealParameter;
+import beast.evolution.tree.TreeInterface;
+
+import java.util.Arrays;
+
+import static org.apache.commons.math.special.Gamma.logGamma;
+
+/* Ported from Beast 1.6
+ * @author Joseph Heled
+ *         Date: 24/02/2008
+ */
+ at Description("Birth Death model based on Gernhard 2008. <br/>" +
+        "This derivation conditions directly on fixed N taxa. <br/>" +
+        "The inference is directly on b-d (strictly positive) and d/b (constrained in [0,1)) <br/>" +
+        "Verified using simulated trees generated by Klass tree sample. (http://www.klaashartmann.com/treesample/) <br/>" +
+        "Sampling proportion not verified via simulation. Proportion set by default to 1, an assignment which makes " +
+        "the expressions identical to the expressions before the change.")
+
+ at Citation(value = "Gernhard 2008. The conditioned reconstructed process. Journal of Theoretical Biology Volume 253, " +
+        "Issue 4, 21 August 2008, Pages 769-778",
+        DOI = "doi:10.1016/j.jtbi.2008.04.005", // (http://dx.doi.org/10.1016/j.jtbi.2008.04.005)
+        year = 2008,
+        firstAuthorSurname = "gernhard")
+
+public class BirthDeathGernhard08Model extends YuleModel {
+
+    final static String[] TYPES = {"unscaled", "timesonly", "oriented", "labeled"};
+
+    public Input<String> typeInput =
+            new Input<String>("type", "tree type, should be one of " + Arrays.toString(TYPES) + " (default unscaled)",
+                    "unscaled", TYPES);
+    public Input<RealParameter> relativeDeathRateParameterInput =
+            new Input<RealParameter>("relativeDeathRate", "relative death rate parameter, mu/lambda in birth death model", Validate.REQUIRED);
+    public Input<RealParameter> sampleProbabilityInput =
+            new Input<RealParameter>("sampleProbability", "sample probability, rho in birth/death model");
+
+    @Override
+    public void initAndValidate() throws Exception {
+        super.initAndValidate();
+        final String sType = typeInput.get().toLowerCase();
+        if (sType.equals("unscaled")) {
+            type = TreeType.UNSCALED;
+        } else if (sType.equals("timesonly")) {
+            type = TreeType.TIMESONLY;
+        } else if (sType.equals("oriented")) {
+            type = TreeType.ORIENTED;
+        } else if (sType.equals("labeled")) {
+            type = TreeType.LABELED;
+        } else {
+            throw new Exception("type '" + sType + "' is not recognized. Should be one of unscaled, timesonly, oriented and labeled.");
+        }
+    }
+
+    @Override
+    public double calculateTreeLogLikelihood(final TreeInterface tree) {
+        final double a = relativeDeathRateParameterInput.get().getValue();
+        final double rho = (sampleProbabilityInput.get() == null ? 1.0 : sampleProbabilityInput.get().getValue());
+        return calculateTreeLogLikelihood(tree, rho, a);
+    }
+
+    private TreeType type;
+
+    public enum TreeType {
+        UNSCALED,     // no coefficient 
+        TIMESONLY,    // n!
+        ORIENTED,     // n
+        LABELED,      // 2^(n-1)/(n-1)!
+                      // conditional on root: 2^(n-1)/n!(n-1)
+                      // conditional on origin: 2^(n-1)/n!
+    }
+
+    /**
+     * scaling coefficient of tree *
+     */
+    protected double logCoeff(final int taxonCount) {
+        switch (type) {
+            case UNSCALED:
+                break;
+            case TIMESONLY:
+                return logGamma(taxonCount + 1);
+            case ORIENTED:
+                return Math.log(taxonCount);
+            case LABELED: {
+                final double two2nm1 = (taxonCount - 1) * Math.log(2.0);
+                if (conditionalOnRoot) {
+                    return two2nm1 - Math.log(taxonCount - 1) - logGamma(taxonCount + 1);
+                } else if (conditionalOnOrigin) {
+                	return two2nm1 - logGamma(taxonCount + 1);
+                } else {
+                    return two2nm1 - logGamma(taxonCount);
+                }
+            }
+        }
+        return 0.0;
+    }
+
+//    @Override
+//    public boolean includeExternalNodesInLikelihoodCalculation() {
+//        return true;
+//    }
+
+    @Override
+    protected boolean requiresRecalculation() {
+        return super.requiresRecalculation() || relativeDeathRateParameterInput.get().somethingIsDirty() || sampleProbabilityInput.get().somethingIsDirty();
+    }
+} // class BirthDeathGernhard08Model
diff --git a/src/beast/evolution/speciation/CalibratedBirthDeathModel.java b/src/beast/evolution/speciation/CalibratedBirthDeathModel.java
new file mode 100644
index 0000000..b14835d
--- /dev/null
+++ b/src/beast/evolution/speciation/CalibratedBirthDeathModel.java
@@ -0,0 +1,1046 @@
+package beast.evolution.speciation;
+
+
+import beast.core.*;
+import beast.core.Input.Validate;
+import beast.core.parameter.RealParameter;
+import beast.core.util.CompoundDistribution;
+import beast.evolution.alignment.TaxonSet;
+import beast.evolution.tree.Node;
+import beast.evolution.tree.Tree;
+import beast.evolution.tree.TreeInterface;
+import beast.math.distributions.MRCAPrior;
+import beast.math.statistic.RPNcalculator;
+
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+* @author Joseph Heled
+ */
+
+
+ at Description("Birth-Death prior with calibrated monophyletic clades. With this prior, " +
+        "the marginal distribution of the" +
+        " calibrated nodes (the root age of the clade) is identical to the specified calibration, " +
+        "and the density ratio between trees with equal calibration values is equal to the ratio under the " +
+        "Birth-Death prior.")
+//@Citation(value = "Heled J, Drummond AJ. Calibrated Tree Priors for Relaxed Phylogenetics and Divergence Time " +
+//        "Estimation. " +
+//        "Syst Biol (2012) 61 (1): 138-149.", DOI = "10.1093/sysbio/syr087")
+public class CalibratedBirthDeathModel extends SpeciesTreeDistribution {
+
+    static enum Type {
+        NONE("none"),
+        OVER_ALL_TOPOS("full"),
+        OVER_RANKED_COUNTS("restricted");
+
+        Type(final String name) {
+            this.ename = name;
+        }
+
+        public String toString() {
+            return ename;
+        }
+
+        private final String ename;
+    }
+
+    // Q2R does this makes sense, or it has to be a realParameter??
+    public Input<RealParameter> birthRateInput =
+            new Input<RealParameter>("birthRate", "birth rate - the rate at which new lineages are created as a result of an " +
+                    "existing lineage splitting into two.", Validate.REQUIRED);
+
+    public Input<RealParameter> deathToBirthRatioInput =
+            new Input<RealParameter>("relativeDeathRate", "relative death rate parameter, mu/lambda in birth death model",
+                    Validate.OPTIONAL);
+
+    public Input<RealParameter> sampleProbabilityInput =
+            new Input<RealParameter>("sampleProbability", "sample probability, rho in birth/death model",
+                    Validate.OPTIONAL);
+
+    public Input<List<CalibrationPoint>> calibrationsInput =
+            new Input<List<CalibrationPoint>>("calibrations", "Set of calibrated nodes", new ArrayList<CalibrationPoint>());
+
+    public Input<Type> correctionTypeInput = new Input<Type>("type", "Type of correction: none for no correction " +
+            "(same as BEAST1), full for Yule-like over calibrated times, and restricted for Yule-like over calibrated" +
+            " times and ranked topology (default 'full'). However, 'full'" +
+            " is generally slow except for a few special cases, such as a single clade or two nested clades.",
+            Type.OVER_ALL_TOPOS, Type.values());
+
+    public Input<RPNcalculator> userMarInput = new Input<RPNcalculator>("logMarginal",
+            "Use provided formula to compute the (log of) the marginal for special cases.",
+            (RPNcalculator) null);
+
+    // Which correction to apply
+    private Type type;
+
+    // Calibration points, (partially) sorted by set inclusion operator on clades. (remember that partially overlapping clades are not allowed)
+    CalibrationPoint[] orderedCalibrations;
+
+    // taxa of calibrated points, in same order as 'orderedCalibrations' above. The clade is represented as an array of integers, where each
+    // integer is the "node index" of the taxon in the tree, that is tree.getNode(xclades[i][k]) is the node for the k'th taxon of the i'th point.
+    private int[][] xclades;
+
+    // taxaPartialOrder[i] contains all clades immediately preceding the i'th clade under clade partial ordering.
+    // (i'th clade is orderedCalibrations[i]/xclades[i]). clades are given as their index into orderedCalibrations (and so into xclades as well).
+    private int[][] taxaPartialOrder;
+
+    RPNcalculator userPDF = null; //Q2R  but would that work propagation-wise
+
+    // whether to calculated the contribution of each of the calibrations
+    // should be false, when the calibrations come from MRCA priors of a parent CompoundDistribution
+    boolean calcCalibrations = true;
+
+    boolean isYule = false;
+
+    public CalibratedBirthDeathModel() {
+    }
+
+    @Override
+    public void initAndValidate() throws Exception {
+        super.initAndValidate();
+
+        type = correctionTypeInput.get();
+
+        final TreeInterface tree = treeInput.get();
+
+        // shallow copy. we shall change cals later
+        final List<CalibrationPoint> cals = new ArrayList<CalibrationPoint>(calibrationsInput.get());
+        int nCals = cals.size();
+        final List<TaxonSet> taxaSets = new ArrayList<TaxonSet>(nCals);
+        if (cals.size() > 0) {
+            xclades = new int[nCals][];
+
+            // convenience
+            for (final CalibrationPoint cal : cals) {
+                taxaSets.add(cal.taxa());
+            }
+
+        } else {
+            // find calibration points from prior
+            for (final Object plugin : getOutputs()) {
+                if (plugin instanceof CompoundDistribution) {
+                    final CompoundDistribution prior = (CompoundDistribution) plugin;
+                    for (final Distribution distr : prior.pDistributions.get()) {
+                        if (distr instanceof MRCAPrior) {
+                            final MRCAPrior _MRCAPrior = (MRCAPrior) distr;
+                            // make sure MRCAPrior is monophyletic
+                            if (_MRCAPrior.distInput.get() != null) {
+                                // make sure MRCAPrior is monophyletic
+                                if (!_MRCAPrior.isMonophyleticInput.get()) {
+                                    throw new Exception("MRCAPriors must be monophyletic for Calibrated Yule prior");
+                                }
+                                // create CalibrationPoint from MRCAPrior
+                                final CalibrationPoint cal = new CalibrationPoint();
+                                cal.distInput.setValue(_MRCAPrior.distInput.get(), cal);
+                                cal.taxonsetInput.setValue(_MRCAPrior.taxonsetInput.get(), cal);
+                                cal.initAndValidate();
+                                cals.add(cal);
+                                taxaSets.add(cal.taxa());
+                                cal.taxa().initAndValidate();
+                                nCals++;
+                                calcCalibrations = false;
+                            } else {
+                                if (_MRCAPrior.isMonophyleticInput.get()) {
+                                    System.err.println("WARNING: MRCAPriors must have a distribution when monophyletic for Calibrated Yule prior");
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            xclades = new int[nCals][];
+        }
+        if (nCals == 0) {
+            // assume we are in beauti, back off for now
+            return;
+        }
+
+        for (int k = 0; k < nCals; ++k) {
+            final TaxonSet tk = taxaSets.get(k);
+            for (int i = k + 1; i < nCals; ++i) {
+                final TaxonSet ti = taxaSets.get(i);
+                if (ti.containsAny(tk)) {
+                    if (!(ti.containsAll(tk) || tk.containsAll(ti))) {
+                        throw new Exception("Overlapping taxaSets??");
+                    }
+                }
+            }
+        }
+
+        orderedCalibrations = new CalibrationPoint[nCals];
+
+        {
+            int loc = taxaSets.size() - 1;
+            while (loc >= 0) {
+                assert loc == taxaSets.size() - 1;
+                //  place maximal taxaSets at end one at a time
+                int k = 0;
+                for (/**/; k < taxaSets.size(); ++k) {
+                    if (isMaximal(taxaSets, k)) {
+                        break;
+                    }
+                }
+
+                final List<String> tk = taxaSets.get(k).asStringList();
+                final int tkcount = tk.size();
+                this.xclades[loc] = new int[tkcount];
+                for (int nt = 0; nt < tkcount; ++nt) {
+                    final int taxonIndex = getTaxonIndex(tree, tk.get(nt));
+                    this.xclades[loc][nt] = taxonIndex;
+                    if (taxonIndex < 0) {
+                        throw new Exception("Taxon not found in tree: " + tk.get(nt));
+                    }
+                }
+
+                orderedCalibrations[loc] = cals.remove(k);
+                taxaSets.remove(k);
+                // cals and taxaSets should match
+                --loc;
+            }
+        }
+
+        // tio[i] will contain all taxaSets contained in the i'th clade, in the form of thier index into orderedCalibrations
+        final List<Integer>[] tio = new List[orderedCalibrations.length];
+        for (int k = 0; k < orderedCalibrations.length; ++k) {
+            tio[k] = new ArrayList<Integer>();
+        }
+
+        for (int k = 0; k < orderedCalibrations.length; ++k) {
+            final TaxonSet txk = orderedCalibrations[k].taxa();
+            for (int i = k + 1; i < orderedCalibrations.length; ++i) {
+                if (orderedCalibrations[i].taxa().containsAll(txk)) {
+                    tio[i].add(k);
+                    break;
+                }
+            }
+        }
+
+        this.taxaPartialOrder = new int[orderedCalibrations.length][];
+        for (int k = 0; k < orderedCalibrations.length; ++k) {
+            final List<Integer> tiok = tio[k];
+
+            this.taxaPartialOrder[k] = new int[tiok.size()];
+            for (int j = 0; j < tiok.size(); ++j) {
+                this.taxaPartialOrder[k][j] = tiok.get(j);
+            }
+        }
+
+        // true if clade is not contained in any other clade
+        final boolean[] maximal = new boolean[nCals];
+        for (int k = 0; k < nCals; ++k) {
+            maximal[k] = true;
+        }
+
+        for (int k = 0; k < nCals; ++k) {
+            for (final int i : this.taxaPartialOrder[k]) {
+                maximal[i] = false;
+            }
+        }
+
+        isYule = deathToBirthRatioInput.get() == null && sampleProbabilityInput.get() == null;
+
+        userPDF = userMarInput.get();
+        if (userPDF == null) {
+            boolean needTables = false;
+
+            if (type == Type.OVER_ALL_TOPOS) {
+                if (nCals == 1 && isYule ) {
+                    // closed form formula
+                } else {
+                    boolean anyParent = false;
+                    for (final CalibrationPoint c : orderedCalibrations) {
+                        if (c.forParentInput.get()) {
+                            anyParent = true;
+                        }
+                    }
+                    if( anyParent ) {
+                        throw new Exception("Sorry, not implemented: calibration on parent for more than one clade.");
+                    }
+                    if( isYule &&
+                            nCals == 2 && orderedCalibrations[1].taxa().containsAll(orderedCalibrations[0].taxa())) {
+                        // closed form formulas
+                    } else {
+                        needTables = true;
+                        lastHeights = new double[nCals];
+                    }
+                }
+            } else if (type == Type.OVER_RANKED_COUNTS) {
+                //setUpTables(tree.getLeafNodeCount() + 1);
+                needTables = true;
+            }
+
+            if( needTables ) {
+                setUpTables(tree.getLeafNodeCount() + 1);
+                linsIter = new CalibrationLineagesIterator(this.xclades, this.taxaPartialOrder, maximal,
+                        tree.getLeafNodeCount());
+            }
+        }
+
+        final List<Node> leafs = tree.getExternalNodes();
+        final double height = leafs.get(0).getHeight();
+        for (final Node leaf : leafs) {
+        	if (Math.abs(leaf.getHeight() - height) > 1e-8) {
+        		System.err.println("WARNING: Calibrated Birth-Death Model does not handle dated tips correctly. " +
+                        "Consider using a coalescent prior instead.");
+        		break;
+        	}
+        }
+    }
+
+    Tree compatibleInitialTree() throws Exception {
+        final int nCals = orderedCalibrations.length;
+        final double[] lowBound = new double[nCals];
+        final double[] cladeHeight = new double[nCals];
+
+        // get lower  bound: max(lower bound of dist , bounds of nested clades)
+        for (int k = 0; k < nCals; ++k) {
+            final CalibrationPoint cal = orderedCalibrations[k];
+            lowBound[k] = cal.dist().inverseCumulativeProbability(0);
+            // those are node heights
+            if (lowBound[k] < 0) {
+                lowBound[k] = 0;
+            }
+            for (final int i : taxaPartialOrder[k]) {
+                lowBound[k] = Math.max(lowBound[k], lowBound[i]);
+            }
+            cladeHeight[k] = cal.dist().inverseCumulativeProbability(1);
+        }
+
+        for (int k = nCals - 1; k >= 0; --k) {
+            //  cladeHeight[k] should be the upper bound of k
+            double upper = cladeHeight[k];
+            if (Double.isInfinite(upper)) {
+                upper = lowBound[k] + 1;
+            }
+            cladeHeight[k] = (upper + lowBound[k]) / 2.0;
+
+            for (final int i : taxaPartialOrder[k]) {
+                cladeHeight[i] = Math.min(cladeHeight[i], cladeHeight[k]);
+            }
+        }
+
+        final TreeInterface tree = treeInput.get();
+        final int nNodes = tree.getLeafNodeCount();
+        final boolean[] used = new boolean[nNodes];
+
+        int curLeaf = -1;
+        int curInternal = nNodes - 1;
+
+        final Node[] subTree = new Node[nCals];
+        for (int k = 0; k < nCals; ++k) {
+            final List<Integer> freeTaxa = new ArrayList<Integer>();
+            for (final int ti : xclades[k]) {
+                freeTaxa.add(ti);
+            }
+            for (final int i : taxaPartialOrder[k]) {
+                for (final int u : xclades[i]) {
+                    freeTaxa.remove(new Integer(u));
+                }
+            }
+
+            final List<Node> sbs = new ArrayList<Node>();
+            for (final int i : freeTaxa) {
+                final Node n = new Node(tree.getNode(i).getID());
+                n.setNr(++curLeaf);
+                n.setHeight(0.0);
+                sbs.add(n);
+
+                used[i] = true;
+            }
+            for (final int i : taxaPartialOrder[k]) {
+                sbs.add(subTree[i]);
+            }
+            final double base = sbs.get(sbs.size() - 1).getHeight();
+            final double step = (cladeHeight[k] - base) / (sbs.size() - 1);
+
+            Node tr = sbs.get(0);
+            for (int i = 1; i < sbs.size(); ++i) {
+                tr = Node.connect(tr, sbs.get(i), base + i * step);
+                tr.setNr(++curInternal);
+            }
+            subTree[k] = tr;
+        }
+
+        Node finalTree = subTree[nCals - 1];
+        double h = cladeHeight[nCals - 1];
+
+        for(int k = 0; k < nCals-1; ++k) {
+          final Node s = subTree[k];
+          h = Math.max(h, cladeHeight[k]) + 1;
+          finalTree = Node.connect(finalTree, s, h);
+          finalTree.setNr(++curInternal);
+        }
+
+        for (int k = 0; k < used.length; ++k) {
+            if (!used[k]) {
+                final String tx = tree.getNode(k).getID();
+                final Node n = new Node(tx);
+                n.setHeight(0.0);
+                n.setNr(++curLeaf);
+                finalTree = Node.connect(finalTree, n, h + 1);
+                finalTree.setNr(++curInternal);
+                h += 1;
+            }
+        }
+        final Tree t = new Tree();
+        t.setRoot(finalTree);
+        t.initAndValidate();
+        return t;
+    }
+
+    @Override
+    public double calculateTreeLogLikelihood(final TreeInterface tree) {
+        final double lam = birthRateInput.get().getArrayValue();
+
+        double logL;
+        if( isYule ) {
+            logL = calculateYuleLikelihood(tree, lam);
+            logL += getCorrection(tree, lam, 0, 1);
+        } else {
+            final RealParameter db = deathToBirthRatioInput.get();
+            final double a = db != null ?  db.getArrayValue() : 0;    assert( a < 1  );
+            final RealParameter sp = sampleProbabilityInput.get();
+            final double rho = sp != null ? sp.getArrayValue() : 1;
+            logL = calculateBDLikelihood(tree, lam, a, rho);
+            logL += getCorrection(tree, lam, a, rho);
+        }
+        //final double mar = getCorrection(tree, lam);
+       // logL += mar;
+        return logL;
+    }
+
+    private double calculateBDLikelihood(final TreeInterface tree, final double r, final double a, final double rho) {
+        if( a == 0 && rho == 1.0 ) {
+            return calculateYuleLikelihood(tree, r);
+        }
+
+        final int taxonCount = tree.getLeafNodeCount();
+
+        // add all lambda multipliers here
+        double logL = lfactorials[taxonCount] + (taxonCount - 1) * Math.log(r * rho);
+        final Node[] nodes = tree.getNodesAsArray();
+
+        logL += taxonCount * Math.log(1 - a);
+
+        for (int i = taxonCount; i < nodes.length; i++) {
+            final Node node = nodes[i];                   assert (!node.isLeaf());
+            final double height = node.getHeight();
+            final double mrh = -r * height;
+            final double z = Math.log(rho + ((1-rho) - a) * Math.exp(mrh));
+            double l = -2 * z + mrh;
+            if( node.isRoot() ) {
+                l += mrh - z;
+            }
+            logL += l;
+        }
+
+        return logL;
+    }
+
+    private static double calculateYuleLikelihood(final TreeInterface tree, final double lam) {
+        final int taxonCount = tree.getLeafNodeCount();
+
+        // add all lambda multipliers here
+        // No normalization at the moment.  for n! use logGamma(taxonCount + 1);
+        double logL = (taxonCount - 1) * Math.log(lam);
+
+        final Node[] nodes = tree.getNodesAsArray();
+        for (int i = taxonCount; i < nodes.length; i++) {
+            final Node node = nodes[i];                     assert (!node.isLeaf());
+            final double height = node.getHeight();
+            final double mrh = -lam * height;
+            logL += mrh + (node.isRoot() ? mrh : 0);
+        }
+        return logL;
+    }
+
+    public double getCorrection(final TreeInterface tree, final double lam, final double a, final double rho) {
+        double logL = 0.0;
+
+        final int nCals = orderedCalibrations.length;
+        final double[] hs = new double[nCals];
+
+        for (int k = 0; k < nCals; ++k) {
+            final CalibrationPoint cal = orderedCalibrations[k];
+            Node c;
+            final int[] taxk = xclades[k];
+            if (taxk.length > 1) {
+                //  find MRCA of taxa
+                c = getCommonAncestor(tree, taxk);
+
+                // only monophyletics clades can be calibrated
+                if (getLeafCount(c) != taxk.length) {
+                    return Double.NEGATIVE_INFINITY;
+                }
+            } else {
+                c = tree.getNode(taxk[0]);
+                assert cal.forParent();
+            }
+
+            if (cal.forParent()) {
+                c = c.getParent();
+            }
+
+            final double h = c.getHeight();
+            // add calibration density for point
+            if (calcCalibrations) {
+                logL += cal.logPdf(h);
+            }
+
+            hs[k] = h;
+        }
+
+        if (Double.isInfinite(logL)) {
+            // some calibration points out of range
+            return logL;
+        }
+
+        if (type == Type.NONE) {
+            return logL;
+        }
+
+        if (userPDF == null) {
+            final int nTaxa = tree.getLeafNodeCount();
+            switch (type) {
+                case OVER_ALL_TOPOS: {
+                    if (nCals == 1 && isYule ) {
+                        logL -= logMarginalDensity(lam, nTaxa, hs[0], xclades[0].length,
+                                orderedCalibrations[0].forParent());
+                    } else if (nCals == 2 && taxaPartialOrder[1].length == 1 && isYule) {
+                        //assert !forParent[0] && !forParent[1];
+                        logL -= logMarginalDensity(lam, nTaxa, hs[0], xclades[0].length,
+                                hs[1], xclades[1].length);
+                    } else {
+
+                        if (lastLam == lam) {
+                            int k = 0;
+                            for (; k < hs.length; ++k) {
+                                if (hs[k] != lastHeights[k]) {
+                                    break;
+                                }
+                            }
+                            if (k == hs.length) {
+                                return lastValue;
+                            }
+                        }
+
+                        // the slow and painful way
+                        final double[] hss = new double[hs.length];
+                        final int[] ranks = new int[hs.length];
+                        for (int k = 0; k < hs.length; ++k) {
+                            int r = 0;
+                            for(int j = 0; j < k; ++j) {
+                              r += (hs[j] <= hs[k]) ? 1 : 0;
+                            }
+                            for(int j = k+1; j < hs.length; ++j) {
+                              r += (hs[j] < hs[k]) ? 1 : 0;
+                            }
+//                            for (final double h : hs) {
+//                                r += (h < hs[k]) ? 1 : 0;
+//                            }
+                            ranks[k] = r + 1;
+                            hss[r] = hs[k];
+                        }
+                        logL -= logMarginalDensity(lam, hss, ranks, linsIter);
+
+                        lastLam = lam;
+                        System.arraycopy(hs, 0, lastHeights, 0, lastHeights.length);
+                        lastValue = logL;
+                    }
+                    break;
+                }
+
+                case OVER_RANKED_COUNTS: {
+                    final int[] ranks = new int[hs.length];
+                    for (int k = 0; k < hs.length; ++k) {
+                        int r = 0;
+                        for(int j = 0; j < k; ++j) {
+                            r += (hs[j] <= hs[k]) ? 1 : 0;
+                        }
+                        for(int j = k+1; j < hs.length; ++j) {
+                            r += (hs[j] < hs[k]) ? 1 : 0;
+                        }
+                        ranks[k] = r + 1;
+                    }
+                    final double nt = countTrees(ranks, linsIter);
+                    logL -= nt;
+
+                    Arrays.sort(hs);
+                    final int[] cs = new int[nCals + 1];
+                    for (final Node n : tree.getInternalNodes()) {
+                        final double nhk = n.getHeight();
+                        int i = 0;
+                        for (/**/; i < hs.length; ++i) {
+                            if (hs[i] >= nhk) {
+                                break;
+                            }
+                        }
+                        if (i == hs.length) {
+                            cs[i]++;
+                        } else {
+                            if (nhk < hs[i]) {
+                                cs[i]++;
+                            }
+                        }
+                    }
+
+                    if( isYule ) {
+                        double ll = 0;
+
+                        ll += cs[0] * Math.log1p(-Math.exp(-lam * hs[0])) - lam * hs[0] - lfactorials[cs[0]];
+                        for (int i = 1; i < cs.length - 1; ++i) {
+                            final int c = cs[i];
+                            ll += c * (Math.log1p(-Math.exp(-lam * (hs[i] - hs[i - 1]))) - lam * hs[i - 1]);
+                            ll += -lam * hs[i] - lfactorials[c];
+                        }
+                        ll += -lam * (cs[nCals] + 1) * hs[nCals - 1] - lfactorials[cs[nCals] + 1];
+                        ll += Math.log(lam) * nCals;
+
+                        logL -= ll;
+                    } else {
+                        assert( a < 1 );
+                        // We try to minimize the effects of numerical unstability,
+                        // so the evaluations look different than the nice equations in the MS.
+
+                        final double r = lam;
+
+                        final double ia = 1 - a;
+                        final double ira = ia-rho;
+                        final double v = (ia*ia)/r;
+
+                        // accumulate terms here
+                        double ll = 0;
+                        for (int i = 0; i < cs.length - 1; ++i) {
+                            final int c = cs[i];
+                            final double mrh = -r * hs[i];
+                            final double mrh1 = (i>0) ? -r * hs[i-1] : 0;
+
+                            ll -= lfactorials[c];
+                            //double xx =  Math.log(1 - Math.exp(mrh - mrh1));
+                            // can we have accurate  log(1+e^x) ??
+                            final double xxo = Math.log1p(-Math.exp(mrh - mrh1));
+
+                            final double xx1 = rho + ira*Math.exp(mrh);
+                            final double xx2 = rho + ira*Math.exp(mrh1);
+                            ll += c * (mrh1 + xxo + Math.log(v/(xx1*xx2)));
+
+                            // contribution of  calibration point
+
+                            final double z = Math.log(ia / (rho + ira * Math.exp(mrh)));
+                            ll += 2 * z + mrh;
+                        }
+
+                        // from last calibration to oo contribution
+                        final double xu = ia/(rho + ira * Math.exp(-r*hs[nCals - 1]));
+                        final int n2 = cs[nCals];                 assert n2 > 0;  // fixme
+
+                        final double rhoia = rho / ia;
+                        ll += -lfactorials[n2 + 1] - (n2) * Math.log(r * rhoia)
+                                - (n2+1) * r * hs[nCals - 1] + (n2+1) * Math.log(xu);
+                        // non-node terms
+                        ll += lfactorials[nTaxa] + (nTaxa - 1) * Math.log(r*rhoia);
+                        logL -= ll;
+                    }
+                    break;
+                }
+            }
+        } else {
+            final double value = userPDF.getArrayValue();
+            if (Double.isNaN(value) || Double.isInfinite(value)) {
+                logL = Double.NEGATIVE_INFINITY;
+            } else {
+                logL -= value;
+            }
+        }
+        return logL;
+    }
+
+    private static double logMarginalDensity(final double lam, final int nTaxa, final double h, final int nClade,
+                                             final boolean forParent) {
+        double lgp;
+
+        final double lh = lam * h;
+
+        if (forParent) {
+            // n(n+1) factor left out
+
+            lgp = -2 * lh + Math.log(lam);
+            if (nClade > 1) {
+                lgp += (nClade - 1) * Math.log(1 - Math.exp(-lh));
+            }
+        } else {
+            assert nClade > 1;
+
+            lgp = -3 * lh + (nClade - 2) * Math.log(1 - Math.exp(-lh)) + Math.log(lam);
+
+            // root is a special case
+            if (nTaxa == nClade) {
+                // n(n-1) factor left out
+                lgp += lh;
+            } else {
+                // (n^3-n)/2 factor left out
+            }
+        }
+
+        return lgp;
+    }
+
+    private static double logMarginalDensity(final double lam, final int nTaxa, final double h2, final int n,
+                                             final double h1, final int nm) {
+
+        assert h2 <= h1 && n < nm;
+
+        final int m = nm - n;
+
+        final double elh2 = Math.exp(-lam * h2);
+        final double elh1 = Math.exp(-lam * h1);
+
+        double lgl = 2 * Math.log(lam);
+
+        lgl += (n - 2) * Math.log(1 - elh2);
+        lgl += (m - 3) * Math.log(1 - elh1);
+
+        lgl += Math.log(1 - 2 * m * elh1 + 2 * (m - 1) * elh2
+                - m * (m - 1) * elh1 * elh2 + (m * (m + 1) / 2.) * elh1 * elh1
+                + ((m - 1) * (m - 2) / 2.) * elh2 * elh2);
+
+        if (nm < nTaxa) {
+            /* lgl += Math.log(0.5*(n*(n*n-1))*(n+1+m)) */
+            lgl -= lam * (h2 + 3 * h1);
+        } else {
+            /* lgl += Math.log(lam) /* + Math.log(n*(n*n-1)) */
+            lgl -= lam * (h2 + 2 * h1);
+        }
+
+        return lgl;
+    }
+
+    private double logMarginalDensity(final double lam, final double[] hs, final int[] ranks,
+                                      final CalibrationLineagesIterator cli) {
+
+        final int ni = cli.setup(ranks);
+
+        final int nHeights = hs.length;
+
+        final double[] lehs = new double[nHeights + 1];
+        lehs[0] = 0.0;
+        for (int i = 1; i < lehs.length; ++i) {
+            lehs[i] = -lam * hs[i - 1];
+        }
+
+        // assert maxRank == len(sit)
+        //final boolean noRoot = ni == lehs.length;
+        final boolean noRoot = ! cli.isRootCalibrated();
+
+        final int nLevels = nHeights + (noRoot ? 1 : 0);
+
+        final double[] lebase = new double[nLevels];
+
+        for (int i = 0; i < nHeights; ++i) {
+            final double d = lehs[i + 1] - lehs[i];
+            lebase[i] = d != 0 ? lehs[i] + Math.log1p(-Math.exp(d)) : -50;
+        }
+
+        if (noRoot) {
+            lebase[nHeights] = lehs[nHeights];
+        }
+
+        final int[] linsAtLevel = new int[nLevels];
+
+        final int[][] joiners = cli.allJoiners();
+
+        double val = 0;
+        boolean first = true;
+
+        int[][] linsInLevels;
+        //int ccc = 0;
+        while ((linsInLevels = cli.next()) != null) {
+            //ccc++;
+            double v = countRankedTrees(nLevels, linsInLevels, joiners, linsAtLevel);
+            // 1 for root formula, 1 for kludge in iterator which sets root as 2 lineages
+            if (noRoot) {
+                final int ll = linsAtLevel[nLevels - 1] + 2;
+                linsAtLevel[nLevels - 1] = ll;
+
+                v -= lc2[ll] + lg2;
+            }
+
+            for (int i = 0; i < nLevels; ++i) {
+                v += linsAtLevel[i] * lebase[i];
+            }
+
+            if (first) {
+                val = v;
+                first = false;
+            } else {
+                if (val > v) {
+                    val += Math.log1p(Math.exp(v - val));
+                } else {
+                    val = v + Math.log1p(Math.exp(val - v));
+                }
+            }
+        }
+
+        double logc0 = 0.0;
+        int totLin = 0;
+        for (int i = 0; i < ni; ++i) {
+            final int l = cli.nStart(i);
+            if (l > 0) {
+                logc0 += lNR[l];
+                totLin += l;
+            }
+        }
+
+        final double logc1 = lfactorials[totLin];
+
+        double logc2 = nHeights * Math.log(lam);
+
+        for (int i = 1; i < nHeights + 1; ++i) {
+            logc2 += lehs[i];
+        }
+
+        if (!noRoot) {
+            // we don't have an iterator for 0 free lineages
+            logc2 += 1 * lehs[nHeights];
+        }
+
+        // Missing scale by total of all possible trees over all ranking orders.
+        // Add it outside if needed for comparison.
+
+        val += logc0 + logc1 + logc2;
+
+        return val;
+    }
+
+    // should cache those for (say) up to 6 (6!=720) values. need rank permutation to index function
+    //
+    private double countTrees(final int[] ranks, final CalibrationLineagesIterator cli) {
+        final int ni = cli.setup(ranks);
+        final boolean noRoot = ! cli.isRootCalibrated();
+
+        final int[] linsAtLevel = new int[ni];
+
+        final int[][] joiners = cli.allJoiners();
+
+        double val = 0;
+        boolean first = true;
+        int[][] linsInLevels;
+
+        while ((linsInLevels = cli.next()) != null) {
+            double v = countRankedTrees(ni, linsInLevels, joiners, linsAtLevel);
+            // 1 for root formula, 1 for kludge in iterator which sets root as 2 lineages
+            if (noRoot) {
+                final int ll = linsAtLevel[ni - 1] + 2;
+                v -= lc2[ll] + lg2;
+            }
+            if (first) {
+                val = v;
+                first = false;
+            } else {
+                if (val > v) {
+                    val += Math.log1p(Math.exp(v - val));
+                } else {
+                    val = v + Math.log1p(Math.exp(val - v));
+                }
+            }
+        }
+        return val;
+    }
+
+    private double
+    countRankedTrees(final int nLevels, final int[][] linsAtCrossings, final int[][] joiners, final int[] linsAtLevel) {
+        double logCount = 0;
+
+        for (int i = 0; i < nLevels; ++i) {
+            int sumLins = 0;
+            for (int k = i; k < nLevels; ++k) {
+                final int[] lack = linsAtCrossings[k];
+                int cki = lack[i];
+                if (joiners[k][i] > 0) {
+                    ++cki;
+                    if (cki > 1) {
+                        // can be 1 if iterator without lins - for joiners only - need to check this is correct
+                        logCount += lc2[cki];
+                    } //assert(cki >= 2);
+                }
+                final int l = cki - lack[i + 1];   //assert(l >= 0);
+                logCount -= lfactorials[l];
+                sumLins += l;
+            }
+            linsAtLevel[i] = sumLins;
+        }
+
+        return logCount;
+    }
+
+    private CalibrationLineagesIterator linsIter = null;
+
+    double lastLam = Double.NEGATIVE_INFINITY;
+    double[] lastHeights;
+    double lastValue = Double.NEGATIVE_INFINITY;
+
+    // speedup constants
+    private final double lg2 = Math.log(2.0);
+    private double[] lc2;
+    private double[] lNR;
+    private double[] lfactorials;
+
+    private void setUpTables(final int MAX_N) {
+        final double[] lints = new double[MAX_N];
+        lc2 = new double[MAX_N];
+        lfactorials = new double[MAX_N];
+        lNR = new double[MAX_N];
+
+        lints[0] = Double.NEGATIVE_INFINITY; //-infinity, should never be used
+        lints[1] = 0.0;
+        for (int i = 2; i < MAX_N; ++i) {
+            lints[i] = Math.log(i);
+        }
+
+        lc2[0] = lc2[1] = Double.NEGATIVE_INFINITY;
+        for (int i = 2; i < MAX_N; ++i) {
+            lc2[i] = lints[i] + lints[i - 1] - lg2;
+        }
+
+        lfactorials[0] = 0.0;
+        for (int i = 1; i < MAX_N; ++i) {
+            lfactorials[i] = lfactorials[i - 1] + lints[i];
+        }
+
+        lNR[0] = Double.NEGATIVE_INFINITY; //-infinity, should never be used
+        lNR[1] = 0.0;
+
+        for (int i = 2; i < MAX_N; ++i) {
+            lNR[i] = lNR[i - 1] + lc2[i];
+        }
+    }
+
+    // @return true if the k'th taxa is maximal under set inclusion, i.e. it is not contained in any other set
+    public static boolean isMaximal(final List<TaxonSet> taxa, final int k) {
+        final TaxonSet tk = taxa.get(k);
+        for (int i = 0; i < taxa.size(); ++i) {
+            if (i != k) {
+                if (taxa.get(i).containsAll(tk)) {
+                    return false;
+                }
+            }
+        }
+        return true;
+    }
+
+
+    // Q2R Those generic functions could find a better home
+
+    public static int getTaxonIndex(final TreeInterface tree, final String taxon) {
+        for (int i = 0; i < tree.getNodeCount(); i++) {
+            final Node node = tree.getNode(i);
+            if (node.isLeaf() && node.getID().equals(taxon)) {
+                return i;
+            }
+        }
+        return -1;
+    }
+
+    public static Node getCommonAncestor(Node n1, Node n2) {
+        // assert n1.getTree() == n2.getTree();
+        while (n1 != n2) {
+            if (n1.getHeight() < n2.getHeight()) {
+                n1 = n1.getParent();
+            } else {
+                n2 = n2.getParent();
+            }
+        }
+        return n1;
+    }
+
+    // A lightweight version for finding the most recent common ancestor of a group of taxa.
+    // return the node-ref of the MRCA.
+
+    // would be nice to use nodeRef's, but they are not preserved :(
+    public static Node getCommonAncestor(final TreeInterface tree, final int[] nodes) {
+        Node cur = tree.getNode(nodes[0]);
+
+        for (int k = 1; k < nodes.length; ++k) {
+            cur = getCommonAncestor(cur, tree.getNode(nodes[k]));
+        }
+        return cur;
+    }
+
+    /**
+     * Count number of leaves in subtree whose root is node.
+     *
+     * @param node   subtree root
+     * @return the number of leaves under this node.
+     */
+    public static int getLeafCount(final Node node) {
+        if (node.isLeaf()) {
+            return 1;
+        }
+        return getLeafCount(node.getLeft()) + getLeafCount(node.getRight());
+    }
+
+    // log likelihood and clades heights
+
+    @Override
+    public void init(final PrintStream out) throws Exception {
+        out.print(getID() + "\t");
+        if (calcCalibrations) {
+            for (final CalibrationPoint cp : orderedCalibrations) {
+                out.print(cp.getID() + "\t");
+            }
+        }
+    }
+
+    @Override
+    public void log(final int nSample, final PrintStream out) {
+        out.print(getCurrentLogP() + "\t");
+        if (calcCalibrations) {
+            final TreeInterface tree = treeInput.get();
+            for (int k = 0; k < orderedCalibrations.length; ++k) {
+                final CalibrationPoint cal = orderedCalibrations[k];
+                Node c;
+                final int[] taxk = xclades[k];
+                if (taxk.length > 1) {
+                    //  find MRCA of taxa
+                    c = getCommonAncestor(tree, taxk);
+                } else {
+                    c = tree.getNode(taxk[0]);
+                }
+
+                if (cal.forParent()) {
+                    c = c.getParent();
+                }
+
+                final double h = c.getHeight();
+                out.print(h + "\t");
+            }
+        }
+    }
+
+    @Override
+    protected boolean requiresRecalculation() {
+        if( super.requiresRecalculation() || birthRateInput.get().somethingIsDirty() ) {
+            return true;
+        }
+        if( !isYule ) {
+            RealParameter p = deathToBirthRatioInput.get();
+            if( p != null && p.somethingIsDirty() ) {
+                return true;
+            }
+            p = sampleProbabilityInput.get();
+            if( p != null && p.somethingIsDirty() ) {
+                return true;
+            }
+        }
+        return false;
+    }
+    
+    @Override
+    public boolean canHandleTipDates() {
+		return false;
+	}
+}
diff --git a/src/beast/evolution/speciation/CalibratedYuleInitialTree.java b/src/beast/evolution/speciation/CalibratedYuleInitialTree.java
new file mode 100644
index 0000000..09425f6
--- /dev/null
+++ b/src/beast/evolution/speciation/CalibratedYuleInitialTree.java
@@ -0,0 +1,79 @@
+/*
+ * CalibratedYuleInitialTree.java
+ *
+ * Copyright (C) 2002-2006 Alexei Drummond and Andrew Rambaut
+ *
+ * This file is part of BEAST.
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership and licensing.
+ *
+ * BEAST 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
+ * of the License, or (at your option) any later version.
+ *
+ *  BEAST 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 BEAST; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+package beast.evolution.speciation;
+
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.StateNode;
+import beast.core.StateNodeInitialiser;
+import beast.evolution.tree.Tree;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+* @author Joseph Heled
+ */
+
+ at Description("A tree compatible with a set of monophyletic clades and hard limits on the clade root.")
+public class CalibratedYuleInitialTree extends Tree implements StateNodeInitialiser {
+
+    public Input<List<CalibrationPoint>> calibrationsInput =
+            new Input<List<CalibrationPoint>>("calibrations", "Set of calibrated nodes", new ArrayList<CalibrationPoint>(),
+                    Input.Validate.REQUIRED);
+
+    @Override
+    public void initAndValidate() throws Exception {
+        super.initAndValidate();
+        initStateNodes();
+    }
+
+    @Override
+    public void initStateNodes() throws Exception {
+        // Would have been nice to use the MCMC CalibratedYuleModel plugin directly, but at this point
+        // it does not exist since the tree being initialized is one of its arguments. So, build a temporary
+        // one using the initializer tree.
+
+        final List<CalibrationPoint> cals = calibrationsInput.get();
+
+        final CalibratedYuleModel cym = new CalibratedYuleModel();
+        for( final CalibrationPoint cal : cals ) {
+          cym.setInputValue("calibrations", cal);
+        }
+        cym.setInputValue("tree", this);
+        cym.setInputValue("type", CalibratedYuleModel.Type.NONE);
+        cym.initAndValidate();
+
+        final Tree t = cym.compatibleInitialTree();
+        m_initial.get().assignFromWithoutID(t);
+    }
+
+    @Override
+    public void getInitialisedStateNodes(final List<StateNode> stateNodes) {
+        stateNodes.add(m_initial.get());
+    }
+}
\ No newline at end of file
diff --git a/src/beast/evolution/speciation/CalibratedYuleModel.java b/src/beast/evolution/speciation/CalibratedYuleModel.java
new file mode 100644
index 0000000..cbcd1f3
--- /dev/null
+++ b/src/beast/evolution/speciation/CalibratedYuleModel.java
@@ -0,0 +1,892 @@
+package beast.evolution.speciation;
+
+
+import beast.core.*;
+import beast.core.Input.Validate;
+import beast.core.parameter.RealParameter;
+import beast.core.util.CompoundDistribution;
+import beast.core.util.Log;
+import beast.evolution.alignment.TaxonSet;
+import beast.evolution.tree.Node;
+import beast.evolution.tree.Tree;
+import beast.evolution.tree.TreeInterface;
+import beast.math.distributions.MRCAPrior;
+import beast.math.distributions.ParametricDistribution;
+import beast.math.statistic.RPNcalculator;
+
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * @author Joseph Heled
+ */
+
+
+ at Description("Yule prior with calibrated monophyletic clades. With this prior, the marginal distribution of the" +
+        " calibrated nodes (the MRCA of clades) is identical to the specified calibration, but the Yule is not preserved over" +
+        " the whole tree space, only among sub-spaces.")
+ at Citation(value =
+        "Heled J, Drummond AJ (2012) Calibrated Tree Priors for Relaxed Phylogenetics\n" +
+                "  and Divergence Time Estimation. Systematic Biology 61(1):138-149."
+        , DOI = "10.1093/sysbio/syr087", year = 2012, firstAuthorSurname = "heled")
+public class CalibratedYuleModel extends SpeciesTreeDistribution {
+
+    public static enum Type {
+        NONE("none"),
+        OVER_ALL_TOPOS("full"),
+        OVER_RANKED_COUNTS("restricted");
+
+        Type(final String name) {
+            this.ename = name;
+        }
+
+        public String toString() {
+            return ename;
+        }
+
+        private final String ename;
+    }
+
+    // Q2R does this makes sense, or it has to be a realParameter??
+    public Input<RealParameter> birthRateInput =
+            new Input<RealParameter>("birthRate", "birth rate of splitting a linage into two", Validate.REQUIRED);
+
+    public Input<List<CalibrationPoint>> calibrationsInput =
+            new Input<List<CalibrationPoint>>("calibrations", "Set of calibrated nodes", new ArrayList<CalibrationPoint>());
+
+    public Input<Type> correctionTypeInput = new Input<Type>("type", "Type of correction: none for no correction " +
+            "(same as BEAST1), full for Yule-like over calibrated times, and restricted for Yule-like over calibrated" +
+            " times and ranked topology (default 'full'). However, 'full'" +
+            " is generally slow except for in a few special cases, such as a single clade or two nested clades.",
+            Type.OVER_ALL_TOPOS, Type.values());
+
+    public Input<RPNcalculator> userMarInput = new Input<RPNcalculator>("logMarginal",
+            "Used provided correction (log of marginal) for special cases.", (RPNcalculator) null);
+
+    // Which correction to apply
+    private Type type;
+
+    // Calibration points, (partially) sorted by set inclusion operator on clades. (remember that partially overlapping clades are not allowed)
+    CalibrationPoint[] orderedCalibrations;
+
+    // taxa of calibrated points, in same order as 'orderedCalibrations' above. The clade is represented as an array of integers, where each
+    // integer is the "node index" of the taxon in the tree, that is tree.getNode(xclades[i][k]) is the node for the k'th taxon of the i'th point.
+    private int[][] xclades;
+
+    // taxaPartialOrder[i] contains all clades immediately preceding the i'th clade under clade partial ordering.
+    // (i'th clade is orderedCalibrations[i]/xclades[i]). clades are given as their index into orderedCalibrations (and so into xclades as well).
+    private int[][] taxaPartialOrder;
+
+    RPNcalculator userPDF = null; //Q2R  but would that work propagation-wise
+
+    // whether to calculated the contribution of each of the calibrations
+    // should be false, when the calibrations come from MRCA priors of a parent CompoundDistribution 
+    boolean calcCalibrations = true;
+
+    public CalibratedYuleModel() {
+    }
+
+    @Override
+    public void initAndValidate() throws Exception {
+        super.initAndValidate();
+
+        type = correctionTypeInput.get();
+
+        final TreeInterface tree = treeInput.get();
+
+        // shallow copy. we shall change cals later
+        final List<CalibrationPoint> cals = new ArrayList<CalibrationPoint>(calibrationsInput.get());
+        int nCals = cals.size();
+        final List<TaxonSet> taxaSets = new ArrayList<TaxonSet>(nCals);
+        if (cals.size() > 0) {
+            xclades = new int[nCals][];
+
+            // convenience
+            for (final CalibrationPoint cal : cals) {
+                taxaSets.add(cal.taxa());
+            }
+
+        } else {
+            // find calibration points from prior
+            for (final Object plugin : getOutputs()) {
+                if (plugin instanceof CompoundDistribution) {
+                    final CompoundDistribution prior = (CompoundDistribution) plugin;
+                    for (final Distribution distr : prior.pDistributions.get()) {
+                        if (distr instanceof MRCAPrior) {
+                            final MRCAPrior _MRCAPrior = (MRCAPrior) distr;
+                            // make sure MRCAPrior is monophyletic
+                            if (_MRCAPrior.distInput.get() != null) {
+                                // make sure MRCAPrior is monophyletic
+                                if (!_MRCAPrior.isMonophyleticInput.get()) {
+                                    throw new Exception("MRCAPriors must be monophyletic for Calibrated Yule prior");
+                                }
+                                // create CalibrationPoint from MRCAPrior
+                                final CalibrationPoint cal = new CalibrationPoint();
+                                cal.distInput.setValue(_MRCAPrior.distInput.get(), cal);
+                                cal.taxonsetInput.setValue(_MRCAPrior.taxonsetInput.get(), cal);
+                                cal.initAndValidate();
+                                cals.add(cal);
+                                taxaSets.add(cal.taxa());
+                                cal.taxa().initAndValidate();
+                                nCals++;
+                                calcCalibrations = false;
+                            } else {
+                                if (_MRCAPrior.isMonophyleticInput.get()) {
+                                    Log.warning.println("WARNING: MRCAPriors (" + _MRCAPrior.getID() + ") must have a distribution when monophyletic. Ignored for Calibrated Yule prior");
+                                } else {
+                                	Log.warning.println("WARNING: MRCAPriors (" + _MRCAPrior.getID() + ") found that is not monophyletic. Ignored for Calibrated Yule prior");                                	
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            xclades = new int[nCals][];
+        }
+        if (nCals == 0) {
+        	Log.warning.println("WARNING: Calibrated Yule prior could not find any properly configured calibrations. Expect this to crash in a BEAST run.");                                	
+            // assume we are in beauti, back off for now
+            return;
+        }
+
+        for (int k = 0; k < nCals; ++k) {
+            final TaxonSet tk = taxaSets.get(k);
+            for (int i = k + 1; i < nCals; ++i) {
+                final TaxonSet ti = taxaSets.get(i);
+                if (ti.containsAny(tk)) {
+                    if (!(ti.containsAll(tk) || tk.containsAll(ti))) {
+                        throw new Exception("Overlapping taxaSets??");
+                    }
+                }
+            }
+        }
+
+        orderedCalibrations = new CalibrationPoint[nCals];
+
+        {
+            int loc = taxaSets.size() - 1;
+            while (loc >= 0) {
+                assert loc == taxaSets.size() - 1;
+                //  place maximal taxaSets at end one at a time
+                int k = 0;
+                for (/**/; k < taxaSets.size(); ++k) {
+                    if (isMaximal(taxaSets, k)) {
+                        break;
+                    }
+                }
+
+                final List<String> tk = taxaSets.get(k).asStringList();
+                final int tkcount = tk.size();
+                this.xclades[loc] = new int[tkcount];
+                for (int nt = 0; nt < tkcount; ++nt) {
+                    final int taxonIndex = getTaxonIndex(tree, tk.get(nt));
+                    this.xclades[loc][nt] = taxonIndex;
+                    if (taxonIndex < 0) {
+                        throw new Exception("Taxon not found in tree: " + tk.get(nt));
+                    }
+                }
+
+                orderedCalibrations[loc] = cals.remove(k);
+                taxaSets.remove(k);
+                // cals and taxaSets should match
+                --loc;
+            }
+        }
+
+        // tio[i] will contain all taxaSets contained in the i'th clade, in the form of thier index into orderedCalibrations
+        final List<Integer>[] tio = new List[orderedCalibrations.length];
+        for (int k = 0; k < orderedCalibrations.length; ++k) {
+            tio[k] = new ArrayList<Integer>();
+        }
+
+        for (int k = 0; k < orderedCalibrations.length; ++k) {
+            final TaxonSet txk = orderedCalibrations[k].taxa();
+            for (int i = k + 1; i < orderedCalibrations.length; ++i) {
+                if (orderedCalibrations[i].taxa().containsAll(txk)) {
+                    tio[i].add(k);
+                    break;
+                }
+            }
+        }
+
+        this.taxaPartialOrder = new int[orderedCalibrations.length][];
+        for (int k = 0; k < orderedCalibrations.length; ++k) {
+            final List<Integer> tiok = tio[k];
+
+            this.taxaPartialOrder[k] = new int[tiok.size()];
+            for (int j = 0; j < tiok.size(); ++j) {
+                this.taxaPartialOrder[k][j] = tiok.get(j);
+            }
+        }
+
+        // true if clade is not contained in any other clade
+        final boolean[] maximal = new boolean[nCals];
+        for (int k = 0; k < nCals; ++k) {
+            maximal[k] = true;
+        }
+
+        for (int k = 0; k < nCals; ++k) {
+            for (final int i : this.taxaPartialOrder[k]) {
+                maximal[i] = false;
+            }
+        }
+
+        userPDF = userMarInput.get();
+        if (userPDF == null) {
+
+            if (type == Type.OVER_ALL_TOPOS) {
+                if (nCals == 1) {
+                    // closed form formula
+                } else {
+                    boolean anyParent = false;
+                    for (final CalibrationPoint c : orderedCalibrations) {
+                        if (c.forParentInput.get()) {
+                            anyParent = true;
+                        }
+                    }
+                    if (anyParent) {
+                        throw new Exception("Sorry, not implemented: calibration on parent for more than one clade.");
+                    }
+                    if (nCals == 2 && orderedCalibrations[1].taxa().containsAll(orderedCalibrations[0].taxa())) {
+                        // closed form formulas
+                    } else {
+                        setUpTables(tree.getLeafNodeCount() + 1);
+                        linsIter = new CalibrationLineagesIterator(this.xclades, this.taxaPartialOrder, maximal,
+                                tree.getLeafNodeCount());
+                        lastHeights = new double[nCals];
+                    }
+                }
+            } else if (type == Type.OVER_RANKED_COUNTS) {
+                setUpTables(tree.getLeafNodeCount() + 1);
+            }
+        }
+
+        final List<Node> leafs = tree.getExternalNodes();
+        final double height = leafs.get(0).getHeight();
+        for (final Node leaf : leafs) {
+            if (Math.abs(leaf.getHeight() - height) > 1e-8) {
+                System.err.println("WARNING: Calibrated Yule Model cannot handle dated tips. Use for example a coalescent prior instead.");
+                break;
+            }
+        }
+    }
+
+    public Tree compatibleInitialTree() throws Exception {
+        final int nCals = orderedCalibrations.length;
+        final double[] lowBound = new double[nCals];
+        final double[] cladeHeight = new double[nCals];
+
+        // get lower  bound: max(lower bound of dist , bounds of nested clades)
+        for (int k = 0; k < nCals; ++k) {
+            final CalibrationPoint cal = orderedCalibrations[k];
+            final ParametricDistribution dist = cal.dist();
+            //final double offset = dist.getOffset();
+            lowBound[k] = dist.inverseCumulativeProbability(0);
+            // those are node heights
+            if (lowBound[k] < 0) {
+                lowBound[k] = 0;
+            }
+            for (final int i : taxaPartialOrder[k]) {
+                lowBound[k] = Math.max(lowBound[k], lowBound[i]);
+            }
+            cladeHeight[k] = dist.inverseCumulativeProbability(1);
+//            if (! Double.isInfinite(cladeHeight[k])) {
+//              cladeHeight[k] += offset;
+//            }
+        }
+
+        for (int k = nCals - 1; k >= 0; --k) {
+            //  cladeHeight[k] should be the upper bound of k
+            double upper = cladeHeight[k];
+            if (Double.isInfinite(upper)) {
+                upper = lowBound[k] + 1;
+            }
+            cladeHeight[k] = (upper + lowBound[k]) / 2.0;
+
+            for (final int i : taxaPartialOrder[k]) {
+                cladeHeight[i] = Math.min(cladeHeight[i], cladeHeight[k]);
+            }
+        }
+
+        final TreeInterface tree = treeInput.get();
+        final int nNodes = tree.getLeafNodeCount();
+        final boolean[] used = new boolean[nNodes];
+
+        int curLeaf = -1;
+        int curInternal = nNodes - 1;
+
+        final Node[] subTree = new Node[nCals];
+        for (int k = 0; k < nCals; ++k) {
+            final List<Integer> freeTaxa = new ArrayList<Integer>();
+            for (final int ti : xclades[k]) {
+                freeTaxa.add(ti);
+            }
+            for (final int i : taxaPartialOrder[k]) {
+                for (final int u : xclades[i]) {
+                    freeTaxa.remove(new Integer(u));
+                }
+            }
+
+            final List<Node> sbs = new ArrayList<Node>();
+            for (final int i : freeTaxa) {
+                final Node n = new Node(tree.getNode(i).getID());
+                n.setNr(++curLeaf);
+                n.setHeight(0.0);
+                sbs.add(n);
+
+                used[i] = true;
+            }
+            for (final int i : taxaPartialOrder[k]) {
+                sbs.add(subTree[i]);
+                subTree[i] = null;
+            }
+            final double base = sbs.get(sbs.size() - 1).getHeight();
+            final double step = (cladeHeight[k] - base) / (sbs.size() - 1);
+
+            Node tr = sbs.get(0);
+            for (int i = 1; i < sbs.size(); ++i) {
+                tr = Node.connect(tr, sbs.get(i), base + i * step);
+                tr.setNr(++curInternal);
+            }
+            subTree[k] = tr;
+        }
+
+        Node finalTree = subTree[nCals - 1];
+        double h = cladeHeight[nCals - 1];
+
+        for (int k = 0; k < nCals - 1; ++k) {
+            final Node s = subTree[k];
+            if( s != null ) {
+                h = Math.max(h, cladeHeight[k]) + 1;
+                finalTree = Node.connect(finalTree, s, h);
+                finalTree.setNr(++curInternal);
+            }
+        }
+
+        for (int k = 0; k < used.length; ++k) {
+            if (!used[k]) {
+                final String tx = tree.getNode(k).getID();
+                final Node n = new Node(tx);
+                n.setHeight(0.0);
+                n.setNr(++curLeaf);
+                finalTree = Node.connect(finalTree, n, h + 1);
+                finalTree.setNr(++curInternal);
+                h += 1;
+            }
+        }
+        final Tree t = new Tree();
+        t.setRoot(finalTree);
+        t.initAndValidate();
+        return t;
+    }
+
+    @Override
+    public double calculateTreeLogLikelihood(final TreeInterface tree) {
+        final double lam = birthRateInput.get().getArrayValue();
+
+        double logL = calculateYuleLikelihood(tree, lam);
+
+        final double mar = getCorrection(tree, lam);
+        logL += mar;
+        return logL;
+    }
+
+    private static double calculateYuleLikelihood(final TreeInterface tree, final double lam) {
+        final int taxonCount = tree.getLeafNodeCount();
+
+        // add all lambda multipliers here
+        // No normalization at the moment.  for n! use logGamma(taxonCount + 1);
+        double logL = (taxonCount - 1) * Math.log(lam);
+
+        final Node[] nodes = tree.getNodesAsArray();
+        for (int i = taxonCount; i < nodes.length; i++) {
+            final Node node = nodes[i];
+            assert (!node.isLeaf());
+            final double height = node.getHeight();
+            final double mrh = -lam * height;
+            logL += mrh + (node.isRoot() ? mrh : 0);
+        }
+        return logL;
+    }
+
+    public double getCorrection(final TreeInterface tree, final double lam) {
+        double logL = 0.0;
+
+        final int nCals = orderedCalibrations.length;
+        final double[] hs = new double[nCals];
+
+        for (int k = 0; k < nCals; ++k) {
+            final CalibrationPoint cal = orderedCalibrations[k];
+            Node c;
+            final int[] taxk = xclades[k];
+            if (taxk.length > 1) {
+                //  find MRCA of taxa
+                c = getCommonAncestor(tree, taxk);
+
+                // only monophyletics clades can be calibrated
+                if (getLeafCount(c) != taxk.length) {
+                    return Double.NEGATIVE_INFINITY;
+                }
+            } else {
+                c = tree.getNode(taxk[0]);
+                assert cal.forParent();
+            }
+
+            if (cal.forParent()) {
+                c = c.getParent();
+            }
+
+            final double h = c.getHeight();
+            // add calibration density for point
+            if (calcCalibrations) {
+                logL += cal.logPdf(h);
+            }
+
+            hs[k] = h;
+        }
+
+        if (Double.isInfinite(logL)) {
+            // some calibration points out of range
+            return logL;
+        }
+
+        if (type == Type.NONE) {
+            return logL;
+        }
+
+        if (userPDF == null) {
+            switch (type) {
+                case OVER_ALL_TOPOS: {
+                    if (nCals == 1) {
+                        logL -= logMarginalDensity(lam, tree.getLeafNodeCount(), hs[0], xclades[0].length,
+                                orderedCalibrations[0].forParent());
+                    } else if (nCals == 2 && taxaPartialOrder[1].length == 1) {
+                        //assert !forParent[0] && !forParent[1];
+                        logL -= logMarginalDensity(lam, tree.getLeafNodeCount(), hs[0], xclades[0].length,
+                                hs[1], xclades[1].length);
+                    } else {
+
+                        if (lastLam == lam) {
+                            int k = 0;
+                            for (; k < hs.length; ++k) {
+                                if (hs[k] != lastHeights[k]) {
+                                    break;
+                                }
+                            }
+                            if (k == hs.length) {
+                                return lastValue;
+                            }
+                        }
+
+                        // the slow and painful way
+                        final double[] hss = new double[hs.length];
+                        final int[] ranks = new int[hs.length];
+                        for (int k = 0; k < hs.length; ++k) {
+                            int r = 0;
+                            for (int j = 0; j < k; ++j) {
+                                r += (hs[j] <= hs[k]) ? 1 : 0;
+                            }
+                            for (int j = k + 1; j < hs.length; ++j) {
+                                r += (hs[j] < hs[k]) ? 1 : 0;
+                            }
+//                            for (final double h : hs) {
+//                                r += (h < hs[k]) ? 1 : 0;
+//                            }
+                            ranks[k] = r + 1;
+                            hss[r] = hs[k];
+                        }
+                        logL -= logMarginalDensity(lam, hss, ranks, linsIter);
+
+                        lastLam = lam;
+                        System.arraycopy(hs, 0, lastHeights, 0, lastHeights.length);
+                        lastValue = logL;
+                    }
+                    break;
+                }
+
+                case OVER_RANKED_COUNTS: {
+                    Arrays.sort(hs);
+                    final int[] cs = new int[nCals + 1];
+                    for (final Node n : tree.getInternalNodes()) {
+                        final double nhk = n.getHeight();
+                        int i = 0;
+                        for (/**/; i < hs.length; ++i) {
+                            if (hs[i] >= nhk) {
+                                break;
+                            }
+                        }
+                        if (i == hs.length) {
+                            cs[i]++;
+                        } else {
+                            if (nhk < hs[i]) {
+                                cs[i]++;
+                            }
+                        }
+                    }
+
+                    double ll = 0;
+
+                    ll += cs[0] * Math.log1p(-Math.exp(-lam * hs[0])) - lam * hs[0] - lfactorials[cs[0]];
+                    for (int i = 1; i < cs.length - 1; ++i) {
+                        final int c = cs[i];
+                        ll += c * (Math.log1p(-Math.exp(-lam * (hs[i] - hs[i - 1]))) - lam * hs[i - 1]);
+                        ll += -lam * hs[i] - lfactorials[c];
+                    }
+                    ll += -lam * (cs[nCals] + 1) * hs[nCals - 1] - lfactorials[cs[nCals] + 1];
+                    ll += Math.log(lam) * nCals;
+
+                    logL -= ll;
+                    break;
+                }
+            }
+        } else {
+            final double value = userPDF.getArrayValue();
+            if (Double.isNaN(value) || Double.isInfinite(value)) {
+                logL = Double.NEGATIVE_INFINITY;
+            } else {
+                logL -= value;
+            }
+        }
+        return logL;
+    }
+
+    private static double logMarginalDensity(final double lam, final int nTaxa, final double h, final int nClade,
+                                             final boolean forParent) {
+        double lgp;
+
+        final double lh = lam * h;
+
+        if (forParent) {
+            // n(n+1) factor left out
+
+            lgp = -2 * lh + Math.log(lam);
+            if (nClade > 1) {
+                lgp += (nClade - 1) * Math.log(1 - Math.exp(-lh));
+            }
+        } else {
+            assert nClade > 1;
+
+            lgp = -3 * lh + (nClade - 2) * Math.log(1 - Math.exp(-lh)) + Math.log(lam);
+
+            // root is a special case
+            if (nTaxa == nClade) {
+                // n(n-1) factor left out
+                lgp += lh;
+            } else {
+                // (n^3-n)/2 factor left out
+            }
+        }
+
+        return lgp;
+    }
+
+    private static double logMarginalDensity(final double lam, final int nTaxa, final double h2, final int n,
+                                             final double h1, final int nm) {
+
+        assert h2 <= h1 && n < nm;
+
+        final int m = nm - n;
+
+        final double elh2 = Math.exp(-lam * h2);
+        final double elh1 = Math.exp(-lam * h1);
+
+        double lgl = 2 * Math.log(lam);
+
+        lgl += (n - 2) * Math.log(1 - elh2);
+        lgl += (m - 3) * Math.log(1 - elh1);
+
+        lgl += Math.log(1 - 2 * m * elh1 + 2 * (m - 1) * elh2
+                - m * (m - 1) * elh1 * elh2 + (m * (m + 1) / 2.) * elh1 * elh1
+                + ((m - 1) * (m - 2) / 2.) * elh2 * elh2);
+
+        if (nm < nTaxa) {
+            /* lgl += Math.log(0.5*(n*(n*n-1))*(n+1+m)) */
+            lgl -= lam * (h2 + 3 * h1);
+        } else {
+            /* lgl += Math.log(lam) /* + Math.log(n*(n*n-1)) */
+            lgl -= lam * (h2 + 2 * h1);
+        }
+
+        return lgl;
+    }
+
+    private double logMarginalDensity(final double lam, final double[] hs, final int[] ranks,
+                                      final CalibrationLineagesIterator cli) {
+
+        final int ni = cli.setup(ranks);
+
+        final int nHeights = hs.length;
+
+        final double[] lehs = new double[nHeights + 1];
+        lehs[0] = 0.0;
+        for (int i = 1; i < lehs.length; ++i) {
+            lehs[i] = -lam * hs[i - 1];
+        }
+
+        // assert maxRank == len(sit)
+        final boolean noRoot = ni == lehs.length;
+
+        final int nLevels = nHeights + (noRoot ? 1 : 0);
+
+        final double[] lebase = new double[nLevels];
+
+        for (int i = 0; i < nHeights; ++i) {
+            final double d = lehs[i + 1] - lehs[i];
+            lebase[i] = d != 0 ? lehs[i] + Math.log1p(-Math.exp(d)) : -50;
+        }
+
+        if (noRoot) {
+            lebase[nHeights] = lehs[nHeights];
+        }
+
+        final int[] linsAtLevel = new int[nLevels];
+
+        final int[][] joiners = cli.allJoiners();
+
+        double val = 0;
+        boolean first = true;
+
+        int[][] linsInLevels;
+        //int ccc = 0;
+        while ((linsInLevels = cli.next()) != null) {
+            //ccc++;
+            double v = countRankedTrees(nLevels, linsInLevels, joiners, linsAtLevel);
+            // 1 for root formula, 1 for kludge in iterator which sets root as 2 lineages
+            if (noRoot) {
+                final int ll = linsAtLevel[nLevels - 1] + 2;
+                linsAtLevel[nLevels - 1] = ll;
+
+                v -= lc2[ll] + lg2;
+            }
+
+            for (int i = 0; i < nLevels; ++i) {
+                v += linsAtLevel[i] * lebase[i];
+            }
+
+            if (first) {
+                val = v;
+                first = false;
+            } else {
+                if (val > v) {
+                    val += Math.log1p(Math.exp(v - val));
+                } else {
+                    val = v + Math.log1p(Math.exp(val - v));
+                }
+            }
+        }
+
+        double logc0 = 0.0;
+        int totLin = 0;
+        for (int i = 0; i < ni; ++i) {
+            final int l = cli.nStart(i);
+            if (l > 0) {
+                logc0 += lNR[l];
+                totLin += l;
+            }
+        }
+
+        final double logc1 = lfactorials[totLin];
+
+        double logc2 = nHeights * Math.log(lam);
+
+        for (int i = 1; i < nHeights + 1; ++i) {
+            logc2 += lehs[i];
+        }
+
+        if (!noRoot) {
+            // we dont have an iterator for 0 free lineages
+            logc2 += 1 * lehs[nHeights];
+        }
+
+        // Missing scale by total of all possible trees over all ranking orders.
+        // Add it outside if needed for comparison.
+
+        val += logc0 + logc1 + logc2;
+
+        return val;
+    }
+
+    private double
+    countRankedTrees(final int nLevels, final int[][] linsAtCrossings, final int[][] joiners, final int[] linsAtLevel) {
+        double logCount = 0;
+
+        for (int i = 0; i < nLevels; ++i) {
+            int sumLins = 0;
+            for (int k = i; k < nLevels; ++k) {
+                final int[] lack = linsAtCrossings[k];
+                int cki = lack[i];
+                if (joiners[k][i] > 0) {
+                    ++cki;
+                    if (cki > 1) {
+                        // can be 1 if iterator without lins - for joiners only - need to check this is correct
+                        logCount += lc2[cki];
+                    } //assert(cki >= 2);
+                }
+                final int l = cki - lack[i + 1];   //assert(l >= 0);
+                logCount -= lfactorials[l];
+                sumLins += l;
+            }
+            linsAtLevel[i] = sumLins;
+        }
+
+        return logCount;
+    }
+
+    private CalibrationLineagesIterator linsIter = null;
+
+    double lastLam = Double.NEGATIVE_INFINITY;
+    double[] lastHeights;
+    double lastValue = Double.NEGATIVE_INFINITY;
+
+    // speedup constants
+    private final double lg2 = Math.log(2.0);
+    private double[] lc2;
+    private double[] lNR;
+    private double[] lfactorials;
+
+    private void setUpTables(final int MAX_N) {
+        final double[] lints = new double[MAX_N];
+        lc2 = new double[MAX_N];
+        lfactorials = new double[MAX_N];
+        lNR = new double[MAX_N];
+
+        lints[0] = Double.NEGATIVE_INFINITY; //-infinity, should never be used
+        lints[1] = 0.0;
+        for (int i = 2; i < MAX_N; ++i) {
+            lints[i] = Math.log(i);
+        }
+
+        lc2[0] = lc2[1] = Double.NEGATIVE_INFINITY;
+        for (int i = 2; i < MAX_N; ++i) {
+            lc2[i] = lints[i] + lints[i - 1] - lg2;
+        }
+
+        lfactorials[0] = 0.0;
+        for (int i = 1; i < MAX_N; ++i) {
+            lfactorials[i] = lfactorials[i - 1] + lints[i];
+        }
+
+        lNR[0] = Double.NEGATIVE_INFINITY; //-infinity, should never be used
+        lNR[1] = 0.0;
+
+        for (int i = 2; i < MAX_N; ++i) {
+            lNR[i] = lNR[i - 1] + lc2[i];
+        }
+    }
+
+    // @return true if the k'th taxa is maximal under set inclusion, i.e. it is not contained in any other set
+    public static boolean isMaximal(final List<TaxonSet> taxa, final int k) {
+        final TaxonSet tk = taxa.get(k);
+        for (int i = 0; i < taxa.size(); ++i) {
+            if (i != k) {
+                if (taxa.get(i).containsAll(tk)) {
+                    return false;
+                }
+            }
+        }
+        return true;
+    }
+
+
+    // Q2R Those generic functions could find a better home
+
+    public static int getTaxonIndex(final TreeInterface tree, final String taxon) {
+        for (int i = 0; i < tree.getNodeCount(); i++) {
+            final Node node = tree.getNode(i);
+            if (node.isLeaf() && node.getID().equals(taxon)) {
+                return i;
+            }
+        }
+        return -1;
+    }
+
+    public static Node getCommonAncestor(Node n1, Node n2) {
+        // assert n1.getTree() == n2.getTree();
+        while (n1 != n2) {
+            if (n1.getHeight() < n2.getHeight()) {
+                n1 = n1.getParent();
+            } else {
+                n2 = n2.getParent();
+            }
+        }
+        return n1;
+    }
+
+    // A lightweight version for finding the most recent common ancestor of a group of taxa.
+    // return the node-ref of the MRCA.
+
+    // would be nice to use nodeRef's, but they are not preserved :(
+    public static Node getCommonAncestor(final TreeInterface tree, final int[] nodes) {
+        Node cur = tree.getNode(nodes[0]);
+
+        for (int k = 1; k < nodes.length; ++k) {
+            cur = getCommonAncestor(cur, tree.getNode(nodes[k]));
+        }
+        return cur;
+    }
+
+    /**
+     * Count number of leaves in subtree whose root is node.
+     *
+     * @param node
+     * @return the number of leaves under this node.
+     */
+    public static int getLeafCount(final Node node) {
+        if (node.isLeaf()) {
+            return 1;
+        }
+        return getLeafCount(node.getLeft()) + getLeafCount(node.getRight());
+    }
+
+    // log likelihood and clades heights
+
+    @Override
+    public void init(final PrintStream out) throws Exception {
+        out.print(getID() + "\t");
+        if (calcCalibrations) {
+            for (final CalibrationPoint cp : orderedCalibrations) {
+                out.print(cp.getID() + "\t");
+            }
+        }
+    }
+
+    @Override
+    public void log(final int nSample, final PrintStream out) {
+        out.print(getCurrentLogP() + "\t");
+        if (calcCalibrations) {
+            final TreeInterface tree = treeInput.get();
+            for (int k = 0; k < orderedCalibrations.length; ++k) {
+                final CalibrationPoint cal = orderedCalibrations[k];
+                Node c;
+                final int[] taxk = xclades[k];
+                if (taxk.length > 1) {
+                    //  find MRCA of taxa
+                    c = getCommonAncestor(tree, taxk);
+                } else {
+                    c = tree.getNode(taxk[0]);
+                }
+
+                if (cal.forParent()) {
+                    c = c.getParent();
+                }
+
+                final double h = c.getHeight();
+                out.print(h + "\t");
+            }
+        }
+    }
+
+    @Override
+    protected boolean requiresRecalculation() {
+        return super.requiresRecalculation() || birthRateInput.get().somethingIsDirty();
+    }
+
+    @Override
+    public boolean canHandleTipDates() {
+        return false;
+    }
+
+
+}
diff --git a/src/beast/evolution/speciation/CalibrationLineagesIterator.java b/src/beast/evolution/speciation/CalibrationLineagesIterator.java
new file mode 100644
index 0000000..f5db7b0
--- /dev/null
+++ b/src/beast/evolution/speciation/CalibrationLineagesIterator.java
@@ -0,0 +1,296 @@
+package beast.evolution.speciation;
+
+// Arguably the most complex iterator I have ever written.
+/**
+* @author Joseph Heled
+ */
+
+
+public class CalibrationLineagesIterator {
+    // taxaPartialOrder[i] contains clades immediately contained in the i'th clade as indices (so, strictly smaller than i)
+    final int[][] taxaPartialOrder;
+
+    // Per calibration point, the number of taxa which is not below any other point.
+    final int[] cladesFreeLins;
+
+    private final boolean rootCalibrated;
+
+    // Use iterators 0 to nCurIters-1 (i.e. iters[0:nCurIters])
+    private int nCurIters;
+
+    // per clade Iterator
+    private final LinsIterator[] iters;
+
+    // last returned value from iterators: vals[i] for  iters[i]
+    private int[][] vals;
+
+    // Number of taxa not below any calibration point
+    private int nFreeLineages;
+
+    // indices of maximal clades
+    private final int[] maximalClades;
+
+    CalibrationLineagesIterator(final int[][] clades, final int[][] taxaPartialOrder,
+                                final boolean[] maximal, final int leafCount) {
+        cladesFreeLins = new int[clades.length];
+        for(int k = 0; k < cladesFreeLins.length; ++k) {
+            cladesFreeLins[k] = clades[k].length;
+            for( final int l : taxaPartialOrder[k] ) {
+                cladesFreeLins[k] -= clades[l].length;
+            }
+            assert cladesFreeLins[k] >= 0;
+        }
+
+        this.taxaPartialOrder = taxaPartialOrder;
+        iters = new LinsIterator[clades.length+1];
+        vals = new int[iters.length][];
+
+        // number of maximal clades
+        int nMax = 0;
+        for(final boolean b : maximal) {
+           nMax += b ? 1 : 0;
+        }
+
+        // indices of maximal clades in a list
+        maximalClades = new int[nMax];
+        nFreeLineages = leafCount;
+
+        nMax = 0;
+        for(int m = 0; m < maximal.length; ++m) {
+            if( maximal[m] ) {
+              maximalClades[nMax] = m;
+              ++nMax;
+              nFreeLineages -= clades[m].length;
+            }
+        }
+
+        rootCalibrated = ( nMax == 1 && clades[maximalClades[0]].length == leafCount );
+
+        assert ! (rootCalibrated &&  nFreeLineages > 0);
+        assert nFreeLineages >= 0;
+    }
+
+    boolean isRootCalibrated() {
+        return rootCalibrated;
+    }
+
+    // Prepare to iterate: ranks[i] gives the rank of the i'th clade. ranks is a permutation of (1,2,...,#points)
+    int setup(final int[] ranks) {
+        final int n = cladesFreeLins.length;
+
+        // reset iterators used. each call to setOneIterator will increment it by one.
+        nCurIters = 0;
+
+        for(int k = 0; k < n; ++k) {
+            setOneIterator(ranks, taxaPartialOrder[k], cladesFreeLins[k], ranks[k]);
+        }
+
+        if( ! rootCalibrated ) {
+          setOneIterator(ranks, maximalClades, nFreeLineages, n+1);
+        }
+        
+        for(int k = 0; k < nCurIters-1; ++k) {
+            vals[k] = iters[k].next();
+        }
+
+        return nCurIters;
+    }
+
+    private void setOneIterator(final int[] ranks, final int[] joinerClades, final int nl, final int rank) {
+        final int nSubs = joinerClades.length;
+
+        LinsIterator itr/* = null*/;
+        if( nSubs == 0 ) {
+            itr = new LinsIterator(nl, rank, null);
+        } else /*if( nl > 0 || nSubs > 2 ) */ {
+            final int[] s = new int[nSubs];
+            for(int i = 0; i < nSubs; ++i) {
+                s[i] = ranks[joinerClades[i]];
+            }
+            itr = new LinsIterator(nl, rank, s);
+        }
+
+        //assert itr != null;
+        //if( itr != null ) {
+            // sorted according to rank
+            iters[itr.rank-1] = itr;
+            itr.startIter();
+            ++nCurIters;
+        //}
+    }
+
+    int[][] next()
+    {
+        final int[] l = iters[nCurIters-1].next();
+
+        if( l != null ) {
+            vals[nCurIters-1] = l;
+            return vals;
+        }
+
+        int i = nCurIters-2;
+        for( ; i >= 0; --i) {
+            if( (vals[i] = iters[i].next()) != null) {
+                break;
+            }
+        }
+
+        if( i < 0 ) {
+            return null;
+        }
+
+        ++i;
+
+        for( ; i < nCurIters; ++i) {
+            iters[i].startIter();
+            vals[i] = iters[i].next();
+        }
+
+        return vals;
+    }
+
+    public int[][] allJoiners() {
+        final int[][] joiners = new int[nCurIters][];
+
+        for(int i = 0; i < nCurIters; ++i) {
+            joiners[i] = iters[i].ljoins();
+        }
+        return joiners;
+    }
+
+    public int nStart(final int i) {
+        return iters[i].nStart;
+    }
+
+    class LinsIterator {
+
+        private final int rank;
+        private final int nStart;
+        private final int[] joiners;
+        private final int[] aStart;
+        // Current count of lineages at all relevant time points, from 0 (start) to clade top.
+        private final int[] lins;
+        private int lastJoinger;
+        private boolean stopIter;
+
+        LinsIterator(final int ns, final int r, final int[] jnr) {
+            rank = r;
+            nStart = ns;
+            joiners = new int [r];
+
+            lastJoinger = -1;
+
+            // 2 for start+end, rank-1 intermediate levels
+            aStart = new int [2 + rank-1];
+            lins = new int [2 + rank-1];
+
+            for(int k = 0; k < rank; ++k) {
+                joiners[k] = 0;
+            }
+
+            if( jnr != null ) {
+                for (final int j : jnr) {
+                    joiners[j] = 1;
+                    if (lastJoinger < j) {
+                        lastJoinger = j;
+                    }
+                }
+            }
+            aStart[0] = ns;
+
+            if( lastJoinger <= 0 ) {
+                for(int i = 1; i < rank+1; ++i) {
+                    aStart[i] = 2;
+                }
+                if( rank > 1 ) {
+                    // first iteration increments this
+                    aStart[rank-1] -= 1;
+                }
+            } else {
+                //assert(rank > 1);
+
+                if( nStart > 0 ) {
+                    int i = 1;
+                    for(; i < lastJoinger+1; ++i) {
+                        aStart[i] = 1;
+                    }
+                    for(; i < rank+1; ++i) {
+                        aStart[i] = 2;
+                    }
+                } else {
+                    assert jnr != null;
+                    int mj = jnr[0];
+                    for (int aJnr : jnr) {
+                        mj = Math.min(mj, aJnr);
+                    }
+                    int i = 1;
+                    for(; i < mj+1; ++i) {
+                        aStart[i] = 0;
+                    }
+                    for(; i < lastJoinger+1; ++i) {
+                        aStart[i] = 1;
+                    }
+                    for(; i < rank+1; ++i) {
+                        aStart[i] = 2;
+                    }
+                }
+                // first iteration increments this
+                aStart[rank-1] -= 1;
+            }
+
+        }
+
+        void startIter() {
+            for(int i = 0; i < rank+1; ++i) {
+                lins[i] = aStart[i];
+            }
+            stopIter = false;
+        }
+
+        final int[] next()
+        {
+            int i = rank - 1;
+            if( lastJoinger <= 0 ) {
+                while( i >= 1 && lins[i] == lins[i-1]) {
+                    --i;
+                }
+                if( i == 0 ) {
+                    if( rank == 1 ) {
+                        if( !stopIter ) {
+                            stopIter = true;
+                            return lins;
+                        }
+                    }
+                    return null;
+                }
+                lins[i] += 1;
+                ++i;
+                while( i < rank ) {
+                    lins[i] = 2;
+                    ++i;
+                }
+            } else {
+
+                while( i >= 1 && lins[i] == lins[i-1] + joiners[i-1] ) {
+                    --i;
+                }
+                if( i == 0 ) {
+                    return null;
+                }
+                lins[i] += 1;
+                i++;
+                while( i < rank ) {
+                    lins[i] = (i <= lastJoinger) ? 1 : 2;
+                    i++;
+                }
+            }
+            return lins;
+        }
+
+        final int[] ljoins()  {
+            return joiners;
+        }
+    }
+}
+
+
diff --git a/src/beast/evolution/speciation/CalibrationPoint.java b/src/beast/evolution/speciation/CalibrationPoint.java
new file mode 100644
index 0000000..8094473
--- /dev/null
+++ b/src/beast/evolution/speciation/CalibrationPoint.java
@@ -0,0 +1,55 @@
+package beast.evolution.speciation;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.BEASTObject;
+import beast.evolution.alignment.TaxonSet;
+import beast.math.distributions.ParametricDistribution;
+
+/**
+* @author Joseph Heled
+ */
+
+ at Description("Specification of a single calibration point of the calibrated Yule.")
+public class CalibrationPoint extends BEASTObject {
+    public Input<TaxonSet> taxonsetInput = new Input<TaxonSet>("taxonset",
+            "Set of taxa. The prior distribution is applied to their TMRCA.", Input.Validate.REQUIRED);
+
+    public Input<ParametricDistribution> distInput = new Input<ParametricDistribution>("distr",
+            "Prior distribution applied to time of clade MRCA", Input.Validate.REQUIRED);
+
+//    public Input<Boolean> m_bIsMonophyleticInput = new Input<Boolean>("monophyletic",
+//            "whether the taxon set is monophyletic (forms a clade without other taxa) or nor. Default is false.", false);
+
+    public Input<Boolean> forParentInput = new Input<Boolean>("parentOf",
+            "Use time of clade parent. Default is false.", false);
+
+
+    private TaxonSet t;
+    private boolean forPar;
+    private ParametricDistribution pd;
+
+    public CalibrationPoint() {}
+
+    public void initAndValidate() throws Exception {
+        t = taxonsetInput.get();
+        forPar = forParentInput.get();
+        pd = distInput.get();
+    }
+
+    public TaxonSet taxa() {
+       return t;
+    }
+
+    public boolean forParent() {
+        return forPar;
+    }
+
+    public ParametricDistribution dist() {
+      return pd;
+    }
+
+    public double logPdf(final double x) {
+        return pd.logDensity(x);
+    }
+}
diff --git a/src/beast/evolution/speciation/GeneTreeForSpeciesTreeDistribution.java b/src/beast/evolution/speciation/GeneTreeForSpeciesTreeDistribution.java
new file mode 100644
index 0000000..810860d
--- /dev/null
+++ b/src/beast/evolution/speciation/GeneTreeForSpeciesTreeDistribution.java
@@ -0,0 +1,401 @@
+package beast.evolution.speciation;
+
+
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.PriorityQueue;
+import java.util.Random;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.State;
+import beast.core.Input.Validate;
+import beast.core.parameter.RealParameter;
+import beast.evolution.alignment.Taxon;
+import beast.evolution.alignment.TaxonSet;
+import beast.evolution.speciation.SpeciesTreePrior.TreePopSizeFunction;
+import beast.evolution.tree.Node;
+import beast.evolution.tree.Tree;
+import beast.evolution.tree.TreeDistribution;
+import beast.evolution.tree.TreeInterface;
+
+
+
+ at Description("Calculates probability of gene tree conditioned on a species tree (multi-species coalescent)")
+public class GeneTreeForSpeciesTreeDistribution extends TreeDistribution {
+    public Input<TreeInterface> speciesTreeInput =
+            new Input<TreeInterface>("speciesTree", "species tree containing the associated gene tree", Validate.REQUIRED);
+
+//    public enum PLOIDY {autosomal_nuclear, X, Y, mitrochondrial};
+    
+    public Input<Double> ploidyInput =
+            new Input<Double>("ploidy", "ploidy (copy number) for this gene, typically a whole number or half (default 2 for autosomal_nuclear)", 2.0);
+//    public Input<PLOIDY> m_ploidy =
+//        new Input<PLOIDY>("ploidy", "ploidy for this gene (default X, Possible values: " + PLOIDY.values(), PLOIDY.X, PLOIDY.values());
+
+    
+    public Input<SpeciesTreePrior> speciesTreePriorInput =
+            new Input<SpeciesTreePrior>("speciesTreePrior", "defines population function and its parameters", Validate.REQUIRED);
+
+    public Input<TreeTopFinder> treeTopFinderInput =
+            new Input<TreeTopFinder>("treetop", "calculates height of species tree, required only for linear *beast analysis");
+
+    // intervals for each of the species tree branches
+    private PriorityQueue<Double>[] intervalsInput;
+    // count nr of lineages at the bottom of species tree branches
+    private int[] nrOfLineages;
+    // maps gene tree leaf nodes to species tree leaf nodes. Indexed by node number.
+    protected int[] nrOfLineageToSpeciesMap;
+
+    beast.evolution.speciation.SpeciesTreePrior.TreePopSizeFunction isConstantPopFunction;
+    RealParameter popSizesBottom;
+    RealParameter popSizesTop;
+
+    // Ploidy is a constant - cache value of input here
+    private double ploidy;
+
+    //???
+    public GeneTreeForSpeciesTreeDistribution() {
+        treeInput.setRule(Validate.REQUIRED);
+    }
+
+    @Override
+    public void initAndValidate() throws Exception {
+    	ploidy = ploidyInput.get();
+//    	switch (m_ploidy.get()) {
+//			case autosomal_nuclear: m_fPloidy = 2.0; break;
+//			case X: m_fPloidy = 1.5; break;
+//			case Y: m_fPloidy = 0.5; break;
+//			case mitrochondrial: m_fPloidy = 0.5; break;
+//			default: throw new Exception("Unknown value for ploidy");
+//		}
+        final Node[] gtNodes = treeInput.get().getNodesAsArray();
+        final int nGtLineages = treeInput.get().getLeafNodeCount();
+        final Node[] sptNodes = speciesTreeInput.get().getNodesAsArray();
+        final int nSpecies = speciesTreeInput.get().getNodeCount();
+
+
+        if (nSpecies <= 1 && sptNodes[0].getID().equals("Beauti2DummyTaxonSet")) {
+            // we are in Beauti, don't initialise
+            return;
+        }
+
+
+        // reserve memory for priority queues
+        intervalsInput = new PriorityQueue[nSpecies];
+        for (int i = 0; i < nSpecies; i++) {
+            intervalsInput[i] = new PriorityQueue<Double>();
+        }
+
+        // sanity check lineage nodes are all at height=0
+        for (int i = 0; i < nGtLineages; i++) {
+            if (gtNodes[i].getHeight() != 0) {
+                throw new Exception("Cannot deal with taxon " + gtNodes[i].getID() +
+                        ", which has non-zero height + " + gtNodes[i].getHeight());
+            }
+        }
+        // set up m_nLineageToSpeciesMap
+        nrOfLineageToSpeciesMap = new int[nGtLineages];
+
+        Arrays.fill(nrOfLineageToSpeciesMap, -1);
+        for (int i = 0; i < nGtLineages; i++) {
+            final String sSpeciesID = getSetID(gtNodes[i].getID());
+            // ??? can this be a startup check? can this happen during run due to tree change?
+            if (sSpeciesID == null) {
+                throw new Exception("Cannot find species for lineage " + gtNodes[i].getID());
+            }
+            for (int iSpecies = 0; iSpecies < nSpecies; iSpecies++) {
+                if (sSpeciesID.equals(sptNodes[iSpecies].getID())) {
+                    nrOfLineageToSpeciesMap[i] = iSpecies;
+                    break;
+                }
+            }
+            if (nrOfLineageToSpeciesMap[i] < 0) {
+                throw new Exception("Cannot find species with name " + sSpeciesID + " in species tree");
+            }
+        }
+
+        // calculate nr of lineages per species
+        nrOfLineages = new int[nSpecies];
+//        for (final Node node : gtNodes) {
+//            if (node.isLeaf()) {
+//                final int iSpecies = m_nLineageToSpeciesMap[node.getNr()];
+//                m_nLineages[iSpecies]++;
+//            }
+//        }
+
+        final SpeciesTreePrior popInfo = speciesTreePriorInput.get();
+        isConstantPopFunction = popInfo.popFunctionInput.get();
+        popSizesBottom = popInfo.popSizesBottomInput.get();
+        popSizesTop = popInfo.popSizesTopInput.get();
+
+        assert( ! (isConstantPopFunction == TreePopSizeFunction.linear && treeTopFinderInput.get() == null ) );
+    }
+
+    /**
+     * @param sLineageID
+     * @return species ID to which the lineage ID belongs according to the TaxonSets
+     */
+    String getSetID(final String sLineageID) {
+        final TaxonSet taxonSuperset = speciesTreePriorInput.get().taxonSetInput.get();
+        final List<Taxon> taxonSets = taxonSuperset.taxonsetInput.get();
+        for (final Taxon taxonSet : taxonSets) {
+            final List<Taxon> taxa = ((TaxonSet) taxonSet).taxonsetInput.get();
+            for (final Taxon aTaxa : taxa) {
+                if (aTaxa.getID().equals(sLineageID)) {
+                    return taxonSet.getID();
+                }
+            }
+        }
+        return null;
+    }
+
+    @Override
+    public double calculateLogP() {
+        logP = 0;
+        for (final PriorityQueue<Double> m_interval : intervalsInput) {
+            m_interval.clear();
+        }
+
+        Arrays.fill(nrOfLineages, 0);
+
+        final TreeInterface stree = speciesTreeInput.get();
+        final Node[] speciesNodes = stree.getNodesAsArray();
+
+        traverseLineageTree(speciesNodes, treeInput.get().getRoot());
+//		System.err.println(getID());
+//		for (int i = 0; i < m_intervals.length; i++) {
+//			System.err.println(m_intervals[i]);
+//		}
+        // if the gene tree does not fit the species tree, logP = -infinity by now
+        if (logP == 0) {
+            traverseSpeciesTree(stree.getRoot());
+        }
+//		System.err.println("logp=" + logP);
+        return logP;
+    }
+
+    /**
+     * calculate contribution to logP for each of the branches of the species tree
+     *
+     * @param node*
+     */
+    private void traverseSpeciesTree(final Node node) {
+        if (!node.isLeaf()) {
+            traverseSpeciesTree(node.getLeft());
+            traverseSpeciesTree(node.getRight());
+        }
+        // calculate contribution of a branch in the species tree to the log probability
+        final int iNode = node.getNr();
+
+        // k, as defined in the paper
+        //System.err.println(Arrays.toString(m_nLineages));
+        final int k = intervalsInput[iNode].size();
+        final double[] fTimes = new double[k + 2];
+        fTimes[0] = node.getHeight();
+        for (int i = 1; i <= k; i++) {
+            fTimes[i] = intervalsInput[iNode].poll();
+        }
+        if (!node.isRoot()) {
+            fTimes[k + 1] = node.getParent().getHeight();
+        } else {
+            if (isConstantPopFunction == TreePopSizeFunction.linear) {
+                fTimes[k + 1] = treeTopFinderInput.get().getHighestTreeHeight();
+            } else {
+                fTimes[k + 1] = Math.max(node.getHeight(), treeInput.get().getRoot().getHeight());
+            }
+        }
+        // sanity check
+        for (int i = 0; i <= k; i++) {
+            if (fTimes[i] > fTimes[i + 1]) {
+                System.err.println("invalid times");
+                calculateLogP();
+            }
+        }
+
+        final int nLineagesBottom = nrOfLineages[iNode];
+
+        switch (isConstantPopFunction) {
+            case constant:
+                calcConstantPopSizeContribution(nLineagesBottom, popSizesBottom.getValue(iNode), fTimes, k);
+                break;
+            case linear:
+                logP += calcLinearPopSizeContributionJH(nLineagesBottom, iNode, fTimes, k, node);
+                break;
+            case linear_with_constant_root:
+                if (node.isRoot()) {
+                    final double fPopSize = getTopPopSize(node.getLeft().getNr()) + getTopPopSize(node.getRight().getNr());
+                    calcConstantPopSizeContribution(nLineagesBottom, fPopSize, fTimes, k);
+                } else {
+                    logP += calcLinearPopSizeContribution(nLineagesBottom, iNode, fTimes, k, node);
+                }
+                break;
+        }
+    }
+
+    /* the contribution of a branch in the species tree to
+      * the log probability, for constant population function.
+      */
+    private void calcConstantPopSizeContribution(final int nLineagesBottom, final double fPopSize2,
+                                                 final double[] fTimes, final int k) {
+        final double fPopSize = fPopSize2 * ploidy;
+        logP += -k * Math.log(fPopSize);
+//		System.err.print(logP);
+        for (int i = 0; i <= k; i++) {
+            logP += -((nLineagesBottom - i) * (nLineagesBottom - i - 1.0) / 2.0) * (fTimes[i + 1] - fTimes[i]) / fPopSize;
+        }
+//		System.err.println(" " + logP + " " + Arrays.toString(fTimes) + " " + iNode + " " + k);
+    }
+
+    /* the contribution of a branch in the species tree to
+      * the log probability, for linear population function.
+      */
+    private double calcLinearPopSizeContribution(final int nLineagesBottom, final int iNode, final double[] fTimes,
+                                                 final int k, final Node node) {
+        double lp = 0.0;
+        final double fPopSizeBottom;
+        if (node.isLeaf()) {
+            fPopSizeBottom = popSizesBottom.getValue(iNode) * ploidy;
+        } else {
+            // use sum of left and right child branches for internal nodes
+            fPopSizeBottom = (getTopPopSize(node.getLeft().getNr()) + getTopPopSize(node.getRight().getNr())) * ploidy;
+        }
+        final double fPopSizeTop = getTopPopSize(iNode) * ploidy;
+        final double a = (fPopSizeTop - fPopSizeBottom) / (fTimes[k + 1] - fTimes[0]);
+        final double b = fPopSizeBottom;
+        for (int i = 0; i < k; i++) {
+            //double fPopSize = fPopSizeBottom + (fPopSizeTop-fPopSizeBottom) * fTimes[i+1]/(fTimes[k]-fTimes[0]);
+            final double fPopSize = a * (fTimes[i + 1] - fTimes[0]) + b;
+            lp += -Math.log(fPopSize);
+        }
+        for (int i = 0; i <= k; i++) {
+            if (Math.abs(fPopSizeTop - fPopSizeBottom) < 1e-10) {
+                // slope = 0, so population function is constant
+                final double fPopSize = a * (fTimes[i + 1] - fTimes[0]) + b;
+                lp += -((nLineagesBottom - i) * (nLineagesBottom - i - 1.0) / 2.0) * (fTimes[i + 1] - fTimes[i]) / fPopSize;
+            } else {
+                final double f = (a * (fTimes[i + 1] - fTimes[0]) + b) / (a * (fTimes[i] - fTimes[0]) + b);
+                lp += -((nLineagesBottom - i) * (nLineagesBottom - i - 1.0) / 2.0) * Math.log(f) / a;
+            }
+        }
+        return lp;
+    }
+
+    private double calcLinearPopSizeContributionJH(final int nLineagesBottom, final int iNode, final double[] fTimes,
+                                                   final int k, final Node node) {
+        double lp = 0.0;
+        double fPopSizeBottom;
+        if (node.isLeaf()) {
+            fPopSizeBottom = popSizesBottom.getValue(iNode);
+        } else {
+            // use sum of left and right child branches for internal nodes
+            fPopSizeBottom = (getTopPopSize(node.getLeft().getNr()) + getTopPopSize(node.getRight().getNr()));
+        }
+        fPopSizeBottom *= ploidy;
+
+        final double fPopSizeTop = getTopPopSize(iNode) * ploidy;
+        final double d5 = fPopSizeTop - fPopSizeBottom;
+        final double fTime0 = fTimes[0];
+        final double a = d5 / (fTimes[k + 1] - fTime0);
+        final double b = fPopSizeBottom;
+
+        if (Math.abs(d5) < 1e-10) {
+            // use approximation for small values to bypass numerical instability
+            for (int i = 0; i <= k; i++) {
+                final double fTimeip1 = fTimes[i + 1];
+                final double fPopSize = a * (fTimeip1 - fTime0) + b;
+                if( i < k ) {
+                  lp += -Math.log(fPopSize);
+                }
+                // slope = 0, so population function is constant
+
+                final int i1 = nLineagesBottom - i;
+                lp -= (i1 * (i1 - 1.0) / 2.0) * (fTimeip1 - fTimes[i]) / fPopSize;
+            }
+        } else {
+            final double vv = b - a * fTime0;
+            for (int i = 0; i <= k; i++) {
+                final double fPopSize = a * fTimes[i + 1] + vv;
+                if( i < k ) {
+                  lp += -Math.log(fPopSize);
+                }
+                final double f = fPopSize / (a * fTimes[i] + vv);
+
+                final int i1 = nLineagesBottom - i;
+                lp += -(i1 * (i1 - 1.0) / 2.0) * Math.log(f) / a;
+            }
+        }
+        return lp;
+    }
+
+    /**
+     * collect intervals for each of the branches of the species tree
+     * as defined by the lineage tree.
+     *
+     * @param speciesNodes
+     * @param node
+     * @return
+     */
+    private int traverseLineageTree(final Node[] speciesNodes, final Node node) {
+        if (node.isLeaf()) {
+            final int iSpecies = nrOfLineageToSpeciesMap[node.getNr()];
+            nrOfLineages[iSpecies]++;
+            return iSpecies;
+        } else {
+            int nSpeciesLeft = traverseLineageTree(speciesNodes, node.getLeft());
+            int nSpeciesRight = traverseLineageTree(speciesNodes, node.getRight());
+            final double fHeight = node.getHeight();
+
+            while (!speciesNodes[nSpeciesLeft].isRoot() && fHeight > speciesNodes[nSpeciesLeft].getParent().getHeight()) {
+                nSpeciesLeft = speciesNodes[nSpeciesLeft].getParent().getNr();
+                nrOfLineages[nSpeciesLeft]++;
+            }
+            while (!speciesNodes[nSpeciesRight].isRoot() && fHeight > speciesNodes[nSpeciesRight].getParent().getHeight()) {
+                nSpeciesRight = speciesNodes[nSpeciesRight].getParent().getNr();
+                nrOfLineages[nSpeciesRight]++;
+            }
+            // validity check
+            if (nSpeciesLeft != nSpeciesRight) {
+                // if we got here, it means the gene tree does
+                // not fit in the species tree
+                logP = Double.NEGATIVE_INFINITY;
+            }
+            intervalsInput[nSpeciesRight].add(fHeight);
+            return nSpeciesRight;
+        }
+    }
+
+    /* return population size at top. For linear with constant root, there is no
+      * entry for the root. An internal node can have the number equal to dimension
+      * of m_fPopSizesTop, then the root node can be numbered with a lower number
+      * and we can use that entry in m_fPopSizesTop for the rogue internal node.
+      */
+    private double getTopPopSize(final int iNode) {
+        if (iNode < popSizesTop.getDimension()) {
+            return popSizesTop.getArrayValue(iNode);
+        }
+        return popSizesTop.getArrayValue(speciesTreeInput.get().getRoot().getNr());
+    }
+
+
+    @Override
+    public boolean requiresRecalculation() {
+        // TODO: check whether this is worth optimising?
+        return true;
+    }
+
+    @Override
+    public List<String> getArguments() {
+        return null;
+    }
+
+    @Override
+    public List<String> getConditions() {
+        return null;
+    }
+
+    @Override
+    public void sample(final State state, final Random random) {
+    }
+}
diff --git a/src/beast/evolution/speciation/RandomGeneTree.java b/src/beast/evolution/speciation/RandomGeneTree.java
new file mode 100644
index 0000000..b187f34
--- /dev/null
+++ b/src/beast/evolution/speciation/RandomGeneTree.java
@@ -0,0 +1,54 @@
+package beast.evolution.speciation;
+
+import java.util.List;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.Input.Validate;
+import beast.evolution.tree.Node;
+import beast.evolution.tree.RandomTree;
+import beast.evolution.tree.Tree;
+import beast.evolution.tree.coalescent.PopulationFunction;
+
+
+
+ at Description("Generates a random gene tree conditioned on a species tree, such " +
+        "that the root of the species tree is lower than any coalescent events in " +
+        "the gene tree")
+public class RandomGeneTree extends RandomTree {
+    public Input<Tree> speciesTreeInput = new Input<Tree>("speciesTree", "The species tree in which this random gene tree needs to fit", Validate.REQUIRED);
+
+    @Override
+    public void initAndValidate() throws Exception {
+        super.initAndValidate();
+    }
+
+    @Override
+    public Node simulateCoalescent(List<Node> nodes, PopulationFunction demographic) {
+        // sanity check - disjoint trees
+
+//        if( ! Tree.Utils.allDisjoint(nodes) ) {
+//            throw new RuntimeException("non disjoint trees");
+//        }
+
+        if (nodes.size() == 0) {
+            throw new IllegalArgumentException("empty nodes set");
+        }
+
+        final double fLowestHeight = speciesTreeInput.get().getRoot().getHeight();
+
+        for (int attempts = 0; attempts < 1000; ++attempts) {
+            try {
+                final List<Node> rootNode = simulateCoalescent(nodes, demographic, fLowestHeight, Double.POSITIVE_INFINITY);
+                if (rootNode.size() == 1) {
+                    return rootNode.get(0);
+                }
+            } catch (ConstraintViolatedException e) {
+                // TODO: handle exception
+            }
+        }
+
+        throw new RuntimeException("failed to merge trees after 1000 tries!");
+    }
+
+}
diff --git a/src/beast/evolution/speciation/SpeciesTreeDistribution.java b/src/beast/evolution/speciation/SpeciesTreeDistribution.java
new file mode 100644
index 0000000..327ba6d
--- /dev/null
+++ b/src/beast/evolution/speciation/SpeciesTreeDistribution.java
@@ -0,0 +1,101 @@
+/*
+ * SpeciationLikelihood.java
+ *
+ * Copyright (C) 2002-2009 Alexei Drummond and Andrew Rambaut
+ *
+ * This file is part of BEAST.
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership and licensing.
+ *
+ * BEAST 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
+ * of the License, or (at your option) any later version.
+ *
+ * BEAST 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 BEAST; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+package beast.evolution.speciation;
+
+
+
+import java.util.List;
+import java.util.Random;
+
+import beast.core.Description;
+import beast.core.State;
+import beast.evolution.tree.Tree;
+import beast.evolution.tree.TreeDistribution;
+import beast.evolution.tree.TreeInterface;
+
+
+/**
+ * Ported from Beast 1.6
+ *
+ * @author Andrew Rambaut
+ * @author Alexei Drummond
+ * @version $Id: SpeciationLikelihood.java,v 1.10 2005/05/18 09:51:11 rambaut Exp $
+ */
+ at Description("A likelihood function for speciation processes.")
+abstract public class SpeciesTreeDistribution extends TreeDistribution {
+//	SpeciesTreeDistribution extends TreeDistribution
+
+    /**
+     * Calculates the log likelihood of this set of coalescent intervals,
+     * given a demographic model.
+     *
+     * @return the log likelihood
+     */
+    @Override
+    public double calculateLogP() {
+        // (Q2R): what if tree intervals?
+        // (Q2R): always the same tree, no? so why pass in argument
+        final TreeInterface tree = treeInput.get();
+        logP = calculateTreeLogLikelihood(tree);
+        return logP;
+    } // calculateLogP
+
+
+    /**
+     * Generic likelihood calculation
+     *
+     * @param tree
+     * @return log-likelihood of density
+     */
+    public abstract double calculateTreeLogLikelihood(TreeInterface tree);
+
+    // ****************************************************************
+    // Private and protected stuff
+    // ****************************************************************
+
+
+    /*****************************************/
+    /** Distribution implementation follows **/
+    /**
+     * *************************************
+     */
+    @Override
+    public List<String> getArguments() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public List<String> getConditions() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public void sample(State state, Random random) {
+        throw new UnsupportedOperationException("This should eventually sample a tree conditional on provided speciation model.");
+    }
+}
\ No newline at end of file
diff --git a/src/beast/evolution/speciation/SpeciesTreeLogger.java b/src/beast/evolution/speciation/SpeciesTreeLogger.java
new file mode 100644
index 0000000..4c42364
--- /dev/null
+++ b/src/beast/evolution/speciation/SpeciesTreeLogger.java
@@ -0,0 +1,177 @@
+package beast.evolution.speciation;
+
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import beast.core.Description;
+import beast.core.Function;
+import beast.core.Input;
+import beast.core.Loggable;
+import beast.core.StateNode;
+import beast.core.BEASTObject;
+import beast.core.Input.Validate;
+import beast.core.parameter.Parameter;
+import beast.evolution.speciation.SpeciesTreePrior.TreePopSizeFunction;
+import beast.evolution.tree.Node;
+import beast.evolution.tree.Tree;
+
+
+
+ at Description("Logs tree annotated with metadata in StarBeast format")
+public class SpeciesTreeLogger extends BEASTObject implements Loggable {
+    public Input<Tree> treeInput = new Input<Tree>("tree", "tree to be logged", Validate.REQUIRED);
+    public Input<Function> parameterInput = new Input<Function>("popSize", "population size parameter associated with tree nodes", Validate.REQUIRED);
+    public Input<Function> parameterTopInput = new Input<Function>("popSizeTop", "population size parameter associated with top of tree branches, only used for non-constant *beast analysis");
+    public Input<SpeciesTreePrior> speciesTreePriorInput = new Input<SpeciesTreePrior>("speciesTreePrior", "species tree prior, used to find which Population Size Function is used. If not specified, assumes 'constant'");
+    public Input<TreeTopFinder> treeTopFinderInput = new Input<TreeTopFinder>("treetop", "calculates height of species tree", Validate.REQUIRED);
+    public Input<List<Function>> metadataInput = new Input<List<Function>>("metadata", "meta data to be logged with the tree nodes",new ArrayList<>());
+
+    TreePopSizeFunction popSizeFunction;
+    String metaDataLabel;
+
+    static final String dmv = "dmv";
+    static final String dmt = "dmt";
+
+    @Override
+    public void initAndValidate() {
+        metaDataLabel = "[&" + dmv + "=";
+        if (speciesTreePriorInput.get() != null) {
+            popSizeFunction = speciesTreePriorInput.get().popFunctionInput.get();
+        } else {
+            popSizeFunction = TreePopSizeFunction.constant;
+        }
+    }
+
+    @Override
+    public void init(final PrintStream out) throws Exception {
+        treeInput.get().init(out);
+    }
+
+    @Override
+    public void log(final int nSample, final PrintStream out) {
+        // make sure we get the current version of the inputs
+        final Tree tree = (Tree) treeInput.get().getCurrent();
+        Function metadata = parameterInput.get();
+        if (metadata instanceof StateNode) {
+            metadata = ((StateNode) metadata).getCurrent();
+        }
+        Function metadataTop = parameterTopInput.get();
+        if (metadataTop != null && metadataTop instanceof StateNode) {
+            metadataTop = ((StateNode) metadataTop).getCurrent();
+        }
+
+        List<Function> metadataList = metadataInput.get();
+        for (int i = 0; i < metadataList.size(); i++) {
+        	if (metadataList.get(i) instanceof StateNode) {
+        		metadataList.set(i, ((StateNode) metadataList.get(i)).getCurrent());
+        	}
+        }
+
+        // write out the log tree with meta data
+        out.print("tree STATE_" + nSample + " = ");
+        tree.getRoot().sort();
+        out.print(toNewick(tree.getRoot(), metadata, metadataTop, metadataList));
+        //out.print(tree.getRoot().toShortNewick(false));
+        out.print(";");
+    }
+
+
+    String toNewick(final Node node, final Function metadata, final Function metadataTop, List<Function> metadataList) {
+        final StringBuilder buf = new StringBuilder();
+
+        if (node.getLeft() != null) {
+            buf.append("(");
+            buf.append(toNewick(node.getLeft(), metadata, metadataTop, metadataList));
+            if (node.getRight() != null) {
+                buf.append(',');
+                buf.append(toNewick(node.getRight(), metadata, metadataTop, metadataList));
+            }
+            buf.append(")");
+        } else {
+            buf.append(node.getNr()+Tree.taxaTranslationOffset);
+        }
+        buf.append("[&");
+        switch (popSizeFunction) {
+            case constant: {
+                final double popStart = metadata.getArrayValue(node.getNr());
+                buf.append(dmv + "=").append(popStart);
+                break;
+            }
+            case linear:
+            case linear_with_constant_root:
+                buf.append(dmt + "=");
+                final double b;
+                if (node.isRoot()) {
+                    b = treeTopFinderInput.get().getHighestTreeHeight() - node.getHeight();
+                } else {
+                    b = node.getLength();
+                }
+                buf.append(b).append("," + dmv + "={");
+
+                final double popStart;
+                if (node.isLeaf()) {
+                    popStart = metadata.getArrayValue(node.getNr());
+                } else {
+                    popStart = (getMetaDataTopValue(node.getLeft(), metadataTop) +
+                            getMetaDataTopValue(node.getRight(), metadataTop));
+                }
+                buf.append(popStart);
+
+                final double popEnd;
+                if (node.isRoot() && popSizeFunction == TreePopSizeFunction.linear_with_constant_root) {
+                    popEnd = popStart;
+                } else {
+                  popEnd = getMetaDataTopValue(node, metadataTop);
+                }
+                buf.append(",").append(popEnd).append("}");
+                break;
+        }
+        if (metadataList.size() > 0) {
+        	for (Function metadata2 : metadataList) {
+	            if (metadataList.indexOf(metadata2) > 0 || buf.length() > 1) {
+	            	buf.append(",");
+	            }
+	            buf.append(((BEASTObject)metadata2).getID());
+	            buf.append('=');
+	            if (metadata2 instanceof Parameter<?>) {
+	            	Parameter p = (Parameter) metadata2;
+	            	int dim = p.getMinorDimension1();
+	            	if (dim > 1) {
+		            	buf.append('{');
+		            	for (int i = 0; i < dim; i++) {
+			            	buf.append(p.getMatrixValue(node.getNr(), i));
+			            	if (i < dim - 1) {
+				            	buf.append(',');
+			            	}
+		            	}
+		            	buf.append('}');
+	            	} else {
+		            	buf.append(metadata2.getArrayValue(node.getNr()));
+	            	}
+	            } else {
+	            	buf.append(metadata2.getArrayValue(node.getNr()));
+	            }
+        	}
+        }
+        buf.append(']');
+        if (!node.isRoot()) {
+            buf.append(":").append(node.getLength());
+        }
+        return buf.toString();
+    }
+
+    double getMetaDataTopValue(final Node node, final Function metadataTop) {
+        int nr = node.getNr();
+        if (nr >= metadataTop.getDimension()) {
+            nr = node.getTree().getRoot().getNr();
+        }
+        return metadataTop.getArrayValue(nr);
+    }
+
+    @Override
+    public void close(final PrintStream out) {
+        treeInput.get().close(out);
+    }
+
+}
diff --git a/src/beast/evolution/speciation/SpeciesTreePrior.java b/src/beast/evolution/speciation/SpeciesTreePrior.java
new file mode 100644
index 0000000..cd16c16
--- /dev/null
+++ b/src/beast/evolution/speciation/SpeciesTreePrior.java
@@ -0,0 +1,194 @@
+package beast.evolution.speciation;
+
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Random;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.State;
+import beast.core.Input.Validate;
+import beast.core.parameter.RealParameter;
+import beast.evolution.alignment.TaxonSet;
+import beast.evolution.tree.Node;
+import beast.evolution.tree.TreeDistribution;
+import beast.math.distributions.Gamma;
+
+
+
+ at Description("Species tree prior for *BEAST analysis")
+public class SpeciesTreePrior extends TreeDistribution {
+    //public Input<Tree> m_speciesTree = new Input<Tree>("speciesTree", "species tree containing the associated gene tree", Validate.REQUIRED);
+
+    protected enum TreePopSizeFunction {constant, linear, linear_with_constant_root}
+
+    public final Input<TreePopSizeFunction> popFunctionInput = new Input<TreePopSizeFunction>("popFunction", "Population function. " +
+            "This can be " + Arrays.toString(TreePopSizeFunction.values()) + " (default 'constant')", TreePopSizeFunction.constant, TreePopSizeFunction.values());
+
+    public final Input<RealParameter> popSizesBottomInput = new Input<RealParameter>("bottomPopSize", "population size parameter for populations at the bottom of a branch. " +
+            "For linear population function, this is the same at the top of the branch.", Validate.REQUIRED);
+    public final Input<RealParameter> popSizesTopInput = new Input<RealParameter>("topPopSize", "population size parameter at the top of a branch. " +
+            "Ignored for constant population function, but required for linear population function.");
+
+    public final Input<RealParameter> gammaParameterInput = new Input<RealParameter>("gammaParameter", "shape parameter of the gamma distribution", Validate.REQUIRED);
+
+//	public Input<RealParameter> m_rootHeightParameter = new Input<RealParameter>("rootBranchHeight","height of the node above the root, representing the root branch", Validate.REQUIRED);
+    /**
+     * m_taxonSet is used by GeneTreeForSpeciesTreeDistribution *
+     */
+    public Input<TaxonSet> taxonSetInput = new Input<TaxonSet>("taxonset", "set of taxa mapping lineages to species", Validate.REQUIRED);
+
+
+    private TreePopSizeFunction popFunction;
+    private RealParameter popSizesBottom;
+    private RealParameter popSizesTop;
+
+    private Gamma gamma2Prior;
+    private Gamma gamma4Prior;
+
+    @Override
+    public void initAndValidate() throws Exception {
+        popFunction = popFunctionInput.get();
+        popSizesBottom = popSizesBottomInput.get();
+        popSizesTop = popSizesTopInput.get();
+
+        // set up sizes of population functions
+        final int nSpecies = treeInput.get().getLeafNodeCount();
+        final int nNodes = treeInput.get().getNodeCount();
+        switch (popFunction) {
+            case constant:
+                popSizesBottom.setDimension(nNodes);
+                break;
+            case linear:
+                if (popSizesTop == null) {
+                    throw new Exception("topPopSize must be specified");
+                }
+                popSizesBottom.setDimension(nSpecies);
+                popSizesTop.setDimension(nNodes);
+                break;
+            case linear_with_constant_root:
+                if (popSizesTop == null) {
+                    throw new Exception("topPopSize must be specified");
+                }
+                popSizesBottom.setDimension(nSpecies);
+                popSizesTop.setDimension(nNodes - 1);
+                break;
+        }
+
+        // bottom prior = Gamma(2,Psi)
+        gamma2Prior = new Gamma();
+        gamma2Prior.betaInput.setValue(gammaParameterInput.get(), gamma2Prior);
+
+        // top prior = Gamma(4,Psi)
+        gamma4Prior = new Gamma();
+        final RealParameter parameter = new RealParameter(new Double[]{4.0});
+        gamma4Prior.alphaInput.setValue(parameter, gamma4Prior);
+        gamma4Prior.betaInput.setValue(gammaParameterInput.get(), gamma4Prior);
+
+        if (popFunction != TreePopSizeFunction.constant && gamma4Prior == null) {
+            throw new Exception("Top prior must be specified when population function is not constant");
+        }
+        // make sure the m_taxonSet is a set of taxonsets
+// HACK to make Beauti initialise: skip the check here
+//		for (Taxon taxon : m_taxonSet.get().m_taxonset.get()) {
+//			if (!(taxon instanceof TaxonSet)) {
+//				throw new Exception("taxonset should be sets of taxa only, not individual taxons");
+//			}
+//		}
+    }
+
+    @Override
+    public double calculateLogP() {
+        logP = 0;
+        // make sure the root branch length is positive
+//		if (m_rootHeightParameter.get().getValue() < m_speciesTree.get().getRoot().getHeight()) {
+//			logP = Double.NEGATIVE_INFINITY;
+//			return logP;
+//		}
+
+        final Node[] speciesNodes = treeInput.get().getNodesAsArray();
+        try {
+            switch (popFunction) {
+                case constant:
+                    // constant pop size function
+                    logP += gamma2Prior.calcLogP(popSizesBottom);
+//			for (int i = 0; i < speciesNodes.length; i++) {
+//				double fPopSize = m_fPopSizesBottom.getValue(i);
+//				logP += m_bottomPrior.logDensity(fPopSize); 
+//			}
+                    break;
+                case linear:
+                    // linear pop size function
+//			int nSpecies = m_tree.get().getLeafNodeCount();
+//			m_fPopSizesBottom.setDimension(nSpecies);
+//			logP += m_gamma4Prior.calcLogP(m_fPopSizesBottom);
+//			int nNodes = m_tree.get().getNodeCount();
+//			m_fPopSizesTop.setDimension(nNodes-1);
+//			logP += m_gamma2Prior.calcLogP(m_fPopSizesTop);
+
+                    for (int i = 0; i < speciesNodes.length; i++) {
+                        final Node node = speciesNodes[i];
+                        final double fPopSizeBottom;
+                        if (node.isLeaf()) {
+                            // Gamma(4, fPsi) prior
+                            fPopSizeBottom = popSizesBottom.getValue(i);
+                            logP += gamma4Prior.logDensity(fPopSizeBottom);
+                        }
+                        final double fPopSizeTop = popSizesTop.getValue(i);
+                        logP += gamma2Prior.logDensity(fPopSizeTop);
+                    }
+                    break;
+                case linear_with_constant_root:
+//			logP += m_gamma4Prior.calcLogP(m_fPopSizesBottom);
+//			logP += m_gamma2Prior.calcLogP(m_fPopSizesTop);
+//			int iRoot = m_tree.get().getRoot().getNr();
+//			double fPopSize = m_fPopSizesTop.getValue(iRoot);
+//			logP -= m_gamma2Prior.logDensity(fPopSize); 
+
+                    for (int i = 0; i < speciesNodes.length; i++) {
+                        final Node node = speciesNodes[i];
+                        if (node.isLeaf()) {
+                            final double fPopSizeBottom = popSizesBottom.getValue(i);
+                            logP += gamma4Prior.logDensity(fPopSizeBottom);
+                        }
+                        if (!node.isRoot()) {
+                            if (i < speciesNodes.length - 1) {
+                                final double fPopSizeTop = popSizesTop.getArrayValue(i);
+                                logP += gamma2Prior.logDensity(fPopSizeTop);
+                            } else {
+                                final int iNode = treeInput.get().getRoot().getNr();
+                                final double fPopSizeTop = popSizesTop.getArrayValue(iNode);
+                                logP += gamma2Prior.logDensity(fPopSizeTop);
+                            }
+                        }
+                    }
+                    break;
+            }
+        } catch (Exception e) {
+            // exceptions can be thrown by the gamma priors
+            e.printStackTrace();
+            return Double.NEGATIVE_INFINITY;
+        }
+        return logP;
+    }
+
+    @Override
+    protected boolean requiresRecalculation() {
+        return true;
+    }
+
+    @Override
+    public List<String> getArguments() {
+        return null;
+    }
+
+    @Override
+    public List<String> getConditions() {
+        return null;
+    }
+
+    @Override
+    public void sample(final State state, final Random random) {
+    }
+}
diff --git a/src/beast/evolution/speciation/StarBeastStartState.java b/src/beast/evolution/speciation/StarBeastStartState.java
new file mode 100644
index 0000000..7c7ea61
--- /dev/null
+++ b/src/beast/evolution/speciation/StarBeastStartState.java
@@ -0,0 +1,416 @@
+package beast.evolution.speciation;
+
+import beast.core.*;
+import beast.core.Input.Validate;
+import beast.core.parameter.RealParameter;
+import beast.evolution.alignment.Alignment;
+import beast.evolution.alignment.Taxon;
+import beast.evolution.alignment.TaxonSet;
+import beast.evolution.alignment.distance.Distance;
+import beast.evolution.alignment.distance.JukesCantorDistance;
+import beast.evolution.tree.Node;
+import beast.evolution.tree.Tree;
+import beast.evolution.tree.TreeInterface;
+import beast.util.ClusterTree;
+
+import java.util.*;
+
+import static java.lang.Math.*;
+
+/**
+* @author Joseph Heled
+ */
+
+ at Description("Set a starting point for a *BEAST analysis from gene alignment data.")
+public class StarBeastStartState extends Tree implements StateNodeInitialiser {
+
+    static enum Method {
+        POINT("point-estimate"),
+        ALL_RANDOM("random");
+
+        Method(final String name) {
+            this.ename = name;
+        }
+
+        public String toString() {
+            return ename;
+        }
+
+        private final String ename;
+    }
+    public Input<Method> initMethod = new Input<Method>("method", "Initialise either with a totally random " +
+            "state or a point estimate based on alignments data (default point-estimate)",
+            Method.POINT, Method.values());
+
+    public Input<Tree> speciesTreeInput = new Input<Tree>("speciesTree", "The species tree to initialize");
+
+    public Input<List<Tree>> genes = new Input<List<Tree>>("gene", "Gene trees to initialize", new ArrayList<Tree>());
+    //,
+    //        Validate.REQUIRED);
+
+    public Input<CalibratedYuleModel> calibratedYule = new Input<CalibratedYuleModel>("calibratedYule",
+            "The species tree (with calibrations) to initialize", Validate.XOR, speciesTreeInput);
+
+    public Input<RealParameter> popMean = new Input<RealParameter>("popMean",
+            "Population mean hyper prior to initialse");
+
+    public Input<RealParameter> birthRate = new Input<RealParameter>("birthRate",
+            "Tree prior birth rate to initialize");
+
+    public Input<SpeciesTreePrior> speciesTreePriorInput =
+            new Input<SpeciesTreePrior>("speciesTreePrior", "Population size parameters to initialise");
+
+    public Input<Function> muInput = new Input<Function>("baseRate",
+            "Main clock rate used to scale trees (default 1).");
+
+
+    private boolean hasCalibrations;
+
+    @Override
+    public void initAndValidate() throws Exception {
+        // what does this do and is it dangerous to call it or not to call it at the start or at the end??????
+        super.initAndValidate();
+        hasCalibrations = calibratedYule.get() != null;
+    }
+
+    @Override
+    public void initStateNodes() throws Exception {
+
+        if( hasCalibrations ) {
+            initWithCalibrations();
+        } else {
+            final Method method = initMethod.get();
+
+            switch( method ) {
+                case POINT:
+                    fullInit();
+                    break;
+                case ALL_RANDOM:
+                    randomInit();
+                    break;
+            }
+        }
+    }
+
+    private double[] firstMeetings(final Tree gtree, final Map<String, Integer> tipName2Species, final int nSpecies) {
+        final Node[] nodes = gtree.listNodesPostOrder(null, null);
+        final Set<Integer>[] tipsSpecies = new Set[nodes.length];
+        for(int k = 0; k < tipsSpecies.length; ++k) {
+            tipsSpecies[k] = new HashSet<Integer>();
+        }
+        // d[i,j] = minimum height of node which has tips belonging to species i and j
+        // d is is upper triangular
+        final double[] dmin = new double[(nSpecies*(nSpecies-1))/2];
+        Arrays.fill(dmin, Double.MAX_VALUE);
+
+        for (final Node n : nodes) {
+            if (n.isLeaf()) {
+                tipsSpecies[n.getNr()].add(tipName2Species.get(n.getID()));
+            } else {
+                assert n.getChildCount() == 2;
+                final Set<Integer>[] sps = new Set[2];
+                sps[0] = tipsSpecies[n.getChild(0).getNr()];
+                sps[1] = tipsSpecies[n.getChild(1).getNr()];
+                final Set<Integer> u = new HashSet<Integer>(sps[0]);
+                u.retainAll(sps[1]);
+                sps[0].removeAll(u);
+                sps[1].removeAll(u);
+
+                for (final Integer s1 : sps[0]) {
+                    for (final Integer s2 : sps[1]) {
+                        final int i = getDMindex(nSpecies, s1, s2);
+                        dmin[i] = min(dmin[i], n.getHeight());
+                    }
+                }
+                u.addAll(sps[0]);
+                u.addAll(sps[1]);
+                tipsSpecies[n.getNr()] = u;
+            }
+        }
+        return dmin;
+    }
+
+    private int getDMindex(final int nSpecies, final int s1, final int s2) {
+        final int mij = min(s1,s2);
+        return (mij*(2*nSpecies-1 - mij))/2 + (abs(s1-s2)-1);
+    }
+
+
+    private void fullInit() throws Exception {
+        // Build gene trees from  alignments
+
+        final Function muInput = this.muInput.get();
+        final double mu =  (muInput != null )  ? muInput.getArrayValue() : 1;
+
+        final Tree stree = speciesTreeInput.get();
+        final TaxonSet species = stree.m_taxonset.get();
+        final List<String> speciesNames = species.asStringList();
+        final int nSpecies = speciesNames.size();
+
+        final List<Tree> geneTrees = genes.get();
+
+        //final List<Alignment> alignments = genes.get();
+        //final List<Tree> geneTrees = new ArrayList<Tree>(alignments.size());
+        double maxNsites = 0;
+        //for( final Alignment alignment : alignments)  {
+        for (final Tree gtree : geneTrees) {
+            //final Tree gtree = new Tree();
+            final Alignment alignment = gtree.m_taxonset.get().alignmentInput.get();
+
+            final ClusterTree ctree = new ClusterTree();
+            ctree.initByName("initial", gtree, "clusterType", "upgma", "taxa", alignment);
+            gtree.scale(1 / mu);
+
+            maxNsites = max(maxNsites, alignment.getSiteCount());
+        }
+        final Map<String, Integer> geneTips2Species = new HashMap<String, Integer>();
+        final List<Taxon> taxonSets = species.taxonsetInput.get();
+
+        for(int k = 0; k < speciesNames.size(); ++k) {
+            final Taxon nx = taxonSets.get(k);
+            final List<Taxon> taxa = ((TaxonSet) nx).taxonsetInput.get();
+            for( final Taxon n : taxa ) {
+              geneTips2Species.put(n.getID(), k);
+            }
+        }
+        final double[] dg = new double[(nSpecies*(nSpecies-1))/2];
+
+        final double[][] genesDmins = new double[geneTrees.size()][];
+
+        for( int ng = 0; ng < geneTrees.size(); ++ng ) {
+            final Tree g = geneTrees.get(ng);
+            final double[] dmin = firstMeetings(g, geneTips2Species, nSpecies);
+            genesDmins[ng] = dmin;
+
+            for(int i = 0; i < dmin.length; ++i) {
+                dg[i] += dmin[i];
+                if (dmin[i] == Double.MAX_VALUE) {
+                	// this happens when a gene tree has no taxa for some species-tree taxon.
+                	// TODO: ensure that if this happens, there will always be an "infinite"
+                	// distance between species-taxon 0 and the species-taxon with missing lineages,
+                	// so i < nSpecies - 1.
+                	// What if lineages for species-taxon 0 are missing? Then all entries will be 'infinite'.
+                	String id = (i < nSpecies - 1? stree.getExternalNodes().get(i+1).getID() : "unknown taxon");
+                	if (i == 0) {
+                		// test that all entries are 'infinite', which implies taxon 0 has lineages missing 
+                		boolean b = true;
+                		for (int k = 1; b && k < nSpecies - 1; k++) {
+                			b = (dmin[k] == Double.MAX_VALUE);
+                		}
+                		if (b) {
+                			// if all entries have 'infinite' distances, it is probably the first taxon that is at fault
+                			id = stree.getExternalNodes().get(0).getID();
+                		}
+                	}
+                	throw new RuntimeException("Gene tree " + g.getID() + " has no lineages for species taxon " + id + " ");
+                }
+            }
+        }
+
+        for(int i = 0; i < dg.length; ++i) {
+            double d = dg[i] / geneTrees.size();
+            if( d == 0 ) {
+               d = (0.5/maxNsites) * (1/mu);
+            } else {
+                // heights to distances
+                d *= 2;
+            }
+            dg[i] = d;
+        }
+
+        final ClusterTree ctree = new ClusterTree();
+        final Distance distance = new Distance() {
+            @Override
+            public double pairwiseDistance(final int s1, final int s2) {
+                final int i = getDMindex(nSpecies, s1,s2);
+                return dg[i];
+            }
+        };
+        ctree.initByName("initial", stree, "taxonset", species,"clusterType", "upgma", "distance", distance);
+
+        final Map<String, Integer> sptips2SpeciesIndex = new HashMap<String, Integer>();
+        for(int i = 0; i < speciesNames.size(); ++i) {
+            sptips2SpeciesIndex.put(speciesNames.get(i), i);
+        }
+        final double[] spmin = firstMeetings(stree, sptips2SpeciesIndex, nSpecies);
+
+        for( int ng = 0; ng < geneTrees.size(); ++ng ) {
+            final double[] dmin = genesDmins[ng];
+            boolean compatible = true;
+            for(int i = 0; i < spmin.length; ++i) {
+                if( dmin[i] <= spmin[i] ) {
+                    compatible = false;
+                    break;
+                }
+            }
+            if( ! compatible ) {
+                final Tree gtree = geneTrees.get(ng);
+                final TaxonSet gtreeTaxa = gtree.m_taxonset.get();
+                final Alignment alignment = gtreeTaxa.alignmentInput.get();
+                final List<String> taxaNames = alignment.getTaxaNames();
+                final int nTaxa =  taxaNames.size();
+                // speedup
+                final Map<Integer,Integer> g2s = new HashMap<Integer, Integer>();
+                for(int i = 0; i < nTaxa; ++i) {
+                    g2s.put(i, geneTips2Species.get(taxaNames.get(i)));
+                }
+
+                final JukesCantorDistance jc = new JukesCantorDistance();
+                jc.setPatterns(alignment);
+                final Distance gdistance = new Distance() {
+                    @Override
+                    public double pairwiseDistance(final int t1, final int t2) {
+                        final int s1 = g2s.get(t1);
+                        final int s2 = g2s.get(t2);
+                        double d = jc.pairwiseDistance(t1,t2)/mu;
+                        if( s1 != s2 ) {
+                            final int i = getDMindex(nSpecies, s1,s2);
+                            final double minDist = 2 * spmin[i];
+                            if( d <= minDist ) {
+                                d = minDist * 1.001;
+                            }
+                        }
+                        return d;
+                    }
+                };
+                final ClusterTree gtreec = new ClusterTree();
+                gtreec.initByName("initial", gtree, "taxonset", gtreeTaxa,
+                        "clusterType", "upgma", "distance", gdistance);
+            }
+        }
+
+        {
+            final RealParameter lambda = birthRate.get();
+            if( lambda != null ) {
+                final double rh = stree.getRoot().getHeight();
+                double l = 0;
+                for(int i = 2; i < nSpecies+1; ++i) {
+                    l += 1./i;
+                }
+                lambda.setValue((1 / rh) * l);
+            }
+
+            double totBranches = 0;
+            final Node[] streeNodeas = stree.getNodesAsArray();
+            for( final Node n : streeNodeas ) {
+                if( ! n.isRoot() ) {
+                    totBranches += n.getLength();
+                }
+            }
+            totBranches /= 2* (streeNodeas.length - 1);
+            final RealParameter popm = popMean.get();
+            if( popm != null ) {
+                popm.setValue(totBranches);
+            }
+            final SpeciesTreePrior speciesTreePrior = speciesTreePriorInput.get();
+            if( speciesTreePrior != null ) {
+                final RealParameter popb = speciesTreePrior.popSizesBottomInput.get();
+                if( popb != null ) {
+                    for(int i = 0; i < popb.getDimension(); ++i) {
+                      popb.setValue(i, 2*totBranches);
+                    }
+                }
+                final RealParameter popt = speciesTreePrior.popSizesTopInput.get();
+                if( popt != null ) {
+                    for(int i = 0; i < popt.getDimension(); ++i) {
+                        popt.setValue(i, totBranches);
+                    }
+                }
+            }
+        }
+    }
+
+    private void randomInitGeneTrees(double speciesTreeHeight) {
+      final List<Tree> geneTrees = genes.get();
+        for (final Tree gtree : geneTrees) {
+            gtree.makeCaterpillar(speciesTreeHeight, speciesTreeHeight/gtree.getInternalNodeCount(), true);
+        }
+    }
+
+    private void randomInit() throws Exception {
+        double lam = 1;
+        final RealParameter lambda = birthRate.get();
+        if( lambda != null ) {
+            lam = lambda.getArrayValue();
+        }
+        final Tree stree = speciesTreeInput.get();
+        final TaxonSet species = stree.m_taxonset.get();
+        final int nSpecies = species.asStringList().size();
+        double s = 0;
+        for(int k = 2; k <= nSpecies; ++k) {
+            s += 1.0/k;
+        }
+        final double rootHeight = (1/lam) * s;
+        stree.scale(rootHeight/stree.getRoot().getHeight());
+        randomInitGeneTrees(rootHeight);
+//        final List<Tree> geneTrees = genes.get();
+//        for (final Tree gtree : geneTrees) {
+//            gtree.makeCaterpillar(rootHeight, rootHeight/gtree.getInternalNodeCount(), true);
+//        }
+    }
+
+    private void initWithCalibrations() throws Exception {
+        final CalibratedYuleModel cYule = calibratedYule.get();
+        final Tree spTree = (Tree) cYule.treeInput.get();
+
+        final List<CalibrationPoint> cals = cYule.calibrationsInput.get();
+
+        final CalibratedYuleModel cym = new CalibratedYuleModel();
+        
+        cym.getOutputs().addAll(cYule.getOutputs());
+
+        for( final CalibrationPoint cal : cals ) {
+          cym.setInputValue("calibrations", cal);
+        }
+        cym.setInputValue("tree", spTree);
+        cym.setInputValue("type", CalibratedYuleModel.Type.NONE);
+        cym.initAndValidate();
+
+        final Tree t = cym.compatibleInitialTree();
+        assert spTree.getLeafNodeCount() == t.getLeafNodeCount();
+
+        spTree.assignFromWithoutID(t);
+
+//        final CalibratedYuleInitialTree ct = new CalibratedYuleInitialTree();
+//        ct.initByName("initial", spTree, "calibrations", cYule.calibrationsInput.get());
+//        ct.initStateNodes();
+        final double rootHeight = spTree.getRoot().getHeight();
+        randomInitGeneTrees(rootHeight);
+
+        cYule.initAndValidate();
+    }
+
+    @Override
+    public void getInitialisedStateNodes(final List<StateNode> stateNodes) {
+        if( hasCalibrations ) {
+            stateNodes.add((Tree) calibratedYule.get().treeInput.get());
+        } else {
+          stateNodes.add(speciesTreeInput.get());
+        }
+
+        for( final Tree g : genes.get() ) {
+            stateNodes.add(g);
+        }
+
+        final RealParameter popm = popMean.get();
+        if( popm != null ) {
+            stateNodes.add(popm);
+        }
+        final RealParameter brate = birthRate.get();
+        if( brate != null ) {
+            stateNodes.add(brate) ;
+        }
+
+        final SpeciesTreePrior speciesTreePrior = speciesTreePriorInput.get();
+        if( speciesTreePrior != null ) {
+            final RealParameter popb = speciesTreePrior.popSizesBottomInput.get();
+            if( popb != null ) {
+                stateNodes.add(popb) ;
+            }
+            final RealParameter popt = speciesTreePrior.popSizesTopInput.get();
+            if( popt != null ) {
+                stateNodes.add(popt);
+            }
+        }
+    }
+}
diff --git a/src/beast/evolution/speciation/TreeTopFinder.java b/src/beast/evolution/speciation/TreeTopFinder.java
new file mode 100644
index 0000000..cdf3dc5
--- /dev/null
+++ b/src/beast/evolution/speciation/TreeTopFinder.java
@@ -0,0 +1,61 @@
+package beast.evolution.speciation;
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+import beast.core.CalculationNode;
+import beast.core.Description;
+import beast.core.Input;
+import beast.evolution.tree.Tree;
+
+
+ at Description("Finds height of highest tree among a set of trees")
+public class TreeTopFinder extends CalculationNode {
+    public Input<List<Tree>> treeInputs = new Input<List<Tree>>("tree", "set of trees to search among", new ArrayList<Tree>());
+
+    List<Tree> trees;
+
+    double oldHeight;
+    double height;
+
+    public void initAndValidate() throws Exception {
+        oldHeight = Double.NaN;
+        trees = treeInputs.get();
+        height = calcHighestTreeHeight();
+    }
+
+    public double getHighestTreeHeight() {
+        return calcHighestTreeHeight();
+    }
+
+    private double calcHighestTreeHeight() {
+        double fTop = 0;
+        for (Tree tree : trees) {
+            fTop = Math.max(tree.getRoot().getHeight(), fTop);
+        }
+        return fTop;
+    }
+
+    @Override
+    protected boolean requiresRecalculation() {
+        double fTop = calcHighestTreeHeight();
+        if (fTop != height) {
+            height = fTop;
+            return true;
+        }
+        return false;
+    }
+
+    @Override
+    protected void store() {
+        oldHeight = height;
+        super.store();
+    }
+
+    @Override
+    protected void restore() {
+        height = oldHeight;
+        super.restore();
+    }
+}
diff --git a/src/beast/evolution/speciation/YuleModel.java b/src/beast/evolution/speciation/YuleModel.java
new file mode 100644
index 0000000..79a64c2
--- /dev/null
+++ b/src/beast/evolution/speciation/YuleModel.java
@@ -0,0 +1,171 @@
+package beast.evolution.speciation;
+
+import java.util.List;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.Input.Validate;
+import beast.core.parameter.RealParameter;
+import beast.evolution.tree.Node;
+import beast.evolution.tree.Tree;
+import beast.evolution.tree.TreeInterface;
+
+
+
+// From Gernhard 2008, Yule density (p; conditioned on n nodes) should be:
+// double p = 0.0;
+// p = lambda^(n-1) * exp(-lambda*rootHeight);
+// for (int i = 1; i < n; i++) {
+//    p *= exp(-lambda*height[i])
+// }
+
+ at Description("Pure birth model (i.e. no deaths)")
+public class YuleModel extends SpeciesTreeDistribution {
+    public Input<RealParameter> birthDiffRateParameterInput =
+            new Input<RealParameter>("birthDiffRate", "birth difference rate parameter, lambda - mu in birth/death model", Validate.REQUIRED);
+    public Input<RealParameter> originHeightParameterInput =
+            new Input<RealParameter>("originHeight", "the height of the point of origin of the process");
+    public Input<Boolean> conditionalOnRootInput =
+            new Input<Boolean>("conditionalOnRoot", "Whether to condition on the root (default false)", false);
+
+    protected boolean conditionalOnRoot;
+    protected boolean conditionalOnOrigin;
+
+    @Override
+    public void initAndValidate() throws Exception {
+        super.initAndValidate();
+        conditionalOnRoot = conditionalOnRootInput.get();
+        conditionalOnOrigin = originHeightParameterInput.get() != null;
+
+        if (conditionalOnRoot && conditionalOnOrigin) {
+            throw new RuntimeException("ERROR: Cannot condition on both root and origin.");
+        }
+        
+        // make sure that all tips are at the same height,
+        // otherwise this Yule Model is not appropriate
+        TreeInterface tree = treeInput.get();
+        if (tree == null) {
+            tree = treeIntervalsInput.get().treeInput.get();
+        }
+        List<Node> leafs = tree.getExternalNodes();
+        double height = leafs.get(0).getHeight();
+        for (Node leaf : leafs) {
+            if (Math.abs(leaf.getHeight() - height) > 1e-8) {
+                System.err.println("WARNING: Yule Model cannot handle dated tips. Use for example a coalescent prior instead.");
+                break;
+            }
+        }
+    }
+
+    @Override
+    public double calculateTreeLogLikelihood(final TreeInterface tree) {
+        return calculateTreeLogLikelihood(tree, 1, 0);
+    }
+
+    protected double calculateTreeLogLikelihood(final TreeInterface tree, final double rho, final double a) {
+    	
+    	if (conditionalOnOrigin && tree.getRoot().getHeight() > originHeightParameterInput.get().getValue())
+    		return Double.NEGATIVE_INFINITY;
+    	
+        final int taxonCount = tree.getLeafNodeCount();
+        final double r = birthDiffRateParameterInput.get().getValue();
+
+        double logL = logTreeProbability(taxonCount, r, rho, a);
+
+        final Node[] nodes = tree.getNodesAsArray();
+        for (int i = taxonCount; i < nodes.length; i++) {
+            assert (!nodes[i].isLeaf());
+            logL += calcLogNodeProbability(nodes[i], r, rho, a, taxonCount);
+        }
+
+        return logL;
+    }
+
+    /**
+     * calculate contribution of the tree to the log likelihood
+     *
+     * @param taxonCount
+     * @param r          relative birth rate (birth rate - death rate)
+     * @param rho        parameter in Gernhard 2008 birth death model
+     * @param a          death/birth rates ratio
+     * @return
+     */
+    protected double logTreeProbability(final int taxonCount, double r, double rho, double a) {
+        double c1 = logCoeff(taxonCount);
+        if (conditionalOnOrigin) {
+            final double height = originHeightParameterInput.get().getValue();
+            c1 += (taxonCount - 1) * calcLogConditioningTerm(height, r, rho, a);
+        } else if (!conditionalOnRoot) {
+            c1 += (taxonCount - 1) * Math.log(r * rho) + taxonCount * Math.log(1 - a);
+        }
+        return c1;
+    }
+
+    /**
+     * default implementation, equivalent with unscaled tree in Gernhard 2008 model
+     *
+     * @param taxonCount
+     * @return
+     */
+    protected double logCoeff(final int taxonCount) {
+        return 0.0;
+    }
+
+    /**
+     * contribution of a single node to the log likelihood
+     * r = relative birth rate (birth rate - death rate)
+     * rho = rho parameter in Gernhard 2008 birth death model
+     * a = death rate relative to birth rate
+     *
+     * @param node
+     * @param r
+     * @param rho
+     * @param a
+     * @param taxonCount
+     * @return
+     */
+    protected double calcLogNodeProbability(Node node, double r, double rho, double a, int taxonCount) {
+        final double height = node.getHeight();
+
+        if (conditionalOnRoot && node.isRoot()) {
+            return (taxonCount - 2) * calcLogConditioningTerm(height, r, rho, a);
+        }
+        
+        final double mrh = -r * height;
+        final double z = Math.log(rho + ((1 - rho) - a) * Math.exp(mrh));
+        double l = -2 * z + mrh;
+        
+        if (!conditionalOnOrigin && !conditionalOnRoot && node.isRoot())
+        	l += mrh - z;
+        
+        return l;
+                
+    } // calcLogNodeProbability
+    
+//    public boolean includeExternalNodesInLikelihoodCalculation() {
+//        return false;
+//    }
+
+    double calcLogConditioningTerm(double height, double r, double rho, double a) {
+        final double ca = 1 - a;
+        final double erh = Math.exp(r * height);
+        if (erh != 1.0) {
+            return Math.log(r * ca * (rho + ca / (erh - 1)));
+        } else {  // use exp(x)-1 = x for x near 0
+            return Math.log(ca * (r * rho + ca / height));
+        }
+    }
+    
+    @Override
+    protected boolean requiresRecalculation() {
+        return super.requiresRecalculation()
+                || birthDiffRateParameterInput.get().somethingIsDirty()
+                || (conditionalOnOrigin && originHeightParameterInput.get().somethingIsDirty());
+    }
+    
+    @Override
+    public boolean canHandleTipDates() {
+        return false;
+    }
+
+}
diff --git a/src/beast/evolution/substitutionmodel/BinaryCovarion.java b/src/beast/evolution/substitutionmodel/BinaryCovarion.java
new file mode 100644
index 0000000..bd2bc46
--- /dev/null
+++ b/src/beast/evolution/substitutionmodel/BinaryCovarion.java
@@ -0,0 +1,333 @@
+package beast.evolution.substitutionmodel;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.Input.Validate;
+import beast.core.parameter.RealParameter;
+import beast.core.util.Log;
+import beast.evolution.datatype.DataType;
+import beast.evolution.datatype.TwoStateCovarion;
+
+
+/**
+ * <p/>
+ * a	the rate of the slow rate class
+ * 1	the rate of the fast rate class
+ * p0	the equilibrium frequency of zero states
+ * p1	1 - p0, the equilibrium frequency of one states
+ * f0	the equilibrium frequency of slow rate class
+ * f1	1 - f0, the equilibrium frequency of fast rate class
+ * s, s1, s2 the rate of switching
+ * <p/>
+ * then the (unnormalized) instantaneous rate matrix (unnormalized Q) should be (depending on mode)
+ * <p/>
+ * 
+ * mode = BEAST -- using classic BEAST implementation, reversible iff hfrequencies = (0.5, 0.5)
+ * FLAGS: reversible = false, TSParameterisation = false
+ * 
+ * [ -(a*p1)-s ,   a*p1    ,    s   ,   0   ]
+ * [   a*p0    , -(a*p0)-s ,    0   ,   s   ]
+ * [    s      ,     0     ,  -p1-s ,  p1   ]
+ * [    0      ,     s     ,    p0  , -p0-s ]
+ *
+ * equilibrium frequencies
+ * [ p0 * f0, p1, * f0, p0 * f1, p1, * f1 ]
+ *
+ * mode = REVERSIBLE -- brings in hfrequencies in rate matrix
+ * reversible = true, TSParameterisation = false
+ * [ - , a , s , 0 ]
+ * [ a , - , 0 , s ]
+ * [ s , 0 , - , 1 ]
+ * [ 0 , s , 1 , - ]
+ * 
+ * which with frequencies becomes
+ * 
+ * [ -(a*p1*f0)-s*f0 ,   a*p1*f0       ,    s*f0      ,   0         ]
+ * [   a*p0*f0       , -(a*p0*f0)-s*f0 ,    0         ,   s*f0      ]
+ * [    s*f1         ,     0           ,  -p1*f1-s*f1 ,  p1*f1      ]
+ * [    0            ,     s*f1        ,    p0*f1     , -p0*f1-s*f1 ]
+ * 
+ * equilibrium frequencies
+ * [ p0 * f0, p1, * f0, p0 * f1, p1, * f1 ]
+ * 
+ * mode = TUFFLEYSTEEL uses alternative parameterisation: hfrequencies is ignored, and switch parameter is set to dimension = 2
+ * [ -(a*p1)-s1 ,   a*p1     ,    s1   ,   0    ]
+ * [   a*p0     , -(a*p0)-s1 ,    0    ,   s1   ]
+ * [    s2      ,     0      ,  -p1-s2 ,  p1    ]
+ * [    0       ,     s2     ,    p0   , -p0-s2 ]
+ *
+ * equilibrium frequencies
+ * [ f0 * s2/(s1+s2), f1, * s2/(s1+s2), f0 * s1/(s1+s2), f1, * s1/(s1+s2) ]
+ *
+ *
+ * Note: to use Tuffley & Steel's methods, set a = 0.
+ */
+ at Description("Covarion model for Binary data")
+public class BinaryCovarion extends GeneralSubstitutionModel {
+    public Input<RealParameter> alphaInput = new Input<RealParameter>("alpha", "the rate of evolution in slow mode", Validate.REQUIRED);
+    public Input<RealParameter> switchRateInput = new Input<RealParameter>("switchRate", "the rate of flipping between slow and fast modes", Validate.REQUIRED);
+    public Input<RealParameter> frequenciesInput = new Input<RealParameter>("vfrequencies", "the frequencies of the visible states", Validate.REQUIRED);
+    public Input<RealParameter> hfrequenciesInput = new Input<RealParameter>("hfrequencies", "the frequencies of the hidden rates");
+
+    public enum MODE {BEAST, REVERSIBLE, TUFFLEYSTEEL};
+	public Input<MODE> modeInput = new Input<>("mode","one of BEAST, REVERSIBLE, TUFFLESTEEL "
+			+ "BEAST = implementation as in BEAST 1 "
+			+ "REVERSIBLE = like BEAST 1 implementation, but using frequencies to make it reversible "
+			+ "TUFFLEYSTEEL = Tuffley & Steel (1996) impementation (no rates for ", MODE.BEAST,MODE.values());
+
+    private RealParameter alpha;
+    private RealParameter switchRate;
+    private RealParameter frequencies;
+    private RealParameter hiddenFrequencies;
+
+    protected double[][] unnormalizedQ;
+    protected double[][] storedUnnormalizedQ;
+    int stateCount;
+    MODE mode  = modeInput.get();
+
+    public BinaryCovarion() {
+        ratesInput.setRule(Validate.OPTIONAL);
+        frequenciesInput.setRule(Validate.OPTIONAL);
+    }
+
+    @Override
+    public void initAndValidate() throws Exception {
+        alpha = alphaInput.get();
+        switchRate = switchRateInput.get();
+        frequencies = frequenciesInput.get();
+        hiddenFrequencies = hfrequenciesInput.get();
+
+        
+        if (mode.equals(MODE.BEAST) || mode.equals(MODE.REVERSIBLE)) {
+        	if (switchRate.getDimension() != 1) {
+        		throw new Exception("switchRate should have dimension 1");
+        	}
+        } else {
+        	if (switchRate.getDimension() != 2) {
+        		throw new Exception("switchRate should have dimension 2");
+        	}
+        }
+        if (alpha.getDimension() != 1) {
+            throw new Exception("alpha should have dimension 1");
+        }
+        if (frequencies.getDimension() != 2) {
+            throw new Exception("frequencies should have dimension 2");
+        }
+        if (mode.equals(MODE.BEAST) || mode.equals(MODE.REVERSIBLE)) {
+        	if (hfrequenciesInput.get() == null) {
+        		throw new Exception("hiddenFrequenciesshould should be specified");
+        	}
+            if (hiddenFrequencies.getDimension() != 2) {
+                throw new Exception("hiddenFrequenciesshould have dimension 2");
+            }
+        } else {
+        	if (hfrequenciesInput.get() != null) {
+        		Log.warning.println("WARNING: hfrequencies is specified, but the BinaryCovarion model ignores it.");
+        	}
+        }
+
+        
+        
+        nrOfStates = 4;
+        unnormalizedQ = new double[4][4];
+        storedUnnormalizedQ = new double[4][4];
+
+        updateMatrix = true;
+        eigenSystem = createEigenSystem();
+        rateMatrix = new double[nrOfStates][nrOfStates];
+        relativeRates = new double[4 * 3];
+        storedRelativeRates = new double[4 * 3];
+    }
+
+
+    @Override
+    public boolean canHandleDataType(DataType dataType) {
+        return dataType.getClass().equals(TwoStateCovarion.class);
+    }
+
+
+    @Override
+    protected void setupRelativeRates() {
+    }
+
+
+    @Override
+    protected void setupRateMatrix() {
+        setupUnnormalizedQMatrix();
+
+        for (int i = 0; i < 4; i++) {
+            for (int j = 0; j < 4; j++) {
+                rateMatrix[i][j] = unnormalizedQ[i][j];
+            }
+        }
+        // bring in frequencies
+//        for (int i = 0; i < m_nStates; i++) {
+//            for (int j = i + 1; j < m_nStates; j++) {
+//            	m_rateMatrix[i][j] *= fFreqs[j];
+//            	m_rateMatrix[j][i] *= fFreqs[i];
+//            }
+//        }
+        // set up diagonal
+        for (int i = 0; i < nrOfStates; i++) {
+            double fSum = 0.0;
+            for (int j = 0; j < nrOfStates; j++) {
+                if (i != j)
+                    fSum += rateMatrix[i][j];
+            }
+            rateMatrix[i][i] = -fSum;
+        }
+        // normalise rate matrix to one expected substitution per unit time
+        normalize(rateMatrix, getFrequencies());
+    } // setupRateMatrix
+
+    @Override
+    public double[] getFrequencies() {
+        double[] fFreqs = new double[4];
+        if (mode.equals(MODE.BEAST) || mode.equals(MODE.REVERSIBLE)) {
+	        fFreqs[0] = frequencies.getValue(0) * hiddenFrequencies.getValue(0);
+	        fFreqs[1] = frequencies.getValue(1) * hiddenFrequencies.getValue(0);
+	        fFreqs[2] = frequencies.getValue(0) * hiddenFrequencies.getValue(1);
+	        fFreqs[3] = frequencies.getValue(1) * hiddenFrequencies.getValue(1);
+        } else {
+        	double h0 = alpha.getValue(1) * (alpha.getValue(0) + alpha.getValue(1));
+        	double h1 = alpha.getValue(0) * (alpha.getValue(0) + alpha.getValue(1));
+	        fFreqs[0] = frequencies.getValue(0) * h0;
+	        fFreqs[1] = frequencies.getValue(1) * h0;
+	        fFreqs[2] = frequencies.getValue(0) * h1;
+	        fFreqs[3] = frequencies.getValue(1) * h1;        	
+        }
+        return fFreqs;
+    }
+
+
+    protected void setupUnnormalizedQMatrix() {
+
+        switch (mode) {
+        case BEAST: {
+
+            double a = alpha.getValue(0);
+            double s = switchRate.getValue(0);
+            double f0 = hiddenFrequencies.getValue(0);
+            double f1 = hiddenFrequencies.getValue(1);
+            double p0 = frequencies.getValue(0);
+            double p1 = frequencies.getValue(1);
+
+            assert Math.abs(1.0 - f0 - f1) < 1e-8;
+            assert Math.abs(1.0 - p0 - p1) < 1e-8;
+
+            unnormalizedQ[0][1] = a * p1;
+            unnormalizedQ[0][2] = s;
+            unnormalizedQ[0][3] = 0.0;
+
+            unnormalizedQ[1][0] = a * p0;
+            unnormalizedQ[1][2] = 0.0;
+            unnormalizedQ[1][3] = s;
+
+            unnormalizedQ[2][0] = s;
+            unnormalizedQ[2][1] = 0.0;
+            unnormalizedQ[2][3] = p1;
+
+            unnormalizedQ[3][0] = 0.0;
+            unnormalizedQ[3][1] = s;
+            unnormalizedQ[3][2] = p0;
+        }
+        break;
+        case REVERSIBLE: {
+
+            double a = alpha.getValue(0);
+            double s = switchRate.getValue(0);
+            double f0 = hiddenFrequencies.getValue(0);
+            double f1 = hiddenFrequencies.getValue(1);
+            double p0 = frequencies.getValue(0);
+            double p1 = frequencies.getValue(1);
+
+            assert Math.abs(1.0 - f0 - f1) < 1e-8;
+            assert Math.abs(1.0 - p0 - p1) < 1e-8;
+
+            unnormalizedQ[0][1] = a * p1 * f0;
+            unnormalizedQ[0][2] = s * f0;
+            unnormalizedQ[0][3] = 0.0;
+
+            unnormalizedQ[1][0] = a * p0 * f0;
+            unnormalizedQ[1][2] = 0.0;
+            unnormalizedQ[1][3] = s * f0;
+
+            unnormalizedQ[2][0] = s * f1;
+            unnormalizedQ[2][1] = 0.0;
+            unnormalizedQ[2][3] = p1 * f1;
+
+            unnormalizedQ[3][0] = 0.0;
+            unnormalizedQ[3][1] = s * f1;
+            unnormalizedQ[3][2] = p0 * f1;
+        }
+    	break;
+        case TUFFLEYSTEEL: {
+            double a = alpha.getValue(0);
+            double s1 = switchRate.getValue(0);
+            double s2 = switchRate.getValue(0);
+            double p0 = frequencies.getValue(0);
+            double p1 = frequencies.getValue(1);
+
+            assert Math.abs(1.0 - p0 - p1) < 1e-8;
+
+            unnormalizedQ[0][1] = a * p1;
+            unnormalizedQ[0][2] = s1;
+            unnormalizedQ[0][3] = 0.0;
+
+            unnormalizedQ[1][0] = a * p0;
+            unnormalizedQ[1][2] = 0.0;
+            unnormalizedQ[1][3] = s1;
+
+            unnormalizedQ[2][0] = s2;
+            unnormalizedQ[2][1] = 0.0;
+            unnormalizedQ[2][3] = p1;
+
+            unnormalizedQ[3][0] = 0.0;
+            unnormalizedQ[3][1] = s2;
+            unnormalizedQ[3][2] = p0;
+        }
+       	break;
+        }
+
+    }
+
+    /**
+     * Normalize rate matrix to one expected substitution per unit time
+     *
+     * @param matrix the matrix to normalize to one expected substitution
+     * @param pi     the equilibrium distribution of states
+     */
+    private void normalize(double[][] matrix, double[] pi) {
+
+        double subst = 0.0;
+        int dimension = pi.length;
+
+        for (int i = 0; i < dimension; i++) {
+            subst += -matrix[i][i] * pi[i];
+        }
+
+        // normalize, including switches
+        for (int i = 0; i < dimension; i++) {
+            for (int j = 0; j < dimension; j++) {
+                matrix[i][j] = matrix[i][j] / subst;
+            }
+        }
+
+        double switchingProportion = 0.0;
+        switchingProportion += matrix[0][2] * pi[2];
+        switchingProportion += matrix[2][0] * pi[0];
+        switchingProportion += matrix[1][3] * pi[3];
+        switchingProportion += matrix[3][1] * pi[1];
+
+        //System.out.println("switchingProportion=" + switchingProportion);
+
+        // normalize, removing switches
+        for (int i = 0; i < dimension; i++) {
+            for (int j = 0; j < dimension; j++) {
+                matrix[i][j] = matrix[i][j] / (1.0 - switchingProportion);
+            }
+        }
+    }
+
+
+}
diff --git a/src/beast/evolution/substitutionmodel/Blosum62.java b/src/beast/evolution/substitutionmodel/Blosum62.java
new file mode 100644
index 0000000..8be9a8f
--- /dev/null
+++ b/src/beast/evolution/substitutionmodel/Blosum62.java
@@ -0,0 +1,272 @@
+package beast.evolution.substitutionmodel;
+
+import beast.core.Description;
+import beast.evolution.datatype.Aminoacid;
+import beast.evolution.datatype.DataType;
+
+ at Description("BLOSUM62 model of amino acid evolution " +
+        "Henikoff, S., and J. G. Henikoff. 1992. PNAS USA 89:10915-10919.")
+public class Blosum62 extends EmpiricalSubstitutionModel {
+
+
+    @Override
+    double[][] getEmpiricalRates() {
+        double[][] rate = new double[20][20];
+
+        // Q matrix from Beast 1
+        rate[0][1] = 7.3579038969751e-01;
+        rate[0][2] = 4.8539105546575e-01;
+        rate[0][3] = 5.4316182089867e-01;
+        rate[0][4] = 1.4599953104700e+00;
+        rate[0][5] = 1.1997057046020e+00;
+        rate[0][6] = 1.1709490427999e+00;
+        rate[0][7] = 1.9558835749595e+00;
+        rate[0][8] = 7.1624144499779e-01;
+        rate[0][9] = 6.0589900368677e-01;
+        rate[0][10] = 8.0001653051838e-01;
+        rate[0][11] = 1.2952012667833e+00;
+        rate[0][12] = 1.2537582666635e+00;
+        rate[0][13] = 4.9296467974759e-01;
+        rate[0][14] = 1.1732759009239e+00;
+        rate[0][15] = 4.3250926870566e+00;
+        rate[0][16] = 1.7291780194850e+00;
+        rate[0][17] = 4.6583936772479e-01;
+        rate[0][18] = 7.1820669758623e-01;
+        rate[0][19] = 2.1877745220045e+00;
+
+        rate[1][2] = 1.2974467051337e+00;
+        rate[1][3] = 5.0096440855513e-01;
+        rate[1][4] = 2.2782657420895e-01;
+        rate[1][5] = 3.0208336100636e+00;
+        rate[1][6] = 1.3605741904203e+00;
+        rate[1][7] = 4.1876330851753e-01;
+        rate[1][8] = 1.4561411663360e+00;
+        rate[1][9] = 2.3203644514174e-01;
+        rate[1][10] = 6.2271166969249e-01;
+        rate[1][11] = 5.4111151414889e+00;
+        rate[1][12] = 9.8369298745695e-01;
+        rate[1][13] = 3.7164469320875e-01;
+        rate[1][14] = 4.4813366171831e-01;
+        rate[1][15] = 1.1227831042096e+00;
+        rate[1][16] = 9.1466595456337e-01;
+        rate[1][17] = 4.2638231012175e-01;
+        rate[1][18] = 7.2051744121611e-01;
+        rate[1][19] = 4.3838834377202e-01;
+
+        rate[2][3] = 3.1801000482161e+00;
+        rate[2][4] = 3.9735894989702e-01;
+        rate[2][5] = 1.8392161469920e+00;
+        rate[2][6] = 1.2404885086396e+00;
+        rate[2][7] = 1.3558723444845e+00;
+        rate[2][8] = 2.4145014342081e+00;
+        rate[2][9] = 2.8301732627800e-01;
+        rate[2][10] = 2.1188815961519e-01;
+        rate[2][11] = 1.5931370434574e+00;
+        rate[2][12] = 6.4844127878707e-01;
+        rate[2][13] = 3.5486124922252e-01;
+        rate[2][14] = 4.9488704370192e-01;
+        rate[2][15] = 2.9041016564560e+00;
+        rate[2][16] = 1.8981736345332e+00;
+        rate[2][17] = 1.9148204624678e-01;
+        rate[2][18] = 5.3822251903674e-01;
+        rate[2][19] = 3.1285879799342e-01;
+
+        rate[3][4] = 2.4083661480204e-01;
+        rate[3][5] = 1.1909457033960e+00;
+        rate[3][6] = 3.7616252083685e+00;
+        rate[3][7] = 7.9847324896839e-01;
+        rate[3][8] = 7.7814266402188e-01;
+        rate[3][9] = 4.1855573246161e-01;
+        rate[3][10] = 2.1813157759360e-01;
+        rate[3][11] = 1.0324479249521e+00;
+        rate[3][12] = 2.2262189795786e-01;
+        rate[3][13] = 2.8173069420651e-01;
+        rate[3][14] = 7.3062827299842e-01;
+        rate[3][15] = 1.5827541420653e+00;
+        rate[3][16] = 9.3418750943056e-01;
+        rate[3][17] = 1.4534504627853e-01;
+        rate[3][18] = 2.6142220896504e-01;
+        rate[3][19] = 2.5812928941763e-01;
+
+        rate[4][5] = 3.2980150463028e-01;
+        rate[4][6] = 1.4074889181440e-01;
+        rate[4][7] = 4.1820319228376e-01;
+        rate[4][8] = 3.5405810983129e-01;
+        rate[4][9] = 7.7489402279418e-01;
+        rate[4][10] = 8.3184264014158e-01;
+        rate[4][11] = 2.8507880090648e-01;
+        rate[4][12] = 7.6768882347954e-01;
+        rate[4][13] = 4.4133747118660e-01;
+        rate[4][14] = 3.5600849876863e-01;
+        rate[4][15] = 1.1971884150942e+00;
+        rate[4][16] = 1.1198313585160e+00;
+        rate[4][17] = 5.2766441887169e-01;
+        rate[4][18] = 4.7023773369610e-01;
+        rate[4][19] = 1.1163524786062e+00;
+
+        rate[5][6] = 5.5289191779282e+00;
+        rate[5][7] = 6.0984630538281e-01;
+        rate[5][8] = 2.4353411311401e+00;
+        rate[5][9] = 2.3620245120365e-01;
+        rate[5][10] = 5.8073709318144e-01;
+        rate[5][11] = 3.9452776745146e+00;
+        rate[5][12] = 2.4948960771127e+00;
+        rate[5][13] = 1.4435695975031e-01;
+        rate[5][14] = 8.5857057567418e-01;
+        rate[5][15] = 1.9348709245965e+00;
+        rate[5][16] = 1.2774802945956e+00;
+        rate[5][17] = 7.5865380864172e-01;
+        rate[5][18] = 9.5898974285014e-01;
+        rate[5][19] = 5.3078579012486e-01;
+
+        rate[6][7] = 4.2357999217628e-01;
+        rate[6][8] = 1.6268910569817e+00;
+        rate[6][9] = 1.8684804693170e-01;
+        rate[6][10] = 3.7262517508685e-01;
+        rate[6][11] = 2.8024271516787e+00;
+        rate[6][12] = 5.5541539747043e-01;
+        rate[6][13] = 2.9140908416530e-01;
+        rate[6][14] = 9.2656393484598e-01;
+        rate[6][15] = 1.7698932389373e+00;
+        rate[6][16] = 1.0710972360073e+00;
+        rate[6][17] = 4.0763564893830e-01;
+        rate[6][18] = 5.9671930034577e-01;
+        rate[6][19] = 5.2425384633796e-01;
+
+        rate[7][8] = 5.3985912495418e-01;
+        rate[7][9] = 1.8929629237636e-01;
+        rate[7][10] = 2.1772115923623e-01;
+        rate[7][11] = 7.5204244030271e-01;
+        rate[7][12] = 4.5943617357855e-01;
+        rate[7][13] = 3.6816646445253e-01;
+        rate[7][14] = 5.0408659952683e-01;
+        rate[7][15] = 1.5093262532236e+00;
+        rate[7][16] = 6.4143601140497e-01;
+        rate[7][17] = 5.0835892463812e-01;
+        rate[7][18] = 3.0805573703500e-01;
+        rate[7][19] = 2.5334079019018e-01;
+
+        rate[8][9] = 2.5271844788492e-01;
+        rate[8][10] = 3.4807220979697e-01;
+        rate[8][11] = 1.0225070358890e+00;
+        rate[8][12] = 9.8431152535870e-01;
+        rate[8][13] = 7.1453370392764e-01;
+        rate[8][14] = 5.2700733915060e-01;
+        rate[8][15] = 1.1170297629105e+00;
+        rate[8][16] = 5.8540709022472e-01;
+        rate[8][17] = 3.0124860078016e-01;
+        rate[8][18] = 4.2189539693890e+00;
+        rate[8][19] = 2.0155597175031e-01;
+
+        rate[9][10] = 3.8909637733035e+00;
+        rate[9][11] = 4.0619358664202e-01;
+        rate[9][12] = 3.3647977631042e+00;
+        rate[9][13] = 1.5173593259539e+00;
+        rate[9][14] = 3.8835540920564e-01;
+        rate[9][15] = 3.5754441245967e-01;
+        rate[9][16] = 1.1790911972601e+00;
+        rate[9][17] = 3.4198578754023e-01;
+        rate[9][18] = 6.7461709322842e-01;
+        rate[9][19] = 8.3118394054582e+00;
+
+        rate[10][11] = 4.4557027426059e-01;
+        rate[10][12] = 6.0305593795716e+00;
+        rate[10][13] = 2.0648397032375e+00;
+        rate[10][14] = 3.7455568747097e-01;
+        rate[10][15] = 3.5296918452729e-01;
+        rate[10][16] = 9.1525985769421e-01;
+        rate[10][17] = 6.9147463459998e-01;
+        rate[10][18] = 8.1124585632307e-01;
+        rate[10][19] = 2.2314056889131e+00;
+
+        rate[11][12] = 1.0730611843319e+00;
+        rate[11][13] = 2.6692475051102e-01;
+        rate[11][14] = 1.0473834507215e+00;
+        rate[11][15] = 1.7521659178195e+00;
+        rate[11][16] = 1.3038752007987e+00;
+        rate[11][17] = 3.3224304063396e-01;
+        rate[11][18] = 7.1799348690032e-01;
+        rate[11][19] = 4.9813847530407e-01;
+
+        rate[12][13] = 1.7738551688305e+00;
+        rate[12][14] = 4.5412362510273e-01;
+        rate[12][15] = 9.1872341574605e-01;
+        rate[12][16] = 1.4885480537218e+00;
+        rate[12][17] = 8.8810109815193e-01;
+        rate[12][18] = 9.5168216224591e-01;
+        rate[12][19] = 2.5758507553153e+00;
+
+        rate[13][14] = 2.3359790962888e-01;
+        rate[13][15] = 5.4002764482413e-01;
+        rate[13][16] = 4.8820611879305e-01;
+        rate[13][17] = 2.0743248934965e+00;
+        rate[13][18] = 6.7472604308008e+00;
+        rate[13][19] = 8.3811961017754e-01;
+
+        rate[14][15] = 1.1691295777157e+00;
+        rate[14][16] = 1.0054516831488e+00;
+        rate[14][17] = 2.5221483002727e-01;
+        rate[14][18] = 3.6940531935451e-01;
+        rate[14][19] = 4.9690841067567e-01;
+
+        rate[15][16] = 5.1515562922704e+00;
+        rate[15][17] = 3.8792562209837e-01;
+        rate[15][18] = 7.9675152076106e-01;
+        rate[15][19] = 5.6192545744165e-01;
+
+        rate[16][17] = 5.1312812689059e-01;
+        rate[16][18] = 8.0101024319939e-01;
+        rate[16][19] = 2.2530740511763e+00;
+
+        rate[17][18] = 4.0544190065580e+00;
+        rate[17][19] = 2.6650873142646e-01;
+
+        rate[18][19] = 1.0000000000000e+00;
+
+
+        return rate;
+    }
+
+    @Override
+    public double[] getEmpiricalFrequencies() {
+        double[] f = new double[20];
+        f[0] = 0.074;
+        f[1] = 0.052;
+        f[2] = 0.045;
+        f[3] = 0.054;
+        f[4] = 0.025;
+        f[5] = 0.034;
+        f[6] = 0.054;
+        f[7] = 0.074;
+        f[8] = 0.026;
+        f[9] = 0.068;
+        f[10] = 0.099;
+        f[11] = 0.058;
+        f[12] = 0.025;
+        f[13] = 0.047;
+        f[14] = 0.039;
+        f[15] = 0.057;
+        f[16] = 0.051;
+        f[17] = 0.013;
+        f[18] = 0.032;
+        f[19] = 0.073;
+        return f;
+    }
+
+    @Override
+    public int[] getEncodingOrder() {
+        Aminoacid dataType = new Aminoacid();
+        String sCodeMap = dataType.getCodeMap();
+        int[] nCodeMap = new int[dataType.getStateCount()];
+        String sEncoding = "ARNDCQEGHILKMFPSTWYV";
+        for (int i = 0; i < dataType.getStateCount(); i++) {
+            nCodeMap[i] = sEncoding.indexOf(sCodeMap.charAt(i));
+        }
+        return nCodeMap;
+    }
+
+    @Override
+    public boolean canHandleDataType(DataType dataType) {
+        return dataType instanceof Aminoacid;
+    }
+} // class WAG
diff --git a/src/beast/evolution/substitutionmodel/CPREV.java b/src/beast/evolution/substitutionmodel/CPREV.java
new file mode 100644
index 0000000..c65e586
--- /dev/null
+++ b/src/beast/evolution/substitutionmodel/CPREV.java
@@ -0,0 +1,271 @@
+package beast.evolution.substitutionmodel;
+
+import beast.core.Description;
+import beast.evolution.datatype.Aminoacid;
+import beast.evolution.datatype.DataType;
+
+ at Description(" CPREV 45 model of amino acid evolution " +
+        " Adachi, J., P.J. Waddell, W. Martin, and M. Hasegawa. 2000. JME 50:348-358")
+public class CPREV extends EmpiricalSubstitutionModel {
+
+
+    @Override
+    double[][] getEmpiricalRates() {
+        double[][] rate = new double[20][20];
+
+        // Q matrix from Beast 1
+        rate[0][1] = 105;
+        rate[0][2] = 227;
+        rate[0][3] = 175;
+        rate[0][4] = 669;
+        rate[0][5] = 157;
+        rate[0][6] = 499;
+        rate[0][7] = 665;
+        rate[0][8] = 66;
+        rate[0][9] = 145;
+        rate[0][10] = 197;
+        rate[0][11] = 236;
+        rate[0][12] = 185;
+        rate[0][13] = 68;
+        rate[0][14] = 490;
+        rate[0][15] = 2440;
+        rate[0][16] = 1340;
+        rate[0][17] = 14;
+        rate[0][18] = 56;
+        rate[0][19] = 968;
+
+        rate[1][2] = 357;
+        rate[1][3] = 43;
+        rate[1][4] = 823;
+        rate[1][5] = 1745;
+        rate[1][6] = 152;
+        rate[1][7] = 243;
+        rate[1][8] = 715;
+        rate[1][9] = 136;
+        rate[1][10] = 203;
+        rate[1][11] = 4482;
+        rate[1][12] = 125;
+        rate[1][13] = 53;
+        rate[1][14] = 87;
+        rate[1][15] = 385;
+        rate[1][16] = 314;
+        rate[1][17] = 230;
+        rate[1][18] = 323;
+        rate[1][19] = 92;
+
+        rate[2][3] = 4435;
+        rate[2][4] = 538;
+        rate[2][5] = 768;
+        rate[2][6] = 1055;
+        rate[2][7] = 653;
+        rate[2][8] = 1405;
+        rate[2][9] = 168;
+        rate[2][10] = 113;
+        rate[2][11] = 2430;
+        rate[2][12] = 61;
+        rate[2][13] = 97;
+        rate[2][14] = 173;
+        rate[2][15] = 2085;
+        rate[2][16] = 1393;
+        rate[2][17] = 40;
+        rate[2][18] = 754;
+        rate[2][19] = 83;
+
+        rate[3][4] = 10;
+        rate[3][5] = 400;
+        rate[3][6] = 3691;
+        rate[3][7] = 431;
+        rate[3][8] = 331;
+        rate[3][9] = 10;
+        rate[3][10] = 10;
+        rate[3][11] = 412;
+        rate[3][12] = 47;
+        rate[3][13] = 22;
+        rate[3][14] = 170;
+        rate[3][15] = 590;
+        rate[3][16] = 266;
+        rate[3][17] = 18;
+        rate[3][18] = 281;
+        rate[3][19] = 75;
+
+        rate[4][5] = 10;
+        rate[4][6] = 10;
+        rate[4][7] = 303;
+        rate[4][8] = 441;
+        rate[4][9] = 280;
+        rate[4][10] = 396;
+        rate[4][11] = 48;
+        rate[4][12] = 159;
+        rate[4][13] = 726;
+        rate[4][14] = 285;
+        rate[4][15] = 2331;
+        rate[4][16] = 576;
+        rate[4][17] = 435;
+        rate[4][18] = 1466;
+        rate[4][19] = 592;
+
+        rate[5][6] = 3122;
+        rate[5][7] = 133;
+        rate[5][8] = 1269;
+        rate[5][9] = 92;
+        rate[5][10] = 286;
+        rate[5][11] = 3313;
+        rate[5][12] = 202;
+        rate[5][13] = 10;
+        rate[5][14] = 323;
+        rate[5][15] = 396;
+        rate[5][16] = 241;
+        rate[5][17] = 53;
+        rate[5][18] = 391;
+        rate[5][19] = 54;
+
+        rate[6][7] = 379;
+        rate[6][8] = 162;
+        rate[6][9] = 148;
+        rate[6][10] = 82;
+        rate[6][11] = 2629;
+        rate[6][12] = 113;
+        rate[6][13] = 145;
+        rate[6][14] = 185;
+        rate[6][15] = 568;
+        rate[6][16] = 369;
+        rate[6][17] = 63;
+        rate[6][18] = 142;
+        rate[6][19] = 200;
+
+        rate[7][8] = 19;
+        rate[7][9] = 40;
+        rate[7][10] = 20;
+        rate[7][11] = 263;
+        rate[7][12] = 21;
+        rate[7][13] = 25;
+        rate[7][14] = 28;
+        rate[7][15] = 691;
+        rate[7][16] = 92;
+        rate[7][17] = 82;
+        rate[7][18] = 10;
+        rate[7][19] = 91;
+
+        rate[8][9] = 29;
+        rate[8][10] = 66;
+        rate[8][11] = 305;
+        rate[8][12] = 10;
+        rate[8][13] = 127;
+        rate[8][14] = 152;
+        rate[8][15] = 303;
+        rate[8][16] = 32;
+        rate[8][17] = 69;
+        rate[8][18] = 1971;
+        rate[8][19] = 25;
+
+        rate[9][10] = 1745;
+        rate[9][11] = 345;
+        rate[9][12] = 1772;
+        rate[9][13] = 454;
+        rate[9][14] = 117;
+        rate[9][15] = 216;
+        rate[9][16] = 1040;
+        rate[9][17] = 42;
+        rate[9][18] = 89;
+        rate[9][19] = 4797;
+
+        rate[10][11] = 218;
+        rate[10][12] = 1351;
+        rate[10][13] = 1268;
+        rate[10][14] = 219;
+        rate[10][15] = 516;
+        rate[10][16] = 156;
+        rate[10][17] = 159;
+        rate[10][18] = 189;
+        rate[10][19] = 865;
+
+        rate[11][12] = 193;
+        rate[11][13] = 72;
+        rate[11][14] = 302;
+        rate[11][15] = 868;
+        rate[11][16] = 918;
+        rate[11][17] = 10;
+        rate[11][18] = 247;
+        rate[11][19] = 249;
+
+        rate[12][13] = 327;
+        rate[12][14] = 100;
+        rate[12][15] = 93;
+        rate[12][16] = 645;
+        rate[12][17] = 86;
+        rate[12][18] = 215;
+        rate[12][19] = 475;
+
+        rate[13][14] = 43;
+        rate[13][15] = 487;
+        rate[13][16] = 148;
+        rate[13][17] = 468;
+        rate[13][18] = 2370;
+        rate[13][19] = 317;
+
+        rate[14][15] = 1202;
+        rate[14][16] = 260;
+        rate[14][17] = 49;
+        rate[14][18] = 97;
+        rate[14][19] = 122;
+
+        rate[15][16] = 2151;
+        rate[15][17] = 73;
+        rate[15][18] = 522;
+        rate[15][19] = 167;
+
+        rate[16][17] = 29;
+        rate[16][18] = 71;
+        rate[16][19] = 760;
+
+        rate[17][18] = 346;
+        rate[17][19] = 10;
+
+        rate[18][19] = 119;
+
+        return rate;
+    }
+
+    @Override
+    public double[] getEmpiricalFrequencies() {
+        double[] f = new double[20];
+        f[0] = 0.076;
+        f[1] = 0.062;
+        f[2] = 0.041;
+        f[3] = 0.037;
+        f[4] = 0.009;
+        f[5] = 0.038;
+        f[6] = 0.049;
+        f[7] = 0.084;
+        f[8] = 0.025;
+        f[9] = 0.081;
+        f[10] = 0.101;
+        f[11] = 0.050;
+        f[12] = 0.022;
+        f[13] = 0.051;
+        f[14] = 0.043;
+        f[15] = 0.062;
+        f[16] = 0.054;
+        f[17] = 0.018;
+        f[18] = 0.031;
+        f[19] = 0.066;
+        return f;
+    }
+
+    @Override
+    public int[] getEncodingOrder() {
+        Aminoacid dataType = new Aminoacid();
+        String sCodeMap = dataType.getCodeMap();
+        int[] nCodeMap = new int[dataType.getStateCount()];
+        String sEncoding = "ARNDCQEGHILKMFPSTWYV";
+        for (int i = 0; i < dataType.getStateCount(); i++) {
+            nCodeMap[i] = sEncoding.indexOf(sCodeMap.charAt(i));
+        }
+        return nCodeMap;
+    }
+
+    @Override
+    public boolean canHandleDataType(DataType dataType) {
+        return dataType instanceof Aminoacid;
+    }
+} // class WAG
diff --git a/src/beast/evolution/substitutionmodel/Dayhoff.java b/src/beast/evolution/substitutionmodel/Dayhoff.java
new file mode 100644
index 0000000..33b7b0b
--- /dev/null
+++ b/src/beast/evolution/substitutionmodel/Dayhoff.java
@@ -0,0 +1,274 @@
+package beast.evolution.substitutionmodel;
+
+import beast.core.Description;
+import beast.evolution.datatype.Aminoacid;
+import beast.evolution.datatype.DataType;
+
+ at Description(" Dayhoff model for amino acid evolution " +
+        " Dayhoff, M.O., Schwartz, R.M., Orcutt, B.C. (1978) " +
+        " A model of evolutionary change in proteins. " +
+        " Dayhoff, M.O. (ed.) Atlas of Protein Sequence Structur., Vol5, Suppl. 3, " +
+        " National Biomedical Research Foundation, Washington DC, pp. 345-352.")
+public class Dayhoff extends EmpiricalSubstitutionModel {
+
+
+    @Override
+    double[][] getEmpiricalRates() {
+        double[][] rate = new double[20][20];
+
+        // Q matrix from Beast 1
+        rate[0][1] = 9.6472567159749e-01;
+        rate[0][2] = 3.5927991886410e+00;
+        rate[0][3] = 4.3200552414656e+00;
+        rate[0][4] = 1.3184584178499e+00;
+        rate[0][5] = 3.2267534963169e+00;
+        rate[0][6] = 7.0141987829615e+00;
+        rate[0][7] = 8.5773867857875e+00;
+        rate[0][8] = 8.1434196396611e-01;
+        rate[0][9] = 2.3518447453539e+00;
+        rate[0][10] = 1.4735711728911e+00;
+        rate[0][11] = 9.3940162271805e-01;
+        rate[0][12] = 2.5490196078431e+00;
+        rate[0][13] = 6.5922920892495e-01;
+        rate[0][14] = 8.9189834148670e+00;
+        rate[0][15] = 1.4540712836859e+01;
+        rate[0][16] = 1.3411904595370e+01;
+        rate[0][17] = 3.8517964118027e-02;
+        rate[0][18] = 8.7897227856660e-01;
+        rate[0][19] = 7.4036511156187e+00;
+
+        rate[1][2] = 1.1890243902439e+00;
+        rate[1][3] = 5.9525626545377e-02;
+        rate[1][4] = 8.4778922655537e-01;
+        rate[1][5] = 8.8348561504191e+00;
+        rate[1][6] = 5.5954088952654e-02;
+        rate[1][7] = 3.1434881434075e-01;
+        rate[1][8] = 8.4753987678285e+00;
+        rate[1][9] = 2.2684090115941e+00;
+        rate[1][10] = 5.5954088952654e-01;
+        rate[1][11] = 1.6681312769010e+01;
+        rate[1][12] = 3.1707317073171e+00;
+        rate[1][13] = 4.8959827833572e-01;
+        rate[1][14] = 3.6754156468900e+00;
+        rate[1][15] = 5.4755072760812e+00;
+        rate[1][16] = 9.6472567159749e-01;
+        rate[1][17] = 7.5538020086083e+00;
+        rate[1][18] = 2.7977044476327e-01;
+        rate[1][19] = 8.6083213773314e-01;
+
+        rate[2][3] = 3.2459324155194e+01;
+        rate[2][4] = 7.3852625416383e-02;
+        rate[2][5] = 3.7732198142415e+00;
+        rate[2][6] = 5.3911764705882e+00;
+        rate[2][7] = 5.0264375413087e+00;
+        rate[2][8] = 1.9061418685121e+01;
+        rate[2][9] = 2.7901430842607e+00;
+        rate[2][10] = 1.2482698961938e+00;
+        rate[2][11] = 1.1542279411765e+01;
+        rate[2][12] = 1.9117647058824e-01;
+        rate[2][13] = 5.0183823529412e-01;
+        rate[2][14] = 1.5181660899654e+00;
+        rate[2][15] = 1.7697478991597e+01;
+        rate[2][16] = 8.3557302231237e+00;
+        rate[2][17] = 8.6029411764706e-01;
+        rate[2][18] = 3.4411764705882e+00;
+        rate[2][19] = 5.7352941176471e-01;
+
+        rate[3][4] = 2.5534152404601e-02;
+        rate[3][5] = 4.8811013767209e+00;
+        rate[3][6] = 4.0561952440551e+01;
+        rate[3][7] = 4.4423506911730e+00;
+        rate[3][8] = 3.0865788117500e+00;
+        rate[3][9] = 8.5749078239692e-01;
+        rate[3][10] = 2.5926985518518e-02;
+        rate[3][11] = 2.5930851063830e+00;
+        rate[3][12] = 1.1667143483333e-01;
+        rate[3][13] = 1.2963492759259e-02;
+        rate[3][14] = 4.7853935065891e-01;
+        rate[3][15] = 3.4167709637046e+00;
+        rate[3][16] = 2.3984722282163e+00;
+        rate[3][17] = 3.2408731898147e-02;
+        rate[3][18] = 8.1351689612015e-02;
+        rate[3][19] = 6.3829787234043e-01;
+
+        rate[4][5] = 2.1864264103535e-02;
+        rate[4][6] = 1.4770525083277e-02;
+        rate[4][7] = 3.9055458751427e-01;
+        rate[4][8] = 1.0223340673168e+00;
+        rate[4][9] = 1.5970515970516e+00;
+        rate[4][10] = 3.9098448749850e-02;
+        rate[4][11] = 8.0776309049169e-03;
+        rate[4][12] = 1.4155086538140e-01;
+        rate[4][13] = 8.6898395721925e-02;
+        rate[4][14] = 6.8155604487784e-01;
+        rate[4][15] = 5.8097784568373e+00;
+        rate[4][16] = 5.9929928084086e-01;
+        rate[4][17] = 3.4759358288770e-01;
+        rate[4][18] = 3.4759358288770e+00;
+        rate[4][19] = 1.7647058823529e+00;
+
+        rate[5][6] = 2.5476780185759e+01;
+        rate[5][7] = 1.0174974779977e+00;
+        rate[5][8] = 2.1573939173192e+01;
+        rate[5][9] = 6.5266504894988e-01;
+        rate[5][10] = 2.6634492806410e+00;
+        rate[5][11] = 5.5466331269350e+00;
+        rate[5][12] = 4.0247678018576e+00;
+        rate[5][13] = 1.8038017885416e-02;
+        rate[5][14] = 5.5044618466582e+00;
+        rate[5][15] = 2.0267580716497e+00;
+        rate[5][16] = 1.9256432155439e+00;
+        rate[5][17] = 9.6202762055552e-02;
+        rate[5][18] = 1.0061919504644e-01;
+        rate[5][19] = 1.2538699690402e+00;
+
+        rate[6][7] = 2.8869795109055e+00;
+        rate[6][8] = 1.5519031141869e+00;
+        rate[6][9] = 2.1701112877583e+00;
+        rate[6][10] = 4.0484429065744e-01;
+        rate[6][11] = 2.9823529411765e+00;
+        rate[6][12] = 1.0705882352941e+00;
+        rate[6][13] = 1.9801735189768e-02;
+        rate[6][14] = 1.7993079584775e+00;
+        rate[6][15] = 2.8184873949580e+00;
+        rate[6][16] = 1.2261663286004e+00;
+        rate[6][17] = 7.3114099162219e-02;
+        rate[6][18] = 7.6470588235294e-01;
+        rate[6][19] = 1.3058823529412e+00;
+
+        rate[7][8] = 3.7906768788150e-01;
+        rate[7][9] = 2.3128004846840e-02;
+        rate[7][10] = 2.5776602775942e-01;
+        rate[7][11] = 9.6662260409782e-01;
+        rate[7][12] = 6.0145406477198e-01;
+        rate[7][13] = 5.4775280898876e-01;
+        rate[7][14] = 1.2382877804129e+00;
+        rate[7][15] = 8.2853366065527e+00;
+        rate[7][16] = 1.1110604644803e+00;
+        rate[7][17] = 1.2888301387971e-01;
+        rate[7][18] = 1.7114723586662e-02;
+        rate[7][19] = 1.9233311302049e+00;
+
+        rate[8][9] = 2.7354343963341e-01;
+        rate[8][10] = 1.5876246692449e+00;
+        rate[8][11] = 9.6993944636678e-01;
+        rate[8][12] = 1.2544085640577e-01;
+        rate[8][13] = 1.6868512110727e+00;
+        rate[8][14] = 3.3075513942601e+00;
+        rate[8][15] = 1.2530894710826e+00;
+        rate[8][16] = 8.1434196396611e-01;
+        rate[8][17] = 1.0121107266436e+00;
+        rate[8][18] = 4.4982698961938e+00;
+        rate[8][19] = 1.5570934256055e+00;
+
+        rate[9][10] = 9.2275320303002e+00;
+        rate[9][11] = 1.6663354531002e+00;
+        rate[9][12] = 1.1780604133545e+01;
+        rate[9][13] = 6.9753577106518e+00;
+        rate[9][14] = 4.2551201720752e-01;
+        rate[9][15] = 8.8575970928912e-01;
+        rate[9][16] = 6.8951811852420e+00;
+        rate[9][17] = 9.8802836705702e-02;
+        rate[9][18] = 1.3434022257552e+00;
+        rate[9][19] = 3.1526232114467e+01;
+
+        rate[10][11] = 6.5787197231834e-01;
+        rate[10][12] = 1.8622837370242e+01;
+        rate[10][13] = 5.6340830449827e+00;
+        rate[10][14] = 1.1377976796255e+00;
+        rate[10][15] = 6.1690558576372e-01;
+        rate[10][16] = 1.2098794893211e+00;
+        rate[10][17] = 1.7543252595156e+00;
+        rate[10][18] = 1.0346020761246e+00;
+        rate[10][19] = 6.2906574394464e+00;
+
+        rate[11][12] = 8.6029411764706e+00;
+        rate[11][13] = 6.6640454965565e-03;
+        rate[11][14] = 1.2089100346021e+00;
+        rate[11][15] = 3.4411764705882e+00;
+        rate[11][16] = 4.9442190669371e+00;
+        rate[11][17] = 3.4272233982290e-02;
+        rate[11][18] = 4.7794117647059e-01;
+        rate[11][19] = 3.7500000000000e-01;
+
+        rate[12][13] = 3.2500000000000e+00;
+        rate[12][14] = 5.9976931949250e-01;
+        rate[12][15] = 2.1848739495798e+00;
+        rate[12][16] = 3.6916835699797e+00;
+        rate[12][17] = 1.6247577591604e-01;
+        rate[12][18] = 1.1508700794053e-01;
+        rate[12][19] = 9.0588235294118e+00;
+
+        rate[13][14] = 3.9359861591695e-01;
+        rate[13][15] = 1.6386554621849e+00;
+        rate[13][16] = 4.9442190669371e-01;
+        rate[13][17] = 2.8676470588235e+00;
+        rate[13][18] = 2.4852941176471e+01;
+        rate[13][19] = 4.4117647058824e-01;
+
+        rate[14][15] = 8.6431043005437e+00;
+        rate[14][16] = 2.8308077795013e+00;
+        rate[14][17] = 3.5840244687362e-02;
+        rate[14][18] = 4.3804743506776e-02;
+        rate[14][19] = 1.7301038062284e+00;
+
+        rate[15][16] = 1.9663865546218e+01;
+        rate[15][17] = 2.7857142857143e+00;
+        rate[15][18] = 1.2016806722689e+00;
+        rate[15][19] = 1.0840336134454e+00;
+
+        rate[16][17] = 4.2019597219666e-02;
+        rate[16][18] = 1.5162271805274e+00;
+        rate[16][19] = 5.6592292089249e+00;
+
+        rate[17][18] = 2.2941176470588e+00;
+        rate[17][19] = 1.2654363316538e-01;
+
+        rate[18][19] = 1.0000000000000e+00;
+
+        return rate;
+    }
+
+    @Override
+    public double[] getEmpiricalFrequencies() {
+        double[] f = new double[20];
+        f[0] = 0.087;
+        f[1] = 0.041;
+        f[2] = 0.040;
+        f[3] = 0.047;
+        f[4] = 0.033;
+        f[5] = 0.038;
+        f[6] = 0.05;
+        f[7] = 0.089;
+        f[8] = 0.034;
+        f[9] = 0.037;
+        f[10] = 0.085;
+        f[11] = 0.08;
+        f[12] = 0.015;
+        f[13] = 0.04;
+        f[14] = 0.051;
+        f[15] = 0.07;
+        f[16] = 0.058;
+        f[17] = 0.01;
+        f[18] = 0.03;
+        f[19] = 0.065;
+        return f;
+    }
+
+    @Override
+    public int[] getEncodingOrder() {
+        Aminoacid dataType = new Aminoacid();
+        String sCodeMap = dataType.getCodeMap();
+        int[] nCodeMap = new int[dataType.getStateCount()];
+        String sEncoding = "ARNDCQEGHILKMFPSTWYV";
+        for (int i = 0; i < dataType.getStateCount(); i++) {
+            nCodeMap[i] = sEncoding.indexOf(sCodeMap.charAt(i));
+        }
+        return nCodeMap;
+    }
+
+    @Override
+    public boolean canHandleDataType(DataType dataType) {
+        return dataType instanceof Aminoacid;
+    }
+} // class WAG
diff --git a/src/beast/evolution/substitutionmodel/DefaultEigenSystem.java b/src/beast/evolution/substitutionmodel/DefaultEigenSystem.java
new file mode 100644
index 0000000..ca2eca2
--- /dev/null
+++ b/src/beast/evolution/substitutionmodel/DefaultEigenSystem.java
@@ -0,0 +1,659 @@
+package beast.evolution.substitutionmodel;
+
+import beast.math.MachineAccuracy;
+
+/**
+ * A default Eigen decomposition system
+ *
+ * @author Andrew Rambaut
+ * @author Marc Suchard
+ * @author Ziheng Yang?
+ */
+public class DefaultEigenSystem implements EigenSystem {
+
+    private final int stateCount;
+
+    public DefaultEigenSystem(int stateCount) {
+
+        this.stateCount = stateCount;
+
+        // some temporary values...
+        ordr = new int[stateCount];
+        evali = new double[stateCount];
+    }
+
+    /**
+     * set instantaneous rate matrix
+     * This changes the values in qMatrix as side effect
+     */
+    public EigenDecomposition decomposeMatrix(double[][] qMatrix) {
+
+        Eval = new double[stateCount];
+        Evec = new double[stateCount][stateCount];
+        Ievc = new double[stateCount][stateCount];
+
+        // compute eigenvalues and eigenvectors
+        elmhes(qMatrix, ordr, stateCount);
+        eltran(qMatrix, Evec, ordr, stateCount);
+        hqr2(stateCount, 1, stateCount, qMatrix, Evec, Eval, evali);
+        luinverse(Evec, Ievc, stateCount);
+
+        double[] flatEvec = new double[stateCount * stateCount];
+        double[] flatIevc = new double[stateCount * stateCount];
+
+        for (int i = 0; i < stateCount; i++) {
+            System.arraycopy(Evec[i], 0, flatEvec, i * stateCount, stateCount);
+            System.arraycopy(Ievc[i], 0, flatIevc, i * stateCount, stateCount);
+        }
+
+        return new EigenDecomposition(flatEvec, flatIevc, Eval);
+    }
+
+    /* real part of eigenvalues **/
+    private double[] Eval;
+    /* eigenvectors **/
+    private double[][] Evec;
+    /* inverse eigenvectors **/
+    private double[][] Ievc;
+
+    private int[] ordr;
+    /* imaginary part of eigenvalues **/
+    private double[] evali;
+
+    /* transforms a real general matrix to upper Hessenberg form */
+    private void elmhes(double[][] a, int[] ordr, int n) {
+        int m, j, i;
+        double y, x;
+
+        for (i = 0; i < n; i++) {
+            ordr[i] = 0;
+        }
+        for (m = 2; m < n; m++) {
+            x = 0.0;
+            i = m;
+            for (j = m; j <= n; j++) {
+                if (Math.abs(a[j - 1][m - 2]) > Math.abs(x)) {
+                    x = a[j - 1][m - 2];
+                    i = j;
+                }
+            }
+            ordr[m - 1] = i;
+            if (i != m) {
+                for (j = m - 2; j < n; j++) {
+                    y = a[i - 1][j];
+                    a[i - 1][j] = a[m - 1][j];
+                    a[m - 1][j] = y;
+                }
+                for (j = 0; j < n; j++) {
+                    y = a[j][i - 1];
+                    a[j][i - 1] = a[j][m - 1];
+                    a[j][m - 1] = y;
+                }
+            }
+            if (x != 0.0) {
+                for (i = m; i < n; i++) {
+                    y = a[i][m - 2];
+                    if (y != 0.0) {
+                        y /= x;
+                        a[i][m - 2] = y;
+                        for (j = m - 1; j < n; j++) {
+                            a[i][j] -= y * a[m - 1][j];
+                        }
+                        for (j = 0; j < n; j++) {
+                            a[j][m - 1] += y * a[j][i];
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    // Helper variables for mcdiv
+    private double cr, ci;
+
+    private void mcdiv(double ar, double ai, double br, double bi) {
+        double s, ars, ais, brs, bis;
+
+        s = Math.abs(br) + Math.abs(bi);
+        ars = ar / s;
+        ais = ai / s;
+        brs = br / s;
+        bis = bi / s;
+        s = brs * brs + bis * bis;
+        cr = (ars * brs + ais * bis) / s;
+        ci = (ais * brs - ars * bis) / s;
+    }
+
+    /* computes eigenvalues and eigenvectors of a real upper Hessenberg matrix */
+    private void hqr2(int n, int low, int hgh, double[][] h, double[][] zz,
+                      double[] wr, double[] wi) throws ArithmeticException {
+        int i, j, k, l = 0, m, en, na, itn, its;
+        double p = 0, q = 0, r = 0, s = 0, t, w, x = 0, y, ra, sa, vi, vr, z = 0, norm, tst1, tst2;
+        boolean notLast;
+
+
+        norm = 0.0;
+        k = 1;
+        /* store isolated roots and compute matrix norm */
+        for (i = 0; i < n; i++) {
+            for (j = k - 1; j < n; j++) {
+                norm += Math.abs(h[i][j]);
+            }
+            k = i + 1;
+            if (i + 1 < low || i + 1 > hgh) {
+                wr[i] = h[i][i];
+                wi[i] = 0.0;
+            }
+        }
+        en = hgh;
+        t = 0.0;
+        itn = n * 30;
+        while (en >= low) {    /* search for next eigenvalues */
+            its = 0;
+            na = en - 1;
+            while (en >= 1) {
+                /* look for single small sub-diagonal element */
+                boolean fullLoop = true;
+                for (l = en; l > low; l--) {
+                    s = Math.abs(h[l - 2][l - 2]) + Math.abs(h[l - 1][l - 1]);
+                    if (s == 0.0) {
+                        s = norm;
+                    }
+                    tst1 = s;
+                    tst2 = tst1 + Math.abs(h[l - 1][l - 2]);
+                    if (tst2 == tst1) {
+                        fullLoop = false;
+                        break;
+                    }
+                }
+                if (fullLoop) {
+                    l = low;
+                }
+
+                x = h[en - 1][en - 1];    /* form shift */
+                if (l == en || l == na) {
+                    break;
+                }
+                if (itn == 0) {
+                    /* eigenvalues have not converged */
+                    System.out.println("Eigenvalues not converged");
+                    throw new ArithmeticException();
+                }
+                y = h[na - 1][na - 1];
+                w = h[en - 1][na - 1] * h[na - 1][en - 1];
+                /* form exceptional shift */
+                if (its == 10 || its == 20) {
+                    t += x;
+                    for (i = low - 1; i < en; i++) {
+                        h[i][i] -= x;
+                    }
+                    s = Math.abs(h[en - 1][na - 1]) + Math.abs(h[na - 1][en - 3]);
+                    x = 0.75 * s;
+                    y = x;
+                    w = -0.4375 * s * s;
+                }
+                its++;
+                itn--;
+                /* look for two consecutive small sub-diagonal elements */
+                for (m = en - 2; m >= l; m--) {
+                    z = h[m - 1][m - 1];
+                    r = x - z;
+                    s = y - z;
+                    p = (r * s - w) / h[m][m - 1] + h[m - 1][m];
+                    q = h[m][m] - z - r - s;
+                    r = h[m + 1][m];
+                    s = Math.abs(p) + Math.abs(q) + Math.abs(r);
+                    p /= s;
+                    q /= s;
+                    r /= s;
+                    if (m == l) {
+                        break;
+                    }
+                    tst1 = Math.abs(p) * (Math.abs(h[m - 2][m - 2]) + Math.abs(z) + Math.abs(h[m][m]));
+                    tst2 = tst1 + Math.abs(h[m - 1][m - 2]) * (Math.abs(q) + Math.abs(r));
+                    if (tst2 == tst1) {
+                        break;
+                    }
+                }
+                for (i = m + 2; i <= en; i++) {
+                    h[i - 1][i - 3] = 0.0;
+                    if (i != m + 2) {
+                        h[i - 1][i - 4] = 0.0;
+                    }
+                }
+                for (k = m; k <= na; k++) {
+                    notLast = k != na;
+                    if (k != m) {
+                        p = h[k - 1][k - 2];
+                        q = h[k][k - 2];
+                        r = 0.0;
+                        if (notLast) {
+                            r = h[k + 1][k - 2];
+                        }
+                        x = Math.abs(p) + Math.abs(q) + Math.abs(r);
+                        if (x != 0.0) {
+                            p /= x;
+                            q /= x;
+                            r /= x;
+                        }
+                    }
+                    if (x != 0.0) {
+                        if (p < 0.0) {    /* sign */
+                            s = -Math.sqrt(p * p + q * q + r * r);
+                        } else {
+                            s = Math.sqrt(p * p + q * q + r * r);
+                        }
+                        if (k != m) {
+                            h[k - 1][k - 2] = -s * x;
+                        } else if (l != m) {
+                            h[k - 1][k - 2] = -h[k - 1][k - 2];
+                        }
+                        p += s;
+                        x = p / s;
+                        y = q / s;
+                        z = r / s;
+                        q /= p;
+                        r /= p;
+                        if (!notLast) {
+                            for (j = k - 1; j < n; j++) {    /* row modification */
+                                p = h[k - 1][j] + q * h[k][j];
+                                h[k - 1][j] -= p * x;
+                                h[k][j] -= p * y;
+                            }
+                            j = (en < (k + 3)) ? en : (k + 3); /* min */
+                            for (i = 0; i < j; i++) {    /* column modification */
+                                p = x * h[i][k - 1] + y * h[i][k];
+                                h[i][k - 1] -= p;
+                                h[i][k] -= p * q;
+                            }
+                            /* accumulate transformations */
+                            for (i = low - 1; i < hgh; i++) {
+                                p = x * zz[i][k - 1] + y * zz[i][k];
+                                zz[i][k - 1] -= p;
+                                zz[i][k] -= p * q;
+                            }
+                        } else {
+                            for (j = k - 1; j < n; j++) {    /* row modification */
+                                p = h[k - 1][j] + q * h[k][j] + r * h[k + 1][j];
+                                h[k - 1][j] -= p * x;
+                                h[k][j] -= p * y;
+                                h[k + 1][j] -= p * z;
+                            }
+                            j = (en < (k + 3)) ? en : (k + 3); /* min */
+                            for (i = 0; i < j; i++) {    /* column modification */
+                                p = x * h[i][k - 1] + y * h[i][k] + z * h[i][k + 1];
+                                h[i][k - 1] -= p;
+                                h[i][k] -= p * q;
+                                h[i][k + 1] -= p * r;
+                            }
+                            /* accumulate transformations */
+                            for (i = low - 1; i < hgh; i++) {
+                                p = x * zz[i][k - 1] + y * zz[i][k] +
+                                        z * zz[i][k + 1];
+                                zz[i][k - 1] -= p;
+                                zz[i][k] -= p * q;
+                                zz[i][k + 1] -= p * r;
+                            }
+                        }
+                    }
+                }                 /* for k */
+            }                     /* while infinite loop */
+            if (l == en) {                 /* one root found */
+                h[en - 1][en - 1] = x + t;
+                wr[en - 1] = h[en - 1][en - 1];
+                wi[en - 1] = 0.0;
+                en = na;
+                continue;
+            }
+            y = h[na - 1][na - 1];
+            w = h[en - 1][na - 1] * h[na - 1][en - 1];
+            p = (y - x) / 2.0;
+            q = p * p + w;
+            z = Math.sqrt(Math.abs(q));
+            h[en - 1][en - 1] = x + t;
+            x = h[en - 1][en - 1];
+            h[na - 1][na - 1] = y + t;
+            if (q >= 0.0) {     /* real pair */
+                if (p < 0.0) {    /* sign */
+                    z = p - Math.abs(z);
+                } else {
+                    z = p + Math.abs(z);
+                }
+                wr[na - 1] = x + z;
+                wr[en - 1] = wr[na - 1];
+                if (z != 0.0) {
+                    wr[en - 1] = x - w / z;
+                }
+                wi[na - 1] = 0.0;
+                wi[en - 1] = 0.0;
+                x = h[en - 1][na - 1];
+                s = Math.abs(x) + Math.abs(z);
+                p = x / s;
+                q = z / s;
+                r = Math.sqrt(p * p + q * q);
+                p /= r;
+                q /= r;
+                for (j = na - 1; j < n; j++) {    /* row modification */
+                    z = h[na - 1][j];
+                    h[na - 1][j] = q * z + p * h[en - 1][j];
+                    h[en - 1][j] = q * h[en - 1][j] - p * z;
+                }
+                for (i = 0; i < en; i++) {    /* column modification */
+                    z = h[i][na - 1];
+                    h[i][na - 1] = q * z + p * h[i][en - 1];
+                    h[i][en - 1] = q * h[i][en - 1] - p * z;
+                }
+                /* accumulate transformations */
+                for (i = low - 1; i < hgh; i++) {
+                    z = zz[i][na - 1];
+                    zz[i][na - 1] = q * z + p * zz[i][en - 1];
+                    zz[i][en - 1] = q * zz[i][en - 1] - p * z;
+                }
+            } else {    /* complex pair */
+                wr[na - 1] = x + p;
+                wr[en - 1] = x + p;
+                wi[na - 1] = z;
+                wi[en - 1] = -z;
+            }
+            en -= 2;
+        } /* while en >= low */
+        /* backsubstitute to find vectors of upper triangular form */
+        if (norm != 0.0) {
+            for (en = n; en >= 1; en--) {
+                p = wr[en - 1];
+                q = wi[en - 1];
+                na = en - 1;
+                if (q == 0.0) {/* real vector */
+                    m = en;
+                    h[en - 1][en - 1] = 1.0;
+                    if (na != 0) {
+                        for (i = en - 2; i >= 0; i--) {
+                            w = h[i][i] - p;
+                            r = 0.0;
+                            for (j = m - 1; j < en; j++) {
+                                r += h[i][j] * h[j][en - 1];
+                            }
+                            if (wi[i] < 0.0) {
+                                z = w;
+                                s = r;
+                            } else {
+                                m = i + 1;
+                                if (wi[i] == 0.0) {
+                                    t = w;
+                                    if (t == 0.0) {
+                                        tst1 = norm;
+                                        t = tst1;
+                                        do {
+                                            t = 0.01 * t;
+                                            tst2 = norm + t;
+                                        }
+                                        while (tst2 > tst1);
+                                    }
+                                    h[i][en - 1] = -(r / t);
+                                } else {    /* solve real equations */
+                                    x = h[i][i + 1];
+                                    y = h[i + 1][i];
+                                    q = (wr[i] - p) * (wr[i] - p) + wi[i] * wi[i];
+                                    t = (x * s - z * r) / q;
+                                    h[i][en - 1] = t;
+                                    if (Math.abs(x) > Math.abs(z))
+                                        h[i + 1][en - 1] = (-r - w * t) / x;
+                                    else
+                                        h[i + 1][en - 1] = (-s - y * t) / z;
+                                }
+                                /* overflow control */
+                                t = Math.abs(h[i][en - 1]);
+                                if (t != 0.0) {
+                                    tst1 = t;
+                                    tst2 = tst1 + 1.0 / tst1;
+                                    if (tst2 <= tst1) {
+                                        for (j = i; j < en; j++) {
+                                            h[j][en - 1] /= t;
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+                } else if (q < 0.0) {
+                    m = na;
+                    if (Math.abs(h[en - 1][na - 1]) > Math.abs(h[na - 1][en - 1])) {
+                        h[na - 1][na - 1] = q / h[en - 1][na - 1];
+                        h[na - 1][en - 1] = (p - h[en - 1][en - 1]) / h[en - 1][na - 1];
+                    } else {
+                        mcdiv(0.0, -h[na - 1][en - 1], h[na - 1][na - 1] - p, q);
+                        h[na - 1][na - 1] = cr;
+                        h[na - 1][en - 1] = ci;
+                    }
+                    h[en - 1][na - 1] = 0.0;
+                    h[en - 1][en - 1] = 1.0;
+                    if (en != 2) {
+                        for (i = en - 3; i >= 0; i--) {
+                            w = h[i][i] - p;
+                            ra = 0.0;
+                            sa = 0.0;
+                            for (j = m - 1; j < en; j++) {
+                                ra += h[i][j] * h[j][na - 1];
+                                sa += h[i][j] * h[j][en - 1];
+                            }
+                            if (wi[i] < 0.0) {
+                                z = w;
+                                r = ra;
+                                s = sa;
+                            } else {
+                                m = i + 1;
+                                if (wi[i] == 0.0) {
+                                    mcdiv(-ra, -sa, w, q);
+                                    h[i][na - 1] = cr;
+                                    h[i][en - 1] = ci;
+                                } else {    /* solve complex equations */
+                                    x = h[i][i + 1];
+                                    y = h[i + 1][i];
+                                    vr = (wr[i] - p) * (wr[i] - p);
+                                    vr = vr + wi[i] * wi[i] - q * q;
+                                    vi = (wr[i] - p) * 2.0 * q;
+                                    if (vr == 0.0 && vi == 0.0) {
+                                        tst1 = norm * (Math.abs(w) + Math.abs(q) + Math.abs(x) +
+                                                Math.abs(y) + Math.abs(z));
+                                        vr = tst1;
+                                        do {
+                                            vr = 0.01 * vr;
+                                            tst2 = tst1 + vr;
+                                        }
+                                        while (tst2 > tst1);
+                                    }
+                                    mcdiv(x * r - z * ra + q * sa, x * s - z * sa - q * ra, vr, vi);
+                                    h[i][na - 1] = cr;
+                                    h[i][en - 1] = ci;
+                                    if (Math.abs(x) > Math.abs(z) + Math.abs(q)) {
+                                        h[i + 1]
+                                                [na - 1] = (q * h[i][en - 1] -
+                                                w * h[i][na - 1] - ra) / x;
+                                        h[i + 1][en - 1] = (-sa - w * h[i][en - 1] -
+                                                q * h[i][na - 1]) / x;
+                                    } else {
+                                        mcdiv(-r - y * h[i][na - 1], -s - y * h[i][en - 1], z, q);
+                                        h[i + 1][na - 1] = cr;
+                                        h[i + 1][en - 1] = ci;
+                                    }
+                                }
+                                /* overflow control */
+                                t = (Math.abs(h[i][na - 1]) > Math.abs(h[i][en - 1])) ?
+                                        Math.abs(h[i][na - 1]) : Math.abs(h[i][en - 1]);
+                                if (t != 0.0) {
+                                    tst1 = t;
+                                    tst2 = tst1 + 1.0 / tst1;
+                                    if (tst2 <= tst1) {
+                                        for (j = i; j < en; j++) {
+                                            h[j][na - 1] /= t;
+                                            h[j][en - 1] /= t;
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            /* end back substitution. vectors of isolated roots */
+            for (i = 0; i < n; i++) {
+                if (i + 1 < low || i + 1 > hgh) {
+                    for (j = i; j < n; j++) {
+                        zz[i][j] = h[i][j];
+                    }
+                }
+            }
+            /* multiply by transformation matrix to give vectors of
+                               * original full matrix. */
+            for (j = n - 1; j >= low - 1; j--) {
+                m = ((j + 1) < hgh) ? (j + 1) : hgh; /* min */
+                for (i = low - 1; i < hgh; i++) {
+                    z = 0.0;
+                    for (k = low - 1; k < m; k++) {
+                        z += zz[i][k] * h[k][j];
+                    }
+                    zz[i][j] = z;
+                }
+            }
+        }
+    }
+
+    /* accumulates similarity transformations used by ELMHES */
+    private void eltran(double[][] a, double[][] zz, int[] ordr, int n) {
+        int i, j, m;
+
+        for (i = 0; i < n; i++) {
+            for (j = i + 1; j < n; j++) {
+                zz[i][j] = 0.0;
+                zz[j][i] = 0.0;
+            }
+            zz[i][i] = 1.0;
+        }
+        if (n <= 2) {
+            return;
+        }
+        for (m = n - 1; m >= 2; m--) {
+            for (i = m; i < n; i++) {
+                zz[i][m - 1] = a[i][m - 2];
+            }
+            i = ordr[m - 1];
+            if (i != m) {
+                for (j = m - 1; j < n; j++) {
+                    zz[m - 1][j] = zz[i - 1][j];
+                    zz[i - 1][j] = 0.0;
+                }
+                zz[i - 1][m - 1] = 1.0;
+            }
+        }
+    }
+
+    private void luinverse(double[][] inmat, double[][] imtrx, int size) throws IllegalArgumentException {
+        int i, j, k, l, maxi = 0, idx, ix, jx;
+        double sum, tmp, maxb, aw;
+        int[] index;
+        double[] wk;
+        double[][] omtrx;
+
+
+        index = new int[size];
+        omtrx = new double[size][size];
+
+        /* copy inmat to omtrx */
+        for (i = 0; i < size; i++) {
+            for (j = 0; j < size; j++) {
+                omtrx[i][j] = inmat[i][j];
+            }
+        }
+
+        wk = new double[size];
+        aw = 1.0;
+        for (i = 0; i < size; i++) {
+            maxb = 0.0;
+            for (j = 0; j < size; j++) {
+                if (Math.abs(omtrx[i][j]) > maxb) {
+                    maxb = Math.abs(omtrx[i][j]);
+                }
+            }
+            if (maxb == 0.0) {
+                /* Singular matrix */
+                System.out.println("Singular matrix encountered");
+                throw new IllegalArgumentException("Singular matrix");
+            }
+            wk[i] = 1.0 / maxb;
+        }
+        for (j = 0; j < size; j++) {
+            for (i = 0; i < j; i++) {
+                sum = omtrx[i][j];
+                for (k = 0; k < i; k++) {
+                    sum -= omtrx[i][k] * omtrx[k][j];
+                }
+                omtrx[i][j] = sum;
+            }
+            maxb = 0.0;
+            for (i = j; i < size; i++) {
+                sum = omtrx[i][j];
+                for (k = 0; k < j; k++) {
+                    sum -= omtrx[i][k] * omtrx[k][j];
+                }
+                omtrx[i][j] = sum;
+                tmp = wk[i] * Math.abs(sum);
+                if (tmp >= maxb) {
+                    maxb = tmp;
+                    maxi = i;
+                }
+            }
+            if (j != maxi) {
+                for (k = 0; k < size; k++) {
+                    tmp = omtrx[maxi][k];
+                    omtrx[maxi][k] = omtrx[j][k];
+                    omtrx[j][k] = tmp;
+                }
+                aw = -aw;
+                wk[maxi] = wk[j];
+            }
+            index[j] = maxi;
+            if (omtrx[j][j] == 0.0) {
+                omtrx[j][j] = MachineAccuracy.EPSILON;
+            }
+            if (j != size - 1) {
+                tmp = 1.0 / omtrx[j][j];
+                for (i = j + 1; i < size; i++) {
+                    omtrx[i][j] *= tmp;
+                }
+            }
+        }
+        for (jx = 0; jx < size; jx++) {
+            for (ix = 0; ix < size; ix++) {
+                wk[ix] = 0.0;
+            }
+            wk[jx] = 1.0;
+            l = -1;
+            for (i = 0; i < size; i++) {
+                idx = index[i];
+                sum = wk[idx];
+                wk[idx] = wk[i];
+                if (l != -1) {
+                    for (j = l; j < i; j++) {
+                        sum -= omtrx[i][j] * wk[j];
+                    }
+                } else if (sum != 0.0) {
+                    l = i;
+                }
+                wk[i] = sum;
+            }
+            for (i = size - 1; i >= 0; i--) {
+                sum = wk[i];
+                for (j = i + 1; j < size; j++) {
+                    sum -= omtrx[i][j] * wk[j];
+                }
+                wk[i] = sum / omtrx[i][i];
+            }
+            for (ix = 0; ix < size; ix++) {
+                imtrx[ix][jx] = wk[ix];
+            }
+        }
+        wk = null;
+        index = null;
+        omtrx = null;
+    }
+}
diff --git a/src/beast/evolution/substitutionmodel/EigenDecomposition.java b/src/beast/evolution/substitutionmodel/EigenDecomposition.java
new file mode 100644
index 0000000..a996d5b
--- /dev/null
+++ b/src/beast/evolution/substitutionmodel/EigenDecomposition.java
@@ -0,0 +1,108 @@
+package beast.evolution.substitutionmodel;
+
+/**
+ * A storage structure to hold an Eigen Decomposition of a rate matrix.
+ * This encapsulates everything and facilitates copying for store/restore
+ * mechanisms.
+ *
+ * @author Andrew Rambaut
+ * @author Alexei Drummond
+ * @author Marc A. Suchard
+ */
+public class EigenDecomposition {
+
+    public EigenDecomposition(double[] evec, double[] ievc, double[] eval) {
+        Evec = evec;
+        Ievc = ievc;
+        Eval = eval;
+        Evali = null;
+    }
+
+    public EigenDecomposition(double[] evec, double[] ievc, double[] eval, double[] evali) {
+        Evec = evec;
+        Ievc = ievc;
+        Eval = eval;
+        Evali = evali;   // the imaginary parts are being ignored at the moment
+    }
+
+    public EigenDecomposition copy() {
+        double[] evec = Evec.clone();
+        double[] ievc = Ievc.clone();
+        double[] eval = Eval.clone();
+
+        return new EigenDecomposition(evec, ievc, eval);
+    }
+
+    /**
+     * This function returns the Eigen vectors.
+     *
+     * @return the array
+     */
+    public final double[] getEigenVectors() {
+        return Evec;
+    }
+
+    /**
+     * This function returns the inverse Eigen vectors.
+     *
+     * @return the array
+     */
+    public final double[] getInverseEigenVectors() {
+        return Ievc;
+    }
+
+    /**
+     * This function returns the Eigen values.
+     *
+     * @return the Eigen values
+     */
+    public final double[] getEigenValues() {
+        return Eval;
+    }
+
+    /**
+     * This function returns the imaginary part of the Eigen values.
+     *
+     * @return the Eigen values
+     */
+    public final double[] getImEigenValues() {
+        return Evali;
+    }
+
+    /**
+     * This functions returns true if the diagonalization may be complex
+     *
+     * @return bool
+     */
+    public boolean canReturnComplexDiagonalization() {
+        return false;
+    }
+
+    /**
+     * This function rescales the eigen values; this is more stable than
+     * rescaling the original Q matrix, also O(stateCount) instead of O(stateCount^2)
+     */
+    public void normalizeEigenValues(double scale) {
+        int dim = Eval.length;
+        for (int i = 0; i < dim; i++)
+
+            Eval[i] /= scale;
+    }
+
+    public Boolean hasImagEigenvectors() {
+        if (Evali == null) return false;
+        for (int i = 0; i < Evali.length; i++)
+            if (Evali[i] != 0) {
+//                System.err.println("Imaginary eigenvectors found. Discard.");
+                return true;
+            }
+        return false;
+    }
+
+    // Eigenvalues, eigenvectors, and inverse eigenvectors
+    private final double[] Evec;
+    private final double[] Ievc;
+    private final double[] Eval;
+    private final double[] Evali;   // imaginary part of eigenvalues
+
+}
diff --git a/src/beast/evolution/substitutionmodel/EigenSystem.java b/src/beast/evolution/substitutionmodel/EigenSystem.java
new file mode 100644
index 0000000..f9c9412
--- /dev/null
+++ b/src/beast/evolution/substitutionmodel/EigenSystem.java
@@ -0,0 +1,14 @@
+package beast.evolution.substitutionmodel;
+
+/**
+ * @author Andrew Rambaut
+ * @version $Id$
+ */
+public interface EigenSystem {
+    /**
+     * Set the instantaneous rate matrix
+     * This changes the values in matrix as side effect
+     * @param matrix
+     */
+    EigenDecomposition decomposeMatrix(double[][] matrix);
+}
diff --git a/src/beast/evolution/substitutionmodel/EmpiricalSubstitutionModel.java b/src/beast/evolution/substitutionmodel/EmpiricalSubstitutionModel.java
new file mode 100644
index 0000000..8505559
--- /dev/null
+++ b/src/beast/evolution/substitutionmodel/EmpiricalSubstitutionModel.java
@@ -0,0 +1,132 @@
+package beast.evolution.substitutionmodel;
+
+import beast.core.Description;
+import beast.core.Input.Validate;
+import beast.core.parameter.RealParameter;
+import beast.evolution.tree.Node;
+
+ at Description("A substitution model where the rates and frequencies are obtained from " +
+        "empirical evidence. Especially, amino acid models like WAG.")
+public abstract class EmpiricalSubstitutionModel extends GeneralSubstitutionModel {
+
+    public EmpiricalSubstitutionModel() {
+        frequenciesInput.setRule(Validate.OPTIONAL);
+        ratesInput.setRule(Validate.OPTIONAL);
+    }
+
+    double[] m_empiricalRates;
+
+    @Override
+    public void initAndValidate() throws Exception {
+        frequencies = getEmpericalFrequencieValues();
+        m_empiricalRates = getEmpericalRateValues();
+        int nFreqs = frequencies.getFreqs().length;
+        if (m_empiricalRates.length != nFreqs * (nFreqs - 1)) {
+            throw new Exception("The number of empirical rates (" + m_empiricalRates.length + ") should be " +
+                    "equal to #frequencies * (#frequencies-1) = (" + nFreqs + "*" + (nFreqs - 1) + ").");
+        }
+
+        updateMatrix = true;
+        nrOfStates = frequencies.getFreqs().length;
+        eigenSystem = createEigenSystem();
+        rateMatrix = new double[nrOfStates][nrOfStates];
+        relativeRates = new double[m_empiricalRates.length];
+        storedRelativeRates = new double[m_empiricalRates.length];
+    } // initAndValidate
+
+    @Override
+    protected void setupRelativeRates() {
+        System.arraycopy(m_empiricalRates, 0, relativeRates, 0, m_empiricalRates.length);
+    }
+
+
+    /**
+     * convert empirical rates into a RealParameter, only off diagonal entries are recorded *
+     */
+    double[] getEmpericalRateValues() throws Exception {
+        double[][] matrix = getEmpiricalRates();
+        int[] nOrder = getEncodingOrder();
+        int nStates = matrix.length;
+
+        double[] rates = new double[nStates * (nStates - 1)];
+        int k = 0;
+        for (int i = 0; i < nStates; i++) {
+            int u = nOrder[i];
+            for (int j = 0; j < nStates; j++) {
+                int v = nOrder[j];
+                if (i != j) {
+                    rates[k++] = matrix[Math.min(u, v)][Math.max(u, v)];
+                }
+            }
+        }
+        return rates;
+    }
+
+    /**
+     * convert empirical frequencies into a RealParameter *
+     */
+    Frequencies getEmpericalFrequencieValues() throws Exception {
+        double[] freqs = getEmpiricalFrequencies();
+        int[] nOrder = getEncodingOrder();
+        int nStates = freqs.length;
+        Frequencies freqsParam = new Frequencies();
+        String sValues = "";
+
+        for (int i = 0; i < nStates; i++) {
+            sValues += freqs[nOrder[i]] + " ";
+        }
+        RealParameter freqsRParam = new RealParameter();
+        freqsRParam.initByName(
+                "value", sValues,
+                "lower", 0.0,
+                "upper", 1.0,
+                "dimension", nStates
+        );
+        freqsParam.frequenciesInput.setValue(freqsRParam, freqsParam);
+        freqsParam.initAndValidate();
+        return freqsParam;
+    }
+
+
+    /**
+     * return rate matrix (ie two dimensional array) in upper diagonal form *
+     */
+    abstract double[][] getEmpiricalRates();
+
+    /**
+     * return empirical frequencies *
+     */
+    abstract double[] getEmpiricalFrequencies();
+
+    /**
+     * return character order for getEmpricialRates and getEmpriricalFrequencies
+     * // The rates may be specified assuming that the amino acids are in this order:
+     * // ARNDCQEGHILKMFPSTWYV
+     * // but the AminoAcids dataType wants them in this order:
+     * // ACDEFGHIKLMNPQRSTVWY
+     * // This method returns the proper order
+     */
+    abstract int[] getEncodingOrder();
+
+    @Override
+    public double[] getRateMatrix(Node node) {
+        double[][] matrix = getEmpiricalRates();
+        int nStates = matrix.length;
+        double[] rates = new double[nStates * nStates];
+        for (int i = 0; i < nStates; i++) {
+            for (int j = i + 1; j < nStates; j++) {
+                rates[i * nStates + j] = matrix[i][j];
+                rates[j * nStates + i] = matrix[i][j];
+            }
+        }
+        // determine diagonal
+        for (int i = 0; i < nStates; i++) {
+            double fSum = 0;
+            for (int j = i + 1; j < nStates; j++) {
+                fSum += rates[i * nStates + j];
+            }
+            rates[i * nStates + i] = -fSum;
+        }
+        return rates;
+    }
+}
diff --git a/src/beast/evolution/substitutionmodel/Frequencies.java b/src/beast/evolution/substitutionmodel/Frequencies.java
new file mode 100644
index 0000000..06ffe5b
--- /dev/null
+++ b/src/beast/evolution/substitutionmodel/Frequencies.java
@@ -0,0 +1,259 @@
+/*
+* File Frequencies.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+package beast.evolution.substitutionmodel;
+
+import java.util.Arrays;
+
+import beast.core.CalculationNode;
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.Input.Validate;
+import beast.core.parameter.RealParameter;
+import beast.core.util.Log;
+import beast.evolution.alignment.Alignment;
+import beast.evolution.datatype.DataType;
+
+
+
+// RRB: TODO: make this an interface?
+
+ at Description("Represents character frequencies typically used as distribution of the root of the tree. " +
+        "Calculates empirical frequencies of characters in sequence data, or simply assumes a uniform " +
+        "distribution if the estimate flag is set to false.")
+public class Frequencies extends CalculationNode {
+    public Input<Alignment> dataInput = new Input<Alignment>("data", "Sequence data for which frequencies are calculated");
+    public Input<Boolean> estimateInput = new Input<Boolean>("estimate", "Whether to estimate the frequencies from data (true=default) or assume a uniform distribution over characters (false)", true);
+    public Input<RealParameter> frequenciesInput = new Input<RealParameter>("frequencies", "A set of frequencies specified as space separated values summing to 1", Validate.XOR, dataInput);
+
+    /**
+     * contains frequency distribution *
+     */
+    protected double[] freqs;
+
+    /**
+     * flag to indicate m_fFreqs is up to date *
+     */
+    boolean needsUpdate;
+
+
+    @Override
+    public void initAndValidate() throws Exception {
+        update();
+        double fSum = getSumOfFrequencies(getFreqs());
+        // sanity check
+        if (Math.abs(fSum - 1.0) > 1e-6) {
+            throw new Exception("Frequencies do not add up to 1");
+        }
+
+    }
+
+    /**
+     * return up to date frequencies *
+     */
+    public double[] getFreqs() {
+        if (needsUpdate) {
+
+            update();
+        }
+
+        return freqs;
+    }
+
+    /**
+     * recalculate frequencies, unless it is fixed *
+     */
+    void update() {
+        if (frequenciesInput.get() != null) {
+
+            // if user specified, parse frequencies from space delimited string
+            freqs = new double[frequenciesInput.get().getDimension()];
+
+            for (int i = 0; i < freqs.length; i++) {
+                freqs[i] = frequenciesInput.get().getValue(i);
+            }
+
+
+        } else if (estimateInput.get()) { // if not user specified, either estimate from data or set as fixed
+            // estimate
+            estimateFrequencies();
+            checkFrequencies();
+        } else {
+            // uniformly distributed
+            int nStates = dataInput.get().getMaxStateCount();
+            freqs = new double[nStates];
+            for (int i = 0; i < nStates; i++) {
+                freqs[i] = 1.0 / nStates;
+            }
+        }
+        needsUpdate = false;
+    } // update
+
+
+    /**
+     * Estimate from sequence alignment.
+     * This version matches the implementation in Beast 1 & PAUP  *
+     */
+    void estimateFrequencies() {
+        Alignment alignment = dataInput.get();
+        DataType dataType = alignment.getDataType();
+        int stateCount = alignment.getMaxStateCount();
+
+        freqs = new double[stateCount];
+        Arrays.fill(freqs, 1.0 / stateCount);
+
+        int nAttempts = 0;
+        double fDifference;
+        do {
+            double[] fTmpFreq = new double[stateCount];
+
+            double fTotal = 0.0;
+            for (int i = 0; i < alignment.getPatternCount(); i++) {
+                int[] nPattern = alignment.getPattern(i);
+                double fWeight = alignment.getPatternWeight(i);
+
+                for (int iValue : nPattern) {
+                    int[] codes = dataType.getStatesForCode(iValue);
+
+                    double sum = 0.0;
+                    for (int iCode : codes) {
+                        sum += freqs[iCode];
+                    }
+
+                    for (int iCode : codes) {
+                        double fTmp = (freqs[iCode] * fWeight) / sum;
+                        fTmpFreq[iCode] += fTmp;
+                        fTotal += fTmp;
+                    }
+                }
+            }
+
+            fDifference = 0.0;
+            for (int i = 0; i < stateCount; i++) {
+                fDifference += Math.abs((fTmpFreq[i] / fTotal) - freqs[i]);
+                freqs[i] = fTmpFreq[i] / fTotal;
+            }
+            nAttempts++;
+        } while (fDifference > 1E-8 && nAttempts < 1000);
+
+//    	Alignment alignment = m_data.get();
+//        m_fFreqs = new double[alignment.getMaxStateCount()];
+//        for (int i = 0; i < alignment.getPatternCount(); i++) {
+//            int[] nPattern = alignment.getPattern(i);
+//            double fWeight = alignment.getPatternWeight(i);
+//            DataType dataType = alignment.getDataType();
+//            for (int iValue : nPattern) {
+//            	if (iValue < 4) {
+//            	int [] codes = dataType.getStatesForCode(iValue);
+//            	for (int iCode : codes) {
+//                    m_fFreqs[iCode] += fWeight / codes.length;
+//            	}
+//            	}
+////                if (iValue < m_fFreqs.length) { // ignore unknowns
+////                    m_fFreqs[iValue] += nWeight;
+////                }
+//            }
+//        }
+//        // normalize
+//        double fSum = 0;
+//        for (double f : m_fFreqs) {
+//            fSum += f;
+//        }
+//        for (int i = 0; i < m_fFreqs.length; i++) {
+//            m_fFreqs[i] /= fSum;
+//        }
+        Log.info.println("Starting frequencies: " + Arrays.toString(freqs));
+    } // calcFrequencies
+
+    /**
+     * Ensures that frequencies are not smaller than MINFREQ and
+     * that two frequencies differ by at least 2*MINFDIFF.
+     * This avoids potential problems later when eigenvalues
+     * are computed.
+     */
+    private void checkFrequencies() {
+        // required frequency difference
+        double MINFDIFF = 1.0E-10;
+
+        // lower limit on frequency
+        double MINFREQ = 1.0E-10;
+
+        int maxi = 0;
+        double sum = 0.0;
+        double maxfreq = 0.0;
+        for (int i = 0; i < freqs.length; i++) {
+            double freq = freqs[i];
+            if (freq < MINFREQ) freqs[i] = MINFREQ;
+            if (freq > maxfreq) {
+                maxfreq = freq;
+                maxi = i;
+            }
+            sum += freqs[i];
+        }
+        double diff = 1.0 - sum;
+        freqs[maxi] += diff;
+
+        for (int i = 0; i < freqs.length - 1; i++) {
+            for (int j = i + 1; j < freqs.length; j++) {
+                if (freqs[i] == freqs[j]) {
+                    freqs[i] += MINFDIFF;
+                    freqs[j] -= MINFDIFF;
+                }
+            }
+        }
+    } // checkFrequencies
+
+    /**
+     * CalculationNode implementation *
+     */
+    @Override
+    protected boolean requiresRecalculation() {
+        boolean recalculates = false;
+        if (frequenciesInput.get().somethingIsDirty()) {
+
+            needsUpdate = true;
+            recalculates = true;
+        }
+
+        return recalculates;
+    }
+
+    /**
+     * @param frequencies the frequencies
+     * @return return the sum of frequencies
+     */
+    private double getSumOfFrequencies(double[] frequencies) {
+        double total = 0.0;
+        for (double frequency : frequencies) {
+            total += frequency;
+        }
+        return total;
+    }
+
+    public void restore() {
+        needsUpdate = true;
+        super.restore();
+    }
+
+} // class Frequencies
diff --git a/src/beast/evolution/substitutionmodel/GTR.java b/src/beast/evolution/substitutionmodel/GTR.java
new file mode 100644
index 0000000..1c23cac
--- /dev/null
+++ b/src/beast/evolution/substitutionmodel/GTR.java
@@ -0,0 +1,94 @@
+package beast.evolution.substitutionmodel;
+
+import beast.core.Description;
+import beast.core.Function;
+import beast.core.Input;
+import beast.core.Input.Validate;
+import beast.core.parameter.RealParameter;
+import beast.evolution.datatype.DataType;
+import beast.evolution.datatype.Nucleotide;
+
+ at Description("General Time Reversible model of nucleotide evolution. " +
+        "Rates that are not specified are assumed to be 1. ")
+public class GTR extends GeneralSubstitutionModel {
+    public Input<Function> rateACInput = new Input<>("rateAC", "substitution rate for A to C (default 1)");
+    public Input<Function> rateAGInput = new Input<>("rateAG", "substitution rate for A to G (default 1)");
+    public Input<Function> rateATInput = new Input<>("rateAT", "substitution rate for A to T (default 1)");
+    public Input<Function> rateCGInput = new Input<>("rateCG", "substitution rate for C to G (default 1)");
+    public Input<Function> rateCTInput = new Input<>("rateCT", "substitution rate for C to T (default 1)");
+    public Input<Function> rateGTInput = new Input<>("rateGT", "substitution rate for G to T (default 1)");
+
+    Function rateAC;
+    Function rateAG;
+    Function rateAT;
+    Function rateCG;
+    Function rateCT;
+    Function rateGT;
+
+    public GTR() {
+        ratesInput.setRule(Validate.OPTIONAL);
+        try {
+        	ratesInput.setValue(null, this);
+        } catch (Exception e) {
+        	e.printStackTrace();
+			// TODO: handle exception
+		}
+    }
+
+    @Override
+    public void initAndValidate() throws Exception {
+        if (ratesInput.get() != null) {
+            throw new Exception("the rates attribute should not be used. Use the individual rates rateAC, rateCG, etc, instead.");
+        }
+
+        frequencies = frequenciesInput.get();
+        updateMatrix = true;
+        nrOfStates = frequencies.getFreqs().length;
+        if (nrOfStates != 4) {
+            throw new Exception("Frequencies has wrong size. Expected 4, but got " + nrOfStates);
+        }
+
+        eigenSystem = createEigenSystem();
+        rateMatrix = new double[nrOfStates][nrOfStates];
+        relativeRates = new double[nrOfStates * (nrOfStates - 1)];
+        storedRelativeRates = new double[nrOfStates * (nrOfStates - 1)];
+
+        rateAC = getParameter(rateACInput);
+        rateAG = getParameter(rateAGInput);
+        rateAT = getParameter(rateATInput);
+        rateCG = getParameter(rateCGInput);
+        rateCT = getParameter(rateCTInput);
+        rateGT = getParameter(rateGTInput);
+    }
+
+    private Function getParameter(Input<Function> parameterInput) throws Exception {
+        if (parameterInput.get() != null) {
+            return parameterInput.get();
+        }
+        return new RealParameter("1.0");
+    }
+
+    @Override
+    protected void setupRelativeRates() {
+        relativeRates[0] = rateAC.getArrayValue(); // A->C
+        relativeRates[1] = rateAG.getArrayValue(); // A->G
+        relativeRates[2] = rateAT.getArrayValue(); // A->T
+
+        relativeRates[3] = rateAC.getArrayValue(); // C->A
+        relativeRates[4] = rateCG.getArrayValue(); // C->G
+        relativeRates[5] = rateCT.getArrayValue(); // C->T
+
+        relativeRates[6] = rateAG.getArrayValue(); // G->A
+        relativeRates[7] = rateCG.getArrayValue(); // G->C
+        relativeRates[8] = rateGT.getArrayValue(); // G->T
+
+        relativeRates[9] = rateAT.getArrayValue(); // T->A
+        relativeRates[10] = rateCT.getArrayValue(); //T->C
+        relativeRates[11] = rateGT.getArrayValue(); //T->G
+    }
+
+    @Override
+    public boolean canHandleDataType(DataType dataType) {
+        return dataType instanceof Nucleotide;
+    }
+}
diff --git a/src/beast/evolution/substitutionmodel/GeneralSubstitutionModel.java b/src/beast/evolution/substitutionmodel/GeneralSubstitutionModel.java
new file mode 100644
index 0000000..a48861d
--- /dev/null
+++ b/src/beast/evolution/substitutionmodel/GeneralSubstitutionModel.java
@@ -0,0 +1,273 @@
+/*
+* File GeneralSubstitutionModel.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is not copyright Remco! It is copied from BEAST 1.
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+package beast.evolution.substitutionmodel;
+
+
+import java.lang.reflect.Constructor;
+
+import beast.core.Description;
+import beast.core.Function;
+import beast.core.Input;
+import beast.core.Input.Validate;
+import beast.evolution.datatype.DataType;
+import beast.evolution.tree.Node;
+
+
+
+ at Description("Specifies transition probability matrix with no restrictions on the rates other " +
+        "than that one of the is equal to one and the others are specified relative to " +
+        "this unit rate. Works for any number of states.")
+public class GeneralSubstitutionModel extends SubstitutionModel.Base {
+    public Input<Function> ratesInput =
+            new Input<Function>("rates", "Rate parameter which defines the transition rate matrix. " +
+                    "Only the off-diagonal entries need to be specified (diagonal makes row sum to zero in a " +
+                    "rate matrix). Entry i specifies the rate from floor(i/(n-1)) to i%(n-1)+delta where " +
+                    "n is the number of states and delta=1 if floor(i/(n-1)) >= i%(n-1) and 0 otherwise.", Validate.REQUIRED);
+
+    public Input<String> eigenSystemClass = new Input<String>("eigenSystem", "Name of the class used for creating an EigenSystem", DefaultEigenSystem.class.getName());
+    /**
+     * a square m_nStates x m_nStates matrix containing current rates  *
+     */
+    protected double[][] rateMatrix;
+
+
+    @Override
+    public void initAndValidate() throws Exception {
+        super.initAndValidate();
+        updateMatrix = true;
+        nrOfStates = frequencies.getFreqs().length;
+        if (ratesInput.get().getDimension() != nrOfStates * (nrOfStates - 1)) {
+            throw new Exception("Dimension of input 'rates' is " + ratesInput.get().getDimension() + " but a " +
+                    "rate matrix of dimension " + nrOfStates + "x" + (nrOfStates - 1) + "=" + nrOfStates * (nrOfStates - 1) + " was " +
+                    "expected");
+        }
+
+        eigenSystem = createEigenSystem();
+        //eigenSystem = new DefaultEigenSystem(m_nStates);
+
+        rateMatrix = new double[nrOfStates][nrOfStates];
+        relativeRates = new double[ratesInput.get().getDimension()];
+        storedRelativeRates = new double[ratesInput.get().getDimension()];
+    } // initAndValidate
+
+    /**
+     * create an EigenSystem of the class indicated by the eigenSystemClass input *
+     */
+    protected EigenSystem createEigenSystem() throws Exception {
+        Constructor<?>[] ctors = Class.forName(eigenSystemClass.get()).getDeclaredConstructors();
+        Constructor<?> ctor = null;
+        for (int i = 0; i < ctors.length; i++) {
+            ctor = ctors[i];
+            if (ctor.getGenericParameterTypes().length == 1)
+                break;
+        }
+        ctor.setAccessible(true);
+        return (EigenSystem) ctor.newInstance(nrOfStates);
+    }
+
+    protected double[] relativeRates;
+    protected double[] storedRelativeRates;
+
+    protected EigenSystem eigenSystem;
+
+    protected EigenDecomposition eigenDecomposition;
+    private EigenDecomposition storedEigenDecomposition;
+
+    protected boolean updateMatrix = true;
+    private boolean storedUpdateMatrix = true;
+
+    @Override
+    public void getTransitionProbabilities(Node node, double fStartTime, double fEndTime, double fRate, double[] matrix) {
+        double distance = (fStartTime - fEndTime) * fRate;
+
+        int i, j, k;
+        double temp;
+
+        // this must be synchronized to avoid being called simultaneously by
+        // two different likelihood threads - AJD
+        synchronized (this) {
+            if (updateMatrix) {
+                setupRelativeRates();
+                setupRateMatrix();
+                eigenDecomposition = eigenSystem.decomposeMatrix(rateMatrix);
+                updateMatrix = false;
+            }
+        }
+
+        // is the following really necessary?
+        // implemented a pool of iexp matrices to support multiple threads
+        // without creating a new matrix each call. - AJD
+        // a quick timing experiment shows no difference - RRB
+        double[] iexp = new double[nrOfStates * nrOfStates];
+        // Eigen vectors
+        double[] Evec = eigenDecomposition.getEigenVectors();
+        // inverse Eigen vectors
+        double[] Ievc = eigenDecomposition.getInverseEigenVectors();
+        // Eigen values
+        double[] Eval = eigenDecomposition.getEigenValues();
+        for (i = 0; i < nrOfStates; i++) {
+            temp = Math.exp(distance * Eval[i]);
+            for (j = 0; j < nrOfStates; j++) {
+                iexp[i * nrOfStates + j] = Ievc[i * nrOfStates + j] * temp;
+            }
+        }
+
+        int u = 0;
+        for (i = 0; i < nrOfStates; i++) {
+            for (j = 0; j < nrOfStates; j++) {
+                temp = 0.0;
+                for (k = 0; k < nrOfStates; k++) {
+                    temp += Evec[i * nrOfStates + k] * iexp[k * nrOfStates + j];
+                }
+
+                matrix[u] = Math.abs(temp);
+                u++;
+            }
+        }
+    } // getTransitionProbabilities
+
+    /**
+     * access to (copy of) rate matrix *
+     */
+    protected double[][] getRateMatrix() {
+        return rateMatrix.clone();
+    }
+
+    protected void setupRelativeRates() {
+        Function rates = this.ratesInput.get();
+        for (int i = 0; i < rates.getDimension(); i++) {
+            relativeRates[i] = rates.getArrayValue(i);
+        }
+    }
+
+    /**
+     * sets up rate matrix *
+     */
+    protected void setupRateMatrix() {
+        double[] fFreqs = frequencies.getFreqs();
+        for (int i = 0; i < nrOfStates; i++) {
+            rateMatrix[i][i] = 0;
+            for (int j = 0; j < i; j++) {
+                rateMatrix[i][j] = relativeRates[i * (nrOfStates - 1) + j];
+            }
+            for (int j = i + 1; j < nrOfStates; j++) {
+                rateMatrix[i][j] = relativeRates[i * (nrOfStates - 1) + j - 1];
+            }
+        }
+        // bring in frequencies
+        for (int i = 0; i < nrOfStates; i++) {
+            for (int j = i + 1; j < nrOfStates; j++) {
+                rateMatrix[i][j] *= fFreqs[j];
+                rateMatrix[j][i] *= fFreqs[i];
+            }
+        }
+        // set up diagonal
+        for (int i = 0; i < nrOfStates; i++) {
+            double fSum = 0.0;
+            for (int j = 0; j < nrOfStates; j++) {
+                if (i != j)
+                    fSum += rateMatrix[i][j];
+            }
+            rateMatrix[i][i] = -fSum;
+        }
+        // normalise rate matrix to one expected substitution per unit time
+        double fSubst = 0.0;
+        for (int i = 0; i < nrOfStates; i++)
+            fSubst += -rateMatrix[i][i] * fFreqs[i];
+
+        for (int i = 0; i < nrOfStates; i++) {
+            for (int j = 0; j < nrOfStates; j++) {
+                rateMatrix[i][j] = rateMatrix[i][j] / fSubst;
+            }
+        }
+    } // setupRateMatrix
+
+
+    /**
+     * CalculationNode implementation follows *
+     */
+    @Override
+    public void store() {
+        storedUpdateMatrix = updateMatrix;
+        storedEigenDecomposition = eigenDecomposition.copy();
+//        System.arraycopy(relativeRates, 0, storedRelativeRates, 0, relativeRates.length);
+
+        super.store();
+    }
+
+    /**
+     * Restore the additional stored state
+     */
+    @Override
+    public void restore() {
+
+        updateMatrix = storedUpdateMatrix;
+
+        // To restore all this stuff just swap the pointers...
+//        double[] tmp1 = storedRelativeRates;
+//        storedRelativeRates = relativeRates;
+//        relativeRates = tmp1;
+
+        EigenDecomposition tmp = storedEigenDecomposition;
+        storedEigenDecomposition = eigenDecomposition;
+        eigenDecomposition = tmp;
+        super.restore();
+
+    }
+
+    @Override
+    protected boolean requiresRecalculation() {
+        // we only get here if something is dirty
+        updateMatrix = true;
+        return true;
+    }
+
+
+    /**
+     * This function returns the Eigen vectors.
+     *
+     * @return the array
+     */
+    @Override
+    public EigenDecomposition getEigenDecomposition(Node node) {
+        synchronized (this) {
+            if (updateMatrix) {
+                setupRelativeRates();
+                setupRateMatrix();
+                eigenDecomposition = eigenSystem.decomposeMatrix(rateMatrix);
+                updateMatrix = false;
+            }
+        }
+        return eigenDecomposition;
+    }
+
+    @Override
+    public boolean canHandleDataType(DataType dataType) {
+        return dataType.getStateCount() != Integer.MAX_VALUE;
+    }
+
+} // class GeneralSubstitutionModel
diff --git a/src/beast/evolution/substitutionmodel/HKY.java b/src/beast/evolution/substitutionmodel/HKY.java
new file mode 100644
index 0000000..185f928
--- /dev/null
+++ b/src/beast/evolution/substitutionmodel/HKY.java
@@ -0,0 +1,270 @@
+/*
+* File HKY.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+package beast.evolution.substitutionmodel;
+
+import beast.core.Citation;
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.Input.Validate;
+import beast.core.parameter.RealParameter;
+import beast.evolution.datatype.DataType;
+import beast.evolution.datatype.Nucleotide;
+import beast.evolution.tree.Node;
+
+ at Description("HKY85 (Hasegawa, Kishino & Yano, 1985) substitution model of nucleotide evolution.")
+ at Citation(value =
+        "Hasegawa M, Kishino H, Yano T (1985) Dating the human-ape splitting by a\n"+
+                "  molecular clock of mitochondrial DNA. Journal of Molecular Evolution\n" +
+                "  22:160-174.", DOI = "10.1007/BF02101694", year = 1985, firstAuthorSurname = "hasegawa")
+public class HKY extends SubstitutionModel.NucleotideBase {
+    public Input<RealParameter> kappaInput = new Input<RealParameter>("kappa", "kappa parameter in HKY model", Validate.REQUIRED);
+
+    /**
+     * applies to nucleotides only *
+     */
+    public static final int STATE_COUNT = 4;
+
+    /**
+     * Eigenvalue decomposition of rate matrix + its stored version *
+     */
+    private EigenDecomposition eigenDecomposition = null;
+    private EigenDecomposition storedEigenDecomposition = null;
+
+    /**
+     * flag to indicate eigen decomposition is up to date *
+     */
+    private boolean updateEigen = true;
+    /**
+     * flag to indicate matrix is up to date *
+     */
+    protected boolean updateMatrix = true;
+
+    @Override
+    public void initAndValidate() throws Exception {
+        super.initAndValidate();
+        kappaInput.get().setBounds(Math.max(0.0, kappaInput.get().getLower()), kappaInput.get().getUpper());
+
+        nrOfStates = STATE_COUNT;
+    }
+
+    @Override
+    public void getTransitionProbabilities(Node node, double fStartTime, double fEndTime, double fRate, double[] matrix) {
+        double distance = (fStartTime - fEndTime) * fRate;
+
+        if (updateMatrix) {
+            setupMatrix();
+        }
+
+        final double xx = beta * distance;
+        final double bbR = Math.exp(xx * A_R);
+        final double bbY = Math.exp(xx * A_Y);
+
+        final double aa = Math.exp(xx);
+        final double oneminusa = 1 - aa;
+
+        final double t1Aaa = (tab1A * aa);
+        matrix[0] = freqA + t1Aaa + (tab2A * bbR);
+
+        matrix[1] = freqC * oneminusa;
+        final double t1Gaa = (tab1G * aa);
+        matrix[2] = freqG + t1Gaa - (tab3G * bbR);
+        matrix[3] = freqT * oneminusa;
+
+        matrix[4] = freqA * oneminusa;
+        final double t1Caa = (tab1C * aa);
+        matrix[5] = freqC + t1Caa + (tab2C * bbY);
+        matrix[6] = freqG * oneminusa;
+        final double t1Taa = (tab1T * aa);
+        matrix[7] = freqT + t1Taa - (tab3T * bbY);
+
+        matrix[8] = freqA + t1Aaa - (tab3A * bbR);
+        matrix[9] = matrix[1];
+        matrix[10] = freqG + t1Gaa + (tab2G * bbR);
+        matrix[11] = matrix[3];
+
+        matrix[12] = matrix[4];
+        matrix[13] = freqC + t1Caa - (tab3C * bbY);
+        matrix[14] = matrix[6];
+        matrix[15] = freqT + t1Taa + (tab2T * bbY);
+    }
+
+    @Override
+    public EigenDecomposition getEigenDecomposition(Node node) {
+
+        if (eigenDecomposition == null) {
+            double[] evec = new double[STATE_COUNT * STATE_COUNT];
+            double[] ivec = new double[STATE_COUNT * STATE_COUNT];
+            double[] eval = new double[STATE_COUNT];
+            eigenDecomposition = new EigenDecomposition(evec, ivec, eval);
+
+            ivec[2 * STATE_COUNT + 1] = 1; // left eigenvectors 3 = (0,1,0,-1); 4 = (1,0,-1,0)
+            ivec[2 * STATE_COUNT + 3] = -1;
+
+            ivec[3 * STATE_COUNT + 0] = 1;
+            ivec[3 * STATE_COUNT + 2] = -1;
+
+            evec[0 * STATE_COUNT + 0] = 1; // right eigenvector 1 = (1,1,1,1)'
+            evec[1 * STATE_COUNT + 0] = 1;
+            evec[2 * STATE_COUNT + 0] = 1;
+            evec[3 * STATE_COUNT + 0] = 1;
+
+            updateEigen = true;
+        }
+
+        if (updateEigen) {
+
+            double[] evec = eigenDecomposition.getEigenVectors();
+            double[] ivec = eigenDecomposition.getInverseEigenVectors();
+            double[] pi = frequencies.getFreqs();
+            double piR = pi[0] + pi[2];
+            double piY = pi[1] + pi[3];
+
+            // left eigenvector #1
+            ivec[0 * STATE_COUNT + 0] = pi[0]; // or, evec[0] = pi;
+            ivec[0 * STATE_COUNT + 1] = pi[1];
+            ivec[0 * STATE_COUNT + 2] = pi[2];
+            ivec[0 * STATE_COUNT + 3] = pi[3];
+
+            // left eigenvector #2
+            ivec[1 * STATE_COUNT + 0] = pi[0] * piY;
+            ivec[1 * STATE_COUNT + 1] = -pi[1] * piR;
+            ivec[1 * STATE_COUNT + 2] = pi[2] * piY;
+            ivec[1 * STATE_COUNT + 3] = -pi[3] * piR;
+
+            // right eigenvector #2
+            evec[0 * STATE_COUNT + 1] = 1.0 / piR;
+            evec[1 * STATE_COUNT + 1] = -1.0 / piY;
+            evec[2 * STATE_COUNT + 1] = 1.0 / piR;
+            evec[3 * STATE_COUNT + 1] = -1.0 / piY;
+
+            // right eigenvector #3
+            evec[1 * STATE_COUNT + 2] = pi[3] / piY;
+            evec[3 * STATE_COUNT + 2] = -pi[1] / piY;
+
+            // right eigenvector #4
+            evec[0 * STATE_COUNT + 3] = pi[2] / piR;
+            evec[2 * STATE_COUNT + 3] = -pi[0] / piR;
+
+            // eigenvectors
+            double[] eval = eigenDecomposition.getEigenValues();
+            final double k = kappaInput.get().getValue();
+
+            final double beta = -1.0 / (2.0 * (piR * piY + k * (pi[0] * pi[2] + pi[1] * pi[3])));
+            final double A_R = 1.0 + piR * (k - 1);
+            final double A_Y = 1.0 + piY * (k - 1);
+
+            eval[1] = beta;
+            eval[2] = beta * A_Y;
+            eval[3] = beta * A_R;
+
+            updateEigen = false;
+
+        }
+
+        return eigenDecomposition;
+    }
+
+    /**
+     * Used for precalculations
+     */
+    protected double beta, A_R, A_Y;
+    protected double tab1A, tab2A, tab3A;
+    protected double tab1C, tab2C, tab3C;
+    protected double tab1G, tab2G, tab3G;
+    protected double tab1T, tab2T, tab3T;
+
+    protected void setupMatrix() {
+
+        calculateFreqRY();
+
+        // small speed up - reduce calculations. Comments show original code
+
+        // (C+T) / (A+G)
+        final double r1 = (1 / freqR) - 1;
+        tab1A = freqA * r1;
+
+        tab3A = freqA / freqR;
+        tab2A = 1 - tab3A;        // (freqR-freqA)/freqR;
+
+        final double r2 = 1 / r1; // ((1 / freqY) - 1);
+        tab1C = freqC * r2;
+
+        tab3C = freqC / freqY;
+        tab2C = 1 - tab3C;       // (freqY-freqC)/freqY; assert  tab2C + tab3C == 1.0;
+
+        tab1G = freqG * r1;
+        tab3G = tab2A;            // 1 - tab3A; // freqG/freqR;
+        tab2G = tab3A;            // 1 - tab3G; // (freqR-freqG)/freqR;
+
+        tab1T = freqT * r2;
+
+        tab3T = tab2C;            // 1 - tab3C;  // freqT/freqY;
+        tab2T = tab3C;            // 1 - tab3T; // (freqY-freqT)/freqY; //assert tab2T + tab3T == 1.0 ;
+
+        final double k = kappaInput.get().getValue();
+        beta = -1.0 / (2.0 * (freqR * freqY + k * (freqA * freqG + freqC * freqT)));
+
+        A_R = 1.0 + freqR * (k - 1);
+        A_Y = 1.0 + freqY * (k - 1);
+
+        updateMatrix = false;
+    }
+
+
+    /**
+     * CalculationNode implementations *
+     */
+    @Override
+    protected boolean requiresRecalculation() {
+        // we only get here if something is dirty
+        updateMatrix = true;
+        updateEigen = true;
+        return true;
+    }
+
+    @Override
+    protected void store() {
+        if (eigenDecomposition != null) {
+            storedEigenDecomposition = eigenDecomposition.copy();
+        }
+        super.store();
+    }
+
+    @Override
+    protected void restore() {
+        updateMatrix = true;
+        updateEigen = true;
+        if (storedEigenDecomposition != null) {
+            eigenDecomposition = storedEigenDecomposition;
+        }
+        super.restore();
+    }
+
+    @Override
+    public boolean canHandleDataType(DataType dataType) {
+        return dataType instanceof Nucleotide;
+    }
+
+}
\ No newline at end of file
diff --git a/src/beast/evolution/substitutionmodel/JTT.java b/src/beast/evolution/substitutionmodel/JTT.java
new file mode 100644
index 0000000..beb5edb
--- /dev/null
+++ b/src/beast/evolution/substitutionmodel/JTT.java
@@ -0,0 +1,273 @@
+package beast.evolution.substitutionmodel;
+
+import beast.core.Description;
+import beast.evolution.datatype.Aminoacid;
+import beast.evolution.datatype.DataType;
+
+ at Description(" * JTT model for amino acid evolution " +
+        " D.T. Jones, W.R. Taylor, and J.M. Thornton " +
+        " The rapid generation of mutation data matrices from protein sequences " +
+        " CABIOS  vol. 8 no. 3 1992 pp. 275-282.")
+public class JTT extends EmpiricalSubstitutionModel {
+
+
+    @Override
+    double[][] getEmpiricalRates() {
+        double[][] rate = new double[20][20];
+
+        // Q matrix from Beast 1
+        rate[0][1] = 3.1628651460584e+00;
+        rate[0][2] = 3.2804935927860e+00;
+        rate[0][3] = 4.8477237048666e+00;
+        rate[0][4] = 3.4612244897959e+00;
+        rate[0][5] = 3.3130910900946e+00;
+        rate[0][6] = 6.3199473337722e+00;
+        rate[0][7] = 1.0440154440154e+01;
+        rate[0][8] = 1.3061224489796e+00;
+        rate[0][9] = 2.1726844583987e+00;
+        rate[0][10] = 1.8443597219107e+00;
+        rate[0][11] = 2.2137668626773e+00;
+        rate[0][12] = 2.7210884353741e+00;
+        rate[0][13] = 8.3265306122449e-01;
+        rate[0][14] = 1.1537414965986e+01;
+        rate[0][15] = 2.2838213546288e+01;
+        rate[0][16] = 2.7007955724663e+01;
+        rate[0][17] = 5.1311953352770e-01;
+        rate[0][18] = 8.3673469387755e-01;
+        rate[0][19] = 1.7474335188621e+01;
+
+        rate[1][2] = 2.6598918637222e+00;
+        rate[1][3] = 9.1014867485456e-01;
+        rate[1][4] = 6.1624649859944e+00;
+        rate[1][5] = 1.8036482885837e+01;
+        rate[1][6] = 1.8924731182796e+00;
+        rate[1][7] = 8.1810886516769e+00;
+        rate[1][8] = 1.9119717452198e+01;
+        rate[1][9] = 1.4410687351864e+00;
+        rate[1][10] = 2.2211961707760e+00;
+        rate[1][11] = 3.9239234676922e+01;
+        rate[1][12] = 2.5060690943044e+00;
+        rate[1][13] = 3.9439775910364e-01;
+        rate[1][14] = 4.1953094963476e+00;
+        rate[1][15] = 5.9016766126741e+00;
+        rate[1][16] = 3.8437069743152e+00;
+        rate[1][17] = 7.6766706682673e+00;
+        rate[1][18] = 1.4173669467787e+00;
+        rate[1][19] = 1.0308123249300e+00;
+
+        rate[2][3] = 3.2226935854843e+01;
+        rate[2][4] = 1.8710963455150e+00;
+        rate[2][5] = 4.5351268130622e+00;
+        rate[2][6] = 3.3951344979102e+00;
+        rate[2][7] = 4.5987249708180e+00;
+        rate[2][8] = 2.3693774375271e+01;
+        rate[2][9] = 2.9235880398671e+00;
+        rate[2][10] = 8.0960899565551e-01;
+        rate[2][11] = 1.5024269384537e+01;
+        rate[2][12] = 1.9003322259136e+00;
+        rate[2][13] = 4.3853820598007e-01;
+        rate[2][14] = 7.1083317047749e-01;
+        rate[2][15] = 2.9456208772690e+01;
+        rate[2][16] = 1.3735908553410e+01;
+        rate[2][17] = 1.6706217370669e-01;
+        rate[2][18] = 4.1661129568106e+00;
+        rate[2][19] = 9.7452934662237e-01;
+
+        rate[3][4] = 6.2857142857143e-01;
+        rate[3][5] = 3.0662020905923e+00;
+        rate[3][6] = 4.5450549450549e+01;
+        rate[3][7] = 7.5402435402435e+00;
+        rate[3][8] = 6.0544672718586e+00;
+        rate[3][9] = 6.8808114961961e-01;
+        rate[3][10] = 3.6130902064968e-01;
+        rate[3][11] = 1.6718197057180e+00;
+        rate[3][12] = 1.0879120879121e+00;
+        rate[3][13] = 1.9340659340659e-01;
+        rate[3][14] = 7.3949579831933e-01;
+        rate[3][15] = 3.4196528109572e+00;
+        rate[3][16] = 2.4749487800335e+00;
+        rate[3][17] = 3.4536891679749e-01;
+        rate[3][18] = 2.6895604395604e+00;
+        rate[3][19] = 1.8608058608059e+00;
+
+        rate[4][5] = 5.5191637630662e-01;
+        rate[4][6] = 3.2442396313364e-01;
+        rate[4][7] = 3.3297297297297e+00;
+        rate[4][8] = 4.3726708074534e+00;
+        rate[4][9] = 9.1868131868132e-01;
+        rate[4][10] = 9.9466248037677e-01;
+        rate[4][11] = 2.9830508474576e-01;
+        rate[4][12] = 2.4095238095238e+00;
+        rate[4][13] = 4.1485714285714e+00;
+        rate[4][14] = 7.3949579831933e-01;
+        rate[4][15] = 1.2862939958592e+01;
+        rate[4][16] = 2.8125907990315e+00;
+        rate[4][17] = 6.8244897959184e+00;
+        rate[4][18] = 1.2885714285714e+01;
+        rate[4][19] = 3.7714285714286e+00;
+
+        rate[5][6] = 2.0316061593796e+01;
+        rate[5][7] = 1.3922214897825e+00;
+        rate[5][8] = 3.3861536130889e+01;
+        rate[5][9] = 4.7172339855267e-01;
+        rate[5][10] = 4.2320327755868e+00;
+        rate[5][11] = 1.7835941652395e+01;
+        rate[5][12] = 2.6573751451800e+00;
+        rate[5][13] = 2.7595818815331e-01;
+        rate[5][14] = 9.4992143198743e+00;
+        rate[5][15] = 3.2350653941322e+00;
+        rate[5][16] = 3.0973838067678e+00;
+        rate[5][17] = 1.0512692882031e+00;
+        rate[5][18] = 1.5331010452962e+00;
+        rate[5][19] = 1.0778164924506e+00;
+
+        rate[6][7] = 6.6857641051189e+00;
+        rate[6][8] = 1.4458024443999e+00;
+        rate[6][9] = 6.7068415455512e-01;
+        rate[6][10] = 5.7932850559579e-01;
+        rate[6][11] = 1.0365070686558e+01;
+        rate[6][12] = 1.0138248847926e+00;
+        rate[6][13] = 2.6359447004608e-01;
+        rate[6][14] = 1.1291226167887e+00;
+        rate[6][15] = 1.8337006611901e+00;
+        rate[6][16] = 1.9520424900414e+00;
+        rate[6][17] = 6.9519420671494e-01;
+        rate[6][18] = 3.8018433179723e-01;
+        rate[6][19] = 2.7772657450077e+00;
+
+        rate[7][8] = 1.2113479939567e+00;
+        rate[7][9] = 3.2670032670033e-01;
+        rate[7][10] = 4.1817641817642e-01;
+        rate[7][11] = 1.6354950592239e+00;
+        rate[7][12] = 7.6447876447876e-01;
+        rate[7][13] = 3.0579150579151e-01;
+        rate[7][14] = 1.2391551215081e+00;
+        rate[7][15] = 1.1138492529797e+01;
+        rate[7][16] = 1.8888816176952e+00;
+        rate[7][17] = 3.3491450634308e+00;
+        rate[7][18] = 3.1853281853282e-01;
+        rate[7][19] = 2.8416988416988e+00;
+
+        rate[8][9] = 1.0931677018634e+00;
+        rate[8][10] = 3.2194389461470e+00;
+        rate[8][11] = 3.1498052426571e+00;
+        rate[8][12] = 1.9130434782609e+00;
+        rate[8][13] = 2.7329192546584e+00;
+        rate[8][14] = 6.7304834977469e+00;
+        rate[8][15] = 4.3726708074534e+00;
+        rate[8][16] = 2.8162964522581e+00;
+        rate[8][17] = 7.8083407275954e-01;
+        rate[8][18] = 3.5118012422360e+01;
+        rate[8][19] = 7.2877846790890e-01;
+
+        rate[9][10] = 1.4069798333535e+01;
+        rate[9][11] = 1.2292791953809e+00;
+        rate[9][12] = 2.8366300366300e+01;
+        rate[9][13] = 4.7384615384615e+00;
+        rate[9][14] = 5.8780435251023e-01;
+        rate[9][15] = 2.4105749323141e+00;
+        rate[9][16] = 1.5243062022723e+01;
+        rate[9][17] = 8.2888540031397e-01;
+        rate[9][18] = 1.8434065934066e+00;
+        rate[9][19] = 5.7699633699634e+01;
+
+        rate[10][11] = 8.8039805231089e-01;
+        rate[10][12] = 2.2425954997384e+01;
+        rate[10][13] = 1.5099529042386e+01;
+        rate[10][14] = 6.2626896912611e+00;
+        rate[10][15] = 3.4917298022888e+00;
+        rate[10][16] = 1.6109411169944e+00;
+        rate[10][17] = 3.2366001345593e+00;
+        rate[10][18] = 1.4505494505495e+00;
+        rate[10][19] = 1.0557823129252e+01;
+
+        rate[11][12] = 3.6577885391445e+00;
+        rate[11][13] = 1.4915254237288e-01;
+        rate[11][14] = 1.2868062479229e+00;
+        rate[11][15] = 2.8162964522581e+00;
+        rate[11][16] = 5.7494151926786e+00;
+        rate[11][17] = 5.4790729851263e-01;
+        rate[11][18] = 5.3268765133172e-01;
+        rate[11][19] = 7.4899112187248e-01;
+
+        rate[12][13] = 2.5666666666667e+00;
+        rate[12][14] = 9.4491129785247e-01;
+        rate[12][15] = 1.6397515527950e+00;
+        rate[12][16] = 1.2180790960452e+01;
+        rate[12][17] = 1.1972789115646e+00;
+        rate[12][18] = 1.1130952380952e+00;
+        rate[12][19] = 1.7746031746032e+01;
+
+        rate[13][14] = 8.8739495798319e-01;
+        rate[13][15] = 5.6298136645963e+00;
+        rate[13][16] = 8.3099273607748e-01;
+        rate[13][17] = 3.3224489795918e+00;
+        rate[13][18] = 3.3392857142857e+01;
+        rate[13][19] = 3.6000000000000e+00;
+
+        rate[14][15] = 1.6261762676085e+01;
+        rate[14][16] = 6.8852490148602e+00;
+        rate[14][17] = 4.2256902761104e-01;
+        rate[14][18] = 6.7787114845938e-01;
+        rate[14][19] = 1.2549019607843e+00;
+
+        rate[15][16] = 2.7891216619293e+01;
+        rate[15][17] = 1.8740017746229e+00;
+        rate[15][18] = 3.7349896480331e+00;
+        rate[15][19] = 2.4182194616977e+00;
+
+        rate[16][17] = 4.8702870978900e-01;
+        rate[16][18] = 1.1985472154964e+00;
+        rate[16][19] = 6.7925746569814e+00;
+
+        rate[17][18] = 4.6020408163265e+00;
+        rate[17][19] = 1.4693877551020e+00;
+
+        rate[18][19] = 1.0000000000000e+00;
+
+        return rate;
+    }
+
+    @Override
+    public double[] getEmpiricalFrequencies() {
+        double[] f = new double[20];
+        f[0] = 0.077;
+        f[1] = 0.051;
+        f[2] = 0.043;
+        f[3] = 0.052;
+        f[4] = 0.02;
+        f[5] = 0.041;
+        f[6] = 0.062;
+        f[7] = 0.074;
+        f[8] = 0.023;
+        f[9] = 0.052;
+        f[10] = 0.091;
+        f[11] = 0.059;
+        f[12] = 0.024;
+        f[13] = 0.04;
+        f[14] = 0.051;
+        f[15] = 0.069;
+        f[16] = 0.059;
+        f[17] = 0.014;
+        f[18] = 0.032;
+        f[19] = 0.066;
+        return f;
+    }
+
+    @Override
+    public int[] getEncodingOrder() {
+        Aminoacid dataType = new Aminoacid();
+        String sCodeMap = dataType.getCodeMap();
+        int[] nCodeMap = new int[dataType.getStateCount()];
+        String sEncoding = "ARNDCQEGHILKMFPSTWYV";
+        for (int i = 0; i < dataType.getStateCount(); i++) {
+            nCodeMap[i] = sEncoding.indexOf(sCodeMap.charAt(i));
+        }
+        return nCodeMap;
+    }
+
+    @Override
+    public boolean canHandleDataType(DataType dataType) {
+        return dataType instanceof Aminoacid;
+    }
+} // class WAG
diff --git a/src/beast/evolution/substitutionmodel/JukesCantor.java b/src/beast/evolution/substitutionmodel/JukesCantor.java
new file mode 100644
index 0000000..f289c8b
--- /dev/null
+++ b/src/beast/evolution/substitutionmodel/JukesCantor.java
@@ -0,0 +1,72 @@
+package beast.evolution.substitutionmodel;
+
+import beast.core.Description;
+import beast.core.Input.Validate;
+import beast.evolution.datatype.DataType;
+import beast.evolution.datatype.Nucleotide;
+import beast.evolution.tree.Node;
+
+import java.util.Arrays;
+
+ at Description("Jukes Cantor substitution model: all rates equal and " + "uniformly distributed frequencies")
+public class JukesCantor extends SubstitutionModel.Base {
+
+    public JukesCantor() {
+        // this is added to avoid a parsing error inherited from superclass because frequencies are not provided.
+        frequenciesInput.setRule(Validate.OPTIONAL);
+        try {
+            // this call will be made twice when constructed from XML
+            // but this ensures that the object is validly constructed for testing purposes.
+            initAndValidate();
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new RuntimeException("initAndValidate() call failed when constructing JukesCantor()");
+        }
+    }
+
+    double[] frequencies;
+    EigenDecomposition eigenDecomposition;
+
+    @Override
+    public void initAndValidate() throws Exception {
+        double[] eval = new double[]{0.0, -1.3333333333333333, -1.3333333333333333, -1.3333333333333333};
+        double[] evec = new double[]{1.0, 2.0, 0.0, 0.5, 1.0, -2.0, 0.5, 0.0, 1.0, 2.0, 0.0, -0.5, 1.0, -2.0, -0.5, 0.0};
+        double[] ivec = new double[]{0.25, 0.25, 0.25, 0.25, 0.125, -0.125, 0.125, -0.125, 0.0, 1.0, 0.0, -1.0, 1.0, 0.0, -1.0, 0.0};
+
+        eigenDecomposition = new EigenDecomposition(evec, ivec, eval);
+
+        if (frequenciesInput.get() != null) {
+            throw new RuntimeException("Frequencies must not be specified in Jukes-Cantor model. They are assumed equal.");
+        }
+
+        frequencies = new double[]{0.25, 0.25, 0.25, 0.25};
+    }
+
+    @Override
+    public double[] getFrequencies() {
+        return frequencies;
+    }
+
+    @Override
+    public void getTransitionProbabilities(Node node, double fStartTime, double fEndTime, double fRate, double[] matrix) {
+        double fDelta = 4.0 / 3.0 * (fStartTime - fEndTime);
+        double fPStay = (1.0 + 3.0 * Math.exp(-fDelta * fRate)) / 4.0;
+        double fPMove = (1.0 - Math.exp(-fDelta * fRate)) / 4.0;
+        // fill the matrix with move probabilities
+        Arrays.fill(matrix, fPMove);
+        // fill the diagonal
+        for (int i = 0; i < 4; i++) {
+            matrix[i * 5] = fPStay;
+        }
+    }
+
+    @Override
+    public EigenDecomposition getEigenDecomposition(Node node) {
+        return eigenDecomposition;
+    }
+
+    @Override
+    public boolean canHandleDataType(DataType dataType) {
+        return dataType instanceof Nucleotide;
+    }
+}
diff --git a/src/beast/evolution/substitutionmodel/MTREV.java b/src/beast/evolution/substitutionmodel/MTREV.java
new file mode 100644
index 0000000..f3b0884
--- /dev/null
+++ b/src/beast/evolution/substitutionmodel/MTREV.java
@@ -0,0 +1,279 @@
+package beast.evolution.substitutionmodel;
+
+import beast.core.Description;
+import beast.evolution.datatype.Aminoacid;
+import beast.evolution.datatype.DataType;
+
+ at Description("MTREV24 model of amino acid evolution " +
+        " (complete sequence data of mtDNA from 24 vertebrate species) " +
+        " Adachi, J., and Hasegawa, M. 1996. J. Mol. Evol. 42:459-468.")
+public class MTREV extends EmpiricalSubstitutionModel {
+
+
+    @Override
+    double[][] getEmpiricalRates() {
+        double[][] rate = new double[20][20];
+
+        // Q matrix from Beast 1
+        rate[0][1] = 1.2199217606346e+01;
+        rate[0][2] = 1.4182139942122e+01;
+        rate[0][3] = 9.2985091873208e+00;
+        rate[0][4] = 3.1542792981957e+01;
+        rate[0][5] = 1.0025852846688e+00;
+        rate[0][6] = 5.1418866803338e+00;
+        rate[0][7] = 6.3531246495131e+01;
+        rate[0][8] = 7.3137132861715e+00;
+        rate[0][9] = 5.0782382656186e+01;
+        rate[0][10] = 1.3399741808481e+01;
+        rate[0][11] = 4.4021672780560e+00;
+        rate[0][12] = 7.4673480520104e+01;
+        rate[0][13] = 3.3513021631978e+00;
+        rate[0][14] = 2.8582502221773e+01;
+        rate[0][15] = 2.0413623195312e+02;
+        rate[0][16] = 2.5301305153906e+02;
+        rate[0][17] = 1.0000000000000e+00;
+        rate[0][18] = 3.4084158197615e+00;
+        rate[0][19] = 1.0266468401249e+02;
+
+        rate[1][2] = 6.9661274444534e+00;
+        rate[1][3] = 1.0000000000000e+00;
+        rate[1][4] = 5.4384584796568e+01;
+        rate[1][5] = 1.1631134513343e+02;
+        rate[1][6] = 1.0000000000000e+00;
+        rate[1][7] = 1.2122831341194e+01;
+        rate[1][8] = 8.6961067087353e+01;
+        rate[1][9] = 1.0000000000000e+00;
+        rate[1][10] = 8.1976829394538e+00;
+        rate[1][11] = 7.4423215395318e+01;
+        rate[1][12] = 1.0000000000000e+00;
+        rate[1][13] = 2.4659158338099e+00;
+        rate[1][14] = 1.2439947713615e+01;
+        rate[1][15] = 3.1791814866372e+00;
+        rate[1][16] = 1.0935327216119e+00;
+        rate[1][17] = 1.1550775790126e+01;
+        rate[1][18] = 1.0000000000000e+00;
+        rate[1][19] = 4.0211417480338e+00;
+
+        rate[2][3] = 4.1809325468160e+02;
+        rate[2][4] = 3.1020979842967e+01;
+        rate[2][5] = 9.1349622725361e+01;
+        rate[2][6] = 3.3185663516310e+01;
+        rate[2][7] = 2.8052324651124e+01;
+        rate[2][8] = 2.6112087577885e+02;
+        rate[2][9] = 1.4261453863336e+01;
+        rate[2][10] = 7.9775653461977e+00;
+        rate[2][11] = 3.2036829276162e+02;
+        rate[2][12] = 3.4424354918739e+01;
+        rate[2][13] = 7.9996445145608e+00;
+        rate[2][14] = 3.8586541461044e+01;
+        rate[2][15] = 2.6020426225852e+02;
+        rate[2][16] = 1.2550758780474e+02;
+        rate[2][17] = 5.6207759736659e+00;
+        rate[2][18] = 1.0071406219571e+02;
+        rate[2][19] = 1.0000000000000e+00;
+
+        rate[3][4] = 1.0000000000000e+00;
+        rate[3][5] = 2.9097352675564e+01;
+        rate[3][6] = 3.0713149855302e+02;
+        rate[3][7] = 2.9877072751897e+01;
+        rate[3][8] = 5.9995408885817e+01;
+        rate[3][9] = 2.2827096245105e+00;
+        rate[3][10] = 1.0000000000000e+00;
+        rate[3][11] = 1.2183938185384e+00;
+        rate[3][12] = 1.0000000000000e+00;
+        rate[3][13] = 2.6221929413096e+00;
+        rate[3][14] = 7.0708004204733e+00;
+        rate[3][15] = 3.6327934317139e+01;
+        rate[3][16] = 1.4743408713748e+01;
+        rate[3][17] = 1.0453246057102e+01;
+        rate[3][18] = 1.1165627147496e+01;
+        rate[3][19] = 1.0000000000000e+00;
+
+        rate[4][5] = 3.9599394038972e+01;
+        rate[4][6] = 1.0000000000000e+00;
+        rate[4][7] = 1.6163581056674e+01;
+        rate[4][8] = 7.4467985406234e+01;
+        rate[4][9] = 3.3018175376623e+01;
+        rate[4][10] = 1.3500725995091e+01;
+        rate[4][11] = 1.0000000000000e+00;
+        rate[4][12] = 3.2504095376923e+00;
+        rate[4][13] = 3.7264767083096e+01;
+        rate[4][14] = 1.6454136037822e+01;
+        rate[4][15] = 1.4581783243113e+02;
+        rate[4][16] = 9.4720031458442e+01;
+        rate[4][17] = 1.7684087896962e+01;
+        rate[4][18] = 1.3409157685926e+02;
+        rate[4][19] = 1.0000000000000e+00;
+
+        rate[5][6] = 1.6503249008836e+02;
+        rate[5][7] = 3.5530760735494e+00;
+        rate[5][8] = 3.0652523140859e+02;
+        rate[5][9] = 4.3905393139325e+00;
+        rate[5][10] = 2.0895470525345e+01;
+        rate[5][11] = 2.4504076430724e+02;
+        rate[5][12] = 2.4931300477797e+01;
+        rate[5][13] = 1.0059428264289e+01;
+        rate[5][14] = 7.2256314165467e+01;
+        rate[5][15] = 2.8480937892158e+01;
+        rate[5][16] = 4.9962974409828e+01;
+        rate[5][17] = 1.0000000000000e+00;
+        rate[5][18] = 2.0430790980529e+01;
+        rate[5][19] = 9.9986289000676e+00;
+
+        rate[6][7] = 1.4884496769963e+01;
+        rate[6][8] = 2.5853576435567e+01;
+        rate[6][9] = 1.7418201388328e+00;
+        rate[6][10] = 1.0000000000000e+00;
+        rate[6][11] = 1.6519126809071e+02;
+        rate[6][12] = 1.0000000000000e+00;
+        rate[6][13] = 1.4067850525292e+00;
+        rate[6][14] = 6.7547121641947e+00;
+        rate[6][15] = 2.8794794140840e+01;
+        rate[6][16] = 7.8001372062558e+00;
+        rate[6][17] = 1.0000000000000e+00;
+        rate[6][18] = 6.9067239183061e+00;
+        rate[6][19] = 1.1127702362585e+01;
+
+        rate[7][8] = 1.0000000000000e+00;
+        rate[7][9] = 3.1466649021550e+00;
+        rate[7][10] = 1.2699794194865e+00;
+        rate[7][11] = 1.1962111069278e+01;
+        rate[7][12] = 1.0000000000000e+00;
+        rate[7][13] = 1.0000000000000e+00;
+        rate[7][14] = 1.0000000000000e+00;
+        rate[7][15] = 6.6277950574411e+01;
+        rate[7][16] = 5.8800079133028e+00;
+        rate[7][17] = 5.7494182626674e+00;
+        rate[7][18] = 1.6887657206208e+00;
+        rate[7][19] = 1.3320553471351e+00;
+
+        rate[8][9] = 6.4536986087271e+00;
+        rate[8][10] = 6.0472584534958e+00;
+        rate[8][11] = 6.7197196398961e+01;
+        rate[8][12] = 6.2977633277779e+00;
+        rate[8][13] = 2.5347805183364e+01;
+        rate[8][14] = 3.2089868698728e+01;
+        rate[8][15] = 4.0766987134407e+01;
+        rate[8][16] = 2.3570850628539e+01;
+        rate[8][17] = 3.7286635325194e+00;
+        rate[8][18] = 3.5270764890474e+02;
+        rate[8][19] = 1.0000000000000e+00;
+
+        rate[9][10] = 1.7320653206333e+02;
+        rate[9][11] = 1.0298655619743e+01;
+        rate[9][12] = 2.7262244199514e+02;
+        rate[9][13] = 4.4561065036310e+01;
+        rate[9][14] = 1.0856482766156e+01;
+        rate[9][15] = 2.5107659603898e+01;
+        rate[9][16] = 1.9391167162525e+02;
+        rate[9][17] = 1.0000000000000e+00;
+        rate[9][18] = 1.3161329199391e+01;
+        rate[9][19] = 6.4365086389428e+02;
+
+        rate[10][11] = 7.8314019154706e+00;
+        rate[10][12] = 2.8290920517725e+02;
+        rate[10][13] = 1.1371735519833e+02;
+        rate[10][14] = 2.1105885757279e+01;
+        rate[10][15] = 3.8741359395934e+01;
+        rate[10][16] = 6.6524559321657e+01;
+        rate[10][17] = 1.7071378554833e+01;
+        rate[10][18] = 2.3234516108847e+01;
+        rate[10][19] = 4.8247261078055e+01;
+
+        rate[11][12] = 4.8092094826036e+01;
+        rate[11][13] = 3.3887559483420e+00;
+        rate[11][14] = 2.6368577564199e+01;
+        rate[11][15] = 5.5679895711418e+01;
+        rate[11][16] = 7.1750284708933e+01;
+        rate[11][17] = 1.2631893872825e+01;
+        rate[11][18] = 2.6932728996777e+01;
+        rate[11][19] = 1.0000000000000e+00;
+
+        rate[12][13] = 4.7798798034572e+01;
+        rate[12][14] = 9.9165053447429e+00;
+        rate[12][15] = 5.8505442466161e+01;
+        rate[12][16] = 2.7798190504760e+02;
+        rate[12][17] = 1.1427000119701e+01;
+        rate[12][18] = 2.1029990530586e+01;
+        rate[12][19] = 2.0397078683768e+02;
+
+        rate[13][14] = 9.1089574817139e+00;
+        rate[13][15] = 3.3835737720574e+01;
+        rate[13][16] = 1.7815549567056e+01;
+        rate[13][17] = 4.1272404968214e+00;
+        rate[13][18] = 2.4504156395152e+02;
+        rate[13][19] = 3.3435675442163e+00;
+
+        rate[14][15] = 8.9421193040709e+01;
+        rate[14][16] = 6.7485067008375e+01;
+        rate[14][17] = 2.2161693733113e+00;
+        rate[14][18] = 8.5338209390745e+00;
+        rate[14][19] = 4.3342126659660e+00;
+
+        rate[15][16] = 3.1432036618746e+02;
+        rate[15][17] = 2.0305343047059e+01;
+        rate[15][18] = 3.4167877957799e+01;
+        rate[15][19] = 1.0000000000000e+00;
+
+        rate[16][17] = 5.2559565123081e+00;
+        rate[16][18] = 2.0382362288681e+01;
+        rate[16][19] = 1.0765527137500e+02;
+
+        rate[17][18] = 1.3814733274637e+01;
+        rate[17][19] = 2.8259139240676e+00;
+
+        rate[18][19] = 1.0000000000000e+00;
+
+        return rate;
+    }
+
+    @Override
+    public double[] getEmpiricalFrequencies() {
+        double[] f = new double[20];
+        f[0] = 0.072;
+        f[1] = 0.019;
+        f[2] = 0.039;
+        f[3] = 0.019;
+        f[4] = 0.006;
+        f[5] = 0.025;
+        f[6] = 0.024;
+        f[7] = 0.056;
+        f[8] = 0.028;
+        f[9] = 0.088;
+        f[10] = 0.168;
+        f[11] = 0.023;
+        f[12] = 0.054;
+        f[13] = 0.061;
+        f[14] = 0.054;
+        f[15] = 0.072;
+        f[16] = 0.086;
+        f[17] = 0.029;
+        f[18] = 0.033;
+        f[19] = 0.043;
+        double sum = 0;
+        for (double value : f) {
+            sum += value;
+        }
+        for (int i = 0; i < 20; i++) {
+            f[i] = f[i] / sum;
+        }
+        return f;
+    }
+
+    @Override
+    public int[] getEncodingOrder() {
+        Aminoacid dataType = new Aminoacid();
+        String sCodeMap = dataType.getCodeMap();
+        int[] nCodeMap = new int[dataType.getStateCount()];
+        String sEncoding = "ARNDCQEGHILKMFPSTWYV";
+        for (int i = 0; i < dataType.getStateCount(); i++) {
+            nCodeMap[i] = sEncoding.indexOf(sCodeMap.charAt(i));
+        }
+        return nCodeMap;
+    }
+
+    @Override
+    public boolean canHandleDataType(DataType dataType) {
+        return dataType instanceof Aminoacid;
+    }
+} // class WAG
diff --git a/src/beast/evolution/substitutionmodel/MutationDeathModel.java b/src/beast/evolution/substitutionmodel/MutationDeathModel.java
new file mode 100644
index 0000000..75b50de
--- /dev/null
+++ b/src/beast/evolution/substitutionmodel/MutationDeathModel.java
@@ -0,0 +1,103 @@
+package beast.evolution.substitutionmodel;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.Input.Validate;
+import beast.core.parameter.RealParameter;
+import beast.evolution.datatype.DataType;
+import beast.evolution.tree.Node;
+
+ at Description("Mutation Death substitution model, can be used as Stochastic Dollo model.")
+public class MutationDeathModel extends SubstitutionModel.Base {
+
+    public Input<RealParameter> delParameter = new Input<RealParameter>("deathprob", "rate of death, used to calculate death probability", Validate.REQUIRED);
+    // mutation rate is already provided in SiteModel, so no need to duplicate it here
+    //public Input<RealParameter> mutationRate = new Input<RealParameter>("mu", "mutation rate, default 1");
+    public Input<SubstitutionModel.Base> CTMCModelInput = new Input<SubstitutionModel.Base>("substmodel", "CTMC Model for the life states, so should have " +
+            "a state-space one less than this model. If not specified, ...");
+    // TODO: figure out the end of the last sentence
+
+    /**
+     * transition matrix for live states *
+     */
+    protected double[] trMatrix;
+    /**
+     * number of states *
+     */
+    int nrOfStates;
+
+    @Override
+    public void initAndValidate() throws Exception {
+        super.initAndValidate();
+        double[] freqs = getFrequencies();
+        nrOfStates = freqs.length;
+        trMatrix = new double[(nrOfStates - 1) * (nrOfStates - 1)];
+        if (CTMCModelInput.get() != null) {
+            if (CTMCModelInput.get().frequenciesInput.get().freqs.length != nrOfStates - 1) {
+                throw new Exception("substmodel does not have the correct state space: should be " + (nrOfStates - 1));
+            }
+        }
+    }
+
+    @Override
+    public EigenDecomposition getEigenDecomposition(Node node) {
+        return null;
+    }
+
+    @Override
+    public void getTransitionProbabilities(Node node, double fStartTime, double fEndTime, double fRate, double[] matrix) {
+        double distance = (fStartTime - fEndTime) * fRate;
+        int i, j;
+        // assuming that expected number of changes in CTMCModel is 1 per unit time
+        // we are contributing s*deathRate number of changes per unit of time
+        double deathProb = Math.exp(-distance * delParameter.get().getValue());
+        double mutationR = 2;
+//        if (mutationRate.get() != null) {
+//            mutationR *= mutationRate.get().getValue();
+//        }
+        double freqs[] = getFrequencies();
+
+        for (i = 0; i < freqs.length - 1; ++i) {
+            mutationR *= freqs[i];
+        }
+        SubstitutionModel.Base CTMCModel = CTMCModelInput.get();
+        if (CTMCModel != null) {
+            CTMCModel.getTransitionProbabilities(node, fStartTime, fEndTime, mutationR * fRate, trMatrix);
+        } else {
+            trMatrix[0] = 1.0;
+        }
+
+        for (i = 0; i < nrOfStates - 1; ++i) {
+            for (j = 0; j < nrOfStates - 1; j++) {
+                matrix[i * (nrOfStates) + j] = trMatrix[i * (nrOfStates - 1) + j] * deathProb;
+            }
+            matrix[i * (nrOfStates) + j] = (1.0 - deathProb);
+        }
+
+        for (j = 0; j < nrOfStates - 1; ++j) {
+            matrix[nrOfStates * (nrOfStates - 1) + j] = 0.0;
+        }
+
+        matrix[nrOfStates * nrOfStates - 1] = 1.0;
+    } // getTransitionProbabilities
+
+    /**
+     * CalculationNode implementation *
+     */
+    @Override
+    protected boolean requiresRecalculation() {
+        // we only get here if delParameter or mutationRate is dirty
+        return true;
+    }
+
+    @Override
+    public boolean canHandleDataType(DataType dataType) {
+    	if (CTMCModelInput.get() == null) {
+    		return dataType.getStateCount() == 2;
+    	} else {
+    		int states = CTMCModelInput.get().nrOfStates;
+    		return dataType.getStateCount() == states + 1;
+    	}
+    }
+
+} // class MutationDeathModel
diff --git a/src/beast/evolution/substitutionmodel/SYM.java b/src/beast/evolution/substitutionmodel/SYM.java
new file mode 100644
index 0000000..4ac1fff
--- /dev/null
+++ b/src/beast/evolution/substitutionmodel/SYM.java
@@ -0,0 +1,108 @@
+package beast.evolution.substitutionmodel;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.Input.Validate;
+import beast.core.parameter.RealParameter;
+import beast.evolution.datatype.DataType;
+import beast.evolution.datatype.Nucleotide;
+
+ at Description("Symmetrical model of nucleotide evolution with equal base frequencies." +
+        "Rates that are not specified are assumed to be 1.")
+public class SYM extends GeneralSubstitutionModel {
+    public Input<RealParameter> rateACInput = new Input<RealParameter>("rateAC", "substitution rate for A to C (default 1)");
+    public Input<RealParameter> rateAGInput = new Input<RealParameter>("rateAG", "substitution rate for A to G (default 1)");
+    public Input<RealParameter> rateATInput = new Input<RealParameter>("rateAT", "substitution rate for A to T (default 1)");
+    public Input<RealParameter> rateCGInput = new Input<RealParameter>("rateCG", "substitution rate for C to G (default 1)");
+    public Input<RealParameter> rateCTInput = new Input<RealParameter>("rateCT", "substitution rate for C to T (default 1)");
+    public Input<RealParameter> rateGTInput = new Input<RealParameter>("rateGT", "substitution rate for G to T (default 1)");
+
+    RealParameter rateAC;
+    RealParameter rateAG;
+    RealParameter rateAT;
+    RealParameter rateCG;
+    RealParameter rateCT;
+    RealParameter rateGT;
+
+    // For hardcoding equal base frequencies
+    //double[] frequencies;
+
+    public SYM() {
+        ratesInput.setRule(Validate.OPTIONAL);
+        try {
+            ratesInput.setValue(null, this);
+        } catch (Exception e) {
+            e.printStackTrace();
+            // TODO: handle exception
+        }
+
+        // Override the superclass SubstitutionModel.Base requirement for input frequencies, since they are equal in SYM
+        //frequenciesInput.setRule(Validate.OPTIONAL);
+        //try {
+        //    initAndValidate();
+        //} catch (Exception e) {
+        //    e.printStackTrace();
+        //    throw new RuntimeException("initAndValidate() call failed when constructing SYM()");
+        //}
+    }
+
+    @Override
+    public void initAndValidate() throws Exception {
+        if (ratesInput.get() != null) {
+            throw new Exception("the rates attribute should not be used. Use the individual rates rateAC, rateCG, etc, instead.");
+        }
+
+        //if (frequenciesInput.get() != null) {
+        //    throw new RuntimeException("Frequencies must not be specified in the SYM model. They are assumed equal.");
+        // }
+
+        // Set equal base frequencies
+        //frequencies = new double[]{0.25, 0.25, 0.25, 0.25};
+        frequencies = frequenciesInput.get();
+        updateMatrix = true;
+        nrOfStates = frequencies.getFreqs().length;
+
+        eigenSystem = createEigenSystem();
+        rateMatrix = new double[nrOfStates][nrOfStates];
+        relativeRates = new double[nrOfStates * (nrOfStates - 1)];
+        storedRelativeRates = new double[nrOfStates * (nrOfStates - 1)];
+
+        rateAC = getParameter(rateACInput);
+        rateAG = getParameter(rateAGInput);
+        rateAT = getParameter(rateATInput);
+        rateCG = getParameter(rateCGInput);
+        rateCT = getParameter(rateCTInput);
+        rateGT = getParameter(rateGTInput);
+    }
+
+    private RealParameter getParameter(Input<RealParameter> parameterInput) throws Exception {
+        if (parameterInput.get() != null) {
+            return parameterInput.get();
+        }
+        return new RealParameter("1.0");
+    }
+
+    @Override
+    protected void setupRelativeRates() {
+        relativeRates[0] = rateAC.getValue(); // A->C
+        relativeRates[1] = rateAG.getValue(); // A->G
+        relativeRates[2] = rateAT.getValue(); // A->T
+
+        relativeRates[3] = rateAC.getValue(); // C->A
+        relativeRates[4] = rateCG.getValue(); // C->G
+        relativeRates[5] = rateCT.getValue(); // C->T
+
+        relativeRates[6] = rateAG.getValue(); // G->A
+        relativeRates[7] = rateCG.getValue(); // G->C
+        relativeRates[8] = rateGT.getValue(); // G->T
+
+        relativeRates[9] = rateAT.getValue(); // T->A
+        relativeRates[10] = rateCT.getValue(); //T->C
+        relativeRates[11] = rateGT.getValue(); //T->G
+    }
+
+    @Override
+    public boolean canHandleDataType(DataType dataType) {
+        return dataType instanceof Nucleotide;
+    }
+}
diff --git a/src/beast/evolution/substitutionmodel/SubstitutionModel.java b/src/beast/evolution/substitutionmodel/SubstitutionModel.java
new file mode 100644
index 0000000..bdef250
--- /dev/null
+++ b/src/beast/evolution/substitutionmodel/SubstitutionModel.java
@@ -0,0 +1,172 @@
+/*
+* File SubstitutionModel.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+package beast.evolution.substitutionmodel;
+
+
+import beast.core.CalculationNode;
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.Input.Validate;
+import beast.evolution.datatype.DataType;
+import beast.evolution.tree.Node;
+
+
+ at Description("Specifies substitution model from which a transition probability matrix for a given " +
+        "distance can be obtained.")
+public interface SubstitutionModel {
+
+    /**
+     * get the complete transition probability matrix for the given distance
+     * determined as (fStartTime-fEndTime)*fRate
+     *
+     * @param node       tree node for which to calculate the probabilities
+     * @param fStartTime
+     * @param fEndTime   we assume start time is larger than end time
+     * @param fRate      rate, includes gamma rates and branch rates
+     * @param matrix     an array to store the matrix which represents the transition probability
+     *                   matrix in the form of an array. So, matrix must be of size n*n where n is number of states.
+     */
+    void getTransitionProbabilities(Node node, double fStartTime, double fEndTime, double fRate, double[] matrix);
+
+    /**
+     * @param node In most cases, the rate matrix is independent of the tree, but if it changes
+     *             throughout a tree, the node can provide this information.
+     * @return instantaneous rate matrix Q, where Q is flattened into an array
+     *         This is a square matrix, where rows add to zero, or null when no rate
+     *         matrix is available.
+     */
+    double[] getRateMatrix(Node node);
+
+    /**
+     * return frequencies for root distribution *
+     */
+    double[] getFrequencies();
+
+    public int getStateCount();
+
+
+    /**
+     * This function returns the Eigen decomposition of the instantaneous rate matrix if available.
+     * Such Eigen decomposition may not be available because the substitution model changes over time,
+     * for example, when one HKY model applies for some time t less than threshold time T while a GTR
+     * model applies when t >= T.
+     *
+     * @param node In most cases, the rate matrix, and thus the Eigen decomposition, is independent of the tree,
+     *             but if it changes throughout a tree, the node can provide this information.
+     * @return the EigenDecomposition, null if not available
+     */
+    EigenDecomposition getEigenDecomposition(Node node);
+
+    /**
+     * @return whether substitution model can return complex diagonalizations
+     *         If so, for example, a treelikelihood needs to be able to deal with this.
+     */
+    boolean canReturnComplexDiagonalization();
+
+    /**
+     * return true if this substitution model is suitable for the data type
+     */
+    boolean canHandleDataType(DataType dataType);
+
+    /**
+     * basic implementation of a SubstitutionModel bringing together relevant super class*
+     */
+    @Description(value = "Base implementation of a substitution model.", isInheritable = false)
+    public abstract class Base extends CalculationNode implements SubstitutionModel {
+        public Input<Frequencies> frequenciesInput =
+                new Input<Frequencies>("frequencies", "substitution model equilibrium state frequencies", Validate.REQUIRED);
+
+        /**
+         * shadows frequencies, or can be set by subst model *
+         */
+        protected Frequencies frequencies;
+
+        /**
+         * number of states *
+         */
+        protected int nrOfStates;
+
+        @Override
+        public void initAndValidate() throws Exception {
+            frequencies = frequenciesInput.get();
+        }
+
+        @Override
+        public double[] getFrequencies() {
+            return frequencies.getFreqs();
+        }
+
+        @Override
+        public int getStateCount() {
+            return nrOfStates;
+        }
+
+
+        @Override
+        public boolean canReturnComplexDiagonalization() {
+            return false;
+        }
+
+        @Override
+        public double[] getRateMatrix(Node node) {
+            return null;
+        }
+
+    } // class Base
+
+    /**
+     * basic implementation of a SubstitutionModel bringing together relevant super class*
+     */
+    @Description(value = "Base implementation of a nucleotide substitution model.", isInheritable = false)
+    public abstract class NucleotideBase extends Base {
+
+        public double freqA, freqC, freqG, freqT,
+        // A+G
+        freqR,
+        // C+T
+        freqY;
+
+
+        @Override
+        public int getStateCount() {
+            assert nrOfStates == 4;
+            return nrOfStates;
+        }
+
+        protected void calculateFreqRY() {
+            double[] freqs = frequencies.getFreqs();
+            freqA = freqs[0];
+            freqC = freqs[1];
+            freqG = freqs[2];
+            freqT = freqs[3];
+            freqR = freqA + freqG;
+            freqY = freqC + freqT;
+        }
+
+
+    } // class NucleotideBase
+
+
+} // class SubstitutionModel
diff --git a/src/beast/evolution/substitutionmodel/TIM.java b/src/beast/evolution/substitutionmodel/TIM.java
new file mode 100644
index 0000000..c131b73
--- /dev/null
+++ b/src/beast/evolution/substitutionmodel/TIM.java
@@ -0,0 +1,91 @@
+package beast.evolution.substitutionmodel;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.Input.Validate;
+import beast.core.parameter.RealParameter;
+import beast.evolution.datatype.DataType;
+import beast.evolution.datatype.Nucleotide;
+
+ at Description("Transition model of nucleotide evolution (variable transition rates, two transversion rates). " +
+        "Rates that are not specified are assumed to be 1.")
+public class TIM extends GeneralSubstitutionModel {
+
+    // Transition rates
+    public Input<RealParameter> rateAGInput = new Input<RealParameter>("rateAG", "substitution rate for A to G (default 1)");
+    public Input<RealParameter> rateCTInput = new Input<RealParameter>("rateCT", "substitution rate for C to T (default 1)");
+
+    // Transversion rates
+    public Input<RealParameter> rateTransversions1Input = new Input<RealParameter>("rateTransversions1", "substitution rate for A<->C and G<->T");
+    public Input<RealParameter> rateTransversions2Input = new Input<RealParameter>("rateTransversions2", "substitution rate for C<->G and A<->T");
+
+    RealParameter rateAG;
+    RealParameter rateCT;
+    RealParameter rateTransversions1;
+    RealParameter rateTransversions2;
+
+    public TIM() {
+        ratesInput.setRule(Validate.OPTIONAL);
+        try {
+            ratesInput.setValue(null, this);
+        } catch (Exception e) {
+            e.printStackTrace();
+            // TODO: handle exception
+        }
+    }
+
+    @Override
+    public void initAndValidate() throws Exception {
+        if (ratesInput.get() != null) {
+            throw new Exception("the rates attribute should not be used. Use the individual rates rateAG, rateCT, etc, instead.");
+        }
+
+        frequencies = frequenciesInput.get();
+        updateMatrix = true;
+        nrOfStates = frequencies.getFreqs().length;
+        if (nrOfStates != 4) {
+            throw new Exception("Frequencies has wrong size. Expected 4, but got " + nrOfStates);
+        }
+
+        eigenSystem = createEigenSystem();
+        rateMatrix = new double[nrOfStates][nrOfStates];
+        relativeRates = new double[nrOfStates * (nrOfStates - 1)];
+        storedRelativeRates = new double[nrOfStates * (nrOfStates - 1)];
+
+        rateAG = getParameter(rateAGInput);
+        rateCT = getParameter(rateCTInput);
+        rateTransversions1 = getParameter(rateTransversions1Input);
+        rateTransversions2 = getParameter(rateTransversions2Input);
+    }
+
+    private RealParameter getParameter(Input<RealParameter> parameterInput) throws Exception {
+        if (parameterInput.get() != null) {
+            return parameterInput.get();
+        }
+        return new RealParameter("1.0");
+    }
+
+    @Override
+    protected void setupRelativeRates() {
+        relativeRates[0] = rateTransversions1.getValue(); // A->C
+        relativeRates[1] = rateAG.getValue(); // A->G
+        relativeRates[2] = rateTransversions2.getValue(); // A->T
+
+        relativeRates[3] = rateTransversions1.getValue(); // C->A
+        relativeRates[4] = rateTransversions2.getValue(); // C->G
+        relativeRates[5] = rateCT.getValue(); // C->T
+
+        relativeRates[6] = rateAG.getValue(); // G->A
+        relativeRates[7] = rateTransversions2.getValue(); // G->C
+        relativeRates[8] = rateTransversions1.getValue(); // G->T
+
+        relativeRates[9] = rateTransversions2.getValue(); // T->A
+        relativeRates[10] = rateCT.getValue(); //T->C
+        relativeRates[11] = rateTransversions1.getValue(); //T->G
+    }
+
+    @Override
+    public boolean canHandleDataType(DataType dataType) {
+        return dataType instanceof Nucleotide;
+    }
+}
\ No newline at end of file
diff --git a/src/beast/evolution/substitutionmodel/TN93.java b/src/beast/evolution/substitutionmodel/TN93.java
new file mode 100644
index 0000000..150f6c3
--- /dev/null
+++ b/src/beast/evolution/substitutionmodel/TN93.java
@@ -0,0 +1,389 @@
+/*
+* File HKY.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+package beast.evolution.substitutionmodel;
+
+import beast.core.Citation;
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.Input.Validate;
+import beast.core.parameter.RealParameter;
+import beast.evolution.datatype.DataType;
+import beast.evolution.datatype.Nucleotide;
+import beast.evolution.tree.Node;
+
+
+/**
+ * Tamura and Nei model of nucleotide evolution.
+ * <p/>
+ * <p/>
+ * <p/>
+ * pr = p[0]+p[1]
+ * py = 1 - pr
+ * <p/>
+ * eigen values
+ * <p/>
+ * [0, -1, -(k[0]*pr + py), -(k[1]*py + pr)]
+ * <p/>
+ * unnormalized eigen vectors
+ * [1,1,1,1],
+ * [1,1,-pr/py,-pr/py],
+ * [1, -p[0]/p[1], 0, 0],
+ * [0, 0, 1,-p[2]/p[3]]
+ *
+ * @author Joseph Heled
+ * @author Alexei Drummond
+ * @author Marc Suchard
+ */
+
+ at Description("TN93 (Tamura and Nei, 1993) substitution model of nucleotide evolution.")
+ at Citation(value = "Tamura, K., & Nei, M. (1993). Estimation of the number of nucleotide substitutions in the control region " +
+        "of mitochondrial DNA in humans and chimpanzees. Molecular Biology and Evolution, 10(3), 512-526.", DOI = "", year = 1994, firstAuthorSurname = "tamura")
+public class TN93 extends SubstitutionModel.NucleotideBase {
+    public Input<RealParameter> kappa1Variable = new Input<RealParameter>("kappa1", "rate of A<->G transitions", Validate.REQUIRED);
+    public Input<RealParameter> kappa2Variable = new Input<RealParameter>("kappa2", "rate of C<->T transitions", Validate.REQUIRED);
+
+    private boolean updateIntermediates = true;
+
+    /**
+     * Used for precalculations
+     */
+    private double p1a;
+    private double p0a;
+    private double p3b;
+    private double p2b;
+    private double a;
+    private double b;
+    private double p1aa;
+    private double p0aa;
+    private double p3bb;
+    private double p2bb;
+    private double p1aIsa;
+    private double p0aIsa;
+    private double p3bIsb;
+    private double p2bIsb;
+    private double k1g;
+    private double k1a;
+    private double k2t;
+    private double k2c;
+    private double subrateScale;
+
+    /**
+     * applies to nucleotides only *
+     */
+    public static final int STATE_COUNT = 4;
+
+    /**
+     * Eigenvalue decomposition of rate matrix + its stored version *
+     */
+    private EigenDecomposition eigenDecomposition = null;
+    private EigenDecomposition storedEigenDecomposition = null;
+
+    /**
+     * flag to indicate eigen decomposition is up to date *
+     */
+    private boolean updateEigen = true;
+
+
+    @Override
+    public void initAndValidate() throws Exception {
+        super.initAndValidate();
+
+        kappa1Variable.get().setBounds(Math.max(0.0, kappa1Variable.get().getLower()), kappa1Variable.get().getUpper());
+        kappa2Variable.get().setBounds(Math.max(0.0, kappa2Variable.get().getLower()), kappa2Variable.get().getUpper());
+
+        nrOfStates = STATE_COUNT;
+
+        updateIntermediates = true;
+    }
+
+    /**
+     * @return kappa1
+     */
+    public final double getKappa1() {
+        return kappa1Variable.get().getValue(0);
+    }
+
+    /**
+     * @return kappa2
+     */
+    public final double getKappa2() {
+        return kappa2Variable.get().getValue(0);
+    }
+
+    /**
+     * get the complete transition probability matrix for the given distance.
+     * <p/>
+     * Based on work Joseph Heled did during his 691 project.
+     *
+     * @param matrix an array to store the matrix
+     */
+    public void getTransitionProbabilities(Node node, double fStartTime, double fEndTime, double fRate, double[] matrix) {
+
+        double distance = (fStartTime - fEndTime) * fRate;
+
+        synchronized (this) {
+            if (updateIntermediates) {
+                calculateIntermediates();
+            }
+        }
+
+        distance /= subrateScale;
+
+        double[] q = {
+                0, k1g, freqC, freqT,
+                k1a, 0, freqC, freqT,
+                freqA, freqG, 0, k2t,
+                freqA, freqG, k2c, 0
+        };
+
+        q[0] = -(q[1] + q[2] + q[3]);
+        q[5] = -(q[4] + q[6] + q[7]);
+        q[10] = -(q[8] + q[9] + q[11]);
+        q[15] = -(q[12] + q[13] + q[14]);
+
+        double[] fa0 = {
+                1 + q[0] - p1aa, q[1] + p1aa, q[2], q[3],
+                q[4] + p0aa, 1 + q[5] - p0aa, q[6], q[7],
+                q[8], q[9], 1 + q[10] - p3bb, q[11] + p3bb,
+                q[12], q[13], q[14] + p2bb, 1 + q[15] - p2bb
+        };
+
+
+        double[] fa1 = {
+                -q[0] + p1aIsa, -q[1] - p1aIsa, -q[2], -q[3],
+                -q[4] - p0aIsa, -q[5] + p0aIsa, -q[6], -q[7],
+                -q[8], -q[9], -q[10] + p3bIsb, -q[11] - p3bIsb,
+                -q[12], -q[13], -q[14] - p2bIsb, -q[15] + p2bIsb};
+
+        double et = Math.exp(-distance);
+
+        for (int k = 0; k < 16; ++k) {
+            fa1[k] = fa1[k] * et + fa0[k];
+        }
+
+        final double eta = Math.exp(distance * a);
+        final double etb = Math.exp(distance * b);
+
+        double za = eta / (a * (1 + a));
+        double zb = etb / (b * (1 + b));
+        double u0 = p1a * za;
+        double u1 = p0a * za;
+        double u2 = p3b * zb;
+        double u3 = p2b * zb;
+
+        fa1[0] += u0;
+        fa1[1] -= u0;
+        fa1[4] -= u1;
+        fa1[5] += u1;
+
+        fa1[10] += u2;
+        fa1[11] -= u2;
+        fa1[14] -= u3;
+        fa1[15] += u3;
+
+        // transpose 2 middle rows and columns
+        matrix[0] = fa1[0];
+        matrix[1] = fa1[2];
+        matrix[2] = fa1[1];
+        matrix[3] = fa1[3];
+        matrix[4] = fa1[8];
+        matrix[5] = fa1[10];
+        matrix[6] = fa1[9];
+        matrix[7] = fa1[11];
+        matrix[8] = fa1[4];
+        matrix[9] = fa1[6];
+        matrix[10] = fa1[5];
+        matrix[11] = fa1[7];
+        matrix[12] = fa1[12];
+        matrix[13] = fa1[14];
+        matrix[14] = fa1[13];
+        matrix[15] = fa1[15];
+
+        //System.arraycopy(fa1, 0, matrix, 0, 16);
+    }
+
+    public EigenDecomposition getEigenDecomposition(Node node) {
+
+        if (eigenDecomposition == null) {
+            double[] evec = new double[STATE_COUNT * STATE_COUNT];
+            double[] ivec = new double[STATE_COUNT * STATE_COUNT];
+            double[] eval = new double[STATE_COUNT];
+            eigenDecomposition = new EigenDecomposition(evec, ivec, eval);
+
+            ivec[2 * STATE_COUNT + 1] = 1; // left eigenvectors 3 = (0,1,0,-1); 4 = (1,0,-1,0)
+            ivec[2 * STATE_COUNT + 3] = -1;
+
+            ivec[3 * STATE_COUNT + 0] = 1;
+            ivec[3 * STATE_COUNT + 2] = -1;
+
+            evec[0 * STATE_COUNT + 0] = 1; // right eigenvector 1 = (1,1,1,1)'
+            evec[1 * STATE_COUNT + 0] = 1;
+            evec[2 * STATE_COUNT + 0] = 1;
+            evec[3 * STATE_COUNT + 0] = 1;
+
+            updateEigen = true;
+
+        }
+
+        if (updateEigen) {
+
+            double[] evec = eigenDecomposition.getEigenVectors();
+            double[] ivec = eigenDecomposition.getInverseEigenVectors();
+            double[] pi = frequencies.getFreqs();
+            double piR = pi[0] + pi[2];
+            double piY = pi[1] + pi[3];
+
+            // left eigenvector #1
+            ivec[0 * STATE_COUNT + 0] = pi[0]; // or, evec[0] = pi;
+            ivec[0 * STATE_COUNT + 1] = pi[1];
+            ivec[0 * STATE_COUNT + 2] = pi[2];
+            ivec[0 * STATE_COUNT + 3] = pi[3];
+
+            // left eigenvector #2
+            ivec[1 * STATE_COUNT + 0] = pi[0] * piY;
+            ivec[1 * STATE_COUNT + 1] = -pi[1] * piR;
+            ivec[1 * STATE_COUNT + 2] = pi[2] * piY;
+            ivec[1 * STATE_COUNT + 3] = -pi[3] * piR;
+
+            // right eigenvector #2
+            evec[0 * STATE_COUNT + 1] = 1.0 / piR;
+            evec[1 * STATE_COUNT + 1] = -1.0 / piY;
+            evec[2 * STATE_COUNT + 1] = 1.0 / piR;
+            evec[3 * STATE_COUNT + 1] = -1.0 / piY;
+
+            // right eigenvector #3
+            evec[1 * STATE_COUNT + 2] = pi[3] / piY;
+            evec[3 * STATE_COUNT + 2] = -pi[1] / piY;
+
+            // right eigenvector #4
+            evec[0 * STATE_COUNT + 3] = pi[2] / piR;
+            evec[2 * STATE_COUNT + 3] = -pi[0] / piR;
+
+            // eigenvectors
+            double[] eval = eigenDecomposition.getEigenValues();
+
+            final double kappa1 = getKappa1();
+            final double kappa2 = getKappa2();
+            final double beta = -1.0 / (2.0 * (piR * piY + kappa1 * pi[0] * pi[2] + kappa2 * pi[1] * pi[3]));
+            final double A_R = 1.0 + piR * (kappa1 - 1);
+            final double A_Y = 1.0 + piY * (kappa2 - 1);
+
+            eval[1] = beta;
+            eval[2] = beta * A_Y;
+            eval[3] = beta * A_R;
+
+            updateEigen = false;
+        }
+
+        return eigenDecomposition;
+    }
+
+    /**
+     * Used for precalculations
+     */
+    protected double beta;
+
+    private void calculateIntermediates() {
+
+        calculateFreqRY();
+
+        double k1 = getKappa1();
+        double k2 = getKappa2();
+
+//        System.out.println(getModelName() + " Using " + k1 + " " + k2);
+        // A hack until I get right this boundary case. gives results accurate to 1e-8 in the P matrix
+        // so should be OK even like this.
+        if (k1 == 1) {
+            k1 += 1E-10;
+        }
+        if (k2 == 1) {
+            k2 += 1e-10;
+        }
+
+        double l1 = k1 * k1 * freqR + k1 * (2 * freqY - 1) - freqY;
+        double l2 = k2 * k2 * freqY + k2 * (2 * freqR - 1) - freqR;
+
+        p1a = freqG * l1;
+        p0a = freqA * l1;
+        p3b = freqT * l2;
+        p2b = freqC * l2;
+
+        a = -(k1 * freqR + freqY);
+        b = -(k2 * freqY + freqR);
+
+        p1aa = p1a / a;
+        p0aa = p0a / a;
+        p3bb = p3b / b;
+        p2bb = p2b / b;
+
+        p1aIsa = p1a / (1 + a);
+        p0aIsa = p0a / (1 + a);
+        p3bIsb = p3b / (1 + b);
+        p2bIsb = p2b / (1 + b);
+
+        k1g = k1 * freqG;
+        k1a = k1 * freqA;
+        k2t = k2 * freqT;
+        k2c = k2 * freqC;
+
+        subrateScale = 2 * (k1 * freqA * freqG + k2 * freqC * freqT + freqR * freqY);
+        updateIntermediates = false;
+    }
+
+    /**
+     * CalculationNode implementations *
+     */
+    @Override
+    protected boolean requiresRecalculation() {
+        // we only get here if something is dirty
+        updateEigen = true;
+        updateIntermediates = true;
+        return true;
+    }
+
+    @Override
+    protected void store() {
+        if (eigenDecomposition != null) {
+            storedEigenDecomposition = eigenDecomposition.copy();
+        }
+        super.store();
+    }
+
+    @Override
+    protected void restore() {
+        updateEigen = true;
+        updateIntermediates = true;
+        if (storedEigenDecomposition != null) {
+            eigenDecomposition = storedEigenDecomposition;
+        }
+        super.restore();
+    }
+
+    @Override
+    public boolean canHandleDataType(DataType dataType) {
+        return dataType instanceof Nucleotide;
+    }
+
+}
\ No newline at end of file
diff --git a/src/beast/evolution/substitutionmodel/TVM.java b/src/beast/evolution/substitutionmodel/TVM.java
new file mode 100644
index 0000000..b69616b
--- /dev/null
+++ b/src/beast/evolution/substitutionmodel/TVM.java
@@ -0,0 +1,95 @@
+package beast.evolution.substitutionmodel;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.Input.Validate;
+import beast.core.parameter.RealParameter;
+import beast.evolution.datatype.DataType;
+import beast.evolution.datatype.Nucleotide;
+
+ at Description("Transversion model of nucleotide evolution (variable transversion rates, equal transition rates)." +
+        "Rates that are not specified are assumed to be 1.")
+public class TVM extends GeneralSubstitutionModel {
+
+    // Transversion rates
+    public Input<RealParameter> rateACInput = new Input<RealParameter>("rateAC", "substitution rate for A to C (default 1)");
+    public Input<RealParameter> rateATInput = new Input<RealParameter>("rateAT", "substitution rate for A to T (default 1)");
+    public Input<RealParameter> rateCGInput = new Input<RealParameter>("rateCG", "substitution rate for C to G (default 1)");
+    public Input<RealParameter> rateGTInput = new Input<RealParameter>("rateGT", "substitution rate for G to T (default 1)");
+
+    // Transition rates
+    public Input<RealParameter> rateTransitionsInput = new Input<RealParameter>("rateTransitions", "substitution rate for A<->G and C<->T");
+
+    RealParameter rateAC;
+    RealParameter rateGT;
+    RealParameter rateAT;
+    RealParameter rateCG;
+    RealParameter rateTransitions;
+
+    public TVM() {
+        ratesInput.setRule(Validate.OPTIONAL);
+        try {
+            ratesInput.setValue(null, this);
+        } catch (Exception e) {
+            e.printStackTrace();
+            // TODO: handle exception
+        }
+    }
+
+    @Override
+    public void initAndValidate() throws Exception {
+        if (ratesInput.get() != null) {
+            throw new Exception("the rates attribute should not be used. Use the individual rates rateAC, rateCG, etc, instead.");
+        }
+
+        frequencies = frequenciesInput.get();
+        updateMatrix = true;
+        nrOfStates = frequencies.getFreqs().length;
+        if (nrOfStates != 4) {
+            throw new Exception("Frequencies has wrong size. Expected 4, but got " + nrOfStates);
+        }
+
+        eigenSystem = createEigenSystem();
+        rateMatrix = new double[nrOfStates][nrOfStates];
+        relativeRates = new double[nrOfStates * (nrOfStates - 1)];
+        storedRelativeRates = new double[nrOfStates * (nrOfStates - 1)];
+
+        rateAC = getParameter(rateACInput);
+        rateAT = getParameter(rateATInput);
+        rateCG = getParameter(rateCGInput);
+        rateGT = getParameter(rateGTInput);
+
+        rateTransitions = getParameter(rateTransitionsInput);
+    }
+
+    private RealParameter getParameter(Input<RealParameter> parameterInput) throws Exception {
+        if (parameterInput.get() != null) {
+            return parameterInput.get();
+        }
+        return new RealParameter("1.0");
+    }
+
+    @Override
+    protected void setupRelativeRates() {
+        relativeRates[0] = rateAC.getValue(); // A->C
+        relativeRates[1] = rateTransitions.getValue(); // A->G
+        relativeRates[2] = rateAT.getValue(); // A->T
+
+        relativeRates[3] = rateAC.getValue(); // C->A
+        relativeRates[4] = rateCG.getValue(); // C->G
+        relativeRates[5] = rateTransitions.getValue(); // C->T
+
+        relativeRates[6] = rateTransitions.getValue(); // G->A
+        relativeRates[7] = rateCG.getValue(); // G->C
+        relativeRates[8] = rateGT.getValue(); // G->T
+
+        relativeRates[9] = rateAT.getValue(); // T->A
+        relativeRates[10] = rateTransitions.getValue(); //T->C
+        relativeRates[11] = rateGT.getValue(); //T->G
+    }
+
+    @Override
+    public boolean canHandleDataType(DataType dataType) {
+        return dataType instanceof Nucleotide;
+    }
+}
diff --git a/src/beast/evolution/substitutionmodel/WAG.java b/src/beast/evolution/substitutionmodel/WAG.java
new file mode 100644
index 0000000..6c1d795
--- /dev/null
+++ b/src/beast/evolution/substitutionmodel/WAG.java
@@ -0,0 +1,727 @@
+package beast.evolution.substitutionmodel;
+
+import beast.core.Description;
+import beast.evolution.datatype.Aminoacid;
+import beast.evolution.datatype.DataType;
+import beast.math.statistic.DiscreteStatistics;
+
+ at Description("WAG model of amino acid evolution by " +
+        "S. Whelan and N. Goldman. 2000. Bioinformatics ?.")
+
+public class WAG extends EmpiricalSubstitutionModel {
+
+    @Override
+    double[][] getEmpiricalRates() {
+        double[][] rate = new double[20][20];
+
+        // Q matrix from Beast 1
+        rate[0][1] = 0.610810;
+        rate[0][2] = 0.569079;
+        rate[0][3] = 0.821500;
+        rate[0][4] = 1.141050;
+        rate[0][5] = 1.011980;
+        rate[0][6] = 1.756410;
+        rate[0][7] = 1.572160;
+        rate[0][8] = 0.354813;
+        rate[0][9] = 0.219023;
+        rate[0][10] = 0.443935;
+        rate[0][11] = 1.005440;
+        rate[0][12] = 0.989475;
+        rate[0][13] = 0.233492;
+        rate[0][14] = 1.594890;
+        rate[0][15] = 3.733380;
+        rate[0][16] = 2.349220;
+        rate[0][17] = 0.125227;
+        rate[0][18] = 0.268987;
+        rate[0][19] = 2.221870;
+
+        rate[1][2] = 0.711690;
+        rate[1][3] = 0.165074;
+        rate[1][4] = 0.585809;
+        rate[1][5] = 3.360330;
+        rate[1][6] = 0.488649;
+        rate[1][7] = 0.650469;
+        rate[1][8] = 2.362040;
+        rate[1][9] = 0.206722;
+        rate[1][10] = 0.551450;
+        rate[1][11] = 5.925170;
+        rate[1][12] = 0.758446;
+        rate[1][13] = 0.116821;
+        rate[1][14] = 0.753467;
+        rate[1][15] = 1.357640;
+        rate[1][16] = 0.613776;
+        rate[1][17] = 1.294610;
+        rate[1][18] = 0.423612;
+        rate[1][19] = 0.280336;
+
+        rate[2][3] = 6.013660;
+        rate[2][4] = 0.296524;
+        rate[2][5] = 1.716740;
+        rate[2][6] = 1.056790;
+        rate[2][7] = 1.253910;
+        rate[2][8] = 4.378930;
+        rate[2][9] = 0.615636;
+        rate[2][10] = 0.147156;
+        rate[2][11] = 3.334390;
+        rate[2][12] = 0.224747;
+        rate[2][13] = 0.110793;
+        rate[2][14] = 0.217538;
+        rate[2][15] = 4.394450;
+        rate[2][16] = 2.257930;
+        rate[2][17] = 0.078463;
+        rate[2][18] = 1.208560;
+        rate[2][19] = 0.221176;
+
+        rate[3][4] = 0.033379;
+        rate[3][5] = 0.691268;
+        rate[3][6] = 6.833400;
+        rate[3][7] = 0.961142;
+        rate[3][8] = 1.032910;
+        rate[3][9] = 0.043523;
+        rate[3][10] = 0.093930;
+        rate[3][11] = 0.533362;
+        rate[3][12] = 0.116813;
+        rate[3][13] = 0.052004;
+        rate[3][14] = 0.472601;
+        rate[3][15] = 1.192810;
+        rate[3][16] = 0.417372;
+        rate[3][17] = 0.146348;
+        rate[3][18] = 0.363243;
+        rate[3][19] = 0.169417;
+
+        rate[4][5] = 0.109261;
+        rate[4][6] = 0.023920;
+        rate[4][7] = 0.341086;
+        rate[4][8] = 0.275403;
+        rate[4][9] = 0.189890;
+        rate[4][10] = 0.428414;
+        rate[4][11] = 0.083649;
+        rate[4][12] = 0.437393;
+        rate[4][13] = 0.441300;
+        rate[4][14] = 0.122303;
+        rate[4][15] = 1.560590;
+        rate[4][16] = 0.570186;
+        rate[4][17] = 0.795736;
+        rate[4][18] = 0.604634;
+        rate[4][19] = 1.114570;
+
+        rate[5][6] = 6.048790;
+        rate[5][7] = 0.366510;
+        rate[5][8] = 4.749460;
+        rate[5][9] = 0.131046;
+        rate[5][10] = 0.964886;
+        rate[5][11] = 4.308310;
+        rate[5][12] = 1.705070;
+        rate[5][13] = 0.110744;
+        rate[5][14] = 1.036370;
+        rate[5][15] = 1.141210;
+        rate[5][16] = 0.954144;
+        rate[5][17] = 0.243615;
+        rate[5][18] = 0.252457;
+        rate[5][19] = 0.333890;
+
+        rate[6][7] = 0.630832;
+        rate[6][8] = 0.635025;
+        rate[6][9] = 0.141320;
+        rate[6][10] = 0.172579;
+        rate[6][11] = 2.867580;
+        rate[6][12] = 0.353912;
+        rate[6][13] = 0.092310;
+        rate[6][14] = 0.755791;
+        rate[6][15] = 0.782467;
+        rate[6][16] = 0.914814;
+        rate[6][17] = 0.172682;
+        rate[6][18] = 0.217549;
+        rate[6][19] = 0.655045;
+
+        rate[7][8] = 0.276379;
+        rate[7][9] = 0.034151;
+        rate[7][10] = 0.068651;
+        rate[7][11] = 0.415992;
+        rate[7][12] = 0.194220;
+        rate[7][13] = 0.055288;
+        rate[7][14] = 0.273149;
+        rate[7][15] = 1.486700;
+        rate[7][16] = 0.251477;
+        rate[7][17] = 0.374321;
+        rate[7][18] = 0.114187;
+        rate[7][19] = 0.209108;
+
+        rate[8][9] = 0.152215;
+        rate[8][10] = 0.555096;
+        rate[8][11] = 0.992083;
+        rate[8][12] = 0.450867;
+        rate[8][13] = 0.756080;
+        rate[8][14] = 0.771387;
+        rate[8][15] = 0.822459;
+        rate[8][16] = 0.525511;
+        rate[8][17] = 0.289998;
+        rate[8][18] = 4.290350;
+        rate[8][19] = 0.131869;
+
+        rate[9][10] = 3.517820;
+        rate[9][11] = 0.360574;
+        rate[9][12] = 4.714220;
+        rate[9][13] = 1.177640;
+        rate[9][14] = 0.111502;
+        rate[9][15] = 0.353443;
+        rate[9][16] = 1.615050;
+        rate[9][17] = 0.234326;
+        rate[9][18] = 0.468951;
+        rate[9][19] = 8.659740;
+
+        rate[10][11] = 0.287583;
+        rate[10][12] = 5.375250;
+        rate[10][13] = 2.348200;
+        rate[10][14] = 0.462018;
+        rate[10][15] = 0.382421;
+        rate[10][16] = 0.364222;
+        rate[10][17] = 0.740259;
+        rate[10][18] = 0.443205;
+        rate[10][19] = 1.997370;
+
+        rate[11][12] = 1.032220;
+        rate[11][13] = 0.098843;
+        rate[11][14] = 0.619503;
+        rate[11][15] = 1.073780;
+        rate[11][16] = 1.537920;
+        rate[11][17] = 0.152232;
+        rate[11][18] = 0.147411;
+        rate[11][19] = 0.342012;
+
+        rate[12][13] = 1.320870;
+        rate[12][14] = 0.194864;
+        rate[12][15] = 0.556353;
+        rate[12][16] = 1.681970;
+        rate[12][17] = 0.570369;
+        rate[12][18] = 0.473810;
+        rate[12][19] = 2.282020;
+
+        rate[13][14] = 0.179896;
+        rate[13][15] = 0.606814;
+        rate[13][16] = 0.191467;
+        rate[13][17] = 1.699780;
+        rate[13][18] = 7.154480;
+        rate[13][19] = 0.725096;
+
+        rate[14][15] = 1.786490;
+        rate[14][16] = 0.885349;
+        rate[14][17] = 0.156619;
+        rate[14][18] = 0.239607;
+        rate[14][19] = 0.351250;
+
+        rate[15][16] = 4.847130;
+        rate[15][17] = 0.578784;
+        rate[15][18] = 0.872519;
+        rate[15][19] = 0.258861;
+
+        rate[16][17] = 0.126678;
+        rate[16][18] = 0.325490;
+        rate[16][19] = 1.547670;
+
+        rate[17][18] = 2.763540;
+        rate[17][19] = 0.409817;
+
+        rate[18][19] = 0.347826;
+
+        // Current (May 2011) version from http://www.ebi.ac.uk/goldman/WAG/index.html
+        //
+//			0.551571 
+//			0.509848  0.635346 
+//			0.738998  0.147304  5.429420 
+//			1.027040  0.528191  0.265256  0.0302949 
+//			0.908598  3.035500  1.543640  0.616783  0.0988179 
+//			1.582850  0.439157  0.947198  6.174160  0.021352  5.469470 
+//			1.416720  0.584665  1.125560  0.865584  0.306674  0.330052  0.567717 
+//			0.316954  2.137150  3.956290  0.930676  0.248972  4.294110  0.570025  0.249410 
+//			0.193335  0.186979  0.554236  0.039437  0.170135  0.113917  0.127395  0.0304501 0.138190 
+//			0.397915  0.497671  0.131528  0.0848047 0.384287  0.869489  0.154263  0.0613037 0.499462  3.170970 
+//			0.906265  5.351420  3.012010  0.479855  0.0740339 3.894900  2.584430  0.373558  0.890432  0.323832  0.257555 
+//			0.893496  0.683162  0.198221  0.103754  0.390482  1.545260  0.315124  0.174100  0.404141  4.257460  4.854020  0.934276 
+//			0.210494  0.102711  0.0961621 0.0467304 0.398020  0.0999208 0.0811339 0.049931  0.679371  1.059470  2.115170  0.088836  1.190630 
+//			1.438550  0.679489  0.195081  0.423984  0.109404  0.933372  0.682355  0.243570  0.696198  0.0999288 0.415844  0.556896  0.171329  0.161444 
+//			3.370790  1.224190  3.974230  1.071760  1.407660  1.028870  0.704939  1.341820  0.740169  0.319440  0.344739  0.967130  0.493905  0.545931  1.613280 
+//			2.121110  0.554413  2.030060  0.374866  0.512984  0.857928  0.822765  0.225833  0.473307  1.458160  0.326622  1.386980  1.516120  0.171903  0.795384  4.378020 
+//			0.113133  1.163920  0.0719167 0.129767  0.717070  0.215737  0.156557  0.336983  0.262569  0.212483  0.665309  0.137505  0.515706  1.529640  0.139405  0.523742  0.110864 
+//			0.240735  0.381533  1.086000  0.325711  0.543833  0.227710  0.196303  0.103604  3.873440  0.420170  0.398618  0.133264  0.428437  6.454280  0.216046  0.786993  0.291148  2.485390 
+//			2.006010  0.251849  0.196246  0.152335  1.002140  0.301281  0.588731  0.187247  0.118358  7.821300  1.800340  0.305434  2.058450  0.649892  0.314887  0.232739  1.388230  0.365369  0.314730 
+        //
+//			0.0866279 0.043972  0.0390894 0.0570451 0.0193078 0.0367281 0.0580589 0.0832518 0.0244313 0.048466  0.086209  0.0620286 0.0195027 0.0384319 0.0457631 0.0695179 0.0610127 0.0143859 0.0352742 0.0708956
+        //
+        //
+//			 A   R   N   D   C   Q   E   G   H   I   L   K   M   F   P   S   T   W   Y   V
+//			Ala Arg Asn Asp Cys Gln Glu Gly His Ile Leu Lys Met Phe Pro Ser Thr Trp Tyr Val
+        //
+//			  
+//				Symmetrical part of the WAG rate matrix and aa frequencies,
+//			estimated from 3905 globular protein amino acid sequences forming 182
+//			protein families.
+//				The first part above indicates the symmetric 'exchangeability'
+//			parameters, where s_ij = s_ji.  The s_ij above are not scaled, but the
+//			PAML package will perform this scaling.
+//				The second part gives the amino acid frequencies (pi_i)
+//			estimated from the 3905 sequences.  The net replacement rate from i to
+//			j is Q_ij = s_ij*pi_j.
+//				Prepared by Simon Whelan and Nick Goldman, December 2000.
+        //
+//			Citation:
+//			Whelan, S. and N. Goldman.  2001.  A general empirical model of
+//				protein evolution derived from multiple protein families using
+//				a maximum likelihood approach.  Molecular Biology and
+//				Evolution 18:691-699.
+
+/*
+		// Q matrix
+		rate[0][1] = 0.551571; rate[0][2] = 0.509848; 
+		rate[0][3] = 0.738998; rate[0][4] = 1.027040; 
+		rate[0][5] = 0.908598; rate[0][6] = 1.582850; 
+		rate[0][7] = 1.416720; rate[0][8] = 0.316954; 
+		rate[0][9] = 0.193335; rate[0][10] = 0.397915; 
+		rate[0][11] = 0.906265; rate[0][12] = 0.893496; 
+		rate[0][13] = 0.210494; rate[0][14] = 1.438550; 
+		rate[0][15] = 3.370790; rate[0][16] = 2.121110; 
+		rate[0][17] = 0.113133; rate[0][18] = 0.240735; 
+		rate[0][19] = 2.006010; 
+
+		rate[0][1] = 0.551571;rate[0][2] = 0.509848;
+		rate[0][3] = 0.738998;rate[0][4] = 1.027040;
+		rate[0][5] = 0.908598;rate[0][6] = 1.582850;
+		rate[0][7] = 1.416720;rate[0][8] = 0.316954;
+		rate[0][9] = 0.193335;rate[0][10] = 0.397915;
+		rate[0][11] = 0.906265;rate[0][12] = 0.893496;
+		rate[0][13] = 0.210494;rate[0][14] = 1.438550;
+		rate[0][15] = 3.370790;rate[0][16] = 2.121110;
+		rate[0][17] = 0.113133;rate[0][18] = 0.240735;
+		rate[0][19] = 2.006010;
+
+		rate[1][2] = 0.635346;rate[1][3] = 0.147304;
+		rate[1][4] = 0.528191;rate[1][5] = 3.0355;
+		rate[1][6] = 0.439157;rate[1][7] = 0.584665;
+		rate[1][8] = 2.13715;rate[1][9] = 0.186979;
+		rate[1][10] = 0.497671;rate[1][11] = 5.35142;
+		rate[1][12] = 0.683162;rate[1][13] = 0.102711;
+		rate[1][14] = 0.679489;rate[1][15] = 1.22419;
+		rate[1][16] = 0.554413;rate[1][17] = 1.16392;
+		rate[1][18] = 0.381533;rate[1][19] = 0.251849;
+
+
+		rate[2][3] = 5.42942;rate[2][4] = 0.265256;
+		rate[2][5] = 1.54364;rate[2][6] = 0.947198;
+		rate[2][7] = 1.12556;rate[2][8] = 3.95629;
+		rate[2][9] = 0.554236;rate[2][10] = 0.131528;
+		rate[2][11] = 3.01201;rate[2][12] = 0.198221;
+		rate[2][13] = 0.0961621;rate[2][14] = 0.195081;
+		rate[2][15] = 3.97423;rate[2][16] = 2.03006;
+		rate[2][17] = 0.0719167;rate[2][18] = 1.086;
+		rate[2][19] = 0.196246;
+
+		rate[3][4] = 0.0302949;rate[3][5] = 0.616783;
+		rate[3][6] = 6.17416;rate[3][7] = 0.865584;
+		rate[3][8] = 0.930676;rate[3][9] = 0.039437;
+		rate[3][10] = 0.0848047;rate[3][11] = 0.479855;
+		rate[3][12] = 0.103754;rate[3][13] = 0.0467304;
+		rate[3][14] = 0.423984;rate[3][15] = 1.07176;
+		rate[3][16] = 0.374866;rate[3][17] = 0.129767;
+		rate[3][18] = 0.325711;rate[3][19] = 0.152335;
+
+
+		rate[4][5] = 0.0988179;rate[4][6] = 0.021352;
+		rate[4][7] = 0.306674;rate[4][8] = 0.248972;
+		rate[4][9] = 0.170135;rate[4][10] = 0.384287;
+		rate[4][11] = 0.0740339;rate[4][12] = 0.390482;
+		rate[4][13] = 0.39802;rate[4][14] = 0.109404;
+		rate[4][15] = 1.40766;rate[4][16] = 0.512984;
+		rate[4][17] = 0.71707;rate[4][18] = 0.543833;
+		rate[4][19] = 1.00214;
+
+		rate[5][6] = 5.46947;rate[5][7] = 0.330052;
+		rate[5][8] = 4.29411;rate[5][9] = 0.113917;
+		rate[5][10] = 0.869489;rate[5][11] = 3.8949;
+		rate[5][12] = 1.54526;rate[5][13] = 0.0999208;
+		rate[5][14] = 0.933372;rate[5][15] = 1.02887;
+		rate[5][16] = 0.857928;rate[5][17] = 0.215737;
+		rate[5][18] = 0.22771;rate[5][19] = 0.301281;
+
+
+		rate[6][7] = 0.567717;rate[6][8] = 0.570025;
+		rate[6][9] = 0.127395;rate[6][10] = 0.154263;
+		rate[6][11] = 2.58443;rate[6][12] = 0.315124;
+		rate[6][13] = 0.0811339;rate[6][14] = 0.682355;
+		rate[6][15] = 0.704939;rate[6][16] = 0.822765;
+		rate[6][17] = 0.156557;rate[6][18] = 0.196303;
+		rate[6][19] = 0.588731;
+
+		rate[7][8] = 0.24941;rate[7][9] = 0.0304501;
+		rate[7][10] = 0.0613037;rate[7][11] = 0.373558;
+		rate[7][12] = 0.1741;rate[7][13] = 0.049931;
+		rate[7][14] = 0.24357;rate[7][15] = 1.34182;
+		rate[7][16] = 0.225833;rate[7][17] = 0.336983;
+		rate[7][18] = 0.103604;rate[7][19] = 0.187247;
+
+
+		rate[8][9] = 0.13819;rate[8][10] = 0.499462;
+		rate[8][11] = 0.890432;rate[8][12] = 0.404141;
+		rate[8][13] = 0.679371;rate[8][14] = 0.696198;
+		rate[8][15] = 0.740169;rate[8][16] = 0.473307;
+		rate[8][17] = 0.262569;rate[8][18] = 3.87344;
+		rate[8][19] = 0.118358;
+
+		rate[9][10] = 3.17097;rate[9][11] = 0.323832;
+		rate[9][12] = 4.25746;rate[9][13] = 1.05947;
+		rate[9][14] = 0.0999288;rate[9][15] = 0.31944;
+		rate[9][16] = 1.45816;rate[9][17] = 0.212483;
+		rate[9][18] = 0.42017;rate[9][19] = 7.8213;
+
+
+		rate[10][11] = 0.257555;rate[10][12] = 4.85402;
+		rate[10][13] = 2.11517;rate[10][14] = 0.415844;
+		rate[10][15] = 0.344739;rate[10][16] = 0.326622;
+		rate[10][17] = 0.665309;rate[10][18] = 0.398618;
+		rate[10][19] = 1.80034;
+
+		rate[11][12] = 0.934276;rate[11][13] = 0.088836;
+		rate[11][14] = 0.556896;rate[11][15] = 0.96713;
+		rate[11][16] = 1.38698;rate[11][17] = 0.137505;
+		rate[11][18] = 0.133264;rate[11][19] = 0.305434;
+
+
+		rate[12][13] = 1.19063;rate[12][14] = 0.171329;
+		rate[12][15] = 0.493905;rate[12][16] = 1.51612;
+		rate[12][17] = 0.515706;rate[12][18] = 0.428437;
+		rate[12][19] = 2.05845;
+
+		rate[13][14] = 0.161444;rate[13][15] = 0.545931;
+		rate[13][16] = 0.171903;rate[13][17] = 1.52964;
+		rate[13][18] = 6.45428;rate[13][19] = 0.649892;
+
+
+		rate[14][15] = 1.61328;rate[14][16] = 0.795384;
+		rate[14][17] = 0.139405;rate[14][18] = 0.216046;
+		rate[14][19] = 0.314887;
+
+		rate[15][16] = 4.37802;rate[15][17] = 0.523742;
+		rate[15][18] = 0.786993;rate[15][19] = 0.232739;
+
+
+		rate[16][17] = 0.110864;rate[16][18] = 0.291148;
+		rate[16][19] = 1.38823;
+
+		rate[17][18] = 2.48539;rate[17][19] = 0.365369;
+
+
+		rate[18][19] = 0.31473;
+*/
+
+
+////        WAG* matrix, a variant of the WAG matrix from the same paper
+////		
+////		0.589718 
+////		0.514347  0.67416 
+////		0.731152  0.159054  5.30821 
+////		1.21324   0.568449  0.233527   0.0379056 
+////		1.03344   3.02808   1.62299    0.657364   0.0999068 
+////		1.55788   0.443685  1.00122    6.04299    0.0284956  5.6037 
+////		1.41993   0.629768  1.12717    0.88357    0.312544   0.346823  0.588609 
+////		0.317684  2.31211   3.9337     0.958529   0.341479   4.87366   0.599188   0.279542 
+////		0.214596  0.187262  0.527321   0.0390513  0.198958   0.125999  0.124553   0.0310522  0.162975 
+////		0.400822  0.51821   0.144354   0.0869637  0.451124   0.873266  0.154936   0.067443   0.508952  3.1554 
+////		0.881639  5.74119   2.88102    0.480308   0.0719929  4.19125   2.45392    0.381514   0.854485  0.320597  0.255092 
+////		0.887458  0.660816  0.198404   0.0992829  0.428648   1.64018   0.294481   0.184545   0.40117   3.94646   4.81956   0.877057 
+////		0.213179  0.122792  0.0848492  0.0458258  0.485001   0.109241  0.0873936  0.0552962  0.631713  1.06458   2.10414   0.0832422  1.14516 
+////		1.51861   0.711498  0.204905   0.444152   0.109081   0.913179  0.720567   0.254626   0.722123  0.111722  0.422851  0.588203   0.179858  0.165205 
+////		3.52499   1.35611   3.90127    1.09965    1.35221    0.87908   0.822025   1.33618    0.876688  0.321774  0.351913  1.05314    0.554077  0.563999  1.54694 
+////		2.24161   0.594177  2.06787    0.395176   0.522957   0.829315  0.889765   0.236489   0.54992   1.48876   0.351564  1.45173    1.56873   0.188237  0.802531  4.02507 
+////		0.135395  1.24086   0.0746093  0.142159   0.728065   0.208163  0.176397   0.366467   0.261223  0.259584  0.706082  0.159261   0.565299  1.58681   0.135024  0.528249  0.118584 
+////		0.270321  0.386714  1.05269    0.326191   0.481954   0.210494  0.209621   0.108982   4.31772   0.44009   0.427718  0.155623   0.437069  6.49269   0.212945  0.742154  0.286443  2.42261 
+////		1.92496   0.282892  0.193323   0.155419   1.10899    0.32893   0.588443   0.190095   0.119749  7.48376   1.82105   0.300343   2.03324   0.653015  0.325745  0.23769   1.4088    0.396884  0.353358 
+////
+////		0.0866279 0.043972  0.0390894 0.0570451 0.0193078 0.0367281 0.0580589 0.0832518 0.0244313 0.048466  0.086209  0.0620286 0.0195027 0.0384319 0.0457631 0.0695179 0.0610127 0.0143859 0.0352742 0.0708956
+////
+////
+////		 A   R   N   D   C   Q   E   G   H   I   L   K   M   F   P   S   T   W   Y   V
+////		Ala Arg Asn Asp Cys Gln Glu Gly His Ile Leu Lys Met Phe Pro Ser Thr Trp Tyr Val
+////
+////		  
+////			Symmetrical part of the WAG* rate matrix and aa frequencies,
+////		estimated from 3905 globular protein amino acid sequences forming 182
+////		protein families.
+////			The first part above indicates the symmetric 'exchangeability'
+////		parameters, where s_ij = s_ji.  The s_ij above are not scaled, but the
+////		PAML package will perform this scaling.
+////			The second part gives the amino acid frequencies (pi_i)
+////		estimated from the 3905 sequences.  The net replacement rate from i to
+////		j is Q_ij = s_ij*pi_j.
+////			Prepared by Simon Whelan and Nick Goldman, December 2000.
+////
+////		Citation:
+////		Whelan, S. and N. Goldman.  2001.  A general empirical model of
+////			protein evolution derived from multiple protein families using
+////			a maximum likelihood approach.  Molecular Biology and
+////			Evolution 18:691-699.		
+//
+//		rate[0][1] = 0.589718;rate[0][2] = 0.514347;
+//		rate[0][3] = 0.731152;rate[0][4] = 1.21324;
+//		rate[0][5] = 1.03344;rate[0][6] = 1.55788;
+//		rate[0][7] = 1.41993;rate[0][8] = 0.317684;
+//		rate[0][9] = 0.214596;rate[0][10] = 0.400822;
+//		rate[0][11] = 0.881639;rate[0][12] = 0.887458;
+//		rate[0][13] = 0.213179;rate[0][14] = 1.51861;
+//		rate[0][15] = 3.52499;rate[0][16] = 2.24161;
+//		rate[0][17] = 0.135395;rate[0][18] = 0.270321;
+//		rate[0][19] = 1.92496;
+//
+//		rate[1][2] = 0.67416;rate[1][3] = 0.159054;
+//		rate[1][4] = 0.568449;rate[1][5] = 3.02808;
+//		rate[1][6] = 0.443685;rate[1][7] = 0.629768;
+//		rate[1][8] = 2.31211;rate[1][9] = 0.187262;
+//		rate[1][10] = 0.51821;rate[1][11] = 5.74119;
+//		rate[1][12] = 0.660816;rate[1][13] = 0.122792;
+//		rate[1][14] = 0.711498;rate[1][15] = 1.35611;
+//		rate[1][16] = 0.594177;rate[1][17] = 1.24086;
+//		rate[1][18] = 0.386714;rate[1][19] = 0.282892;
+//
+//
+//		rate[2][3] = 5.30821;rate[2][4] = 0.233527;
+//		rate[2][5] = 1.62299;rate[2][6] = 1.00122;
+//		rate[2][7] = 1.12717;rate[2][8] = 3.9337;
+//		rate[2][9] = 0.527321;rate[2][10] = 0.144354;
+//		rate[2][11] = 2.88102;rate[2][12] = 0.198404;
+//		rate[2][13] = 0.0848492;rate[2][14] = 0.204905;
+//		rate[2][15] = 3.90127;rate[2][16] = 2.06787;
+//		rate[2][17] = 0.0746093;rate[2][18] = 1.05269;
+//		rate[2][19] = 0.193323;
+//
+//		rate[3][4] = 0.0379056;rate[3][5] = 0.657364;
+//		rate[3][6] = 6.04299;rate[3][7] = 0.88357;
+//		rate[3][8] = 0.958529;rate[3][9] = 0.0390513;
+//		rate[3][10] = 0.0869637;rate[3][11] = 0.480308;
+//		rate[3][12] = 0.0992829;rate[3][13] = 0.0458258;
+//		rate[3][14] = 0.444152;rate[3][15] = 1.09965;
+//		rate[3][16] = 0.395176;rate[3][17] = 0.142159;
+//		rate[3][18] = 0.326191;rate[3][19] = 0.155419;
+//
+//
+//		rate[4][5] = 0.0999068;rate[4][6] = 0.0284956;
+//		rate[4][7] = 0.312544;rate[4][8] = 0.341479;
+//		rate[4][9] = 0.198958;rate[4][10] = 0.451124;
+//		rate[4][11] = 0.0719929;rate[4][12] = 0.428648;
+//		rate[4][13] = 0.485001;rate[4][14] = 0.109081;
+//		rate[4][15] = 1.35221;rate[4][16] = 0.522957;
+//		rate[4][17] = 0.728065;rate[4][18] = 0.481954;
+//		rate[4][19] = 1.10899;
+//
+//		rate[5][6] = 5.6037;rate[5][7] = 0.346823;
+//		rate[5][8] = 4.87366;rate[5][9] = 0.125999;
+//		rate[5][10] = 0.873266;rate[5][11] = 4.19125;
+//		rate[5][12] = 1.64018;rate[5][13] = 0.109241;
+//		rate[5][14] = 0.913179;rate[5][15] = 0.87908;
+//		rate[5][16] = 0.829315;rate[5][17] = 0.208163;
+//		rate[5][18] = 0.210494;rate[5][19] = 0.32893;
+//
+//
+//		rate[6][7] = 0.588609;rate[6][8] = 0.599188;
+//		rate[6][9] = 0.124553;rate[6][10] = 0.154936;
+//		rate[6][11] = 2.45392;rate[6][12] = 0.294481;
+//		rate[6][13] = 0.0873936;rate[6][14] = 0.720567;
+//		rate[6][15] = 0.822025;rate[6][16] = 0.889765;
+//		rate[6][17] = 0.176397;rate[6][18] = 0.209621;
+//		rate[6][19] = 0.588443;
+//
+//		rate[7][8] = 0.279542;rate[7][9] = 0.0310522;
+//		rate[7][10] = 0.067443;rate[7][11] = 0.381514;
+//		rate[7][12] = 0.184545;rate[7][13] = 0.0552962;
+//		rate[7][14] = 0.254626;rate[7][15] = 1.33618;
+//		rate[7][16] = 0.236489;rate[7][17] = 0.366467;
+//		rate[7][18] = 0.108982;rate[7][19] = 0.190095;
+//
+//
+//		rate[8][9] = 0.162975;rate[8][10] = 0.508952;
+//		rate[8][11] = 0.854485;rate[8][12] = 0.40117;
+//		rate[8][13] = 0.631713;rate[8][14] = 0.722123;
+//		rate[8][15] = 0.876688;rate[8][16] = 0.54992;
+//		rate[8][17] = 0.261223;rate[8][18] = 4.31772;
+//		rate[8][19] = 0.119749;
+//
+//		rate[9][10] = 3.1554;rate[9][11] = 0.320597;
+//		rate[9][12] = 3.94646;rate[9][13] = 1.06458;
+//		rate[9][14] = 0.111722;rate[9][15] = 0.321774;
+//		rate[9][16] = 1.48876;rate[9][17] = 0.259584;
+//		rate[9][18] = 0.44009;rate[9][19] = 7.48376;
+//
+//
+//		rate[10][11] = 0.255092;rate[10][12] = 4.81956;
+//		rate[10][13] = 2.10414;rate[10][14] = 0.422851;
+//		rate[10][15] = 0.351913;rate[10][16] = 0.351564;
+//		rate[10][17] = 0.706082;rate[10][18] = 0.427718;
+//		rate[10][19] = 1.82105;
+//
+//		rate[11][12] = 0.877057;rate[11][13] = 0.0832422;
+//		rate[11][14] = 0.588203;rate[11][15] = 1.05314;
+//		rate[11][16] = 1.45173;rate[11][17] = 0.159261;
+//		rate[11][18] = 0.155623;rate[11][19] = 0.300343;
+//
+//
+//		rate[12][13] = 1.14516;rate[12][14] = 0.179858;
+//		rate[12][15] = 0.554077;rate[12][16] = 1.56873;
+//		rate[12][17] = 0.565299;rate[12][18] = 0.437069;
+//		rate[12][19] = 2.03324;
+//
+//		rate[13][14] = 0.165205;rate[13][15] = 0.563999;
+//		rate[13][16] = 0.188237;rate[13][17] = 1.58681;
+//		rate[13][18] = 6.49269;rate[13][19] = 0.653015;
+//
+//
+//		rate[14][15] = 1.54694;rate[14][16] = 0.802531;
+//		rate[14][17] = 0.135024;rate[14][18] = 0.212945;
+//		rate[14][19] = 0.325745;
+//
+//		rate[15][16] = 4.02507;rate[15][17] = 0.528249;
+//		rate[15][18] = 0.742154;rate[15][19] = 0.23769;
+//
+//
+//		rate[16][17] = 0.118584;rate[16][18] = 0.286443;
+//		rate[16][19] = 1.4088;
+//
+//		rate[17][18] = 2.42261;rate[17][19] = 0.396884;
+//
+//
+//		rate[18][19] = 0.353358;
+//		
+
+        return rate;
+    }
+
+    @Override
+    public double[] getEmpiricalFrequencies() {
+        double[] f = new double[20];
+        // frequencies from May 2011
+        f[0] = 0.0866279;
+        f[1] = 0.043972;
+        f[2] = 0.0390894;
+        f[3] = 0.0570451;
+        f[4] = 0.0193078;
+        f[5] = 0.0367281;
+        f[6] = 0.0580589;
+        f[7] = 0.0832518;
+        f[8] = 0.0244313;
+        f[9] = 0.048466;
+        f[10] = 0.086209;
+        f[11] = 0.0620286;
+        f[12] = 0.0195027;
+        f[13] = 0.0384319;
+        f[14] = 0.0457631;
+        f[15] = 0.0695179;
+        f[16] = 0.0610127;
+        f[17] = 0.0143859;
+        f[18] = 0.0352742;
+        f[19] = 0.0708956;
+        // frequencies from Beast 1
+        f[0] = 0.0866;
+        f[1] = 0.0440;
+        f[2] = 0.0391;
+        f[3] = 0.0570;
+        f[4] = 0.0193;
+        f[5] = 0.0367;
+        f[6] = 0.0581;
+        f[7] = 0.0833;
+        f[8] = 0.0244;
+        f[9] = 0.0485;
+        f[10] = 0.0862;
+        f[11] = 0.0620;
+        f[12] = 0.0195;
+        f[13] = 0.0384;
+        f[14] = 0.0458;
+        f[15] = 0.0695;
+        f[16] = 0.0610;
+        f[17] = 0.0144;
+        f[18] = 0.0353;
+        f[19] = 0.0709;
+        return f;
+    }
+
+    @Override
+    public int[] getEncodingOrder() {
+        Aminoacid dataType = new Aminoacid();
+        String sCodeMap = dataType.getCodeMap();
+        int[] nCodeMap = new int[dataType.getStateCount()];
+        String sEncoding = "ARNDCQEGHILKMFPSTWYV";
+        for (int i = 0; i < dataType.getStateCount(); i++) {
+            nCodeMap[i] = sEncoding.indexOf(sCodeMap.charAt(i));
+        }
+        return nCodeMap;
+    }
+
+    @Override
+    public boolean canHandleDataType(DataType dataType) {
+        return dataType instanceof Aminoacid;
+    }
+
+    public static void main(String[] args) {
+
+        WAG wag = new WAG();
+
+        String aminoAcids = "ARNDCQEGHILKMFPSTWYV";
+        boolean[] class1 = {false,true,false,false,true,true,true,false,false,true,true,
+                false,true,false,false,false,false,true,true,true};
+
+        int within1 = 0;
+        int within2 = 0;
+        int between = 0;
+        double[] w1 = new double[45];
+        double[] w2 = new double[45];
+        double[] b = new double[100];
+
+        double[][] rates = wag.getEmpiricalRates();
+
+        for (int i = 0; i < 20; i++) {
+            for (int j = i+1; j < 20; j++) {
+                if (class1[i]) {
+                    if (class1[j]) {
+                        w1[within1] = rates[i][j];
+                        within1 += 1;
+                    } else {
+                        b[between] = rates[i][j];
+                        between += 1;
+                    }
+                } else {
+                    if (!class1[j]) {
+                        w2[within2] = rates[i][j];
+                        within2 += 1;
+                    } else {
+                        b[between] = rates[i][j];
+                        between += 1;
+                    }
+                }
+            }
+        }
+
+        System.out.println("Within 1 mean rate = " + DiscreteStatistics.mean(w1));
+        System.out.println("Within 2 mean rate = " + DiscreteStatistics.mean(w2));
+        System.out.println("Between mean rate = " + DiscreteStatistics.mean(b));
+
+        System.out.println("Within 1 rate stdev = " + DiscreteStatistics.stdev(w1));
+        System.out.println("Within 2 rate stdev = " + DiscreteStatistics.stdev(w2));
+        System.out.println("Between rate stdev = " + DiscreteStatistics.stdev(b));
+
+        System.out.println("Within 1 rate stderr = " + DiscreteStatistics.stdev(w1)/Math.sqrt(within1));
+        System.out.println("Within 2 rate stderr = " + DiscreteStatistics.stdev(w2)/Math.sqrt(within2));
+        System.out.println("Between rate stderr = " + DiscreteStatistics.stdev(b)/Math.sqrt(between));
+
+        double sse = 0;
+        double meanb = DiscreteStatistics.mean(b);
+        for (int i = 0; i < b.length; i++) {
+            sse += (meanb - b[i]) * (meanb - b[i]);
+        }
+        sse /= b.length;
+        sse = Math.sqrt(sse);
+
+        System.out.println("Between rate sse = " + sse);
+
+        System.out.println("Within 1 count = " + within1);
+        System.out.println("Within 2 count = " + within2);
+        System.out.println("Between count = " +  between);
+    }
+
+
+
+} // class WAG
diff --git a/src/beast/evolution/tree/CladeSet.java b/src/beast/evolution/tree/CladeSet.java
new file mode 100644
index 0000000..b8cb0e1
--- /dev/null
+++ b/src/beast/evolution/tree/CladeSet.java
@@ -0,0 +1,261 @@
+/*
+ * CladeSet.java
+ *
+ * Copyright (C) 2002-2006 Alexei Drummond and Andrew Rambaut
+ *
+ * This file is part of BEAST.
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership and licensing.
+ *
+ * BEAST 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
+ * of the License, or (at your option) any later version.
+ *
+ *  BEAST 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 BEAST; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+package beast.evolution.tree;
+
+
+import beast.evolution.alignment.TaxonSet;
+import beast.util.FrequencySet;
+
+import java.util.*;
+
+/**
+ * Stores a set of unique clades (and their node heights) for a tree.
+ * Import from BEAST 1.
+ *
+ * @author Andrew Rambaut
+ * @author Alexei Drummond
+ * @author Walter Xie
+ */
+//TODO not tested
+public class CladeSet extends FrequencySet<BitSet> {
+    //
+    // Public stuff
+    //
+
+    public CladeSet() {}
+
+    /**
+     * @param tree
+     */
+    public CladeSet(Tree tree) {
+        this(tree, tree.getTaxonset());
+    }
+
+    /**
+     * @param taxonSet  a set of taxa used to label the tips
+     */
+    public CladeSet(Tree tree, TaxonSet taxonSet) {
+        this.taxonSet = taxonSet;
+        add(tree);
+    }
+
+    /** get number of unique clades */
+    public int getCladeCount()
+    {
+        return size();
+    }
+
+    /** get clade bit set */
+    public String getClade(int index) {
+        BitSet bits = get(index);
+
+        StringBuffer buffer = new StringBuffer("{");
+        boolean first = true;
+        for (String taxonId : getTaxaSet(bits)) {
+            if (!first) {
+                buffer.append(", ");
+            } else {
+                first = false;
+            }
+            buffer.append(taxonId);
+        }
+        buffer.append("}");
+        return buffer.toString();
+    }
+
+    private SortedSet<String> getTaxaSet(BitSet bits) {
+
+        SortedSet<String> taxaSet = new TreeSet<String>();
+
+        for (int i = 0; i < bits.length(); i++) {
+            if (bits.get(i)) {
+                taxaSet.add(taxonSet.asStringList().get(i)); //TODO ?= taxonList.getTaxonId(i)
+            }
+        }
+        return taxaSet;
+    }
+
+
+    /** get clade frequency */
+    int getCladeFrequency(int index)
+    {
+        return getFrequency(index);
+    }
+
+    /** adds all the clades in the tree */
+    public void add(Tree tree) {
+        if (taxonSet == null) {
+            taxonSet = tree.getTaxonset();
+        }
+
+        totalTrees += 1;
+
+        // Recurse over the tree and add all the clades (or increment their
+        // frequency if already present). The root clade is not added.
+        addClades(tree.getRoot(), null);
+    }
+
+    private void addClades(Node node, BitSet bits) {
+
+        if (node.isLeaf()) {
+            if (taxonSet != null) {
+                int index = taxonSet.getTaxonIndex(node.getID());
+                bits.set(index);
+            } else {
+                bits.set(node.getNr());
+            }
+        } else {
+
+            BitSet bits2 = new BitSet();
+            for (Node child : node.getChildren()) {
+                addClades(child, bits2);
+            }
+
+            add(bits2, 1);
+            addNodeHeight(bits2, node.getHeight()); // TODO ?= tree.getNodeHeight(node)
+
+            if (bits != null) {
+                bits.or(bits2);
+            }
+        }
+    }
+
+    public double getMeanNodeHeight(int i) {
+        BitSet bits = get(i);
+
+        return getTotalNodeHeight(bits) / getFrequency(i);
+    }
+
+    private double getTotalNodeHeight(BitSet bits) {
+        Double tnh = totalNodeHeight.get(bits);
+        if (tnh == null) return 0.0;
+        return tnh;
+    }
+
+    private void addNodeHeight(BitSet bits, double height) {
+        totalNodeHeight.put(bits, (getTotalNodeHeight(bits) + height));
+    }
+
+    // Generifying found that this code was buggy. Luckily it is not used anymore.
+
+//    /** adds all the clades in the CladeSet */
+//    public void add(CladeSet cladeSet)
+//    {
+//        for (int i = 0, n = cladeSet.getCladeCount(); i < n; i++) {
+//            add(cladeSet.getClade(i), cladeSet.getCladeFrequency(i));
+//        }
+//    }
+
+    private BitSet annotate(Tree tree, Node node, String freqAttrName) {
+        BitSet b = null;
+        if (node.isLeaf()) {
+            int index;
+            if (taxonSet != null) {
+                index = taxonSet.getTaxonIndex(node.getID());
+            } else {
+                index = node.getNr();
+            }
+            b = new BitSet(tree.getLeafNodeCount());
+            b.set(index);
+
+        } else {
+
+            for (Node child : node.getChildren()) {
+                BitSet b1 = annotate(tree, child, freqAttrName);
+                if( child.isRoot() ) {
+                    b = b1;
+                } else {
+                    b.or(b1);
+                }
+            }
+            final int total = getFrequency(b);
+            if( total >= 0 ) {
+                node.setMetaData(freqAttrName, total / (double)totalTrees );
+            }
+        }
+        return b;
+    }
+
+    /**
+     * Annotate clades of tree with posterior probability
+     * @param tree
+     * @param freqAttrName name of attribute to set per node
+     * @return sum(log(all clades probability))
+     */
+    public double annotate(Tree tree, String freqAttrName) {
+        annotate(tree, tree.getRoot(), freqAttrName);
+
+        double logClade = 0.0;
+        for(Node internalNode : tree.getInternalNodes()) {
+            final double f = (Double) internalNode.getMetaData(freqAttrName);
+            logClade += Math.log(f);
+        }
+        return logClade;
+    }
+
+    public boolean hasClade(int index, Tree tree) {
+        BitSet bits = get(index);
+
+        Node[] mrca = new Node[1];
+        findClade(bits, tree.getRoot(), mrca);
+
+        return (mrca[0] != null);
+    }
+
+    private int findClade(BitSet bitSet, Node node, Node[] cladeMRCA) {
+
+        if (node.isLeaf()) {
+
+            if (taxonSet != null) {
+                int index = taxonSet.getTaxonIndex(node.getID());
+                if (bitSet.get(index)) return 1;
+            } else {
+                if (bitSet.get(node.getNr())) return 1;
+            }
+            return -1;
+        } else {
+            int count = 0;
+            for (Node child : node.getChildren()) {
+                int childCount = findClade(bitSet, child, cladeMRCA);
+
+                if (childCount != -1 && count != -1) {
+                    count += childCount;
+                } else count = -1;
+            }
+
+            if (count == bitSet.cardinality()) cladeMRCA[0] = node;
+
+            return count;
+        }
+    }
+
+    //
+    // Private stuff
+    //
+    private TaxonSet taxonSet = null;
+    private final Map<BitSet, Double> totalNodeHeight = new HashMap<BitSet, Double>();
+    private int totalTrees = 0;
+}
diff --git a/src/beast/evolution/tree/Node.java b/src/beast/evolution/tree/Node.java
new file mode 100644
index 0000000..7078aeb
--- /dev/null
+++ b/src/beast/evolution/tree/Node.java
@@ -0,0 +1,813 @@
+/*
+* File Node.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+package beast.evolution.tree;
+
+
+import beast.core.BEASTObject;
+import beast.core.Description;
+import beast.util.HeapSort;
+
+import java.util.*;
+
+
+ at Description("Nodes in building beast.tree data structure.")
+public class Node extends BEASTObject {
+
+    /**
+     * label nr of node, used mostly when this is a leaf.
+     */
+    protected int labelNr;
+
+    /**
+     * height of this node.
+     */
+    protected double height = Double.MAX_VALUE;
+
+    /**
+     * Arbitrarily labeled metadata on this node. Not currently implemented as part of state!
+     */
+    protected Map<String, Object> metaData = new TreeMap<String, Object>();
+
+    /**
+     * list of children of this node *
+     * Don't use m_left and m_right directly
+     * Use getChildCount() and getChild(x) or getChildren() instead
+     */
+    List<Node> children = new ArrayList<Node>();
+
+//    @Deprecated
+//	private Node m_left;
+//    @Deprecated
+//	private Node m_right;
+
+    /**
+     * parent node in the beast.tree, null if root *
+     */
+    Node parent = null;
+
+    /**
+     * status of this node after an operation is performed on the state *
+     */
+    int isDirty = Tree.IS_CLEAN;
+
+    /**
+     * meta-data contained in square brackets in Newick *
+     */
+    public String metaDataString;
+
+    /**
+     * The Tree that this node is a part of.
+     * This allows e.g. access to the State containing the Tree *
+     */
+    protected Tree m_tree;
+
+    public Node() {
+    }
+
+    public Node(final String id) throws Exception {
+        setID(id);
+        initAndValidate();
+    }
+
+    public Tree getTree() {
+        return m_tree;
+    }
+
+    @Override
+    public void initAndValidate() throws Exception {
+        // do nothing
+    }
+
+    /**
+     * @return number uniquely identifying the node in the tree.
+     *         This is a number between 0 and the total number of nodes in the tree
+     *         Leaf nodes are number 0 to #leaf nodes -1
+     *         Internal nodes are numbered  #leaf nodes  up to #nodes-1
+     *         The root node is always numbered #nodes-1
+     */
+    public int getNr() {
+        return labelNr;
+    }
+
+    public void setNr(final int iLabel) {
+        labelNr = iLabel;
+    }
+
+    public double getHeight() {
+        return height;
+    }
+
+    public double getDate() {
+        return m_tree.getDate(height);
+    }
+
+    public void setHeight(final double fHeight) {
+        startEditing();
+        height = fHeight;
+        isDirty |= Tree.IS_DIRTY;
+        if (!isLeaf()) {
+            getLeft().isDirty |= Tree.IS_DIRTY;
+            if (getRight() != null) {
+                getRight().isDirty |= Tree.IS_DIRTY;
+            }
+        }
+    }
+
+    /**
+     * @return length of branch between this node and its parent in the beast.tree
+     */
+    public final double getLength() {
+        if (isRoot()) {
+            return 0;
+        } else {
+            return getParent().height - height;
+        }
+    }
+
+    /**
+     * methods for accessing the dirtiness state of the Node.
+     * A Node is Tree.IS_DIRTY if its value (like height) has changed
+     * A Node Tree.IS_if FILTHY if its parent or child has changed.
+     * Otherwise the node is Tree.IS_CLEAN *
+     */
+    public int isDirty() {
+        return isDirty;
+    }
+
+    public void makeDirty(final int nDirty) {
+        isDirty |= nDirty;
+    }
+
+    public void makeAllDirty(final int nDirty) {
+        isDirty = nDirty;
+        if (!isLeaf()) {
+            getLeft().makeAllDirty(nDirty);
+            if (getRight() != null) {
+                getRight().makeAllDirty(nDirty);
+            }
+        }
+    }
+
+
+    /**
+     * @return parent node, or null if this is root *
+     */
+    public Node getParent() {
+        return parent;
+    }
+
+    /**
+     * Calls setParent(parent, true)
+     *
+     * @param parent the new parent to be set, must be called from within an operator.
+     */
+    public void setParent(final Node parent) {
+        setParent(parent, true);
+    }
+
+    /**
+     * Sets the parent of this node
+     *
+     * @param parent     the node to become parent
+     * @param inOperator if true, then startEditing() is called and setting the parent will make tree "filthy"
+     */
+    void setParent(final Node parent, final boolean inOperator) {
+        if (inOperator) startEditing();
+        if (this.parent != parent) {
+        	this.parent = parent;
+            if (inOperator) isDirty = Tree.IS_FILTHY;
+        }
+    }
+
+     /**
+     * Sets the parent of this node. No overhead, no side effects like setting dirty flags etc.
+     *
+     * @param parent     the node to become parent
+     */
+    void setParentImmediate(final Node parent) {
+        this.parent = parent;
+    }
+
+    /**
+     * @return unmodifiable list of children of this node
+     */
+    public List<Node> getChildren() {
+        return Collections.unmodifiableList(children);
+    }
+
+    /**
+     * get all child node under this node, if this node is leaf then list.size() = 0.
+     *
+     * @return
+     */
+    public List<Node> getAllChildNodes() {
+        final List<Node> childNodes = new ArrayList<Node>();
+        if (!this.isLeaf()) getAllChildNodes(childNodes);
+        return childNodes;
+    }
+
+    // recursive
+    public void getAllChildNodes(final List<Node> childNodes) {
+        childNodes.add(this);
+        for (Node child : children)
+            child.getAllChildNodes(childNodes);
+    }
+
+    /**
+     * get all leaf node under this node, if this node is leaf then list.size() = 0.
+     *
+     * @return
+     */
+    public List<Node> getAllLeafNodes() {
+        final List<Node> leafNodes = new ArrayList<Node>();
+        if (!this.isLeaf()) getAllLeafNodes(leafNodes);
+        return leafNodes;
+    }
+
+    // recursive
+    public void getAllLeafNodes(final List<Node> leafNodes) {
+        if (this.isLeaf()) {
+            leafNodes.add(this);
+        }
+
+        for (Node child : children)
+            child.getAllLeafNodes(leafNodes);
+    }
+
+    /**
+     * @return true if current node is root node *
+     */
+    public boolean isRoot() {
+        return parent == null;
+    }
+
+    /**
+     * @return true if current node is a leaf node *
+     */
+    public boolean isLeaf() {
+        return children.size() == 0;
+        //return getLeft() == null && getRight() == null;
+    }
+
+    public void removeChild(final Node child) {
+        startEditing();
+        children.remove(child);
+    }
+
+    /**
+     * Removes all children from this node.
+     *
+     * @param inOperator if true then startEditing() is called. For operator uses, called removeAllChildren(true), otherwise
+     *                   use set to false.
+     */
+    public void removeAllChildren(final boolean inOperator) {
+        if (inOperator) startEditing();
+        children.clear();
+    }
+
+    public void addChild(final Node child) {
+        child.setParent(this);
+        children.add(child);
+    }
+
+    /**
+     * @return count number of nodes in beast.tree, starting with current node *
+     */
+    public int getNodeCount() {
+        int nodes = 1;
+        for (final Node child : children) {
+            nodes += child.getNodeCount();
+        }
+        return nodes;
+    }
+
+    public int getLeafNodeCount() {
+        if (isLeaf()) {
+            return 1;
+        }
+        int nodes = 0;
+        for (final Node child : children) {
+            nodes += child.getLeafNodeCount();
+        }
+        return nodes;
+    }
+
+    public int getInternalNodeCount() {
+        if (isLeaf()) {
+            return 0;
+        }
+        int nodes = 1;
+        for (final Node child : children) {
+            nodes += child.getInternalNodeCount();
+        }
+        return nodes;
+    }
+
+    /**
+     * @return beast.tree in Newick format, with length and meta data
+     *         information. Unlike toNewick(), here Nodes are numbered, instead of
+     *         using the node labels.
+     *         If there are internal nodes with non-null IDs then their numbers are also printed.
+     *         Also, all internal nodes are labelled if bPrintInternalNodeNumbers
+     *         is set true. This is useful for example when storing a State to file
+     *         so that it can be restored.
+     */
+    public String toShortNewick(final boolean bPrintInternalNodeNumbers) {
+        final StringBuilder buf = new StringBuilder();
+        if (getLeft() != null) {
+            buf.append("(");
+            buf.append(getLeft().toShortNewick(bPrintInternalNodeNumbers));
+            if (getRight() != null) {
+                buf.append(',');
+                buf.append(getRight().toShortNewick(bPrintInternalNodeNumbers));
+            }
+            buf.append(")");
+            if (getID() != null) {
+                buf.append(getNr());
+            } else if (bPrintInternalNodeNumbers) {
+                buf.append(getNr());
+            }
+
+        } else {
+            buf.append(getNr());
+        }
+        buf.append(getNewickMetaData());
+        buf.append(":").append(getLength());
+        return buf.toString();
+    }
+
+    /**
+     * prints newick string where it orders by highest leaf number
+     * in a clade. Print node numbers (m_iLabel) incremented by 1
+     * for leaves and internal nodes with non-null IDs.
+     */
+    String toSortedNewick(final int[] iMaxNodeInClade) {
+        return toSortedNewick(iMaxNodeInClade, false);
+    }
+
+    public String toSortedNewick(int[] iMaxNodeInClade, boolean printMetaData) {
+        StringBuilder buf = new StringBuilder();
+        if (getLeft() != null) {
+            buf.append("(");
+            String sChild1 = getLeft().toSortedNewick(iMaxNodeInClade, printMetaData);
+            int iChild1 = iMaxNodeInClade[0];
+            if (getRight() != null) {
+                String sChild2 = getRight().toSortedNewick(iMaxNodeInClade, printMetaData);
+                int iChild2 = iMaxNodeInClade[0];
+                if (iChild1 > iChild2) {
+                    buf.append(sChild2);
+                    buf.append(",");
+                    buf.append(sChild1);
+                } else {
+                    buf.append(sChild1);
+                    buf.append(",");
+                    buf.append(sChild2);
+                    iMaxNodeInClade[0] = iChild1;
+                }
+            } else {
+                buf.append(sChild1);
+            }
+            buf.append(")");
+            if (getID() != null) {
+                buf.append(labelNr+1);
+            }
+        } else {
+            iMaxNodeInClade[0] = labelNr;
+            buf.append(labelNr + 1);
+        }
+
+        if (printMetaData) {
+            buf.append(getNewickMetaData());
+        }
+        buf.append(":").append(getLength());
+        return buf.toString();
+    }
+
+    @Deprecated
+    public String toNewick(final List<String> labels) {
+        throw new UnsupportedOperationException("Please use toNewick(). Labels will come from node.getId() or node.getNr().");
+    }
+
+    /**
+     *
+     * @param onlyTopology  if true, only print topology
+     * @return
+     */
+    public String toNewick(boolean onlyTopology) {
+        final StringBuilder buf = new StringBuilder();
+        if (getLeft() != null) {
+            buf.append("(");
+            buf.append(getLeft().toNewick(onlyTopology));
+            if (getRight() != null) {
+                buf.append(',');
+                buf.append(getRight().toNewick(onlyTopology));
+            }
+            buf.append(")");
+            if (getID() != null) {
+                buf.append(getID());
+            }
+        } else {
+            if (getID() == null) {
+                buf.append(labelNr);
+            } else {
+                buf.append(getID());
+            }
+        }
+        if (!onlyTopology) {
+            buf.append(getNewickMetaData());
+            buf.append(":").append(getLength());
+        }
+        return buf.toString();
+    }
+
+
+    /**
+     * @return beast.tree in Newick format with taxon labels for labelled tip nodes
+     * and labeled (having non-null ID) internal nodes.
+     * If a tip node doesn't have an ID (taxon label) then node number (m_iLabel) is printed.
+     */
+    public String toNewick() {
+        return toNewick(false);
+    }
+
+    public String getNewickMetaData() {
+        if (metaDataString != null) {
+            return "[&" + metaDataString + ']';
+        }
+        return "";
+    }
+
+    /**
+     * @param sLabels
+     * @return beast.tree in long Newick format, with all length and meta data
+     *         information, but with leafs labelled with their names
+     */
+    public String toString(final List<String> sLabels) {
+        final StringBuilder buf = new StringBuilder();
+        if (getLeft() != null) {
+            buf.append("(");
+            buf.append(getLeft().toString(sLabels));
+            if (getRight() != null) {
+                buf.append(',');
+                buf.append(getRight().toString(sLabels));
+            }
+            buf.append(")");
+        } else {
+            buf.append(sLabels.get(labelNr));
+        }
+        if (metaDataString != null) {
+            buf.append('[');
+            buf.append(metaDataString);
+            buf.append(']');
+        }
+        buf.append(":").append(getLength());
+        return buf.toString();
+    }
+
+    public String toString() {
+        return toShortNewick(true);
+    }
+
+    /**
+     * sorts nodes in children according to lowest numbered label in subtree
+     *
+     * @return
+     */
+    public int sort() {
+
+        if (isLeaf()) {
+            return labelNr;
+        }
+
+        final int childCount = getChildCount();
+
+        if (childCount == 1) return getChild(0).sort();
+
+        final List<Integer> lowest = new ArrayList<Integer>();
+        final int[] indices = new int[childCount];
+
+        // relies on this being a copy of children list
+        final List<Node> children = new ArrayList<>(getChildren());
+
+        for (final Node child : children) {
+            lowest.add(child.sort());
+        }
+        HeapSort.sort(lowest, indices);
+        for (int i = 0; i < childCount; i++) {
+            setChild(i, children.get(indices[i]));
+        }
+        return lowest.get(indices[0]);
+    } // sort
+
+    /**
+     * during parsing, leaf nodes are numbered 0...m_nNrOfLabels-1
+     * but internal nodes are left to zero. After labeling internal
+     * nodes, m_iLabel uniquely identifies a node in a beast.tree.
+     *
+     * @param iLabel
+     * @return
+     */
+    public int labelInternalNodes(int iLabel) {
+        if (isLeaf()) {
+            return iLabel;
+        } else {
+            iLabel = getLeft().labelInternalNodes(iLabel);
+            if (getRight() != null) {
+                iLabel = getRight().labelInternalNodes(iLabel);
+            }
+            labelNr = iLabel++;
+        }
+        return iLabel;
+    } // labelInternalNodes
+
+    /**
+     * @return (deep) copy of node
+     */
+    public Node copy() {
+        final Node node = new Node();
+        node.height = height;
+        node.labelNr = labelNr;
+        node.metaDataString = metaDataString;
+        node.metaData = new TreeMap<String, Object>(metaData);
+        node.parent = null;
+        node.setID(getID());
+
+        for (final Node child : getChildren()) {
+            node.addChild(child.copy());
+        }
+        return node;
+    } // copy
+
+    /**
+     * assign values to a tree in array representation *
+     */
+    public void assignTo(final Node[] nodes) {
+        final Node node = nodes[getNr()];
+        node.height = height;
+        node.labelNr = labelNr;
+        node.metaDataString = metaDataString;
+        node.metaData = new TreeMap<String, Object>(metaData);
+        node.parent = null;
+        node.setID(getID());
+        if (getLeft() != null) {
+            node.setLeft(nodes[getLeft().getNr()]);
+            getLeft().assignTo(nodes);
+            node.getLeft().parent = node;
+            if (getRight() != null) {
+                node.setRight(nodes[getRight().getNr()]);
+                getRight().assignTo(nodes);
+                node.getRight().parent = node;
+            }
+        }
+    }
+
+    /**
+     * assign values from a tree in array representation *
+     */
+    public void assignFrom(final Node[] nodes, final Node node) {
+        height = node.height;
+        labelNr = node.labelNr;
+        metaDataString = node.metaDataString;
+        metaData = new TreeMap<String, Object>(node.metaData);
+        parent = null;
+        setID(node.getID());
+        if (node.getLeft() != null) {
+            setLeft(nodes[node.getLeft().getNr()]);
+            getLeft().assignFrom(nodes, node.getLeft());
+            getLeft().parent = this;
+            if (node.getRight() != null) {
+                setRight(nodes[node.getRight().getNr()]);
+                getRight().assignFrom(nodes, node.getRight());
+                getRight().parent = this;
+            }
+        }
+    }
+
+    /**
+     * set meta-data according to pattern.
+     * Only heights are recognised, but derived classes could deal with
+     * richer meta data pattersn.
+     */
+    public void setMetaData(final String sPattern, final Object fValue) {
+        startEditing();
+        if (sPattern.equals(TraitSet.DATE_TRAIT) ||
+                sPattern.equals(TraitSet.DATE_FORWARD_TRAIT) ||
+                sPattern.equals(TraitSet.DATE_BACKWARD_TRAIT)) {
+            height = (Double) fValue;
+            isDirty |= Tree.IS_DIRTY;
+        } else {
+            metaData.put(sPattern, fValue);
+        }
+
+    }
+
+    public Object getMetaData(final String sPattern) {
+        if (sPattern.equals(TraitSet.DATE_TRAIT) ||
+                sPattern.equals(TraitSet.DATE_FORWARD_TRAIT) ||
+                sPattern.equals(TraitSet.DATE_BACKWARD_TRAIT)) {
+            return height;
+        } else {
+            final Object d = metaData.get(sPattern);
+            if (d != null) return d;
+        }
+        return 0;
+    }
+
+    public Set<String> getMetaDataNames() {
+        return metaData.keySet();
+    }
+
+
+    /**
+     * scale height of this node and all its descendants
+     *
+     * @param fScale scale factor
+     */
+    public void scale(final double fScale) throws Exception {
+        startEditing();
+        isDirty |= Tree.IS_DIRTY;
+        if (!isLeaf() && !isFake()) {
+            height *= fScale;
+        }
+        if (!isLeaf()) {
+            getLeft().scale(fScale);
+            if (getRight() != null) {
+                getRight().scale(fScale);
+            }
+            if (height < getLeft().height || height < getRight().height) {
+                throw new Exception("Scale gives negative branch length");
+            }
+        }
+    }
+
+//    /**
+//     * Used for sampled ancestor trees
+//     * Scales this node and all its descendants (either all descendants, or only non-sampled descendants)
+//     *
+//     * @param fScale    the scalar to multiply each scaled node age by
+//     * @param scaleSNodes true if sampled nodes should be scaled as well as internal nodes, false if only non-sampled
+//     *                  internal nodes should be scaled.
+//     * @throws Exception throws exception if resulting tree would have negative branch lengths.
+//     */
+//    public void scale(double fScale, boolean scaleSNodes) throws Exception {
+//        startEditing();
+//        isDirty |= Tree.IS_DIRTY;
+//        if (scaleSNodes || (!isLeaf() && !isFake())) {
+//            height *= fScale;
+//        }
+//        if (!isLeaf()) {
+//            (getLeft()).scale(fScale, scaleSNodes);
+//            if (getRight() != null) {
+//                (getRight()).scale(fScale, scaleSNodes);
+//            }
+//            if (height < getLeft().height || height < getRight().height) {
+//                throw new Exception("Scale gives negative branch length");
+//            }
+//        }
+//    }
+
+    protected void startEditing() {
+        if (m_tree != null && m_tree.getState() != null) {
+            m_tree.startEditing(null);
+        }
+    }
+
+    /**
+     * some methods that are useful for porting from BEAST 1 *
+     */
+    public int getChildCount() {
+        return children.size();
+    }
+
+    public Node getChild(final int iChild) {
+        return children.get(iChild);
+    }
+
+    public void setChild(final int iChild, final Node node) {
+        while (children.size() < iChild) {
+            children.add(null);
+        }
+        children.set(iChild, node);
+    }
+
+
+    public void setLeft(final Node m_left) {
+        if (children.size() == 0) {
+            children.add(m_left);
+        } else {
+            children.set(0, m_left);
+        }
+    }
+
+    public Node getLeft() {
+        if (children.size() == 0) {
+            return null;
+        }
+        return children.get(0);
+    }
+
+    public void setRight(final Node m_right) {
+        switch (children.size()) {
+            case 0:
+                children.add(null);
+            case 1:
+                children.add(m_right);
+                break;
+            default:
+                children.set(1, m_right);
+                break;
+        }
+    }
+
+    public Node getRight() {
+        if (children.size() <= 1) {
+            return null;
+        }
+        return children.get(1);
+    }
+
+    public static Node connect(final Node left, final Node right, final double h) {
+        final Node n = new Node();
+        n.setHeight(h);
+        n.setLeft(left);
+        n.setRight(right);
+        left.parent = n;
+        right.parent = n;
+        return n;
+    }
+
+    /**
+     * @return true if this leaf actually represent a direct ancestor
+     * (i.e. is on the end of a zero-length branch)
+     */
+    public boolean isDirectAncestor() {
+        return (isLeaf() && !isRoot() && this.getParent().getHeight() == this.getHeight());
+    }
+
+    /**
+     * @return true if this is a "fake" internal node (i.e. one of its children is a direct ancestor)
+     */
+    public boolean isFake() {
+        if (this.isLeaf())
+            return false;
+        return ((this.getLeft()).isDirectAncestor() || (this.getRight() != null && (this.getRight()).isDirectAncestor()));
+    }
+
+    public Node getDirectAncestorChild() {
+        if (!this.isFake()) {
+            return null;
+        }
+        if (this.getLeft().isDirectAncestor()) {
+            return this.getLeft();
+        }
+        return this.getRight();
+    }
+
+    public Node getNonDirectAncestorChild(){
+        if (!this.isFake()) {
+            return null;
+        }
+        if ((this.getLeft()).isDirectAncestor()){
+            return getRight();
+        }
+        if  ((this.getRight()).isDirectAncestor()){
+            return getLeft();
+        }
+        return null;
+    }
+
+    public Node getFakeChild(){
+
+        if ((this.getLeft()).isFake()){
+            return getLeft();
+        }
+        if ((this.getRight()).isFake()){
+            return getRight();
+        }
+        return null;
+    }
+
+	
+} // class Node
diff --git a/src/beast/evolution/tree/RandomTree.java b/src/beast/evolution/tree/RandomTree.java
new file mode 100644
index 0000000..ad965d6
--- /dev/null
+++ b/src/beast/evolution/tree/RandomTree.java
@@ -0,0 +1,700 @@
+/*
+ * CoalescentSimulator.java
+ *
+ * Copyright (C) 2002-2006 Alexei Drummond and Andrew Rambaut
+ *
+ * This file is part of BEAST.
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership and licensing.
+ *
+ * BEAST 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
+ * of the License, or (at your option) any later version.
+ *
+ *  BEAST 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 BEAST; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+package beast.evolution.tree;
+
+
+import java.util.*;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.StateNode;
+import beast.core.StateNodeInitialiser;
+import beast.core.util.Log;
+import beast.core.BEASTObject;
+import beast.core.BEASTInterface;
+import beast.core.Input.Validate;
+import beast.evolution.alignment.Alignment;
+import beast.evolution.alignment.TaxonSet;
+import beast.evolution.tree.coalescent.PopulationFunction;
+import beast.math.distributions.MRCAPrior;
+import beast.math.distributions.ParametricDistribution;
+import beast.util.HeapSort;
+import beast.util.Randomizer;
+
+
+
+
+ at Description("This class provides the basic engine for coalescent simulation of a given demographic model over a given time period. ")
+public class RandomTree extends Tree implements StateNodeInitialiser {
+    public Input<Alignment> taxaInput = new Input<>("taxa", "set of taxa to initialise tree specified by alignment");
+
+    public Input<PopulationFunction> populationFunctionInput = new Input<PopulationFunction>("populationModel", "population function for generating coalescent???", Validate.REQUIRED);
+    public Input<List<MRCAPrior>> calibrationsInput = new Input<List<MRCAPrior>>("constraint", "specifies (monophyletic or height distribution) constraints on internal nodes", new ArrayList<MRCAPrior>());
+    public Input<Double> rootHeightInput = new Input<Double>("rootHeight", "If specified the tree will be scaled to match the root height, if constraints allow this");
+
+    // total nr of taxa
+    int nrOfTaxa;
+    // list of bitset representation of the taxon sets
+    List<Set<String>> taxonSets;
+    // the first m_nIsMonophyletic of the m_bTaxonSets are monophyletic, while the remainder are not
+    int isMonophyletic;
+    // list of parametric distribution constraining the MRCA of taxon sets, null if not present
+    List<ParametricDistribution> distributions;
+
+    class Bound {
+        Double upper = Double.POSITIVE_INFINITY;
+        Double lower = Double.NEGATIVE_INFINITY;
+
+        public String toString() {
+            return "[" + lower + "," + upper + "]";
+        }
+    }
+
+    List<Bound> m_bounds;
+    List<String> taxonSetIDs;
+
+    List<Integer>[] children;
+
+    Set<String> sTaxa;
+
+    // number of the next internal node, used when creating new internal nodes
+    int nextNodeNr;
+
+    // used to indicate one of the MRCA constraints could not be met
+    protected class ConstraintViolatedException extends Exception {
+        private static final long serialVersionUID = 1L;
+    }
+
+    @Override
+    public void initAndValidate() throws Exception {
+
+        sTaxa = new LinkedHashSet<>();
+        if (taxaInput.get() != null) {
+            sTaxa.addAll(taxaInput.get().getTaxaNames());
+        } else {
+            sTaxa.addAll(m_taxonset.get().asStringList());
+        }
+
+        nrOfTaxa = sTaxa.size();
+
+        initStateNodes();
+        super.initAndValidate();
+    }
+
+    @SuppressWarnings({"rawtypes", "unchecked"})
+    private void swap(final List list, final int i, final int j) {
+        final Object tmp = list.get(i);
+        list.set(i, list.get(j));
+        list.set(j, tmp);
+    }
+
+    // taxonset intersection test
+    private boolean intersects(final BitSet bitSet, final BitSet bitSet2) {
+        for (int k = bitSet.nextSetBit(0); k >= 0; k = bitSet.nextSetBit(k + 1)) {
+            if (bitSet2.get(k)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    // returns true if bitSet is a subset of bitSet2
+    private boolean isSubset(final BitSet bitSet, final BitSet bitSet2) {
+        boolean bIsSubset = true;
+        for (int k = bitSet.nextSetBit(0); bIsSubset && k >= 0; k = bitSet.nextSetBit(k + 1)) {
+            bIsSubset = bitSet2.get(k);
+        }
+        return bIsSubset;
+    }
+
+    //@Override
+    public void initStateNodes() throws Exception {
+        // find taxon sets we are dealing with
+        taxonSets = new ArrayList<>();
+        m_bounds = new ArrayList<>();
+        distributions = new ArrayList<>();
+        taxonSetIDs = new ArrayList<>();
+        isMonophyletic = 0;
+
+        if (taxaInput.get() != null) {
+            sTaxa.addAll(taxaInput.get().getTaxaNames());
+        } else {
+            sTaxa.addAll(m_taxonset.get().asStringList());
+        }
+
+        // pick up constraints from outputs, m_inititial input tree and output tree, if any
+        List<MRCAPrior> calibrations = new ArrayList<MRCAPrior>();
+        calibrations.addAll(calibrationsInput.get());
+//    	for (Plugin plugin : outputs) {
+//    	// pick up constraints in outputs
+//		if (plugin instanceof MRCAPrior && !calibrations.contains(plugin)) {
+//			calibrations.add((MRCAPrior) plugin);
+//		} else  if (plugin instanceof Tree) {
+//        	// pick up constraints in outputs if output tree
+//			Tree tree = (Tree) plugin;
+//			if (tree.m_initial.get() == this) {
+//            	for (Plugin plugin2 : tree.outputs) {
+//            		if (plugin2 instanceof MRCAPrior && !calibrations.contains(plugin2)) {
+//            			calibrations.add((MRCAPrior) plugin2);
+//            		}                		
+//            	}
+//			}
+//		}
+//		
+//	}
+        // pick up constraints in m_initial tree
+        for (final Object plugin : getOutputs()) {
+            if (plugin instanceof MRCAPrior && !calibrations.contains(plugin) ) {
+                calibrations.add((MRCAPrior) plugin);
+            }
+        }
+        if (m_initial.get() != null) {
+            for (final Object plugin : m_initial.get().getOutputs()) {
+                if (plugin instanceof MRCAPrior && !calibrations.contains(plugin)) {
+                    calibrations.add((MRCAPrior) plugin);
+                }
+            }
+        }
+
+        for (final MRCAPrior prior : calibrations) {
+            final TaxonSet taxonSet = prior.taxonsetInput.get();
+            if (taxonSet != null && !prior.onlyUseTipsInput.get()) {
+	            final Set<String> bTaxa = new HashSet<>();
+	        	if (taxonSet.asStringList() == null) {
+	        		taxonSet.initAndValidate();
+	        	}
+	            for (final String sTaxonID : taxonSet.asStringList()) {
+
+	                if (!sTaxa.contains(sTaxonID)) {
+	                    throw new Exception("Taxon <" + sTaxonID + "> could not be found in list of taxa. Choose one of " + sTaxa.toArray(new String[0]));
+	                }
+	                bTaxa.add(sTaxonID);
+	            }
+	            final ParametricDistribution distr = prior.distInput.get();
+	            final Bound bounds = new Bound();
+	            if (distr != null) {
+	        		List<BEASTInterface> plugins = new ArrayList<BEASTInterface>();
+	        		distr.getPredecessors(plugins);
+	        		for (int i = plugins.size() - 1; i >= 0 ; i--) {
+	        			plugins.get(i).initAndValidate();
+	        		}
+	                bounds.lower = distr.inverseCumulativeProbability(0.0) + distr.offsetInput.get();
+	                bounds.upper = distr.inverseCumulativeProbability(1.0) + distr.offsetInput.get();
+	            }
+	
+	            if (prior.isMonophyleticInput.get()) {
+	                // add any monophyletic constraint
+	                taxonSets.add(isMonophyletic, bTaxa);
+	                distributions.add(isMonophyletic, distr);
+	                m_bounds.add(isMonophyletic, bounds);
+	                taxonSetIDs.add(prior.getID());
+	                isMonophyletic++;
+	            } else {
+	                // only calibrations with finite bounds are added
+	                if (!Double.isInfinite(bounds.lower) || !Double.isInfinite(bounds.upper)) {
+	                    taxonSets.add(bTaxa);
+	                    distributions.add(distr);
+	                    m_bounds.add(bounds);
+	                    taxonSetIDs.add(prior.getID());
+	                }
+	            }
+            }
+        }
+
+        // assume all calibration constraints are MonoPhyletic
+        // TODO: verify that this is a reasonable assumption
+        isMonophyletic = taxonSets.size();
+
+
+        // sort constraints such that if taxon set i is subset of taxon set j, then i < j
+        for (int i = 0; i < isMonophyletic; i++) {
+            for (int j = i + 1; j < isMonophyletic; j++) {
+
+                Set<String> intersection = new HashSet<>(taxonSets.get(i));
+                intersection.retainAll(taxonSets.get(j));
+
+                if (intersection.size() > 0) {
+                    final boolean bIsSubset = taxonSets.get(i).containsAll(taxonSets.get(j));
+                    final boolean bIsSubset2 = taxonSets.get(j).containsAll(taxonSets.get(i));
+                    // sanity check: make sure either
+                    // o taxonset1 is subset of taxonset2 OR
+                    // o taxonset1 is superset of taxonset2 OR
+                    // o taxonset1 does not intersect taxonset2
+                    if (!(bIsSubset || bIsSubset2)) {
+                        throw new Exception("333: Don't know how to generate a Random Tree for taxon sets that intersect, " +
+                                "but are not inclusive. Taxonset " + taxonSetIDs.get(i) + " and " + taxonSetIDs.get(j));
+                    }
+                    // swap i & j if b1 subset of b2
+                    if (bIsSubset) {
+                        swap(taxonSets, i, j);
+                        swap(distributions, i, j);
+                        swap(m_bounds, i, j);
+                        swap(taxonSetIDs, i, j);
+                    }
+                }
+            }
+        }
+
+        // build tree of mono constraints such that i is parent of j => j is subset of i
+        final int[] nParent = new int[isMonophyletic];
+        children = new List[isMonophyletic + 1];
+        for (int i = 0; i < isMonophyletic + 1; i++) {
+            children[i] = new ArrayList<Integer>();
+        }
+        for (int i = 0; i < isMonophyletic; i++) {
+            int j = i + 1;
+            while (j < isMonophyletic && !taxonSets.get(j).containsAll(taxonSets.get(i))) {
+                j++;
+            }
+            nParent[i] = j;
+            children[j].add(i);
+        }
+
+        // make sure upper bounds of a child does not exceed the upper bound of its parent
+        for (int i = 0; i < isMonophyletic; i++) {
+            if (nParent[i] < isMonophyletic) {
+                if (m_bounds.get(i).upper > m_bounds.get(nParent[i]).upper) {
+                    m_bounds.get(i).upper = m_bounds.get(nParent[i]).upper - 1e-100;
+                }
+            }
+        }
+
+
+        final PopulationFunction popFunction = populationFunctionInput.get();
+
+        simulateTree(sTaxa, popFunction);
+        if (rootHeightInput.get() != null) {
+        	scaleToFit(rootHeightInput.get() / root.getHeight(), root);
+        }
+
+        nodeCount = 2 * sTaxa.size() - 1;
+        internalNodeCount = sTaxa.size() - 1;
+        leafNodeCount = sTaxa.size();
+        initArrays();
+
+        if (m_initial.get() != null) {
+            m_initial.get().assignFromWithoutID(this);
+        }
+    }
+
+    private void scaleToFit(double scale, Node node) {
+        if (!node.isLeaf()) {
+	    	double oldHeight = node.getHeight();
+	    	node.height *= scale;
+	        final Integer iConstraint = getDistrConstraint(node);
+	        if (iConstraint != null) {
+	            if (node.height < m_bounds.get(iConstraint).lower || node.height > m_bounds.get(iConstraint).upper) {
+	            	//revert scaling
+	            	node.height = oldHeight;
+	            	return;
+	            }
+	        }
+	        scaleToFit(scale, node.getLeft());
+	        scaleToFit(scale, node.getRight());
+	        if (node.height < Math.max(node.getLeft().getHeight(), node.getRight().getHeight())) {
+	        	// this can happen if a child node is constrained and the default tree is higher than desired
+	        	node.height = 1.0000001 * Math.max(node.getLeft().getHeight(), node.getRight().getHeight());
+	        }
+        }
+	}
+
+	//@Override
+    public void getInitialisedStateNodes(final List<StateNode> stateNodes) {
+        stateNodes.add(m_initial.get());
+    }
+
+    /**
+     * Simulates a coalescent tree, given a taxon list.
+     *
+     * @param taxa         the set of taxa to simulate a coalescent tree between
+     * @param demoFunction the demographic function to use
+     */
+    public void simulateTree(final Set<String> taxa, final PopulationFunction demoFunction) {
+        if (taxa.size() == 0)
+            return;
+
+        for (int attempts = 0; attempts < 1000; ++attempts) {
+            try {
+                nextNodeNr = nrOfTaxa;
+                final Set<Node> candidates = new HashSet<>();
+                int i = 0;
+                for (String taxon : taxa) {
+                    final Node node = new Node();
+                    node.setNr(i);
+                    node.setID(taxon);
+                    node.setHeight(0.0);
+                    candidates.add(node);
+                    i += 1;
+                }
+
+                if (m_initial.get() != null) {
+                    processCandidateTraits(candidates, m_initial.get().m_traitList.get());
+                } else {
+                    processCandidateTraits(candidates, m_traitList.get());
+                }
+
+                final Map<String,Node> allCandidates = new TreeMap<String,Node>();
+                for (Node node: candidates) {
+                    allCandidates.put(node.getID(),node);
+                }
+                root = simulateCoalescent(isMonophyletic, allCandidates, candidates, demoFunction);
+                return;
+            } catch (ConstraintViolatedException e) {
+                // need to generate another tree
+            	Log.warning.println("WARNING: Generating a random tree did not succeed. The most common reasons are:");
+            	Log.warning.println("WARNING: 1. there are conflicting monophyletic constraints, for example if both (A,B) "
+            			+ "and (B,C) must be monophyletic no tree will be able to meet these constraints at the same "
+            			+ "time. To fix this, carefully check all clade sets, especially the ones that are expected to "
+            			+ "be nested clades.");
+            	Log.warning.println("WARNING: 2. clade heights are constrained by an upper and lower bound, but the population size "
+            			+ "is too large, so it is very unlikely a generated treed does not violate these constraints. To "
+            			+ "fix this you can try to reduce the popultion size of the population model.");
+            	Log.warning.println("WARNING: Expect BEAST to crash if this is not fixed."); 
+            }
+        }
+    }
+    
+    /**
+     * Apply traits to a set of nodes.
+     * @param candidates List of nodes
+     * @param traitSets List of TraitSets to apply
+     */
+    private void processCandidateTraits(Set<Node> candidates, List<TraitSet> traitSets) {
+        for (TraitSet traitSet : traitSets) {
+            for (Node node : candidates) {
+                node.setMetaData(traitSet.getTraitName(), traitSet.getValue(node.getID()));
+            }
+        }
+    }
+
+
+    private Node simulateCoalescent(final int iIsMonophyleticNode, final Map<String,Node> allCandidates, final Set<Node> candidates, final PopulationFunction demoFunction)
+            throws ConstraintViolatedException {
+        final List<Node> remainingCandidates = new ArrayList<Node>();
+        final Set<String> taxaDone = new TreeSet<>();
+        for (final int iMonoNode : children[iIsMonophyleticNode]) {
+            // create list of leaf nodes for this monophyletic MRCA
+            final Set<Node> candidates2 = new HashSet<>();
+            final Set<String> bTaxonSet = taxonSets.get(iMonoNode);
+            for (String taxon : bTaxonSet) {
+                candidates2.add(allCandidates.get(taxon));
+            }
+
+            final Node MRCA = simulateCoalescent(iMonoNode, allCandidates, candidates2, demoFunction);
+            remainingCandidates.add(MRCA);
+
+            taxaDone.addAll(bTaxonSet);
+        }
+
+        for (final Node node : candidates) {
+            if (!taxaDone.contains(node.getID())) {
+                remainingCandidates.add(node);
+            }
+        }
+
+        final Node MRCA = simulateCoalescent(remainingCandidates, demoFunction);
+        return MRCA;
+    }
+
+    /**
+     * @param id the id to match
+     * @param nodes a list of nodes
+     * @return the node with the matching id;
+     */
+    private Node getNodeById(String id, List<Node> nodes) {
+        for (Node node : nodes) {
+            if (node.getID().equals(id)) return node;
+        }
+        return null;
+    }
+
+    /**
+     * @param nodes
+     * @param demographic
+     * @return the root node of the given array of nodes after simulation of the
+     *         coalescent under the given demographic model.
+     * @throws beast.evolution.tree.RandomTree.ConstraintViolatedException
+     */
+    public Node simulateCoalescent(final List<Node> nodes, final PopulationFunction demographic) throws ConstraintViolatedException {
+        // sanity check - disjoint trees
+
+        // if( ! Tree.Utils.allDisjoint(nodes) ) {
+        // throw new RuntimeException("non disjoint trees");
+        // }
+
+        if (nodes.size() == 0) {
+            throw new IllegalArgumentException("empty nodes set");
+        }
+
+        for (int attempts = 0; attempts < 1000; ++attempts) {
+            final List<Node> rootNode = simulateCoalescent(nodes, demographic, 0.0, Double.POSITIVE_INFINITY);
+            if (rootNode.size() == 1) {
+                return rootNode.get(0);
+            }
+        }
+
+        throw new RuntimeException("failed to merge trees after 1000 tries!");
+    }
+
+    public List<Node> simulateCoalescent(final List<Node> nodes, final PopulationFunction demographic, double currentHeight,
+                                         final double maxHeight) throws ConstraintViolatedException {
+        // If only one node, return it
+        // continuing results in an infinite loop
+        if (nodes.size() == 1)
+            return nodes;
+
+        final double[] heights = new double[nodes.size()];
+        for (int i = 0; i < nodes.size(); i++) {
+            heights[i] = nodes.get(i).getHeight();
+        }
+        final int[] indices = new int[nodes.size()];
+        HeapSort.sort(heights, indices);
+
+        // node list
+        nodeList.clear();
+        activeNodeCount = 0;
+        for (int i = 0; i < nodes.size(); i++) {
+            nodeList.add(nodes.get(indices[i]));
+        }
+        setCurrentHeight(currentHeight);
+
+        // get at least two tips
+        while (getActiveNodeCount() < 2) {
+            currentHeight = getMinimumInactiveHeight();
+            setCurrentHeight(currentHeight);
+        }
+
+        // simulate coalescent events
+        double nextCoalescentHeight = currentHeight
+                + PopulationFunction.Utils.getSimulatedInterval(demographic, getActiveNodeCount(), currentHeight);
+
+        // while (nextCoalescentHeight < maxHeight && (getNodeCount() > 1)) {
+        while (nextCoalescentHeight < maxHeight && (nodeList.size() > 1)) {
+
+            if (nextCoalescentHeight >= getMinimumInactiveHeight()) {
+                currentHeight = getMinimumInactiveHeight();
+                setCurrentHeight(currentHeight);
+            } else {
+                currentHeight = coalesceTwoActiveNodes(currentHeight, nextCoalescentHeight);
+            }
+
+            // if (getNodeCount() > 1) {
+            if (nodeList.size() > 1) {
+                // get at least two tips
+                while (getActiveNodeCount() < 2) {
+                    currentHeight = getMinimumInactiveHeight();
+                    setCurrentHeight(currentHeight);
+                }
+
+                // nextCoalescentHeight = currentHeight +
+                // DemographicFunction.Utils.getMedianInterval(demographic,
+                // getActiveNodeCount(), currentHeight);
+                nextCoalescentHeight = currentHeight
+                        + PopulationFunction.Utils.getSimulatedInterval(demographic, getActiveNodeCount(),
+                        currentHeight);
+            }
+        }
+
+        return nodeList;
+
+        // Node[] nodesLeft = new Node[nodeList.size()];
+        // for (int i = 0; i < nodesLeft.length; i++) {
+        // nodesLeft[i] = nodeList.get(i);
+        // }
+        //
+        // return nodesLeft;
+    }
+
+    /**
+     * @return the height of youngest inactive node.
+     */
+    private double getMinimumInactiveHeight() {
+        if (activeNodeCount < nodeList.size()) {
+            return (nodeList.get(activeNodeCount)).getHeight();
+        } else
+            return Double.POSITIVE_INFINITY;
+    }
+
+    /**
+     * Set the current height.
+     * @param height
+     */
+    private void setCurrentHeight(final double height) {
+        while (getMinimumInactiveHeight() <= height) {
+            activeNodeCount += 1;
+        }
+    }
+
+    /**
+     * @return the number of active nodes (equate to lineages)
+     */
+    private int getActiveNodeCount() {
+        return activeNodeCount;
+    }
+
+    //
+    // /**
+    // * @return the total number of nodes both active and inactive
+    // */
+    // private int getNodeCount() {
+    // return nodeList.size();
+    // }
+    //
+
+    /**
+     * Coalesce two nodes in the active list. This method removes the two
+     * (randomly selected) active nodes and replaces them with the new node at
+     * the top of the active list.
+     * @param fMinHeight
+     * @param height
+     * @return
+     */
+    private double coalesceTwoActiveNodes(final double fMinHeight, double height) throws ConstraintViolatedException {
+        final int node1 = Randomizer.nextInt(activeNodeCount);
+        int node2 = node1;
+        while (node2 == node1) {
+            node2 = Randomizer.nextInt(activeNodeCount);
+        }
+
+        final Node left = nodeList.get(node1);
+        final Node right = nodeList.get(node2);
+
+        final Node newNode = new Node();
+//		System.err.println(2 * m_taxa.get().getNrTaxa() - nodeList.size());
+        newNode.setNr(nextNodeNr++);
+        newNode.setHeight(height);
+        newNode.setLeft(left);
+        left.setParent(newNode);
+        newNode.setRight(right);
+        right.setParent(newNode);
+
+        nodeList.remove(left);
+        nodeList.remove(right);
+
+        activeNodeCount -= 2;
+
+        nodeList.add(activeNodeCount, newNode);
+
+        activeNodeCount += 1;
+
+        // check if there is a calibration on this node
+        final Integer iConstraint = getDistrConstraint(newNode);
+        if (iConstraint != null) {
+//			for (int i = 0; i < 1000; i++) {
+//				try {
+//					height = distr.sample(1)[0][0];
+//				} catch (Exception e) {
+//					e.printStackTrace();
+//				}
+//				if (height > fMinHeight) {
+//					break;
+//				}
+//			} 
+            final double fMin = Math.max(m_bounds.get(iConstraint).lower, fMinHeight);
+            final double fMax = m_bounds.get(iConstraint).upper;
+            if (fMax < fMin) {
+                // failed to draw a matching height from the MRCA distribution
+                // TODO: try to scale rest of tree down
+                throw new ConstraintViolatedException();
+            }
+            if (height < fMin || height > fMax) {
+            	if (fMax == Double.POSITIVE_INFINITY) {
+            		height = fMin + 0.1;
+            	} else {
+            		height = fMin + Randomizer.nextDouble() * (fMax - fMin);
+            	}
+                newNode.setHeight(height);
+            }
+        }
+
+
+        if (getMinimumInactiveHeight() < height) {
+            throw new RuntimeException(
+                    "This should never happen! Somehow the current active node is older than the next inactive node!");
+        }
+        return height;
+    }
+
+    private Integer getDistrConstraint(final Node node) {
+        for (int i = 0; i < distributions.size(); i++) {
+            if (distributions.get(i) != null) {
+                final Set<String> taxonSet = taxonSets.get(i);
+                if (traverse(node, taxonSet, taxonSet.size(), new int[1]) == nrOfTaxa + 127) {
+                    return i;
+                }
+            }
+        }
+        return null;
+    }
+
+    int traverse(final Node node, final Set<String> MRCATaxonSet, final int nNrOfMRCATaxa, final int[] nTaxonCount) {
+        if (node.isLeaf()) {
+            nTaxonCount[0]++;
+            if (MRCATaxonSet.contains(node.getID())) {
+                return 1;
+            } else {
+                return 0;
+            }
+        } else {
+            int iTaxons = traverse(node.getLeft(), MRCATaxonSet, nNrOfMRCATaxa, nTaxonCount);
+            final int nLeftTaxa = nTaxonCount[0];
+            nTaxonCount[0] = 0;
+            if (node.getRight() != null) {
+                iTaxons += traverse(node.getRight(), MRCATaxonSet, nNrOfMRCATaxa, nTaxonCount);
+                final int nRightTaxa = nTaxonCount[0];
+                nTaxonCount[0] = nLeftTaxa + nRightTaxa;
+            }
+            if (iTaxons == nrOfTaxa + 127) {
+                iTaxons++;
+            }
+            if (iTaxons == nNrOfMRCATaxa) {
+                // we are at the MRCA, return magic nr
+                return nrOfTaxa + 127;
+            }
+            return iTaxons;
+        }
+    }
+
+
+    @Override
+    public String[] getTaxaNames() {
+        if (m_sTaxaNames == null) {
+            final List<String> sTaxa;
+            if (taxaInput.get() != null) {
+                sTaxa = taxaInput.get().getTaxaNames();
+            } else {
+                sTaxa = m_taxonset.get().asStringList();
+            }
+            m_sTaxaNames = sTaxa.toArray(new String[sTaxa.size()]);
+        }
+        return m_sTaxaNames;
+    }
+
+    final private ArrayList<Node> nodeList = new ArrayList<Node>();
+    private int activeNodeCount = 0;
+
+
+}
\ No newline at end of file
diff --git a/src/beast/evolution/tree/TraitSet.java b/src/beast/evolution/tree/TraitSet.java
new file mode 100644
index 0000000..4b4e608
--- /dev/null
+++ b/src/beast/evolution/tree/TraitSet.java
@@ -0,0 +1,256 @@
+package beast.evolution.tree;
+
+import java.util.Arrays;
+import java.util.Date;
+import java.util.HashMap;
+import java.time.LocalDate;
+import java.time.format.DateTimeFormatter;
+import java.time.format.DateTimeParseException;
+import java.util.List;
+import java.util.Map;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.BEASTObject;
+import beast.core.Input.Validate;
+import beast.core.util.Log;
+import beast.evolution.alignment.TaxonSet;
+
+
+ at Description("A trait set represent a collection of properties of taxons, for the use of initializing a tree. " +
+        "The traits are represented as text content in taxon=value form, for example, for a date trait, we" +
+        "could have a content of chimp=1950,human=1991,neander=-10000. All white space is ignored, so they can" +
+        "be put on multiple tabbed lines in the XML. " +
+        "The type of node in the tree determines what happes with this information. The default Node only " +
+        "recognizes 'date', 'date-forward' and 'date-backward' as a trait, but by creating custom Node classes " +
+        "other traits can be supported as well.")
+public class TraitSet extends BEASTObject {
+
+    public enum Units {
+        year, month, day
+    }
+
+    public Input<String> traitNameInput = new Input<String>("traitname", "name of the trait, used as meta data name for the tree. " +
+            "Special traitnames that are recognized are '" + DATE_TRAIT + "','" + DATE_FORWARD_TRAIT + "' and '" + DATE_BACKWARD_TRAIT + "'.", Validate.REQUIRED);
+    public Input<Units> unitsInput = new Input<Units>("units", "name of the units in which values are posed, " +
+            "used for conversion to a real value. This can be " + Arrays.toString(Units.values()) + " (default 'year')", Units.year, Units.values());
+    public Input<String> traitsInput = new Input<String>("value", "traits encoded as taxon=value pairs separated by commas", Validate.REQUIRED);
+    public Input<TaxonSet> taxaInput = new Input<TaxonSet>("taxa", "contains list of taxa to map traits to", Validate.REQUIRED);
+
+    public Input<String> dateTimeFormatInput = new Input<String>("dateFormat", "the date/time format to be parsed, (e.g., 'dd/M/yyyy')");
+
+    final public static String DATE_TRAIT = "date";
+    final public static String DATE_FORWARD_TRAIT = "date-forward";
+    final public static String DATE_BACKWARD_TRAIT = "date-backward";
+
+    /**
+     * String values of taxa in order of taxons in alignment*
+     */
+    protected String[] taxonValues;
+    
+    /**
+     * double representation of taxa value *
+     */
+    double[] values;
+    double minValue;
+    double maxValue;
+    
+    Map<String, Integer> map;
+
+    /**
+     * Whether or not values are ALL numeric.
+     */
+    boolean numeric = true;
+    
+    @Override
+    public void initAndValidate() throws Exception {
+        if (traitsInput.get().matches("^\\s*$")) {
+            return;
+        }
+
+        // first, determine taxon numbers associated with traits
+        // The Taxon number is the index in the alignment, and
+        // used as node number in a tree.
+        map = new HashMap<String, Integer>();
+        List<String> labels = taxaInput.get().asStringList();
+        String[] traits = traitsInput.get().split(",");
+        taxonValues = new String[labels.size()];
+        values = new double[labels.size()];
+        for (String trait : traits) {
+            trait = trait.replaceAll("\\s+", " ");
+            String[] sStrs = trait.split("=");
+            if (sStrs.length != 2) {
+                throw new Exception("could not parse trait: " + trait);
+            }
+            String taxonID = normalize(sStrs[0]);
+            int taxonNr = labels.indexOf(taxonID);
+            if (taxonNr < 0) {
+                throw new Exception("Trait (" + taxonID + ") is not a known taxon. Spelling error perhaps?");
+            }
+            taxonValues[taxonNr] = normalize(sStrs[1]);
+            values[taxonNr] = parseDouble(taxonValues[taxonNr]);
+            map.put(taxonID, taxonNr);
+            
+            if (Double.isNaN(values[taxonNr]))
+                numeric = false;
+        }
+
+        // sanity check: did we cover all taxa?
+        for (int i = 0; i < labels.size(); i++) {
+            if (taxonValues[i] == null) {
+                Log.warning.println("WARNING: no trait specified for " + labels.get(i));
+            }
+        }
+
+        // find extremes
+        minValue = values[0];
+        maxValue = values[0];
+        for (double fValue : values) {
+            minValue = Math.min(minValue, fValue);
+            maxValue = Math.max(maxValue, fValue);
+        }
+
+        if (traitNameInput.get().equals(DATE_TRAIT) || traitNameInput.get().equals(DATE_FORWARD_TRAIT)) {
+            for (int i = 0; i < labels.size(); i++) {
+                values[i] = maxValue - values[i];
+            }
+        }
+
+        if (traitNameInput.get().equals(DATE_BACKWARD_TRAIT)) {
+            for (int i = 0; i < labels.size(); i++) {
+                values[i] = values[i] - minValue;
+            }
+        }
+
+        for (int i = 0; i < labels.size(); i++) {
+            Log.info.println(labels.get(i) + " = " + taxonValues[i] + " (" + (values[i]) + ")");
+        }
+    } // initAndValidate
+
+    /**
+     * some getters and setters *
+     */
+    public String getTraitName() {
+        return traitNameInput.get();
+    }
+
+    @Deprecated // use getStringValue by name instead
+    public String getStringValue(int iTaxonNr) {
+        return taxonValues[iTaxonNr];
+    }
+
+    @Deprecated // use getValue by name instead
+    public double getValue(int iTaxonNr) {
+        if (values == null) {
+            return 0;
+        }
+        return values[iTaxonNr];
+    }
+
+    public String getStringValue(String taxonName) {
+        if (taxonValues == null || map == null || map.get(taxonName) == null) {
+            return null;
+        }
+        return taxonValues[map.get(taxonName)];
+
+    }
+
+    public double getValue(String taxonName) {
+        if (values == null || map == null || map.get(taxonName) == null) {
+                return 0;
+        }
+        //Log.trace.println("Trait " + taxonName + " => " + values[map.get(taxonName)]);
+        return values[map.get(taxonName)];
+    }
+
+    /**
+     * see if we can convert the string to a double value *
+     */
+    private double parseDouble(String sStr) throws Exception {
+        // default, try to interpret the string as a number
+        try {
+            return Double.parseDouble(sStr);
+        } catch (NumberFormatException e) {
+            // does not look like a number
+                if (traitNameInput.get().equals(DATE_TRAIT) ||
+                        traitNameInput.get().equals(DATE_FORWARD_TRAIT) ||
+                        traitNameInput.get().equals(DATE_BACKWARD_TRAIT)) {
+
+                        try {
+                            double year;
+                            if (dateTimeFormatInput.get() == null) {
+                                if (sStr.matches(".*[a-zA-Z].*")) {
+                                        sStr = sStr.replace('/', '-');
+                                }
+                                long date = Date.parse(sStr);
+                                year = 1970.0 + date / (60.0 * 60 * 24 * 365 * 1000);
+                                System.err.println("No date/time format provided, using default parsing: '" + sStr + "' parsed as '" + year + "'");
+                            } else {
+                                DateTimeFormatter formatter = DateTimeFormatter.ofPattern(dateTimeFormatInput.get());
+                                LocalDate date = LocalDate.parse(sStr, formatter);
+
+                                System.err.println("Using format '" + dateTimeFormatInput.get() + "' to parse '" + sStr +
+                                        "' as: " + (date.getYear() + (date.getDayOfYear()-1.0) / (date.isLeapYear() ? 366.0 : 365.0)));
+
+                                year = date.getYear() + (date.getDayOfYear()-1.0) / (date.isLeapYear() ? 366.0 : 365.0);
+                            }
+
+                            switch (unitsInput.get()) {
+                                case month:
+                                    return year * 12.0;
+                                case day:
+                                    return year * 365;
+                                default:
+                                    return year;
+                            }
+                        } catch (DateTimeParseException e2) {
+                            System.err.println("Failed to parse date '" + sStr + "' using format '" + dateTimeFormatInput.get() + "'");
+                            System.exit(1);
+                        }
+                    }
+                }
+        //return 0;
+        return Double.NaN;
+    } // parseStrings
+
+    /**
+     * remove start and end spaces
+     */
+    String normalize(String sStr) {
+        if (sStr.charAt(0) == ' ') {
+            sStr = sStr.substring(1);
+        }
+        if (sStr.endsWith(" ")) {
+            sStr = sStr.substring(0, sStr.length() - 1);
+        }
+        return sStr;
+    }
+
+    public double getDate(double fHeight) {
+        if (traitNameInput.get().equals(DATE_TRAIT) || traitNameInput.get().equals(DATE_FORWARD_TRAIT)) {
+            return maxValue - fHeight;
+        }
+
+        if (traitNameInput.get().equals(DATE_BACKWARD_TRAIT)) {
+            return minValue + fHeight;
+        }
+        return fHeight;
+    }
+    
+    /**
+     * Determines whether trait is recognised as specifying taxa dates.
+     * @return true if this is a date trait.
+     */
+    public boolean isDateTrait() {
+        return traitNameInput.get().equals(DATE_TRAIT)
+                || traitNameInput.get().equals(DATE_FORWARD_TRAIT)
+                || traitNameInput.get().equals(DATE_BACKWARD_TRAIT);
+    }
+
+    /**
+     * @return true if trait values are (all) numeric.
+     */
+    public boolean isNumeric() {
+        return numeric;
+    }
+} // class TraitSet
diff --git a/src/beast/evolution/tree/Tree.java b/src/beast/evolution/tree/Tree.java
new file mode 100644
index 0000000..3ff3565
--- /dev/null
+++ b/src/beast/evolution/tree/Tree.java
@@ -0,0 +1,956 @@
+package beast.evolution.tree;
+
+import beast.core.*;
+import beast.evolution.alignment.TaxonSet;
+import beast.util.TreeParser;
+
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+
+ at Description("Tree (the T in BEAST) representing gene beast.tree, species"
+        + " beast.tree, language history, or other time-beast.tree"
+        + " relationships among sequence data.")
+public class Tree extends StateNode implements TreeInterface {
+    public Input<Tree> m_initial = new Input<Tree>("initial", "tree to start with");
+    public Input<List<TraitSet>> m_traitList = new Input<List<TraitSet>>("trait",
+            "trait information for initializing traits (like node dates) in the tree",
+            new ArrayList<TraitSet>());
+    public Input<TaxonSet> m_taxonset = new Input<TaxonSet>("taxonset",
+            "set of taxa that correspond to the leafs in the tree");
+    public Input<String> nodeTypeInput = new Input<String>("nodetype",
+            "type of the nodes in the beast.tree", Node.class.getName());
+
+    /**
+     * state of dirtiness of a node in the tree
+     * DIRTY means a property on the node has changed, but not the topology. "property" includes the node height
+     *       and that branch length to its parent.
+     * FILTHY means the nodes' parent or child has changed.
+     */
+    public static final int IS_CLEAN = 0, IS_DIRTY = 1, IS_FILTHY = 2;
+
+    /**
+     * counters of number of nodes, nodeCount = internalNodeCount + leafNodeCount *
+     */
+    protected int nodeCount = -1;
+    protected int internalNodeCount = -1;
+    protected int leafNodeCount = -1;
+
+    /**
+     * node representation of the beast.tree *
+     */
+    protected beast.evolution.tree.Node root;
+    protected beast.evolution.tree.Node storedRoot;
+
+    /**
+     * array of all nodes in the tree *
+     */
+    protected Node[] m_nodes = null;
+
+    protected Node[] m_storedNodes = null;
+
+    /**
+     * array of taxa names for the nodes in the tree
+     * such that m_sTaxaNames[node.getNr()] == node.getID()*
+     */
+    String[] m_sTaxaNames = null;
+
+    /**
+     * Trait set which specifies leaf node times.
+     */
+    protected TraitSet timeTraitSet = null;
+
+    /*
+     * Whether or not TraitSets have been processed.
+     */
+    protected boolean traitsProcessed = false;
+
+    @Override
+    public void initAndValidate() throws Exception {
+        if (m_initial.get() != null && !(this instanceof StateNodeInitialiser)) {
+        	throw new RuntimeException("initial-input should be specified for tree that is not a StateNodeInitialiser");
+//            final Tree other = m_initial.get();
+//            root = other.root.copy();
+//            nodeCount = other.nodeCount;
+//            internalNodeCount = other.internalNodeCount;
+//            leafNodeCount = other.leafNodeCount;
+        }
+
+        if (nodeCount < 0) {
+            if (m_taxonset.get() != null) {
+                makeCaterpillar(0, 1, false);
+            } else {
+                // make dummy tree with a single root node
+                root = newNode();
+                root.labelNr = 0;
+                root.height = 0;
+                root.m_tree = this;
+                nodeCount = 1;
+                internalNodeCount = 0;
+                leafNodeCount = 1;
+            }
+        }
+
+        if (nodeCount >= 0) {
+            initArrays();
+        }
+
+        processTraits(m_traitList.get());
+
+        // Ensure tree is compatible with time trait.
+        if (timeTraitSet != null)
+            adjustTreeNodeHeights(root);
+        
+        // ensure all nodes have their taxon names set up
+        String [] taxa = getTaxaNames();
+        for (int i = 0; i < getNodeCount() && i < taxa.length; i++) {
+        	if (taxa[i] != null)
+        		m_nodes[i].setID(taxa[i]);
+        }
+    }
+
+    public void makeCaterpillar(final double minInternalHeight, final double step, final boolean finalize) {
+        // make a caterpillar
+        final List<String> sTaxa = m_taxonset.get().asStringList();
+        Node left = newNode();
+        left.labelNr = 0;
+        left.height = 0;
+        left.setID(sTaxa.get(0));
+        for (int i = 1; i < sTaxa.size(); i++) {
+            final Node right = newNode();
+            right.labelNr = i;
+            right.height = 0;
+            right.setID(sTaxa.get(i));
+            final Node parent = newNode();
+            parent.labelNr = sTaxa.size() + i - 1;
+            parent.height = minInternalHeight + i * step;
+            left.parent = parent;
+            parent.setLeft(left);
+            right.parent = parent;
+            parent.setRight(right);
+            left = parent;
+        }
+        root = left;
+        leafNodeCount = sTaxa.size();
+        nodeCount = leafNodeCount * 2 - 1;
+        internalNodeCount = leafNodeCount - 1;
+
+        if (finalize) {
+            initArrays();
+        }
+    }
+
+    /**
+     * Process trait sets.
+     *
+     * @param traitList List of trait sets.
+     */
+    protected void processTraits(List<TraitSet> traitList) {
+        for (TraitSet traitSet : traitList) {
+            for (Node node : getExternalNodes()) {
+            	String id = node.getID();
+            	if (id != null) {
+                    node.setMetaData(traitSet.getTraitName(), traitSet.getValue(id));
+            	}
+            }
+            if (traitSet.isDateTrait())
+                timeTraitSet = traitSet;
+        }
+        traitsProcessed = true;
+    }
+
+    /**
+     * Overridable method to construct new node object of the specific type
+     * defined by nodeTypeInput.
+     *
+     * @return new node object.
+     */
+    protected Node newNode() {
+        try {
+            return (Node) Class.forName(nodeTypeInput.get()).newInstance();
+        } catch (Exception e) {
+            throw new RuntimeException("Cannot create node of type "
+                    + nodeTypeInput.get() + ": " + e.getMessage());
+        }
+        //return new NodeData();
+    }
+
+    protected void initArrays() {
+        // initialise tree-as-array representation + its stored variant
+        m_nodes = new Node[nodeCount];
+        listNodes(root, m_nodes);
+        m_storedNodes = new Node[nodeCount];
+        final Node copy = root.copy();
+        listNodes(copy, m_storedNodes);
+    }
+
+
+    public Tree() {
+    }
+
+    public Tree(final Node rootNode) {
+        setRoot(rootNode);
+        initArrays();
+    }
+
+    /**
+     * Construct a tree from newick string -- will not automatically adjust tips to zero.
+     */
+    public Tree(final String sNewick) throws Exception {
+        this(new TreeParser(sNewick).getRoot());
+    }
+
+    /**
+     * Ensure no negative branch lengths exist in tree.  This can occur if
+     * leaf heights given as a trait are incompatible with the existing tree.
+     */
+    final static double EPSILON = 0.0000001;
+
+    protected void adjustTreeNodeHeights(final Node node) {
+        if (!node.isLeaf()) {
+            for (final Node child : node.getChildren()) {
+                adjustTreeNodeHeights(child);
+            }
+            for (final Node child : node.getChildren()) {
+                final double minHeight = child.getHeight() + EPSILON;
+                if (node.height < minHeight) {
+                    node.height = minHeight;
+                }
+            }
+        }
+    }
+
+
+    /**
+     * getters and setters
+     *
+     * @return the number of nodes in the beast.tree
+     */
+    public int getNodeCount() {
+        if (nodeCount < 0) {
+            nodeCount = this.root.getNodeCount();
+        }
+
+        //System.out.println("nodeCount=" + nodeCount);
+        return nodeCount;
+    }
+
+    public int getInternalNodeCount() {
+        if (internalNodeCount < 0) {
+            internalNodeCount = root.getInternalNodeCount();
+        }
+        return internalNodeCount;
+    }
+
+    public int getLeafNodeCount() {
+        //TODO will this caching work if trees can have random numbers of tips during MCMC
+        if (leafNodeCount < 0) {
+            leafNodeCount = root.getLeafNodeCount();
+        }
+        return leafNodeCount;
+    }
+
+    /**
+     * @return a list of external (leaf) nodes contained in this tree
+     */
+    public List<Node> getExternalNodes() {
+        final ArrayList<Node> externalNodes = new ArrayList<Node>();
+        for (int i = 0; i < getNodeCount(); i++) {
+            final Node node = getNode(i);
+            if (node.isLeaf()) externalNodes.add(node);
+        }
+        return externalNodes;
+    }
+
+    /**
+     * @return a list of internal (ancestral) nodes contained in this tree, including the root node
+     */
+    public List<Node> getInternalNodes() {
+        final ArrayList<Node> internalNodes = new ArrayList<Node>();
+        for (int i = 0; i < getNodeCount(); i++) {
+            final Node node = getNode(i);
+            if (!node.isLeaf()) internalNodes.add(node);
+        }
+        return internalNodes;
+    }
+
+    public Node getRoot() {
+        return root;
+    }
+
+    public void setRoot(final Node root) {
+        this.root = root;
+        nodeCount = this.root.getNodeCount();
+        // ensure root is the last node
+        if (m_nodes != null && root.labelNr != m_nodes.length - 1) {
+            final int rootPos = m_nodes.length - 1;
+            Node tmp = m_nodes[rootPos];
+            m_nodes[rootPos] = root;
+            m_nodes[root.labelNr] = tmp;
+            tmp.labelNr = root.labelNr;
+            m_nodes[rootPos].labelNr = rootPos;
+        }
+    }
+
+    /**
+     * Sets root without recalculating nodeCount or ensuring that root is the last node in the internal array.
+     * Currently only used by sampled ancestor tree operators. Use carefully!
+     *
+     * @param root the new root node
+     */
+    public void setRootOnly(final Node root) {
+        //TODO should we flag this with startEditing since it is an operator call?
+
+        this.root = root;
+    }
+
+    public Node getNode(final int iNodeNr) {
+        return m_nodes[iNodeNr];
+        //return getNode(iNodeNr, root);
+    }
+
+    @Deprecated
+    /**
+     * @returns an array of taxon names in order of their node numbers.
+     */
+    public String[] getTaxaNames() {
+         if (m_sTaxaNames == null || (m_sTaxaNames.length == 1 && m_sTaxaNames[0] == null) || m_sTaxaNames.length == 0) {
+            final TaxonSet taxonSet = m_taxonset.get();
+            if (taxonSet != null) {
+                final List<String> txs = taxonSet.asStringList();
+                m_sTaxaNames = txs.toArray(new String[txs.size()]);
+            } else {
+                m_sTaxaNames = new String[getNodeCount()];
+                collectTaxaNames(getRoot());
+                List<String> taxaNames = new ArrayList<>();
+                for (String name : m_sTaxaNames) {
+                	if (name != null) {
+                		taxaNames.add(name);
+                	}
+                }
+                m_sTaxaNames = taxaNames.toArray(new String[]{});
+                
+            }
+        }
+
+        // sanity check
+        if (m_sTaxaNames.length == 1 && m_sTaxaNames[0] == null) {
+            System.err.println("WARNING: tree interrogated for taxa, but the tree was not initialised properly. To fix this, specify the taxonset input");
+        }
+        return m_sTaxaNames;
+    }
+
+    void collectTaxaNames(final Node node) {
+        if (node.getID() != null) {
+            m_sTaxaNames[node.getNr()] = node.getID();
+        }
+        if (node.isLeaf()) {
+            if (node.getID() == null) {
+            	node.setID("node" + node.getNr());
+            }
+        } else {
+        	for (Node child : node.getChildren()) {
+        		collectTaxaNames(child);
+        	}
+        }
+    }
+
+
+    /**
+     * copy meta data matching sPattern to double array
+     *
+     * @param node     the node
+     * @param fT       the double array to be filled with meta data
+     * @param sPattern the name of the meta data
+     */
+    public void getMetaData(final Node node, final Double[] fT, final String sPattern) {
+        fT[Math.abs(node.getNr())] = (Double) node.getMetaData(sPattern);
+        if (!node.isLeaf()) {
+            getMetaData(node.getLeft(), fT, sPattern);
+            if (node.getRight() != null) {
+                getMetaData(node.getRight(), fT, sPattern);
+            }
+        }
+    }
+
+    /**
+     * copy meta data matching sPattern to double array
+     *
+     * @param node     the node
+     * @param fT       the integer array to be filled with meta data
+     * @param sPattern the name of the meta data
+     */
+    public void getMetaData(final Node node, final Integer[] fT, final String sPattern) {
+        fT[Math.abs(node.getNr())] = (Integer) node.getMetaData(sPattern);
+        if (!node.isLeaf()) {
+            getMetaData(node.getLeft(), fT, sPattern);
+            if (node.getRight() != null) {
+                getMetaData(node.getRight(), fT, sPattern);
+            }
+        }
+    }
+
+
+    /**
+     * traverse tree and assign meta-data values in fT to nodes in the
+     * tree to the meta-data field represented by the given pattern.
+     * This only has an effect when setMetadata() in a subclass
+     * of Node know how to process such value.
+     */
+    public void setMetaData(final Node node, final Double[] fT, final String sPattern) {
+        node.setMetaData(sPattern, fT[Math.abs(node.getNr())]);
+        if (!node.isLeaf()) {
+            setMetaData(node.getLeft(), fT, sPattern);
+            if (node.getRight() != null) {
+                setMetaData(node.getRight(), fT, sPattern);
+            }
+        }
+    }
+
+
+    /**
+     * convert tree to array representation *
+     */
+    void listNodes(final Node node, final Node[] nodes) {
+        nodes[node.getNr()] = node;
+        node.m_tree = this;  //(JH) I don't understand this code
+
+        // (JH) why not  node.children, we don't keep it around??
+        for (final Node child : node.getChildren()) {
+            listNodes(child, nodes);
+        }
+    }
+
+//    private int
+//    getNodesPostOrder(final Node node, final Node[] nodes, int pos) {
+//        node.m_tree = this;
+//        for (final Node child : node.children) {
+//            pos = getNodesPostOrder(child, nodes, pos);
+//        }
+//        nodes[pos] = node;
+//        return pos + 1;
+//    }
+
+//    /**
+//     * @param node  top of tree/sub tree (null defaults to whole tree)
+//     * @param nodes array to fill (null will result in creating a new one)
+//     * @return tree nodes in post-order, children before parents
+//     */
+//    public Node[] listNodesPostOrder(Node node, Node[] nodes) {
+//        if (node == null) {
+//            node = root;
+//        }
+//        if (nodes == null) {
+//            final int n = (node == root) ? nodeCount : node.getNodeCount();
+//            nodes = new Node[n];
+//        }
+//        getNodesPostOrder(node, nodes, 0);
+//        return nodes;
+//    }
+
+    protected Node[] postCache = null;
+    public Node[] listNodesPostOrder(Node node, Node[] nodes) {
+        if( node != null ) {
+            return TreeInterface.super.listNodesPostOrder(node, nodes);
+        }
+        if( postCache == null ) {
+            postCache = TreeInterface.super.listNodesPostOrder(node, nodes);
+        }
+        return postCache;
+    }
+
+    /**
+     * @return list of nodes in array format.
+     *         *
+     */
+    public Node[] getNodesAsArray() {
+        return m_nodes;
+    }
+
+    /**
+     * deep copy, returns a completely new tree
+     *
+     * @return a deep copy of this beast.tree.
+     */
+    @Override
+    public Tree copy() {
+        Tree tree = new Tree();
+        tree.setID(getID());
+        tree.index = index;
+        tree.root = root.copy();
+        tree.nodeCount = nodeCount;
+        tree.internalNodeCount = internalNodeCount;
+        tree.leafNodeCount = leafNodeCount;
+        return tree;
+    }
+
+    /**
+     * copy of all values into existing tree *
+     */
+    @Override
+    public void assignTo(final StateNode other) {
+        final Tree tree = (Tree) other;
+        final Node[] nodes = new Node[nodeCount];
+        listNodes(tree.root, nodes);
+        tree.setID(getID());
+        //tree.index = index;
+        root.assignTo(nodes);
+        tree.root = nodes[root.getNr()];
+        tree.nodeCount = nodeCount;
+        tree.internalNodeCount = internalNodeCount;
+        tree.leafNodeCount = leafNodeCount;
+    }
+
+    /**
+     * copy of all values from existing tree *
+     */
+    @Override
+    public void assignFrom(final StateNode other) {
+        final Tree tree = (Tree) other;
+        final Node[] nodes = new Node[tree.getNodeCount()];//tree.getNodesAsArray();
+        for (int i = 0; i < tree.getNodeCount(); i++) {
+            nodes[i] = newNode();
+        }
+        setID(tree.getID());
+        //index = tree.index;
+        root = nodes[tree.root.getNr()];
+        root.assignFrom(nodes, tree.root);
+        root.parent = null;
+        nodeCount = tree.nodeCount;
+        internalNodeCount = tree.internalNodeCount;
+        leafNodeCount = tree.leafNodeCount;
+        initArrays();
+    }
+
+    /**
+     * as assignFrom, but only copy tree structure *
+     */
+    @Override
+    public void assignFromFragile(final StateNode other) {
+        final Tree tree = (Tree) other;
+        if (m_nodes == null) {
+            initArrays();
+        }
+        root = m_nodes[tree.root.getNr()];
+        final Node[] otherNodes = tree.m_nodes;
+        final int iRoot = root.getNr();
+        assignFrom(0, iRoot, otherNodes);
+        root.height = otherNodes[iRoot].height;
+        root.parent = null;
+        if (otherNodes[iRoot].getLeft() != null) {
+            root.setLeft(m_nodes[otherNodes[iRoot].getLeft().getNr()]);
+        } else {
+            root.setLeft(null);
+        }
+        if (otherNodes[iRoot].getRight() != null) {
+            root.setRight(m_nodes[otherNodes[iRoot].getRight().getNr()]);
+        } else {
+            root.setRight(null);
+        }
+        assignFrom(iRoot + 1, nodeCount, otherNodes);
+    }
+
+    /**
+     * helper to assignFromFragile *
+     */
+    private void assignFrom(final int iStart, final int iEnd, final Node[] otherNodes) {
+        for (int i = iStart; i < iEnd; i++) {
+            Node sink = m_nodes[i];
+            Node src = otherNodes[i];
+            sink.height = src.height;
+            sink.parent = m_nodes[src.parent.getNr()];
+            if (src.getLeft() != null) {
+                sink.setLeft(m_nodes[src.getLeft().getNr()]);
+                if (src.getRight() != null) {
+                    sink.setRight(m_nodes[src.getRight().getNr()]);
+                } else {
+                    sink.setRight(null);
+                }
+            }
+        }
+    }
+
+
+    public String toString() {
+        return root.toString();
+    }
+
+
+    /**
+     * StateNode implementation
+     */
+    @Override
+    public void setEverythingDirty(final boolean bDirty) {
+        setSomethingIsDirty(bDirty);
+        if (!bDirty) {
+            for( Node n : m_nodes ) {
+                n.isDirty = IS_CLEAN;
+            }
+          //  root.makeAllDirty(IS_CLEAN);
+        } else {
+            for( Node n : m_nodes ) {
+                n.isDirty = IS_FILTHY;
+            }
+        //    root.makeAllDirty(IS_FILTHY);
+        }
+    }
+
+    @Override
+    public int scale(final double fScale) throws Exception {
+        root.scale(fScale);
+        return getInternalNodeCount()- getDirectAncestorNodeCount();
+    }
+
+
+//    /**
+//     * The same as scale but with option to scale all sampled nodes
+//     * @param fScale
+//     * @param scaleSNodes if true all sampled nodes are scaled. Note, the most recent node is considered to
+//     *                    have height 0.
+//     * @return
+//     * @throws Exception
+//     */
+//    public int scale(double fScale, boolean scaleSNodes) throws Exception {
+//        ((ZeroBranchSANode)root).scale(fScale, scaleSNodes);
+//        if (scaleSNodes) {
+//            return getNodeCount() - 1 - getDirectAncestorNodeCount();
+//        } else {
+//            return getInternalNodeCount() - getDirectAncestorNodeCount();
+//        }
+//    }
+
+    /** Loggable interface implementation follows **/
+
+    /**
+     * print translate block for NEXUS beast.tree file
+     */
+    public static void printTranslate(final Node node, final PrintStream out, final int nNodeCount) {
+        final List<String> translateLines = new ArrayList<String>();
+        printTranslate(node, translateLines, nNodeCount);
+        Collections.sort(translateLines);
+        for (final String sLine : translateLines) {
+            out.println(sLine);
+        }
+    }
+
+    static public int taxaTranslationOffset = 1;
+
+    /**
+     * need this helper so that we can sort list of entries *
+     */
+    static void printTranslate(Node node, List<String> translateLines, int nNodeCount) {
+        if (node.isLeaf()) {
+            final String sNr = (node.getNr() + taxaTranslationOffset) + "";
+            String sLine = "\t\t" + "    ".substring(sNr.length()) + sNr + " " + node.getID();
+            if (node.getNr() < nNodeCount) {
+                sLine += ",";
+            }
+            translateLines.add(sLine);
+        } else {
+            printTranslate(node.getLeft(), translateLines, nNodeCount);
+            if (node.getRight() != null) {
+                printTranslate(node.getRight(), translateLines, nNodeCount);
+            }
+        }
+    }
+
+    public static void printTaxa(final Node node, final PrintStream out, final int nNodeCount) {
+        final List<String> translateLines = new ArrayList<String>();
+        printTranslate(node, translateLines, nNodeCount);
+        Collections.sort(translateLines);
+        for (String sLine : translateLines) {
+            sLine = sLine.split("\\s+")[2];
+            out.println("\t\t\t" + sLine.replace(',', ' '));
+        }
+    }
+
+    public void init(PrintStream out) throws Exception {
+        Node node = getRoot();
+        out.println("#NEXUS\n");
+        out.println("Begin taxa;");
+        out.println("\tDimensions ntax=" + getLeafNodeCount() + ";");
+        out.println("\t\tTaxlabels");
+        printTaxa(node, out, getNodeCount() / 2);
+        out.println("\t\t\t;");
+        out.println("End;");
+
+        out.println("Begin trees;");
+        out.println("\tTranslate");
+        printTranslate(node, out, getNodeCount() / 2);
+        out.print(";");
+    }
+
+    public void log(int nSample, PrintStream out) {
+        Tree tree = (Tree) getCurrent();
+        out.print("tree STATE_" + nSample + " = ");
+        // Don't sort, this can confuse CalculationNodes relying on the tree
+        //tree.getRoot().sort();
+        final int[] dummy = new int[1];
+        final String sNewick = tree.getRoot().toSortedNewick(dummy);
+        out.print(sNewick);
+        out.print(";");
+    }
+
+    /**
+     * @see beast.core.Loggable *
+     */
+    public void close(PrintStream out) {
+        out.print("End;");
+    }
+
+    /**
+     * reconstruct tree from XML fragment in the form of a DOM node *
+     */
+    @Override
+    public void fromXML(final org.w3c.dom.Node node) {
+        final String sNewick = node.getTextContent();
+        final TreeParser parser = new TreeParser();
+        try {
+            parser.thresholdInput.setValue(1e-10, parser);
+        } catch (Exception e1) {
+            e1.printStackTrace();
+        }
+        try {
+            parser.offsetInput.setValue(0, parser);
+            setRoot(parser.parseNewick(sNewick));
+        } catch (Exception e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        initArrays();
+    }
+
+    /**
+     * Valuable implementation *
+     */
+    public int getDimension() {
+        return getNodeCount();
+    }
+
+    public double getArrayValue() {
+        return root.height;
+    }
+
+    public double getArrayValue(int iValue) {
+        return m_nodes[iValue].height;
+    }
+
+    /**
+     * StateNode implementation *
+     */
+    @Override
+    protected void store() {
+
+        // this condition can only be true for sampled ancestor trees
+        if (m_storedNodes.length != nodeCount) {
+            final Node[] tmp = new Node[nodeCount];
+            System.arraycopy(m_storedNodes, 0, tmp, 0, m_storedNodes.length - 1);
+            if (nodeCount > m_storedNodes.length) {
+                tmp[m_storedNodes.length - 1] = m_storedNodes[m_storedNodes.length - 1];
+                tmp[nodeCount - 1] = newNode();
+                tmp[nodeCount - 1].setNr(nodeCount - 1);
+            }
+            m_storedNodes = tmp;
+        }
+
+        storeNodes(0, nodeCount);
+        storedRoot = m_storedNodes[root.getNr()];
+    }
+
+
+    /**
+     * Stores nodes with index i, for iStart <= i < iEnd
+     * (i.e. including iStart but not including iEnd)
+     *
+     * @param iStart the first index to be stored
+     * @param iEnd   nodes are stored up to but not including this index
+     */
+    private void storeNodes(final int iStart, final int iEnd) {
+        // Use direct members for speed (we are talking 5-7% or more from total time for large trees :)
+        for (int i = iStart; i < iEnd; i++) {
+            final Node sink = m_storedNodes[i];
+            final Node src = m_nodes[i];
+            sink.height = src.height;
+
+            if ( src.parent != null ) {
+                sink.parent = m_storedNodes[src.parent.getNr()];
+            } else {
+                // currently only called in the case of sampled ancestor trees
+                // where root node is not always last in the list
+                sink.parent = null;
+            }
+
+            final List<Node> children = sink.children;
+            final List<Node> srcChildren = src.children;
+
+            if( children.size() == srcChildren.size() ) {
+               // shave some more time by avoiding list clear and add
+               for (int k = 0; k < children.size(); ++k) {
+                   final Node srcChild = srcChildren.get(k);
+                   // don't call addChild, which calls  setParent(..., true);
+                   final Node c = m_storedNodes[srcChild.getNr()];
+                   c.parent = sink;
+                   children.set(k, c);
+               }
+            } else {
+                children.clear();
+                //sink.removeAllChildren(false);
+                for (final Node srcChild : srcChildren) {
+                    // don't call addChild, which calls  setParent(..., true);
+                    final Node c = m_storedNodes[srcChild.getNr()];
+                    c.parent = sink;
+                    children.add(c);
+                    //sink.addChild(c);
+                }
+            }
+        }
+    }
+
+    @Override
+    public void startEditing(final Operator operator) {
+        super.startEditing(operator);
+        postCache = null;
+    }
+
+    @Override
+    public void restore() {
+
+        // necessary for sampled ancestor trees
+        nodeCount = m_storedNodes.length;
+
+        final Node[] tmp = m_storedNodes;
+        m_storedNodes = m_nodes;
+        m_nodes = tmp;
+        root = m_nodes[storedRoot.getNr()];
+
+        // necessary for sampled ancestor trees,
+        // we have the nodes, no need for expensive recursion
+        leafNodeCount = 0;
+        for( Node n : m_nodes ) {
+            leafNodeCount += n.isLeaf() ? 1 : 0;
+        }
+
+        //leafNodeCount = root.getLeafNodeCount();
+
+        hasStartedEditing = false;
+
+        for( Node n : m_nodes ) {
+            n.isDirty = Tree.IS_CLEAN;
+        }
+
+        postCache = null;
+    }
+
+    /**
+     * @return Date trait set if available, null otherwise.
+     */
+    public TraitSet getDateTrait() {
+        if (!traitsProcessed)
+            processTraits(m_traitList.get());
+
+        return timeTraitSet;
+    }
+
+    /**
+     * Determine whether tree has a date/time trait set associated with it.
+     *
+     * @return true if so
+     */
+    public boolean hasDateTrait() {
+        return getDateTrait() != null;
+    }
+
+    /**
+     * Specifically set the date trait set for this tree. A null value simply
+     * removes the existing trait set.
+     *
+     * @param traitSet
+     */
+    public void setDateTrait(TraitSet traitSet) {
+        if (hasDateTrait()) {
+            m_traitList.get().remove(timeTraitSet);
+        }
+
+        if (traitSet != null)
+            m_traitList.get().add(traitSet);
+
+        timeTraitSet = traitSet;
+    }
+
+    /**
+     * Convert age/height to the date time scale given by a trait set,
+     * if one exists.  Otherwise just return the unconverted height.
+     *
+     * @param fHeight
+     * @return date specified by height
+     */
+    public double getDate(final double fHeight) {
+        if (hasDateTrait()) {
+            return timeTraitSet.getDate(fHeight);
+        } else
+            return fHeight;
+    }
+
+    /**
+     * This method allows the retrieval of the taxon label of a node without using the node number.
+     *
+     * @param node
+     * @return the name of the given node, or null if the node is unlabelled
+     */
+    public String getTaxonId(final Node node) {
+        //TODO should be implemented to avoid using deprecated methods
+        return getTaxaNames()[node.getNr()];  //To change body of created methods use File | Settings | File Templates.
+    }
+
+    /**
+     * Removes the i'th node in the tree. Results in a renumbering of the remaining nodes so that their numbers
+     * faithfully describe their new position in the array. nodeCount and leafNodeCount are recalculated.
+     * Use with care!
+     *
+     * @param i the index of the node to be removed.
+     */
+    public void removeNode(final int i) {
+        final Node[] tmp = new Node[nodeCount - 1];
+        System.arraycopy(m_nodes, 0, tmp, 0, i);
+        for (int j = i; j < nodeCount - 1; j++) {
+            tmp[j] = m_nodes[j + 1];
+            tmp[j].setNr(j);
+        }
+        m_nodes = tmp;
+        nodeCount--;
+        leafNodeCount--;
+    }
+
+    /**
+     * Adds a node to the end of the node array. nodeCount and leafNodeCount are recalculated.
+     * Use with care!
+     */
+    public void addNode(final Node newNode) {
+        final Node[] tmp = new Node[nodeCount + 1];
+        System.arraycopy(m_nodes, 0, tmp, 0, nodeCount);
+        tmp[nodeCount] = newNode;
+        newNode.setNr(nodeCount);
+        m_nodes = tmp;
+        nodeCount++;
+        leafNodeCount++;
+    }
+
+    public int getDirectAncestorNodeCount() {
+        int directAncestorNodeCount = 0;
+        for (int i = 0; i < leafNodeCount; i++) {
+            if (this.getNode(i).isDirectAncestor()) {
+                directAncestorNodeCount += 1;
+            }
+        }
+        return directAncestorNodeCount;
+    }
+
+
+    @Override
+    public TaxonSet getTaxonset() {
+        return m_taxonset.get();
+    }
+} // class Tree
\ No newline at end of file
diff --git a/src/beast/evolution/tree/TreeDistribution.java b/src/beast/evolution/tree/TreeDistribution.java
new file mode 100644
index 0000000..7e59d8c
--- /dev/null
+++ b/src/beast/evolution/tree/TreeDistribution.java
@@ -0,0 +1,53 @@
+package beast.evolution.tree;
+
+
+import java.util.List;
+import java.util.Random;
+
+import beast.core.Description;
+import beast.core.Distribution;
+import beast.core.Input;
+import beast.core.State;
+import beast.core.Input.Validate;
+import beast.evolution.tree.coalescent.TreeIntervals;
+
+
+ at Description("Distribution on a tree, typically a prior such as Coalescent or Yule")
+public class TreeDistribution extends Distribution {
+    public Input<TreeInterface> treeInput = new Input<TreeInterface>("tree", "tree over which to calculate a prior or likelihood");
+    public Input<TreeIntervals> treeIntervalsInput = new Input<TreeIntervals>("treeIntervals", "Intervals for a phylogenetic beast tree", Validate.XOR, treeInput);
+
+    @Override
+    public List<String> getArguments() {
+        return null;
+    }
+
+    @Override
+    public List<String> getConditions() {
+        return null;
+    }
+
+    @Override
+    public void sample(State state, Random random) {
+    }
+
+    @Override
+    protected boolean requiresRecalculation() {
+        final TreeIntervals ti = treeIntervalsInput.get();
+        if (ti != null) {
+            //boolean d = ti.isDirtyCalculation();
+            //assert d;
+            assert ti.isDirtyCalculation();
+            return true;
+        }
+        return treeInput.get().somethingIsDirty();
+    }
+    
+ 	/** Indicate that the tree distribution can deal with dated tips in the tree
+	 * Some tree distributions like the Yule prior cannot handle this.
+	 * @return true by default
+	 */
+	public boolean canHandleTipDates() {
+		return true;
+	}
+}
diff --git a/src/beast/evolution/tree/TreeHeightLogger.java b/src/beast/evolution/tree/TreeHeightLogger.java
new file mode 100644
index 0000000..d81b25b
--- /dev/null
+++ b/src/beast/evolution/tree/TreeHeightLogger.java
@@ -0,0 +1,59 @@
+package beast.evolution.tree;
+
+
+
+import java.io.PrintStream;
+
+import beast.core.CalculationNode;
+import beast.core.Description;
+import beast.core.Function;
+import beast.core.Input;
+import beast.core.Loggable;
+import beast.core.Input.Validate;
+
+
+ at Description("Logger to report height of a tree")
+public class TreeHeightLogger extends CalculationNode implements Loggable, Function {
+    public Input<Tree> treeInput = new Input<Tree>("tree", "tree to report height for.", Validate.REQUIRED);
+
+    @Override
+    public void initAndValidate() {
+        // nothing to do
+    }
+
+    @Override
+    public void init(PrintStream out) throws Exception {
+        final Tree tree = treeInput.get();
+        if (getID() == null || getID().matches("\\s*")) {
+            out.print(tree.getID() + ".height\t");
+        } else {
+            out.print(getID() + "\t");
+        }
+    }
+
+    @Override
+    public void log(int nSample, PrintStream out) {
+        final Tree tree = treeInput.get();
+        out.print(tree.getRoot().getHeight() + "\t");
+    }
+
+    @Override
+    public void close(PrintStream out) {
+        // nothing to do
+    }
+
+    @Override
+    public int getDimension() {
+        return 1;
+    }
+
+    @Override
+    public double getArrayValue() {
+        return treeInput.get().getRoot().getHeight();
+    }
+
+    @Override
+    public double getArrayValue(int iDim) {
+        return treeInput.get().getRoot().getHeight();
+    }
+}
diff --git a/src/beast/evolution/tree/TreeInterface.java b/src/beast/evolution/tree/TreeInterface.java
new file mode 100644
index 0000000..856e2cb
--- /dev/null
+++ b/src/beast/evolution/tree/TreeInterface.java
@@ -0,0 +1,65 @@
+package beast.evolution.tree;
+
+
+
+import java.util.List;
+
+import beast.evolution.alignment.TaxonSet;
+import beast.evolution.tree.Node;
+
+public interface TreeInterface {
+    String getID();
+
+    int getLeafNodeCount();
+	int getInternalNodeCount();
+	int getNodeCount();
+
+	Node getRoot();
+    Node getNode(int i);
+    Node [] getNodesAsArray();
+
+    List<Node> getExternalNodes();
+    List<Node> getInternalNodes();
+    
+    TaxonSet getTaxonset();
+    
+	boolean somethingIsDirty();
+
+    public void getMetaData(Node node, Double[] fT, String sPattern);
+    public void setMetaData(Node node, Double[] fT, String sPattern);
+
+    /*
+    * Note that leaf nodes are always numbered 0,...,nodeCount-1
+    * Internal nodes are numbered higher, but the root has no guaranteed 
+    * number.
+    */
+
+
+    /**
+     * @param node  top of tree/sub tree (null defaults to whole tree)
+     * @param nodes array to fill (null will result in creating a new one)
+     * @return tree nodes in post-order, children before parents
+     */
+    default public Node[] listNodesPostOrder(Node node, Node[] nodes) {
+        if (node == null) {
+            node = getRoot();
+        }
+        if (nodes == null) {
+            // overall node count is cached, faster
+            final int n = node == getRoot() ? getNodeCount() : node.getNodeCount();
+            nodes = new Node[n];
+        }
+        getNodesPostOrder(node, nodes, 0);
+        return nodes;
+    }
+
+    static int
+    getNodesPostOrder(final Node node, final Node[] nodes, int pos) {
+        //node.m_tree = this;
+        for (final Node child : node.children) {
+            pos = getNodesPostOrder(child, nodes, pos);
+        }
+        nodes[pos] = node;
+        return pos + 1;
+    }
+}
diff --git a/src/beast/evolution/tree/TreeTraceAnalysis.java b/src/beast/evolution/tree/TreeTraceAnalysis.java
new file mode 100644
index 0000000..f559886
--- /dev/null
+++ b/src/beast/evolution/tree/TreeTraceAnalysis.java
@@ -0,0 +1,309 @@
+/*
+ * Copyright (C) 2012 Tim Vaughan
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+package beast.evolution.tree;
+
+
+import beast.util.CredibleSet;
+import beast.util.FrequencySet;
+import beast.util.NexusParser;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+
+// TODO: Calculate mean node heights for trees in credible set.
+
+/**
+ * Partial re-implementation of TreeTraceAnalysis from BEAST 1.
+ * <p/>
+ * Represents an analysis of a list of trees obtained either directly
+ * from a logger or from a trace file. The set of tree topologies is
+ * calculated by given credible set probability threshold (default 95%).
+ *
+ *
+ * @author Walter Xie
+ * @author Alexei Drummond
+ * @author Tim Vaughan
+ */
+public class TreeTraceAnalysis {
+
+    public static final double DEFAULT_BURN_IN_FRACTION = 0.1;
+
+    protected List<Tree> treeInTrace;
+
+    protected int totalTrees; // total from original log
+    protected int burnin;
+
+    protected FrequencySet<String> topologiesFrequencySet;
+    protected CredibleSet<String> credibleSet;
+
+    protected boolean isTaxaLabel = true; // false to display node index instead
+
+    public TreeTraceAnalysis(List<Tree> posteriorTreeList) {
+        this(posteriorTreeList, DEFAULT_BURN_IN_FRACTION);
+    }
+
+    /**
+     * default credible set probability threshold 95%
+     * analyze() needs after create TreeTraceAnalysis
+     * @param posteriorTreeList
+     * @param burninFraction
+     */
+    public TreeTraceAnalysis(List<Tree> posteriorTreeList, double burninFraction) {
+        assert posteriorTreeList != null;
+        removeBurnin(posteriorTreeList, burninFraction);
+    }
+
+    /**
+     * Analyse tree topologies, and set credSetProbability 95%
+     */
+    public void analyze() {
+        // 0.95
+        analyze(FrequencySet.DEFAULT_CRED_SET);
+    }
+
+    /**
+     * Analyse tree topologies, and set credSetProbability
+     * @param credSetProbability
+     */
+    public void analyze(double credSetProbability) {
+        // set credSetProbability
+        topologiesFrequencySet = new FrequencySet<String>();
+        topologiesFrequencySet.setCredSetProbability(credSetProbability);
+
+        for (Tree tree : treeInTrace) {
+            String topology = uniqueNewick(tree.getRoot());
+            topologiesFrequencySet.add(topology, 1);
+        }
+
+        credibleSet = topologiesFrequencySet.getCredibleSet();
+    }
+
+    /**
+     * report number of unique tree topologies and total trees in the credible set
+     *
+     * @param oStream Print stream to write output to.
+     * @param verbose if true then print all trees
+     */
+    public void report(PrintStream oStream, boolean verbose) {
+        // prefix non-tabular lines with # so file can be read into R
+        oStream.println("# burnin = " + String.valueOf(burnin));
+        oStream.println("# total trees used (total - burnin) = "
+                + String.valueOf(treeInTrace.size()));
+
+        // prefix non-tabular lines with # so file can be read into R
+        oStream.print("# \n# " + String.valueOf(topologiesFrequencySet.getCredSetProbability() * 100)
+                + "% credible set");
+
+        oStream.println(" (" + String.valueOf(credibleSet.credibleSetList.size())
+                + " unique tree topologies, "
+                + String.valueOf(credibleSet.sumFrequency)
+                + " trees in total)");
+
+        if (verbose) {
+            oStream.println("Rank\tCount\tPercent\tRunning\tTree");
+            double runningPercent = 0;
+            for (int i = 0; i < credibleSet.credibleSetList.size(); i++) {
+                double percent = 100.0 * credibleSet.getFrequency(i, topologiesFrequencySet) / (totalTrees - burnin);
+                runningPercent += percent;
+
+                oStream.print((i + 1) + "\t");
+                oStream.print(credibleSet.getFrequency(i, topologiesFrequencySet) + "\t");
+                oStream.format("%.2f%%\t", percent);
+                oStream.format("%.2f%%\t", runningPercent);
+                oStream.println(credibleSet.credibleSetList.get(i));
+            }
+        }
+    }
+
+
+    public void report(PrintStream oStream) {
+        report(oStream, true);
+    }
+
+    /**
+     * Recursive function for constructing a Newick tree representation
+     * in the given buffer.
+     *
+     * @param node
+     * @return
+     */
+    public String uniqueNewick(Node node) {
+        return TreeUtils.sortedNewickTopology(node, isTaxaLabel);
+    }
+
+    public boolean isTaxaLabel() {
+        return isTaxaLabel;
+    }
+
+    public void setTaxaLabel(boolean taxaLabel) {
+        this.isTaxaLabel = taxaLabel;
+    }
+
+    public int getBurnin() {
+        return burnin;
+    }
+
+    public double getBurninFraction() {
+        return (double) burnin / (double) totalTrees;
+    }
+
+    public double getCredSetProbability() {
+        return topologiesFrequencySet.getCredSetProbability();
+    }
+
+    /**
+     * Obtain credible set of tree topologies
+     *
+     * @return List of tree topologies as Newick-formatted strings.
+     */
+    public List<String> getCredibleSetList() {
+        return credibleSet.credibleSetList;
+    }
+
+    /**
+     * total from original log
+     *
+     * @return  Number of trees from log
+     */
+    public int getTotalTreesInLog() {
+        return totalTrees;
+    }
+
+    /**
+     * Obtain total number of trees analysed after burnin removed.
+     *
+     * @return Number of trees analysed.
+     */
+    public int getTotalTreesBurninRemoved() {
+        return treeInTrace.size();
+    }
+
+    public Map<String, Integer> getTopologyCounts() {
+        return topologiesFrequencySet.getFrequencyMap();
+    }
+
+    /**
+     * Obtain frequencies with which members of the credible set appeared
+     * in the original tree list.
+     *
+     * @return List of absolute topology frequencies.
+     */
+//    public List<Integer> getCredibleSetFreqs() {
+//        return credibleSetFreqs;
+//    }
+
+    /**
+     * static Utils
+     */
+    public static class Utils {
+        /**
+         * get list of trees from file
+         * @param treeFile
+         * @return
+         * @throws Exception
+         */
+        public static List<Tree> getTrees (File treeFile) throws Exception {
+            NexusParser parser = new NexusParser();
+            parser.parseFile(treeFile);
+            return parser.trees;
+        }
+
+        /**
+         * get burn in from total and burninFraction
+         * @param total
+         * @param burninFraction
+         * @return
+         */
+        public static int getBurnIn(int total, double burninFraction) {
+            // Record original list length and burnin for report:
+            int burnin = (int) (total * burninFraction);
+            assert burnin < total;
+            return burnin;
+        }
+
+        /**
+         * get a subset of trees from total trees in a range.
+         * it can be used to
+         *
+         * @param rawTreeList
+         * @param start
+         * @param end
+         * @return
+         */
+        public static List<Tree> getSubListOfTrees(List<Tree> rawTreeList, int start, int end) {
+            assert start < end;
+            return new ArrayList<Tree>(rawTreeList.subList(start, end));
+        }
+
+        public static List<Tree> getSubListOfTrees(List<Tree> rawTreeList, int start) {
+            return getSubListOfTrees(rawTreeList, start, rawTreeList.size());
+        }
+    }
+
+    //******** protected *****
+
+    // Remove burnin
+    protected void removeBurnin(List<Tree> posteriorTreeList, double burninFraction) {
+        totalTrees = posteriorTreeList.size();
+        burnin = Utils.getBurnIn(totalTrees, burninFraction);
+
+        // Remove burnin from trace:
+        treeInTrace = Utils.getSubListOfTrees(posteriorTreeList, burnin);
+    }
+
+    //******** main *****
+    public static void main(String[] args) {
+        PrintStream out = System.out;
+        File inputFile = null;
+
+        if (args.length > 0) {
+            System.out.println("Input file  = " + args[0]);
+            inputFile = new File(args[0]);
+        } else {
+            System.out.println("Error: Expected nexus file, but not file name was provided.");
+            System.exit(0);
+        }
+
+        if (args.length > 1) {
+            System.out.println("Output file = " + args[1]);
+            try {
+                out = new PrintStream(new FileOutputStream(args[1]));
+            } catch (FileNotFoundException e) {
+                System.out.println("Error: Unable to create output file.");
+                System.exit(0);
+            }
+        }
+
+        List<Tree> trees = null;
+        try {
+            trees = TreeTraceAnalysis.Utils.getTrees(inputFile);
+        } catch (Exception e) {
+            System.out.println("Error occurred while parsing input file.");
+            System.exit(0);
+        }
+        TreeTraceAnalysis analysis = new TreeTraceAnalysis(trees); // default 0.1, 0.95
+        analysis.analyze();
+        analysis.report(out);
+    }
+
+}
\ No newline at end of file
diff --git a/src/beast/evolution/tree/TreeUtils.java b/src/beast/evolution/tree/TreeUtils.java
new file mode 100644
index 0000000..d8035c9
--- /dev/null
+++ b/src/beast/evolution/tree/TreeUtils.java
@@ -0,0 +1,400 @@
+package beast.evolution.tree;
+
+import java.util.*;
+
+/**
+ * @author Alexei Drummond and Alexandra Gavryushkina
+ */
+public class TreeUtils {
+
+    /**
+     * Recursively order.
+     */
+    public static void rotateNodeByComparator(Node node, Comparator<Node> comparator) {
+
+        if (node.getChildCount() > 2) throw new RuntimeException("Not implemented yet!");
+
+        for (Node child : node.getChildren()) {
+            rotateNodeByComparator(child, comparator);
+        }
+
+        if (node.getChildCount() > 1) {
+            if (comparator.compare(node.getLeft(), node.getRight()) > 0) {
+                Node temp = node.getLeft();
+                node.setLeft(node.getRight());
+                node.setRight(temp);
+            }
+        }
+    }
+
+    public static Comparator<Node> createNodeDensityComparator() {
+
+        return new Comparator<Node>() {
+
+            public int compare(Node node1, Node node2) {
+                return node2.getLeafNodeCount() - node1.getLeafNodeCount();
+            }
+
+            public boolean equals(Node node1, Node node2) {
+                return node1.getLeafNodeCount() == node2.getLeafNodeCount();
+            }
+        };
+    }
+
+
+    public static Comparator<Node> createNodeDensityMinNodeHeightComparator() {
+
+        return new Comparator<Node>() {
+
+            public int compare(Node node1, Node node2) {
+                int larger = node1.getLeafNodeCount() - node2.getLeafNodeCount();
+
+                if (larger != 0) return larger;
+
+                double tipRecent = getMinNodeHeight(node1) - getMinNodeHeight(node2);
+                if (tipRecent > 0.0) return -1;
+                if (tipRecent < 0.0) return 1;
+                return 0;
+            }
+
+        };
+    }
+
+    public static Comparator<Node> createReverseNodeDensityMinNodeHeightComparator() {
+        return new Comparator<Node>() {
+
+            public int compare(Node node1, Node node2) {
+                int larger = node2.getLeafNodeCount() - node1.getLeafNodeCount();
+
+
+                if (larger != 0) return larger;
+
+                double tipRecent = getMinNodeHeight(node2) - getMinNodeHeight(node1);
+                if (tipRecent > 0.0) return -1;
+                if (tipRecent < 0.0) return 1;
+                return 0;
+            }
+
+        };
+    }
+
+    public static double getMinNodeHeight(Node node) {
+        if (!node.isLeaf()) {
+            double minNodeHeight = Double.MAX_VALUE;
+            for (Node child : node.getChildren()) {
+                double childMinHeight = getMinNodeHeight(child);
+                if (childMinHeight < minNodeHeight) {
+                    minNodeHeight = childMinHeight;
+                }
+            }
+            return minNodeHeight;
+        } else return node.getHeight();
+    }
+
+    public static double getDoubleMetaData(Node node, String metaDataName) {
+        Object metaData = node.getMetaData(metaDataName);
+        if (metaData instanceof Integer) return (double) ((Integer) metaData);
+        if (metaData instanceof Double) return (Double) metaData;
+        if (metaData instanceof String) return Double.parseDouble((String) metaData);
+        return -1;
+    }
+
+    /**
+     * Gets the most recent common ancestor (MRCA) node of a set of leaf nodes.
+     *
+     * @param tree      the Tree
+     * @param leafNodes a set of names
+     * @return the NodeRef of the MRCA
+     */
+    public static Node getCommonAncestorNode(Tree tree, Set<String> leafNodes) {
+
+        int cardinality = leafNodes.size();
+
+        if (cardinality == 0) {
+            throw new IllegalArgumentException("No leaf nodes selected");
+        }
+
+        Node[] mrca = {null};
+        getCommonAncestorNode(tree, tree.getRoot(), leafNodes, cardinality, mrca);
+
+        return mrca[0];
+    }
+
+    /*
+    * Private recursive function used by getCommonAncestorNode.
+    */
+    private static int getCommonAncestorNode(Tree tree, Node node,
+                                             Set<String> leafNodes, int cardinality,
+                                             Node[] mrca) {
+
+        if (node.isLeaf()) {
+            if (leafNodes.contains(tree.getTaxonId(node))) {
+                if (cardinality == 1) {
+                    mrca[0] = node;
+                }
+                return 1;
+            } else {
+                return 0;
+            }
+        }
+
+        int matches = 0;
+
+        for (Node child : node.getChildren()) {
+            matches += getCommonAncestorNode(tree, child, leafNodes, cardinality, mrca);
+            if (mrca[0] != null) {
+                break;
+            }
+        }
+
+        if (mrca[0] == null) {
+            // If we haven't already found the MRCA, test this node
+            if (matches == cardinality) {
+                mrca[0] = node;
+            }
+        }
+
+        return matches;
+    }
+
+    /**
+     * @param tree
+     * @param node
+     * @return the length of the (sub)tree below the given node.
+     */
+    public static double getTreeLength(Tree tree, Node node) {
+
+        int childCount = node.getChildCount();
+        if (childCount == 0) return node.getLength();
+
+        double length = 0;
+        for (Node child : node.getChildren()) {
+            length += getTreeLength(tree, child);
+        }
+        if (node != tree.getRoot())
+            length += node.getLength();
+        return length;
+    }
+
+    /**
+     * @param tree
+     * @return the sum of the external branch lengths of the given tree
+     */
+    public static double getExternalLength(Tree tree) {
+        double length = 0.0;
+        for (Node node : tree.getExternalNodes()) {
+            length += node.getLength();
+            while (true) {
+                if (!node.isDirectAncestor() && node.getParent() != null && node.getParent().isFake()) {
+                    node = node.getParent();
+                    length += node.getLength();
+                } else break;
+
+            }
+        }
+        return length;
+    }
+
+    /**
+     * @param tree
+     * @return the sum of the internal branch lengths of the given tree
+     */
+    public static double getInternalLength(Tree tree) {
+        double length = 0.0;
+        for (Node node : tree.getInternalNodes()) {
+            length += node.getLength();
+            if (node.isFake() && node.getNonDirectAncestorChild().isLeaf()) {
+                while (true) {
+                    length -= node.getLength();
+                    if (node.getParent() != null && node.getParent().isFake()) {
+                        node = node.getParent();
+                    } else break;
+
+                }
+            }
+
+        }
+        return length;
+    }
+
+    /**
+     * @param tree
+     * @param node
+     * @return the sum of the branch lengths on the subtree relating all
+     * contemporaneous descendants of the node
+     */
+    public static double getTrunkLength(Tree tree, Node node) {
+
+        int childCount = node.getChildCount();
+        if (childCount == 0) {
+            if (node.getHeight() == 0.0) {
+                return node.getLength();
+            } else {
+                return 0.0;
+            }
+        }
+
+        double length = 0;
+        for (Node child : node.getChildren()) {
+            length += getTrunkLength(tree, child);
+        }
+        if (node != tree.getRoot() && length > 0.0)
+            length += node.getLength();
+        return length;
+
+    }
+
+    /**
+     * @return the intervals in an ultrametric tree in order from root to tips.
+     */
+    public static double[] getIntervals(Tree tree) {
+
+        List<Double> heights = new ArrayList<Double>();
+
+        for (Node node : tree.getInternalNodes()) {
+            heights.add(node.getHeight());
+        }
+        Collections.sort(heights, Collections.reverseOrder());
+
+        double[] intervals = new double[heights.size()];
+        for (int i = 0; i < intervals.length - 1; i++) {
+            double height1 = heights.get(i);
+            double height2 = heights.get(i + 1);
+
+            intervals[i] = height1 - height2;
+        }
+        intervals[intervals.length - 1] = heights.get(intervals.length - 1);
+
+        return intervals;
+
+    }
+
+    /**
+     * @param tree the tree
+     * @param node the node to get names of leaves below
+     * @return a set of taxa names (as strings) of the leaf nodes descended from the given node.
+     */
+    public static Set<String> getDescendantLeaves(Tree tree, Node node) {
+
+        HashSet<String> set = new HashSet<String>();
+        getDescendantLeaves(tree, node, set);
+        return set;
+    }
+
+    /**
+     * @param tree the tree
+     * @param node the node to get name of leaves below
+     * @param set  will be populated with taxa names (as strings) of the leaf nodes descended from the given node.
+     */
+    private static void getDescendantLeaves(Tree tree, Node node, Set<String> set) {
+
+        if (node.isLeaf()) {
+            set.add(tree.getTaxonId(node));
+        } else {
+
+            for (Node child : node.getChildren()) {
+                getDescendantLeaves(tree, child, set);
+            }
+        }
+    }
+
+    /**
+     * @param tree the tree to test fo ultrametricity
+     * @param threshold the largest absolute value of height that a leaf node can have
+     *                  and the tree still be regarded as ultrametric
+     * @return true only if all tips have height 0.0
+     */
+    public static boolean isUltrametric(Tree tree, double threshold) {
+        for (Node node : tree.getExternalNodes()) {
+            if (Math.abs(node.getHeight()) > threshold)
+                return false;
+        }
+        return true;
+    }
+
+    /**
+     * @param tree the tree to test fo ultrametricity
+     * @return true only if all tips have height exactly 0.0. Since newick is expressed in branch lengths
+     * it may be necessary to use isUltrametric(tree, threshold) to allow for numerical precision issues.
+     */
+    public static boolean isUltrametric(Tree tree) {
+        for (Node node : tree.getExternalNodes()) {
+            if (node.getHeight() != 0.0)
+                return false;
+        }
+        return true;
+    }
+
+    /**
+     * @param tree the tree to test if binary
+     * @return true only if internal nodes have 2 children
+     */
+    public static boolean isBinary(Tree tree) {
+        for (Node node : tree.getInternalNodes()) {
+            if (node.getChildCount() != 2)
+                return false;
+        }
+        return true;
+    }
+
+    /**
+     * get tree topology in Newick that is sorted by taxa labels or node indexes.
+     * @param node
+     * @param isTaxaLabel       if true, then print taxa label instead of node index
+     * @return
+     */
+    public static String sortedNewickTopology(Node node, boolean isTaxaLabel) {
+        if (node.isLeaf()) {
+            if (isTaxaLabel) {
+                return String.valueOf(node.getID());
+            } else {
+                return String.valueOf(node.getNr());
+            }
+        } else {
+            StringBuilder builder = new StringBuilder("(");
+
+            List<String> subTrees = new ArrayList<String>();
+            for (int i = 0; i < node.getChildCount(); i++) {
+                subTrees.add(sortedNewickTopology(node.getChild(i), isTaxaLabel));
+            }
+
+            Collections.sort(subTrees);
+
+            for (int i = 0; i < subTrees.size(); i++) {
+                builder.append(subTrees.get(i));
+                if (i < subTrees.size() - 1) {
+                    builder.append(",");
+                }
+            }
+            builder.append(")");
+
+            return builder.toString();
+        }
+    }
+
+    // populate  postOrderList with node numbers in posorder: parent before children.
+    //  postOrderList is pre-allocated with the right size
+    public static void preOrderTraversalList(Tree tree, int[] postOrderList) {
+
+        final int nodeCount = tree.getNodeCount();
+        if (postOrderList.length != nodeCount) {
+            throw new IllegalArgumentException("Illegal list length");
+        }
+        postOrderList[0] = tree.getRoot().getNr();
+        preOrderTraversalList(tree, 0, postOrderList);
+    }
+
+    public static int preOrderTraversalList(Tree tree, int idx, int[] postOrderList) {
+        final Node node = tree.getNode(postOrderList[idx]);
+        for(int i = 0; i < node.getChildCount(); ++i) {
+            final Node child = node.getChild(i);
+            idx += 1;
+            postOrderList[idx] = child.getNr();
+            if( ! child.isLeaf() ) {
+                idx = preOrderTraversalList(tree, idx, postOrderList);
+            }
+        }
+        return idx;
+    }
+}
+
diff --git a/src/beast/evolution/tree/TreeWithMetaDataLogger.java b/src/beast/evolution/tree/TreeWithMetaDataLogger.java
new file mode 100644
index 0000000..990293d
--- /dev/null
+++ b/src/beast/evolution/tree/TreeWithMetaDataLogger.java
@@ -0,0 +1,166 @@
+package beast.evolution.tree;
+
+import java.io.PrintStream;
+import java.math.RoundingMode;
+import java.text.DecimalFormat;
+import java.util.ArrayList;
+import java.util.List;
+
+import beast.core.Description;
+import beast.core.Function;
+import beast.core.Input;
+import beast.core.Loggable;
+import beast.core.StateNode;
+import beast.core.BEASTObject;
+import beast.core.Input.Validate;
+import beast.core.parameter.Parameter;
+import beast.evolution.branchratemodel.BranchRateModel;
+
+ at Description("Logs tree annotated with metadata and/or rates")
+public class TreeWithMetaDataLogger extends BEASTObject implements Loggable {
+    public Input<Tree> treeInput = new Input<Tree>("tree", "tree to be logged", Validate.REQUIRED);
+    // TODO: make this input a list of valuables
+    public Input<List<Function>> parameterInput = new Input<List<Function>>("metadata", "meta data to be logged with the tree nodes",new ArrayList<>());
+    public Input<BranchRateModel.Base> clockModelInput = new Input<BranchRateModel.Base>("branchratemodel", "rate to be logged with branches of the tree");
+    public Input<Boolean> substitutionsInput = new Input<Boolean>("substitutions", "report branch lengths as substitutions (branch length times clock rate for the branch)", false);
+    public Input<Integer> decimalPlacesInput = new Input<Integer>("dp", "the number of decimal places to use writing branch lengths and rates, use -1 for full precision (default = full precision)", -1);
+
+    
+    boolean someMetaDataNeedsLogging;
+    boolean substitutions = false;
+
+    private DecimalFormat df;
+
+    @Override
+    public void initAndValidate() throws Exception {
+        if (parameterInput.get().size() == 0 && clockModelInput.get() == null) {
+        	someMetaDataNeedsLogging = false;
+        	return;
+            //throw new Exception("At least one of the metadata and branchratemodel inputs must be defined");
+        }
+    	someMetaDataNeedsLogging = true;
+    	// without substitution model, reporting substitutions == reporting branch lengths 
+        if (clockModelInput.get() != null) {
+        	substitutions = substitutionsInput.get();
+        }
+
+        int dp = decimalPlacesInput.get();
+
+        if (dp < 0) {
+            df = null;
+        } else {
+            // just new DecimalFormat("#.######") (with dp time '#' after the decimal)
+            df = new DecimalFormat("#."+new String(new char[dp]).replace('\0', '#'));
+            df.setRoundingMode(RoundingMode.HALF_UP);
+        }
+    }
+
+    @Override
+    public void init(PrintStream out) throws Exception {
+        treeInput.get().init(out);
+    }
+
+    @Override
+    public void log(int nSample, PrintStream out) {
+        // make sure we get the current version of the inputs
+        Tree tree = (Tree) treeInput.get().getCurrent();
+        List<Function> metadata = parameterInput.get();
+        for (int i = 0; i < metadata.size(); i++) {
+        	if (metadata.get(i) instanceof StateNode) {
+        		metadata.set(i, ((StateNode) metadata.get(i)).getCurrent());
+        	}
+        }
+        BranchRateModel.Base branchRateModel = clockModelInput.get();
+        // write out the log tree with meta data
+        out.print("tree STATE_" + nSample + " = ");
+        tree.getRoot().sort();
+        out.print(toNewick(tree.getRoot(), metadata, branchRateModel));
+        //out.print(tree.getRoot().toShortNewick(false));
+        out.print(";");
+    }
+
+    /**
+     * Appends a double to the given StringBuffer, formatting it using
+     * the private DecimalFormat instance, if the input 'dp' has been
+     * given a non-negative integer, otherwise just uses default
+     * formatting.
+     * @param buf
+     * @param d
+     */
+    private void appendDouble(StringBuffer buf, double d) {
+        if (df == null) {
+            buf.append(d);
+        } else {
+            buf.append(df.format(d));
+        }
+    }
+
+    String toNewick(Node node, List<Function> metadataList, BranchRateModel.Base branchRateModel) {
+        StringBuffer buf = new StringBuffer();
+        if (node.getLeft() != null) {
+            buf.append("(");
+            buf.append(toNewick(node.getLeft(), metadataList, branchRateModel));
+            if (node.getRight() != null) {
+                buf.append(',');
+                buf.append(toNewick(node.getRight(), metadataList, branchRateModel));
+            }
+            buf.append(")");
+        } else {
+            buf.append(node.labelNr + 1);
+        }
+        if (someMetaDataNeedsLogging) {
+	        buf.append("[&");
+	        if (metadataList.size() > 0) {
+	        	for (Function metadata : metadataList) {
+		            buf.append(((BEASTObject)metadata).getID());
+		            buf.append('=');
+		            if (metadata instanceof Parameter<?>) {
+		            	Parameter p = (Parameter) metadata;
+		            	int dim = p.getMinorDimension1();
+		            	if (dim > 1) {
+			            	buf.append('{');
+			            	for (int i = 0; i < dim; i++) {
+				            	buf.append(p.getMatrixValue(node.labelNr, i));
+				            	if (i < dim - 1) {
+					            	buf.append(',');
+				            	}
+			            	}
+			            	buf.append('}');
+		            	} else {
+			            	buf.append(metadata.getArrayValue(node.labelNr));
+		            	}
+		            } else {
+		            	buf.append(metadata.getArrayValue(node.labelNr));
+		            }
+		            if (metadataList.indexOf(metadata) < metadataList.size() - 1) {
+		            	buf.append(",");
+		            }
+	        	}
+	            if (branchRateModel != null) {
+	                buf.append(",");
+	            }
+	        }
+	        if (branchRateModel != null) {
+	            buf.append("rate=");
+                appendDouble(buf, branchRateModel.getRateForBranch(node));
+	        }
+	        buf.append(']');
+        }
+        buf.append(":");
+        if (substitutions) {
+            appendDouble(buf, node.getLength() * branchRateModel.getRateForBranch(node));
+        } else {
+            appendDouble(buf, node.getLength());
+        }
+        return buf.toString();
+    }
+
+
+    @Override
+    public void close(PrintStream out) {
+        treeInput.get().close(out);
+    }
+
+}
+
+    
\ No newline at end of file
diff --git a/src/beast/evolution/tree/coalescent/BayesianSkyline.java b/src/beast/evolution/tree/coalescent/BayesianSkyline.java
new file mode 100644
index 0000000..0251a3a
--- /dev/null
+++ b/src/beast/evolution/tree/coalescent/BayesianSkyline.java
@@ -0,0 +1,351 @@
+package beast.evolution.tree.coalescent;
+
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Random;
+
+import beast.core.Description;
+import beast.core.Distribution;
+import beast.core.Function;
+import beast.core.Input;
+import beast.core.State;
+import beast.core.BEASTObject;
+import beast.core.Input.Validate;
+import beast.core.parameter.IntegerParameter;
+import beast.evolution.speciation.SpeciesTreeDistribution;
+import beast.evolution.tree.Tree;
+import beast.evolution.tree.TreeDistribution;
+import beast.math.Binomial;
+
+
+
+/**
+ * @author Alexei Drummond
+ */
+ at Description("A likelihood function for the generalized skyline plot coalescent.")
+public class BayesianSkyline extends TreeDistribution {
+//public class BayesianSkyline extends PopulationFunction.Abstract {
+
+    public Input<Function> popSizeParamInput = new Input<Function>("popSizes", "present-day population size. "
+            + "If time units are set to Units.EXPECTED_SUBSTITUTIONS then"
+            + "the N0 parameter will be interpreted as N0 * mu. "
+            + "Also note that if you are dealing with a diploid population " + "N0 will be out by a factor of 2.",
+            Validate.REQUIRED);
+    public Input<IntegerParameter> groupSizeParamInput = new Input<IntegerParameter>("groupSizes",
+            "the group sizes parameter", Validate.REQUIRED);
+    // public Input<Tree> treeInput = new Input<Tree>("tree",
+    // "The tree containing coalescent node times for use in defining BSP.");
+//	public Input<TreeIntervals> m_treeIntervals = new Input<TreeIntervals>("treeIntervals",
+//			"The intervals of the tree containing coalescent node times for use in defining BSP.", Validate.REQUIRED);
+
+    Function popSizes;
+    IntegerParameter groupSizes;
+    Tree tree;
+    TreeIntervals intervals;
+    double[] coalescentTimes;
+
+    int[] cumulativeGroupSizes;
+    boolean m_bIsPrepared = false;
+
+    public BayesianSkyline() {
+    }
+
+    // /**
+    // * This pseudo-constructor is only used for junit tests
+    // *
+    // * @param populationSize
+    // * @param groupSizes
+    // * @param tree
+    // * @throws Exception
+    // */
+    // public void init(RealParameter populationSize, IntegerParameter
+    // groupSizes, Tree tree) throws Exception {
+    // super.init(populationSize, groupSizes, tree);
+    // }
+
+    public void initAndValidate() throws Exception {
+        if (treeInput.get() != null) {
+            throw new Exception("only tree intervals (not tree) should not be specified");
+        }
+        intervals = treeIntervalsInput.get();
+        groupSizes = groupSizeParamInput.get();
+        popSizes = popSizeParamInput.get();
+
+        // make sure that the sum of groupsizes == number of coalescent events
+        int events = intervals.treeInput.get().getInternalNodeCount();
+        if (groupSizes.getDimension() > events) {
+            throw new IllegalArgumentException("There are more groups than coalescent nodes in the tree.");
+        }
+        int paramDim2 = groupSizes.getDimension();
+
+        int eventsCovered = 0;
+        for (int i = 0; i < groupSizes.getDimension(); i++) {
+            eventsCovered += groupSizes.getValue(i);
+        }
+
+        if (eventsCovered != events) {
+            if (eventsCovered == 0 || eventsCovered == paramDim2) {
+                // double[] uppers = new double[paramDim2];
+                // double[] lowers = new double[paramDim2];
+
+                // For these special cases we assume that the XML has not
+                // specified initial group sizes
+                // or has set all to 1 and we set them here automatically...
+                int eventsEach = events / paramDim2;
+                int eventsExtras = events % paramDim2;
+                Integer[] values = new Integer[paramDim2];
+                for (int i = 0; i < paramDim2; i++) {
+                    if (i < eventsExtras) {
+                        values[i] = eventsEach + 1;
+                    } else {
+                        values[i] = eventsEach;
+                    }
+                    // uppers[i] = Double.MAX_VALUE;
+                    // lowers[i] = 1.0;
+                }
+
+                // if (type == EXPONENTIAL_TYPE || type == LINEAR_TYPE) {
+                // lowers[0] = 2.0;
+                // }
+                IntegerParameter parameter = new IntegerParameter(values);
+                parameter.setBounds(1, Integer.MAX_VALUE);
+                groupSizes.assignFromWithoutID(parameter);
+            } else {
+                // ... otherwise assume the user has made a mistake setting
+                // initial group sizes.
+                throw new IllegalArgumentException(
+                        "The sum of the initial group sizes does not match the number of coalescent events in the tree.");
+            }
+        }
+
+        prepare();
+    }
+
+    public void prepare() {
+        cumulativeGroupSizes = new int[groupSizes.getDimension()];
+
+        int intervalCount = 0;
+        for (int i = 0; i < cumulativeGroupSizes.length; i++) {
+            intervalCount += groupSizes.getValue(i);
+            cumulativeGroupSizes[i] = intervalCount;
+        }
+
+        coalescentTimes = intervals.getCoalescentTimes(coalescentTimes);
+
+        assert (intervals.getSampleCount() == intervalCount);
+        m_bIsPrepared = true;
+    }
+
+    /**
+     * CalculationNode methods *
+     */
+    @Override
+    protected boolean requiresRecalculation() {
+        m_bIsPrepared = false;
+        return true;
+    }
+
+    @Override
+    public void store() {
+        m_bIsPrepared = false;
+        super.store();
+    }
+
+    @Override
+    public void restore() {
+        m_bIsPrepared = false;
+        super.restore();
+    }
+
+    public List<String> getParameterIds() {
+
+        List<String> paramIDs = new ArrayList<String>();
+        paramIDs.add(((BEASTObject) popSizes).getID());
+        paramIDs.add(groupSizes.getID());
+
+        return paramIDs;
+    }
+
+    /**
+     * Calculates the log likelihood of this set of coalescent intervals, given
+     * a demographic model.
+     */
+    @Override
+    public double calculateLogP() throws Exception {
+        if (!m_bIsPrepared) {
+            prepare();
+        }
+
+        logP = 0.0;
+
+        double currentTime = 0.0;
+
+        int groupIndex = 0;
+        // int[] groupSizes = getGroupSizes();
+        // double[] groupEnds = getGroupHeights();
+
+        int subIndex = 0;
+
+        //ConstantPopulation cp = new ConstantPopulation();// Units.Type.YEARS);
+
+        for (int j = 0; j < intervals.getIntervalCount(); j++) {
+
+            // set the population size to the size of the middle of the current
+            // interval
+            final double ps = getPopSize(currentTime + (intervals.getInterval(j) / 2.0));
+            //cp.setN0(ps);
+            if (intervals.getIntervalType(j) == IntervalType.COALESCENT) {
+                subIndex += 1;
+                if (subIndex >= groupSizes.getValue(groupIndex)) {
+                    groupIndex += 1;
+                    subIndex = 0;
+                }
+            }
+
+            logP += calculateIntervalLikelihood(ps, intervals.getInterval(j), currentTime,
+                    intervals.getLineageCount(j), intervals.getIntervalType(j));
+
+            // insert zero-length coalescent intervals
+            int diff = intervals.getCoalescentEvents(j) - 1;
+            for (int k = 0; k < diff; k++) {
+                //cp.setN0(getPopSize(currentTime));
+                double fPopSize = getPopSize(currentTime);
+                logP += calculateIntervalLikelihood(fPopSize, 0.0, currentTime, intervals.getLineageCount(j) - k - 1,
+                        IntervalType.COALESCENT);
+                subIndex += 1;
+                if (subIndex >= groupSizes.getValue(groupIndex)) {
+                    groupIndex += 1;
+                    subIndex = 0;
+                }
+            }
+
+            currentTime += intervals.getInterval(j);
+        }
+        return logP;
+    }
+
+    public static double calculateIntervalLikelihood(double popSize, double width,
+                                                     double timeOfPrevCoal, int lineageCount, IntervalType type) {
+        final double timeOfThisCoal = width + timeOfPrevCoal;
+
+        final double intervalArea = (timeOfThisCoal - timeOfPrevCoal) / popSize;
+        //demogFunction.getIntegral(timeOfPrevCoal, timeOfThisCoal);
+        final double kchoose2 = Binomial.choose2(lineageCount);
+        double like = -kchoose2 * intervalArea;
+
+        switch (type) {
+            case COALESCENT:
+                final double demographic = Math.log(popSize);//demogFunction.getLogDemographic(timeOfThisCoal);
+                like += -demographic;
+
+                break;
+            default:
+                break;
+        }
+
+        return like;
+    }
+
+    /**
+     * @param t time
+     * @return
+     */
+    public double getPopSize(double t) {
+
+        if (!m_bIsPrepared) {
+            prepare();
+        }
+
+        if (t > coalescentTimes[coalescentTimes.length - 1])
+            return popSizes.getArrayValue(popSizes.getDimension() - 1);
+
+        int epoch = Arrays.binarySearch(coalescentTimes, t);
+        if (epoch < 0) {
+            epoch = -epoch - 1;
+        }
+
+        int groupIndex = Arrays.binarySearch(cumulativeGroupSizes, epoch);
+
+        if (groupIndex < 0) {
+            groupIndex = -groupIndex - 1;
+        } else {
+            groupIndex++;
+        }
+        if (groupIndex >= popSizes.getDimension()) {
+            groupIndex = popSizes.getDimension() - 1;
+        }
+
+        return popSizes.getArrayValue(groupIndex);
+    }
+
+    @Override
+    public List<String> getArguments() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public List<String> getConditions() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public void sample(State state, Random random) {
+        // TODO Auto-generated method stub
+
+    }
+
+
+// This is the implementation of BayesianSkyline as PopulationFunction.Abstract, which is somewhat slower 
+//	than the implementation as a Distribution (43s/Msamples agains 41s/Msamples on Dengue data)
+//	/**
+//	 * @param t
+//	 *            time
+//	 * @return
+//	 */
+//	@Override
+//	public double getIntensity(double t) {
+//		if (!m_bIsPrepared) {
+//			prepare();
+//		}
+//
+//		int index = 0;
+//		int groupIndex = 0;
+//
+//		t -= 1e-100;
+//		if (t > coalescentTimes[coalescentTimes.length - 1]) {
+//			t = coalescentTimes[coalescentTimes.length - 1];
+//		}
+//
+//		if (t < coalescentTimes[0]) {
+//			return t / popSizes.getArrayValue(0);
+//		} else {
+//
+//			double intensity = coalescentTimes[0] / popSizes.getArrayValue(0);
+//			index += 1;
+//			if (index >= cumulativeGroupSizes[groupIndex]) {
+//				groupIndex += 1;
+//			}
+//
+//			while (t > coalescentTimes[index]) {
+//
+//				intensity += (coalescentTimes[index] - coalescentTimes[index - 1]) / popSizes.getArrayValue(groupIndex);
+//
+//				index += 1;
+//				if (index >= cumulativeGroupSizes[groupIndex]) {
+//					groupIndex += 1;
+//				}
+//			}
+//			intensity += (t - coalescentTimes[index - 1]) / popSizes.getArrayValue(groupIndex);
+//
+//			return intensity;
+//		}
+//	}
+//
+//	public double getInverseIntensity(double x) {
+//		throw new UnsupportedOperationException();
+//	}
+}
diff --git a/src/beast/evolution/tree/coalescent/Coalescent.java b/src/beast/evolution/tree/coalescent/Coalescent.java
new file mode 100644
index 0000000..9406e88
--- /dev/null
+++ b/src/beast/evolution/tree/coalescent/Coalescent.java
@@ -0,0 +1,148 @@
+package beast.evolution.tree.coalescent;
+
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Random;
+
+import beast.core.CalculationNode;
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.State;
+import beast.core.Input.Validate;
+import beast.evolution.tree.TreeDistribution;
+import beast.math.Binomial;
+
+
+/**
+ * @author Alexei Drummond
+ */
+
+ at Description("Calculates the probability of a beast.tree conditional on a population size function. " +
+        "Note that this does not take the number of possible tree interval/tree topology combinations " +
+        "in account, in other words, the constant required for making this a proper distribution that integrates " +
+        "to unity is not calculated (partly, because we don't know how for sequentially sampled data).")
+public class Coalescent extends TreeDistribution {
+    public Input<PopulationFunction> popSizeInput = new Input<PopulationFunction>("populationModel", "A population size model", Validate.REQUIRED);
+
+    TreeIntervals intervals;
+
+    @Override
+    public void initAndValidate() throws Exception {
+        intervals = treeIntervalsInput.get();
+        if (intervals == null) {
+            throw new Exception("Expected treeIntervals to be specified");
+        }
+        calculateLogP();
+    }
+
+
+    /**
+     * do the actual calculation *
+     */
+    @Override
+    public double calculateLogP() throws Exception {
+
+        logP = calculateLogLikelihood(intervals, popSizeInput.get());
+
+        if (Double.isInfinite(logP)) {
+        	logP = Double.NEGATIVE_INFINITY;
+        }
+
+        return logP;
+    }
+
+    @Override
+    public void sample(State state, Random random) {
+        // TODO this should eventually sample a coalescent tree conditional on population size function
+        throw new UnsupportedOperationException("This should eventually sample a coalescent tree conditional on population size function.");
+    }
+
+    /**
+     * @return a list of unique ids for the state nodes that form the argument
+     */
+    @Override
+    public List<String> getArguments() {
+        return Collections.singletonList(treeIntervalsInput.get().getID());
+    }
+
+    /**
+     * @return a list of unique ids for the state nodes that make up the conditions
+     */
+    @Override
+    public List<String> getConditions() {
+        return popSizeInput.get().getParameterIds();
+    }
+
+
+    /**
+     * Calculates the log likelihood of this set of coalescent intervals,
+     * given a demographic model.
+     *
+     * @param intervals       the intervals whose likelihood is computed
+     * @param popSizeFunction the population size function
+     * @return the log likelihood of the intervals given the population size function
+     */
+    public double calculateLogLikelihood(IntervalList intervals, PopulationFunction popSizeFunction) {
+        return calculateLogLikelihood(intervals, popSizeFunction, 0.0);
+    }
+
+    /**
+     * Calculates the log likelihood of this set of coalescent intervals,
+     * given a population size function.
+     *
+     * @param intervals       the intervals whose likelihood is computed
+     * @param popSizeFunction the population size function
+     * @param threshold       the minimum allowable coalescent interval size; negative infinity will be returned if
+     *                        any non-zero intervals are smaller than this
+     * @return the log likelihood of the intervals given the population size function
+     */
+    public double calculateLogLikelihood(IntervalList intervals, PopulationFunction popSizeFunction, double threshold) {
+
+        double logL = 0.0;
+
+        double startTime = 0.0;
+        final int n = intervals.getIntervalCount();
+        for (int i = 0; i < n; i++) {
+
+            final double duration = intervals.getInterval(i);
+            final double finishTime = startTime + duration;
+
+            final double intervalArea = popSizeFunction.getIntegral(startTime, finishTime);
+            if (intervalArea == 0 && duration != 0) {
+                return Double.NEGATIVE_INFINITY;
+            }
+            final int lineageCount = intervals.getLineageCount(i);
+
+            final double kChoose2 = Binomial.choose2(lineageCount);
+            // common part
+            logL += -kChoose2 * intervalArea;
+
+            if (intervals.getIntervalType(i) == IntervalType.COALESCENT) {
+
+                final double demographicAtCoalPoint = popSizeFunction.getPopSize(finishTime);
+
+                // if value at end is many orders of magnitude different than mean over interval reject the interval
+                // This is protection against cases where ridiculous infinitesimal
+                // population size at the end of a linear interval drive coalescent values to infinity.
+
+                if (duration == 0.0 || demographicAtCoalPoint * (intervalArea / duration) >= threshold) {
+                    //                if( duration == 0.0 || demographicAtCoalPoint >= threshold * (duration/intervalArea) ) {
+                    logL -= Math.log(demographicAtCoalPoint);
+                } else {
+                    // remove this at some stage
+                    //  System.err.println("Warning: " + i + " " + demographicAtCoalPoint + " " + (intervalArea/duration) );
+                    return Double.NEGATIVE_INFINITY;
+                }
+            }
+            startTime = finishTime;
+        }
+
+        return logL;
+    }
+
+    @Override
+    protected boolean requiresRecalculation() {
+        return ((CalculationNode) popSizeInput.get()).isDirtyCalculation() || super.requiresRecalculation();
+    }
+}
diff --git a/src/beast/evolution/tree/coalescent/CompoundPopulationFunction.java b/src/beast/evolution/tree/coalescent/CompoundPopulationFunction.java
new file mode 100644
index 0000000..b0dec41
--- /dev/null
+++ b/src/beast/evolution/tree/coalescent/CompoundPopulationFunction.java
@@ -0,0 +1,619 @@
+package beast.evolution.tree.coalescent;
+
+
+import java.io.BufferedReader;
+import java.io.FileReader;
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.Loggable;
+import beast.core.parameter.BooleanParameter;
+import beast.core.parameter.RealParameter;
+import beast.evolution.tree.coalescent.IntervalType;
+import beast.evolution.tree.coalescent.PopulationFunction;
+import beast.evolution.tree.coalescent.TreeIntervals;
+import beast.math.statistic.DiscreteStatistics;
+
+
+/**
+ * @author joseph
+ *         Date: 26/08/2010
+ */
+ at Description("An effective population size function based on coalecent times from a set of trees.")
+public class CompoundPopulationFunction extends PopulationFunction.Abstract implements Loggable {
+
+    public Input<RealParameter> popSizeParameterInput = new Input<RealParameter>("populationSizes",
+            "population value at each point.", Input.Validate.REQUIRED);
+
+    public Input<BooleanParameter> indicatorsParameterInput = new Input<BooleanParameter>("populationIndicators",
+            "Include/exclude population value from the population function.", Input.Validate.REQUIRED);
+
+    public Input<List<TreeIntervals>> treesInput = new Input<List<TreeIntervals>>("itree", "Coalecent intervals of this tree are " +
+            "used in the compound population function.", new ArrayList<TreeIntervals>(), Input.Validate.REQUIRED);
+
+    public Input<String> demographicTypeInput = new Input<String>("type", "Flavour of demographic: either linear or stepwise for " +
+            " piecewise-linear or piecewise-constant.",
+            "linear");
+
+    public Input<Boolean> useMiddleInput = new Input<Boolean>("useIntervalsMiddle", "When true, the demographic X axis points are " +
+            "in the middle of the coalescent intervals. By default they are at the beginning.",
+            false);
+
+    private RealParameter popSizeParameter;
+    private BooleanParameter indicatorsParameter;
+    private List<TreeIntervals> trees;
+
+    private Type type;
+    private boolean useMid;
+
+
+    public enum Type {
+        LINEAR("linear"),
+        //EXPONENTIAL("exponential"),
+        STEPWISE("stepwise");
+
+        Type(String name) {
+            this.name = name;
+        }
+
+        public String toString() {
+            return name;
+        }
+
+        String name;
+    }
+
+    private void getParams() {
+        popSizeParameter = popSizeParameterInput.get();
+        indicatorsParameter = indicatorsParameterInput.get();
+        assert popSizeParameter != null && popSizeParameter.getArrayValue(0) > 0 && indicatorsParameter != null;
+    }
+
+    // why do we need this additional level on top of initAndValidate - does not seem to do anything?
+    @Override
+    public void prepare() {
+        getParams();
+        // is that safe???
+        trees = treesInput.get();
+
+        useMid = useMiddleInput.get();
+
+        // used to work without upper case ???
+        type = Type.valueOf(demographicTypeInput.get().toUpperCase());  // errors?
+        // set lengths
+
+        int events = 0;
+        for (TreeIntervals ti : trees) {
+            // number of coalescent events
+            events += ti.treeInput.get().getLeafNodeCount() - 1;
+        }
+        // all trees share time 0, need fixing for serial data
+
+        events += type == Type.STEPWISE ? 0 : 1;
+        try {
+            if (popSizeParameter.getDimension() != events) {
+                final RealParameter p = new RealParameter();
+                p.initByName("value", popSizeParameter.getValue() + "", "upper", popSizeParameter.getUpper(), "lower", popSizeParameter.getLower(), "dimension", events);
+                p.setID(popSizeParameter.getID());
+                popSizeParameter.assignFromWithoutID(p);
+            }
+
+            if (indicatorsParameter.getDimension() != events - 1) {
+                final BooleanParameter p = new BooleanParameter();
+                p.initByName("value", "" + indicatorsParameter.getValue(), "dimension", events - 1);
+                p.setID(indicatorsParameter.getID());
+                indicatorsParameter.assignFrom(p);
+            }
+        } catch (Exception e) {
+            // what to do?
+            e.printStackTrace();
+        }
+
+        initInternals();
+        for (int nt = 0; nt < trees.size(); ++nt) {
+            setTreeTimes(nt);
+        }
+        mergeTreeTimes();
+        setDemographicArrays();
+
+        shadow = new Shadow();
+    }
+
+    @Override
+    public List<String> getParameterIds() {
+        List<String> paramIDs = new ArrayList<String>();
+        paramIDs.add(popSizeParameter.getID());
+        paramIDs.add(indicatorsParameter.getID());
+
+        for (TreeIntervals t : trees) {
+            // I think this may be wrong, and we need the trees themselves
+            paramIDs.add(t.getID());
+        }
+        return paramIDs;
+    }
+
+    @Override
+    public double getPopSize(double t) {
+        double p;
+        switch (type) {
+            case STEPWISE: {
+                final int j = getIntervalIndexStep(t);
+                p = values[j];
+                break;
+            }
+            case LINEAR: {
+                p = linPop(t);
+                break;
+            }
+            default:
+                throw new IllegalArgumentException("");
+        }
+        return p;
+    }
+
+    @Override
+    public double getIntensity(double t) {
+        return getIntegral(0, t);
+    }
+
+    @Override
+    public double getInverseIntensity(double x) {
+        throw new UnsupportedOperationException();
+    }
+
+    // values participating in the demographic
+    private double[] values;
+    // times participating in the demographic
+    private double[] times;
+    // convenience: intervals[n] = times[n+1] - times[n]
+    private double[] intervals;
+
+    // sorted times from each tree
+    private double[][] ttimes;
+
+    // sorted times from all trees (merge of ttimes above)
+    private double[] alltimes;
+
+    // no allocations, minimal copying
+    class Shadow {
+        double[] values;
+        double[] times;
+        double[] intervals;
+        double[][] ttimes;
+        double[] alltimes;
+
+        boolean c_demo, c_alltimes;
+        boolean[] c_ttimes;
+
+        Shadow() {
+            values = CompoundPopulationFunction.this.values.clone();
+            times = CompoundPopulationFunction.this.times.clone();
+            intervals = CompoundPopulationFunction.this.intervals.clone();
+
+            alltimes = CompoundPopulationFunction.this.alltimes.clone();
+
+            ttimes = CompoundPopulationFunction.this.ttimes.clone();
+            for (int nt = 0; nt < ttimes.length; ++nt) {
+                ttimes[nt] = CompoundPopulationFunction.this.ttimes[nt].clone();
+            }
+            c_ttimes = new boolean[ttimes.length];
+
+            reset();
+        }
+
+        void reset() {
+            c_alltimes = false;
+            c_demo = false;
+            Arrays.fill(c_ttimes, false);
+        }
+
+        void protect_demo() {
+
+            values = CompoundPopulationFunction.this.values;
+            times = CompoundPopulationFunction.this.times;
+            intervals = CompoundPopulationFunction.this.intervals;
+
+            CompoundPopulationFunction.this.values = null;
+            CompoundPopulationFunction.this.times = null;
+            CompoundPopulationFunction.this.intervals = null;
+//            {
+//                final double[] src = CompoundPopulationFunction.this.values;
+//                final double[] target = values;
+//                if( src.length == target.length ) {
+//                    System.arraycopy(src, 0,  target, 0, src.length);
+//                } else {
+//                    values = src.clone();
+//                }
+//            }
+//            {
+//                final double[] src = CompoundPopulationFunction.this.times;
+//                final double[] target = times;
+//                if( src.length == target.length ) {
+//                    System.arraycopy(src, 0,  target, 0, src.length);
+//                }  else {
+//                    times = src.clone();
+//                }
+//            }
+//            {
+//                final double[] src = CompoundPopulationFunction.this.intervals;
+//                final double[] target = intervals;
+//                if( src.length == target.length ) {
+//                    System.arraycopy(src, 0,  target, 0, src.length);
+//                } else {
+//                    intervals = src.clone();
+//                }
+//            }
+            c_demo = true;
+        }
+
+        void protect_alltimes() {
+            final double[] src = CompoundPopulationFunction.this.alltimes;
+            System.arraycopy(src, 0, alltimes, 0, src.length);
+            c_alltimes = true;
+        }
+
+        void protect_ttimes(int nt) {
+            final double[] src = CompoundPopulationFunction.this.ttimes[nt];
+            System.arraycopy(src, 0, ttimes[nt], 0, src.length);
+            c_ttimes[nt] = true;
+        }
+
+        void accept() {
+            values = times = intervals = null;
+        }
+
+        void reject() {
+            if (c_alltimes) {
+                final double[] v = CompoundPopulationFunction.this.alltimes;
+                CompoundPopulationFunction.this.alltimes = alltimes;
+                alltimes = v;
+            }
+
+            if (c_demo) {
+                CompoundPopulationFunction.this.values = values;
+                CompoundPopulationFunction.this.times = times;
+                CompoundPopulationFunction.this.intervals = intervals;
+
+                values = times = intervals = null;
+//                double[] v = CompoundPopulationFunction.this.values;
+//                CompoundPopulationFunction.this.values = values;
+//                values = v;
+//
+//                v = CompoundPopulationFunction.this.times;
+//                CompoundPopulationFunction.this.times = times;
+//                times = v;
+//
+//                v = CompoundPopulationFunction.this.intervals;
+//                CompoundPopulationFunction.this.intervals = intervals;
+//                intervals = v;
+            }
+
+            for (int nt = 0; nt < c_ttimes.length; ++nt) {
+                if (c_ttimes[nt]) {
+                    double[] v = CompoundPopulationFunction.this.ttimes[nt];
+                    CompoundPopulationFunction.this.ttimes[nt] = ttimes[nt];
+                    ttimes[nt] = v;
+                }
+            }
+        }
+    }
+
+    private Shadow shadow;
+
+    private void initInternals() {
+        ttimes = new double[trees.size()][];
+        int tot = 0;
+        for (int k = 0; k < ttimes.length; ++k) {
+            ttimes[k] = new double[trees.get(k).treeInput.get().getLeafNodeCount() - 1];
+            tot += ttimes[k].length;
+        }
+        alltimes = new double[tot];
+    }
+
+    private int getIntervalIndexStep(final double t) {
+        int j = 0;
+        // ugly hack,
+        // when doubles are added in a different order and compared later, they can be a tiny bit off. With a
+        // stepwise model this creates a "one off" situation here, which is unpleasant.
+        // use float comparison here to avoid it
+
+        final float tf = (float) t;
+        while (tf > (float) times[j + 1]) ++j;
+        return j;
+    }
+
+    private int getIntervalIndexLin(final double t) {
+        int j = 0;
+        while (t > times[j + 1]) ++j;
+        return j;
+    }
+
+    private double linPop(double t) {
+        final int j = getIntervalIndexLin(t);
+        if (j == values.length - 1) {
+            return values[j];
+        }
+
+        final double a = (t - times[j]) / (intervals[j]);
+        return a * values[j + 1] + (1 - a) * values[j];
+    }
+
+    private double intensityLinInterval(double start, double end, int index) {
+        final double dx = end - start;
+        if (dx == 0) {
+            return 0;
+        }
+
+        final double popStart = values[index];
+        final double popDiff = (index < values.length - 1) ? values[index + 1] - popStart : 0.0;
+        if (popDiff == 0.0) {
+            return dx / popStart;
+        }
+        final double time0 = times[index];
+        final double interval = intervals[index];
+
+        assert (float) start <= (float) (time0 + interval) && start >= time0
+                && (float) end <= (float) (time0 + interval) && end >= time0;
+
+        //better numerical stability but not perfect
+        final double p1minusp0 = ((end - start) / interval) * popDiff;
+
+        final double v = interval * (popStart / popDiff);
+        final double p1overp0 = (v + (end - time0)) / (v + (start - time0));
+        if (p1minusp0 == 0.0 || p1overp0 <= 0) {
+            // either dx == 0 or is very small (numerical inaccuracy)
+            final double pop0 = popStart + ((start - time0) / interval) * popDiff;
+            return dx / pop0;
+        }
+
+        return dx * Math.log(p1overp0) / p1minusp0;
+        // return dx * Math.log(pop1/pop0) / (pop1 - pop0);*/
+    }
+
+    private double intensityLinInterval(int index) {
+        final double interval = intervals[index];
+        final double pop0 = values[index];
+        final double pop1 = values[index + 1];
+        if (pop0 == pop1) {
+            return interval / pop0;
+        }
+        return interval * Math.log(pop1 / pop0) / (pop1 - pop0);
+    }
+
+    public double getIntegral(double start, double finish) {
+
+        double intensity = 0.0;
+
+        switch (type) {
+            case STEPWISE: {
+                final int first = getIntervalIndexStep(start);
+                final int last = getIntervalIndexStep(finish);
+
+                final double popStart = values[first];
+                if (first == last) {
+                    intensity = (finish - start) / popStart;
+                } else {
+                    intensity = (times[first + 1] - start) / popStart;
+
+                    for (int k = first + 1; k < last; ++k) {
+                        intensity += intervals[k] / values[k];
+                    }
+                    intensity += (finish - times[last]) / values[last];
+                }
+                break;
+            }
+            case LINEAR: {
+                final int first = getIntervalIndexLin(start);
+                final int last = getIntervalIndexLin(finish);
+
+                if (first == last) {
+                    intensity += intensityLinInterval(start, finish, first);
+                } else {
+                    // from first to end of interval
+                    intensity += intensityLinInterval(start, times[first + 1], first);
+                    // intervals until (not including) last
+                    for (int k = first + 1; k < last; ++k) {
+                        intensity += intensityLinInterval(k);
+                    }
+                    // last interval
+                    intensity += intensityLinInterval(times[last], finish, last);
+                }
+                break;
+            }
+        }
+        return intensity;
+    }
+
+    /**
+     * Get times of the (presumably changed) nt'th tree into the local array.
+     *
+     * @param nt
+     */
+    private void setTreeTimes(int nt) {
+
+        TreeIntervals nti = trees.get(nt);
+        nti.setMultifurcationLimit(0);
+
+        // code probably incorrect for serial samples
+        final int nLineages = nti.getIntervalCount();
+        assert nLineages >= ttimes[nt].length : nLineages + " " + ttimes[nt].length;
+
+        int iCount = 0;
+        for (int k = 0; k < ttimes[nt].length; ++k) {
+            double timeToCoal = nti.getInterval(iCount);
+            while (nti.getIntervalType(iCount) != IntervalType.COALESCENT) {
+                ++iCount;
+                timeToCoal += nti.getInterval(iCount);
+            }
+
+            int linAtStart = nti.getLineageCount(iCount);
+            ++iCount;
+
+            assert !(iCount == nLineages && linAtStart != 2);
+
+            int linAtEnd = (iCount == nLineages) ? 1 : nti.getLineageCount(iCount);
+
+            while (linAtStart <= linAtEnd) {
+                ++iCount;
+                timeToCoal += nti.getInterval(iCount);
+
+                linAtStart = linAtEnd;
+                ++iCount;
+                linAtEnd = nti.getLineageCount(iCount);
+            }
+            ttimes[nt][k] = timeToCoal + (k == 0 ? 0 : ttimes[nt][k - 1]);
+        }
+    }
+
+    /**
+     * Merge sorted times in each ttimes[] array into one sorted array (alltimes) *
+     */
+    private void mergeTreeTimes() {
+        // now we want to merge times together
+        int[] inds = new int[ttimes.length];
+
+        for (int k = 0; k < alltimes.length; ++k) {
+            int j = 0;
+            while (inds[j] == ttimes[j].length) {
+                ++j;
+            }
+            for (int l = j + 1; l < inds.length; ++l) {
+                if (inds[l] < ttimes[l].length) {
+                    if (ttimes[l][inds[l]] < ttimes[j][inds[j]]) {
+                        j = l;
+                    }
+                }
+            }
+            alltimes[k] = ttimes[j][inds[j]];
+            inds[j]++;
+        }
+    }
+
+    /**
+     * Setup the internal times,values,intervals from the rest *
+     */
+    private void setDemographicArrays() {
+        // assumes lowest node has time 0. this is probably problematic when we come
+        // to deal with multiple trees
+
+        int tot = 1;
+        final int nd = indicatorsParameter.getDimension();
+
+        assert nd == alltimes.length + (type == Type.STEPWISE ? -1 : 0) :
+                " nd=" + nd + " alltimes.length=" + alltimes.length + " type=" + type;
+        for (int k = 0; k < nd; ++k) {
+            if (indicatorsParameter.getValue(k)) {
+                ++tot;
+            }
+        }
+
+        times = new double[tot + 1];
+        values = new double[tot];
+        intervals = new double[tot - 1];
+
+        times[0] = 0.0;
+        times[tot] = Double.POSITIVE_INFINITY;
+
+        values[0] = popSizeParameter.getValue(0);
+
+        int n = 0;
+        for (int k = 0; k < nd && n + 1 < tot; ++k) {
+
+            if (indicatorsParameter.getValue(k)) {
+                times[n + 1] = useMid ? ((alltimes[k] + (k > 0 ? alltimes[k - 1] : 0)) / 2) : alltimes[k];
+
+                values[n + 1] = popSizeParameter.getValue(k + 1);
+                intervals[n] = times[n + 1] - times[n];
+                ++n;
+            }
+        }
+    }
+
+    @Override
+    protected void store() {
+        super.store();
+    }
+
+    @Override
+    protected boolean requiresRecalculation() {
+        boolean anyTreesChanged = false;
+        for (int nt = 0; nt < trees.size(); ++nt) {
+            TreeIntervals ti = trees.get(nt);
+            if (ti.isDirtyCalculation()) {
+                shadow.protect_ttimes(nt);
+
+                setTreeTimes(nt);
+                anyTreesChanged = true;
+            }
+        }
+
+        // we access parameters in any case
+        getParams();
+
+        if (anyTreesChanged) {
+            shadow.protect_alltimes();
+            shadow.protect_demo();
+
+            mergeTreeTimes();
+            setDemographicArrays();
+        } else {
+            if (popSizeParameter.somethingIsDirty() && !indicatorsParameter.somethingIsDirty()) {
+
+            }
+            shadow.protect_demo();
+            setDemographicArrays();
+        }
+        return true;
+    }
+
+    @Override
+    protected void restore() {
+        shadow.reject();
+        shadow.reset();
+        super.restore();
+    }
+
+    @Override
+    protected void accept() {
+        shadow.accept();
+        shadow.reset();
+        super.accept();
+    }
+
+    @Override
+    public void init(PrintStream out) throws Exception {
+        // interval sizes
+        out.print("popsSize0\t");
+        for (int i = 0; i < alltimes.length; i++) {
+            out.print(getID() + ".times." + i + "\t");
+        }
+    }
+
+    @Override
+    public void log(int nSample, PrintStream out) {
+        // interval sizes
+        out.print("0:" + popSizeParameter.getArrayValue(0) + "\t");
+        for (int i = 0; i < alltimes.length - (type == Type.STEPWISE ? 1 : 0); i++) {
+            out.print(alltimes[i]);
+            if (indicatorsParameter.getArrayValue(i) > 0) {
+                out.print(":" + popSizeParameter.getArrayValue(i + 1));
+            }
+            out.print("\t");
+        }
+        if( type == Type.STEPWISE ) {
+          out.print(alltimes[alltimes.length-1]);
+        }
+    }
+
+
+    @Override
+    public void close(PrintStream out) {
+    }
+}
\ No newline at end of file
diff --git a/src/beast/evolution/tree/coalescent/ConstantPopulation.java b/src/beast/evolution/tree/coalescent/ConstantPopulation.java
new file mode 100644
index 0000000..efb00ad
--- /dev/null
+++ b/src/beast/evolution/tree/coalescent/ConstantPopulation.java
@@ -0,0 +1,141 @@
+package beast.evolution.tree.coalescent;
+
+
+import java.util.Collections;
+import java.util.List;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.Input.Validate;
+import beast.core.parameter.RealParameter;
+/*
+ * ConstantPopulation.java
+ *
+ * Copyright (C) 2002-2006 Alexei Drummond and Andrew Rambaut
+ *
+ * This file is part of BEAST.
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership and licensing.
+ *
+ * BEAST 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
+ * of the License, or (at your option) any later version.
+ *
+ *  BEAST 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 BEAST; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+
+/**
+ * @author Andrew Rambaut
+ * @author Alexei Drummond
+ * @version $Id: ConstantPopulation.java,v 1.9 2005/05/24 20:25:55 rambaut Exp $
+ */
+ at Description("coalescent intervals for a constant population")
+public class ConstantPopulation extends PopulationFunction.Abstract {
+    public Input<RealParameter> popSizeParameter = new Input<RealParameter>("popSize",
+            "constant (effective) population size value.", Validate.REQUIRED);
+
+    //
+    // Public stuff
+    //
+
+    /**
+     * @return initial population size.
+     */
+    public double getN0() {
+        N0 = popSizeParameter.get().getValue();
+        return N0;
+    }
+
+    /**
+     * sets initial population size.
+     *
+     * @param N0 new size
+     */
+    public void setN0(double N0) {
+        this.N0 = N0;
+    }
+
+
+    // Implementation of abstract methods
+
+    public List<String> getParameterIds() {
+        return Collections.singletonList(popSizeParameter.get().getID());
+    }
+
+    public double getPopSize(double t) {
+        return getN0();
+    }
+
+    public double getIntensity(double t) {
+        return t / getN0();
+    }
+
+    public double getInverseIntensity(double x) {
+        return getN0() * x;
+    }
+
+    // same as abstract
+//	/**
+//	 * Calculates the integral 1/N(x) dx between start and finish. The
+//	 * inherited function in DemographicFunction.Abstract calls a
+//	 * numerical integrater which is unecessary.
+//	 */
+//	public double getIntegral(double start, double finish) {
+//		return getIntensity(finish) - getIntensity(start);
+//	}
+
+    //
+
+//    public int getNumArguments() {
+//        return 1;
+//    }
+//
+//    public String getArgumentName(int n) {
+//        return "N0";
+//    }
+//
+//    public double getArgument(int n) {
+//        return getN0();
+//    }
+//
+//    public void setArgument(int n, double value) {
+//        setN0(value);
+//    }
+//
+//    public double getLowerBound(int n) {
+//        return 0.0;
+//    }
+//
+//    public double getUpperBound(int n) {
+//        return Double.POSITIVE_INFINITY;
+//    }
+//
+//    public PopulationFunction getCopy() {
+//        ConstantPopulation cp = new ConstantPopulation();
+//        cp.setN0(N0);
+//        return cp;
+//    }
+
+//    public void prepare(State state) {
+//        if (popSizeParameter.get() != null) {
+//            N0 = popSizeParameter.get().getValue();//state.getParameter(popSizeParameter).getValue();
+//        }
+//    }
+
+
+    //
+    // private stuff
+    //
+
+    private double N0 = 1.0;
+}
diff --git a/src/beast/evolution/tree/coalescent/ExponentialGrowth.java b/src/beast/evolution/tree/coalescent/ExponentialGrowth.java
new file mode 100644
index 0000000..d979f19
--- /dev/null
+++ b/src/beast/evolution/tree/coalescent/ExponentialGrowth.java
@@ -0,0 +1,212 @@
+package beast.evolution.tree.coalescent;
+
+
+import java.util.Collections;
+import java.util.List;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.parameter.RealParameter;
+/*
+ * ConstantPopulation.java
+ *
+ * Copyright (C) 2002-2006 Alexei Drummond and Andrew Rambaut
+ *
+ * This file is part of BEAST.
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership and licensing.
+ *
+ * BEAST 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
+ * of the License, or (at your option) any later version.
+ *
+ *  BEAST 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 BEAST; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+
+/**
+ * @author Andrew Rambaut
+ * @author Alexei Drummond
+ * @version $Id: ConstantPopulation.java,v 1.9 2005/05/24 20:25:55 rambaut Exp $
+ */
+ at Description("Coalescent intervals for a exponentially growing population.")
+public class ExponentialGrowth extends PopulationFunction.Abstract {
+    public Input<RealParameter> popSizeParameterInput = new Input<RealParameter>("popSize",
+            "present-day population size (defaults to 1.0). ");
+    public Input<RealParameter> growthRateParameterInput = new Input<RealParameter>("growthRate",
+            "growth rate is the exponent of the exponential growth");
+
+    //
+    // Public stuff
+    //
+
+    public void initAndValidate() throws Exception {
+        if (popSizeParameterInput.get() != null) {
+            popSizeParameterInput.get().setBounds(
+            		Math.max(0.0, popSizeParameterInput.get().getLower()), 
+            		popSizeParameterInput.get().getUpper());
+        }
+//        if (growthRateParameter.get() != null) {
+//            growthRateParameter.get().setBounds(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY);
+//        }
+    }
+
+    /**
+     * @return initial population size.
+     */
+    public double getN0() {
+        return popSizeParameterInput.get().getValue();
+    }
+
+    /**
+     * sets initial population size.
+     *
+     * @param N0 new size
+     */
+//    public void setN0(double N0) {
+//        this.N0 = N0;
+//    }
+
+    /**
+     * @return growth rate.
+     */
+    public final double getGrowthRate() {
+        return growthRateParameterInput.get().getValue();
+    }
+
+    /**
+     * sets growth rate to r.
+     *
+     * @param r
+     */
+//    public void setGrowthRate(double r) {
+//        this.r = r;
+//    }
+
+    /**
+     * An alternative parameterization of this model. This
+     * function sets growth rate for a given doubling time.
+     *
+     * @param doublingTime
+     */
+//    public void setDoublingTime(double doublingTime) {
+//        setGrowthRate(Math.log(2) / doublingTime);
+//    }
+
+    // Implementation of abstract methods
+    public double getPopSize(double t) {
+
+        double r = getGrowthRate();
+        if (r == 0) {
+            return getN0();
+        } else {
+            return getN0() * Math.exp(-t * r);
+        }
+    }
+
+    /**
+     * Calculates the integral 1/N(x) dx between start and finish.
+     */
+    @Override
+    public double getIntegral(double start, double finish) {
+        double r = getGrowthRate();
+        if (r == 0.0) {
+            return (finish - start) / getN0();
+        } else {
+            return (Math.exp(finish * r) - Math.exp(start * r)) / getN0() / r;
+        }
+    }
+
+    public double getIntensity(double t) {
+        double r = getGrowthRate();
+        if (r == 0.0) {
+            return t / getN0();
+        } else {
+            return (Math.exp(t * r) - 1.0) / getN0() / r;
+        }
+    }
+
+    public double getInverseIntensity(double x) {
+
+        double r = getGrowthRate();
+        if (r == 0.0) {
+            return getN0() * x;
+        } else {
+            return Math.log(1.0 + getN0() * x * r) / r;
+        }
+    }
+
+
+    // Implementation of abstract methods
+
+    public List<String> getParameterIds() {
+        return Collections.singletonList(popSizeParameterInput.get().getID());
+    }
+
+//    public int getNumArguments() {
+//        return 2;
+//    }
+//
+//    public String getArgumentName(int n) {
+//        if (n == 0) return "N0";
+//        else return "r";
+//    }
+//
+//    public double getArgument(int n) {
+//        if (n == 0) return getN0();
+//        else return r;
+//    }
+//
+//    public void setArgument(int n, double value) {
+//        if (n == 0) setN0(value);
+//        else r = value;
+//    }
+//
+//    public double getLowerBound(int n) {
+//        if (n == 0) return 0.0;
+//        else return Double.NEGATIVE_INFINITY;
+//    }
+//
+//    public double getUpperBound(int n) {
+//        return Double.POSITIVE_INFINITY;
+//    }
+//
+//    public PopulationFunction getCopy() {
+//        ExponentialGrowth eg = new ExponentialGrowth();
+//        eg.setN0(N0);
+//        eg.r = r;
+//        return eg;
+//    }
+
+//    public void prepare(State state) {
+//        if (popSizeParameter.get() != null) {
+//            N0 = popSizeParameter.get().getValue();//state.getParameter(popSizeParameter).getValue();
+//        }
+//        if (growthRateParameter.get() != null) {
+//            r = growthRateParameter.get().getValue();//state.getParameter(growthRateParameter).getValue();
+//        }
+//    }
+
+    //
+    // private stuff
+    //
+
+    /**
+     * The current day population size
+     */
+    //private double N0 = 1.0;
+
+    /**
+     * The exponential growth rate
+     */
+    //private double r = 0.01;
+}
\ No newline at end of file
diff --git a/src/beast/evolution/tree/coalescent/IntervalList.java b/src/beast/evolution/tree/coalescent/IntervalList.java
new file mode 100644
index 0000000..6af2d3a
--- /dev/null
+++ b/src/beast/evolution/tree/coalescent/IntervalList.java
@@ -0,0 +1,157 @@
+package beast.evolution.tree.coalescent;
+
+/*
+ * IntervalList.java
+ *
+ * Copyright (C) 2002-2006 Alexei Drummond and Andrew Rambaut
+ *
+ * This file is part of BEAST.
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership and licensing.
+ *
+ * BEAST 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
+ * of the License, or (at your option) any later version.
+ *
+ *  BEAST 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 BEAST; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+
+/**
+ * An interface for a set of coalescent intervals.
+ *
+ * @author Andrew Rambaut
+ * @author Alexei Drummond
+ * @version $Id: IntervalList.java,v 1.7 2005/05/24 20:25:56 rambaut Exp $
+ */
+public interface IntervalList {
+
+    /**
+     * @return the number of intervals
+     */
+    int getIntervalCount();
+
+    /**
+     * @return the total number of sampling events.
+     */
+    int getSampleCount();
+
+    /**
+     * @param i the index of the interval
+     * @return the size of the i'th interval.
+     */
+    double getInterval(int i);
+
+    /**
+     * Required for s-coalescents, where new lineages are added as
+     * earlier samples are come across.
+     *
+     * @param i the index of the interval
+     * @return the number of uncoalesced lineages within this interval.
+     */
+    int getLineageCount(int i);
+
+    /**
+     * @param i the index of the interval
+     * @return the number coalescent events in an interval
+     */
+    int getCoalescentEvents(int i);
+
+    /**
+     * @param i the index of the interval
+     * @return the type of interval observed.
+     */
+    IntervalType getIntervalType(int i);
+
+    /**
+     * @return the total duration of these intervals.
+     */
+    double getTotalDuration();
+
+    /**
+     * @return true if this set of coalescent intervals is fully resolved
+     *         (i.e. whether is has exactly one coalescent event in each
+     *         subsequent interval), false otherwise.
+     */
+    boolean isBinaryCoalescent();
+
+    /**
+     * @return true if this set of coalescent intervals coalescent only
+     *         (i.e. whether is has exactly one or more coalescent event in each
+     *         subsequent interval), false otherwise
+     */
+    boolean isCoalescentOnly();
+
+
+    public class Utils {
+
+        /**
+         * @param intervals the intervals
+         * @param t         the time that you are counting the number of lineages
+         * @return the number of lineages at time t.
+         */
+        public static int getLineageCount(IntervalList intervals, double t) {
+
+            int i = 0;
+            while (i < intervals.getIntervalCount() && t > intervals.getInterval(i)) {
+                t -= intervals.getInterval(i);
+                i += 1;
+            }
+            if (i == intervals.getIntervalCount()) return 1;
+            return intervals.getLineageCount(i);
+        }
+
+        /**
+         * @param intervals the intervals for which the delta parameter is calculated.
+         * @return the delta parameter of Pybus et al (Node spread statistic)
+         */
+        public static double getDelta(IntervalList intervals) {
+
+            // Assumes ultrametric beast.tree!
+            if (!intervals.isCoalescentOnly()) {
+                throw new IllegalArgumentException("Assumes ultrametric beast.tree!");
+            }
+
+            int n = intervals.getIntervalCount();
+
+            int numTips = n + 1;
+
+            double transTreeDepth = 0.0;
+            double cumInts = 0.0;
+            double sum = 0.0;
+
+            // transform intervals
+            for (int j = 0; j < n; j++) { // move from tips to root
+
+                double transInt = intervals.getInterval(j) *
+                        beast.math.Binomial.choose2(intervals.getLineageCount(j)); // coalescent version
+                //intLenCopy[j] = getInterval(j)*getLineageCount(j); // birth-death version
+
+                // don't include the last interval so put this before...
+                sum += cumInts;
+
+                // ...incrementing the cumInts
+                cumInts += transInt;
+
+                transTreeDepth += transInt;
+            }
+
+            double halfTreeDepth = transTreeDepth / 2.0;
+
+            sum *= (1.0 / (numTips - 2.0));
+            double top = halfTreeDepth - sum;
+            double bottom = transTreeDepth * Math.sqrt((1.0 / (12.0 * (numTips - 2.0))));
+
+            return (top / bottom);
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/beast/evolution/tree/coalescent/IntervalType.java b/src/beast/evolution/tree/coalescent/IntervalType.java
new file mode 100644
index 0000000..70a9bbd
--- /dev/null
+++ b/src/beast/evolution/tree/coalescent/IntervalType.java
@@ -0,0 +1,75 @@
+package beast.evolution.tree.coalescent;
+
+/*
+ * IntervalType.java
+ *
+ * Copyright (C) 2002-2009 Alexei Drummond and Andrew Rambaut
+ *
+ * This file is part of BEAST.
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership and licensing.
+ *
+ * BEAST 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
+ * of the License, or (at your option) any later version.
+ *
+ * BEAST 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 BEAST; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+/**
+ * Specifies the interval types.
+ *
+ * @author Andrew Rambaut
+ * @author Alexei Drummond
+ * @version $Id: IntervalType.java,v 1.9 2005/05/24 20:25:56 rambaut Exp $
+ */
+public enum IntervalType {
+
+    /**
+     * Denotes an interval at the end of which a new sample addition is
+     * observed (i.e. the number of lineages is larger in the next interval).
+     */
+    SAMPLE("sample"),
+
+    /**
+     * Denotes an interval after which a coalescent event is observed
+     * (i.e. the number of lineages is smaller in the next interval)
+     */
+    COALESCENT("coalescent"),
+
+    /**
+     * Denotes an interval at the end of which a migration event occurs.
+     * This means that the colour of one lineage changes.
+     */
+    MIGRATION("migration"),
+
+    /**
+     * Denotes an interval at the end of which nothing is
+     * observed (i.e. the number of lineages is the same in the next interval).
+     */
+    NOTHING("nothing");
+
+    /**
+     * private constructor.
+     *
+     * @param name the name of the interval type
+     */
+    private IntervalType(String name) {
+        this.name = name;
+    }
+
+    public String toString() {
+        return name;
+    }
+
+    private final String name;
+}
\ No newline at end of file
diff --git a/src/beast/evolution/tree/coalescent/PopulationFunction.java b/src/beast/evolution/tree/coalescent/PopulationFunction.java
new file mode 100644
index 0000000..e05a3f1
--- /dev/null
+++ b/src/beast/evolution/tree/coalescent/PopulationFunction.java
@@ -0,0 +1,256 @@
+package beast.evolution.tree.coalescent;
+
+import org.apache.commons.math.FunctionEvaluationException;
+import org.apache.commons.math.MaxIterationsExceededException;
+import org.apache.commons.math.analysis.UnivariateRealFunction;
+import org.apache.commons.math.analysis.integration.RombergIntegrator;
+
+import beast.core.*;
+import beast.math.Binomial;
+import beast.util.Randomizer;
+
+
+import java.util.List;
+
+
+/**
+ * This interface provides methods that describe a population size function.
+ *
+ * @author Alexei Drummond
+ * @author Andrew Rambaut
+ * @author Korbinian Strimmer
+ */
+public interface PopulationFunction extends UnivariateRealFunction {
+
+    /**
+     * @return a list of the unique identifiers for the parameters describing this population function
+     */
+    List<String> getParameterIds();
+
+    /**
+     * @param t time
+     * @return value of the demographic function N(t) at time t
+     */
+    double getPopSize(double t);
+
+    /**
+     * @param t time
+     * @return value of demographic intensity function at time t (x = integral 1/N(s) ds from 0 to t).
+     */
+    double getIntensity(double t);
+
+    /**
+     * @param x the coalescent intensity
+     * @return value of inverse demographic intensity function
+     *         (returns time, needed for simulation of coalescent intervals).
+     */
+    double getInverseIntensity(double x);
+
+    /**
+     * Calculates the integral 1/N(t) dt between start and finish.
+     *
+     * @param start  point
+     * @param finish point
+     * @return integral value
+     */
+    double getIntegral(double start, double finish);
+
+    /** Interface is not used anywhere and was not implemented for skyline anyway
+     * For now it is commented out. We can easily reinstate the code if a use arises,
+     * but then we need to implement for all cases ...
+     **/
+//
+//    /**
+//     * @return the number of arguments for this function.
+//     */
+//    int getNumArguments();
+//
+//    /**
+//     * @param n the index of argument to retrieve the name of
+//     * @return the name of the n'th argument of this function.
+//     */
+//    String getArgumentName(int n);
+//
+//    /**
+//     * @param n the argument index
+//     * @return the value of the n'th argument of this function.
+//     */
+//    double getArgument(int n);
+//
+//    /**
+//     * @param n     the argument index
+//     * @param value the value to set for the n'th argument
+//     *              Sets the value of the nth argument of this function.
+//     */
+//    void setArgument(int n, double value);
+//
+//    /**
+//     * @param n the argument index
+//     * @return the lower bound of the nth argument of this function.
+//     */
+//    double getLowerBound(int n);
+//
+//    /**
+//     * @param n the argument index
+//     * @return the upper bound of the nth argument of this function.
+//     */
+//    double getUpperBound(int n);
+//
+//    /**
+//     * @return a copy of this function.
+//     */
+//    PopulationFunction getCopy();
+
+    /**
+     * A threshold for underflow on calculation of likelihood of internode intervals.
+     * Most population size functions could probably return 0.0 but (e.g.,) the Extended Skyline
+     * needs a non zero value to prevent a numerical problem.
+     *
+     * @return the minimum coalescent interval
+     */
+    double getThreshold();
+
+    @Description("An implementation of a population size function plugin." +
+            "Also note that if you are dealing with a diploid population " +
+            "N0 will be the number of alleles, not the number of individuals.")
+    public abstract class Abstract extends CalculationNode implements PopulationFunction {
+
+        RombergIntegrator numericalIntegrator = new RombergIntegrator();
+
+        /**
+         * Construct demographic model with default settings
+         */
+        public Abstract() {
+        }
+
+        // general functions
+        public void initAndValidate() throws Exception {
+            prepare();
+        }
+
+        public double getThreshold() {
+            return 0;
+        }
+
+        /**
+         * Calculates the integral 1/N(t) dt between start and finish.
+         */
+        public double getIntegral(double start, double finish) {
+            return getIntensity(finish) - getIntensity(start);
+        }
+
+        /**
+         * @param start  the start time of the definite integral
+         * @param finish the end time of the definite integral
+         * @return the integral of 1/N(t) between start and finish, calling either the getAnalyticalIntegral or
+         *         getNumericalIntegral function as appropriate.
+         */
+        public double getNumericalIntegral(double start, double finish) {
+            // AER 19th March 2008: I switched this to use the RombergIntegrator from
+            // commons-beast.math v1.2.
+
+            if (start > finish) {
+                throw new RuntimeException("NumericalIntegration start > finish");
+            }
+
+            if (start == finish) {
+                return 0.0;
+            }
+
+            try {
+                return numericalIntegrator.integrate(this, start, finish);
+            } catch (MaxIterationsExceededException e) {
+                throw new RuntimeException(e);
+            } catch (FunctionEvaluationException e) {
+                throw new RuntimeException(e);
+            }
+        }
+
+        // **************************************************************
+        // Cacheable IMPLEMENTATION
+        // **************************************************************
+
+        public void prepare() {
+            // empty - may be overridden
+        }
+
+
+        // **************************************************************
+        // UnivariateRealFunction IMPLEMENTATION
+        // **************************************************************
+
+        /**
+         * Return the intensity at a given time for numerical integration
+         *
+         * @param t the time
+         * @return the intensity
+         */
+        public double value(double t) {
+            return 1.0 / getPopSize(t);
+        }
+
+        /**
+         * Default implementation
+         *
+         * @param t
+         * @return log(demographic at t)
+         */
+        public double getLogDemographic(double t) {
+            return Math.log(getPopSize(t));
+        }
+    }
+
+    public static class Utils {
+        private static double getInterval(double U, PopulationFunction populationFunction,
+                                          int lineageCount, double timeOfLastCoalescent) {
+            final double intensity = populationFunction.getIntensity(timeOfLastCoalescent);
+            final double tmp = -Math.log(U) / Binomial.choose2(lineageCount) + intensity;
+
+            return populationFunction.getInverseIntensity(tmp) - timeOfLastCoalescent;
+        }
+
+        /**
+         * @param populationFunction   the population size function
+         * @param lineageCount         the number of lineages spanning the interval
+         * @param timeOfLastCoalescent the start time for the interval to be simulated
+         * @return a random interval size selected from the Kingman prior of the demographic model.
+         */
+        public static double getSimulatedInterval(PopulationFunction populationFunction,
+                                                  int lineageCount, double timeOfLastCoalescent) {
+            final double U = Randomizer.nextDouble(); // create unit uniform random variate
+            return getInterval(U, populationFunction, lineageCount, timeOfLastCoalescent);
+        }
+
+        public static double getMedianInterval(PopulationFunction populationFunction,
+                                               int lineageCount, double timeOfLastCoalescent) {
+            return getInterval(0.5, populationFunction, lineageCount, timeOfLastCoalescent);
+        }
+
+        /**
+         * This function tests the consistency of the
+         * getIntensity and getInverseIntensity methods
+         * of this demographic model. If the model is
+         * inconsistent then a RuntimeException will be thrown.
+         *
+         * @param populationFunction the population size function to test.
+         * @param steps              the number of steps between 0.0 and maxTime to test.
+         * @param maxTime            the maximum time to test.
+         */
+        public static void testConsistency(PopulationFunction populationFunction, int steps, double maxTime) {
+
+            final double delta = maxTime / (double) steps;
+
+            for (int i = 0; i <= steps; i++) {
+                final double time = (double) i * delta;
+                final double intensity = populationFunction.getIntensity(time);
+                final double newTime = populationFunction.getInverseIntensity(intensity);
+
+                if (Math.abs(time - newTime) > 1e-12) {
+                    throw new RuntimeException(
+                            "Demographic model not consistent! error size = " +
+                                    Math.abs(time - newTime));
+                }
+            }
+        }
+    }
+}
diff --git a/src/beast/evolution/tree/coalescent/SampleOffValues.java b/src/beast/evolution/tree/coalescent/SampleOffValues.java
new file mode 100644
index 0000000..f35e2ce
--- /dev/null
+++ b/src/beast/evolution/tree/coalescent/SampleOffValues.java
@@ -0,0 +1,87 @@
+package beast.evolution.tree.coalescent;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.Operator;
+import beast.core.parameter.BooleanParameter;
+import beast.core.parameter.RealParameter;
+import beast.math.distributions.ParametricDistribution;
+import beast.util.Randomizer;
+
+/**
+ * @author Joseph Heled
+ *         Date: 2/03/2011
+ */
+ at Description("Sample values from a distribution")
+public class SampleOffValues extends Operator {
+    public Input<RealParameter> valuesInput = new Input<RealParameter>("values", "vector of target values", Input.Validate.REQUIRED);
+
+    public Input<BooleanParameter> indicatorsInput = new Input<BooleanParameter>("indicators", "Sample only entries which are 'off'");
+
+    public Input<ParametricDistribution> distInput = new Input<ParametricDistribution>("dist",
+            "distribution to sample from.", Input.Validate.REQUIRED);
+
+    public final Input<Boolean> scaleAll =
+            new Input<Boolean>("all", "if true, sample all off values in one go.", false);
+
+    public void initAndValidate() {
+    }
+
+    @Override
+    public double proposal() {
+        final BooleanParameter indicators = indicatorsInput.get(this);
+        final RealParameter data = valuesInput.get(this);
+        final ParametricDistribution distribution = distInput.get();
+
+        final int idim = indicators.getDimension();
+
+        final int offset = (data.getDimension() - 1) == idim ? 1 : 0;
+        assert offset == 1 || data.getDimension() == idim : "" + idim + " (?+1) != " + data.getDimension();
+
+        double hr = Double.NEGATIVE_INFINITY;
+
+        if( scaleAll.get() ) {
+            for (int i = offset; i < idim; ++i) {
+                if( !indicators.getValue(i-offset) ) {
+                    try {
+                        final double val = distribution.inverseCumulativeProbability(Randomizer.nextDouble());
+                        hr += distribution.logDensity(data.getValue(i));
+                        data.setValue(i, val);
+                    } catch (Exception e) {
+                        // some distributions fail on extreme values - currently gamma
+                        return Double.NEGATIVE_INFINITY;
+                    }
+                }
+            }
+        } else {
+
+            // available locations for direct sampling
+            int[] loc = new int[idim];
+            int nLoc = 0;
+
+            for (int i = 0; i < idim; ++i) {
+                if( !indicators.getValue(i) ) {
+                    loc[nLoc] = i + offset;
+                    ++nLoc;
+                }
+            }
+
+            if( nLoc > 0 ) {
+                final int index = loc[Randomizer.nextInt(nLoc)];
+                try {
+                    final double val = distribution.inverseCumulativeProbability(Randomizer.nextDouble());
+                    hr = distribution.logDensity(data.getValue(index));
+                    data.setValue(index, val);
+                } catch (Exception e) {
+                    // some distributions fail on extreme values - currently gamma
+                    return Double.NEGATIVE_INFINITY;
+                    //throw new OperatorFailedException(e.getMessage());
+                }
+            } else {
+                // no non-active indicators
+                //return Double.NEGATIVE_INFINITY;
+            }
+        }
+        return hr;
+    }
+}
diff --git a/src/beast/evolution/tree/coalescent/ScaledPopulationFunction.java b/src/beast/evolution/tree/coalescent/ScaledPopulationFunction.java
new file mode 100644
index 0000000..8c65cfa
--- /dev/null
+++ b/src/beast/evolution/tree/coalescent/ScaledPopulationFunction.java
@@ -0,0 +1,56 @@
+package beast.evolution.tree.coalescent;
+
+
+import java.util.List;
+
+import beast.core.CalculationNode;
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.Input.Validate;
+import beast.core.parameter.RealParameter;
+import beast.evolution.tree.coalescent.PopulationFunction;
+
+
+/**
+ * @author Joseph Heled
+ *         Date: 2/03/2011
+ */
+
+ at Description("Scale a demographic function by a constant factor")
+public class ScaledPopulationFunction extends PopulationFunction.Abstract {
+    public Input<PopulationFunction> popParameterInput = new Input<PopulationFunction>("population",
+            "population function to scale. ", Validate.REQUIRED);
+
+    public Input<RealParameter> scaleFactorInput = new Input<RealParameter>("factor",
+            "scale population by this facor.", Validate.REQUIRED);
+
+    public ScaledPopulationFunction() {
+    }
+
+    // Implementation of abstract methods
+
+    public List<String> getParameterIds() {
+        List<String> ids = popParameterInput.get().getParameterIds();
+        ids.add(scaleFactorInput.get().getID());
+        return ids;
+    }
+
+    public double getPopSize(double t) {
+        return popParameterInput.get().getPopSize(t) * scaleFactorInput.get().getValue();
+    }
+
+    public double getIntensity(double t) {
+        double fIntensity = popParameterInput.get().getIntensity(t);
+        double fScale = scaleFactorInput.get().getValue();
+        return fIntensity / fScale;
+    }
+
+    public double getInverseIntensity(double x) {
+        throw new RuntimeException("unimplemented");
+    }
+
+    @Override
+    protected boolean requiresRecalculation() {
+        return ((CalculationNode) popParameterInput.get()).isDirtyCalculation() || scaleFactorInput.get().somethingIsDirty();
+    }
+}
diff --git a/src/beast/evolution/tree/coalescent/TreeIntervals.java b/src/beast/evolution/tree/coalescent/TreeIntervals.java
new file mode 100644
index 0000000..611bdba
--- /dev/null
+++ b/src/beast/evolution/tree/coalescent/TreeIntervals.java
@@ -0,0 +1,491 @@
+package beast.evolution.tree.coalescent;
+
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+import beast.core.CalculationNode;
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.Input.Validate;
+import beast.evolution.tree.Node;
+import beast.evolution.tree.Tree;
+import beast.util.HeapSort;
+
+
+/*
+ * TreeIntervals.java
+ *
+ * Copyright (C) 2002-2006 Alexei Drummond and Andrew Rambaut
+ *
+ * This file is part of BEAST.
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership and licensing.
+ *
+ * BEAST 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
+ * of the License, or (at your option) any later version.
+ *
+ *  BEAST 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 BEAST; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+/**
+ * Extracts the intervals from a beast.tree.
+ *
+ * @author Andrew Rambaut
+ * @author Alexei Drummond
+ * @version $Id: TreeIntervals.java,v 1.9 2005/05/24 20:25:56 rambaut Exp $
+ */
+ at Description("Extracts the intervals from a tree. Points in the intervals " +
+        "are defined by the heights of nodes in the tree.")
+public class TreeIntervals extends CalculationNode implements IntervalList {
+    public Input<Tree> treeInput = new Input<Tree>("tree", "tree for which to calculate the intervals", Validate.REQUIRED);
+
+    public TreeIntervals() {
+        super();
+    }
+
+    public TreeIntervals(Tree tree) throws Exception {
+        init(tree);
+    }
+
+    @Override
+    public void initAndValidate() {
+        // this initialises data structures that store/restore might need
+        calculateIntervals();
+        intervalsKnown = false;
+    }
+
+    /**
+     * CalculationNode methods *
+     */
+    @Override
+    protected boolean requiresRecalculation() {
+        // we only get here if the tree is dirty, which is a StateNode
+        // since the StateNode can only become dirty through an operation,
+        // we need to recalculate tree intervals
+        intervalsKnown = false;
+        return true;
+    }
+
+    @Override
+    protected void restore() {
+        //intervalsKnown = false;
+        double[] tmp = storedIntervals;
+        storedIntervals = intervals;
+        intervals = tmp;
+
+        int[] tmp2 = storedLineageCounts;
+        storedLineageCounts = lineageCounts;
+        lineageCounts = tmp2;
+
+        int tmp3 = storedIntervalCount;
+        storedIntervalCount = intervalCount;
+        intervalCount = tmp3;
+        super.restore();
+    }
+
+    @Override
+    protected void store() {
+        System.arraycopy(lineageCounts, 0, storedLineageCounts, 0, lineageCounts.length);
+        System.arraycopy(intervals, 0, storedIntervals, 0, intervals.length);
+        storedIntervalCount = intervalCount;
+        super.store();
+    }
+
+    /**
+     * Specifies that the intervals are unknown (i.e., the beast.tree has changed).
+     */
+    public void setIntervalsUnknown() {
+        intervalsKnown = false;
+    }
+
+    /**
+     * Sets the limit for which adjacent events are merged.
+     *
+     * @param multifurcationLimit A value of 0 means merge addition of leafs (terminal nodes) when possible but
+     *                            return each coalescense as a separate event.
+     */
+    public void setMultifurcationLimit(double multifurcationLimit) {
+        // invalidate only if changing anything
+        if (this.multifurcationLimit != multifurcationLimit) {
+            this.multifurcationLimit = multifurcationLimit;
+            intervalsKnown = false;
+        }
+    }
+
+    public int getSampleCount() {
+        // Assumes a binary tree!
+        return treeInput.get().getInternalNodeCount();
+    }
+
+    /**
+     * get number of intervals
+     */
+    public int getIntervalCount() {
+        if (!intervalsKnown) {
+            calculateIntervals();
+        }
+        return intervalCount;
+    }
+
+    /**
+     * Gets an interval.
+     */
+    public double getInterval(int i) {
+        if (!intervalsKnown) {
+            calculateIntervals();
+        }
+        if (i < 0 || i >= intervalCount) throw new IllegalArgumentException();
+        return intervals[i];
+    }
+
+    /**
+     * Defensive implementation creates copy
+     *
+     * @return
+     */
+    public double[] getIntervals(double[] inters) {
+        if (!intervalsKnown) {
+            calculateIntervals();
+        }
+        if (inters == null) inters = new double[intervals.length];
+        System.arraycopy(intervals, 0, inters, 0, intervals.length);
+        return inters;
+    }
+
+    public double[] getCoalescentTimes(double[] coalescentTimes) {
+
+        if (!intervalsKnown) {
+            calculateIntervals();
+        }
+
+        if (coalescentTimes == null) coalescentTimes = new double[getSampleCount()];
+
+        double time = 0;
+        int coalescentIndex = 0;
+        for (int i = 0; i < intervals.length; i++) {
+            time += intervals[i];
+            for (int j = 0; j < getCoalescentEvents(i); j++) {
+                coalescentTimes[coalescentIndex] = time;
+                coalescentIndex += 1;
+            }
+        }
+        return coalescentTimes;
+    }
+
+    /**
+     * Returns the number of uncoalesced lineages within this interval.
+     * Required for s-coalescents, where new lineages are added as
+     * earlier samples are come across.
+     */
+    public int getLineageCount(int i) {
+        if (!intervalsKnown) {
+            calculateIntervals();
+        }
+        if (i >= intervalCount) throw new IllegalArgumentException();
+        return lineageCounts[i];
+    }
+
+    /**
+     * @param interval the index of the interval
+     * @return a list of the nodes representing the lineages in the ith interval.
+     */
+//    public final List<Node> getLineages(int interval) {
+//
+//        if (lineages[interval] == null) {
+//
+//            List<Node> lines = new ArrayList<Node>();
+//            for (int i = 0; i <= interval; i++) {
+//                if (lineagesAdded[i] != null) lines.addAll(lineagesAdded[i]);
+//                if (lineagesRemoved[i] != null) lines.removeAll(lineagesRemoved[i]);
+//            }
+//            lineages[interval] = Collections.unmodifiableList(lines);
+//
+//        }
+//        return lineages[interval];
+//    }
+
+    /**
+     * Returns the number of coalescent events in an interval
+     */
+    public int getCoalescentEvents(int i) {
+        if (!intervalsKnown) {
+            calculateIntervals();
+        }
+        if (i >= intervalCount) throw new IllegalArgumentException();
+        if (i < intervalCount - 1) {
+            return lineageCounts[i] - lineageCounts[i + 1];
+        } else {
+            return lineageCounts[i] - 1;
+        }
+    }
+
+    /**
+     * Returns the type of interval observed.
+     */
+    public IntervalType getIntervalType(int i) {
+        if (!intervalsKnown) {
+            calculateIntervals();
+        }
+        if (i >= intervalCount) throw new IllegalArgumentException();
+        int numEvents = getCoalescentEvents(i);
+
+        if (numEvents > 0) return IntervalType.COALESCENT;
+        else if (numEvents < 0) return IntervalType.SAMPLE;
+        else return IntervalType.NOTHING;
+    }
+
+//    public Node getCoalescentNode(int interval) {
+//        if (getIntervalType(interval) == IntervalType.COALESCENT) {
+//            if (lineagesRemoved[interval] != null) {
+//                if (lineagesRemoved[interval].size() == 1) {
+//                    return lineagesRemoved[interval].get(0);
+//                } else throw new IllegalArgumentException("multiple lineages lost over this interval!");
+//            } else throw new IllegalArgumentException("Inconsistent: no intervals lost over this interval!");
+//        } else throw new IllegalArgumentException("Interval " + interval + " is not a coalescent interval.");
+//    }
+
+    /**
+     * get the total height of the genealogy represented by these
+     * intervals.
+     */
+    public double getTotalDuration() {
+
+        if (!intervalsKnown) {
+            calculateIntervals();
+        }
+        double height = 0.0;
+        for (int j = 0; j < intervalCount; j++) {
+            height += intervals[j];
+        }
+        return height;
+    }
+
+    /**
+     * Checks whether this set of coalescent intervals is fully resolved
+     * (i.e. whether is has exactly one coalescent event in each
+     * subsequent interval)
+     */
+    public boolean isBinaryCoalescent() {
+        if (!intervalsKnown) {
+            calculateIntervals();
+        }
+        for (int i = 0; i < intervalCount; i++) {
+            if (getCoalescentEvents(i) > 0) {
+                if (getCoalescentEvents(i) != 1) return false;
+            }
+        }
+
+        return true;
+    }
+
+    /**
+     * Checks whether this set of coalescent intervals coalescent only
+     * (i.e. whether is has exactly one or more coalescent event in each
+     * subsequent interval)
+     */
+    public boolean isCoalescentOnly() {
+        if (!intervalsKnown) {
+            calculateIntervals();
+        }
+        for (int i = 0; i < intervalCount; i++) {
+            if (getCoalescentEvents(i) < 1) return false;
+        }
+
+        return true;
+    }
+
+    /**
+     * Recalculates all the intervals for the given beast.tree.
+     */
+    @SuppressWarnings("unchecked")
+    protected void calculateIntervals() {
+        Tree tree = treeInput.get();
+
+        final int nodeCount = tree.getNodeCount();
+
+        double[] times = new double[nodeCount];
+        int[] childCounts = new int[nodeCount];
+
+        collectTimes(tree, times, childCounts);
+
+        int[] indices = new int[nodeCount];
+
+        HeapSort.sort(times, indices);
+
+        if (intervals == null || intervals.length != nodeCount) {
+            intervals = new double[nodeCount];
+            lineageCounts = new int[nodeCount];
+            lineagesAdded = new List[nodeCount];
+            lineagesRemoved = new List[nodeCount];
+//            lineages = new List[nodeCount];
+
+            storedIntervals = new double[nodeCount];
+            storedLineageCounts = new int[nodeCount];
+
+        } else {
+            for (List<Node> l : lineagesAdded) {
+                if (l != null) {
+                    l.clear();
+                }
+            }
+            for (List<Node> l : lineagesRemoved) {
+                if (l != null) {
+                    l.clear();
+                }
+            }
+        }
+
+        // start is the time of the first tip
+        double start = times[indices[0]];
+        int numLines = 0;
+        int nodeNo = 0;
+        intervalCount = 0;
+        while (nodeNo < nodeCount) {
+
+            int lineagesRemoved = 0;
+            int lineagesAdded = 0;
+
+            double finish = times[indices[nodeNo]];
+            double next;
+
+            do {
+                final int childIndex = indices[nodeNo];
+                final int childCount = childCounts[childIndex];
+                // don't use nodeNo from here on in do loop
+                nodeNo += 1;
+                if (childCount == 0) {
+                    addLineage(intervalCount, tree.getNode(childIndex));
+                    lineagesAdded += 1;
+                } else {
+                    lineagesRemoved += (childCount - 1);
+
+                    // record removed lineages
+                    final Node parent = tree.getNode(childIndex);
+                    //assert childCounts[indices[nodeNo]] == beast.tree.getChildCount(parent);
+                    //for (int j = 0; j < lineagesRemoved + 1; j++) {
+                    for (int j = 0; j < childCount; j++) {
+                        Node child = j == 0 ? parent.getLeft() : parent.getRight();
+                        removeLineage(intervalCount, child);
+                    }
+
+                    // record added lineages
+                    addLineage(intervalCount, parent);
+                    // no mix of removed lineages when 0 th
+                    if (multifurcationLimit == 0.0) {
+                        break;
+                    }
+                }
+
+                if (nodeNo < nodeCount) {
+                    next = times[indices[nodeNo]];
+                } else break;
+            } while (Math.abs(next - finish) <= multifurcationLimit);
+
+            if (lineagesAdded > 0) {
+
+                if (intervalCount > 0 || ((finish - start) > multifurcationLimit)) {
+                    intervals[intervalCount] = finish - start;
+                    lineageCounts[intervalCount] = numLines;
+                    intervalCount += 1;
+                }
+
+                start = finish;
+            }
+
+            // add sample event
+            numLines += lineagesAdded;
+
+            if (lineagesRemoved > 0) {
+
+                intervals[intervalCount] = finish - start;
+                lineageCounts[intervalCount] = numLines;
+                intervalCount += 1;
+                start = finish;
+            }
+            // coalescent event
+            numLines -= lineagesRemoved;
+        }
+
+        intervalsKnown = true;
+    }
+
+    protected void addLineage(int interval, Node node) {
+        if (lineagesAdded[interval] == null) lineagesAdded[interval] = new ArrayList<Node>();
+        lineagesAdded[interval].add(node);
+    }
+
+    protected void removeLineage(int interval, Node node) {
+        if (lineagesRemoved[interval] == null) lineagesRemoved[interval] = new ArrayList<Node>();
+        lineagesRemoved[interval].add(node);
+    }
+
+    /**
+     * @return the delta parameter of Pybus et al (Node spread statistic)
+     */
+    public double getDelta() {
+
+        return IntervalList.Utils.getDelta(this);
+    }
+
+    /**
+     * extract coalescent times and tip information into array times from beast.tree.
+     *
+     * @param tree        the beast.tree
+     * @param times       the times of the nodes in the beast.tree
+     * @param childCounts the number of children of each node
+     */
+    protected static void collectTimes(Tree tree, double[] times, int[] childCounts) {
+        Node[] nodes = tree.getNodesAsArray();
+        for (int i = 0; i < nodes.length; i++) {
+            Node node = nodes[i];
+            times[i] = node.getHeight();
+            childCounts[i] = node.isLeaf() ? 0 : 2;
+        }
+    }
+
+    /**
+     * The beast.tree. RRB: not a good idea to keep a copy around, since it changes all the time.
+     */
+//    private Tree tree = null;
+
+    /**
+     * The widths of the intervals.
+     */
+    protected double[] intervals;
+    protected double[] storedIntervals;
+
+    /**
+     * The number of uncoalesced lineages within a particular interval.
+     */
+    protected int[] lineageCounts;
+    protected int[] storedLineageCounts;
+
+    /**
+     * The lineages in each interval (stored by node ref).
+     */
+    protected List<Node>[] lineagesAdded;
+    protected List<Node>[] lineagesRemoved;
+//    private List<Node>[] lineages;
+
+    protected int intervalCount = 0;
+    protected int storedIntervalCount = 0;
+
+    /**
+     * are the intervals known?
+     */
+    protected boolean intervalsKnown = false;
+
+    protected double multifurcationLimit = -1.0;
+}
\ No newline at end of file
diff --git a/src/beast/math/Binomial.java b/src/beast/math/Binomial.java
new file mode 100644
index 0000000..e85ee3d
--- /dev/null
+++ b/src/beast/math/Binomial.java
@@ -0,0 +1,102 @@
+/*
+ * Binomial.java
+ *
+ * Copyright (C) 2002-2006 Alexei Drummond and Andrew Rambaut
+ *
+ * This file is part of BEAST.
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership and licensing.
+ *
+ * BEAST 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
+ * of the License, or (at your option) any later version.
+ *
+ *  BEAST 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 BEAST; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+package beast.math;
+
+/**
+ * Binomial coefficients
+ *
+ * @author Andrew Rambaut
+ * @author Alexei Drummond
+ * @author Korbinian Strimmer
+ * @version $Id: Binomial.java,v 1.11 2005/05/24 20:26:00 rambaut Exp $
+ */
+public class Binomial {
+    //
+    // Public stuff
+    //
+
+    public static double logChoose(final int n, final int k) {
+        return GammaFunction.lnGamma(n + 1.0) - GammaFunction.lnGamma(k + 1.0)
+                - GammaFunction.lnGamma(n - k + 1.0);
+    }
+
+
+    /**
+     * @param n total elements
+     * @param k chosen elements
+     * @return Binomial coefficient n choose k
+     */
+    public static double choose(double n, double k) {
+        n = Math.floor(n + 0.5);
+        k = Math.floor(k + 0.5);
+
+        final double lchoose = GammaFunction.lnGamma(n + 1.0) -
+                GammaFunction.lnGamma(k + 1.0) - GammaFunction.lnGamma(n - k + 1.0);
+
+        return Math.floor(Math.exp(lchoose) + 0.5);
+    }
+
+    /**
+     * @param n # elements
+     * @return n choose 2 (number of distinct ways to choose a pair from n elements)
+     */
+    public static double choose2(final int n) {
+        // not sure how much overhead there is with try-catch blocks
+        // i.e. would an if statement be better?
+
+        try {
+            return choose2LUT[n];
+        } catch (ArrayIndexOutOfBoundsException e) {
+            if (n < 0) {
+                return 0;
+            }
+
+            while (maxN < n) {
+                maxN += 1000;
+            }
+
+            initialize();
+            return choose2LUT[n];
+        }
+    }
+
+    private static void initialize() {
+        choose2LUT = new double[maxN + 1];
+        choose2LUT[0] = 0;
+        choose2LUT[1] = 0;
+        choose2LUT[2] = 1;
+        for (int i = 3; i <= maxN; i++) {
+            choose2LUT[i] = ((double) (i * (i - 1))) * 0.5;
+        }
+    }
+
+    private static int maxN = 5000;
+    private static double[] choose2LUT;
+
+    static {
+        //
+        initialize();
+    }
+}
diff --git a/src/beast/math/GammaFunction.java b/src/beast/math/GammaFunction.java
new file mode 100644
index 0000000..13a6b13
--- /dev/null
+++ b/src/beast/math/GammaFunction.java
@@ -0,0 +1,205 @@
+/*
+ * GammaFunction.java
+ *
+ * Copyright (C) 2002-2006 Alexei Drummond and Andrew Rambaut
+ *
+ * This file is part of BEAST.
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership and licensing.
+ *
+ * BEAST 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
+ * of the License, or (at your option) any later version.
+ *
+ *  BEAST 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 BEAST; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+package beast.math;
+
+/**
+ * gamma function
+ *
+ * @author Korbinian Strimmer
+ * @version $Id: GammaFunction.java,v 1.3 2005/05/24 20:26:01 rambaut Exp $
+ */
+public class GammaFunction {
+    //
+    // Public stuff
+    //
+
+    // Gamma function
+
+    /**
+     * log Gamma function: ln(gamma(alpha)) for alpha>0, accurate to 10 decimal places
+     *
+     * @param alpha argument
+     * @return the log of the gamma function of the given alpha
+     */
+    public static double lnGamma(final double alpha) {
+        // Pike MC & Hill ID (1966) Algorithm 291: Logarithm of the gamma function.
+        // Communications of the Association for Computing Machinery, 9:684
+
+        double x = alpha, f = 0.0, z;
+
+        if (x < 7) {
+            f = 1;
+            z = x - 1;
+            while (++z < 7) {
+                f *= z;
+            }
+            x = z;
+            f = -Math.log(f);
+        }
+        z = 1 / (x * x);
+
+        return
+                f + (x - 0.5) * Math.log(x) - x + 0.918938533204673 +
+                        (((-0.000595238095238 * z + 0.000793650793651) *
+                                z - 0.002777777777778) * z + 0.083333333333333) / x;
+    }
+
+    /**
+     * Incomplete Gamma function Q(a,x)
+     * (a cleanroom implementation of Numerical Recipes gammq(a,x);
+     * in Mathematica this function is called GammaRegularized)
+     *
+     * @param a parameter
+     * @param x argument
+     * @return function value
+     */
+    public static double incompleteGammaQ(final double a, final double x) {
+        return 1.0 - incompleteGamma(x, a, lnGamma(a));
+    }
+
+    /**
+     * Incomplete Gamma function P(a,x) = 1-Q(a,x)
+     * (a cleanroom implementation of Numerical Recipes gammp(a,x);
+     * in Mathematica this function is 1-GammaRegularized)
+     *
+     * @param a parameter
+     * @param x argument
+     * @return function value
+     */
+    public static double incompleteGammaP(final double a, final double x) {
+        return incompleteGamma(x, a, lnGamma(a));
+    }
+
+    /**
+     * Incomplete Gamma function P(a,x) = 1-Q(a,x)
+     * (a cleanroom implementation of Numerical Recipes gammp(a,x);
+     * in Mathematica this function is 1-GammaRegularized)
+     *
+     * @param a        parameter
+     * @param x        argument
+     * @param lnGammaA precomputed lnGamma(a)
+     * @return function value
+     */
+    public static double incompleteGammaP(final double a, final double x, final double lnGammaA) {
+        return incompleteGamma(x, a, lnGammaA);
+    }
+
+
+    /**
+     * Returns the incomplete gamma ratio I(x,alpha) where x is the upper
+     * limit of the integration and alpha is the shape parameter.
+     *
+     * @param x              upper limit of integration
+     * @param alpha          shape parameter
+     * @param ln_gamma_alpha the log gamma function for alpha
+     * @return the incomplete gamma ratio
+     */
+    private static double incompleteGamma(final double x, final double alpha, final double ln_gamma_alpha) {
+        // (1) series expansion     if (alpha>x || x<=1)
+        // (2) continued fraction   otherwise
+        // RATNEST FORTRAN by
+        // Bhattacharjee GP (1970) The incomplete gamma integral.  Applied Statistics,
+        // 19: 285-287 (AS32)
+
+        final double accurate = 1e-8;
+        final double overflow = 1e30;
+        final double factor;
+        double gin;
+        double rn;
+        double a;
+        double b;
+        double an;
+        double dif;
+        double term;
+        double pn0, pn1, pn2, pn3, pn4, pn5;
+
+        if (x == 0.0) {
+            return 0.0;
+        }
+        if (x < 0.0 || alpha <= 0.0) {
+            throw new IllegalArgumentException("Arguments out of bounds");
+        }
+
+        factor = Math.exp(alpha * Math.log(x) - x - ln_gamma_alpha);
+
+        if (x > 1 && x >= alpha) {
+            // continued fraction
+            a = 1 - alpha;
+            b = a + x + 1;
+            term = 0;
+            pn0 = 1;
+            pn1 = x;
+            pn2 = x + 1;
+            pn3 = x * b;
+            gin = pn2 / pn3;
+
+            do {
+                a++;
+                b += 2;
+                term++;
+                an = a * term;
+                pn4 = b * pn2 - an * pn0;
+                pn5 = b * pn3 - an * pn1;
+
+                if (pn5 != 0) {
+                    rn = pn4 / pn5;
+                    dif = Math.abs(gin - rn);
+                    if (dif <= accurate) {
+                        if (dif <= accurate * rn) {
+                            break;
+                        }
+                    }
+
+                    gin = rn;
+                }
+                pn0 = pn2;
+                pn1 = pn3;
+                pn2 = pn4;
+                pn3 = pn5;
+                if (Math.abs(pn4) >= overflow) {
+                    pn0 /= overflow;
+                    pn1 /= overflow;
+                    pn2 /= overflow;
+                    pn3 /= overflow;
+                }
+            } while (true);
+            gin = 1 - factor * gin;
+        } else {
+            // series expansion
+            gin = 1;
+            term = 1;
+            rn = alpha;
+            do {
+                rn++;
+                term *= x / rn;
+                gin += term;
+            }
+            while (term > accurate);
+            gin *= factor / alpha;
+        }
+        return gin;
+    }
+
+}
diff --git a/src/beast/math/MachineAccuracy.java b/src/beast/math/MachineAccuracy.java
new file mode 100644
index 0000000..36d6d3d
--- /dev/null
+++ b/src/beast/math/MachineAccuracy.java
@@ -0,0 +1,82 @@
+/*
+ * MachineAccuracy.java
+ *
+ * Copyright (C) 2010 BEAST II Developer Group
+ *
+ * This file is part of BEAST.
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership and licensing.
+ *
+ * BEAST 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
+ * of the License, or (at your option) any later version.
+ *
+ *  BEAST 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 BEAST; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+package beast.math;
+
+
+/**
+ * determines machine accuracy
+ *
+ * @author Korbinian Strimmer
+ * @author Alexei Drummond
+ * @version $Id: MachineAccuracy.java,v 1.4 2005/05/24 20:26:01 rambaut Exp $
+ */
+public class MachineAccuracy {
+    //
+    // Public stuff
+    //
+
+    /**
+     * machine accuracy constant
+     */
+    public static double EPSILON = 2.220446049250313E-16;
+
+    public static double SQRT_EPSILON = 1.4901161193847656E-8;
+    public static double SQRT_SQRT_EPSILON = 1.220703125E-4;
+
+    /**
+     * compute EPSILON from scratch
+     */
+    public static double computeEpsilon() {
+        double eps = 1.0;
+
+        while (eps + 1.0 != 1.0) {
+            eps /= 2.0;
+        }
+        eps *= 2.0;
+
+        return eps;
+    }
+
+    /**
+     * @return true if the relative difference between the two parameters
+     *         is smaller than SQRT_EPSILON.
+     */
+    public static boolean same(double a, double b) {
+        return Math.abs((a / b) - 1.0) <= SQRT_EPSILON;
+    }
+    
+    /**
+     * Tests to see whether the absolute difference between a and b is
+     * smaller than EPSILON.
+     * 
+     * @param a
+     * @param b
+     * @return result of test
+     */
+    public static boolean sameAbsolute(double a, double b) {
+        return Math.abs(a-b) < EPSILON;
+    }
+}
diff --git a/src/beast/math/distributions/Beta.java b/src/beast/math/distributions/Beta.java
new file mode 100644
index 0000000..2a17b0e
--- /dev/null
+++ b/src/beast/math/distributions/Beta.java
@@ -0,0 +1,53 @@
+package beast.math.distributions;
+
+import org.apache.commons.math.distribution.BetaDistributionImpl;
+import org.apache.commons.math.distribution.ContinuousDistribution;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.parameter.RealParameter;
+
+
+
+ at Description("Beta distribution, used as prior.  p(x;alpha,beta) = \frac{x^{alpha-1}(1-x)^{beta-1}} {B(alpha,beta)} " +
+        "where B() is the beta function. " +
+        "If the input x is a multidimensional parameter, each of the dimensions is considered as a " +
+        "separate independent component.")
+public class Beta extends ParametricDistribution {
+    public Input<RealParameter> alphaInput = new Input<RealParameter>("alpha", "first shape parameter, defaults to 1");
+    public Input<RealParameter> betaInput = new Input<RealParameter>("beta", "the other shape parameter, defaults to 1");
+
+    static org.apache.commons.math.distribution.BetaDistribution m_dist = new BetaDistributionImpl(1, 1);
+
+    @Override
+    public void initAndValidate() {
+        refresh();
+    }
+
+    /**
+     * make sure internal state is up to date *
+     */
+    void refresh() {
+        double fAlpha;
+        double fBeta;
+        if (alphaInput.get() == null) {
+            fAlpha = 1;
+        } else {
+            fAlpha = alphaInput.get().getValue();
+        }
+        if (betaInput.get() == null) {
+            fBeta = 1;
+        } else {
+            fBeta = betaInput.get().getValue();
+        }
+        m_dist.setAlpha(fAlpha);
+        m_dist.setBeta(fBeta);
+    }
+
+    @Override
+    public ContinuousDistribution getDistribution() {
+        refresh();
+        return m_dist;
+    }
+
+} // class Beta
diff --git a/src/beast/math/distributions/ChiSquare.java b/src/beast/math/distributions/ChiSquare.java
new file mode 100644
index 0000000..b4b6068
--- /dev/null
+++ b/src/beast/math/distributions/ChiSquare.java
@@ -0,0 +1,48 @@
+package beast.math.distributions;
+
+
+import org.apache.commons.math.distribution.ChiSquaredDistributionImpl;
+import org.apache.commons.math.distribution.ContinuousDistribution;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.parameter.IntegerParameter;
+
+
+
+ at Description("Chi square distribution, f(x; k) = \\frac{1}{2^{k/2}Gamma(k/2)} x^{k/2-1} e^{-x/2} " +
+        "If the input x is a multidimensional parameter, each of the dimensions is considered as a " +
+        "separate independent component.")
+public class ChiSquare extends ParametricDistribution {
+    public Input<IntegerParameter> dfInput = new Input<IntegerParameter>("df", "degrees if freedin, defaults to 1");
+
+    static org.apache.commons.math.distribution.ChiSquaredDistribution m_dist = new ChiSquaredDistributionImpl(1);
+
+    @Override
+    public void initAndValidate() {
+        refresh();
+    }
+
+    /**
+     * make sure internal state is up to date *
+     */
+    void refresh() {
+        int nDF;
+        if (dfInput.get() == null) {
+            nDF = 1;
+        } else {
+            nDF = dfInput.get().getValue();
+            if (nDF <= 0) {
+                nDF = 1;
+            }
+        }
+        m_dist.setDegreesOfFreedom(nDF);
+    }
+
+    @Override
+    public ContinuousDistribution getDistribution() {
+        refresh();
+        return m_dist;
+    }
+
+} // class ChiSquare
diff --git a/src/beast/math/distributions/Dirichlet.java b/src/beast/math/distributions/Dirichlet.java
new file mode 100644
index 0000000..ff31b93
--- /dev/null
+++ b/src/beast/math/distributions/Dirichlet.java
@@ -0,0 +1,82 @@
+package beast.math.distributions;
+
+import org.apache.commons.math.MathException;
+import org.apache.commons.math.distribution.ContinuousDistribution;
+import org.apache.commons.math.distribution.Distribution;
+
+import beast.core.Description;
+import beast.core.Function;
+import beast.core.Input;
+import beast.core.Input.Validate;
+import beast.core.parameter.RealParameter;
+
+
+
+ at Description("Dirichlet distribution.  p(x_1,...,x_n;alpha_1,...,alpha_n) = 1/B(alpha) prod_{i=1}^K x_i^{alpha_i - 1} " +
+        "where B() is the beta function B(alpha) = prod_{i=1}^K Gamma(alpha_i)/ Gamma(sum_{i=1}^K alpha_i}. ")
+public class Dirichlet extends ParametricDistribution {
+    public Input<RealParameter> alphaInput = new Input<RealParameter>("alpha", "coefficients of the Dirichlet distribution", Validate.REQUIRED);
+
+    @Override
+    public void initAndValidate() throws Exception {
+    }
+
+    @Override
+    public Distribution getDistribution() {
+        return null;
+    }
+
+    class DirichletImpl implements ContinuousDistribution {
+        Double[] m_fAlpha;
+
+        void setAlpha(Double[] fAlpha) {
+            m_fAlpha = fAlpha;
+        }
+
+        @Override
+        public double cumulativeProbability(double x) throws MathException {
+            throw new MathException("Not implemented yet");
+        }
+
+        @Override
+        public double cumulativeProbability(double x0, double x1) throws MathException {
+            throw new MathException("Not implemented yet");
+        }
+
+        @Override
+        public double inverseCumulativeProbability(double p) throws MathException {
+            throw new MathException("Not implemented yet");
+        }
+
+        @Override
+        public double density(double x) {
+            return Double.NaN;
+        }
+
+        @Override
+        public double logDensity(double x) {
+            return Double.NaN;
+        }
+    } // class DirichletImpl
+
+
+    @Override
+    public double calcLogP(Function pX) throws Exception {
+        Double[] fAlpha = alphaInput.get().getValues();
+        if (alphaInput.get().getDimension() != pX.getDimension()) {
+            throw new Exception("Dimensions of alpha and x should be the same, but dim(alpha)=" + alphaInput.get().getDimension()
+                    + " and dim(x)=" + pX.getDimension());
+        }
+        double fLogP = 0;
+        double fSumAlpha = 0;
+        for (int i = 0; i < pX.getDimension(); i++) {
+            double fX = pX.getArrayValue(i);
+            fLogP += (fAlpha[i] - 1) * Math.log(fX);
+            fLogP -= org.apache.commons.math.special.Gamma.logGamma(fAlpha[i]);
+            fSumAlpha += fAlpha[i];
+        }
+        fLogP += org.apache.commons.math.special.Gamma.logGamma(fSumAlpha);
+        return fLogP;
+    }
+
+}
diff --git a/src/beast/math/distributions/Exponential.java b/src/beast/math/distributions/Exponential.java
new file mode 100644
index 0000000..1d7e8f2
--- /dev/null
+++ b/src/beast/math/distributions/Exponential.java
@@ -0,0 +1,53 @@
+package beast.math.distributions;
+
+
+import org.apache.commons.math.distribution.ContinuousDistribution;
+import org.apache.commons.math.distribution.ExponentialDistributionImpl;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.parameter.RealParameter;
+
+
+ at Description("Exponential distribution.  f(x;\\lambda) = 1/\\lambda e^{-x/\\lambda}, if x >= 0 " +
+        "If the input x is a multidimensional parameter, each of the dimensions is considered as a " +
+        "separate independent component.")
+public class Exponential extends ParametricDistribution {
+    public Input<RealParameter> lambdaInpupt = new Input<RealParameter>("mean", "mean parameter, defaults to 1");
+
+    static org.apache.commons.math.distribution.ExponentialDistribution m_dist = new ExponentialDistributionImpl(1);
+
+    @Override
+    public void initAndValidate() {
+        refresh();
+    }
+
+    /**
+     * make sure internal state is up to date *
+     */
+    void refresh() {
+        double fLambda;
+        if (lambdaInpupt.get() == null) {
+            fLambda = 1;
+        } else {
+            fLambda = lambdaInpupt.get().getValue();
+            if (fLambda < 0) {
+                System.err.println("Exponential::Lambda should be positive not " + fLambda + ". Assigning default value.");
+                fLambda = 1;
+            }
+        }
+        m_dist.setMean(fLambda);
+    }
+
+    @Override
+    public ContinuousDistribution getDistribution() {
+        refresh();
+        return m_dist;
+    }
+    
+    @Override
+    public double getMean() {
+    	return offsetInput.get() + m_dist.getMean();
+    }
+
+} // class Exponential
diff --git a/src/beast/math/distributions/Gamma.java b/src/beast/math/distributions/Gamma.java
new file mode 100644
index 0000000..5d946f1
--- /dev/null
+++ b/src/beast/math/distributions/Gamma.java
@@ -0,0 +1,57 @@
+package beast.math.distributions;
+
+
+import org.apache.commons.math.distribution.ContinuousDistribution;
+import org.apache.commons.math.distribution.GammaDistributionImpl;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.parameter.RealParameter;
+
+
+
+ at Description("Gamma distribution.    for x>0  g(x;alpha,beta) = \\frac{beta^{alpha}}{Gamma(alpha)} x^{alpha-1} e^{-beta {x}}" +
+        "If the input x is a multidimensional parameter, each of the dimensions is considered as a " +
+        "separate independent component.")
+public class Gamma extends ParametricDistribution {
+    public Input<RealParameter> alphaInput = new Input<RealParameter>("alpha", "shape parameter, defaults to 2");
+    public Input<RealParameter> betaInput = new Input<RealParameter>("beta", "scale parameter, defaults to 2");
+
+    static org.apache.commons.math.distribution.GammaDistribution m_dist = new GammaDistributionImpl(1, 1);
+
+    @Override
+    public void initAndValidate() {
+        refresh();
+    }
+
+    /**
+     * make sure internal state is up to date *
+     */
+    void refresh() {
+        double fAlpha;
+        double fBeta;
+        if (alphaInput.get() == null) {
+            fAlpha = 2;
+        } else {
+            fAlpha = alphaInput.get().getValue();
+        }
+        if (betaInput.get() == null) {
+            fBeta = 2;
+        } else {
+            fBeta = betaInput.get().getValue();
+        }
+        m_dist.setAlpha(fAlpha);
+        m_dist.setBeta(fBeta);
+    }
+
+    @Override
+    public ContinuousDistribution getDistribution() {
+        refresh();
+        return m_dist;
+    }
+
+    @Override
+    public double getMean() {
+    	return offsetInput.get() + m_dist.getAlpha() / m_dist.getBeta();
+    }
+} // class Gamma
diff --git a/src/beast/math/distributions/InverseGamma.java b/src/beast/math/distributions/InverseGamma.java
new file mode 100644
index 0000000..ec76d70
--- /dev/null
+++ b/src/beast/math/distributions/InverseGamma.java
@@ -0,0 +1,98 @@
+package beast.math.distributions;
+
+
+import org.apache.commons.math.MathException;
+import org.apache.commons.math.distribution.ContinuousDistribution;
+import org.apache.commons.math.distribution.Distribution;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.parameter.RealParameter;
+
+
+
+ at Description("Inverse Gamma distribution, used as prior.    for x>0  f(x; alpha, beta) = \frac{beta^alpha}{Gamma(alpha)} (1/x)^{alpha + 1}exp(-beta/x) " +
+        "If the input x is a multidimensional parameter, each of the dimensions is considered as a " +
+        "separate independent component.")
+public class InverseGamma extends ParametricDistribution {
+    public Input<RealParameter> alphaInput = new Input<RealParameter>("alpha", "shape parameter, defaults to 2");
+    public Input<RealParameter> betaInput = new Input<RealParameter>("beta", "scale parameter, defaults to 2");
+
+    InverseGammaImpl dist = new InverseGammaImpl(2, 2);
+
+    @Override
+    public void initAndValidate() {
+        refresh();
+    }
+
+    /**
+     * ensure internal state is up to date *
+     */
+    void refresh() {
+        double fAlpha;
+        double fBeta;
+        if (alphaInput.get() == null) {
+            fAlpha = 2;
+        } else {
+            fAlpha = alphaInput.get().getValue();
+        }
+        if (betaInput.get() == null) {
+            fBeta = 2;
+        } else {
+            fBeta = betaInput.get().getValue();
+        }
+        dist.setAlphaBeta(fAlpha, fBeta);
+    }
+
+    @Override
+    public Distribution getDistribution() {
+        refresh();
+        return dist;
+    }
+
+    class InverseGammaImpl implements ContinuousDistribution {
+        double m_fAlpha;
+        double m_fBeta;
+        // log of the constant beta^alpha/Gamma(alpha)
+        double C;
+
+        InverseGammaImpl(double fAlpha, double fBeta) {
+            setAlphaBeta(fAlpha, fBeta);
+        }
+
+        void setAlphaBeta(double fAlpha, double fBeta) {
+            m_fAlpha = fAlpha;
+            m_fBeta = fBeta;
+            C = m_fAlpha * Math.log(m_fBeta) - org.apache.commons.math.special.Gamma.logGamma(m_fAlpha);
+        }
+
+        @Override
+        public double cumulativeProbability(double x) throws MathException {
+            throw new MathException("Not implemented yet");
+        }
+
+        @Override
+        public double cumulativeProbability(double x0, double x1) throws MathException {
+            throw new MathException("Not implemented yet");
+        }
+
+        @Override
+        public double inverseCumulativeProbability(double p) throws MathException {
+            throw new MathException("Not implemented yet");
+        }
+
+        @Override
+        public double density(double fX) {
+            double fLogP = logDensity(fX);
+            return Math.exp(fLogP);
+        }
+
+        @Override
+        public double logDensity(double fX) {
+            double fLogP = -(m_fAlpha + 1.0) * Math.log(fX) - (m_fBeta / fX) + C;
+            return fLogP;
+        }
+    } // class OneOnXImpl
+
+
+} // class InverseGamma
diff --git a/src/beast/math/distributions/LaplaceDistribution.java b/src/beast/math/distributions/LaplaceDistribution.java
new file mode 100644
index 0000000..5094e01
--- /dev/null
+++ b/src/beast/math/distributions/LaplaceDistribution.java
@@ -0,0 +1,95 @@
+package beast.math.distributions;
+
+import org.apache.commons.math.distribution.ContinuousDistribution;
+import org.apache.commons.math.distribution.NormalDistributionImpl;
+import org.apache.commons.math.MathException;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.parameter.RealParameter;
+import beast.math.distributions.LogNormalDistributionModel.LogNormalImpl;
+
+ at Description("Laplace distribution.    f(x|\\mu,b) = \\frac{1}{2b} \\exp \\left( -\\frac{|x-\\mu|}{b} \\right)" +
+        "The probability density function of the Laplace distribution is also reminiscent of the normal distribution; " +
+        "however, whereas the normal distribution is expressed in terms of the squared difference from the mean ?, " +
+        "the Laplace density is expressed in terms of the absolute difference from the mean. Consequently the Laplace " +
+        "distribution has fatter tails than the normal distribution.")
+public class LaplaceDistribution extends ParametricDistribution {
+    public Input<RealParameter> muInput = new Input<RealParameter>("mu", "location parameter, defaults to 0");
+    public Input<RealParameter> scaleInput = new Input<RealParameter>("scale", "scale parameter, defaults to 1");
+
+    // the mean parameter
+    double mu;
+    // the scale parameter
+    double scale;
+    // the maximum density
+    double c;
+    LaplaceImpl dist = new LaplaceImpl();
+
+    @Override
+    public void initAndValidate() {
+        refresh();
+    }
+
+    /**
+     * make sure internal state is up to date *
+     */
+    void refresh() {
+
+        if (muInput.get() == null) {
+            mu = 0;
+        } else {
+            mu = muInput.get().getValue();
+        }
+        if (scaleInput.get() == null || scaleInput.get().getValue()<=0.0) {
+            scale = 1;
+        } else {
+            scale = scaleInput.get().getValue();
+        }
+
+        //Normalizing constant
+        c = 1.0 / (2.0 * scale);
+    }
+
+    @Override
+    public ContinuousDistribution getDistribution() {
+        refresh();
+        return dist;
+    }
+
+    class LaplaceImpl implements ContinuousDistribution {
+
+        @Override
+        public double cumulativeProbability(double x) throws MathException {
+            // =0.5\,[1 + \sgn(x-\mu)\,(1-\exp(-|x-\mu|/b))].
+            if (x == mu) {
+                return 0.5;
+            } else {
+                return (0.5) * (1 + ((x - mu) / Math.abs(x - mu)) * (1 - Math.exp(-Math.abs(x - mu) / scale)));
+            }
+        }
+
+        @Override
+        public double cumulativeProbability(double x0, double x1) throws MathException {
+            return cumulativeProbability(x1) - cumulativeProbability(x0);
+        }
+
+        @Override
+        public double inverseCumulativeProbability(double p) throws MathException {
+            //     \mu - b\,\sgn(p-0.5)\,\ln(1 - 2|p-0.5|).
+            return mu - scale * Math.signum(p - 0.5) * Math.log(1.0 - 2.0 * Math.abs(p - 0.5));
+        }
+
+        @Override
+        public double density(double fX) {
+            // f(x|\mu,b) = \frac{1}{2b} \exp \left( -\frac{|x-\mu|}{b} \right) \,\!
+            return c * Math.exp(-Math.abs(fX - mu) / scale);
+        }
+
+        @Override
+        public double logDensity(double fX) {
+            return Math.log(c) - (Math.abs(fX - mu) / scale);
+        }
+    } // class LaplaceImpl
+
+} // class
\ No newline at end of file
diff --git a/src/beast/math/distributions/LogNormalDistributionModel.java b/src/beast/math/distributions/LogNormalDistributionModel.java
new file mode 100644
index 0000000..be56932
--- /dev/null
+++ b/src/beast/math/distributions/LogNormalDistributionModel.java
@@ -0,0 +1,136 @@
+package beast.math.distributions;
+
+import org.apache.commons.math.MathException;
+import org.apache.commons.math.distribution.ContinuousDistribution;
+import org.apache.commons.math.distribution.Distribution;
+import org.apache.commons.math.distribution.NormalDistributionImpl;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.parameter.RealParameter;
+
+
+
+/**
+ * @author Alexei Drummond
+ */
+ at Description("A log-normal distribution with mean and variance parameters.")
+public class LogNormalDistributionModel extends ParametricDistribution {
+    public Input<RealParameter> MParameterInput = new Input<RealParameter>("M", "M parameter of lognormal distribution. Equal to the mean of the log-transformed distribution.");
+    public Input<RealParameter> SParameterInput = new Input<RealParameter>("S", "S parameter of lognormal distribution. Equal to the standard deviation of the log-transformed distribution.");
+    public Input<Boolean> hasMeanInRealSpaceInput = new Input<Boolean>("meanInRealSpace", "Whether the M parameter is in real space, or in log-transformed space. Default false = log-transformed.", false);
+
+    boolean hasMeanInRealSpace;
+    LogNormalImpl dist = new LogNormalImpl(0, 1);
+
+    public void initAndValidate() throws Exception {
+        hasMeanInRealSpace = hasMeanInRealSpaceInput.get();
+        if (MParameterInput.get() != null) {
+            if (MParameterInput.get().getLower() == null) {
+                MParameterInput.get().setLower(Double.NEGATIVE_INFINITY);
+            }
+            if (MParameterInput.get().getUpper() == null) {
+                MParameterInput.get().setUpper(Double.POSITIVE_INFINITY);
+            }
+        }
+
+        if (SParameterInput.get() != null) {
+            if (SParameterInput.get().getLower() == null) {
+                SParameterInput.get().setLower(0.0);
+            }
+            if (SParameterInput.get().getUpper() == null) {
+                SParameterInput.get().setUpper(Double.POSITIVE_INFINITY);
+            }
+        }
+        refresh();
+    }
+
+    /**
+     * make sure internal state is up to date *
+     */
+    void refresh() {
+        double fMean;
+        double fSigma;
+        if (SParameterInput.get() == null) {
+            fSigma = 1;
+        } else {
+            fSigma = SParameterInput.get().getValue();
+        }
+        if (MParameterInput.get() == null) {
+            fMean = 0;
+        } else {
+            fMean = MParameterInput.get().getValue();
+        }
+        if (hasMeanInRealSpace) {
+            fMean = Math.log(fMean) - (0.5 * fSigma * fSigma);
+        }
+        dist.setMeanAndStdDev(fMean, fSigma);
+    }
+
+    @Override
+    public Distribution getDistribution() {
+        refresh();
+        return dist;
+    }
+
+    public class LogNormalImpl implements ContinuousDistribution {
+        double m_fMean;
+        double m_fStdDev;
+        NormalDistributionImpl m_normal = new NormalDistributionImpl(0, 1);
+
+        public LogNormalImpl(double fMean, double fStdDev) {
+            setMeanAndStdDev(fMean, fStdDev);
+        }
+
+        void setMeanAndStdDev(double fMean, double fStdDev) {
+            m_fMean = fMean;
+            m_fStdDev = fStdDev;
+            m_normal.setMean(fMean);
+            m_normal.setStandardDeviation(fStdDev);
+        }
+
+        @Override
+        public double cumulativeProbability(double x) throws MathException {
+            return m_normal.cumulativeProbability(Math.log(x));
+        }
+
+        @Override
+        public double cumulativeProbability(double x0, double x1) throws MathException {
+            return cumulativeProbability(x1) - cumulativeProbability(x0);
+        }
+
+        @Override
+        public double inverseCumulativeProbability(double p) throws MathException {
+            return Math.exp(m_normal.inverseCumulativeProbability(p));
+        }
+
+        @Override
+        public double density(double fX) {
+            if( fX <= 0 ) {
+                return 0;
+            }
+            return m_normal.density(Math.log(fX)) / fX;
+        }
+
+        @Override
+        public double logDensity(double fX) {
+            if( fX <= 0 ) {
+                return  Double.NEGATIVE_INFINITY;
+            }
+            return m_normal.logDensity(Math.log(fX)) - Math.log(fX);
+        }
+    } // class LogNormalImpl
+
+    @Override
+    public double getMean() {
+    	if (hasMeanInRealSpace) {
+    		if (MParameterInput.get() != null) {
+    			return offsetInput.get() + MParameterInput.get().getValue();
+    		} else {
+    			return offsetInput.get();
+    		}
+    	} else {
+    		throw new RuntimeException("Not implemented yet");
+    	}
+    }
+}
diff --git a/src/beast/math/distributions/MRCAPrior.java b/src/beast/math/distributions/MRCAPrior.java
new file mode 100644
index 0000000..081368a
--- /dev/null
+++ b/src/beast/math/distributions/MRCAPrior.java
@@ -0,0 +1,316 @@
+package beast.math.distributions;
+
+
+import java.io.PrintStream;
+import java.util.*;
+
+import beast.core.Description;
+import beast.core.Distribution;
+import beast.core.Input;
+import beast.core.State;
+import beast.core.Input.Validate;
+import beast.evolution.alignment.TaxonSet;
+import beast.evolution.tree.Node;
+import beast.evolution.tree.Tree;
+
+
+ at Description("Prior over set of taxa, useful for defining monophyletic constraints and "
+        + "distributions over MRCA times or (sets of) tips of trees")
+public class MRCAPrior extends Distribution {
+    public final Input<Tree> treeInput = new Input<Tree>("tree", "the tree containing the taxon set", Validate.REQUIRED);
+    public final Input<TaxonSet> taxonsetInput = new Input<TaxonSet>("taxonset",
+            "set of taxa for which prior information is available");
+    public final Input<Boolean> isMonophyleticInput = new Input<Boolean>("monophyletic",
+            "whether the taxon set is monophyletic (forms a clade without other taxa) or nor. Default is false.", false);
+    public final Input<ParametricDistribution> distInput = new Input<ParametricDistribution>("distr",
+            "distribution used to calculate prior over MRCA time, "
+                    + "e.g. normal, beta, gamma. If not specified, monophyletic must be true");
+    public final Input<Boolean> onlyUseTipsInput = new Input<Boolean>("tipsonly",
+            "flag to indicate tip dates are to be used instead of the MRCA node. " +
+                    "If set to true, the prior is applied to the height of all tips in the taxonset " +
+                    "and the monophyletic flag is ignored. Default is false.", false);
+    public final Input<Boolean> useOriginateInput = new Input<Boolean>("useOriginate", "Use parent of clade instead of clade. Cannot be used with tipsonly, or on the root.", false);
+
+    /**
+     * shadow members *
+     */
+    ParametricDistribution dist;
+    Tree tree;
+    // number of taxa in taxon set
+    int nrOfTaxa = -1;
+    // array of flags to indicate which taxa are in the set
+    Set<String> isInTaxaSet = new LinkedHashSet<>();
+
+    // array of indices of taxa
+    int[] taxonIndex;
+    // stores time to be calculated
+    double MRCATime = -1;
+    double storedMRCATime = -1;
+    // flag indicating taxon set is monophyletic
+    boolean isMonophyletic = false;
+    boolean onlyUseTips = false;
+    boolean useOriginate = false;
+
+    @Override
+    public void initAndValidate() throws Exception {
+        dist = distInput.get();
+        tree = treeInput.get();
+        final List<String> sTaxaNames = new ArrayList<>();
+        for (final String sTaxon : tree.getTaxaNames()) {
+            sTaxaNames.add(sTaxon);
+        }
+        // determine nr of taxa in taxon set
+        List<String> set = null;
+        if (taxonsetInput.get() != null) {
+            set = taxonsetInput.get().asStringList();
+            nrOfTaxa = set.size();
+        } else {
+            // assume all taxa
+            nrOfTaxa = sTaxaNames.size();
+        }
+
+        onlyUseTips = onlyUseTipsInput.get();
+        useOriginate = useOriginateInput.get();
+        if (nrOfTaxa == 1) {
+            // ignore test for Monophyletic when it only involves a tree tip
+        	if (!useOriginate && !onlyUseTips) {
+        		onlyUseTips = true;
+        	}
+        }
+        if (!onlyUseTips && !useOriginate && nrOfTaxa < 2) {
+            throw new Exception("At least two taxa are required in a taxon set");
+        }
+        if (!onlyUseTips && taxonsetInput.get() == null) {
+            throw new Exception("Taxonset must be specified OR tipsonly be set to true");
+        }
+        
+        // determine which taxa are in the set
+        taxonIndex = new int[nrOfTaxa];
+        if ( set != null )  {  // m_taxonset.get() != null) {
+            isInTaxaSet.clear();
+            int k = 0;
+            for (final String sTaxon : set) {
+                final int iTaxon = sTaxaNames.indexOf(sTaxon);
+                if (iTaxon < 0) {
+                    throw new Exception("Cannot find taxon " + sTaxon + " in data");
+                }
+                if (isInTaxaSet.contains(sTaxon)) {
+                    throw new Exception("Taxon " + sTaxon + " is defined multiple times, while they should be unique");
+                }
+                isInTaxaSet.add(sTaxon);
+                taxonIndex[k++] = iTaxon;
+            }
+        } else {
+            for (int i = 0; i < nrOfTaxa; i++) {
+                taxonIndex[i] = i;
+            }
+        }
+        
+        if (useOriginate && onlyUseTips) {
+        	throw new Exception("'useOriginate' and 'tipsOnly' cannot be both true");
+        }
+        if (useOriginate && nrOfTaxa == tree.getLeafNodeCount()) {
+        	throw new Exception("Cannot use originate of root. You can set useOriginate to false to fix this");
+        }
+
+    }
+
+    @Override
+    public double calculateLogP() throws Exception {
+        logP = 0;
+        if (onlyUseTips) {
+            // tip date
+        	if (dist == null) {
+        		return logP;
+        	}
+            for (final int i : taxonIndex) {
+                MRCATime = tree.getNode(i).getDate();
+                logP += dist.logDensity(MRCATime);
+            }
+            return logP;
+        } else {
+            // internal node
+            calcMRCAtime(tree.getRoot(), new int[1]);
+        }
+        if (isMonophyleticInput.get() && !isMonophyletic) {
+            logP = Double.NEGATIVE_INFINITY;
+            return Double.NEGATIVE_INFINITY;
+        }
+        if (dist != null) {
+            logP = dist.logDensity(MRCATime); // - dist.offsetInput.get());
+        }
+        return logP;
+    }
+
+    /**
+     * Recursively visit all leaf nodes, and collect number of taxa in the taxon
+     * set. When all taxa in the set are visited, record the time.
+     * *
+     * @param node
+     * @param nTaxonCount
+     */
+    int calcMRCAtime(final Node node, final int[] nTaxonCount) {
+        if (node.isLeaf()) {
+            nTaxonCount[0]++;
+            if (isInTaxaSet.contains(node.getID())) {
+                return 1;
+            } else {
+                return 0;
+            }
+        } else {
+            int taxonCount = calcMRCAtime(node.getLeft(), nTaxonCount);
+            final int nLeftTaxa = nTaxonCount[0];
+            nTaxonCount[0] = 0;
+            if (node.getRight() != null) {
+                taxonCount += calcMRCAtime(node.getRight(), nTaxonCount);
+                final int nRightTaxa = nTaxonCount[0];
+                nTaxonCount[0] = nLeftTaxa + nRightTaxa;
+                if (taxonCount == nrOfTaxa) {
+                	if (nrOfTaxa == 1 && useOriginate) {
+            			MRCATime = node.getDate();
+                        isMonophyletic = true;
+                        return taxonCount + 1;
+                	}
+                    // we are at the MRCA, so record the height
+                	if (useOriginate) {
+                		Node parent = node.getParent();
+                		if (parent != null) {
+                			MRCATime = parent.getDate();
+                		} else {
+                			MRCATime = node.getDate();
+                		}
+                	} else {
+                		MRCATime = node.getDate();
+                	}
+                    isMonophyletic = (nTaxonCount[0] == nrOfTaxa);
+                    return taxonCount + 1;
+                }
+            }
+            return taxonCount;
+        }
+    }
+
+
+    @Override
+    public void store() {
+        storedMRCATime = MRCATime;
+        // don't need to store m_bIsMonophyletic since it is never reported
+        // explicitly, only logP and MRCA time are (re)stored
+        super.store();
+    }
+
+    @Override
+    public void restore() {
+        MRCATime = storedMRCATime;
+        super.restore();
+    }
+
+    @Override
+    protected boolean requiresRecalculation() {
+        return super.requiresRecalculation();
+    }
+
+
+    /**
+     * Loggable interface implementation follows *
+     */
+    @Override
+    public void init(final PrintStream out) throws Exception {
+        if (onlyUseTips) {
+            if (dist != null) {
+                out.print("logP(mrca(" + getID() + "))\t");
+            }
+            for (final int i : taxonIndex) {
+                out.print("height(" + tree.getTaxaNames()[i] + ")\t");
+            }
+        } else {
+        	if (!isMonophyleticInput.get()) {
+        		out.print("monophyletic(" + taxonsetInput.get().getID() + ")\t");
+        	}
+            if (dist != null) {
+                out.print("logP(mrca(" + taxonsetInput.get().getID() + "))\t");
+            }
+            out.print("mrcatime(" + taxonsetInput.get().getID() + ")\t");
+        }
+    }
+
+    @Override
+    public void log(final int nSample, final PrintStream out) {
+        if (onlyUseTips) {
+            if (dist != null) {
+                out.print(getCurrentLogP() + "\t");
+            }
+            for (final int i : taxonIndex) {
+                out.print(tree.getNode(i).getDate() + "\t");
+            }
+        } else {
+        	if (!isMonophyleticInput.get()) {
+        		out.print((isMonophyletic ? 1 : 0) + "\t");
+        	}
+            if (dist != null) {
+                out.print(getCurrentLogP() + "\t");
+            } else {
+                calcMRCAtime(tree.getRoot(), new int[1]);
+            }
+            out.print(MRCATime + "\t");
+        }
+    }
+
+    @Override
+    public void close(final PrintStream out) {
+        // nothing to do
+    }
+
+    /**
+     * Valuable interface implementation follows, first dimension is log likelihood, second the time *
+     */
+    @Override
+    public int getDimension() {
+        return 2;
+    }
+
+    @Override
+    public double getArrayValue() {
+    	if (Double.isNaN(logP)) {
+    		try {
+    			calculateLogP();
+    		}catch (Exception e) {
+    			logP  = Double.NaN;
+    		}
+    	}
+        return logP;
+    }
+
+    @Override
+    public double getArrayValue(final int iDim) {
+    	if (Double.isNaN(logP)) {
+    		try {
+    			calculateLogP();
+    		}catch (Exception e) {
+    			logP  = Double.NaN;
+    		}
+    	}
+        switch (iDim) {
+            case 0:
+                return logP;
+            case 1:
+                return MRCATime;
+            default:
+                return 0;
+        }
+    }
+
+    @Override
+    public void sample(final State state, final Random random) {
+    }
+
+    @Override
+    public List<String> getArguments() {
+        return null;
+    }
+
+    @Override
+    public List<String> getConditions() {
+        return null;
+    }
+}
\ No newline at end of file
diff --git a/src/beast/math/distributions/MarkovChainDistribution.java b/src/beast/math/distributions/MarkovChainDistribution.java
new file mode 100644
index 0000000..b8301f8
--- /dev/null
+++ b/src/beast/math/distributions/MarkovChainDistribution.java
@@ -0,0 +1,123 @@
+package beast.math.distributions;
+
+
+import java.util.List;
+import java.util.Random;
+
+import org.apache.commons.math.distribution.GammaDistribution;
+import org.apache.commons.math.distribution.GammaDistributionImpl;
+
+import beast.core.Description;
+import beast.core.Distribution;
+import beast.core.Input;
+import beast.core.State;
+import beast.core.Input.Validate;
+import beast.core.parameter.RealParameter;
+import beast.math.distributions.LogNormalDistributionModel.LogNormalImpl;
+
+
+
+/**
+ * Initial version Ported from Beast 1.7 ExponentialMarkovModel
+ */
+ at Description("A class that produces a distribution chaining values in a parameter through the Gamma distribution. " +
+        "The value of a parameter is assumed to be Gamma distributed with mean as the previous value in the parameter. " +
+		"If useLogNormal is set, a log normal distribution is used instead of a Gamma. " +
+        "If a Jeffrey's prior is used, the first value is assumed to be distributed as 1/x, otherwise it is assumed to be uniform. " +
+        "Handy for population parameters. ")
+public class MarkovChainDistribution extends Distribution {
+
+    public Input<Boolean> isJeffreysInput = new Input<Boolean>("jeffreys", "use Jeffrey's prior (default false)", false);
+    public Input<Boolean> isReverseInput = new Input<Boolean>("reverse", "parameter in reverse (default false)", false);
+    public Input<Boolean> useLogInput = new Input<Boolean>("uselog", "use logarithm of parameter values (default false)", false);
+    public Input<Double> shapeInput = new Input<Double>("shape", "shape parameter of the Gamma distribution (default 1.0 = exponential distribution) " +
+    		" or precision parameter if the log normal is used.", 1.0);
+    public Input<RealParameter> parameterInput = new Input<RealParameter>("parameter", "chain parameter to calculate distribution over", Validate.REQUIRED);
+    public Input<Boolean> useLogNormalInput = new Input<Boolean>("useLogNormal", "use Log Normal distribution instead of Gamma (default false)", false);
+
+    // **************************************************************
+    // Private instance variables
+    // **************************************************************
+    private RealParameter chainParameter = null;
+    private boolean jeffreys = false;
+    private boolean reverse = false;
+    private boolean uselog = false;
+    private double shape = 1.0;
+    GammaDistribution gamma;
+    LogNormalImpl logNormal;
+    boolean useLogNormal;
+
+    @Override
+    public void initAndValidate() throws Exception {
+        reverse = isReverseInput.get();
+        jeffreys = isJeffreysInput.get();
+        uselog = useLogInput.get();
+        shape = shapeInput.get();
+        chainParameter = parameterInput.get();
+        useLogNormal = useLogNormalInput.get();
+        gamma = new GammaDistributionImpl(shape, 1);
+        logNormal = new LogNormalDistributionModel().new LogNormalImpl(1, 1);
+    }
+
+
+    /**
+     * Get the log likelihood.
+     *
+     * @return the log likelihood.
+     */
+    @Override
+    public double calculateLogP() throws Exception {
+        logP = 0.0;
+        // jeffreys Prior!
+        if (jeffreys) {
+            logP += -Math.log(getChainValue(0));
+        }
+        for (int i = 1; i < chainParameter.getDimension(); i++) {
+            final double mean = getChainValue(i - 1);
+            final double x = getChainValue(i);
+
+            if (useLogNormal) {
+	            final double sigma = 1.0 / shape; // shape = precision
+	            // convert mean to log space
+	            final double M = Math.log(mean) - (0.5 * sigma * sigma);
+	            logNormal.setMeanAndStdDev(M, sigma);
+	            logP += logNormal.logDensity(x);
+            } else {
+                final double scale = mean / shape;
+                gamma.setBeta(scale);
+                logP += gamma.logDensity(x);
+            }
+        }
+        return logP;
+    }
+
+    private double getChainValue(int i) {
+        if (uselog) {
+            return Math.log(chainParameter.getValue(index(i)));
+        } else {
+            return chainParameter.getValue(index(i));
+        }
+    }
+
+    private int index(int i) {
+        if (reverse)
+            return chainParameter.getDimension() - i - 1;
+        else
+            return i;
+    }
+
+    @Override
+    public List<String> getArguments() {
+        return null;
+    }
+
+    @Override
+    public List<String> getConditions() {
+        return null;
+    }
+
+    @Override
+    public void sample(State state, Random random) {
+    }
+}
+
diff --git a/src/beast/math/distributions/Normal.java b/src/beast/math/distributions/Normal.java
new file mode 100644
index 0000000..7d36ebc
--- /dev/null
+++ b/src/beast/math/distributions/Normal.java
@@ -0,0 +1,67 @@
+package beast.math.distributions;
+
+
+import org.apache.commons.math.distribution.ContinuousDistribution;
+import org.apache.commons.math.distribution.NormalDistributionImpl;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.Input.Validate;
+import beast.core.parameter.RealParameter;
+
+
+
+ at Description("Normal distribution.  f(x) = frac{1}{\\sqrt{2\\pi\\sigma^2}} e^{ -\\frac{(x-\\mu)^2}{2\\sigma^2} } " +
+        "If the input x is a multidimensional parameter, each of the dimensions is considered as a " +
+        "separate independent component.")
+public class Normal extends ParametricDistribution {
+    public Input<RealParameter> meanInput = new Input<RealParameter>("mean", "mean of the normal distribution, defaults to 0");
+    public Input<RealParameter> sigmaInput = new Input<RealParameter>("sigma", "variance of the normal distribution, defaults to 1");
+    public Input<RealParameter> tauInput = new Input<RealParameter>("tau", "precission of the normal distribution, defaults to 1", Validate.XOR, sigmaInput);
+
+    static org.apache.commons.math.distribution.NormalDistribution dist = new NormalDistributionImpl(0, 1);
+
+    @Override
+    public void initAndValidate() {
+        refresh();
+    }
+
+    /**
+     * make sure internal state is up to date *
+     */
+    void refresh() {
+        double fMean;
+        double fSigma;
+        if (meanInput.get() == null) {
+            fMean = 0;
+        } else {
+            fMean = meanInput.get().getValue();
+        }
+        if (sigmaInput.get() == null) {
+        	if (tauInput.get() == null) {
+        		fSigma = 1;
+        	} else {
+                fSigma = Math.sqrt(1.0/tauInput.get().getValue());
+        	}
+        } else {
+            fSigma = sigmaInput.get().getValue();
+        }
+        dist.setMean(fMean);
+        dist.setStandardDeviation(fSigma);
+    }
+
+    @Override
+    public ContinuousDistribution getDistribution() {
+        refresh();
+        return dist;
+    }
+
+    @Override
+    public double getMean() {
+        if (meanInput.get() == null) {
+        	return offsetInput.get();
+        } else {
+        	return offsetInput.get() + meanInput.get().getValue();
+        }
+    }
+} // class Normal
diff --git a/src/beast/math/distributions/OneOnX.java b/src/beast/math/distributions/OneOnX.java
new file mode 100644
index 0000000..0c1f7f8
--- /dev/null
+++ b/src/beast/math/distributions/OneOnX.java
@@ -0,0 +1,57 @@
+package beast.math.distributions;
+
+
+import org.apache.commons.math.MathException;
+import org.apache.commons.math.distribution.ContinuousDistribution;
+import org.apache.commons.math.distribution.Distribution;
+
+import beast.core.Description;
+
+
+
+ at Description("OneOnX distribution.  f(x) = C/x for some normalizing constant C. " +
+        "If the input x is a multidimensional parameter, each of the dimensions is considered as a " +
+        "separate independent component.")
+public class OneOnX extends ParametricDistribution {
+
+    ContinuousDistribution dist = new OneOnXImpl();
+
+    @Override
+    public void initAndValidate() {
+    }
+
+    @Override
+    public Distribution getDistribution() {
+        return dist;
+    }
+
+    class OneOnXImpl implements ContinuousDistribution {
+
+        @Override
+        public double cumulativeProbability(double x) throws MathException {
+            throw new MathException("Not implemented yet");
+        }
+
+        @Override
+        public double cumulativeProbability(double x0, double x1) throws MathException {
+            throw new MathException("Not implemented yet");
+        }
+
+        @Override
+        public double inverseCumulativeProbability(double p) throws MathException {
+            throw new MathException("Not implemented yet");
+        }
+
+        @Override
+        public double density(double x) {
+            return 1 / x;
+        }
+
+        @Override
+        public double logDensity(double x) {
+            return -Math.log(x);
+        }
+    } // class OneOnXImpl
+
+
+} // class OneOnX
diff --git a/src/beast/math/distributions/ParametricDistribution.java b/src/beast/math/distributions/ParametricDistribution.java
new file mode 100644
index 0000000..a27e3a7
--- /dev/null
+++ b/src/beast/math/distributions/ParametricDistribution.java
@@ -0,0 +1,201 @@
+/*
+ * ParametricDistributionModel.java
+ *
+ * Copyright (C) 2002-2006 Alexei Drummond and Andrew Rambaut
+ *
+ * This file is part of BEAST.
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership and licensing.
+ *
+ * BEAST 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
+ * of the License, or (at your option) any later version.
+ *
+ *  BEAST 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 BEAST; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+package beast.math.distributions;
+
+import org.apache.commons.math.MathException;
+import org.apache.commons.math.distribution.ContinuousDistribution;
+import org.apache.commons.math.distribution.IntegerDistribution;
+
+import beast.core.CalculationNode;
+import beast.core.Description;
+import beast.core.Function;
+import beast.core.Input;
+import beast.util.Randomizer;
+
+/**
+ * A class that describes a parametric distribution
+ *
+ * * (FIXME) cumulative functions disregard offset. Serious bug if they are used.
+ *
+ * @author Alexei Drummond
+ * @version $Id: ParametricDistributionModel.java,v 1.4 2005/05/24 20:25:59 rambaut Exp $
+ */
+
+ at Description("A class that describes a parametric distribution, that is, a distribution that takes some " +
+        "parameters/valuables as inputs and can produce (cumulative) densities and inverse " +
+        "cumulative densities.")
+public abstract class ParametricDistribution extends CalculationNode implements ContinuousDistribution {
+    public final Input<Double> offsetInput = new Input<Double>("offset", "offset of origin (defaults to 0)", 0.0);
+
+    abstract public org.apache.commons.math.distribution.Distribution getDistribution();
+
+    /**
+     * Calculate log probability of a valuable x for this distribution.
+     * If x is multidimensional, the components of x are assumed to be independent,
+     * so the sum of log probabilities of all elements of x is returned as the prior.
+     */
+    public double calcLogP(final Function x) throws Exception {
+        final double fOffset = offsetInput.get();
+        double fLogP = 0;
+        for (int i = 0; i < x.getDimension(); i++) {
+            final double fX = x.getArrayValue(i);
+            //fLogP += Math.log(density(fX));
+            fLogP += logDensity(fX, fOffset);
+        }
+        return fLogP;
+    }
+
+    /*
+     * This implementation is only suitable for univariate distributions.
+     * Must be overwritten for multivariate ones.
+     */
+    public Double[][] sample(final int size) throws Exception {
+        final Double[][] sample = new Double[size][];
+        for (int i = 0; i < sample.length; i++) {
+            final double p = Randomizer.nextDouble();
+            sample[i] = new Double[]{inverseCumulativeProbability(p)+offsetInput.get()};
+        }
+        return sample;
+
+    }
+
+    /**
+     * For this distribution, X, this method returns x such that P(X < x) = p.
+     *
+     * @param p the cumulative probability.
+     * @return x.
+     * @throws MathException if the inverse cumulative probability can not be
+     *                       computed due to convergence or other numerical errors.
+     */
+    //@Override
+    public double inverseCumulativeProbability(final double p) throws MathException {
+        final org.apache.commons.math.distribution.Distribution dist = getDistribution();
+        double offset = getOffset();
+        if (dist instanceof ContinuousDistribution) {
+            return offset + ((ContinuousDistribution) dist).inverseCumulativeProbability(p);
+        } else if (dist instanceof IntegerDistribution) {
+            return offset + ((IntegerDistribution)dist).inverseCumulativeProbability(p);
+        }
+        return 0.0;
+    }
+
+    /**
+     * Return the probability density for a particular point.
+     * NB this does not take offset in account
+     *
+     * @param x The point at which the density should be computed.
+     * @return The pdf at point x.
+     */
+    //@Override
+    public double density(double x) {
+        final double offset = getOffset();
+ //       if( x >= offset ) {
+            x -= offset;
+            final org.apache.commons.math.distribution.Distribution dist = getDistribution();
+            if (dist instanceof ContinuousDistribution) {
+                return ((ContinuousDistribution) dist).density(x);
+            } else if (dist instanceof IntegerDistribution) {
+                return ((IntegerDistribution) dist).probability(x);
+            }
+   //     }
+        return 0.0;
+    }
+    
+    private double logDensity(double x, final double offset) {
+   //     if( x >= offset ) {
+            x -= offset;
+            final org.apache.commons.math.distribution.Distribution dist = getDistribution();
+            if (dist instanceof ContinuousDistribution) {
+                return ((ContinuousDistribution) dist).logDensity(x);
+            } else if (dist instanceof IntegerDistribution) {
+                final double probability = ((IntegerDistribution) dist).probability(x);
+                if( probability > 0 ) {
+                    return Math.log(probability);
+                }
+            }
+  //      }
+        return Double.NEGATIVE_INFINITY;
+    }
+
+    //@Override
+    public double logDensity(final double x) {
+        return logDensity(x, getOffset());
+    }
+
+    /**
+     * For a random variable X whose values are distributed according
+     * to this distribution, this method returns P(X ≤ x).  In other words,
+     * this method represents the  (cumulative) distribution function, or
+     * CDF, for this distribution.
+     *
+     * @param x the value at which the distribution function is evaluated.
+     * @return the probability that a random variable with this
+     *         distribution takes a value less than or equal to <code>x</code>
+     * @throws MathException if the cumulative probability can not be
+     *                       computed due to convergence or other numerical errors.
+     */
+    //@Override
+    public double cumulativeProbability(final double x) throws MathException {
+        return getDistribution().cumulativeProbability(x);
+    }
+
+    /**
+     * For a random variable X whose values are distributed according
+     * to this distribution, this method returns P(x0 ≤ X ≤ x1).
+     *
+     * @param x0 the (inclusive) lower bound
+     * @param x1 the (inclusive) upper bound
+     * @return the probability that a random variable with this distribution
+     *         will take a value between <code>x0</code> and <code>x1</code>,
+     *         including the endpoints
+     * @throws MathException            if the cumulative probability can not be
+     *                                  computed due to convergence or other numerical errors.
+     * @throws IllegalArgumentException if <code>x0 > x1</code>
+     */
+    //@Override
+    public double cumulativeProbability(final double x0, final double x1) throws MathException {
+        return getDistribution().cumulativeProbability(x0, x1);
+    }
+
+    /**
+     * @return  offset of distribution.
+     */
+    private double getOffset() {
+        return offsetInput.get();
+    }
+
+    /** returns mean of distribution, if implemented **/
+    public double getMean() {
+    	throw new RuntimeException("Not implemented yet");
+    }
+    
+    /**
+     * @return true if the distribution is an integer distribution
+     */
+    public boolean isIntegerDistribution() {
+        return getDistribution() instanceof IntegerDistribution;
+    }
+}
\ No newline at end of file
diff --git a/src/beast/math/distributions/Poisson.java b/src/beast/math/distributions/Poisson.java
new file mode 100644
index 0000000..09659fb
--- /dev/null
+++ b/src/beast/math/distributions/Poisson.java
@@ -0,0 +1,61 @@
+package beast.math.distributions;
+
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.parameter.RealParameter;
+import org.apache.commons.math.distribution.IntegerDistribution;
+import org.apache.commons.math.distribution.PoissonDistributionImpl;
+
+
+ at Description("Poisson distribution, used as prior  f(k; lambda)=\\frac{lambda^k e^{-lambda}}{k!}  " +
+        "If the input x is a multidimensional parameter, each of the dimensions is considered as a " +
+        "separate independent component.")
+public class Poisson extends ParametricDistribution {
+    public Input<RealParameter> lambdaInput = new Input<RealParameter>("lambda", "rate parameter, defaults to 1");
+
+    static org.apache.commons.math.distribution.PoissonDistribution dist = new PoissonDistributionImpl(1);
+
+
+    // Must provide empty constructor for construction by XML. Note that this constructor DOES NOT call initAndValidate();
+    public Poisson() {
+    }
+
+    public Poisson(RealParameter lambda) {
+
+        try {
+            initByName("lambda", lambda);
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new RuntimeException("Failed to initByName lambda parameter when constructing Poisson instance.");
+        }
+    }
+
+    @Override
+    public void initAndValidate() {
+        refresh();
+    }
+
+    /**
+     * make sure internal state is up to date *
+     */
+    void refresh() {
+        double m_fLambda;
+        if (lambdaInput.get() == null) {
+            m_fLambda = 1;
+        } else {
+            m_fLambda = lambdaInput.get().getValue();
+            if (m_fLambda < 0) {
+                m_fLambda = 1;
+            }
+        }
+        dist.setMean(m_fLambda);
+    }
+
+    @Override
+    public org.apache.commons.math.distribution.Distribution getDistribution() {
+        refresh();
+        return dist;
+    }
+    
+} // class Poisson
diff --git a/src/beast/math/distributions/Prior.java b/src/beast/math/distributions/Prior.java
new file mode 100644
index 0000000..bda873a
--- /dev/null
+++ b/src/beast/math/distributions/Prior.java
@@ -0,0 +1,78 @@
+package beast.math.distributions;
+
+
+import java.util.List;
+import java.util.Random;
+
+import beast.core.*;
+import beast.core.Input.Validate;
+import beast.core.parameter.IntegerParameter;
+import beast.core.parameter.RealParameter;
+
+
+ at Description("Produces prior (log) probability of value x." +
+        "If x is multidimensional, the components of x are assumed to be independent, " +
+        "so the sum of log probabilities of all elements of x is returned as the prior.")
+public class Prior extends Distribution {
+    public Input<Function> m_x = new Input<Function>("x", "point at which the density is calculated", Validate.REQUIRED);
+    public Input<ParametricDistribution> distInput = new Input<ParametricDistribution>("distr", "distribution used to calculate prior, e.g. normal, beta, gamma.", Validate.REQUIRED);
+
+    /**
+     * shadows m_distInput *
+     */
+    protected ParametricDistribution dist;
+
+    @Override
+    public void initAndValidate() throws Exception {
+        dist = distInput.get();
+        calculateLogP();
+    }
+
+    @Override
+    public double calculateLogP() throws Exception {
+        Function x = m_x.get();
+        if (x instanceof RealParameter || x instanceof IntegerParameter) {
+        	// test that parameter is inside its bounds
+            double l = 0.0;
+            double h = 0.0;
+        	if (x instanceof RealParameter) {
+                l = ((RealParameter) x).getLower();
+                h = ((RealParameter) x).getUpper();
+        	} else {
+                l = ((IntegerParameter) x).getLower();
+                h = ((IntegerParameter) x).getUpper();
+        	}
+            for (int i = 0; i < x.getDimension(); i++) {
+            	double value = x.getArrayValue(i);
+            	if (value < l || value > h) {
+            		logP = Double.NEGATIVE_INFINITY;
+            		return Double.NEGATIVE_INFINITY;
+            	}
+            }
+        }
+        logP = dist.calcLogP(x);
+        return logP;
+    }
+    
+    /** return name of the parameter this prior is applied to **/
+    public String getParameterName() {
+    	if (m_x.get() instanceof BEASTObject) {
+    		return ((BEASTObject) m_x.get()).getID();
+    	}
+    	return m_x.get() + "";
+    }
+
+    @Override
+    public void sample(State state, Random random) {
+    }
+
+    @Override
+    public List<String> getArguments() {
+        return null;
+    }
+
+    @Override
+    public List<String> getConditions() {
+        return null;
+    }
+}
diff --git a/src/beast/math/distributions/Uniform.java b/src/beast/math/distributions/Uniform.java
new file mode 100644
index 0000000..5e60e4b
--- /dev/null
+++ b/src/beast/math/distributions/Uniform.java
@@ -0,0 +1,122 @@
+package beast.math.distributions;
+
+import org.apache.commons.math.MathException;
+import org.apache.commons.math.distribution.ContinuousDistribution;
+import org.apache.commons.math.distribution.Distribution;
+
+import beast.core.Description;
+import beast.core.Input;
+
+
+
+ at Description("Uniform distribution over a given interval (including lower and upper values)")
+public class Uniform extends ParametricDistribution {
+    public Input<Double> lowerInput = new Input<Double>("lower", "lower bound on the interval, default 0", 0.0);
+    public Input<Double> upperInput = new Input<Double>("upper", "lower bound on the interval, default 1", 1.0);
+
+    UniformImpl distr = new UniformImpl();
+
+    double _lower, _upper, density;
+
+    private boolean infiniteSupport;
+
+    @Override
+    public void initAndValidate() throws Exception {
+        _lower = lowerInput.get();
+        _upper = upperInput.get();
+        if (_lower >= _upper) {
+            throw new Exception("Upper value should be higher than lower value");
+        }
+        distr.setBounds(_lower, _upper);
+        infiniteSupport = Double.isInfinite(_lower) || Double.isInfinite(_upper);
+        if (infiniteSupport) {
+            density = 1.0;
+        } else {
+            density = 1.0 / (_upper - _lower);
+        }
+    }
+
+
+    class UniformImpl implements ContinuousDistribution {
+        private double lower;
+        private double upper;
+
+        public void setBounds(final double lower, final double upper) {
+            this.lower = lower;
+            this.upper = upper;
+        }
+
+        @Override
+        public double cumulativeProbability(double x) throws MathException {
+            x = Math.max(x, lower);
+            return (x - lower) / (upper - lower);
+        }
+
+        @Override
+        public double cumulativeProbability(double x0, double x1) throws MathException {
+            x0 = Math.max(x0, lower);
+            x1 = Math.min(x1, upper);
+            if (x1 < lower || x1 > upper) {
+                throw new RuntimeException("Value x (" + x1 + ") out of bounds (" + lower + "," + upper + ").");
+            }
+            return (x1 - x0) / (upper - lower);
+        }
+
+        @Override
+        public double inverseCumulativeProbability(final double p) throws MathException {
+            if (p < 0.0 || p > 1.0) {
+                throw new RuntimeException("inverseCumulativeProbability::argument out of range [0...1]");
+            }
+            if( p == 0 ) {
+                // works even when one bound is infinite
+                return _lower;
+            }
+            if( p == 1 ) {
+                // works even when one bound is infinite
+                return _upper;
+            }
+            if( infiniteSupport ) {
+                 throw new RuntimeException("Inverse Cumulative Probability for 0 < p < 1 and infinite support") ;
+            }
+            return (upper - lower) * p + lower;
+        }
+
+        @Override
+        public double density(final double x) {
+            if (x >= lower && x <= upper) {
+                return density;
+            } else {
+                return 0;
+            }
+        }
+
+        @Override
+        public double logDensity(final double x) {
+            return Math.log(density(x));
+        }
+    } // class UniformImpl
+
+
+    @Override
+    public Distribution getDistribution() {
+        return distr;
+    }
+
+    @Override
+    public double density(final double x) {
+        if (x >= _lower && x <= _upper) {
+            // (BUG)?? why does this not return this.density??? (JH)
+            return 1;
+        } else {
+            return 0;
+        }
+    }
+    
+    @Override
+    public double getMean() {
+    	if (Double.isInfinite(_lower) || Double.isInfinite(_upper)) {
+    		return Double.NaN;
+    	}
+    	return offsetInput.get() + (_upper + _lower)/2;
+    }
+}
diff --git a/src/beast/math/statistic/DiscreteStatistics.java b/src/beast/math/statistic/DiscreteStatistics.java
new file mode 100644
index 0000000..0ef7e73
--- /dev/null
+++ b/src/beast/math/statistic/DiscreteStatistics.java
@@ -0,0 +1,394 @@
+/*
+ * DiscreteStatistics.java
+ *
+ * Copyright (C) 2002-2006 Alexei Drummond and Andrew Rambaut
+ *
+ * This file is part of BEAST.
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership and licensing.
+ *
+ * BEAST 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
+ * of the License, or (at your option) any later version.
+ *
+ *  BEAST 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 BEAST; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+package beast.math.statistic;
+
+import beast.util.HeapSort;
+
+
+/**
+ * simple discrete statistics (mean, variance, cumulative probability, quantiles etc.)
+ *
+ * @author Korbinian Strimmer
+ * @author Alexei Drummond
+ * @version $Id: DiscreteStatistics.java,v 1.11 2006/07/02 21:14:53 rambaut Exp $
+ */
+public class DiscreteStatistics {
+    /**
+     * compute mean
+     *
+     * @param x list of numbers
+     * @return mean
+     */
+    public static double mean(double[] x) {
+        double m = 0;
+        int count = x.length;
+        for (double aX : x) {
+            if (Double.isNaN(aX)) {
+                count--;
+            } else {
+                m += aX;
+            }
+        }
+
+        return m / (double) count;
+    }
+
+    /**
+     * compute median
+     *
+     * @param x       list of numbers
+     * @param indices index sorting x
+     * @return median
+     */
+    public static double median(double[] x, int[] indices) {
+
+        int pos = x.length / 2;
+        if (x.length % 2 == 1) {
+            return x[indices[pos]];
+        } else {
+            return (x[indices[pos - 1]] + x[indices[pos]]) / 2.0;
+        }
+    }
+
+    /**
+     * compute the mean squared error
+     *
+     * @param x         list of numbers
+     * @param trueValue truth
+     * @return MSE
+     */
+
+    public static double meanSquaredError(double[] x, double trueValue) {
+
+        if (x == null || x.length == 0) {
+            throw new IllegalArgumentException();
+        }
+
+        double total = 0;
+        for (double sample : x) {
+            total += (sample - trueValue) * (sample - trueValue);
+        }
+        total /= x.length;
+        return total;
+    }
+
+    /**
+     * compute median
+     *
+     * @param x list of numbers
+     * @return median
+     */
+    public static double median(double[] x) {
+
+        if (x == null || x.length == 0) {
+            throw new IllegalArgumentException();
+        }
+
+        int[] indices = new int[x.length];
+        HeapSort.sort(x, indices);
+
+        return median(x, indices);
+    }
+
+
+    /**
+     * compute variance (ML estimator)
+     *
+     * @param x    list of numbers
+     * @param mean assumed mean of x
+     * @return variance of x (ML estimator)
+     */
+    public static double variance(double[] x, double mean) {
+        double var = 0;
+        int count = x.length;
+        for (double aX : x) {
+            if (Double.isNaN(aX)) {
+                count--;
+            } else {
+                double diff = aX - mean;
+                var += diff * diff;
+            }
+        }
+
+        if (count < 2) {
+            count = 1; // to avoid division by zero
+        } else {
+            count = count - 1; // for ML estimate
+        }
+
+        return var / (double) count;
+    }
+
+
+    /**
+     * compute covariance
+     *
+     * @param x list of numbers
+     * @param y list of numbers
+     * @return covariance of x and y
+     */
+    public static double covariance(double[] x, double[] y) {
+
+        return covariance(x, y, mean(x), mean(y), stdev(x), stdev(y));
+    }
+
+    /**
+     * compute covariance
+     *
+     * @param x      list of numbers
+     * @param y      list of numbers
+     * @param xmean  assumed mean of x
+     * @param ymean  assumed mean of y
+     * @param xstdev assumed stdev of x
+     * @param ystdev assumed stdev of y
+     * @return covariance of x and y
+     */
+    public static double covariance(double[] x, double[] y, double xmean, double ymean, double xstdev, double ystdev) {
+
+        if (x.length != y.length) throw new IllegalArgumentException("x and y arrays must be same length!");
+
+        int count = x.length;
+        double covar = 0.0;
+        for (int i = 0; i < x.length; i++) {
+            if (Double.isNaN(x[i]) || Double.isNaN(y[i])) {
+                count--;
+            } else {
+                covar += (x[i] - xmean) * (y[i] - ymean);
+            }
+        }
+        covar /= count;
+        covar /= (xstdev * ystdev);
+        return covar;
+    }
+
+    /**
+     * compute fisher skewness
+     *
+     * @param x list of numbers
+     * @return skewness of x
+     */
+    public static double skewness(double[] x) {
+
+        double mean = mean(x);
+        double stdev = stdev(x);
+        double skew = 0.0;
+        double len = x.length;
+
+        for (double xv : x) {
+            double diff = xv - mean;
+            diff /= stdev;
+
+            skew += (diff * diff * diff);
+        }
+
+        skew *= (len / ((len - 1) * (len - 2)));
+
+        return skew;
+    }
+
+    /**
+     * compute standard deviation
+     *
+     * @param x list of numbers
+     * @return standard deviation of x
+     */
+    public static double stdev(double[] x) {
+        return Math.sqrt(variance(x));
+    }
+
+    /**
+     * compute variance (ML estimator)
+     *
+     * @param x list of numbers
+     * @return variance of x (ML estimator)
+     */
+    public static double variance(double[] x) {
+        final double m = mean(x);
+        return variance(x, m);
+    }
+
+
+    /**
+     * compute variance of sample mean (ML estimator)
+     *
+     * @param x    list of numbers
+     * @param mean assumed mean of x
+     * @return variance of x (ML estimator)
+     */
+    public static double varianceSampleMean(double[] x, double mean) {
+        return variance(x, mean) / (double) x.length;
+    }
+
+    /**
+     * compute variance of sample mean (ML estimator)
+     *
+     * @param x list of numbers
+     * @return variance of x (ML estimator)
+     */
+    public static double varianceSampleMean(double[] x) {
+        return variance(x) / (double) x.length;
+    }
+
+
+    /**
+     * compute the q-th quantile for a distribution of x
+     * (= inverse cdf)
+     *
+     * @param q       quantile (0 < q <= 1)
+     * @param x       discrete distribution (an unordered list of numbers)
+     * @param indices index sorting x
+     * @return q-th quantile
+     */
+    public static double quantile(double q, double[] x, int[] indices) {
+        if (q < 0.0 || q > 1.0) throw new IllegalArgumentException("Quantile out of range");
+
+        if (q == 0.0) {
+            // for q==0 we have to "invent" an entry smaller than the smallest x
+
+            return x[indices[0]] - 1.0;
+        }
+
+        return x[indices[(int) Math.ceil(q * indices.length) - 1]];
+    }
+
+    /**
+     * compute the q-th quantile for a distribution of x
+     * (= inverse cdf)
+     *
+     * @param q quantile (0 <= q <= 1)
+     * @param x discrete distribution (an unordered list of numbers)
+     * @return q-th quantile
+     */
+    public static double quantile(double q, double[] x) {
+        int[] indices = new int[x.length];
+        HeapSort.sort(x, indices);
+
+        return quantile(q, x, indices);
+    }
+
+    /**
+     * compute the q-th quantile for a distribution of x
+     * (= inverse cdf)
+     *
+     * @param q     quantile (0 <= q <= 1)
+     * @param x     discrete distribution (an unordered list of numbers)
+     * @param count use only first count entries in x
+     * @return q-th quantile
+     */
+    public static double quantile(double q, double[] x, int count) {
+        int[] indices = new int[count];
+        HeapSort.sort(x, indices);
+
+        return quantile(q, x, indices);
+    }
+
+    /**
+     * Determine the highest posterior density for a list of values.
+     * The HPD is the smallest interval containing the required amount of elements.
+     *
+     * @param proportion of elements inside the interval
+     * @param x          values
+     * @param indices    index sorting x
+     * @return the interval, an array of {low, high} values.
+     */
+    public static double[] HPDInterval(double proportion, double[] x, int[] indices) {
+
+        double minRange = Double.MAX_VALUE;
+        int hpdIndex = 0;
+
+        final int diff = (int) Math.round(proportion * (double) x.length);
+        for (int i = 0; i <= (x.length - diff); i++) {
+            final double minValue = x[indices[i]];
+            final double maxValue = x[indices[i + diff - 1]];
+            final double range = Math.abs(maxValue - minValue);
+            if (range < minRange) {
+                minRange = range;
+                hpdIndex = i;
+            }
+        }
+
+        return new double[]{x[indices[hpdIndex]], x[indices[hpdIndex + diff - 1]]};
+    }
+
+    /**
+     * compute the cumulative probability Pr(x <= z) for a given z
+     * and a distribution of x
+     *
+     * @param z       threshold value
+     * @param x       discrete distribution (an unordered list of numbers)
+     * @param indices index sorting x
+     * @return cumulative probability
+     */
+    public static double cdf(double z, double[] x, int[] indices) {
+        int i;
+        for (i = 0; i < x.length; i++) {
+            if (x[indices[i]] > z) break;
+        }
+
+        return (double) i / (double) x.length;
+    }
+
+    /**
+     * compute the cumulative probability Pr(x <= z) for a given z
+     * and a distribution of x
+     *
+     * @param z threshold value
+     * @param x discrete distribution (an unordered list of numbers)
+     * @return cumulative probability
+     */
+    public static double cdf(double z, double[] x) {
+        int[] indices = new int[x.length];
+        HeapSort.sort(x, indices);
+
+        return cdf(z, x, indices);
+    }
+
+    public static double max(double[] x) {
+        double max = x[0];
+        for (int i = 1; i < x.length; i++) {
+            if (x[i] > max) max = x[i];
+        }
+        return max;
+    }
+
+    public static double min(double[] x) {
+        double min = x[0];
+        for (int i = 1; i < x.length; i++) {
+            if (x[i] < min) min = x[i];
+        }
+        return min;
+    }
+
+    public static double geometricMean(double[] x) {
+        double gm = 0;
+        int len = x.length;
+        for (int i = 0; i < len; i++) {
+            gm += Math.log(x[i]);
+        }
+
+        return Math.exp(gm / (double) len);
+    }
+}
diff --git a/src/beast/math/statistic/RPNcalculator.java b/src/beast/math/statistic/RPNcalculator.java
new file mode 100644
index 0000000..3107179
--- /dev/null
+++ b/src/beast/math/statistic/RPNcalculator.java
@@ -0,0 +1,157 @@
+package beast.math.statistic;
+
+
+
+import java.util.Map;
+import java.util.List;
+import java.util.HashMap;
+import java.util.ArrayList;
+import java.io.PrintStream;
+
+import beast.core.*;
+import beast.core.parameter.Parameter;
+
+
+/**
+ * A statistic based on evaluating simple expressions.
+ * <p/>
+ * The expressions are in RPN, so no parsing issues. whitespace separated. Variables (other statistics),
+ * constants and operations. Currently just the basic four, but easy to extend.
+ *
+ * @author Joseph Heled in beast1, migrated to beast2 by Denise Kuehnert
+ */
+ at Description("RPN calculator to evaluate simple expressions of parameters (Reverse Polish notation is a mathematical notation wherein every operator follows its operands)")
+public class RPNcalculator extends CalculationNode implements Loggable, Function {
+
+
+    public Input<String> strExpressionInput = new Input<String>("expression", "Expressions needed for the calculations", Input.Validate.REQUIRED);
+    public Input<List<Parameter>> parametersInput = new Input<List<Parameter>>("parameter", "Parameters needed for the calculations", new ArrayList<Parameter>());
+
+    private RPNexpressionCalculator[] expressions;
+    private List<String> names;
+
+    private Map variables;
+    RPNexpressionCalculator.GetVariable[] vars;
+    int dim;
+
+    public void initAndValidate() throws Exception {
+
+        names = new ArrayList<String>();
+        dim = parametersInput.get().get(0).getDimension();
+
+        int pdim;
+
+        for (final Parameter p : parametersInput.get()) {
+
+            pdim = p.getDimension();
+
+            if (pdim != dim && dim != 1 && pdim != 1) {
+                throw new Exception("error: all parameters have to have same length or be of dimension 1.");
+            }
+            if (pdim > dim) dim = pdim;
+
+            expressions = new RPNexpressionCalculator[dim];
+            names.add(p.toString());
+
+            for (int i = 0; i < pdim; i++) {
+
+                variables = new HashMap<String, Double[]>();
+
+                variables.put(p.getID(), p.getValues());
+            }
+        }
+
+        vars = new RPNexpressionCalculator.GetVariable[dim];
+
+        for (int i = 0; i < dim; i++) {
+            final int index = i;
+            vars[i] = new RPNexpressionCalculator.GetVariable() {
+                public double get(final String name) {
+                    final Object[] values = ((Object[]) variables.get(name));
+                    if (values[0] instanceof Boolean)
+                        return ((Boolean) values[values.length > 1 ? index : 0] ? 1. : 0.);
+                    if (values[0] instanceof Integer)
+                        return (Integer) values[values.length > 1 ? index : 0];
+                    return (Double) values[values.length > 1 ? index : 0];
+                }
+            };
+        }
+
+        String err;
+        for (int i = 0; i < dim; i++) {
+            expressions[i] = new RPNexpressionCalculator(strExpressionInput.get());
+
+            err = expressions[i].validate();
+            if (err != null) {
+                throw new RuntimeException("Error in expression: " + err);
+            }
+        }
+    }
+
+    private void updateValues() {
+        for (Parameter p : parametersInput.get()) {
+            for (int i = 0; i < p.getDimension(); i++) {
+                variables.put(p.getID(), p.getValues());
+            }
+        }
+    }
+
+    public int getDimension() {
+        return dim;
+    }
+
+
+    // todo: add dirty flag to avoid double calculation!!! 
+    @Override
+    public double getArrayValue() {
+        return getStatisticValue(0);
+    }
+
+    @Override
+    public double getArrayValue(final int i) {
+        return getStatisticValue(i);
+    }
+
+//    public String getDimensionName(final int dim) {
+//        return names.get(dim);
+//    }
+
+    /**
+     * @return the value of the expression
+     */
+    public double getStatisticValue(final int i) {
+        updateValues();
+        return expressions[i].evaluate(vars[i]);
+    }
+
+
+    @Override
+    public void init(final PrintStream out) throws Exception {
+        if (dim == 1)
+            out.print(this.getID() + "\t");
+        else
+            for (int i = 0; i < dim; i++)
+                out.print(this.getID() + "_" + i + "\t");
+    }
+
+    @Override
+    public void log(final int nSample, final PrintStream out) {
+        for (int i = 0; i < dim; i++)
+            out.print(getStatisticValue(i) + "\t");
+    }
+
+    @Override
+    public void close(final PrintStream out) {
+        // nothing to do
+    }
+
+    public List<String> getArguments() {
+        final List<String> arguments = new ArrayList<String>();
+        for (final Parameter par : parametersInput.get()) {
+            arguments.add(par.getID());
+        }
+        return arguments;
+    }
+
+
+}
\ No newline at end of file
diff --git a/src/beast/math/statistic/RPNexpressionCalculator.java b/src/beast/math/statistic/RPNexpressionCalculator.java
new file mode 100644
index 0000000..71e4cb0
--- /dev/null
+++ b/src/beast/math/statistic/RPNexpressionCalculator.java
@@ -0,0 +1,199 @@
+package beast.math.statistic;
+
+
+import java.util.Stack;
+
+import beast.core.Description;
+
+
+/**
+ * Simple RPN expression evaluator.
+ * <p/>
+ * Limitations:
+ * - variables are statistics of 1 dimension.
+ * - Four basic operations (easy to extend, though)
+ *
+ * @author Joseph Heled in beast1, migrated to beast2 by Denise Kuehnert
+ *         Date: 10/05/2008
+ */
+ at Description("RPN calculator to evaluate simple expressions of parameters - evaluating the expressions from RPNCalculator (Reverse Polish notation is a mathematical notation wherein every operator follows its operands)")
+public class RPNexpressionCalculator {
+    /**
+     * Interface for variable access by name
+     */
+    public interface GetVariable {
+        /**
+         * @param name
+         * @return variable value
+         */
+        double get(String name);
+    }
+
+    private enum OP {OP_ADD, OP_SUB, OP_MULT, OP_DIV, OP_LOG, OP_EXP, OP_CHS, OP_CONST, OP_REF}
+
+    private class Eelement {
+        OP op;
+        String name;
+        private double value;
+
+        Eelement(OP op) {
+            this.op = op;
+            name = null;
+        }
+
+        Eelement(String name) {
+            this.op = OP.OP_REF;
+            this.name = name;
+        }
+
+        Eelement(double val) {
+            this.op = OP.OP_CONST;
+            this.value = val;
+        }
+    }
+
+    Eelement[] expression;
+
+    public RPNexpressionCalculator(String expressionString) {
+        String[] tokens = expressionString.trim().split("\\s+");
+
+        expression = new Eelement[tokens.length];
+
+        for (int k = 0; k < tokens.length; ++k) {
+            String tok = tokens[k];
+            Eelement element;
+            if (tok.equals("+")) {
+                element = new Eelement(OP.OP_ADD);
+            } else if (tok.equals("-")) {
+                element = new Eelement(OP.OP_SUB);
+            } else if (tok.equals("*")) {
+                element = new Eelement(OP.OP_MULT);
+            } else if (tok.equals("/")) {
+                element = new Eelement(OP.OP_DIV);
+            } else if (tok.equals("log")) {
+                element = new Eelement(OP.OP_LOG);
+            } else if (tok.equals("exp")) {
+                element = new Eelement(OP.OP_EXP);
+            } else if (tok.equals("chs")) {
+                element = new Eelement(OP.OP_CHS);
+            } else {
+                try {
+                    double val = Double.parseDouble(tok);
+                    element = new Eelement(val);
+                } catch (java.lang.NumberFormatException ex) {
+                    element = new Eelement(tok);
+                }
+            }
+            expression[k] = element;
+        }
+    }
+
+    /**
+     * @param variables
+     * @return evaluate expression given context (i.e. variables)
+     */
+    public double evaluate(GetVariable variables) {
+        Stack<Double> stack = new Stack<Double>();
+
+        for (Eelement elem : expression) {
+            switch (elem.op) {
+                case OP_ADD: {
+                    final Double y = stack.pop();
+                    final Double x = stack.pop();
+                    stack.push(x + y);
+                    break;
+                }
+                case OP_SUB: {
+                    final Double y = stack.pop();
+                    final Double x = stack.pop();
+                    stack.push(x - y);
+                    break;
+                }
+                case OP_MULT: {
+                    final Double y = stack.pop();
+                    final Double x = stack.pop();
+                    stack.push(x * y);
+                    break;
+                }
+                case OP_DIV: {
+                    final Double y = stack.pop();
+                    final Double x = stack.pop();
+                    stack.push(x / y);
+                    break;
+                }
+                case OP_CHS: {
+                    final Double x = stack.pop();
+                    stack.push(-x);
+                    break;
+                }
+                case OP_LOG: {
+                    final Double x = stack.pop();
+                    if (x <= 0.0) {
+                        return Double.NaN;
+                    }
+                    stack.push(Math.log(x));
+                    break;
+                }
+                case OP_EXP: {
+                    final Double x = stack.pop();
+                    stack.push(Math.exp(x));
+                    break;
+                }
+                case OP_CONST: {
+                    stack.push(elem.value);
+                    break;
+                }
+                case OP_REF: {
+                    stack.push(variables.get(elem.name));
+                    break;
+                }
+            }
+        }
+
+        return stack.pop();
+    }
+
+    /**
+     * @return null if all ok, error message otherwise
+     */
+    public String validate() {
+        int stackSize = 0;
+
+        for (Eelement elem : expression) {
+            switch (elem.op) {
+                case OP_ADD:
+                case OP_SUB:
+                case OP_MULT:
+                case OP_DIV: {
+                    if (stackSize < 2) {
+                        return "Binary operator underflow";
+                    }
+                    stackSize -= 1;
+                    break;
+                }
+                case OP_CHS:
+                case OP_LOG:
+                case OP_EXP: {
+                    if (stackSize == 0) {
+                        return "Unary operator underflow";
+                    }
+                    break;
+                }
+                case OP_CONST: {
+                    stackSize += 1;
+                    break;
+                }
+                case OP_REF: {
+                    stackSize += 1;
+                    break;
+                }
+            }
+        }
+
+        if (stackSize != 1) {
+            return "Stack size " + stackSize + " ( != 1 ) at end of expression evaluation";
+        }
+
+        return null;
+    }
+}
diff --git a/src/beast/util/AddOnManager.java b/src/beast/util/AddOnManager.java
new file mode 100644
index 0000000..ed2a965
--- /dev/null
+++ b/src/beast/util/AddOnManager.java
@@ -0,0 +1,1186 @@
+/*
+ * File AddOnManager.java
+ *
+ * Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+ *
+ * This file is part of BEAST2.
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership and licensing.
+ *
+ * BEAST 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
+ * of the License, or (at your option) any later version.
+ *
+ *  BEAST 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 BEAST; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+/*
+ * Parts copied from WEKA ClassDiscovery.java
+ * Copyright (C) 2005 University of Waikato, Hamilton, New Zealand
+ *
+ */
+
+package beast.util;
+
+
+import beast.app.BEASTVersion;
+import beast.app.util.Arguments;
+import beast.app.util.Utils;
+import beast.core.Description;
+import beast.core.util.Log;
+import beast.evolution.alignment.Alignment;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+import javax.swing.*;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import java.io.*;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.nio.channels.Channels;
+import java.nio.channels.ReadableByteChannel;
+import java.util.*;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+import java.util.jar.JarInputStream;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
+/**
+ * This class is used to manage beast 2 add-ons, and can
+ * - install a new add on
+ * - un-install an add on
+ * - list directories that may contain add ons
+ * - load jars from installed add ons
+ * - discover classes in add ons that implement a certain interface or a derived from a certain class
+ */
+// TODO: on windows allow installation on drive D: and pick up add-ons in drive C:
+ at Description("Manage all BEAUti packages and list their dependencies")
+public class AddOnManager {
+    public static final BEASTVersion beastVersion = new BEASTVersion();
+
+    public final static String[] IMPLEMENTATION_DIR = {"beast", "snap"};
+    public final static String TO_DELETE_LIST_FILE = "toDeleteList";
+    //configuration file
+    public final static String PACKAGES_XML = "https://raw.githubusercontent.com/CompEvol/CBAN/master/packages" + beastVersion.getVersion() + ".xml";
+
+    public static final String INSTALLED = "installed";
+    public static final String NOT_INSTALLED = "un-installed";
+    
+    public static final String NO_CONNECTION_MESSAGE = "Could not get an internet connection. "
+    		+ "The BEAST Pacakage Manager needs internet access in order to list available packages and download them for installation. "
+    		+ "Possibly, some software (like security software, or a firewall) blocks the BEAST Pacakage Manager.  "
+    		+ "If so, you need to reconfigure such software to allow access.";
+    		
+
+    /**
+     * flag indicating add ons have been loaded at least once *
+     */
+    static boolean externalJarsLoaded = false;
+
+
+    /**
+     * list of all classes found in the class path *
+     */
+    private static List<String> all_classes;
+
+    /**
+     * @return URLs containing list of downloadable packages.
+     * @throws java.net.MalformedURLException
+     */
+    public static List<String> getPackagesURL() throws MalformedURLException {
+        // Java 7 introduced SNI support which is enabled by default.
+        // http://stackoverflow.com/questions/7615645/ssl-handshake-alert-unrecognized-name-error-since-upgrade-to-java-1-7-0
+        System.setProperty("jsse.enableSNIExtension", "false");
+
+        List<String> URLs = new ArrayList<String>();
+        URLs.add(PACKAGES_XML);
+
+        File beastProps = new File(getPackageUserDir() + "/beauti.properties");
+        // check beast.properties file exists in package directory
+        if (beastProps.exists()) {
+            Properties prop = new Properties();
+
+            try {
+                //load a properties file
+                prop.load(new FileInputStream(beastProps));
+
+                //# url
+                //packages.url=http://...
+                if (prop.containsKey("packages.url")) {
+                    for (String userURL : prop.getProperty("packages.url").split(","))
+                        URLs.add(userURL.trim());
+                }
+
+            } catch (IOException ex) {
+                ex.printStackTrace();
+            }
+        }
+
+        return URLs;
+    }
+    
+    /**
+     * Write any third-party package repository URLs to the options file.
+     * 
+     * @param URLs List of URLs.  The first is assumed to be the central
+     * package repository and is thus ignored.
+     */
+    public static void savePackageURLs(List<String> URLs) {
+        if (URLs.size()<1)
+            return;
+        
+        File propsFile = new File(getPackageUserDir() + "/beauti.properties");
+        Properties prop = new Properties();
+
+        //Load or create properties file
+        if (propsFile.exists()) {
+            try {
+                prop.load(new FileInputStream(propsFile));
+            } catch (IOException ex) {
+                ex.printStackTrace();
+            }
+        } else {
+            try {
+                propsFile.createNewFile();
+            } catch (IOException ex) {
+                ex.printStackTrace();
+            }
+        }
+        
+        // Modify property
+        if (URLs.size()>1) {
+            StringBuilder sb = new StringBuilder("");
+            for (int i=1; i<URLs.size(); i++) {
+                if (i>1)
+                    sb.append(",");
+                sb.append(URLs.get(i));
+            }
+            
+            prop.setProperty("packages.url", sb.toString());
+        } else {
+            prop.remove("packages.url");
+        }
+
+        // Write properties file
+        try {
+            prop.store(new FileOutputStream(propsFile),
+                    "Automatically-generated by BEAUti.\n");
+        } catch (IOException ex) {
+            Logger.getLogger(AddOnManager.class.getName()).log(Level.SEVERE, null, ex);
+        }
+    }
+
+    /**
+     * create list of packages. The list is downloaded from a beast2 wiki page and
+     * parsed.
+     *
+     * @return list of packages, encoded as pairs of description, urls.
+     * @throws java.io.IOException
+     * @throws javax.xml.parsers.ParserConfigurationException
+     * @throws org.xml.sax.SAXException
+     */
+    public static List<Package> getPackages() throws IOException, ParserConfigurationException, SAXException {
+
+        List<Package> packages = new ArrayList<Package>();
+        List<String> sURLs = getPackagesURL();
+
+        for (String sURL : sURLs) {
+            URL url = new URL(sURL);
+            InputStream is = url.openStream(); // throws an IOException
+
+            if (sURL.endsWith(".xml")) {
+                addPackages(is, packages);
+            } 
+
+            is.close();
+
+//            write package xml page, if received from internet
+        }
+        
+        // Ensure package list is in alphabetical order
+        Collections.sort(packages, new Comparator<Package>() {
+
+            @Override
+            public int compare(Package p1, Package p2) {
+                return p1.packageName.toLowerCase().compareTo(p2.packageName.toLowerCase());
+            }
+        });
+        
+        return packages;
+    }
+
+    public static void addPackages(InputStream is, List<Package> packages) throws ParserConfigurationException, IOException, SAXException {
+
+        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+        DocumentBuilder builder = factory.newDocumentBuilder();
+        Document document = builder.parse(new InputSource(is));
+
+        Element rootElement = document.getDocumentElement(); // <packages>
+        NodeList nodes = rootElement.getChildNodes();
+
+        for(int i = 0; i < nodes.getLength(); i++){
+            Node node = nodes.item(i);
+
+            if(node instanceof Element){
+                Package aPackage = new Package((Element) node);
+                if (!containsPackage(aPackage.packageName, packages))
+                    packages.add(aPackage);
+                else
+                    message("Multiple packages with name "
+                            + "'" + aPackage.packageName + "' "
+                            + "found in repositories.  Selecting first (version "
+                            + getPackage(aPackage.packageName, packages).latestVersion
+                            + ").");
+            }
+
+        } // end for i
+
+    }
+
+    public static Package getPackage(String packageName, List<Package> packages) {
+        for (Package aPackage : packages) {
+            if (packageName.equalsIgnoreCase(aPackage.packageName))
+                return aPackage;
+        }
+        return null;
+    }
+
+    public static boolean containsPackage(String packageName, List<Package> packages) {
+        for (Package aPackage : packages) {
+            if (packageName.equalsIgnoreCase(aPackage.packageName))
+                return true;
+        }
+        return false;
+    }
+
+    /**
+     * download and unzip package from URL provided It is assumed the package
+     * consists of a zip file containing directories /lib with jars used by the
+     * add on /templates with beauti XML templates
+     *
+     *
+     * @param aPackage
+     * @param useAppDir if false, use user directory, otherwise use application directory
+     * @param customDir
+     * @param packages  if not null, install all dependent packages of aPackage, but not work for customDir != null
+     * @throws Exception
+     */
+    public static String installPackage(Package aPackage, boolean useAppDir, String customDir, List<Package> packages) throws Exception {
+        if (!aPackage.url.toLowerCase().endsWith(".zip")) {
+            throw new Exception("Package should be packaged in a zip file");
+        }
+//        String sName = URL2PackageName(sURL); // not safe to use
+        String sName = aPackage.packageName;
+
+        // install all dependent packages
+        if (customDir == null && packages != null) {
+            for (PackageDependency packageDependency : aPackage.dependencies) {
+                String s = packageDependency.dependson;
+                if (!s.equals("beast2")) {
+                    Package pDent = getPackage(s, packages);
+                    installPackage(pDent, useAppDir, null, packages);
+                }
+            }
+        }
+
+        // create directory
+        URL templateURL = new URL(aPackage.url);
+        ReadableByteChannel rbc = Channels.newChannel(templateURL.openStream());
+        String sDir = (useAppDir ? getPackageSystemDir() : getPackageUserDir()) + "/" + sName;
+        if (customDir != null) {
+            sDir = customDir + "/" + sName;
+        }
+        File dir = new File(sDir);
+        if (!dir.exists()) {
+            if (!dir.mkdirs()) {
+                throw new Exception("Could not create template directory " + sDir);
+            }
+        }
+        // grab file from URL
+        String sZipFile = sDir + "/" + sName + ".zip";
+        FileOutputStream fos = new FileOutputStream(sZipFile);
+        fos.getChannel().transferFrom(rbc, 0, 1 << 24);
+
+        // unzip archive
+        doUnzip(sZipFile, sDir);
+        // refresh classes
+        loadExternalJars();
+        return sDir;
+    }
+
+    public static String uninstallPackage(Package aPackage, boolean useAppDir, String customDir, List<Package> packages, boolean autoUninstall) throws Exception {
+        if (!aPackage.url.toLowerCase().endsWith(".zip")) {
+            throw new Exception("Package should be packaged in a zip file");
+        }
+//        String sName = URL2PackageName(sURL);
+        String sName = aPackage.packageName;
+
+        // uninstall all dependent packages
+        if (customDir == null && packages != null) {
+            for (Package p : packages) {
+                if (p.dependsOn(aPackage.packageName) && p.isInstalled()) {
+                    if (autoUninstall) {
+                        uninstallPackage(p, useAppDir, null, packages, true);
+                    } else {
+                        warning("Installed package (" + p.packageName + ") depends on the package (" + aPackage.packageName + "),\n" +
+                                "which will not work if " + aPackage.packageName + "is uninstalled.");
+                        return null;
+                    }
+                }
+            }
+        }
+
+        String sDir = (useAppDir ? getPackageSystemDir() : getPackageUserDir()) + "/" + sName;
+        if (customDir != null) {
+            sDir = customDir + "/" + sName;
+        }
+        File dir = new File(sDir);
+        List<File> deleteFailed = new ArrayList<File>();
+        deleteRecursively(dir, deleteFailed);
+
+        // write deleteFailed to file
+        if (deleteFailed.size() > 0) {
+            File toDeleteList = getToDeleteListFile();
+            FileWriter outfile= new FileWriter(toDeleteList, true);
+            for (File file : deleteFailed) {
+                outfile.write(file.getAbsolutePath() + "\n");
+            }
+            outfile.close();
+        }
+        return sDir;
+    }
+
+    public static boolean checkIsInstalled(String packageName) {
+        boolean isInstalled = false;
+        List<String> sBeastDirs = getBeastDirectories();
+        for (String sDir : sBeastDirs) {
+            File f = new File(sDir + "/" + packageName);
+            if (f.exists()) {
+                isInstalled = true;
+            }
+        }
+        return isInstalled;
+    }
+
+    /** pretty format aPackage information in list of string form as produced by getAddOns() **/
+    public static String formatPackageInfo(Package aPackage) {
+        StringBuffer buf = new StringBuffer();
+        buf.append(aPackage.packageName);
+        if (aPackage.packageName.length() < 12) {
+            buf.append("             ".substring(aPackage.packageName.length()));
+        }
+        buf.append(" (");
+        if (aPackage.isInstalled()) {
+            buf.append("v");
+        }
+        buf.append(aPackage.getStatus());
+        buf.append(") : latest version " + aPackage.latestVersion);
+        buf.append((aPackage.getDependenciesString().length() > 0 ? " : depends on " + aPackage.getDependenciesString() : ""));
+        buf.append(" : " + aPackage.description.trim());
+        return buf.toString();
+    }
+
+    private static void deleteRecursively(File file, List<File> deleteFailed) {
+        if (file.isDirectory()) {
+            File[] files = file.listFiles();
+            for (File f : files) {
+                deleteRecursively(f, deleteFailed);
+            }
+        }
+        if (!file.delete()) {
+            deleteFailed.add(file);
+        }
+    }
+
+
+    /**
+     * unzip zip archive *
+     */
+    public static void doUnzip(String inputZip, String destinationDirectory) throws IOException {
+        int BUFFER = 2048;
+        File sourceZipFile = new File(inputZip);
+        File unzipDestinationDirectory = new File(destinationDirectory);
+
+        // Open Zip file for reading
+        ZipFile zipFile = new ZipFile(sourceZipFile, ZipFile.OPEN_READ);
+
+        // Create an enumeration of the entries in the zip file
+        Enumeration<?> zipFileEntries = zipFile.entries();
+
+        // Process each entry
+        while (zipFileEntries.hasMoreElements()) {
+            // grab a zip file entry
+            ZipEntry entry = (ZipEntry) zipFileEntries.nextElement();
+
+            String currentEntry = entry.getName();
+
+            File destFile = new File(unzipDestinationDirectory + "/" + currentEntry);
+
+            // grab file's parent directory structure
+            File destinationParent = destFile.getParentFile();
+
+            // create the parent directory structure if needed
+            destinationParent.mkdirs();
+
+            try {
+                // extract file if not a directory
+                if (!entry.isDirectory()) {
+                    BufferedInputStream is = new BufferedInputStream(zipFile.getInputStream(entry));
+                    int currentByte;
+                    // establish buffer for writing file
+                    byte data[] = new byte[BUFFER];
+
+                    // write the current file to disk
+                    FileOutputStream fos = new FileOutputStream(destFile);
+                    BufferedOutputStream dest = new BufferedOutputStream(fos, BUFFER);
+
+                    // read and write until last byte is encountered
+                    while ((currentByte = is.read(data, 0, BUFFER)) != -1) {
+                        dest.write(data, 0, currentByte);
+                    }
+                    dest.flush();
+                    dest.close();
+                    is.close();
+                }
+            } catch (IOException ioe) {
+                ioe.printStackTrace();
+            }
+        }
+        zipFile.close();
+    }
+
+    /**
+     * @return directory where to install packages for users *
+     */
+    public static String getPackageUserDir() {
+        
+        if (System.getProperty("beast.user.package.dir") != null)
+            return System.getProperty("beast.user.package.dir");
+        
+        if (Utils.isWindows()) {
+            return System.getProperty("user.home") + "\\BEAST\\" + beastVersion.getMajorVersion();
+        }
+        if (Utils.isMac()) {
+            return System.getProperty("user.home") + "/Library/Application Support/BEAST/" + beastVersion.getMajorVersion();
+        }
+        // Linux and unices
+        return System.getProperty("user.home") + "/.beast/" + beastVersion.getMajorVersion();
+    }
+
+    /**
+     * @return directory where system wide packages reside *
+     */
+    public static String getPackageSystemDir() {
+        
+        if (System.getProperty("beast.system.package.dir") != null)
+            return System.getProperty("beast.system.package.dir");
+        
+        if (Utils.isWindows()) {
+            return "\\Program Files\\BEAST\\" + beastVersion.getMajorVersion();
+        }
+        if (Utils.isMac()) {
+            return "/Library/Application Support/BEAST/" + beastVersion.getMajorVersion();
+        }
+        return "/usr/local/share/beast/" + beastVersion.getMajorVersion();
+    }
+
+    /**
+     * @return file containing list of files that need to be deleted
+     * but could not be deleted. This can happen when uninstalling packages
+     * on windows, which locks jar files loaded by java.
+     */
+    public static File getToDeleteListFile() {
+        return new File(getPackageUserDir() + "/" + TO_DELETE_LIST_FILE);
+    }
+
+    /**
+     * return list of directories that may contain packages *
+     */
+    public static List<String> getBeastDirectories() {
+        List<String> sDirs = new ArrayList<>();
+        // check if there is the BEAST environment variable is set
+        if (System.getProperty("BEAST_ADDON_PATH") != null) {
+            String sBEAST = System.getProperty("BEAST_ADDON_PATH");
+            for (String sDir : sBEAST.split(":")) {
+                sDirs.add(sDir);
+            }
+        }
+        if (System.getenv("BEAST_ADDON_PATH") != null) {
+            String sBEAST = System.getenv("BEAST_ADDON_PATH");
+            for (String sDir : sBEAST.split(":")) {
+                sDirs.add(sDir);
+            }
+        }
+
+        // add user package directory
+        sDirs.add(getPackageUserDir());
+        // add application package directory
+        sDirs.add(getPackageSystemDir());
+
+        // pick up directories in class path, useful when running in an IDE
+        String strClassPath = System.getProperty("java.class.path");
+        String [] paths = strClassPath.split(":");
+        for (String path : paths) {
+            if (!path.endsWith(".jar")) {
+                path = path.replaceAll("\\\\","/");
+                if (path.contains("/")) {
+                    path = path.substring(0, path.lastIndexOf("/"));
+                    // deal with the way Mac's appbundler sets up paths
+                  	path = path.replaceAll("/[^/]*/Contents/Java", "");
+                    // exclude Intellij build path out/production
+                    if (!sDirs.contains(path) && !path.contains("production")) {
+                        sDirs.add(path);
+                    }
+                }
+            }
+        }
+
+
+        // subdirectories that look like they may contain an package
+        // this is detected by checking the subdirectory contains a lib or
+        // templates directory
+        List<String> sSubDirs = new ArrayList<>();
+        for (String sDir : sDirs) {
+            File dir = new File(sDir);
+            if (dir.isDirectory()) {
+                File[] files = dir.listFiles();
+                if (files == null)
+                    continue;
+
+                for (File file : files) {
+                    if (file.isDirectory()) {
+                        File versionFile = new File(file, "version.xml");
+                        if (versionFile.exists())
+                            sSubDirs.add(file.getAbsolutePath());
+                    }
+                }
+            }
+        }
+        // check version dependencies
+
+
+        sDirs.addAll(sSubDirs);
+
+        return sDirs;
+    } // getBeastDirectories
+
+    /**
+     * load external jars in beast directories *
+     */
+    public static void loadExternalJars() throws Exception {
+        processDeleteList();
+
+        List<String> sDirs = getBeastDirectories();
+        checkDependencies(sDirs);
+        for (String sJarDir : sDirs) {
+            File versionFile = new File(sJarDir + "/version.xml");
+            if (versionFile.exists()) {
+                try {
+                    // print name and version of package
+                    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+                    Document doc = factory.newDocumentBuilder().parse(versionFile);
+                    Element addon = doc.getDocumentElement();
+                    Log.info.println("Loading package " + addon.getAttribute("name") + " v" + addon.getAttribute("version"));
+                } catch (Exception e) {
+                	// too bad, won't print out any info
+                }
+            }
+            File jarDir = new File(sJarDir + "/lib");
+            if (!jarDir.exists()) {
+                jarDir = new File(sJarDir + "\\lib");
+            }
+            if (jarDir.exists() && jarDir.isDirectory()) {
+                for (String sFile : jarDir.list()) {
+                    if (sFile.endsWith(".jar")) {
+                        Log.debug.print("Probing: " + sFile + " ");
+                        // check that we are not reload existing classes
+                        String loadedClass = null;
+                        try {
+                            JarInputStream jarFile = new JarInputStream
+                                    (new FileInputStream(jarDir.getAbsolutePath() + "/" + sFile));
+                            JarEntry jarEntry;
+
+                            while (loadedClass == null) {
+                                jarEntry = jarFile.getNextJarEntry();
+                                if (jarEntry == null) {
+                                    break;
+                                }
+                                if ((jarEntry.getName().endsWith(".class"))) {
+                                    String className = jarEntry.getName().replaceAll("/", "\\.");
+                                    className = className.substring(0, className.lastIndexOf('.'));
+                                    try {
+                                        Object o = Class.forName(className);
+                                        loadedClass = className;
+                                    } catch (Exception e) {
+                                        // TODO: handle exception
+                                    }
+                                }
+                            }
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+
+
+                        @SuppressWarnings("deprecation")
+                        URL url = new File(jarDir.getAbsolutePath() + "/" + sFile).toURL();
+                        if (loadedClass == null) {
+                            addURL(url);
+                        } else {
+                            Log.debug.println("Skip loading " + url + ": contains class " + loadedClass + " that is already loaded");
+                        }
+                    }
+                }
+            }
+        }
+        externalJarsLoaded = true;
+        Alignment.findDataTypes();
+    } // loadExternalJars
+
+
+    /** try to delete files that could not be deleted earlier **/
+    private static void processDeleteList() {
+        File toDeleteLisFile = getToDeleteListFile();
+        if (toDeleteLisFile.exists()) {
+            try {
+                BufferedReader fin = new BufferedReader(new FileReader(toDeleteLisFile));
+                while (fin.ready()) {
+                    String sStr = fin.readLine();
+                    File file = new File(sStr);
+                    file.delete();
+                }
+                fin.close();
+                toDeleteLisFile.delete();
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    /**
+     * go through list of directories collecting version and dependency information for
+     * all packages. Version and dependency info is stored in a file
+     *
+     * @param sDirs
+     */
+    private static void checkDependencies(List<String> sDirs) {
+        HashMap<String, Double> packageVersion = new HashMap<String, Double>();
+        packageVersion.put("beast2", beastVersion.parseVersion(beastVersion.getVersion()));
+        List<PackageDependency> dependencies = new ArrayList<PackageDependency>();
+
+        // gather version and dependency info for all packages
+        for (String sDir : sDirs) {
+            File version = new File(sDir + "/version.xml");
+            if (version.exists()) {
+                try {
+                    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+                    Document doc = factory.newDocumentBuilder().parse(version);
+                    doc.normalize();
+                    // get name and version of package
+                    Element addon = doc.getDocumentElement();
+                    String sAddon = addon.getAttribute("name");
+                    String sAddonVersion = addon.getAttribute("version");
+                    packageVersion.put(sAddon, beastVersion.parseVersion(sAddonVersion));
+
+                    // get dependencies of add-n
+                    NodeList nodes = doc.getElementsByTagName("depends");
+                    for (int i = 0; i < nodes.getLength(); i++) {
+                        Element dependson = (Element) nodes.item(i);
+                        PackageDependency dep = new PackageDependency();
+                        dep.packageName = sAddon;
+                        dep.dependson = dependson.getAttribute("on");
+                        String sAtLeast = dependson.getAttribute("atleast");
+                        dep.setAtLest(sAtLeast);
+                        String sAtMost = dependson.getAttribute("atmost");
+                        dep.setAtMost(sAtMost);
+                        dependencies.add(dep);
+                    }
+
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+
+        // check dependencies
+        for (PackageDependency dep : dependencies) {
+            Double version = packageVersion.get(dep.dependson);
+            if (version == null) {
+                warning("Package " + dep.packageName + " requires another package (" + dep.dependson + ") which is not installed.\n" +
+                        "Either uninstall " + dep.packageName + " or install the " + dep.dependson + " add on.");
+            } else if (version > dep.atMost || version < dep.atLeast) {
+                warning("Package " + dep.packageName + " requires another package (" + dep.dependson + ") with version in range " +
+                        beastVersion.formatVersion(dep.atLeast) + " to " + beastVersion.formatVersion(dep.atMost) + " but " + dep.dependson + " has version " + beastVersion.formatVersion(version) + "\n" +
+                        "Either uninstall " + dep.packageName + " or install the correct version of " + dep.dependson + ".");
+            }
+        }
+    }
+
+    /**
+     * Display a warning to console or as a dialog, depending
+     * on whether a GUI exists.
+     * 
+     * @param string warning to display
+     */
+    private static void warning(String string) {
+        Log.warning.println(string);
+        Log.warning.println("Unexpected behavior may follow!");
+        if (!java.awt.GraphicsEnvironment.isHeadless() && System.getProperty("no.beast.popup") == null) {
+            JOptionPane.showMessageDialog(null, string +
+                    "\nUnexpected behavior may follow!");
+        }
+    }
+    
+    /**
+     * Display a message to console or as a dialog, depending
+     * on whether a GUI exists.
+     * 
+     * @param string message to display
+     */
+    private static void message(String string) {
+    	Log.info.println(string);
+        if (!java.awt.GraphicsEnvironment.isHeadless()) {
+            JOptionPane.showMessageDialog(null, string);
+        }
+    }
+
+    /**
+     * Add URL to CLASSPATH
+     *
+     * @param u URL
+     * @throws IOException if something goes wrong when adding a url
+     */
+    public static void addURL(URL u) throws IOException {
+        // ClassloaderUtil clu = new ClassloaderUtil();
+        AddOnManager clu = new AddOnManager();
+        // URLClassLoader sysLoader = (URLClassLoader)
+        // ClassLoader.getSystemClassLoader();
+        URLClassLoader sysLoader = (URLClassLoader) clu.getClass().getClassLoader();
+        URL urls[] = sysLoader.getURLs();
+        for (int i = 0; i < urls.length; i++) {
+            if (urls[i].toString().toLowerCase().equals(u.toString().toLowerCase())) {
+                Log.debug.println("URL " + u + " is already in the CLASSPATH");
+                return;
+            }
+        }
+        Class<?> sysclass = URLClassLoader.class;
+        try {
+            // Parameters
+            Class<?>[] parameters = new Class[]{URL.class};
+            Method method = sysclass.getDeclaredMethod("addURL", parameters);
+            method.setAccessible(true);
+            method.invoke(sysLoader, new Object[]{u});
+            Log.debug.println("Loaded URL " + u);
+        } catch (Throwable t) {
+            t.printStackTrace();
+            throw new IOException("Error, could not add URL to system classloader");
+        }
+        String classpath = System.getProperty("java.class.path");
+        String sJar = u + "";
+        classpath += System.getProperty("path.separator") + sJar.substring(5);
+        System.setProperty("java.class.path", classpath);
+        all_classes = null;
+    }
+
+
+    private static void loadAllClasses() {
+        if (!externalJarsLoaded) {
+            try {
+                loadExternalJars();
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+
+        all_classes = new ArrayList<String>();
+        String pathSep = System.getProperty("path.separator");
+        String classpath = System.getProperty("java.class.path");
+
+        for (String path : classpath.split(pathSep)) {
+            //Log.debug.println("loadallclasses " + path);
+            File filepath = new File(path);
+
+            if (filepath.isDirectory()) {
+                addDirContent(filepath, filepath.getAbsolutePath().length());
+            } else if (path.endsWith(".jar")) {
+
+                JarFile jar;
+                try {
+                    jar = new JarFile(filepath);
+                } catch (IOException e) {
+                    Log.debug.println("WARNING: " + filepath + " could not be opened!");
+                    continue;
+                }
+
+                for (Enumeration<JarEntry> entries = jar.entries(); entries.hasMoreElements(); ) {
+                    JarEntry entry = entries.nextElement();
+                    if (entry.getName().endsWith(".class")) {
+                        all_classes.add(entry.getName());
+                    }
+                }
+            } else if (path.endsWith(".class")) {
+                all_classes.add(path);
+            } else {
+                Log.debug.println("Warning: corrupt classpath entry: " + path);
+            }
+
+        }
+
+        String fileSep = System.getProperty("file.separator");
+        if (fileSep.equals("\\")) {
+            fileSep = "\\\\";
+        }
+        for (int i = 0; i < all_classes.size(); i++) {
+            String sStr = all_classes.get(i);
+            sStr = sStr.substring(0, sStr.length() - 6);
+            sStr = sStr.replaceAll(fileSep, ".");
+            if (sStr.startsWith(".")) {
+                sStr = sStr.substring(1);
+            }
+            all_classes.set(i, sStr);
+        }
+
+    }
+
+    private static void addDirContent(File dir, int len) {
+        for (File file : dir.listFiles()) {
+            if (file.isDirectory()) {
+                addDirContent(file, len);
+            } else {
+                if (file.getName().endsWith(".class")) {
+                    all_classes.add(file.getAbsolutePath().substring(len));
+                }
+            }
+        }
+
+    }
+
+
+    /**
+     * Checks whether the "otherclass" is a subclass of the given "superclass".
+     *
+     * @param superclass the superclass to check against
+     * @param otherclass this class is checked whether it is a subclass of the the
+     *                   superclass
+     * @return TRUE if "otherclass" is a true subclass
+     */
+    public static boolean isSubclass(Class<?> superclass, Class<?> otherclass) {
+        Class<?> currentclass;
+        boolean result;
+
+        result = false;
+        currentclass = otherclass;
+        do {
+            result = currentclass.equals(superclass);
+
+            // topmost class reached?
+            if (currentclass.equals(Object.class))
+                break;
+
+            if (!result)
+                currentclass = currentclass.getSuperclass();
+        } while (!result);
+
+        return result;
+    }
+
+
+    /**
+     * Checks whether the given class implements the given interface.
+     *
+     * @param intf the interface to look for in the given class
+     * @param cls  the class to check for the interface
+     * @return TRUE if the class contains the interface
+     */
+    public static boolean hasInterface(Class<?> intf, Class<?> cls) {
+        Class<?>[] intfs;
+        int i;
+        boolean result;
+        Class<?> currentclass;
+
+        result = false;
+        currentclass = cls;
+        do {
+            // check all the interfaces, this class implements
+            intfs = currentclass.getInterfaces();
+            for (i = 0; i < intfs.length; i++) {
+                if (intfs[i].equals(intf)) {
+                    result = true;
+                    break;
+                }
+            }
+
+            // get parent class
+            if (!result) {
+                currentclass = currentclass.getSuperclass();
+
+                // topmost class reached or no superclass?
+                if ((currentclass == null) || (currentclass.equals(Object.class)))
+                    break;
+            }
+        } while (!result);
+
+        return result;
+    }
+
+
+    /**
+     * Checks the given packages for classes that inherited from the given
+     * class, in case it's a class, or implement this class, in case it's an
+     * interface.
+     *
+     * @param classname the class/interface to look for
+     * @param pkgnames  the packages to search in
+     * @return a list with all the found classnames
+     */
+    public static List<String> find(String classname, String[] pkgnames) {
+        List<String> result;
+        Class<?> cls;
+
+        result = new ArrayList<String>();
+
+        try {
+            cls = Class.forName(classname);
+            result = find(cls, pkgnames);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return result;
+    }
+
+    /**
+     * Checks the given package for classes that inherited from the given class,
+     * in case it's a class, or implement this class, in case it's an interface.
+     *
+     * @param classname the class/interface to look for
+     * @param pkgname   the package to search in
+     * @return a list with all the found classnames
+     */
+    public static List<String> find(String classname, String pkgname) {
+        List<String> result;
+        Class<?> cls;
+
+        result = new ArrayList<String>();
+
+        try {
+            cls = Class.forName(classname);
+            result = find(cls, pkgname);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return result;
+    }
+
+    /**
+     * Checks the given packages for classes that inherited from the given
+     * class, in case it's a class, or implement this class, in case it's an
+     * interface.
+     *
+     * @param cls      the class/interface to look for
+     * @param pkgnames the packages to search in
+     * @return a list with all the found classnames
+     */
+    public static List<String> find(Class<?> cls, String[] pkgnames) {
+        List<String> result;
+        int i;
+        HashSet<String> names;
+
+        result = new ArrayList<String>();
+
+        names = new HashSet<String>();
+        for (i = 0; i < pkgnames.length; i++) {
+            names.addAll(find(cls, pkgnames[i]));
+        }
+
+        // sort result
+        result.addAll(names);
+        Collections.sort(result); //, new StringCompare());
+
+        return result;
+    }
+
+    /**
+     * Checks the given package for classes that inherited from the given class,
+     * in case it's a class, or implement this class, in case it's an interface.
+     *
+     * @param cls     the class/interface to look for
+     * @param pkgname the package to search in
+     * @return a list with all the found classnames
+     */
+    public static List<String> find(Class<?> cls, String pkgname) {
+        if (all_classes == null) {
+            loadAllClasses();
+        }
+
+        List<String> result = new ArrayList<String>();
+        for (int i = all_classes.size() - 1; i >= 0; i--) {
+            String sClass = all_classes.get(i);
+            sClass = sClass.replaceAll("/", ".");
+            //Log.debug.println(sClass + " " + pkgname);
+
+            // must match package
+            if (sClass.startsWith(pkgname)) {
+                //Log.debug.println(sClass);
+                try {
+                    Class<?> clsNew = Class.forName(sClass);
+
+                    // no abstract classes
+                    if (!Modifier.isAbstract(clsNew.getModifiers()) &&
+                            // must implement interface
+                            (cls.isInterface() && hasInterface(cls, clsNew)) ||
+                            // must be derived from class
+                            (!clsNew.isInterface() && isSubclass(cls, clsNew))) {
+                        result.add(sClass);
+                    }
+                } catch (Throwable e) {
+                    Log.debug.println("Checking class: " + sClass);
+                    e.printStackTrace();
+                }
+
+            }
+        }
+
+        // sort result
+        Collections.sort(result); //, new StringCompare());
+        // remove duplicates
+        for (int i = result.size() - 1; i > 0; i--) {
+            if (result.get(i).equals(result.get(i - 1))) {
+                result.remove(i);
+            }
+        }
+
+        return result;
+    }
+
+
+    private static void printUsageAndExit(Arguments arguments) {
+        arguments.printUsage("addonmanager", "");
+        Log.info.println("\nExamples:");
+        Log.info.println("addonmanager -list");
+        Log.info.println("addonmanager -add SNAPP");
+        Log.info.println("addonmanager -useAppDir -add SNAPP");
+        Log.info.println("addonmanager -del SNAPP");
+        System.exit(0);
+    }
+
+    public static void main(String[] args) {
+        try {
+            Arguments arguments = new Arguments(
+                    new Arguments.Option[]{
+                            new Arguments.Option("list", "List available packages"),
+                            new Arguments.StringOption("add", "NAME", "Install the <NAME> package "),
+                            new Arguments.StringOption("del", "NAME", "Uninstall the <NAME> package "),
+                            new Arguments.Option("useAppDir", "Use application (system wide) installation directory. Note this requires writing rights to the application directory. If not specified, the user's BEAST directory will be used."),
+                            new Arguments.StringOption("dir", "DIR", "Install/uninstall package in directory <DIR>. This overrides the useAppDir option"),
+                            new Arguments.Option("help", "Show help"),
+                    });
+            try {
+                arguments.parseArguments(args);
+            } catch (Arguments.ArgumentException ae) {
+                Log.info.println();
+                Log.info.println(ae.getMessage());
+                Log.info.println();
+                printUsageAndExit(arguments);
+            }
+
+            if (args.length == 0 || arguments.hasOption("help")) {
+                printUsageAndExit(arguments);
+            }
+
+            boolean useAppDir = arguments.hasOption("useAppDir");
+            String customDir = arguments.getStringOption("dir");
+            if (customDir != null) {
+                String path = System.getProperty("BEAST_ADDON_PATH");
+                System.setProperty("BEAST_ADDON_PATH", (path != null ? path + ":" : "") +customDir);
+            }
+
+            List<String> sURLs = getPackagesURL();
+            Log.debug.println("Packages user path : " + getPackageUserDir());
+            for (String sURL : sURLs) {
+                Log.debug.println("Access URL : " + sURL);
+            }
+            Log.debug.print("Getting list of packages ...");
+            List<Package> packages = null;
+            try {
+            	packages = AddOnManager.getPackages();
+            } catch (IOException e) {
+            	Log.warning.println(e.getMessage());
+            	Log.warning.println(NO_CONNECTION_MESSAGE);
+            	return;
+            }
+            Log.debug.println("Done!\n");
+
+            if (arguments.hasOption("list")) {
+                Log.info.println("Name : status : Description ");
+                for (Package aPackage : packages) {
+                    Log.info.println(formatPackageInfo(aPackage));
+                }
+            }
+
+            if (arguments.hasOption("add")) {
+                String name = arguments.getStringOption("add");
+                boolean processed = false;
+                for (Package aPackage : packages) {
+                    if (aPackage.packageName.equals(name)) {
+                        processed = true;
+                        if (!aPackage.isInstalled()) {
+                            Log.debug.println("Start installation");
+                            String dir = installPackage(aPackage, useAppDir, customDir, null);
+                            Log.info.println("Package " + name + " is installed in " + dir + ".");
+                        } else {
+                            Log.info.println("Installation aborted: " + name + " is already installed.");
+                            System.exit(0);
+                        }
+                    }
+                }
+                if (!processed) {
+                    Log.info.println("Could not find package '" + name + "' (typo perhaps?)");
+                }
+            }
+
+            if (arguments.hasOption("del")) {
+                String name = arguments.getStringOption("del");
+                boolean processed = false;
+                for (Package aPackage : packages) {
+                    if (aPackage.packageName.equals(name)) {
+                        processed = true;
+                        if (aPackage.isInstalled()) {
+                            Log.debug.println("Start un-installation");
+                            String dir = uninstallPackage(aPackage, useAppDir, customDir, null, false);
+                            Log.info.println("Package " + name + " is uninstalled from " + dir + ".");
+                        } else {
+                            Log.info.println("Un-installation aborted: " + name + " is not installed yet.");
+                            System.exit(0);
+                        }
+                    }
+                }
+                if (!processed) {
+                    Log.info.println("Could not find package '" + name + "' (typo perhaps?)");
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+ }
diff --git a/src/beast/util/ClusterTree.java b/src/beast/util/ClusterTree.java
new file mode 100644
index 0000000..dcd95ce
--- /dev/null
+++ b/src/beast/util/ClusterTree.java
@@ -0,0 +1,809 @@
+/*
+* File ClusterTree.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+package beast.util;
+
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.StateNode;
+import beast.core.StateNodeInitialiser;
+import beast.core.parameter.RealParameter;
+import beast.evolution.alignment.Alignment;
+import beast.evolution.alignment.distance.Distance;
+import beast.evolution.alignment.distance.JukesCantorDistance;
+import beast.evolution.tree.Node;
+import beast.evolution.tree.Tree;
+
+import java.text.DecimalFormat;
+import java.text.DecimalFormatSymbols;
+import java.util.*;
+
+
+
+
+
+/**
+ * Adapted from Weka's HierarchicalClustering class *
+ */
+ at Description("Create initial beast.tree by hierarchical clustering, either through one of the classic link methods " +
+        "or by neighbor joining. The following link methods are supported: " +
+        "<br/>o single link, " +
+        "<br/>o complete link, " +
+        "<br/>o UPGMA=average link, " +
+        "<br/>o mean link, " +
+        "<br/>o centroid, " +
+        "<br/>o Ward and " +
+        "<br/>o adjusted complete link " +
+        "<br/>o neighborjoining " +
+        "<br/>o neighborjoining2 - corrects tree for tip data, unlike plain neighborjoining")
+public class ClusterTree extends Tree implements StateNodeInitialiser {
+
+    enum Type {single, average, complete, upgma, mean, centroid, ward, adjcomplete, neighborjoining, neighborjoining2}
+
+
+    double EPSILON = 1e-10;
+
+    public Input<Type> clusterTypeInput = new Input<Type>("clusterType", "type of clustering algorithm used for generating initial beast.tree. " +
+            "Should be one of " + Type.values() + " (default " + Type.average + ")", Type.average, Type.values());
+    public Input<Alignment> dataInput = new Input<Alignment>("taxa", "alignment data used for calculating distances for clustering");
+
+    public Input<Distance> distanceInput = new Input<Distance>("distance", "method for calculating distance between two sequences (default Jukes Cantor)");
+
+    public Input<RealParameter> clockRateInput = new Input<RealParameter>("clock.rate",
+            "the clock rate parameter, used to divide all divergence times by, to convert from substitutions to times. (default 1.0)",
+            new RealParameter(new Double[] {1.0}));
+
+    /**
+     * Whether the distance represent node height (if false) or branch length (if true).
+     */
+    protected boolean distanceIsBranchLength = false;
+    Distance distance;
+    List<String> taxaNames;
+
+    /**
+     * Holds the Link type used calculate distance between clusters
+     */
+    Type nLinkType = Type.single;
+
+
+    @Override
+    public void initAndValidate() throws Exception {
+    	
+        RealParameter clockRate = clockRateInput.get();
+
+    	if (dataInput.get() != null) {
+    		taxaNames = dataInput.get().getTaxaNames();
+    	} else {
+    		if (m_taxonset.get() == null) {
+    			throw new Exception("At least one of taxa and taxonset input needs to be specified");
+    		}
+    		taxaNames = m_taxonset.get().asStringList();
+    	}
+        if (Boolean.valueOf(System.getProperty("beast.resume")) &&
+                (isEstimatedInput.get() || (m_initial.get() != null && m_initial.get().isEstimatedInput.get()))) {
+            // don't bother creating a cluster tree to save some time, if it is read from file anyway
+            // make a caterpillar
+            Node left = newNode();
+            left.setNr(0);
+            left.setID(taxaNames.get(0));
+            left.setHeight(0);
+            for (int i = 1; i < taxaNames.size(); i++) {
+                final Node right = newNode();
+                right.setNr(i);
+                right.setID(taxaNames.get(i));
+                right.setHeight(0);
+                final Node parent = newNode();
+                parent.setNr(taxaNames.size() + i - 1);
+                parent.setHeight(i);
+                left.setParent(parent);
+                parent.setLeft(left);
+                right.setParent(parent);
+                parent.setRight(right);
+                left = parent;
+            }
+            root = left;
+            leafNodeCount = taxaNames.size();
+            nodeCount = leafNodeCount * 2 - 1;
+            internalNodeCount = leafNodeCount - 1;
+            super.initAndValidate();
+            return;
+        }
+
+        distance = distanceInput.get();
+        if (distance == null) {
+            distance = new JukesCantorDistance();
+        }
+        if (distance instanceof Distance.Base){
+        	if (dataInput.get() == null) {
+        		// Distance requires an alignment?
+        	}
+        	((Distance.Base) distance).setPatterns(dataInput.get());
+        }
+
+        nLinkType = clusterTypeInput.get();
+
+        if (nLinkType == Type.upgma) nLinkType = Type.average;
+
+        if (nLinkType == Type.neighborjoining || nLinkType == Type.neighborjoining2) {
+            distanceIsBranchLength = true;
+        }
+        final Node root = buildClusterer();
+        setRoot(root);
+        root.labelInternalNodes((getNodeCount() + 1) / 2);
+        super.initAndValidate();
+        if (nLinkType == Type.neighborjoining2) {
+            // set tip dates to zero
+            final Node[] nodes = getNodesAsArray();
+            for (int i = 0; i < getLeafNodeCount(); i++) {
+                nodes[i].setHeight(0);
+            }
+            super.initAndValidate();
+        }
+
+        if (m_initial.get() != null)
+            processTraits(m_initial.get().m_traitList.get());
+        else
+            processTraits(m_traitList.get());
+
+        if (timeTraitSet != null)
+            adjustTreeNodeHeights(root);
+        else {
+        	// all nodes should be at zero height if no date-trait is available
+        	for (int i = 0; i < getLeafNodeCount(); i++) {
+        		getNode(i).setHeight(0);
+        	}
+        }
+
+        //divide all node heights by clock rate to convert from substitutions to time.
+        for (Node node : getInternalNodes()) {
+            double height = node.getHeight();
+            node.setHeight(height/clockRate.getValue());
+        }
+
+        initStateNodes();
+    }
+
+
+    public ClusterTree() {
+    } // c'tor
+
+
+    /**
+     * class representing node in cluster hierarchy *
+     */
+    class NodeX {
+        NodeX m_left;
+        NodeX m_right;
+        NodeX m_parent;
+        int m_iLeftInstance;
+        int m_iRightInstance;
+        double m_fLeftLength = 0;
+        double m_fRightLength = 0;
+        double m_fHeight = 0;
+
+        void setHeight(double fHeight1, double fHeight2) {
+            if (fHeight1 < EPSILON) {
+                fHeight1 = EPSILON;
+            }
+            if (fHeight2 < EPSILON) {
+                fHeight2 = EPSILON;
+            }
+            m_fHeight = fHeight1;
+            if (m_left == null) {
+                m_fLeftLength = fHeight1;
+            } else {
+                m_fLeftLength = fHeight1 - m_left.m_fHeight;
+            }
+            if (m_right == null) {
+                m_fRightLength = fHeight2;
+            } else {
+                m_fRightLength = fHeight2 - m_right.m_fHeight;
+            }
+        }
+
+        void setLength(double fLength1, double fLength2) {
+            if (fLength1 < EPSILON) {
+                fLength1 = EPSILON;
+            }
+            if (fLength2 < EPSILON) {
+                fLength2 = EPSILON;
+            }
+            m_fLeftLength = fLength1;
+            m_fRightLength = fLength2;
+            m_fHeight = fLength1;
+            if (m_left != null) {
+                m_fHeight += m_left.m_fHeight;
+            }
+        }
+
+        public String toString() {
+            final DecimalFormat myFormatter = new DecimalFormat("#.#####", new DecimalFormatSymbols(Locale.US));
+
+            if (m_left == null) {
+                if (m_right == null) {
+                    return "(" + taxaNames.get(m_iLeftInstance) + ":" + myFormatter.format(m_fLeftLength) + "," +
+                            taxaNames.get(m_iRightInstance) + ":" + myFormatter.format(m_fRightLength) + ")";
+                } else {
+                    return "(" + taxaNames.get(m_iLeftInstance) + ":" + myFormatter.format(m_fLeftLength) + "," +
+                            m_right.toString() + ":" + myFormatter.format(m_fRightLength) + ")";
+                }
+            } else {
+                if (m_right == null) {
+                    return "(" + m_left.toString() + ":" + myFormatter.format(m_fLeftLength) + "," +
+                            taxaNames.get(m_iRightInstance) + ":" + myFormatter.format(m_fRightLength) + ")";
+                } else {
+                    return "(" + m_left.toString() + ":" + myFormatter.format(m_fLeftLength) + "," + m_right.toString() + ":" + myFormatter.format(m_fRightLength) + ")";
+                }
+            }
+        }
+
+        Node toNode() throws Exception {
+            final Node node = newNode();
+            node.setHeight(m_fHeight);
+            if (m_left == null) {
+                node.setLeft(newNode());
+                node.getLeft().setNr(m_iLeftInstance);
+                node.getLeft().setID(taxaNames.get(m_iLeftInstance));
+                node.getLeft().setHeight(m_fHeight - m_fLeftLength);
+                if (m_right == null) {
+                    node.setRight(newNode());
+                    node.getRight().setNr(m_iRightInstance);
+                    node.getRight().setID(taxaNames.get(m_iRightInstance));
+                    node.getRight().setHeight(m_fHeight - m_fRightLength);
+                } else {
+                    node.setRight(m_right.toNode());
+                }
+            } else {
+                node.setLeft(m_left.toNode());
+                if (m_right == null) {
+                    node.setRight(newNode());
+                    node.getRight().setNr(m_iRightInstance);
+                    node.getRight().setID(taxaNames.get(m_iRightInstance));
+                    node.getRight().setHeight(m_fHeight - m_fRightLength);
+                } else {
+                    node.setRight(m_right.toNode());
+                }
+            }
+            if (node.getHeight() < node.getLeft().getHeight() + EPSILON) {
+                node.setHeight(node.getLeft().getHeight() + EPSILON);
+            }
+            if (node.getHeight() < node.getRight().getHeight() + EPSILON) {
+                node.setHeight(node.getRight().getHeight() + EPSILON);
+            }
+
+            node.getRight().setParent(node);
+            node.getLeft().setParent(node);
+            return node;
+        }
+    } // class NodeX
+
+    /**
+     * used for priority queue for efficient retrieval of pair of clusters to merge*
+     */
+    class Tuple {
+        public Tuple(final double d, final int i, final int j, final int nSize1, final int nSize2) {
+            m_fDist = d;
+            m_iCluster1 = i;
+            m_iCluster2 = j;
+            m_nClusterSize1 = nSize1;
+            m_nClusterSize2 = nSize2;
+        }
+
+        double m_fDist;
+        int m_iCluster1;
+        int m_iCluster2;
+        int m_nClusterSize1;
+        int m_nClusterSize2;
+    }
+
+    /**
+     * comparator used by priority queue*
+     */
+    class TupleComparator implements Comparator<Tuple> {
+        public int compare(final Tuple o1, final Tuple o2) {
+            if (o1.m_fDist < o2.m_fDist) {
+                return -1;
+            } else if (o1.m_fDist == o2.m_fDist) {
+                return 0;
+            }
+            return 1;
+        }
+    }
+
+    // return distance according to distance metric
+    double distance(final int iTaxon1, final int iTaxon2) {
+        return distance.pairwiseDistance(iTaxon1, iTaxon2);
+    } // distance
+
+    // 1-norm
+    double distance(final double[] nPattern1, final double[] nPattern2) {
+        double fDist = 0;
+        for (int i = 0; i < dataInput.get().getPatternCount(); i++) {
+            fDist += dataInput.get().getPatternWeight(i) * Math.abs(nPattern1[i] - nPattern2[i]);
+        }
+        return fDist / dataInput.get().getSiteCount();
+    }
+
+
+    @SuppressWarnings("unchecked")
+    public Node buildClusterer() throws Exception {
+        final int nTaxa = taxaNames.size();
+        if (nTaxa == 1) {
+            // pathological case
+            final Node node = newNode();
+            node.setHeight(1);
+            node.setNr(0);
+            return node;
+        }
+
+        // use array of integer vectors to store cluster indices,
+        // starting with one cluster per instance
+        final List<Integer>[] nClusterID = new ArrayList[nTaxa];
+        for (int i = 0; i < nTaxa; i++) {
+            nClusterID[i] = new ArrayList<Integer>();
+            nClusterID[i].add(i);
+        }
+        // calculate distance matrix
+        final int nClusters = nTaxa;
+
+        // used for keeping track of hierarchy
+        final NodeX[] clusterNodes = new NodeX[nTaxa];
+        if (nLinkType == Type.neighborjoining || nLinkType == Type.neighborjoining2) {
+            neighborJoining(nClusters, nClusterID, clusterNodes);
+        } else {
+            doLinkClustering(nClusters, nClusterID, clusterNodes);
+        }
+
+        // move all clusters in m_nClusterID array
+        // & collect hierarchy
+        for (int i = 0; i < nTaxa; i++) {
+            if (nClusterID[i].size() > 0) {
+                return clusterNodes[i].toNode();
+            }
+        }
+        return null;
+    } // buildClusterer
+
+    /**
+     * use neighbor joining algorithm for clustering
+     * This is roughly based on the RapidNJ simple implementation and runs at O(n^3)
+     * More efficient implementations exist, see RapidNJ (or my GPU implementation :-))
+     *
+     * @param nClusters
+     * @param nClusterID
+     * @param clusterNodes
+     */
+    void neighborJoining(int nClusters, final List<Integer>[] nClusterID, final NodeX[] clusterNodes) {
+        final int n = taxaNames.size();
+
+        final double[][] fDist = new double[nClusters][nClusters];
+        for (int i = 0; i < nClusters; i++) {
+            fDist[i][i] = 0;
+            for (int j = i + 1; j < nClusters; j++) {
+                fDist[i][j] = getDistance0(nClusterID[i], nClusterID[j]);
+                fDist[j][i] = fDist[i][j];
+            }
+        }
+
+        final double[] fSeparationSums = new double[n];
+        final double[] fSeparations = new double[n];
+        final int[] nNextActive = new int[n];
+
+        //calculate initial separation rows
+        for (int i = 0; i < n; i++) {
+            double fSum = 0;
+            for (int j = 0; j < n; j++) {
+                fSum += fDist[i][j];
+            }
+            fSeparationSums[i] = fSum;
+            fSeparations[i] = fSum / (nClusters - 2);
+            nNextActive[i] = i + 1;
+        }
+
+        while (nClusters > 2) {
+            // find minimum
+            int iMin1 = -1;
+            int iMin2 = -1;
+            double fMin = Double.MAX_VALUE;
+            {
+                int i = 0;
+                while (i < n) {
+                    final double fSep1 = fSeparations[i];
+                    final double[] fRow = fDist[i];
+                    int j = nNextActive[i];
+                    while (j < n) {
+                        final double fSep2 = fSeparations[j];
+                        final double fVal = fRow[j] - fSep1 - fSep2;
+                        if (fVal < fMin) {
+                            // new minimum
+                            iMin1 = i;
+                            iMin2 = j;
+                            fMin = fVal;
+                        }
+                        j = nNextActive[j];
+                    }
+                    i = nNextActive[i];
+                }
+            }
+            // record distance
+            final double fMinDistance = fDist[iMin1][iMin2];
+            nClusters--;
+            final double fSep1 = fSeparations[iMin1];
+            final double fSep2 = fSeparations[iMin2];
+            final double fDist1 = (0.5 * fMinDistance) + (0.5 * (fSep1 - fSep2));
+            final double fDist2 = (0.5 * fMinDistance) + (0.5 * (fSep2 - fSep1));
+            if (nClusters > 2) {
+                // update separations  & distance
+                double fNewSeparationSum = 0;
+                final double fMutualDistance = fDist[iMin1][iMin2];
+                final double[] fRow1 = fDist[iMin1];
+                final double[] fRow2 = fDist[iMin2];
+                for (int i = 0; i < n; i++) {
+                    if (i == iMin1 || i == iMin2 || nClusterID[i].size() == 0) {
+                        fRow1[i] = 0;
+                    } else {
+                        final double fVal1 = fRow1[i];
+                        final double fVal2 = fRow2[i];
+                        final double fDistance = (fVal1 + fVal2 - fMutualDistance) / 2.0;
+                        fNewSeparationSum += fDistance;
+                        // update the separationsum of cluster i.
+                        fSeparationSums[i] += (fDistance - fVal1 - fVal2);
+                        fSeparations[i] = fSeparationSums[i] / (nClusters - 2);
+                        fRow1[i] = fDistance;
+                        fDist[i][iMin1] = fDistance;
+                    }
+                }
+                fSeparationSums[iMin1] = fNewSeparationSum;
+                fSeparations[iMin1] = fNewSeparationSum / (nClusters - 2);
+                fSeparationSums[iMin2] = 0;
+                merge(iMin1, iMin2, fDist1, fDist2, nClusterID, clusterNodes);
+                int iPrev = iMin2;
+                // since iMin1 < iMin2 we havenActiveRows[0] >= 0, so the next loop should be save
+                while (nClusterID[iPrev].size() == 0) {
+                    iPrev--;
+                }
+                nNextActive[iPrev] = nNextActive[iMin2];
+            } else {
+                merge(iMin1, iMin2, fDist1, fDist2, nClusterID, clusterNodes);
+                break;
+            }
+        }
+
+        for (int i = 0; i < n; i++) {
+            if (nClusterID[i].size() > 0) {
+                for (int j = i + 1; j < n; j++) {
+                    if (nClusterID[j].size() > 0) {
+                        final double fDist1 = fDist[i][j];
+                        if (nClusterID[i].size() == 1) {
+                            merge(i, j, fDist1, 0, nClusterID, clusterNodes);
+                        } else if (nClusterID[j].size() == 1) {
+                            merge(i, j, 0, fDist1, nClusterID, clusterNodes);
+                        } else {
+                            merge(i, j, fDist1 / 2.0, fDist1 / 2.0, nClusterID, clusterNodes);
+                        }
+                        break;
+                    }
+                }
+            }
+        }
+    } // neighborJoining
+
+    /**
+     * Perform clustering using a link method
+     * This implementation uses a priority queue resulting in a O(n^2 log(n)) algorithm
+     *
+     * @param nClusters    number of clusters
+     * @param nClusterID
+     * @param clusterNodes
+     */
+    void doLinkClustering(int nClusters, final List<Integer>[] nClusterID, final NodeX[] clusterNodes) {
+        final int nInstances = taxaNames.size();
+        final PriorityQueue<Tuple> queue = new PriorityQueue<Tuple>(nClusters * nClusters / 2, new TupleComparator());
+        final double[][] fDistance0 = new double[nClusters][nClusters];
+        for (int i = 0; i < nClusters; i++) {
+            fDistance0[i][i] = 0;
+            for (int j = i + 1; j < nClusters; j++) {
+                fDistance0[i][j] = getDistance0(nClusterID[i], nClusterID[j]);
+                fDistance0[j][i] = fDistance0[i][j];
+                queue.add(new Tuple(fDistance0[i][j], i, j, 1, 1));
+            }
+        }
+        while (nClusters > 1) {
+            int iMin1 = -1;
+            int iMin2 = -1;
+            // use priority queue to find next best pair to cluster
+            Tuple t;
+            do {
+                t = queue.poll();
+            }
+            while (t != null && (nClusterID[t.m_iCluster1].size() != t.m_nClusterSize1 || nClusterID[t.m_iCluster2].size() != t.m_nClusterSize2));
+            iMin1 = t.m_iCluster1;
+            iMin2 = t.m_iCluster2;
+            merge(iMin1, iMin2, t.m_fDist/2.0, t.m_fDist/2.0, nClusterID, clusterNodes);
+            // merge  clusters
+
+            // update distances & queue
+            for (int i = 0; i < nInstances; i++) {
+                if (i != iMin1 && nClusterID[i].size() != 0) {
+                    final int i1 = Math.min(iMin1, i);
+                    final int i2 = Math.max(iMin1, i);
+                    final double fDistance = getDistance(fDistance0, nClusterID[i1], nClusterID[i2]);
+                    queue.add(new Tuple(fDistance, i1, i2, nClusterID[i1].size(), nClusterID[i2].size()));
+                }
+            }
+
+            nClusters--;
+        }
+    } // doLinkClustering
+
+    void merge(int iMin1, int iMin2, double fDist1, double fDist2, final List<Integer>[] nClusterID, final NodeX[] clusterNodes) {
+        if (iMin1 > iMin2) {
+            final int h = iMin1;
+            iMin1 = iMin2;
+            iMin2 = h;
+            final double f = fDist1;
+            fDist1 = fDist2;
+            fDist2 = f;
+        }
+        nClusterID[iMin1].addAll(nClusterID[iMin2]);
+        //nClusterID[iMin2].removeAllElements();
+        nClusterID[iMin2].removeAll(nClusterID[iMin2]);
+
+        // track hierarchy
+        final NodeX node = new NodeX();
+        if (clusterNodes[iMin1] == null) {
+            node.m_iLeftInstance = iMin1;
+        } else {
+            node.m_left = clusterNodes[iMin1];
+            clusterNodes[iMin1].m_parent = node;
+        }
+        if (clusterNodes[iMin2] == null) {
+            node.m_iRightInstance = iMin2;
+        } else {
+            node.m_right = clusterNodes[iMin2];
+            clusterNodes[iMin2].m_parent = node;
+        }
+        if (distanceIsBranchLength) {
+            node.setLength(fDist1, fDist2);
+        } else {
+            node.setHeight(fDist1, fDist2);
+        }
+        clusterNodes[iMin1] = node;
+    } // merge
+
+    /**
+     * calculate distance the first time when setting up the distance matrix *
+     */
+    double getDistance0(final List<Integer> cluster1, final List<Integer> cluster2) {
+        double fBestDist = Double.MAX_VALUE;
+        switch (nLinkType) {
+            case single:
+            case neighborjoining:
+            case neighborjoining2:
+            case centroid:
+            case complete:
+            case adjcomplete:
+            case average:
+            case mean:
+                // set up two instances for distance function
+                fBestDist = distance(cluster1.get(0), cluster2.get(0));
+                break;
+            case ward: {
+                // finds the distance of the change in caused by merging the cluster.
+                // The information of a cluster is calculated as the error sum of squares of the
+                // centroids of the cluster and its members.
+                final double ESS1 = calcESS(cluster1);
+                final double ESS2 = calcESS(cluster2);
+                final List<Integer> merged = new ArrayList<Integer>();
+                merged.addAll(cluster1);
+                merged.addAll(cluster2);
+                final double ESS = calcESS(merged);
+                fBestDist = ESS * merged.size() - ESS1 * cluster1.size() - ESS2 * cluster2.size();
+            }
+            break;
+        }
+        return fBestDist;
+    } // getDistance0
+
+    /**
+     * calculate the distance between two clusters
+     *
+     * @param cluster1 list of indices of instances in the first cluster
+     * @param cluster2 dito for second cluster
+     * @return distance between clusters based on link type
+     */
+    double getDistance(final double[][] fDistance, final List<Integer> cluster1, final List<Integer> cluster2) {
+        double fBestDist = Double.MAX_VALUE;
+        switch (nLinkType) {
+            case single:
+                // find single link distance aka minimum link, which is the closest distance between
+                // any item in cluster1 and any item in cluster2
+                fBestDist = Double.MAX_VALUE;
+                for (int i = 0; i < cluster1.size(); i++) {
+                    final int i1 = cluster1.get(i);
+                    for (int j = 0; j < cluster2.size(); j++) {
+                        final int i2 = cluster2.get(j);
+                        final double fDist = fDistance[i1][i2];
+                        if (fBestDist > fDist) {
+                            fBestDist = fDist;
+                        }
+                    }
+                }
+                break;
+            case complete:
+            case adjcomplete:
+                // find complete link distance aka maximum link, which is the largest distance between
+                // any item in cluster1 and any item in cluster2
+                fBestDist = 0;
+                for (int i = 0; i < cluster1.size(); i++) {
+                    final int i1 = cluster1.get(i);
+                    for (int j = 0; j < cluster2.size(); j++) {
+                        final int i2 = cluster2.get(j);
+                        final double fDist = fDistance[i1][i2];
+                        if (fBestDist < fDist) {
+                            fBestDist = fDist;
+                        }
+                    }
+                }
+                if (nLinkType == Type.complete) {
+                    break;
+                }
+                // calculate adjustment, which is the largest within cluster distance
+                double fMaxDist = 0;
+                for (int i = 0; i < cluster1.size(); i++) {
+                    final int i1 = cluster1.get(i);
+                    for (int j = i + 1; j < cluster1.size(); j++) {
+                        final int i2 = cluster1.get(j);
+                        final double fDist = fDistance[i1][i2];
+                        if (fMaxDist < fDist) {
+                            fMaxDist = fDist;
+                        }
+                    }
+                }
+                for (int i = 0; i < cluster2.size(); i++) {
+                    final int i1 = cluster2.get(i);
+                    for (int j = i + 1; j < cluster2.size(); j++) {
+                        final int i2 = cluster2.get(j);
+                        final double fDist = fDistance[i1][i2];
+                        if (fMaxDist < fDist) {
+                            fMaxDist = fDist;
+                        }
+                    }
+                }
+                fBestDist -= fMaxDist;
+                break;
+            case average:
+                // finds average distance between the elements of the two clusters
+                fBestDist = 0;
+                for (int i = 0; i < cluster1.size(); i++) {
+                    final int i1 = cluster1.get(i);
+                    for (int j = 0; j < cluster2.size(); j++) {
+                        final int i2 = cluster2.get(j);
+                        fBestDist += fDistance[i1][i2];
+                    }
+                }
+                fBestDist /= (cluster1.size() * cluster2.size());
+                break;
+            case mean: {
+                // calculates the mean distance of a merged cluster (akak Group-average agglomerative clustering)
+                final List<Integer> merged = new ArrayList<Integer>();
+                merged.addAll(cluster1);
+                merged.addAll(cluster2);
+                fBestDist = 0;
+                for (int i = 0; i < merged.size(); i++) {
+                    final int i1 = merged.get(i);
+                    for (int j = i + 1; j < merged.size(); j++) {
+                        final int i2 = merged.get(j);
+                        fBestDist += fDistance[i1][i2];
+                    }
+                }
+                final int n = merged.size();
+                fBestDist /= (n * (n - 1.0) / 2.0);
+            }
+            break;
+            case centroid:
+                // finds the distance of the centroids of the clusters
+                final int nPatterns = dataInput.get().getPatternCount();
+                final double[] centroid1 = new double[nPatterns];
+                for (int i = 0; i < cluster1.size(); i++) {
+                    final int iTaxon = cluster1.get(i);
+                    for (int j = 0; j < nPatterns; j++) {
+                        centroid1[j] += dataInput.get().getPattern(iTaxon, j);
+                    }
+                }
+                final double[] centroid2 = new double[nPatterns];
+                for (int i = 0; i < cluster2.size(); i++) {
+                    final int iTaxon = cluster2.get(i);
+                    for (int j = 0; j < nPatterns; j++) {
+                        centroid2[j] += dataInput.get().getPattern(iTaxon, j);
+                    }
+                }
+                for (int j = 0; j < nPatterns; j++) {
+                    centroid1[j] /= cluster1.size();
+                    centroid2[j] /= cluster2.size();
+                }
+                fBestDist = distance(centroid1, centroid2);
+                break;
+            case ward: {
+                // finds the distance of the change in caused by merging the cluster.
+                // The information of a cluster is calculated as the error sum of squares of the
+                // centroids of the cluster and its members.
+                final double ESS1 = calcESS(cluster1);
+                final double ESS2 = calcESS(cluster2);
+                final List<Integer> merged = new ArrayList<Integer>();
+                merged.addAll(cluster1);
+                merged.addAll(cluster2);
+                final double ESS = calcESS(merged);
+                fBestDist = ESS * merged.size() - ESS1 * cluster1.size() - ESS2 * cluster2.size();
+            }
+            break;
+        }
+        return fBestDist;
+    } // getDistance
+
+
+    /**
+     * calculated error sum-of-squares for instances wrt centroid *
+     */
+    double calcESS(final List<Integer> cluster) {
+        final int nPatterns = dataInput.get().getPatternCount();
+        final double[] centroid = new double[nPatterns];
+        for (int i = 0; i < cluster.size(); i++) {
+            final int iTaxon = cluster.get(i);
+            for (int j = 0; j < nPatterns; j++) {
+                centroid[j] += dataInput.get().getPattern(iTaxon, j);
+            }
+        }
+        for (int j = 0; j < nPatterns; j++) {
+            centroid[j] /= cluster.size();
+        }
+        // set up two instances for distance function
+        double fESS = 0;
+        for (int i = 0; i < cluster.size(); i++) {
+            final double[] instance = new double[nPatterns];
+            final int iTaxon = cluster.get(i);
+            for (int j = 0; j < nPatterns; j++) {
+                instance[j] += dataInput.get().getPattern(iTaxon, j);
+            }
+            fESS += distance(centroid, instance);
+        }
+        return fESS / cluster.size();
+    } // calcESS
+
+    @Override
+    public void initStateNodes() {
+        if (m_initial.get() != null) {
+            m_initial.get().assignFromWithoutID(this);
+        }
+    }
+
+    @Override
+    public void getInitialisedStateNodes(final List<StateNode> stateNodes) {
+        if (m_initial.get() != null) {
+            stateNodes.add(m_initial.get());
+        }
+    }
+
+} // class ClusterTree
diff --git a/src/beast/util/CollectionUtils.java b/src/beast/util/CollectionUtils.java
new file mode 100644
index 0000000..98f5512
--- /dev/null
+++ b/src/beast/util/CollectionUtils.java
@@ -0,0 +1,56 @@
+package beast.util;
+
+
+import java.util.Arrays;
+import java.util.BitSet;
+import java.util.List;
+
+/**
+ * some useful methods
+ */
+public class CollectionUtils {
+
+    // not use set because hard to get element given index
+    public static <E> List<E> intersection(List<E> list1, List<E> list2) {
+        list1.retainAll(list2);
+        return list1;
+    }
+
+    public static <E> List<E> intersection(E[] array1, E[] array2) {
+        return intersection(Arrays.asList(array1), Arrays.asList(array2));
+    }
+
+    public static <E> int indexof(E sLabel, E[] m_sLabels) {
+        for (int i = 0; i < m_sLabels.length ; i++) {
+            if (m_sLabels[i].equals(sLabel)) {
+                return i;
+            }
+        }
+        return -1;
+    }
+
+    /**
+     *
+     * @param array the array to be converted into list
+     * @param fromIndex the index of the first element, inclusive, to be sorted
+     * @param toIndex the index of the last element, exclusive, to be sorted
+     * @return
+     */
+    public static <E> List<E> toList(E[] array, int fromIndex, int toIndex) {
+        List<E> list = Arrays.asList(array);
+        return list.subList(fromIndex, toIndex);
+    }
+
+    /**
+     * very inefficient, but Java wonderful bitset has no subset op
+     * perhaps using bit iterator would be faster, I can't br bothered.
+     * @param x
+     * @param y
+     * @return
+     */
+    public static boolean isSubSet(BitSet x, BitSet y) {
+        y = (BitSet) y.clone();
+        y.and(x);
+        return y.equals(x);
+    }
+}
diff --git a/src/beast/util/CredibleSet.java b/src/beast/util/CredibleSet.java
new file mode 100644
index 0000000..5e2fb1e
--- /dev/null
+++ b/src/beast/util/CredibleSet.java
@@ -0,0 +1,58 @@
+package beast.util;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Credible Set results
+ *
+ * @author Walter Xie
+ */
+public class CredibleSet<T> {
+
+    public List<T> credibleSetList;
+
+    final double credSetProbability;
+
+    public int sumFrequency = 0;
+
+    public int targetIndex = -1;
+    public double targetProb = 0.0;
+    public double targetCum = 1.0;
+
+    public CredibleSet(double credSetProbability) {
+        credibleSetList = new ArrayList<T>();
+        this.credSetProbability = credSetProbability;
+    }
+
+    public void setCredibleSetList(T target, FrequencySet<T> frequencySet) {
+        int total = frequencySet.getSumFrequency();
+
+        for (int i = 0; i < frequencySet.size(); i++) {
+            final int freq = frequencySet.getFrequency(i);
+            final double prop = ((double) freq) / total;
+
+            sumFrequency += freq;
+            final double sumProp = ((double) sumFrequency) / (double)total;
+
+            T obj = frequencySet.get(i);
+            credibleSetList.add(obj);
+            if (target != null && obj.equals(target)) {
+                targetIndex = i + 1;
+                targetProb = prop;
+                targetCum = sumProp;
+            }
+
+            if (sumProp >= credSetProbability) {
+                break;
+            }
+        }
+    }
+
+    /**
+     * get frequency of ith object
+     */
+    public int getFrequency(int i, FrequencySet<T> frequencySet) {
+        return frequencySet.getFrequency(credibleSetList.get(i));
+    }
+}
\ No newline at end of file
diff --git a/src/beast/util/FrequencySet.java b/src/beast/util/FrequencySet.java
new file mode 100644
index 0000000..102417a
--- /dev/null
+++ b/src/beast/util/FrequencySet.java
@@ -0,0 +1,185 @@
+/*
+ * FrequencySet.java
+ *
+ * Copyright (C) 2002-2006 Alexei Drummond and Andrew Rambaut
+ *
+ * This file is part of BEAST.
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership and licensing.
+ *
+ * BEAST 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
+ * of the License, or (at your option) any later version.
+ *
+ *  BEAST 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 BEAST; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+package beast.util;
+
+import java.util.*;
+
+/**
+ * modified from BEAST 1 FrequencySet<T>
+ * Stores a set of objects with frequencies
+ *
+ * @author Andrew Rambaut
+ * @author Walter Xie
+ */
+public class FrequencySet<T> {
+    public static final double DEFAULT_CRED_SET = 0.95;
+
+    public FrequencySet() {
+        setCredSetProbability(DEFAULT_CRED_SET);
+    }
+
+    // really need ?
+    public FrequencySet(double credSetProbability) {
+        setCredSetProbability(credSetProbability);
+    }
+
+    /**
+     * get number of objects
+     */
+    public int size() {
+        return frequencyMap.size();
+    }
+
+    /**
+     * get object in frequency order
+     */
+    public T get(int i) {
+        if (!sorted) {
+            sortByFrequency();
+        }
+
+        return sortedList.get(i);
+    }
+
+
+    public Integer getFrequency(T obj) {
+        if (!sorted) {
+            sortByFrequency();
+        }
+
+        return frequencyMap.get(obj);
+    }
+
+    /**
+     * get frequency of ith object
+     */
+    public int getFrequency(int i) {
+        return getFrequency(sortedList.get(i));
+    }
+
+    /**
+     * get sum of all frequencies
+     */
+    public int getSumFrequency() {
+        if (!sorted) {
+            sortByFrequency();
+        }
+
+        int sum = 0;
+        for (int i = 0; i < size(); i++) {
+            sum += getFrequency(i);
+        }
+
+        return sum;
+    }
+
+    /**
+     * adds an object to the set
+     */
+    public void add(T object) {
+        add(object, 1);
+    }
+
+    /**
+     * adds an object to the set with an initial frequency, or if object already
+     * in frequency set then frequency is incremented by given frequency.
+     */
+    public void add(T object, int frequency) {
+        Integer freq = frequencyMap.get(object);
+        if (freq != null) {
+            freq += frequency;
+            frequencyMap.put(object, freq);
+        } else {
+            frequencyMap.put(object, frequency);
+            sortedList.add(object);
+            sorted = false;
+        }
+    }
+
+    /**
+     * The frequencySets are equal if their inner sets are equal
+     */
+    @Override
+    public boolean equals(Object obj) {
+        return (obj instanceof FrequencySet) && sortedList.equals(((FrequencySet) obj).sortedList);
+    }
+
+    public Map<T, Integer> getFrequencyMap() {
+        return frequencyMap;
+    }
+
+    /**
+     *
+     * @param target     if null, then only return credibleSetList.credibleSetList
+     * @return
+     */
+    public CredibleSet<T> getCredibleSet(T target) {
+        CredibleSet<T> credibleSet = new CredibleSet<T>(getCredSetProbability());
+        credibleSet.setCredibleSetList(target, this);
+        return credibleSet;
+    }
+
+    public CredibleSet<T> getCredibleSet() {
+        return getCredibleSet(null);
+    }
+
+
+    public double getCredSetProbability() {
+        if (credSetProbability == 0)
+            setCredSetProbability(DEFAULT_CRED_SET);
+        return credSetProbability;
+    }
+
+    public void setCredSetProbability(double credSetProbability) {
+        this.credSetProbability = credSetProbability;
+    }
+
+    /**
+     * sort by descending frequency
+     */
+    private void sortByFrequency() {
+        sortedList.clear();
+        sortedList.addAll(frequencyMap.keySet());
+        Collections.sort(sortedList, frequencyComparator);
+        sorted = true;
+    }
+
+    //
+    // Private stuff
+    //
+
+    private List<T> sortedList = new ArrayList<T>();
+    private Map<T, Integer> frequencyMap = new HashMap<T, Integer>();
+    private boolean sorted = false;
+    private double credSetProbability = 0;
+
+    private Comparator<T> frequencyComparator = new Comparator<T>() {
+        public int compare(T obj1, T obj2) {
+            return frequencyMap.get(obj2) - frequencyMap.get(obj1);
+        }
+    };
+
+}
\ No newline at end of file
diff --git a/src/beast/util/HeapSort.java b/src/beast/util/HeapSort.java
new file mode 100644
index 0000000..a31332c
--- /dev/null
+++ b/src/beast/util/HeapSort.java
@@ -0,0 +1,383 @@
+package beast.util;
+
+import java.util.Comparator;
+import java.util.List;
+
+/**
+ * sorts numbers and comparable objects by treating contents of array as a binary beast.tree.
+ * KNOWN BUGS: There is a horrible amount of code duplication here!
+ *
+ * @author Alexei Drummond
+ * @author Korbinian Strimmer
+ * @version $Id: HeapSort.java,v 1.7 2006/02/20 17:36:23 rambaut Exp $
+ */
+public class HeapSort {
+
+    //
+    // Public stuff
+    //
+
+    /**
+     * Sorts an array of indices refering to a list of comparable objects
+     * into increasing order.
+     *
+     * @param list    the list of comparable objects
+     * @param indices an array of indices describing an ascending order of the comparable object in the list
+     */
+    public static void sort(@SuppressWarnings("rawtypes") List<? extends Comparable> list, int[] indices) {
+
+        // ensures we are starting with valid indices
+        for (int i = 0; i < indices.length; i++) {
+            indices[i] = i;
+        }
+
+        int temp;
+        int j, n = list.size();
+
+        // turn input array into a heap
+        for (j = n / 2; j > 0; j--) {
+            adjust(list, indices, j, n);
+        }
+
+        // remove largest elements and put them at the end
+        // of the unsorted region until you are finished
+        for (j = n - 1; j > 0; j--) {
+            temp = indices[0];
+            indices[0] = indices[j];
+            indices[j] = temp;
+            adjust(list, indices, 1, j);
+        }
+    }
+
+    /**
+     * Sorts an array of comparable objects into increasing order.
+     *
+     * @param array an array of Comparables to be sorted into ascending order
+     */
+    public static void sort(Comparable<?>[] array) {
+
+        Comparable<?> temp;
+        int j, n = array.length;
+
+        // turn input array into a heap
+        for (j = n / 2; j > 0; j--) {
+            adjust(array, j, n);
+        }
+
+        // remove largest elements and put them at the end
+        // of the unsorted region until you are finished
+        for (j = n - 1; j > 0; j--) {
+            temp = array[0];
+            array[0] = array[j];
+            array[j] = temp;
+            adjust(array, 1, j);
+        }
+    }
+
+    /**
+     * Sorts an array of objects into increasing order given a comparator.
+     *
+     * @param array      and array of objects to be sorted
+     * @param comparator a comparator used to defined the ordering of the objects
+     */
+    public static void sort(Object[] array, Comparator<?> comparator) {
+
+        Object temp;
+        int j, n = array.length;
+
+        // turn input array into a heap
+        for (j = n / 2; j > 0; j--) {
+            adjust(array, comparator, j, n);
+        }
+
+        // remove largest elements and put them at the end
+        // of the unsorted region until you are finished
+        for (j = n - 1; j > 0; j--) {
+            temp = array[0];
+            array[0] = array[j];
+            array[j] = temp;
+            adjust(array, comparator, 1, j);
+        }
+    }
+
+    /**
+     * Sorts an array of doubles into increasing order.
+     *
+     * @param array an array of doubles to be sorted in ascending order.
+     */
+    public static void sort(double[] array) {
+
+        double temp;
+        int j, n = array.length;
+
+        // turn input array into a heap
+        for (j = n / 2; j > 0; j--) {
+            adjust(array, j, n);
+        }
+
+        // remove largest elements and put them at the end
+        // of the unsorted region until you are finished
+        for (j = n - 1; j > 0; j--) {
+            temp = array[0];
+            array[0] = array[j];
+            array[j] = temp;
+            adjust(array, 1, j);
+        }
+    }
+
+    /**
+     * Sorts an array of doubles into increasing order, ingoring sign.
+     *
+     * @param array and array of doubles to be sorted into increasing order, ignoring sign
+     */
+    public static void sortAbs(double[] array) {
+
+        double temp;
+        int j, n = array.length;
+
+        // turn input array into a heap
+        for (j = n / 2; j > 0; j--) {
+            adjustAbs(array, j, n);
+        }
+
+        // remove largest elements and put them at the end
+        // of the unsorted region until you are finished
+        for (j = n - 1; j > 0; j--) {
+            temp = array[0];
+            array[0] = array[j];
+            array[j] = temp;
+            adjustAbs(array, 1, j);
+        }
+    }
+
+    /**
+     * Sorts an array of indices into an array of doubles
+     * into increasing order.
+     *
+     * @param array   an array of doubles
+     * @param indices an array of indices to be sorted so that they describe an ascending order of values in array
+     */
+    public static void sort(double[] array, int[] indices) {
+
+        // ensures we are starting with valid indices
+        for (int i = 0; i < indices.length; i++) {
+            indices[i] = i;
+        }
+
+        int temp;
+        int j, n = indices.length;
+
+        // turn input array into a heap
+        for (j = n / 2; j > 0; j--) {
+            adjust(array, indices, j, n);
+        }
+
+        // remove largest elements and put them at the end
+        // of the unsorted region until you are finished
+        for (j = n - 1; j > 0; j--) {
+            temp = indices[0];
+            indices[0] = indices[j];
+            indices[j] = temp;
+            adjust(array, indices, 1, j);
+        }
+    }
+
+    // PRIVATE STUFF
+
+    /**
+     * helps sort an array of indices pointing into a list of comparable objects.
+     * Assumes that indices[lower+1] through to indices[upper] is
+     * already in heap form and then puts indices[lower] to
+     * indices[upper] in heap form.
+     *
+     * @param list    a list of comparables
+     * @param indices an array of indices pointing into list
+     * @param lower   starting index in array to heapify
+     * @param upper   end index in array to heapify
+     */
+    @SuppressWarnings("unchecked")
+    private static void adjust(@SuppressWarnings("rawtypes") List<? extends Comparable> list, int[] indices, int lower, int upper) {
+
+        int j, k;
+        int temp;
+
+        j = lower;
+        k = lower * 2;
+
+        while (k <= upper) {
+            if ((k < upper) && (list.get(indices[k - 1]).compareTo(list.get(indices[k])) < 0)) {
+                k += 1;
+            }
+            if (list.get(indices[j - 1]).compareTo(list.get(indices[k - 1])) < 0) {
+                temp = indices[j - 1];
+                indices[j - 1] = indices[k - 1];
+                indices[k - 1] = temp;
+            }
+            j = k;
+            k *= 2;
+        }
+    }
+
+    /**
+     * Assumes that array[lower+1] through to array[upper] is
+     * already in heap form and then puts array[lower] to
+     * array[upper] in heap form.
+     *
+     * @param array array to sort
+     * @param lower lower index of heapify
+     * @param upper upper index of heapify
+     */
+    @SuppressWarnings("unchecked")
+    private static void adjust(@SuppressWarnings("rawtypes") Comparable[] array, int lower, int upper) {
+
+        int j, k;
+        Comparable<?> temp;
+
+        j = lower;
+        k = lower * 2;
+
+        while (k <= upper) {
+            if ((k < upper) && (array[k - 1].compareTo(array[k]) < 0)) {
+                k += 1;
+            }
+            if (array[j - 1].compareTo(array[k - 1]) < 0) {
+                temp = array[j - 1];
+                array[j - 1] = array[k - 1];
+                array[k - 1] = temp;
+            }
+            j = k;
+            k *= 2;
+        }
+    }
+
+    /**
+     * Assumes that array[lower+1] through to array[upper] is
+     * already in heap form and then puts array[lower] to
+     * array[upper] in heap form.
+     *
+     * @param array      array of objects to sort
+     * @param comparator comparator to provide ordering
+     * @param lower      lower index of heapify
+     * @param upper      upper index of heapify
+     */
+    @SuppressWarnings("unchecked")
+    private static void adjust(Object[] array, @SuppressWarnings("rawtypes") Comparator comparator, int lower, int upper) {
+
+        int j, k;
+        Object temp;
+
+        j = lower;
+        k = lower * 2;
+
+        while (k <= upper) {
+            if ((k < upper) && (comparator.compare(array[k - 1], array[k]) < 0)) {
+                k += 1;
+            }
+            if (comparator.compare(array[j - 1], array[k - 1]) < 0) {
+                temp = array[j - 1];
+                array[j - 1] = array[k - 1];
+                array[k - 1] = temp;
+            }
+            j = k;
+            k *= 2;
+        }
+    }
+
+    /**
+     * helps sort an array of doubles.
+     * Assumes that array[lower+1] through to array[upper] is
+     * already in heap form and then puts array[lower] to
+     * array[upper] in heap form.
+     *
+     * @param array array of doubles to sort
+     * @param lower lower index of heapify
+     * @param upper upper index of heapify
+     */
+    private static void adjust(double[] array, int lower, int upper) {
+
+        int j, k;
+        double temp;
+
+        j = lower;
+        k = lower * 2;
+
+        while (k <= upper) {
+            if ((k < upper) && (array[k - 1] < array[k])) {
+                k += 1;
+            }
+            if (array[j - 1] < array[k - 1]) {
+                temp = array[j - 1];
+                array[j - 1] = array[k - 1];
+                array[k - 1] = temp;
+            }
+            j = k;
+            k *= 2;
+        }
+    }
+
+    /**
+     * helps sort an array of doubles.
+     * Assumes that array[lower+1] through to array[upper] is
+     * already in heap form and then puts array[lower] to
+     * array[upper] in heap form.
+     *
+     * @param array array of doubles to sort ignoring sign
+     * @param lower lower index of heapify
+     * @param upper upper index of heapify
+     */
+    private static void adjustAbs(double[] array, int lower, int upper) {
+
+        int j, k;
+        double temp;
+
+        j = lower;
+        k = lower * 2;
+
+        while (k <= upper) {
+            if ((k < upper) && (Math.abs(array[k - 1]) < Math.abs(array[k]))) {
+                k += 1;
+            }
+            if (Math.abs(array[j - 1]) < Math.abs(array[k - 1])) {
+                temp = array[j - 1];
+                array[j - 1] = array[k - 1];
+                array[k - 1] = temp;
+            }
+            j = k;
+            k *= 2;
+        }
+    }
+
+    /**
+     * helps sort an array of indices into an array of doubles.
+     * Assumes that array[lower+1] through to array[upper] is
+     * already in heap form and then puts array[lower] to
+     * array[upper] in heap form.
+     *
+     * @param array   array of doubles
+     * @param indices array of indices into double array to sort
+     * @param lower   lower index of heapify
+     * @param upper   upper index of heapify
+     */
+    private static void adjust(double[] array, int[] indices, int lower, int upper) {
+
+        int j, k;
+        int temp;
+
+        j = lower;
+        k = lower * 2;
+
+        while (k <= upper) {
+            if ((k < upper) && (array[indices[k - 1]] < array[indices[k]])) {
+                k += 1;
+            }
+            if (array[indices[j - 1]] < array[indices[k - 1]]) {
+                temp = indices[j - 1];
+                indices[j - 1] = indices[k - 1];
+                indices[k - 1] = temp;
+            }
+            j = k;
+            k *= 2;
+        }
+    }
+}
+
diff --git a/src/beast/util/JSONParser.java b/src/beast/util/JSONParser.java
new file mode 100644
index 0000000..bf13f6c
--- /dev/null
+++ b/src/beast/util/JSONParser.java
@@ -0,0 +1,1122 @@
+/*
+ * File XMLParser.java
+ *
+ * Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+ *
+ * This file is part of BEAST2.
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership and licensing.
+ *
+ * BEAST 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
+ * of the License, or (at your option) any later version.
+ *
+ *  BEAST 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 BEAST; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+package beast.util;
+
+
+import org.json.JSONArray;
+import org.json.JSONObject;
+
+import beast.app.beauti.PartitionContext;
+import beast.core.*;
+import beast.core.Input.Validate;
+import beast.core.Runnable;
+import beast.core.parameter.Parameter;
+import beast.core.parameter.RealParameter;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/** parses YABBY JSON file into a set of YABBY objects **/
+public class JSONParser {
+	final public static String ANALYSIS_ELEMENT = "analysis";
+
+	final static String INPUT_CLASS = Input.class.getName();
+	final static String YOBJECT_CLASS = BEASTInterface.class.getName();
+	final static String RUNNABLE_CLASS = Runnable.class.getName();
+
+	Runnable runnable;
+	State state;
+	/**
+	 * DOM document representation of XML file *
+	 */
+	JSONObject doc;
+
+	/**
+	 * maps sequence data onto integer value *
+	 */
+	String DataMap;
+
+	HashMap<String, BEASTInterface> IDMap;
+	HashMap<String, Integer[]> likelihoodMap;
+	HashMap<String, JSONObject> IDNodeMap;
+
+	static HashMap<String, String> element2ClassMap;
+	static Set<String> reservedElements;
+	static {
+		element2ClassMap = new HashMap<String, String>();
+		reservedElements = new HashSet<String>();
+		for (String element : element2ClassMap.keySet()) {
+			reservedElements.add(element);
+		}
+	}
+
+	List<BEASTInterface> pluginsWaitingToInit;
+	List<JSONObject> nodesWaitingToInit;
+
+	public HashMap<String, String> getElement2ClassMap() {
+		return element2ClassMap;
+	}
+
+	String[] m_sNameSpaces;
+
+	/**
+	 * Flag to indicate initAndValidate should be called after all inputs of a
+	 * plugin have been parsed
+	 */
+	boolean m_bInitialize = true;
+
+	/**
+	 * when parsing XML, missing inputs can be assigned default values through a
+	 * RequiredInputProvider
+	 */
+	RequiredInputProvider requiredInputProvider = null;
+	PartitionContext partitionContext = null;
+
+	public JSONParser() {
+		pluginsWaitingToInit = new ArrayList<BEASTInterface>();
+		nodesWaitingToInit = new ArrayList<JSONObject>();
+	}
+
+	public Runnable parseFile(File file) throws Exception {
+		// parse the JSON file into a JSONObject
+		
+		// first get rid of comments: remove all text on lines starting with space followed by //
+		// keep line breaks so that error reporting indicates the correct line.
+		BufferedReader fin = new BufferedReader(new FileReader(file));
+		StringBuffer buf = new StringBuffer();
+		String sStr = null;
+		while (fin.ready()) {
+			sStr = fin.readLine();
+			if (!sStr.matches("^\\s*//.*")) {
+				buf.append(sStr);
+			}
+			buf.append('\n');
+		}
+		fin.close();
+		
+		doc = new JSONObject(buf.toString());
+		processPlates(doc);
+
+		IDMap = new HashMap<String, BEASTInterface>();
+		likelihoodMap = new HashMap<String, Integer[]>();
+		IDNodeMap = new HashMap<String, JSONObject>();
+
+		parse();
+		// assert m_runnable == null || m_runnable instanceof Runnable;
+		if (runnable != null)
+			return runnable;
+		else {
+			throw new Exception("Run element does not point to a runnable object.");
+		}
+	} // parseFile
+
+	/**
+	 * extract all elements (runnable or not) from an XML fragment. Useful for
+	 * retrieving all non-runnable elements when a template is instantiated by
+	 * Beauti *
+	 */
+	// public List<Plugin> parseTemplate(String sXML, HashMap<String, Plugin>
+	// sIDMap, boolean bInitialize) throws Exception {
+	// m_bInitialize = bInitialize;
+	// // parse the XML file into a DOM document
+	// DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+	// //factory.setValidating(true);
+	// doc = factory.newDocumentBuilder().parse(new InputSource(new
+	// StringReader(sXML)));
+	// processPlates();
+	//
+	// IDMap = sIDMap;//new HashMap<String, Plugin>();
+	// likelihoodMap = new HashMap<String, Integer[]>();
+	// IDNodeMap = new HashMap<String, JSONObject>();
+	//
+	// List<Plugin> plugins = new ArrayList<Plugin>();
+	//
+	// // find top level beast element
+	// NodeList nodes = doc.getElementsByTagName("*");
+	// if (nodes == null || nodes.getLength() == 0) {
+	// throw new Exception("Expected top level beast element in XML");
+	// }
+	// Node topNode = nodes.item(0);
+	// // sanity check that we are reading a beast 2 file
+	// double fVersion = getAttributeAsDouble(topNode, "version");
+	// if (!topNode.getNodeName().equals(BEAST_ELEMENT) || fVersion < 2.0 ||
+	// fVersion == Double.MAX_VALUE) {
+	// return plugins;
+	// }
+	// // only process templates
+	// // String sType = getAttribute(topNode, "type");
+	// // if (sType == null || !sType.equals("template")) {
+	// // return plugins;
+	// // }
+	//
+	//
+	// initIDNodeMap(topNode);
+	// parseNameSpaceAndMap(topNode);
+	//
+	// NodeList children = topNode.getChildNodes();
+	// for (int i = 0; i < children.getLength(); i++) {
+	// if (children.item(i).getNodeType() == Node.ELEMENT_NODE) {
+	// Node child = children.item(i);
+	// System.err.println(child.getNodeName());
+	// if (!child.getNodeName().equals(MAP_ELEMENT)) {
+	// plugins.add(createObject(child, PLUGIN_CLASS, null));
+	// }
+	// }
+	// }
+	// initPlugins();
+	// return plugins;
+	// } // parseTemplate
+
+	private void initPlugins() throws Exception {
+		JSONObject node = null;
+		try {
+			for (int i = 0; i < pluginsWaitingToInit.size(); i++) {
+				BEASTInterface plugin = pluginsWaitingToInit.get(i);
+				node = nodesWaitingToInit.get(i);
+				plugin.initAndValidate();
+			}
+		} catch (Exception e) {
+			// next lines for debugging only
+			// plugin.validateInputs();
+			// plugin.initAndValidate();
+			e.printStackTrace();
+			throw new JSONParserException(node, "validate and intialize error: " + e.getMessage(), 110);
+		}
+	}
+
+	/**
+	 * Expand plates in JSON by duplicating the containing XML and replacing the
+	 * plate variable with the appropriate value.
+	 * "plate":{"var":"n",
+	 *  "range": ["CO1", "CO2", "Nuc"],
+	 *  "content": [
+	 *      {"part":"$(n)"}
+	 *      {"otherpart":"$(n).$(m)"}
+	 *      {"yetotherpart":"xyz$(n)"}
+	 *  ]
+	 *  }
+	 *  
+	 *  is replaced by
+	 *  
+	 *  {"part":"CO1"}
+	 *  {"otherpart":"CO1.$(m)"}
+	 *  {"yetotherpart":"xyzCO1"}
+	 *  {"part":"CO2"}
+	 *  {"otherpart":"CO2.$(m)"}
+	 *  {"yetotherpart":"xyzCO2"}
+	 *  {"part":"Nuc"}
+	 *  {"otherpart":"Nuc.$(m)"}
+	 *  {"yetotherpart":"xyzNuc"}
+	 * @throws Exception 
+	 * 
+	 */
+	void processPlates(JSONObject node) throws Exception {
+		for (String key : node.keySet()) {
+			Object o = node.get(key);
+			if (o instanceof JSONObject) {
+				JSONObject child = (JSONObject) o;
+				processPlates((JSONObject) child);
+			}
+			if (o instanceof JSONArray) {
+				JSONArray list = (JSONArray) o;
+				for (int i = 0; i < list.length(); i++) {
+					Object o2 = list.get(i);
+					if (o2 instanceof JSONObject) {
+						JSONObject child = (JSONObject) o2;
+						processPlates(child);
+						if (child.has("plate")) {
+							unrollPlate(list, child);
+						}
+					}
+				}
+			}
+		}
+	} // processPlates
+
+	private void unrollPlate(JSONArray list, JSONObject plate) throws Exception {
+		int index = list.indexOf(plate);
+		if (index < 0) {
+			throw new Exception("Programmer error: plate should be in list");
+		}
+		list.remove(index);
+		if (plate.keySet().size() != 3 || 
+				!plate.has("plate") ||
+				!plate.has("range") ||
+				!plate.has("var")) {
+			throw new JSONParserException(plate, "Plate should only have tree attributes: plate,  range and var", 1007);
+		}
+		
+		Object o = plate.get("range");
+		if (!(o instanceof JSONArray)) {
+			throw new JSONParserException(plate, "Plate attribute range should be a list", 1008);
+		}
+		JSONArray range = (JSONArray) o;
+		
+		o = plate.get("var");
+		if (!(o instanceof String)) {
+			throw new JSONParserException(plate, "Plate attribute var should be a string", 1009);
+		}
+		String varStr = (String) o;
+		
+		for (int i = 0; i < range.length(); i++) {
+			o = range.get(i);
+			if (!(o instanceof String)) {
+				throw new JSONParserException(plate, "Plate range value should be a string", 1010);
+			}
+			String valueStr = (String) o;
+			Object copy = copyReplace(plate, varStr, valueStr);
+			list.insert(index + i, copy);
+		}
+	} // unrollPlate
+
+	private Object copyReplace(Object o, String varStr, String valueStr) {
+		if (o instanceof Number) {
+			return o;
+		} else if (o instanceof Boolean) {
+			return o;
+		} else if (o instanceof String) {
+			String str = (String) o;
+			str = str.replaceAll("\\$\\(" + varStr + "\\)", valueStr);
+			return str;
+		} else if (o instanceof JSONObject) {
+			JSONObject orig = (JSONObject) o;
+			JSONObject copy = new JSONObject();
+			for (String key : orig.keySet()) {
+				Object value = orig.get(key);
+				Object copyValue = copyReplace(value, varStr, valueStr);
+				copy.put(key, copyValue);
+			}
+			return copy;
+		} else if (o instanceof JSONArray) {
+			JSONArray orig = (JSONArray) o;
+			JSONArray copy = new JSONArray();
+			for (int i = 0; i < orig.length(); i++) {
+				Object value = orig.get(i);
+				Object copyValue = copyReplace(value, varStr, valueStr);
+				copy.add(copyValue);
+			}
+			return copy;			
+		}
+		throw new RuntimeException("How did we get here?");
+	} // unrollPlate
+	
+
+	// /**
+	// * Parse an XML fragment representing a Plug-in
+	// * Only the run element or if that does not exist the last child element
+	// of
+	// * the top level <beast> element is considered.
+	// */
+	// public Plugin parseFragment(String sXML, boolean bInitialize) throws
+	// Exception {
+	// m_bInitialize = bInitialize;
+	// // parse the XML fragment into a DOM document
+	// DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+	// doc = factory.newDocumentBuilder().parse(new InputSource(new
+	// StringReader(sXML)));
+	// doc.normalize();
+	// processPlates();
+	//
+	// IDMap = new HashMap<String, Plugin>();
+	// likelihoodMap = new HashMap<String, Integer[]>();
+	// IDNodeMap = new HashMap<String, Node>();
+	//
+	// // find top level beast element
+	// NodeList nodes = doc.getElementsByTagName("*");
+	// if (nodes == null || nodes.getLength() == 0) {
+	// throw new Exception("Expected top level beast element in XML");
+	// }
+	// Node topNode = nodes.item(0);
+	// initIDNodeMap(topNode);
+	// parseNameSpaceAndMap(topNode);
+	//
+	// NodeList children = topNode.getChildNodes();
+	// if (children.getLength() == 0) {
+	// throw new Exception("Need at least one child element");
+	// }
+	// int i = children.getLength() - 1;
+	// while (i >= 0 && (children.item(i).getNodeType() != Node.ELEMENT_NODE ||
+	// !children.item(i).getNodeName().equals("run"))) {
+	// i--;
+	// }
+	// if (i < 0) {
+	// i = children.getLength() - 1;
+	// while (i >= 0 && children.item(i).getNodeType() != Node.ELEMENT_NODE) {
+	// i--;
+	// }
+	// }
+	// if (i < 0) {
+	// throw new Exception("Need at least one child element");
+	// }
+	//
+	// Plugin plugin = createObject(children.item(i), PLUGIN_CLASS, null);
+	// initPlugins();
+	// return plugin;
+	// } // parseFragment
+	//
+	// /**
+	// * Parse XML fragment that will be wrapped in a beast element
+	// * before parsing. This allows for ease of creating Plugin objects,
+	// * like this:
+	// * Tree tree = (Tree) new
+	// XMLParser().parseBareFragment("<tree spec='beast.util.TreeParser' newick='((1:1,3:1):1,2:2)'/>");
+	// * to create a simple tree.
+	// */
+	// public Plugin parseBareFragment(String sXML, boolean bInitialize) throws
+	// Exception {
+	// // get rid of XML processing instruction
+	// sXML = sXML.replaceAll("<\\?xml[^>]*>", "");
+	// if (sXML.indexOf("<beast") > -1) {
+	// return parseFragment(sXML, bInitialize);
+	// } else {
+	// return parseFragment("<beast>" + sXML + "</beast>", bInitialize);
+	// }
+	// }
+	//
+	// public List<Plugin> parseBareFragments(String sXML, boolean bInitialize)
+	// throws Exception {
+	// m_bInitialize = bInitialize;
+	// // parse the XML fragment into a DOM document
+	// DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+	// doc = factory.newDocumentBuilder().parse(new InputSource(new
+	// StringReader(sXML)));
+	// doc.normalize();
+	// processPlates();
+	//
+	// // find top level beast element
+	// NodeList nodes = doc.getElementsByTagName("*");
+	// if (nodes == null || nodes.getLength() == 0) {
+	// throw new Exception("Expected top level beast element in XML");
+	// }
+	// Node topNode = nodes.item(0);
+	// initIDNodeMap(topNode);
+	// parseNameSpaceAndMap(topNode);
+	//
+	// NodeList children = topNode.getChildNodes();
+	// List<Plugin> plugins = new ArrayList<Plugin>();
+	// for (int i = 0; i < children.getLength(); i++) {
+	// if (children.item(i).getNodeType() == Node.ELEMENT_NODE) {
+	// Plugin plugin = createObject(children.item(i), PLUGIN_CLASS, null);
+	// plugins.add(plugin);
+	// }
+	// }
+	// initPlugins();
+	// return plugins;
+	// }
+
+	/**
+	 * parse BEAST file as DOM document
+	 * 
+	 * @throws Exception
+	 */
+	public void parse() throws Exception {
+		// find top level beast element
+		JSONObject nodes = doc;
+		if (nodes == null || nodes.keySet().size() == 0) {
+			throw new Exception("Expected top level beast element in XML");
+		}
+		double fVersion = getAttributeAsDouble(nodes, "version");
+		if (fVersion < 2.0 || fVersion == Double.MAX_VALUE) {
+			throw new JSONParserException(nodes, "Wrong version: only versions > 2.0 are supported", 101);
+		}
+
+		initIDNodeMap(doc);
+		parseNameSpaceAndMap(doc);
+
+		// parseState();
+		parseRunElement(doc);
+		initPlugins();
+	} // parse
+
+	/**
+	 * Traverse DOM beast.tree and grab all nodes that have an 'id' attribute
+	 * Throw exception when a duplicate id is encountered
+	 * 
+	 * @param node
+	 * @throws Exception
+	 */
+	void initIDNodeMap(JSONObject node) throws Exception {
+		String ID = getID(node);
+		if (ID != null) {
+			if (IDNodeMap.containsKey(ID)) {
+				throw new JSONParserException(node, "IDs should be unique. Duplicate id '" + ID + "' found", 104);
+			}
+			IDNodeMap.put(ID, node);
+		}
+		for (Object key : node.keySet()) {
+			Object o = node.get((String) key);
+			if (o instanceof JSONObject) {
+				initIDNodeMap((JSONObject) o);
+			}
+			if (o instanceof JSONArray) {
+				JSONArray list = (JSONArray) o;
+				for (int i = 0; i < list.length(); i++) {
+					Object o2 = list.get(i);
+					if (o2 instanceof JSONObject) {
+						initIDNodeMap((JSONObject) o2);
+					}
+				}
+			}
+		}
+	}
+
+	/**
+	 * find out namespaces (beast/@namespace attribute) and element to class
+	 * maps, which reside in beast/map elements <beast version='2.0'
+	 * namespace='snap:beast.util'> <map
+	 * name='snapprior'>snap.likelihood.SnAPPrior</map> <map
+	 * name='snaplikelihood'>snap.likelihood.SnAPTreeLikelihood</map>
+	 * 
+	 * @param topNode
+	 * @throws XMLParserException
+	 */
+	void parseNameSpaceAndMap(JSONObject topNode) throws XMLParserException {
+		// process namespaces
+		if (topNode.has("namespace")) {
+			String sNameSpace = getAttribute(topNode, "namespace");
+			setNameSpace(sNameSpace);
+		} else {
+			// make sure that the default namespace is in there
+			if (m_sNameSpaces == null) {
+				m_sNameSpaces = new String[1];
+				m_sNameSpaces[0] = "";
+			}
+		}
+
+		// // process map elements
+		// NodeList nodes = doc.getElementsByTagName(MAP_ELEMENT);
+		// for (int i = 0; i < nodes.getLength(); i++) {
+		// Node child = nodes.item(i);
+		// String sName = getAttribute(child, "name");
+		// if (sName == null) {
+		// throw new XMLParserException(child,
+		// "name attribute expected in map element", 300);
+		// }
+		// if (!element2ClassMap.containsKey(sName)) {
+		// // throw new XMLParserException(child, "name '" + sName +
+		// "' is already defined as " + m_sElement2ClassMap.get(sName), 301);
+		// // }
+		//
+		// // get class
+		// String sClass = child.getTextContent();
+		// // remove spaces
+		// sClass = sClass.replaceAll("\\s", "");
+		// // go through namespaces in order they are declared to find the
+		// correct class
+		// boolean bDone = false;
+		// for (String sNameSpace : m_sNameSpaces) {
+		// try {
+		// // sanity check: class should exist
+		// if (!bDone && Class.forName(sNameSpace + sClass) != null) {
+		// element2ClassMap.put(sName, sClass);
+		// System.err.println(sName + " => " + sNameSpace + sClass);
+		// String reserved = getAttribute(child, "reserved");
+		// if (reserved != null && reserved.toLowerCase().equals("true")) {
+		// reservedElements.add(sName);
+		// }
+		//
+		// bDone = true;
+		// }
+		// } catch (ClassNotFoundException e) {
+		// //System.err.println("Not found " + e.getMessage());
+		// // TODO: handle exception
+		// }
+		// }
+		// }
+		// }
+	} // parseNameSpaceAndMap
+
+	public void setNameSpace(String sNameSpaceStr) {
+		String[] sNameSpaces = sNameSpaceStr.split(":");
+		// append dot after every non-zero namespace
+		m_sNameSpaces = new String[sNameSpaces.length + 1];
+		int i = 0;
+		for (String sNameSpace : sNameSpaces) {
+			if (sNameSpace.length() > 0) {
+				if (sNameSpace.charAt(sNameSpace.length() - 1) != '.') {
+					sNameSpace += '.';
+				}
+			}
+			m_sNameSpaces[i++] = sNameSpace;
+		}
+		// make sure that the default namespace is in there
+		m_sNameSpaces[i] = "";
+	}
+
+	void parseRunElement(JSONObject topNode) throws Exception {
+		// find mcmc element
+		Object o = doc.get(ANALYSIS_ELEMENT);
+		if (o == null) {
+			throw new JSONParserException(topNode, "Expected " + ANALYSIS_ELEMENT + " top level object in file", 102);
+		}
+		if (!(o instanceof JSONArray)) {
+			throw new JSONParserException(topNode, "Expected " + ANALYSIS_ELEMENT + " to be a list", 1020);
+		}
+		JSONArray analysis = (JSONArray) o;
+		runnable = null;
+		for (int i = 0; i < analysis.length(); i++) {
+			o = analysis.get(i);
+			if (!(o instanceof JSONObject)) {
+				throw new JSONParserException(topNode, ANALYSIS_ELEMENT + " should only contain objects", 1021);
+			}
+			JSONObject node = (JSONObject) o;
+			o = createObject(node, RUNNABLE_CLASS, null);
+			if (o instanceof Runnable) {
+				if (runnable != null) {
+					 throw new JSONParserException(node, "Expected only one runnable element in file",  103);
+				}
+				runnable = (Runnable) o;
+			}
+		}
+		if (runnable == null) {
+			 throw new JSONParserException(topNode, "Expected at least one runnable element in file",  1030);
+		}
+	} // parseRunElement
+
+	/**
+	 * Check that plugin is a class that is assignable to class with name
+	 * sClass. This involves a parameter clutch to deal with non-real
+	 * parameters. This needs a bit of work, obviously...
+	 */
+	boolean checkType(String sClass, BEASTInterface plugin) throws Exception {
+		// parameter clutch
+		if (plugin instanceof Parameter<?>) {
+			for (String nameSpace : m_sNameSpaces) {
+				//nameSpace = nameSpace.replaceAll("beast", "yabby");
+				if ((nameSpace + sClass).equals(RealParameter.class.getName())) {
+					return true;
+				}
+			}
+		}
+		if (sClass.equals(INPUT_CLASS)) {
+			return true;
+		}
+		for (String nameSpace : m_sNameSpaces) {
+			//nameSpace = nameSpace.replaceAll("beast", "yabby");
+			try {
+				if (Class.forName(nameSpace + sClass).isInstance(plugin)) {
+					return true;
+				}
+			} catch (Exception e) {
+				// ignore
+			}
+		}
+		return false;
+	} // checkType
+
+	BEASTInterface createObject(JSONObject node, String className, BEASTInterface parent) throws Exception {
+		//className = className.replaceAll("beast", "yabby");
+		// try the IDMap first
+		String ID = getID(node);
+
+		if (ID != null) {
+			if (IDMap.containsKey(ID)) {
+				BEASTInterface plugin = IDMap.get(ID);
+				if (checkType(className, plugin)) {
+					return plugin;
+				}
+				throw new JSONParserException(node, "id=" + ID + ". Expected object of type " + className + " instead of "
+						+ plugin.getClass().getName(), 105);
+			}
+		}
+
+		String IDRef = getIDRef(node);
+		if (IDRef != null) {
+			// produce warning if there are other attributes than idref
+			if (node.keySet().size() > 1) {
+				// check if there is just 1 attribute
+				System.err.println("Element " + getAttribute((JSONObject) node.getParent(), "name") + " found with idref='" + IDRef
+						+ "'. All other attributes are ignored.\n");
+			}
+			if (IDMap.containsKey(IDRef)) {
+				BEASTInterface plugin = IDMap.get(IDRef);
+				if (checkType(className, plugin)) {
+					return plugin;
+				}
+				throw new JSONParserException(node, "id=" + IDRef + ". Expected object of type " + className + " instead of "
+						+ plugin.getClass().getName(), 106);
+			} else if (IDNodeMap.containsKey(IDRef)) {
+				BEASTInterface plugin = createObject(IDNodeMap.get(IDRef), className, parent);
+				if (checkType(className, plugin)) {
+					return plugin;
+				}
+				throw new JSONParserException(node, "id=" + IDRef + ". Expected object of type " + className + " instead of "
+						+ plugin.getClass().getName(), 107);
+			}
+			throw new JSONParserException(node, "Could not find object associated with idref " + IDRef, 170);
+		}
+		// it's not in the ID map yet, so we have to create a new object
+		String specClass = className;
+		// String sElementName = node.getNodeName();
+
+		// if (element2ClassMap.containsKey(sElementName)) {
+		// sSpecClass = element2ClassMap.get(sElementName);
+		// }
+		String spec = getAttribute(node, "spec");
+		if (spec != null) {
+			specClass = spec;
+		}
+		//specClass = specClass.replaceAll("beast", "yabby");
+
+		Object o = null;
+		// try to create object from sSpecName, taking namespaces in account
+		try {
+			boolean bDone = false;
+			for (String nameSpace : m_sNameSpaces) {
+				try {
+					if (!bDone) {
+						//nameSpace = nameSpace.replaceAll("beast", "yabby");
+						Class<?> c = Class.forName(nameSpace + specClass); 
+						o = c.newInstance();
+						bDone = true;
+						break;
+					}
+				} catch (InstantiationException e) {
+					// we only get here when the class exists, but cannot be
+					// created
+					// for instance because it is abstract
+					throw new Exception("Cannot instantiate class. Please check the spec attribute.");
+				} catch (ClassNotFoundException e) {
+					// TODO: handle exception
+					System.err.println(e.getMessage());
+				}
+			}
+			if (!bDone) {
+				throw new Exception("Class could not be found. Did you mean " + guessClass(specClass) + "?");
+				// throw new ClassNotFoundException(sSpecClass);
+			}
+			// hack required to make log-parsing easier
+			if (o instanceof State) {
+				state = (State) o;
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw new JSONParserException(node, "Cannot create class: " + specClass + ". " + e.getMessage(), 122);
+		}
+		// sanity check
+		if (!(o instanceof BEASTInterface)) {
+			// if (o instanceof Input) {
+			// // if we got this far, it is a basic input,
+			// // that is, one of the form <input name='xyz'>value</input>
+			// String sName = getAttribute(node, "name");
+			// if (sName == null) {
+			// sName = "value";
+			// }
+			// String sText = node.getTextContent();
+			// if (sText.length() > 0) {
+			// setInput(node, parent, sName, sText);
+			// }
+			// return null;
+			// } else {
+			throw new JSONParserException(node, "Expected object to be instance of Plugin", 108);
+			// }
+		}
+		// set id
+		BEASTInterface plugin = (BEASTInterface) o;
+		plugin.setID(ID);
+		register(node, plugin);
+		// process inputs
+		parseInputs(plugin, node);
+		// initialise
+		if (m_bInitialize) {
+			try {
+				plugin.validateInputs();
+				pluginsWaitingToInit.add(plugin);
+				nodesWaitingToInit.add(node);
+				// plugin.initAndValidate();
+			} catch (Exception e) {
+				// next lines for debugging only
+				// plugin.validateInputs();
+				// plugin.initAndValidate();
+				e.printStackTrace();
+				throw new JSONParserException(node, "validate and intialize error: " + e.getMessage(), 110);
+			}
+		}
+		return plugin;
+	} // createObject
+
+	/**
+	 * find closest matching class to named class *
+	 */
+	String guessClass(String className) {
+		String sName = className;
+		if (className.contains(".")) {
+			sName = className.substring(className.lastIndexOf('.') + 1);
+		}
+		List<String> pluginNames = AddOnManager.find(beast.core.BEASTInterface.class, AddOnManager.IMPLEMENTATION_DIR);
+		int bestDistance = Integer.MAX_VALUE;
+		String closest = null;
+		for (String pluginName : pluginNames) {
+			String className2 = pluginName.substring(pluginName.lastIndexOf('.') + 1);
+			int distance = getLevenshteinDistance(sName, className2);
+
+			if (distance < bestDistance) {
+				bestDistance = distance;
+				closest = pluginName;
+			}
+		}
+		return closest;
+	}
+
+	/**
+	 * Compute edit distance between two strings = Levenshtein distance *
+	 */
+	public static int getLevenshteinDistance(String s, String t) {
+		if (s == null || t == null) {
+			throw new IllegalArgumentException("Strings must not be null");
+		}
+
+		int n = s.length(); // length of s
+		int m = t.length(); // length of t
+
+		if (n == 0) {
+			return m;
+		} else if (m == 0) {
+			return n;
+		}
+
+		int p[] = new int[n + 1]; // 'previous' cost array, horizontally
+		int d[] = new int[n + 1]; // cost array, horizontally
+		int _d[]; // placeholder to assist in swapping p and d
+
+		// indexes into strings s and t
+		int i; // iterates through s
+		int j; // iterates through t
+		char t_j; // jth character of t
+		int cost; // cost
+		for (i = 0; i <= n; i++) {
+			p[i] = i;
+		}
+		for (j = 1; j <= m; j++) {
+			t_j = t.charAt(j - 1);
+			d[0] = j;
+			for (i = 1; i <= n; i++) {
+				cost = s.charAt(i - 1) == t_j ? 0 : 1;
+				// minimum of cell to the left+1, to the top+1, diagonally left
+				// and up +cost
+				d[i] = Math.min(Math.min(d[i - 1] + 1, p[i] + 1), p[i - 1] + cost);
+			}
+			// copy current distance counts to 'previous row' distance counts
+			_d = p;
+			p = d;
+			d = _d;
+		}
+
+		// our last action in the above loop was to switch d and p, so p now
+		// actually has the most recent cost counts
+		return p[n];
+	}
+
+	void parseInputs(BEASTInterface parent, JSONObject node) throws Exception {
+		// sanity check: all attributes should be valid input names
+		for (String name : node.keySet()) {
+			if (!(name.equals("id") || name.equals("idref") || name.equals("spec") || name.equals("name"))) {
+				try {
+					parent.getInput(name);
+				} catch (Exception e) {
+					throw new JSONParserException(node, e.getMessage(), 1006);
+				}
+			}
+		}
+
+		if (node.keySet() != null) {
+			// parse inputs in occurrance of inputs in the parent object
+			// this determines the order in which initAndValidate is called
+			List<Input<?>> inputs = parent.listInputs();
+			Set<String> done = new HashSet<String>();
+			for (Input<?> input : inputs) {
+				String name = input.getName();
+				processInput(name, node, parent);
+				done.add(name);
+			}
+			
+			for (String name : node.keySet()) {
+				if (!done.contains(name)) {
+					// this can happen with Maps
+					processInput(name, node, parent);
+				}
+			}
+		}
+		
+		
+		// // process element nodes
+		// NodeList children = node.getChildNodes();
+		// String sText = "";
+		// for (int i = 0; i < children.getLength(); i++) {
+		// Node child = children.item(i);
+		// if (child.getNodeType() == Node.ELEMENT_NODE) {
+		// String sElement = child.getNodeName();
+		// // resolve name of the input
+		// String sName = getAttribute(child, "name");
+		// if (sName == null) {
+		// sName = sElement;
+		// }
+		// // resolve base class
+		// String sClass = PLUGIN_CLASS;
+		// if (element2ClassMap.containsKey(sElement)) {
+		// sClass = element2ClassMap.get(sElement);
+		// }
+		// Plugin childItem = createObject(child, sClass, parent);
+		// if (childItem != null) {
+		// setInput(node, parent, sName, childItem);
+		// }
+		// nChildElements++;
+		// } else if (child.getNodeType() == Node.CDATA_SECTION_NODE ||
+		// child.getNodeType() == Node.TEXT_NODE) {
+		// sText += child.getTextContent();
+		// }
+		// }
+		// if (!sText.matches("\\s*")) {
+		// setInput(node, parent, "value", sText);
+		// }
+		//
+		// if (nChildElements == 0) {
+		// String sContent = node.getTextContent();
+		// if (sContent != null && sContent.length() > 0 &&
+		// sContent.replaceAll("\\s", "").length() > 0) {
+		// try {
+		// setInput(node, parent, "value", sContent);
+		// } catch (Exception e) {
+		// //
+		// }
+		// }
+		// }
+
+		// fill in missing inputs, if an input provider is available
+		if (requiredInputProvider != null) {
+			for (Input<?> input : parent.listInputs()) {
+				if (input.get() == null && input.getRule() == Validate.REQUIRED) {
+					Object o = requiredInputProvider.createInput(parent, input, partitionContext);
+					if (o != null) {
+						input.setValue(o, parent);
+					}
+				}
+			}
+		}
+	} // setInputs
+
+	private void processInput(String name, JSONObject node, BEASTInterface parent) throws Exception {
+		if (node.has(name)) {
+			if (!(name.equals("id") || name.equals("idref") || name.equals("spec") || name.equals("name"))) {
+				Object o = node.get(name);
+				if (o instanceof String) {
+					String value = (String) o;
+					if (value.startsWith("@")) {
+						String IDRef = value.substring(1);
+						JSONObject element = new JSONObject();
+						element.put("idref", IDRef);
+						BEASTInterface plugin = createObject(element, YOBJECT_CLASS, parent);
+						setInput(node, parent, name, plugin);
+					} else {
+						setInput(node, parent, name, value);
+					}
+				} else if (o instanceof Number) {
+					parent.setInputValue(name, o);
+				} else if (o instanceof Boolean) {
+					parent.setInputValue(name, o);
+				} else if (o instanceof JSONObject) {
+					JSONObject child = (JSONObject) o;
+					String className = getClassName(child, name, parent);
+					BEASTInterface childItem = createObject(child, className, parent);
+					if (childItem != null) {
+						setInput(node, parent, name, childItem);
+					}
+					// nChildElements++;
+				} else if (o instanceof JSONArray) {
+					JSONArray list = (JSONArray) o;
+					for (int i = 0; i < list.length(); i++) {
+						Object o2 = list.get(i);
+						if (o2 instanceof JSONObject) {
+							JSONObject child = (JSONObject) o2;
+							String className = getClassName(child, name, parent);
+							BEASTInterface childItem = createObject(child, className, parent);
+							if (childItem != null) {
+								setInput(node, parent, name, childItem);
+							}
+						} else {
+							parent.setInputValue(name, o2);									
+						}
+					}
+				} else {
+					throw new Exception("Developer error: Don't know how to handle this JSON construction");
+				}
+			}
+		}		
+	}
+
+	void setInput(JSONObject node, BEASTInterface plugin, String name, BEASTInterface plugin2) throws JSONParserException {
+		try {
+			Input<?> input = plugin.getInput(name);
+			// test whether input was not set before, this is done by testing
+			// whether input has default value.
+			// for non-list inputs, this should be true if the value was not
+			// already set before
+			// for list inputs this is always true.
+			if (input.get() == input.defaultValue) {
+				plugin.setInputValue(name, plugin2);
+			} else {
+				throw new Exception("Multiple entries for non-list input " + input.getName());
+			}
+			return;
+		} catch (Exception e) {
+			if (name.equals("xml:base")) {
+				// ignore xml:base attributes introduces by XML entities
+				return;
+			}
+			if (e.getMessage().contains("101")) {
+				String type = "?";
+				try {
+					type = plugin.getInput(name).getType().getName().replaceAll(".*\\.", "");
+				} catch (Exception e2) {
+					// TODO: handle exception
+				}
+				throw new JSONParserException(node, e.getMessage() + " expected '" + type + "' but got '"
+						+ plugin2.getClass().getName().replaceAll(".*\\.", "") + "'", 123);
+			} else {
+				throw new JSONParserException(node, e.getMessage(), 130);
+			}
+		}
+	}
+
+	void setInput(JSONObject node, BEASTInterface plugin, String sName, String sValue) throws JSONParserException {
+		try {
+			plugin.setInputValue(sName, sValue);
+			return;
+		} catch (Exception e) {
+			try {
+				plugin.setInputValue(sName, sValue);
+			} catch (Exception e1) {
+				// TODO Auto-generated catch block
+				e1.printStackTrace();
+			}
+			throw new JSONParserException(node, e.getMessage(), 124);
+		}
+	}
+
+	/**
+	 * records id in IDMap, for ease of retrieving Plugins associated with
+	 * idrefs *
+	 */
+	void register(JSONObject node, BEASTInterface plugin) {
+		String ID = getID(node);
+		if (ID != null) {
+			IDMap.put(ID, plugin);
+		}
+	}
+
+	public static String getID(JSONObject node) {
+		return getAttribute(node, "id");
+	}
+
+	public static String getIDRef(JSONObject node) {
+		return getAttribute(node, "idref");
+	}
+
+	/**
+	 * get string value of attribute with given name as opposed to double or
+	 * integer value (see methods below) *
+	 */
+	public static String getAttribute(JSONObject node, String attName) {
+		if (node.has(attName)) {
+			return node.get(attName).toString();
+		}
+		return null;
+	}
+
+	/**
+	 * get integer value of attribute with given name *
+	 */
+	public static int getAttributeAsInt(JSONObject node, String attName) {
+		String sAtt = getAttribute(node, attName);
+		if (sAtt == null) {
+			return -1;
+		}
+		return Integer.parseInt(sAtt);
+	}
+
+	/**
+	 * get double value of attribute with given name *
+	 */
+	public static double getAttributeAsDouble(JSONObject node, String attName) {
+		String sAtt = getAttribute(node, attName);
+		if (sAtt == null) {
+			return Double.MAX_VALUE;
+		}
+		return Double.parseDouble(sAtt);
+	}
+
+	public interface RequiredInputProvider {
+		Object createInput(BEASTInterface plugin, Input<?> input, PartitionContext context);
+	}
+
+	public void setRequiredInputProvider(RequiredInputProvider provider, PartitionContext context) {
+		requiredInputProvider = provider;
+		partitionContext = context;
+	}
+
+	String getClassName(JSONObject child, String name, BEASTInterface parent) throws Exception {
+		String className = getAttribute(child, "spec");
+		if (className == null) {
+			Input<?> input = parent.getInput(name);
+			Class<?> type = input.getType();
+			if (type == null) {
+				input.determineClass(parent);
+				type = input.getType();
+			}
+			className = type.getName();
+		}
+		if (element2ClassMap.containsKey(className)) {
+			className = element2ClassMap.get(className);
+		}
+		return className;
+	}
+
+	/**
+	 * parses file and formats it using the XMLProducer *
+	 */
+	public static void main(String[] args) {
+		try {
+			// redirect stdout to stderr
+			PrintStream out = System.out;
+			System.setOut(System.err);
+			// parse the file
+			JSONParser parser = new JSONParser();
+			BEASTInterface plugin = parser.parseFile(new File(args[0]));
+			// restore stdout
+			System.setOut(out);
+			System.out.println(new XMLProducer().toXML(plugin));
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+
+} // class JSONParser
diff --git a/src/beast/util/JSONParserException.java b/src/beast/util/JSONParserException.java
new file mode 100644
index 0000000..5a568fa
--- /dev/null
+++ b/src/beast/util/JSONParserException.java
@@ -0,0 +1,137 @@
+/*
+* File JSONParserException.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+package beast.util;
+
+import org.json.JSONArray;
+import org.json.JSONObject;
+
+/**
+ * Exception thrown by JSONParser
+ * that keeps track of the JSONOBject that caused the anomaly.
+ */
+ at SuppressWarnings("serial")
+public class JSONParserException extends Exception {
+    /**
+     * JSONObject where the anomaly was in the vicinity *
+     */
+	JSONObject node;
+
+	/**
+     * short description of the anomaly *
+     */
+    String m_sMsg;
+    
+    /**
+     * number of the anomaly, for ease of finding in the code *
+     */
+    int m_nErrorNr;
+
+    public JSONParserException(JSONObject node, String sMsg, int nErrorNr) {
+        super(sMsg);
+        this.node = node;
+        m_sMsg = "";
+        m_nErrorNr = nErrorNr;
+    }
+
+    // format message and resolve parent
+    public String getMessage() {
+        String msg = "\nError " + m_nErrorNr + " parsing the json input file\n\n" + m_sMsg + super.getMessage();
+        if (node == null) {
+            return "NULL NODE\n" + msg;
+        }
+        String path = "";
+        Object o = this.node;
+        while (o != null) {
+        	if (o instanceof JSONObject) {
+        		JSONObject node = (JSONObject) o; 
+	            String ID;
+	            ID = getAttribute(node, "id");
+	            if (ID != null) {
+	                ID = " id: \"" + ID + "\"";
+	            } else {
+	                ID = "";
+	            }
+	
+	            String name = "";
+	            Object p = node.getParent();
+	            if (p instanceof JSONObject) {
+	            	JSONObject parent = (JSONObject) p;
+	            	for (String key : parent.keySet()) {
+	            		if (parent.get(key).equals(o)) {
+	            			name = "\"" + key + "\": ";
+	            		}
+	            	}
+	            }
+	
+	            String spec;
+	            spec = getAttribute(node, "spec");
+	            if (spec != null) {
+	                spec = " spec: \"" + spec + "\"";
+	            } else {
+	                spec = "";
+	            }
+	            path = path.replaceAll("  \"", "      \"");
+	            path = path.replaceAll("  \\{", "      \\{");
+	            path = path.replaceAll("  \\[", "      [");
+	            path = path.replaceAll("  \\]", "      ]");
+	            path = path.replaceAll("  \\}", "      \\}");
+	            path = "  " + name + "{" + ID  + spec + "\n" + path + "  }\n";
+	            
+	            o = node.getParent();
+        	} else if (o instanceof JSONArray) {
+        		JSONArray list = (JSONArray) o;
+	            Object p = list.getParent();
+	            String name = "";
+	            if (p instanceof JSONObject) {
+	            	JSONObject parent = (JSONObject) p;
+	            	for (String key : parent.keySet()) {
+	            		if (parent.get(key).equals(o)) {
+	            			name = "\"" + key + "\": ";
+	            		}
+	            	}
+	            }
+
+	            path = path.replaceAll("  \"", "      \"");
+	            path = path.replaceAll("  \\{", "      \\{");
+	            path = path.replaceAll("  \\[", "      [");
+	            path = path.replaceAll("  \\]", "      ]");
+	            path = path.replaceAll("  \\}", "      \\}");
+	            path = "  " + name + "[\n"  + path + "  ]\n";        	
+	            o = list.getParent();
+        	}
+
+        }
+        msg += "\n\nError detected about here:\n" + path;
+        return msg;
+    } // getMessage
+
+    String getAttribute(JSONObject node, String target) {
+    	if (node.has(target)) {
+    		return  node.get(target).toString();
+    	}
+   		return null;
+    } // getAttribute
+
+} // JSONParserException
diff --git a/src/beast/util/JSONProducer.java b/src/beast/util/JSONProducer.java
new file mode 100644
index 0000000..ee3e499
--- /dev/null
+++ b/src/beast/util/JSONProducer.java
@@ -0,0 +1,449 @@
+package beast.util;
+
+import java.io.File;
+import java.io.PrintStream;
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+
+import beast.core.Input;
+import beast.core.BEASTObject;
+import beast.core.BEASTInterface;
+import beast.evolution.alignment.Alignment;
+import beast.evolution.tree.TraitSet;
+
+
+
+
+
+/*
+ * Why JSON:
+ *
+ * JSON vs XML: http://www.json.org/fatfree.html
+ * + JSON more readable
+ * + JSON less to type
+ * 
+ * JSON vs YAML: http://en.wikipedia.org/wiki/YAML
+ * 
+ * + JSON has editor support -- gedit, any javascript editor
+ * + JSON validation -- http://jsonlint.com/ for validation
+ * + JSON = javascript, useful format for GUIs
+ * - JSON bracket mathcing is not well supported in editors
+ * 
+ * + YAML no issues with brackets
+ * - YAML litte editor support
+*/
+
+public class JSONProducer {
+
+    /**
+     * list of objects already converted to XML, so an idref suffices
+     */
+    HashSet<BEASTInterface> isDone;
+    @SuppressWarnings("rawtypes")
+    HashSet<Input> isInputsDone;
+    /**
+     * list of IDs of elements produces, used to prevent duplicate ID generation
+     */
+    HashSet<String> IDs;
+    /**
+     * #spaces before elements in XML *
+     */
+    int indentCount;
+    
+    final public static String DEFAULT_NAMESPACE = "beast.core:beast.evolution.alignment:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood";
+
+    public JSONProducer() {
+        super();
+    }
+
+    /**
+     * Main entry point for this class
+     * Given a plug-in, produces the XML in BEAST 2 format
+     * representing the plug-in. This assumes plugin is Runnable
+     */
+    public String toJSON(BEASTInterface plugin) {
+    	return toJSON(plugin, new ArrayList<BEASTInterface>());
+    }
+
+	@SuppressWarnings("rawtypes")
+    public String toJSON(BEASTInterface plugin, Collection<BEASTInterface> others) {
+        try {
+            StringBuffer buf = new StringBuffer();
+            //buf.append("{\"version\": \"2.0\",\n\"namespace\": \"" + DEFAULT_NAMESPACE + "\",\n\n" +
+            //		"\"" + JSONParser.ANALYSIS_ELEMENT + "\": [\n");
+            buf.append("{version: \"2.0\",\nnamespace: \"" + DEFAULT_NAMESPACE + "\",\n\n" +
+            		JSONParser.ANALYSIS_ELEMENT + ": [\n");
+            //buf.append("\n\n");
+            isDone = new HashSet<BEASTInterface>();
+            isInputsDone = new HashSet<Input>();
+            IDs = new HashSet<String>();
+            indentCount = 1;
+            
+            List<BEASTInterface> priorityPlugins = new ArrayList<BEASTInterface>();
+            findPriorityPlugins(plugin, priorityPlugins);
+            for (BEASTInterface plugin2 : priorityPlugins) {
+            	if (!isDone.contains(plugin2)) {
+            		//String name = plugin2.getClass().getName();
+            		//name = name.substring(name.lastIndexOf('.') + 1).toLowerCase();
+            		pluginToJSON(plugin2, BEASTInterface.class, buf, null, true);
+            		buf.append(",");
+            	}
+            }
+            buf.append("\n\n");
+            
+            pluginToJSON(plugin, BEASTInterface.class, buf, null, true);
+            String end = "\n]\n}";
+            buf.append(end);
+
+            String JSON = buf.toString();
+            String[] nameSpaces = DEFAULT_NAMESPACE.split(":");
+            for (String nameSpace : nameSpaces) {
+                //JSON = JSON.replaceAll("\"spec\": \"" + nameSpace + ".", "\"spec\": \"");
+                JSON = JSON.replaceAll("spec: \"" + nameSpace + ".", "spec: \"");
+            }
+            return JSON;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+    } // toXML
+
+    private void findPriorityPlugins(BEASTInterface plugin, List<BEASTInterface> priorityPlugins) throws IllegalArgumentException, IllegalAccessException {
+    	if (plugin.getClass().equals(Alignment.class)) {
+    		priorityPlugins.add(plugin);
+    	}
+    	if (plugin instanceof TraitSet) {
+    		priorityPlugins.add(plugin);
+    	}
+		for (BEASTInterface plugin2 : plugin.listActivePlugins()) {
+			findPriorityPlugins(plugin2, priorityPlugins);
+		}
+	}
+
+	/**
+     * like modelToXML, but without the cleanup *
+     * For plugin without name
+     */
+//    @SuppressWarnings("rawtypes")
+//    public String toJSON(Plugin plugin, String sName) {
+//        try {
+//            StringBuffer buf = new StringBuffer();
+//            isDone = new HashSet<Plugin>();
+//            isInputsDone = new HashSet<Input>();
+//            ids = new HashSet<String>();
+//            indentCount = 0;
+//            pluginToJSON(plugin, Plugin.class, buf, sName, false);
+//            return buf.toString();
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//            return null;
+//        }
+//    } // toRawJSON
+
+
+
+    public String stateNodeToJSON(BEASTInterface plugin) {
+        try {
+            StringBuffer buf = new StringBuffer();
+            //buf.append("<" + XMLParser.beast_ELEMENT + " version='2.0'>\n");
+            isDone = new HashSet<BEASTInterface>();
+            IDs = new HashSet<String>();
+            indentCount = 1;
+            pluginToJSON(plugin, null, buf, null, false);
+            return buf.toString();
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+
+
+    /**
+     * produce elements for a plugin with name sName, putting results in buf.
+     * It tries to create XML conforming to the XML transformation rules (see XMLParser)
+     * that is moderately readable.
+     */
+//    @SuppressWarnings("rawtypes")
+    void pluginToJSON(BEASTInterface plugin, Class<?> defaultType, StringBuffer buf, String name, boolean bIsTopLevel) throws Exception {
+        // determine element name, default is input, otherswise find one of the defaults
+
+    	String indent = "";
+        for (int i = 0; i < indentCount; i++) {
+        	indent += "\t";
+            //buf.append("    ");
+        }
+        indentCount++;
+
+        // open element
+        boolean needsComma = false;
+        if (name != null) {
+            //buf.append((indentCount == 1 ? "" : indent.substring(1)) + " \"" + name + "\": {");
+            buf.append((indentCount == 1 ? "" : indent.substring(1)) + " " + name + ": {");
+        } else {
+        	buf.append(indent + "{");
+        }
+
+        boolean skipInputs = false;
+        if (isDone.contains(plugin)) {
+            // XML is already produced, we can idref it
+        	buf.append((needsComma == true) ? ",\n" + indent + " " : ""); 
+            //buf.append("\"idref\": \"" + plugin.getID() + "\" ");
+            buf.append("idref: \"" + plugin.getID() + "\" ");
+            needsComma = true;
+            skipInputs = true;
+        } else {
+            // see whether a reasonable id can be generated
+            if (plugin.getID() != null && !plugin.getID().equals("")) {
+                String sID = plugin.getID();
+                // ensure ID is unique
+                if (IDs.contains(sID)) {
+                    int k = 1;
+                    while (IDs.contains(sID + k)) {
+                        k++;
+                    }
+                    sID = sID + k;
+                }
+            	buf.append((needsComma == true) ? ",\n" + indent + " " : ""); 
+                //buf.append("\"id\": \"" + normalise(null, sID) + "\"");
+                buf.append("id: \"" + normalise(null, sID) + "\"");
+                needsComma = true;
+                IDs.add(sID);
+            }
+            isDone.add(plugin);
+        }
+        String sClassName = plugin.getClass().getName();
+        if (skipInputs == false) {
+            // only add spec element if it cannot be deduced otherwise (i.e., by idref)
+        	if (defaultType != null && !defaultType.getName().equals(sClassName)) {
+	        	buf.append((needsComma == true) ? ",\n" + indent + " " : ""); 
+	            //buf.append("\"spec\": \"" + sClassName + "\"");
+	            buf.append("spec: \"" + sClassName + "\"");
+	            needsComma = true;
+        	}
+        }
+
+        if (!skipInputs) {
+            // process inputs of this plugin
+            // first, collect values as attributes
+            List<Input<?>> inputs = plugin.listInputs();
+            for (Input<?> input : inputs) {
+            	StringBuffer buf2 = new StringBuffer();
+                inputToJSON(input.getName(), plugin, buf2, true, indent);
+                if (buf2.length() > 0) {
+                	buf.append((needsComma == true) ? "," : "");
+                	buf.append(buf2);
+                    needsComma = true;
+                }
+            }
+            // next, collect values as input elements
+            StringBuffer buf2 = new StringBuffer();
+            for (Input<?> input : inputs) {
+            	StringBuffer buf3 = new StringBuffer();
+                inputToJSON(input.getName(), plugin, buf3, false, indent);
+                if (buf3.length() > 0) {
+                	buf2.append((needsComma == true) ? ",\n" : "\n");
+                	buf2.append(buf3);
+                    needsComma = true;
+                }
+            }
+            if (buf2.length() != 0) {
+                buf.append(buf2);
+            }
+            indentCount--;
+            if (needsComma) {
+                buf.append("\n"+indent);
+            }
+            needsComma = true;
+        } else {
+            // close element
+            indentCount--;
+            buf.append("");
+            needsComma = true;
+        }
+        //if (m_nIndent < 2) {
+        // collapse newlines if there are no sub-objects
+        String str = buf.toString();
+        if (str.indexOf('}') < 0 && str.length() < 1024) {
+        	str = str.replaceAll("\\s+", " ");
+        	buf.delete(0, buf.length());
+        	buf.append(indent);
+        	buf.append(str);
+        }
+        
+        buf.append("}");
+        //}
+    } // pluginToJSON
+
+
+    /**
+     * produce JSON for an input of a plugin, both as attribute/value pairs for
+     * primitive inputs (if isShort=true) and as individual elements (if bShort=false)
+     *
+     * @param sInput: name of the input
+     * @param plugin: plugin to produce this input XML for
+     * @param buf:    gets XML results are appended
+     * @param isShort: flag to indicate attribute/value format (true) or element format (false)
+     * @throws Exception
+     */
+    @SuppressWarnings({ "rawtypes", "unchecked" })
+    void inputToJSON(String input0, BEASTInterface plugin, StringBuffer buf, boolean isShort, String indent) throws Exception {
+        Field[] fields = plugin.getClass().getFields();
+        for (int i = 0; i < fields.length; i++) {
+            if (fields[i].getType().isAssignableFrom(Input.class)) {
+                Input input = (Input) fields[i].get(plugin);
+                if (input.getName().equals(input0)) {
+                    // found the input with name sInput
+                    if (input.get() != null) {
+                        // distinguish between Map, List, Plugin and primitive input types
+                        if (input.get() instanceof Map) {
+                            if (!isShort) {
+	                        	Map<String,?> map = (Map<String,?>) input.get();
+	                        	StringBuffer buf2 = new StringBuffer();
+	                        	// determine label widith
+	                        	int whiteSpaceWidth = 0;
+	                        	for (String key : map.keySet()) {
+	                        		whiteSpaceWidth = Math.max(whiteSpaceWidth, key.length());
+	                        	}
+	                        	boolean needsComma = false;
+	                        	List<String> keys = new ArrayList<String>();
+	                        	keys.addAll(map.keySet());
+	                        	Collections.sort(keys);
+	                        	for (String key : keys) {
+	                            	if (needsComma) {
+	                            		buf2.append(",\n");
+	                            	}
+	                        		buf2.append(indent + " " + key);
+	                        		for (int k = key.length(); k < whiteSpaceWidth; k++) {
+	                        			buf2.append(' ');
+	                        		}
+	                        		buf2.append(" :\"" + map.get(key) +"\"");
+	                        		needsComma = true;
+	                        	}
+	                        	buf.append(buf2);
+                            }
+                        	return;
+                        } else if (input.get() instanceof List) {
+                            if (!isShort) {
+                            	StringBuffer buf2 = new StringBuffer();
+                            	//buf2.append(indent + " \"" + input0 + "\": [\n");
+                            	buf2.append(indent + " " + input0 + ": [\n");
+                            	boolean needsComma = false;
+                            	int oldLen = buf2.length();
+                                for (Object o2 : (List) input.get()) {
+                                	if (needsComma) {
+                                		buf2.append(",\n");
+                                	}
+                                	StringBuffer buf3 = new StringBuffer();
+                                	if (o2 instanceof BEASTInterface) {
+                                		pluginToJSON((BEASTInterface) o2, input.getType(), buf3, null, false);
+                                	} else {
+                                		buf2.append(o2.toString());
+                                	}
+                                    buf2.append(buf3);
+                                    needsComma = oldLen < buf2.length();
+                                }
+                                if (buf2.length() != oldLen) {
+                                	buf.append(buf2);
+                                	buf.append("\n" + indent + "  ]");
+                                }
+                            }
+                            return;
+                        } else if (input.get() instanceof BEASTInterface) {
+                        	if (!input.get().equals(input.defaultValue)) {
+	                            if (isShort && isDone.contains((BEASTInterface) input.get())) {
+	                                buf.append(" " + input0 + ": \"@" + ((BEASTInterface) input.get()).getID() + "\"");
+	                                isInputsDone.add(input);
+	                            }
+	                            if (!isShort && !isInputsDone.contains(input)) {
+	                                pluginToJSON((BEASTInterface) input.get(), input.getType(), buf, input0, false);
+	                            }
+                        	}
+                            return;
+                        } else {
+                        	if (!input.get().equals(input.defaultValue)) {
+	                            // primitive type, see if
+	                            String sValue = input.get().toString();
+	                            if (isShort) {
+	                                if (sValue.indexOf('\n') < 0) {
+	                                    //buf.append(" \"" + input0 + "\": " + normalise(input, input.get().toString()) + "");
+	                                    buf.append(" " + input0 + ": " + normalise(input, input.get().toString()) + "");
+	                                }
+	                            } else {
+	                                if (sValue.indexOf('\n') >= 0) {
+//	                                    for (int j = 0; j < m_nIndent; j++) {
+//	                                        buf.append("    ");
+//	                                    }
+	                                    //if (sInput.equals("value")) {
+	                                    //    buf.append(input.get().toString());
+	                                    //} else {
+	                                        //buf.append(indent + "\"" + input0 + "\": " + normalise(input, input.get().toString()) + "");
+	                                        buf.append(indent + "" + input0 + ": " + normalise(input, input.get().toString()) + "");
+	                                    //}
+	                                }
+	                            }
+                        	}
+                            return;
+                        }
+                    } else {
+                        // value=null, no XML to produce
+                        return;
+                    }
+                }
+            }
+        }
+        // should never get here
+        throw new Exception("Could not find input " + input0 + " in plugin " + plugin.getID() + " " + plugin.getClass().getName());
+    } // inputToJSON
+
+    
+   /** convert plain text string to XML string, replacing some entities **/
+    String normalise(Input<?> input, String str) {
+    	str = str.replaceAll("\\\\", "\\\\\\\\");
+    	str = str.replaceAll("/", "\\\\/");
+    	str = str.replaceAll("\b", "\\\\b");
+    	str = str.replaceAll("\f", "\\\\f");
+    	str = str.replaceAll("\t", "\\\\t");
+    	str = str.replaceAll("\\r", "\\\\r");
+    	str = str.replaceAll("\"", "\\\\\"");
+    	str = str.replaceAll("\n", "\\\\n");
+    	if (input != null && !input.getType().equals(Double.class) &&
+    			!input.getType().equals(Integer.class)&&
+    			!input.getType().equals(Boolean.class)) {
+    		str = "\"" + str + "\"";
+    	}
+    	return str;
+    }
+    
+
+	
+	@SuppressWarnings("resource")
+	public static void main(String[] args) throws Exception {
+		// convert BEAST 2 XML to BEAST json file
+		XMLParser parser = new XMLParser();
+		BEASTInterface plugin = parser.parseFile(new File(args[0]));
+
+		String JSONFile = args[0].replace(".xml", ".json");
+		PrintStream out;
+		if (JSONFile.endsWith(".json")) {
+			out = new PrintStream(new File(JSONFile));
+		} else {
+			out = System.out;
+		}
+		
+		JSONProducer writer = new JSONProducer();
+		String JSON = writer.toJSON(plugin);
+		out.println(JSON);
+		out.close();
+		
+		
+	}
+
+}
+
+
diff --git a/src/beast/util/LogAnalyser.java b/src/beast/util/LogAnalyser.java
new file mode 100644
index 0000000..dc999f0
--- /dev/null
+++ b/src/beast/util/LogAnalyser.java
@@ -0,0 +1,525 @@
+package beast.util;
+
+import beast.app.BEASTVersion;
+import beast.app.util.Utils;
+import beast.core.util.ESS;
+import beast.core.util.Log;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import static beast.util.OutputUtils.format;
+
+
+public class LogAnalyser {
+    // MAX_LAG typical = 2000; = maximum lag for ESS, TODO not used
+    protected final static int MAX_LAG = 2000;
+
+    public static final int BURN_IN_PERCENTAGE = 10; // default
+
+    protected final String sFile;
+
+    /**
+     * column labels in log file *
+     */
+    protected String[] m_sLabels;
+
+    /**
+     * distinguish various column types *
+     */
+    protected enum type {
+        REAL, INTEGER, BOOL, NOMINAL
+    }
+
+    ;
+    protected type[] m_types;
+    /**
+     * range of a column, if it is not a REAL *
+     */
+    protected List<String>[] m_ranges;
+
+    /**
+     * data from log file with burn-in removed *
+     */
+    protected Double[][] m_fTraces;
+
+    /**
+     * statistics on the data, one per column. First column (sample nr) is not set *
+     */
+    Double[] m_fMean, m_fStdError, m_fStdDev, m_fMedian, m_f95HPDup, m_f95HPDlow, m_fESS, m_fACT, m_fGeometricMean;
+
+    /**
+     * used for storing comments before the actual log file commences *
+     */
+    protected String m_sPreAmble;
+
+    final protected static String BAR = "|---------|---------|---------|---------|---------|---------|---------|---------|";
+
+    public LogAnalyser() {
+        sFile = null;
+    }
+
+    /**
+     *
+     * @param args
+     * @param nBurnInPercentage  nBurnInPercentage typical = 10; percentage of data that can be ignored
+     * @throws Exception
+     */
+    public LogAnalyser(String[] args, int nBurnInPercentage) throws Exception {
+        sFile = args[args.length - 1];
+        readLogFile(sFile, nBurnInPercentage);
+        calcStats();
+    }
+
+    public LogAnalyser(String[] args) throws Exception {
+        this(args, BURN_IN_PERCENTAGE);
+    }
+
+    public LogAnalyser(String sFile, int nBurnInPercentage) throws Exception {
+        this.sFile = sFile;
+        readLogFile(sFile, nBurnInPercentage);
+        calcStats();
+    }
+
+    public LogAnalyser(String sFile) throws Exception {
+        this(sFile, BURN_IN_PERCENTAGE);
+    }
+
+    protected void readLogFile(String sFile, int nBurnInPercentage) throws Exception {
+        log("\nLoading " + sFile);
+        BufferedReader fin = new BufferedReader(new FileReader(sFile));
+        String sStr = null;
+        m_sPreAmble = "";
+        m_sLabels = null;
+        int nData = 0;
+        // first, sweep through the log file to determine size of the log
+        while (fin.ready()) {
+            sStr = fin.readLine();
+            if (sStr.indexOf('#') < 0 && sStr.matches(".*[0-9a-zA-Z].*")) {
+                if (m_sLabels == null)
+                    m_sLabels = sStr.split("\\s");
+                else
+                    nData++;
+            } else {
+                m_sPreAmble += sStr + "\n";
+            }
+        }
+        int nLines = Math.max(1, nData / 80);
+        // reserve memory
+        int nItems = m_sLabels.length;
+        m_ranges = new List[nItems];
+        int nBurnIn = nData * nBurnInPercentage / 100;
+        m_fTraces = new Double[nItems][nData - nBurnIn];
+        fin = new BufferedReader(new FileReader(sFile));
+        nData = -nBurnIn - 1;
+        logln(", burnin " + nBurnInPercentage + "%, skipping " + nBurnIn + " log lines\n\n" + BAR);
+        // grab data from the log, ignoring burn in samples
+        m_types = new type[nItems];
+        Arrays.fill(m_types, type.INTEGER);
+        while (fin.ready()) {
+            sStr = fin.readLine();
+            int i = 0;
+            if (sStr.indexOf('#') < 0 && sStr.matches("[0-9].*")) // {
+                //nData++;
+                if (++nData >= 0) //{
+                    for (String sStr2 : sStr.split("\\s")) {
+                        try {
+                            if (sStr2.indexOf('.') >= 0) {
+                                m_types[i] = type.REAL;
+                            }
+                            m_fTraces[i][nData] = Double.parseDouble(sStr2);
+                        } catch (Exception e) {
+                            if (m_ranges[i] == null) {
+                                m_ranges[i] = new ArrayList<String>();
+                            }
+                            if (!m_ranges[i].contains(sStr2)) {
+                                m_ranges[i].add(sStr2);
+                            }
+                            m_fTraces[i][nData] = 1.0 * m_ranges[i].indexOf(sStr2);
+                        }
+                        i++;
+                    }
+            //}
+            //}
+            if (nData % nLines == 0) {
+                log("*");
+            }
+        }
+        logln("");
+        // determine types
+        for (int i = 0; i < nItems; i++)
+            if (m_ranges[i] != null)
+                if (m_ranges[i].size() == 2 && m_ranges[i].contains("true") && m_ranges[i].contains("false") ||
+                        m_ranges[i].size() == 1 && (m_ranges[i].contains("true") || m_ranges[i].contains("false")))
+                    m_types[i] = type.BOOL;
+                else
+                    m_types[i] = type.NOMINAL;
+
+    } // readLogFile
+
+    /**
+     * calculate statistics on the data, one per column.
+     * First column (sample nr) is not set *
+     */
+    void calcStats() {
+        logln("\nCalculating statistics\n\n" + BAR);
+        int nStars = 0;
+        int nItems = m_sLabels.length;
+        m_fMean = new Double[nItems];
+        m_fStdError = new Double[nItems];
+        m_fStdDev = new Double[nItems];
+        m_fMedian = new Double[nItems];
+        m_f95HPDlow = new Double[nItems];
+        m_f95HPDup = new Double[nItems];
+        m_fESS = new Double[nItems];
+        m_fACT = new Double[nItems];
+        m_fGeometricMean = new Double[nItems];
+        int nSampleInterval = (int) (m_fTraces[0][1] - m_fTraces[0][0]);
+        for (int i = 1; i < nItems; i++) {
+            // calc mean and standard deviation
+            Double[] fTrace = m_fTraces[i];
+            double fSum = 0, fSum2 = 0;
+            for (double f : fTrace) {
+                fSum += f;
+                fSum2 += f * f;
+            }
+            if (m_types[i] != type.NOMINAL) {
+                m_fMean[i] = fSum / fTrace.length;
+                m_fStdDev[i] = Math.sqrt(fSum2 / fTrace.length - m_fMean[i] * m_fMean[i]);
+            } else {
+                m_fMean[i] = Double.NaN;
+                m_fStdDev[i] = Double.NaN;
+            }
+
+            if (m_types[i] == type.REAL || m_types[i] == type.INTEGER) {
+                // calc median, and 95% HPD interval
+                Double[] fSorted = fTrace.clone();
+                Arrays.sort(fSorted);
+                m_fMedian[i] = fSorted[fTrace.length / 2];
+                // n instances cover 95% of the trace, reduced down by 1 to match Tracer
+                int n = (int) ((fSorted.length - 1) * 95.0 / 100.0);
+                double fMinRange = Double.MAX_VALUE;
+                int hpdIndex = 0;
+                for (int k = 0; k < fSorted.length - n; k++) {
+                    double fRange = fSorted[k + n] - fSorted[k];
+                    if (fRange < fMinRange) {
+                        fMinRange = fRange;
+                        hpdIndex = k;
+                    }
+                }
+                m_f95HPDlow[i] = fSorted[hpdIndex];
+                m_f95HPDup[i] = fSorted[hpdIndex + n];
+
+                // calc effective sample size
+                m_fACT[i] = ESS.ACT(m_fTraces[i], nSampleInterval);
+                m_fStdError[i] = ESS.stdErrorOfMean(fTrace, nSampleInterval);
+                m_fESS[i] = fTrace.length / (m_fACT[i] / nSampleInterval);
+
+                // calc geometric mean
+                if (fSorted[0] > 0) {
+                    // geometric mean is only defined when all elements are positive
+                    double gm = 0;
+                    for (double f : fTrace)
+                        gm += Math.log(f);
+                    m_fGeometricMean[i] = Math.exp(gm / (double) fTrace.length);
+                } else
+                    m_fGeometricMean[i] = Double.NaN;
+            } else {
+                m_fMedian[i] = Double.NaN;
+                m_f95HPDlow[i] = Double.NaN;
+                m_f95HPDup[i] = Double.NaN;
+                ;
+                m_fACT[i] = Double.NaN;
+                ;
+                m_fESS[i] = Double.NaN;
+                ;
+                m_fGeometricMean[i] = Double.NaN;
+            }
+            while (nStars < 80 * (i + 1) / nItems) {
+                log("*");
+                nStars++;
+            }
+        }
+        logln("\n");
+    } // calcStats
+
+    public void setData(Double[][] fTraces, String[] sLabels, type[] types) {
+        m_fTraces = fTraces.clone();
+        m_sLabels = sLabels.clone();
+        m_types = types.clone();
+        calcStats();
+    }
+
+    public void setData(Double[] fTrace, int nSampleStep) {
+        Double[][] fTraces = new Double[2][];
+        fTraces[0] = new Double[fTrace.length];
+        for (int i = 0; i < fTrace.length; i++) {
+            fTraces[0][i] = (double) i * nSampleStep;
+        }
+        fTraces[1] = fTrace.clone();
+        setData(fTraces, new String[]{"column", "data"}, new type[]{type.REAL, type.REAL});
+    }
+
+    public int indexof(String sLabel) {
+        return CollectionUtils.indexof(sLabel, m_sLabels);
+	}
+
+    /**
+     * First column "Sample" (sample nr) needs to be removed
+     * @return
+     */
+    public List<String> getLabels() {
+        if (m_sLabels.length < 2)
+            return new ArrayList<>();
+        return CollectionUtils.toList(m_sLabels, 1, m_sLabels.length);
+    }
+
+    public Double [] getTrace(int index) {
+    	return m_fTraces[index].clone();
+    }
+
+    public Double [] getTrace(String sLabel) {
+    	return m_fTraces[indexof(sLabel)].clone();
+    }
+
+    public double getMean(String sLabel) {
+        return getMean(indexof(sLabel));
+    }
+
+    public double getStdError(String sLabel) {
+        return getStdError(indexof(sLabel));
+    }
+
+    public double getStdDev(String sLabel) {
+        return getStdDev(indexof(sLabel));
+    }
+
+    public double getMedian(String sLabel) {
+        return getMedian(indexof(sLabel));
+    }
+
+    public double get95HPDup(String sLabel) {
+        return get95HPDup(indexof(sLabel));
+    }
+
+    public double get95HPDlow(String sLabel) {
+        return get95HPDlow(indexof(sLabel));
+    }
+
+    public double getESS(String sLabel) {
+        return getESS(indexof(sLabel));
+    }
+
+    public double getACT(String sLabel) {
+        return getACT(indexof(sLabel));
+    }
+
+    public double getGeometricMean(String sLabel) {
+        return getGeometricMean(indexof(sLabel));
+    }
+
+    public double getMean(int iColumn) {
+        return m_fMean[iColumn];
+    }
+
+    public double getStdDev(int iColumn) {
+        return m_fStdDev[iColumn];
+    }
+
+    public double getStdError(int iColumn) {
+        return m_fStdError[iColumn];
+    }
+
+    public double getMedian(int iColumn) {
+        return m_fMedian[iColumn];
+    }
+
+    public double get95HPDup(int iColumn) {
+        return m_f95HPDup[iColumn];
+    }
+
+    public double get95HPDlow(int iColumn) {
+        return m_f95HPDlow[iColumn];
+    }
+
+    public double getESS(int iColumn) {
+        return m_fESS[iColumn];
+    }
+
+    public double getACT(int iColumn) {
+        return m_fACT[iColumn];
+    }
+
+    public double getGeometricMean(int iColumn) {
+        return m_fGeometricMean[iColumn];
+    }
+
+    public double getMean(Double[] fTrace) {
+        setData(fTrace, 1);
+        return m_fMean[1];
+    }
+
+    public double getStdDev(Double[] fTrace) {
+        setData(fTrace, 1);
+        return m_fStdDev[1];
+    }
+
+    public double getMedian(Double[] fTrace) {
+        setData(fTrace, 1);
+        return m_fMedian[1];
+    }
+
+    public double get95HPDup(Double[] fTrace) {
+        setData(fTrace, 1);
+        return m_f95HPDup[1];
+    }
+
+    public double get95HPDlow(Double[] fTrace) {
+        setData(fTrace, 1);
+        return m_f95HPDlow[1];
+    }
+
+    public double getESS(Double[] fTrace) {
+        setData(fTrace, 1);
+        return m_fESS[1];
+    }
+
+    public double getACT(Double[] fTrace, int nSampleStep) {
+        setData(fTrace, nSampleStep);
+        return m_fACT[1];
+    }
+
+    public double getGeometricMean(Double[] fTrace) {
+        setData(fTrace, 1);
+        return m_fGeometricMean[1];
+    }
+
+    public String getLogFile() {
+        return sFile;
+    }
+
+    /**
+     * print statistics for each column except first column (sample nr). *
+     */
+    final String SPACE = OutputUtils.SPACE;
+    public void print(PrintStream out) {
+    	// set up header for prefix, if any is specified
+    	String prefix = System.getProperty("prefix");
+    	String prefixHead = (prefix == null ? "" : "prefix ");
+    	if (prefix != null) {
+	    	String [] p = prefix.trim().split("\\s+");
+	    	if (p.length > 1) {
+	    		prefixHead = "";
+	    		for (int i = 0; i < p.length; i++) {
+	    			prefixHead += "prefix" + i + " ";
+	    		}
+	    	}
+    	}
+    	
+        try {
+            // delay so that stars can be flushed from stderr
+            Thread.sleep(100);
+        } catch (Exception e) {
+        }
+        int nMax = 0;
+        for (int i = 1; i < m_sLabels.length; i++)
+            nMax = Math.max(m_sLabels[i].length(), nMax);
+        String sSpace = "";
+        for (int i = 0; i < nMax; i++)
+            sSpace += " ";
+
+        out.println("item" + sSpace.substring(4) + " " + prefixHead +
+        		format("mean") + format("stderr")  + format("stddev")  + format("median")  + format("95%HPDlo")  + format("95%HPDup")  + format("ACT")  + format("ESS")  + format("geometric-mean"));
+        for (int i = 1; i < m_sLabels.length; i++) {
+            out.println(m_sLabels[i] + sSpace.substring(m_sLabels[i].length()) + SPACE + (prefix == null ? "" : prefix + SPACE) +
+                    format(m_fMean[i]) + SPACE + format(m_fStdError[i]) + SPACE + format(m_fStdDev[i]) +
+                    SPACE + format(m_fMedian[i]) + SPACE + format(m_f95HPDlow[i]) + SPACE + format(m_f95HPDup[i]) +
+                    SPACE + format(m_fACT[i]) + SPACE + format(m_fESS[i]) + SPACE + format(m_fGeometricMean[i]));
+        }
+    }
+
+    protected void log(String s) {
+        System.err.print(s);
+    }
+
+    protected void logln(String s) {
+        System.err.println(s);
+    }
+
+    static void printUsageAndExit() {
+    	System.out.println("LogAnalyser [-b <burninPercentage] [file1] ... [filen]");
+    	System.out.println("-burnin <burninPercentage>");
+    	System.out.println("--burnin <burninPercentage>");
+    	System.out.println("-b <burninPercentage> percentage of log file to disregard, default " + BURN_IN_PERCENTAGE);
+    	System.out.println("-help");
+    	System.out.println("--help");
+    	System.out.println("-h print this message");
+    	System.out.println("[fileX] log file to analyse. Multiple files are allowed, each is analysed separately");
+    	System.exit(0);
+    }
+    
+    /**
+     * @param args
+     */
+    public static void main(String[] args) {
+        try {
+            LogAnalyser analyser;
+            	// process args
+            	int burninPercentage = BURN_IN_PERCENTAGE;
+            	List<String> files = new ArrayList<>();
+            	int i = 0;
+            	while (i < args.length) {
+            		String arg = args[i];
+            		switch (arg) {
+            		case "-b":
+            		case "-burnin":
+            		case "--burnin":
+            			if (i+1 >= args.length) {
+            				Log.warning.println("-b argument requires another argument");
+            				printUsageAndExit();
+            			}
+            			burninPercentage = Integer.parseInt(args[i+1]);
+            			i += 2;
+            			break;
+            		case "-h":
+            		case "-help":
+            		case "--help":
+            			printUsageAndExit();
+            			break;
+            		default:
+            			if (arg.startsWith("-")) {
+            				Log.warning.println("unrecognised command " + arg);
+            				printUsageAndExit();
+            			}
+            			files.add(arg);
+            			i++;
+            		}
+            	}
+            	if (files.size() == 0) {
+            		// no file specified, open file dialog to select one
+	                BEASTVersion version = new BEASTVersion();
+	                File file = Utils.getLoadFile("LogAnalyser " + version.getVersionString() + " - Select log file to analyse",
+	                        null, "BEAST log (*.log) Files", "log", "txt");
+	                if (file == null) {
+	                    return;
+	                }
+	                analyser = new LogAnalyser(file.getAbsolutePath(), burninPercentage);
+	                analyser.print(System.out);
+            	} else {
+            		// process files
+            		for (String file : files) {
+    	                analyser = new LogAnalyser(file, burninPercentage);
+    	                analyser.print(System.out);
+            		}
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+}
diff --git a/src/beast/util/LogComparator.java b/src/beast/util/LogComparator.java
new file mode 100644
index 0000000..6894405
--- /dev/null
+++ b/src/beast/util/LogComparator.java
@@ -0,0 +1,168 @@
+package beast.util;
+
+
+import beast.app.BEASTVersion;
+import beast.app.util.Utils;
+
+import java.io.File;
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import static beast.util.OutputUtils.format;
+
+/**
+ * Compare log files to find the set of parameters same between logs but having significantly different value.
+ * Z score = 2 * |mean1 - mean2| / (stdError1 + stdError2), If Z score > 2 it is significant.
+ * It is limited to 2 logs at a time at moment.
+ *
+ * @author Walter Xie
+ */
+public class LogComparator {
+    /**
+     * matched column labels in log files
+     */
+    protected List<String> matchedLabels;
+
+    protected Double[] zScore; // Z score
+
+    protected LogAnalyser analyser1, analyser2;
+
+    /**
+     * at least 2 logs
+     * @param analyser1
+     * @param analyser2
+     */
+    public LogComparator (LogAnalyser analyser1, LogAnalyser analyser2) {
+        assert analyser1 != null;
+        assert analyser2 != null;
+
+        this.analyser1 = analyser1;
+        this.analyser2 = analyser2;
+        compareLogs();
+    }
+
+    public double getZScore(String sLabel) {
+        int index = matchedLabels.indexOf(sLabel);
+        if (index < 0)
+            throw new IllegalArgumentException("Cannot find " + sLabel + " from matched parameter list !");
+
+        return zScore[index];
+    }
+
+    protected void compareLogs() {
+        matchedLabels = CollectionUtils.intersection(analyser1.getLabels(), analyser2.getLabels());
+
+        if (matchedLabels.size() < 1)
+            throw new IllegalArgumentException("There is no parameter name matched between log files !");
+
+        zScore = new Double[matchedLabels.size()];
+
+        for (String mLabel : matchedLabels) {
+            int index1 = analyser1.indexof(mLabel);
+            double m1 = analyser1.getMean(index1);
+            double se1 = analyser1.getStdError(index1);
+
+            int index2 = analyser2.indexof(mLabel);
+            double m2 = analyser2.getMean(index2);
+            double se2 = analyser2.getStdError(index2);
+
+            int index = matchedLabels.indexOf(mLabel);
+            // Z score = 2 * |m1 - m2| / (se1 + se2), If Z score > 2 it is significant
+            zScore[index] = 2 * Math.abs(m1 - m2) / (se1 + se2);
+        }
+    }
+
+    final String SPACE = OutputUtils.SPACE;
+    final String STAR = "* ";
+    final String NON_STAR = "  ";
+    public void print(PrintStream out, boolean verbose) {
+        // set up header for prefix, if any is specified
+        String prefix = System.getProperty("prefix");
+        String prefixHead = (prefix == null ? "" : "prefix ");
+        if (prefix != null) {
+            String [] p = prefix.trim().split("\\s+");
+            if (p.length > 1) {
+                prefixHead = "";
+                for (int i = 0; i < p.length; i++) {
+                    prefixHead += "prefix" + i + " ";
+                }
+            }
+        }
+
+        int nMax = 0;
+        for (int i = 1; i < matchedLabels.size(); i++)
+            nMax = Math.max(matchedLabels.get(i).length(), nMax);
+        String sSpace = "";
+        for (int i = 0; i < nMax; i++)
+            sSpace += " ";
+
+        out.println("Comparing log " + analyser1.getLogFile() + " and " + analyser2.getLogFile() + "\n");
+
+        List<String> significantLabels = new ArrayList<>();
+        if (verbose) {
+            out.println("item" + sSpace.substring(4) + " " + prefixHead + "   " + format("ZScore") +
+                    format("mean1") + format("stderr1") + format("mean2") + format("stderr2"));
+
+            for (int i = 1; i < matchedLabels.size(); i++) {
+                String mLabel = matchedLabels.get(i);
+
+                int index1 = analyser1.indexof(mLabel);
+                double m1 = analyser1.getMean(index1);
+                double se1 = analyser1.getStdError(index1);
+
+                int index2 = analyser2.indexof(mLabel);
+                double m2 = analyser2.getMean(index2);
+                double se2 = analyser2.getStdError(index2);
+
+                out.println(mLabel + sSpace.substring(mLabel.length()) + SPACE + (prefix == null ? "" : prefix + SPACE) +
+                        (zScore[i] > 2 ? STAR : NON_STAR) + SPACE + format(zScore[i]) + SPACE +
+                        format(m1) + SPACE + format(se1) + SPACE + format(m2) + SPACE + format(se2));
+
+                if (zScore[i] > 2) significantLabels.add(mLabel);
+            }
+        }
+
+        out.println("\nThere are " + significantLabels.size() + " parameters having significantly different value : " +
+                OutputUtils.toString(significantLabels) + "\n\n");
+    }
+
+    /**
+     * main
+     */
+    public static void main(String[] args) {
+        LogAnalyser analyser1 = null;
+        LogAnalyser analyser2 = null;
+        try {
+            if (args.length == 0) {
+                BEASTVersion version = new BEASTVersion();
+                File file = Utils.getLoadFile("LogComparator " + version.getVersionString() + " - Select first log file to analyse",
+                        null, "BEAST log (*.log) Files", "log", "txt");
+                if (file == null) {
+                    return;
+                }
+                analyser1 = new LogAnalyser(file.getAbsolutePath());
+
+                file = Utils.getLoadFile("LogComparator " + version.getVersionString() + " - Select second log file to analyse",
+                        null, "BEAST log (*.log) Files", "log", "txt");
+                if (file == null) {
+                    return;
+                }
+                analyser2 = new LogAnalyser(file.getAbsolutePath());
+
+            } else {
+                analyser1 = new LogAnalyser(args[0]);
+                analyser2 = new LogAnalyser(args[1]);
+            }
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        LogComparator logComparator = new LogComparator(analyser1, analyser2);
+        logComparator.print(System.out, true);
+
+    } // main
+
+
+}
diff --git a/src/beast/util/MersenneTwisterFast.java b/src/beast/util/MersenneTwisterFast.java
new file mode 100644
index 0000000..3a8b937
--- /dev/null
+++ b/src/beast/util/MersenneTwisterFast.java
@@ -0,0 +1,780 @@
+/*
+* File MersenneTwisterFast.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+/*
+ * MersenneTwisterFast.java
+ *
+ * Copyright (C) 2002-2006 Alexei Drummond and Andrew Rambaut
+ *
+ * This file is part of BEAST.
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership and licensing.
+ *
+ * BEAST 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
+ * of the License, or (at your option) any later version.
+ *
+ *  BEAST 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 BEAST; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+package beast.util;
+
+import java.io.FileNotFoundException;
+import java.io.PrintStream;
+import java.io.Serializable;
+
+import beast.math.GammaFunction;
+import beast.math.statistic.DiscreteStatistics;
+
+
+
+/**
+ * MersenneTwisterFast:
+ * <p/>
+ * A simulation quality fast random number generator (MT19937)
+ * with the  same public methods as java.beast.util.Random.
+ * <p/>
+ * <p>About the Mersenne Twister.
+ * This is a Java version of the C-program for MT19937: Integer version.
+ * next(32) generates one pseudorandom unsigned integer (32bit)
+ * which is uniformly distributed among 0 to 2^32-1  for each
+ * call.  next(int bits) >>>'s by (32-bits) to get a value ranging
+ * between 0 and 2^bits-1 long inclusive; hope that's correct.
+ * setSeed(seed) set initial values to the working area
+ * of 624 words. For setSeed(seed), seed is any 32-bit integer
+ * except for 0.
+ * <p/>
+ * Reference.
+ * M. Matsumoto and T. Nishimura,
+ * "Mersenne Twister: A 623-Dimensionally Equidistributed Uniform
+ * Pseudo-Random Number Generator",
+ * <i>ACM Transactions on Modeling and Computer Simulation,</i>
+ * Vol. 8, No. 1, January 1998, pp 3--30.
+ * <p/>
+ * <p>Bug Fixes. This implementation implements the bug fixes made
+ * in Java 1.2's version of Random, which means it can be used with
+ * earlier versions of Java.  See
+ * <a href="http://www.javasoft.com/products/jdk/1.2/docs/api/java/beast.util/Random.html">
+ * the JDK 1.2 java.beast.util.Random documentation</a> for further documentation
+ * on the random-number generation contracts made.  Additionally, there's
+ * an undocumented bug in the JDK java.beast.util.Random.nextBytes() method,
+ * which this code fixes.
+ * <p/>
+ * <p> Important Note.  Just like java.beast.util.Random, this
+ * generator accepts a long seed but doesn't use all of it.  java.beast.util.Random
+ * uses 48 bits.  The Mersenne Twister instead uses 32 bits (int size).
+ * So it's best if your seed does not exceed the int range.
+ * <p/>
+ * <p><a href="http://www.cs.umd.edu/users/seanl/">Sean Luke's web page</a>
+ * <p/>
+ * <p/>
+ * - added shuffling method (Alexei Drummond)
+ * <p/>
+ * - added gamma RV method (Marc Suchard)
+ * <p/>
+ * - thread safety (Remco Bouckaert)
+ * <p/>
+ * This is now package private - it should be accessed using the instance in Randomizer
+ */
+public class MersenneTwisterFast implements Serializable {
+    /**
+     *
+     */
+    private static final long serialVersionUID = 6185086957226269797L;
+    // Period parameters
+    private static final int N = 624;
+    private static final int M = 397;
+    private static final int MATRIX_A = 0x9908b0df;   //  private static final * constant vector a
+    private static final int UPPER_MASK = 0x80000000; // most significant w-r bits
+    private static final int LOWER_MASK = 0x7fffffff; // least significant r bits
+
+
+    // Tempering parameters
+    private static final int TEMPERING_MASK_B = 0x9d2c5680;
+    private static final int TEMPERING_MASK_C = 0xefc60000;
+
+    // #define TEMPERING_SHIFT_U(y)  (y >>> 11)
+    // #define TEMPERING_SHIFT_S(y)  (y << 7)
+    // #define TEMPERING_SHIFT_T(y)  (y << 15)
+    // #define TEMPERING_SHIFT_L(y)  (y >>> 18)
+
+    private int mt[]; // the array for the state vector
+    private int mti; // mti==N+1 means mt[N] is not initialized
+    private int mag01[];
+
+    // a good initial seed (of int size, though stored in a long)
+    private static final long GOOD_SEED = 4357;
+
+    private double nextNextGaussian;
+    private boolean haveNextNextGaussian;
+
+    // The following can be accessed externally by the static accessor methods which
+    // inforce synchronization
+    public static final MersenneTwisterFast DEFAULT_INSTANCE = new MersenneTwisterFast();
+
+    // Added to curernt time in default constructor, and then adjust to allow for programs that construct
+    // multiple MersenneTwisterFast in a short amount of time.
+    private static long seedAdditive_ = 0;
+
+    private long initializationSeed;
+
+    /**
+     * Constructor using the time of day as default seed.
+     */
+    private MersenneTwisterFast() {
+        this(System.currentTimeMillis() + seedAdditive_);
+        seedAdditive_ += nextInt();
+    }
+
+    /**
+     * Constructor using a given seed.  Though you pass this seed in
+     * as a long, it's best to make sure it's actually an integer.
+     *
+     * @param seed generator starting number, often the time of day.
+     */
+    private MersenneTwisterFast(long seed) {
+        if (seed == 0) {
+            setSeed(GOOD_SEED);
+        } else {
+            setSeed(seed);
+        }
+    }
+
+
+    /**
+     * Initalize the pseudo random number generator.
+     * The Mersenne Twister only uses an integer for its seed;
+     * It's best that you don't pass in a long that's bigger
+     * than an int.
+     *
+     * @param seed from constructor
+     */
+    public final void setSeed(long seed) {
+        if (seed == 0) {
+            throw new IllegalArgumentException("Non zero random seed required.");
+        }
+        initializationSeed = seed;
+        haveNextNextGaussian = false;
+
+        mt = new int[N];
+
+        // setting initial seeds to mt[N] using
+        // the generator Line 25 of Table 1 in
+        // [KNUTH 1981, The Art of Computer Programming
+        //    Vol. 2 (2nd Ed.), pp102]
+
+        // the 0xffffffff is commented out because in Java
+        // ints are always 32 bits; hence i & 0xffffffff == i
+
+        mt[0] = ((int) seed); // & 0xffffffff;
+
+        for (mti = 1; mti < N; mti++)
+            mt[mti] = (69069 * mt[mti - 1]); //& 0xffffffff;
+
+        // mag01[x] = x * MATRIX_A  for x=0,1
+        mag01 = new int[2];
+        mag01[0] = 0x0;
+        mag01[1] = MATRIX_A;
+    }
+
+    public final long getSeed() {
+        return initializationSeed;
+    }
+
+    /**
+     * grabbing the next int should be synchronized,
+     * If 2 threads request, say, a double and a gaussian at the same time,
+     * and mti = N - 1, the condition (mit >= N) is false for both threads,
+     * but the first increase mti before the second results in an out-of-bounds
+     * exception when 'return mt[mti++] is called.
+     * <p/>
+     * To prevent this, this part of the code should be synchronized
+     */
+    synchronized private int next() {
+        int y;
+        if (mti >= N)   // generate N words at one time
+        {
+            int kk;
+
+            for (kk = 0; kk < N - M; kk++) {
+                y = (mt[kk] & UPPER_MASK) | (mt[kk + 1] & LOWER_MASK);
+                mt[kk] = mt[kk + M] ^ (y >>> 1) ^ mag01[y & 0x1];
+            }
+            for (; kk < N - 1; kk++) {
+                y = (mt[kk] & UPPER_MASK) | (mt[kk + 1] & LOWER_MASK);
+                mt[kk] = mt[kk + (M - N)] ^ (y >>> 1) ^ mag01[y & 0x1];
+            }
+            y = (mt[N - 1] & UPPER_MASK) | (mt[0] & LOWER_MASK);
+            mt[N - 1] = mt[M - 1] ^ (y >>> 1) ^ mag01[y & 0x1];
+
+            mti = 0;
+        }
+
+        return mt[mti++];
+    }
+
+    public final int nextInt() {
+        int y;
+
+        y = next();
+        y ^= y >>> 11;                          // TEMPERING_SHIFT_U(y)
+        y ^= (y << 7) & TEMPERING_MASK_B;       // TEMPERING_SHIFT_S(y)
+        y ^= (y << 15) & TEMPERING_MASK_C;      // TEMPERING_SHIFT_T(y)
+        y ^= (y >>> 18);                        // TEMPERING_SHIFT_L(y)
+
+        return y;
+    }
+
+
+    public final short nextShort() {
+        int y;
+
+        y = next();
+        y ^= y >>> 11;                          // TEMPERING_SHIFT_U(y)
+        y ^= (y << 7) & TEMPERING_MASK_B;       // TEMPERING_SHIFT_S(y)
+        y ^= (y << 15) & TEMPERING_MASK_C;      // TEMPERING_SHIFT_T(y)
+        y ^= (y >>> 18);                        // TEMPERING_SHIFT_L(y)
+
+        return (short) (y >>> 16);
+    }
+
+
+    public final char nextChar() {
+        int y;
+
+        y = next();
+        y ^= y >>> 11;                          // TEMPERING_SHIFT_U(y)
+        y ^= (y << 7) & TEMPERING_MASK_B;       // TEMPERING_SHIFT_S(y)
+        y ^= (y << 15) & TEMPERING_MASK_C;      // TEMPERING_SHIFT_T(y)
+        y ^= (y >>> 18);                        // TEMPERING_SHIFT_L(y)
+
+        return (char) (y >>> 16);
+    }
+
+
+    public final boolean nextBoolean() {
+        int y;
+
+        y = next();
+        y ^= y >>> 11;                          // TEMPERING_SHIFT_U(y)
+        y ^= (y << 7) & TEMPERING_MASK_B;       // TEMPERING_SHIFT_S(y)
+        y ^= (y << 15) & TEMPERING_MASK_C;      // TEMPERING_SHIFT_T(y)
+        y ^= (y >>> 18);                        // TEMPERING_SHIFT_L(y)
+
+        return ((y >>> 31) != 0);
+    }
+
+
+    public final byte nextByte() {
+        int y;
+
+        y = next();
+        y ^= y >>> 11;                          // TEMPERING_SHIFT_U(y)
+        y ^= (y << 7) & TEMPERING_MASK_B;       // TEMPERING_SHIFT_S(y)
+        y ^= (y << 15) & TEMPERING_MASK_C;      // TEMPERING_SHIFT_T(y)
+        y ^= (y >>> 18);                        // TEMPERING_SHIFT_L(y)
+
+        return (byte) (y >>> 24);
+    }
+
+
+    public final void nextBytes(byte[] bytes) {
+        int y;
+
+        for (int x = 0; x < bytes.length; x++) {
+            y = next();
+            y ^= y >>> 11;                          // TEMPERING_SHIFT_U(y)
+            y ^= (y << 7) & TEMPERING_MASK_B;       // TEMPERING_SHIFT_S(y)
+            y ^= (y << 15) & TEMPERING_MASK_C;      // TEMPERING_SHIFT_T(y)
+            y ^= (y >>> 18);                        // TEMPERING_SHIFT_L(y)
+
+            bytes[x] = (byte) (y >>> 24);
+        }
+    }
+
+
+    public final long nextLong() {
+        int y;
+        int z;
+
+        y = next();
+        y ^= y >>> 11;                          // TEMPERING_SHIFT_U(y)
+        y ^= (y << 7) & TEMPERING_MASK_B;       // TEMPERING_SHIFT_S(y)
+        y ^= (y << 15) & TEMPERING_MASK_C;      // TEMPERING_SHIFT_T(y)
+        y ^= (y >>> 18);                        // TEMPERING_SHIFT_L(y)
+
+        z = next();
+        z ^= z >>> 11;                          // TEMPERING_SHIFT_U(z)
+        z ^= (z << 7) & TEMPERING_MASK_B;       // TEMPERING_SHIFT_S(z)
+        z ^= (z << 15) & TEMPERING_MASK_C;      // TEMPERING_SHIFT_T(z)
+        z ^= (z >>> 18);                        // TEMPERING_SHIFT_L(z)
+
+        return (((long) y) << 32) + (long) z;
+    }
+
+
+    public final double nextDouble() {
+        int y;
+        int z;
+
+        y = next();
+        y ^= y >>> 11;                          // TEMPERING_SHIFT_U(y)
+        y ^= (y << 7) & TEMPERING_MASK_B;       // TEMPERING_SHIFT_S(y)
+        y ^= (y << 15) & TEMPERING_MASK_C;      // TEMPERING_SHIFT_T(y)
+        y ^= (y >>> 18);                        // TEMPERING_SHIFT_L(y)
+
+        z = next();
+        z ^= z >>> 11;                          // TEMPERING_SHIFT_U(z)
+        z ^= (z << 7) & TEMPERING_MASK_B;       // TEMPERING_SHIFT_S(z)
+        z ^= (z << 15) & TEMPERING_MASK_C;      // TEMPERING_SHIFT_T(z)
+        z ^= (z >>> 18);                        // TEMPERING_SHIFT_L(z)
+
+        /* derived from nextDouble documentation in jdk 1.2 docs, see top */
+        return ((((long) (y >>> 6)) << 27) + (z >>> 5)) / (double) (1L << 53);
+    }
+
+    public final double nextGaussian() {
+        if (haveNextNextGaussian) {
+            haveNextNextGaussian = false;
+            return nextNextGaussian;
+        } else {
+            double v1, v2, s;
+            do {
+                int y;
+                int z;
+                int a;
+                int b;
+
+                y = next();
+                y ^= y >>> 11;                          // TEMPERING_SHIFT_U(y)
+                y ^= (y << 7) & TEMPERING_MASK_B;       // TEMPERING_SHIFT_S(y)
+                y ^= (y << 15) & TEMPERING_MASK_C;      // TEMPERING_SHIFT_T(y)
+                y ^= (y >>> 18);                        // TEMPERING_SHIFT_L(y)
+
+                z = next();
+                z ^= z >>> 11;                          // TEMPERING_SHIFT_U(z)
+                z ^= (z << 7) & TEMPERING_MASK_B;       // TEMPERING_SHIFT_S(z)
+                z ^= (z << 15) & TEMPERING_MASK_C;      // TEMPERING_SHIFT_T(z)
+                z ^= (z >>> 18);                        // TEMPERING_SHIFT_L(z)
+
+                a = next();
+                a ^= a >>> 11;                          // TEMPERING_SHIFT_U(a)
+                a ^= (a << 7) & TEMPERING_MASK_B;       // TEMPERING_SHIFT_S(a)
+                a ^= (a << 15) & TEMPERING_MASK_C;      // TEMPERING_SHIFT_T(a)
+                a ^= (a >>> 18);                        // TEMPERING_SHIFT_L(a)
+
+                b = next();
+                b ^= b >>> 11;                          // TEMPERING_SHIFT_U(b)
+                b ^= (b << 7) & TEMPERING_MASK_B;       // TEMPERING_SHIFT_S(b)
+                b ^= (b << 15) & TEMPERING_MASK_C;      // TEMPERING_SHIFT_T(b)
+                b ^= (b >>> 18);                        // TEMPERING_SHIFT_L(b)
+
+                /* derived from nextDouble documentation in jdk 1.2 docs, see top */
+                v1 = 2 *
+                        (((((long) (y >>> 6)) << 27) + (z >>> 5)) / (double) (1L << 53))
+                        - 1;
+                v2 = 2 * (((((long) (a >>> 6)) << 27) + (b >>> 5)) / (double) (1L << 53))
+                        - 1;
+                s = v1 * v1 + v2 * v2;
+            } while (s >= 1);
+            double multiplier = Math.sqrt(-2 * Math.log(s) / s);
+            nextNextGaussian = v2 * multiplier;
+            haveNextNextGaussian = true;
+            return v1 * multiplier;
+        }
+    }
+
+    public final float nextFloat() {
+        int y;
+
+        y = next();
+        y ^= y >>> 11;                          // TEMPERING_SHIFT_U(y)
+        y ^= (y << 7) & TEMPERING_MASK_B;       // TEMPERING_SHIFT_S(y)
+        y ^= (y << 15) & TEMPERING_MASK_C;      // TEMPERING_SHIFT_T(y)
+        y ^= (y >>> 18);                        // TEMPERING_SHIFT_L(y)
+
+        return (y >>> 8) / ((float) (1 << 24));
+    }
+
+
+    /**
+     * Returns an integer drawn uniformly from 0 to n-1.  Suffice it to say,
+     * n must be > 0, or an IllegalArgumentException is raised.
+     */
+    public int nextInt(int n) {
+        if (n <= 0)
+            throw new IllegalArgumentException("n must be positive");
+
+        if ((n & -n) == n)  // i.e., n is a power of 2
+        {
+            int y;
+
+            y = next();
+            y ^= y >>> 11;                          // TEMPERING_SHIFT_U(y)
+            y ^= (y << 7) & TEMPERING_MASK_B;       // TEMPERING_SHIFT_S(y)
+            y ^= (y << 15) & TEMPERING_MASK_C;      // TEMPERING_SHIFT_T(y)
+            y ^= (y >>> 18);                        // TEMPERING_SHIFT_L(y)
+
+            return (int) ((n * (long) (y >>> 1)) >> 31);
+        }
+
+        int bits, val;
+        do {
+            int y;
+
+            y = next();
+            y ^= y >>> 11;                          // TEMPERING_SHIFT_U(y)
+            y ^= (y << 7) & TEMPERING_MASK_B;       // TEMPERING_SHIFT_S(y)
+            y ^= (y << 15) & TEMPERING_MASK_C;      // TEMPERING_SHIFT_T(y)
+            y ^= (y >>> 18);                        // TEMPERING_SHIFT_L(y)
+
+            bits = (y >>> 1);
+            val = bits % n;
+        } while (bits - val + (n - 1) < 0);
+        return val;
+    }
+
+    /**
+     * Returns a uniform random permutation of int objects in array
+     */
+    public final void permute(int[] array) {
+        int l = array.length;
+        for (int i = 0; i < l; i++) {
+            int index = nextInt(l - i) + i;
+            int temp = array[index];
+            array[index] = array[i];
+            array[i] = temp;
+        }
+    }
+
+
+    /**
+     * Shuffles an array.
+     */
+    public final void shuffle(int[] array) {
+        int l = array.length;
+        for (int i = 0; i < l; i++) {
+            int index = nextInt(l - i) + i;
+            int temp = array[index];
+            array[index] = array[i];
+            array[i] = temp;
+        }
+    }
+
+    /**
+     * Shuffles an array. Shuffles numberOfShuffles times
+     */
+    public final void shuffle(int[] array, int numberOfShuffles) {
+        int i, j, temp, l = array.length;
+        for (int shuffle = 0; shuffle < numberOfShuffles; shuffle++) {
+            do {
+                i = nextInt(l);
+                j = nextInt(l);
+            } while (i != j);
+            temp = array[j];
+            array[j] = array[i];
+            array[i] = temp;
+        }
+    }
+
+    /**
+     * Returns an array of shuffled indices of length l.
+     *
+     * @param l length of the array required.
+     */
+    public int[] shuffled(int l) {
+
+        int[] array = new int[l];
+
+        // initialize array
+        for (int i = 0; i < l; i++) {
+            array[i] = i;
+        }
+        shuffle(array);
+
+        return array;
+    }
+
+    /**
+     * Returns a uniform random permutation of ints 0,...,l-1
+     *
+     * @param l length of the array required.
+     */
+    public int[] permuted(int l) {
+
+        int[] array = new int[l];
+
+        // initialize array
+        for (int i = 0; i < l; i++) {
+            array[i] = i;
+        }
+        permute(array);
+
+        return array;
+    }
+
+
+    public double nextGamma(double alpha, double lambda) {
+        /******************************************************************
+         *                                                                *
+         *    Gamma Distribution - Acceptance Rejection combined with     *
+         *                         Acceptance Complement                  *
+         *                                                                *
+         ******************************************************************
+         *                                                                *
+         * FUNCTION:    - gds samples a random number from the standard   *
+         *                gamma distribution with parameter  a > 0.       *
+         *                Acceptance Rejection  gs  for  a < 1 ,          *
+         *                Acceptance Complement gd  for  a >= 1 .         *
+         * REFERENCES:  - J.H. Ahrens, U. Dieter (1974): Computer methods *
+         *                for sampling from gamma, beta, Poisson and      *
+         *                binomial distributions, Computing 12, 223-246.  *
+         *              - J.H. Ahrens, U. Dieter (1982): Generating gamma *
+         *                variates by a modified rejection technique,     *
+         *                Communications of the ACM 25, 47-54.            *
+         * SUBPROGRAMS: - drand(seed) ... (0,1)-Uniform generator with    *
+         *                unsigned long integer *seed                     *
+         *              - NORMAL(seed) ... Normal generator N(0,1).       *
+         *                                                                *
+         ******************************************************************/
+        double a = alpha;
+        double aa = -1.0, aaa = -1.0,
+                b = 0.0, c = 0.0, d = 0.0, e, r, s = 0.0, si = 0.0, ss = 0.0, q0 = 0.0,
+                q1 = 0.0416666664, q2 = 0.0208333723, q3 = 0.0079849875,
+                q4 = 0.0015746717, q5 = -0.0003349403, q6 = 0.0003340332,
+                q7 = 0.0006053049, q8 = -0.0004701849, q9 = 0.0001710320,
+                a1 = 0.333333333, a2 = -0.249999949, a3 = 0.199999867,
+                a4 = -0.166677482, a5 = 0.142873973, a6 = -0.124385581,
+                a7 = 0.110368310, a8 = -0.112750886, a9 = 0.104089866,
+                e1 = 1.000000000, e2 = 0.499999994, e3 = 0.166666848,
+                e4 = 0.041664508, e5 = 0.008345522, e6 = 0.001353826,
+                e7 = 0.000247453;
+
+        double gds, p, q, t, sign_u, u, v, w, x;
+        double v1, v2, v12;
+
+        // Check for invalid input values
+
+        if (a <= 0.0) throw new IllegalArgumentException();
+        if (lambda <= 0.0) new IllegalArgumentException();
+
+        if (a < 1.0) { // CASE A: Acceptance rejection algorithm gs
+            b = 1.0 + 0.36788794412 * a;              // Step 1
+            for (; ; ) {
+                p = b * nextDouble();
+                if (p <= 1.0) {                       // Step 2. Case gds <= 1
+                    gds = Math.exp(Math.log(p) / a);
+                    if (Math.log(nextDouble()) <= -gds) return (gds / lambda);
+                } else {                                // Step 3. Case gds > 1
+                    gds = -Math.log((b - p) / a);
+                    if (Math.log(nextDouble()) <= ((a - 1.0) * Math.log(gds))) return (gds / lambda);
+                }
+            }
+        } else {        // CASE B: Acceptance complement algorithm gd (gaussian distribution, box muller transformation)
+            if (a != aa) {                        // Step 1. Preparations
+                aa = a;
+                ss = a - 0.5;
+                s = Math.sqrt(ss);
+                d = 5.656854249 - 12.0 * s;
+            }
+            // Step 2. Normal deviate
+            do {
+                v1 = 2.0 * nextDouble() - 1.0;
+                v2 = 2.0 * nextDouble() - 1.0;
+                v12 = v1 * v1 + v2 * v2;
+            } while (v12 > 1.0);
+            t = v1 * Math.sqrt(-2.0 * Math.log(v12) / v12);
+            x = s + 0.5 * t;
+            gds = x * x;
+            if (t >= 0.0) return (gds / lambda);         // Immediate acceptance
+
+            u = nextDouble();                // Step 3. Uniform random number
+            if (d * u <= t * t * t) return (gds / lambda); // Squeeze acceptance
+
+            if (a != aaa) {                           // Step 4. Set-up for hat case
+                aaa = a;
+                r = 1.0 / a;
+                q0 = ((((((((q9 * r + q8) * r + q7) * r + q6) * r + q5) * r + q4) *
+                        r + q3) * r + q2) * r + q1) * r;
+                if (a > 3.686) {
+                    if (a > 13.022) {
+                        b = 1.77;
+                        si = 0.75;
+                        c = 0.1515 / s;
+                    } else {
+                        b = 1.654 + 0.0076 * ss;
+                        si = 1.68 / s + 0.275;
+                        c = 0.062 / s + 0.024;
+                    }
+                } else {
+                    b = 0.463 + s - 0.178 * ss;
+                    si = 1.235;
+                    c = 0.195 / s - 0.079 + 0.016 * s;
+                }
+            }
+            if (x > 0.0) {                        // Step 5. Calculation of q
+                v = t / (s + s);                  // Step 6.
+                if (Math.abs(v) > 0.25) {
+                    q = q0 - s * t + 0.25 * t * t + (ss + ss) * Math.log(1.0 + v);
+                } else {
+                    q = q0 + 0.5 * t * t * ((((((((a9 * v + a8) * v + a7) * v + a6) *
+                            v + a5) * v + a4) * v + a3) * v + a2) * v + a1) * v;
+                }                                  // Step 7. Quotient acceptance
+                if (Math.log(1.0 - u) <= q) return (gds / lambda);
+            }
+
+            for (; ; ) {                                // Step 8. Double exponential deviate t
+                do {
+                    e = -Math.log(nextDouble());
+                    u = nextDouble();
+                    u = u + u - 1.0;
+                    sign_u = (u > 0) ? 1.0 : -1.0;
+                    t = b + (e * si) * sign_u;
+                } while (t <= -0.71874483771719); // Step 9. Rejection of t
+                v = t / (s + s);                  // Step 10. New q(t)
+                if (Math.abs(v) > 0.25) {
+                    q = q0 - s * t + 0.25 * t * t + (ss + ss) * Math.log(1.0 + v);
+                } else {
+                    q = q0 + 0.5 * t * t * ((((((((a9 * v + a8) * v + a7) * v + a6) *
+                            v + a5) * v + a4) * v + a3) * v + a2) * v + a1) * v;
+                }
+                if (q <= 0.0) continue;           // Step 11.
+                if (q > 0.5) {
+                    w = Math.exp(q) - 1.0;
+                } else {
+                    w = ((((((e7 * q + e6) * q + e5) * q + e4) * q + e3) * q + e2) *
+                            q + e1) * q;
+                }                                  // Step 12. Hat acceptance
+                if (c * u * sign_u <= w * Math.exp(e - 0.5 * t * t)) {
+                    x = s + 0.5 * t;
+                    return (x * x / lambda);
+                }
+            }
+        }
+    }
+    
+    /**********************************************************
+     *                                                        *
+     *  Poissonian distribution - Rejection + direct method   *
+     *                                                        *
+     **********************************************************/
+    
+    /**
+     * Rejection method from NR, apparently good for lambda>=12, although
+     * systematic errors start to creep in at lambda>=1e14.  Can we improve
+     * on this?  A straight Gaussian seems to stay accurate for larger
+     * means.
+     * 
+     * @param lambda
+     * @return 
+     */
+    private double poissonian_reject(double lambda) {
+        double sq = Math.sqrt(2.0*lambda);
+        double alxm = Math.log(lambda);
+        double g = lambda*alxm-GammaFunction.lnGamma(lambda+1.0);
+        double em, t, y;
+
+        do {
+            do {
+                y = Math.tan(Math.PI*nextDouble());
+                em = sq*y+lambda;
+            } while (em<0.0);
+
+            em = Math.floor(em);
+            t = 0.9*(1.0+y*y)*Math.exp(em*alxm
+                    -GammaFunction.lnGamma(em+1.0)-g);
+
+        } while (nextDouble()>t);
+
+        return em;
+    }
+
+    /**
+     * Direct method: only efficient for small lambda.
+     * 
+     * @param lambda
+     * @return 
+     */
+    private double poissonian_knuth(double lambda) {
+        double L = Math.exp(-lambda);
+        double p;
+        int k;
+
+        for (k = 0, p = 1; p>=L; k++)
+            p = p*nextDouble();
+
+        return k-1;
+    }
+
+    /**
+     * Sample from a Poissonian distribution.  Note that samples are expressed
+     * as doubles, allowing for sensible convergence to the appropriate
+     * Gaussian when extremely large lambdas are used.  Be aware however that
+     * systematic errors due to rounding start to creep in for lambda>1e14.
+     * Can we improve on this?
+     * 
+     * @param lambda
+     * @return Draw from Pois(lambda).
+     */
+    public double nextPoisson(double lambda) {
+        if (lambda<12)
+            return poissonian_knuth(lambda);
+
+        return poissonian_reject(lambda);
+    }
+    
+    /**
+     * Main for debugging only.
+     */
+    public static void main (String [] args) throws FileNotFoundException {
+        
+        double lambda = 1e12;
+        int reps=100000;
+        
+        double sqrtlambda = Math.sqrt(lambda);
+        double [] vals = new double[reps];
+
+        PrintStream outf = new PrintStream("vals.txt");
+        
+        for (int i=0; i<reps; i++) {
+            double val = Randomizer.nextPoisson(lambda);
+            //double val = Randomizer.nextGaussian()*sqrtlambda + lambda;
+            vals[i] = val;
+            outf.println(val);
+        }
+        outf.close();
+        
+        System.out.format("E[x]=%g\n",DiscreteStatistics.mean(vals));
+        System.out.format("Var[x]=%g\n", DiscreteStatistics.variance(vals));
+    }
+}
diff --git a/src/beast/util/NexusParser.java b/src/beast/util/NexusParser.java
new file mode 100644
index 0000000..e29cc07
--- /dev/null
+++ b/src/beast/util/NexusParser.java
@@ -0,0 +1,1017 @@
+package beast.util;
+
+import beast.core.util.Log;
+import beast.evolution.alignment.*;
+import beast.evolution.datatype.DataType;
+import beast.evolution.datatype.StandardData;
+import beast.evolution.datatype.UserDataType;
+import beast.evolution.tree.TraitSet;
+import beast.evolution.tree.Tree;
+
+import java.io.*;
+import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+
+/**
+ * parses nexus file and grabs alignment and calibration from the file *
+ */
+public class NexusParser {
+    /**
+     * keep track of nexus file line number, to report when the file does not parse *
+     */
+    int lineNr;
+
+    /**
+     * Beast II objects reconstructed from the file*
+     */
+    public Alignment m_alignment;
+    public List<Alignment> filteredAlignments = new ArrayList<Alignment>();
+    public TraitSet traitSet;
+
+    public List<String> taxa;
+    public List<Tree> trees;
+
+    static Set<String> g_sequenceIDs;
+
+    public Map<String, String> translationMap = null;
+
+    static {
+        g_sequenceIDs = new HashSet<>();
+    }
+
+    public List<TaxonSet> taxonsets = new ArrayList<>();
+
+    private List<NexusParserListener> listeners = new ArrayList<>();
+
+    /**
+     * Adds a listener for client classes that want to monitor progress of the parsing.
+     * @param listener
+     */
+    public void addListener(final NexusParserListener listener) {
+        listeners.add(listener);
+    }
+
+    /**
+     * Try to parse BEAST 2 objects from the given file
+     *
+     * @param file the file to parse.
+     */
+    public void parseFile(final File file) throws Exception {
+        final String fileName = file.getName().replaceAll(".*[\\/\\\\]", "").replaceAll("\\..*", "");
+
+        parseFile(fileName, new FileReader(file));
+    }
+
+    /**
+     * try to reconstruct Beast II objects from the given reader
+     *
+     * @param id     a name to give to the parsed results
+     * @param reader a reader to parse from
+     */
+    public void parseFile(final String id, final Reader reader) throws Exception {
+        lineNr = 0;
+        final BufferedReader fin;
+        if (reader instanceof BufferedReader) {
+            fin = (BufferedReader) reader;
+        } else {
+            fin = new BufferedReader(reader);
+        }
+        try {
+            while (fin.ready()) {
+                final String sStr = nextLine(fin);
+                if (sStr == null) {
+                    return;
+                }
+                final String sLower = sStr.toLowerCase();
+                if (sLower.matches("^\\s*begin\\s+data;\\s*$") || sLower.matches("^\\s*begin\\s+characters;\\s*$")) {
+                    m_alignment = parseDataBlock(fin);
+                    m_alignment.setID(id);
+                } else if (sLower.matches("^\\s*begin\\s+calibration;\\s*$")) {
+                    traitSet = parseCalibrationsBlock(fin);
+                } else if (sLower.matches("^\\s*begin\\s+assumptions;\\s*$") ||
+                        sLower.matches("^\\s*begin\\s+sets;\\s*$") ||
+                        sLower.matches("^\\s*begin\\s+mrbayes;\\s*$")) {
+                    parseAssumptionsBlock(fin);
+                } else if (sLower.matches("^\\s*begin\\s+taxa;\\s*$")) {
+                    parseTaxaBlock(fin);
+                } else if (sLower.matches("^\\s*begin\\s+trees;\\s*$")) {
+                    parseTreesBlock(fin);
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new Exception("Around line " + lineNr + "\n" + e.getMessage());
+        }
+    } // parseFile
+
+    private void parseTreesBlock(final BufferedReader fin) throws Exception {
+        trees = new ArrayList<Tree>();
+        // read to first non-empty line within trees block
+        String sStr = fin.readLine().trim();
+        while (sStr.equals("")) {
+            sStr = fin.readLine().trim();
+        }
+
+        int origin = -1;
+
+        // if first non-empty line is "translate" then parse translate block
+        if (sStr.toLowerCase().contains("translate")) {
+            translationMap = parseTranslateBlock(fin);
+            origin = getIndexedTranslationMapOrigin(translationMap);
+            if (origin != -1) {
+                taxa = getIndexedTranslationMap(translationMap, origin);
+            }
+        }
+
+        // read trees
+        while (sStr != null) {
+            if (sStr.toLowerCase().startsWith("tree ")) {
+                final int i = sStr.indexOf('(');
+                if (i > 0) {
+                    sStr = sStr.substring(i);
+                }
+                TreeParser treeParser;
+
+                if (origin != -1) {
+                    treeParser = new TreeParser(taxa, sStr, origin, false);
+                } else {
+                    try {
+                        treeParser = new TreeParser(taxa, sStr, 0, false);
+                    } catch (ArrayIndexOutOfBoundsException e) {
+                        treeParser = new TreeParser(taxa, sStr, 1, false);
+                    }
+                }
+//                catch (NullPointerException e) {
+//                    treeParser = new TreeParser(m_taxa, sStr, 1);
+//                }
+
+                for (final NexusParserListener listener : listeners) {
+                    listener.treeParsed(trees.size(), treeParser);
+                }
+
+                if (translationMap != null) treeParser.translateLeafIds(translationMap);
+
+                trees.add(treeParser);
+
+//				Node tree = treeParser.getRoot();
+//				tree.sort();
+//				tree.labelInternalNodes(nNrOfLabels);
+            }
+            sStr = fin.readLine();
+            if (sStr != null) sStr = sStr.trim();
+        }
+    }
+
+    private List<String> getIndexedTranslationMap(final Map<String, String> translationMap, final int origin) {
+
+        System.out.println("translation map size = " + translationMap.size());
+
+        final String[] taxa = new String[translationMap.size()];
+
+        for (final String key : translationMap.keySet()) {
+            taxa[Integer.parseInt(key) - origin] = translationMap.get(key);
+        }
+        return Arrays.asList(taxa);
+    }
+
+    /**
+     * @param translationMap
+     * @return minimum key value if keys are a contiguous set of integers starting from zero or one, -1 otherwise
+     */
+    private int getIndexedTranslationMapOrigin(final Map<String, String> translationMap) {
+
+        final SortedSet<Integer> indices = new TreeSet<Integer>();
+
+        int count = 0;
+        for (final String key : translationMap.keySet()) {
+            final int index = Integer.parseInt(key);
+            indices.add(index);
+            count += 1;
+        }
+        if ((indices.last() - indices.first() == count - 1) && (indices.first() == 0 || indices.first() == 1)) {
+            return indices.first();
+        }
+        return -1;
+    }
+
+    /**
+     * @param reader a reader
+     * @return a map of taxa translations, keys are generally integer node number starting from 1
+     *         whereas values are generally descriptive strings.
+     * @throws IOException
+     */
+    private Map<String, String> parseTranslateBlock(final BufferedReader reader) throws IOException {
+
+        final Map<String, String> translationMap = new HashMap<String, String>();
+
+        String line = reader.readLine();
+        final StringBuilder translateBlock = new StringBuilder();
+        while (line != null && !line.trim().toLowerCase().equals(";")) {
+            translateBlock.append(line.trim());
+            line = reader.readLine();
+        }
+        final String[] taxaTranslations = translateBlock.toString().split(",");
+        for (final String taxaTranslation : taxaTranslations) {
+            final String[] translation = taxaTranslation.split("[\t ]+");
+            if (translation.length == 2) {
+                translationMap.put(translation[0], translation[1]);
+//                System.out.println(translation[0] + " -> " + translation[1]);
+            } else {
+                System.err.println("Ignoring translation:" + Arrays.toString(translation));
+            }
+        }
+        return translationMap;
+    }
+
+    private void parseTaxaBlock(final BufferedReader fin) throws Exception {
+        taxa = new ArrayList<String>();
+        int nTaxaExpected = -1;
+        String sStr;
+        do {
+            sStr = nextLine(fin);
+            if (sStr.toLowerCase().matches("\\s*dimensions\\s.*")) {
+                sStr = sStr.substring(sStr.toLowerCase().indexOf("ntax=") + 5);
+                sStr = sStr.replaceAll(";", "");
+                nTaxaExpected = Integer.parseInt(sStr.trim());
+            } else if (sStr.toLowerCase().trim().equals("taxlabels")) {
+                do {
+                    sStr = nextLine(fin);
+                    sStr = sStr.replaceAll(";", "");
+                    sStr = sStr.trim();
+                    if (sStr.length() > 0 && !sStr.toLowerCase().equals("end")) {
+                    	String [] sStrs = sStr.split("\\s+");
+                    	for (int i = 0; i < sStrs.length; i++) {
+                        	String taxon = sStrs[i];
+                            if (taxon.charAt(0) == '\'' || taxon.charAt(0) == '\"') {
+                            	while (i < sStrs.length && taxon.charAt(0) != taxon.charAt(taxon.length() - 1)) {
+                            		i++;
+                            		if (i == sStrs.length) {
+                            			throw new Exception("Unclosed quote starting with " + taxon);
+                            		}
+                            		taxon += " " + sStrs[i];
+                            	}
+                            	taxon = taxon.substring(1, taxon.length() - 1);
+                            }
+                            taxa.add(taxon);
+                    	}
+                    }
+                } while (!sStr.toLowerCase().equals("end"));
+            }
+        } while (!sStr.toLowerCase().equals("end"));
+        if (nTaxaExpected >= 0 && taxa.size() != nTaxaExpected) {
+            throw new Exception("Number of taxa (" + taxa.size() + ") is not equal to 'dimension' " +
+            		"field (" + nTaxaExpected + ") specified in 'taxa' block");
+        }
+    }
+
+    /**
+     * parse calibrations block and create TraitSet *
+     */
+    TraitSet parseCalibrationsBlock(final BufferedReader fin) throws Exception {
+        final TraitSet traitSet = new TraitSet();
+        traitSet.traitNameInput.setValue("date", traitSet);
+        String sStr;
+        do {
+            sStr = nextLine(fin);
+            if (sStr.toLowerCase().contains("options")) {
+                String sScale = getAttValue("scale", sStr);
+                if (sScale.endsWith("s")) {
+                    sScale = sScale.substring(0, sScale.length() - 1);
+                }
+                traitSet.unitsInput.setValue(sScale, traitSet);
+            }
+        } while (sStr.toLowerCase().contains("tipcalibration"));
+
+        String sText = "";
+        while (true) {
+            sStr = nextLine(fin);
+            if (sStr.contains(";")) {
+                break;
+            }
+            sText += sStr;
+        }
+        final String[] sStrs = sText.split(",");
+        sText = "";
+        for (final String sStr2 : sStrs) {
+            final String[] sParts = sStr2.split(":");
+            final String sDate = sParts[0].replaceAll(".*=\\s*", "");
+            final String[] sTaxa = sParts[1].split("\\s+");
+            for (final String sTaxon : sTaxa) {
+                if (!sTaxon.matches("^\\s*$")) {
+                    sText += sTaxon + "=" + sDate + ",\n";
+                }
+            }
+        }
+        sText = sText.substring(0, sText.length() - 2);
+        traitSet.traitsInput.setValue(sText, traitSet);
+        final TaxonSet taxa = new TaxonSet();
+        taxa.initByName("alignment", m_alignment);
+        traitSet.taxaInput.setValue(taxa, traitSet);
+
+        traitSet.initAndValidate();
+        return traitSet;
+    } // parseCalibrations
+
+
+    /**
+     * parse data block and create Alignment *
+     */
+    public Alignment parseDataBlock(final BufferedReader fin) throws Exception {
+
+        final Alignment alignment = new Alignment();
+
+        String sStr;
+        int nTaxa = -1;
+        int nChar = -1;
+        int nTotalCount = 4;
+        String sMissing = "?";
+        String sGap = "-";
+        // indicates character matches the one in the first sequence
+        String sMatchChar = null;
+        do {
+            sStr = nextLine(fin);
+
+            //dimensions ntax=12 nchar=898;
+            if (sStr.toLowerCase().contains("dimensions")) {
+                while (sStr.indexOf(';') < 0) {
+                    sStr += nextLine(fin);
+                }
+                sStr = sStr.replace(";", " ");
+
+                final String sChar = getAttValue("nchar", sStr);
+                if (sChar == null) {
+                    throw new Exception("nchar attribute expected (e.g. 'dimensions char=123') expected, not " + sStr);
+                }
+                nChar = Integer.parseInt(sChar);
+                final String sTaxa = getAttValue("ntax", sStr);
+                if (sTaxa != null) {
+                    nTaxa = Integer.parseInt(sTaxa);
+                }
+            } else if (sStr.toLowerCase().contains("format")) {
+                while (sStr.indexOf(';') < 0) {
+                    sStr += nextLine(fin);
+                }
+                sStr = sStr.replace(";", " ");
+
+                //format datatype=dna interleave=no gap=-;
+                final String sDataType = getAttValue("datatype", sStr);
+                final String sSymbols;
+                if (getAttValue("symbols", sStr) == null) {
+                    sSymbols = getAttValue("symbols", sStr);
+                } else {
+                    sSymbols = getAttValue("symbols", sStr).replaceAll("\\s", "");
+                }
+                if (sDataType == null) {
+                    System.out.println("Warning: expected datatype (e.g. something like 'format datatype=dna;') not '" + sStr + "' Assuming integer dataType");
+                    alignment.dataTypeInput.setValue("integer", alignment);
+                    if (sSymbols != null && (sSymbols.equals("01") || sSymbols.equals("012"))) {
+                        nTotalCount = sSymbols.length();
+                    }
+                } else if (sDataType.toLowerCase().equals("rna") || sDataType.toLowerCase().equals("dna") || sDataType.toLowerCase().equals("nucleotide")) {
+                    alignment.dataTypeInput.setValue("nucleotide", alignment);
+                    nTotalCount = 4;
+                } else if (sDataType.toLowerCase().equals("aminoacid") || sDataType.toLowerCase().equals("protein")) {
+                    alignment.dataTypeInput.setValue("aminoacid", alignment);
+                    nTotalCount = 20;
+                } else if (sDataType.toLowerCase().equals("standard")) {
+                    alignment.dataTypeInput.setValue("standard", alignment);
+                    nTotalCount = sSymbols.length();
+//                    if (sSymbols == null || sSymbols.equals("01")) {
+//                        alignment.dataTypeInput.setValue("binary", alignment);
+//                        nTotalCount = 2;
+//                    }  else {
+//                        alignment.dataTypeInput.setValue("standard", alignment);
+//                        nTotalCount = sSymbols.length();
+//                    }
+                } else if (sDataType.toLowerCase().equals("binary")) {
+                    alignment.dataTypeInput.setValue("binary", alignment);
+                    nTotalCount = 2;
+                } else {
+                    alignment.dataTypeInput.setValue("integer", alignment);
+                    if (sSymbols != null && (sSymbols.equals("01") || sSymbols.equals("012"))) {
+                        nTotalCount = sSymbols.length();
+                    }
+                }
+                final String sMissingChar = getAttValue("missing", sStr);
+                if (sMissingChar != null) {
+                    sMissing = sMissingChar;
+                }
+                final String sGapChar = getAttValue("gap", sStr);
+                if (sGapChar != null) {
+                    sGap = sGapChar;
+                }
+                sMatchChar = getAttValue("matchchar", sStr);
+            }
+        } while (!sStr.trim().toLowerCase().startsWith("matrix") && !sStr.toLowerCase().contains("charstatelabels"));
+
+        if (alignment.dataTypeInput.get().equals("standard")) {
+        	StandardData type = new StandardData();
+            type.setInputValue("nrOfStates", nTotalCount);
+        	type.initAndValidate();
+            alignment.setInputValue("userDataType", type);
+        }
+
+        //reading CHARSTATELABELS block
+        if (sStr.toLowerCase().contains("charstatelabels")) {
+            if (!alignment.dataTypeInput.get().equals("standard")) {
+                new Exception("If CHATSTATELABELS block is specified then DATATYPE has to be Standard");
+            }
+            StandardData standardDataType = (StandardData)alignment.userDataTypeInput.get();
+            int[] maxNumberOfStates = new int[] {0};
+            ArrayList<String> tokens = readInCharstatelablesTokens(fin);
+            ArrayList<UserDataType> charDescriptions = processCharstatelabelsTokens(tokens, maxNumberOfStates);
+
+//            while (true) {
+//                sStr = nextLine(fin);
+//                if (sStr.contains(";")) {
+//                    break;
+//                }
+//                String[] sStrSplit = sStr.split("/");
+//                ArrayList<String> states = new ArrayList<>();
+//
+//                if (sStrSplit.length < 2) {
+//                    charDescriptions.add(new UserDataType(sStrSplit[0], states));
+//                    continue;
+//                }
+//
+//                String stateStr = sStrSplit[1];
+//
+//                //add a comma at the end of the string if the last non-whitespace character is not a comma or all the
+//                // characters are whitespaces in the string. Also remove whitespaces at the end of the string.
+//                for (int i=stateStr.length()-1; i>=0; i--) {
+//                    if (!Character.isWhitespace(stateStr.charAt(i))) {
+//                        if (stateStr.charAt(i-1) != ',') {
+//                            stateStr = stateStr.substring(0, i)+",";
+//                            break;
+//                        }
+//                    }
+//                    if (i==0) {
+//                        stateStr = stateStr.substring(0, i)+",";
+//                    }
+//                }
+//                if (stateStr.isEmpty()) {
+//                    stateStr = stateStr+",";
+//                }
+//
+//                final int WAITING=0, WORD=1, PHRASE_IN_QUOTES=2;
+//                int mode =WAITING; //0 waiting for non-space letter, 1 reading a word; 2 reading a phrase in quotes
+//                int begin =0, end;
+//
+//                for (int i=0; i< stateStr.length(); i++) {
+//                    switch (mode) {
+//                        case WAITING:
+//                            while (stateStr.charAt(i) == ' ') {
+//                                i++;
+//                            }
+//                            mode = stateStr.charAt(i) == '\'' ? PHRASE_IN_QUOTES : WORD;
+//                            begin = i;
+//                            break;
+//                        case WORD:
+//                            end = stateStr.indexOf(" ", begin) != -1 ? stateStr.indexOf(" ", begin) : stateStr.indexOf(",", begin);
+//                            states.add(stateStr.substring(begin, end));
+//                            i=end;
+//                            mode = WAITING;
+//                            break;
+//                        case PHRASE_IN_QUOTES:
+//                            end = begin;
+//                            do {
+//                                end = stateStr.indexOf("'", end+2);
+//                            } while (stateStr.charAt(end+1) == '\'' || end == -1);
+//                            if (end == -1) {
+//                                System.out.println("Incorrect description in charstatelabels. Single quote found in line ");
+//                            }
+//                            end++;
+//                            states.add(stateStr.substring(begin, end));
+//                            i=end;
+//                            mode=WAITING;
+//                            break;
+//                        default:
+//                            break;
+//                    }
+//                }
+//                // oldTODO make sStrSplit[0] look nicer (remove whitespaces and may be numbers at the beginning)
+//                charDescriptions.add(new UserDataType(sStrSplit[0], states));
+//                maxNumberOfStates = Math.max(maxNumberOfStates, states.size());
+//            }
+            standardDataType.setInputValue("charstatelabels", charDescriptions);
+            standardDataType.setInputValue("nrOfStates", Math.max(maxNumberOfStates[0], nTotalCount));
+            standardDataType.initAndValidate();
+            for (UserDataType dataType : standardDataType.charStateLabelsInput.get()) {
+            	dataType.initAndValidate();
+            }
+        }
+
+        //skipping before MATRIX block
+        while (!sStr.toLowerCase().contains(("matrix"))) {
+            sStr = nextLine(fin);
+        }
+
+        // read character data
+        // Use string builder for efficiency
+        final Map<String, StringBuilder> seqMap = new HashMap<String, StringBuilder>();
+        final List<String> sTaxa = new ArrayList<String>();
+        String sPrevTaxon = null;
+        int seqLen = 0;
+        while (true) {
+            sStr = nextLine(fin);
+            if (sStr.contains(";")) {
+                break;
+            }
+
+            int iStart = 0, iEnd;
+            final String sTaxon;
+            while (Character.isWhitespace(sStr.charAt(iStart))) {
+                iStart++;
+            }
+            if (sStr.charAt(iStart) == '\'' || sStr.charAt(iStart) == '\"') {
+                final char c = sStr.charAt(iStart);
+                iStart++;
+                iEnd = iStart;
+                while (sStr.charAt(iEnd) != c) {
+                    iEnd++;
+                }
+                sTaxon = sStr.substring(iStart, iEnd);
+                seqLen = 0;
+                iEnd++;
+            } else {
+                iEnd = iStart;
+                while (iEnd < sStr.length() && !Character.isWhitespace(sStr.charAt(iEnd))) {
+                    iEnd++;
+                }
+                if (iEnd < sStr.length()) {
+                    sTaxon = sStr.substring(iStart, iEnd);
+                    seqLen = 0;
+                } else if ((sPrevTaxon == null || seqLen == nChar) && iEnd == sStr.length()) {
+                    sTaxon = sStr.substring(iStart, iEnd);
+                    seqLen = 0;
+                } else {
+                    sTaxon = sPrevTaxon;
+                    if (sTaxon == null) {
+                        throw new Exception("Could not recognise taxon");
+                    }
+                    iEnd = iStart;
+                }
+            }
+            sPrevTaxon = sTaxon;
+            final String sData = sStr.substring(iEnd);
+            for (int k = 0; k < sData.length(); k++) {
+            	if (!Character.isWhitespace(sData.charAt(k))) {
+            		seqLen++;
+            	}
+            }
+            // Do this once outside loop- save on multiple regex compilations
+            //sData = sData.replaceAll("\\s", "");
+
+//			String [] sStrs = sStr.split("\\s+");
+//			String sTaxon = sStrs[0];
+//			for (int k = 1; k < sStrs.length - 1; k++) {
+//				sTaxon += sStrs[k];
+//			}
+//			sTaxon = sTaxon.replaceAll("'", "");
+//			System.err.println(sTaxon);
+//			String sData = sStrs[sStrs.length - 1];
+
+            if (seqMap.containsKey(sTaxon)) {
+                seqMap.put(sTaxon, seqMap.get(sTaxon).append(sData));
+            } else {
+                seqMap.put(sTaxon, new StringBuilder(sData));
+                sTaxa.add(sTaxon);
+            }
+        }
+        if (nTaxa > 0 && sTaxa.size() > nTaxa) {
+            throw new Exception("Wrong number of taxa. Perhaps a typo in one of the taxa: " + sTaxa);
+        }
+
+        HashSet<String> sortedAmbiguities = new HashSet<>();
+        for (final String sTaxon : sTaxa) {
+            final StringBuilder bsData = seqMap.get(sTaxon);
+            String sData = bsData.toString().replaceAll("\\s", "");
+            seqMap.put(sTaxon, new StringBuilder(sData));
+
+            //collect all ambiguities in the sequence
+            List<String> ambiguities = new ArrayList<String>();
+            Matcher m = Pattern.compile("\\{(.*?)\\}").matcher(sData);
+            while (m.find()) {
+                int mLength = m.group().length();
+                ambiguities.add(m.group().substring(1, mLength-1));
+            }
+
+            //sort elements of ambiguity sets
+            String sData_without_ambiguities = sData.replaceAll("\\{(.*?)\\}", "?");
+            for (String amb : ambiguities) {
+                List<Integer> ambInt = new ArrayList<>();
+                for (int i=0; i<amb.length(); i++) {
+                	char c = amb.charAt(i);
+                	if (c >= '0' && c <= '9') {
+                		ambInt.add(Integer.parseInt(amb.charAt(i) + ""));
+                	} else {
+                		// ignore
+                		if (sData != sData_without_ambiguities) {
+                			Log.warning.println("Ambiguity found in " + sTaxon + " that is treated as missing value");
+                		}
+                		sData = sData_without_ambiguities; 
+                	}
+                }
+                Collections.sort(ambInt);
+                String ambStr = "";
+                for (int i=0; i<ambInt.size(); i++) {
+                    ambStr += Integer.toString(ambInt.get(i));
+                }
+                sortedAmbiguities.add(ambStr);
+            }
+
+            //check the length of the sequence (treat ambiguity sets as single characters)
+            if (sData_without_ambiguities.length() != nChar) {
+                throw new Exception(sStr + "\nExpected sequence of length " + nChar + " instead of " + sData.length() + " for taxon " + sTaxon);
+            }
+
+            // map to standard missing and gap chars
+            sData = sData.replace(sMissing.charAt(0), DataType.MISSING_CHAR);
+            sData = sData.replace(sGap.charAt(0), DataType.GAP_CHAR);
+
+            // resolve matching char, if any
+            if (sMatchChar != null && sData.contains(sMatchChar)) {
+                final char cMatchChar = sMatchChar.charAt(0);
+                final String sBaseData = seqMap.get(sTaxa.get(0)).toString();
+                for (int i = 0; i < sData.length(); i++) {
+                    if (sData.charAt(i) == cMatchChar) {
+                        final char cReplaceChar = sBaseData.charAt(i);
+                        sData = sData.substring(0, i) + cReplaceChar + (i + 1 < sData.length() ? sData.substring(i + 1) : "");
+                    }
+                }
+            }
+
+//            alignment.setInputValue(sTaxon, sData);
+            final Sequence sequence = new Sequence();
+            sequence.init(nTotalCount, sTaxon, sData);
+            sequence.setID(generateSequenceID(sTaxon));
+            alignment.sequenceInput.setValue(sequence, alignment);
+        }
+
+
+        if (alignment.dataTypeInput.get().equals("standard")) {
+            //convert sortedAmbiguities to a whitespace separated string of ambiguities
+            String ambiguitiesStr = "";
+            for (String sAmb: sortedAmbiguities) {
+                ambiguitiesStr += sAmb + " ";
+            }
+            if (ambiguitiesStr.length() > 0) {
+            	ambiguitiesStr = ambiguitiesStr.substring(0, ambiguitiesStr.length()-1);
+            }
+            alignment.userDataTypeInput.get().initByName("ambiguities", ambiguitiesStr);
+        }
+
+        alignment.initAndValidate();
+        if (nTaxa > 0 && nTaxa != alignment.getNrTaxa()) {
+            throw new Exception("dimensions block says there are " + nTaxa + " taxa, but there were " + alignment.getNrTaxa() + " taxa found");
+        }
+        return alignment;
+    } // parseDataBlock
+
+
+    /**
+     * parse assumptions block
+     * begin assumptions;
+     * charset firsthalf = 1-449;
+     * charset secondhalf = 450-898;
+     * charset third = 1-457\3 662-896\3;
+     * end;
+     * 
+     * begin assumptions;
+     * wtset MySoapWeights (VECTOR) = 13 13 13 50 50 88 8
+     * end;
+     * 
+     */
+    void parseAssumptionsBlock(final BufferedReader fin) throws Exception {
+        String sStr;
+        do {
+            sStr = nextLine(fin);
+            if (sStr.toLowerCase().matches("\\s*charset\\s.*")) {
+            	// remove text in brackets (as TreeBase files are wont to contain)
+                sStr = sStr.replaceAll("\\(.*\\)", "");
+                // clean up spaces
+                sStr = sStr.replaceAll("^\\s+", "");
+                sStr = sStr.replaceAll("\\s*-\\s*", "-");
+                sStr = sStr.replaceAll("\\s*\\\\\\s*", "\\\\");
+                sStr = sStr.replaceAll("\\s*;", "");
+                final String[] sStrs = sStr.trim().split("\\s+");
+                final String sID = sStrs[1];
+                String sRange = "";
+                for (int i = 3; i < sStrs.length; i++) {
+                    sRange += sStrs[i] + " ";
+                }
+                sRange = sRange.trim().replace(' ', ',');
+                final FilteredAlignment alignment = new FilteredAlignment();
+                alignment.setID(sID);
+                alignment.alignmentInput.setValue(m_alignment, alignment);
+                alignment.filterInput.setValue(sRange, alignment);
+                alignment.initAndValidate();
+                filteredAlignments.add(alignment);
+            } else if (sStr.toLowerCase().matches("\\s*wtset\\s.*")) {
+            	String [] strs = sStr.split("=");
+            	if (strs.length > 1) {
+            		sStr = strs[strs.length - 1].trim();
+            		strs = sStr.split("\\s+");
+            		int [] weights = new int[strs.length];
+            		for (int i = 0; i< strs.length; i++) {
+            			weights[i] = Integer.parseInt(strs[i]);
+            		}
+            		if (m_alignment != null) {
+            			if (weights.length != m_alignment.getSiteCount()) {
+            				throw new RuntimeException("Number of weights (" + weights.length+ ") " +
+            						"does not match number of sites in alignment(" + m_alignment.getSiteCount()+ ")");
+            			}
+            			StringBuilder weightStr = new StringBuilder();
+            			for (String str : strs) {
+            				weightStr.append(str);
+            				weightStr.append(',');
+            			}
+            			weightStr.delete(weightStr.length() - 1, weightStr.length());
+            			m_alignment.siteWeightsInput.setValue(weightStr.toString(), m_alignment);
+            			m_alignment.initAndValidate();
+            		} else {
+            			Log.warning.println("WTSET was specified before alignment. WTSET is ignored.");
+            		}
+            	}
+            }
+
+        } while (!sStr.toLowerCase().contains("end;"));
+    }
+
+    /**
+     * parse sets block
+     * BEGIN Sets;
+     * TAXSET 'con' = 'con_SL_Gert2' 'con_SL_Tran6' 'con_SL_Tran7' 'con_SL_Gert6';
+     * TAXSET 'spa' = 'spa_138a_Cerb' 'spa_JB_Eyre1' 'spa_JB_Eyre2';
+     * END; [Sets]
+     */
+    void parseSetsBlock(final BufferedReader fin) throws Exception {
+        String sStr;
+        do {
+            sStr = nextLine(fin);
+            if (sStr.toLowerCase().matches("\\s*taxset\\s.*")) {
+                sStr = sStr.replaceAll("^\\s+", "");
+                sStr = sStr.replaceAll(";", "");
+                final String[] sStrs = sStr.split("\\s+");
+                String sID = sStrs[1];
+                sID = sID.replaceAll("'\"", "");
+                final TaxonSet set = new TaxonSet();
+                set.setID(sID);
+                for (int i = 3; i < sStrs.length; i++) {
+                    sID = sStrs[i];
+                    sID = sID.replaceAll("'\"", "");
+                    final Taxon taxon = new Taxon();
+                    taxon.setID(sID);
+                    set.taxonsetInput.setValue(taxon, set);
+                }
+                taxonsets.add(set);
+            }
+        } while (!sStr.toLowerCase().contains("end;"));
+    }
+
+    public static String generateSequenceID(final String sTaxon) {
+        String sID = "seq_" + sTaxon;
+        int i = 0;
+        while (g_sequenceIDs.contains(sID + (i > 0 ? i : ""))) {
+            i++;
+        }
+        sID = sID + (i > 0 ? i : "");
+        g_sequenceIDs.add(sID);
+        return sID;
+    }
+
+    /**
+     * read line from nexus file *
+     */
+    String readLine(final BufferedReader fin) throws Exception {
+        if (!fin.ready()) {
+            return null;
+        }
+        lineNr++;
+        return fin.readLine();
+    }
+
+    /**
+     * read next line from nexus file that is not a comment and not empty *
+     */
+    String nextLine(final BufferedReader fin) throws Exception {
+        String sStr = readLine(fin);
+        if (sStr == null) {
+            return null;
+        }
+        if (sStr.contains("[")) {
+            final int iStart = sStr.indexOf('[');
+            int iEnd = sStr.indexOf(']', iStart);
+            while (iEnd < 0) {
+                sStr += readLine(fin);
+                iEnd = sStr.indexOf(']', iStart);
+            }
+            sStr = sStr.substring(0, iStart) + sStr.substring(iEnd + 1);
+            if (sStr.matches("^\\s*$")) {
+                return nextLine(fin);
+            }
+        }
+        if (sStr.matches("^\\s*$")) {
+            return nextLine(fin);
+        }
+        return sStr;
+    }
+
+    /**
+     * return attribute value as a string *
+     */
+    String getAttValue(final String sAttribute, final String sStr) {
+        final Pattern pattern = Pattern.compile(".*" + sAttribute + "\\s*=\\s*([^\\s;]+).*");
+        final Matcher matcher = pattern.matcher(sStr.toLowerCase());
+        if (!matcher.find()) {
+            return null;
+        }
+        String sAtt = matcher.group(1);
+        if (sAtt.startsWith("\"") && sAtt.endsWith("\"")) {
+            final int iStart = matcher.start(1);
+            sAtt = sStr.substring(iStart + 1, sStr.indexOf('"', iStart + 1));
+        }
+        return sAtt;
+    }
+
+    private ArrayList<String> readInCharstatelablesTokens(final BufferedReader fin) throws Exception {
+
+        ArrayList<String> tokens = new ArrayList<>();
+        String token="";
+        final int READING=0, OPENQUOTE=1, WAITING=2;
+        int mode = WAITING;
+        int numberOfQuotes=0;
+        boolean endOfBlock=false;
+        String sStr;
+
+        while (!endOfBlock) {
+            sStr = nextLine(fin);
+            Character nextChar;
+            for (int i=0; i< sStr.length(); i++) {
+                nextChar=sStr.charAt(i);
+                switch (mode) {
+                    case WAITING:
+                        if (!Character.isWhitespace(nextChar)) {
+                            if (nextChar == '\'') {
+                                mode=OPENQUOTE;
+                            } else if (nextChar == '/' || nextChar == ',') {
+                                tokens.add(nextChar.toString());
+                                token="";
+                            } else if (nextChar == ';') {
+                                endOfBlock = true;
+                            } else {
+                                token=token+nextChar;
+                                mode=READING;
+                            }
+                        }
+                        break;
+                    case READING:
+                        if (nextChar == '\'') {
+                            tokens.add(token);
+                            token="";
+                            mode=OPENQUOTE;
+                        } else if (nextChar == '/' || nextChar == ',') {
+                            tokens.add(token);
+                            tokens.add(nextChar.toString());
+                            token="";
+                            mode=WAITING;
+                        } else if (nextChar == ';') {
+                            tokens.add(token);
+                            endOfBlock = true;
+                        } else if (Character.isWhitespace(nextChar)) {
+                            tokens.add(token);
+                            token="";
+                            mode=WAITING;
+                        } else {
+                            token=token+nextChar;
+                        }
+                        break;
+                    case OPENQUOTE:
+                        if (nextChar == '\'') {
+                            numberOfQuotes++;
+                        } else {
+                            if (numberOfQuotes % 2 == 0) {
+                                for (int ind=0; ind< numberOfQuotes/2; ind++) {
+                                    token=token+"'";
+                                }
+                                token=token+nextChar;
+                            } else {
+                                for (int ind=0; ind< numberOfQuotes/2; ind++) {
+                                    token=token+"'";
+                                }
+                                tokens.add(token);
+                                token="";
+                                if (nextChar == '/' || nextChar == ',') {
+                                    tokens.add(nextChar.toString());
+                                    mode=WAITING;
+                                } else if (nextChar == ';') {
+                                    endOfBlock = true;
+                                } else if (Character.isWhitespace(nextChar)) {
+                                    mode=WAITING;
+                                } else {
+                                    token=token+nextChar;
+                                    mode=READING;
+                                }
+                            }
+                            numberOfQuotes=0;
+                        }
+                        break;
+                    default:
+                        break;
+                }
+            }
+        }
+
+        if (!tokens.get(tokens.size()-1).equals(",")) {
+            tokens.add(",");
+        }
+
+        return tokens;
+    }
+
+    private ArrayList<UserDataType> processCharstatelabelsTokens(ArrayList<String> tokens, int[] maxNumberOfStates) throws Exception {
+
+        ArrayList<UserDataType> charDescriptions = new ArrayList<>();
+
+        final int CHAR_NR=0, CHAR_NAME=1, STATES=2;
+        int mode = CHAR_NR;
+        int charNumber = -1;
+        String charName = "";
+        ArrayList<String> states = new ArrayList<>();
+
+        for (String token:tokens) {
+            switch (mode) {
+                case CHAR_NR:
+                    charNumber = Integer.parseInt(token);
+                    mode = CHAR_NAME;
+                    break;
+                case CHAR_NAME:
+                    if (token.equals("/")) {
+                        mode = STATES;
+                    } else if (token.equals(",")) {
+                        if (charNumber > charDescriptions.size()+1) {
+                            throw new Exception("Character descriptions should go in the ascending order and there " +
+                                    "should not be any description missing.");
+                        }
+                        charDescriptions.add(new UserDataType(charName, states));
+                        maxNumberOfStates[0] = Math.max(maxNumberOfStates[0], states.size());
+                        charNumber = -1;
+                        charName = "";
+                        states = new ArrayList<>();
+                        mode = CHAR_NR;
+                    } else {
+                        charName = token;
+                    }
+                    break;
+                case STATES:
+                    if (token.equals(",")) {
+                        if (charNumber > charDescriptions.size()+1) {
+                            throw new Exception("Character descriptions should go in the ascending order and there " +
+                                    "should not be any description missing.");
+                        }
+                        charDescriptions.add(new UserDataType(charName, states));
+                        maxNumberOfStates[0] = Math.max(maxNumberOfStates[0], states.size());
+                        charNumber = -1;
+                        charName = "";
+                        states = new ArrayList<>();
+                        mode = CHAR_NR;
+                    } else {
+                        states.add(token);
+                    }
+                default:
+                    break;
+            }
+        }
+
+        return charDescriptions;
+
+    }
+
+    public static void main(final String[] args) {
+        try {
+            final NexusParser parser = new NexusParser();
+            parser.parseFile(new File(args[0]));
+            if (parser.taxa != null) {
+                System.out.println(parser.taxa.size() + " taxa");
+                System.out.println(Arrays.toString(parser.taxa.toArray(new String[parser.taxa.size()])));
+            }
+            if (parser.trees != null) {
+                System.out.println(parser.trees.size() + " trees");
+            }
+            if (parser.m_alignment != null) {
+                final String sXML = new XMLProducer().toXML(parser.m_alignment);
+                System.out.println(sXML);
+            }
+            if (parser.traitSet != null) {
+                final String sXML = new XMLProducer().toXML(parser.traitSet);
+                System.out.println(sXML);
+            }
+        } catch (Exception e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+    } // main
+
+} // class NexusParser
diff --git a/src/beast/util/NexusParserListener.java b/src/beast/util/NexusParserListener.java
new file mode 100644
index 0000000..a8a71c6
--- /dev/null
+++ b/src/beast/util/NexusParserListener.java
@@ -0,0 +1,16 @@
+package beast.util;
+
+import beast.evolution.tree.Tree;
+
+/**
+ * @author Alexei Drummond
+ */
+public interface NexusParserListener {
+
+    /**
+     * This method is called to alert a listener that a tree has been parsed by the nexus parser
+     * @param treeIndex the index of the tree (starting from zero)
+     * @param tree the tree that has been parsed
+     */
+    void treeParsed(int treeIndex, Tree tree);
+}
diff --git a/src/beast/util/OutputUtils.java b/src/beast/util/OutputUtils.java
new file mode 100644
index 0000000..9839c8e
--- /dev/null
+++ b/src/beast/util/OutputUtils.java
@@ -0,0 +1,65 @@
+package beast.util;
+
+
+import java.text.DecimalFormat;
+import java.text.DecimalFormatSymbols;
+import java.util.List;
+import java.util.Locale;
+
+/**
+ * some useful methods
+ *
+ * @author Remco Bouckaert
+ * @author Walter Xie
+ */
+public class OutputUtils {
+    public final static String SPACE = " ";
+
+    public static String format(String s) {
+        return format(s, SPACE);
+    }
+    public static String format(String s, String space) {
+        while (s.length() < 8) {
+            s += " ";
+        }
+        return s + space;
+    }
+
+    public static String format(Double d) {
+        if (Double.isNaN(d)) {
+            return "NaN     ";
+        }
+        if (Math.abs(d) > 1e-4 || d == 0) {
+            DecimalFormat f = new DecimalFormat("#0.######", new DecimalFormatSymbols(Locale.US));
+            String sStr = f.format(d);
+            if (sStr.length() > 8) {
+                sStr = sStr.substring(0, 8);
+            }
+            while (sStr.length() < 8) {
+                sStr += " ";
+            }
+            return sStr;
+        } else {
+            DecimalFormat f = new DecimalFormat("0.##E0", new DecimalFormatSymbols(Locale.US));
+            String sStr = f.format(d);
+            if (sStr.length() > 8) {
+                String [] sStrs = sStr.split("E");
+                sStr =  sStrs[0].substring(0, 8 - sStrs[1].length() - 1) + "E" + sStrs[1];
+            }
+            while (sStr.length() < 8) {
+                sStr += " ";
+            }
+            return sStr;
+        }
+    }
+
+    public static String toString(List list) {
+        String s = "";
+        for (int i = 0; i < list.size(); i++) {
+            if (i > 0) s += ", ";
+            Object o = list.get(i);
+            s += o.toString();
+        }
+        return s;
+    }
+}
diff --git a/src/beast/util/Package.java b/src/beast/util/Package.java
new file mode 100644
index 0000000..6db3228
--- /dev/null
+++ b/src/beast/util/Package.java
@@ -0,0 +1,162 @@
+package beast.util;
+
+import beast.core.Description;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+import java.io.File;
+import java.util.List;
+import java.util.Set;
+import java.util.TreeSet;
+
+import static beast.util.AddOnManager.NOT_INSTALLED;
+import static beast.util.AddOnManager.getBeastDirectories;
+
+/**
+ * BEAUti Package managed by AddOnManager
+ * all property is for installed package only
+ * the released/latest package info is online
+ *
+ * modified by Walter Xie
+ */
+ at Description("BEAUti package managed by package manager, also named as add-on previously")
+public class Package {
+    public String description = "";
+    public String url = "";
+    public String packageName = "";
+    public String installedVersion = ""; // get from local /version.xml
+    public String latestVersion = ""; // get from packages.xml
+
+    public Set<PackageDependency> dependencies = new TreeSet<PackageDependency>();
+
+    public Package(Element packageE) {
+        url = packageE.getAttribute("url");
+//        packageName = URL2PackageName(url);
+        packageName = packageE.getAttribute("name");
+        latestVersion = packageE.getAttribute("version");
+        description = packageE.getAttribute("description");
+
+        NodeList nodes = packageE.getElementsByTagName("depends");
+        setVersionDependencies(nodes);
+    }
+
+    public void setVersionDependencies(NodeList nodes) {
+        for (int i = 0; i < nodes.getLength(); i++) {
+            Element depend_on = (Element) nodes.item(i);
+
+            installedVersion = getVersionDependencyFromLocal(packageName, dependencies);
+
+            if (installedVersion == null) {
+                installedVersion = "";
+                PackageDependency dep = getPackageDependency(packageName, depend_on);
+                dependencies.add(dep);
+            }
+        }
+    }
+
+    public String getVersionDependencyFromLocal(String packageName, Set<PackageDependency> dependencies) {
+        List<String> sBeastDirs = getBeastDirectories();
+
+        // gather dependency info for this package
+        for (String sDir : sBeastDirs) {
+            File f = new File(sDir + "/" + packageName);
+            if (f.exists()) {
+                File vf = new File(sDir + "/" + packageName + "/version.xml");
+
+                if (vf.exists()) {
+                    try {
+                        // parse installed version.xml
+                        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+                        Document doc = factory.newDocumentBuilder().parse(vf);
+                        doc.normalize();
+                        // get name and version of package
+                        Element packageE = doc.getDocumentElement();
+//                        String packageName = packageE.getAttribute("name");
+                        String installedVersion = packageE.getAttribute("version");
+
+                        // get dependencies of add-n
+                        NodeList nodes = doc.getElementsByTagName("depends");
+                        for (int i = 0; i < nodes.getLength(); i++) {
+                            Element depend_on = (Element) nodes.item(i);
+
+                            PackageDependency dep = getPackageDependency(packageName, depend_on);
+                            dependencies.add(dep);
+                        }
+
+                        return installedVersion;
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                }
+            }
+        }
+
+        return null;
+    }
+
+    private PackageDependency getPackageDependency(String packageName, Element depend_on) {
+        PackageDependency dep = new PackageDependency();
+        dep.packageName = packageName;
+        dep.dependson = depend_on.getAttribute("on");
+
+        String sAtLeast = depend_on.getAttribute("atleast");
+        dep.setAtLest(sAtLeast);
+        String sAtMost = depend_on.getAttribute("atmost");
+        dep.setAtMost(sAtMost);
+        return dep;
+    }
+
+    public boolean isInstalled() {
+        return installedVersion.trim().length() > 0;
+    }
+
+    public String getStatus() {
+        return isInstalled() ? installedVersion : NOT_INSTALLED;
+    }
+
+    /**
+     * the latest package info is online
+     * @return
+     */
+    public String getLatestVersion() {
+        return latestVersion;
+    }
+
+    public boolean dependsOn(String packageName) {
+        for (PackageDependency packageDependency : dependencies) {
+            if (packageDependency.compareTo(packageName) == 0)
+                return true;
+        }
+        return false;
+    }
+
+    public String getDependenciesString() {
+        String depString = "";
+        for (PackageDependency packageDependency : dependencies) {
+            String s = packageDependency.dependson;
+            if (!s.equalsIgnoreCase("beast2")) {
+                depString +=  s + ", ";
+            }
+        }
+        if (depString.length() > 2) {
+            depString = depString.substring(0, depString.length() - 2);
+        }
+        return depString;
+    }
+
+    public String toString() {
+        return description;
+    }
+
+    public String toHTML() {
+        String html = "<html>";
+        html += "<h1>" + packageName + "</h1>";
+        html += "<p>Installed version: " + (isInstalled() ? installedVersion : "not installed") + "</p>";
+        html += "<p>Latestversion: " + latestVersion + "</p>";
+        html += "<p>" + description +"</p>";
+        html += "</html>";
+        return html;
+    }
+}
diff --git a/src/beast/util/PackageDependency.java b/src/beast/util/PackageDependency.java
new file mode 100644
index 0000000..dc20639
--- /dev/null
+++ b/src/beast/util/PackageDependency.java
@@ -0,0 +1,71 @@
+package beast.util;
+
+/*
+ * File PackageDependency.java
+ *
+ * Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+ *
+ * This file is part of BEAST2.
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership and licensing.
+ *
+ * BEAST 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
+ * of the License, or (at your option) any later version.
+ *
+ *  BEAST 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 BEAST; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+/*
+ * Parts copied from WEKA ClassDiscovery.java
+ * Copyright (C) 2005 University of Waikato, Hamilton, New Zealand
+ *
+ */
+
+import beast.core.Description;
+
+import static beast.util.AddOnManager.beastVersion;
+
+/**
+ * modified by Walter Xie
+ */
+ at Description("BEAUti plugin dependency class")
+public class PackageDependency implements Comparable {
+    String packageName;
+    String dependson;
+    Double atLeast;
+    Double atMost;
+
+    public void setAtLest(String sAtLeast) {
+        if (sAtLeast == null || sAtLeast.length() == 0) {
+            atLeast = 0.0;
+        } else {
+            atLeast = beastVersion.parseVersion(sAtLeast);
+        }
+    }
+
+    public void setAtMost(String sAtMost) {
+        if (sAtMost == null || sAtMost.length() == 0) {
+            atMost = Double.POSITIVE_INFINITY;
+        } else {
+            atMost = beastVersion.parseVersion(sAtMost);
+        }
+    }
+
+    @Override
+    public int compareTo(Object o) {
+        return dependson.toUpperCase().compareTo(o.toString().toUpperCase());
+    }
+
+    public String toString() {
+        return dependson;
+    }
+}
diff --git a/src/beast/util/Randomizer.java b/src/beast/util/Randomizer.java
new file mode 100644
index 0000000..ad907a7
--- /dev/null
+++ b/src/beast/util/Randomizer.java
@@ -0,0 +1,494 @@
+/*
+* File Randomizer.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+/*
+ * MathUtils.java
+ *
+ * Copyright (C) 2002-2006 Alexei Drummond and Andrew Rambaut
+ *
+ * This file is part of BEAST.
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership and licensing.
+ *
+ * BEAST 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
+ * of the License, or (at your option) any later version.
+ *
+ *  BEAST 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 BEAST; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+package beast.util;
+
+/**
+ * Handy utility functions which have some Mathematical relevance.
+ *
+ * @author Matthew Goode
+ * @author Alexei Drummond
+ * @author Gerton Lunter
+ * @version $Id: MathUtils.java,v 1.13 2006/08/31 14:57:24 rambaut Exp $
+ */
+public class Randomizer {
+    private Randomizer() {
+    }
+
+    /**
+     * A random number generator that is initialized with the clock when this
+     * class is loaded into the JVM. Use this for all random numbers.
+     * Note: This method or getting random numbers in not thread-safe. Since
+     * MersenneTwisterFast is currently (as of 9/01) not synchronized using
+     * this function may cause concurrency issues. Use the static get methods of the
+     * MersenneTwisterFast class for access to a single instance of the class, that
+     * has synchronization.
+     */
+    //private static final MersenneTwisterFast random = MersenneTwisterFast.DEFAULT_INSTANCE;
+    final private static MersenneTwisterFast random = MersenneTwisterFast.DEFAULT_INSTANCE;
+
+    /**
+     * Chooses one category if a cumulative probability distribution is given
+     * 
+     * @param cf
+     * @return 
+     */
+    public static int randomChoice(double[] cf) {
+
+        double U = random.nextDouble();
+
+        int s;
+        if (U <= cf[0]) {
+            s = 0;
+        } else {
+            for (s = 1; s < cf.length; s++) {
+                if (U <= cf[s] && U > cf[s - 1]) {
+                    break;
+                }
+            }
+        }
+
+        return s;
+    }
+
+
+    /**
+     * @param pdf array of unnormalized probabilities
+     * @return a sample according to an unnormalized probability distribution
+     */
+    public static int randomChoicePDF(double[] pdf) {
+
+        double U = random.nextDouble() * getTotal(pdf);
+        for (int i = 0; i < pdf.length; i++) {
+
+            U -= pdf[i];
+            if (U < 0.0) {
+                return i;
+            }
+
+        }
+        for (int i = 0; i < pdf.length; i++) {
+            System.out.println(i + "\t" + pdf[i]);
+        }
+        throw new Error("randomChoiceUnnormalized falls through -- negative components in input distribution?");
+    }
+
+
+    /**
+     * @param array to normalize
+     * @return a new double array where all the values sum to 1.
+     *         Relative ratios are preserved.
+     */
+    public static double[] getNormalized(double[] array) {
+        double[] newArray = new double[array.length];
+        double total = getTotal(array);
+        for (int i = 0; i < array.length; i++) {
+            newArray[i] = array[i] / total;
+        }
+        return newArray;
+    }
+
+
+    /**
+     * @param array entries to be summed
+     * @param start start position
+     * @param end   the index of the element after the last one to be included
+     * @return the total of a the values in a range of an array
+     */
+    public static double getTotal(double[] array, int start, int end) {
+        double total = 0.0;
+        for (int i = start; i < end; i++) {
+            total += array[i];
+        }
+        return total;
+    }
+
+    /**
+     * @param array to sum over
+     * @return the total of the values in an array
+     */
+    public static double getTotal(double[] array) {
+        return getTotal(array, 0, array.length);
+
+    }
+
+    // ===================== (Synchronized) Static access methods to the private random instance ===========
+
+    /**
+     * Access a default instance of this class, access is synchronized
+     * @return 
+     */
+    public static long getSeed() {
+        synchronized (random) {
+            return random.getSeed();
+        }
+    }
+
+    /**
+     * Access a default instance of this class, access is synchronized
+     */
+    public static void setSeed(long seed) {
+        synchronized (random) {
+            random.setSeed(seed);
+        }
+    }
+
+    /**
+     * Access a default instance of this class, access is synchronized
+     */
+    public static byte nextByte() {
+        synchronized (random) {
+            return random.nextByte();
+        }
+    }
+
+    /**
+     * Access a default instance of this class, access is synchronized
+     */
+    public static boolean nextBoolean() {
+        synchronized (random) {
+            return random.nextBoolean();
+        }
+    }
+
+    /**
+     * Access a default instance of this class, access is synchronized
+     */
+    public static void nextBytes(byte[] bs) {
+        synchronized (random) {
+            random.nextBytes(bs);
+        }
+    }
+
+    /**
+     * Access a default instance of this class, access is synchronized
+     */
+    public static char nextChar() {
+        synchronized (random) {
+            return random.nextChar();
+        }
+    }
+
+    /**
+     * Sample a double from a Gaussian distribution with zero mean
+     * and unit variance.
+     * 
+     * @return sample
+     */
+    public static double nextGaussian() {
+        synchronized (random) {
+            return random.nextGaussian();
+        }
+    }
+
+    /**
+     * Sample a double from a Gamma distribution with a mean of
+     * alpha/lambda and a variance of alpha/lambda^2.
+     * Access a default instance of this class, access is synchronized.
+     *
+     * @param alpha
+     * @param lambda
+     * @return sample
+     */
+    public static double nextGamma(double alpha, double lambda) {
+        synchronized (random) {
+            return random.nextGamma(alpha, lambda);
+        }
+    }
+    
+    /**
+     * Draw sample from a Poissonian distribution of mean lambda. Accesses
+     * a default instance of this class, access is synchronized.
+     * 
+     * @param lambda mean of Poissonian distribution
+     * @return sample
+     */
+    public static double nextPoisson(double lambda) {
+        synchronized (random) {
+            return random.nextPoisson(lambda);
+        }
+    }
+
+    /**
+     * Access a default instance of this class, access is synchronized
+     *
+     * @return a pseudo random double precision floating point number in [01)
+     */
+    public static double nextDouble() {
+        synchronized (random) {
+            return random.nextDouble();
+        }
+    }
+
+    /**
+     * @return log of random variable in [0,1]
+     */
+    public static double randomLogDouble() {
+        return Math.log(nextDouble());
+    }
+
+    /**
+     * Draw from an exponential distribution.  Accesses a default instance of
+     * this class, access is synchronized.
+     * 
+     * @param lambda rate parameter (not mean) for the exponential
+     * @return number drawn from distribution
+     */
+    public static double nextExponential(double lambda) {
+        synchronized (random) {
+            return -1.0 * Math.log(1 - random.nextDouble()) / lambda;
+        }
+    }
+
+    /**
+     * Draw from a geometric distribution with trial success probability p.
+     * This method uses the form of the geometric distribution in which
+     * the random variable represents the number of failures before success,
+     * i.e. P(n) = (1-p)^n * p
+     * Access a default instance of this class, access is synchronized.
+     * 
+     * @param p success probability of each Bernoulli trial
+     * @return number drawn from distribution
+     */
+    public static long nextGeometric(double p) {
+        synchronized (random) {
+            double lambda = -Math.log(1.0-p);
+            return Math.round(Math.floor(nextExponential(lambda)));
+        }
+    }
+
+    /**
+     * Samples a float uniformly from [0,1). Access a default
+     * instance of this class, access is synchronized
+     * 
+     * @return sample
+     */
+    public static float nextFloat() {
+        synchronized (random) {
+            return random.nextFloat();
+        }
+    }
+
+    /**
+     * Samples a long int uniformly from between Long.MIN_VALUE
+     * and Long.MAX_VALUE.
+     * Access a default instance of this class, access is synchronized
+     * 
+     * @return sample
+     */
+    public static long nextLong() {
+        synchronized (random) {
+            return random.nextLong();
+        }
+    }
+
+    
+    /**
+     * Samples a short int uniformly from between Short.MIN_VALUE
+     * and Short.MAX_VALUE.
+     * Access a default instance of this class, access is synchronized
+     * 
+     * @return sample
+     */
+    public static short nextShort() {
+        synchronized (random) {
+            return random.nextShort();
+        }
+    }
+
+    /**
+     * Samples an int uniformly from between Integer.MIN_VALUE
+     * and Integer.MAX_VALUE.
+     * Access a default instance of this class, access is synchronized
+     * 
+     * @return sample
+     */
+    public static int nextInt() {
+        synchronized (random) {
+            return random.nextInt();
+        }
+    }
+
+    /**
+     * Samples an int uniformly from between 0 and n-1.
+     * Access a default instance of this class, access is synchronized
+     * 
+     * @param n
+     * @return sample
+     */
+    public static int nextInt(int n) {
+        synchronized (random) {
+            return random.nextInt(n);
+        }
+    }
+
+    /**
+     * Samples a double uniformly from between low and high.
+     * 
+     * @param low
+     * @param high
+     * @return sample
+     */
+    public static double uniform(double low, double high) {
+        return low + nextDouble() * (high - low);
+    }
+
+    /**
+     * Shuffles an array in place.
+     * @param array
+     */
+    public static void shuffle(int[] array) {
+        synchronized (random) {
+            random.shuffle(array);
+        }
+    }
+
+    /**
+     * Shuffles an array in place. Shuffles numberOfShuffles times
+     * @param array
+     * @param numberOfShuffles
+     */
+    public static void shuffle(int[] array, int numberOfShuffles) {
+        synchronized (random) {
+            random.shuffle(array, numberOfShuffles);
+        }
+    }
+
+    /**
+     * Returns an array of shuffled indices of length l.
+     *
+     * @param l length of the array required.
+     * @return array
+     */
+    public static int[] shuffled(int l) {
+        synchronized (random) {
+            return random.shuffled(l);
+        }
+    }
+
+
+    /**
+     * Returns an array of l ints sampled uniformly (with replacement)
+     * from between 0 and l-1.
+     * 
+     * @param l length of array required
+     * @return array
+     */
+    public static int[] sampleIndicesWithReplacement(int l) {
+        synchronized (random) {
+            int[] result = new int[l];
+            for (int i = 0; i < l; i++)
+                result[i] = random.nextInt(l);
+            return result;
+        }
+    }
+
+    /**
+     * Permutes the elements of array in place.
+     * 
+     * @param array
+     */
+    public static void permute(int[] array) {
+        synchronized (random) {
+            random.permute(array);
+        }
+    }
+
+    /**
+     * Returns a uniform random permutation of 0,...,l-1
+     *
+     * @param l length of the array required.
+     * @return array containing permuted indices
+     */
+    public static int[] permuted(int l) {
+        synchronized (random) {
+            return random.permuted(l);
+        }
+    }
+
+    static int m_nIDNr = 0;
+
+    static public int nextIDNr() {
+        return m_nIDNr++;
+    }
+
+//
+//    static public void storeToFile(String stateFile) {
+//        // serialize random
+//        try {
+//            FileOutputStream fos = new FileOutputStream(stateFile + ".rstate");
+//            ObjectOutputStream out = new ObjectOutputStream(fos);
+//            out.writeObject(random);
+//            out.close();
+//        }
+//        catch(IOException ex)
+//        {
+//            ex.printStackTrace();
+//        }
+//    }
+//
+//    static public void restoreFromFile(String stateFile) {
+//        // unserialize random
+//        try {
+//            FileInputStream fis = new FileInputStream(stateFile + ".rstate");
+//            ObjectInputStream in = new ObjectInputStream(fis);
+//            random = (MersenneTwisterFast)in.readObject();
+//            in.close();
+//        }
+//        catch(IOException ex)
+//        {
+//            ex.printStackTrace();
+//        }
+//        catch(ClassNotFoundException ex)
+//        {
+//            ex.printStackTrace();
+//        }
+//    }
+
+}
diff --git a/src/beast/util/TreeParser.java b/src/beast/util/TreeParser.java
new file mode 100644
index 0000000..3031f84
--- /dev/null
+++ b/src/beast/util/TreeParser.java
@@ -0,0 +1,630 @@
+/*
+* File TreeParser.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+package beast.util;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.StateNode;
+import beast.core.StateNodeInitialiser;
+import beast.evolution.alignment.Alignment;
+import beast.evolution.alignment.TaxonSet;
+import beast.evolution.tree.Node;
+import beast.evolution.tree.Tree;
+import beast.evolution.tree.TreeUtils;
+import beast.util.treeparser.NewickBaseVisitor;
+import beast.util.treeparser.NewickLexer;
+import beast.util.treeparser.NewickParser;
+import org.antlr.v4.runtime.*;
+import org.antlr.v4.runtime.misc.NotNull;
+import org.antlr.v4.runtime.misc.ParseCancellationException;
+import org.antlr.v4.runtime.tree.ParseTree;
+import java.text.DecimalFormat;
+import java.util.*;
+
+ at Description("Create beast.tree by parsing from a specification of a beast.tree in Newick format " +
+        "(includes parsing of any meta data in the Newick string).")
+public class TreeParser extends Tree implements StateNodeInitialiser {
+    /**
+     * default beast.tree branch length, used when that info is not in the Newick beast.tree
+     */
+    final static double DEFAULT_LENGTH = 0.001f;
+
+    /**
+     * labels of leafs, order of this list corresponds to node numbers
+     */
+    List<String> labels = null;
+
+    /**
+     * for memory saving, set to true *
+     */
+    final boolean suppressMetadata = false;
+
+    /**
+     * This solves issues where the taxa labels are numbers (in generated
+     * beast.tree data for example).
+     */
+    public final Input<Boolean> isLabelledNewickInput = new Input<>(
+            "IsLabelledNewick",
+            "Is the newick tree labelled (alternatively contains node numbers)? Default=false.", false);
+
+    public final Input<Alignment> dataInput = new Input<>("taxa",
+            "Specifies the list of taxa represented by leaves in the beast.tree");
+    public final Input<String> newickInput = new Input<>("newick",
+            "initial beast.tree represented in newick format");// not required, Beauti may need this for example
+    public final Input<Integer> offsetInput = new Input<>("offset",
+            "offset if numbers are used for taxa (offset=the lowest taxa number) default=1", 1);
+    public final Input<Double> thresholdInput = new Input<>("threshold",
+            "threshold under which node heights (derived from lengths) are set to zero. Default=0.", 0.0);
+    public final Input<Boolean> allowSingleChildInput = new Input<>(
+            "singlechild",
+            "flag to indicate that single child nodes are allowed. Default=true.", true);
+    public final Input<Boolean> adjustTipHeightsInput = new Input<>(
+            "adjustTipHeights",
+            "flag to indicate if tipHeights shall be adjusted when date traits missing. Default=true.", true);
+    public final Input<Double> scaleInput = new Input<>("scale",
+            "scale used to multiply internal node heights during parsing. Useful for importing starting from external" +
+                    " programs, for instance, RaxML tree rooted using Path-o-gen.", 1.0);
+
+    boolean createUnrecognizedTaxa = false;
+
+    /**
+     * Flag to indicate whether integer leaf labels have been used.  If
+     * they have, these will be used to interpret Nexus label translation maps
+     * in place of the node numbers.
+     */
+    boolean integerLeafLabels = true;
+
+    /**
+     * Ensure the class behaves properly, even when inputs are not specified.
+     */
+    @Override
+    public void initAndValidate() throws Exception {
+    	boolean sortNodesAlphabetically = false;
+
+        if (dataInput.get() != null) {
+            labels = dataInput.get().getTaxaNames();
+        } else if (m_taxonset.get() != null) {
+        	if (labels == null) {
+        		labels = m_taxonset.get().asStringList();
+        	} else { // else labels were set by TreeParser c'tor
+        		sortNodesAlphabetically = true;
+        	}
+        } else {
+            if (isLabelledNewickInput.get()) {
+                if (m_initial.get() != null) {
+                    labels = m_initial.get().getTaxonset().asStringList();
+                } else {
+                    labels = new ArrayList<>();
+                    createUnrecognizedTaxa = true;
+            		sortNodesAlphabetically = true;
+                }
+            } else {
+                if (m_initial.get() != null) {
+                    // try to pick up taxa from initial tree
+                    final Tree tree = m_initial.get();
+                    if (tree.m_taxonset.get() != null) {
+                        labels = tree.m_taxonset.get().asStringList();
+                    } else {
+                        // m_sLabels = null;
+                    }
+                } else {
+                    // m_sLabels = null;
+                }
+            }
+//            m_bIsLabelledNewick = false;
+        }
+        final String sNewick = newickInput.get();
+        if (sNewick == null || sNewick.equals("")) {
+            // can happen while initalising Beauti
+            final Node dummy = new Node();
+            setRoot(dummy);
+        } else {
+            setRoot(parseNewick(newickInput.get()));
+        }
+
+        super.initAndValidate();
+        
+        if (sortNodesAlphabetically) {
+	        // correct for node ordering: ensure order is alphabetical
+	        for (int i = 0; i < getNodeCount() && i < labels.size(); i++) {
+	       		m_nodes[i].setID(labels.get(i));
+	        }
+
+	        Node [] nodes = new Node[labels.size()];
+            System.arraycopy(m_nodes, 0, nodes, 0, labels.size());
+
+	        Arrays.sort(nodes, (o1, o2) -> o1.getID().compareTo(o2.getID()));
+	        for (int i = 0; i < labels.size(); i++) {
+	        	m_nodes[i] = nodes[i];
+	        	nodes[i].setNr(i);
+	        }
+        }
+        
+        
+        if (m_initial.get() != null)
+            processTraits(m_initial.get().m_traitList.get());
+        else
+            processTraits(m_traitList.get());
+
+        if (timeTraitSet != null) {
+            adjustTreeNodeHeights(root);
+        } else if (adjustTipHeightsInput.get()) {
+
+            double treeLength = TreeUtils.getTreeLength(this,getRoot());
+
+            double extraTreeLength = 0.0;
+            double maxTipHeight = 0.0;
+
+            // all nodes should be at zero height if no date-trait is available
+            for (int i = 0; i < getLeafNodeCount(); i++) {
+                double height = getNode(i).getHeight();
+                if (maxTipHeight < height) {
+                    maxTipHeight = height;
+                }
+                extraTreeLength += height;
+                getNode(i).setHeight(0);
+            }
+
+            double scaleFactor = (treeLength+extraTreeLength)/treeLength;
+
+            final double SCALE_FACTOR_THRESHOLD = 0.001;
+
+            // if the change in total tree length is more than 0.1% then give the user a warning!
+            if (scaleFactor > 1.0 + SCALE_FACTOR_THRESHOLD) {
+
+                DecimalFormat format = new DecimalFormat("#.##");
+
+                System.out.println("WARNING: Adjust tip heights attribute set to 'true' in " + getClass().getSimpleName());
+                System.out.println("         has resulted in significant (>" + format.format(SCALE_FACTOR_THRESHOLD*100.0) + "%) change in tree length.");
+                System.out.println("         Use "+adjustTipHeightsInput.getName()+"='false' to override this default.");
+                System.out.printf( "  original max tip age = %8.3f\n", maxTipHeight);
+                System.out.printf( "       new max tip age = %8.3f\n", 0.0);
+                System.out.printf( "  original tree length = %8.3f\n", treeLength);
+                System.out.printf( "       new tree length = %8.3f\n", treeLength+extraTreeLength);
+                System.out.printf( "       TL scale factor = %8.3f\n", scaleFactor);
+            }
+        }
+
+        if( m_taxonset.get() == null && labels != null && isLabelledNewickInput.get() ) {
+            m_taxonset.setValue(new TaxonSet(TaxonSet.createTaxonList(labels)), this);
+        }
+
+        initStateNodes();
+    } // init
+
+    public TreeParser() {
+    }
+
+    public TreeParser(final Alignment alignment, final String newick) throws Exception {
+        dataInput.setValue(alignment, this);
+        newickInput.setValue(newick, this);
+        initAndValidate();
+    }
+
+    /**
+     * Create a tree from the given newick format
+     *
+     * @param taxaNames a list of taxa names to use, or null.
+     *                  If null then IsLabelledNewick will be set to true
+     * @param newick    the newick of the tree
+     * @param offset    the offset to map node numbers in newick format to indices in taxaNames.
+     *                  so, name(node with nodeNumber) = taxaNames[nodeNumber-offset]
+     * @param adjustTipHeightsWhenMissingDateTraits
+     *                  true if tip heights should be adjusted to zero
+     * @throws Exception
+     */
+    public TreeParser(final List<String> taxaNames,
+                      final String newick,
+                      final int offset,
+                      final boolean adjustTipHeightsWhenMissingDateTraits) throws Exception {
+
+        if (taxaNames == null) {
+            isLabelledNewickInput.setValue(true, this);
+        } else {
+            m_taxonset.setValue(new TaxonSet(TaxonSet.createTaxonList(taxaNames)), this);
+        }
+        newickInput.setValue(newick, this);
+        offsetInput.setValue(offset, this);
+        adjustTipHeightsInput.setValue(adjustTipHeightsWhenMissingDateTraits, this);
+        labels = taxaNames;
+        initAndValidate();
+    }
+
+    /**
+     * Parses newick format. The default does not adjust heights and allows single child nodes.
+     * Modifications of the input should be deliberately made by calling e.g. new TreeParser(newick, true, false).
+     *
+     * @param newick a string representing a tree in newick format
+     */
+    public TreeParser(final String newick) throws Exception {
+        this(newick, false, true, true, 1);
+    }
+
+    /**
+     * @param newick                a string representing a tree in newick format
+     * @param adjustTipHeights      true if the tip heights should be adjusted to 0 (i.e. contemporaneous) after reading in tree.
+     * @param allowSingleChildNodes true if internal nodes with single children are allowed
+     * @throws Exception
+     */
+    public TreeParser(final String newick,
+                      final boolean adjustTipHeights,
+                      final boolean allowSingleChildNodes) throws Exception {
+        this(newick, adjustTipHeights, allowSingleChildNodes, true, 1);
+    }
+
+    /**
+     * @param newick           a string representing a tree in newick format
+     * @param adjustTipHeights true if the tip heights should be adjusted to 0 (i.e. contemporaneous) after reading in tree.
+     * @throws Exception
+     */
+    public TreeParser(final String newick,
+                      final boolean adjustTipHeights) throws Exception {
+        this(newick, adjustTipHeights, true, true, 1);
+    }
+
+    /**
+     * @param newick                a string representing a tree in newick format
+     * @param adjustTipHeights      true if the tip heights should be adjusted to 0 (i.e. contemporaneous) after reading in tree.
+     * @param allowSingleChildNodes true if internal nodes with single children are allowed
+     * @param isLabeled             true if nodes are labeled with taxa labels
+     * @param offset                if isLabeled == false and node labeling starts with x
+     *                              then offset should be x. When isLabeled == true offset should
+     *                              be 1 as by default.
+     * @throws Exception
+     */
+    public TreeParser(final String newick,
+                      final boolean adjustTipHeights,
+                      final boolean allowSingleChildNodes,
+                      final boolean isLabeled,
+                      final int offset) throws Exception {
+
+        newickInput.setValue(newick, this);
+        isLabelledNewickInput.setValue(isLabeled, this);
+        adjustTipHeightsInput.setValue(adjustTipHeights, this);
+        allowSingleChildInput.setValue(allowSingleChildNodes, this);
+
+        offsetInput.setValue(offset, this);
+
+        initAndValidate();
+    }
+
+    /**
+     * Parse a newick-ish string and generate the BEAST tree it describes.
+     *
+     * @param newick string to parse
+     * @return root node of tree
+     * @throws Exception if anything goes wrong during the parse.
+     */
+    public Node parseNewick(String newick) {
+        ANTLRInputStream input = new ANTLRInputStream(newick);
+
+        // Custom parse/lexer error listener
+        BaseErrorListener errorListener = new BaseErrorListener() {
+            @Override
+            public void syntaxError(Recognizer<?, ?> recognizer,
+                                    Object offendingSymbol,
+                                    int line, int charPositionInLine,
+                                    String msg, RecognitionException e) {
+                throw new RuntimeException("TreeParser: Error parsing character "
+                        + charPositionInLine + " of Newick string: " + msg);
+            }
+        };
+
+        // Use lexer to produce token stream
+
+        NewickLexer lexer = new NewickLexer(input);
+        lexer.removeErrorListeners();
+        lexer.addErrorListener(errorListener);
+
+        CommonTokenStream tokens = new CommonTokenStream(lexer);
+
+        // Parse token stream to produce parse tree
+
+        NewickParser parser = new NewickParser(tokens);
+        parser.removeErrorListeners();
+        parser.addErrorListener(errorListener);
+
+        ParseTree parseTree = parser.tree();
+
+        // Traverse parse tree, constructing BEAST tree along the way
+
+        NewickASTVisitor visitor = new NewickASTVisitor();
+        Node root = visitor.visit(parseTree);
+
+        return root;
+    }
+
+
+    /**
+     * Given a map of name translations (string to string),
+     * rewrites all leaf ids that match a key in the map
+     * to the respective value in the matching key/value pair.
+     * If current leaf id is null, then interpret translation keys as node numbers (origin 1)
+     * and set leaf id of node n to map.get(n-1).
+     *
+     * @param translationMap map of name translations
+     */
+    public void translateLeafIds(final Map<String, String> translationMap) {
+
+        for (final Node leaf : getExternalNodes()) {
+            String id = leaf.getID();
+
+            if (id == null || !integerLeafLabels) {
+                id = Integer.toString(leaf.getNr() + 1);
+            }
+
+            final String newId = translationMap.get(id);
+            if (newId != null) {
+                leaf.setID(newId);
+            }
+        }
+    }
+
+
+    /**
+     * Visits each component of the AST built from the Newick string, constructing
+     * a BEAST tree along the way.
+     */
+    class NewickASTVisitor extends NewickBaseVisitor<Node> {
+
+        private List<Exception> raisedExceptions = new ArrayList<>();
+
+        private int numberedNodeCount = 0;
+
+        @Override
+        public Node visitTree(@NotNull NewickParser.TreeContext ctx) {
+            Node root = visit(ctx.node());
+
+            // Ensure tree is properly sorted in terms of node numbers.
+            root.sort();
+
+            // Replace lengths read from Newick with heights.
+            convertLengthToHeight(root);
+
+            // Make sure internal nodes are numbered correctly
+            numberUnnumberedNodes(root);
+
+            // Check for duplicate taxa
+            BitSet nodeNrSeen = new BitSet();
+            for (Node leaf : root.getAllLeafNodes()) {
+                if (leaf.getNr()<0)
+                   continue;  // Skip unnumbered leaves
+
+                if (nodeNrSeen.get(leaf.getNr()))
+                    throw new ParseCancellationException("Duplicate taxon found: " + labels.get(leaf.getNr()));
+                else
+                    nodeNrSeen.set(leaf.getNr());
+            }
+
+            return root;
+        }
+
+        @Override
+        public Node visitNode(NewickParser.NodeContext ctx) {
+            Node node = new Node();
+
+            for (NewickParser.NodeContext ctxChild : ctx.node()) {
+                node.addChild(visit(ctxChild));
+            }
+
+            NewickParser.PostContext postCtx = ctx.post();
+
+            // Process metadata
+
+            if (postCtx.meta() != null) {
+
+                node.metaDataString = "";
+                for (int i=0; i<postCtx.meta().attrib().size(); i++) {
+                    if (i>0)
+                        node.metaDataString += ",";
+                    node.metaDataString += postCtx.meta().attrib().get(i).getText();
+                }
+
+                if (!suppressMetadata) {
+                    for (NewickParser.AttribContext attribctx : postCtx.meta().attrib()) {
+                        String key = attribctx.attribKey.getText();
+
+                        if (attribctx.attribValue().number() != null) {
+                            node.setMetaData(key, Double.parseDouble(
+                                    attribctx.attribValue().number().getText()));
+                        } else if (attribctx.attribValue().STRING() != null) {
+                            String stringValue = attribctx.attribValue().STRING().getText();
+                            if (stringValue.startsWith("\"") || stringValue.startsWith("\'"));
+                                stringValue = stringValue.substring(1, stringValue.length()-1);
+                            node.setMetaData(key, stringValue);
+                        } else {
+                            // BEAST doesn't do anything with vectors yet.
+                        }
+                    }
+                }
+            }
+
+            // Process edge length
+
+            if (postCtx.length != null)
+                node.setHeight(Double.parseDouble(postCtx.length.getText()));
+            else
+                node.setHeight(DEFAULT_LENGTH);
+
+            // Process label
+
+            node.setNr(-1);
+            if (postCtx.label() != null) {
+                node.setID(postCtx.label().getText());
+
+                if (postCtx.label().number() == null
+                        || postCtx.label().number().INT() == null)
+                    integerLeafLabels = false;
+
+                String postText = postCtx.getText();
+
+                // Treat labels as node numbers in certain situations
+                if (!isLabelledNewickInput.get()
+                        && postCtx.label().number() != null
+                        && postCtx.label().number().INT() != null) {
+
+                    int nodeNr = Integer.parseInt(postCtx.label().getText()) - offsetInput.get();
+                    if (nodeNr<0)
+                        throw new ParseCancellationException("Node number given " +
+                                "is smaller than current offset (" +
+                                offsetInput.get() + ").  Perhaps offset is " +
+                                "too high?");
+
+                    node.setNr(nodeNr);
+                    numberedNodeCount += 1;
+                } else {
+                    if (node.isLeaf()) {
+                        node.setNr(getLabelIndex(postCtx.label().getText()));
+                        numberedNodeCount += 1;
+                    }
+                }
+            }
+
+            if (node.getChildCount()==1 && !allowSingleChildInput.get())
+                throw new ParseCancellationException("Node with single child found.");
+
+            return node;
+        }
+
+        /**
+         * Try to map sStr into an index.
+         */
+        private int getLabelIndex(final String sStr) {
+
+            // look it up in list of taxa
+            for (int nIndex = 0; nIndex < labels.size(); nIndex++) {
+                if (sStr.equals(labels.get(nIndex))) {
+                    return nIndex;
+                }
+            }
+
+            // if createUnrecognizedTaxon==true, then do it now, otherwise labels will not be populated and
+            // out of bounds error will occur in m_sLabels later.
+            if (createUnrecognizedTaxa) {
+                labels.add(sStr);
+                return labels.size() - 1;
+            }
+
+            throw new ParseCancellationException("Label '" + sStr + "' in Newick beast.tree could " +
+                    "not be identified. Perhaps taxa or taxonset is not specified?");
+        }
+
+        /**
+         * The node height field is initially populated with the length of the edge above due
+         * to the way the tree is stored in Newick format.  This method converts these lengths
+         * to actual ages before the most recent sample.
+         *
+         * @param root root of tree
+         */
+        private void convertLengthToHeight(final Node root) {
+            final double fTotalHeight = convertLengthToHeight(root, 0);
+            offset(root, -fTotalHeight);
+        }
+
+        /**
+         * Recursive method used to convert lengths to heights.  Applied to the root,
+         * results in heights from 0 to -total_height_of_tree.
+         *
+         * @param node node of a clade to convert
+         * @param fHeight Parent height.
+         * @return total height of clade
+         */
+        private double convertLengthToHeight(final Node node, final double fHeight) {
+            final double fLength = node.getHeight();
+            node.setHeight((fHeight - fLength) * scaleInput.get());
+            if (node.isLeaf()) {
+                return node.getHeight();
+            } else {
+                final double fLeft = convertLengthToHeight(node.getLeft(), fHeight - fLength);
+                if (node.getRight() == null) {
+                    return fLeft;
+                }
+                final double fRight = convertLengthToHeight(node.getRight(), fHeight - fLength);
+                return Math.min(fLeft, fRight);
+            }
+        }
+
+        /**
+         * Method used by convertLengthToHeight(node) to remove negative offset from
+         * node heights that is produced by convertLengthToHeight(node, height).
+         *
+         * @param node node of clade to offset
+         * @param fDelta offset
+         */
+        private void offset(final Node node, final double fDelta) {
+            node.setHeight(node.getHeight() + fDelta);
+            if (node.isLeaf()) {
+                if (node.getHeight() < thresholdInput.get()) {
+                    node.setHeight(0);
+                }
+            }
+            if (!node.isLeaf()) {
+                offset(node.getLeft(), fDelta);
+                if (node.getRight() != null) {
+                    offset(node.getRight(), fDelta);
+                }
+            }
+        }
+
+        /**
+         * Number any nodes in a clade which were not explicitly numbered by
+         * the parsed string.
+         *
+         * @param node clade parent
+         */
+        private void numberUnnumberedNodes(Node node) {
+            if (node.isLeaf())
+                return;
+
+            for (Node child : node.getChildren()) {
+                numberUnnumberedNodes(child);
+            }
+
+            if (node.getNr()<0)
+                node.setNr(numberedNodeCount);
+
+            numberedNodeCount += 1;
+        }
+    }
+
+
+    /*
+     *StateNodeInitializer implementation
+     */
+
+    @Override
+    public void initStateNodes() {
+        if (m_initial.get() != null) {
+            m_initial.get().assignFrom(this);
+        }
+    }
+
+    @Override
+    public void getInitialisedStateNodes(final List<StateNode> stateNodes) {
+        if (m_initial.get() != null) {
+            stateNodes.add(m_initial.get());
+        }
+    }
+}
diff --git a/src/beast/util/XMLParser.java b/src/beast/util/XMLParser.java
new file mode 100644
index 0000000..71e15a6
--- /dev/null
+++ b/src/beast/util/XMLParser.java
@@ -0,0 +1,1035 @@
+/*
+* File XMLParser.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+package beast.util;
+
+
+import beast.app.beauti.PartitionContext;
+import beast.core.*;
+import beast.core.Input.Validate;
+import beast.core.Runnable;
+import beast.core.parameter.Parameter;
+import beast.core.parameter.RealParameter;
+import beast.core.util.Log;
+import beast.evolution.alignment.Alignment;
+import beast.evolution.alignment.Sequence;
+import beast.evolution.tree.Tree;
+
+import org.w3c.dom.*;
+import org.xml.sax.InputSource;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import java.io.File;
+import java.io.PrintStream;
+import java.io.StringReader;
+import java.util.*;
+
+import static beast.util.XMLParserUtils.processPlates;
+import static beast.util.XMLParserUtils.replaceVariable;
+
+
+/**
+ * XMLParser process Beast 2 XML and constructs an MCMC object
+ * <p/>
+ * <p/>
+ * Reserved elements (present in element2class map)
+ * <distribution>
+ * <operator>
+ * <logger>
+ * <data>
+ * <sequence>
+ * <state>
+ * <parameter>
+ * <tree>
+ * <beast version='2.0' namespace='x.y.z:'>
+ * <map name='elementName'>x.y.z.Class</map>
+ * <run>
+ * <plate>
+ * <input>
+ * <p/>
+ * Reserved attributes:
+ * <input id='myId' idRef='otherId' name='inputName' spec='x.y.z.MyClass'/>
+ * <p/>
+ * Reserved attribute formats:
+ * shortcut for idref inputs
+ * <input xyz='@ref'/>
+ * ==
+ * <input>
+ * <input name='xyz' idref='ref'/>
+ * </input>
+ * <p/>
+ * plate notations
+ * <plate var='n' range='1,2,3'><xyz id='id$(n)'/></plate>
+ * ==
+ * <xyz id='id1'/>
+ * <xyz id='id2'/>
+ * <xyz id='id3'/>
+ * <p/>
+ * Resolving class:
+ * 1. specified in spec attribute
+ * 2. if not, get from element2class map
+ * 3. if not, use element name (and hope it shows up in the namespace somewhere).
+ * <p/>
+ * Resolving name:
+ * 1. specified in name attribute
+ * 2. if not, use (non-reserved) attribute name
+ * 3. if not, use element name
+ * 4. if input, use 'value' when there is text content, but no element content
+ * <p/>
+ * Resolving value:
+ * 0. if idref is specified, use the referred object
+ * 1. specified in value attribute
+ * 2. if not, use value of (non-reserved) attribute
+ * 3. if not, use text content when there is text content, but no element content
+ * <p/>
+ * Parsing rules:
+ * <p/>
+ * Processing non reserved attributes
+ * <input otherAttribute="xyz"/>
+ * equals
+ * <input>
+ * <input name='otherAttribute' value='xyz'/>
+ * </input>
+ * <p/>
+ * Processing non reserved element names
+ * <myElement/>
+ * ==
+ * <input spec='myElement' name='myElement'/>
+ * unless 'spec' is a specified attribute, then that overrides, likewise for 'name'
+ * <p/>
+ * Processing of text content (only when there are no enclosing elements)
+ * <input name='data'>xyz</input>
+ * ==
+ * <input name='data' value='xyz/>
+ *
+ * @author rrb
+ */
+
+
+public class XMLParser {
+    final static String DATA_CLASS = Alignment.class.getName();
+    final static String SEQUENCE_CLASS = Sequence.class.getName();
+    final static String STATE_CLASS = State.class.getName();
+    final static String LIKELIHOOD_CLASS = Distribution.class.getName();
+    final static String LOG_CLASS = Logger.class.getName();
+    final static String OPERATOR_CLASS = Operator.class.getName();
+    final static String REAL_PARAMETER_CLASS = RealParameter.class.getName();
+    final static String PLUGIN_CLASS = BEASTInterface.class.getName();
+    final static String INPUT_CLASS = Input.class.getName();
+    final static String TREE_CLASS = Tree.class.getName();
+    final static String RUNNABLE_CLASS = Runnable.class.getName();
+
+
+    /* This is the set of keywords in XML.
+* This list should not be added to unless there
+* is a very very good reason. */
+    public final static String BEAST_ELEMENT = "beast";
+    public final static String MAP_ELEMENT = "map";
+    public final static String DISTRIBUTION_ELEMENT = "distribution";
+    public final static String OPERATOR_ELEMENT = "operator";
+    public final static String INPUT_ELEMENT = "input";
+    public final static String LOG_ELEMENT = "logger";
+    public final static String DATA_ELEMENT = "data";
+    public final static String SEQUENCE_ELEMENT = "sequence";
+    public final static String STATE_ELEMENT = "state";
+    public final static String TREE_ELEMENT = "tree";
+    public final static String REAL_PARAMETER_ELEMENT = "parameter";
+    public final static String RUN_ELEMENT = "run";
+    public final static String PLATE_ELEMENT = "plate";
+
+    Runnable m_runnable;
+    State m_state;
+    /**
+     * DOM document representation of XML file *
+     */
+    Document doc;
+
+    /**
+     * maps sequence data onto integer value *
+     */
+    String m_sDataMap;
+
+    HashMap<String, BEASTInterface> IDMap;
+    HashMap<String, Integer[]> likelihoodMap;
+    HashMap<String, Node> IDNodeMap;
+
+    static HashMap<String, String> element2ClassMap;
+    static Set<String> reservedElements;
+    static {
+        element2ClassMap = new HashMap<String, String>();
+        element2ClassMap.put(DISTRIBUTION_ELEMENT, LIKELIHOOD_CLASS);
+        element2ClassMap.put(OPERATOR_ELEMENT, OPERATOR_CLASS);
+        element2ClassMap.put(INPUT_ELEMENT, INPUT_CLASS);
+        element2ClassMap.put(LOG_ELEMENT, LOG_CLASS);
+        element2ClassMap.put(DATA_ELEMENT, DATA_CLASS);
+        element2ClassMap.put(STATE_ELEMENT, STATE_CLASS);
+        element2ClassMap.put(SEQUENCE_ELEMENT, SEQUENCE_CLASS);
+        element2ClassMap.put(TREE_ELEMENT, TREE_CLASS);
+        element2ClassMap.put(REAL_PARAMETER_ELEMENT, REAL_PARAMETER_CLASS);
+        reservedElements = new HashSet<String>();
+        for (final String element : element2ClassMap.keySet()) {
+        	reservedElements.add(element);
+        }
+    }
+    
+    List<BEASTInterface> pluginsWaitingToInit;
+    List<Node> nodesWaitingToInit;
+
+    public HashMap<String, String> getElement2ClassMap() {
+        return element2ClassMap;
+    }
+
+
+    String[] m_sNameSpaces;
+
+    /**
+     * Flag to indicate initAndValidate should be called after
+     * all inputs of a plugin have been parsed
+     */
+    boolean m_bInitialize = true;
+
+    /**
+     * when parsing XML, missing inputs can be assigned default values through
+     * a RequiredInputProvider
+     */
+    RequiredInputProvider requiredInputProvider = null;
+    PartitionContext partitionContext = null;
+
+    public XMLParser() {
+        pluginsWaitingToInit = new ArrayList<BEASTInterface>();
+        nodesWaitingToInit = new ArrayList<Node>();
+    }
+
+    public Runnable parseFile(final File file) throws Exception {
+        // parse the XML file into a DOM document
+        final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+        //factory.setValidating(true);
+        doc = factory.newDocumentBuilder().parse(file);
+        doc.normalize();
+        processPlates(doc,PLATE_ELEMENT);
+
+        // Substitute occurrences of "$(filebase)" with name of file 
+        int pointIdx = file.getName().lastIndexOf('.');
+        String baseName = pointIdx<0 ? file.getName() : file.getName().substring(0, pointIdx);
+        if (doc.getElementsByTagName(BEAST_ELEMENT).item(0) == null) {
+        	Log.err.println("Incorrect XML: Could not find 'beast' element in file " + file.getName());
+        	throw new RuntimeException();
+        }
+        replaceVariable(doc.getElementsByTagName(BEAST_ELEMENT).item(0), "filebase", baseName);
+
+        // Substitute occurrences of "$(seed)" with RNG seed
+        replaceVariable(doc.getElementsByTagName(BEAST_ELEMENT).item(0), "seed",
+                String.valueOf(Randomizer.getSeed()));
+        
+        IDMap = new HashMap<String, BEASTInterface>();
+        likelihoodMap = new HashMap<String, Integer[]>();
+        IDNodeMap = new HashMap<String, Node>();
+
+        
+        parse();
+        //assert m_runnable == null || m_runnable instanceof Runnable;
+        if (m_runnable != null)
+            return m_runnable;
+        else {
+            throw new Exception("Run element does not point to a runnable object.");
+        }
+    } // parseFile
+
+    /**
+     * extract all elements (runnable or not) from an XML fragment.
+     * Useful for retrieving all non-runnable elements when a template
+     * is instantiated by Beauti *
+     */
+    public List<BEASTInterface> parseTemplate(final String sXML, final HashMap<String, BEASTInterface> sIDMap, final boolean bInitialize) throws Exception {
+        m_bInitialize = bInitialize;
+        // parse the XML file into a DOM document
+        final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+        //factory.setValidating(true);
+        doc = factory.newDocumentBuilder().parse(new InputSource(new StringReader(sXML)));
+        doc.normalize();
+        processPlates(doc,PLATE_ELEMENT);
+        
+        //XMLParserUtils.saveDocAsXML(doc, "/tmp/beast2.xml");
+
+        IDMap = sIDMap;//new HashMap<String, Plugin>();
+        likelihoodMap = new HashMap<String, Integer[]>();
+        IDNodeMap = new HashMap<String, Node>();
+
+        final List<BEASTInterface> plugins = new ArrayList<BEASTInterface>();
+
+        // find top level beast element
+        final NodeList nodes = doc.getElementsByTagName("*");
+        if (nodes == null || nodes.getLength() == 0) {
+            throw new Exception("Expected top level beast element in XML");
+        }
+        final Node topNode = nodes.item(0);
+        // sanity check that we are reading a beast 2 file
+        final double fVersion = getAttributeAsDouble(topNode, "version");
+        if (!topNode.getNodeName().equals(BEAST_ELEMENT) || fVersion < 2.0 || fVersion == Double.MAX_VALUE) {
+            return plugins;
+        }
+        // only process templates
+//        String sType = getAttribute(topNode, "type");
+//        if (sType == null || !sType.equals("template")) {
+//        	return plugins;
+//        }
+
+
+        initIDNodeMap(topNode);
+        parseNameSpaceAndMap(topNode);
+
+        final NodeList children = topNode.getChildNodes();
+        for (int i = 0; i < children.getLength(); i++) {
+            if (children.item(i).getNodeType() == Node.ELEMENT_NODE) {
+                final Node child = children.item(i);
+                System.err.println(child.getNodeName());
+                if (!child.getNodeName().equals(MAP_ELEMENT)) {
+                    plugins.add(createObject(child, PLUGIN_CLASS, null));
+                }
+            }
+        }
+        initPlugins();
+        return plugins;
+    } // parseTemplate
+
+    private void initPlugins() throws Exception {
+    	Node node = null;
+        try {
+        	for (int i = 0; i < pluginsWaitingToInit.size(); i++) {
+        		final BEASTInterface plugin = pluginsWaitingToInit.get(i);
+        		node = nodesWaitingToInit.get(i);
+        		plugin.initAndValidate();
+        	}
+        } catch (Exception e) {
+            // next lines for debugging only
+            //plugin.validateInputs();
+            //plugin.initAndValidate();
+            e.printStackTrace();
+            throw new XMLParserException(node, "validate and intialize error: " + e.getMessage(), 110);
+        }
+	}
+
+    /**
+     * Parse an XML fragment representing a Plug-in
+     * Only the run element or if that does not exist the last child element of
+     * the top level <beast> element is considered.
+     */
+    public BEASTInterface parseFragment(final String sXML, final boolean bInitialize) throws Exception {
+        m_bInitialize = bInitialize;
+        // parse the XML fragment into a DOM document
+        final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+        doc = factory.newDocumentBuilder().parse(new InputSource(new StringReader(sXML)));
+        doc.normalize();
+        processPlates(doc,PLATE_ELEMENT);
+
+        IDMap = new HashMap<String, BEASTInterface>();
+        likelihoodMap = new HashMap<String, Integer[]>();
+        IDNodeMap = new HashMap<String, Node>();
+
+        // find top level beast element
+        final NodeList nodes = doc.getElementsByTagName("*");
+        if (nodes == null || nodes.getLength() == 0) {
+            throw new Exception("Expected top level beast element in XML");
+        }
+        final Node topNode = nodes.item(0);
+        initIDNodeMap(topNode);
+        parseNameSpaceAndMap(topNode);
+
+        final NodeList children = topNode.getChildNodes();
+        if (children.getLength() == 0) {
+            throw new Exception("Need at least one child element");
+        }
+        int i = children.getLength() - 1;
+        while (i >= 0 && (children.item(i).getNodeType() != Node.ELEMENT_NODE ||
+                !children.item(i).getNodeName().equals("run"))) {
+            i--;
+        }
+        if (i < 0) {
+            i = children.getLength() - 1;
+            while (i >= 0 && children.item(i).getNodeType() != Node.ELEMENT_NODE) {
+                i--;
+            }
+        }
+        if (i < 0) {
+            throw new Exception("Need at least one child element");
+        }
+
+        final BEASTInterface plugin = createObject(children.item(i), PLUGIN_CLASS, null);
+        initPlugins();
+        return plugin;
+    } // parseFragment
+
+    /**
+     * Parse XML fragment that will be wrapped in a beast element
+     * before parsing. This allows for ease of creating Plugin objects,
+     * like this:
+     * Tree tree = (Tree) new XMLParser().parseBareFragment("<tree spec='beast.util.TreeParser' newick='((1:1,3:1):1,2:2)'/>");
+     * to create a simple tree.
+     */
+    public BEASTInterface parseBareFragment(String sXML, final boolean bInitialize) throws Exception {
+        // get rid of XML processing instruction
+        sXML = sXML.replaceAll("<\\?xml[^>]*>", "");
+        if (sXML.contains("<beast")) {
+            return parseFragment(sXML, bInitialize);
+        } else {
+            return parseFragment("<beast>" + sXML + "</beast>", bInitialize);
+        }
+    }
+
+    public List<BEASTInterface> parseBareFragments(final String sXML, final boolean bInitialize) throws Exception {
+        m_bInitialize = bInitialize;
+        // parse the XML fragment into a DOM document
+        final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+        doc = factory.newDocumentBuilder().parse(new InputSource(new StringReader(sXML)));
+        doc.normalize();
+        processPlates(doc,PLATE_ELEMENT);
+
+        // find top level beast element
+        final NodeList nodes = doc.getElementsByTagName("*");
+        if (nodes == null || nodes.getLength() == 0) {
+            throw new Exception("Expected top level beast element in XML");
+        }
+        final Node topNode = nodes.item(0);
+        initIDNodeMap(topNode);
+        parseNameSpaceAndMap(topNode);
+
+        final NodeList children = topNode.getChildNodes();
+        final List<BEASTInterface> plugins = new ArrayList<BEASTInterface>();
+        for (int i = 0; i < children.getLength(); i++) {
+            if (children.item(i).getNodeType() == Node.ELEMENT_NODE) {
+                final BEASTInterface plugin = createObject(children.item(i), PLUGIN_CLASS, null);
+                plugins.add(plugin);
+            }
+        }
+        initPlugins();
+        return plugins;
+    }
+
+    /**
+     * parse BEAST file as DOM document
+     *
+     * @throws Exception
+     */
+    public void parse() throws Exception {
+        // find top level beast element
+        final NodeList nodes = doc.getElementsByTagName("*");
+        if (nodes == null || nodes.getLength() == 0) {
+            throw new Exception("Expected top level beast element in XML");
+        }
+        final Node topNode = nodes.item(0);
+        final double fVersion = getAttributeAsDouble(topNode, "version");
+        if (fVersion < 2.0 || fVersion == Double.MAX_VALUE) {
+            throw new XMLParserException(topNode, "Wrong version: only versions > 2.0 are supported", 101);
+        }
+
+        initIDNodeMap(topNode);
+        parseNameSpaceAndMap(topNode);
+
+        //parseState();
+        parseRunElement(topNode);
+        initPlugins();
+    } // parse
+
+
+    /**
+     * Traverse DOM beast.tree and grab all nodes that have an 'id' attribute
+     * Throw exception when a duplicate id is encountered
+     *
+     * @param node
+     * @throws Exception
+     */
+    void initIDNodeMap(final Node node) throws Exception {
+        final String sID = getID(node);
+        if (sID != null) {
+            if (IDNodeMap.containsKey(sID)) {
+                throw new XMLParserException(node, "IDs should be unique. Duplicate id '" + sID + "' found", 104);
+            }
+            IDNodeMap.put(sID, node);
+        }
+        final NodeList children = node.getChildNodes();
+        for (int i = 0; i < children.getLength(); i++) {
+            initIDNodeMap(children.item(i));
+        }
+    }
+
+    /**
+     * find out namespaces (beast/@namespace attribute)
+     * and element to class maps, which reside in beast/map elements
+     * <beast version='2.0' namespace='snap:beast.util'>
+     * <map name='snapprior'>snap.likelihood.SnAPPrior</map>
+     * <map name='snaplikelihood'>snap.likelihood.SnAPTreeLikelihood</map>
+     *
+     * @param topNode
+     * @throws XMLParserException
+     */
+    void parseNameSpaceAndMap(final Node topNode) throws XMLParserException {
+        // process namespaces
+        if (hasAtt(topNode, "namespace")) {
+            final String sNameSpace = getAttribute(topNode, "namespace");
+            setNameSpace(sNameSpace);
+        } else {
+            // make sure that the default namespace is in there
+            if (m_sNameSpaces == null) {
+                m_sNameSpaces = new String[1];
+                m_sNameSpaces[0] = "";
+            }
+        }
+
+        // process map elements
+        final NodeList nodes = doc.getElementsByTagName(MAP_ELEMENT);
+        for (int i = 0; i < nodes.getLength(); i++) {
+            final Node child = nodes.item(i);
+            final String sName = getAttribute(child, "name");
+            if (sName == null) {
+                throw new XMLParserException(child, "name attribute expected in map element", 300);
+            }
+            if (!element2ClassMap.containsKey(sName)) {
+//                throw new XMLParserException(child, "name '" + sName + "' is already defined as " + m_sElement2ClassMap.get(sName), 301);
+//            }
+
+	            // get class
+	            String sClass = child.getTextContent();
+	            // remove spaces
+	            sClass = sClass.replaceAll("\\s", "");
+	            //sClass = sClass.replaceAll("beast", "yabby");
+	            // go through namespaces in order they are declared to find the correct class
+	            boolean bDone = false;
+	            for (final String sNameSpace : m_sNameSpaces) {
+	                try {
+	                    // sanity check: class should exist
+	                    if (!bDone && Class.forName(sNameSpace + sClass) != null) {
+	                        element2ClassMap.put(sName, sClass);
+	                        Log.debug.println(sName + " => " + sNameSpace + sClass);
+	                        final String reserved = getAttribute(child, "reserved");
+	                        if (reserved != null && reserved.toLowerCase().equals("true")) {
+	                        	reservedElements.add(sName);
+	                        }
+	
+	                        bDone = true;
+	                    }
+	                } catch (ClassNotFoundException e) {
+	                    //System.err.println("Not found " + e.getMessage());
+	                    // TODO: handle exception
+	                }
+	            }
+            }
+        }
+    } // parseNameSpaceAndMap
+
+    public void setNameSpace(final String sNameSpaceStr) {
+        final String[] sNameSpaces = sNameSpaceStr.split(":");
+        // append dot after every non-zero namespace
+        m_sNameSpaces = new String[sNameSpaces.length + 1];
+        int i = 0;
+        for (String sNameSpace : sNameSpaces) {
+            sNameSpace = sNameSpace.trim();
+            if (sNameSpace.length() > 0) {
+                if (sNameSpace.charAt(sNameSpace.length() - 1) != '.') {
+                    sNameSpace += '.';
+                }
+            }
+            m_sNameSpaces[i++] = sNameSpace;
+        }
+        // make sure that the default namespace is in there
+        m_sNameSpaces[i] = "";
+    }
+
+    void parseRunElement(final Node topNode) throws Exception {
+        // find mcmc element
+        final NodeList nodes = doc.getElementsByTagName(RUN_ELEMENT);
+        if (nodes.getLength() == 0) {
+            throw new XMLParserException(topNode, "Expected run element in file", 102);
+        }
+        if (nodes.getLength() > 1) {
+            throw new XMLParserException(topNode, "Expected only one mcmc element in file, not " + nodes.getLength(), 103);
+        }
+        final Node mcmc = nodes.item(0);
+
+        m_runnable = (Runnable) createObject(mcmc, RUNNABLE_CLASS, null);
+    } // parseMCMC
+
+    /**
+     * Check that plugin is a class that is assignable to class with name sClass.
+     * This involves a parameter clutch to deal with non-real parameters.
+     * This needs a bit of work, obviously...
+     */
+    boolean checkType(final String sClass, final BEASTInterface plugin) throws Exception {
+        if (sClass.equals(INPUT_CLASS) || Class.forName(sClass).isInstance(plugin)) {
+            return true;
+        }
+        // parameter clutch
+        if (sClass.equals(RealParameter.class.getName()) && plugin instanceof Parameter<?>) {
+            return true;
+        }
+        return false;
+    } // checkType
+
+    BEASTInterface createObject(final Node node, final String sClass, final BEASTInterface parent) throws Exception {
+    	//sClass = sClass.replaceAll("beast", "yabby");
+        // try the IDMap first
+        final String sID = getID(node);
+
+        if (sID != null) {
+            if (IDMap.containsKey(sID)) {
+                final BEASTInterface plugin = IDMap.get(sID);
+                if (checkType(sClass, plugin)) {
+                    return plugin;
+                }
+                throw new XMLParserException(node, "id=" + sID + ". Expected object of type " + sClass + " instead of " + plugin.getClass().getName(), 105);
+            }
+        }
+
+        final String sIDRef = getIDRef(node);
+        if (sIDRef != null) {
+            // produce warning if there are other attributes than idref
+            if (node.getAttributes().getLength() > 1) {
+                // check if there are just 2 attributes and other attribute is 'name' and/or 'id'
+            	final int offset = (getAttribute(node, "id") == null? 0: 1) + (getAttribute(node, "name") == null? 0: 1);
+                if (node.getAttributes().getLength() > 1 + offset) {
+                    Log.warning.println("Element " + node.getNodeName() + " found with idref='" + sIDRef + "'. All other attributes are ignored.\n");
+                }
+            }
+            if (IDMap.containsKey(sIDRef)) {
+                final BEASTInterface plugin = IDMap.get(sIDRef);
+                if (checkType(sClass, plugin)) {
+                    return plugin;
+                }
+                throw new XMLParserException(node, "id=" + sIDRef + ". Expected object of type " + sClass + " instead of " + plugin.getClass().getName(), 106);
+            } else if (IDNodeMap.containsKey(sIDRef)) {
+                final BEASTInterface plugin = createObject(IDNodeMap.get(sIDRef), sClass, parent);
+                if (checkType(sClass, plugin)) {
+                    return plugin;
+                }
+                throw new XMLParserException(node, "id=" + sIDRef + ". Expected object of type " + sClass + " instead of " + plugin.getClass().getName(), 107);
+            }
+            throw new XMLParserException(node, "Could not find object associated with idref " + sIDRef, 170);
+        }
+        // it's not in the ID map yet, so we have to create a new object
+        String sSpecClass = sClass;
+        final String sElementName = node.getNodeName();
+
+
+        if (element2ClassMap.containsKey(sElementName)) {
+            sSpecClass = element2ClassMap.get(sElementName);
+        }
+        final String sSpec = getAttribute(node, "spec");
+        if (sSpec != null) {
+            sSpecClass = sSpec;
+        }
+    	//sSpecClass = sSpecClass.replaceAll("beast", "yabby");
+    	
+    	if (sSpecClass.indexOf("BEASTInterface") > 0) {
+    		System.out.println(sSpecClass);
+    	}
+
+    	Object o = null;
+        // try to create object from sSpecName, taking namespaces in account
+        try {
+            boolean bDone = false;
+            for (final String sNameSpace : m_sNameSpaces) {
+                try {
+                    if (!bDone) {
+                    	//sNameSpace = sNameSpace.replaceAll("beast", "yabby");
+                        o = Class.forName(sNameSpace + sSpecClass).newInstance();
+                        bDone = true;
+                    }
+                } catch (InstantiationException e) {
+                    // we only get here when the class exists, but cannot be created
+                    // for instance because it is abstract or an interface
+
+                    throw new Exception("Cannot instantiate class (" + sSpecClass + "). Please check the spec attribute.");
+                } catch (ClassNotFoundException e) {
+                    // TODO: handle exception
+                }
+            }
+            if (!bDone) {
+                throw new Exception("Class could not be found. Did you mean " + guessClass(sSpecClass) + "?");
+                //throw new ClassNotFoundException(sSpecClass);
+            }
+            // hack required to make log-parsing easier
+            if (o instanceof State) {
+                m_state = (State) o;
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new XMLParserException(node, "Cannot create class: " + sSpecClass + ". " + e.getMessage(), 122);
+        }
+        // sanity check
+        if (!(o instanceof BEASTInterface)) {
+            if (o instanceof Input) {
+                // if we got this far, it is a basic input,
+                // that is, one of the form <input name='xyz'>value</input>
+                String sName = getAttribute(node, "name");
+                if (sName == null) {
+                    sName = "value";
+                }
+                final String sText = node.getTextContent();
+                if (sText.length() > 0) {
+                    setInput(node, parent, sName, sText);
+                }
+                return null;
+            } else {
+                throw new XMLParserException(node, "Expected object to be instance of Plugin", 108);
+            }
+        }
+        // set id
+        final BEASTInterface plugin = (BEASTInterface) o;
+        plugin.setID(sID);
+        register(node, plugin);
+        // process inputs
+        parseInputs(plugin, node);
+        // initialise
+        if (m_bInitialize) {
+            try {
+                plugin.validateInputs();
+                pluginsWaitingToInit.add(plugin);
+                nodesWaitingToInit.add(node);
+                //plugin.initAndValidate();
+            } catch (Exception e) {
+                // next lines for debugging only
+                //plugin.validateInputs();
+                //plugin.initAndValidate();
+                e.printStackTrace();
+                throw new XMLParserException(node, "validate and intialize error: " + e.getMessage(), 110);
+            }
+        }
+        return plugin;
+    } // createObject
+
+    /**
+     * find closest matching class to named class *
+     */
+    String guessClass(final String sClass) {
+        String sName = sClass;
+        if (sClass.contains(".")) {
+            sName = sClass.substring(sClass.lastIndexOf('.') + 1);
+        }
+        final List<String> sPluginNames = AddOnManager.find(beast.core.BEASTInterface.class, AddOnManager.IMPLEMENTATION_DIR);
+        int nBestDistance = Integer.MAX_VALUE;
+        String sClosest = null;
+        for (final String sPlugin : sPluginNames) {
+            final String sClassName = sPlugin.substring(sPlugin.lastIndexOf('.') + 1);
+            final int nDistance = getLevenshteinDistance(sName, sClassName);
+
+
+            if (nDistance < nBestDistance) {
+                nBestDistance = nDistance;
+                sClosest = sPlugin;
+            }
+        }
+        return sClosest;
+    }
+
+
+    /**
+     * Compute edit distance between two strings = Levenshtein distance *
+     */
+    public static int getLevenshteinDistance(final String s, final String t) {
+        if (s == null || t == null) {
+            throw new IllegalArgumentException("Strings must not be null");
+        }
+
+        final int n = s.length(); // length of s
+        final int m = t.length(); // length of t
+
+        if (n == 0) {
+            return m;
+        } else if (m == 0) {
+            return n;
+        }
+
+        int p[] = new int[n + 1]; //'previous' cost array, horizontally
+        int d[] = new int[n + 1]; // cost array, horizontally
+        int _d[]; //placeholder to assist in swapping p and d
+
+        // indexes into strings s and t
+        int i; // iterates through s
+        int j; // iterates through t
+        char t_j; // jth character of t
+        int cost; // cost
+        for (i = 0; i <= n; i++) {
+            p[i] = i;
+        }
+        for (j = 1; j <= m; j++) {
+            t_j = t.charAt(j - 1);
+            d[0] = j;
+            for (i = 1; i <= n; i++) {
+                cost = s.charAt(i - 1) == t_j ? 0 : 1;
+                // minimum of cell to the left+1, to the top+1, diagonally left and up +cost
+                d[i] = Math.min(Math.min(d[i - 1] + 1, p[i] + 1), p[i - 1] + cost);
+            }
+            // copy current distance counts to 'previous row' distance counts
+            _d = p;
+            p = d;
+            d = _d;
+        }
+
+        // our last action in the above loop was to switch d and p, so p now
+        // actually has the most recent cost counts
+        return p[n];
+    }
+
+    void parseInputs(final BEASTInterface parent, final Node node) throws Exception {
+        // first, process attributes
+        final NamedNodeMap atts = node.getAttributes();
+        if (atts != null) {
+            for (int i = 0; i < atts.getLength(); i++) {
+                final String sName = atts.item(i).getNodeName();
+                if (!(sName.equals("id") ||
+                        sName.equals("idref") ||
+                        sName.equals("spec") ||
+                        sName.equals("name"))) {
+                    final String sValue = atts.item(i).getNodeValue();
+                    if (sValue.startsWith("@")) {
+                        final String sIDRef = sValue.substring(1);
+                        final Element element = doc.createElement("input");
+                        element.setAttribute("idref", sIDRef);
+                        // add child in case things go belly up, and an XMLParserException is thrown
+                        node.appendChild(element);
+                        final BEASTInterface plugin = createObject(element, PLUGIN_CLASS, parent);
+                        // it is save to remove the elment now
+                        node.removeChild(element);
+                        setInput(node, parent, sName, plugin);
+                    } else {
+                        setInput(node, parent, sName, sValue);
+                    }
+                }
+            }
+        }
+        // process element nodes
+        final NodeList children = node.getChildNodes();
+        int nChildElements = 0;
+        String sText = "";
+        for (int i = 0; i < children.getLength(); i++) {
+            final Node child = children.item(i);
+            if (child.getNodeType() == Node.ELEMENT_NODE) {
+                final String sElement = child.getNodeName();
+                // resolve name of the input
+                String sName = getAttribute(child, "name");
+                if (sName == null) {
+                    sName = sElement;
+                }
+                // resolve base class
+                String sClass = PLUGIN_CLASS;
+                if (element2ClassMap.containsKey(sElement)) {
+                    sClass = element2ClassMap.get(sElement);
+                }
+                final BEASTInterface childItem = createObject(child, sClass, parent);
+                if (childItem != null) {
+                    setInput(node, parent, sName, childItem);
+                }
+                nChildElements++;
+            } else if (child.getNodeType() == Node.CDATA_SECTION_NODE ||
+                    child.getNodeType() == Node.TEXT_NODE) {
+                sText += child.getTextContent();
+            }
+        }
+        if (!sText.matches("\\s*")) {
+            setInput(node, parent, "value", sText);
+        }
+
+        if (nChildElements == 0) {
+            final String sContent = node.getTextContent();
+            if (sContent != null && sContent.length() > 0 && sContent.replaceAll("\\s", "").length() > 0) {
+                try {
+                    setInput(node, parent, "value", sContent);
+                } catch (Exception e) {
+                    //
+                }
+            }
+        }
+
+        // fill in missing inputs, if an input provider is available
+        if (requiredInputProvider != null) {
+            for (final Input<?> input : parent.listInputs()) {
+                if (input.get() == null && input.getRule() == Validate.REQUIRED) {
+                    final Object o = requiredInputProvider.createInput(parent, input, partitionContext);
+                    if (o != null) {
+                        input.setValue(o, parent);
+                    }
+                }
+            }
+        }
+    } // setInputs
+
+    void setInput(final Node node, final BEASTInterface plugin, final String sName, final BEASTInterface plugin2) throws XMLParserException {
+        try {
+            final Input<?> input = plugin.getInput(sName);
+            // test whether input was not set before, this is done by testing whether input has default value.
+            // for non-list inputs, this should be true if the value was not already set before
+            // for list inputs this is always true.
+            if (input.get() == input.defaultValue) {
+                plugin.setInputValue(sName, plugin2);
+            } else {
+                throw new Exception("Multiple entries for non-list input " + input.getName());
+            }
+            return;
+        } catch (Exception e) {
+        	if (sName.equals("xml:base")) {
+        		// ignore xml:base attributes introduces by XML entities
+        		return;
+        	}
+            if (e.getMessage().contains("101")) {
+                String sType = "?";
+                try {
+                    sType = plugin.getInput(sName).getType().getName().replaceAll(".*\\.", "");
+                } catch (Exception e2) {
+                    // TODO: handle exception
+                }
+                throw new XMLParserException(node, e.getMessage() +
+                        " expected '" + sType +
+                        "' but got '" + plugin2.getClass().getName().replaceAll(".*\\.", "") + "'"
+                        , 123);
+            } else {
+                throw new XMLParserException(node, e.getMessage(), 130);
+            }
+        }
+        //throw new XMLParserException(node, "no such input '"+sName+"' for element <" + node.getNodeName() + ">", 167);
+    }
+
+    void setInput(final Node node, final BEASTInterface plugin, final String sName, final String sValue) throws XMLParserException {
+        try {
+			plugin.setInputValue(sName, sValue);
+            return;
+        } catch (Exception e) {
+        	if (sName.equals("xml:base")) {
+        		// ignore xml:base attributes introduces by XML entities
+        		return;
+        	}
+            try {
+				plugin.setInputValue(sName, sValue);
+			} catch (Exception e1) {
+				// TODO Auto-generated catch block
+				e1.printStackTrace();
+			}
+            throw new XMLParserException(node, e.getMessage(), 124);
+        }
+        //throw new XMLParserException(node, "no such input '"+sName+"' for element <" + node.getNodeName() + ">", 168);
+    }
+
+    /**
+     * records id in IDMap, for ease of retrieving Plugins associated with idrefs *
+     */
+    void register(final Node node, final BEASTInterface plugin) {
+        final String sID = getID(node);
+        if (sID != null) {
+            IDMap.put(sID, plugin);
+        }
+    }
+
+    public static String getID(final Node node) { // throws Exception {
+        return getAttribute(node, "id");
+    } // getID
+
+    public static String getIDRef(final Node node) {// throws Exception {
+        return getAttribute(node, "idref");
+    } // getIDRef
+
+    /**
+     * get string value of attribute with given name
+     * as opposed to double or integer value (see methods below) *
+     */
+    public static String getAttribute(final Node node, final String sAttName) { // throws Exception {
+        final NamedNodeMap atts = node.getAttributes();
+        if (atts == null) {
+            return null;
+        }
+        for (int i = 0; i < atts.getLength(); i++) {
+            final String sName = atts.item(i).getNodeName();
+            if (sName.equals(sAttName)) {
+                return atts.item(i).getNodeValue();
+            }
+        }
+        return null;
+    } // getAttribute
+
+    /**
+     * get integer value of attribute with given name *
+     */
+    public static int getAttributeAsInt(final Node node, final String sAttName) { //throws Exception {
+        final String sAtt = getAttribute(node, sAttName);
+        if (sAtt == null) {
+            return -1;
+        }
+        return Integer.parseInt(sAtt);
+    }
+
+    /**
+     * get double value of attribute with given name *
+     */
+    public static double getAttributeAsDouble(final Node node, final String sAttName) { // throws Exception {
+        final String sAtt = getAttribute(node, sAttName);
+        if (sAtt == null) {
+            return Double.MAX_VALUE;
+        }
+        return Double.parseDouble(sAtt);
+    }
+
+    /**
+     * test whether a node contains a attribute with given name *
+     */
+    boolean hasAtt(final Node node, final String sAttributeName) {
+        final NamedNodeMap atts = node.getAttributes();
+        if (atts != null) {
+            for (int i = 0; i < atts.getLength(); i++) {
+                final String sName = atts.item(i).getNodeName();
+                if (sName.equals(sAttributeName)) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
+    public interface RequiredInputProvider {
+		Object createInput(BEASTInterface plugin, Input<?> input, PartitionContext context);
+    }
+
+    public void setRequiredInputProvider(final RequiredInputProvider provider, final PartitionContext context) {
+        requiredInputProvider = provider;
+        partitionContext = context;
+    }
+
+    /**
+     * parses file and formats it using the XMLProducer *
+     */
+    public static void main(final String[] args) {
+        try {
+            // redirect stdout to stderr
+            final PrintStream out = System.out;
+            System.setOut(System.err);
+            // parse the file
+            final XMLParser parser = new XMLParser();
+            final BEASTInterface plugin = parser.parseFile(new File(args[0]));
+            // restore stdout
+            System.setOut(out);
+            System.out.println(new XMLProducer().toXML(plugin));
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+
+} // class XMLParser
diff --git a/src/beast/util/XMLParserException.java b/src/beast/util/XMLParserException.java
new file mode 100644
index 0000000..780c324
--- /dev/null
+++ b/src/beast/util/XMLParserException.java
@@ -0,0 +1,112 @@
+/*
+* File XMLParserException.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+package beast.util;
+
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+
+/**
+ * Exception thrown by XMLParser
+ * that keeps track of the DOM Node that caused the
+ * anomaly.
+ */
+ at SuppressWarnings("serial")
+public class XMLParserException extends Exception {
+    /**
+     * DOM Node where the anomaly was in the vicinity *
+     */
+    Node _node;
+    /**
+     * short description of the anomaly *
+     */
+    String msg;
+    /**
+     * number of the anomaly, for ease of finding in the code *
+     */
+    int errorNr;
+
+    public XMLParserException(Node node, String sMsg, int nErrorNr) {
+        super(sMsg);
+        _node = node;
+        msg = "";
+        errorNr = nErrorNr;
+    }
+
+    // format message and resolve parent
+    public String getMessage() {
+        String sMsg = "\nError " + errorNr + " parsing the xml input file\n\n" + msg + super.getMessage();
+        if (_node == null) {
+            return "NULL NODE\n" + sMsg;
+        }
+        String path = "";
+        Node node = _node;
+        while (node != null && node.getNodeType() == Node.ELEMENT_NODE) {
+            String sID;
+            sID = getAttribute(node, "id");
+            if (sID != null) {
+                sID = " id='" + sID + "'";
+            } else {
+                sID = "";
+            }
+
+            String sName;
+            sName = getAttribute(node, "name");
+            if (sName != null) {
+                sName = " name='" + sName + "'";
+            } else {
+                sName = "";
+            }
+
+            String sSpec;
+            sSpec = getAttribute(node, "spec");
+            if (sSpec != null) {
+                sSpec = " spec='" + sSpec + "'";
+            } else {
+                sSpec = "";
+            }
+            path = path.replaceAll("  <", "      <");
+            path = "  <" + node.getNodeName() + sID + sName + sSpec + ">\n" + path;
+            node = node.getParentNode();
+        }
+        sMsg += "\n\nError detected about here:\n" + path;
+        return sMsg;
+    } // getMessage
+
+    String getAttribute(Node node, String sTarget) {
+        NamedNodeMap atts = node.getAttributes();
+        if (atts == null) {
+            return null;
+        }
+        for (int i = 0; i < atts.getLength(); i++) {
+            String sName = atts.item(i).getNodeName();
+            if (sName.equals(sTarget)) {
+                String sValue = atts.item(i).getNodeValue();
+                return sValue;
+            }
+        }
+        return null;
+    } // getID
+
+} // XMLParserException
diff --git a/src/beast/util/XMLParserUtils.java b/src/beast/util/XMLParserUtils.java
new file mode 100644
index 0000000..9646e7c
--- /dev/null
+++ b/src/beast/util/XMLParserUtils.java
@@ -0,0 +1,158 @@
+package beast.util;
+
+import org.w3c.dom.*;
+
+import com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl;
+
+import beast.core.util.Log;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+/**
+ *
+ * Provides basic functions for variable substitution and plates.
+ *
+ * @author Remco Bouckaert
+ * @author Alexei Drummond
+ */
+public class XMLParserUtils {
+
+    /**
+     * Expand plates in XML by duplicating the containing XML and replacing
+     * the plate variable with the appropriate value.
+     */
+    public static void processPlates(Document doc, String plateElementName) {
+        // process plate elements
+        final NodeList nodes = doc.getElementsByTagName(plateElementName);
+        // instead of processing all plates, process them one by one,
+        // then check recursively for new plates that could have been
+        // created when they are nested
+        if (nodes.getLength() > 0) {
+            Node node = nodes.item(0);
+            final String sVar = node.getAttributes().getNamedItem("var").getNodeValue();
+            final String sRange = node.getAttributes().getNamedItem("range").getNodeValue();
+            
+            if (node.getAttributes().getNamedItem("fragment") != null) {
+            	final String fragmentID = node.getAttributes().getNamedItem("fragment").getNodeValue();
+            	Node fragment = getElementById(doc, fragmentID);
+            	if (fragment == null) {
+            		throw new RuntimeException("plate refers to fragment with id='" + fragmentID + "' that cannot be found");
+            	}
+            	fragment = fragment.cloneNode(true);
+                node.getParentNode().replaceChild(fragment, node);
+            	node = fragment;
+           }
+	
+            final String[] sValues = sRange.split(",");
+
+            // interpret values in the range of form x:y as all numbers between x and y inclusive
+            List<String> vals = new ArrayList<>();
+            for (final String sValue : sValues) {
+                if (sValue.indexOf(":") > 0) {
+                    String[] range = sValue.split(":");
+                    int min = Integer.parseInt(range[0]);
+                    int max = Integer.parseInt(range[1]);
+                    for (int i = min; i <= max; i++) {
+                        vals.add(String.valueOf(i));
+                    }
+                } else {
+                    vals.add(sValue);
+                }
+            }
+
+            for (final String val : vals) {
+                // copy children
+                final NodeList children = node.getChildNodes();
+                for (int iChild = 0; iChild < children.getLength(); iChild++) {
+                    final Node child = children.item(iChild);
+                    final Node newChild = child.cloneNode(true);
+                    replaceVariable(newChild, sVar, val);
+                    node.getParentNode().insertBefore(newChild, node);
+                }
+            }
+            node.getParentNode().removeChild(node);
+            processPlates(doc,plateElementName);
+        }
+    } // processPlates
+    
+    static  Node getElementById(Document doc, String id) {
+    	if (doc.getElementById(id) == null) {
+    		registerIDs(doc, doc.getDocumentElement());
+    	}
+    	return doc.getElementById(id);
+    }
+
+    static void registerIDs(Document doc, Node node) {
+    	if (node.getNodeType() == Node.ELEMENT_NODE) {
+            if (node.getAttributes().getNamedItem("id") != null) {
+            	final String id = node.getAttributes().getNamedItem("id").getNodeValue();
+            	((CoreDocumentImpl) doc).putIdentifier(id, (Element) node);
+            }
+    	}
+    	NodeList children = node.getChildNodes();
+    	for (int i = 0; i < children.getLength(); i++) {
+    		registerIDs(doc, children.item(i));
+    	}
+    }
+
+    /** export DOM document to a file -- handy for debugging **/
+    public static void saveDocAsXML(Document doc, String filename) {
+    	try {
+	    	Transformer transformer = TransformerFactory.newInstance().newTransformer();
+	    	Result output = new StreamResult(new File(filename));
+	    	Source input = new DOMSource(doc);
+	
+	    	transformer.transform(input, output);
+    	} catch (Exception e) {
+    		e.printStackTrace();
+    	}    	
+    }
+    
+    /**
+     * @param node the node to do variable replacement in
+     * @param sVar the variable name to replace
+     * @param sValue the value to replace the variable name with
+     */
+    public static void replaceVariable(final Node node, final String sVar, final String sValue) {
+        switch (node.getNodeType()) {
+	        case Node.ELEMENT_NODE:  {
+	            final Element element = (Element) node;
+	            final NamedNodeMap atts = element.getAttributes();
+	            for (int i = 0; i < atts.getLength(); i++) {
+	                final Attr attr = (Attr) atts.item(i);
+	                if (attr.getValue().contains("$(" + sVar + ")")) {
+	                    String sAtt = attr.getValue();
+	                    sAtt = sAtt.replaceAll("\\$\\(" + sVar + "\\)", sValue);
+	                    attr.setNodeValue(sAtt);
+	                }
+	            }
+	        }
+	        case Node.CDATA_SECTION_NODE: {
+	        	String content = node.getTextContent();
+	        	if (content.contains("$(" + sVar + ")")) {
+	        		content = content.replaceAll("\\$\\(" + sVar + "\\)", sValue);
+	        		node.setNodeValue(content);
+	        	}
+	        }
+        }
+
+        // process children
+        final NodeList children = node.getChildNodes();
+        for (int iChild = 0; iChild < children.getLength(); iChild++) {
+            final Node child = children.item(iChild);
+            replaceVariable(child, sVar, sValue);
+        }
+    } // replace
+
+
+
+}
diff --git a/src/beast/util/XMLProducer.java b/src/beast/util/XMLProducer.java
new file mode 100644
index 0000000..7192a97
--- /dev/null
+++ b/src/beast/util/XMLProducer.java
@@ -0,0 +1,1019 @@
+/*
+* File XMLProducer.java
+*
+* Copyright (C) 2010 Remco Bouckaert remco at cs.auckland.ac.nz
+*
+* This file is part of BEAST 2.
+* See the NOTICE file distributed with this work for additional
+* information regarding copyright ownership and licensing.
+*
+* BEAST 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
+* of the License, or (at your option) any later version.
+*
+*  BEAST 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 BEAST; if not, write to the
+* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+* Boston, MA  02110-1301  USA
+*/
+package beast.util;
+
+
+
+
+import beast.core.BEASTInterface;
+import beast.core.Input;
+
+import org.w3c.dom.*;
+import org.xml.sax.InputSource;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import java.io.Reader;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.lang.reflect.Field;
+import java.util.*;
+
+/**
+ * converts MCMC plug in into XML, i.e. does the reverse of XMLParser
+ * but tries to prettify the XML as well.
+ */
+public class XMLProducer extends XMLParser {
+    /**
+     * list of objects already converted to XML, so an idref suffices
+     */
+    HashSet<BEASTInterface> isDone;
+    @SuppressWarnings("rawtypes")
+    HashSet<Input> inputsDone;
+    /**
+     * list of IDs of elements produces, used to prevent duplicate ID generation
+     */
+    HashSet<String> IDs;
+    /**
+     * #spaces before elements in XML *
+     */
+    int indent;
+
+    final public static String DEFAULT_NAMESPACE = "beast.core:beast.evolution.alignment:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood";
+    //final public static String DO_NOT_EDIT_WARNING = "DO NOT EDIT the following machine generated text, they are used in Beauti";
+
+    public XMLProducer() {
+        super();
+    }
+
+    /**
+     * Main entry point for this class
+     * Given a plug-in, produces the XML in BEAST 2.0 format
+     * representing the plug-in. This assumes plugin is Runnable
+     */
+    @SuppressWarnings("rawtypes")
+    public String toXML(BEASTInterface plugin) {
+        return toXML(plugin, new ArrayList<BEASTInterface>());
+    }
+
+    public String toXML(BEASTInterface plugin, Collection<BEASTInterface> others) {
+        try {
+            StringBuffer buf = new StringBuffer();
+            buf.append("<" + XMLParser.BEAST_ELEMENT + " version='2.0' namespace='" + DEFAULT_NAMESPACE + "'>\n");
+            for (String element : element2ClassMap.keySet()) {
+            	if (!reservedElements.contains(element)) {
+            		buf.append("<map name='" + element + "'>" + element2ClassMap.get(element) +"</map>\n");
+            	}
+            }
+            buf.append("\n\n");
+            isDone = new HashSet<BEASTInterface>();
+            inputsDone = new HashSet<Input>();
+            IDs = new HashSet<String>();
+            indent = 0;
+            pluginToXML(plugin, buf, null, true);
+            String sEndBeast = "</" + XMLParser.BEAST_ELEMENT + ">";
+            buf.append(sEndBeast);
+            //return buf.toString();
+            // beautify XML hierarchy
+            String sXML = cleanUpXML(buf.toString(), m_sXMLBeuatifyXSL);
+            // TODO: fix m_sIDRefReplacementXSL script to deal with nested taxon sets
+            // String sXML2 = cleanUpXML(sXML, m_sIDRefReplacementXSL);
+            String sXML2 = sXML;
+            sXML = findPlates(sXML2);
+            // beatify by applying name spaces to spec attributes
+            String[] sNameSpaces = DEFAULT_NAMESPACE.split(":");
+            for (String sNameSpace : sNameSpaces) {
+                sXML = sXML.replaceAll("spec=\"" + sNameSpace + ".", "spec=\"");
+            }
+
+
+            buf = new StringBuffer();
+            if (others.size() > 0) {
+                for (BEASTInterface plugin2 : others) {
+                    if (!IDs.contains(plugin2.getID())) {
+                        pluginToXML(plugin2, buf, null, false);
+                    }
+                }
+            }
+            int iEnd = sXML.indexOf(sEndBeast);
+            String extras = buf.toString();
+            // prevent double -- inside XML comment, this can happen in sequences
+            extras = extras.replaceAll("--","- - ");
+            sXML = sXML.substring(0, iEnd) //+ "\n\n<!-- " + DO_NOT_EDIT_WARNING + " \n\n" + 
+            	//extras +  "\n\n-->\n\n" 
+            		+ sEndBeast;
+
+            sXML = sXML.replaceAll("xmlns=\"http://www.w3.org/TR/xhtml1/strict\"", "");
+            
+            sXML = dedupName(sXML);
+            sXML = sortTags(sXML);
+            
+
+            //insert newlines in alignments
+            int k = sXML.indexOf("<data ");
+            StringBuffer buf2 = new StringBuffer(sXML); 
+            while (k > 0) {
+            	while (sXML.charAt(k) != '>') {
+            		if (sXML.charAt(k) == ' ' && !sXML.startsWith("idref", k+1)) {
+            			buf2.setCharAt(k, '\n');
+            		}
+            		k++;
+            	}
+            	k = sXML.indexOf("<data ", k + 1);
+            }
+            
+
+            return buf2.toString();
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+    } // toXML
+
+    // ensure attributes are ordered so that id goes first, then spec, then remainder of attributes
+    private String sortTags(String sXML) {
+    	//if (true) return sXML;
+    	String [] strs = sXML.split("<");
+    	StringBuilder bf = new StringBuilder();
+    	bf.append(strs[0]);
+    	for (int i = 1; i < strs.length; i++) {
+    		String str = strs[i];
+    		String [] ss = str.split(">");
+    		boolean [] isShortEnd = new  boolean[ss.length];
+    		for (int j = 0; j < ss.length; j++) {
+    			if (ss[j].endsWith("/")) {
+    				isShortEnd[j] = true;
+    				ss[j] = ss[j].substring(0,  ss[j].length() - 1);
+    			}
+    		}
+   			String [] strs2 = split(ss[0]);
+   			int iSpec = 0;
+   			while (iSpec < strs2.length && !strs2[iSpec].startsWith("spec=")) {
+   				iSpec++;
+   			}
+   			int iID = 0;
+   			while (iID < strs2.length && !strs2[iID].startsWith("id=")) {
+   				iID++;
+   			}
+			bf.append('<');
+			if (strs2[0] != null)
+				bf.append(strs2[0]);
+			if (iID < strs2.length) {
+				bf.append(' ');
+				bf.append(strs2[iID]);
+			}
+			if (iSpec < strs2.length) {
+				bf.append(' ');
+				bf.append(strs2[iSpec]);
+			}
+			for (int j = 1; j < strs2.length; j++) {
+				if (j != iID && j != iSpec) {
+	    			bf.append(' ');
+	    			if (strs2[j] != null)
+	    				bf.append(strs2[j]);
+				}
+			}
+			for (int k = 1; k < ss.length; k++) {
+				if (isShortEnd[k-1]) {
+					bf.append('/');
+				}
+				bf.append('>');
+				bf.append(ss[k]);
+			}
+			if (ss.length == 1 && str != null && str.endsWith(">")) {
+				bf.append('>');
+			}
+    	}
+		return bf.toString();
+	}
+    
+    // since str.split(" "): does not match trailing spaces, we need to split by hand
+    // also, attributes with spaces in them should not be split, e.g. <x id="a b"/> should be split in 2, not 3
+    String [] split(String str) {
+    	List<String> s = new ArrayList<>();
+    	StringBuilder buf = new StringBuilder();
+    	int i = 0;
+    	while (i < str.length()) {
+    		char c = str.charAt(i);
+    		if (c == ' ') {
+    			String str2 = buf.toString();
+    			if ((str2.contains("='") && !str2.endsWith("'")) || 
+    					(str2.contains("=\"") && !str2.endsWith("\""))) {
+    				buf.append(c);
+    			} else {
+    				s.add(str2);
+    				buf = new StringBuilder();
+    			}
+    		} else {
+    			buf.append(c);
+    		}
+    		i++;
+    	}
+		s.add(buf.toString());
+    	return s.toArray(new String []{});
+    }
+
+	String dedupName(String sXML) {
+        // replace <$x name="$y" idref="$z"/> and <$x idref="$z" name="$y"/> 
+        // with <$y idref="$z"/>
+        StringBuilder sb = new StringBuilder();
+        int i = -1;
+        while (++i < sXML.length()) {
+        	char c = sXML.charAt(i);
+        	if (c == '<') {
+                StringBuilder tag = new StringBuilder();
+        		tag.append(c);
+        		while (((c = sXML.charAt(++i)) != ' ') && (c != '/') && c != '>') {
+        			tag.append(c);
+        		}
+        		if (c != '/' && c != '>') {
+                    StringBuilder tag2 = new StringBuilder();
+            		while ((c = sXML.charAt(++i)) != '=') {
+            			tag2.append(c);
+            		}
+            		if (tag2.toString().equals("name")) {
+                        ++i;
+                        StringBuilder value2 = new StringBuilder();
+                		while ((c = sXML.charAt(++i)) != '"') {
+                			value2.append(c);
+                		}
+                        StringBuilder tag3 = new StringBuilder();
+                    	c = sXML.charAt(++i);
+                        if (c != '>') {
+                            if (c == '/') {
+                        		tag3.append(c);
+                            }
+                        	while (((c = sXML.charAt(++i)) != '=') && (c != '/') && (c != '>')) {
+                        		tag3.append(c);
+                        	}
+                        }
+                		if (c != '/' && c != '>' && tag3.toString().equals("idref")) {
+                			tag3.append(c);
+                			tag3.append(sXML.charAt(++i));
+                    		while ((c = sXML.charAt(++i)) != '"') {
+                    			tag3.append(c);
+                    		}
+                    		sb.append('<');
+                			sb.append(value2);                			
+                    		sb.append('=');
+                    		sb.append(tag3);
+                    		sb.append("/>");
+                    		while ((c = sXML.charAt(++i)) != '>') {}
+                		} else {
+                			sb.append(tag);
+                			sb.append(' ');
+                			sb.append(tag2);
+                			sb.append("=\"");
+                			sb.append(value2);                			
+                			sb.append('"');
+                			sb.append(' ');
+                			sb.append(tag3);
+                			sb.append(c);
+                		}
+            		} else if (tag2.toString().equals("idref")) {
+            			tag2.append(c);
+            			tag2.append(sXML.charAt(++i));
+                		while (((c = sXML.charAt(++i)) != ' ') && (c != '/') && c != '>') {
+                			tag2.append(c);
+                		}
+                		if (c != '/' && c != '>') {
+                            StringBuilder tag3 = new StringBuilder();
+                    		while ((c = sXML.charAt(++i)) != '=') {
+                    			tag3.append(c);
+                    		}
+                    		if (tag3.toString().equals("name")) {
+                                ++i;
+                                StringBuilder value2 = new StringBuilder();
+                        		while ((c = sXML.charAt(++i)) != '"') {
+                        			value2.append(c);
+                        		}
+                        		sb.append('<');
+                    			sb.append(value2);                			
+                        		sb.append(' ');
+                        		sb.append(tag2);
+                        		sb.append("/>");
+                        		while ((c = sXML.charAt(++i)) != '>') {}
+                    		} else {
+                    			sb.append(tag);
+                    			sb.append(' ');
+                    			sb.append(tag2);
+                    			sb.append(' ');
+                    			sb.append(tag3);
+                    			sb.append(c);
+                    		}
+                		} else {
+                			sb.append(tag);
+                			sb.append(' ');
+                			sb.append(tag2);
+                			sb.append(c);
+                		}
+            		} else {
+            			sb.append(tag);
+            			sb.append(' ');
+            			sb.append(tag2);                			
+            			sb.append(c);
+            		}
+        		} else {
+        			sb.append(tag);
+        			sb.append(c);
+        		}
+        	} else {
+        		sb.append(c);
+        	}
+        }
+        return sb.toString();
+	}
+
+	/**
+     * like toXML() but without the assumption that plugin is Runnable *
+     */
+    public String modelToXML(BEASTInterface plugin) {
+        try {
+            String sXML0 = toRawXML(plugin);
+            String sXML = cleanUpXML(sXML0, m_sSupressAlignmentXSL);
+            // TODO: fix m_sIDRefReplacementXSL script to deal with nested taxon sets
+            //String sXML2 = cleanUpXML(sXML, m_sIDRefReplacementXSL);
+            String sXML2 = sXML;
+            sXML = findPlates(sXML2);
+            sXML = sXML.replaceAll("<\\?xml version=\"1.0\" encoding=\"UTF-8\"\\?>", "");
+            sXML = sXML.replaceAll("\\n\\s*\\n", "\n");
+            return sXML;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+    } // toXML
+
+    /**
+     * like modelToXML, but without the cleanup *
+     */
+    @SuppressWarnings("rawtypes")
+    public String toRawXML(BEASTInterface plugin) {
+        return toRawXML(plugin, null);
+    } // toRawXML
+
+    /**
+     * like modelToXML, but without the cleanup *
+     * For plugin without name
+     */
+    @SuppressWarnings("rawtypes")
+    public String toRawXML(BEASTInterface plugin, String sName) {
+        try {
+            StringBuffer buf = new StringBuffer();
+            isDone = new HashSet<BEASTInterface>();
+            inputsDone = new HashSet<Input>();
+            IDs = new HashSet<String>();
+            indent = 0;
+            pluginToXML(plugin, buf, sName, false);
+            return buf.toString();
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+    } // toRawXML
+
+
+
+    public String stateNodeToXML(BEASTInterface plugin) {
+        try {
+            StringBuffer buf = new StringBuffer();
+            //buf.append("<" + XMLParser.BEAST_ELEMENT + " version='2.0'>\n");
+            isDone = new HashSet<BEASTInterface>();
+            IDs = new HashSet<String>();
+            indent = 0;
+            pluginToXML(plugin, buf, null, false);
+            return buf.toString();
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+    /**
+     * Applies XSL script (specified in m_sXSL) to make XML a bit
+     * nicer by removing unused IDs and moving data, beast.tree and likelihood
+     * outside MCMC element.
+     * Tries to compress common parts into plates.
+     */
+    String cleanUpXML(String sXML, String sXSL) throws TransformerException {
+        StringWriter strWriter = new StringWriter();
+        Reader xmlInput = new StringReader(sXML);
+        javax.xml.transform.Source xmlSource =
+                new javax.xml.transform.stream.StreamSource(xmlInput);
+        Reader xslInput = new StringReader(sXSL);
+        javax.xml.transform.Source xsltSource =
+                new javax.xml.transform.stream.StreamSource(xslInput);
+        javax.xml.transform.Result result =
+                new javax.xml.transform.stream.StreamResult(strWriter);
+        // create an instance of TransformerFactory
+        javax.xml.transform.TransformerFactory transFact = javax.xml.transform.TransformerFactory.newInstance();
+        javax.xml.transform.Transformer trans = transFact.newTransformer(xsltSource);
+        trans.transform(xmlSource, result);
+
+        String sXML2 = strWriter.toString();
+        return sXML2;
+    }
+
+    // compress parts into plates
+    String findPlates(String sXML) throws Exception {
+        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+        doc = factory.newDocumentBuilder().parse(new InputSource(new StringReader(sXML)));
+        doc.normalize();
+
+        Node topNode = doc.getElementsByTagName("*").item(0);
+        findPlates(topNode);
+
+        //create string from xml tree
+        StringWriter sw = new StringWriter();
+        StreamResult result = new StreamResult(sw);
+        DOMSource source = new DOMSource(doc);
+        TransformerFactory factory2 = TransformerFactory.newInstance();
+        Transformer transformer = factory2.newTransformer();
+        transformer.transform(source, result);
+
+        return sw.toString();
+    }
+
+    /**
+     * tries to compress XML into plates *
+     */
+    void findPlates(Node node) {
+        NodeList children = node.getChildNodes();
+        for (int iChild = 0; iChild < children.getLength(); iChild++) {
+            Node child = children.item(iChild);
+            if (child.getNodeType() == Node.ELEMENT_NODE) {
+                List<Node> comparables = new ArrayList<Node>();
+                for (int iSibling = iChild + 1; iSibling < children.getLength(); iSibling++) {
+                    if (children.item(iSibling).getNodeType() == Node.ELEMENT_NODE) {
+                        Node sibling = children.item(iSibling);
+                        if (comparable(child, sibling, ".p1", ".p" + (comparables.size() + 2))) {
+                            comparables.add(sibling);
+                        } else {
+                            // break
+                            iSibling = children.getLength();
+                        }
+                    }
+                }
+                if (comparables.size() > 0) {
+                	// TODO: FIX THIS SO THAT NOT AN ARBITRARY `1' is used to generate the plate
+                    // we can make a plate now
+//                    String sRange = "1";
+//                    int k = 2;
+//                    for (Node sibling : comparables) {
+//                        sRange += "," + k++;
+//                        sibling.getParentNode().removeChild(sibling);
+//                    }
+//                    makePlate(child, "1", "n", sRange);
+                }
+            }
+        }
+        // recurse to lower levels
+        children = node.getChildNodes();
+        for (int iChild = 0; iChild < children.getLength(); iChild++) {
+            findPlates(children.item(iChild));
+        }
+    } // findPlates
+
+    /**
+     * replace node element by a plate element with variable sVar and range sRange *
+     */
+    void makePlate(Node node, String sPattern, String sVar, String sRange) {
+        Element plate = doc.createElement("plate");
+        plate.setAttribute("var", sVar);
+        plate.setAttribute("range", sRange);
+        String sIndent = node.getPreviousSibling().getTextContent();
+        replace(node, sPattern, sVar);
+        node.getParentNode().replaceChild(plate, node);
+        plate.appendChild(doc.createTextNode(sIndent + "  "));
+        plate.appendChild(node);
+        plate.appendChild(doc.createTextNode(sIndent));
+    }
+
+    /**
+     * recursively replace all attribute values containing the pattern with variable sVar *
+     */
+    void replace(Node node, String sPattern, String sVar) {
+        NamedNodeMap atts = node.getAttributes();
+        if (atts != null) {
+            for (int i = 0; i < atts.getLength(); i++) {
+                Attr attr = (Attr) atts.item(i);
+                String sValue = attr.getValue().replaceAll(sPattern, "\\$\\(" + sVar + "\\)");
+                ;
+                attr.setValue(sValue);
+            }
+        }
+        NodeList children = node.getChildNodes();
+        for (int iChild = 0; iChild < children.getLength(); iChild++) {
+            Node child = children.item(iChild);
+            replace(child, sPattern, sVar);
+        }
+    }
+
+    /**
+     * check if two XML nodes are the same, when sPattern1 is replaced by sPattothersern2 *
+     */
+    boolean comparable(Node node1, Node node2, String sPattern1, String sPattern2) {
+        // compare name
+        if (!node1.getNodeName().equals(node2.getNodeName())) {
+            return false;
+        }
+        // compare text
+        if (!node1.getTextContent().trim().equals(node2.getTextContent().trim())) {
+            return false;
+        }
+        // compare attributes
+        NamedNodeMap atts = node1.getAttributes();
+        NamedNodeMap atts2 = node2.getAttributes();
+        if (atts.getLength() != atts2.getLength()) {
+            return false;
+        }
+        for (int i = 0; i < atts.getLength(); i++) {
+            Attr attr = (Attr) atts.item(i);
+            String sName = attr.getName();
+            String sValue = attr.getValue();
+            Node att = atts2.getNamedItem(sName);
+            if (att == null) {
+                return false;
+            }
+            String sValue2 = ((Attr) att).getValue();
+            if (!sValue.equals(sValue2)) {
+                sValue = sValue.replaceAll(sPattern1, "\\$\\(n\\)");
+                sValue2 = sValue2.replaceAll(sPattern2, "\\$\\(n\\)");
+                if (!sValue.equals(sValue2)) {
+                    return false;
+                }
+            }
+        }
+        // compare children
+        NodeList children = node1.getChildNodes();
+        NodeList children2 = node2.getChildNodes();
+        for (int iChild = 0; iChild < children.getLength(); iChild++) {
+            Node child = children.item(iChild);
+            if (child.getNodeType() == Node.ELEMENT_NODE) {
+                String sName = child.getNodeName();
+                boolean bMatch = false;
+                for (int iChild2 = 0; !bMatch && iChild2 < children2.getLength(); iChild2++) {
+                    Node child2 = children2.item(iChild2);
+                    if (child2.getNodeType() == Node.ELEMENT_NODE && sName.equals(child2.getNodeName())) {
+                        bMatch = comparable(child, child2, sPattern1, sPattern2);
+                    }
+                }
+                if (!bMatch) {
+                    return false;
+                }
+            }
+        }
+        return true;
+    } // comparable
+
+
+    /**
+     * XSL stylesheet for cleaning up bits and pieces of the vanilla XML
+     * in order to make it more readable *
+     */
+    String m_sXMLBeuatifyXSL = "<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns='http://www.w3.org/TR/xhtml1/strict'>\n" +
+            "\n" +
+            "<xsl:output method='xml' indent='yes'/>\n" +
+            "\n" +
+            "<xsl:template match='beast'>\n" +
+            "    <xsl:copy>\n" +
+            "        <xsl:apply-templates select='@*'/>\n" +
+            "        <xsl:text>&#x0a;&#x0a;&#x0a;    </xsl:text>\n" +
+            "        <xsl:apply-templates  select='//data[not(@idref)]' mode='copy'/>\n" +
+            "        <xsl:text>&#x0a;&#x0a;&#x0a;    </xsl:text>\n" +
+            "        <xsl:apply-templates select='//beast.tree[not(@idref)]' mode='copy'/>\n" +
+            "        <xsl:text>&#x0a;&#x0a;&#x0a;    </xsl:text>\n" +
+            "        <xsl:apply-templates select='//distribution[not(@idref) and not(ancestor::distribution)]' mode='copy'/>\n" +
+            "        <xsl:text>&#x0a;&#x0a;&#x0a;    </xsl:text>\n" +
+            "        <xsl:apply-templates select='node()'/>    \n" +
+            "    </xsl:copy>\n" +
+            "</xsl:template>\n" +
+            "\n" +
+            "<xsl:template match='*' mode='copy'>\n" +
+            "  <xsl:copy>\n" +
+            "    <xsl:attribute name='id'>\n" +
+            "         <xsl:value-of select='@id'/>\n" +
+            "    </xsl:attribute>\n" +
+            "    <xsl:apply-templates select='@*|node()'/>\n" +
+            "  </xsl:copy>\n" +
+            "</xsl:template>\n" +
+            "\n" +
+            "<xsl:template match='data|beast.tree|distribution[not(ancestor::distribution)]'>\n" +
+            "    <xsl:copy>\n" +
+            "        <xsl:attribute name='idref'>\n" +
+            "            <xsl:choose>\n" +
+            "                <xsl:when test='@idref!=\"\"'><xsl:value-of select='@idref'/></xsl:when>\n" +
+            "                <xsl:otherwise><xsl:value-of select='@id'/></xsl:otherwise>\n" +
+            "            </xsl:choose>\n" +
+            "        </xsl:attribute>\n" +
+            "    <xsl:apply-templates select='@name'/>\n" +
+            "    </xsl:copy>\n" +
+            "</xsl:template>\n" +
+            "\n" +
+            "<xsl:template match='input'>\n" +
+            "    <xsl:element name='{@name}'>" +
+            "		<xsl:apply-templates select='node()|@*[name()!=\"name\"]'/>" +
+            "	</xsl:element>\n" +
+            "</xsl:template>\n" +
+
+            "<xsl:template match='log/log'>\n" +
+            "    <xsl:copy><xsl:apply-templates select='*[@*!=\"\"]'/> </xsl:copy>\n" +
+            "</xsl:template>\n" +
+            "\n" +
+            // Better not suppress unused id's; used for example in reporting Operators
+            //"<xsl:template match='@id'>\n" +
+            //"    <xsl:if test='//@idref=. or not(contains(../@spec,substring(.,string-length(.)-2)))'>\n" +
+            //"        <xsl:copy/>\n" +
+            //"    </xsl:if>\n" +
+            //"</xsl:template>\n" +
+            "\n" +
+            "<xsl:template match='@*|node()'>\n" +
+            "  <xsl:copy>\n" +
+            "    <xsl:apply-templates select='@*|node()'/>\n" +
+            "  </xsl:copy>\n" +
+            "</xsl:template>\n" +
+            "\n" +
+            "</xsl:stylesheet>\n";
+
+
+    /**
+     * script to reduce elements of the form <name idref='xyz'/> to name='@xyz' attributes *
+     */
+    String m_sIDRefReplacementXSL =
+            "<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns='http://www.w3.org/TR/xhtml1/strict'>\n" +
+                    "\n" +
+                    "<xsl:output method='xml' indent='yes'/>\n" +
+                    "\n" +
+                    "<xsl:template match='beast'>\n" +
+                    "  <xsl:copy>\n" +
+                    "    <xsl:apply-templates select='@*|node()'/>\n" +
+                    "  </xsl:copy>\n" +
+                    "</xsl:template>\n" +
+                    "\n" +
+                    "<xsl:template match='node()'>\n" +
+                    "    <xsl:choose>\n" +
+                    "    <xsl:when test='count(@idref)=1 and count(@name)=1 and count(@*)=2'>\n" +
+                    "        <xsl:element name='{@name}'>\n" +
+                    "            <xsl:attribute name='idref'>\n" +
+                    "                <xsl:value-of select='@idref'/>\n" +
+                    "            </xsl:attribute>\n" +
+                    "        </xsl:element>\n" +
+                    "    </xsl:when>\n" +
+                    "    <xsl:when test='not(count(@idref)=1 and count(@*)=1)'>\n" +
+                    "        <xsl:copy>\n" +
+                    "           <xsl:apply-templates select='@*'/>\n" +
+                    "		    <xsl:for-each select='*'>\n" +
+                    "                <xsl:if test='count(@idref)=1 and count(@*)=1'>\n" +
+                    "                    <xsl:attribute name='{name()}'>@<xsl:value-of select='@idref'/></xsl:attribute>\n" +
+                    "                </xsl:if>\n" +
+                    "		    </xsl:for-each>\n" +
+                    "           <xsl:apply-templates/>\n" +
+                    "        </xsl:copy>\n" +
+                    "    </xsl:when>\n" +
+                    "    </xsl:choose>\n" +
+                    "</xsl:template>\n" +
+                    "\n" +
+                    "<xsl:template match='@*'>\n" +
+                    "  <xsl:copy>\n" +
+                    "    <xsl:apply-templates select='@*|node()'/>\n" +
+                    "  </xsl:copy>\n" +
+                    "</xsl:template>\n" +
+                    "\n" +
+                    "</xsl:stylesheet>";
+
+    String s = "<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns='http://www.w3.org/TR/xhtml1/strict'>\n" +
+            "\n" +
+            "<xsl:output method='xml' indent='yes'/>\n" +
+            "\n" +
+            "<xsl:template match='beast'>\n" +
+            "  <xsl:copy>\n" +
+            "    <xsl:apply-templates select='@*|node()'/>\n" +
+            "  </xsl:copy>\n" +
+            "</xsl:template>\n" +
+            "\n" +
+            "<xsl:template match='node()'>\n" +
+            "    <xsl:if test='not(count(@idref)=1 and count(@*)=1)'>\n" +
+            "    <xsl:copy>\n" +
+            "       <xsl:apply-templates select='@*'/>\n" +
+            "		<xsl:for-each select='*'>\n" +
+            "            <xsl:if test='count(@idref)=1 and count(@*)=1'>\n" +
+            "                <xsl:attribute name='{name()}'>@<xsl:value-of select='@idref'/></xsl:attribute>\n" +
+            "            </xsl:if>\n" +
+            "		</xsl:for-each>\n" +
+            "       <xsl:apply-templates/>\n" +
+            "    </xsl:copy>\n" +
+            "    </xsl:if>\n" +
+            "</xsl:template>\n" +
+            "\n" +
+            "<xsl:template match='@*'>\n" +
+            "  <xsl:copy>\n" +
+            "    <xsl:apply-templates select='@*|node()'/>\n" +
+            "  </xsl:copy>\n" +
+            "</xsl:template>\n" +
+            "\n" +
+            "</xsl:stylesheet>\n";
+
+
+    /**
+     * XSL stylesheet for suppressing alignment*
+     */
+    String m_sSupressAlignmentXSL = "<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns='http://www.w3.org/TR/xhtml1/strict'>\n" +
+            "\n" +
+            "<xsl:output method='xml'/>\n" +
+            "\n" +
+            "<xsl:template match='data'/>\n" +
+            "\n" +
+            "<xsl:template match='input[@name]'>\n" +
+            "    <xsl:element name='{@name}'>" +
+            "		<xsl:apply-templates select='node()|@*[name()!=\"name\"]'/>" +
+            "	</xsl:element>\n" +
+            "</xsl:template>\n" +
+            "\n" +
+            "<xsl:template match='@*|node()'>\n" +
+            "  <xsl:copy>\n" +
+            "    <xsl:apply-templates select='@*|node()'/>\n" +
+            "  </xsl:copy>\n" +
+            "</xsl:template>\n" +
+            "\n" +
+            "</xsl:stylesheet>\n";
+
+    /**
+     * produce elements for a plugin with name sName, putting results in buf.
+     * It tries to create XML conforming to the XML transformation rules (see XMLParser)
+     * that is moderately readable.
+     */
+    @SuppressWarnings("rawtypes")
+    void pluginToXML(BEASTInterface plugin, StringBuffer buf, String sName, boolean bIsTopLevel) throws Exception {
+        // determine element name, default is input, otherswise find one of the defaults
+        String sElementName = "input";
+        for (String key : element2ClassMap.keySet()) {
+        	String className = element2ClassMap.get(key);
+        	Class _class = Class.forName(className);
+        	if (_class.equals(plugin.getClass())) {
+        		sElementName = key;
+        	}
+        }
+        
+//        if (plugin instanceof Alignment) {
+//            sElementName = XMLParser.DATA_ELEMENT;
+//        }
+//        if (plugin instanceof Sequence) {
+//            sElementName = XMLParser.SEQUENCE_ELEMENT;
+//        }
+//        if (plugin instanceof State) {
+//            sElementName = XMLParser.STATE_ELEMENT;
+//        }
+//        if (plugin instanceof Distribution) {
+//            sElementName = XMLParser.DISTRIBUTION_ELEMENT;
+//        }
+//        if (plugin instanceof Logger) {
+//            sElementName = XMLParser.LOG_ELEMENT;
+//        }
+//        if (plugin instanceof Operator) {
+//            sElementName = XMLParser.OPERATOR_ELEMENT;
+//        }
+//        if (plugin instanceof RealParameter) {
+//            sElementName = XMLParser.REAL_PARAMETER_ELEMENT;
+//        }
+//        if (plugin instanceof Tree) {
+//            sElementName = XMLParser.TREE_ELEMENT;
+//        }
+
+        if (bIsTopLevel) {
+            sElementName = XMLParser.RUN_ELEMENT;
+        }
+        for (int i = 0; i < indent; i++) {
+            buf.append("    ");
+        }
+        indent++;
+
+        // open element
+        buf.append("<").append(sElementName);
+
+        boolean bSkipInputs = false;
+        if (isDone.contains(plugin)) {
+            // XML is already produced, we can idref it
+            buf.append(" idref='" + normalise(plugin.getID()) + "'");
+            bSkipInputs = true;
+        } else {
+            // see whether a reasonable id can be generated
+            if (plugin.getID() != null && !plugin.getID().equals("")) {
+                String sID = plugin.getID();
+                // ensure ID is unique
+                if (IDs.contains(sID)) {
+                    int k = 1;
+                    while (IDs.contains(sID + k)) {
+                        k++;
+                    }
+                    sID = sID + k;
+                }
+                buf.append(" id='" + normalise(sID) + "'");
+                IDs.add(sID);
+            }
+            isDone.add(plugin);
+        }
+        String sClassName = plugin.getClass().getName();
+        if (bSkipInputs == false && (!element2ClassMap.containsKey(sElementName) ||
+                !element2ClassMap.get(sElementName).equals(sClassName))) {
+            // only add spec element if it cannot be deduced otherwise (i.e., by idref or default mapping
+            buf.append(" spec='" + sClassName + "'");
+        }
+        if (sName != null && !sName.equals(sElementName)) {
+            // only add name element if it differs from element = default name
+            buf.append(" name='" + sName + "'");
+        }
+
+        if (!bSkipInputs) {
+            // process inputs of this plugin
+            // first, collect values as attributes
+            List<Input<?>> sInputs = plugin.listInputs();
+            for (Input sInput : sInputs) {
+                inputToXML(sInput.getName(), plugin, buf, true);
+            }
+            // next, collect values as input elements
+            StringBuffer buf2 = new StringBuffer();
+            for (Input sInput : sInputs) {
+                inputToXML(sInput.getName(), plugin, buf2, false);
+            }
+            if (buf2.length() == 0) {
+                // if nothing was added by the inputs, close element
+                indent--;
+                buf.append("/>\n");
+            } else {
+                // add contribution of inputs
+            	if (buf2.indexOf("<") >= 0) {
+                    buf.append(">\n");
+                    buf.append(buf2);
+                    indent--;
+                    for (int i = 0; i < indent; i++) {
+                        buf.append("    ");
+                    }
+            	} else {
+                    buf.append(">");
+            		buf.append(buf2.toString().trim());
+                    indent--;
+            	}
+                // add closing element
+                buf.append("</" + sElementName + ">\n");
+            }
+        } else {
+            // close element
+            indent--;
+            buf.append("/>\n");
+        }
+        if (indent < 2) {
+            buf.append("\n");
+        }
+    } // pluginToXML
+
+
+    /**
+     * produce XML for an input of a plugin, both as attribute/value pairs for
+     * primitive inputs (if bShort=true) and as individual elements (if bShort=false)
+     *
+     * @param sInput: name of the input
+     * @param plugin: plugin to produce this input XML for
+     * @param buf:    gets XML results are appended
+     * @param isShort: flag to indicate attribute/value format (true) or element format (false)
+     * @throws Exception
+     */
+    @SuppressWarnings("rawtypes")
+    void inputToXML(String sInput, BEASTInterface plugin, StringBuffer buf, boolean isShort) throws Exception {
+    	if (sInput.equals("*")) {
+    		// this can happen with beast.core.parameter.Map
+    		// and * is not a valid XML attribute name
+    		return;
+    	}
+    	
+        Field[] fields = plugin.getClass().getFields();
+        for (int i = 0; i < fields.length; i++) {
+            if (fields[i].getType().isAssignableFrom(Input.class)) {
+                Input input = (Input) fields[i].get(plugin);
+                if (input.getName().equals(sInput)) {
+                    // found the input with name sInput
+                    if (input.get() != null) {
+                        if (input.get() instanceof Map) {
+                            // distinguish between List, Plugin and primitive input types
+                        	if (isShort) {
+	                        	Map<String,?> map = (Map<String,?>) input.get();
+	                        	// determine label width
+	                        	int whiteSpaceWidth = 0;
+	                        	List<String> keys = new ArrayList<String>();
+	                        	keys.addAll(map.keySet());
+	                        	Collections.sort(keys);
+	                        	for (String key : keys) {
+	                        		whiteSpaceWidth = Math.max(whiteSpaceWidth, key.length());
+	                        	}
+	                        	for (String key : map.keySet()) {
+                                    //buf.append("        <input name='" + key + "'>");
+                                    buf.append("\n        " + key);
+	                        		for (int k = key.length(); k < whiteSpaceWidth; k++) {
+	                        			buf.append(' ');
+	                        		}
+	                        		buf.append("=\"" + normalise(map.get(key).toString()) + "\"");
+	                        	}
+                            }
+                        	return;
+                        } else if (input.get() instanceof List) {
+                            if (!isShort) {
+                            	int k = 0;
+                            	List list = (List) input.get();
+                                for (Object o2 : list) {
+                                	if (o2 instanceof BEASTInterface) {
+                                		pluginToXML((BEASTInterface) o2, buf, sInput, false);
+                                	} else {
+                                		k++;
+                                		buf.append(o2.toString());
+                                		if (k < list.size()) {
+                                			buf.append(' ');
+                                		}
+                                	}
+                                }
+                            }
+                            return;
+                        } else if (input.get() instanceof BEASTInterface) {
+                        	if (!input.get().equals(input.defaultValue)) {
+	                            if (isShort && isDone.contains((BEASTInterface) input.get())) {
+	                                buf.append(" " + sInput + "='@" + normalise( ((BEASTInterface) input.get()).getID() ) + "'");
+	                                inputsDone.add(input);
+	                            }
+	                            if (!isShort && !inputsDone.contains(input)) {
+	                                pluginToXML((BEASTInterface) input.get(), buf, sInput, false);
+	                            }
+                        	}
+                            return;
+                        } else {
+                        	if (!input.get().equals(input.defaultValue)) {
+	                            // primitive type, see if
+	                            String sValue = input.get().toString();
+	                            if (isShort) {
+	                                if (sValue.indexOf('\n') < 0) {
+	                                    buf.append(" " + sInput + "='" + normalise(input.get().toString()) + "'");
+	                                }
+	                            } else {
+	                                if (sValue.indexOf('\n') >= 0) {
+	                                    for (int j = 0; j < indent; j++) {
+	                                        buf.append("    ");
+	                                    }
+	                                    if (sInput.equals("value")) {
+	                                        buf.append(normalise(input.get().toString()));
+	                                    } else {
+	                                        buf.append("<input name='" + sInput + "'>" + normalise(input.get().toString()) + "</input>\n");
+	                                    }
+	                                }
+	                            }
+                        	}
+                            return;
+                        }
+                    } else {
+                        // value=null, no XML to produce
+                        return;
+                    }
+                }
+            }
+        }
+        // should never get here
+        throw new Exception("Could not find input " + sInput + " in plugin " + plugin.getID() + " " + plugin.getClass().getName());
+    } // inputToXML
+
+    
+   /** convert plain text string to XML string, replacing some entities **/
+    String normalise(String str) {
+    	str = str.replaceAll("&", "&");    	
+    	str = str.replaceAll("'", "'");
+    	str = str.replaceAll("\"", """);
+    	str = str.replaceAll("<", "<");
+    	str = str.replaceAll(">", ">");
+    	return str;
+    }
+
+
+} // class XMLProducer
+
diff --git a/src/beast/util/treeparser/Newick.g4 b/src/beast/util/treeparser/Newick.g4
new file mode 100644
index 0000000..e14a596
--- /dev/null
+++ b/src/beast/util/treeparser/Newick.g4
@@ -0,0 +1,38 @@
+grammar Newick;
+
+// Parser rules:
+
+tree: node ';'? EOF;
+
+node: ('(' node (',' node)* ')')? post ;
+
+post: label? meta? (':' length=number)? ;
+
+label: number | STRING ;
+
+meta: '[&' attrib (',' attrib)* ']' ;
+
+attrib: attribKey=STRING '=' attribValue ;
+
+attribValue: number | STRING | vector;
+
+number: INT | FLOAT ;
+
+vector: '{' attribValue (',' attribValue)* '}' ;
+
+
+// Lexer rules:
+
+FLOAT : '-'? NNINT ('.' D*) ([eE] '-'? D+)? ;
+INT : '-'? NNINT;
+fragment NNINT : '0' | NZD D* ;
+fragment NZD : [1-9] ;
+fragment D : [0-9] ;
+
+STRING :
+    [a-zA-Z0-9|*%/.\-+_&]+  // these chars don't need quotes
+    | '"' .*? '"'
+    | '\'' .*? '\''
+    ;
+
+WHITESPACE : [ \t\r\n]+ -> skip ;
\ No newline at end of file
diff --git a/src/beast/util/treeparser/NewickBaseVisitor.java b/src/beast/util/treeparser/NewickBaseVisitor.java
new file mode 100644
index 0000000..37739c8
--- /dev/null
+++ b/src/beast/util/treeparser/NewickBaseVisitor.java
@@ -0,0 +1,77 @@
+// Generated from /home/tvaughan/code/beast_and_friends/beast2/src/beast/util/treeparser/Newick.g4 by ANTLR 4.5.1
+package beast.util.treeparser;
+import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor;
+
+/**
+ * This class provides an empty implementation of {@link NewickVisitor},
+ * which can be extended to create a visitor which only needs to handle a subset
+ * of the available methods.
+ *
+ * @param <T> The return type of the visit operation. Use {@link Void} for
+ * operations with no return type.
+ */
+public class NewickBaseVisitor<T> extends AbstractParseTreeVisitor<T> implements NewickVisitor<T> {
+	/**
+	 * {@inheritDoc}
+	 *
+	 * <p>The default implementation returns the result of calling
+	 * {@link #visitChildren} on {@code ctx}.</p>
+	 */
+	@Override public T visitTree(NewickParser.TreeContext ctx) { return visitChildren(ctx); }
+	/**
+	 * {@inheritDoc}
+	 *
+	 * <p>The default implementation returns the result of calling
+	 * {@link #visitChildren} on {@code ctx}.</p>
+	 */
+	@Override public T visitNode(NewickParser.NodeContext ctx) { return visitChildren(ctx); }
+	/**
+	 * {@inheritDoc}
+	 *
+	 * <p>The default implementation returns the result of calling
+	 * {@link #visitChildren} on {@code ctx}.</p>
+	 */
+	@Override public T visitPost(NewickParser.PostContext ctx) { return visitChildren(ctx); }
+	/**
+	 * {@inheritDoc}
+	 *
+	 * <p>The default implementation returns the result of calling
+	 * {@link #visitChildren} on {@code ctx}.</p>
+	 */
+	@Override public T visitLabel(NewickParser.LabelContext ctx) { return visitChildren(ctx); }
+	/**
+	 * {@inheritDoc}
+	 *
+	 * <p>The default implementation returns the result of calling
+	 * {@link #visitChildren} on {@code ctx}.</p>
+	 */
+	@Override public T visitMeta(NewickParser.MetaContext ctx) { return visitChildren(ctx); }
+	/**
+	 * {@inheritDoc}
+	 *
+	 * <p>The default implementation returns the result of calling
+	 * {@link #visitChildren} on {@code ctx}.</p>
+	 */
+	@Override public T visitAttrib(NewickParser.AttribContext ctx) { return visitChildren(ctx); }
+	/**
+	 * {@inheritDoc}
+	 *
+	 * <p>The default implementation returns the result of calling
+	 * {@link #visitChildren} on {@code ctx}.</p>
+	 */
+	@Override public T visitAttribValue(NewickParser.AttribValueContext ctx) { return visitChildren(ctx); }
+	/**
+	 * {@inheritDoc}
+	 *
+	 * <p>The default implementation returns the result of calling
+	 * {@link #visitChildren} on {@code ctx}.</p>
+	 */
+	@Override public T visitNumber(NewickParser.NumberContext ctx) { return visitChildren(ctx); }
+	/**
+	 * {@inheritDoc}
+	 *
+	 * <p>The default implementation returns the result of calling
+	 * {@link #visitChildren} on {@code ctx}.</p>
+	 */
+	@Override public T visitVector(NewickParser.VectorContext ctx) { return visitChildren(ctx); }
+}
\ No newline at end of file
diff --git a/src/beast/util/treeparser/NewickLexer.java b/src/beast/util/treeparser/NewickLexer.java
new file mode 100644
index 0000000..421a086
--- /dev/null
+++ b/src/beast/util/treeparser/NewickLexer.java
@@ -0,0 +1,136 @@
+// Generated from /home/tvaughan/code/beast_and_friends/beast2/src/beast/util/treeparser/Newick.g4 by ANTLR 4.5.1
+package beast.util.treeparser;
+import org.antlr.v4.runtime.Lexer;
+import org.antlr.v4.runtime.CharStream;
+import org.antlr.v4.runtime.Token;
+import org.antlr.v4.runtime.TokenStream;
+import org.antlr.v4.runtime.*;
+import org.antlr.v4.runtime.atn.*;
+import org.antlr.v4.runtime.dfa.DFA;
+import org.antlr.v4.runtime.misc.*;
+
+ at SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"})
+public class NewickLexer extends Lexer {
+	static { RuntimeMetaData.checkVersion("4.5.1", RuntimeMetaData.VERSION); }
+
+	protected static final DFA[] _decisionToDFA;
+	protected static final PredictionContextCache _sharedContextCache =
+		new PredictionContextCache();
+	public static final int
+		T__0=1, T__1=2, T__2=3, T__3=4, T__4=5, T__5=6, T__6=7, T__7=8, T__8=9, 
+		T__9=10, FLOAT=11, INT=12, STRING=13, WHITESPACE=14;
+	public static String[] modeNames = {
+		"DEFAULT_MODE"
+	};
+
+	public static final String[] ruleNames = {
+		"T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", "T__7", "T__8", 
+		"T__9", "FLOAT", "INT", "NNINT", "NZD", "D", "STRING", "WHITESPACE"
+	};
+
+	private static final String[] _LITERAL_NAMES = {
+		null, "';'", "'('", "','", "')'", "':'", "'[&'", "']'", "'='", "'{'", 
+		"'}'"
+	};
+	private static final String[] _SYMBOLIC_NAMES = {
+		null, null, null, null, null, null, null, null, null, null, null, "FLOAT", 
+		"INT", "STRING", "WHITESPACE"
+	};
+	public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES);
+
+	/**
+	 * @deprecated Use {@link #VOCABULARY} instead.
+	 */
+	@Deprecated
+	public static final String[] tokenNames;
+	static {
+		tokenNames = new String[_SYMBOLIC_NAMES.length];
+		for (int i = 0; i < tokenNames.length; i++) {
+			tokenNames[i] = VOCABULARY.getLiteralName(i);
+			if (tokenNames[i] == null) {
+				tokenNames[i] = VOCABULARY.getSymbolicName(i);
+			}
+
+			if (tokenNames[i] == null) {
+				tokenNames[i] = "<INVALID>";
+			}
+		}
+	}
+
+	@Override
+	@Deprecated
+	public String[] getTokenNames() {
+		return tokenNames;
+	}
+
+	@Override
+
+	public Vocabulary getVocabulary() {
+		return VOCABULARY;
+	}
+
+
+	public NewickLexer(CharStream input) {
+		super(input);
+		_interp = new LexerATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
+	}
+
+	@Override
+	public String getGrammarFileName() { return "Newick.g4"; }
+
+	@Override
+	public String[] getRuleNames() { return ruleNames; }
+
+	@Override
+	public String getSerializedATN() { return _serializedATN; }
+
+	@Override
+	public String[] getModeNames() { return modeNames; }
+
+	@Override
+	public ATN getATN() { return _ATN; }
+
+	public static final String _serializedATN =
+		"\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2\20\u0081\b\1\4\2"+
+		"\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4"+
+		"\13\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22"+
+		"\t\22\3\2\3\2\3\3\3\3\3\4\3\4\3\5\3\5\3\6\3\6\3\7\3\7\3\7\3\b\3\b\3\t"+
+		"\3\t\3\n\3\n\3\13\3\13\3\f\5\f<\n\f\3\f\3\f\3\f\7\fA\n\f\f\f\16\fD\13"+
+		"\f\3\f\3\f\5\fH\n\f\3\f\6\fK\n\f\r\f\16\fL\5\fO\n\f\3\r\5\rR\n\r\3\r\3"+
+		"\r\3\16\3\16\3\16\7\16Y\n\16\f\16\16\16\\\13\16\5\16^\n\16\3\17\3\17\3"+
+		"\20\3\20\3\21\6\21e\n\21\r\21\16\21f\3\21\3\21\7\21k\n\21\f\21\16\21n"+
+		"\13\21\3\21\3\21\3\21\7\21s\n\21\f\21\16\21v\13\21\3\21\5\21y\n\21\3\22"+
+		"\6\22|\n\22\r\22\16\22}\3\22\3\22\4lt\2\23\3\3\5\4\7\5\t\6\13\7\r\b\17"+
+		"\t\21\n\23\13\25\f\27\r\31\16\33\2\35\2\37\2!\17#\20\3\2\7\4\2GGgg\3\2"+
+		"\63;\3\2\62;\t\2\'(,-/;C\\aac|~~\5\2\13\f\17\17\"\"\u008b\2\3\3\2\2\2"+
+		"\2\5\3\2\2\2\2\7\3\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2\17\3\2"+
+		"\2\2\2\21\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2\2\2\2\31\3\2\2\2"+
+		"\2!\3\2\2\2\2#\3\2\2\2\3%\3\2\2\2\5\'\3\2\2\2\7)\3\2\2\2\t+\3\2\2\2\13"+
+		"-\3\2\2\2\r/\3\2\2\2\17\62\3\2\2\2\21\64\3\2\2\2\23\66\3\2\2\2\258\3\2"+
+		"\2\2\27;\3\2\2\2\31Q\3\2\2\2\33]\3\2\2\2\35_\3\2\2\2\37a\3\2\2\2!x\3\2"+
+		"\2\2#{\3\2\2\2%&\7=\2\2&\4\3\2\2\2\'(\7*\2\2(\6\3\2\2\2)*\7.\2\2*\b\3"+
+		"\2\2\2+,\7+\2\2,\n\3\2\2\2-.\7<\2\2.\f\3\2\2\2/\60\7]\2\2\60\61\7(\2\2"+
+		"\61\16\3\2\2\2\62\63\7_\2\2\63\20\3\2\2\2\64\65\7?\2\2\65\22\3\2\2\2\66"+
+		"\67\7}\2\2\67\24\3\2\2\289\7\177\2\29\26\3\2\2\2:<\7/\2\2;:\3\2\2\2;<"+
+		"\3\2\2\2<=\3\2\2\2=>\5\33\16\2>B\7\60\2\2?A\5\37\20\2@?\3\2\2\2AD\3\2"+
+		"\2\2B@\3\2\2\2BC\3\2\2\2CN\3\2\2\2DB\3\2\2\2EG\t\2\2\2FH\7/\2\2GF\3\2"+
+		"\2\2GH\3\2\2\2HJ\3\2\2\2IK\5\37\20\2JI\3\2\2\2KL\3\2\2\2LJ\3\2\2\2LM\3"+
+		"\2\2\2MO\3\2\2\2NE\3\2\2\2NO\3\2\2\2O\30\3\2\2\2PR\7/\2\2QP\3\2\2\2QR"+
+		"\3\2\2\2RS\3\2\2\2ST\5\33\16\2T\32\3\2\2\2U^\7\62\2\2VZ\5\35\17\2WY\5"+
+		"\37\20\2XW\3\2\2\2Y\\\3\2\2\2ZX\3\2\2\2Z[\3\2\2\2[^\3\2\2\2\\Z\3\2\2\2"+
+		"]U\3\2\2\2]V\3\2\2\2^\34\3\2\2\2_`\t\3\2\2`\36\3\2\2\2ab\t\4\2\2b \3\2"+
+		"\2\2ce\t\5\2\2dc\3\2\2\2ef\3\2\2\2fd\3\2\2\2fg\3\2\2\2gy\3\2\2\2hl\7$"+
+		"\2\2ik\13\2\2\2ji\3\2\2\2kn\3\2\2\2lm\3\2\2\2lj\3\2\2\2mo\3\2\2\2nl\3"+
+		"\2\2\2oy\7$\2\2pt\7)\2\2qs\13\2\2\2rq\3\2\2\2sv\3\2\2\2tu\3\2\2\2tr\3"+
+		"\2\2\2uw\3\2\2\2vt\3\2\2\2wy\7)\2\2xd\3\2\2\2xh\3\2\2\2xp\3\2\2\2y\"\3"+
+		"\2\2\2z|\t\6\2\2{z\3\2\2\2|}\3\2\2\2}{\3\2\2\2}~\3\2\2\2~\177\3\2\2\2"+
+		"\177\u0080\b\22\2\2\u0080$\3\2\2\2\20\2;BGLNQZ]fltx}\3\b\2\2";
+	public static final ATN _ATN =
+		new ATNDeserializer().deserialize(_serializedATN.toCharArray());
+	static {
+		_decisionToDFA = new DFA[_ATN.getNumberOfDecisions()];
+		for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) {
+			_decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i);
+		}
+	}
+}
\ No newline at end of file
diff --git a/src/beast/util/treeparser/NewickParser.java b/src/beast/util/treeparser/NewickParser.java
new file mode 100644
index 0000000..6816e27
--- /dev/null
+++ b/src/beast/util/treeparser/NewickParser.java
@@ -0,0 +1,627 @@
+// Generated from /home/tvaughan/code/beast_and_friends/beast2/src/beast/util/treeparser/Newick.g4 by ANTLR 4.5.1
+package beast.util.treeparser;
+import org.antlr.v4.runtime.atn.*;
+import org.antlr.v4.runtime.dfa.DFA;
+import org.antlr.v4.runtime.*;
+import org.antlr.v4.runtime.misc.*;
+import org.antlr.v4.runtime.tree.*;
+import java.util.List;
+import java.util.Iterator;
+import java.util.ArrayList;
+
+ at SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"})
+public class NewickParser extends Parser {
+	static { RuntimeMetaData.checkVersion("4.5.1", RuntimeMetaData.VERSION); }
+
+	protected static final DFA[] _decisionToDFA;
+	protected static final PredictionContextCache _sharedContextCache =
+		new PredictionContextCache();
+	public static final int
+		T__0=1, T__1=2, T__2=3, T__3=4, T__4=5, T__5=6, T__6=7, T__7=8, T__8=9, 
+		T__9=10, FLOAT=11, INT=12, STRING=13, WHITESPACE=14;
+	public static final int
+		RULE_tree = 0, RULE_node = 1, RULE_post = 2, RULE_label = 3, RULE_meta = 4, 
+		RULE_attrib = 5, RULE_attribValue = 6, RULE_number = 7, RULE_vector = 8;
+	public static final String[] ruleNames = {
+		"tree", "node", "post", "label", "meta", "attrib", "attribValue", "number", 
+		"vector"
+	};
+
+	private static final String[] _LITERAL_NAMES = {
+		null, "';'", "'('", "','", "')'", "':'", "'[&'", "']'", "'='", "'{'", 
+		"'}'"
+	};
+	private static final String[] _SYMBOLIC_NAMES = {
+		null, null, null, null, null, null, null, null, null, null, null, "FLOAT", 
+		"INT", "STRING", "WHITESPACE"
+	};
+	public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES);
+
+	/**
+	 * @deprecated Use {@link #VOCABULARY} instead.
+	 */
+	@Deprecated
+	public static final String[] tokenNames;
+	static {
+		tokenNames = new String[_SYMBOLIC_NAMES.length];
+		for (int i = 0; i < tokenNames.length; i++) {
+			tokenNames[i] = VOCABULARY.getLiteralName(i);
+			if (tokenNames[i] == null) {
+				tokenNames[i] = VOCABULARY.getSymbolicName(i);
+			}
+
+			if (tokenNames[i] == null) {
+				tokenNames[i] = "<INVALID>";
+			}
+		}
+	}
+
+	@Override
+	@Deprecated
+	public String[] getTokenNames() {
+		return tokenNames;
+	}
+
+	@Override
+
+	public Vocabulary getVocabulary() {
+		return VOCABULARY;
+	}
+
+	@Override
+	public String getGrammarFileName() { return "Newick.g4"; }
+
+	@Override
+	public String[] getRuleNames() { return ruleNames; }
+
+	@Override
+	public String getSerializedATN() { return _serializedATN; }
+
+	@Override
+	public ATN getATN() { return _ATN; }
+
+	public NewickParser(TokenStream input) {
+		super(input);
+		_interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
+	}
+	public static class TreeContext extends ParserRuleContext {
+		public NodeContext node() {
+			return getRuleContext(NodeContext.class,0);
+		}
+		public TerminalNode EOF() { return getToken(NewickParser.EOF, 0); }
+		public TreeContext(ParserRuleContext parent, int invokingState) {
+			super(parent, invokingState);
+		}
+		@Override public int getRuleIndex() { return RULE_tree; }
+		@Override
+		public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
+			if ( visitor instanceof NewickVisitor ) return ((NewickVisitor<? extends T>)visitor).visitTree(this);
+			else return visitor.visitChildren(this);
+		}
+	}
+
+	public final TreeContext tree() throws RecognitionException {
+		TreeContext _localctx = new TreeContext(_ctx, getState());
+		enterRule(_localctx, 0, RULE_tree);
+		int _la;
+		try {
+			enterOuterAlt(_localctx, 1);
+			{
+			setState(18);
+			node();
+			setState(20);
+			_la = _input.LA(1);
+			if (_la==T__0) {
+				{
+				setState(19);
+				match(T__0);
+				}
+			}
+
+			setState(22);
+			match(EOF);
+			}
+		}
+		catch (RecognitionException re) {
+			_localctx.exception = re;
+			_errHandler.reportError(this, re);
+			_errHandler.recover(this, re);
+		}
+		finally {
+			exitRule();
+		}
+		return _localctx;
+	}
+
+	public static class NodeContext extends ParserRuleContext {
+		public PostContext post() {
+			return getRuleContext(PostContext.class,0);
+		}
+		public List<NodeContext> node() {
+			return getRuleContexts(NodeContext.class);
+		}
+		public NodeContext node(int i) {
+			return getRuleContext(NodeContext.class,i);
+		}
+		public NodeContext(ParserRuleContext parent, int invokingState) {
+			super(parent, invokingState);
+		}
+		@Override public int getRuleIndex() { return RULE_node; }
+		@Override
+		public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
+			if ( visitor instanceof NewickVisitor ) return ((NewickVisitor<? extends T>)visitor).visitNode(this);
+			else return visitor.visitChildren(this);
+		}
+	}
+
+	public final NodeContext node() throws RecognitionException {
+		NodeContext _localctx = new NodeContext(_ctx, getState());
+		enterRule(_localctx, 2, RULE_node);
+		int _la;
+		try {
+			enterOuterAlt(_localctx, 1);
+			{
+			setState(35);
+			_la = _input.LA(1);
+			if (_la==T__1) {
+				{
+				setState(24);
+				match(T__1);
+				setState(25);
+				node();
+				setState(30);
+				_errHandler.sync(this);
+				_la = _input.LA(1);
+				while (_la==T__2) {
+					{
+					{
+					setState(26);
+					match(T__2);
+					setState(27);
+					node();
+					}
+					}
+					setState(32);
+					_errHandler.sync(this);
+					_la = _input.LA(1);
+				}
+				setState(33);
+				match(T__3);
+				}
+			}
+
+			setState(37);
+			post();
+			}
+		}
+		catch (RecognitionException re) {
+			_localctx.exception = re;
+			_errHandler.reportError(this, re);
+			_errHandler.recover(this, re);
+		}
+		finally {
+			exitRule();
+		}
+		return _localctx;
+	}
+
+	public static class PostContext extends ParserRuleContext {
+		public NumberContext length;
+		public LabelContext label() {
+			return getRuleContext(LabelContext.class,0);
+		}
+		public MetaContext meta() {
+			return getRuleContext(MetaContext.class,0);
+		}
+		public NumberContext number() {
+			return getRuleContext(NumberContext.class,0);
+		}
+		public PostContext(ParserRuleContext parent, int invokingState) {
+			super(parent, invokingState);
+		}
+		@Override public int getRuleIndex() { return RULE_post; }
+		@Override
+		public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
+			if ( visitor instanceof NewickVisitor ) return ((NewickVisitor<? extends T>)visitor).visitPost(this);
+			else return visitor.visitChildren(this);
+		}
+	}
+
+	public final PostContext post() throws RecognitionException {
+		PostContext _localctx = new PostContext(_ctx, getState());
+		enterRule(_localctx, 4, RULE_post);
+		int _la;
+		try {
+			enterOuterAlt(_localctx, 1);
+			{
+			setState(40);
+			_la = _input.LA(1);
+			if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FLOAT) | (1L << INT) | (1L << STRING))) != 0)) {
+				{
+				setState(39);
+				label();
+				}
+			}
+
+			setState(43);
+			_la = _input.LA(1);
+			if (_la==T__5) {
+				{
+				setState(42);
+				meta();
+				}
+			}
+
+			setState(47);
+			_la = _input.LA(1);
+			if (_la==T__4) {
+				{
+				setState(45);
+				match(T__4);
+				setState(46);
+				((PostContext)_localctx).length = number();
+				}
+			}
+
+			}
+		}
+		catch (RecognitionException re) {
+			_localctx.exception = re;
+			_errHandler.reportError(this, re);
+			_errHandler.recover(this, re);
+		}
+		finally {
+			exitRule();
+		}
+		return _localctx;
+	}
+
+	public static class LabelContext extends ParserRuleContext {
+		public NumberContext number() {
+			return getRuleContext(NumberContext.class,0);
+		}
+		public TerminalNode STRING() { return getToken(NewickParser.STRING, 0); }
+		public LabelContext(ParserRuleContext parent, int invokingState) {
+			super(parent, invokingState);
+		}
+		@Override public int getRuleIndex() { return RULE_label; }
+		@Override
+		public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
+			if ( visitor instanceof NewickVisitor ) return ((NewickVisitor<? extends T>)visitor).visitLabel(this);
+			else return visitor.visitChildren(this);
+		}
+	}
+
+	public final LabelContext label() throws RecognitionException {
+		LabelContext _localctx = new LabelContext(_ctx, getState());
+		enterRule(_localctx, 6, RULE_label);
+		try {
+			setState(51);
+			switch (_input.LA(1)) {
+			case FLOAT:
+			case INT:
+				enterOuterAlt(_localctx, 1);
+				{
+				setState(49);
+				number();
+				}
+				break;
+			case STRING:
+				enterOuterAlt(_localctx, 2);
+				{
+				setState(50);
+				match(STRING);
+				}
+				break;
+			default:
+				throw new NoViableAltException(this);
+			}
+		}
+		catch (RecognitionException re) {
+			_localctx.exception = re;
+			_errHandler.reportError(this, re);
+			_errHandler.recover(this, re);
+		}
+		finally {
+			exitRule();
+		}
+		return _localctx;
+	}
+
+	public static class MetaContext extends ParserRuleContext {
+		public List<AttribContext> attrib() {
+			return getRuleContexts(AttribContext.class);
+		}
+		public AttribContext attrib(int i) {
+			return getRuleContext(AttribContext.class,i);
+		}
+		public MetaContext(ParserRuleContext parent, int invokingState) {
+			super(parent, invokingState);
+		}
+		@Override public int getRuleIndex() { return RULE_meta; }
+		@Override
+		public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
+			if ( visitor instanceof NewickVisitor ) return ((NewickVisitor<? extends T>)visitor).visitMeta(this);
+			else return visitor.visitChildren(this);
+		}
+	}
+
+	public final MetaContext meta() throws RecognitionException {
+		MetaContext _localctx = new MetaContext(_ctx, getState());
+		enterRule(_localctx, 8, RULE_meta);
+		int _la;
+		try {
+			enterOuterAlt(_localctx, 1);
+			{
+			setState(53);
+			match(T__5);
+			setState(54);
+			attrib();
+			setState(59);
+			_errHandler.sync(this);
+			_la = _input.LA(1);
+			while (_la==T__2) {
+				{
+				{
+				setState(55);
+				match(T__2);
+				setState(56);
+				attrib();
+				}
+				}
+				setState(61);
+				_errHandler.sync(this);
+				_la = _input.LA(1);
+			}
+			setState(62);
+			match(T__6);
+			}
+		}
+		catch (RecognitionException re) {
+			_localctx.exception = re;
+			_errHandler.reportError(this, re);
+			_errHandler.recover(this, re);
+		}
+		finally {
+			exitRule();
+		}
+		return _localctx;
+	}
+
+	public static class AttribContext extends ParserRuleContext {
+		public Token attribKey;
+		public AttribValueContext attribValue() {
+			return getRuleContext(AttribValueContext.class,0);
+		}
+		public TerminalNode STRING() { return getToken(NewickParser.STRING, 0); }
+		public AttribContext(ParserRuleContext parent, int invokingState) {
+			super(parent, invokingState);
+		}
+		@Override public int getRuleIndex() { return RULE_attrib; }
+		@Override
+		public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
+			if ( visitor instanceof NewickVisitor ) return ((NewickVisitor<? extends T>)visitor).visitAttrib(this);
+			else return visitor.visitChildren(this);
+		}
+	}
+
+	public final AttribContext attrib() throws RecognitionException {
+		AttribContext _localctx = new AttribContext(_ctx, getState());
+		enterRule(_localctx, 10, RULE_attrib);
+		try {
+			enterOuterAlt(_localctx, 1);
+			{
+			setState(64);
+			((AttribContext)_localctx).attribKey = match(STRING);
+			setState(65);
+			match(T__7);
+			setState(66);
+			attribValue();
+			}
+		}
+		catch (RecognitionException re) {
+			_localctx.exception = re;
+			_errHandler.reportError(this, re);
+			_errHandler.recover(this, re);
+		}
+		finally {
+			exitRule();
+		}
+		return _localctx;
+	}
+
+	public static class AttribValueContext extends ParserRuleContext {
+		public NumberContext number() {
+			return getRuleContext(NumberContext.class,0);
+		}
+		public TerminalNode STRING() { return getToken(NewickParser.STRING, 0); }
+		public VectorContext vector() {
+			return getRuleContext(VectorContext.class,0);
+		}
+		public AttribValueContext(ParserRuleContext parent, int invokingState) {
+			super(parent, invokingState);
+		}
+		@Override public int getRuleIndex() { return RULE_attribValue; }
+		@Override
+		public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
+			if ( visitor instanceof NewickVisitor ) return ((NewickVisitor<? extends T>)visitor).visitAttribValue(this);
+			else return visitor.visitChildren(this);
+		}
+	}
+
+	public final AttribValueContext attribValue() throws RecognitionException {
+		AttribValueContext _localctx = new AttribValueContext(_ctx, getState());
+		enterRule(_localctx, 12, RULE_attribValue);
+		try {
+			setState(71);
+			switch (_input.LA(1)) {
+			case FLOAT:
+			case INT:
+				enterOuterAlt(_localctx, 1);
+				{
+				setState(68);
+				number();
+				}
+				break;
+			case STRING:
+				enterOuterAlt(_localctx, 2);
+				{
+				setState(69);
+				match(STRING);
+				}
+				break;
+			case T__8:
+				enterOuterAlt(_localctx, 3);
+				{
+				setState(70);
+				vector();
+				}
+				break;
+			default:
+				throw new NoViableAltException(this);
+			}
+		}
+		catch (RecognitionException re) {
+			_localctx.exception = re;
+			_errHandler.reportError(this, re);
+			_errHandler.recover(this, re);
+		}
+		finally {
+			exitRule();
+		}
+		return _localctx;
+	}
+
+	public static class NumberContext extends ParserRuleContext {
+		public TerminalNode INT() { return getToken(NewickParser.INT, 0); }
+		public TerminalNode FLOAT() { return getToken(NewickParser.FLOAT, 0); }
+		public NumberContext(ParserRuleContext parent, int invokingState) {
+			super(parent, invokingState);
+		}
+		@Override public int getRuleIndex() { return RULE_number; }
+		@Override
+		public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
+			if ( visitor instanceof NewickVisitor ) return ((NewickVisitor<? extends T>)visitor).visitNumber(this);
+			else return visitor.visitChildren(this);
+		}
+	}
+
+	public final NumberContext number() throws RecognitionException {
+		NumberContext _localctx = new NumberContext(_ctx, getState());
+		enterRule(_localctx, 14, RULE_number);
+		int _la;
+		try {
+			enterOuterAlt(_localctx, 1);
+			{
+			setState(73);
+			_la = _input.LA(1);
+			if ( !(_la==FLOAT || _la==INT) ) {
+			_errHandler.recoverInline(this);
+			} else {
+				consume();
+			}
+			}
+		}
+		catch (RecognitionException re) {
+			_localctx.exception = re;
+			_errHandler.reportError(this, re);
+			_errHandler.recover(this, re);
+		}
+		finally {
+			exitRule();
+		}
+		return _localctx;
+	}
+
+	public static class VectorContext extends ParserRuleContext {
+		public List<AttribValueContext> attribValue() {
+			return getRuleContexts(AttribValueContext.class);
+		}
+		public AttribValueContext attribValue(int i) {
+			return getRuleContext(AttribValueContext.class,i);
+		}
+		public VectorContext(ParserRuleContext parent, int invokingState) {
+			super(parent, invokingState);
+		}
+		@Override public int getRuleIndex() { return RULE_vector; }
+		@Override
+		public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
+			if ( visitor instanceof NewickVisitor ) return ((NewickVisitor<? extends T>)visitor).visitVector(this);
+			else return visitor.visitChildren(this);
+		}
+	}
+
+	public final VectorContext vector() throws RecognitionException {
+		VectorContext _localctx = new VectorContext(_ctx, getState());
+		enterRule(_localctx, 16, RULE_vector);
+		int _la;
+		try {
+			enterOuterAlt(_localctx, 1);
+			{
+			setState(75);
+			match(T__8);
+			setState(76);
+			attribValue();
+			setState(81);
+			_errHandler.sync(this);
+			_la = _input.LA(1);
+			while (_la==T__2) {
+				{
+				{
+				setState(77);
+				match(T__2);
+				setState(78);
+				attribValue();
+				}
+				}
+				setState(83);
+				_errHandler.sync(this);
+				_la = _input.LA(1);
+			}
+			setState(84);
+			match(T__9);
+			}
+		}
+		catch (RecognitionException re) {
+			_localctx.exception = re;
+			_errHandler.reportError(this, re);
+			_errHandler.recover(this, re);
+		}
+		finally {
+			exitRule();
+		}
+		return _localctx;
+	}
+
+	public static final String _serializedATN =
+		"\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\3\20Y\4\2\t\2\4\3\t"+
+		"\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\3\2\3\2\5\2"+
+		"\27\n\2\3\2\3\2\3\3\3\3\3\3\3\3\7\3\37\n\3\f\3\16\3\"\13\3\3\3\3\3\5\3"+
+		"&\n\3\3\3\3\3\3\4\5\4+\n\4\3\4\5\4.\n\4\3\4\3\4\5\4\62\n\4\3\5\3\5\5\5"+
+		"\66\n\5\3\6\3\6\3\6\3\6\7\6<\n\6\f\6\16\6?\13\6\3\6\3\6\3\7\3\7\3\7\3"+
+		"\7\3\b\3\b\3\b\5\bJ\n\b\3\t\3\t\3\n\3\n\3\n\3\n\7\nR\n\n\f\n\16\nU\13"+
+		"\n\3\n\3\n\3\n\2\2\13\2\4\6\b\n\f\16\20\22\2\3\3\2\r\16Z\2\24\3\2\2\2"+
+		"\4%\3\2\2\2\6*\3\2\2\2\b\65\3\2\2\2\n\67\3\2\2\2\fB\3\2\2\2\16I\3\2\2"+
+		"\2\20K\3\2\2\2\22M\3\2\2\2\24\26\5\4\3\2\25\27\7\3\2\2\26\25\3\2\2\2\26"+
+		"\27\3\2\2\2\27\30\3\2\2\2\30\31\7\2\2\3\31\3\3\2\2\2\32\33\7\4\2\2\33"+
+		" \5\4\3\2\34\35\7\5\2\2\35\37\5\4\3\2\36\34\3\2\2\2\37\"\3\2\2\2 \36\3"+
+		"\2\2\2 !\3\2\2\2!#\3\2\2\2\" \3\2\2\2#$\7\6\2\2$&\3\2\2\2%\32\3\2\2\2"+
+		"%&\3\2\2\2&\'\3\2\2\2\'(\5\6\4\2(\5\3\2\2\2)+\5\b\5\2*)\3\2\2\2*+\3\2"+
+		"\2\2+-\3\2\2\2,.\5\n\6\2-,\3\2\2\2-.\3\2\2\2.\61\3\2\2\2/\60\7\7\2\2\60"+
+		"\62\5\20\t\2\61/\3\2\2\2\61\62\3\2\2\2\62\7\3\2\2\2\63\66\5\20\t\2\64"+
+		"\66\7\17\2\2\65\63\3\2\2\2\65\64\3\2\2\2\66\t\3\2\2\2\678\7\b\2\28=\5"+
+		"\f\7\29:\7\5\2\2:<\5\f\7\2;9\3\2\2\2<?\3\2\2\2=;\3\2\2\2=>\3\2\2\2>@\3"+
+		"\2\2\2?=\3\2\2\2 at A\7\t\2\2A\13\3\2\2\2BC\7\17\2\2CD\7\n\2\2DE\5\16\b\2"+
+		"E\r\3\2\2\2FJ\5\20\t\2GJ\7\17\2\2HJ\5\22\n\2IF\3\2\2\2IG\3\2\2\2IH\3\2"+
+		"\2\2J\17\3\2\2\2KL\t\2\2\2L\21\3\2\2\2MN\7\13\2\2NS\5\16\b\2OP\7\5\2\2"+
+		"PR\5\16\b\2QO\3\2\2\2RU\3\2\2\2SQ\3\2\2\2ST\3\2\2\2TV\3\2\2\2US\3\2\2"+
+		"\2VW\7\f\2\2W\23\3\2\2\2\f\26 %*-\61\65=IS";
+	public static final ATN _ATN =
+		new ATNDeserializer().deserialize(_serializedATN.toCharArray());
+	static {
+		_decisionToDFA = new DFA[_ATN.getNumberOfDecisions()];
+		for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) {
+			_decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i);
+		}
+	}
+}
\ No newline at end of file
diff --git a/src/beast/util/treeparser/NewickVisitor.java b/src/beast/util/treeparser/NewickVisitor.java
new file mode 100644
index 0000000..e1cb154
--- /dev/null
+++ b/src/beast/util/treeparser/NewickVisitor.java
@@ -0,0 +1,67 @@
+// Generated from /home/tvaughan/code/beast_and_friends/beast2/src/beast/util/treeparser/Newick.g4 by ANTLR 4.5.1
+package beast.util.treeparser;
+import org.antlr.v4.runtime.tree.ParseTreeVisitor;
+
+/**
+ * This interface defines a complete generic visitor for a parse tree produced
+ * by {@link NewickParser}.
+ *
+ * @param <T> The return type of the visit operation. Use {@link Void} for
+ * operations with no return type.
+ */
+public interface NewickVisitor<T> extends ParseTreeVisitor<T> {
+	/**
+	 * Visit a parse tree produced by {@link NewickParser#tree}.
+	 * @param ctx the parse tree
+	 * @return the visitor result
+	 */
+	T visitTree(NewickParser.TreeContext ctx);
+	/**
+	 * Visit a parse tree produced by {@link NewickParser#node}.
+	 * @param ctx the parse tree
+	 * @return the visitor result
+	 */
+	T visitNode(NewickParser.NodeContext ctx);
+	/**
+	 * Visit a parse tree produced by {@link NewickParser#post}.
+	 * @param ctx the parse tree
+	 * @return the visitor result
+	 */
+	T visitPost(NewickParser.PostContext ctx);
+	/**
+	 * Visit a parse tree produced by {@link NewickParser#label}.
+	 * @param ctx the parse tree
+	 * @return the visitor result
+	 */
+	T visitLabel(NewickParser.LabelContext ctx);
+	/**
+	 * Visit a parse tree produced by {@link NewickParser#meta}.
+	 * @param ctx the parse tree
+	 * @return the visitor result
+	 */
+	T visitMeta(NewickParser.MetaContext ctx);
+	/**
+	 * Visit a parse tree produced by {@link NewickParser#attrib}.
+	 * @param ctx the parse tree
+	 * @return the visitor result
+	 */
+	T visitAttrib(NewickParser.AttribContext ctx);
+	/**
+	 * Visit a parse tree produced by {@link NewickParser#attribValue}.
+	 * @param ctx the parse tree
+	 * @return the visitor result
+	 */
+	T visitAttribValue(NewickParser.AttribValueContext ctx);
+	/**
+	 * Visit a parse tree produced by {@link NewickParser#number}.
+	 * @param ctx the parse tree
+	 * @return the visitor result
+	 */
+	T visitNumber(NewickParser.NumberContext ctx);
+	/**
+	 * Visit a parse tree produced by {@link NewickParser#vector}.
+	 * @param ctx the parse tree
+	 * @return the visitor result
+	 */
+	T visitVector(NewickParser.VectorContext ctx);
+}
\ No newline at end of file
diff --git a/src/org/apache/commons/math/ConvergenceException.java b/src/org/apache/commons/math/ConvergenceException.java
new file mode 100644
index 0000000..e480993
--- /dev/null
+++ b/src/org/apache/commons/math/ConvergenceException.java
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math;
+
+/**
+ * Error thrown when a numerical computation can not be performed because the
+ * numerical result failed to converge to a finite value.
+ *
+ * @version $Revision: 811685 $ $Date: 2009-09-05 13:36:48 -0400 (Sat, 05 Sep 2009) $
+ */
+public class ConvergenceException extends MathException {
+
+    /**
+     * Serializable version identifier
+     */
+    private static final long serialVersionUID = 4883703247677159141L;
+
+    /**
+     * Default constructor.
+     */
+    public ConvergenceException() {
+        super("Convergence failed");
+    }
+
+    /**
+     * Constructs an exception with specified formatted detail message.
+     * Message formatting is delegated to {@link java.text.MessageFormat}.
+     *
+     * @param pattern   format specifier
+     * @param arguments format arguments
+     * @since 1.2
+     */
+    public ConvergenceException(String pattern, Object... arguments) {
+        super(pattern, arguments);
+    }
+
+    /**
+     * Create an exception with a given root cause.
+     *
+     * @param cause the exception or error that caused this exception to be thrown
+     */
+    public ConvergenceException(Throwable cause) {
+        super(cause);
+    }
+
+    /**
+     * Constructs an exception with specified formatted detail message and root cause.
+     * Message formatting is delegated to {@link java.text.MessageFormat}.
+     *
+     * @param cause     the exception or error that caused this exception to be thrown
+     * @param pattern   format specifier
+     * @param arguments format arguments
+     * @since 1.2
+     */
+    public ConvergenceException(Throwable cause, String pattern, Object... arguments) {
+        super(cause, pattern, arguments);
+    }
+
+}
diff --git a/src/org/apache/commons/math/ConvergingAlgorithm.java b/src/org/apache/commons/math/ConvergingAlgorithm.java
new file mode 100644
index 0000000..09cae7f
--- /dev/null
+++ b/src/org/apache/commons/math/ConvergingAlgorithm.java
@@ -0,0 +1,138 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math;
+
+
+/**
+ * Interface for algorithms handling convergence settings.
+ * <p>
+ * This interface only deals with convergence parameters setting, not
+ * execution of the algorithms per se.
+ * </p>
+ *
+ * @version $Revision: 811786 $ $Date: 2009-09-06 05:36:08 -0400 (Sun, 06 Sep 2009) $
+ * @see ConvergenceException
+ * @since 2.0
+ */
+public interface ConvergingAlgorithm {
+
+    /**
+     * Set the upper limit for the number of iterations.
+     * <p>
+     * Usually a high iteration count indicates convergence problems. However,
+     * the "reasonable value" varies widely for different algorithms. Users are
+     * advised to use the default value supplied by the algorithm.</p>
+     * <p>
+     * A {@link ConvergenceException} will be thrown if this number
+     * is exceeded.</p>
+     *
+     * @param count maximum number of iterations
+     */
+    void setMaximalIterationCount(int count);
+
+    /**
+     * Get the upper limit for the number of iterations.
+     *
+     * @return the actual upper limit
+     */
+    int getMaximalIterationCount();
+
+    /**
+     * Reset the upper limit for the number of iterations to the default.
+     * <p>
+     * The default value is supplied by the algorithm implementation.</p>
+     *
+     * @see #setMaximalIterationCount(int)
+     */
+    void resetMaximalIterationCount();
+
+    /**
+     * Set the absolute accuracy.
+     * <p>
+     * The default is usually chosen so that results in the interval
+     * -10..-0.1 and +0.1..+10 can be found with a reasonable accuracy. If the
+     * expected absolute value of your results is of much smaller magnitude, set
+     * this to a smaller value.</p>
+     * <p>
+     * Algorithms are advised to do a plausibility check with the relative
+     * accuracy, but clients should not rely on this.</p>
+     *
+     * @param accuracy the accuracy.
+     * @throws IllegalArgumentException if the accuracy can't be achieved by
+     *                                  the solver or is otherwise deemed unreasonable.
+     */
+    void setAbsoluteAccuracy(double accuracy);
+
+    /**
+     * Get the actual absolute accuracy.
+     *
+     * @return the accuracy
+     */
+    double getAbsoluteAccuracy();
+
+    /**
+     * Reset the absolute accuracy to the default.
+     * <p>
+     * The default value is provided by the algorithm implementation.</p>
+     */
+    void resetAbsoluteAccuracy();
+
+    /**
+     * Set the relative accuracy.
+     * <p>
+     * This is used to stop iterations if the absolute accuracy can't be
+     * achieved due to large values or short mantissa length.</p>
+     * <p>
+     * If this should be the primary criterion for convergence rather then a
+     * safety measure, set the absolute accuracy to a ridiculously small value,
+     * like {@link org.apache.commons.math.util.MathUtils#SAFE_MIN MathUtils.SAFE_MIN}.</p>
+     *
+     * @param accuracy the relative accuracy.
+     * @throws IllegalArgumentException if the accuracy can't be achieved by
+     *                                  the algorithm or is otherwise deemed unreasonable.
+     */
+    void setRelativeAccuracy(double accuracy);
+
+    /**
+     * Get the actual relative accuracy.
+     *
+     * @return the accuracy
+     */
+    double getRelativeAccuracy();
+
+    /**
+     * Reset the relative accuracy to the default.
+     * The default value is provided by the algorithm implementation.
+     */
+    void resetRelativeAccuracy();
+
+    /**
+     * Get the number of iterations in the last run of the algorithm.
+     * <p>
+     * This is mainly meant for testing purposes. It may occasionally
+     * help track down performance problems: if the iteration count
+     * is notoriously high, check whether the problem is evaluated
+     * properly, and whether another algorithm is more amenable to the
+     * problem.</p>
+     *
+     * @return the last iteration count.
+     * @throws IllegalStateException if there is no result available, either
+     *                               because no result was yet computed or the last attempt failed.
+     */
+    int getIterationCount();
+
+}
diff --git a/src/org/apache/commons/math/ConvergingAlgorithmImpl.java b/src/org/apache/commons/math/ConvergingAlgorithmImpl.java
new file mode 100644
index 0000000..23c2c57
--- /dev/null
+++ b/src/org/apache/commons/math/ConvergingAlgorithmImpl.java
@@ -0,0 +1,155 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.math;
+
+
+/**
+ * Provide a default implementation for several functions useful to generic
+ * converging algorithms.
+ *
+ * @version $Revision: 811685 $ $Date: 2009-09-05 13:36:48 -0400 (Sat, 05 Sep 2009) $
+ * @since 2.0
+ */
+public abstract class ConvergingAlgorithmImpl implements ConvergingAlgorithm {
+
+    /**
+     * Maximum absolute error.
+     */
+    protected double absoluteAccuracy;
+
+    /**
+     * Maximum relative error.
+     */
+    protected double relativeAccuracy;
+
+    /**
+     * Maximum number of iterations.
+     */
+    protected int maximalIterationCount;
+
+    /**
+     * Default maximum absolute error.
+     */
+    protected double defaultAbsoluteAccuracy;
+
+    /**
+     * Default maximum relative error.
+     */
+    protected double defaultRelativeAccuracy;
+
+    /**
+     * Default maximum number of iterations.
+     */
+    protected int defaultMaximalIterationCount;
+
+    // Mainly for test framework.
+    /**
+     * The last iteration count.
+     */
+    protected int iterationCount;
+
+    /**
+     * Construct an algorithm with given iteration count and accuracy.
+     *
+     * @param defaultAbsoluteAccuracy      maximum absolute error
+     * @param defaultMaximalIterationCount maximum number of iterations
+     * @throws IllegalArgumentException if f is null or the
+     *                                  defaultAbsoluteAccuracy is not valid
+     */
+    protected ConvergingAlgorithmImpl(final int defaultMaximalIterationCount,
+                                      final double defaultAbsoluteAccuracy) {
+        this.defaultAbsoluteAccuracy = defaultAbsoluteAccuracy;
+        this.defaultRelativeAccuracy = 1.0e-14;
+        this.absoluteAccuracy = defaultAbsoluteAccuracy;
+        this.relativeAccuracy = defaultRelativeAccuracy;
+        this.defaultMaximalIterationCount = defaultMaximalIterationCount;
+        this.maximalIterationCount = defaultMaximalIterationCount;
+        this.iterationCount = 0;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public int getIterationCount() {
+        return iterationCount;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setAbsoluteAccuracy(double accuracy) {
+        absoluteAccuracy = accuracy;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public double getAbsoluteAccuracy() {
+        return absoluteAccuracy;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void resetAbsoluteAccuracy() {
+        absoluteAccuracy = defaultAbsoluteAccuracy;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setMaximalIterationCount(int count) {
+        maximalIterationCount = count;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public int getMaximalIterationCount() {
+        return maximalIterationCount;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void resetMaximalIterationCount() {
+        maximalIterationCount = defaultMaximalIterationCount;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setRelativeAccuracy(double accuracy) {
+        relativeAccuracy = accuracy;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public double getRelativeAccuracy() {
+        return relativeAccuracy;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void resetRelativeAccuracy() {
+        relativeAccuracy = defaultRelativeAccuracy;
+    }
+
+}
diff --git a/src/org/apache/commons/math/FunctionEvaluationException.java b/src/org/apache/commons/math/FunctionEvaluationException.java
new file mode 100644
index 0000000..f51752b
--- /dev/null
+++ b/src/org/apache/commons/math/FunctionEvaluationException.java
@@ -0,0 +1,169 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math;
+
+//import org.apache.commons.math.linear.ArrayRealVector;
+
+/**
+ * Exception thrown when an error occurs evaluating a function.
+ * <p/>
+ * Maintains an <code>argument</code> property holding the input value that
+ * caused the function evaluation to fail.
+ *
+ * @version $Revision: 885278 $ $Date: 2009-11-29 16:47:51 -0500 (Sun, 29 Nov 2009) $
+ */
+public class FunctionEvaluationException extends MathException {
+
+    /**
+     * Serializable version identifier.
+     */
+    private static final long serialVersionUID = -4305020489115478365L;
+
+    /**
+     * Message for failed evaluation.
+     */
+    private static final String FAILED_EVALUATION_MESSAGE =
+            "evaluation failed for argument = {0}";
+
+    /**
+     * Argument causing function evaluation failure
+     */
+    private double[] argument;
+
+    /**
+     * Construct an exception indicating the argument value
+     * that caused the function evaluation to fail.
+     *
+     * @param argument the failing function argument
+     */
+    public FunctionEvaluationException(double argument) {
+        super(FAILED_EVALUATION_MESSAGE, argument);
+        this.argument = new double[]{argument};
+    }
+
+    /**
+     * Construct an exception indicating the argument value
+     * that caused the function evaluation to fail.
+     *
+     * @param argument  the failing function argument
+     * @since 2.0
+     */
+//    public FunctionEvaluationException(double[] argument) {
+//        super(FAILED_EVALUATION_MESSAGE, new ArrayRealVector(argument));
+//        this.argument = argument.clone();
+//    }
+
+    /**
+     * Constructs an exception with specified formatted detail message.
+     * Message formatting is delegated to {@link java.text.MessageFormat}.
+     *
+     * @param argument  the failing function argument
+     * @param pattern   format specifier
+     * @param arguments format arguments
+     * @since 1.2
+     */
+    public FunctionEvaluationException(double argument,
+                                       String pattern, Object... arguments) {
+        super(pattern, arguments);
+        this.argument = new double[]{argument};
+    }
+
+    /**
+     * Constructs an exception with specified formatted detail message.
+     * Message formatting is delegated to {@link java.text.MessageFormat}.
+     *
+     * @param argument  the failing function argument
+     * @param pattern   format specifier
+     * @param arguments format arguments
+     * @since 2.0
+     */
+    public FunctionEvaluationException(double[] argument,
+                                       String pattern, Object... arguments) {
+        super(pattern, arguments);
+        this.argument = argument.clone();
+    }
+
+    /**
+     * Constructs an exception with specified root cause.
+     * Message formatting is delegated to {@link java.text.MessageFormat}.
+     *
+     * @param cause    the exception or error that caused this exception to be thrown
+     * @param argument the failing function argument
+     * @since 1.2
+     */
+    public FunctionEvaluationException(Throwable cause, double argument) {
+        super(cause);
+        this.argument = new double[]{argument};
+    }
+
+    /**
+     * Constructs an exception with specified root cause.
+     * Message formatting is delegated to {@link java.text.MessageFormat}.
+     *
+     * @param cause    the exception or error that caused this exception to be thrown
+     * @param argument the failing function argument
+     * @since 2.0
+     */
+    public FunctionEvaluationException(Throwable cause, double[] argument) {
+        super(cause);
+        this.argument = argument.clone();
+    }
+
+    /**
+     * Constructs an exception with specified formatted detail message and root cause.
+     * Message formatting is delegated to {@link java.text.MessageFormat}.
+     *
+     * @param cause     the exception or error that caused this exception to be thrown
+     * @param argument  the failing function argument
+     * @param pattern   format specifier
+     * @param arguments format arguments
+     * @since 1.2
+     */
+    public FunctionEvaluationException(Throwable cause,
+                                       double argument, String pattern,
+                                       Object... arguments) {
+        super(cause, pattern, arguments);
+        this.argument = new double[]{argument};
+    }
+
+    /**
+     * Constructs an exception with specified formatted detail message and root cause.
+     * Message formatting is delegated to {@link java.text.MessageFormat}.
+     *
+     * @param cause     the exception or error that caused this exception to be thrown
+     * @param argument  the failing function argument
+     * @param pattern   format specifier
+     * @param arguments format arguments
+     * @since 2.0
+     */
+    public FunctionEvaluationException(Throwable cause,
+                                       double[] argument, String pattern,
+                                       Object... arguments) {
+        super(cause, pattern, arguments);
+        this.argument = argument.clone();
+    }
+
+    /**
+     * Returns the function argument that caused this exception.
+     *
+     * @return argument that caused function evaluation to fail
+     */
+    public double[] getArgument() {
+        return argument.clone();
+    }
+
+}
diff --git a/src/org/apache/commons/math/MathConfigurationException.java b/src/org/apache/commons/math/MathConfigurationException.java
new file mode 100644
index 0000000..b1c886a
--- /dev/null
+++ b/src/org/apache/commons/math/MathConfigurationException.java
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math;
+
+import java.io.Serializable;
+
+/**
+ * Signals a configuration problem with any of the factory methods.
+ *
+ * @version $Revision: 811685 $ $Date: 2009-09-05 13:36:48 -0400 (Sat, 05 Sep 2009) $
+ */
+public class MathConfigurationException extends MathException implements Serializable {
+
+    /**
+     * Serializable version identifier
+     */
+    private static final long serialVersionUID = 5261476508226103366L;
+
+    /**
+     * Default constructor.
+     */
+    public MathConfigurationException() {
+        super();
+    }
+
+    /**
+     * Constructs an exception with specified formatted detail message.
+     * Message formatting is delegated to {@link java.text.MessageFormat}.
+     *
+     * @param pattern   format specifier
+     * @param arguments format arguments
+     * @since 1.2
+     */
+    public MathConfigurationException(String pattern, Object... arguments) {
+        super(pattern, arguments);
+    }
+
+    /**
+     * Create an exception with a given root cause.
+     *
+     * @param cause the exception or error that caused this exception to be thrown
+     */
+    public MathConfigurationException(Throwable cause) {
+        super(cause);
+    }
+
+    /**
+     * Constructs an exception with specified formatted detail message and root cause.
+     * Message formatting is delegated to {@link java.text.MessageFormat}.
+     *
+     * @param cause     the exception or error that caused this exception to be thrown
+     * @param pattern   format specifier
+     * @param arguments format arguments
+     * @since 1.2
+     */
+    public MathConfigurationException(Throwable cause, String pattern, Object... arguments) {
+        super(cause, pattern, arguments);
+    }
+
+}
diff --git a/src/org/apache/commons/math/MathException.java b/src/org/apache/commons/math/MathException.java
new file mode 100644
index 0000000..f7a9436
--- /dev/null
+++ b/src/org/apache/commons/math/MathException.java
@@ -0,0 +1,202 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math;
+
+import java.io.PrintStream;
+import java.io.PrintWriter;
+import java.text.MessageFormat;
+import java.util.Locale;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+
+/**
+ * Base class for commons-math checked exceptions.
+ * <p>
+ * Supports nesting, emulating JDK 1.4 behavior if necessary.</p>
+ * <p>
+ * Adapted from <a href="http://commons.apache.org/collections/api-release/org/apache/commons/collections/FunctorException.html"/>.</p>
+ *
+ * @version $Revision: 822850 $ $Date: 2009-10-07 14:56:42 -0400 (Wed, 07 Oct 2009) $
+ */
+public class MathException extends Exception {
+
+    /**
+     * Serializable version identifier.
+     */
+    private static final long serialVersionUID = -9004610152740737812L;
+
+    /**
+     * Pattern used to build the message.
+     */
+    private final String pattern;
+
+    /**
+     * Arguments used to build the message.
+     */
+    private final Object[] arguments;
+
+    /**
+     * Constructs a new <code>MathException</code> with no
+     * detail message.
+     */
+    public MathException() {
+        this.pattern = null;
+        this.arguments = new Object[0];
+    }
+
+    /**
+     * Constructs a new <code>MathException</code> with specified
+     * formatted detail message.
+     * Message formatting is delegated to {@link java.text.MessageFormat}.
+     *
+     * @param pattern   format specifier
+     * @param arguments format arguments
+     */
+    public MathException(String pattern, Object... arguments) {
+        this.pattern = pattern;
+        this.arguments = (arguments == null) ? new Object[0] : arguments.clone();
+    }
+
+    /**
+     * Constructs a new <code>MathException</code> with specified
+     * nested <code>Throwable</code> root cause.
+     *
+     * @param rootCause the exception or error that caused this exception
+     *                  to be thrown.
+     */
+    public MathException(Throwable rootCause) {
+        super(rootCause);
+        this.pattern = getMessage();
+        this.arguments = new Object[0];
+    }
+
+    /**
+     * Constructs a new <code>MathException</code> with specified
+     * formatted detail message and nested <code>Throwable</code> root cause.
+     * Message formatting is delegated to {@link java.text.MessageFormat}.
+     *
+     * @param rootCause the exception or error that caused this exception
+     *                  to be thrown.
+     * @param pattern   format specifier
+     * @param arguments format arguments
+     * @since 1.2
+     */
+    public MathException(Throwable rootCause, String pattern, Object... arguments) {
+        super(rootCause);
+        this.pattern = pattern;
+        this.arguments = (arguments == null) ? new Object[0] : arguments.clone();
+    }
+
+    /**
+     * Translate a string to a given locale.
+     *
+     * @param s      string to translate
+     * @param locale locale into which to translate the string
+     * @return translated string or original string
+     *         for unsupported locales or unknown strings
+     */
+    private static String translate(String s, Locale locale) {
+        try {
+            ResourceBundle bundle =
+                    ResourceBundle.getBundle("org.apache.commons.math.MessagesResources", locale);
+            if (bundle.getLocale().getLanguage().equals(locale.getLanguage())) {
+                // the value of the resource is the translated string
+                return bundle.getString(s);
+            }
+
+        } catch (MissingResourceException mre) {
+            // do nothing here
+        }
+
+        // the locale is not supported or the resource is unknown
+        // don't translate and fall back to using the string as is
+        return s;
+
+    }
+
+    /**
+     * Gets the pattern used to build the message of this throwable.
+     *
+     * @return the pattern used to build the message of this throwable
+     * @since 1.2
+     */
+    public String getPattern() {
+        return pattern;
+    }
+
+    /**
+     * Gets the arguments used to build the message of this throwable.
+     *
+     * @return the arguments used to build the message of this throwable
+     * @since 1.2
+     */
+    public Object[] getArguments() {
+        return arguments.clone();
+    }
+
+    /**
+     * Gets the message in a specified locale.
+     *
+     * @param locale Locale in which the message should be translated
+     * @return localized message
+     * @since 1.2
+     */
+    public String getMessage(final Locale locale) {
+        return (pattern == null) ? "" : new MessageFormat(translate(pattern, locale), locale).format(arguments);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public String getMessage() {
+        return getMessage(Locale.US);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public String getLocalizedMessage() {
+        return getMessage(Locale.getDefault());
+    }
+
+    /**
+     * Prints the stack trace of this exception to the standard error stream.
+     */
+    @Override
+    public void printStackTrace() {
+        printStackTrace(System.err);
+    }
+
+    /**
+     * Prints the stack trace of this exception to the specified stream.
+     *
+     * @param out the <code>PrintStream</code> to use for output
+     */
+    @Override
+    public void printStackTrace(PrintStream out) {
+        synchronized (out) {
+            PrintWriter pw = new PrintWriter(out, false);
+            printStackTrace(pw);
+            // Flush the PrintWriter before it's GC'ed.
+            pw.flush();
+        }
+    }
+
+}
diff --git a/src/org/apache/commons/math/MathRuntimeException.java b/src/org/apache/commons/math/MathRuntimeException.java
new file mode 100644
index 0000000..3029a88
--- /dev/null
+++ b/src/org/apache/commons/math/MathRuntimeException.java
@@ -0,0 +1,541 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math;
+
+import java.io.EOFException;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.io.PrintWriter;
+import java.text.MessageFormat;
+import java.text.ParseException;
+import java.util.ConcurrentModificationException;
+import java.util.Locale;
+import java.util.MissingResourceException;
+import java.util.NoSuchElementException;
+import java.util.ResourceBundle;
+
+/**
+ * Base class for commons-math unchecked exceptions.
+ *
+ * @version $Revision: 822850 $ $Date: 2009-10-07 14:56:42 -0400 (Wed, 07 Oct 2009) $
+ * @since 2.0
+ */
+public class MathRuntimeException extends RuntimeException {
+
+    /**
+     * Serializable version identifier.
+     */
+    private static final long serialVersionUID = -5128983364075381060L;
+
+    /**
+     * Pattern used to build the message.
+     */
+    private final String pattern;
+
+    /**
+     * Arguments used to build the message.
+     */
+    private final Object[] arguments;
+
+    /**
+     * Constructs a new <code>MathRuntimeException</code> with specified
+     * formatted detail message.
+     * Message formatting is delegated to {@link java.text.MessageFormat}.
+     *
+     * @param pattern   format specifier
+     * @param arguments format arguments
+     */
+    public MathRuntimeException(final String pattern, final Object... arguments) {
+        this.pattern = pattern;
+        this.arguments = (arguments == null) ? new Object[0] : arguments.clone();
+    }
+
+    /**
+     * Constructs a new <code>MathRuntimeException</code> with specified
+     * nested <code>Throwable</code> root cause.
+     *
+     * @param rootCause the exception or error that caused this exception
+     *                  to be thrown.
+     */
+    public MathRuntimeException(final Throwable rootCause) {
+        super(rootCause);
+        this.pattern = getMessage();
+        this.arguments = new Object[0];
+    }
+
+    /**
+     * Constructs a new <code>MathRuntimeException</code> with specified
+     * formatted detail message and nested <code>Throwable</code> root cause.
+     * Message formatting is delegated to {@link java.text.MessageFormat}.
+     *
+     * @param rootCause the exception or error that caused this exception
+     *                  to be thrown.
+     * @param pattern   format specifier
+     * @param arguments format arguments
+     */
+    public MathRuntimeException(final Throwable rootCause,
+                                final String pattern, final Object... arguments) {
+        super(rootCause);
+        this.pattern = pattern;
+        this.arguments = (arguments == null) ? new Object[0] : arguments.clone();
+    }
+
+    /**
+     * Translate a string to a given locale.
+     *
+     * @param s      string to translate
+     * @param locale locale into which to translate the string
+     * @return translated string or original string
+     *         for unsupported locales or unknown strings
+     */
+    private static String translate(final String s, final Locale locale) {
+        try {
+            ResourceBundle bundle =
+                    ResourceBundle.getBundle("org.apache.commons.math.MessagesResources", locale);
+            if (bundle.getLocale().getLanguage().equals(locale.getLanguage())) {
+                // the value of the resource is the translated string
+                return bundle.getString(s);
+            }
+
+        } catch (MissingResourceException mre) {
+            // do nothing here
+        }
+
+        // the locale is not supported or the resource is unknown
+        // don't translate and fall back to using the string as is
+        return s;
+
+    }
+
+    /**
+     * Builds a message string by from a pattern and its arguments.
+     *
+     * @param locale    Locale in which the message should be translated
+     * @param pattern   format specifier
+     * @param arguments format arguments
+     * @return a message string
+     */
+    private static String buildMessage(final Locale locale, final String pattern,
+                                       final Object... arguments) {
+        return (pattern == null) ? "" : new MessageFormat(translate(pattern, locale), locale).format(arguments);
+    }
+
+    /**
+     * Gets the pattern used to build the message of this throwable.
+     *
+     * @return the pattern used to build the message of this throwable
+     */
+    public String getPattern() {
+        return pattern;
+    }
+
+    /**
+     * Gets the arguments used to build the message of this throwable.
+     *
+     * @return the arguments used to build the message of this throwable
+     */
+    public Object[] getArguments() {
+        return arguments.clone();
+    }
+
+    /**
+     * Gets the message in a specified locale.
+     *
+     * @param locale Locale in which the message should be translated
+     * @return localized message
+     */
+    public String getMessage(final Locale locale) {
+        return buildMessage(locale, pattern, arguments);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public String getMessage() {
+        return getMessage(Locale.US);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public String getLocalizedMessage() {
+        return getMessage(Locale.getDefault());
+    }
+
+    /**
+     * Prints the stack trace of this exception to the standard error stream.
+     */
+    @Override
+    public void printStackTrace() {
+        printStackTrace(System.err);
+    }
+
+    /**
+     * Prints the stack trace of this exception to the specified stream.
+     *
+     * @param out the <code>PrintStream</code> to use for output
+     */
+    @Override
+    public void printStackTrace(final PrintStream out) {
+        synchronized (out) {
+            PrintWriter pw = new PrintWriter(out, false);
+            printStackTrace(pw);
+            // Flush the PrintWriter before it's GC'ed.
+            pw.flush();
+        }
+    }
+
+    /**
+     * Constructs a new <code>ArithmeticException</code> with specified formatted detail message.
+     * Message formatting is delegated to {@link java.text.MessageFormat}.
+     *
+     * @param pattern   format specifier
+     * @param arguments format arguments
+     * @return built exception
+     */
+    public static ArithmeticException createArithmeticException(final String pattern,
+                                                                final Object... arguments) {
+        return new ArithmeticException() {
+
+            /** Serializable version identifier. */
+            private static final long serialVersionUID = 7705628723242533939L;
+
+            /** {@inheritDoc} */
+            @Override
+            public String getMessage() {
+                return buildMessage(Locale.US, pattern, arguments);
+            }
+
+            /** {@inheritDoc} */
+            @Override
+            public String getLocalizedMessage() {
+                return buildMessage(Locale.getDefault(), pattern, arguments);
+            }
+
+        };
+    }
+
+    /**
+     * Constructs a new <code>ArrayIndexOutOfBoundsException</code> with specified formatted detail message.
+     * Message formatting is delegated to {@link java.text.MessageFormat}.
+     *
+     * @param pattern   format specifier
+     * @param arguments format arguments
+     * @return built exception
+     */
+    public static ArrayIndexOutOfBoundsException createArrayIndexOutOfBoundsException(final String pattern,
+                                                                                      final Object... arguments) {
+        return new ArrayIndexOutOfBoundsException() {
+
+            /** Serializable version identifier. */
+            private static final long serialVersionUID = -3394748305449283486L;
+
+            /** {@inheritDoc} */
+            @Override
+            public String getMessage() {
+                return buildMessage(Locale.US, pattern, arguments);
+            }
+
+            /** {@inheritDoc} */
+            @Override
+            public String getLocalizedMessage() {
+                return buildMessage(Locale.getDefault(), pattern, arguments);
+            }
+
+        };
+    }
+
+    /**
+     * Constructs a new <code>EOFException</code> with specified formatted detail message.
+     * Message formatting is delegated to {@link java.text.MessageFormat}.
+     *
+     * @param pattern   format specifier
+     * @param arguments format arguments
+     * @return built exception
+     */
+    public static EOFException createEOFException(final String pattern,
+                                                  final Object... arguments) {
+        return new EOFException() {
+
+            /** Serializable version identifier. */
+            private static final long serialVersionUID = 279461544586092584L;
+
+            /** {@inheritDoc} */
+            @Override
+            public String getMessage() {
+                return buildMessage(Locale.US, pattern, arguments);
+            }
+
+            /** {@inheritDoc} */
+            @Override
+            public String getLocalizedMessage() {
+                return buildMessage(Locale.getDefault(), pattern, arguments);
+            }
+
+        };
+    }
+
+    /**
+     * Constructs a new <code>IOException</code> with specified nested
+     * <code>Throwable</code> root cause.
+     * <p>This factory method allows chaining of other exceptions within an
+     * <code>IOException</code> even for Java 5. The constructor for
+     * <code>IOException</code> with a cause parameter was introduced only
+     * with Java 6.</p>
+     *
+     * @param rootCause the exception or error that caused this exception
+     *                  to be thrown.
+     * @return built exception
+     */
+    public static IOException createIOException(final Throwable rootCause) {
+        IOException ioe = new IOException(rootCause.getLocalizedMessage());
+        ioe.initCause(rootCause);
+        return ioe;
+    }
+
+    /**
+     * Constructs a new <code>IllegalArgumentException</code> with specified formatted detail message.
+     * Message formatting is delegated to {@link java.text.MessageFormat}.
+     *
+     * @param pattern   format specifier
+     * @param arguments format arguments
+     * @return built exception
+     */
+    public static IllegalArgumentException createIllegalArgumentException(final String pattern,
+                                                                          final Object... arguments) {
+        return new IllegalArgumentException() {
+
+            /** Serializable version identifier. */
+            private static final long serialVersionUID = -6555453980658317913L;
+
+            /** {@inheritDoc} */
+            @Override
+            public String getMessage() {
+                return buildMessage(Locale.US, pattern, arguments);
+            }
+
+            /** {@inheritDoc} */
+            @Override
+            public String getLocalizedMessage() {
+                return buildMessage(Locale.getDefault(), pattern, arguments);
+            }
+
+        };
+    }
+
+    /**
+     * Constructs a new <code>IllegalArgumentException</code> with specified nested
+     * <code>Throwable</code> root cause.
+     *
+     * @param rootCause the exception or error that caused this exception
+     *                  to be thrown.
+     * @return built exception
+     */
+    public static IllegalArgumentException createIllegalArgumentException(final Throwable rootCause) {
+        IllegalArgumentException iae = new IllegalArgumentException(rootCause.getLocalizedMessage());
+        iae.initCause(rootCause);
+        return iae;
+    }
+
+    /**
+     * Constructs a new <code>IllegalStateException</code> with specified formatted detail message.
+     * Message formatting is delegated to {@link java.text.MessageFormat}.
+     *
+     * @param pattern   format specifier
+     * @param arguments format arguments
+     * @return built exception
+     */
+    public static IllegalStateException createIllegalStateException(final String pattern,
+                                                                    final Object... arguments) {
+        return new IllegalStateException() {
+
+            /** Serializable version identifier. */
+            private static final long serialVersionUID = -95247648156277208L;
+
+            /** {@inheritDoc} */
+            @Override
+            public String getMessage() {
+                return buildMessage(Locale.US, pattern, arguments);
+            }
+
+            /** {@inheritDoc} */
+            @Override
+            public String getLocalizedMessage() {
+                return buildMessage(Locale.getDefault(), pattern, arguments);
+            }
+
+        };
+    }
+
+    /**
+     * Constructs a new <code>ConcurrentModificationException</code> with specified formatted detail message.
+     * Message formatting is delegated to {@link java.text.MessageFormat}.
+     *
+     * @param pattern   format specifier
+     * @param arguments format arguments
+     * @return built exception
+     */
+    public static ConcurrentModificationException createConcurrentModificationException(final String pattern,
+                                                                                        final Object... arguments) {
+        return new ConcurrentModificationException() {
+
+            /** Serializable version identifier. */
+            private static final long serialVersionUID = 6134247282754009421L;
+
+            /** {@inheritDoc} */
+            @Override
+            public String getMessage() {
+                return buildMessage(Locale.US, pattern, arguments);
+            }
+
+            /** {@inheritDoc} */
+            @Override
+            public String getLocalizedMessage() {
+                return buildMessage(Locale.getDefault(), pattern, arguments);
+            }
+
+        };
+    }
+
+    /**
+     * Constructs a new <code>NoSuchElementException</code> with specified formatted detail message.
+     * Message formatting is delegated to {@link java.text.MessageFormat}.
+     *
+     * @param pattern   format specifier
+     * @param arguments format arguments
+     * @return built exception
+     */
+    public static NoSuchElementException createNoSuchElementException(final String pattern,
+                                                                      final Object... arguments) {
+        return new NoSuchElementException() {
+
+            /** Serializable version identifier. */
+            private static final long serialVersionUID = 7304273322489425799L;
+
+            /** {@inheritDoc} */
+            @Override
+            public String getMessage() {
+                return buildMessage(Locale.US, pattern, arguments);
+            }
+
+            /** {@inheritDoc} */
+            @Override
+            public String getLocalizedMessage() {
+                return buildMessage(Locale.getDefault(), pattern, arguments);
+            }
+
+        };
+    }
+
+    /**
+     * Constructs a new <code>NullPointerException</code> with specified formatted detail message.
+     * Message formatting is delegated to {@link java.text.MessageFormat}.
+     *
+     * @param pattern   format specifier
+     * @param arguments format arguments
+     * @return built exception
+     */
+    public static NullPointerException createNullPointerException(final String pattern,
+                                                                  final Object... arguments) {
+        return new NullPointerException() {
+
+            /** Serializable version identifier. */
+            private static final long serialVersionUID = -3075660477939965216L;
+
+            /** {@inheritDoc} */
+            @Override
+            public String getMessage() {
+                return buildMessage(Locale.US, pattern, arguments);
+            }
+
+            /** {@inheritDoc} */
+            @Override
+            public String getLocalizedMessage() {
+                return buildMessage(Locale.getDefault(), pattern, arguments);
+            }
+
+        };
+    }
+
+    /**
+     * Constructs a new <code>ParseException</code> with specified
+     * formatted detail message.
+     * Message formatting is delegated to {@link java.text.MessageFormat}.
+     *
+     * @param offset    offset at which error occurred
+     * @param pattern   format specifier
+     * @param arguments format arguments
+     * @return built exception
+     */
+    public static ParseException createParseException(final int offset,
+                                                      final String pattern,
+                                                      final Object... arguments) {
+        return new ParseException(null, offset) {
+
+            /** Serializable version identifier. */
+            private static final long serialVersionUID = -1103502177342465975L;
+
+            /** {@inheritDoc} */
+            @Override
+            public String getMessage() {
+                return buildMessage(Locale.US, pattern, arguments);
+            }
+
+            /** {@inheritDoc} */
+            @Override
+            public String getLocalizedMessage() {
+                return buildMessage(Locale.getDefault(), pattern, arguments);
+            }
+
+        };
+    }
+
+    /**
+     * Create an {@link java.lang.RuntimeException} for an internal error.
+     *
+     * @param cause underlying cause
+     * @return an {@link java.lang.RuntimeException} for an internal error
+     */
+    public static RuntimeException createInternalError(final Throwable cause) {
+
+        final String pattern = "internal error, please fill a bug report at {0}";
+        final String argument = "https://issues.apache.org/jira/browse/MATH";
+
+        return new RuntimeException() {
+
+            /** Serializable version identifier. */
+            private static final long serialVersionUID = -201865440834027016L;
+
+            /** {@inheritDoc} */
+            @Override
+            public String getMessage() {
+                return buildMessage(Locale.US, pattern, argument);
+            }
+
+            /** {@inheritDoc} */
+            @Override
+            public String getLocalizedMessage() {
+                return buildMessage(Locale.getDefault(), pattern, argument);
+            }
+
+        };
+
+    }
+
+}
diff --git a/src/org/apache/commons/math/MaxEvaluationsExceededException.java b/src/org/apache/commons/math/MaxEvaluationsExceededException.java
new file mode 100644
index 0000000..accf08a
--- /dev/null
+++ b/src/org/apache/commons/math/MaxEvaluationsExceededException.java
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.math;
+
+import org.apache.commons.math.ConvergenceException;
+
+/**
+ * Error thrown when a numerical computation exceeds its allowed
+ * number of functions evaluations.
+ *
+ * @version $Revision: 779273 $ $Date: 2009-05-27 14:54:48 -0400 (Wed, 27 May 2009) $
+ * @since 2.0
+ */
+public class MaxEvaluationsExceededException extends ConvergenceException {
+
+    /**
+     * Serializable version identifier.
+     */
+    private static final long serialVersionUID = -5921271447220129118L;
+
+    /**
+     * Maximal number of evaluations allowed.
+     */
+    private final int maxEvaluations;
+
+    /**
+     * Constructs an exception with specified formatted detail message.
+     * Message formatting is delegated to {@link java.text.MessageFormat}.
+     *
+     * @param maxEvaluations maximal number of evaluations allowed
+     */
+    public MaxEvaluationsExceededException(final int maxEvaluations) {
+        super("Maximal number of evaluations ({0}) exceeded", maxEvaluations);
+        this.maxEvaluations = maxEvaluations;
+    }
+
+    /**
+     * Constructs an exception with specified formatted detail message.
+     * Message formatting is delegated to {@link java.text.MessageFormat}.
+     *
+     * @param maxEvaluations the exceeded maximal number of evaluations
+     * @param pattern        format specifier
+     * @param arguments      format arguments
+     */
+    public MaxEvaluationsExceededException(final int maxEvaluations,
+                                           final String pattern, final Object... arguments) {
+        super(pattern, arguments);
+        this.maxEvaluations = maxEvaluations;
+    }
+
+    /**
+     * Get the maximal number of evaluations allowed.
+     *
+     * @return maximal number of evaluations allowed
+     */
+    public int getMaxEvaluations() {
+        return maxEvaluations;
+    }
+
+}
diff --git a/src/org/apache/commons/math/MaxIterationsExceededException.java b/src/org/apache/commons/math/MaxIterationsExceededException.java
new file mode 100644
index 0000000..aa60110
--- /dev/null
+++ b/src/org/apache/commons/math/MaxIterationsExceededException.java
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.math;
+
+import org.apache.commons.math.ConvergenceException;
+
+/**
+ * Error thrown when a numerical computation exceeds its allowed
+ * number of iterations.
+ *
+ * @version $Revision: 746578 $ $Date: 2009-02-21 15:01:14 -0500 (Sat, 21 Feb 2009) $
+ * @since 1.2
+ */
+public class MaxIterationsExceededException extends ConvergenceException {
+
+    /**
+     * Serializable version identifier.
+     */
+    private static final long serialVersionUID = -7821226672760574694L;
+
+    /**
+     * Maximal number of iterations allowed.
+     */
+    private final int maxIterations;
+
+    /**
+     * Constructs an exception with specified formatted detail message.
+     * Message formatting is delegated to {@link java.text.MessageFormat}.
+     *
+     * @param maxIterations maximal number of iterations allowed
+     */
+    public MaxIterationsExceededException(final int maxIterations) {
+        super("Maximal number of iterations ({0}) exceeded", maxIterations);
+        this.maxIterations = maxIterations;
+    }
+
+    /**
+     * Constructs an exception with specified formatted detail message.
+     * Message formatting is delegated to {@link java.text.MessageFormat}.
+     *
+     * @param maxIterations the exceeded maximal number of iterations
+     * @param pattern       format specifier
+     * @param arguments     format arguments
+     */
+    public MaxIterationsExceededException(final int maxIterations,
+                                          final String pattern, final Object... arguments) {
+        super(pattern, arguments);
+        this.maxIterations = maxIterations;
+    }
+
+    /**
+     * Get the maximal number of iterations allowed.
+     *
+     * @return maximal number of iterations allowed
+     */
+    public int getMaxIterations() {
+        return maxIterations;
+    }
+
+}
diff --git a/src/org/apache/commons/math/analysis/BinaryFunction.java b/src/org/apache/commons/math/analysis/BinaryFunction.java
new file mode 100644
index 0000000..656b22a
--- /dev/null
+++ b/src/org/apache/commons/math/analysis/BinaryFunction.java
@@ -0,0 +1,134 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.math.analysis;
+
+import org.apache.commons.math.FunctionEvaluationException;
+
+
+/**
+ * Base class for {@link BivariateRealFunction} that can be composed with other functions.
+ *
+ * @version $Revision: 924453 $ $Date: 2010-03-17 16:05:20 -0400 (Wed, 17 Mar 2010) $
+ * @since 2.1
+ */
+public abstract class BinaryFunction implements BivariateRealFunction {
+
+    /**
+     * The + operator method wrapped as a {@link BinaryFunction}.
+     */
+    public static final BinaryFunction ADD = new BinaryFunction() {
+        /** {@inheritDoc} */
+        @Override
+        public double value(double x, double y) {
+            return x + y;
+        }
+    };
+
+    /**
+     * The - operator method wrapped as a {@link BinaryFunction}.
+     */
+    public static final BinaryFunction SUBTRACT = new BinaryFunction() {
+        /** {@inheritDoc} */
+        @Override
+        public double value(double x, double y) {
+            return x - y;
+        }
+    };
+
+    /**
+     * The * operator method wrapped as a {@link BinaryFunction}.
+     */
+    public static final BinaryFunction MULTIPLY = new BinaryFunction() {
+        /** {@inheritDoc} */
+        @Override
+        public double value(double x, double y) {
+            return x * y;
+        }
+    };
+
+    /**
+     * The / operator method wrapped as a {@link BinaryFunction}.
+     */
+    public static final BinaryFunction DIVIDE = new BinaryFunction() {
+        /** {@inheritDoc} */
+        @Override
+        public double value(double x, double y) {
+            return x / y;
+        }
+    };
+
+    /**
+     * The {@code Math.pow} method wrapped as a {@link BinaryFunction}.
+     */
+    public static final BinaryFunction POW = new BinaryFunction() {
+        /** {@inheritDoc} */
+        @Override
+        public double value(double x, double y) {
+            return Math.pow(x, y);
+        }
+    };
+
+    /**
+     * The {@code Math.atan2} method wrapped as a {@link BinaryFunction}.
+     */
+    public static final BinaryFunction ATAN2 = new BinaryFunction() {
+        /** {@inheritDoc} */
+        @Override
+        public double value(double x, double y) {
+            return Math.atan2(x, y);
+        }
+    };
+
+    /**
+     * {@inheritDoc}
+     */
+    public abstract double value(double x, double y) throws FunctionEvaluationException;
+
+    /**
+     * Get a composable function by fixing the first argument of the instance.
+     *
+     * @param fixedX fixed value of the first argument
+     * @return a function such that {@code f.value(y) == value(fixedX, y)}
+     */
+    public ComposableFunction fix1stArgument(final double fixedX) {
+        return new ComposableFunction() {
+            @Override
+            /** {@inheritDoc} */
+            public double value(double x) throws FunctionEvaluationException {
+                return BinaryFunction.this.value(fixedX, x);
+            }
+        };
+    }
+
+    /**
+     * Get a composable function by fixing the second argument of the instance.
+     *
+     * @param fixedY fixed value of the second argument
+     * @return a function such that {@code f.value(x) == value(x, fixedY)}
+     */
+    public ComposableFunction fix2ndArgument(final double fixedY) {
+        return new ComposableFunction() {
+            @Override
+            /** {@inheritDoc} */
+            public double value(double x) throws FunctionEvaluationException {
+                return BinaryFunction.this.value(x, fixedY);
+            }
+        };
+    }
+
+}
diff --git a/src/org/apache/commons/math/analysis/BivariateRealFunction.java b/src/org/apache/commons/math/analysis/BivariateRealFunction.java
new file mode 100644
index 0000000..1a71acb
--- /dev/null
+++ b/src/org/apache/commons/math/analysis/BivariateRealFunction.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.math.analysis;
+
+import org.apache.commons.math.FunctionEvaluationException;
+
+
+/**
+ * An interface representing a bivariate real function.
+ *
+ * @version $Revision: 924453 $ $Date: 2010-03-17 16:05:20 -0400 (Wed, 17 Mar 2010) $
+ * @since 2.1
+ */
+public interface BivariateRealFunction {
+
+    /**
+     * Compute the value for the function.
+     *
+     * @param x abscissa for which the function value should be computed
+     * @param y ordinate for which the function value should be computed
+     * @return the value
+     * @throws FunctionEvaluationException if the function evaluation fails
+     */
+    double value(double x, double y) throws FunctionEvaluationException;
+
+}
diff --git a/src/org/apache/commons/math/analysis/ComposableFunction.java b/src/org/apache/commons/math/analysis/ComposableFunction.java
new file mode 100644
index 0000000..179f6d9
--- /dev/null
+++ b/src/org/apache/commons/math/analysis/ComposableFunction.java
@@ -0,0 +1,577 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.math.analysis;
+
+import org.apache.commons.math.FunctionEvaluationException;
+
+
+/**
+ * Base class for {@link UnivariateRealFunction} that can be composed with other functions.
+ *
+ * @version $Revision: 924453 $ $Date: 2010-03-17 16:05:20 -0400 (Wed, 17 Mar 2010) $
+ * @since 2.1
+ */
+public abstract class ComposableFunction implements UnivariateRealFunction {
+
+    /**
+     * The constant function always returning 0.
+     */
+    public static final ComposableFunction ZERO = new ComposableFunction() {
+        /** {@inheritDoc} */
+        @Override
+        public double value(double d) {
+            return 0;
+        }
+    };
+
+    /**
+     * The constant function always returning 1.
+     */
+    public static final ComposableFunction ONE = new ComposableFunction() {
+        /** {@inheritDoc} */
+        @Override
+        public double value(double d) {
+            return 1;
+        }
+    };
+
+    /**
+     * The identity function.
+     */
+    public static final ComposableFunction IDENTITY = new ComposableFunction() {
+        /** {@inheritDoc} */
+        @Override
+        public double value(double d) {
+            return d;
+        }
+    };
+
+    /**
+     * The {@code Math.abs} method wrapped as a {@link ComposableFunction}.
+     */
+    public static final ComposableFunction ABS = new ComposableFunction() {
+        /** {@inheritDoc} */
+        @Override
+        public double value(double d) {
+            return Math.abs(d);
+        }
+    };
+
+    /**
+     * The - operator wrapped as a {@link ComposableFunction}.
+     */
+    public static final ComposableFunction NEGATE = new ComposableFunction() {
+        /** {@inheritDoc} */
+        @Override
+        public double value(double d) {
+            return -d;
+        }
+    };
+
+    /**
+     * The invert operator wrapped as a {@link ComposableFunction}.
+     */
+    public static final ComposableFunction INVERT = new ComposableFunction() {
+        /** {@inheritDoc} */
+        @Override
+        public double value(double d) {
+            return 1 / d;
+        }
+    };
+
+    /**
+     * The {@code Math.sin} method wrapped as a {@link ComposableFunction}.
+     */
+    public static final ComposableFunction SIN = new ComposableFunction() {
+        /** {@inheritDoc} */
+        @Override
+        public double value(double d) {
+            return Math.sin(d);
+        }
+    };
+
+    /**
+     * The {@code Math.sqrt} method wrapped as a {@link ComposableFunction}.
+     */
+    public static final ComposableFunction SQRT = new ComposableFunction() {
+        /** {@inheritDoc} */
+        @Override
+        public double value(double d) {
+            return Math.sqrt(d);
+        }
+    };
+
+    /**
+     * The {@code Math.sinh} method wrapped as a {@link ComposableFunction}.
+     */
+    public static final ComposableFunction SINH = new ComposableFunction() {
+        /** {@inheritDoc} */
+        @Override
+        public double value(double d) {
+            return Math.sinh(d);
+        }
+    };
+
+    /**
+     * The {@code Math.exp} method wrapped as a {@link ComposableFunction}.
+     */
+    public static final ComposableFunction EXP = new ComposableFunction() {
+        /** {@inheritDoc} */
+        @Override
+        public double value(double d) {
+            return Math.exp(d);
+        }
+    };
+
+    /**
+     * The {@code Math.expm1} method wrapped as a {@link ComposableFunction}.
+     */
+    public static final ComposableFunction EXPM1 = new ComposableFunction() {
+        /** {@inheritDoc} */
+        @Override
+        public double value(double d) {
+            return Math.expm1(d);
+        }
+    };
+
+    /**
+     * The {@code Math.asin} method wrapped as a {@link ComposableFunction}.
+     */
+    public static final ComposableFunction ASIN = new ComposableFunction() {
+        /** {@inheritDoc} */
+        @Override
+        public double value(double d) {
+            return Math.asin(d);
+        }
+    };
+
+    /**
+     * The {@code Math.atan} method wrapped as a {@link ComposableFunction}.
+     */
+    public static final ComposableFunction ATAN = new ComposableFunction() {
+        /** {@inheritDoc} */
+        @Override
+        public double value(double d) {
+            return Math.atan(d);
+        }
+    };
+
+    /**
+     * The {@code Math.tan} method wrapped as a {@link ComposableFunction}.
+     */
+    public static final ComposableFunction TAN = new ComposableFunction() {
+        /** {@inheritDoc} */
+        @Override
+        public double value(double d) {
+            return Math.tan(d);
+        }
+    };
+
+    /**
+     * The {@code Math.tanh} method wrapped as a {@link ComposableFunction}.
+     */
+    public static final ComposableFunction TANH = new ComposableFunction() {
+        /** {@inheritDoc} */
+        @Override
+        public double value(double d) {
+            return Math.tanh(d);
+        }
+    };
+
+    /**
+     * The {@code Math.cbrt} method wrapped as a {@link ComposableFunction}.
+     */
+    public static final ComposableFunction CBRT = new ComposableFunction() {
+        /** {@inheritDoc} */
+        @Override
+        public double value(double d) {
+            return Math.cbrt(d);
+        }
+    };
+
+    /**
+     * The {@code Math.ceil} method wrapped as a {@link ComposableFunction}.
+     */
+    public static final ComposableFunction CEIL = new ComposableFunction() {
+        /** {@inheritDoc} */
+        @Override
+        public double value(double d) {
+            return Math.ceil(d);
+        }
+    };
+
+    /**
+     * The {@code Math.floor} method wrapped as a {@link ComposableFunction}.
+     */
+    public static final ComposableFunction FLOOR = new ComposableFunction() {
+        /** {@inheritDoc} */
+        @Override
+        public double value(double d) {
+            return Math.floor(d);
+        }
+    };
+
+    /**
+     * The {@code Math.log} method wrapped as a {@link ComposableFunction}.
+     */
+    public static final ComposableFunction LOG = new ComposableFunction() {
+        /** {@inheritDoc} */
+        @Override
+        public double value(double d) {
+            return Math.log(d);
+        }
+    };
+
+    /**
+     * The {@code Math.log10} method wrapped as a {@link ComposableFunction}.
+     */
+    public static final ComposableFunction LOG10 = new ComposableFunction() {
+        /** {@inheritDoc} */
+        @Override
+        public double value(double d) {
+            return Math.log10(d);
+        }
+    };
+
+    /**
+     * The {@code Math.log1p} method wrapped as a {@link ComposableFunction}.
+     */
+    public static final ComposableFunction LOG1P = new ComposableFunction() {
+        @Override
+        public double value(double d) {
+            return Math.log1p(d);
+        }
+    };
+
+    /**
+     * The {@code Math.cos} method wrapped as a {@link ComposableFunction}.
+     */
+    public static final ComposableFunction COS = new ComposableFunction() {
+        /** {@inheritDoc} */
+        @Override
+        public double value(double d) {
+            return Math.cos(d);
+        }
+    };
+
+    /**
+     * The {@code Math.abs} method wrapped as a {@link ComposableFunction}.
+     */
+    public static final ComposableFunction ACOS = new ComposableFunction() {
+        /** {@inheritDoc} */
+        @Override
+        public double value(double d) {
+            return Math.acos(d);
+        }
+    };
+
+    /**
+     * The {@code Math.cosh} method wrapped as a {@link ComposableFunction}.
+     */
+    public static final ComposableFunction COSH = new ComposableFunction() {
+        /** {@inheritDoc} */
+        @Override
+        public double value(double d) {
+            return Math.cosh(d);
+        }
+    };
+
+    /**
+     * The {@code Math.rint} method wrapped as a {@link ComposableFunction}.
+     */
+    public static final ComposableFunction RINT = new ComposableFunction() {
+        /** {@inheritDoc} */
+        @Override
+        public double value(double d) {
+            return Math.rint(d);
+        }
+    };
+
+    /**
+     * The {@code Math.signum} method wrapped as a {@link ComposableFunction}.
+     */
+    public static final ComposableFunction SIGNUM = new ComposableFunction() {
+        /** {@inheritDoc} */
+        @Override
+        public double value(double d) {
+            return Math.signum(d);
+        }
+    };
+
+    /**
+     * The {@code Math.ulp} method wrapped as a {@link ComposableFunction}.
+     */
+    public static final ComposableFunction ULP = new ComposableFunction() {
+        /** {@inheritDoc} */
+        @Override
+        public double value(double d) {
+            return Math.ulp(d);
+        }
+    };
+
+    /**
+     * Precompose the instance with another function.
+     * <p>
+     * The composed function h created by {@code h = g.of(f)} is such
+     * that {@code h.value(x) == g.value(f.value(x))} for all x.
+     * </p>
+     *
+     * @param f function to compose with
+     * @return a new function which computes {@code this.value(f.value(x))}
+     * @see #postCompose(UnivariateRealFunction)
+     */
+    public ComposableFunction of(final UnivariateRealFunction f) {
+        return new ComposableFunction() {
+            @Override
+            /** {@inheritDoc} */
+            public double value(double x) throws FunctionEvaluationException {
+                return ComposableFunction.this.value(f.value(x));
+            }
+        };
+    }
+
+    /**
+     * Postcompose the instance with another function.
+     * <p>
+     * The composed function h created by {@code h = g.postCompose(f)} is such
+     * that {@code h.value(x) == f.value(g.value(x))} for all x.
+     * </p>
+     *
+     * @param f function to compose with
+     * @return a new function which computes {@code f.value(this.value(x))}
+     * @see #of(UnivariateRealFunction)
+     */
+    public ComposableFunction postCompose(final UnivariateRealFunction f) {
+        return new ComposableFunction() {
+            @Override
+            /** {@inheritDoc} */
+            public double value(double x) throws FunctionEvaluationException {
+                return f.value(ComposableFunction.this.value(x));
+            }
+        };
+    }
+
+    /**
+     * Return a function combining the instance and another function.
+     * <p>
+     * The function h created by {@code h = g.combine(f, combiner)} is such that
+     * {@code h.value(x) == combiner.value(g.value(x), f.value(x))} for all x.
+     * </p>
+     *
+     * @param f        function to combine with the instance
+     * @param combiner bivariate function used for combining
+     * @return a new function which computes {@code combine.value(this.value(x), f.value(x))}
+     */
+    public ComposableFunction combine(final UnivariateRealFunction f,
+                                      final BivariateRealFunction combiner) {
+        return new ComposableFunction() {
+            @Override
+            /** {@inheritDoc} */
+            public double value(double x) throws FunctionEvaluationException {
+                return combiner.value(ComposableFunction.this.value(x), f.value(x));
+            }
+        };
+    }
+
+    /**
+     * Return a function adding the instance and another function.
+     *
+     * @param f function to combine with the instance
+     * @return a new function which computes {@code this.value(x) + f.value(x)}
+     */
+    public ComposableFunction add(final UnivariateRealFunction f) {
+        return new ComposableFunction() {
+            @Override
+            /** {@inheritDoc} */
+            public double value(double x) throws FunctionEvaluationException {
+                return ComposableFunction.this.value(x) + f.value(x);
+            }
+        };
+    }
+
+    /**
+     * Return a function adding a constant term to the instance.
+     *
+     * @param a term to add
+     * @return a new function which computes {@code this.value(x) + a}
+     */
+    public ComposableFunction add(final double a) {
+        return new ComposableFunction() {
+            @Override
+            /** {@inheritDoc} */
+            public double value(double x) throws FunctionEvaluationException {
+                return ComposableFunction.this.value(x) + a;
+            }
+        };
+    }
+
+    /**
+     * Return a function subtracting another function from the instance.
+     *
+     * @param f function to combine with the instance
+     * @return a new function which computes {@code this.value(x) - f.value(x)}
+     */
+    public ComposableFunction subtract(final UnivariateRealFunction f) {
+        return new ComposableFunction() {
+            @Override
+            /** {@inheritDoc} */
+            public double value(double x) throws FunctionEvaluationException {
+                return ComposableFunction.this.value(x) - f.value(x);
+            }
+        };
+    }
+
+    /**
+     * Return a function multiplying the instance and another function.
+     *
+     * @param f function to combine with the instance
+     * @return a new function which computes {@code this.value(x) * f.value(x)}
+     */
+    public ComposableFunction multiply(final UnivariateRealFunction f) {
+        return new ComposableFunction() {
+            @Override
+            /** {@inheritDoc} */
+            public double value(double x) throws FunctionEvaluationException {
+                return ComposableFunction.this.value(x) * f.value(x);
+            }
+        };
+    }
+
+    /**
+     * Return a function scaling the instance by a constant factor.
+     *
+     * @param scaleFactor constant scaling factor
+     * @return a new function which computes {@code this.value(x) * scaleFactor}
+     */
+    public ComposableFunction multiply(final double scaleFactor) {
+        return new ComposableFunction() {
+            @Override
+            /** {@inheritDoc} */
+            public double value(double x) throws FunctionEvaluationException {
+                return ComposableFunction.this.value(x) * scaleFactor;
+            }
+        };
+    }
+
+    /**
+     * Return a function dividing the instance by another function.
+     *
+     * @param f function to combine with the instance
+     * @return a new function which computes {@code this.value(x) / f.value(x)}
+     */
+    public ComposableFunction divide(final UnivariateRealFunction f) {
+        return new ComposableFunction() {
+            @Override
+            /** {@inheritDoc} */
+            public double value(double x) throws FunctionEvaluationException {
+                return ComposableFunction.this.value(x) / f.value(x);
+            }
+        };
+    }
+
+    /**
+     * Generates a function that iteratively apply instance function on all
+     * elements of an array.
+     * <p>
+     * The generated function behaves as follows:
+     * <ul>
+     * <li>initialize result = initialValue</li>
+     * <li>iterate: {@code result = combiner.value(result,
+     * this.value(nextMultivariateEntry));}</li>
+     * <li>return result</li>
+     * </ul>
+     * </p>
+     *
+     * @param combiner     combiner to use between entries
+     * @param initialValue initial value to use before first entry
+     * @return a new function that iteratively applie instance function on all
+     *         elements of an array.
+     */
+    public MultivariateRealFunction asCollector(final BivariateRealFunction combiner,
+                                                final double initialValue) {
+        return new MultivariateRealFunction() {
+            /** {@inheritDoc} */
+            public double value(double[] point)
+                    throws FunctionEvaluationException, IllegalArgumentException {
+                double result = initialValue;
+                for (final double entry : point) {
+                    result = combiner.value(result, ComposableFunction.this.value(entry));
+                }
+                return result;
+            }
+        };
+    }
+
+    /**
+     * Generates a function that iteratively apply instance function on all
+     * elements of an array.
+     * <p>
+     * Calling this method is equivalent to call {@link
+     * #asCollector(BivariateRealFunction, double) asCollector(BivariateRealFunction, 0.0)}.
+     * </p>
+     *
+     * @param combiner combiner to use between entries
+     * @return a new function that iteratively applie instance function on all
+     *         elements of an array.
+     * @see #asCollector(BivariateRealFunction, double)
+     */
+    public MultivariateRealFunction asCollector(final BivariateRealFunction combiner) {
+        return asCollector(combiner, 0.0);
+    }
+
+    /**
+     * Generates a function that iteratively apply instance function on all
+     * elements of an array.
+     * <p>
+     * Calling this method is equivalent to call {@link
+     * #asCollector(BivariateRealFunction, double) asCollector(BinaryFunction.ADD, initialValue)}.
+     * </p>
+     *
+     * @param initialValue initial value to use before first entry
+     * @return a new function that iteratively applie instance function on all
+     *         elements of an array.
+     * @see #asCollector(BivariateRealFunction, double)
+     * @see BinaryFunction#ADD
+     */
+    public MultivariateRealFunction asCollector(final double initialValue) {
+        return asCollector(BinaryFunction.ADD, initialValue);
+    }
+
+    /**
+     * Generates a function that iteratively apply instance function on all
+     * elements of an array.
+     * <p>
+     * Calling this method is equivalent to call {@link
+     * #asCollector(BivariateRealFunction, double) asCollector(BinaryFunction.ADD, 0.0)}.
+     * </p>
+     *
+     * @return a new function that iteratively applie instance function on all
+     *         elements of an array.
+     * @see #asCollector(BivariateRealFunction, double)
+     * @see BinaryFunction#ADD
+     */
+    public MultivariateRealFunction asCollector() {
+        return asCollector(BinaryFunction.ADD, 0.0);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public abstract double value(double x) throws FunctionEvaluationException;
+
+}
diff --git a/src/org/apache/commons/math/analysis/DifferentiableUnivariateRealFunction.java b/src/org/apache/commons/math/analysis/DifferentiableUnivariateRealFunction.java
new file mode 100644
index 0000000..2b5fa1d
--- /dev/null
+++ b/src/org/apache/commons/math/analysis/DifferentiableUnivariateRealFunction.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.analysis;
+
+/**
+ * Extension of {@link UnivariateRealFunction} representing a differentiable univariate real function.
+ *
+ * @version $Revision: 811786 $ $Date: 2009-09-06 05:36:08 -0400 (Sun, 06 Sep 2009) $
+ */
+public interface DifferentiableUnivariateRealFunction
+        extends UnivariateRealFunction {
+
+    /**
+     * Returns the derivative of the function
+     *
+     * @return the derivative function
+     */
+    UnivariateRealFunction derivative();
+
+}
diff --git a/src/org/apache/commons/math/analysis/MultivariateRealFunction.java b/src/org/apache/commons/math/analysis/MultivariateRealFunction.java
new file mode 100644
index 0000000..3b3da04
--- /dev/null
+++ b/src/org/apache/commons/math/analysis/MultivariateRealFunction.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.math.analysis;
+
+import org.apache.commons.math.FunctionEvaluationException;
+
+/**
+ * An interface representing a multivariate real function.
+ *
+ * @version $Revision: 811685 $ $Date: 2009-09-05 13:36:48 -0400 (Sat, 05 Sep 2009) $
+ * @since 2.0
+ */
+public interface MultivariateRealFunction {
+
+    /**
+     * Compute the value for the function at the given point.
+     *
+     * @param point point at which the function must be evaluated
+     * @return function value for the given point
+     * @throws FunctionEvaluationException if the function evaluation fails
+     * @throws IllegalArgumentException    if points dimension is wrong
+     */
+    double value(double[] point)
+            throws FunctionEvaluationException, IllegalArgumentException;
+
+}
diff --git a/src/org/apache/commons/math/analysis/UnivariateRealFunction.java b/src/org/apache/commons/math/analysis/UnivariateRealFunction.java
new file mode 100644
index 0000000..be2701c
--- /dev/null
+++ b/src/org/apache/commons/math/analysis/UnivariateRealFunction.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.analysis;
+
+import org.apache.commons.math.FunctionEvaluationException;
+
+/**
+ * An interface representing a univariate real function.
+ *
+ * @version $Revision: 811786 $ $Date: 2009-09-06 05:36:08 -0400 (Sun, 06 Sep 2009) $
+ */
+public interface UnivariateRealFunction {
+
+    /**
+     * Compute the value for the function.
+     *
+     * @param x the point for which the function value should be computed
+     * @return the value
+     * @throws FunctionEvaluationException if the function evaluation fails
+     */
+    double value(double x) throws FunctionEvaluationException;
+
+}
diff --git a/src/org/apache/commons/math/analysis/integration/RombergIntegrator.java b/src/org/apache/commons/math/analysis/integration/RombergIntegrator.java
new file mode 100644
index 0000000..e6b5c29
--- /dev/null
+++ b/src/org/apache/commons/math/analysis/integration/RombergIntegrator.java
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.analysis.integration;
+
+import org.apache.commons.math.FunctionEvaluationException;
+import org.apache.commons.math.MathRuntimeException;
+import org.apache.commons.math.MaxIterationsExceededException;
+import org.apache.commons.math.analysis.UnivariateRealFunction;
+
+/**
+ * Implements the <a href="http://mathworld.wolfram.com/RombergIntegration.html">
+ * Romberg Algorithm</a> for integration of real univariate functions. For
+ * reference, see <b>Introduction to Numerical Analysis</b>, ISBN 038795452X,
+ * chapter 3.
+ * <p>
+ * Romberg integration employs k successive refinements of the trapezoid
+ * rule to remove error terms less than order O(N^(-2k)). Simpson's rule
+ * is a special case of k = 2.</p>
+ *
+ * @version $Revision: 824822 $ $Date: 2009-10-13 11:56:51 -0400 (Tue, 13 Oct 2009) $
+ * @since 1.2
+ */
+public class RombergIntegrator extends UnivariateRealIntegratorImpl {
+
+    /**
+     * Construct an integrator for the given function.
+     *
+     * @param f function to integrate
+     * @deprecated as of 2.0 the integrand function is passed as an argument
+     *             to the {@link #integrate(UnivariateRealFunction, double, double)}method.
+     */
+    @Deprecated
+    public RombergIntegrator(UnivariateRealFunction f) {
+        super(f, 32);
+    }
+
+    /**
+     * Construct an integrator.
+     */
+    public RombergIntegrator() {
+        super(32);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Deprecated
+    public double integrate(final double min, final double max)
+            throws MaxIterationsExceededException, FunctionEvaluationException, IllegalArgumentException {
+        return integrate(f, min, max);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public double integrate(final UnivariateRealFunction f,
+                            final double min, final double max)
+            throws MaxIterationsExceededException, FunctionEvaluationException, IllegalArgumentException {
+
+        final int m = maximalIterationCount + 1;
+        double previousRow[] = new double[m];
+        double currentRow[] = new double[m];
+
+        clearResult();
+        verifyInterval(min, max);
+        verifyIterationCount();
+
+        TrapezoidIntegrator qtrap = new TrapezoidIntegrator();
+        currentRow[0] = qtrap.stage(f, min, max, 0);
+        double olds = currentRow[0];
+        for (int i = 1; i <= maximalIterationCount; ++i) {
+
+            // switch rows
+            final double[] tmpRow = previousRow;
+            previousRow = currentRow;
+            currentRow = tmpRow;
+
+            currentRow[0] = qtrap.stage(f, min, max, i);
+            for (int j = 1; j <= i; j++) {
+                // Richardson extrapolation coefficient
+                final double r = (1L << (2 * j)) - 1;
+                final double tIJm1 = currentRow[j - 1];
+                currentRow[j] = tIJm1 + (tIJm1 - previousRow[j - 1]) / r;
+            }
+            final double s = currentRow[i];
+            if (i >= minimalIterationCount) {
+                final double delta = Math.abs(s - olds);
+                final double rLimit = relativeAccuracy * (Math.abs(olds) + Math.abs(s)) * 0.5;
+                if ((delta <= rLimit) || (delta <= absoluteAccuracy)) {
+                    setResult(s, i);
+                    return result;
+                }
+            }
+            olds = s;
+        }
+        throw new MaxIterationsExceededException(maximalIterationCount);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected void verifyIterationCount() throws IllegalArgumentException {
+        super.verifyIterationCount();
+        // at most 32 bisection refinements due to higher order divider
+        if (maximalIterationCount > 32) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "invalid iteration limits: min={0}, max={1}",
+                    0, 32);
+        }
+    }
+}
diff --git a/src/org/apache/commons/math/analysis/integration/TrapezoidIntegrator.java b/src/org/apache/commons/math/analysis/integration/TrapezoidIntegrator.java
new file mode 100644
index 0000000..ce780d4
--- /dev/null
+++ b/src/org/apache/commons/math/analysis/integration/TrapezoidIntegrator.java
@@ -0,0 +1,150 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.analysis.integration;
+
+import org.apache.commons.math.FunctionEvaluationException;
+import org.apache.commons.math.MathRuntimeException;
+import org.apache.commons.math.MaxIterationsExceededException;
+import org.apache.commons.math.analysis.UnivariateRealFunction;
+
+/**
+ * Implements the <a href="http://mathworld.wolfram.com/TrapezoidalRule.html">
+ * Trapezoidal Rule</a> for integration of real univariate functions. For
+ * reference, see <b>Introduction to Numerical Analysis</b>, ISBN 038795452X,
+ * chapter 3.
+ * <p>
+ * The function should be integrable.</p>
+ *
+ * @version $Revision: 825919 $ $Date: 2009-10-16 10:51:55 -0400 (Fri, 16 Oct 2009) $
+ * @since 1.2
+ */
+public class TrapezoidIntegrator extends UnivariateRealIntegratorImpl {
+
+    /**
+     * Intermediate result.
+     */
+    private double s;
+
+    /**
+     * Construct an integrator for the given function.
+     *
+     * @param f function to integrate
+     * @deprecated as of 2.0 the integrand function is passed as an argument
+     *             to the {@link #integrate(UnivariateRealFunction, double, double)}method.
+     */
+    @Deprecated
+    public TrapezoidIntegrator(UnivariateRealFunction f) {
+        super(f, 64);
+    }
+
+    /**
+     * Construct an integrator.
+     */
+    public TrapezoidIntegrator() {
+        super(64);
+    }
+
+    /**
+     * Compute the n-th stage integral of trapezoid rule. This function
+     * should only be called by API <code>integrate()</code> in the package.
+     * To save time it does not verify arguments - caller does.
+     * <p>
+     * The interval is divided equally into 2^n sections rather than an
+     * arbitrary m sections because this configuration can best utilize the
+     * alrealy computed values.</p>
+     *
+     * @param f   the integrand function
+     * @param min the lower bound for the interval
+     * @param max the upper bound for the interval
+     * @param n   the stage of 1/2 refinement, n = 0 is no refinement
+     * @return the value of n-th stage integral
+     * @throws FunctionEvaluationException if an error occurs evaluating the
+     *                                     function
+     */
+    double stage(final UnivariateRealFunction f,
+                 final double min, final double max, final int n)
+            throws FunctionEvaluationException {
+
+        if (n == 0) {
+            s = 0.5 * (max - min) * (f.value(min) + f.value(max));
+            return s;
+        } else {
+            final long np = 1L << (n - 1);           // number of new points in this stage
+            double sum = 0;
+            final double spacing = (max - min) / np; // spacing between adjacent new points
+            double x = min + 0.5 * spacing;    // the first new point
+            for (long i = 0; i < np; i++) {
+                sum += f.value(x);
+                x += spacing;
+            }
+            // add the new sum to previously calculated result
+            s = 0.5 * (s + sum * spacing);
+            return s;
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Deprecated
+    public double integrate(final double min, final double max)
+            throws MaxIterationsExceededException, FunctionEvaluationException, IllegalArgumentException {
+        return integrate(f, min, max);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public double integrate(final UnivariateRealFunction f,
+                            final double min, final double max)
+            throws MaxIterationsExceededException, FunctionEvaluationException, IllegalArgumentException {
+
+        clearResult();
+        verifyInterval(min, max);
+        verifyIterationCount();
+
+        double oldt = stage(f, min, max, 0);
+        for (int i = 1; i <= maximalIterationCount; ++i) {
+            final double t = stage(f, min, max, i);
+            if (i >= minimalIterationCount) {
+                final double delta = Math.abs(t - oldt);
+                final double rLimit =
+                        relativeAccuracy * (Math.abs(oldt) + Math.abs(t)) * 0.5;
+                if ((delta <= rLimit) || (delta <= absoluteAccuracy)) {
+                    setResult(t, i);
+                    return result;
+                }
+            }
+            oldt = t;
+        }
+        throw new MaxIterationsExceededException(maximalIterationCount);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected void verifyIterationCount() throws IllegalArgumentException {
+        super.verifyIterationCount();
+        // at most 64 bisection refinements
+        if (maximalIterationCount > 64) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "invalid iteration limits: min={0}, max={1}",
+                    0, 64);
+        }
+    }
+}
diff --git a/src/org/apache/commons/math/analysis/integration/UnivariateRealIntegrator.java b/src/org/apache/commons/math/analysis/integration/UnivariateRealIntegrator.java
new file mode 100644
index 0000000..ac44e23
--- /dev/null
+++ b/src/org/apache/commons/math/analysis/integration/UnivariateRealIntegrator.java
@@ -0,0 +1,107 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.analysis.integration;
+
+import org.apache.commons.math.ConvergenceException;
+import org.apache.commons.math.ConvergingAlgorithm;
+import org.apache.commons.math.FunctionEvaluationException;
+import org.apache.commons.math.analysis.UnivariateRealFunction;
+
+/**
+ * Interface for univariate real integration algorithms.
+ *
+ * @version $Revision: 811685 $ $Date: 2009-09-05 13:36:48 -0400 (Sat, 05 Sep 2009) $
+ * @since 1.2
+ */
+public interface UnivariateRealIntegrator extends ConvergingAlgorithm {
+
+    /**
+     * Set the lower limit for the number of iterations.
+     * <p>
+     * Minimal iteration is needed to avoid false early convergence, e.g.
+     * the sample points happen to be zeroes of the function. Users can
+     * use the default value or choose one that they see as appropriate.</p>
+     * <p>
+     * A <code>ConvergenceException</code> will be thrown if this number
+     * is not met.</p>
+     *
+     * @param count minimum number of iterations
+     */
+    void setMinimalIterationCount(int count);
+
+    /**
+     * Get the lower limit for the number of iterations.
+     *
+     * @return the actual lower limit
+     */
+    int getMinimalIterationCount();
+
+    /**
+     * Reset the lower limit for the number of iterations to the default.
+     * <p>
+     * The default value is supplied by the implementation.</p>
+     *
+     * @see #setMinimalIterationCount(int)
+     */
+    void resetMinimalIterationCount();
+
+    /**
+     * Integrate the function in the given interval.
+     *
+     * @param min the lower bound for the interval
+     * @param max the upper bound for the interval
+     * @return the value of integral
+     * @throws ConvergenceException        if the maximum iteration count is exceeded
+     *                                     or the integrator detects convergence problems otherwise
+     * @throws FunctionEvaluationException if an error occurs evaluating the
+     *                                     function
+     * @throws IllegalArgumentException    if min > max or the endpoints do not
+     *                                     satisfy the requirements specified by the integrator
+     * @deprecated replaced by {@link #integrate(UnivariateRealFunction, double, double)}
+     *             since 2.0
+     */
+    @Deprecated
+    double integrate(double min, double max) throws ConvergenceException,
+            FunctionEvaluationException, IllegalArgumentException;
+
+    /**
+     * Integrate the function in the given interval.
+     *
+     * @param f   the integrand function
+     * @param min the lower bound for the interval
+     * @param max the upper bound for the interval
+     * @return the value of integral
+     * @throws ConvergenceException        if the maximum iteration count is exceeded
+     *                                     or the integrator detects convergence problems otherwise
+     * @throws FunctionEvaluationException if an error occurs evaluating the
+     *                                     function
+     * @throws IllegalArgumentException    if min > max or the endpoints do not
+     *                                     satisfy the requirements specified by the integrator
+     */
+    double integrate(UnivariateRealFunction f, double min, double max) throws ConvergenceException,
+            FunctionEvaluationException, IllegalArgumentException;
+
+    /**
+     * Get the result of the last run of the integrator.
+     *
+     * @return the last result
+     * @throws IllegalStateException if there is no result available, either
+     *                               because no result was yet computed or the last attempt failed
+     */
+    double getResult() throws IllegalStateException;
+
+}
diff --git a/src/org/apache/commons/math/analysis/integration/UnivariateRealIntegratorImpl.java b/src/org/apache/commons/math/analysis/integration/UnivariateRealIntegratorImpl.java
new file mode 100644
index 0000000..a550bd7
--- /dev/null
+++ b/src/org/apache/commons/math/analysis/integration/UnivariateRealIntegratorImpl.java
@@ -0,0 +1,197 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.analysis.integration;
+
+import org.apache.commons.math.ConvergingAlgorithmImpl;
+import org.apache.commons.math.MathRuntimeException;
+import org.apache.commons.math.analysis.UnivariateRealFunction;
+
+/**
+ * Provide a default implementation for several generic functions.
+ *
+ * @version $Revision: 811685 $ $Date: 2009-09-05 13:36:48 -0400 (Sat, 05 Sep 2009) $
+ * @since 1.2
+ */
+public abstract class UnivariateRealIntegratorImpl
+        extends ConvergingAlgorithmImpl implements UnivariateRealIntegrator {
+
+    /**
+     * Serializable version identifier.
+     */
+    private static final long serialVersionUID = 6248808456637441533L;
+
+    /**
+     * minimum number of iterations
+     */
+    protected int minimalIterationCount;
+
+    /**
+     * default minimum number of iterations
+     */
+    protected int defaultMinimalIterationCount;
+
+    /**
+     * indicates whether an integral has been computed
+     */
+    protected boolean resultComputed = false;
+
+    /**
+     * the last computed integral
+     */
+    protected double result;
+
+    /**
+     * The integrand functione.
+     *
+     * @deprecated as of 2.0 the integrand function is passed as an argument
+     *             to the {@link #integrate(UnivariateRealFunction, double, double)}method.
+     */
+    @Deprecated
+    protected UnivariateRealFunction f;
+
+    /**
+     * Construct an integrator with given iteration count and accuracy.
+     *
+     * @param f                            the integrand function
+     * @param defaultMaximalIterationCount maximum number of iterations
+     * @throws IllegalArgumentException if f is null or the iteration
+     *                                  limits are not valid
+     * @deprecated as of 2.0 the integrand function is passed as an argument
+     *             to the {@link #integrate(UnivariateRealFunction, double, double)}method.
+     */
+    @Deprecated
+    protected UnivariateRealIntegratorImpl(final UnivariateRealFunction f,
+                                           final int defaultMaximalIterationCount)
+            throws IllegalArgumentException {
+        super(defaultMaximalIterationCount, 1.0e-15);
+        if (f == null) {
+            throw MathRuntimeException.createIllegalArgumentException("function is null");
+        }
+
+        this.f = f;
+
+        // parameters that are problem specific
+        setRelativeAccuracy(1.0e-6);
+        this.defaultMinimalIterationCount = 3;
+        this.minimalIterationCount = defaultMinimalIterationCount;
+
+        verifyIterationCount();
+    }
+
+    /**
+     * Construct an integrator with given iteration count and accuracy.
+     *
+     * @param defaultMaximalIterationCount maximum number of iterations
+     * @throws IllegalArgumentException if f is null or the iteration
+     *                                  limits are not valid
+     */
+    protected UnivariateRealIntegratorImpl(final int defaultMaximalIterationCount)
+            throws IllegalArgumentException {
+        super(defaultMaximalIterationCount, 1.0e-15);
+
+        // parameters that are problem specific
+        setRelativeAccuracy(1.0e-6);
+        this.defaultMinimalIterationCount = 3;
+        this.minimalIterationCount = defaultMinimalIterationCount;
+
+        verifyIterationCount();
+    }
+
+    /**
+     * Access the last computed integral.
+     *
+     * @return the last computed integral
+     * @throws IllegalStateException if no integral has been computed
+     */
+    public double getResult() throws IllegalStateException {
+        if (resultComputed) {
+            return result;
+        } else {
+            throw MathRuntimeException.createIllegalStateException("no result available");
+        }
+    }
+
+    /**
+     * Convenience function for implementations.
+     *
+     * @param newResult      the result to set
+     * @param iterationCount the iteration count to set
+     */
+    protected final void setResult(double newResult, int iterationCount) {
+        this.result = newResult;
+        this.iterationCount = iterationCount;
+        this.resultComputed = true;
+    }
+
+    /**
+     * Convenience function for implementations.
+     */
+    protected final void clearResult() {
+        this.iterationCount = 0;
+        this.resultComputed = false;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setMinimalIterationCount(int count) {
+        minimalIterationCount = count;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public int getMinimalIterationCount() {
+        return minimalIterationCount;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void resetMinimalIterationCount() {
+        minimalIterationCount = defaultMinimalIterationCount;
+    }
+
+    /**
+     * Verifies that the endpoints specify an interval.
+     *
+     * @param lower lower endpoint
+     * @param upper upper endpoint
+     * @throws IllegalArgumentException if not interval
+     */
+    protected void verifyInterval(double lower, double upper) throws
+            IllegalArgumentException {
+        if (lower >= upper) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "endpoints do not specify an interval: [{0}, {1}]",
+                    lower, upper);
+        }
+    }
+
+    /**
+     * Verifies that the upper and lower limits of iterations are valid.
+     *
+     * @throws IllegalArgumentException if not valid
+     */
+    protected void verifyIterationCount() throws IllegalArgumentException {
+        if ((minimalIterationCount <= 0) || (maximalIterationCount <= minimalIterationCount)) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "invalid iteration limits: min={0}, max={1}",
+                    minimalIterationCount, maximalIterationCount);
+        }
+    }
+}
diff --git a/src/org/apache/commons/math/analysis/solvers/BisectionSolver.java b/src/org/apache/commons/math/analysis/solvers/BisectionSolver.java
new file mode 100644
index 0000000..ffd641d
--- /dev/null
+++ b/src/org/apache/commons/math/analysis/solvers/BisectionSolver.java
@@ -0,0 +1,116 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.analysis.solvers;
+
+import org.apache.commons.math.FunctionEvaluationException;
+import org.apache.commons.math.MaxIterationsExceededException;
+import org.apache.commons.math.analysis.UnivariateRealFunction;
+
+/**
+ * Implements the <a href="http://mathworld.wolfram.com/Bisection.html">
+ * bisection algorithm</a> for finding zeros of univariate real functions.
+ * <p>
+ * The function should be continuous but not necessarily smooth.</p>
+ *
+ * @version $Revision: 811685 $ $Date: 2009-09-05 13:36:48 -0400 (Sat, 05 Sep 2009) $
+ */
+public class BisectionSolver extends UnivariateRealSolverImpl {
+
+    /**
+     * Construct a solver for the given function.
+     *
+     * @param f function to solve.
+     * @deprecated as of 2.0 the function to solve is passed as an argument
+     *             to the {@link #solve(UnivariateRealFunction, double, double)} or
+     *             {@link UnivariateRealSolverImpl#solve(UnivariateRealFunction, double, double, double)}
+     *             method.
+     */
+    @Deprecated
+    public BisectionSolver(UnivariateRealFunction f) {
+        super(f, 100, 1E-6);
+    }
+
+    /**
+     * Construct a solver.
+     */
+    public BisectionSolver() {
+        super(100, 1E-6);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Deprecated
+    public double solve(double min, double max, double initial)
+            throws MaxIterationsExceededException, FunctionEvaluationException {
+        return solve(f, min, max);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Deprecated
+    public double solve(double min, double max)
+            throws MaxIterationsExceededException, FunctionEvaluationException {
+        return solve(f, min, max);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public double solve(final UnivariateRealFunction f, double min, double max, double initial)
+            throws MaxIterationsExceededException, FunctionEvaluationException {
+        return solve(min, max);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public double solve(final UnivariateRealFunction f, double min, double max)
+            throws MaxIterationsExceededException, FunctionEvaluationException {
+
+        clearResult();
+        verifyInterval(min, max);
+        double m;
+        double fm;
+        double fmin;
+
+        int i = 0;
+        while (i < maximalIterationCount) {
+            m = UnivariateRealSolverUtils.midpoint(min, max);
+            fmin = f.value(min);
+            fm = f.value(m);
+
+            if (fm * fmin > 0.0) {
+                // max and m bracket the root.
+                min = m;
+            } else {
+                // min and m bracket the root.
+                max = m;
+            }
+
+            if (Math.abs(max - min) <= absoluteAccuracy) {
+                m = UnivariateRealSolverUtils.midpoint(min, max);
+                setResult(m, i);
+                return m;
+            }
+            ++i;
+        }
+
+        throw new MaxIterationsExceededException(maximalIterationCount);
+    }
+}
diff --git a/src/org/apache/commons/math/analysis/solvers/BrentSolver.java b/src/org/apache/commons/math/analysis/solvers/BrentSolver.java
new file mode 100644
index 0000000..1a7cb7f
--- /dev/null
+++ b/src/org/apache/commons/math/analysis/solvers/BrentSolver.java
@@ -0,0 +1,362 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.analysis.solvers;
+
+
+import org.apache.commons.math.FunctionEvaluationException;
+import org.apache.commons.math.MathRuntimeException;
+import org.apache.commons.math.MaxIterationsExceededException;
+import org.apache.commons.math.analysis.UnivariateRealFunction;
+
+/**
+ * Implements the <a href="http://mathworld.wolfram.com/BrentsMethod.html">
+ * Brent algorithm</a> for  finding zeros of real univariate functions.
+ * <p>
+ * The function should be continuous but not necessarily smooth.</p>
+ *
+ * @version $Revision:670469 $ $Date:2008-06-23 10:01:38 +0200 (lun., 23 juin 2008) $
+ */
+public class BrentSolver extends UnivariateRealSolverImpl {
+
+    /**
+     * Default absolute accuracy
+     *
+     * @since 2.1
+     */
+    public static final double DEFAULT_ABSOLUTE_ACCURACY = 1E-6;
+
+    /**
+     * Default maximum number of iterations
+     *
+     * @since 2.1
+     */
+    public static final int DEFAULT_MAXIMUM_ITERATIONS = 5000;
+
+    /**
+     * Error message for non-bracketing interval.
+     */
+    private static final String NON_BRACKETING_MESSAGE =
+            "function values at endpoints do not have different signs.  " +
+                    "Endpoints: [{0}, {1}], Values: [{2}, {3}]";
+
+    /**
+     * Serializable version identifier
+     */
+    private static final long serialVersionUID = 7694577816772532779L;
+
+    /**
+     * Construct a solver for the given function.
+     *
+     * @param f function to solve.
+     * @deprecated as of 2.0 the function to solve is passed as an argument
+     *             to the {@link #solve(UnivariateRealFunction, double, double)} or
+     *             {@link UnivariateRealSolverImpl#solve(UnivariateRealFunction, double, double, double)}
+     *             method.
+     */
+    @Deprecated
+    public BrentSolver(UnivariateRealFunction f) {
+        super(f, DEFAULT_MAXIMUM_ITERATIONS, DEFAULT_ABSOLUTE_ACCURACY);
+    }
+
+    /**
+     * Construct a solver with default properties.
+     */
+    public BrentSolver() {
+        super(DEFAULT_MAXIMUM_ITERATIONS, DEFAULT_ABSOLUTE_ACCURACY);
+    }
+
+    /**
+     * Construct a solver with the given absolute accuracy.
+     *
+     * @param absoluteAccuracy lower bound for absolute accuracy of solutions returned by the solver
+     * @since 2.1
+     */
+    public BrentSolver(double absoluteAccuracy) {
+        super(DEFAULT_MAXIMUM_ITERATIONS, absoluteAccuracy);
+    }
+
+    /**
+     * Contstruct a solver with the given maximum iterations and absolute accuracy.
+     *
+     * @param maximumIterations maximum number of iterations
+     * @param absoluteAccuracy  lower bound for absolute accuracy of solutions returned by the solver
+     * @since 2.1
+     */
+    public BrentSolver(int maximumIterations, double absoluteAccuracy) {
+        super(maximumIterations, absoluteAccuracy);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Deprecated
+    public double solve(double min, double max)
+            throws MaxIterationsExceededException, FunctionEvaluationException {
+        return solve(f, min, max);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Deprecated
+    public double solve(double min, double max, double initial)
+            throws MaxIterationsExceededException, FunctionEvaluationException {
+        return solve(f, min, max, initial);
+    }
+
+    /**
+     * Find a zero in the given interval with an initial guess.
+     * <p>Throws <code>IllegalArgumentException</code> if the values of the
+     * function at the three points have the same sign (note that it is
+     * allowed to have endpoints with the same sign if the initial point has
+     * opposite sign function-wise).</p>
+     *
+     * @param f       function to solve.
+     * @param min     the lower bound for the interval.
+     * @param max     the upper bound for the interval.
+     * @param initial the start value to use (must be set to min if no
+     *                initial point is known).
+     * @return the value where the function is zero
+     * @throws MaxIterationsExceededException the maximum iteration count
+     *                                        is exceeded
+     * @throws FunctionEvaluationException    if an error occurs evaluating
+     *                                        the function
+     * @throws IllegalArgumentException       if initial is not between min and max
+     *                                        (even if it <em>is</em> a root)
+     */
+    public double solve(final UnivariateRealFunction f,
+                        final double min, final double max, final double initial)
+            throws MaxIterationsExceededException, FunctionEvaluationException {
+
+        clearResult();
+        if ((initial < min) || (initial > max)) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "invalid interval, initial value parameters:  lower={0}, initial={1}, upper={2}",
+                    min, initial, max);
+        }
+
+        // return the initial guess if it is good enough
+        double yInitial = f.value(initial);
+        if (Math.abs(yInitial) <= functionValueAccuracy) {
+            setResult(initial, 0);
+            return result;
+        }
+
+        // return the first endpoint if it is good enough
+        double yMin = f.value(min);
+        if (Math.abs(yMin) <= functionValueAccuracy) {
+            setResult(min, 0);
+            return result;
+        }
+
+        // reduce interval if min and initial bracket the root
+        if (yInitial * yMin < 0) {
+            return solve(f, min, yMin, initial, yInitial, min, yMin);
+        }
+
+        // return the second endpoint if it is good enough
+        double yMax = f.value(max);
+        if (Math.abs(yMax) <= functionValueAccuracy) {
+            setResult(max, 0);
+            return result;
+        }
+
+        // reduce interval if initial and max bracket the root
+        if (yInitial * yMax < 0) {
+            return solve(f, initial, yInitial, max, yMax, initial, yInitial);
+        }
+
+        throw MathRuntimeException.createIllegalArgumentException(
+                NON_BRACKETING_MESSAGE, min, max, yMin, yMax);
+
+    }
+
+    /**
+     * Find a zero in the given interval.
+     * <p>
+     * Requires that the values of the function at the endpoints have opposite
+     * signs. An <code>IllegalArgumentException</code> is thrown if this is not
+     * the case.</p>
+     *
+     * @param f   the function to solve
+     * @param min the lower bound for the interval.
+     * @param max the upper bound for the interval.
+     * @return the value where the function is zero
+     * @throws MaxIterationsExceededException if the maximum iteration count is exceeded
+     * @throws FunctionEvaluationException    if an error occurs evaluating the
+     *                                        function
+     * @throws IllegalArgumentException       if min is not less than max or the
+     *                                        signs of the values of the function at the endpoints are not opposites
+     */
+    public double solve(final UnivariateRealFunction f,
+                        final double min, final double max)
+            throws MaxIterationsExceededException,
+            FunctionEvaluationException {
+
+        clearResult();
+        verifyInterval(min, max);
+
+        double ret = Double.NaN;
+
+        double yMin = f.value(min);
+        double yMax = f.value(max);
+
+        // Verify bracketing
+        double sign = yMin * yMax;
+        if (sign > 0) {
+            // check if either value is close to a zero
+            if (Math.abs(yMin) <= functionValueAccuracy) {
+                setResult(min, 0);
+                ret = min;
+            } else if (Math.abs(yMax) <= functionValueAccuracy) {
+                setResult(max, 0);
+                ret = max;
+            } else {
+                // neither value is close to zero and min and max do not bracket root.
+                throw MathRuntimeException.createIllegalArgumentException(
+                        NON_BRACKETING_MESSAGE, min, max, yMin, yMax);
+            }
+        } else if (sign < 0) {
+            // solve using only the first endpoint as initial guess
+            ret = solve(f, min, yMin, max, yMax, min, yMin);
+        } else {
+            // either min or max is a root
+            if (yMin == 0.0) {
+                ret = min;
+            } else {
+                ret = max;
+            }
+        }
+
+        return ret;
+    }
+
+    /**
+     * Find a zero starting search according to the three provided points.
+     *
+     * @param f  the function to solve
+     * @param x0 old approximation for the root
+     * @param y0 function value at the approximation for the root
+     * @param x1 last calculated approximation for the root
+     * @param y1 function value at the last calculated approximation
+     *           for the root
+     * @param x2 bracket point (must be set to x0 if no bracket point is
+     *           known, this will force starting with linear interpolation)
+     * @param y2 function value at the bracket point.
+     * @return the value where the function is zero
+     * @throws MaxIterationsExceededException if the maximum iteration count
+     *                                        is exceeded
+     * @throws FunctionEvaluationException    if an error occurs evaluating
+     *                                        the function
+     */
+    private double solve(final UnivariateRealFunction f,
+                         double x0, double y0,
+                         double x1, double y1,
+                         double x2, double y2)
+            throws MaxIterationsExceededException, FunctionEvaluationException {
+
+        double delta = x1 - x0;
+        double oldDelta = delta;
+
+        int i = 0;
+        while (i < maximalIterationCount) {
+            if (Math.abs(y2) < Math.abs(y1)) {
+                // use the bracket point if is better than last approximation
+                x0 = x1;
+                x1 = x2;
+                x2 = x0;
+                y0 = y1;
+                y1 = y2;
+                y2 = y0;
+            }
+            if (Math.abs(y1) <= functionValueAccuracy) {
+                // Avoid division by very small values. Assume
+                // the iteration has converged (the problem may
+                // still be ill conditioned)
+                setResult(x1, i);
+                return result;
+            }
+            double dx = x2 - x1;
+            double tolerance =
+                    Math.max(relativeAccuracy * Math.abs(x1), absoluteAccuracy);
+            if (Math.abs(dx) <= tolerance) {
+                setResult(x1, i);
+                return result;
+            }
+            if ((Math.abs(oldDelta) < tolerance) ||
+                    (Math.abs(y0) <= Math.abs(y1))) {
+                // Force bisection.
+                delta = 0.5 * dx;
+                oldDelta = delta;
+            } else {
+                double r3 = y1 / y0;
+                double p;
+                double p1;
+                // the equality test (x0 == x2) is intentional,
+                // it is part of the original Brent's method,
+                // it should NOT be replaced by proximity test
+                if (x0 == x2) {
+                    // Linear interpolation.
+                    p = dx * r3;
+                    p1 = 1.0 - r3;
+                } else {
+                    // Inverse quadratic interpolation.
+                    double r1 = y0 / y2;
+                    double r2 = y1 / y2;
+                    p = r3 * (dx * r1 * (r1 - r2) - (x1 - x0) * (r2 - 1.0));
+                    p1 = (r1 - 1.0) * (r2 - 1.0) * (r3 - 1.0);
+                }
+                if (p > 0.0) {
+                    p1 = -p1;
+                } else {
+                    p = -p;
+                }
+                if (2.0 * p >= 1.5 * dx * p1 - Math.abs(tolerance * p1) ||
+                        p >= Math.abs(0.5 * oldDelta * p1)) {
+                    // Inverse quadratic interpolation gives a value
+                    // in the wrong direction, or progress is slow.
+                    // Fall back to bisection.
+                    delta = 0.5 * dx;
+                    oldDelta = delta;
+                } else {
+                    oldDelta = delta;
+                    delta = p / p1;
+                }
+            }
+            // Save old X1, Y1
+            x0 = x1;
+            y0 = y1;
+            // Compute new X1, Y1
+            if (Math.abs(delta) > tolerance) {
+                x1 = x1 + delta;
+            } else if (dx > 0.0) {
+                x1 = x1 + 0.5 * tolerance;
+            } else if (dx <= 0.0) {
+                x1 = x1 - 0.5 * tolerance;
+            }
+            y1 = f.value(x1);
+            if ((y1 > 0) == (y2 > 0)) {
+                x2 = x0;
+                y2 = y0;
+                delta = x1 - x0;
+                oldDelta = delta;
+            }
+            i++;
+        }
+        throw new MaxIterationsExceededException(maximalIterationCount);
+    }
+}
diff --git a/src/org/apache/commons/math/analysis/solvers/MullerSolver.java b/src/org/apache/commons/math/analysis/solvers/MullerSolver.java
new file mode 100644
index 0000000..f0c8a82
--- /dev/null
+++ b/src/org/apache/commons/math/analysis/solvers/MullerSolver.java
@@ -0,0 +1,370 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.analysis.solvers;
+
+import org.apache.commons.math.ConvergenceException;
+import org.apache.commons.math.FunctionEvaluationException;
+import org.apache.commons.math.MaxIterationsExceededException;
+import org.apache.commons.math.analysis.UnivariateRealFunction;
+import org.apache.commons.math.util.MathUtils;
+
+/**
+ * Implements the <a href="http://mathworld.wolfram.com/MullersMethod.html">
+ * Muller's Method</a> for root finding of real univariate functions. For
+ * reference, see <b>Elementary Numerical Analysis</b>, ISBN 0070124477,
+ * chapter 3.
+ * <p>
+ * Muller's method applies to both real and complex functions, but here we
+ * restrict ourselves to real functions. Methods solve() and solve2() find
+ * real zeros, using different ways to bypass complex arithmetics.</p>
+ *
+ * @version $Revision: 825919 $ $Date: 2009-10-16 10:51:55 -0400 (Fri, 16 Oct 2009) $
+ * @since 1.2
+ */
+public class MullerSolver extends UnivariateRealSolverImpl {
+
+    /**
+     * Construct a solver for the given function.
+     *
+     * @param f function to solve
+     * @deprecated as of 2.0 the function to solve is passed as an argument
+     *             to the {@link #solve(UnivariateRealFunction, double, double)} or
+     *             {@link UnivariateRealSolverImpl#solve(UnivariateRealFunction, double, double, double)}
+     *             method.
+     */
+    @Deprecated
+    public MullerSolver(UnivariateRealFunction f) {
+        super(f, 100, 1E-6);
+    }
+
+    /**
+     * Construct a solver.
+     */
+    public MullerSolver() {
+        super(100, 1E-6);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Deprecated
+    public double solve(final double min, final double max)
+            throws ConvergenceException, FunctionEvaluationException {
+        return solve(f, min, max);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Deprecated
+    public double solve(final double min, final double max, final double initial)
+            throws ConvergenceException, FunctionEvaluationException {
+        return solve(f, min, max, initial);
+    }
+
+    /**
+     * Find a real root in the given interval with initial value.
+     * <p>
+     * Requires bracketing condition.</p>
+     *
+     * @param f       the function to solve
+     * @param min     the lower bound for the interval
+     * @param max     the upper bound for the interval
+     * @param initial the start value to use
+     * @return the point at which the function value is zero
+     * @throws MaxIterationsExceededException if the maximum iteration count is exceeded
+     *                                        or the solver detects convergence problems otherwise
+     * @throws FunctionEvaluationException    if an error occurs evaluating the
+     *                                        function
+     * @throws IllegalArgumentException       if any parameters are invalid
+     */
+    public double solve(final UnivariateRealFunction f,
+                        final double min, final double max, final double initial)
+            throws MaxIterationsExceededException, FunctionEvaluationException {
+
+        // check for zeros before verifying bracketing
+        if (f.value(min) == 0.0) {
+            return min;
+        }
+        if (f.value(max) == 0.0) {
+            return max;
+        }
+        if (f.value(initial) == 0.0) {
+            return initial;
+        }
+
+        verifyBracketing(min, max, f);
+        verifySequence(min, initial, max);
+        if (isBracketing(min, initial, f)) {
+            return solve(f, min, initial);
+        } else {
+            return solve(f, initial, max);
+        }
+    }
+
+    /**
+     * Find a real root in the given interval.
+     * <p>
+     * Original Muller's method would have function evaluation at complex point.
+     * Since our f(x) is real, we have to find ways to avoid that. Bracketing
+     * condition is one way to go: by requiring bracketing in every iteration,
+     * the newly computed approximation is guaranteed to be real.</p>
+     * <p>
+     * Normally Muller's method converges quadratically in the vicinity of a
+     * zero, however it may be very slow in regions far away from zeros. For
+     * example, f(x) = exp(x) - 1, min = -50, max = 100. In such case we use
+     * bisection as a safety backup if it performs very poorly.</p>
+     * <p>
+     * The formulas here use divided differences directly.</p>
+     *
+     * @param f   the function to solve
+     * @param min the lower bound for the interval
+     * @param max the upper bound for the interval
+     * @return the point at which the function value is zero
+     * @throws MaxIterationsExceededException if the maximum iteration count is exceeded
+     *                                        or the solver detects convergence problems otherwise
+     * @throws FunctionEvaluationException    if an error occurs evaluating the
+     *                                        function
+     * @throws IllegalArgumentException       if any parameters are invalid
+     */
+    public double solve(final UnivariateRealFunction f,
+                        final double min, final double max)
+            throws MaxIterationsExceededException, FunctionEvaluationException {
+
+        // [x0, x2] is the bracketing interval in each iteration
+        // x1 is the last approximation and an interpolation point in (x0, x2)
+        // x is the new root approximation and new x1 for next round
+        // d01, d12, d012 are divided differences
+
+        double x0 = min;
+        double y0 = f.value(x0);
+        double x2 = max;
+        double y2 = f.value(x2);
+        double x1 = 0.5 * (x0 + x2);
+        double y1 = f.value(x1);
+
+        // check for zeros before verifying bracketing
+        if (y0 == 0.0) {
+            return min;
+        }
+        if (y2 == 0.0) {
+            return max;
+        }
+        verifyBracketing(min, max, f);
+
+        double oldx = Double.POSITIVE_INFINITY;
+        for (int i = 1; i <= maximalIterationCount; ++i) {
+            // Muller's method employs quadratic interpolation through
+            // x0, x1, x2 and x is the zero of the interpolating parabola.
+            // Due to bracketing condition, this parabola must have two
+            // real roots and we choose one in [x0, x2] to be x.
+            final double d01 = (y1 - y0) / (x1 - x0);
+            final double d12 = (y2 - y1) / (x2 - x1);
+            final double d012 = (d12 - d01) / (x2 - x0);
+            final double c1 = d01 + (x1 - x0) * d012;
+            final double delta = c1 * c1 - 4 * y1 * d012;
+            final double xplus = x1 + (-2.0 * y1) / (c1 + Math.sqrt(delta));
+            final double xminus = x1 + (-2.0 * y1) / (c1 - Math.sqrt(delta));
+            // xplus and xminus are two roots of parabola and at least
+            // one of them should lie in (x0, x2)
+            final double x = isSequence(x0, xplus, x2) ? xplus : xminus;
+            final double y = f.value(x);
+
+            // check for convergence
+            final double tolerance = Math.max(relativeAccuracy * Math.abs(x), absoluteAccuracy);
+            if (Math.abs(x - oldx) <= tolerance) {
+                setResult(x, i);
+                return result;
+            }
+            if (Math.abs(y) <= functionValueAccuracy) {
+                setResult(x, i);
+                return result;
+            }
+
+            // Bisect if convergence is too slow. Bisection would waste
+            // our calculation of x, hopefully it won't happen often.
+            // the real number equality test x == x1 is intentional and
+            // completes the proximity tests above it
+            boolean bisect = (x < x1 && (x1 - x0) > 0.95 * (x2 - x0)) ||
+                    (x > x1 && (x2 - x1) > 0.95 * (x2 - x0)) ||
+                    (x == x1);
+            // prepare the new bracketing interval for next iteration
+            if (!bisect) {
+                x0 = x < x1 ? x0 : x1;
+                y0 = x < x1 ? y0 : y1;
+                x2 = x > x1 ? x2 : x1;
+                y2 = x > x1 ? y2 : y1;
+                x1 = x;
+                y1 = y;
+                oldx = x;
+            } else {
+                double xm = 0.5 * (x0 + x2);
+                double ym = f.value(xm);
+                if (MathUtils.sign(y0) + MathUtils.sign(ym) == 0.0) {
+                    x2 = xm;
+                    y2 = ym;
+                } else {
+                    x0 = xm;
+                    y0 = ym;
+                }
+                x1 = 0.5 * (x0 + x2);
+                y1 = f.value(x1);
+                oldx = Double.POSITIVE_INFINITY;
+            }
+        }
+        throw new MaxIterationsExceededException(maximalIterationCount);
+    }
+
+    /**
+     * Find a real root in the given interval.
+     * <p>
+     * solve2() differs from solve() in the way it avoids complex operations.
+     * Except for the initial [min, max], solve2() does not require bracketing
+     * condition, e.g. f(x0), f(x1), f(x2) can have the same sign. If complex
+     * number arises in the computation, we simply use its modulus as real
+     * approximation.</p>
+     * <p>
+     * Because the interval may not be bracketing, bisection alternative is
+     * not applicable here. However in practice our treatment usually works
+     * well, especially near real zeros where the imaginary part of complex
+     * approximation is often negligible.</p>
+     * <p>
+     * The formulas here do not use divided differences directly.</p>
+     *
+     * @param min the lower bound for the interval
+     * @param max the upper bound for the interval
+     * @return the point at which the function value is zero
+     * @throws MaxIterationsExceededException if the maximum iteration count is exceeded
+     *                                        or the solver detects convergence problems otherwise
+     * @throws FunctionEvaluationException    if an error occurs evaluating the
+     *                                        function
+     * @throws IllegalArgumentException       if any parameters are invalid
+     * @deprecated replaced by {@link #solve2(UnivariateRealFunction, double, double)}
+     *             since 2.0
+     */
+    @Deprecated
+    public double solve2(final double min, final double max)
+            throws MaxIterationsExceededException, FunctionEvaluationException {
+        return solve2(f, min, max);
+    }
+
+    /**
+     * Find a real root in the given interval.
+     * <p>
+     * solve2() differs from solve() in the way it avoids complex operations.
+     * Except for the initial [min, max], solve2() does not require bracketing
+     * condition, e.g. f(x0), f(x1), f(x2) can have the same sign. If complex
+     * number arises in the computation, we simply use its modulus as real
+     * approximation.</p>
+     * <p>
+     * Because the interval may not be bracketing, bisection alternative is
+     * not applicable here. However in practice our treatment usually works
+     * well, especially near real zeros where the imaginary part of complex
+     * approximation is often negligible.</p>
+     * <p>
+     * The formulas here do not use divided differences directly.</p>
+     *
+     * @param f   the function to solve
+     * @param min the lower bound for the interval
+     * @param max the upper bound for the interval
+     * @return the point at which the function value is zero
+     * @throws MaxIterationsExceededException if the maximum iteration count is exceeded
+     *                                        or the solver detects convergence problems otherwise
+     * @throws FunctionEvaluationException    if an error occurs evaluating the
+     *                                        function
+     * @throws IllegalArgumentException       if any parameters are invalid
+     */
+    public double solve2(final UnivariateRealFunction f,
+                         final double min, final double max)
+            throws MaxIterationsExceededException, FunctionEvaluationException {
+
+        // x2 is the last root approximation
+        // x is the new approximation and new x2 for next round
+        // x0 < x1 < x2 does not hold here
+
+        double x0 = min;
+        double y0 = f.value(x0);
+        double x1 = max;
+        double y1 = f.value(x1);
+        double x2 = 0.5 * (x0 + x1);
+        double y2 = f.value(x2);
+
+        // check for zeros before verifying bracketing
+        if (y0 == 0.0) {
+            return min;
+        }
+        if (y1 == 0.0) {
+            return max;
+        }
+        verifyBracketing(min, max, f);
+
+        double oldx = Double.POSITIVE_INFINITY;
+        for (int i = 1; i <= maximalIterationCount; ++i) {
+            // quadratic interpolation through x0, x1, x2
+            final double q = (x2 - x1) / (x1 - x0);
+            final double a = q * (y2 - (1 + q) * y1 + q * y0);
+            final double b = (2 * q + 1) * y2 - (1 + q) * (1 + q) * y1 + q * q * y0;
+            final double c = (1 + q) * y2;
+            final double delta = b * b - 4 * a * c;
+            double x;
+            final double denominator;
+            if (delta >= 0.0) {
+                // choose a denominator larger in magnitude
+                double dplus = b + Math.sqrt(delta);
+                double dminus = b - Math.sqrt(delta);
+                denominator = Math.abs(dplus) > Math.abs(dminus) ? dplus : dminus;
+            } else {
+                // take the modulus of (B +/- Math.sqrt(delta))
+                denominator = Math.sqrt(b * b - delta);
+            }
+            if (denominator != 0) {
+                x = x2 - 2.0 * c * (x2 - x1) / denominator;
+                // perturb x if it exactly coincides with x1 or x2
+                // the equality tests here are intentional
+                while (x == x1 || x == x2) {
+                    x += absoluteAccuracy;
+                }
+            } else {
+                // extremely rare case, get a random number to skip it
+                x = min + Math.random() * (max - min);
+                oldx = Double.POSITIVE_INFINITY;
+            }
+            final double y = f.value(x);
+
+            // check for convergence
+            final double tolerance = Math.max(relativeAccuracy * Math.abs(x), absoluteAccuracy);
+            if (Math.abs(x - oldx) <= tolerance) {
+                setResult(x, i);
+                return result;
+            }
+            if (Math.abs(y) <= functionValueAccuracy) {
+                setResult(x, i);
+                return result;
+            }
+
+            // prepare the next iteration
+            x0 = x1;
+            y0 = y1;
+            x1 = x2;
+            y1 = y2;
+            x2 = x;
+            y2 = y;
+            oldx = x;
+        }
+        throw new MaxIterationsExceededException(maximalIterationCount);
+    }
+}
diff --git a/src/org/apache/commons/math/analysis/solvers/NewtonSolver.java b/src/org/apache/commons/math/analysis/solvers/NewtonSolver.java
new file mode 100644
index 0000000..6c7fdf2
--- /dev/null
+++ b/src/org/apache/commons/math/analysis/solvers/NewtonSolver.java
@@ -0,0 +1,141 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.math.analysis.solvers;
+
+import org.apache.commons.math.FunctionEvaluationException;
+import org.apache.commons.math.MathRuntimeException;
+import org.apache.commons.math.MaxIterationsExceededException;
+import org.apache.commons.math.analysis.DifferentiableUnivariateRealFunction;
+import org.apache.commons.math.analysis.UnivariateRealFunction;
+
+/**
+ * Implements <a href="http://mathworld.wolfram.com/NewtonsMethod.html">
+ * Newton's Method</a> for finding zeros of real univariate functions.
+ * <p>
+ * The function should be continuous but not necessarily smooth.</p>
+ *
+ * @version $Revision: 811685 $ $Date: 2009-09-05 13:36:48 -0400 (Sat, 05 Sep 2009) $
+ */
+public class NewtonSolver extends UnivariateRealSolverImpl {
+
+    /**
+     * Construct a solver for the given function.
+     *
+     * @param f function to solve.
+     * @deprecated as of 2.0 the function to solve is passed as an argument
+     *             to the {@link #solve(UnivariateRealFunction, double, double)} or
+     *             {@link UnivariateRealSolverImpl#solve(UnivariateRealFunction, double, double, double)}
+     *             method.
+     */
+    @Deprecated
+    public NewtonSolver(DifferentiableUnivariateRealFunction f) {
+        super(f, 100, 1E-6);
+    }
+
+    /**
+     * Construct a solver.
+     */
+    public NewtonSolver() {
+        super(100, 1E-6);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Deprecated
+    public double solve(final double min, final double max)
+            throws MaxIterationsExceededException,
+            FunctionEvaluationException {
+        return solve(f, min, max);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Deprecated
+    public double solve(final double min, final double max, final double startValue)
+            throws MaxIterationsExceededException, FunctionEvaluationException {
+        return solve(f, min, max, startValue);
+    }
+
+    /**
+     * Find a zero near the midpoint of <code>min</code> and <code>max</code>.
+     *
+     * @param f   the function to solve
+     * @param min the lower bound for the interval
+     * @param max the upper bound for the interval
+     * @return the value where the function is zero
+     * @throws MaxIterationsExceededException if the maximum iteration count is exceeded
+     * @throws FunctionEvaluationException    if an error occurs evaluating the
+     *                                        function or derivative
+     * @throws IllegalArgumentException       if min is not less than max
+     */
+    public double solve(final UnivariateRealFunction f,
+                        final double min, final double max)
+            throws MaxIterationsExceededException, FunctionEvaluationException {
+        return solve(f, min, max, UnivariateRealSolverUtils.midpoint(min, max));
+    }
+
+    /**
+     * Find a zero near the value <code>startValue</code>.
+     *
+     * @param f          the function to solve
+     * @param min        the lower bound for the interval (ignored).
+     * @param max        the upper bound for the interval (ignored).
+     * @param startValue the start value to use.
+     * @return the value where the function is zero
+     * @throws MaxIterationsExceededException if the maximum iteration count is exceeded
+     * @throws FunctionEvaluationException    if an error occurs evaluating the
+     *                                        function or derivative
+     * @throws IllegalArgumentException       if startValue is not between min and max or
+     *                                        if function is not a {@link DifferentiableUnivariateRealFunction} instance
+     */
+    public double solve(final UnivariateRealFunction f,
+                        final double min, final double max, final double startValue)
+            throws MaxIterationsExceededException, FunctionEvaluationException {
+
+        try {
+
+            final UnivariateRealFunction derivative =
+                    ((DifferentiableUnivariateRealFunction) f).derivative();
+            clearResult();
+            verifySequence(min, startValue, max);
+
+            double x0 = startValue;
+            double x1;
+
+            int i = 0;
+            while (i < maximalIterationCount) {
+
+                x1 = x0 - (f.value(x0) / derivative.value(x0));
+                if (Math.abs(x1 - x0) <= absoluteAccuracy) {
+                    setResult(x1, i);
+                    return x1;
+                }
+
+                x0 = x1;
+                ++i;
+            }
+
+            throw new MaxIterationsExceededException(maximalIterationCount);
+        } catch (ClassCastException cce) {
+            throw MathRuntimeException.createIllegalArgumentException("function is not differentiable");
+        }
+    }
+
+}
diff --git a/src/org/apache/commons/math/analysis/solvers/RiddersSolver.java b/src/org/apache/commons/math/analysis/solvers/RiddersSolver.java
new file mode 100644
index 0000000..a1c5afe
--- /dev/null
+++ b/src/org/apache/commons/math/analysis/solvers/RiddersSolver.java
@@ -0,0 +1,207 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.analysis.solvers;
+
+import org.apache.commons.math.ConvergenceException;
+import org.apache.commons.math.FunctionEvaluationException;
+import org.apache.commons.math.MaxIterationsExceededException;
+import org.apache.commons.math.analysis.UnivariateRealFunction;
+import org.apache.commons.math.util.MathUtils;
+
+/**
+ * Implements the <a href="http://mathworld.wolfram.com/RiddersMethod.html">
+ * Ridders' Method</a> for root finding of real univariate functions. For
+ * reference, see C. Ridders, <i>A new algorithm for computing a single root
+ * of a real continuous function </i>, IEEE Transactions on Circuits and
+ * Systems, 26 (1979), 979 - 980.
+ * <p>
+ * The function should be continuous but not necessarily smooth.</p>
+ *
+ * @version $Revision: 825919 $ $Date: 2009-10-16 10:51:55 -0400 (Fri, 16 Oct 2009) $
+ * @since 1.2
+ */
+public class RiddersSolver extends UnivariateRealSolverImpl {
+
+    /**
+     * Construct a solver for the given function.
+     *
+     * @param f function to solve
+     * @deprecated as of 2.0 the function to solve is passed as an argument
+     *             to the {@link #solve(UnivariateRealFunction, double, double)} or
+     *             {@link UnivariateRealSolverImpl#solve(UnivariateRealFunction, double, double, double)}
+     *             method.
+     */
+    @Deprecated
+    public RiddersSolver(UnivariateRealFunction f) {
+        super(f, 100, 1E-6);
+    }
+
+    /**
+     * Construct a solver.
+     */
+    public RiddersSolver() {
+        super(100, 1E-6);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Deprecated
+    public double solve(final double min, final double max)
+            throws ConvergenceException, FunctionEvaluationException {
+        return solve(f, min, max);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Deprecated
+    public double solve(final double min, final double max, final double initial)
+            throws ConvergenceException, FunctionEvaluationException {
+        return solve(f, min, max, initial);
+    }
+
+    /**
+     * Find a root in the given interval with initial value.
+     * <p>
+     * Requires bracketing condition.</p>
+     *
+     * @param f       the function to solve
+     * @param min     the lower bound for the interval
+     * @param max     the upper bound for the interval
+     * @param initial the start value to use
+     * @return the point at which the function value is zero
+     * @throws MaxIterationsExceededException if the maximum iteration count is exceeded
+     * @throws FunctionEvaluationException    if an error occurs evaluating the
+     *                                        function
+     * @throws IllegalArgumentException       if any parameters are invalid
+     */
+    public double solve(final UnivariateRealFunction f,
+                        final double min, final double max, final double initial)
+            throws MaxIterationsExceededException, FunctionEvaluationException {
+
+        // check for zeros before verifying bracketing
+        if (f.value(min) == 0.0) {
+            return min;
+        }
+        if (f.value(max) == 0.0) {
+            return max;
+        }
+        if (f.value(initial) == 0.0) {
+            return initial;
+        }
+
+        verifyBracketing(min, max, f);
+        verifySequence(min, initial, max);
+        if (isBracketing(min, initial, f)) {
+            return solve(f, min, initial);
+        } else {
+            return solve(f, initial, max);
+        }
+    }
+
+    /**
+     * Find a root in the given interval.
+     * <p>
+     * Requires bracketing condition.</p>
+     *
+     * @param f   the function to solve
+     * @param min the lower bound for the interval
+     * @param max the upper bound for the interval
+     * @return the point at which the function value is zero
+     * @throws MaxIterationsExceededException if the maximum iteration count is exceeded
+     * @throws FunctionEvaluationException    if an error occurs evaluating the
+     *                                        function
+     * @throws IllegalArgumentException       if any parameters are invalid
+     */
+    public double solve(final UnivariateRealFunction f,
+                        final double min, final double max)
+            throws MaxIterationsExceededException, FunctionEvaluationException {
+
+        // [x1, x2] is the bracketing interval in each iteration
+        // x3 is the midpoint of [x1, x2]
+        // x is the new root approximation and an endpoint of the new interval
+        double x1 = min;
+        double y1 = f.value(x1);
+        double x2 = max;
+        double y2 = f.value(x2);
+
+        // check for zeros before verifying bracketing
+        if (y1 == 0.0) {
+            return min;
+        }
+        if (y2 == 0.0) {
+            return max;
+        }
+        verifyBracketing(min, max, f);
+
+        int i = 1;
+        double oldx = Double.POSITIVE_INFINITY;
+        while (i <= maximalIterationCount) {
+            // calculate the new root approximation
+            final double x3 = 0.5 * (x1 + x2);
+            final double y3 = f.value(x3);
+            if (Math.abs(y3) <= functionValueAccuracy) {
+                setResult(x3, i);
+                return result;
+            }
+            final double delta = 1 - (y1 * y2) / (y3 * y3);  // delta > 1 due to bracketing
+            final double correction = (MathUtils.sign(y2) * MathUtils.sign(y3)) *
+                    (x3 - x1) / Math.sqrt(delta);
+            final double x = x3 - correction;                // correction != 0
+            final double y = f.value(x);
+
+            // check for convergence
+            final double tolerance = Math.max(relativeAccuracy * Math.abs(x), absoluteAccuracy);
+            if (Math.abs(x - oldx) <= tolerance) {
+                setResult(x, i);
+                return result;
+            }
+            if (Math.abs(y) <= functionValueAccuracy) {
+                setResult(x, i);
+                return result;
+            }
+
+            // prepare the new interval for next iteration
+            // Ridders' method guarantees x1 < x < x2
+            if (correction > 0.0) {             // x1 < x < x3
+                if (MathUtils.sign(y1) + MathUtils.sign(y) == 0.0) {
+                    x2 = x;
+                    y2 = y;
+                } else {
+                    x1 = x;
+                    x2 = x3;
+                    y1 = y;
+                    y2 = y3;
+                }
+            } else {                            // x3 < x < x2
+                if (MathUtils.sign(y2) + MathUtils.sign(y) == 0.0) {
+                    x1 = x;
+                    y1 = y;
+                } else {
+                    x1 = x3;
+                    x2 = x;
+                    y1 = y3;
+                    y2 = y;
+                }
+            }
+            oldx = x;
+            i++;
+        }
+        throw new MaxIterationsExceededException(maximalIterationCount);
+    }
+}
diff --git a/src/org/apache/commons/math/analysis/solvers/SecantSolver.java b/src/org/apache/commons/math/analysis/solvers/SecantSolver.java
new file mode 100644
index 0000000..76fd8d9
--- /dev/null
+++ b/src/org/apache/commons/math/analysis/solvers/SecantSolver.java
@@ -0,0 +1,190 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.analysis.solvers;
+
+import org.apache.commons.math.ConvergenceException;
+import org.apache.commons.math.FunctionEvaluationException;
+import org.apache.commons.math.MathRuntimeException;
+import org.apache.commons.math.MaxIterationsExceededException;
+import org.apache.commons.math.analysis.UnivariateRealFunction;
+
+
+/**
+ * Implements a modified version of the
+ * <a href="http://mathworld.wolfram.com/SecantMethod.html">secant method</a>
+ * for approximating a zero of a real univariate function.
+ * <p>
+ * The algorithm is modified to maintain bracketing of a root by successive
+ * approximations. Because of forced bracketing, convergence may be slower than
+ * the unrestricted secant algorithm. However, this implementation should in
+ * general outperform the
+ * <a href="http://mathworld.wolfram.com/MethodofFalsePosition.html">
+ * regula falsi method.</a></p>
+ * <p>
+ * The function is assumed to be continuous but not necessarily smooth.</p>
+ *
+ * @version $Revision: 811685 $ $Date: 2009-09-05 13:36:48 -0400 (Sat, 05 Sep 2009) $
+ */
+public class SecantSolver extends UnivariateRealSolverImpl {
+
+    /**
+     * Construct a solver for the given function.
+     *
+     * @param f function to solve.
+     * @deprecated as of 2.0 the function to solve is passed as an argument
+     *             to the {@link #solve(UnivariateRealFunction, double, double)} or
+     *             {@link UnivariateRealSolverImpl#solve(UnivariateRealFunction, double, double, double)}
+     *             method.
+     */
+    @Deprecated
+    public SecantSolver(UnivariateRealFunction f) {
+        super(f, 100, 1E-6);
+    }
+
+    /**
+     * Construct a solver.
+     */
+    public SecantSolver() {
+        super(100, 1E-6);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Deprecated
+    public double solve(final double min, final double max)
+            throws ConvergenceException, FunctionEvaluationException {
+        return solve(f, min, max);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Deprecated
+    public double solve(final double min, final double max, final double initial)
+            throws ConvergenceException, FunctionEvaluationException {
+        return solve(f, min, max, initial);
+    }
+
+    /**
+     * Find a zero in the given interval.
+     *
+     * @param f       the function to solve
+     * @param min     the lower bound for the interval
+     * @param max     the upper bound for the interval
+     * @param initial the start value to use (ignored)
+     * @return the value where the function is zero
+     * @throws MaxIterationsExceededException if the maximum iteration count is exceeded
+     * @throws FunctionEvaluationException    if an error occurs evaluating the
+     *                                        function
+     * @throws IllegalArgumentException       if min is not less than max or the
+     *                                        signs of the values of the function at the endpoints are not opposites
+     */
+    public double solve(final UnivariateRealFunction f,
+                        final double min, final double max, final double initial)
+            throws MaxIterationsExceededException, FunctionEvaluationException {
+        return solve(f, min, max);
+    }
+
+    /**
+     * Find a zero in the given interval.
+     *
+     * @param f   the function to solve
+     * @param min the lower bound for the interval.
+     * @param max the upper bound for the interval.
+     * @return the value where the function is zero
+     * @throws MaxIterationsExceededException if the maximum iteration count is exceeded
+     * @throws FunctionEvaluationException    if an error occurs evaluating the
+     *                                        function
+     * @throws IllegalArgumentException       if min is not less than max or the
+     *                                        signs of the values of the function at the endpoints are not opposites
+     */
+    public double solve(final UnivariateRealFunction f,
+                        final double min, final double max)
+            throws MaxIterationsExceededException, FunctionEvaluationException {
+
+        clearResult();
+        verifyInterval(min, max);
+
+        // Index 0 is the old approximation for the root.
+        // Index 1 is the last calculated approximation  for the root.
+        // Index 2 is a bracket for the root with respect to x0.
+        // OldDelta is the length of the bracketing interval of the last
+        // iteration.
+        double x0 = min;
+        double x1 = max;
+        double y0 = f.value(x0);
+        double y1 = f.value(x1);
+
+        // Verify bracketing
+        if (y0 * y1 >= 0) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "function values at endpoints do not have different signs, " +
+                            "endpoints: [{0}, {1}], values: [{2}, {3}]",
+                    min, max, y0, y1);
+        }
+
+        double x2 = x0;
+        double y2 = y0;
+        double oldDelta = x2 - x1;
+        int i = 0;
+        while (i < maximalIterationCount) {
+            if (Math.abs(y2) < Math.abs(y1)) {
+                x0 = x1;
+                x1 = x2;
+                x2 = x0;
+                y0 = y1;
+                y1 = y2;
+                y2 = y0;
+            }
+            if (Math.abs(y1) <= functionValueAccuracy) {
+                setResult(x1, i);
+                return result;
+            }
+            if (Math.abs(oldDelta) <
+                    Math.max(relativeAccuracy * Math.abs(x1), absoluteAccuracy)) {
+                setResult(x1, i);
+                return result;
+            }
+            double delta;
+            if (Math.abs(y1) > Math.abs(y0)) {
+                // Function value increased in last iteration. Force bisection.
+                delta = 0.5 * oldDelta;
+            } else {
+                delta = (x0 - x1) / (1 - y0 / y1);
+                if (delta / oldDelta > 1) {
+                    // New approximation falls outside bracket.
+                    // Fall back to bisection.
+                    delta = 0.5 * oldDelta;
+                }
+            }
+            x0 = x1;
+            y0 = y1;
+            x1 = x1 + delta;
+            y1 = f.value(x1);
+            if ((y1 > 0) == (y2 > 0)) {
+                // New bracket is (x0,x1).
+                x2 = x0;
+                y2 = y0;
+            }
+            oldDelta = x2 - x1;
+            i++;
+        }
+        throw new MaxIterationsExceededException(maximalIterationCount);
+    }
+
+}
diff --git a/src/org/apache/commons/math/analysis/solvers/UnivariateRealSolver.java b/src/org/apache/commons/math/analysis/solvers/UnivariateRealSolver.java
new file mode 100644
index 0000000..c5af6d3
--- /dev/null
+++ b/src/org/apache/commons/math/analysis/solvers/UnivariateRealSolver.java
@@ -0,0 +1,168 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.analysis.solvers;
+
+import org.apache.commons.math.ConvergenceException;
+import org.apache.commons.math.ConvergingAlgorithm;
+import org.apache.commons.math.FunctionEvaluationException;
+import org.apache.commons.math.analysis.UnivariateRealFunction;
+
+
+/**
+ * Interface for (univariate real) rootfinding algorithms.
+ * <p>
+ * Implementations will search for only one zero in the given interval.</p>
+ *
+ * @version $Revision: 811685 $ $Date: 2009-09-05 13:36:48 -0400 (Sat, 05 Sep 2009) $
+ */
+public interface UnivariateRealSolver extends ConvergingAlgorithm {
+
+    /**
+     * Set the function value accuracy.
+     * <p>
+     * This is used to determine when an evaluated function value or some other
+     * value which is used as divisor is zero.</p>
+     * <p>
+     * This is a safety guard and it shouldn't be necessary to change this in
+     * general.</p>
+     *
+     * @param accuracy the accuracy.
+     * @throws IllegalArgumentException if the accuracy can't be achieved by
+     *                                  the solver or is otherwise deemed unreasonable.
+     */
+    void setFunctionValueAccuracy(double accuracy);
+
+    /**
+     * Get the actual function value accuracy.
+     *
+     * @return the accuracy
+     */
+    double getFunctionValueAccuracy();
+
+    /**
+     * Reset the actual function accuracy to the default.
+     * The default value is provided by the solver implementation.
+     */
+    void resetFunctionValueAccuracy();
+
+    /**
+     * Solve for a zero root in the given interval.
+     * <p>A solver may require that the interval brackets a single zero root.
+     * Solvers that do require bracketing should be able to handle the case
+     * where one of the endpoints is itself a root.</p>
+     *
+     * @param min the lower bound for the interval.
+     * @param max the upper bound for the interval.
+     * @return a value where the function is zero
+     * @throws ConvergenceException        if the maximum iteration count is exceeded
+     *                                     or the solver detects convergence problems otherwise.
+     * @throws FunctionEvaluationException if an error occurs evaluating the
+     *                                     function
+     * @throws IllegalArgumentException    if min > max or the endpoints do not
+     *                                     satisfy the requirements specified by the solver
+     * @deprecated replaced by {@link #solve(UnivariateRealFunction, double, double)}
+     *             since 2.0
+     */
+    @Deprecated
+    double solve(double min, double max) throws ConvergenceException,
+            FunctionEvaluationException;
+
+    /**
+     * Solve for a zero root in the given interval.
+     * <p>A solver may require that the interval brackets a single zero root.
+     * Solvers that do require bracketing should be able to handle the case
+     * where one of the endpoints is itself a root.</p>
+     *
+     * @param f   the function to solve.
+     * @param min the lower bound for the interval.
+     * @param max the upper bound for the interval.
+     * @return a value where the function is zero
+     * @throws ConvergenceException        if the maximum iteration count is exceeded
+     *                                     or the solver detects convergence problems otherwise.
+     * @throws FunctionEvaluationException if an error occurs evaluating the
+     *                                     function
+     * @throws IllegalArgumentException    if min > max or the endpoints do not
+     *                                     satisfy the requirements specified by the solver
+     * @since 2.0
+     */
+    double solve(UnivariateRealFunction f, double min, double max)
+            throws ConvergenceException,
+            FunctionEvaluationException;
+
+    /**
+     * Solve for a zero in the given interval, start at startValue.
+     * <p>A solver may require that the interval brackets a single zero root.
+     * Solvers that do require bracketing should be able to handle the case
+     * where one of the endpoints is itself a root.</p>
+     *
+     * @param min        the lower bound for the interval.
+     * @param max        the upper bound for the interval.
+     * @param startValue the start value to use
+     * @return a value where the function is zero
+     * @throws ConvergenceException        if the maximum iteration count is exceeded
+     *                                     or the solver detects convergence problems otherwise.
+     * @throws FunctionEvaluationException if an error occurs evaluating the
+     *                                     function
+     * @throws IllegalArgumentException    if min > max or the arguments do not
+     *                                     satisfy the requirements specified by the solver
+     * @deprecated replaced by {@link #solve(UnivariateRealFunction, double, double, double)}
+     *             since 2.0
+     */
+    @Deprecated
+    double solve(double min, double max, double startValue)
+            throws ConvergenceException, FunctionEvaluationException, IllegalArgumentException;
+
+    /**
+     * Solve for a zero in the given interval, start at startValue.
+     * <p>A solver may require that the interval brackets a single zero root.
+     * Solvers that do require bracketing should be able to handle the case
+     * where one of the endpoints is itself a root.</p>
+     *
+     * @param f          the function to solve.
+     * @param min        the lower bound for the interval.
+     * @param max        the upper bound for the interval.
+     * @param startValue the start value to use
+     * @return a value where the function is zero
+     * @throws ConvergenceException        if the maximum iteration count is exceeded
+     *                                     or the solver detects convergence problems otherwise.
+     * @throws FunctionEvaluationException if an error occurs evaluating the
+     *                                     function
+     * @throws IllegalArgumentException    if min > max or the arguments do not
+     *                                     satisfy the requirements specified by the solver
+     * @since 2.0
+     */
+    double solve(UnivariateRealFunction f, double min, double max, double startValue)
+            throws ConvergenceException, FunctionEvaluationException, IllegalArgumentException;
+
+    /**
+     * Get the result of the last run of the solver.
+     *
+     * @return the last result.
+     * @throws IllegalStateException if there is no result available, either
+     *                               because no result was yet computed or the last attempt failed.
+     */
+    double getResult();
+
+    /**
+     * Get the result of the last run of the solver.
+     *
+     * @return the value of the function at the last result.
+     * @throws IllegalStateException if there is no result available, either
+     *                               because no result was yet computed or the last attempt failed.
+     */
+    double getFunctionValue();
+}
diff --git a/src/org/apache/commons/math/analysis/solvers/UnivariateRealSolverFactory.java b/src/org/apache/commons/math/analysis/solvers/UnivariateRealSolverFactory.java
new file mode 100644
index 0000000..387f1d6
--- /dev/null
+++ b/src/org/apache/commons/math/analysis/solvers/UnivariateRealSolverFactory.java
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.analysis.solvers;
+
+/**
+ * Abstract factory class used to create {@link UnivariateRealSolver} instances.
+ * <p>
+ * Solvers implementing the following algorithms are supported:
+ * <ul>
+ * <li>Bisection</li>
+ * <li>Brent's method</li>
+ * <li>Secant method</li>
+ * </ul>
+ * Concrete factories extending this class also specify a default solver, instances of which
+ * are returned by <code>newDefaultSolver()</code>.</p>
+ * <p>
+ * Common usage:<pre>
+ * SolverFactory factory = UnivariateRealSolverFactory.newInstance();</p>
+ * <p/>
+ * // create a Brent solver to use
+ * BrentSolver solver = factory.newBrentSolver();
+ * </pre>
+ *
+ * @version $Revision: 811685 $ $Date: 2009-09-05 13:36:48 -0400 (Sat, 05 Sep 2009) $
+ */
+public abstract class UnivariateRealSolverFactory {
+    /**
+     * Default constructor.
+     */
+    protected UnivariateRealSolverFactory() {
+    }
+
+    /**
+     * Create a new factory.
+     *
+     * @return a new factory.
+     */
+    public static UnivariateRealSolverFactory newInstance() {
+        return new UnivariateRealSolverFactoryImpl();
+    }
+
+    /**
+     * Create a new {@link UnivariateRealSolver}.  The
+     * actual solver returned is determined by the underlying factory.
+     *
+     * @return the new solver.
+     */
+    public abstract UnivariateRealSolver newDefaultSolver();
+
+    /**
+     * Create a new {@link UnivariateRealSolver}.  The
+     * solver is an implementation of the bisection method.
+     *
+     * @return the new solver.
+     */
+    public abstract UnivariateRealSolver newBisectionSolver();
+
+    /**
+     * Create a new {@link UnivariateRealSolver}.  The
+     * solver is an implementation of the Brent method.
+     *
+     * @return the new solver.
+     */
+    public abstract UnivariateRealSolver newBrentSolver();
+
+    /**
+     * Create a new {@link UnivariateRealSolver}.  The
+     * solver is an implementation of Newton's Method.
+     *
+     * @return the new solver.
+     */
+    public abstract UnivariateRealSolver newNewtonSolver();
+
+    /**
+     * Create a new {@link UnivariateRealSolver}.  The
+     * solver is an implementation of the secant method.
+     *
+     * @return the new solver.
+     */
+    public abstract UnivariateRealSolver newSecantSolver();
+
+}
diff --git a/src/org/apache/commons/math/analysis/solvers/UnivariateRealSolverFactoryImpl.java b/src/org/apache/commons/math/analysis/solvers/UnivariateRealSolverFactoryImpl.java
new file mode 100644
index 0000000..5737084
--- /dev/null
+++ b/src/org/apache/commons/math/analysis/solvers/UnivariateRealSolverFactoryImpl.java
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.analysis.solvers;
+
+/**
+ * A concrete {@link  UnivariateRealSolverFactory}.  This is the default solver factory
+ * used by commons-math.
+ * <p>
+ * The default solver returned by this factory is a {@link BrentSolver}.</p>
+ *
+ * @version $Revision: 811685 $ $Date: 2009-09-05 13:36:48 -0400 (Sat, 05 Sep 2009) $
+ */
+public class UnivariateRealSolverFactoryImpl extends UnivariateRealSolverFactory {
+
+    /**
+     * Default constructor.
+     */
+    public UnivariateRealSolverFactoryImpl() {
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public UnivariateRealSolver newDefaultSolver() {
+        return newBrentSolver();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public UnivariateRealSolver newBisectionSolver() {
+        return new BisectionSolver();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public UnivariateRealSolver newBrentSolver() {
+        return new BrentSolver();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public UnivariateRealSolver newNewtonSolver() {
+        return new NewtonSolver();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public UnivariateRealSolver newSecantSolver() {
+        return new SecantSolver();
+    }
+}
diff --git a/src/org/apache/commons/math/analysis/solvers/UnivariateRealSolverImpl.java b/src/org/apache/commons/math/analysis/solvers/UnivariateRealSolverImpl.java
new file mode 100644
index 0000000..fae775f
--- /dev/null
+++ b/src/org/apache/commons/math/analysis/solvers/UnivariateRealSolverImpl.java
@@ -0,0 +1,280 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.math.analysis.solvers;
+
+import org.apache.commons.math.ConvergingAlgorithmImpl;
+import org.apache.commons.math.FunctionEvaluationException;
+import org.apache.commons.math.MathRuntimeException;
+import org.apache.commons.math.analysis.UnivariateRealFunction;
+
+/**
+ * Provide a default implementation for several functions useful to generic
+ * solvers.
+ *
+ * @version $Revision: 811833 $ $Date: 2009-09-06 12:27:50 -0400 (Sun, 06 Sep 2009) $
+ */
+public abstract class UnivariateRealSolverImpl
+        extends ConvergingAlgorithmImpl implements UnivariateRealSolver {
+
+    /**
+     * Maximum error of function.
+     */
+    protected double functionValueAccuracy;
+
+    /**
+     * Default maximum error of function.
+     */
+    protected double defaultFunctionValueAccuracy;
+
+    /**
+     * Indicates where a root has been computed.
+     */
+    protected boolean resultComputed = false;
+
+    /**
+     * The last computed root.
+     */
+    protected double result;
+
+    /**
+     * Value of the function at the last computed result.
+     */
+    protected double functionValue;
+
+    /**
+     * The function to solve.
+     *
+     * @deprecated as of 2.0 the function to solve is passed as an argument
+     *             to the {@link #solve(UnivariateRealFunction, double, double)} or
+     *             {@link UnivariateRealSolverImpl#solve(UnivariateRealFunction, double, double, double)}
+     *             method.
+     */
+    @Deprecated
+    protected UnivariateRealFunction f;
+
+    /**
+     * Construct a solver with given iteration count and accuracy.
+     *
+     * @param f                            the function to solve.
+     * @param defaultAbsoluteAccuracy      maximum absolute error
+     * @param defaultMaximalIterationCount maximum number of iterations
+     * @throws IllegalArgumentException if f is null or the
+     *                                  defaultAbsoluteAccuracy is not valid
+     * @deprecated as of 2.0 the function to solve is passed as an argument
+     *             to the {@link #solve(UnivariateRealFunction, double, double)} or
+     *             {@link UnivariateRealSolverImpl#solve(UnivariateRealFunction, double, double, double)}
+     *             method.
+     */
+    @Deprecated
+    protected UnivariateRealSolverImpl(final UnivariateRealFunction f,
+                                       final int defaultMaximalIterationCount,
+                                       final double defaultAbsoluteAccuracy) {
+        super(defaultMaximalIterationCount, defaultAbsoluteAccuracy);
+        if (f == null) {
+            throw MathRuntimeException.createIllegalArgumentException("function to solve cannot be null");
+        }
+        this.f = f;
+        this.defaultFunctionValueAccuracy = 1.0e-15;
+        this.functionValueAccuracy = defaultFunctionValueAccuracy;
+    }
+
+    /**
+     * Construct a solver with given iteration count and accuracy.
+     *
+     * @param defaultAbsoluteAccuracy      maximum absolute error
+     * @param defaultMaximalIterationCount maximum number of iterations
+     * @throws IllegalArgumentException if f is null or the
+     *                                  defaultAbsoluteAccuracy is not valid
+     */
+    protected UnivariateRealSolverImpl(final int defaultMaximalIterationCount,
+                                       final double defaultAbsoluteAccuracy) {
+        super(defaultMaximalIterationCount, defaultAbsoluteAccuracy);
+        this.defaultFunctionValueAccuracy = 1.0e-15;
+        this.functionValueAccuracy = defaultFunctionValueAccuracy;
+    }
+
+    /**
+     * Check if a result has been computed.
+     *
+     * @throws IllegalStateException if no result has been computed
+     */
+    protected void checkResultComputed() throws IllegalStateException {
+        if (!resultComputed) {
+            throw MathRuntimeException.createIllegalStateException("no result available");
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public double getResult() {
+        checkResultComputed();
+        return result;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public double getFunctionValue() {
+        checkResultComputed();
+        return functionValue;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setFunctionValueAccuracy(final double accuracy) {
+        functionValueAccuracy = accuracy;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public double getFunctionValueAccuracy() {
+        return functionValueAccuracy;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void resetFunctionValueAccuracy() {
+        functionValueAccuracy = defaultFunctionValueAccuracy;
+    }
+
+    /**
+     * Convenience function for implementations.
+     *
+     * @param newResult      the result to set
+     * @param iterationCount the iteration count to set
+     */
+    protected final void setResult(final double newResult, final int iterationCount) {
+        this.result = newResult;
+        this.iterationCount = iterationCount;
+        this.resultComputed = true;
+    }
+
+    /**
+     * Convenience function for implementations.
+     *
+     * @param x              the result to set
+     * @param fx             the result to set
+     * @param iterationCount the iteration count to set
+     */
+    protected final void setResult(final double x, final double fx,
+                                   final int iterationCount) {
+        this.result = x;
+        this.functionValue = fx;
+        this.iterationCount = iterationCount;
+        this.resultComputed = true;
+    }
+
+    /**
+     * Convenience function for implementations.
+     */
+    protected final void clearResult() {
+        this.iterationCount = 0;
+        this.resultComputed = false;
+    }
+
+    /**
+     * Returns true iff the function takes opposite signs at the endpoints.
+     *
+     * @param lower    the lower endpoint
+     * @param upper    the upper endpoint
+     * @param function the function
+     * @return true if f(lower) * f(upper) < 0
+     * @throws FunctionEvaluationException if an error occurs evaluating the
+     *                                     function at the endpoints
+     */
+    protected boolean isBracketing(final double lower, final double upper,
+                                   final UnivariateRealFunction function)
+            throws FunctionEvaluationException {
+        final double f1 = function.value(lower);
+        final double f2 = function.value(upper);
+        return (f1 > 0 && f2 < 0) || (f1 < 0 && f2 > 0);
+    }
+
+    /**
+     * Returns true if the arguments form a (strictly) increasing sequence
+     *
+     * @param start first number
+     * @param mid   second number
+     * @param end   third number
+     * @return true if the arguments form an increasing sequence
+     */
+    protected boolean isSequence(final double start, final double mid, final double end) {
+        return (start < mid) && (mid < end);
+    }
+
+    /**
+     * Verifies that the endpoints specify an interval,
+     * throws IllegalArgumentException if not
+     *
+     * @param lower lower endpoint
+     * @param upper upper endpoint
+     * @throws IllegalArgumentException
+     */
+    protected void verifyInterval(final double lower, final double upper) {
+        if (lower >= upper) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "endpoints do not specify an interval: [{0}, {1}]",
+                    lower, upper);
+        }
+    }
+
+    /**
+     * Verifies that <code>lower < initial < upper</code>
+     * throws IllegalArgumentException if not
+     *
+     * @param lower   lower endpoint
+     * @param initial initial value
+     * @param upper   upper endpoint
+     * @throws IllegalArgumentException
+     */
+    protected void verifySequence(final double lower, final double initial, final double upper) {
+        if (!isSequence(lower, initial, upper)) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "invalid interval, initial value parameters:  lower={0}, initial={1}, upper={2}",
+                    lower, initial, upper);
+        }
+    }
+
+    /**
+     * Verifies that the endpoints specify an interval and the function takes
+     * opposite signs at the enpoints, throws IllegalArgumentException if not
+     *
+     * @param lower    lower endpoint
+     * @param upper    upper endpoint
+     * @param function function
+     * @throws IllegalArgumentException
+     * @throws FunctionEvaluationException if an error occurs evaluating the
+     *                                     function at the endpoints
+     */
+    protected void verifyBracketing(final double lower, final double upper,
+                                    final UnivariateRealFunction function)
+            throws FunctionEvaluationException {
+
+        verifyInterval(lower, upper);
+        if (!isBracketing(lower, upper, function)) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "function values at endpoints do not have different signs.  " +
+                            "Endpoints: [{0}, {1}], Values: [{2}, {3}]",
+                    lower, upper, function.value(lower), function.value(upper));
+        }
+    }
+}
diff --git a/src/org/apache/commons/math/analysis/solvers/UnivariateRealSolverUtils.java b/src/org/apache/commons/math/analysis/solvers/UnivariateRealSolverUtils.java
new file mode 100644
index 0000000..db55aaf
--- /dev/null
+++ b/src/org/apache/commons/math/analysis/solvers/UnivariateRealSolverUtils.java
@@ -0,0 +1,254 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.analysis.solvers;
+
+import org.apache.commons.math.FunctionEvaluationException;
+import org.apache.commons.math.ConvergenceException;
+import org.apache.commons.math.MathRuntimeException;
+import org.apache.commons.math.analysis.UnivariateRealFunction;
+
+/**
+ * Utility routines for {@link UnivariateRealSolver} objects.
+ *
+ * @version $Revision: 885278 $ $Date: 2009-11-29 16:47:51 -0500 (Sun, 29 Nov 2009) $
+ */
+public class UnivariateRealSolverUtils {
+
+    /**
+     * Message for null function.
+     */
+    private static final String NULL_FUNCTION_MESSAGE =
+            "function is null";
+
+    /**
+     * Default constructor.
+     */
+    private UnivariateRealSolverUtils() {
+        super();
+    }
+
+    /**
+     * Convenience method to find a zero of a univariate real function.  A default
+     * solver is used.
+     *
+     * @param f  the function.
+     * @param x0 the lower bound for the interval.
+     * @param x1 the upper bound for the interval.
+     * @return a value where the function is zero.
+     * @throws ConvergenceException        if the iteration count was exceeded
+     * @throws FunctionEvaluationException if an error occurs evaluating
+     *                                     the function
+     * @throws IllegalArgumentException    if f is null or the endpoints do not
+     *                                     specify a valid interval
+     */
+    public static double solve(UnivariateRealFunction f, double x0, double x1)
+            throws ConvergenceException, FunctionEvaluationException {
+        setup(f);
+        return LazyHolder.FACTORY.newDefaultSolver().solve(f, x0, x1);
+    }
+
+    /**
+     * Convenience method to find a zero of a univariate real function.  A default
+     * solver is used.
+     *
+     * @param f                the function
+     * @param x0               the lower bound for the interval
+     * @param x1               the upper bound for the interval
+     * @param absoluteAccuracy the accuracy to be used by the solver
+     * @return a value where the function is zero
+     * @throws ConvergenceException        if the iteration count is exceeded
+     * @throws FunctionEvaluationException if an error occurs evaluating the
+     *                                     function
+     * @throws IllegalArgumentException    if f is null, the endpoints do not
+     *                                     specify a valid interval, or the absoluteAccuracy is not valid for the
+     *                                     default solver
+     */
+    public static double solve(UnivariateRealFunction f, double x0, double x1,
+                               double absoluteAccuracy) throws ConvergenceException,
+            FunctionEvaluationException {
+
+        setup(f);
+        UnivariateRealSolver solver = LazyHolder.FACTORY.newDefaultSolver();
+        solver.setAbsoluteAccuracy(absoluteAccuracy);
+        return solver.solve(f, x0, x1);
+    }
+
+    /**
+     * This method attempts to find two values a and b satisfying <ul>
+     * <li> <code> lowerBound <= a < initial < b <= upperBound</code> </li>
+     * <li> <code> f(a) * f(b) < 0 </code></li>
+     * </ul>
+     * If f is continuous on <code>[a,b],</code> this means that <code>a</code>
+     * and <code>b</code> bracket a root of f.
+     * <p>
+     * The algorithm starts by setting
+     * <code>a := initial -1; b := initial +1,</code> examines the value of the
+     * function at <code>a</code> and <code>b</code> and keeps moving
+     * the endpoints out by one unit each time through a loop that terminates
+     * when one of the following happens: <ul>
+     * <li> <code> f(a) * f(b) < 0 </code> --  success!</li>
+     * <li> <code> a = lower </code> and <code> b = upper</code>
+     * -- ConvergenceException </li>
+     * <li> <code> Integer.MAX_VALUE</code> iterations elapse
+     * -- ConvergenceException </li>
+     * </ul></p>
+     * <p>
+     * <strong>Note: </strong> this method can take
+     * <code>Integer.MAX_VALUE</code> iterations to throw a
+     * <code>ConvergenceException.</code>  Unless you are confident that there
+     * is a root between <code>lowerBound</code> and <code>upperBound</code>
+     * near <code>initial,</code> it is better to use
+     * {@link #bracket(UnivariateRealFunction, double, double, double, int)},
+     * explicitly specifying the maximum number of iterations.</p>
+     *
+     * @param function   the function
+     * @param initial    initial midpoint of interval being expanded to
+     *                   bracket a root
+     * @param lowerBound lower bound (a is never lower than this value)
+     * @param upperBound upper bound (b never is greater than this
+     *                   value)
+     * @return a two element array holding {a, b}
+     * @throws ConvergenceException        if a root can not be bracketted
+     * @throws FunctionEvaluationException if an error occurs evaluating the
+     *                                     function
+     * @throws IllegalArgumentException    if function is null, maximumIterations
+     *                                     is not positive, or initial is not between lowerBound and upperBound
+     */
+    public static double[] bracket(UnivariateRealFunction function,
+                                   double initial, double lowerBound, double upperBound)
+            throws ConvergenceException, FunctionEvaluationException {
+        return bracket(function, initial, lowerBound, upperBound,
+                Integer.MAX_VALUE);
+    }
+
+    /**
+     * This method attempts to find two values a and b satisfying <ul>
+     * <li> <code> lowerBound <= a < initial < b <= upperBound</code> </li>
+     * <li> <code> f(a) * f(b) <= 0 </code> </li>
+     * </ul>
+     * If f is continuous on <code>[a,b],</code> this means that <code>a</code>
+     * and <code>b</code> bracket a root of f.
+     * <p>
+     * The algorithm starts by setting
+     * <code>a := initial -1; b := initial +1,</code> examines the value of the
+     * function at <code>a</code> and <code>b</code> and keeps moving
+     * the endpoints out by one unit each time through a loop that terminates
+     * when one of the following happens: <ul>
+     * <li> <code> f(a) * f(b) <= 0 </code> --  success!</li>
+     * <li> <code> a = lower </code> and <code> b = upper</code>
+     * -- ConvergenceException </li>
+     * <li> <code> maximumIterations</code> iterations elapse
+     * -- ConvergenceException </li></ul></p>
+     *
+     * @param function          the function
+     * @param initial           initial midpoint of interval being expanded to
+     *                          bracket a root
+     * @param lowerBound        lower bound (a is never lower than this value)
+     * @param upperBound        upper bound (b never is greater than this
+     *                          value)
+     * @param maximumIterations maximum number of iterations to perform
+     * @return a two element array holding {a, b}.
+     * @throws ConvergenceException        if the algorithm fails to find a and b
+     *                                     satisfying the desired conditions
+     * @throws FunctionEvaluationException if an error occurs evaluating the
+     *                                     function
+     * @throws IllegalArgumentException    if function is null, maximumIterations
+     *                                     is not positive, or initial is not between lowerBound and upperBound
+     */
+    public static double[] bracket(UnivariateRealFunction function,
+                                   double initial, double lowerBound, double upperBound,
+                                   int maximumIterations) throws ConvergenceException,
+            FunctionEvaluationException {
+
+        if (function == null) {
+            throw MathRuntimeException.createIllegalArgumentException(NULL_FUNCTION_MESSAGE);
+        }
+        if (maximumIterations <= 0) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "bad value for maximum iterations number: {0}", maximumIterations);
+        }
+        if (initial < lowerBound || initial > upperBound || lowerBound >= upperBound) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "invalid bracketing parameters:  lower bound={0},  initial={1}, upper bound={2}",
+                    lowerBound, initial, upperBound);
+        }
+        double a = initial;
+        double b = initial;
+        double fa;
+        double fb;
+        int numIterations = 0;
+
+        do {
+            a = Math.max(a - 1.0, lowerBound);
+            b = Math.min(b + 1.0, upperBound);
+            fa = function.value(a);
+
+            fb = function.value(b);
+            numIterations++;
+        } while ((fa * fb > 0.0) && (numIterations < maximumIterations) &&
+                ((a > lowerBound) || (b < upperBound)));
+
+        if (fa * fb > 0.0) {
+            throw new ConvergenceException(
+                    "number of iterations={0}, maximum iterations={1}, " +
+                            "initial={2}, lower bound={3}, upper bound={4}, final a value={5}, " +
+                            "final b value={6}, f(a)={7}, f(b)={8}",
+                    numIterations, maximumIterations, initial,
+                    lowerBound, upperBound, a, b, fa, fb);
+        }
+
+        return new double[]{a, b};
+    }
+
+    /**
+     * Compute the midpoint of two values.
+     *
+     * @param a first value.
+     * @param b second value.
+     * @return the midpoint.
+     */
+    public static double midpoint(double a, double b) {
+        return (a + b) * .5;
+    }
+
+    /**
+     * Checks to see if f is null, throwing IllegalArgumentException if so.
+     *
+     * @param f input function
+     * @throws IllegalArgumentException if f is null
+     */
+    private static void setup(UnivariateRealFunction f) {
+        if (f == null) {
+            throw MathRuntimeException.createIllegalArgumentException(NULL_FUNCTION_MESSAGE);
+        }
+    }
+
+    // CHECKSTYLE: stop HideUtilityClassConstructor
+
+    /**
+     * Holder for the factory.
+     * <p>We use here the Initialization On Demand Holder Idiom.</p>
+     */
+    private static class LazyHolder {
+        /**
+         * Cached solver factory
+         */
+        private static final UnivariateRealSolverFactory FACTORY = UnivariateRealSolverFactory.newInstance();
+    }
+    // CHECKSTYLE: resume HideUtilityClassConstructor
+
+}
diff --git a/src/org/apache/commons/math/distribution/AbstractContinuousDistribution.java b/src/org/apache/commons/math/distribution/AbstractContinuousDistribution.java
new file mode 100644
index 0000000..22c62c5
--- /dev/null
+++ b/src/org/apache/commons/math/distribution/AbstractContinuousDistribution.java
@@ -0,0 +1,199 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.distribution;
+
+import java.io.Serializable;
+
+import org.apache.commons.math.ConvergenceException;
+import org.apache.commons.math.FunctionEvaluationException;
+import org.apache.commons.math.MathException;
+import org.apache.commons.math.MathRuntimeException;
+import org.apache.commons.math.analysis.UnivariateRealFunction;
+import org.apache.commons.math.analysis.solvers.BrentSolver;
+import org.apache.commons.math.analysis.solvers.UnivariateRealSolverUtils;
+
+/**
+ * Base class for continuous distributions.  Default implementations are
+ * provided for some of the methods that do not vary from distribution to
+ * distribution.
+ *
+ * @version $Revision: 925812 $ $Date: 2010-03-21 11:49:31 -0400 (Sun, 21 Mar 2010) $
+ */
+public abstract class AbstractContinuousDistribution
+        extends AbstractDistribution
+        implements ContinuousDistribution, Serializable {
+
+    /**
+     * Serializable version identifier
+     */
+    private static final long serialVersionUID = -38038050983108802L;
+
+    /**
+     * Solver absolute accuracy for inverse cum computation
+     *
+     * @since 2.1
+     */
+    private double solverAbsoluteAccuracy = 1E-6;
+
+    /**
+     * Default constructor.
+     */
+    protected AbstractContinuousDistribution() {
+        super();
+    }
+
+    /**
+     * Return the probability density for a particular point.
+     *
+     * @param x The point at which the density should be computed.
+     * @return The pdf at point x.
+     * @throws MathRuntimeException if the specialized class hasn't implemented this function
+     * @since 2.1
+     */
+    public double density(double x) throws MathRuntimeException {
+        throw new MathRuntimeException(new UnsupportedOperationException(),
+                "This distribution does not have a density function implemented");
+    }
+
+    @Override
+    public double logDensity(double x) {
+        return Math.log(density(x));
+    }
+
+    /**
+     * For this distribution, X, this method returns the critical point x, such
+     * that P(X < x) = <code>p</code>.
+     *
+     * @param p the desired probability
+     * @return x, such that P(X < x) = <code>p</code>
+     * @throws MathException            if the inverse cumulative probability can not be
+     *                                  computed due to convergence or other numerical errors.
+     * @throws IllegalArgumentException if <code>p</code> is not a valid
+     *                                  probability.
+     */
+    public double inverseCumulativeProbability(final double p)
+            throws MathException {
+        if (p < 0.0 || p > 1.0) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "{0} out of [{1}, {2}] range", p, 0.0, 1.0);
+        }
+
+        // by default, do simple root finding using bracketing and default solver.
+        // subclasses can override if there is a better method.
+        UnivariateRealFunction rootFindingFunction =
+                new UnivariateRealFunction() {
+                    public double value(double x) throws FunctionEvaluationException {
+                        double ret = Double.NaN;
+                        try {
+                            ret = cumulativeProbability(x) - p;
+                        } catch (MathException ex) {
+                            throw new FunctionEvaluationException(ex, x, ex.getPattern(), ex.getArguments());
+                        }
+                        if (Double.isNaN(ret)) {
+                            throw new FunctionEvaluationException(x,
+                                    "Cumulative probability function returned NaN for argument {0} p = {1}", x, p);
+                        }
+                        return ret;
+                    }
+                };
+
+        // Try to bracket root, test domain endoints if this fails
+        double lowerBound = getDomainLowerBound(p);
+        double upperBound = getDomainUpperBound(p);
+        double[] bracket = null;
+        try {
+            bracket = UnivariateRealSolverUtils.bracket(
+                    rootFindingFunction, getInitialDomain(p),
+                    lowerBound, upperBound);
+        } catch (ConvergenceException ex) {
+            /*
+             * Check domain endpoints to see if one gives value that is within
+             * the default solver's defaultAbsoluteAccuracy of 0 (will be the
+             * case if density has bounded support and p is 0 or 1).
+             */
+            if (Math.abs(rootFindingFunction.value(lowerBound)) < getSolverAbsoluteAccuracy()) {
+                return lowerBound;
+            }
+            if (Math.abs(rootFindingFunction.value(upperBound)) < getSolverAbsoluteAccuracy()) {
+                return upperBound;
+            }
+            // Failed bracket convergence was not because of corner solution
+            throw new MathException(ex);
+        }
+
+        // find root
+        double eps = 10.0 * getSolverAbsoluteAccuracy();
+        double root = 0;
+        while (Math.abs(root) < 1000*eps && eps > 1e-320) {
+        	eps /= 10.0;
+            root = UnivariateRealSolverUtils.solve(rootFindingFunction,
+                    // override getSolverAbsoluteAccuracy() to use a Brent solver with
+                    // absolute accuracy different from BrentSolver default
+                    bracket[0], bracket[1], eps);
+        }
+        if (Math.abs(root) < eps) {
+        	root = 0;
+        }
+//        double root = UnivariateRealSolverUtils.solve(rootFindingFunction,
+//                // override getSolverAbsoluteAccuracy() to use a Brent solver with
+//                // absolute accuracy different from BrentSolver default
+//        		bracket[0], bracket[1], getSolverAbsoluteAccuracy());
+        return root;
+    }
+
+    /**
+     * Access the initial domain value, based on <code>p</code>, used to
+     * bracket a CDF root.  This method is used by
+     * {@link #inverseCumulativeProbability(double)} to find critical values.
+     *
+     * @param p the desired probability for the critical value
+     * @return initial domain value
+     */
+    protected abstract double getInitialDomain(double p);
+
+    /**
+     * Access the domain value lower bound, based on <code>p</code>, used to
+     * bracket a CDF root.  This method is used by
+     * {@link #inverseCumulativeProbability(double)} to find critical values.
+     *
+     * @param p the desired probability for the critical value
+     * @return domain value lower bound, i.e.
+     *         P(X < <i>lower bound</i>) < <code>p</code>
+     */
+    protected abstract double getDomainLowerBound(double p);
+
+    /**
+     * Access the domain value upper bound, based on <code>p</code>, used to
+     * bracket a CDF root.  This method is used by
+     * {@link #inverseCumulativeProbability(double)} to find critical values.
+     *
+     * @param p the desired probability for the critical value
+     * @return domain value upper bound, i.e.
+     *         P(X < <i>upper bound</i>) > <code>p</code>
+     */
+    protected abstract double getDomainUpperBound(double p);
+
+    /**
+     * Returns the solver absolute accuracy for inverse cum computation.
+     *
+     * @return the maximum absolute error in inverse cumulative probability estimates
+     * @since 2.1
+     */
+    protected double getSolverAbsoluteAccuracy() {
+        return solverAbsoluteAccuracy;
+    }
+}
diff --git a/src/org/apache/commons/math/distribution/AbstractDistribution.java b/src/org/apache/commons/math/distribution/AbstractDistribution.java
new file mode 100644
index 0000000..5cbec8e
--- /dev/null
+++ b/src/org/apache/commons/math/distribution/AbstractDistribution.java
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.distribution;
+
+import java.io.Serializable;
+
+import org.apache.commons.math.MathException;
+import org.apache.commons.math.MathRuntimeException;
+
+/**
+ * Base class for probability distributions.
+ *
+ * @version $Revision: 811685 $ $Date: 2009-09-05 13:36:48 -0400 (Sat, 05 Sep 2009) $
+ */
+public abstract class AbstractDistribution
+        implements Distribution, Serializable {
+
+    /**
+     * Serializable version identifier
+     */
+    private static final long serialVersionUID = -38038050983108802L;
+
+    /**
+     * Default constructor.
+     */
+    protected AbstractDistribution() {
+        super();
+    }
+
+    /**
+     * For a random variable X whose values are distributed according
+     * to this distribution, this method returns P(x0 ≤ X ≤ x1).
+     * <p>
+     * The default implementation uses the identity</p>
+     * <p>
+     * P(x0 ≤ X ≤ x1) = P(X ≤ x1) - P(X ≤ x0) </p>
+     *
+     * @param x0 the (inclusive) lower bound
+     * @param x1 the (inclusive) upper bound
+     * @return the probability that a random variable with this distribution
+     *         will take a value between <code>x0</code> and <code>x1</code>,
+     *         including the endpoints.
+     * @throws MathException            if the cumulative probability can not be
+     *                                  computed due to convergence or other numerical errors.
+     * @throws IllegalArgumentException if <code>x0 > x1</code>
+     */
+    public double cumulativeProbability(double x0, double x1)
+            throws MathException {
+        if (x0 > x1) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "lower endpoint ({0}) must be less than or equal to upper endpoint ({1})",
+                    x0, x1);
+        }
+        return cumulativeProbability(x1) - cumulativeProbability(x0);
+    }
+}
diff --git a/src/org/apache/commons/math/distribution/AbstractIntegerDistribution.java b/src/org/apache/commons/math/distribution/AbstractIntegerDistribution.java
new file mode 100644
index 0000000..79fc871
--- /dev/null
+++ b/src/org/apache/commons/math/distribution/AbstractIntegerDistribution.java
@@ -0,0 +1,266 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.distribution;
+
+import java.io.Serializable;
+
+import org.apache.commons.math.FunctionEvaluationException;
+import org.apache.commons.math.MathException;
+import org.apache.commons.math.MathRuntimeException;
+
+
+/**
+ * Base class for integer-valued discrete distributions.  Default
+ * implementations are provided for some of the methods that do not vary
+ * from distribution to distribution.
+ *
+ * @version $Revision: 920558 $ $Date: 2010-03-08 17:57:32 -0500 (Mon, 08 Mar 2010) $
+ */
+public abstract class AbstractIntegerDistribution extends AbstractDistribution
+        implements IntegerDistribution, Serializable {
+
+    /**
+     * Message for endpoints in wrong order.
+     */
+    private static final String WRONG_ORDER_ENDPOINTS_MESSAGE =
+            "lower endpoint ({0}) must be less than or equal to upper endpoint ({1})";
+
+    /**
+     * Message for out of range point.
+     */
+    private static final String OUT_OF_RANGE_POINT =
+            "{0} out of [{1}, {2}] range";
+
+    /**
+     * Serializable version identifier
+     */
+    private static final long serialVersionUID = -1146319659338487221L;
+
+    /**
+     * Default constructor.
+     */
+    protected AbstractIntegerDistribution() {
+        super();
+    }
+
+    /**
+     * For a random variable X whose values are distributed according
+     * to this distribution, this method returns P(X ≤ x).  In other words,
+     * this method represents the  (cumulative) distribution function, or
+     * CDF, for this distribution.
+     * <p/>
+     * If <code>x</code> does not represent an integer value, the CDF is
+     * evaluated at the greatest integer less than x.
+     *
+     * @param x the value at which the distribution function is evaluated.
+     * @return cumulative probability that a random variable with this
+     *         distribution takes a value less than or equal to <code>x</code>
+     * @throws MathException if the cumulative probability can not be
+     *                       computed due to convergence or other numerical errors.
+     */
+    public double cumulativeProbability(double x) throws MathException {
+        return cumulativeProbability((int) Math.floor(x));
+    }
+
+    /**
+     * For a random variable X whose values are distributed according
+     * to this distribution, this method returns P(x0 ≤ X ≤ x1).
+     *
+     * @param x0 the (inclusive) lower bound
+     * @param x1 the (inclusive) upper bound
+     * @return the probability that a random variable with this distribution
+     *         will take a value between <code>x0</code> and <code>x1</code>,
+     *         including the endpoints.
+     * @throws MathException            if the cumulative probability can not be
+     *                                  computed due to convergence or other numerical errors.
+     * @throws IllegalArgumentException if <code>x0 > x1</code>
+     */
+    @Override
+    public double cumulativeProbability(double x0, double x1)
+            throws MathException {
+        if (x0 > x1) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    WRONG_ORDER_ENDPOINTS_MESSAGE, x0, x1);
+        }
+        if (Math.floor(x0) < x0) {
+            return cumulativeProbability(((int) Math.floor(x0)) + 1,
+                    (int) Math.floor(x1)); // don't want to count mass below x0
+        } else { // x0 is mathematical integer, so use as is
+            return cumulativeProbability((int) Math.floor(x0),
+                    (int) Math.floor(x1));
+        }
+    }
+
+    /**
+     * For a random variable X whose values are distributed according
+     * to this distribution, this method returns P(X ≤ x).  In other words,
+     * this method represents the probability distribution function, or PDF,
+     * for this distribution.
+     *
+     * @param x the value at which the PDF is evaluated.
+     * @return PDF for this distribution.
+     * @throws MathException if the cumulative probability can not be
+     *                       computed due to convergence or other numerical errors.
+     */
+    public abstract double cumulativeProbability(int x) throws MathException;
+
+    /**
+     * For a random variable X whose values are distributed according
+     * to this distribution, this method returns P(X = x). In other words, this
+     * method represents the probability mass function,  or PMF, for the distribution.
+     * <p/>
+     * If <code>x</code> does not represent an integer value, 0 is returned.
+     *
+     * @param x the value at which the probability density function is evaluated
+     * @return the value of the probability density function at x
+     */
+    public double probability(double x) {
+        double fl = Math.floor(x);
+        if (fl == x) {
+            return this.probability((int) x);
+        } else {
+            return 0;
+        }
+    }
+
+    /**
+     * For a random variable X whose values are distributed according
+     * to this distribution, this method returns P(x0 ≤ X ≤ x1).
+     *
+     * @param x0 the inclusive, lower bound
+     * @param x1 the inclusive, upper bound
+     * @return the cumulative probability.
+     * @throws MathException            if the cumulative probability can not be
+     *                                  computed due to convergence or other numerical errors.
+     * @throws IllegalArgumentException if x0 > x1
+     */
+    public double cumulativeProbability(int x0, int x1) throws MathException {
+        if (x0 > x1) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    WRONG_ORDER_ENDPOINTS_MESSAGE, x0, x1);
+        }
+        return cumulativeProbability(x1) - cumulativeProbability(x0 - 1);
+    }
+
+    /**
+     * For a random variable X whose values are distributed according
+     * to this distribution, this method returns the largest x, such
+     * that P(X ≤ x) ≤ <code>p</code>.
+     *
+     * @param p the desired probability
+     * @return the largest x such that P(X ≤ x) <= p
+     * @throws MathException            if the inverse cumulative probability can not be
+     *                                  computed due to convergence or other numerical errors.
+     * @throws IllegalArgumentException if p < 0 or p > 1
+     */
+    public int inverseCumulativeProbability(final double p) throws MathException {
+        if (p < 0.0 || p > 1.0) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    OUT_OF_RANGE_POINT, p, 0.0, 1.0);
+        }
+
+        // by default, do simple bisection.
+        // subclasses can override if there is a better method.
+        int x0 = getDomainLowerBound(p);
+        int x1 = getDomainUpperBound(p);
+        double pm;
+        while (x0 < x1) {
+            int xm = x0 + (x1 - x0) / 2;
+            pm = checkedCumulativeProbability(xm);
+            if (pm > p) {
+                // update x1
+                if (xm == x1) {
+                    // this can happen with integer division
+                    // simply decrement x1
+                    --x1;
+                } else {
+                    // update x1 normally
+                    x1 = xm;
+                }
+            } else {
+                // update x0
+                if (xm == x0) {
+                    // this can happen with integer division
+                    // simply increment x0
+                    ++x0;
+                } else {
+                    // update x0 normally
+                    x0 = xm;
+                }
+            }
+        }
+
+        // insure x0 is the correct critical point
+        pm = checkedCumulativeProbability(x0);
+        while (pm > p) {
+            --x0;
+            pm = checkedCumulativeProbability(x0);
+        }
+
+        // ensure x0 lies within domain bounds
+        x0 = x0>=getDomainLowerBound(p) ? x0 : getDomainLowerBound(p);
+        x0 = x0<=getDomainUpperBound(p) ? x0 : getDomainUpperBound(p);
+        
+        return x0;
+    }
+
+    /**
+     * Computes the cumulative probablity function and checks for NaN values returned.
+     * Throws MathException if the value is NaN. Wraps and rethrows any MathException encountered
+     * evaluating the cumulative probability function in a FunctionEvaluationException. Throws
+     * FunctionEvaluationException of the cumulative probability function returns NaN.
+     *
+     * @param argument input value
+     * @return cumulative probability
+     * @throws FunctionEvaluationException if a MathException occurs computing the cumulative probability
+     */
+    private double checkedCumulativeProbability(int argument) throws FunctionEvaluationException {
+        double result = Double.NaN;
+        try {
+            result = cumulativeProbability(argument);
+        } catch (MathException ex) {
+            throw new FunctionEvaluationException(ex, argument, ex.getPattern(), ex.getArguments());
+        }
+        if (Double.isNaN(result)) {
+            throw new FunctionEvaluationException(argument,
+                    "Discrete cumulative probability function returned NaN for argument {0}", argument);
+        }
+        return result;
+    }
+
+    /**
+     * Access the domain value lower bound, based on <code>p</code>, used to
+     * bracket a PDF root.  This method is used by
+     * {@link #inverseCumulativeProbability(double)} to find critical values.
+     *
+     * @param p the desired probability for the critical value
+     * @return domain value lower bound, i.e.
+     *         P(X < <i>lower bound</i>) < <code>p</code>
+     */
+    protected abstract int getDomainLowerBound(double p);
+
+    /**
+     * Access the domain value upper bound, based on <code>p</code>, used to
+     * bracket a PDF root.  This method is used by
+     * {@link #inverseCumulativeProbability(double)} to find critical values.
+     *
+     * @param p the desired probability for the critical value
+     * @return domain value upper bound, i.e.
+     *         P(X < <i>upper bound</i>) > <code>p</code>
+     */
+    protected abstract int getDomainUpperBound(double p);
+}
diff --git a/src/org/apache/commons/math/distribution/BetaDistribution.java b/src/org/apache/commons/math/distribution/BetaDistribution.java
new file mode 100644
index 0000000..569682b
--- /dev/null
+++ b/src/org/apache/commons/math/distribution/BetaDistribution.java
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.distribution;
+
+import org.apache.commons.math.MathException;
+
+/**
+ * Computes the cumulative, inverse cumulative and density functions for the beta distribuiton.
+ *
+ * @version $Revision: 920852 $ $Date: 2010-03-09 07:53:44 -0500 (Tue, 09 Mar 2010) $
+ * @see <a href="http://en.wikipedia.org/wiki/Beta_distribution">Beta_distribution</a>
+ * @since 2.0
+ */
+public interface BetaDistribution extends ContinuousDistribution, HasDensity<Double> {
+    /**
+     * Modify the shape parameter, alpha.
+     *
+     * @param alpha the new shape parameter.
+     * @deprecated as of 2.1
+     */
+    @Deprecated
+    void setAlpha(double alpha);
+
+    /**
+     * Access the shape parameter, alpha
+     *
+     * @return alpha.
+     */
+    double getAlpha();
+
+    /**
+     * Modify the shape parameter, beta.
+     *
+     * @param beta the new scale parameter.
+     * @deprecated as of 2.1
+     */
+    @Deprecated
+    void setBeta(double beta);
+
+    /**
+     * Access the shape parameter, beta
+     *
+     * @return beta.
+     */
+    double getBeta();
+
+    /**
+     * Return the probability density for a particular point.
+     *
+     * @param x The point at which the density should be computed.
+     * @return The pdf at point x.
+     * @throws MathException if probability density cannot be computed
+     */
+    double density(Double x) throws MathException;
+
+}
diff --git a/src/org/apache/commons/math/distribution/BetaDistributionImpl.java b/src/org/apache/commons/math/distribution/BetaDistributionImpl.java
new file mode 100644
index 0000000..b896692
--- /dev/null
+++ b/src/org/apache/commons/math/distribution/BetaDistributionImpl.java
@@ -0,0 +1,255 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.distribution;
+
+import org.apache.commons.math.MathException;
+import org.apache.commons.math.MathRuntimeException;
+import org.apache.commons.math.special.Gamma;
+import org.apache.commons.math.special.Beta;
+
+/**
+ * Implements the Beta distribution.
+ * <p>
+ * References:
+ * <ul>
+ * <li><a href="http://en.wikipedia.org/wiki/Beta_distribution">
+ * Beta distribution</a></li>
+ * </ul>
+ * </p>
+ *
+ * @version $Revision: 925900 $ $Date: 2010-03-21 17:10:07 -0400 (Sun, 21 Mar 2010) $
+ * @since 2.0
+ */
+public class BetaDistributionImpl
+        extends AbstractContinuousDistribution implements BetaDistribution {
+
+    /**
+     * Default inverse cumulative probability accurac
+     *
+     * @since 2.1
+     */
+    public static final double DEFAULT_INVERSE_ABSOLUTE_ACCURACY = 1e-9;
+
+    /**
+     * Serializable version identifier.
+     */
+    private static final long serialVersionUID = -1221965979403477668L;
+
+    /**
+     * First shape parameter.
+     */
+    private double alpha;
+
+    /**
+     * Second shape parameter.
+     */
+    private double beta;
+
+    /**
+     * Normalizing factor used in density computations.
+     * updated whenever alpha or beta are changed.
+     */
+    private double z;
+
+    /**
+     * Inverse cumulative probability accuracy
+     */
+    private final double solverAbsoluteAccuracy;
+
+    /**
+     * Build a new instance.
+     *
+     * @param alpha              first shape parameter (must be positive)
+     * @param beta               second shape parameter (must be positive)
+     * @param inverseCumAccuracy the maximum absolute error in inverse cumulative probability estimates
+     *                           (defaults to {@link #DEFAULT_INVERSE_ABSOLUTE_ACCURACY})
+     * @since 2.1
+     */
+    public BetaDistributionImpl(double alpha, double beta, double inverseCumAccuracy) {
+        this.alpha = alpha;
+        this.beta = beta;
+        z = Double.NaN;
+        solverAbsoluteAccuracy = inverseCumAccuracy;
+    }
+
+    /**
+     * Build a new instance.
+     *
+     * @param alpha first shape parameter (must be positive)
+     * @param beta  second shape parameter (must be positive)
+     */
+    public BetaDistributionImpl(double alpha, double beta) {
+        this(alpha, beta, DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
+    }
+
+    /**
+     * {@inheritDoc}
+     *
+     * @deprecated as of 2.1 (class will become immutable in 3.0)
+     */
+    @Deprecated
+    public void setAlpha(double alpha) {
+        this.alpha = alpha;
+        z = Double.NaN;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public double getAlpha() {
+        return alpha;
+    }
+
+    /**
+     * {@inheritDoc}
+     *
+     * @deprecated as of 2.1 (class will become immutable in 3.0)
+     */
+    @Deprecated
+    public void setBeta(double beta) {
+        this.beta = beta;
+        z = Double.NaN;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public double getBeta() {
+        return beta;
+    }
+
+    /**
+     * Recompute the normalization factor.
+     */
+    private void recomputeZ() {
+        if (Double.isNaN(z)) {
+            z = Gamma.logGamma(alpha) + Gamma.logGamma(beta) - Gamma.logGamma(alpha + beta);
+        }
+    }
+
+    /**
+     * Return the probability density for a particular point.
+     *
+     * @param x The point at which the density should be computed.
+     * @return The pdf at point x.
+     * @deprecated
+     */
+    public double density(Double x) {
+        return density(x.doubleValue());
+    }
+
+    /**
+     * Return the probability density for a particular point.
+     *
+     * @param x The point at which the density should be computed.
+     * @return The pdf at point x.
+     * @since 2.1
+     */
+    public double density(double x) {
+        recomputeZ();
+        if (x < 0 || x > 1) {
+            return 0;
+        } else if (x == 0) {
+            if (alpha < 1) {
+                throw MathRuntimeException.createIllegalArgumentException(
+                        "Cannot compute beta density at 0 when alpha = {0,number}", alpha);
+            }
+            return 0;
+        } else if (x == 1) {
+            if (beta < 1) {
+                throw MathRuntimeException.createIllegalArgumentException(
+                        "Cannot compute beta density at 1 when beta = %.3g", beta);
+            }
+            return 0;
+        } else {
+            double logX = Math.log(x);
+            double log1mX = Math.log1p(-x);
+            return Math.exp((alpha - 1) * logX + (beta - 1) * log1mX - z);
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public double inverseCumulativeProbability(double p) throws MathException {
+        if (p == 0) {
+            return 0;
+        } else if (p == 1) {
+            return 1;
+        } else {
+            return super.inverseCumulativeProbability(p);
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected double getInitialDomain(double p) {
+        return p;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected double getDomainLowerBound(double p) {
+        return 0;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected double getDomainUpperBound(double p) {
+        return 1;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public double cumulativeProbability(double x) throws MathException {
+        if (x <= 0) {
+            return 0;
+        } else if (x >= 1) {
+            return 1;
+        } else {
+            return Beta.regularizedBeta(x, alpha, beta);
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public double cumulativeProbability(double x0, double x1) throws MathException {
+        return cumulativeProbability(x1) - cumulativeProbability(x0);
+    }
+
+    /**
+     * Return the absolute accuracy setting of the solver used to estimate
+     * inverse cumulative probabilities.
+     *
+     * @return the solver absolute accuracy
+     * @since 2.1
+     */
+    @Override
+    protected double getSolverAbsoluteAccuracy() {
+        return solverAbsoluteAccuracy;
+    }
+}
diff --git a/src/org/apache/commons/math/distribution/BinomialDistribution.java b/src/org/apache/commons/math/distribution/BinomialDistribution.java
new file mode 100644
index 0000000..e2610e0
--- /dev/null
+++ b/src/org/apache/commons/math/distribution/BinomialDistribution.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.distribution;
+
+/**
+ * The Binomial Distribution.
+ * <p/>
+ * <p>
+ * References:
+ * <ul>
+ * <li><a href="http://mathworld.wolfram.com/BinomialDistribution.html">
+ * Binomial Distribution</a></li>
+ * </ul>
+ * </p>
+ *
+ * @version $Revision: 920852 $ $Date: 2010-03-09 07:53:44 -0500 (Tue, 09 Mar 2010) $
+ */
+public interface BinomialDistribution extends IntegerDistribution {
+    /**
+     * Access the number of trials for this distribution.
+     *
+     * @return the number of trials.
+     */
+    int getNumberOfTrials();
+
+    /**
+     * Access the probability of success for this distribution.
+     *
+     * @return the probability of success.
+     */
+    double getProbabilityOfSuccess();
+
+    /**
+     * Change the number of trials for this distribution.
+     *
+     * @param trials the new number of trials.
+     * @deprecated as of v2.1
+     */
+    @Deprecated
+    void setNumberOfTrials(int trials);
+
+    /**
+     * Change the probability of success for this distribution.
+     *
+     * @param p the new probability of success.
+     * @deprecated as of v2.1
+     */
+    @Deprecated
+    void setProbabilityOfSuccess(double p);
+}
diff --git a/src/org/apache/commons/math/distribution/BinomialDistributionImpl.java b/src/org/apache/commons/math/distribution/BinomialDistributionImpl.java
new file mode 100644
index 0000000..7ad65c7
--- /dev/null
+++ b/src/org/apache/commons/math/distribution/BinomialDistributionImpl.java
@@ -0,0 +1,229 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.distribution;
+
+import java.io.Serializable;
+
+import org.apache.commons.math.MathException;
+import org.apache.commons.math.MathRuntimeException;
+import org.apache.commons.math.special.Beta;
+
+/**
+ * The default implementation of {@link BinomialDistribution}.
+ *
+ * @version $Revision: 920852 $ $Date: 2010-03-09 07:53:44 -0500 (Tue, 09 Mar 2010) $
+ */
+public class BinomialDistributionImpl extends AbstractIntegerDistribution
+        implements BinomialDistribution, Serializable {
+
+    /**
+     * Serializable version identifier
+     */
+    private static final long serialVersionUID = 6751309484392813623L;
+
+    /**
+     * The number of trials.
+     */
+    private int numberOfTrials;
+
+    /**
+     * The probability of success.
+     */
+    private double probabilityOfSuccess;
+
+    /**
+     * Create a binomial distribution with the given number of trials and
+     * probability of success.
+     *
+     * @param trials the number of trials.
+     * @param p      the probability of success.
+     */
+    public BinomialDistributionImpl(int trials, double p) {
+        super();
+        setNumberOfTrialsInternal(trials);
+        setProbabilityOfSuccessInternal(p);
+    }
+
+    /**
+     * Access the number of trials for this distribution.
+     *
+     * @return the number of trials.
+     */
+    public int getNumberOfTrials() {
+        return numberOfTrials;
+    }
+
+    /**
+     * Access the probability of success for this distribution.
+     *
+     * @return the probability of success.
+     */
+    public double getProbabilityOfSuccess() {
+        return probabilityOfSuccess;
+    }
+
+    /**
+     * Change the number of trials for this distribution.
+     *
+     * @param trials the new number of trials.
+     * @throws IllegalArgumentException if <code>trials</code> is not a valid
+     *                                  number of trials.
+     * @deprecated as of 2.1 (class will become immutable in 3.0)
+     */
+    @Deprecated
+    public void setNumberOfTrials(int trials) {
+        setNumberOfTrialsInternal(trials);
+    }
+
+    /**
+     * Change the number of trials for this distribution.
+     *
+     * @param trials the new number of trials.
+     * @throws IllegalArgumentException if <code>trials</code> is not a valid
+     *                                  number of trials.
+     */
+    private void setNumberOfTrialsInternal(int trials) {
+        if (trials < 0) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "number of trials must be non-negative ({0})", trials);
+        }
+        numberOfTrials = trials;
+    }
+
+    /**
+     * Change the probability of success for this distribution.
+     *
+     * @param p the new probability of success.
+     * @throws IllegalArgumentException if <code>p</code> is not a valid
+     *                                  probability.
+     * @deprecated as of 2.1 (class will become immutable in 3.0)
+     */
+    @Deprecated
+    public void setProbabilityOfSuccess(double p) {
+        setProbabilityOfSuccessInternal(p);
+    }
+
+    /**
+     * Change the probability of success for this distribution.
+     *
+     * @param p the new probability of success.
+     * @throws IllegalArgumentException if <code>p</code> is not a valid
+     *                                  probability.
+     */
+    private void setProbabilityOfSuccessInternal(double p) {
+        if (p < 0.0 || p > 1.0) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "{0} out of [{1}, {2}] range", p, 0.0, 1.0);
+        }
+        probabilityOfSuccess = p;
+    }
+
+    /**
+     * Access the domain value lower bound, based on <code>p</code>, used to
+     * bracket a PDF root.
+     *
+     * @param p the desired probability for the critical value
+     * @return domain value lower bound, i.e. P(X < <i>lower bound</i>) <
+     *         <code>p</code>
+     */
+    @Override
+    protected int getDomainLowerBound(double p) {
+        return -1;
+    }
+
+    /**
+     * Access the domain value upper bound, based on <code>p</code>, used to
+     * bracket a PDF root.
+     *
+     * @param p the desired probability for the critical value
+     * @return domain value upper bound, i.e. P(X < <i>upper bound</i>) >
+     *         <code>p</code>
+     */
+    @Override
+    protected int getDomainUpperBound(double p) {
+        return numberOfTrials;
+    }
+
+    /**
+     * For this distribution, X, this method returns P(X ≤ x).
+     *
+     * @param x the value at which the PDF is evaluated.
+     * @return PDF for this distribution.
+     * @throws MathException if the cumulative probability can not be computed
+     *                       due to convergence or other numerical errors.
+     */
+    @Override
+    public double cumulativeProbability(int x) throws MathException {
+        double ret;
+        if (x < 0) {
+            ret = 0.0;
+        } else if (x >= numberOfTrials) {
+            ret = 1.0;
+        } else {
+            ret = 1.0 - Beta.regularizedBeta(getProbabilityOfSuccess(),
+                    x + 1.0, numberOfTrials - x);
+        }
+        return ret;
+    }
+
+    /**
+     * For this distribution, X, this method returns P(X = x).
+     *
+     * @param x the value at which the PMF is evaluated.
+     * @return PMF for this distribution.
+     */
+    public double probability(int x) {
+        double ret;
+        if (x < 0 || x > numberOfTrials) {
+            ret = 0.0;
+        } else {
+            ret = Math.exp(SaddlePointExpansion.logBinomialProbability(x,
+                    numberOfTrials, probabilityOfSuccess,
+                    1.0 - probabilityOfSuccess));
+        }
+        return ret;
+    }
+
+    /**
+     * For this distribution, X, this method returns the largest x, such that
+     * P(X ≤ x) ≤ <code>p</code>.
+     * <p>
+     * Returns <code>-1</code> for p=0 and <code>Integer.MAX_VALUE</code> for
+     * p=1.
+     * </p>
+     *
+     * @param p the desired probability
+     * @return the largest x such that P(X ≤ x) <= p
+     * @throws MathException            if the inverse cumulative probability can not be
+     *                                  computed due to convergence or other numerical errors.
+     * @throws IllegalArgumentException if p < 0 or p > 1
+     */
+    @Override
+    public int inverseCumulativeProbability(final double p)
+            throws MathException {
+        // handle extreme values explicitly
+        if (p == 0) {
+            return -1;
+        }
+        if (p == 1) {
+            return Integer.MAX_VALUE;
+        }
+
+        // use default bisection impl
+        return super.inverseCumulativeProbability(p);
+    }
+}
diff --git a/src/org/apache/commons/math/distribution/CauchyDistribution.java b/src/org/apache/commons/math/distribution/CauchyDistribution.java
new file mode 100644
index 0000000..bcee24c
--- /dev/null
+++ b/src/org/apache/commons/math/distribution/CauchyDistribution.java
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.math.distribution;
+
+/**
+ * Cauchy Distribution.
+ * <p/>
+ * <p>
+ * References:
+ * <ul>
+ * <li><a href="http://mathworld.wolfram.com/CauchyDistribution.html">
+ * Cauchy Distribution</a></li>
+ * </ul>
+ * </p>
+ *
+ * @version $Revision: 920852 $ $Date: 2010-03-09 07:53:44 -0500 (Tue, 09 Mar 2010) $
+ * @since 1.1
+ */
+public interface CauchyDistribution extends ContinuousDistribution {
+
+    /**
+     * Access the median.
+     *
+     * @return median for this distribution
+     */
+    double getMedian();
+
+    /**
+     * Access the scale parameter.
+     *
+     * @return scale parameter for this distribution
+     */
+    double getScale();
+
+    /**
+     * Modify the median.
+     *
+     * @param median for this distribution
+     * @deprecated as of v2.1
+     */
+    @Deprecated
+    void setMedian(double median);
+
+    /**
+     * Modify the scale parameter.
+     *
+     * @param s scale parameter for this distribution
+     * @deprecated as of v2.1
+     */
+    @Deprecated
+    void setScale(double s);
+}
diff --git a/src/org/apache/commons/math/distribution/CauchyDistributionImpl.java b/src/org/apache/commons/math/distribution/CauchyDistributionImpl.java
new file mode 100644
index 0000000..7686815
--- /dev/null
+++ b/src/org/apache/commons/math/distribution/CauchyDistributionImpl.java
@@ -0,0 +1,288 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.math.distribution;
+
+import java.io.Serializable;
+
+import org.apache.commons.math.MathRuntimeException;
+
+/**
+ * Default implementation of
+ * {@link org.apache.commons.math.distribution.CauchyDistribution}.
+ *
+ * @version $Revision: 925900 $ $Date: 2010-03-21 17:10:07 -0400 (Sun, 21 Mar 2010) $
+ * @since 1.1
+ */
+public class CauchyDistributionImpl extends AbstractContinuousDistribution
+        implements CauchyDistribution, Serializable {
+
+    /**
+     * Default inverse cumulative probability accuracy
+     *
+     * @since 2.1
+     */
+    public static final double DEFAULT_INVERSE_ABSOLUTE_ACCURACY = 1e-9;
+
+    /**
+     * Serializable version identifier
+     */
+    private static final long serialVersionUID = 8589540077390120676L;
+
+    /**
+     * The median of this distribution.
+     */
+    private double median = 0;
+
+    /**
+     * The scale of this distribution.
+     */
+    private double scale = 1;
+
+    /**
+     * Inverse cumulative probability accuracy
+     */
+    private final double solverAbsoluteAccuracy;
+
+    /**
+     * Creates cauchy distribution with the medain equal to zero and scale
+     * equal to one.
+     */
+    public CauchyDistributionImpl() {
+        this(0.0, 1.0);
+    }
+
+    /**
+     * Create a cauchy distribution using the given median and scale.
+     *
+     * @param median median for this distribution
+     * @param s      scale parameter for this distribution
+     */
+    public CauchyDistributionImpl(double median, double s) {
+        this(median, s, DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
+    }
+
+    /**
+     * Create a cauchy distribution using the given median and scale.
+     *
+     * @param median             median for this distribution
+     * @param s                  scale parameter for this distribution
+     * @param inverseCumAccuracy the maximum absolute error in inverse cumulative probability estimates
+     *                           (defaults to {@link #DEFAULT_INVERSE_ABSOLUTE_ACCURACY})
+     * @since 2.1
+     */
+    public CauchyDistributionImpl(double median, double s, double inverseCumAccuracy) {
+        super();
+        setMedianInternal(median);
+        setScaleInternal(s);
+        solverAbsoluteAccuracy = inverseCumAccuracy;
+    }
+
+    /**
+     * For this distribution, X, this method returns P(X < <code>x</code>).
+     *
+     * @param x the value at which the CDF is evaluated.
+     * @return CDF evaluted at <code>x</code>.
+     */
+    public double cumulativeProbability(double x) {
+        return 0.5 + (Math.atan((x - median) / scale) / Math.PI);
+    }
+
+    /**
+     * Access the median.
+     *
+     * @return median for this distribution
+     */
+    public double getMedian() {
+        return median;
+    }
+
+    /**
+     * Access the scale parameter.
+     *
+     * @return scale parameter for this distribution
+     */
+    public double getScale() {
+        return scale;
+    }
+
+    /**
+     * Returns the probability density for a particular point.
+     *
+     * @param x The point at which the density should be computed.
+     * @return The pdf at point x.
+     * @since 2.1
+     */
+    @Override
+    public double density(double x) {
+        final double dev = x - median;
+        return (1 / Math.PI) * (scale / (dev * dev + scale * scale));
+    }
+
+    /**
+     * For this distribution, X, this method returns the critical point x, such
+     * that P(X < x) = <code>p</code>.
+     * <p>
+     * Returns <code>Double.NEGATIVE_INFINITY</code> for p=0 and
+     * <code>Double.POSITIVE_INFINITY</code> for p=1.</p>
+     *
+     * @param p the desired probability
+     * @return x, such that P(X < x) = <code>p</code>
+     * @throws IllegalArgumentException if <code>p</code> is not a valid
+     *                                  probability.
+     */
+    @Override
+    public double inverseCumulativeProbability(double p) {
+        double ret;
+        if (p < 0.0 || p > 1.0) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "{0} out of [{1}, {2}] range", p, 0.0, 1.0);
+        } else if (p == 0) {
+            ret = Double.NEGATIVE_INFINITY;
+        } else if (p == 1) {
+            ret = Double.POSITIVE_INFINITY;
+        } else {
+            ret = median + scale * Math.tan(Math.PI * (p - .5));
+        }
+        return ret;
+    }
+
+    /**
+     * Modify the median.
+     *
+     * @param median for this distribution
+     * @deprecated as of 2.1 (class will become immutable in 3.0)
+     */
+    @Deprecated
+    public void setMedian(double median) {
+        setMedianInternal(median);
+    }
+
+    /**
+     * Modify the median.
+     *
+     * @param newMedian for this distribution
+     */
+    private void setMedianInternal(double newMedian) {
+        this.median = newMedian;
+    }
+
+    /**
+     * Modify the scale parameter.
+     *
+     * @param s scale parameter for this distribution
+     * @throws IllegalArgumentException if <code>sd</code> is not positive.
+     * @deprecated as of 2.1 (class will become immutable in 3.0)
+     */
+    @Deprecated
+    public void setScale(double s) {
+        setScaleInternal(s);
+    }
+
+    /**
+     * Modify the scale parameter.
+     *
+     * @param s scale parameter for this distribution
+     * @throws IllegalArgumentException if <code>sd</code> is not positive.
+     */
+    private void setScaleInternal(double s) {
+        if (s <= 0.0) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "scale must be positive ({0})", s);
+        }
+        scale = s;
+    }
+
+    /**
+     * Access the domain value lower bound, based on <code>p</code>, used to
+     * bracket a CDF root.  This method is used by
+     * {@link #inverseCumulativeProbability(double)} to find critical values.
+     *
+     * @param p the desired probability for the critical value
+     * @return domain value lower bound, i.e.
+     *         P(X < <i>lower bound</i>) < <code>p</code>
+     */
+    @Override
+    protected double getDomainLowerBound(double p) {
+        double ret;
+
+        if (p < .5) {
+            ret = -Double.MAX_VALUE;
+        } else {
+            ret = median;
+        }
+
+        return ret;
+    }
+
+    /**
+     * Access the domain value upper bound, based on <code>p</code>, used to
+     * bracket a CDF root.  This method is used by
+     * {@link #inverseCumulativeProbability(double)} to find critical values.
+     *
+     * @param p the desired probability for the critical value
+     * @return domain value upper bound, i.e.
+     *         P(X < <i>upper bound</i>) > <code>p</code>
+     */
+    @Override
+    protected double getDomainUpperBound(double p) {
+        double ret;
+
+        if (p < .5) {
+            ret = median;
+        } else {
+            ret = Double.MAX_VALUE;
+        }
+
+        return ret;
+    }
+
+    /**
+     * Access the initial domain value, based on <code>p</code>, used to
+     * bracket a CDF root.  This method is used by
+     * {@link #inverseCumulativeProbability(double)} to find critical values.
+     *
+     * @param p the desired probability for the critical value
+     * @return initial domain value
+     */
+    @Override
+    protected double getInitialDomain(double p) {
+        double ret;
+
+        if (p < .5) {
+            ret = median - scale;
+        } else if (p > .5) {
+            ret = median + scale;
+        } else {
+            ret = median;
+        }
+
+        return ret;
+    }
+
+    /**
+     * Return the absolute accuracy setting of the solver used to estimate
+     * inverse cumulative probabilities.
+     *
+     * @return the solver absolute accuracy
+     * @since 2.1
+     */
+    @Override
+    protected double getSolverAbsoluteAccuracy() {
+        return solverAbsoluteAccuracy;
+    }
+}
diff --git a/src/org/apache/commons/math/distribution/ChiSquaredDistribution.java b/src/org/apache/commons/math/distribution/ChiSquaredDistribution.java
new file mode 100644
index 0000000..e44d54a
--- /dev/null
+++ b/src/org/apache/commons/math/distribution/ChiSquaredDistribution.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.distribution;
+
+/**
+ * The Chi-Squared Distribution.
+ * <p/>
+ * <p>
+ * References:
+ * <ul>
+ * <li><a href="http://mathworld.wolfram.com/Chi-SquaredDistribution.html">
+ * Chi-Squared Distribution</a></li>
+ * </ul>
+ * </p>
+ *
+ * @version $Revision: 920852 $ $Date: 2010-03-09 07:53:44 -0500 (Tue, 09 Mar 2010) $
+ */
+public interface ChiSquaredDistribution extends ContinuousDistribution, HasDensity<Double> {
+    /**
+     * Modify the degrees of freedom.
+     *
+     * @param degreesOfFreedom the new degrees of freedom.
+     * @deprecated as of v2.1
+     */
+    @Deprecated
+    void setDegreesOfFreedom(double degreesOfFreedom);
+
+    /**
+     * Access the degrees of freedom.
+     *
+     * @return the degrees of freedom.
+     */
+    double getDegreesOfFreedom();
+
+    /**
+     * Return the probability density for a particular point.
+     *
+     * @param x The point at which the density should be computed.
+     * @return The pdf at point x.
+     */
+    double density(Double x);
+}
diff --git a/src/org/apache/commons/math/distribution/ChiSquaredDistributionImpl.java b/src/org/apache/commons/math/distribution/ChiSquaredDistributionImpl.java
new file mode 100644
index 0000000..53ffe12
--- /dev/null
+++ b/src/org/apache/commons/math/distribution/ChiSquaredDistributionImpl.java
@@ -0,0 +1,289 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.distribution;
+
+import java.io.Serializable;
+
+import org.apache.commons.math.MathException;
+
+/**
+ * The default implementation of {@link ChiSquaredDistribution}
+ *
+ * @version $Revision: 925812 $ $Date: 2010-03-21 11:49:31 -0400 (Sun, 21 Mar 2010) $
+ */
+public class ChiSquaredDistributionImpl
+        extends AbstractContinuousDistribution
+        implements ChiSquaredDistribution, Serializable {
+
+    /**
+     * Default inverse cumulative probability accuracy
+     *
+     * @since 2.1
+     */
+    public static final double DEFAULT_INVERSE_ABSOLUTE_ACCURACY = 1e-9;
+
+    /**
+     * Serializable version identifier
+     */
+    private static final long serialVersionUID = -8352658048349159782L;
+
+    /**
+     * Internal Gamma distribution.
+     */
+    private GammaDistribution gamma;
+
+    /**
+     * Inverse cumulative probability accuracy
+     */
+    private final double solverAbsoluteAccuracy;
+
+    /**
+     * Create a Chi-Squared distribution with the given degrees of freedom.
+     *
+     * @param df degrees of freedom.
+     */
+    public ChiSquaredDistributionImpl(double df) {
+        this(df, new GammaDistributionImpl(df / 2.0, 2.0));
+    }
+
+    /**
+     * Create a Chi-Squared distribution with the given degrees of freedom.
+     *
+     * @param df degrees of freedom.
+     * @param g  the underlying gamma distribution used to compute probabilities.
+     * @since 1.2
+     * @deprecated as of 2.1 (to avoid possibly inconsistent state, the
+     *             "GammaDistribution" will be instantiated internally)
+     */
+    @Deprecated
+    public ChiSquaredDistributionImpl(double df, GammaDistribution g) {
+        super();
+        setGammaInternal(g);
+        setDegreesOfFreedomInternal(df);
+        solverAbsoluteAccuracy = DEFAULT_INVERSE_ABSOLUTE_ACCURACY;
+    }
+
+    /**
+     * Create a Chi-Squared distribution with the given degrees of freedom and
+     * inverse cumulative probability accuracy.
+     *
+     * @param df                 degrees of freedom.
+     * @param inverseCumAccuracy the maximum absolute error in inverse cumulative probability estimates
+     *                           (defaults to {@link #DEFAULT_INVERSE_ABSOLUTE_ACCURACY})
+     * @since 2.1
+     */
+    public ChiSquaredDistributionImpl(double df, double inverseCumAccuracy) {
+        super();
+        gamma = new GammaDistributionImpl(df / 2.0, 2.0);
+        setDegreesOfFreedomInternal(df);
+        solverAbsoluteAccuracy = inverseCumAccuracy;
+    }
+
+    /**
+     * Modify the degrees of freedom.
+     *
+     * @param degreesOfFreedom the new degrees of freedom.
+     * @deprecated as of 2.1 (class will become immutable in 3.0)
+     */
+    @Deprecated
+    public void setDegreesOfFreedom(double degreesOfFreedom) {
+        setDegreesOfFreedomInternal(degreesOfFreedom);
+    }
+
+    /**
+     * Modify the degrees of freedom.
+     *
+     * @param degreesOfFreedom the new degrees of freedom.
+     */
+    private void setDegreesOfFreedomInternal(double degreesOfFreedom) {
+        gamma.setAlpha(degreesOfFreedom / 2.0);
+    }
+
+    /**
+     * Access the degrees of freedom.
+     *
+     * @return the degrees of freedom.
+     */
+    public double getDegreesOfFreedom() {
+        return gamma.getAlpha() * 2.0;
+    }
+
+    /**
+     * Return the probability density for a particular point.
+     *
+     * @param x The point at which the density should be computed.
+     * @return The pdf at point x.
+     * @deprecated
+     */
+    public double density(Double x) {
+        return density(x.doubleValue());
+    }
+
+    /**
+     * Return the probability density for a particular point.
+     *
+     * @param x The point at which the density should be computed.
+     * @return The pdf at point x.
+     * @since 2.1
+     */
+    @Override
+    public double density(double x) {
+        return gamma.density(x);
+    }
+
+    /**
+     * For this distribution, X, this method returns P(X < x).
+     *
+     * @param x the value at which the CDF is evaluated.
+     * @return CDF for this distribution.
+     * @throws MathException if the cumulative probability can not be
+     *                       computed due to convergence or other numerical errors.
+     */
+    public double cumulativeProbability(double x) throws MathException {
+        return gamma.cumulativeProbability(x);
+    }
+
+    /**
+     * For this distribution, X, this method returns the critical point x, such
+     * that P(X < x) = <code>p</code>.
+     * <p>
+     * Returns 0 for p=0 and <code>Double.POSITIVE_INFINITY</code> for p=1.</p>
+     *
+     * @param p the desired probability
+     * @return x, such that P(X < x) = <code>p</code>
+     * @throws MathException            if the inverse cumulative probability can not be
+     *                                  computed due to convergence or other numerical errors.
+     * @throws IllegalArgumentException if <code>p</code> is not a valid
+     *                                  probability.
+     */
+    @Override
+    public double inverseCumulativeProbability(final double p)
+            throws MathException {
+        if (p == 0) {
+            return 0d;
+        }
+        if (p == 1) {
+            return Double.POSITIVE_INFINITY;
+        }
+        return super.inverseCumulativeProbability(p);
+    }
+
+    /**
+     * Access the domain value lower bound, based on <code>p</code>, used to
+     * bracket a CDF root.  This method is used by
+     * {@link #inverseCumulativeProbability(double)} to find critical values.
+     *
+     * @param p the desired probability for the critical value
+     * @return domain value lower bound, i.e.
+     *         P(X < <i>lower bound</i>) < <code>p</code>
+     */
+    @Override
+    protected double getDomainLowerBound(double p) {
+        return Double.MIN_VALUE * gamma.getBeta();
+    }
+
+    /**
+     * Access the domain value upper bound, based on <code>p</code>, used to
+     * bracket a CDF root.  This method is used by
+     * {@link #inverseCumulativeProbability(double)} to find critical values.
+     *
+     * @param p the desired probability for the critical value
+     * @return domain value upper bound, i.e.
+     *         P(X < <i>upper bound</i>) > <code>p</code>
+     */
+    @Override
+    protected double getDomainUpperBound(double p) {
+        // NOTE: chi squared is skewed to the left
+        // NOTE: therefore, P(X < μ) > .5
+
+        double ret;
+
+        if (p < .5) {
+            // use mean
+            ret = getDegreesOfFreedom();
+        } else {
+            // use max
+            ret = Double.MAX_VALUE;
+        }
+
+        return ret;
+    }
+
+    /**
+     * Access the initial domain value, based on <code>p</code>, used to
+     * bracket a CDF root.  This method is used by
+     * {@link #inverseCumulativeProbability(double)} to find critical values.
+     *
+     * @param p the desired probability for the critical value
+     * @return initial domain value
+     */
+    @Override
+    protected double getInitialDomain(double p) {
+        // NOTE: chi squared is skewed to the left
+        // NOTE: therefore, P(X < μ) > .5
+
+        double ret;
+
+        if (p < .5) {
+            // use 1/2 mean
+            ret = getDegreesOfFreedom() * .5;
+        } else {
+            // use mean
+            ret = getDegreesOfFreedom();
+        }
+
+        return ret;
+    }
+
+    /**
+     * Modify the underlying gamma distribution.  The caller is responsible for
+     * insuring the gamma distribution has the proper parameter settings.
+     *
+     * @param g the new distribution.
+     * @since 1.2 made public
+     * @deprecated as of 2.1 (class will become immutable in 3.0)
+     */
+    @Deprecated
+    public void setGamma(GammaDistribution g) {
+        setGammaInternal(g);
+    }
+
+    /**
+     * Modify the underlying gamma distribution.  The caller is responsible for
+     * insuring the gamma distribution has the proper parameter settings.
+     *
+     * @param g the new distribution.
+     * @since 1.2 made public
+     */
+    private void setGammaInternal(GammaDistribution g) {
+        this.gamma = g;
+
+    }
+
+
+    /**
+     * Return the absolute accuracy setting of the solver used to estimate
+     * inverse cumulative probabilities.
+     *
+     * @return the solver absolute accuracy
+     * @since 2.1
+     */
+    @Override
+    protected double getSolverAbsoluteAccuracy() {
+        return solverAbsoluteAccuracy;
+    }
+}
diff --git a/src/org/apache/commons/math/distribution/ContinuousDistribution.java b/src/org/apache/commons/math/distribution/ContinuousDistribution.java
new file mode 100644
index 0000000..bef148d
--- /dev/null
+++ b/src/org/apache/commons/math/distribution/ContinuousDistribution.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.distribution;
+
+import org.apache.commons.math.MathException;
+
+/**
+ * <p>Base interface for continuous distributions.</p>
+ * <p/>
+ * <p>Note: this interface will be extended in version 3.0 to include
+ * <br/><code>public double density(double x)</code><br/> RRB: already added this.
+ * that is, from version 3.0 forward, continuous distributions <strong>must</strong>
+ * include implementations of probability density functions. As of version
+ * 2.1, all continuous distribution implementations included in commons-math
+ * provide implementations of this method.</p>
+ *
+ * @version $Revision: 924362 $ $Date: 2010-03-17 12:45:31 -0400 (Wed, 17 Mar 2010) $
+ */
+public interface ContinuousDistribution extends Distribution {
+
+    /**
+     * For this distribution, X, this method returns x such that P(X < x) = p.
+     *
+     * @param p the cumulative probability.
+     * @return x.
+     * @throws MathException if the inverse cumulative probability can not be
+     *                       computed due to convergence or other numerical errors.
+     */
+    double inverseCumulativeProbability(double p) throws MathException;
+
+    /**
+     * Return the probability density for a particular point.
+     *
+     * @param x The point at which the density should be computed.
+     * @return The pdf at point x.
+     */
+    double density(double x);
+
+    double logDensity(double x);// {return Math.log(density(x));
+}
\ No newline at end of file
diff --git a/src/org/apache/commons/math/distribution/DiscreteDistribution.java b/src/org/apache/commons/math/distribution/DiscreteDistribution.java
new file mode 100644
index 0000000..f3d15d4
--- /dev/null
+++ b/src/org/apache/commons/math/distribution/DiscreteDistribution.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.distribution;
+
+
+/**
+ * Base interface for discrete distributions.
+ *
+ * @version $Revision: 811685 $ $Date: 2009-09-05 13:36:48 -0400 (Sat, 05 Sep 2009) $
+ */
+public interface DiscreteDistribution extends Distribution {
+    /**
+     * For a random variable X whose values are distributed according
+     * to this distribution, this method returns P(X = x). In other words, this
+     * method represents the probability mass function, or PMF for the distribution.
+     *
+     * @param x the value at which the probability mass function is evaluated.
+     * @return the value of the probability mass function at x
+     */
+    double probability(double x);
+}
diff --git a/src/org/apache/commons/math/distribution/Distribution.java b/src/org/apache/commons/math/distribution/Distribution.java
new file mode 100644
index 0000000..95b1c38
--- /dev/null
+++ b/src/org/apache/commons/math/distribution/Distribution.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.distribution;
+
+import org.apache.commons.math.MathException;
+
+/**
+ * Base interface for probability distributions.
+ *
+ * @version $Revision: 811685 $ $Date: 2009-09-05 13:36:48 -0400 (Sat, 05 Sep 2009) $
+ */
+public interface Distribution {
+    /**
+     * For a random variable X whose values are distributed according
+     * to this distribution, this method returns P(X ≤ x).  In other words,
+     * this method represents the  (cumulative) distribution function, or
+     * CDF, for this distribution.
+     *
+     * @param x the value at which the distribution function is evaluated.
+     * @return the probability that a random variable with this
+     *         distribution takes a value less than or equal to <code>x</code>
+     * @throws MathException if the cumulative probability can not be
+     *                       computed due to convergence or other numerical errors.
+     */
+    double cumulativeProbability(double x) throws MathException;
+
+    /**
+     * For a random variable X whose values are distributed according
+     * to this distribution, this method returns P(x0 ≤ X ≤ x1).
+     *
+     * @param x0 the (inclusive) lower bound
+     * @param x1 the (inclusive) upper bound
+     * @return the probability that a random variable with this distribution
+     *         will take a value between <code>x0</code> and <code>x1</code>,
+     *         including the endpoints
+     * @throws MathException            if the cumulative probability can not be
+     *                                  computed due to convergence or other numerical errors.
+     * @throws IllegalArgumentException if <code>x0 > x1</code>
+     */
+    double cumulativeProbability(double x0, double x1) throws MathException;
+}
diff --git a/src/org/apache/commons/math/distribution/ExponentialDistribution.java b/src/org/apache/commons/math/distribution/ExponentialDistribution.java
new file mode 100644
index 0000000..22fb7cb
--- /dev/null
+++ b/src/org/apache/commons/math/distribution/ExponentialDistribution.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.distribution;
+
+/**
+ * The Exponential Distribution.
+ * <p/>
+ * <p>
+ * References:
+ * <ul>
+ * <li><a href="http://mathworld.wolfram.com/ExponentialDistribution.html">
+ * Exponential Distribution</a></li>
+ * </ul>
+ * </p>
+ *
+ * @version $Revision: 920852 $ $Date: 2010-03-09 07:53:44 -0500 (Tue, 09 Mar 2010) $
+ */
+public interface ExponentialDistribution extends ContinuousDistribution, HasDensity<Double> {
+    /**
+     * Modify the mean.
+     *
+     * @param mean the new mean.
+     * @deprecated as of v2.1
+     */
+    @Deprecated
+    void setMean(double mean);
+
+    /**
+     * Access the mean.
+     *
+     * @return the mean.
+     */
+    double getMean();
+
+    /**
+     * Return the probability density for a particular point.
+     *
+     * @param x The point at which the density should be computed.
+     * @return The pdf at point x.
+     */
+    double density(Double x);
+}
diff --git a/src/org/apache/commons/math/distribution/ExponentialDistributionImpl.java b/src/org/apache/commons/math/distribution/ExponentialDistributionImpl.java
new file mode 100644
index 0000000..5227afa
--- /dev/null
+++ b/src/org/apache/commons/math/distribution/ExponentialDistributionImpl.java
@@ -0,0 +1,259 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.distribution;
+
+import java.io.Serializable;
+
+import org.apache.commons.math.MathException;
+import org.apache.commons.math.MathRuntimeException;
+
+/**
+ * The default implementation of {@link ExponentialDistribution}.
+ *
+ * @version $Revision: 925900 $ $Date: 2010-03-21 17:10:07 -0400 (Sun, 21 Mar 2010) $
+ */
+public class ExponentialDistributionImpl extends AbstractContinuousDistribution
+        implements ExponentialDistribution, Serializable {
+
+    /**
+     * Default inverse cumulative probability accuracy
+     *
+     * @since 2.1
+     */
+    public static final double DEFAULT_INVERSE_ABSOLUTE_ACCURACY = 1e-9;
+
+    /**
+     * Serializable version identifier
+     */
+    private static final long serialVersionUID = 2401296428283614780L;
+
+    /**
+     * The mean of this distribution.
+     */
+    private double mean;
+
+    /**
+     * Inverse cumulative probability accuracy
+     */
+    private final double solverAbsoluteAccuracy;
+
+    /**
+     * Create a exponential distribution with the given mean.
+     *
+     * @param mean mean of this distribution.
+     */
+    public ExponentialDistributionImpl(double mean) {
+        this(mean, DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
+    }
+
+    /**
+     * Create a exponential distribution with the given mean.
+     *
+     * @param mean               mean of this distribution.
+     * @param inverseCumAccuracy the maximum absolute error in inverse cumulative probability estimates
+     *                           (defaults to {@link #DEFAULT_INVERSE_ABSOLUTE_ACCURACY})
+     * @since 2.1
+     */
+    public ExponentialDistributionImpl(double mean, double inverseCumAccuracy) {
+        super();
+        setMeanInternal(mean);
+        solverAbsoluteAccuracy = inverseCumAccuracy;
+    }
+
+    /**
+     * Modify the mean.
+     *
+     * @param mean the new mean.
+     * @throws IllegalArgumentException if <code>mean</code> is not positive.
+     * @deprecated as of 2.1 (class will become immutable in 3.0)
+     */
+    @Deprecated
+    public void setMean(double mean) {
+        setMeanInternal(mean);
+    }
+
+    /**
+     * Modify the mean.
+     *
+     * @param newMean the new mean.
+     * @throws IllegalArgumentException if <code>newMean</code> is not positive.
+     */
+    private void setMeanInternal(double newMean) {
+        if (newMean <= 0.0) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "mean must be positive ({0})", newMean);
+        }
+        this.mean = newMean;
+    }
+
+    /**
+     * Access the mean.
+     *
+     * @return the mean.
+     */
+    public double getMean() {
+        return mean;
+    }
+
+    /**
+     * Return the probability density for a particular point.
+     *
+     * @param x The point at which the density should be computed.
+     * @return The pdf at point x.
+     * @deprecated - use density(double)
+     */
+    public double density(Double x) {
+        return density(x.doubleValue());
+    }
+
+    /**
+     * Return the probability density for a particular point.
+     *
+     * @param x The point at which the density should be computed.
+     * @return The pdf at point x.
+     * @since 2.1
+     */
+    @Override
+    public double density(double x) {
+        if (x < 0) {
+            return 0;
+        }
+        return Math.exp(-x / mean) / mean;
+    }
+
+    /**
+     * For this distribution, X, this method returns P(X < x).
+     * <p/>
+     * The implementation of this method is based on:
+     * <ul>
+     * <li>
+     * <a href="http://mathworld.wolfram.com/ExponentialDistribution.html">
+     * Exponential Distribution</a>, equation (1).</li>
+     * </ul>
+     *
+     * @param x the value at which the CDF is evaluated.
+     * @return CDF for this distribution.
+     * @throws MathException if the cumulative probability can not be
+     *                       computed due to convergence or other numerical errors.
+     */
+    public double cumulativeProbability(double x) throws MathException {
+        double ret;
+        if (x <= 0.0) {
+            ret = 0.0;
+        } else {
+            ret = 1.0 - Math.exp(-x / mean);
+        }
+        return ret;
+    }
+
+    /**
+     * For this distribution, X, this method returns the critical point x, such
+     * that P(X < x) = <code>p</code>.
+     * <p>
+     * Returns 0 for p=0 and <code>Double.POSITIVE_INFINITY</code> for p=1.</p>
+     *
+     * @param p the desired probability
+     * @return x, such that P(X < x) = <code>p</code>
+     * @throws MathException            if the inverse cumulative probability can not be
+     *                                  computed due to convergence or other numerical errors.
+     * @throws IllegalArgumentException if p < 0 or p > 1.
+     */
+    @Override
+    public double inverseCumulativeProbability(double p) throws MathException {
+        double ret;
+
+        if (p < 0.0 || p > 1.0) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "{0} out of [{1}, {2}] range", p, 0.0, 1.0);
+        } else if (p == 1.0) {
+            ret = Double.POSITIVE_INFINITY;
+        } else {
+            ret = -mean * Math.log(1.0 - p);
+        }
+
+        return ret;
+    }
+
+    /**
+     * Access the domain value lower bound, based on <code>p</code>, used to
+     * bracket a CDF root.
+     *
+     * @param p the desired probability for the critical value
+     * @return domain value lower bound, i.e.
+     *         P(X < <i>lower bound</i>) < <code>p</code>
+     */
+    @Override
+    protected double getDomainLowerBound(double p) {
+        return 0;
+    }
+
+    /**
+     * Access the domain value upper bound, based on <code>p</code>, used to
+     * bracket a CDF root.
+     *
+     * @param p the desired probability for the critical value
+     * @return domain value upper bound, i.e.
+     *         P(X < <i>upper bound</i>) > <code>p</code>
+     */
+    @Override
+    protected double getDomainUpperBound(double p) {
+        // NOTE: exponential is skewed to the left
+        // NOTE: therefore, P(X < μ) > .5
+
+        if (p < .5) {
+            // use mean
+            return mean;
+        } else {
+            // use max
+            return Double.MAX_VALUE;
+        }
+    }
+
+    /**
+     * Access the initial domain value, based on <code>p</code>, used to
+     * bracket a CDF root.
+     *
+     * @param p the desired probability for the critical value
+     * @return initial domain value
+     */
+    @Override
+    protected double getInitialDomain(double p) {
+        // TODO: try to improve on this estimate
+        // TODO: what should really happen here is not derive from AbstractContinuousDistribution
+        // TODO: because the inverse cumulative distribution is simple.
+        // Exponential is skewed to the left, therefore, P(X < μ) > .5
+        if (p < .5) {
+            // use 1/2 mean
+            return mean * .5;
+        } else {
+            // use mean
+            return mean;
+        }
+    }
+
+    /**
+     * Return the absolute accuracy setting of the solver used to estimate
+     * inverse cumulative probabilities.
+     *
+     * @return the solver absolute accuracy
+     * @since 2.1
+     */
+    @Override
+    protected double getSolverAbsoluteAccuracy() {
+        return solverAbsoluteAccuracy;
+    }
+}
diff --git a/src/org/apache/commons/math/distribution/FDistribution.java b/src/org/apache/commons/math/distribution/FDistribution.java
new file mode 100644
index 0000000..2ab5748
--- /dev/null
+++ b/src/org/apache/commons/math/distribution/FDistribution.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.distribution;
+
+/**
+ * F-Distribution.
+ * <p/>
+ * <p>
+ * References:
+ * <ul>
+ * <li><a href="http://mathworld.wolfram.com/F-Distribution.html">
+ * F-Distribution</a></li>
+ * </ul>
+ * </p>
+ *
+ * @version $Revision: 920852 $ $Date: 2010-03-09 07:53:44 -0500 (Tue, 09 Mar 2010) $
+ */
+public interface FDistribution extends ContinuousDistribution {
+    /**
+     * Modify the numerator degrees of freedom.
+     *
+     * @param degreesOfFreedom the new numerator degrees of freedom.
+     * @deprecated as of v2.1
+     */
+    @Deprecated
+    void setNumeratorDegreesOfFreedom(double degreesOfFreedom);
+
+    /**
+     * Access the numerator degrees of freedom.
+     *
+     * @return the numerator degrees of freedom.
+     */
+    double getNumeratorDegreesOfFreedom();
+
+    /**
+     * Modify the denominator degrees of freedom.
+     *
+     * @param degreesOfFreedom the new denominator degrees of freedom.
+     * @deprecated as of v2.1
+     */
+    @Deprecated
+    void setDenominatorDegreesOfFreedom(double degreesOfFreedom);
+
+    /**
+     * Access the denominator degrees of freedom.
+     *
+     * @return the denominator degrees of freedom.
+     */
+    double getDenominatorDegreesOfFreedom();
+}
diff --git a/src/org/apache/commons/math/distribution/FDistributionImpl.java b/src/org/apache/commons/math/distribution/FDistributionImpl.java
new file mode 100644
index 0000000..5c959dd
--- /dev/null
+++ b/src/org/apache/commons/math/distribution/FDistributionImpl.java
@@ -0,0 +1,302 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.distribution;
+
+import java.io.Serializable;
+
+import org.apache.commons.math.MathException;
+import org.apache.commons.math.MathRuntimeException;
+import org.apache.commons.math.special.Beta;
+
+/**
+ * Default implementation of
+ * {@link org.apache.commons.math.distribution.FDistribution}.
+ *
+ * @version $Revision: 925897 $ $Date: 2010-03-21 17:06:46 -0400 (Sun, 21 Mar 2010) $
+ */
+public class FDistributionImpl
+        extends AbstractContinuousDistribution
+        implements FDistribution, Serializable {
+
+    /**
+     * Default inverse cumulative probability accuracy
+     *
+     * @since 2.1
+     */
+    public static final double DEFAULT_INVERSE_ABSOLUTE_ACCURACY = 1e-9;
+
+    /**
+     * Message for non positive degrees of freddom.
+     */
+    private static final String NON_POSITIVE_DEGREES_OF_FREEDOM_MESSAGE =
+            "degrees of freedom must be positive ({0})";
+
+    /**
+     * Serializable version identifier
+     */
+    private static final long serialVersionUID = -8516354193418641566L;
+
+    /**
+     * The numerator degrees of freedom
+     */
+    private double numeratorDegreesOfFreedom;
+
+    /**
+     * The numerator degrees of freedom
+     */
+    private double denominatorDegreesOfFreedom;
+
+    /**
+     * Inverse cumulative probability accuracy
+     */
+    private final double solverAbsoluteAccuracy;
+
+    /**
+     * Create a F distribution using the given degrees of freedom.
+     *
+     * @param numeratorDegreesOfFreedom   the numerator degrees of freedom.
+     * @param denominatorDegreesOfFreedom the denominator degrees of freedom.
+     */
+    public FDistributionImpl(double numeratorDegreesOfFreedom,
+                             double denominatorDegreesOfFreedom) {
+        this(numeratorDegreesOfFreedom, denominatorDegreesOfFreedom, DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
+    }
+
+    /**
+     * Create a F distribution using the given degrees of freedom and inverse cumulative probability accuracy.
+     *
+     * @param numeratorDegreesOfFreedom   the numerator degrees of freedom.
+     * @param denominatorDegreesOfFreedom the denominator degrees of freedom.
+     * @param inverseCumAccuracy          the maximum absolute error in inverse cumulative probability estimates
+     *                                    (defaults to {@link #DEFAULT_INVERSE_ABSOLUTE_ACCURACY})
+     * @since 2.1
+     */
+    public FDistributionImpl(double numeratorDegreesOfFreedom, double denominatorDegreesOfFreedom,
+                             double inverseCumAccuracy) {
+        super();
+        setNumeratorDegreesOfFreedomInternal(numeratorDegreesOfFreedom);
+        setDenominatorDegreesOfFreedomInternal(denominatorDegreesOfFreedom);
+        solverAbsoluteAccuracy = inverseCumAccuracy;
+    }
+
+    /**
+     * Returns the probability density for a particular point.
+     *
+     * @param x The point at which the density should be computed.
+     * @return The pdf at point x.
+     * @since 2.1
+     */
+    @Override
+    public double density(double x) {
+        final double nhalf = numeratorDegreesOfFreedom / 2;
+        final double mhalf = denominatorDegreesOfFreedom / 2;
+        final double logx = Math.log(x);
+        final double logn = Math.log(numeratorDegreesOfFreedom);
+        final double logm = Math.log(denominatorDegreesOfFreedom);
+        final double lognxm = Math.log(numeratorDegreesOfFreedom * x + denominatorDegreesOfFreedom);
+        return Math.exp(nhalf * logn + nhalf * logx - logx + mhalf * logm - nhalf * lognxm -
+                mhalf * lognxm - Beta.logBeta(nhalf, mhalf));
+    }
+
+    /**
+     * For this distribution, X, this method returns P(X < x).
+     * <p/>
+     * The implementation of this method is based on:
+     * <ul>
+     * <li>
+     * <a href="http://mathworld.wolfram.com/F-Distribution.html">
+     * F-Distribution</a>, equation (4).</li>
+     * </ul>
+     *
+     * @param x the value at which the CDF is evaluated.
+     * @return CDF for this distribution.
+     * @throws MathException if the cumulative probability can not be
+     *                       computed due to convergence or other numerical errors.
+     */
+    public double cumulativeProbability(double x) throws MathException {
+        double ret;
+        if (x <= 0.0) {
+            ret = 0.0;
+        } else {
+            double n = numeratorDegreesOfFreedom;
+            double m = denominatorDegreesOfFreedom;
+
+            ret = Beta.regularizedBeta((n * x) / (m + n * x),
+                    0.5 * n,
+                    0.5 * m);
+        }
+        return ret;
+    }
+
+    /**
+     * For this distribution, X, this method returns the critical point x, such
+     * that P(X < x) = <code>p</code>.
+     * <p>
+     * Returns 0 for p=0 and <code>Double.POSITIVE_INFINITY</code> for p=1.</p>
+     *
+     * @param p the desired probability
+     * @return x, such that P(X < x) = <code>p</code>
+     * @throws MathException            if the inverse cumulative probability can not be
+     *                                  computed due to convergence or other numerical errors.
+     * @throws IllegalArgumentException if <code>p</code> is not a valid
+     *                                  probability.
+     */
+    @Override
+    public double inverseCumulativeProbability(final double p)
+            throws MathException {
+        if (p == 0) {
+            return 0d;
+        }
+        if (p == 1) {
+            return Double.POSITIVE_INFINITY;
+        }
+        return super.inverseCumulativeProbability(p);
+    }
+
+    /**
+     * Access the domain value lower bound, based on <code>p</code>, used to
+     * bracket a CDF root.  This method is used by
+     * {@link #inverseCumulativeProbability(double)} to find critical values.
+     *
+     * @param p the desired probability for the critical value
+     * @return domain value lower bound, i.e.
+     *         P(X < <i>lower bound</i>) < <code>p</code>
+     */
+    @Override
+    protected double getDomainLowerBound(double p) {
+        return 0.0;
+    }
+
+    /**
+     * Access the domain value upper bound, based on <code>p</code>, used to
+     * bracket a CDF root.  This method is used by
+     * {@link #inverseCumulativeProbability(double)} to find critical values.
+     *
+     * @param p the desired probability for the critical value
+     * @return domain value upper bound, i.e.
+     *         P(X < <i>upper bound</i>) > <code>p</code>
+     */
+    @Override
+    protected double getDomainUpperBound(double p) {
+        return Double.MAX_VALUE;
+    }
+
+    /**
+     * Access the initial domain value, based on <code>p</code>, used to
+     * bracket a CDF root.  This method is used by
+     * {@link #inverseCumulativeProbability(double)} to find critical values.
+     *
+     * @param p the desired probability for the critical value
+     * @return initial domain value
+     */
+    @Override
+    protected double getInitialDomain(double p) {
+        double ret = 1.0;
+        double d = denominatorDegreesOfFreedom;
+        if (d > 2.0) {
+            // use mean
+            ret = d / (d - 2.0);
+        }
+        return ret;
+    }
+
+    /**
+     * Modify the numerator degrees of freedom.
+     *
+     * @param degreesOfFreedom the new numerator degrees of freedom.
+     * @throws IllegalArgumentException if <code>degreesOfFreedom</code> is not
+     *                                  positive.
+     * @deprecated as of 2.1 (class will become immutable in 3.0)
+     */
+    @Deprecated
+    public void setNumeratorDegreesOfFreedom(double degreesOfFreedom) {
+        setNumeratorDegreesOfFreedomInternal(degreesOfFreedom);
+    }
+
+    /**
+     * Modify the numerator degrees of freedom.
+     *
+     * @param degreesOfFreedom the new numerator degrees of freedom.
+     * @throws IllegalArgumentException if <code>degreesOfFreedom</code> is not
+     *                                  positive.
+     */
+    private void setNumeratorDegreesOfFreedomInternal(double degreesOfFreedom) {
+        if (degreesOfFreedom <= 0.0) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    NON_POSITIVE_DEGREES_OF_FREEDOM_MESSAGE, degreesOfFreedom);
+        }
+        this.numeratorDegreesOfFreedom = degreesOfFreedom;
+    }
+
+    /**
+     * Access the numerator degrees of freedom.
+     *
+     * @return the numerator degrees of freedom.
+     */
+    public double getNumeratorDegreesOfFreedom() {
+        return numeratorDegreesOfFreedom;
+    }
+
+    /**
+     * Modify the denominator degrees of freedom.
+     *
+     * @param degreesOfFreedom the new denominator degrees of freedom.
+     * @throws IllegalArgumentException if <code>degreesOfFreedom</code> is not
+     *                                  positive.
+     * @deprecated as of 2.1 (class will become immutable in 3.0)
+     */
+    @Deprecated
+    public void setDenominatorDegreesOfFreedom(double degreesOfFreedom) {
+        setDenominatorDegreesOfFreedomInternal(degreesOfFreedom);
+    }
+
+    /**
+     * Modify the denominator degrees of freedom.
+     *
+     * @param degreesOfFreedom the new denominator degrees of freedom.
+     * @throws IllegalArgumentException if <code>degreesOfFreedom</code> is not
+     *                                  positive.
+     */
+    private void setDenominatorDegreesOfFreedomInternal(double degreesOfFreedom) {
+        if (degreesOfFreedom <= 0.0) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    NON_POSITIVE_DEGREES_OF_FREEDOM_MESSAGE, degreesOfFreedom);
+        }
+        this.denominatorDegreesOfFreedom = degreesOfFreedom;
+    }
+
+    /**
+     * Access the denominator degrees of freedom.
+     *
+     * @return the denominator degrees of freedom.
+     */
+    public double getDenominatorDegreesOfFreedom() {
+        return denominatorDegreesOfFreedom;
+    }
+
+    /**
+     * Return the absolute accuracy setting of the solver used to estimate
+     * inverse cumulative probabilities.
+     *
+     * @return the solver absolute accuracy
+     * @since 2.1
+     */
+    @Override
+    protected double getSolverAbsoluteAccuracy() {
+        return solverAbsoluteAccuracy;
+    }
+}
diff --git a/src/org/apache/commons/math/distribution/GammaDistribution.java b/src/org/apache/commons/math/distribution/GammaDistribution.java
new file mode 100644
index 0000000..42a21a8
--- /dev/null
+++ b/src/org/apache/commons/math/distribution/GammaDistribution.java
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.distribution;
+
+/**
+ * The Gamma Distribution.
+ * <p/>
+ * <p>
+ * References:
+ * <ul>
+ * <li><a href="http://mathworld.wolfram.com/GammaDistribution.html">
+ * Gamma Distribution</a></li>
+ * </ul>
+ * </p>
+ *
+ * @version $Revision: 920852 $ $Date: 2010-03-09 07:53:44 -0500 (Tue, 09 Mar 2010) $
+ */
+public interface GammaDistribution extends ContinuousDistribution, HasDensity<Double> {
+    /**
+     * Modify the shape parameter, alpha.
+     *
+     * @param alpha the new shape parameter.
+     * @deprecated as of v2.1
+     */
+    @Deprecated
+    void setAlpha(double alpha);
+
+    /**
+     * Access the shape parameter, alpha
+     *
+     * @return alpha.
+     */
+    double getAlpha();
+
+    /**
+     * Modify the scale parameter, beta.
+     *
+     * @param beta the new scale parameter.
+     * @deprecated as of v2.1
+     */
+    @Deprecated
+    void setBeta(double beta);
+
+    /**
+     * Access the scale parameter, beta
+     *
+     * @return beta.
+     */
+    double getBeta();
+
+    /**
+     * Return the probability density for a particular point.
+     *
+     * @param x The point at which the density should be computed.
+     * @return The pdf at point x.
+     */
+    double density(Double x);
+}
diff --git a/src/org/apache/commons/math/distribution/GammaDistributionImpl.java b/src/org/apache/commons/math/distribution/GammaDistributionImpl.java
new file mode 100644
index 0000000..defc265
--- /dev/null
+++ b/src/org/apache/commons/math/distribution/GammaDistributionImpl.java
@@ -0,0 +1,315 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.distribution;
+
+import java.io.Serializable;
+
+import org.apache.commons.math.MathException;
+import org.apache.commons.math.MathRuntimeException;
+import org.apache.commons.math.special.Gamma;
+
+/**
+ * The default implementation of {@link GammaDistribution}.
+ *
+ * @version $Revision: 925812 $ $Date: 2010-03-21 11:49:31 -0400 (Sun, 21 Mar 2010) $
+ */
+public class GammaDistributionImpl extends AbstractContinuousDistribution
+        implements GammaDistribution, Serializable {
+
+    /**
+     * Default inverse cumulative probability accuracy
+     *
+     * @since 2.1
+     */
+    public static final double DEFAULT_INVERSE_ABSOLUTE_ACCURACY = 1e-9;
+
+    /**
+     * Serializable version identifier
+     */
+    private static final long serialVersionUID = -3239549463135430361L;
+
+    /**
+     * The shape parameter.
+     */
+    private double alpha;
+
+    /**
+     * The scale parameter.
+     */
+    private double beta;
+
+    /**
+     * Inverse cumulative probability accuracy
+     */
+    private final double solverAbsoluteAccuracy;
+
+    /**
+     * Create a new gamma distribution with the given alpha and beta values.
+     *
+     * @param alpha the shape parameter.
+     * @param beta  the scale parameter.
+     */
+    public GammaDistributionImpl(double alpha, double beta) {
+        this(alpha, beta, DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
+    }
+
+    /**
+     * Create a new gamma distribution with the given alpha and beta values.
+     *
+     * @param alpha              the shape parameter.
+     * @param beta               the scale parameter.
+     * @param inverseCumAccuracy the maximum absolute error in inverse cumulative probability estimates
+     *                           (defaults to {@link #DEFAULT_INVERSE_ABSOLUTE_ACCURACY})
+     * @since 2.1
+     */
+    public GammaDistributionImpl(double alpha, double beta, double inverseCumAccuracy) {
+        super();
+        setAlphaInternal(alpha);
+        setBetaInternal(beta);
+        solverAbsoluteAccuracy = inverseCumAccuracy;
+    }
+
+    /**
+     * For this distribution, X, this method returns P(X < x).
+     * <p/>
+     * The implementation of this method is based on:
+     * <ul>
+     * <li>
+     * <a href="http://mathworld.wolfram.com/Chi-SquaredDistribution.html">
+     * Chi-Squared Distribution</a>, equation (9).</li>
+     * <li>Casella, G., & Berger, R. (1990). <i>Statistical Inference</i>.
+     * Belmont, CA: Duxbury Press.</li>
+     * </ul>
+     *
+     * @param x the value at which the CDF is evaluated.
+     * @return CDF for this distribution.
+     * @throws MathException if the cumulative probability can not be
+     *                       computed due to convergence or other numerical errors.
+     */
+    public double cumulativeProbability(double x) throws MathException {
+        double ret;
+
+        if (x <= 0.0) {
+            ret = 0.0;
+        } else {
+            ret = Gamma.regularizedGammaP(alpha, x / beta);
+        }
+
+        return ret;
+    }
+
+    /**
+     * For this distribution, X, this method returns the critical point x, such
+     * that P(X < x) = <code>p</code>.
+     * <p>
+     * Returns 0 for p=0 and <code>Double.POSITIVE_INFINITY</code> for p=1.</p>
+     *
+     * @param p the desired probability
+     * @return x, such that P(X < x) = <code>p</code>
+     * @throws MathException            if the inverse cumulative probability can not be
+     *                                  computed due to convergence or other numerical errors.
+     * @throws IllegalArgumentException if <code>p</code> is not a valid
+     *                                  probability.
+     */
+    @Override
+    public double inverseCumulativeProbability(final double p)
+            throws MathException {
+        if (p == 0) {
+            return 0d;
+        }
+        if (p == 1) {
+            return Double.POSITIVE_INFINITY;
+        }
+        return super.inverseCumulativeProbability(p);
+    }
+
+    /**
+     * Modify the shape parameter, alpha.
+     *
+     * @param alpha the new shape parameter.
+     * @throws IllegalArgumentException if <code>alpha</code> is not positive.
+     * @deprecated as of 2.1 (class will become immutable in 3.0)
+     */
+    @Deprecated
+    public void setAlpha(double alpha) {
+        setAlphaInternal(alpha);
+    }
+
+    /**
+     * Modify the shape parameter, alpha.
+     *
+     * @param newAlpha the new shape parameter.
+     * @throws IllegalArgumentException if <code>newAlpha</code> is not positive.
+     */
+    private void setAlphaInternal(double newAlpha) {
+        if (newAlpha <= 0.0) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "alpha must be positive ({0})",
+                    newAlpha);
+        }
+        this.alpha = newAlpha;
+    }
+
+    /**
+     * Access the shape parameter, alpha
+     *
+     * @return alpha.
+     */
+    public double getAlpha() {
+        return alpha;
+    }
+
+    /**
+     * Modify the scale parameter, beta.
+     *
+     * @param newBeta the new scale parameter.
+     * @throws IllegalArgumentException if <code>newBeta</code> is not positive.
+     * @deprecated as of 2.1 (class will become immutable in 3.0)
+     */
+    @Deprecated
+    public void setBeta(double newBeta) {
+        setBetaInternal(newBeta);
+    }
+
+    /**
+     * Modify the scale parameter, beta.
+     *
+     * @param newBeta the new scale parameter.
+     * @throws IllegalArgumentException if <code>newBeta</code> is not positive.
+     */
+    private void setBetaInternal(double newBeta) {
+        if (newBeta <= 0.0) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "beta must be positive ({0})",
+                    newBeta);
+        }
+        this.beta = newBeta;
+    }
+
+    /**
+     * Access the scale parameter, beta
+     *
+     * @return beta.
+     */
+    public double getBeta() {
+        return beta;
+    }
+
+    /**
+     * Returns the probability density for a particular point.
+     *
+     * @param x The point at which the density should be computed.
+     * @return The pdf at point x.
+     */
+    @Override
+    public double density(double x) {
+        if (x < 0) return 0;
+        return Math.pow(x / beta, alpha - 1) / beta * Math.exp(-x / beta) / Math.exp(Gamma.logGamma(alpha));
+    }
+
+    /**
+     * Return the probability density for a particular point.
+     *
+     * @param x The point at which the density should be computed.
+     * @return The pdf at point x.
+     * @deprecated
+     */
+    public double density(Double x) {
+        return density(x.doubleValue());
+    }
+
+    /**
+     * Access the domain value lower bound, based on <code>p</code>, used to
+     * bracket a CDF root.  This method is used by
+     * {@link #inverseCumulativeProbability(double)} to find critical values.
+     *
+     * @param p the desired probability for the critical value
+     * @return domain value lower bound, i.e.
+     *         P(X < <i>lower bound</i>) < <code>p</code>
+     */
+    @Override
+    protected double getDomainLowerBound(double p) {
+        // TODO: try to improve on this estimate
+        return Double.MIN_VALUE;
+    }
+
+    /**
+     * Access the domain value upper bound, based on <code>p</code>, used to
+     * bracket a CDF root.  This method is used by
+     * {@link #inverseCumulativeProbability(double)} to find critical values.
+     *
+     * @param p the desired probability for the critical value
+     * @return domain value upper bound, i.e.
+     *         P(X < <i>upper bound</i>) > <code>p</code>
+     */
+    @Override
+    protected double getDomainUpperBound(double p) {
+        // TODO: try to improve on this estimate
+        // NOTE: gamma is skewed to the left
+        // NOTE: therefore, P(X < μ) > .5
+
+        double ret;
+
+        if (p < .5) {
+            // use mean
+            ret = alpha * beta;
+        } else {
+            // use max value
+            ret = Double.MAX_VALUE;
+        }
+
+        return ret;
+    }
+
+    /**
+     * Access the initial domain value, based on <code>p</code>, used to
+     * bracket a CDF root.  This method is used by
+     * {@link #inverseCumulativeProbability(double)} to find critical values.
+     *
+     * @param p the desired probability for the critical value
+     * @return initial domain value
+     */
+    @Override
+    protected double getInitialDomain(double p) {
+        // TODO: try to improve on this estimate
+        // Gamma is skewed to the left, therefore, P(X < μ) > .5
+
+        double ret;
+
+        if (p < .5) {
+            // use 1/2 mean
+            ret = alpha * beta * .5;
+        } else {
+            // use mean
+            ret = alpha * beta;
+        }
+
+        return ret;
+    }
+
+    /**
+     * Return the absolute accuracy setting of the solver used to estimate
+     * inverse cumulative probabilities.
+     *
+     * @return the solver absolute accuracy
+     * @since 2.1
+     */
+    @Override
+    protected double getSolverAbsoluteAccuracy() {
+        return solverAbsoluteAccuracy;
+    }
+}
diff --git a/src/org/apache/commons/math/distribution/HasDensity.java b/src/org/apache/commons/math/distribution/HasDensity.java
new file mode 100644
index 0000000..9044374
--- /dev/null
+++ b/src/org/apache/commons/math/distribution/HasDensity.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.math.distribution;
+
+import org.apache.commons.math.MathException;
+
+/**
+ * <p>Interface that signals that a distribution can compute the probability density function
+ * for a particular point.
+ *
+ * @param <P> the type of the point at which density is to be computed, this
+ *            may be for example <code>Double.</code></p>
+ *            <p/>
+ *            <p>This interface is deprecated.  As of version 2.0, the {@link ContinuousDistribution}
+ *            interface will be extended to include a <code>density(double)<code> method.</p>
+ * @version $Revision: 924362 $ $Date: 2010-03-17 12:45:31 -0400 (Wed, 17 Mar 2010) $
+ * @deprecated to be removed in math 3.0
+ */
+public interface HasDensity<P> {
+
+    /**
+     * Compute the probability density function.
+     *
+     * @param x point for which the probability density is requested
+     * @return probability density at point x
+     * @throws MathException if probability density cannot be computed at specifed point
+     */
+    double density(P x) throws MathException;
+
+}
diff --git a/src/org/apache/commons/math/distribution/HypergeometricDistribution.java b/src/org/apache/commons/math/distribution/HypergeometricDistribution.java
new file mode 100644
index 0000000..e8cda01
--- /dev/null
+++ b/src/org/apache/commons/math/distribution/HypergeometricDistribution.java
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.math.distribution;
+
+/**
+ * The Hypergeometric Distribution.
+ * <p/>
+ * <p>
+ * References:
+ * <ul>
+ * <li><a href="http://mathworld.wolfram.com/HypergeometricDistribution.html">
+ * Hypergeometric Distribution</a></li>
+ * </ul>
+ * </p>
+ *
+ * @version $Revision: 920852 $ $Date: 2010-03-09 07:53:44 -0500 (Tue, 09 Mar 2010) $
+ */
+public interface HypergeometricDistribution extends IntegerDistribution {
+
+    /**
+     * Access the number of successes.
+     *
+     * @return the number of successes.
+     */
+    int getNumberOfSuccesses();
+
+    /**
+     * Access the population size.
+     *
+     * @return the population size.
+     */
+    int getPopulationSize();
+
+    /**
+     * Access the sample size.
+     *
+     * @return the sample size.
+     */
+    int getSampleSize();
+
+    /**
+     * Modify the number of successes.
+     *
+     * @param num the new number of successes.
+     * @deprecated as of v2.1
+     */
+    @Deprecated
+    void setNumberOfSuccesses(int num);
+
+    /**
+     * Modify the population size.
+     *
+     * @param size the new population size.
+     * @deprecated as of v2.1
+     */
+    @Deprecated
+    void setPopulationSize(int size);
+
+    /**
+     * Modify the sample size.
+     *
+     * @param size the new sample size.
+     * @deprecated as of v2.1
+     */
+    @Deprecated
+    void setSampleSize(int size);
+}
diff --git a/src/org/apache/commons/math/distribution/HypergeometricDistributionImpl.java b/src/org/apache/commons/math/distribution/HypergeometricDistributionImpl.java
new file mode 100644
index 0000000..42f3cf2
--- /dev/null
+++ b/src/org/apache/commons/math/distribution/HypergeometricDistributionImpl.java
@@ -0,0 +1,363 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.math.distribution;
+
+import java.io.Serializable;
+
+import org.apache.commons.math.MathRuntimeException;
+import org.apache.commons.math.util.MathUtils;
+
+/**
+ * The default implementation of {@link HypergeometricDistribution}.
+ *
+ * @version $Revision: 920852 $ $Date: 2010-03-09 07:53:44 -0500 (Tue, 09 Mar 2010) $
+ */
+public class HypergeometricDistributionImpl extends AbstractIntegerDistribution
+        implements HypergeometricDistribution, Serializable {
+
+    /**
+     * Serializable version identifier
+     */
+    private static final long serialVersionUID = -436928820673516179L;
+
+    /**
+     * The number of successes in the population.
+     */
+    private int numberOfSuccesses;
+
+    /**
+     * The population size.
+     */
+    private int populationSize;
+
+    /**
+     * The sample size.
+     */
+    private int sampleSize;
+
+    /**
+     * Construct a new hypergeometric distribution with the given the population
+     * size, the number of successes in the population, and the sample size.
+     *
+     * @param populationSize    the population size.
+     * @param numberOfSuccesses number of successes in the population.
+     * @param sampleSize        the sample size.
+     */
+    public HypergeometricDistributionImpl(int populationSize,
+                                          int numberOfSuccesses, int sampleSize) {
+        super();
+        if (numberOfSuccesses > populationSize) {
+            throw MathRuntimeException
+                    .createIllegalArgumentException(
+                            "number of successes ({0}) must be less than or equal to population size ({1})",
+                            numberOfSuccesses, populationSize);
+        }
+        if (sampleSize > populationSize) {
+            throw MathRuntimeException
+                    .createIllegalArgumentException(
+                            "sample size ({0}) must be less than or equal to population size ({1})",
+                            sampleSize, populationSize);
+        }
+
+        setPopulationSizeInternal(populationSize);
+        setSampleSizeInternal(sampleSize);
+        setNumberOfSuccessesInternal(numberOfSuccesses);
+    }
+
+    /**
+     * For this distribution, X, this method returns P(X ≤ x).
+     *
+     * @param x the value at which the PDF is evaluated.
+     * @return PDF for this distribution.
+     */
+    @Override
+    public double cumulativeProbability(int x) {
+        double ret;
+
+        int[] domain = getDomain(populationSize, numberOfSuccesses, sampleSize);
+        if (x < domain[0]) {
+            ret = 0.0;
+        } else if (x >= domain[1]) {
+            ret = 1.0;
+        } else {
+            ret = innerCumulativeProbability(domain[0], x, 1, populationSize,
+                    numberOfSuccesses, sampleSize);
+        }
+
+        return ret;
+    }
+
+    /**
+     * Return the domain for the given hypergeometric distribution parameters.
+     *
+     * @param n the population size.
+     * @param m number of successes in the population.
+     * @param k the sample size.
+     * @return a two element array containing the lower and upper bounds of the
+     *         hypergeometric distribution.
+     */
+    private int[] getDomain(int n, int m, int k) {
+        return new int[]{getLowerDomain(n, m, k), getUpperDomain(m, k)};
+    }
+
+    /**
+     * Access the domain value lower bound, based on <code>p</code>, used to
+     * bracket a PDF root.
+     *
+     * @param p the desired probability for the critical value
+     * @return domain value lower bound, i.e. P(X < <i>lower bound</i>) <
+     *         <code>p</code>
+     */
+    @Override
+    protected int getDomainLowerBound(double p) {
+        return getLowerDomain(populationSize, numberOfSuccesses, sampleSize);
+    }
+
+    /**
+     * Access the domain value upper bound, based on <code>p</code>, used to
+     * bracket a PDF root.
+     *
+     * @param p the desired probability for the critical value
+     * @return domain value upper bound, i.e. P(X < <i>upper bound</i>) >
+     *         <code>p</code>
+     */
+    @Override
+    protected int getDomainUpperBound(double p) {
+        return getUpperDomain(sampleSize, numberOfSuccesses);
+    }
+
+    /**
+     * Return the lowest domain value for the given hypergeometric distribution
+     * parameters.
+     *
+     * @param n the population size.
+     * @param m number of successes in the population.
+     * @param k the sample size.
+     * @return the lowest domain value of the hypergeometric distribution.
+     */
+    private int getLowerDomain(int n, int m, int k) {
+        return Math.max(0, m - (n - k));
+    }
+
+    /**
+     * Access the number of successes.
+     *
+     * @return the number of successes.
+     */
+    public int getNumberOfSuccesses() {
+        return numberOfSuccesses;
+    }
+
+    /**
+     * Access the population size.
+     *
+     * @return the population size.
+     */
+    public int getPopulationSize() {
+        return populationSize;
+    }
+
+    /**
+     * Access the sample size.
+     *
+     * @return the sample size.
+     */
+    public int getSampleSize() {
+        return sampleSize;
+    }
+
+    /**
+     * Return the highest domain value for the given hypergeometric distribution
+     * parameters.
+     *
+     * @param m number of successes in the population.
+     * @param k the sample size.
+     * @return the highest domain value of the hypergeometric distribution.
+     */
+    private int getUpperDomain(int m, int k) {
+        return Math.min(k, m);
+    }
+
+    /**
+     * For this distribution, X, this method returns P(X = x).
+     *
+     * @param x the value at which the PMF is evaluated.
+     * @return PMF for this distribution.
+     */
+    public double probability(int x) {
+        double ret;
+
+        int[] domain = getDomain(populationSize, numberOfSuccesses, sampleSize);
+        if (x < domain[0] || x > domain[1]) {
+            ret = 0.0;
+        } else {
+            double p = (double) sampleSize / (double) populationSize;
+            double q = (double) (populationSize - sampleSize) / (double) populationSize;
+            double p1 = SaddlePointExpansion.logBinomialProbability(x,
+                    numberOfSuccesses, p, q);
+            double p2 =
+                    SaddlePointExpansion.logBinomialProbability(sampleSize - x,
+                            populationSize - numberOfSuccesses, p, q);
+            double p3 =
+                    SaddlePointExpansion.logBinomialProbability(sampleSize, populationSize, p, q);
+            ret = Math.exp(p1 + p2 - p3);
+        }
+
+        return ret;
+    }
+
+    /**
+     * For the distribution, X, defined by the given hypergeometric distribution
+     * parameters, this method returns P(X = x).
+     *
+     * @param n the population size.
+     * @param m number of successes in the population.
+     * @param k the sample size.
+     * @param x the value at which the PMF is evaluated.
+     * @return PMF for the distribution.
+     */
+    private double probability(int n, int m, int k, int x) {
+        return Math.exp(MathUtils.binomialCoefficientLog(m, x) +
+                MathUtils.binomialCoefficientLog(n - m, k - x) -
+                MathUtils.binomialCoefficientLog(n, k));
+    }
+
+    /**
+     * Modify the number of successes.
+     *
+     * @param num the new number of successes.
+     * @throws IllegalArgumentException if <code>num</code> is negative.
+     * @deprecated as of 2.1 (class will become immutable in 3.0)
+     */
+    @Deprecated
+    public void setNumberOfSuccesses(int num) {
+        setNumberOfSuccessesInternal(num);
+    }
+
+    /**
+     * Modify the number of successes.
+     *
+     * @param num the new number of successes.
+     * @throws IllegalArgumentException if <code>num</code> is negative.
+     */
+    private void setNumberOfSuccessesInternal(int num) {
+        if (num < 0) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "number of successes must be non-negative ({0})", num);
+        }
+        numberOfSuccesses = num;
+    }
+
+    /**
+     * Modify the population size.
+     *
+     * @param size the new population size.
+     * @throws IllegalArgumentException if <code>size</code> is not positive.
+     * @deprecated as of 2.1 (class will become immutable in 3.0)
+     */
+    @Deprecated
+    public void setPopulationSize(int size) {
+        setPopulationSizeInternal(size);
+    }
+
+    /**
+     * Modify the population size.
+     *
+     * @param size the new population size.
+     * @throws IllegalArgumentException if <code>size</code> is not positive.
+     */
+    private void setPopulationSizeInternal(int size) {
+        if (size <= 0) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "population size must be positive ({0})", size);
+        }
+        populationSize = size;
+    }
+
+    /**
+     * Modify the sample size.
+     *
+     * @param size the new sample size.
+     * @throws IllegalArgumentException if <code>size</code> is negative.
+     * @deprecated as of 2.1 (class will become immutable in 3.0)
+     */
+    @Deprecated
+    public void setSampleSize(int size) {
+        setSampleSizeInternal(size);
+    }
+
+    /**
+     * Modify the sample size.
+     *
+     * @param size the new sample size.
+     * @throws IllegalArgumentException if <code>size</code> is negative.
+     */
+    private void setSampleSizeInternal(int size) {
+        if (size < 0) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "sample size must be positive ({0})", size);
+        }
+        sampleSize = size;
+    }
+
+    /**
+     * For this distribution, X, this method returns P(X ≥ x).
+     *
+     * @param x the value at which the CDF is evaluated.
+     * @return upper tail CDF for this distribution.
+     * @since 1.1
+     */
+    public double upperCumulativeProbability(int x) {
+        double ret;
+
+        final int[] domain = getDomain(populationSize, numberOfSuccesses, sampleSize);
+        if (x < domain[0]) {
+            ret = 1.0;
+        } else if (x > domain[1]) {
+            ret = 0.0;
+        } else {
+            ret = innerCumulativeProbability(domain[1], x, -1, populationSize, numberOfSuccesses, sampleSize);
+        }
+
+        return ret;
+    }
+
+    /**
+     * For this distribution, X, this method returns P(x0 ≤ X ≤ x1). This
+     * probability is computed by summing the point probabilities for the values
+     * x0, x0 + 1, x0 + 2, ..., x1, in the order directed by dx.
+     *
+     * @param x0 the inclusive, lower bound
+     * @param x1 the inclusive, upper bound
+     * @param dx the direction of summation. 1 indicates summing from x0 to x1.
+     *           0 indicates summing from x1 to x0.
+     * @param n  the population size.
+     * @param m  number of successes in the population.
+     * @param k  the sample size.
+     * @return P(x0 ≤ X ≤ x1).
+     */
+    private double innerCumulativeProbability(int x0, int x1, int dx, int n,
+                                              int m, int k) {
+        double ret = probability(n, m, k, x0);
+        while (x0 != x1) {
+            x0 += dx;
+            ret += probability(n, m, k, x0);
+        }
+        return ret;
+    }
+}
diff --git a/src/org/apache/commons/math/distribution/IntegerDistribution.java b/src/org/apache/commons/math/distribution/IntegerDistribution.java
new file mode 100644
index 0000000..8e34e39
--- /dev/null
+++ b/src/org/apache/commons/math/distribution/IntegerDistribution.java
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.distribution;
+
+import org.apache.commons.math.MathException;
+
+/**
+ * Interface for discrete distributions of integer-valued random variables.
+ *
+ * @version $Revision: 811685 $ $Date: 2009-09-05 13:36:48 -0400 (Sat, 05 Sep 2009) $
+ */
+public interface IntegerDistribution extends DiscreteDistribution {
+    /**
+     * For a random variable X whose values are distributed according
+     * to this distribution, this method returns P(X = x). In other words, this
+     * method represents the probability mass function for the distribution.
+     *
+     * @param x the value at which the probability density function is evaluated.
+     * @return the value of the probability density function at x
+     */
+    double probability(int x);
+
+    /**
+     * For a random variable X whose values are distributed according
+     * to this distribution, this method returns P(X ≤ x).  In other words,
+     * this method represents the probability distribution function, or PDF
+     * for the distribution.
+     *
+     * @param x the value at which the PDF is evaluated.
+     * @return PDF for this distribution.
+     * @throws MathException if the cumulative probability can not be
+     *                       computed due to convergence or other numerical errors.
+     */
+    double cumulativeProbability(int x) throws MathException;
+
+    /**
+     * For this distribution, X, this method returns P(x0 ≤ X ≤ x1).
+     *
+     * @param x0 the inclusive, lower bound
+     * @param x1 the inclusive, upper bound
+     * @return the cumulative probability.
+     * @throws MathException            if the cumulative probability can not be
+     *                                  computed due to convergence or other numerical errors.
+     * @throws IllegalArgumentException if x0 > x1
+     */
+    double cumulativeProbability(int x0, int x1) throws MathException;
+
+    /**
+     * For this distribution, X, this method returns the largest x such that
+     * P(X ≤ x) <= p.
+     * <p>
+     * Note that this definition implies: <ul>
+     * <li> If there is a minimum value, <code>m</code>, with postive
+     * probablility under (the density of) X, then <code>m - 1</code> is
+     * returned by <code>inverseCumulativeProbability(0).</code>  If there is
+     * no such value <code>m,  Integer.MIN_VALUE</code> is
+     * returned.</li>
+     * <li> If there is a maximum value, <code>M</code>, such that
+     * P(X ≤ M) =1, then <code>M</code> is returned by
+     * <code>inverseCumulativeProbability(1).</code>
+     * If there is no such value, <code>M, Integer.MAX_VALUE</code> is
+     * returned.</li></ul></p>
+     *
+     * @param p the cumulative probability.
+     * @return the largest x such that P(X ≤ x) <= p
+     * @throws MathException            if the inverse cumulative probability can not be
+     *                                  computed due to convergence or other numerical errors.
+     * @throws IllegalArgumentException if p is not between 0 and 1 (inclusive)
+     */
+    int inverseCumulativeProbability(double p) throws MathException;
+}
diff --git a/src/org/apache/commons/math/distribution/NormalDistribution.java b/src/org/apache/commons/math/distribution/NormalDistribution.java
new file mode 100644
index 0000000..adafe4e
--- /dev/null
+++ b/src/org/apache/commons/math/distribution/NormalDistribution.java
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.math.distribution;
+
+/**
+ * Normal (Gauss) Distribution.
+ * <p/>
+ * <p>
+ * References:</p><p>
+ * <ul>
+ * <li><a href="http://mathworld.wolfram.com/NormalDistribution.html">
+ * Normal Distribution</a></li>
+ * </ul>
+ * </p>
+ *
+ * @version $Revision: 920852 $ $Date: 2010-03-09 07:53:44 -0500 (Tue, 09 Mar 2010) $
+ */
+public interface NormalDistribution extends ContinuousDistribution, HasDensity<Double> {
+    /**
+     * Access the mean.
+     *
+     * @return mean for this distribution
+     */
+    double getMean();
+
+    /**
+     * Modify the mean.
+     *
+     * @param mean for this distribution
+     * @deprecated as of v2.1
+     */
+    @Deprecated
+    void setMean(double mean);
+
+    /**
+     * Access the standard deviation.
+     *
+     * @return standard deviation for this distribution
+     */
+    double getStandardDeviation();
+
+    /**
+     * Modify the standard deviation.
+     *
+     * @param sd standard deviation for this distribution
+     * @deprecated as of v2.1
+     */
+    @Deprecated
+    void setStandardDeviation(double sd);
+
+    /**
+     * Return the probability density for a particular point.
+     *
+     * @param x The point at which the density should be computed.
+     * @return The pdf at point x.
+     */
+    double density(Double x);
+}
diff --git a/src/org/apache/commons/math/distribution/NormalDistributionImpl.java b/src/org/apache/commons/math/distribution/NormalDistributionImpl.java
new file mode 100644
index 0000000..913dbdc
--- /dev/null
+++ b/src/org/apache/commons/math/distribution/NormalDistributionImpl.java
@@ -0,0 +1,327 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.math.distribution;
+
+import java.io.Serializable;
+
+import org.apache.commons.math.MathException;
+import org.apache.commons.math.MathRuntimeException;
+import org.apache.commons.math.MaxIterationsExceededException;
+import org.apache.commons.math.special.Erf;
+
+/**
+ * Default implementation of
+ * {@link org.apache.commons.math.distribution.NormalDistribution}.
+ *
+ * @version $Revision: 925812 $ $Date: 2010-03-21 11:49:31 -0400 (Sun, 21 Mar 2010) $
+ */
+public class NormalDistributionImpl extends AbstractContinuousDistribution
+        implements NormalDistribution, Serializable {
+
+    /**
+     * Default inverse cumulative probability accuracy
+     *
+     * @since 2.1
+     */
+    public static final double DEFAULT_INVERSE_ABSOLUTE_ACCURACY = 1e-9;
+
+    /**
+     * Serializable version identifier
+     */
+    private static final long serialVersionUID = 8589540077390120676L;
+
+    /**
+     * &sqrt;(2 π)
+     */
+    private static final double SQRT2PI = Math.sqrt(2 * Math.PI);
+
+    /**
+     * The mean of this distribution.
+     */
+    private double mean = 0;
+
+    /**
+     * The standard deviation of this distribution.
+     */
+    private double standardDeviation = 1;
+
+    /**
+     * Inverse cumulative probability accuracy
+     */
+    private final double solverAbsoluteAccuracy;
+
+    /**
+     * Create a normal distribution using the given mean and standard deviation.
+     *
+     * @param mean mean for this distribution
+     * @param sd   standard deviation for this distribution
+     */
+    public NormalDistributionImpl(double mean, double sd) {
+        this(mean, sd, DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
+    }
+
+    /**
+     * Create a normal distribution using the given mean, standard deviation and
+     * inverse cumulative distribution accuracy.
+     *
+     * @param mean               mean for this distribution
+     * @param sd                 standard deviation for this distribution
+     * @param inverseCumAccuracy inverse cumulative probability accuracy
+     * @since 2.1
+     */
+    public NormalDistributionImpl(double mean, double sd, double inverseCumAccuracy) {
+        super();
+        setMeanInternal(mean);
+        setStandardDeviationInternal(sd);
+        solverAbsoluteAccuracy = inverseCumAccuracy;
+    }
+
+    /**
+     * Creates normal distribution with the mean equal to zero and standard
+     * deviation equal to one.
+     */
+    public NormalDistributionImpl() {
+        this(0.0, 1.0);
+    }
+
+    /**
+     * Access the mean.
+     *
+     * @return mean for this distribution
+     */
+    public double getMean() {
+        return mean;
+    }
+
+    /**
+     * Modify the mean.
+     *
+     * @param mean for this distribution
+     * @deprecated as of 2.1 (class will become immutable in 3.0)
+     */
+    @Deprecated
+    public void setMean(double mean) {
+        setMeanInternal(mean);
+    }
+
+    /**
+     * Modify the mean.
+     *
+     * @param newMean for this distribution
+     */
+    private void setMeanInternal(double newMean) {
+        this.mean = newMean;
+    }
+
+    /**
+     * Access the standard deviation.
+     *
+     * @return standard deviation for this distribution
+     */
+    public double getStandardDeviation() {
+        return standardDeviation;
+    }
+
+    /**
+     * Modify the standard deviation.
+     *
+     * @param sd standard deviation for this distribution
+     * @throws IllegalArgumentException if <code>sd</code> is not positive.
+     * @deprecated as of 2.1 (class will become immutable in 3.0)
+     */
+    @Deprecated
+    public void setStandardDeviation(double sd) {
+        setStandardDeviationInternal(sd);
+    }
+
+    /**
+     * Modify the standard deviation.
+     *
+     * @param sd standard deviation for this distribution
+     * @throws IllegalArgumentException if <code>sd</code> is not positive.
+     */
+    private void setStandardDeviationInternal(double sd) {
+        if (sd <= 0.0) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "standard deviation must be positive ({0})",
+                    sd);
+        }
+        standardDeviation = sd;
+    }
+
+    /**
+     * Return the probability density for a particular point.
+     *
+     * @param x The point at which the density should be computed.
+     * @return The pdf at point x.
+     * @deprecated
+     */
+    public double density(Double x) {
+        return density(x.doubleValue());
+    }
+
+    /**
+     * Returns the probability density for a particular point.
+     *
+     * @param x The point at which the density should be computed.
+     * @return The pdf at point x.
+     * @since 2.1
+     */
+    @Override
+    public double density(double x) {
+        double x0 = x - mean;
+        return Math.exp(-x0 * x0 / (2 * standardDeviation * standardDeviation)) / (standardDeviation * SQRT2PI);
+    }
+
+    @Override
+    public double logDensity(double x) {
+        double a = 1.0 / (Math.sqrt(2.0 * Math.PI) * standardDeviation);
+        double b = -(x - mean) * (x - mean) / (2.0 * standardDeviation * standardDeviation);
+
+        return Math.log(a) + b;
+    }
+
+    /**
+     * For this distribution, X, this method returns P(X < <code>x</code>).
+     *
+     * @param x the value at which the CDF is evaluated.
+     * @return CDF evaluted at <code>x</code>.
+     * @throws MathException if the algorithm fails to converge; unless
+     *                       x is more than 20 standard deviations from the mean, in which case the
+     *                       convergence exception is caught and 0 or 1 is returned.
+     */
+    public double cumulativeProbability(double x) throws MathException {
+        try {
+            return 0.5 * (1.0 + Erf.erf((x - mean) /
+                    (standardDeviation * Math.sqrt(2.0))));
+        } catch (MaxIterationsExceededException ex) {
+            if (x < (mean - 20 * standardDeviation)) { // JDK 1.5 blows at 38
+                return 0.0d;
+            } else if (x > (mean + 20 * standardDeviation)) {
+                return 1.0d;
+            } else {
+                throw ex;
+            }
+        }
+    }
+
+    /**
+     * Return the absolute accuracy setting of the solver used to estimate
+     * inverse cumulative probabilities.
+     *
+     * @return the solver absolute accuracy
+     * @since 2.1
+     */
+    @Override
+    protected double getSolverAbsoluteAccuracy() {
+        return solverAbsoluteAccuracy;
+    }
+
+    /**
+     * For this distribution, X, this method returns the critical point x, such
+     * that P(X < x) = <code>p</code>.
+     * <p>
+     * Returns <code>Double.NEGATIVE_INFINITY</code> for p=0 and
+     * <code>Double.POSITIVE_INFINITY</code> for p=1.</p>
+     *
+     * @param p the desired probability
+     * @return x, such that P(X < x) = <code>p</code>
+     * @throws MathException            if the inverse cumulative probability can not be
+     *                                  computed due to convergence or other numerical errors.
+     * @throws IllegalArgumentException if <code>p</code> is not a valid
+     *                                  probability.
+     */
+    @Override
+    public double inverseCumulativeProbability(final double p)
+            throws MathException {
+        if (p == 0) {
+            return Double.NEGATIVE_INFINITY;
+        }
+        if (p == 1) {
+            return Double.POSITIVE_INFINITY;
+        }
+        return super.inverseCumulativeProbability(p);
+    }
+
+    /**
+     * Access the domain value lower bound, based on <code>p</code>, used to
+     * bracket a CDF root.  This method is used by
+     * {@link #inverseCumulativeProbability(double)} to find critical values.
+     *
+     * @param p the desired probability for the critical value
+     * @return domain value lower bound, i.e.
+     *         P(X < <i>lower bound</i>) < <code>p</code>
+     */
+    @Override
+    protected double getDomainLowerBound(double p) {
+        double ret;
+
+        if (p < .5) {
+            ret = -Double.MAX_VALUE;
+        } else {
+            ret = mean;
+        }
+
+        return ret;
+    }
+
+    /**
+     * Access the domain value upper bound, based on <code>p</code>, used to
+     * bracket a CDF root.  This method is used by
+     * {@link #inverseCumulativeProbability(double)} to find critical values.
+     *
+     * @param p the desired probability for the critical value
+     * @return domain value upper bound, i.e.
+     *         P(X < <i>upper bound</i>) > <code>p</code>
+     */
+    @Override
+    protected double getDomainUpperBound(double p) {
+        double ret;
+
+        if (p < .5) {
+            ret = mean;
+        } else {
+            ret = Double.MAX_VALUE;
+        }
+
+        return ret;
+    }
+
+    /**
+     * Access the initial domain value, based on <code>p</code>, used to
+     * bracket a CDF root.  This method is used by
+     * {@link #inverseCumulativeProbability(double)} to find critical values.
+     *
+     * @param p the desired probability for the critical value
+     * @return initial domain value
+     */
+    @Override
+    protected double getInitialDomain(double p) {
+        double ret;
+
+        if (p < .5) {
+            ret = mean - standardDeviation;
+        } else if (p > .5) {
+            ret = mean + standardDeviation;
+        } else {
+            ret = mean;
+        }
+
+        return ret;
+    }
+}
diff --git a/src/org/apache/commons/math/distribution/PascalDistribution.java b/src/org/apache/commons/math/distribution/PascalDistribution.java
new file mode 100644
index 0000000..5177c6b
--- /dev/null
+++ b/src/org/apache/commons/math/distribution/PascalDistribution.java
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.distribution;
+
+/**
+ * The Pascal distribution.  The Pascal distribution is a special case of the
+ * Negative Binomial distribution where the number of successes parameter is an
+ * integer.
+ * <p/>
+ * There are various ways to express the probability mass and distribution
+ * functions for the Pascal distribution.  The convention employed by the
+ * library is to express these functions in terms of the number of failures in
+ * a Bernoulli experiment [2].
+ * <p/>
+ * <p>
+ * References:
+ * <ol>
+ * <li><a href="http://mathworld.wolfram.com/NegativeBinomialDistribution.html">
+ * Negative Binomial Distribution</a></li>
+ * <oi><a href="http://en.wikipedia.org/wiki/Negative_binomial_distribution#Waiting_time_in_a_Bernoulli_process">Waiting Time in a Bernoulli Process</a></li>
+ * </ul>
+ * </p>
+ *
+ * @version $Revision: 920852 $ $Date: 2010-03-09 07:53:44 -0500 (Tue, 09 Mar 2010) $
+ * @since 1.2
+ */
+public interface PascalDistribution extends IntegerDistribution {
+    /**
+     * Access the number of successes for this distribution.
+     *
+     * @return the number of successes
+     */
+    int getNumberOfSuccesses();
+
+    /**
+     * Access the probability of success for this distribution.
+     *
+     * @return the probability of success
+     */
+    double getProbabilityOfSuccess();
+
+    /**
+     * Change the number of successes for this distribution.
+     *
+     * @param successes the new number of successes
+     * @deprecated as of v2.1
+     */
+    @Deprecated
+    void setNumberOfSuccesses(int successes);
+
+    /**
+     * Change the probability of success for this distribution.
+     *
+     * @param p the new probability of success
+     * @deprecated as of v2.1
+     */
+    @Deprecated
+    void setProbabilityOfSuccess(double p);
+}
diff --git a/src/org/apache/commons/math/distribution/PascalDistributionImpl.java b/src/org/apache/commons/math/distribution/PascalDistributionImpl.java
new file mode 100644
index 0000000..6a4de7a
--- /dev/null
+++ b/src/org/apache/commons/math/distribution/PascalDistributionImpl.java
@@ -0,0 +1,233 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.distribution;
+
+import java.io.Serializable;
+
+import org.apache.commons.math.MathException;
+import org.apache.commons.math.MathRuntimeException;
+import org.apache.commons.math.special.Beta;
+import org.apache.commons.math.util.MathUtils;
+
+/**
+ * The default implementation of {@link PascalDistribution}.
+ *
+ * @version $Revision: 920852 $ $Date: 2010-03-09 07:53:44 -0500 (Tue, 09 Mar 2010) $
+ * @since 1.2
+ */
+public class PascalDistributionImpl extends AbstractIntegerDistribution
+        implements PascalDistribution, Serializable {
+
+    /**
+     * Serializable version identifier
+     */
+    private static final long serialVersionUID = 6751309484392813623L;
+
+    /**
+     * The number of successes
+     */
+    private int numberOfSuccesses;
+
+    /**
+     * The probability of success
+     */
+    private double probabilityOfSuccess;
+
+    /**
+     * Create a binomial distribution with the given number of trials and
+     * probability of success.
+     *
+     * @param r the number of successes
+     * @param p the probability of success
+     */
+    public PascalDistributionImpl(int r, double p) {
+        super();
+        setNumberOfSuccessesInternal(r);
+        setProbabilityOfSuccessInternal(p);
+    }
+
+    /**
+     * Access the number of successes for this distribution.
+     *
+     * @return the number of successes
+     */
+    public int getNumberOfSuccesses() {
+        return numberOfSuccesses;
+    }
+
+    /**
+     * Access the probability of success for this distribution.
+     *
+     * @return the probability of success
+     */
+    public double getProbabilityOfSuccess() {
+        return probabilityOfSuccess;
+    }
+
+    /**
+     * Change the number of successes for this distribution.
+     *
+     * @param successes the new number of successes
+     * @throws IllegalArgumentException if <code>successes</code> is not
+     *                                  positive.
+     * @deprecated as of 2.1 (class will become immutable in 3.0)
+     */
+    @Deprecated
+    public void setNumberOfSuccesses(int successes) {
+        setNumberOfSuccessesInternal(successes);
+    }
+
+    /**
+     * Change the number of successes for this distribution.
+     *
+     * @param successes the new number of successes
+     * @throws IllegalArgumentException if <code>successes</code> is not
+     *                                  positive.
+     */
+    private void setNumberOfSuccessesInternal(int successes) {
+        if (successes < 0) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "number of successes must be non-negative ({0})",
+                    successes);
+        }
+        numberOfSuccesses = successes;
+    }
+
+    /**
+     * Change the probability of success for this distribution.
+     *
+     * @param p the new probability of success
+     * @throws IllegalArgumentException if <code>p</code> is not a valid
+     *                                  probability.
+     * @deprecated as of 2.1 (class will become immutable in 3.0)
+     */
+    @Deprecated
+    public void setProbabilityOfSuccess(double p) {
+        setProbabilityOfSuccessInternal(p);
+    }
+
+    /**
+     * Change the probability of success for this distribution.
+     *
+     * @param p the new probability of success
+     * @throws IllegalArgumentException if <code>p</code> is not a valid
+     *                                  probability.
+     */
+    private void setProbabilityOfSuccessInternal(double p) {
+        if (p < 0.0 || p > 1.0) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "{0} out of [{1}, {2}] range", p, 0.0, 1.0);
+        }
+        probabilityOfSuccess = p;
+    }
+
+    /**
+     * Access the domain value lower bound, based on <code>p</code>, used to
+     * bracket a PDF root.
+     *
+     * @param p the desired probability for the critical value
+     * @return domain value lower bound, i.e. P(X < <i>lower bound</i>) <
+     *         <code>p</code>
+     */
+    @Override
+    protected int getDomainLowerBound(double p) {
+        return -1;
+    }
+
+    /**
+     * Access the domain value upper bound, based on <code>p</code>, used to
+     * bracket a PDF root.
+     *
+     * @param p the desired probability for the critical value
+     * @return domain value upper bound, i.e. P(X < <i>upper bound</i>) >
+     *         <code>p</code>
+     */
+    @Override
+    protected int getDomainUpperBound(double p) {
+        // use MAX - 1 because MAX causes loop
+        return Integer.MAX_VALUE - 1;
+    }
+
+    /**
+     * For this distribution, X, this method returns P(X ≤ x).
+     *
+     * @param x the value at which the PDF is evaluated
+     * @return PDF for this distribution
+     * @throws MathException if the cumulative probability can not be computed
+     *                       due to convergence or other numerical errors
+     */
+    @Override
+    public double cumulativeProbability(int x) throws MathException {
+        double ret;
+        if (x < 0) {
+            ret = 0.0;
+        } else {
+            ret = Beta.regularizedBeta(probabilityOfSuccess,
+                    numberOfSuccesses, x + 1);
+        }
+        return ret;
+    }
+
+    /**
+     * For this distribution, X, this method returns P(X = x).
+     *
+     * @param x the value at which the PMF is evaluated
+     * @return PMF for this distribution
+     */
+    public double probability(int x) {
+        double ret;
+        if (x < 0) {
+            ret = 0.0;
+        } else {
+            ret = MathUtils.binomialCoefficientDouble(x +
+                    numberOfSuccesses - 1, numberOfSuccesses - 1) *
+                    Math.pow(probabilityOfSuccess, numberOfSuccesses) *
+                    Math.pow(1.0 - probabilityOfSuccess, x);
+        }
+        return ret;
+    }
+
+    /**
+     * For this distribution, X, this method returns the largest x, such that
+     * P(X ≤ x) ≤ <code>p</code>.
+     * <p>
+     * Returns <code>-1</code> for p=0 and <code>Integer.MAX_VALUE</code>
+     * for p=1.</p>
+     *
+     * @param p the desired probability
+     * @return the largest x such that P(X ≤ x) <= p
+     * @throws MathException            if the inverse cumulative probability can not be
+     *                                  computed due to convergence or other numerical errors.
+     * @throws IllegalArgumentException if p < 0 or p > 1
+     */
+    @Override
+    public int inverseCumulativeProbability(final double p)
+            throws MathException {
+        int ret;
+
+        // handle extreme values explicitly
+        if (p == 0) {
+            ret = -1;
+        } else if (p == 1) {
+            ret = Integer.MAX_VALUE;
+        } else {
+            ret = super.inverseCumulativeProbability(p);
+        }
+
+        return ret;
+    }
+}
diff --git a/src/org/apache/commons/math/distribution/PoissonDistribution.java b/src/org/apache/commons/math/distribution/PoissonDistribution.java
new file mode 100644
index 0000000..739394c
--- /dev/null
+++ b/src/org/apache/commons/math/distribution/PoissonDistribution.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.distribution;
+
+import org.apache.commons.math.MathException;
+
+/**
+ * Interface representing the Poisson Distribution.
+ * <p/>
+ * <p>
+ * References:
+ * <ul>
+ * <li><a href="http://mathworld.wolfram.com/PoissonDistribution.html">
+ * Poisson distribution</a></li>
+ * </ul>
+ * </p>
+ *
+ * @version $Revision: 920852 $ $Date: 2010-03-09 07:53:44 -0500 (Tue, 09 Mar 2010) $
+ */
+public interface PoissonDistribution extends IntegerDistribution {
+
+    /**
+     * Get the mean for the distribution.
+     *
+     * @return the mean for the distribution.
+     */
+    double getMean();
+
+    /**
+     * Set the mean for the distribution.
+     * The parameter value must be positive; otherwise an
+     * <code>IllegalArgument</code> is thrown.
+     *
+     * @param p the mean
+     * @throws IllegalArgumentException if p ≤ 0
+     * @deprecated as of v2.1
+     */
+    @Deprecated
+    void setMean(double p);
+
+    /**
+     * Calculates the Poisson distribution function using a normal approximation.
+     *
+     * @param x the upper bound, inclusive
+     * @return the distribution function value calculated using a normal approximation
+     * @throws MathException if an error occurs computing the normal approximation
+     */
+    double normalApproximateProbability(int x) throws MathException;
+
+}
diff --git a/src/org/apache/commons/math/distribution/PoissonDistributionImpl.java b/src/org/apache/commons/math/distribution/PoissonDistributionImpl.java
new file mode 100644
index 0000000..af1b0c6
--- /dev/null
+++ b/src/org/apache/commons/math/distribution/PoissonDistributionImpl.java
@@ -0,0 +1,286 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.distribution;
+
+import java.io.Serializable;
+
+import org.apache.commons.math.MathException;
+import org.apache.commons.math.MathRuntimeException;
+import org.apache.commons.math.special.Gamma;
+import org.apache.commons.math.util.MathUtils;
+
+/**
+ * Implementation for the {@link PoissonDistribution}.
+ *
+ * @version $Revision: 925812 $ $Date: 2010-03-21 11:49:31 -0400 (Sun, 21 Mar 2010) $
+ */
+public class PoissonDistributionImpl extends AbstractIntegerDistribution
+        implements PoissonDistribution, Serializable {
+
+    /**
+     * Default maximum number of iterations for cumulative probability calculations.
+     *
+     * @since 2.1
+     */
+    public static final int DEFAULT_MAX_ITERATIONS = 10000000;
+
+    /**
+     * Default convergence criterion.
+     *
+     * @since 2.1
+     */
+    public static final double DEFAULT_EPSILON = 1E-12;
+
+    /**
+     * Serializable version identifier
+     */
+    private static final long serialVersionUID = -3349935121172596109L;
+
+    /**
+     * Distribution used to compute normal approximation.
+     */
+    private NormalDistribution normal;
+
+    /**
+     * Holds the Poisson mean for the distribution.
+     */
+    private double mean;
+
+    /**
+     * Maximum number of iterations for cumulative probability.
+     * <p/>
+     * Cumulative probabilities are estimated using either Lanczos series approximation of
+     * Gamma#regularizedGammaP or continued fraction approximation of Gamma#regularizedGammaQ.
+     */
+    private int maxIterations = DEFAULT_MAX_ITERATIONS;
+
+    /**
+     * Convergence criterion for cumulative probability.
+     */
+    private double epsilon = DEFAULT_EPSILON;
+
+    /**
+     * Create a new Poisson distribution with the given the mean. The mean value
+     * must be positive; otherwise an <code>IllegalArgument</code> is thrown.
+     *
+     * @param p the Poisson mean
+     * @throws IllegalArgumentException if p ≤ 0
+     */
+    public PoissonDistributionImpl(double p) {
+        this(p, new NormalDistributionImpl());
+    }
+
+    /**
+     * Create a new Poisson distribution with the given mean, convergence criterion
+     * and maximum number of iterations.
+     *
+     * @param p             the Poisson mean
+     * @param epsilon       the convergence criteria for cumulative probabilites
+     * @param maxIterations the maximum number of iterations for cumulative probabilites
+     * @since 2.1
+     */
+    public PoissonDistributionImpl(double p, double epsilon, int maxIterations) {
+        setMean(p);
+        this.epsilon = epsilon;
+        this.maxIterations = maxIterations;
+    }
+
+    /**
+     * Create a new Poisson distribution with the given mean and convergence criterion.
+     *
+     * @param p       the Poisson mean
+     * @param epsilon the convergence criteria for cumulative probabilites
+     * @since 2.1
+     */
+    public PoissonDistributionImpl(double p, double epsilon) {
+        setMean(p);
+        this.epsilon = epsilon;
+    }
+
+    /**
+     * Create a new Poisson distribution with the given mean and maximum number of iterations.
+     *
+     * @param p             the Poisson mean
+     * @param maxIterations the maximum number of iterations for cumulative probabilites
+     * @since 2.1
+     */
+    public PoissonDistributionImpl(double p, int maxIterations) {
+        setMean(p);
+        this.maxIterations = maxIterations;
+    }
+
+
+    /**
+     * Create a new Poisson distribution with the given the mean. The mean value
+     * must be positive; otherwise an <code>IllegalArgument</code> is thrown.
+     *
+     * @param p the Poisson mean
+     * @param z a normal distribution used to compute normal approximations.
+     * @throws IllegalArgumentException if p ≤ 0
+     * @since 1.2
+     * @deprecated as of 2.1 (to avoid possibly inconsistent state, the
+     *             "NormalDistribution" will be instantiated internally)
+     */
+    @Deprecated
+    public PoissonDistributionImpl(double p, NormalDistribution z) {
+        super();
+        setNormalAndMeanInternal(z, p);
+    }
+
+    /**
+     * Get the Poisson mean for the distribution.
+     *
+     * @return the Poisson mean for the distribution.
+     */
+    public double getMean() {
+        return mean;
+    }
+
+    /**
+     * Set the Poisson mean for the distribution. The mean value must be
+     * positive; otherwise an <code>IllegalArgument</code> is thrown.
+     *
+     * @param p the Poisson mean value
+     * @throws IllegalArgumentException if p ≤ 0
+     * @deprecated as of 2.1 (class will become immutable in 3.0)
+     */
+    @Deprecated
+    public void setMean(double p) {
+        setNormalAndMeanInternal(normal, p);
+    }
+
+    /**
+     * Set the Poisson mean for the distribution. The mean value must be
+     * positive; otherwise an <code>IllegalArgument</code> is thrown.
+     *
+     * @param z the new distribution
+     * @param p the Poisson mean value
+     * @throws IllegalArgumentException if p ≤ 0
+     */
+    private void setNormalAndMeanInternal(NormalDistribution z,
+                                          double p) {
+        if (p <= 0) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "the Poisson mean must be positive ({0})", p);
+        }
+        mean = p;
+        normal = z;
+        normal.setMean(p);
+        normal.setStandardDeviation(Math.sqrt(p));
+    }
+
+    /**
+     * The probability mass function P(X = x) for a Poisson distribution.
+     *
+     * @param x the value at which the probability density function is
+     *          evaluated.
+     * @return the value of the probability mass function at x
+     */
+    public double probability(int x) {
+        double ret;
+        if (x < 0 || x == Integer.MAX_VALUE) {
+            ret = 0.0;
+        } else if (x == 0) {
+            ret = Math.exp(-mean);
+        } else {
+            ret = Math.exp(-SaddlePointExpansion.getStirlingError(x) -
+                    SaddlePointExpansion.getDeviancePart(x, mean)) /
+                    Math.sqrt(MathUtils.TWO_PI * x);
+        }
+        return ret;
+    }
+
+    /**
+     * The probability distribution function P(X <= x) for a Poisson
+     * distribution.
+     *
+     * @param x the value at which the PDF is evaluated.
+     * @return Poisson distribution function evaluated at x
+     * @throws MathException if the cumulative probability can not be computed
+     *                       due to convergence or other numerical errors.
+     */
+    @Override
+    public double cumulativeProbability(int x) throws MathException {
+        if (x < 0) {
+            return 0;
+        }
+        if (x == Integer.MAX_VALUE) {
+            return 1;
+        }
+        return Gamma.regularizedGammaQ((double) x + 1, mean, epsilon, maxIterations);
+    }
+
+    /**
+     * Calculates the Poisson distribution function using a normal
+     * approximation. The <code>N(mean, sqrt(mean))</code> distribution is used
+     * to approximate the Poisson distribution.
+     * <p>
+     * The computation uses "half-correction" -- evaluating the normal
+     * distribution function at <code>x + 0.5</code>
+     * </p>
+     *
+     * @param x the upper bound, inclusive
+     * @return the distribution function value calculated using a normal
+     *         approximation
+     * @throws MathException if an error occurs computing the normal
+     *                       approximation
+     */
+    public double normalApproximateProbability(int x) throws MathException {
+        // calculate the probability using half-correction
+        return normal.cumulativeProbability(x + 0.5);
+    }
+
+    /**
+     * Access the domain value lower bound, based on <code>p</code>, used to
+     * bracket a CDF root. This method is used by
+     * {@link #inverseCumulativeProbability(double)} to find critical values.
+     *
+     * @param p the desired probability for the critical value
+     * @return domain lower bound
+     */
+    @Override
+    protected int getDomainLowerBound(double p) {
+        return 0;
+    }
+
+    /**
+     * Access the domain value upper bound, based on <code>p</code>, used to
+     * bracket a CDF root. This method is used by
+     * {@link #inverseCumulativeProbability(double)} to find critical values.
+     *
+     * @param p the desired probability for the critical value
+     * @return domain upper bound
+     */
+    @Override
+    protected int getDomainUpperBound(double p) {
+        return Integer.MAX_VALUE;
+    }
+
+    /**
+     * Modify the normal distribution used to compute normal approximations. The
+     * caller is responsible for insuring the normal distribution has the proper
+     * parameter settings.
+     *
+     * @param value the new distribution
+     * @since 1.2
+     * @deprecated as of 2.1 (class will become immutable in 3.0)
+     */
+    @Deprecated
+    public void setNormal(NormalDistribution value) {
+        setNormalAndMeanInternal(value, mean);
+    }
+}
diff --git a/src/org/apache/commons/math/distribution/SaddlePointExpansion.java b/src/org/apache/commons/math/distribution/SaddlePointExpansion.java
new file mode 100644
index 0000000..b80bc8d
--- /dev/null
+++ b/src/org/apache/commons/math/distribution/SaddlePointExpansion.java
@@ -0,0 +1,204 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.distribution;
+
+import org.apache.commons.math.special.Gamma;
+import org.apache.commons.math.util.MathUtils;
+
+/**
+ * <p>
+ * Utility class used by various distributions to accurately compute their
+ * respective probability mass functions. The implementation for this class is
+ * based on the Catherine Loader's <a target="_blank"
+ * href="http://www.herine.net/stat/software/dbinom.html">dbinom</a> routines.
+ * </p>
+ * <p>
+ * This class is not intended to be called directly.
+ * </p>
+ * <p>
+ * References:
+ * <ol>
+ * <li>Catherine Loader (2000). "Fast and Accurate Computation of Binomial
+ * Probabilities.". <a target="_blank"
+ * href="http://www.herine.net/stat/papers/dbinom.pdf">
+ * http://www.herine.net/stat/papers/dbinom.pdf</a></li>
+ * </ol>
+ * </p>
+ *
+ * @version $Revision$ $Date$
+ * @since 2.1
+ */
+final class SaddlePointExpansion {
+
+    /**
+     * 1/2 * log(2 π).
+     */
+    private static final double HALF_LOG_2_PI = 0.5 * Math.log(MathUtils.TWO_PI);
+
+    /**
+     * exact Stirling expansion error for certain values.
+     */
+    private static final double[] EXACT_STIRLING_ERRORS = {0.0, /* 0.0 */
+            0.1534264097200273452913848, /* 0.5 */
+            0.0810614667953272582196702, /* 1.0 */
+            0.0548141210519176538961390, /* 1.5 */
+            0.0413406959554092940938221, /* 2.0 */
+            0.03316287351993628748511048, /* 2.5 */
+            0.02767792568499833914878929, /* 3.0 */
+            0.02374616365629749597132920, /* 3.5 */
+            0.02079067210376509311152277, /* 4.0 */
+            0.01848845053267318523077934, /* 4.5 */
+            0.01664469118982119216319487, /* 5.0 */
+            0.01513497322191737887351255, /* 5.5 */
+            0.01387612882307074799874573, /* 6.0 */
+            0.01281046524292022692424986, /* 6.5 */
+            0.01189670994589177009505572, /* 7.0 */
+            0.01110455975820691732662991, /* 7.5 */
+            0.010411265261972096497478567, /* 8.0 */
+            0.009799416126158803298389475, /* 8.5 */
+            0.009255462182712732917728637, /* 9.0 */
+            0.008768700134139385462952823, /* 9.5 */
+            0.008330563433362871256469318, /* 10.0 */
+            0.007934114564314020547248100, /* 10.5 */
+            0.007573675487951840794972024, /* 11.0 */
+            0.007244554301320383179543912, /* 11.5 */
+            0.006942840107209529865664152, /* 12.0 */
+            0.006665247032707682442354394, /* 12.5 */
+            0.006408994188004207068439631, /* 13.0 */
+            0.006171712263039457647532867, /* 13.5 */
+            0.005951370112758847735624416, /* 14.0 */
+            0.005746216513010115682023589, /* 14.5 */
+            0.005554733551962801371038690 /* 15.0 */
+    };
+
+    /**
+     * Default constructor.
+     */
+    private SaddlePointExpansion() {
+        super();
+    }
+
+    /**
+     * Compute the error of Stirling's series at the given value.
+     * <p>
+     * References:
+     * <ol>
+     * <li>Eric W. Weisstein. "Stirling's Series." From MathWorld--A Wolfram Web
+     * Resource. <a target="_blank"
+     * href="http://mathworld.wolfram.com/StirlingsSeries.html">
+     * http://mathworld.wolfram.com/StirlingsSeries.html</a></li>
+     * </ol>
+     * </p>
+     *
+     * @param z the value.
+     * @return the Striling's series error.
+     */
+    static double getStirlingError(double z) {
+        double ret;
+        if (z < 15.0) {
+            double z2 = 2.0 * z;
+            if (Math.floor(z2) == z2) {
+                ret = EXACT_STIRLING_ERRORS[(int) z2];
+            } else {
+                ret = Gamma.logGamma(z + 1.0) - (z + 0.5) * Math.log(z) +
+                        z - HALF_LOG_2_PI;
+            }
+        } else {
+            double z2 = z * z;
+            ret = (0.083333333333333333333 -
+                    (0.00277777777777777777778 -
+                            (0.00079365079365079365079365 -
+                                    (0.000595238095238095238095238 -
+                                            0.0008417508417508417508417508 /
+                                                    z2) / z2) / z2) / z2) / z;
+        }
+        return ret;
+    }
+
+    /**
+     * A part of the deviance portion of the saddle point approximation.
+     * <p>
+     * References:
+     * <ol>
+     * <li>Catherine Loader (2000). "Fast and Accurate Computation of Binomial
+     * Probabilities.". <a target="_blank"
+     * href="http://www.herine.net/stat/papers/dbinom.pdf">
+     * http://www.herine.net/stat/papers/dbinom.pdf</a></li>
+     * </ol>
+     * </p>
+     *
+     * @param x  the x value.
+     * @param mu the average.
+     * @return a part of the deviance.
+     */
+    static double getDeviancePart(double x, double mu) {
+        double ret;
+        if (Math.abs(x - mu) < 0.1 * (x + mu)) {
+            double d = x - mu;
+            double v = d / (x + mu);
+            double s1 = v * d;
+            double s = Double.NaN;
+            double ej = 2.0 * x * v;
+            v = v * v;
+            int j = 1;
+            while (s1 != s) {
+                s = s1;
+                ej *= v;
+                s1 = s + ej / ((j * 2) + 1);
+                ++j;
+            }
+            ret = s1;
+        } else {
+            ret = x * Math.log(x / mu) + mu - x;
+        }
+        return ret;
+    }
+
+    /**
+     * Compute the PMF for a binomial distribution using the saddle point
+     * expansion.
+     *
+     * @param x the value at which the probability is evaluated.
+     * @param n the number of trials.
+     * @param p the probability of success.
+     * @param q the probability of failure (1 - p).
+     * @return log(p(x)).
+     */
+    static double logBinomialProbability(int x, int n, double p, double q) {
+        double ret;
+        if (x == 0) {
+            if (p < 0.1) {
+                ret = -getDeviancePart(n, n * q) - n * p;
+            } else {
+                ret = n * Math.log(q);
+            }
+        } else if (x == n) {
+            if (q < 0.1) {
+                ret = -getDeviancePart(n, n * p) - n * q;
+            } else {
+                ret = n * Math.log(p);
+            }
+        } else {
+            ret = getStirlingError(n) - getStirlingError(x) -
+                    getStirlingError(n - x) - getDeviancePart(x, n * p) -
+                    getDeviancePart(n - x, n * q);
+            double f = (MathUtils.TWO_PI * x * (n - x)) / n;
+            ret = -0.5 * Math.log(f) + ret;
+        }
+        return ret;
+    }
+}
diff --git a/src/org/apache/commons/math/distribution/TDistribution.java b/src/org/apache/commons/math/distribution/TDistribution.java
new file mode 100644
index 0000000..2013836
--- /dev/null
+++ b/src/org/apache/commons/math/distribution/TDistribution.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.distribution;
+
+/**
+ * Student's t-Distribution.
+ * <p/>
+ * <p>
+ * References:
+ * <ul>
+ * <li><a href="http://mathworld.wolfram.com/Studentst-Distribution.html">
+ * Student's t-Distribution</a></li>
+ * </ul>
+ * </p>
+ *
+ * @version $Revision: 920852 $ $Date: 2010-03-09 07:53:44 -0500 (Tue, 09 Mar 2010) $
+ */
+public interface TDistribution extends ContinuousDistribution {
+    /**
+     * Modify the degrees of freedom.
+     *
+     * @param degreesOfFreedom the new degrees of freedom.
+     * @deprecated as of v2.1
+     */
+    @Deprecated
+    void setDegreesOfFreedom(double degreesOfFreedom);
+
+    /**
+     * Access the degrees of freedom.
+     *
+     * @return the degrees of freedom.
+     */
+    double getDegreesOfFreedom();
+}
diff --git a/src/org/apache/commons/math/distribution/TDistributionImpl.java b/src/org/apache/commons/math/distribution/TDistributionImpl.java
new file mode 100644
index 0000000..e4f97a4
--- /dev/null
+++ b/src/org/apache/commons/math/distribution/TDistributionImpl.java
@@ -0,0 +1,237 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.distribution;
+
+import java.io.Serializable;
+
+import org.apache.commons.math.MathException;
+import org.apache.commons.math.MathRuntimeException;
+import org.apache.commons.math.special.Beta;
+import org.apache.commons.math.special.Gamma;
+
+/**
+ * Default implementation of
+ * {@link org.apache.commons.math.distribution.TDistribution}.
+ *
+ * @version $Revision: 925812 $ $Date: 2010-03-21 11:49:31 -0400 (Sun, 21 Mar 2010) $
+ */
+public class TDistributionImpl
+        extends AbstractContinuousDistribution
+        implements TDistribution, Serializable {
+
+    /**
+     * Default inverse cumulative probability accuracy
+     *
+     * @since 2.1
+     */
+    public static final double DEFAULT_INVERSE_ABSOLUTE_ACCURACY = 1e-9;
+
+    /**
+     * Serializable version identifier
+     */
+    private static final long serialVersionUID = -5852615386664158222L;
+
+    /**
+     * The degrees of freedom
+     */
+    private double degreesOfFreedom;
+
+    /**
+     * Inverse cumulative probability accuracy
+     */
+    private final double solverAbsoluteAccuracy;
+
+    /**
+     * Create a t distribution using the given degrees of freedom and the
+     * specified inverse cumulative probability absolute accuracy.
+     *
+     * @param degreesOfFreedom   the degrees of freedom.
+     * @param inverseCumAccuracy the maximum absolute error in inverse cumulative probability estimates
+     *                           (defaults to {@link #DEFAULT_INVERSE_ABSOLUTE_ACCURACY})
+     * @since 2.1
+     */
+    public TDistributionImpl(double degreesOfFreedom, double inverseCumAccuracy) {
+        super();
+        setDegreesOfFreedomInternal(degreesOfFreedom);
+        solverAbsoluteAccuracy = inverseCumAccuracy;
+    }
+
+    /**
+     * Create a t distribution using the given degrees of freedom.
+     *
+     * @param degreesOfFreedom the degrees of freedom.
+     */
+    public TDistributionImpl(double degreesOfFreedom) {
+        this(degreesOfFreedom, DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
+    }
+
+    /**
+     * Modify the degrees of freedom.
+     *
+     * @param degreesOfFreedom the new degrees of freedom.
+     * @deprecated as of 2.1 (class will become immutable in 3.0)
+     */
+    @Deprecated
+    public void setDegreesOfFreedom(double degreesOfFreedom) {
+        setDegreesOfFreedomInternal(degreesOfFreedom);
+    }
+
+    /**
+     * Modify the degrees of freedom.
+     *
+     * @param newDegreesOfFreedom the new degrees of freedom.
+     */
+    private void setDegreesOfFreedomInternal(double newDegreesOfFreedom) {
+        if (newDegreesOfFreedom <= 0.0) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "degrees of freedom must be positive ({0})",
+                    newDegreesOfFreedom);
+        }
+        this.degreesOfFreedom = newDegreesOfFreedom;
+    }
+
+    /**
+     * Access the degrees of freedom.
+     *
+     * @return the degrees of freedom.
+     */
+    public double getDegreesOfFreedom() {
+        return degreesOfFreedom;
+    }
+
+    /**
+     * Returns the probability density for a particular point.
+     *
+     * @param x The point at which the density should be computed.
+     * @return The pdf at point x.
+     * @since 2.1
+     */
+    @Override
+    public double density(double x) {
+        final double n = degreesOfFreedom;
+        final double nPlus1Over2 = (n + 1) / 2;
+        return Math.exp(Gamma.logGamma(nPlus1Over2) - 0.5 * (Math.log(Math.PI) + Math.log(n)) -
+                Gamma.logGamma(n / 2) - nPlus1Over2 * Math.log(1 + x * x / n));
+    }
+
+    /**
+     * For this distribution, X, this method returns P(X < <code>x</code>).
+     *
+     * @param x the value at which the CDF is evaluated.
+     * @return CDF evaluted at <code>x</code>.
+     * @throws MathException if the cumulative probability can not be
+     *                       computed due to convergence or other numerical errors.
+     */
+    public double cumulativeProbability(double x) throws MathException {
+        double ret;
+        if (x == 0.0) {
+            ret = 0.5;
+        } else {
+            double t =
+                    Beta.regularizedBeta(
+                            degreesOfFreedom / (degreesOfFreedom + (x * x)),
+                            0.5 * degreesOfFreedom,
+                            0.5);
+            if (x < 0.0) {
+                ret = 0.5 * t;
+            } else {
+                ret = 1.0 - 0.5 * t;
+            }
+        }
+
+        return ret;
+    }
+
+    /**
+     * For this distribution, X, this method returns the critical point x, such
+     * that P(X < x) = <code>p</code>.
+     * <p>
+     * Returns <code>Double.NEGATIVE_INFINITY</code> for p=0 and
+     * <code>Double.POSITIVE_INFINITY</code> for p=1.</p>
+     *
+     * @param p the desired probability
+     * @return x, such that P(X < x) = <code>p</code>
+     * @throws MathException            if the inverse cumulative probability can not be
+     *                                  computed due to convergence or other numerical errors.
+     * @throws IllegalArgumentException if <code>p</code> is not a valid
+     *                                  probability.
+     */
+    @Override
+    public double inverseCumulativeProbability(final double p)
+            throws MathException {
+        if (p == 0) {
+            return Double.NEGATIVE_INFINITY;
+        }
+        if (p == 1) {
+            return Double.POSITIVE_INFINITY;
+        }
+        return super.inverseCumulativeProbability(p);
+    }
+
+    /**
+     * Access the domain value lower bound, based on <code>p</code>, used to
+     * bracket a CDF root.  This method is used by
+     * {@link #inverseCumulativeProbability(double)} to find critical values.
+     *
+     * @param p the desired probability for the critical value
+     * @return domain value lower bound, i.e.
+     *         P(X < <i>lower bound</i>) < <code>p</code>
+     */
+    @Override
+    protected double getDomainLowerBound(double p) {
+        return -Double.MAX_VALUE;
+    }
+
+    /**
+     * Access the domain value upper bound, based on <code>p</code>, used to
+     * bracket a CDF root.  This method is used by
+     * {@link #inverseCumulativeProbability(double)} to find critical values.
+     *
+     * @param p the desired probability for the critical value
+     * @return domain value upper bound, i.e.
+     *         P(X < <i>upper bound</i>) > <code>p</code>
+     */
+    @Override
+    protected double getDomainUpperBound(double p) {
+        return Double.MAX_VALUE;
+    }
+
+    /**
+     * Access the initial domain value, based on <code>p</code>, used to
+     * bracket a CDF root.  This method is used by
+     * {@link #inverseCumulativeProbability(double)} to find critical values.
+     *
+     * @param p the desired probability for the critical value
+     * @return initial domain value
+     */
+    @Override
+    protected double getInitialDomain(double p) {
+        return 0.0;
+    }
+
+    /**
+     * Return the absolute accuracy setting of the solver used to estimate
+     * inverse cumulative probabilities.
+     *
+     * @return the solver absolute accuracy
+     * @since 2.1
+     */
+    @Override
+    protected double getSolverAbsoluteAccuracy() {
+        return solverAbsoluteAccuracy;
+    }
+}
diff --git a/src/org/apache/commons/math/distribution/WeibullDistribution.java b/src/org/apache/commons/math/distribution/WeibullDistribution.java
new file mode 100644
index 0000000..b12d58f
--- /dev/null
+++ b/src/org/apache/commons/math/distribution/WeibullDistribution.java
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.math.distribution;
+
+/**
+ * Weibull Distribution.  This interface defines the two parameter form of the
+ * distribution as defined by
+ * <a href="http://mathworld.wolfram.com/WeibullDistribution.html">
+ * Weibull Distribution</a>, equations (1) and (2).
+ * <p/>
+ * <p>
+ * References:
+ * <ul>
+ * <li><a href="http://mathworld.wolfram.com/WeibullDistribution.html">
+ * Weibull Distribution</a></li>
+ * </ul>
+ * </p>
+ *
+ * @version $Revision: 920852 $ $Date: 2010-03-09 07:53:44 -0500 (Tue, 09 Mar 2010) $
+ * @since 1.1
+ */
+public interface WeibullDistribution extends ContinuousDistribution {
+
+    /**
+     * Access the shape parameter.
+     *
+     * @return the shape parameter.
+     */
+    double getShape();
+
+    /**
+     * Access the scale parameter.
+     *
+     * @return the scale parameter.
+     */
+    double getScale();
+
+    /**
+     * Modify the shape parameter.
+     *
+     * @param alpha The new shape parameter value.
+     * @deprecated as of v2.1
+     */
+    @Deprecated
+    void setShape(double alpha);
+
+    /**
+     * Modify the scale parameter.
+     *
+     * @param beta The new scale parameter value.
+     * @deprecated as of v2.1
+     */
+    @Deprecated
+    void setScale(double beta);
+}
diff --git a/src/org/apache/commons/math/distribution/WeibullDistributionImpl.java b/src/org/apache/commons/math/distribution/WeibullDistributionImpl.java
new file mode 100644
index 0000000..4d9f1da
--- /dev/null
+++ b/src/org/apache/commons/math/distribution/WeibullDistributionImpl.java
@@ -0,0 +1,280 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.math.distribution;
+
+import java.io.Serializable;
+
+import org.apache.commons.math.MathRuntimeException;
+
+/**
+ * Default implementation of
+ * {@link org.apache.commons.math.distribution.WeibullDistribution}.
+ *
+ * @version $Revision: 925812 $ $Date: 2010-03-21 11:49:31 -0400 (Sun, 21 Mar 2010) $
+ * @since 1.1
+ */
+public class WeibullDistributionImpl extends AbstractContinuousDistribution
+        implements WeibullDistribution, Serializable {
+
+    /**
+     * Default inverse cumulative probability accuracy
+     *
+     * @since 2.1
+     */
+    public static final double DEFAULT_INVERSE_ABSOLUTE_ACCURACY = 1e-9;
+
+    /**
+     * Serializable version identifier
+     */
+    private static final long serialVersionUID = 8589540077390120676L;
+
+    /**
+     * The shape parameter.
+     */
+    private double shape;
+
+    /**
+     * The scale parameter.
+     */
+    private double scale;
+
+    /**
+     * Inverse cumulative probability accuracy
+     */
+    private final double solverAbsoluteAccuracy;
+
+    /**
+     * Creates weibull distribution with the given shape and scale and a
+     * location equal to zero.
+     *
+     * @param alpha the shape parameter.
+     * @param beta  the scale parameter.
+     */
+    public WeibullDistributionImpl(double alpha, double beta) {
+        this(alpha, beta, DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
+    }
+
+    /**
+     * Creates weibull distribution with the given shape, scale and inverse
+     * cumulative probability accuracy and a location equal to zero.
+     *
+     * @param alpha              the shape parameter.
+     * @param beta               the scale parameter.
+     * @param inverseCumAccuracy the maximum absolute error in inverse cumulative probability estimates
+     *                           (defaults to {@link #DEFAULT_INVERSE_ABSOLUTE_ACCURACY})
+     * @since 2.1
+     */
+    public WeibullDistributionImpl(double alpha, double beta, double inverseCumAccuracy) {
+        super();
+        setShapeInternal(alpha);
+        setScaleInternal(beta);
+        solverAbsoluteAccuracy = inverseCumAccuracy;
+    }
+
+    /**
+     * For this distribution, X, this method returns P(X < <code>x</code>).
+     *
+     * @param x the value at which the CDF is evaluated.
+     * @return CDF evaluted at <code>x</code>.
+     */
+    public double cumulativeProbability(double x) {
+        double ret;
+        if (x <= 0.0) {
+            ret = 0.0;
+        } else {
+            ret = 1.0 - Math.exp(-Math.pow(x / scale, shape));
+        }
+        return ret;
+    }
+
+    /**
+     * Access the shape parameter.
+     *
+     * @return the shape parameter.
+     */
+    public double getShape() {
+        return shape;
+    }
+
+    /**
+     * Access the scale parameter.
+     *
+     * @return the scale parameter.
+     */
+    public double getScale() {
+        return scale;
+    }
+
+    /**
+     * Returns the probability density for a particular point.
+     *
+     * @param x The point at which the density should be computed.
+     * @return The pdf at point x.
+     * @since 2.1
+     */
+    @Override
+    public double density(double x) {
+        if (x < 0) {
+            return 0;
+        }
+
+        final double xscale = x / scale;
+        final double xscalepow = Math.pow(xscale, shape - 1);
+
+        /*
+         * Math.pow(x / scale, shape) =
+         * Math.pow(xscale, shape) =
+         * Math.pow(xscale, shape - 1) * xscale
+         */
+        final double xscalepowshape = xscalepow * xscale;
+
+        return (shape / scale) * xscalepow * Math.exp(-xscalepowshape);
+    }
+
+    /**
+     * For this distribution, X, this method returns the critical point x, such
+     * that P(X < x) = <code>p</code>.
+     * <p>
+     * Returns <code>Double.NEGATIVE_INFINITY</code> for p=0 and
+     * <code>Double.POSITIVE_INFINITY</code> for p=1.</p>
+     *
+     * @param p the desired probability
+     * @return x, such that P(X < x) = <code>p</code>
+     * @throws IllegalArgumentException if <code>p</code> is not a valid
+     *                                  probability.
+     */
+    @Override
+    public double inverseCumulativeProbability(double p) {
+        double ret;
+        if (p < 0.0 || p > 1.0) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "{0} out of [{1}, {2}] range", p, 0.0, 1.0);
+        } else if (p == 0) {
+            ret = 0.0;
+        } else if (p == 1) {
+            ret = Double.POSITIVE_INFINITY;
+        } else {
+            ret = scale * Math.pow(-Math.log(1.0 - p), 1.0 / shape);
+        }
+        return ret;
+    }
+
+    /**
+     * Modify the shape parameter.
+     *
+     * @param alpha the new shape parameter value.
+     * @deprecated as of 2.1 (class will become immutable in 3.0)
+     */
+    @Deprecated
+    public void setShape(double alpha) {
+        setShapeInternal(alpha);
+    }
+
+    /**
+     * Modify the shape parameter.
+     *
+     * @param alpha the new shape parameter value.
+     */
+    private void setShapeInternal(double alpha) {
+        if (alpha <= 0.0) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "shape must be positive ({0})",
+                    alpha);
+        }
+        this.shape = alpha;
+    }
+
+    /**
+     * Modify the scale parameter.
+     *
+     * @param beta the new scale parameter value.
+     * @deprecated as of 2.1 (class will become immutable in 3.0)
+     */
+    @Deprecated
+    public void setScale(double beta) {
+        setScaleInternal(beta);
+    }
+
+    /**
+     * Modify the scale parameter.
+     *
+     * @param beta the new scale parameter value.
+     */
+    private void setScaleInternal(double beta) {
+        if (beta <= 0.0) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "scale must be positive ({0})",
+                    beta);
+        }
+        this.scale = beta;
+    }
+
+    /**
+     * Access the domain value lower bound, based on <code>p</code>, used to
+     * bracket a CDF root.  This method is used by
+     * {@link #inverseCumulativeProbability(double)} to find critical values.
+     *
+     * @param p the desired probability for the critical value
+     * @return domain value lower bound, i.e.
+     *         P(X < <i>lower bound</i>) < <code>p</code>
+     */
+    @Override
+    protected double getDomainLowerBound(double p) {
+        return 0.0;
+    }
+
+    /**
+     * Access the domain value upper bound, based on <code>p</code>, used to
+     * bracket a CDF root.  This method is used by
+     * {@link #inverseCumulativeProbability(double)} to find critical values.
+     *
+     * @param p the desired probability for the critical value
+     * @return domain value upper bound, i.e.
+     *         P(X < <i>upper bound</i>) > <code>p</code>
+     */
+    @Override
+    protected double getDomainUpperBound(double p) {
+        return Double.MAX_VALUE;
+    }
+
+    /**
+     * Access the initial domain value, based on <code>p</code>, used to
+     * bracket a CDF root.  This method is used by
+     * {@link #inverseCumulativeProbability(double)} to find critical values.
+     *
+     * @param p the desired probability for the critical value
+     * @return initial domain value
+     */
+    @Override
+    protected double getInitialDomain(double p) {
+        // use median
+        return Math.pow(scale * Math.log(2.0), 1.0 / shape);
+    }
+
+    /**
+     * Return the absolute accuracy setting of the solver used to estimate
+     * inverse cumulative probabilities.
+     *
+     * @return the solver absolute accuracy
+     * @since 2.1
+     */
+    @Override
+    protected double getSolverAbsoluteAccuracy() {
+        return solverAbsoluteAccuracy;
+    }
+}
diff --git a/src/org/apache/commons/math/distribution/ZipfDistribution.java b/src/org/apache/commons/math/distribution/ZipfDistribution.java
new file mode 100644
index 0000000..0767e5d
--- /dev/null
+++ b/src/org/apache/commons/math/distribution/ZipfDistribution.java
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.math.distribution;
+
+/**
+ * The Zipf (or zeta) Distribution.
+ * <p>
+ * References:
+ * <ul>
+ * <li><a href="http://mathworld.wolfram.com/ZipfDistribution.html">Zipf
+ * Distribution</a></li>
+ * </ul>
+ * </p>
+ *
+ * @version $Revision: 920852 $ $Date: 2010-03-09 07:53:44 -0500 (Tue, 09 Mar 2010) $
+ */
+public interface ZipfDistribution extends IntegerDistribution {
+
+    /**
+     * Get the number of elements (e.g. corpus size) for the distribution.
+     *
+     * @return the number of elements
+     */
+    int getNumberOfElements();
+
+    /**
+     * Set the number of elements (e.g. corpus size) for the distribution.
+     * The parameter value must be positive; otherwise an
+     * <code>IllegalArgumentException</code> is thrown.
+     *
+     * @param n the number of elements
+     * @throws IllegalArgumentException if n ≤ 0
+     * @deprecated as of v2.1
+     */
+    @Deprecated
+    void setNumberOfElements(int n);
+
+    /**
+     * Get the exponent characterising the distribution.
+     *
+     * @return the exponent
+     */
+    double getExponent();
+
+    /**
+     * Set the exponent characterising the distribution.
+     * The parameter value must be positive; otherwise an
+     * <code>IllegalArgumentException</code> is thrown.
+     *
+     * @param s the exponent
+     * @throws IllegalArgumentException if s ≤ 0.0
+     * @deprecated as of v2.1
+     */
+    @Deprecated
+    void setExponent(double s);
+}
diff --git a/src/org/apache/commons/math/distribution/ZipfDistributionImpl.java b/src/org/apache/commons/math/distribution/ZipfDistributionImpl.java
new file mode 100644
index 0000000..ff1dec3
--- /dev/null
+++ b/src/org/apache/commons/math/distribution/ZipfDistributionImpl.java
@@ -0,0 +1,221 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.math.distribution;
+
+import java.io.Serializable;
+
+import org.apache.commons.math.MathRuntimeException;
+
+/**
+ * Implementation for the {@link ZipfDistribution}.
+ *
+ * @version $Revision: 920852 $ $Date: 2010-03-09 07:53:44 -0500 (Tue, 09 Mar 2010) $
+ */
+public class ZipfDistributionImpl extends AbstractIntegerDistribution
+        implements ZipfDistribution, Serializable {
+
+    /**
+     * Serializable version identifier.
+     */
+    private static final long serialVersionUID = -140627372283420404L;
+
+    /**
+     * Number of elements.
+     */
+    private int numberOfElements;
+
+    /**
+     * Exponent parameter of the distribution.
+     */
+    private double exponent;
+
+    /**
+     * Create a new Zipf distribution with the given number of elements and
+     * exponent. Both values must be positive; otherwise an
+     * <code>IllegalArgumentException</code> is thrown.
+     *
+     * @param numberOfElements the number of elements
+     * @param exponent         the exponent
+     * @throws IllegalArgumentException if n ≤ 0 or s ≤ 0.0
+     */
+    public ZipfDistributionImpl(final int numberOfElements, final double exponent)
+            throws IllegalArgumentException {
+        setNumberOfElementsInternal(numberOfElements);
+        setExponentInternal(exponent);
+    }
+
+    /**
+     * Get the number of elements (e.g. corpus size) for the distribution.
+     *
+     * @return the number of elements
+     */
+    public int getNumberOfElements() {
+        return numberOfElements;
+    }
+
+    /**
+     * Set the number of elements (e.g. corpus size) for the distribution.
+     * The parameter value must be positive; otherwise an
+     * <code>IllegalArgumentException</code> is thrown.
+     *
+     * @param n the number of elements
+     * @throws IllegalArgumentException if n ≤ 0
+     * @deprecated as of 2.1 (class will become immutable in 3.0)
+     */
+    @Deprecated
+    public void setNumberOfElements(final int n) {
+        setNumberOfElementsInternal(n);
+    }
+
+    /**
+     * Set the number of elements (e.g. corpus size) for the distribution.
+     * The parameter value must be positive; otherwise an
+     * <code>IllegalArgumentException</code> is thrown.
+     *
+     * @param n the number of elements
+     * @throws IllegalArgumentException if n ≤ 0
+     */
+    private void setNumberOfElementsInternal(final int n)
+            throws IllegalArgumentException {
+        if (n <= 0) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "invalid number of elements {0} (must be positive)",
+                    n);
+        }
+        this.numberOfElements = n;
+    }
+
+    /**
+     * Get the exponent characterising the distribution.
+     *
+     * @return the exponent
+     */
+    public double getExponent() {
+        return exponent;
+    }
+
+    /**
+     * Set the exponent characterising the distribution.
+     * The parameter value must be positive; otherwise an
+     * <code>IllegalArgumentException</code> is thrown.
+     *
+     * @param s the exponent
+     * @throws IllegalArgumentException if s ≤ 0.0
+     * @deprecated as of 2.1 (class will become immutable in 3.0)
+     */
+    @Deprecated
+    public void setExponent(final double s) {
+        setExponentInternal(s);
+    }
+
+    /**
+     * Set the exponent characterising the distribution.
+     * The parameter value must be positive; otherwise an
+     * <code>IllegalArgumentException</code> is thrown.
+     *
+     * @param s the exponent
+     * @throws IllegalArgumentException if s ≤ 0.0
+     */
+    private void setExponentInternal(final double s)
+            throws IllegalArgumentException {
+        if (s <= 0.0) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "invalid exponent {0} (must be positive)",
+                    s);
+        }
+        this.exponent = s;
+    }
+
+    /**
+     * The probability mass function P(X = x) for a Zipf distribution.
+     *
+     * @param x the value at which the probability density function is evaluated.
+     * @return the value of the probability mass function at x
+     */
+    public double probability(final int x) {
+        if (x <= 0 || x > numberOfElements) {
+            return 0.0;
+        }
+
+        return (1.0 / Math.pow(x, exponent)) / generalizedHarmonic(numberOfElements, exponent);
+
+    }
+
+    /**
+     * The probability distribution function P(X <= x) for a Zipf distribution.
+     *
+     * @param x the value at which the PDF is evaluated.
+     * @return Zipf distribution function evaluated at x
+     */
+    @Override
+    public double cumulativeProbability(final int x) {
+        if (x <= 0) {
+            return 0.0;
+        } else if (x >= numberOfElements) {
+            return 1.0;
+        }
+
+        return generalizedHarmonic(x, exponent) / generalizedHarmonic(numberOfElements, exponent);
+
+    }
+
+    /**
+     * Access the domain value lower bound, based on <code>p</code>, used to
+     * bracket a PDF root.
+     *
+     * @param p the desired probability for the critical value
+     * @return domain value lower bound, i.e.
+     *         P(X < <i>lower bound</i>) < <code>p</code>
+     */
+    @Override
+    protected int getDomainLowerBound(final double p) {
+        return 0;
+    }
+
+    /**
+     * Access the domain value upper bound, based on <code>p</code>, used to
+     * bracket a PDF root.
+     *
+     * @param p the desired probability for the critical value
+     * @return domain value upper bound, i.e.
+     *         P(X < <i>upper bound</i>) > <code>p</code>
+     */
+    @Override
+    protected int getDomainUpperBound(final double p) {
+        return numberOfElements;
+    }
+
+
+    /**
+     * Calculates the Nth generalized harmonic number. See
+     * <a href="http://mathworld.wolfram.com/HarmonicSeries.html">Harmonic
+     * Series</a>.
+     *
+     * @param n the term in the series to calculate (must be ≥ 1)
+     * @param m the exponent; special case m == 1.0 is the harmonic series
+     * @return the nth generalized harmonic number
+     */
+    private double generalizedHarmonic(final int n, final double m) {
+        double value = 0;
+        for (int k = n; k > 0; --k) {
+            value += 1.0 / Math.pow(k, m);
+        }
+        return value;
+    }
+
+}
diff --git a/src/org/apache/commons/math/special/Beta.java b/src/org/apache/commons/math/special/Beta.java
new file mode 100644
index 0000000..0669e96
--- /dev/null
+++ b/src/org/apache/commons/math/special/Beta.java
@@ -0,0 +1,198 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.special;
+
+import org.apache.commons.math.MathException;
+import org.apache.commons.math.util.ContinuedFraction;
+
+/**
+ * This is a utility class that provides computation methods related to the
+ * Beta family of functions.
+ *
+ * @version $Revision: 811685 $ $Date: 2009-09-05 13:36:48 -0400 (Sat, 05 Sep 2009) $
+ */
+public class Beta {
+
+    /**
+     * Maximum allowed numerical error.
+     */
+    private static final double DEFAULT_EPSILON = 10e-15;
+
+    /**
+     * Default constructor.  Prohibit instantiation.
+     */
+    private Beta() {
+        super();
+    }
+
+    /**
+     * Returns the
+     * <a href="http://mathworld.wolfram.com/RegularizedBetaFunction.html">
+     * regularized beta function</a> I(x, a, b).
+     *
+     * @param x the value.
+     * @param a the a parameter.
+     * @param b the b parameter.
+     * @return the regularized beta function I(x, a, b)
+     * @throws MathException if the algorithm fails to converge.
+     */
+    public static double regularizedBeta(double x, double a, double b)
+            throws MathException {
+        return regularizedBeta(x, a, b, DEFAULT_EPSILON, Integer.MAX_VALUE);
+    }
+
+    /**
+     * Returns the
+     * <a href="http://mathworld.wolfram.com/RegularizedBetaFunction.html">
+     * regularized beta function</a> I(x, a, b).
+     *
+     * @param x       the value.
+     * @param a       the a parameter.
+     * @param b       the b parameter.
+     * @param epsilon When the absolute value of the nth item in the
+     *                series is less than epsilon the approximation ceases
+     *                to calculate further elements in the series.
+     * @return the regularized beta function I(x, a, b)
+     * @throws MathException if the algorithm fails to converge.
+     */
+    public static double regularizedBeta(double x, double a, double b,
+                                         double epsilon) throws MathException {
+        return regularizedBeta(x, a, b, epsilon, Integer.MAX_VALUE);
+    }
+
+    /**
+     * Returns the regularized beta function I(x, a, b).
+     *
+     * @param x             the value.
+     * @param a             the a parameter.
+     * @param b             the b parameter.
+     * @param maxIterations Maximum number of "iterations" to complete.
+     * @return the regularized beta function I(x, a, b)
+     * @throws MathException if the algorithm fails to converge.
+     */
+    public static double regularizedBeta(double x, double a, double b,
+                                         int maxIterations) throws MathException {
+        return regularizedBeta(x, a, b, DEFAULT_EPSILON, maxIterations);
+    }
+
+    /**
+     * Returns the regularized beta function I(x, a, b).
+     * <p/>
+     * The implementation of this method is based on:
+     * <ul>
+     * <li>
+     * <a href="http://mathworld.wolfram.com/RegularizedBetaFunction.html">
+     * Regularized Beta Function</a>.</li>
+     * <li>
+     * <a href="http://functions.wolfram.com/06.21.10.0001.01">
+     * Regularized Beta Function</a>.</li>
+     * </ul>
+     *
+     * @param x             the value.
+     * @param a             the a parameter.
+     * @param b             the b parameter.
+     * @param epsilon       When the absolute value of the nth item in the
+     *                      series is less than epsilon the approximation ceases
+     *                      to calculate further elements in the series.
+     * @param maxIterations Maximum number of "iterations" to complete.
+     * @return the regularized beta function I(x, a, b)
+     * @throws MathException if the algorithm fails to converge.
+     */
+    public static double regularizedBeta(double x, final double a,
+                                         final double b, double epsilon, int maxIterations) throws MathException {
+        double ret;
+
+        if (Double.isNaN(x) || Double.isNaN(a) || Double.isNaN(b) || (x < 0) ||
+                (x > 1) || (a <= 0.0) || (b <= 0.0)) {
+            ret = Double.NaN;
+        } else if (x > (a + 1.0) / (a + b + 2.0)) {
+            ret = 1.0 - regularizedBeta(1.0 - x, b, a, epsilon, maxIterations);
+        } else {
+            ContinuedFraction fraction = new ContinuedFraction() {
+
+                @Override
+                protected double getB(int n, double x) {
+                    double ret;
+                    double m;
+                    if (n % 2 == 0) { // even
+                        m = n / 2.0;
+                        ret = (m * (b - m) * x) /
+                                ((a + (2 * m) - 1) * (a + (2 * m)));
+                    } else {
+                        m = (n - 1.0) / 2.0;
+                        ret = -((a + m) * (a + b + m) * x) /
+                                ((a + (2 * m)) * (a + (2 * m) + 1.0));
+                    }
+                    return ret;
+                }
+
+                @Override
+                protected double getA(int n, double x) {
+                    return 1.0;
+                }
+            };
+            ret = Math.exp((a * Math.log(x)) + (b * Math.log(1.0 - x)) -
+                    Math.log(a) - logBeta(a, b, epsilon, maxIterations)) *
+                    1.0 / fraction.evaluate(x, epsilon, maxIterations);
+        }
+
+        return ret;
+    }
+
+    /**
+     * Returns the natural logarithm of the beta function B(a, b).
+     *
+     * @param a the a parameter.
+     * @param b the b parameter.
+     * @return log(B(a, b))
+     */
+    public static double logBeta(double a, double b) {
+        return logBeta(a, b, DEFAULT_EPSILON, Integer.MAX_VALUE);
+    }
+
+    /**
+     * Returns the natural logarithm of the beta function B(a, b).
+     * <p/>
+     * The implementation of this method is based on:
+     * <ul>
+     * <li><a href="http://mathworld.wolfram.com/BetaFunction.html">
+     * Beta Function</a>, equation (1).</li>
+     * </ul>
+     *
+     * @param a             the a parameter.
+     * @param b             the b parameter.
+     * @param epsilon       When the absolute value of the nth item in the
+     *                      series is less than epsilon the approximation ceases
+     *                      to calculate further elements in the series.
+     * @param maxIterations Maximum number of "iterations" to complete.
+     * @return log(B(a, b))
+     */
+    public static double logBeta(double a, double b, double epsilon,
+                                 int maxIterations) {
+
+        double ret;
+
+        if (Double.isNaN(a) || Double.isNaN(b) || (a <= 0.0) || (b <= 0.0)) {
+            ret = Double.NaN;
+        } else {
+            ret = Gamma.logGamma(a) + Gamma.logGamma(b) -
+                    Gamma.logGamma(a + b);
+        }
+
+        return ret;
+    }
+}
diff --git a/src/org/apache/commons/math/special/Erf.java b/src/org/apache/commons/math/special/Erf.java
new file mode 100644
index 0000000..06dd324
--- /dev/null
+++ b/src/org/apache/commons/math/special/Erf.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.special;
+
+import org.apache.commons.math.MathException;
+
+/**
+ * This is a utility class that provides computation methods related to the
+ * error functions.
+ *
+ * @version $Revision: 811685 $ $Date: 2009-09-05 13:36:48 -0400 (Sat, 05 Sep 2009) $
+ */
+public class Erf {
+
+    /**
+     * Default constructor.  Prohibit instantiation.
+     */
+    private Erf() {
+        super();
+    }
+
+    /**
+     * Returns the error function erf(x).
+     * <p/>
+     * The implementation of this method is based on:
+     * <ul>
+     * <li>
+     * <a href="http://mathworld.wolfram.com/Erf.html">
+     * Erf</a>, equation (3).</li>
+     * </ul>
+     *
+     * @param x the value.
+     * @return the error function erf(x)
+     * @throws MathException if the algorithm fails to converge.
+     */
+    public static double erf(double x) throws MathException {
+        double ret = Gamma.regularizedGammaP(0.5, x * x, 1.0e-15, 10000);
+        if (x < 0) {
+            ret = -ret;
+        }
+        return ret;
+    }
+}
diff --git a/src/org/apache/commons/math/special/Gamma.java b/src/org/apache/commons/math/special/Gamma.java
new file mode 100644
index 0000000..0931144
--- /dev/null
+++ b/src/org/apache/commons/math/special/Gamma.java
@@ -0,0 +1,345 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.special;
+
+import org.apache.commons.math.MathException;
+import org.apache.commons.math.MaxIterationsExceededException;
+import org.apache.commons.math.util.ContinuedFraction;
+
+/**
+ * This is a utility class that provides computation methods related to the
+ * Gamma family of functions.
+ *
+ * @version $Revision: 920558 $ $Date: 2010-03-08 17:57:32 -0500 (Mon, 08 Mar 2010) $
+ */
+public class Gamma {
+
+    /**
+     * <a href="http://en.wikipedia.org/wiki/Euler-Mascheroni_constant">Euler-Mascheroni constant</a>
+     *
+     * @since 2.0
+     */
+    public static final double GAMMA = 0.577215664901532860606512090082;
+
+    /**
+     * Maximum allowed numerical error.
+     */
+    private static final double DEFAULT_EPSILON = 10e-15;
+
+    /**
+     * Lanczos coefficients
+     */
+    private static final double[] LANCZOS =
+            {
+                    0.99999999999999709182,
+                    57.156235665862923517,
+                    -59.597960355475491248,
+                    14.136097974741747174,
+                    -0.49191381609762019978,
+                    .33994649984811888699e-4,
+                    .46523628927048575665e-4,
+                    -.98374475304879564677e-4,
+                    .15808870322491248884e-3,
+                    -.21026444172410488319e-3,
+                    .21743961811521264320e-3,
+                    -.16431810653676389022e-3,
+                    .84418223983852743293e-4,
+                    -.26190838401581408670e-4,
+                    .36899182659531622704e-5,
+            };
+
+    /**
+     * Avoid repeated computation of log of 2 PI in logGamma
+     */
+    private static final double HALF_LOG_2_PI = 0.5 * Math.log(2.0 * Math.PI);
+
+    // limits for switching algorithm in digamma
+    /**
+     * C limit.
+     */
+    private static final double C_LIMIT = 49;
+
+    /**
+     * S limit.
+     */
+    private static final double S_LIMIT = 1e-5;
+
+    /**
+     * Default constructor.  Prohibit instantiation.
+     */
+    private Gamma() {
+        super();
+    }
+
+    /**
+     * Returns the natural logarithm of the gamma function Γ(x).
+     * <p/>
+     * The implementation of this method is based on:
+     * <ul>
+     * <li><a href="http://mathworld.wolfram.com/GammaFunction.html">
+     * Gamma Function</a>, equation (28).</li>
+     * <li><a href="http://mathworld.wolfram.com/LanczosApproximation.html">
+     * Lanczos Approximation</a>, equations (1) through (5).</li>
+     * <li><a href="http://my.fit.edu/~gabdo/gamma.txt">Paul Godfrey, A note on
+     * the computation of the convergent Lanczos complex Gamma approximation
+     * </a></li>
+     * </ul>
+     *
+     * @param x the value.
+     * @return log(Γ(x))
+     */
+    public static double logGamma(double x) {
+        double ret;
+
+        if (Double.isNaN(x) || (x <= 0.0)) {
+            ret = Double.NaN;
+        } else {
+            double g = 607.0 / 128.0;
+
+            double sum = 0.0;
+            for (int i = LANCZOS.length - 1; i > 0; --i) {
+                sum = sum + (LANCZOS[i] / (x + i));
+            }
+            sum = sum + LANCZOS[0];
+
+            double tmp = x + g + .5;
+            ret = ((x + .5) * Math.log(tmp)) - tmp +
+                    HALF_LOG_2_PI + Math.log(sum / x);
+        }
+
+        return ret;
+    }
+
+    /**
+     * Returns the regularized gamma function P(a, x).
+     *
+     * @param a the a parameter.
+     * @param x the value.
+     * @return the regularized gamma function P(a, x)
+     * @throws MathException if the algorithm fails to converge.
+     */
+    public static double regularizedGammaP(double a, double x)
+            throws MathException {
+        return regularizedGammaP(a, x, DEFAULT_EPSILON, Integer.MAX_VALUE);
+    }
+
+
+    /**
+     * Returns the regularized gamma function P(a, x).
+     * <p/>
+     * The implementation of this method is based on:
+     * <ul>
+     * <li>
+     * <a href="http://mathworld.wolfram.com/RegularizedGammaFunction.html">
+     * Regularized Gamma Function</a>, equation (1).</li>
+     * <li>
+     * <a href="http://mathworld.wolfram.com/IncompleteGammaFunction.html">
+     * Incomplete Gamma Function</a>, equation (4).</li>
+     * <li>
+     * <a href="http://mathworld.wolfram.com/ConfluentHypergeometricFunctionoftheFirstKind.html">
+     * Confluent Hypergeometric Function of the First Kind</a>, equation (1).
+     * </li>
+     * </ul>
+     *
+     * @param a             the a parameter.
+     * @param x             the value.
+     * @param epsilon       When the absolute value of the nth item in the
+     *                      series is less than epsilon the approximation ceases
+     *                      to calculate further elements in the series.
+     * @param maxIterations Maximum number of "iterations" to complete.
+     * @return the regularized gamma function P(a, x)
+     * @throws MathException if the algorithm fails to converge.
+     */
+    public static double regularizedGammaP(double a,
+                                           double x,
+                                           double epsilon,
+                                           int maxIterations)
+            throws MathException {
+        double ret;
+
+        if (Double.isNaN(a) || Double.isNaN(x) || (a <= 0.0) || (x < 0.0)) {
+            ret = Double.NaN;
+        } else if (x == 0.0) {
+            ret = 0.0;
+        } else if (x >= a + 1) {
+            // use regularizedGammaQ because it should converge faster in this
+            // case.
+            ret = 1.0 - regularizedGammaQ(a, x, epsilon, maxIterations);
+        } else {
+            // calculate series
+            double n = 0.0; // current element index
+            double an = 1.0 / a; // n-th element in the series
+            double sum = an; // partial sum
+            while (Math.abs(an / sum) > epsilon && n < maxIterations && sum < Double.POSITIVE_INFINITY) {
+                // compute next element in the series
+                n = n + 1.0;
+                an = an * (x / (a + n));
+
+                // update partial sum
+                sum = sum + an;
+            }
+            if (n >= maxIterations) {
+                throw new MaxIterationsExceededException(maxIterations);
+            } else if (Double.isInfinite(sum)) {
+                ret = 1.0;
+            } else {
+                ret = Math.exp(-x + (a * Math.log(x)) - logGamma(a)) * sum;
+            }
+        }
+
+        return ret;
+    }
+
+    /**
+     * Returns the regularized gamma function Q(a, x) = 1 - P(a, x).
+     *
+     * @param a the a parameter.
+     * @param x the value.
+     * @return the regularized gamma function Q(a, x)
+     * @throws MathException if the algorithm fails to converge.
+     */
+    public static double regularizedGammaQ(double a, double x)
+            throws MathException {
+        return regularizedGammaQ(a, x, DEFAULT_EPSILON, Integer.MAX_VALUE);
+    }
+
+    /**
+     * Returns the regularized gamma function Q(a, x) = 1 - P(a, x).
+     * <p/>
+     * The implementation of this method is based on:
+     * <ul>
+     * <li>
+     * <a href="http://mathworld.wolfram.com/RegularizedGammaFunction.html">
+     * Regularized Gamma Function</a>, equation (1).</li>
+     * <li>
+     * <a href="http://functions.wolfram.com/GammaBetaErf/GammaRegularized/10/0003/">
+     * Regularized incomplete gamma function: Continued fraction representations  (formula 06.08.10.0003)</a></li>
+     * </ul>
+     *
+     * @param a             the a parameter.
+     * @param x             the value.
+     * @param epsilon       When the absolute value of the nth item in the
+     *                      series is less than epsilon the approximation ceases
+     *                      to calculate further elements in the series.
+     * @param maxIterations Maximum number of "iterations" to complete.
+     * @return the regularized gamma function P(a, x)
+     * @throws MathException if the algorithm fails to converge.
+     */
+    public static double regularizedGammaQ(final double a,
+                                           double x,
+                                           double epsilon,
+                                           int maxIterations)
+            throws MathException {
+        double ret;
+
+        if (Double.isNaN(a) || Double.isNaN(x) || (a <= 0.0) || (x < 0.0)) {
+            ret = Double.NaN;
+        } else if (x == 0.0) {
+            ret = 1.0;
+        } else if (x < a + 1.0) {
+            // use regularizedGammaP because it should converge faster in this
+            // case.
+            ret = 1.0 - regularizedGammaP(a, x, epsilon, maxIterations);
+        } else {
+            // create continued fraction
+            ContinuedFraction cf = new ContinuedFraction() {
+
+                @Override
+                protected double getA(int n, double x) {
+                    return ((2.0 * n) + 1.0) - a + x;
+                }
+
+                @Override
+                protected double getB(int n, double x) {
+                    return n * (a - n);
+                }
+            };
+
+            ret = 1.0 / cf.evaluate(x, epsilon, maxIterations);
+            ret = Math.exp(-x + (a * Math.log(x)) - logGamma(a)) * ret;
+        }
+
+        return ret;
+    }
+
+
+    /**
+     * <p>Computes the digamma function of x.</p>
+     * <p/>
+     * <p>This is an independently written implementation of the algorithm described in
+     * Jose Bernardo, Algorithm AS 103: Psi (Digamma) Function, Applied Statistics, 1976.</p>
+     * <p/>
+     * <p>Some of the constants have been changed to increase accuracy at the moderate expense
+     * of run-time.  The result should be accurate to within 10^-8 absolute tolerance for
+     * x >= 10^-5 and within 10^-8 relative tolerance for x > 0.</p>
+     * <p/>
+     * <p>Performance for large negative values of x will be quite expensive (proportional to
+     * |x|).  Accuracy for negative values of x should be about 10^-8 absolute for results
+     * less than 10^5 and 10^-8 relative for results larger than that.</p>
+     *
+     * @param x the argument
+     * @return digamma(x) to within 10-8 relative or absolute error whichever is smaller
+     * @see <a href="http://en.wikipedia.org/wiki/Digamma_function"> Digamma at wikipedia </a>
+     * @see <a href="http://www.uv.es/~bernardo/1976AppStatist.pdf"> Bernardo's original article </a>
+     * @since 2.0
+     */
+    public static double digamma(double x) {
+        if (x > 0 && x <= S_LIMIT) {
+            // use method 5 from Bernardo AS103
+            // accurate to O(x)
+            return -GAMMA - 1 / x;
+        }
+
+        if (x >= C_LIMIT) {
+            // use method 4 (accurate to O(1/x^8)
+            double inv = 1 / (x * x);
+            //            1       1        1         1
+            // log(x) -  --- - ------ + ------- - -------
+            //           2 x   12 x^2   120 x^4   252 x^6
+            return Math.log(x) - 0.5 / x - inv * ((1.0 / 12) + inv * (1.0 / 120 - inv / 252));
+        }
+
+        return digamma(x + 1) - 1 / x;
+    }
+
+    /**
+     * <p>Computes the trigamma function of x.  This function is derived by taking the derivative of
+     * the implementation of digamma.</p>
+     *
+     * @param x the argument
+     * @return trigamma(x) to within 10-8 relative or absolute error whichever is smaller
+     * @see <a href="http://en.wikipedia.org/wiki/Trigamma_function"> Trigamma at wikipedia </a>
+     * @see Gamma#digamma(double)
+     * @since 2.0
+     */
+    public static double trigamma(double x) {
+        if (x > 0 && x <= S_LIMIT) {
+            return 1 / (x * x);
+        }
+
+        if (x >= C_LIMIT) {
+            double inv = 1 / (x * x);
+            //  1    1      1       1       1
+            //  - + ---- + ---- - ----- + -----
+            //  x      2      3       5       7
+            //      2 x    6 x    30 x    42 x
+            return 1 / x + inv / 2 + inv / x * (1.0 / 6 - inv * (1.0 / 30 + inv / 42));
+        }
+
+        return trigamma(x + 1) + 1 / (x * x);
+    }
+}
diff --git a/src/org/apache/commons/math/util/ContinuedFraction.java b/src/org/apache/commons/math/util/ContinuedFraction.java
new file mode 100644
index 0000000..a566542
--- /dev/null
+++ b/src/org/apache/commons/math/util/ContinuedFraction.java
@@ -0,0 +1,213 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math.util;
+
+import org.apache.commons.math.ConvergenceException;
+import org.apache.commons.math.MathException;
+import org.apache.commons.math.MaxIterationsExceededException;
+
+/**
+ * Provides a generic means to evaluate continued fractions.  Subclasses simply
+ * provided the a and b coefficients to evaluate the continued fraction.
+ * <p/>
+ * <p>
+ * References:
+ * <ul>
+ * <li><a href="http://mathworld.wolfram.com/ContinuedFraction.html">
+ * Continued Fraction</a></li>
+ * </ul>
+ * </p>
+ *
+ * @version $Revision: 920558 $ $Date: 2010-03-08 17:57:32 -0500 (Mon, 08 Mar 2010) $
+ */
+public abstract class ContinuedFraction {
+
+    /**
+     * Maximum allowed numerical error.
+     */
+    private static final double DEFAULT_EPSILON = 10e-9;
+
+    /**
+     * Default constructor.
+     */
+    protected ContinuedFraction() {
+        super();
+    }
+
+    /**
+     * Access the n-th a coefficient of the continued fraction.  Since a can be
+     * a function of the evaluation point, x, that is passed in as well.
+     *
+     * @param n the coefficient index to retrieve.
+     * @param x the evaluation point.
+     * @return the n-th a coefficient.
+     */
+    protected abstract double getA(int n, double x);
+
+    /**
+     * Access the n-th b coefficient of the continued fraction.  Since b can be
+     * a function of the evaluation point, x, that is passed in as well.
+     *
+     * @param n the coefficient index to retrieve.
+     * @param x the evaluation point.
+     * @return the n-th b coefficient.
+     */
+    protected abstract double getB(int n, double x);
+
+    /**
+     * Evaluates the continued fraction at the value x.
+     *
+     * @param x the evaluation point.
+     * @return the value of the continued fraction evaluated at x.
+     * @throws MathException if the algorithm fails to converge.
+     */
+    public double evaluate(double x) throws MathException {
+        return evaluate(x, DEFAULT_EPSILON, Integer.MAX_VALUE);
+    }
+
+    /**
+     * Evaluates the continued fraction at the value x.
+     *
+     * @param x       the evaluation point.
+     * @param epsilon maximum error allowed.
+     * @return the value of the continued fraction evaluated at x.
+     * @throws MathException if the algorithm fails to converge.
+     */
+    public double evaluate(double x, double epsilon) throws MathException {
+        return evaluate(x, epsilon, Integer.MAX_VALUE);
+    }
+
+    /**
+     * Evaluates the continued fraction at the value x.
+     *
+     * @param x             the evaluation point.
+     * @param maxIterations maximum number of convergents
+     * @return the value of the continued fraction evaluated at x.
+     * @throws MathException if the algorithm fails to converge.
+     */
+    public double evaluate(double x, int maxIterations) throws MathException {
+        return evaluate(x, DEFAULT_EPSILON, maxIterations);
+    }
+
+    /**
+     * <p>
+     * Evaluates the continued fraction at the value x.
+     * </p>
+     * <p/>
+     * <p>
+     * The implementation of this method is based on equations 14-17 of:
+     * <ul>
+     * <li>
+     * Eric W. Weisstein. "Continued Fraction." From MathWorld--A Wolfram Web
+     * Resource. <a target="_blank"
+     * href="http://mathworld.wolfram.com/ContinuedFraction.html">
+     * http://mathworld.wolfram.com/ContinuedFraction.html</a>
+     * </li>
+     * </ul>
+     * The recurrence relationship defined in those equations can result in
+     * very large intermediate results which can result in numerical overflow.
+     * As a means to combat these overflow conditions, the intermediate results
+     * are scaled whenever they threaten to become numerically unstable.</p>
+     *
+     * @param x             the evaluation point.
+     * @param epsilon       maximum error allowed.
+     * @param maxIterations maximum number of convergents
+     * @return the value of the continued fraction evaluated at x.
+     * @throws MathException if the algorithm fails to converge.
+     */
+    public double evaluate(double x, double epsilon, int maxIterations)
+            throws MathException {
+        double p0 = 1.0;
+        double p1 = getA(0, x);
+        double q0 = 0.0;
+        double q1 = 1.0;
+        double c = p1 / q1;
+        int n = 0;
+        double relativeError = Double.MAX_VALUE;
+        while (n < maxIterations && relativeError > epsilon) {
+            ++n;
+            double a = getA(n, x);
+            double b = getB(n, x);
+            double p2 = a * p1 + b * p0;
+            double q2 = a * q1 + b * q0;
+            boolean infinite = false;
+            if (Double.isInfinite(p2) || Double.isInfinite(q2)) {
+                /*
+                 * Need to scale. Try successive powers of the larger of a or b
+                 * up to 5th power. Throw ConvergenceException if one or both
+                 * of p2, q2 still overflow.
+                 */
+                double scaleFactor = 1d;
+                double lastScaleFactor = 1d;
+                final int maxPower = 5;
+                final double scale = Math.max(a, b);
+                if (scale <= 0) {  // Can't scale
+                    throw new ConvergenceException(
+                            "Continued fraction convergents diverged to +/- infinity for value {0}",
+                            x);
+                }
+                infinite = true;
+                for (int i = 0; i < maxPower; i++) {
+                    lastScaleFactor = scaleFactor;
+                    scaleFactor *= scale;
+                    if (a != 0.0 && a > b) {
+                        p2 = p1 / lastScaleFactor + (b / scaleFactor * p0);
+                        q2 = q1 / lastScaleFactor + (b / scaleFactor * q0);
+                    } else if (b != 0) {
+                        p2 = (a / scaleFactor * p1) + p0 / lastScaleFactor;
+                        q2 = (a / scaleFactor * q1) + q0 / lastScaleFactor;
+                    }
+                    infinite = Double.isInfinite(p2) || Double.isInfinite(q2);
+                    if (!infinite) {
+                        break;
+                    }
+                }
+            }
+
+            if (infinite) {
+                // Scaling failed
+                throw new ConvergenceException(
+                        "Continued fraction convergents diverged to +/- infinity for value {0}",
+                        x);
+            }
+
+            double r = p2 / q2;
+
+            if (Double.isNaN(r)) {
+                throw new ConvergenceException(
+                        "Continued fraction diverged to NaN for value {0}",
+                        x);
+            }
+            relativeError = Math.abs(r / c - 1.0);
+
+            // prepare for next iteration
+            c = p2 / q2;
+            p0 = p1;
+            p1 = p2;
+            q0 = q1;
+            q1 = q2;
+        }
+
+        if (n >= maxIterations) {
+            throw new MaxIterationsExceededException(maxIterations,
+                    "Continued fraction convergents failed to converge for value {0}",
+                    x);
+        }
+
+        return c;
+    }
+}
diff --git a/src/org/apache/commons/math/util/MathUtils.java b/src/org/apache/commons/math/util/MathUtils.java
new file mode 100644
index 0000000..aa4f95a
--- /dev/null
+++ b/src/org/apache/commons/math/util/MathUtils.java
@@ -0,0 +1,1864 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.math.util;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.Arrays;
+
+import org.apache.commons.math.MathRuntimeException;
+
+/**
+ * Some useful additions to the built-in functions in {@link Math}.
+ *
+ * @version $Revision: 927249 $ $Date: 2010-03-24 21:06:51 -0400 (Wed, 24 Mar 2010) $
+ */
+public final class MathUtils {
+
+    /**
+     * Smallest positive number such that 1 - EPSILON is not numerically equal to 1.
+     */
+    public static final double EPSILON = 0x1.0p-53;
+
+    /**
+     * Safe minimum, such that 1 / SAFE_MIN does not overflow.
+     * <p>In IEEE 754 arithmetic, this is also the smallest normalized
+     * number 2<sup>-1022</sup>.</p>
+     */
+    public static final double SAFE_MIN = 0x1.0p-1022;
+
+    /**
+     * 2 π.
+     *
+     * @since 2.1
+     */
+    public static final double TWO_PI = 2 * Math.PI;
+
+    /**
+     * -1.0 cast as a byte.
+     */
+    private static final byte NB = (byte) -1;
+
+    /**
+     * -1.0 cast as a short.
+     */
+    private static final short NS = (short) -1;
+
+    /**
+     * 1.0 cast as a byte.
+     */
+    private static final byte PB = (byte) 1;
+
+    /**
+     * 1.0 cast as a short.
+     */
+    private static final short PS = (short) 1;
+
+    /**
+     * 0.0 cast as a byte.
+     */
+    private static final byte ZB = (byte) 0;
+
+    /**
+     * 0.0 cast as a short.
+     */
+    private static final short ZS = (short) 0;
+
+    /**
+     * Gap between NaN and regular numbers.
+     */
+    private static final int NAN_GAP = 4 * 1024 * 1024;
+
+    /**
+     * Offset to order signed double numbers lexicographically.
+     */
+    private static final long SGN_MASK = 0x8000000000000000L;
+
+    /**
+     * All long-representable factorials
+     */
+    private static final long[] FACTORIALS = new long[]{
+            1l, 1l, 2l,
+            6l, 24l, 120l,
+            720l, 5040l, 40320l,
+            362880l, 3628800l, 39916800l,
+            479001600l, 6227020800l, 87178291200l,
+            1307674368000l, 20922789888000l, 355687428096000l,
+            6402373705728000l, 121645100408832000l, 2432902008176640000l};
+
+    /**
+     * Private Constructor
+     */
+    private MathUtils() {
+        super();
+    }
+
+    /**
+     * Add two integers, checking for overflow.
+     *
+     * @param x an addend
+     * @param y an addend
+     * @return the sum <code>x+y</code>
+     * @throws ArithmeticException if the result can not be represented as an
+     *                             int
+     * @since 1.1
+     */
+    public static int addAndCheck(int x, int y) {
+        long s = (long) x + (long) y;
+        if (s < Integer.MIN_VALUE || s > Integer.MAX_VALUE) {
+            throw new ArithmeticException("overflow: add");
+        }
+        return (int) s;
+    }
+
+    /**
+     * Add two long integers, checking for overflow.
+     *
+     * @param a an addend
+     * @param b an addend
+     * @return the sum <code>a+b</code>
+     * @throws ArithmeticException if the result can not be represented as an
+     *                             long
+     * @since 1.2
+     */
+    public static long addAndCheck(long a, long b) {
+        return addAndCheck(a, b, "overflow: add");
+    }
+
+    /**
+     * Add two long integers, checking for overflow.
+     *
+     * @param a   an addend
+     * @param b   an addend
+     * @param msg the message to use for any thrown exception.
+     * @return the sum <code>a+b</code>
+     * @throws ArithmeticException if the result can not be represented as an
+     *                             long
+     * @since 1.2
+     */
+    private static long addAndCheck(long a, long b, String msg) {
+        long ret;
+        if (a > b) {
+            // use symmetry to reduce boundary cases
+            ret = addAndCheck(b, a, msg);
+        } else {
+            // assert a <= b
+
+            if (a < 0) {
+                if (b < 0) {
+                    // check for negative overflow
+                    if (Long.MIN_VALUE - b <= a) {
+                        ret = a + b;
+                    } else {
+                        throw new ArithmeticException(msg);
+                    }
+                } else {
+                    // opposite sign addition is always safe
+                    ret = a + b;
+                }
+            } else {
+                // assert a >= 0
+                // assert b >= 0
+
+                // check for positive overflow
+                if (a <= Long.MAX_VALUE - b) {
+                    ret = a + b;
+                } else {
+                    throw new ArithmeticException(msg);
+                }
+            }
+        }
+        return ret;
+    }
+
+    /**
+     * Returns an exact representation of the <a
+     * href="http://mathworld.wolfram.com/BinomialCoefficient.html"> Binomial
+     * Coefficient</a>, "<code>n choose k</code>", the number of
+     * <code>k</code>-element subsets that can be selected from an
+     * <code>n</code>-element set.
+     * <p>
+     * <Strong>Preconditions</strong>:
+     * <ul>
+     * <li> <code>0 <= k <= n </code> (otherwise
+     * <code>IllegalArgumentException</code> is thrown)</li>
+     * <li> The result is small enough to fit into a <code>long</code>. The
+     * largest value of <code>n</code> for which all coefficients are
+     * <code> < Long.MAX_VALUE</code> is 66. If the computed value exceeds
+     * <code>Long.MAX_VALUE</code> an <code>ArithMeticException</code> is
+     * thrown.</li>
+     * </ul></p>
+     *
+     * @param n the size of the set
+     * @param k the size of the subsets to be counted
+     * @return <code>n choose k</code>
+     * @throws IllegalArgumentException if preconditions are not met.
+     * @throws ArithmeticException      if the result is too large to be represented
+     *                                  by a long integer.
+     */
+    public static long binomialCoefficient(final int n, final int k) {
+        checkBinomial(n, k);
+        if ((n == k) || (k == 0)) {
+            return 1;
+        }
+        if ((k == 1) || (k == n - 1)) {
+            return n;
+        }
+        // Use symmetry for large k
+        if (k > n / 2)
+            return binomialCoefficient(n, n - k);
+
+        // We use the formula
+        // (n choose k) = n! / (n-k)! / k!
+        // (n choose k) == ((n-k+1)*...*n) / (1*...*k)
+        // which could be written
+        // (n choose k) == (n-1 choose k-1) * n / k
+        long result = 1;
+        if (n <= 61) {
+            // For n <= 61, the naive implementation cannot overflow.
+            int i = n - k + 1;
+            for (int j = 1; j <= k; j++) {
+                result = result * i / j;
+                i++;
+            }
+        } else if (n <= 66) {
+            // For n > 61 but n <= 66, the result cannot overflow,
+            // but we must take care not to overflow intermediate values.
+            int i = n - k + 1;
+            for (int j = 1; j <= k; j++) {
+                // We know that (result * i) is divisible by j,
+                // but (result * i) may overflow, so we split j:
+                // Filter out the gcd, d, so j/d and i/d are integer.
+                // result is divisible by (j/d) because (j/d)
+                // is relative prime to (i/d) and is a divisor of
+                // result * (i/d).
+                final long d = gcd(i, j);
+                result = (result / (j / d)) * (i / d);
+                i++;
+            }
+        } else {
+            // For n > 66, a result overflow might occur, so we check
+            // the multiplication, taking care to not overflow
+            // unnecessary.
+            int i = n - k + 1;
+            for (int j = 1; j <= k; j++) {
+                final long d = gcd(i, j);
+                result = mulAndCheck(result / (j / d), i / d);
+                i++;
+            }
+        }
+        return result;
+    }
+
+    /**
+     * Returns a <code>double</code> representation of the <a
+     * href="http://mathworld.wolfram.com/BinomialCoefficient.html"> Binomial
+     * Coefficient</a>, "<code>n choose k</code>", the number of
+     * <code>k</code>-element subsets that can be selected from an
+     * <code>n</code>-element set.
+     * <p>
+     * <Strong>Preconditions</strong>:
+     * <ul>
+     * <li> <code>0 <= k <= n </code> (otherwise
+     * <code>IllegalArgumentException</code> is thrown)</li>
+     * <li> The result is small enough to fit into a <code>double</code>. The
+     * largest value of <code>n</code> for which all coefficients are <
+     * Double.MAX_VALUE is 1029. If the computed value exceeds Double.MAX_VALUE,
+     * Double.POSITIVE_INFINITY is returned</li>
+     * </ul></p>
+     *
+     * @param n the size of the set
+     * @param k the size of the subsets to be counted
+     * @return <code>n choose k</code>
+     * @throws IllegalArgumentException if preconditions are not met.
+     */
+    public static double binomialCoefficientDouble(final int n, final int k) {
+        checkBinomial(n, k);
+        if ((n == k) || (k == 0)) {
+            return 1d;
+        }
+        if ((k == 1) || (k == n - 1)) {
+            return n;
+        }
+        if (k > n / 2) {
+            return binomialCoefficientDouble(n, n - k);
+        }
+        if (n < 67) {
+            return binomialCoefficient(n, k);
+        }
+
+        double result = 1d;
+        for (int i = 1; i <= k; i++) {
+            result *= (double) (n - k + i) / (double) i;
+        }
+
+        return Math.floor(result + 0.5);
+    }
+
+    /**
+     * Returns the natural <code>log</code> of the <a
+     * href="http://mathworld.wolfram.com/BinomialCoefficient.html"> Binomial
+     * Coefficient</a>, "<code>n choose k</code>", the number of
+     * <code>k</code>-element subsets that can be selected from an
+     * <code>n</code>-element set.
+     * <p>
+     * <Strong>Preconditions</strong>:
+     * <ul>
+     * <li> <code>0 <= k <= n </code> (otherwise
+     * <code>IllegalArgumentException</code> is thrown)</li>
+     * </ul></p>
+     *
+     * @param n the size of the set
+     * @param k the size of the subsets to be counted
+     * @return <code>n choose k</code>
+     * @throws IllegalArgumentException if preconditions are not met.
+     */
+    public static double binomialCoefficientLog(final int n, final int k) {
+        checkBinomial(n, k);
+        if ((n == k) || (k == 0)) {
+            return 0;
+        }
+        if ((k == 1) || (k == n - 1)) {
+            return Math.log(n);
+        }
+
+        /*
+         * For values small enough to do exact integer computation,
+         * return the log of the exact value
+         */
+        if (n < 67) {
+            return Math.log(binomialCoefficient(n, k));
+        }
+
+        /*
+         * Return the log of binomialCoefficientDouble for values that will not
+         * overflow binomialCoefficientDouble
+         */
+        if (n < 1030) {
+            return Math.log(binomialCoefficientDouble(n, k));
+        }
+
+        if (k > n / 2) {
+            return binomialCoefficientLog(n, n - k);
+        }
+
+        /*
+         * Sum logs for values that could overflow
+         */
+        double logSum = 0;
+
+        // n!/(n-k)!
+        for (int i = n - k + 1; i <= n; i++) {
+            logSum += Math.log(i);
+        }
+
+        // divide by k!
+        for (int i = 2; i <= k; i++) {
+            logSum -= Math.log(i);
+        }
+
+        return logSum;
+    }
+
+    /**
+     * Check binomial preconditions.
+     *
+     * @param n the size of the set
+     * @param k the size of the subsets to be counted
+     * @throws IllegalArgumentException if preconditions are not met.
+     */
+    private static void checkBinomial(final int n, final int k)
+            throws IllegalArgumentException {
+        if (n < k) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "must have n >= k for binomial coefficient (n,k), got n = {0}, k = {1}",
+                    n, k);
+        }
+        if (n < 0) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "must have n >= 0 for binomial coefficient (n,k), got n = {0}",
+                    n);
+        }
+    }
+
+    /**
+     * Compares two numbers given some amount of allowed error.
+     *
+     * @param x   the first number
+     * @param y   the second number
+     * @param eps the amount of error to allow when checking for equality
+     * @return <ul><li>0 if  {@link #equals(double, double, double) equals(x, y, eps)}</li>
+     *         <li>< 0 if !{@link #equals(double, double, double) equals(x, y, eps)} && x < y</li>
+     *         <li>> 0 if !{@link #equals(double, double, double) equals(x, y, eps)} && x > y</li></ul>
+     */
+    public static int compareTo(double x, double y, double eps) {
+        if (equals(x, y, eps)) {
+            return 0;
+        } else if (x < y) {
+            return -1;
+        }
+        return 1;
+    }
+
+    /**
+     * Returns the <a href="http://mathworld.wolfram.com/HyperbolicCosine.html">
+     * hyperbolic cosine</a> of x.
+     *
+     * @param x double value for which to find the hyperbolic cosine
+     * @return hyperbolic cosine of x
+     */
+    public static double cosh(double x) {
+        return (Math.exp(x) + Math.exp(-x)) / 2.0;
+    }
+
+    /**
+     * Returns true iff both arguments are NaN or neither is NaN and they are
+     * equal
+     *
+     * @param x first value
+     * @param y second value
+     * @return true if the values are equal or both are NaN
+     */
+    public static boolean equals(double x, double y) {
+        return (Double.isNaN(x) && Double.isNaN(y)) || x == y;
+    }
+
+    /**
+     * Returns true iff both arguments are equal or within the range of allowed
+     * error (inclusive).
+     * <p>
+     * Two NaNs are considered equals, as are two infinities with same sign.
+     * </p>
+     *
+     * @param x   first value
+     * @param y   second value
+     * @param eps the amount of absolute error to allow
+     * @return true if the values are equal or within range of each other
+     */
+    public static boolean equals(double x, double y, double eps) {
+        return equals(x, y) || (Math.abs(y - x) <= eps);
+    }
+
+    /**
+     * Returns true iff both arguments are equal or within the range of allowed
+     * error (inclusive).
+     * Adapted from <a
+     * href="http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm">
+     * Bruce Dawson</a>
+     *
+     * @param x       first value
+     * @param y       second value
+     * @param maxUlps {@code (maxUlps - 1)} is the number of floating point
+     *                values between {@code x} and {@code y}.
+     * @return {@code true} if there are less than {@code maxUlps} floating
+     *         point values between {@code x} and {@code y}
+     */
+    public static boolean equals(double x, double y, int maxUlps) {
+        // Check that "maxUlps" is non-negative and small enough so that the
+        // default NAN won't compare as equal to anything.
+        assert maxUlps > 0 && maxUlps < NAN_GAP;
+
+        long xInt = Double.doubleToLongBits(x);
+        long yInt = Double.doubleToLongBits(y);
+
+        // Make lexicographically ordered as a two's-complement integer.
+        if (xInt < 0) {
+            xInt = SGN_MASK - xInt;
+        }
+        if (yInt < 0) {
+            yInt = SGN_MASK - yInt;
+        }
+
+        return Math.abs(xInt - yInt) <= maxUlps;
+    }
+
+    /**
+     * Returns true iff both arguments are null or have same dimensions
+     * and all their elements are {@link #equals(double, double) equals}
+     *
+     * @param x first array
+     * @param y second array
+     * @return true if the values are both null or have same dimension
+     *         and equal elements
+     * @since 1.2
+     */
+    public static boolean equals(double[] x, double[] y) {
+        if ((x == null) || (y == null)) {
+            return !((x == null) ^ (y == null));
+        }
+        if (x.length != y.length) {
+            return false;
+        }
+        for (int i = 0; i < x.length; ++i) {
+            if (!equals(x[i], y[i])) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    /**
+     * Returns n!. Shorthand for <code>n</code> <a
+     * href="http://mathworld.wolfram.com/Factorial.html"> Factorial</a>, the
+     * product of the numbers <code>1,...,n</code>.
+     * <p>
+     * <Strong>Preconditions</strong>:
+     * <ul>
+     * <li> <code>n >= 0</code> (otherwise
+     * <code>IllegalArgumentException</code> is thrown)</li>
+     * <li> The result is small enough to fit into a <code>long</code>. The
+     * largest value of <code>n</code> for which <code>n!</code> <
+     * Long.MAX_VALUE</code> is 20. If the computed value exceeds <code>Long.MAX_VALUE</code>
+     * an <code>ArithMeticException </code> is thrown.</li>
+     * </ul>
+     * </p>
+     *
+     * @param n argument
+     * @return <code>n!</code>
+     * @throws ArithmeticException      if the result is too large to be represented
+     *                                  by a long integer.
+     * @throws IllegalArgumentException if n < 0
+     */
+    public static long factorial(final int n) {
+        if (n < 0) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "must have n >= 0 for n!, got n = {0}",
+                    n);
+        }
+        if (n > 20) {
+            throw new ArithmeticException(
+                    "factorial value is too large to fit in a long");
+        }
+        return FACTORIALS[n];
+    }
+
+    /**
+     * Returns n!. Shorthand for <code>n</code> <a
+     * href="http://mathworld.wolfram.com/Factorial.html"> Factorial</a>, the
+     * product of the numbers <code>1,...,n</code> as a <code>double</code>.
+     * <p>
+     * <Strong>Preconditions</strong>:
+     * <ul>
+     * <li> <code>n >= 0</code> (otherwise
+     * <code>IllegalArgumentException</code> is thrown)</li>
+     * <li> The result is small enough to fit into a <code>double</code>. The
+     * largest value of <code>n</code> for which <code>n!</code> <
+     * Double.MAX_VALUE</code> is 170. If the computed value exceeds
+     * Double.MAX_VALUE, Double.POSITIVE_INFINITY is returned</li>
+     * </ul>
+     * </p>
+     *
+     * @param n argument
+     * @return <code>n!</code>
+     * @throws IllegalArgumentException if n < 0
+     */
+    public static double factorialDouble(final int n) {
+        if (n < 0) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "must have n >= 0 for n!, got n = {0}",
+                    n);
+        }
+        if (n < 21) {
+            return factorial(n);
+        }
+        return Math.floor(Math.exp(factorialLog(n)) + 0.5);
+    }
+
+    /**
+     * Returns the natural logarithm of n!.
+     * <p>
+     * <Strong>Preconditions</strong>:
+     * <ul>
+     * <li> <code>n >= 0</code> (otherwise
+     * <code>IllegalArgumentException</code> is thrown)</li>
+     * </ul></p>
+     *
+     * @param n argument
+     * @return <code>n!</code>
+     * @throws IllegalArgumentException if preconditions are not met.
+     */
+    public static double factorialLog(final int n) {
+        if (n < 0) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "must have n >= 0 for n!, got n = {0}",
+                    n);
+        }
+        if (n < 21) {
+            return Math.log(factorial(n));
+        }
+        double logSum = 0;
+        for (int i = 2; i <= n; i++) {
+            logSum += Math.log(i);
+        }
+        return logSum;
+    }
+
+    /**
+     * <p>
+     * Gets the greatest common divisor of the absolute value of two numbers,
+     * using the "binary gcd" method which avoids division and modulo
+     * operations. See Knuth 4.5.2 algorithm B. This algorithm is due to Josef
+     * Stein (1961).
+     * </p>
+     * Special cases:
+     * <ul>
+     * <li>The invocations
+     * <code>gcd(Integer.MIN_VALUE, Integer.MIN_VALUE)</code>,
+     * <code>gcd(Integer.MIN_VALUE, 0)</code> and
+     * <code>gcd(0, Integer.MIN_VALUE)</code> throw an
+     * <code>ArithmeticException</code>, because the result would be 2^31, which
+     * is too large for an int value.</li>
+     * <li>The result of <code>gcd(x, x)</code>, <code>gcd(0, x)</code> and
+     * <code>gcd(x, 0)</code> is the absolute value of <code>x</code>, except
+     * for the special cases above.
+     * <li>The invocation <code>gcd(0, 0)</code> is the only one which returns
+     * <code>0</code>.</li>
+     * </ul>
+     *
+     * @param p any number
+     * @param q any number
+     * @return the greatest common divisor, never negative
+     * @throws ArithmeticException if the result cannot be represented as a
+     *                             nonnegative int value
+     * @since 1.1
+     */
+    public static int gcd(final int p, final int q) {
+        int u = p;
+        int v = q;
+        if ((u == 0) || (v == 0)) {
+            if ((u == Integer.MIN_VALUE) || (v == Integer.MIN_VALUE)) {
+                throw MathRuntimeException.createArithmeticException(
+                        "overflow: gcd({0}, {1}) is 2^31",
+                        p, q);
+            }
+            return Math.abs(u) + Math.abs(v);
+        }
+        // keep u and v negative, as negative integers range down to
+        // -2^31, while positive numbers can only be as large as 2^31-1
+        // (i.e. we can't necessarily negate a negative number without
+        // overflow)
+        /* assert u!=0 && v!=0; */
+        if (u > 0) {
+            u = -u;
+        } // make u negative
+        if (v > 0) {
+            v = -v;
+        } // make v negative
+        // B1. [Find power of 2]
+        int k = 0;
+        while ((u & 1) == 0 && (v & 1) == 0 && k < 31) { // while u and v are
+            // both even...
+            u /= 2;
+            v /= 2;
+            k++; // cast out twos.
+        }
+        if (k == 31) {
+            throw MathRuntimeException.createArithmeticException(
+                    "overflow: gcd({0}, {1}) is 2^31",
+                    p, q);
+        }
+        // B2. Initialize: u and v have been divided by 2^k and at least
+        // one is odd.
+        int t = ((u & 1) == 1) ? v : -(u / 2)/* B3 */;
+        // t negative: u was odd, v may be even (t replaces v)
+        // t positive: u was even, v is odd (t replaces u)
+        do {
+            /* assert u<0 && v<0; */
+            // B4/B3: cast out twos from t.
+            while ((t & 1) == 0) { // while t is even..
+                t /= 2; // cast out twos
+            }
+            // B5 [reset max(u,v)]
+            if (t > 0) {
+                u = -t;
+            } else {
+                v = t;
+            }
+            // B6/B3. at this point both u and v should be odd.
+            t = (v - u) / 2;
+            // |u| larger: t positive (replace u)
+            // |v| larger: t negative (replace v)
+        } while (t != 0);
+        return -u * (1 << k); // gcd is u*2^k
+    }
+
+    /**
+     * <p>
+     * Gets the greatest common divisor of the absolute value of two numbers,
+     * using the "binary gcd" method which avoids division and modulo
+     * operations. See Knuth 4.5.2 algorithm B. This algorithm is due to Josef
+     * Stein (1961).
+     * </p>
+     * Special cases:
+     * <ul>
+     * <li>The invocations
+     * <code>gcd(Long.MIN_VALUE, Long.MIN_VALUE)</code>,
+     * <code>gcd(Long.MIN_VALUE, 0L)</code> and
+     * <code>gcd(0L, Long.MIN_VALUE)</code> throw an
+     * <code>ArithmeticException</code>, because the result would be 2^63, which
+     * is too large for a long value.</li>
+     * <li>The result of <code>gcd(x, x)</code>, <code>gcd(0L, x)</code> and
+     * <code>gcd(x, 0L)</code> is the absolute value of <code>x</code>, except
+     * for the special cases above.
+     * <li>The invocation <code>gcd(0L, 0L)</code> is the only one which returns
+     * <code>0L</code>.</li>
+     * </ul>
+     *
+     * @param p any number
+     * @param q any number
+     * @return the greatest common divisor, never negative
+     * @throws ArithmeticException if the result cannot be represented as a nonnegative long
+     *                             value
+     * @since 2.1
+     */
+    public static long gcd(final long p, final long q) {
+        long u = p;
+        long v = q;
+        if ((u == 0) || (v == 0)) {
+            if ((u == Long.MIN_VALUE) || (v == Long.MIN_VALUE)) {
+                throw MathRuntimeException.createArithmeticException(
+                        "overflow: gcd({0}, {1}) is 2^63",
+                        p, q);
+            }
+            return Math.abs(u) + Math.abs(v);
+        }
+        // keep u and v negative, as negative integers range down to
+        // -2^63, while positive numbers can only be as large as 2^63-1
+        // (i.e. we can't necessarily negate a negative number without
+        // overflow)
+        /* assert u!=0 && v!=0; */
+        if (u > 0) {
+            u = -u;
+        } // make u negative
+        if (v > 0) {
+            v = -v;
+        } // make v negative
+        // B1. [Find power of 2]
+        int k = 0;
+        while ((u & 1) == 0 && (v & 1) == 0 && k < 63) { // while u and v are
+            // both even...
+            u /= 2;
+            v /= 2;
+            k++; // cast out twos.
+        }
+        if (k == 63) {
+            throw MathRuntimeException.createArithmeticException(
+                    "overflow: gcd({0}, {1}) is 2^63",
+                    p, q);
+        }
+        // B2. Initialize: u and v have been divided by 2^k and at least
+        // one is odd.
+        long t = ((u & 1) == 1) ? v : -(u / 2)/* B3 */;
+        // t negative: u was odd, v may be even (t replaces v)
+        // t positive: u was even, v is odd (t replaces u)
+        do {
+            /* assert u<0 && v<0; */
+            // B4/B3: cast out twos from t.
+            while ((t & 1) == 0) { // while t is even..
+                t /= 2; // cast out twos
+            }
+            // B5 [reset max(u,v)]
+            if (t > 0) {
+                u = -t;
+            } else {
+                v = t;
+            }
+            // B6/B3. at this point both u and v should be odd.
+            t = (v - u) / 2;
+            // |u| larger: t positive (replace u)
+            // |v| larger: t negative (replace v)
+        } while (t != 0);
+        return -u * (1L << k); // gcd is u*2^k
+    }
+
+    /**
+     * Returns an integer hash code representing the given double value.
+     *
+     * @param value the value to be hashed
+     * @return the hash code
+     */
+    public static int hash(double value) {
+        return new Double(value).hashCode();
+    }
+
+    /**
+     * Returns an integer hash code representing the given double array.
+     *
+     * @param value the value to be hashed (may be null)
+     * @return the hash code
+     * @since 1.2
+     */
+    public static int hash(double[] value) {
+        return Arrays.hashCode(value);
+    }
+
+    /**
+     * For a byte value x, this method returns (byte)(+1) if x >= 0 and
+     * (byte)(-1) if x < 0.
+     *
+     * @param x the value, a byte
+     * @return (byte)(+1) or (byte)(-1), depending on the sign of x
+     */
+    public static byte indicator(final byte x) {
+        return (x >= ZB) ? PB : NB;
+    }
+
+    /**
+     * For a double precision value x, this method returns +1.0 if x >= 0 and
+     * -1.0 if x < 0. Returns <code>NaN</code> if <code>x</code> is
+     * <code>NaN</code>.
+     *
+     * @param x the value, a double
+     * @return +1.0 or -1.0, depending on the sign of x
+     */
+    public static double indicator(final double x) {
+        if (Double.isNaN(x)) {
+            return Double.NaN;
+        }
+        return (x >= 0.0) ? 1.0 : -1.0;
+    }
+
+    /**
+     * For a float value x, this method returns +1.0F if x >= 0 and -1.0F if x <
+     * 0. Returns <code>NaN</code> if <code>x</code> is <code>NaN</code>.
+     *
+     * @param x the value, a float
+     * @return +1.0F or -1.0F, depending on the sign of x
+     */
+    public static float indicator(final float x) {
+        if (Float.isNaN(x)) {
+            return Float.NaN;
+        }
+        return (x >= 0.0F) ? 1.0F : -1.0F;
+    }
+
+    /**
+     * For an int value x, this method returns +1 if x >= 0 and -1 if x < 0.
+     *
+     * @param x the value, an int
+     * @return +1 or -1, depending on the sign of x
+     */
+    public static int indicator(final int x) {
+        return (x >= 0) ? 1 : -1;
+    }
+
+    /**
+     * For a long value x, this method returns +1L if x >= 0 and -1L if x < 0.
+     *
+     * @param x the value, a long
+     * @return +1L or -1L, depending on the sign of x
+     */
+    public static long indicator(final long x) {
+        return (x >= 0L) ? 1L : -1L;
+    }
+
+    /**
+     * For a short value x, this method returns (short)(+1) if x >= 0 and
+     * (short)(-1) if x < 0.
+     *
+     * @param x the value, a short
+     * @return (short)(+1) or (short)(-1), depending on the sign of x
+     */
+    public static short indicator(final short x) {
+        return (x >= ZS) ? PS : NS;
+    }
+
+    /**
+     * <p>
+     * Returns the least common multiple of the absolute value of two numbers,
+     * using the formula <code>lcm(a,b) = (a / gcd(a,b)) * b</code>.
+     * </p>
+     * Special cases:
+     * <ul>
+     * <li>The invocations <code>lcm(Integer.MIN_VALUE, n)</code> and
+     * <code>lcm(n, Integer.MIN_VALUE)</code>, where <code>abs(n)</code> is a
+     * power of 2, throw an <code>ArithmeticException</code>, because the result
+     * would be 2^31, which is too large for an int value.</li>
+     * <li>The result of <code>lcm(0, x)</code> and <code>lcm(x, 0)</code> is
+     * <code>0</code> for any <code>x</code>.
+     * </ul>
+     *
+     * @param a any number
+     * @param b any number
+     * @return the least common multiple, never negative
+     * @throws ArithmeticException if the result cannot be represented as a nonnegative int
+     *                             value
+     * @since 1.1
+     */
+    public static int lcm(int a, int b) {
+        if (a == 0 || b == 0) {
+            return 0;
+        }
+        int lcm = Math.abs(mulAndCheck(a / gcd(a, b), b));
+        if (lcm == Integer.MIN_VALUE) {
+            throw MathRuntimeException.createArithmeticException(
+                    "overflow: lcm({0}, {1}) is 2^31",
+                    a, b);
+        }
+        return lcm;
+    }
+
+    /**
+     * <p>
+     * Returns the least common multiple of the absolute value of two numbers,
+     * using the formula <code>lcm(a,b) = (a / gcd(a,b)) * b</code>.
+     * </p>
+     * Special cases:
+     * <ul>
+     * <li>The invocations <code>lcm(Long.MIN_VALUE, n)</code> and
+     * <code>lcm(n, Long.MIN_VALUE)</code>, where <code>abs(n)</code> is a
+     * power of 2, throw an <code>ArithmeticException</code>, because the result
+     * would be 2^63, which is too large for an int value.</li>
+     * <li>The result of <code>lcm(0L, x)</code> and <code>lcm(x, 0L)</code> is
+     * <code>0L</code> for any <code>x</code>.
+     * </ul>
+     *
+     * @param a any number
+     * @param b any number
+     * @return the least common multiple, never negative
+     * @throws ArithmeticException if the result cannot be represented as a nonnegative long
+     *                             value
+     * @since 2.1
+     */
+    public static long lcm(long a, long b) {
+        if (a == 0 || b == 0) {
+            return 0;
+        }
+        long lcm = Math.abs(mulAndCheck(a / gcd(a, b), b));
+        if (lcm == Long.MIN_VALUE) {
+            throw MathRuntimeException.createArithmeticException(
+                    "overflow: lcm({0}, {1}) is 2^63",
+                    a, b);
+        }
+        return lcm;
+    }
+
+    /**
+     * <p>Returns the
+     * <a href="http://mathworld.wolfram.com/Logarithm.html">logarithm</a>
+     * for base <code>b</code> of <code>x</code>.
+     * </p>
+     * <p>Returns <code>NaN<code> if either argument is negative.  If
+     * <code>base</code> is 0 and <code>x</code> is positive, 0 is returned.
+     * If <code>base</code> is positive and <code>x</code> is 0,
+     * <code>Double.NEGATIVE_INFINITY</code> is returned.  If both arguments
+     * are 0, the result is <code>NaN</code>.</p>
+     *
+     * @param base the base of the logarithm, must be greater than 0
+     * @param x    argument, must be greater than 0
+     * @return the value of the logarithm - the number y such that base^y = x.
+     * @since 1.2
+     */
+    public static double log(double base, double x) {
+        return Math.log(x) / Math.log(base);
+    }
+
+    /**
+     * Multiply two integers, checking for overflow.
+     *
+     * @param x a factor
+     * @param y a factor
+     * @return the product <code>x*y</code>
+     * @throws ArithmeticException if the result can not be represented as an
+     *                             int
+     * @since 1.1
+     */
+    public static int mulAndCheck(int x, int y) {
+        long m = ((long) x) * ((long) y);
+        if (m < Integer.MIN_VALUE || m > Integer.MAX_VALUE) {
+            throw new ArithmeticException("overflow: mul");
+        }
+        return (int) m;
+    }
+
+    /**
+     * Multiply two long integers, checking for overflow.
+     *
+     * @param a first value
+     * @param b second value
+     * @return the product <code>a * b</code>
+     * @throws ArithmeticException if the result can not be represented as an
+     *                             long
+     * @since 1.2
+     */
+    public static long mulAndCheck(long a, long b) {
+        long ret;
+        String msg = "overflow: multiply";
+        if (a > b) {
+            // use symmetry to reduce boundary cases
+            ret = mulAndCheck(b, a);
+        } else {
+            if (a < 0) {
+                if (b < 0) {
+                    // check for positive overflow with negative a, negative b
+                    if (a >= Long.MAX_VALUE / b) {
+                        ret = a * b;
+                    } else {
+                        throw new ArithmeticException(msg);
+                    }
+                } else if (b > 0) {
+                    // check for negative overflow with negative a, positive b
+                    if (Long.MIN_VALUE / b <= a) {
+                        ret = a * b;
+                    } else {
+                        throw new ArithmeticException(msg);
+
+                    }
+                } else {
+                    // assert b == 0
+                    ret = 0;
+                }
+            } else if (a > 0) {
+                // assert a > 0
+                // assert b > 0
+
+                // check for positive overflow with positive a, positive b
+                if (a <= Long.MAX_VALUE / b) {
+                    ret = a * b;
+                } else {
+                    throw new ArithmeticException(msg);
+                }
+            } else {
+                // assert a == 0
+                ret = 0;
+            }
+        }
+        return ret;
+    }
+
+    /**
+     * Get the next machine representable number after a number, moving
+     * in the direction of another number.
+     * <p>
+     * If <code>direction</code> is greater than or equal to<code>d</code>,
+     * the smallest machine representable number strictly greater than
+     * <code>d</code> is returned; otherwise the largest representable number
+     * strictly less than <code>d</code> is returned.</p>
+     * <p>
+     * If <code>d</code> is NaN or Infinite, it is returned unchanged.</p>
+     *
+     * @param d         base number
+     * @param direction (the only important thing is whether
+     *                  direction is greater or smaller than d)
+     * @return the next machine representable number in the specified direction
+     * @since 1.2
+     */
+    public static double nextAfter(double d, double direction) {
+
+        // handling of some important special cases
+        if (Double.isNaN(d) || Double.isInfinite(d)) {
+            return d;
+        } else if (d == 0) {
+            return (direction < 0) ? -Double.MIN_VALUE : Double.MIN_VALUE;
+        }
+        // special cases MAX_VALUE to infinity and  MIN_VALUE to 0
+        // are handled just as normal numbers
+
+        // split the double in raw components
+        long bits = Double.doubleToLongBits(d);
+        long sign = bits & 0x8000000000000000L;
+        long exponent = bits & 0x7ff0000000000000L;
+        long mantissa = bits & 0x000fffffffffffffL;
+
+        if (d * (direction - d) >= 0) {
+            // we should increase the mantissa
+            if (mantissa == 0x000fffffffffffffL) {
+                return Double.longBitsToDouble(sign |
+                        (exponent + 0x0010000000000000L));
+            } else {
+                return Double.longBitsToDouble(sign |
+                        exponent | (mantissa + 1));
+            }
+        } else {
+            // we should decrease the mantissa
+            if (mantissa == 0L) {
+                return Double.longBitsToDouble(sign |
+                        (exponent - 0x0010000000000000L) |
+                        0x000fffffffffffffL);
+            } else {
+                return Double.longBitsToDouble(sign |
+                        exponent | (mantissa - 1));
+            }
+        }
+
+    }
+
+    /**
+     * Scale a number by 2<sup>scaleFactor</sup>.
+     * <p>If <code>d</code> is 0 or NaN or Infinite, it is returned unchanged.</p>
+     *
+     * @param d           base number
+     * @param scaleFactor power of two by which d sould be multiplied
+     * @return d × 2<sup>scaleFactor</sup>
+     * @since 2.0
+     */
+    public static double scalb(final double d, final int scaleFactor) {
+
+        // handling of some important special cases
+        if ((d == 0) || Double.isNaN(d) || Double.isInfinite(d)) {
+            return d;
+        }
+
+        // split the double in raw components
+        final long bits = Double.doubleToLongBits(d);
+        final long exponent = bits & 0x7ff0000000000000L;
+        final long rest = bits & 0x800fffffffffffffL;
+
+        // shift the exponent
+        final long newBits = rest | (exponent + (((long) scaleFactor) << 52));
+        return Double.longBitsToDouble(newBits);
+
+    }
+
+    /**
+     * Normalize an angle in a 2&pi wide interval around a center value.
+     * <p>This method has three main uses:</p>
+     * <ul>
+     * <li>normalize an angle between 0 and 2π:<br/>
+     * <code>a = MathUtils.normalizeAngle(a, Math.PI);</code></li>
+     * <li>normalize an angle between -π and +π<br/>
+     * <code>a = MathUtils.normalizeAngle(a, 0.0);</code></li>
+     * <li>compute the angle between two defining angular positions:<br>
+     * <code>angle = MathUtils.normalizeAngle(end, start) - start;</code></li>
+     * </ul>
+     * <p>Note that due to numerical accuracy and since π cannot be represented
+     * exactly, the result interval is <em>closed</em>, it cannot be half-closed
+     * as would be more satisfactory in a purely mathematical view.</p>
+     *
+     * @param a      angle to normalize
+     * @param center center of the desired 2π interval for the result
+     * @return a-2kπ with integer k and center-π <= a-2kπ <= center+π
+     * @since 1.2
+     */
+    public static double normalizeAngle(double a, double center) {
+        return a - TWO_PI * Math.floor((a + Math.PI - center) / TWO_PI);
+    }
+
+    /**
+     * <p>Normalizes an array to make it sum to a specified value.
+     * Returns the result of the transformation <pre>
+     *    x |-> x * normalizedSum / sum
+     * </pre>
+     * applied to each non-NaN element x of the input array, where sum is the
+     * sum of the non-NaN entries in the input array.</p>
+     * <p/>
+     * <p>Throws IllegalArgumentException if <code>normalizedSum</code> is infinite
+     * or NaN and ArithmeticException if the input array contains any infinite elements
+     * or sums to 0</p>
+     * <p/>
+     * <p>Ignores (i.e., copies unchanged to the output array) NaNs in the input array.</p>
+     *
+     * @param values        input array to be normalized
+     * @param normalizedSum target sum for the normalized array
+     * @return normalized array
+     * @throws ArithmeticException      if the input array contains infinite elements or sums to zero
+     * @throws IllegalArgumentException if the target sum is infinite or NaN
+     * @since 2.1
+     */
+    public static double[] normalizeArray(double[] values, double normalizedSum)
+            throws ArithmeticException, IllegalArgumentException {
+        if (Double.isInfinite(normalizedSum)) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "Cannot normalize to an infinite value");
+        }
+        if (Double.isNaN(normalizedSum)) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "Cannot normalize to NaN");
+        }
+        double sum = 0d;
+        final int len = values.length;
+        double[] out = new double[len];
+        for (int i = 0; i < len; i++) {
+            if (Double.isInfinite(values[i])) {
+                throw MathRuntimeException.createArithmeticException(
+                        "Array contains an infinite element, {0} at index {1}", values[i], i);
+            }
+            if (!Double.isNaN(values[i])) {
+                sum += values[i];
+            }
+        }
+        if (sum == 0) {
+            throw MathRuntimeException.createArithmeticException(
+                    "Array sums to zero");
+        }
+        for (int i = 0; i < len; i++) {
+            if (Double.isNaN(values[i])) {
+                out[i] = Double.NaN;
+            } else {
+                out[i] = values[i] * normalizedSum / sum;
+            }
+        }
+        return out;
+    }
+
+    /**
+     * Round the given value to the specified number of decimal places. The
+     * value is rounded using the {@link BigDecimal#ROUND_HALF_UP} method.
+     *
+     * @param x     the value to round.
+     * @param scale the number of digits to the right of the decimal point.
+     * @return the rounded value.
+     * @since 1.1
+     */
+    public static double round(double x, int scale) {
+        return round(x, scale, BigDecimal.ROUND_HALF_UP);
+    }
+
+    /**
+     * Round the given value to the specified number of decimal places. The
+     * value is rounded using the given method which is any method defined in
+     * {@link BigDecimal}.
+     *
+     * @param x              the value to round.
+     * @param scale          the number of digits to the right of the decimal point.
+     * @param roundingMethod the rounding method as defined in
+     *                       {@link BigDecimal}.
+     * @return the rounded value.
+     * @since 1.1
+     */
+    public static double round(double x, int scale, int roundingMethod) {
+        try {
+            return (new BigDecimal
+                    (Double.toString(x))
+                    .setScale(scale, roundingMethod))
+                    .doubleValue();
+        } catch (NumberFormatException ex) {
+            if (Double.isInfinite(x)) {
+                return x;
+            } else {
+                return Double.NaN;
+            }
+        }
+    }
+
+    /**
+     * Round the given value to the specified number of decimal places. The
+     * value is rounding using the {@link BigDecimal#ROUND_HALF_UP} method.
+     *
+     * @param x     the value to round.
+     * @param scale the number of digits to the right of the decimal point.
+     * @return the rounded value.
+     * @since 1.1
+     */
+    public static float round(float x, int scale) {
+        return round(x, scale, BigDecimal.ROUND_HALF_UP);
+    }
+
+    /**
+     * Round the given value to the specified number of decimal places. The
+     * value is rounded using the given method which is any method defined in
+     * {@link BigDecimal}.
+     *
+     * @param x              the value to round.
+     * @param scale          the number of digits to the right of the decimal point.
+     * @param roundingMethod the rounding method as defined in
+     *                       {@link BigDecimal}.
+     * @return the rounded value.
+     * @since 1.1
+     */
+    public static float round(float x, int scale, int roundingMethod) {
+        float sign = indicator(x);
+        float factor = (float) Math.pow(10.0f, scale) * sign;
+        return (float) roundUnscaled(x * factor, sign, roundingMethod) / factor;
+    }
+
+    /**
+     * Round the given non-negative, value to the "nearest" integer. Nearest is
+     * determined by the rounding method specified. Rounding methods are defined
+     * in {@link BigDecimal}.
+     *
+     * @param unscaled       the value to round.
+     * @param sign           the sign of the original, scaled value.
+     * @param roundingMethod the rounding method as defined in
+     *                       {@link BigDecimal}.
+     * @return the rounded value.
+     * @since 1.1
+     */
+    private static double roundUnscaled(double unscaled, double sign,
+                                        int roundingMethod) {
+        switch (roundingMethod) {
+            case BigDecimal.ROUND_CEILING:
+                if (sign == -1) {
+                    unscaled = Math.floor(nextAfter(unscaled, Double.NEGATIVE_INFINITY));
+                } else {
+                    unscaled = Math.ceil(nextAfter(unscaled, Double.POSITIVE_INFINITY));
+                }
+                break;
+            case BigDecimal.ROUND_DOWN:
+                unscaled = Math.floor(nextAfter(unscaled, Double.NEGATIVE_INFINITY));
+                break;
+            case BigDecimal.ROUND_FLOOR:
+                if (sign == -1) {
+                    unscaled = Math.ceil(nextAfter(unscaled, Double.POSITIVE_INFINITY));
+                } else {
+                    unscaled = Math.floor(nextAfter(unscaled, Double.NEGATIVE_INFINITY));
+                }
+                break;
+            case BigDecimal.ROUND_HALF_DOWN: {
+                unscaled = nextAfter(unscaled, Double.NEGATIVE_INFINITY);
+                double fraction = unscaled - Math.floor(unscaled);
+                if (fraction > 0.5) {
+                    unscaled = Math.ceil(unscaled);
+                } else {
+                    unscaled = Math.floor(unscaled);
+                }
+                break;
+            }
+            case BigDecimal.ROUND_HALF_EVEN: {
+                double fraction = unscaled - Math.floor(unscaled);
+                if (fraction > 0.5) {
+                    unscaled = Math.ceil(unscaled);
+                } else if (fraction < 0.5) {
+                    unscaled = Math.floor(unscaled);
+                } else {
+                    // The following equality test is intentional and needed for rounding purposes
+                    if (Math.floor(unscaled) / 2.0 == Math.floor(Math
+                            .floor(unscaled) / 2.0)) { // even
+                        unscaled = Math.floor(unscaled);
+                    } else { // odd
+                        unscaled = Math.ceil(unscaled);
+                    }
+                }
+                break;
+            }
+            case BigDecimal.ROUND_HALF_UP: {
+                unscaled = nextAfter(unscaled, Double.POSITIVE_INFINITY);
+                double fraction = unscaled - Math.floor(unscaled);
+                if (fraction >= 0.5) {
+                    unscaled = Math.ceil(unscaled);
+                } else {
+                    unscaled = Math.floor(unscaled);
+                }
+                break;
+            }
+            case BigDecimal.ROUND_UNNECESSARY:
+                if (unscaled != Math.floor(unscaled)) {
+                    throw new ArithmeticException("Inexact result from rounding");
+                }
+                break;
+            case BigDecimal.ROUND_UP:
+                unscaled = Math.ceil(nextAfter(unscaled, Double.POSITIVE_INFINITY));
+                break;
+            default:
+                throw MathRuntimeException.createIllegalArgumentException(
+                        "invalid rounding method {0}, valid methods: {1} ({2}), {3} ({4})," +
+                                " {5} ({6}), {7} ({8}), {9} ({10}), {11} ({12}), {13} ({14}), {15} ({16})",
+                        roundingMethod,
+                        "ROUND_CEILING", BigDecimal.ROUND_CEILING,
+                        "ROUND_DOWN", BigDecimal.ROUND_DOWN,
+                        "ROUND_FLOOR", BigDecimal.ROUND_FLOOR,
+                        "ROUND_HALF_DOWN", BigDecimal.ROUND_HALF_DOWN,
+                        "ROUND_HALF_EVEN", BigDecimal.ROUND_HALF_EVEN,
+                        "ROUND_HALF_UP", BigDecimal.ROUND_HALF_UP,
+                        "ROUND_UNNECESSARY", BigDecimal.ROUND_UNNECESSARY,
+                        "ROUND_UP", BigDecimal.ROUND_UP);
+        }
+        return unscaled;
+    }
+
+    /**
+     * Returns the <a href="http://mathworld.wolfram.com/Sign.html"> sign</a>
+     * for byte value <code>x</code>.
+     * <p>
+     * For a byte value x, this method returns (byte)(+1) if x > 0, (byte)(0) if
+     * x = 0, and (byte)(-1) if x < 0.</p>
+     *
+     * @param x the value, a byte
+     * @return (byte)(+1), (byte)(0), or (byte)(-1), depending on the sign of x
+     */
+    public static byte sign(final byte x) {
+        return (x == ZB) ? ZB : (x > ZB) ? PB : NB;
+    }
+
+    /**
+     * Returns the <a href="http://mathworld.wolfram.com/Sign.html"> sign</a>
+     * for double precision <code>x</code>.
+     * <p>
+     * For a double value <code>x</code>, this method returns
+     * <code>+1.0</code> if <code>x > 0</code>, <code>0.0</code> if
+     * <code>x = 0.0</code>, and <code>-1.0</code> if <code>x < 0</code>.
+     * Returns <code>NaN</code> if <code>x</code> is <code>NaN</code>.</p>
+     *
+     * @param x the value, a double
+     * @return +1.0, 0.0, or -1.0, depending on the sign of x
+     */
+    public static double sign(final double x) {
+        if (Double.isNaN(x)) {
+            return Double.NaN;
+        }
+        return (x == 0.0) ? 0.0 : (x > 0.0) ? 1.0 : -1.0;
+    }
+
+    /**
+     * Returns the <a href="http://mathworld.wolfram.com/Sign.html"> sign</a>
+     * for float value <code>x</code>.
+     * <p>
+     * For a float value x, this method returns +1.0F if x > 0, 0.0F if x =
+     * 0.0F, and -1.0F if x < 0. Returns <code>NaN</code> if <code>x</code>
+     * is <code>NaN</code>.</p>
+     *
+     * @param x the value, a float
+     * @return +1.0F, 0.0F, or -1.0F, depending on the sign of x
+     */
+    public static float sign(final float x) {
+        if (Float.isNaN(x)) {
+            return Float.NaN;
+        }
+        return (x == 0.0F) ? 0.0F : (x > 0.0F) ? 1.0F : -1.0F;
+    }
+
+    /**
+     * Returns the <a href="http://mathworld.wolfram.com/Sign.html"> sign</a>
+     * for int value <code>x</code>.
+     * <p>
+     * For an int value x, this method returns +1 if x > 0, 0 if x = 0, and -1
+     * if x < 0.</p>
+     *
+     * @param x the value, an int
+     * @return +1, 0, or -1, depending on the sign of x
+     */
+    public static int sign(final int x) {
+        return (x == 0) ? 0 : (x > 0) ? 1 : -1;
+    }
+
+    /**
+     * Returns the <a href="http://mathworld.wolfram.com/Sign.html"> sign</a>
+     * for long value <code>x</code>.
+     * <p>
+     * For a long value x, this method returns +1L if x > 0, 0L if x = 0, and
+     * -1L if x < 0.</p>
+     *
+     * @param x the value, a long
+     * @return +1L, 0L, or -1L, depending on the sign of x
+     */
+    public static long sign(final long x) {
+        return (x == 0L) ? 0L : (x > 0L) ? 1L : -1L;
+    }
+
+    /**
+     * Returns the <a href="http://mathworld.wolfram.com/Sign.html"> sign</a>
+     * for short value <code>x</code>.
+     * <p>
+     * For a short value x, this method returns (short)(+1) if x > 0, (short)(0)
+     * if x = 0, and (short)(-1) if x < 0.</p>
+     *
+     * @param x the value, a short
+     * @return (short)(+1), (short)(0), or (short)(-1), depending on the sign of
+     *         x
+     */
+    public static short sign(final short x) {
+        return (x == ZS) ? ZS : (x > ZS) ? PS : NS;
+    }
+
+    /**
+     * Returns the <a href="http://mathworld.wolfram.com/HyperbolicSine.html">
+     * hyperbolic sine</a> of x.
+     *
+     * @param x double value for which to find the hyperbolic sine
+     * @return hyperbolic sine of x
+     */
+    public static double sinh(double x) {
+        return (Math.exp(x) - Math.exp(-x)) / 2.0;
+    }
+
+    /**
+     * Subtract two integers, checking for overflow.
+     *
+     * @param x the minuend
+     * @param y the subtrahend
+     * @return the difference <code>x-y</code>
+     * @throws ArithmeticException if the result can not be represented as an
+     *                             int
+     * @since 1.1
+     */
+    public static int subAndCheck(int x, int y) {
+        long s = (long) x - (long) y;
+        if (s < Integer.MIN_VALUE || s > Integer.MAX_VALUE) {
+            throw new ArithmeticException("overflow: subtract");
+        }
+        return (int) s;
+    }
+
+    /**
+     * Subtract two long integers, checking for overflow.
+     *
+     * @param a first value
+     * @param b second value
+     * @return the difference <code>a-b</code>
+     * @throws ArithmeticException if the result can not be represented as an
+     *                             long
+     * @since 1.2
+     */
+    public static long subAndCheck(long a, long b) {
+        long ret;
+        String msg = "overflow: subtract";
+        if (b == Long.MIN_VALUE) {
+            if (a < 0) {
+                ret = a - b;
+            } else {
+                throw new ArithmeticException(msg);
+            }
+        } else {
+            // use additive inverse
+            ret = addAndCheck(a, -b, msg);
+        }
+        return ret;
+    }
+
+    /**
+     * Raise an int to an int power.
+     *
+     * @param k number to raise
+     * @param e exponent (must be positive or null)
+     * @return k<sup>e</sup>
+     * @throws IllegalArgumentException if e is negative
+     */
+    public static int pow(final int k, int e)
+            throws IllegalArgumentException {
+
+        if (e < 0) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "cannot raise an integral value to a negative power ({0}^{1})",
+                    k, e);
+        }
+
+        int result = 1;
+        int k2p = k;
+        while (e != 0) {
+            if ((e & 0x1) != 0) {
+                result *= k2p;
+            }
+            k2p *= k2p;
+            e = e >> 1;
+        }
+
+        return result;
+
+    }
+
+    /**
+     * Raise an int to a long power.
+     *
+     * @param k number to raise
+     * @param e exponent (must be positive or null)
+     * @return k<sup>e</sup>
+     * @throws IllegalArgumentException if e is negative
+     */
+    public static int pow(final int k, long e)
+            throws IllegalArgumentException {
+
+        if (e < 0) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "cannot raise an integral value to a negative power ({0}^{1})",
+                    k, e);
+        }
+
+        int result = 1;
+        int k2p = k;
+        while (e != 0) {
+            if ((e & 0x1) != 0) {
+                result *= k2p;
+            }
+            k2p *= k2p;
+            e = e >> 1;
+        }
+
+        return result;
+
+    }
+
+    /**
+     * Raise a long to an int power.
+     *
+     * @param k number to raise
+     * @param e exponent (must be positive or null)
+     * @return k<sup>e</sup>
+     * @throws IllegalArgumentException if e is negative
+     */
+    public static long pow(final long k, int e)
+            throws IllegalArgumentException {
+
+        if (e < 0) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "cannot raise an integral value to a negative power ({0}^{1})",
+                    k, e);
+        }
+
+        long result = 1l;
+        long k2p = k;
+        while (e != 0) {
+            if ((e & 0x1) != 0) {
+                result *= k2p;
+            }
+            k2p *= k2p;
+            e = e >> 1;
+        }
+
+        return result;
+
+    }
+
+    /**
+     * Raise a long to a long power.
+     *
+     * @param k number to raise
+     * @param e exponent (must be positive or null)
+     * @return k<sup>e</sup>
+     * @throws IllegalArgumentException if e is negative
+     */
+    public static long pow(final long k, long e)
+            throws IllegalArgumentException {
+
+        if (e < 0) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "cannot raise an integral value to a negative power ({0}^{1})",
+                    k, e);
+        }
+
+        long result = 1l;
+        long k2p = k;
+        while (e != 0) {
+            if ((e & 0x1) != 0) {
+                result *= k2p;
+            }
+            k2p *= k2p;
+            e = e >> 1;
+        }
+
+        return result;
+
+    }
+
+    /**
+     * Raise a BigInteger to an int power.
+     *
+     * @param k number to raise
+     * @param e exponent (must be positive or null)
+     * @return k<sup>e</sup>
+     * @throws IllegalArgumentException if e is negative
+     */
+    public static BigInteger pow(final BigInteger k, int e)
+            throws IllegalArgumentException {
+
+        if (e < 0) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "cannot raise an integral value to a negative power ({0}^{1})",
+                    k, e);
+        }
+
+        return k.pow(e);
+
+    }
+
+    /**
+     * Raise a BigInteger to a long power.
+     *
+     * @param k number to raise
+     * @param e exponent (must be positive or null)
+     * @return k<sup>e</sup>
+     * @throws IllegalArgumentException if e is negative
+     */
+    public static BigInteger pow(final BigInteger k, long e)
+            throws IllegalArgumentException {
+
+        if (e < 0) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "cannot raise an integral value to a negative power ({0}^{1})",
+                    k, e);
+        }
+
+        BigInteger result = BigInteger.ONE;
+        BigInteger k2p = k;
+        while (e != 0) {
+            if ((e & 0x1) != 0) {
+                result = result.multiply(k2p);
+            }
+            k2p = k2p.multiply(k2p);
+            e = e >> 1;
+        }
+
+        return result;
+
+    }
+
+    /**
+     * Raise a BigInteger to a BigInteger power.
+     *
+     * @param k number to raise
+     * @param e exponent (must be positive or null)
+     * @return k<sup>e</sup>
+     * @throws IllegalArgumentException if e is negative
+     */
+    public static BigInteger pow(final BigInteger k, BigInteger e)
+            throws IllegalArgumentException {
+
+        if (e.compareTo(BigInteger.ZERO) < 0) {
+            throw MathRuntimeException.createIllegalArgumentException(
+                    "cannot raise an integral value to a negative power ({0}^{1})",
+                    k, e);
+        }
+
+        BigInteger result = BigInteger.ONE;
+        BigInteger k2p = k;
+        while (!BigInteger.ZERO.equals(e)) {
+            if (e.testBit(0)) {
+                result = result.multiply(k2p);
+            }
+            k2p = k2p.multiply(k2p);
+            e = e.shiftRight(1);
+        }
+
+        return result;
+
+    }
+
+    /**
+     * Calculates the L<sub>1</sub> (sum of abs) distance between two points.
+     *
+     * @param p1 the first point
+     * @param p2 the second point
+     * @return the L<sub>1</sub> distance between the two points
+     */
+    public static double distance1(double[] p1, double[] p2) {
+        double sum = 0;
+        for (int i = 0; i < p1.length; i++) {
+            sum += Math.abs(p1[i] - p2[i]);
+        }
+        return sum;
+    }
+
+    /**
+     * Calculates the L<sub>1</sub> (sum of abs) distance between two points.
+     *
+     * @param p1 the first point
+     * @param p2 the second point
+     * @return the L<sub>1</sub> distance between the two points
+     */
+    public static int distance1(int[] p1, int[] p2) {
+        int sum = 0;
+        for (int i = 0; i < p1.length; i++) {
+            sum += Math.abs(p1[i] - p2[i]);
+        }
+        return sum;
+    }
+
+    /**
+     * Calculates the L<sub>2</sub> (Euclidean) distance between two points.
+     *
+     * @param p1 the first point
+     * @param p2 the second point
+     * @return the L<sub>2</sub> distance between the two points
+     */
+    public static double distance(double[] p1, double[] p2) {
+        double sum = 0;
+        for (int i = 0; i < p1.length; i++) {
+            final double dp = p1[i] - p2[i];
+            sum += dp * dp;
+        }
+        return Math.sqrt(sum);
+    }
+
+    /**
+     * Calculates the L<sub>2</sub> (Euclidean) distance between two points.
+     *
+     * @param p1 the first point
+     * @param p2 the second point
+     * @return the L<sub>2</sub> distance between the two points
+     */
+    public static double distance(int[] p1, int[] p2) {
+        double sum = 0;
+        for (int i = 0; i < p1.length; i++) {
+            final double dp = p1[i] - p2[i];
+            sum += dp * dp;
+        }
+        return Math.sqrt(sum);
+    }
+
+    /**
+     * Calculates the L<sub>∞</sub> (max of abs) distance between two points.
+     *
+     * @param p1 the first point
+     * @param p2 the second point
+     * @return the L<sub>∞</sub> distance between the two points
+     */
+    public static double distanceInf(double[] p1, double[] p2) {
+        double max = 0;
+        for (int i = 0; i < p1.length; i++) {
+            max = Math.max(max, Math.abs(p1[i] - p2[i]));
+        }
+        return max;
+    }
+
+    /**
+     * Calculates the L<sub>∞</sub> (max of abs) distance between two points.
+     *
+     * @param p1 the first point
+     * @param p2 the second point
+     * @return the L<sub>∞</sub> distance between the two points
+     */
+    public static int distanceInf(int[] p1, int[] p2) {
+        int max = 0;
+        for (int i = 0; i < p1.length; i++) {
+            max = Math.max(max, Math.abs(p1[i] - p2[i]));
+        }
+        return max;
+    }
+
+    /**
+     * Checks that the given array is sorted.
+     *
+     * @param val    Values
+     * @param dir    Order direction (-1 for decreasing, 1 for increasing)
+     * @param strict Whether the order should be strict
+     * @throws IllegalArgumentException if the array is not sorted.
+     */
+    public static void checkOrder(double[] val, int dir, boolean strict) {
+        double previous = val[0];
+
+        int max = val.length;
+        for (int i = 1; i < max; i++) {
+            if (dir > 0) {
+                if (strict) {
+                    if (val[i] <= previous) {
+                        throw MathRuntimeException.createIllegalArgumentException("points {0} and {1} are not strictly increasing ({2} >= {3})",
+                                i - 1, i, previous, val[i]);
+                    }
+                } else {
+                    if (val[i] < previous) {
+                        throw MathRuntimeException.createIllegalArgumentException("points {0} and {1} are not increasing ({2} > {3})",
+                                i - 1, i, previous, val[i]);
+                    }
+                }
+            } else {
+                if (strict) {
+                    if (val[i] >= previous) {
+                        throw MathRuntimeException.createIllegalArgumentException("points {0} and {1} are not strictly decreasing ({2} <= {3})",
+                                i - 1, i, previous, val[i]);
+                    }
+                } else {
+                    if (val[i] > previous) {
+                        throw MathRuntimeException.createIllegalArgumentException("points {0} and {1} are not decreasing ({2} < {3})",
+                                i - 1, i, previous, val[i]);
+                    }
+                }
+            }
+
+            previous = val[i];
+        }
+    }
+}
diff --git a/src/org/apache/commons/math/util/OpenIntToDoubleHashMap.java b/src/org/apache/commons/math/util/OpenIntToDoubleHashMap.java
new file mode 100644
index 0000000..035f7d1
--- /dev/null
+++ b/src/org/apache/commons/math/util/OpenIntToDoubleHashMap.java
@@ -0,0 +1,680 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.math.util;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.Serializable;
+import java.util.ConcurrentModificationException;
+import java.util.NoSuchElementException;
+
+import org.apache.commons.math.MathRuntimeException;
+
+/**
+ * Open addressed map from int to double.
+ * <p>This class provides a dedicated map from integers to doubles with a
+ * much smaller memory overhead than standard <code>java.util.Map</code>.</p>
+ * <p>This class is not synchronized. The specialized iterators returned by
+ * {@link #iterator()} are fail-fast: they throw a
+ * <code>ConcurrentModificationException</code> when they detect the map has been
+ * modified during iteration.</p>
+ *
+ * @version $Revision: 885278 $ $Date: 2009-11-29 16:47:51 -0500 (Sun, 29 Nov 2009) $
+ * @since 2.0
+ */
+public class OpenIntToDoubleHashMap implements Serializable {
+
+    /**
+     * Status indicator for free table entries.
+     */
+    protected static final byte FREE = 0;
+
+    /**
+     * Status indicator for full table entries.
+     */
+    protected static final byte FULL = 1;
+
+    /**
+     * Status indicator for removed table entries.
+     */
+    protected static final byte REMOVED = 2;
+
+    /**
+     * Serializable version identifier
+     */
+    private static final long serialVersionUID = -3646337053166149105L;
+
+    /**
+     * Message for map modification during iteration.
+     */
+    private static final String CONCURRENT_MODIFICATION_MESSAGE =
+            "map has been modified while iterating";
+
+    /**
+     * Message for exhausted iterator.
+     */
+    private static final String EXHAUSTED_ITERATOR_MESSAGE =
+            "iterator exhausted";
+
+    /**
+     * Load factor for the map.
+     */
+    private static final float LOAD_FACTOR = 0.5f;
+
+    /**
+     * Default starting size.
+     * <p>This must be a power of two for bit mask to work properly. </p>
+     */
+    private static final int DEFAULT_EXPECTED_SIZE = 16;
+
+    /**
+     * Multiplier for size growth when map fills up.
+     * <p>This must be a power of two for bit mask to work properly. </p>
+     */
+    private static final int RESIZE_MULTIPLIER = 2;
+
+    /**
+     * Number of bits to perturb the index when probing for collision resolution.
+     */
+    private static final int PERTURB_SHIFT = 5;
+
+    /**
+     * Keys table.
+     */
+    private int[] keys;
+
+    /**
+     * Values table.
+     */
+    private double[] values;
+
+    /**
+     * States table.
+     */
+    private byte[] states;
+
+    /**
+     * Return value for missing entries.
+     */
+    private final double missingEntries;
+
+    /**
+     * Current size of the map.
+     */
+    private int size;
+
+    /**
+     * Bit mask for hash values.
+     */
+    private int mask;
+
+    /**
+     * Modifications count.
+     */
+    private transient int count;
+
+    /**
+     * Build an empty map with default size and using NaN for missing entries.
+     */
+    public OpenIntToDoubleHashMap() {
+        this(DEFAULT_EXPECTED_SIZE, Double.NaN);
+    }
+
+    /**
+     * Build an empty map with default size
+     *
+     * @param missingEntries value to return when a missing entry is fetched
+     */
+    public OpenIntToDoubleHashMap(final double missingEntries) {
+        this(DEFAULT_EXPECTED_SIZE, missingEntries);
+    }
+
+    /**
+     * Build an empty map with specified size and using NaN for missing entries.
+     *
+     * @param expectedSize expected number of elements in the map
+     */
+    public OpenIntToDoubleHashMap(final int expectedSize) {
+        this(expectedSize, Double.NaN);
+    }
+
+    /**
+     * Build an empty map with specified size.
+     *
+     * @param expectedSize   expected number of elements in the map
+     * @param missingEntries value to return when a missing entry is fetched
+     */
+    public OpenIntToDoubleHashMap(final int expectedSize,
+                                  final double missingEntries) {
+        final int capacity = computeCapacity(expectedSize);
+        keys = new int[capacity];
+        values = new double[capacity];
+        states = new byte[capacity];
+        this.missingEntries = missingEntries;
+        mask = capacity - 1;
+    }
+
+    /**
+     * Copy constructor.
+     *
+     * @param source map to copy
+     */
+    public OpenIntToDoubleHashMap(final OpenIntToDoubleHashMap source) {
+        final int length = source.keys.length;
+        keys = new int[length];
+        System.arraycopy(source.keys, 0, keys, 0, length);
+        values = new double[length];
+        System.arraycopy(source.values, 0, values, 0, length);
+        states = new byte[length];
+        System.arraycopy(source.states, 0, states, 0, length);
+        missingEntries = source.missingEntries;
+        size = source.size;
+        mask = source.mask;
+        count = source.count;
+    }
+
+    /**
+     * Compute the capacity needed for a given size.
+     *
+     * @param expectedSize expected size of the map
+     * @return capacity to use for the specified size
+     */
+    private static int computeCapacity(final int expectedSize) {
+        if (expectedSize == 0) {
+            return 1;
+        }
+        final int capacity = (int) Math.ceil(expectedSize / LOAD_FACTOR);
+        final int powerOfTwo = Integer.highestOneBit(capacity);
+        if (powerOfTwo == capacity) {
+            return capacity;
+        }
+        return nextPowerOfTwo(capacity);
+    }
+
+    /**
+     * Find the smallest power of two greater than the input value
+     *
+     * @param i input value
+     * @return smallest power of two greater than the input value
+     */
+    private static int nextPowerOfTwo(final int i) {
+        return Integer.highestOneBit(i) << 1;
+    }
+
+    /**
+     * Get the stored value associated with the given key
+     *
+     * @param key key associated with the data
+     * @return data associated with the key
+     */
+    public double get(final int key) {
+
+        final int hash = hashOf(key);
+        int index = hash & mask;
+        if (containsKey(key, index)) {
+            return values[index];
+        }
+
+        if (states[index] == FREE) {
+            return missingEntries;
+        }
+
+        int j = index;
+        for (int perturb = perturb(hash); states[index] != FREE; perturb >>= PERTURB_SHIFT) {
+            j = probe(perturb, j);
+            index = j & mask;
+            if (containsKey(key, index)) {
+                return values[index];
+            }
+        }
+
+        return missingEntries;
+
+    }
+
+    /**
+     * Check if a value is associated with a key.
+     *
+     * @param key key to check
+     * @return true if a value is associated with key
+     */
+    public boolean containsKey(final int key) {
+
+        final int hash = hashOf(key);
+        int index = hash & mask;
+        if (containsKey(key, index)) {
+            return true;
+        }
+
+        if (states[index] == FREE) {
+            return false;
+        }
+
+        int j = index;
+        for (int perturb = perturb(hash); states[index] != FREE; perturb >>= PERTURB_SHIFT) {
+            j = probe(perturb, j);
+            index = j & mask;
+            if (containsKey(key, index)) {
+                return true;
+            }
+        }
+
+        return false;
+
+    }
+
+    /**
+     * Get an iterator over map elements.
+     * <p>The specialized iterators returned are fail-fast: they throw a
+     * <code>ConcurrentModificationException</code> when they detect the map
+     * has been modified during iteration.</p>
+     *
+     * @return iterator over the map elements
+     */
+    public Iterator iterator() {
+        return new Iterator();
+    }
+
+    /**
+     * Perturb the hash for starting probing.
+     *
+     * @param hash initial hash
+     * @return perturbed hash
+     */
+    private static int perturb(final int hash) {
+        return hash & 0x7fffffff;
+    }
+
+    /**
+     * Find the index at which a key should be inserted
+     *
+     * @param key key to lookup
+     * @return index at which key should be inserted
+     */
+    private int findInsertionIndex(final int key) {
+        return findInsertionIndex(keys, states, key, mask);
+    }
+
+    /**
+     * Find the index at which a key should be inserted
+     *
+     * @param keys   keys table
+     * @param states states table
+     * @param key    key to lookup
+     * @param mask   bit mask for hash values
+     * @return index at which key should be inserted
+     */
+    private static int findInsertionIndex(final int[] keys, final byte[] states,
+                                          final int key, final int mask) {
+        final int hash = hashOf(key);
+        int index = hash & mask;
+        if (states[index] == FREE) {
+            return index;
+        } else if (states[index] == FULL && keys[index] == key) {
+            return changeIndexSign(index);
+        }
+
+        int perturb = perturb(hash);
+        int j = index;
+        if (states[index] == FULL) {
+            while (true) {
+                j = probe(perturb, j);
+                index = j & mask;
+                perturb >>= PERTURB_SHIFT;
+
+                if (states[index] != FULL || keys[index] == key) {
+                    break;
+                }
+            }
+        }
+
+        if (states[index] == FREE) {
+            return index;
+        } else if (states[index] == FULL) {
+            // due to the loop exit condition,
+            // if (states[index] == FULL) then keys[index] == key
+            return changeIndexSign(index);
+        }
+
+        final int firstRemoved = index;
+        while (true) {
+            j = probe(perturb, j);
+            index = j & mask;
+
+            if (states[index] == FREE) {
+                return firstRemoved;
+            } else if (states[index] == FULL && keys[index] == key) {
+                return changeIndexSign(index);
+            }
+
+            perturb >>= PERTURB_SHIFT;
+
+        }
+
+    }
+
+    /**
+     * Compute next probe for collision resolution
+     *
+     * @param perturb perturbed hash
+     * @param j       previous probe
+     * @return next probe
+     */
+    private static int probe(final int perturb, final int j) {
+        return (j << 2) + j + perturb + 1;
+    }
+
+    /**
+     * Change the index sign
+     *
+     * @param index initial index
+     * @return changed index
+     */
+    private static int changeIndexSign(final int index) {
+        return -index - 1;
+    }
+
+    /**
+     * Get the number of elements stored in the map.
+     *
+     * @return number of elements stored in the map
+     */
+    public int size() {
+        return size;
+    }
+
+
+    /**
+     * Remove the value associated with a key.
+     *
+     * @param key key to which the value is associated
+     * @return removed value
+     */
+    public double remove(final int key) {
+
+        final int hash = hashOf(key);
+        int index = hash & mask;
+        if (containsKey(key, index)) {
+            return doRemove(index);
+        }
+
+        if (states[index] == FREE) {
+            return missingEntries;
+        }
+
+        int j = index;
+        for (int perturb = perturb(hash); states[index] != FREE; perturb >>= PERTURB_SHIFT) {
+            j = probe(perturb, j);
+            index = j & mask;
+            if (containsKey(key, index)) {
+                return doRemove(index);
+            }
+        }
+
+        return missingEntries;
+
+    }
+
+    /**
+     * Check if the tables contain an element associated with specified key
+     * at specified index.
+     *
+     * @param key   key to check
+     * @param index index to check
+     * @return true if an element is associated with key at index
+     */
+    private boolean containsKey(final int key, final int index) {
+        return (key != 0 || states[index] == FULL) && keys[index] == key;
+    }
+
+    /**
+     * Remove an element at specified index.
+     *
+     * @param index index of the element to remove
+     * @return removed value
+     */
+    private double doRemove(int index) {
+        keys[index] = 0;
+        states[index] = REMOVED;
+        final double previous = values[index];
+        values[index] = missingEntries;
+        --size;
+        ++count;
+        return previous;
+    }
+
+    /**
+     * Put a value associated with a key in the map.
+     *
+     * @param key   key to which value is associated
+     * @param value value to put in the map
+     * @return previous value associated with the key
+     */
+    public double put(final int key, final double value) {
+        int index = findInsertionIndex(key);
+        double previous = missingEntries;
+        boolean newMapping = true;
+        if (index < 0) {
+            index = changeIndexSign(index);
+            previous = values[index];
+            newMapping = false;
+        }
+        keys[index] = key;
+        states[index] = FULL;
+        values[index] = value;
+        if (newMapping) {
+            ++size;
+            if (shouldGrowTable()) {
+                growTable();
+            }
+            ++count;
+        }
+        return previous;
+
+    }
+
+    /**
+     * Grow the tables.
+     */
+    private void growTable() {
+
+        final int oldLength = states.length;
+        final int[] oldKeys = keys;
+        final double[] oldValues = values;
+        final byte[] oldStates = states;
+
+        final int newLength = RESIZE_MULTIPLIER * oldLength;
+        final int[] newKeys = new int[newLength];
+        final double[] newValues = new double[newLength];
+        final byte[] newStates = new byte[newLength];
+        final int newMask = newLength - 1;
+        for (int i = 0; i < oldLength; ++i) {
+            if (oldStates[i] == FULL) {
+                final int key = oldKeys[i];
+                final int index = findInsertionIndex(newKeys, newStates, key, newMask);
+                newKeys[index] = key;
+                newValues[index] = oldValues[i];
+                newStates[index] = FULL;
+            }
+        }
+
+        mask = newMask;
+        keys = newKeys;
+        values = newValues;
+        states = newStates;
+
+    }
+
+    /**
+     * Check if tables should grow due to increased size.
+     *
+     * @return true if  tables should grow
+     */
+    private boolean shouldGrowTable() {
+        return size > (mask + 1) * LOAD_FACTOR;
+    }
+
+    /**
+     * Compute the hash value of a key
+     *
+     * @param key key to hash
+     * @return hash value of the key
+     */
+    private static int hashOf(final int key) {
+        final int h = key ^ ((key >>> 20) ^ (key >>> 12));
+        return h ^ (h >>> 7) ^ (h >>> 4);
+    }
+
+
+    /**
+     * Iterator class for the map.
+     */
+    public class Iterator {
+
+        /**
+         * Reference modification count.
+         */
+        private final int referenceCount;
+
+        /**
+         * Index of current element.
+         */
+        private int current;
+
+        /**
+         * Index of next element.
+         */
+        private int next;
+
+        /**
+         * Simple constructor.
+         */
+        private Iterator() {
+
+            // preserve the modification count of the map to detect concurrent modifications later
+            referenceCount = count;
+
+            // initialize current index
+            next = -1;
+            try {
+                advance();
+            } catch (NoSuchElementException nsee) {
+                // ignored
+            }
+
+        }
+
+        /**
+         * Check if there is a next element in the map.
+         *
+         * @return true if there is a next element
+         */
+        public boolean hasNext() {
+            return next >= 0;
+        }
+
+        /**
+         * Get the key of current entry.
+         *
+         * @return key of current entry
+         * @throws ConcurrentModificationException
+         *                                if the map is modified during iteration
+         * @throws NoSuchElementException if there is no element left in the map
+         */
+        public int key()
+                throws ConcurrentModificationException, NoSuchElementException {
+            if (referenceCount != count) {
+                throw MathRuntimeException.createConcurrentModificationException(
+                        CONCURRENT_MODIFICATION_MESSAGE);
+            }
+            if (current < 0) {
+                throw MathRuntimeException.createNoSuchElementException(EXHAUSTED_ITERATOR_MESSAGE);
+            }
+            return keys[current];
+        }
+
+        /**
+         * Get the value of current entry.
+         *
+         * @return value of current entry
+         * @throws ConcurrentModificationException
+         *                                if the map is modified during iteration
+         * @throws NoSuchElementException if there is no element left in the map
+         */
+        public double value()
+                throws ConcurrentModificationException, NoSuchElementException {
+            if (referenceCount != count) {
+                throw MathRuntimeException.createConcurrentModificationException(
+                        CONCURRENT_MODIFICATION_MESSAGE);
+            }
+            if (current < 0) {
+                throw MathRuntimeException.createNoSuchElementException(EXHAUSTED_ITERATOR_MESSAGE);
+            }
+            return values[current];
+        }
+
+        /**
+         * Advance iterator one step further.
+         *
+         * @throws ConcurrentModificationException
+         *                                if the map is modified during iteration
+         * @throws NoSuchElementException if there is no element left in the map
+         */
+        public void advance()
+                throws ConcurrentModificationException, NoSuchElementException {
+
+            if (referenceCount != count) {
+                throw MathRuntimeException.createConcurrentModificationException(
+                        CONCURRENT_MODIFICATION_MESSAGE);
+            }
+
+            // advance on step
+            current = next;
+
+            // prepare next step
+            try {
+                while (states[++next] != FULL) {
+                    // nothing to do
+                }
+            } catch (ArrayIndexOutOfBoundsException e) {
+                next = -2;
+                if (current < 0) {
+                    throw MathRuntimeException.createNoSuchElementException(EXHAUSTED_ITERATOR_MESSAGE);
+                }
+            }
+
+        }
+
+    }
+
+    /**
+     * Read a serialized object.
+     *
+     * @param stream input stream
+     * @throws IOException            if object cannot be read
+     * @throws ClassNotFoundException if the class corresponding
+     *                                to the serialized object cannot be found
+     */
+    private void readObject(final ObjectInputStream stream)
+            throws IOException, ClassNotFoundException {
+        stream.defaultReadObject();
+        count = 0;
+    }
+
+
+}
diff --git a/src/org/json/CDL.java b/src/org/json/CDL.java
new file mode 100755
index 0000000..0fc3cf8
--- /dev/null
+++ b/src/org/json/CDL.java
@@ -0,0 +1,279 @@
+package org.json;
+
+/*
+Copyright (c) 2002 JSON.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+The Software shall be used for Good, not Evil.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+/**
+ * This provides static methods to convert comma delimited text into a
+ * JSONArray, and to covert a JSONArray into comma delimited text. Comma
+ * delimited text is a very popular format for data interchange. It is
+ * understood by most database, spreadsheet, and organizer programs.
+ * <p>
+ * Each row of text represents a row in a table or a data record. Each row
+ * ends with a NEWLINE character. Each row contains one or more values.
+ * Values are separated by commas. A value can contain any character except
+ * for comma, unless is is wrapped in single quotes or double quotes.
+ * <p>
+ * The first row usually contains the names of the columns.
+ * <p>
+ * A comma delimited list can be converted into a JSONArray of JSONObjects.
+ * The names for the elements in the JSONObjects can be taken from the names
+ * in the first row.
+ * @author JSON.org
+ * @version 2012-11-13
+ */
+public class CDL {
+
+    /**
+     * Get the next value. The value can be wrapped in quotes. The value can
+     * be empty.
+     * @param x A JSONTokener of the source text.
+     * @return The value string, or null if empty.
+     * @throws JSONException if the quoted string is badly formed.
+     */
+    private static String getValue(JSONTokener x) throws JSONException {
+        char c;
+        char q;
+        StringBuffer sb;
+        do {
+            c = x.next();
+        } while (c == ' ' || c == '\t');
+        switch (c) {
+        case 0:
+            return null;
+        case '"':
+        case '\'':
+            q = c;
+            sb = new StringBuffer();
+            for (;;) {
+                c = x.next();
+                if (c == q) {
+                    break;
+                }
+                if (c == 0 || c == '\n' || c == '\r') {
+                    throw x.syntaxError("Missing close quote '" + q + "'.");
+                }
+                sb.append(c);
+            }
+            return sb.toString();
+        case ',':
+            x.back();
+            return "";
+        default:
+            x.back();
+            return x.nextTo(',');
+        }
+    }
+
+    /**
+     * Produce a JSONArray of strings from a row of comma delimited values.
+     * @param x A JSONTokener of the source text.
+     * @return A JSONArray of strings.
+     * @throws JSONException
+     */
+    public static JSONArray rowToJSONArray(JSONTokener x) throws JSONException {
+        JSONArray ja = new JSONArray();
+        for (;;) {
+            String value = getValue(x);
+            char c = x.next();
+            if (value == null ||
+                    (ja.length() == 0 && value.length() == 0 && c != ',')) {
+                return null;
+            }
+            ja.put(value);
+            for (;;) {
+                if (c == ',') {
+                    break;
+                }
+                if (c != ' ') {
+                    if (c == '\n' || c == '\r' || c == 0) {
+                        return ja;
+                    }
+                    throw x.syntaxError("Bad character '" + c + "' (" +
+                            (int)c + ").");
+                }
+                c = x.next();
+            }
+        }
+    }
+
+    /**
+     * Produce a JSONObject from a row of comma delimited text, using a
+     * parallel JSONArray of strings to provides the names of the elements.
+     * @param names A JSONArray of names. This is commonly obtained from the
+     *  first row of a comma delimited text file using the rowToJSONArray
+     *  method.
+     * @param x A JSONTokener of the source text.
+     * @return A JSONObject combining the names and values.
+     * @throws JSONException
+     */
+    public static JSONObject rowToJSONObject(JSONArray names, JSONTokener x)
+            throws JSONException {
+        JSONArray ja = rowToJSONArray(x);
+        return ja != null ? ja.toJSONObject(names) :  null;
+    }
+
+    /**
+     * Produce a comma delimited text row from a JSONArray. Values containing
+     * the comma character will be quoted. Troublesome characters may be
+     * removed.
+     * @param ja A JSONArray of strings.
+     * @return A string ending in NEWLINE.
+     */
+    public static String rowToString(JSONArray ja) {
+        StringBuffer sb = new StringBuffer();
+        for (int i = 0; i < ja.length(); i += 1) {
+            if (i > 0) {
+                sb.append(',');
+            }
+            Object object = ja.opt(i);
+            if (object != null) {
+                String string = object.toString();
+                if (string.length() > 0 && (string.indexOf(',') >= 0 ||
+                        string.indexOf('\n') >= 0 || string.indexOf('\r') >= 0 ||
+                        string.indexOf(0) >= 0 || string.charAt(0) == '"')) {
+                    sb.append('"');
+                    int length = string.length();
+                    for (int j = 0; j < length; j += 1) {
+                        char c = string.charAt(j);
+                        if (c >= ' ' && c != '"') {
+                            sb.append(c);
+                        }
+                    }
+                    sb.append('"');
+                } else {
+                    sb.append(string);
+                }
+            }
+        }
+        sb.append('\n');
+        return sb.toString();
+    }
+
+    /**
+     * Produce a JSONArray of JSONObjects from a comma delimited text string,
+     * using the first row as a source of names.
+     * @param string The comma delimited text.
+     * @return A JSONArray of JSONObjects.
+     * @throws JSONException
+     */
+    public static JSONArray toJSONArray(String string) throws JSONException {
+        return toJSONArray(new JSONTokener(string));
+    }
+
+    /**
+     * Produce a JSONArray of JSONObjects from a comma delimited text string,
+     * using the first row as a source of names.
+     * @param x The JSONTokener containing the comma delimited text.
+     * @return A JSONArray of JSONObjects.
+     * @throws JSONException
+     */
+    public static JSONArray toJSONArray(JSONTokener x) throws JSONException {
+        return toJSONArray(rowToJSONArray(x), x);
+    }
+
+    /**
+     * Produce a JSONArray of JSONObjects from a comma delimited text string
+     * using a supplied JSONArray as the source of element names.
+     * @param names A JSONArray of strings.
+     * @param string The comma delimited text.
+     * @return A JSONArray of JSONObjects.
+     * @throws JSONException
+     */
+    public static JSONArray toJSONArray(JSONArray names, String string)
+            throws JSONException {
+        return toJSONArray(names, new JSONTokener(string));
+    }
+
+    /**
+     * Produce a JSONArray of JSONObjects from a comma delimited text string
+     * using a supplied JSONArray as the source of element names.
+     * @param names A JSONArray of strings.
+     * @param x A JSONTokener of the source text.
+     * @return A JSONArray of JSONObjects.
+     * @throws JSONException
+     */
+    public static JSONArray toJSONArray(JSONArray names, JSONTokener x)
+            throws JSONException {
+        if (names == null || names.length() == 0) {
+            return null;
+        }
+        JSONArray ja = new JSONArray();
+        for (;;) {
+            JSONObject jo = rowToJSONObject(names, x);
+            if (jo == null) {
+                break;
+            }
+            ja.put(jo);
+        }
+        if (ja.length() == 0) {
+            return null;
+        }
+        return ja;
+    }
+
+
+    /**
+     * Produce a comma delimited text from a JSONArray of JSONObjects. The
+     * first row will be a list of names obtained by inspecting the first
+     * JSONObject.
+     * @param ja A JSONArray of JSONObjects.
+     * @return A comma delimited text.
+     * @throws JSONException
+     */
+    public static String toString(JSONArray ja) throws JSONException {
+        JSONObject jo = ja.optJSONObject(0);
+        if (jo != null) {
+            JSONArray names = jo.names();
+            if (names != null) {
+                return rowToString(names) + toString(names, ja);
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Produce a comma delimited text from a JSONArray of JSONObjects using
+     * a provided list of names. The list of names is not included in the
+     * output.
+     * @param names A JSONArray of strings.
+     * @param ja A JSONArray of JSONObjects.
+     * @return A comma delimited text.
+     * @throws JSONException
+     */
+    public static String toString(JSONArray names, JSONArray ja)
+            throws JSONException {
+        if (names == null || names.length() == 0) {
+            return null;
+        }
+        StringBuffer sb = new StringBuffer();
+        for (int i = 0; i < ja.length(); i += 1) {
+            JSONObject jo = ja.optJSONObject(i);
+            if (jo != null) {
+                sb.append(rowToString(jo.toJSONArray(names)));
+            }
+        }
+        return sb.toString();
+    }
+}
diff --git a/src/org/json/Cookie.java b/src/org/json/Cookie.java
new file mode 100755
index 0000000..9cf5ce2
--- /dev/null
+++ b/src/org/json/Cookie.java
@@ -0,0 +1,169 @@
+package org.json;
+
+/*
+Copyright (c) 2002 JSON.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+The Software shall be used for Good, not Evil.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+/**
+ * Convert a web browser cookie specification to a JSONObject and back.
+ * JSON and Cookies are both notations for name/value pairs.
+ * @author JSON.org
+ * @version 2010-12-24
+ */
+public class Cookie {
+
+    /**
+     * Produce a copy of a string in which the characters '+', '%', '=', ';'
+     * and control characters are replaced with "%hh". This is a gentle form
+     * of URL encoding, attempting to cause as little distortion to the
+     * string as possible. The characters '=' and ';' are meta characters in
+     * cookies. By convention, they are escaped using the URL-encoding. This is
+     * only a convention, not a standard. Often, cookies are expected to have
+     * encoded values. We encode '=' and ';' because we must. We encode '%' and
+     * '+' because they are meta characters in URL encoding.
+     * @param string The source string.
+     * @return       The escaped result.
+     */
+    public static String escape(String string) {
+        char         c;
+        String       s = string.trim();
+        StringBuffer sb = new StringBuffer();
+        int          length = s.length();
+        for (int i = 0; i < length; i += 1) {
+            c = s.charAt(i);
+            if (c < ' ' || c == '+' || c == '%' || c == '=' || c == ';') {
+                sb.append('%');
+                sb.append(Character.forDigit((char)((c >>> 4) & 0x0f), 16));
+                sb.append(Character.forDigit((char)(c & 0x0f), 16));
+            } else {
+                sb.append(c);
+            }
+        }
+        return sb.toString();
+    }
+
+
+    /**
+     * Convert a cookie specification string into a JSONObject. The string
+     * will contain a name value pair separated by '='. The name and the value
+     * will be unescaped, possibly converting '+' and '%' sequences. The
+     * cookie properties may follow, separated by ';', also represented as
+     * name=value (except the secure property, which does not have a value).
+     * The name will be stored under the key "name", and the value will be
+     * stored under the key "value". This method does not do checking or
+     * validation of the parameters. It only converts the cookie string into
+     * a JSONObject.
+     * @param string The cookie specification string.
+     * @return A JSONObject containing "name", "value", and possibly other
+     *  members.
+     * @throws JSONException
+     */
+    public static JSONObject toJSONObject(String string) throws JSONException {
+        String         name;
+        JSONObject     jo = new JSONObject();
+        Object         value;
+        JSONTokener x = new JSONTokener(string);
+        jo.put("name", x.nextTo('='));
+        x.next('=');
+        jo.put("value", x.nextTo(';'));
+        x.next();
+        while (x.more()) {
+            name = unescape(x.nextTo("=;"));
+            if (x.next() != '=') {
+                if (name.equals("secure")) {
+                    value = Boolean.TRUE;
+                } else {
+                    throw x.syntaxError("Missing '=' in cookie parameter.");
+                }
+            } else {
+                value = unescape(x.nextTo(';'));
+                x.next();
+            }
+            jo.put(name, value);
+        }
+        return jo;
+    }
+
+
+    /**
+     * Convert a JSONObject into a cookie specification string. The JSONObject
+     * must contain "name" and "value" members.
+     * If the JSONObject contains "expires", "domain", "path", or "secure"
+     * members, they will be appended to the cookie specification string.
+     * All other members are ignored.
+     * @param jo A JSONObject
+     * @return A cookie specification string
+     * @throws JSONException
+     */
+    public static String toString(JSONObject jo) throws JSONException {
+        StringBuffer sb = new StringBuffer();
+
+        sb.append(escape(jo.getString("name")));
+        sb.append("=");
+        sb.append(escape(jo.getString("value")));
+        if (jo.has("expires")) {
+            sb.append(";expires=");
+            sb.append(jo.getString("expires"));
+        }
+        if (jo.has("domain")) {
+            sb.append(";domain=");
+            sb.append(escape(jo.getString("domain")));
+        }
+        if (jo.has("path")) {
+            sb.append(";path=");
+            sb.append(escape(jo.getString("path")));
+        }
+        if (jo.optBoolean("secure")) {
+            sb.append(";secure");
+        }
+        return sb.toString();
+    }
+
+    /**
+     * Convert <code>%</code><i>hh</i> sequences to single characters, and
+     * convert plus to space.
+     * @param string A string that may contain
+     *      <code>+</code> <small>(plus)</small> and
+     *      <code>%</code><i>hh</i> sequences.
+     * @return The unescaped string.
+     */
+    public static String unescape(String string) {
+        int length = string.length();
+        StringBuffer sb = new StringBuffer();
+        for (int i = 0; i < length; ++i) {
+            char c = string.charAt(i);
+            if (c == '+') {
+                c = ' ';
+            } else if (c == '%' && i + 2 < length) {
+                int d = JSONTokener.dehexchar(string.charAt(i + 1));
+                int e = JSONTokener.dehexchar(string.charAt(i + 2));
+                if (d >= 0 && e >= 0) {
+                    c = (char)(d * 16 + e);
+                    i += 2;
+                }
+            }
+            sb.append(c);
+        }
+        return sb.toString();
+    }
+}
diff --git a/src/org/json/CookieList.java b/src/org/json/CookieList.java
new file mode 100755
index 0000000..7f4fe07
--- /dev/null
+++ b/src/org/json/CookieList.java
@@ -0,0 +1,90 @@
+package org.json;
+
+/*
+Copyright (c) 2002 JSON.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+The Software shall be used for Good, not Evil.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+import java.util.Iterator;
+
+/**
+ * Convert a web browser cookie list string to a JSONObject and back.
+ * @author JSON.org
+ * @version 2010-12-24
+ */
+public class CookieList {
+
+    /**
+     * Convert a cookie list into a JSONObject. A cookie list is a sequence
+     * of name/value pairs. The names are separated from the values by '='.
+     * The pairs are separated by ';'. The names and the values
+     * will be unescaped, possibly converting '+' and '%' sequences.
+     *
+     * To add a cookie to a cooklist,
+     * cookielistJSONObject.put(cookieJSONObject.getString("name"),
+     *     cookieJSONObject.getString("value"));
+     * @param string  A cookie list string
+     * @return A JSONObject
+     * @throws JSONException
+     */
+    public static JSONObject toJSONObject(String string) throws JSONException {
+        JSONObject jo = new JSONObject();
+        JSONTokener x = new JSONTokener(string);
+        while (x.more()) {
+            String name = Cookie.unescape(x.nextTo('='));
+            x.next('=');
+            jo.put(name, Cookie.unescape(x.nextTo(';')));
+            x.next();
+        }
+        return jo;
+    }
+
+
+    /**
+     * Convert a JSONObject into a cookie list. A cookie list is a sequence
+     * of name/value pairs. The names are separated from the values by '='.
+     * The pairs are separated by ';'. The characters '%', '+', '=', and ';'
+     * in the names and values are replaced by "%hh".
+     * @param jo A JSONObject
+     * @return A cookie list string
+     * @throws JSONException
+     */
+    public static String toString(JSONObject jo) throws JSONException {
+        boolean      b = false;
+        Iterator     keys = jo.keys();
+        String       string;
+        StringBuffer sb = new StringBuffer();
+        while (keys.hasNext()) {
+            string = keys.next().toString();
+            if (!jo.isNull(string)) {
+                if (b) {
+                    sb.append(';');
+                }
+                sb.append(Cookie.escape(string));
+                sb.append("=");
+                sb.append(Cookie.escape(jo.getString(string)));
+                b = true;
+            }
+        }
+        return sb.toString();
+    }
+}
diff --git a/src/org/json/HTTP.java b/src/org/json/HTTP.java
new file mode 100755
index 0000000..43d04a8
--- /dev/null
+++ b/src/org/json/HTTP.java
@@ -0,0 +1,163 @@
+package org.json;
+
+/*
+Copyright (c) 2002 JSON.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+The Software shall be used for Good, not Evil.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+import java.util.Iterator;
+
+/**
+ * Convert an HTTP header to a JSONObject and back.
+ * @author JSON.org
+ * @version 2010-12-24
+ */
+public class HTTP {
+
+    /** Carriage return/line feed. */
+    public static final String CRLF = "\r\n";
+
+    /**
+     * Convert an HTTP header string into a JSONObject. It can be a request
+     * header or a response header. A request header will contain
+     * <pre>{
+     *    Method: "POST" (for example),
+     *    "Request-URI": "/" (for example),
+     *    "HTTP-Version": "HTTP/1.1" (for example)
+     * }</pre>
+     * A response header will contain
+     * <pre>{
+     *    "HTTP-Version": "HTTP/1.1" (for example),
+     *    "Status-Code": "200" (for example),
+     *    "Reason-Phrase": "OK" (for example)
+     * }</pre>
+     * In addition, the other parameters in the header will be captured, using
+     * the HTTP field names as JSON names, so that <pre>
+     *    Date: Sun, 26 May 2002 18:06:04 GMT
+     *    Cookie: Q=q2=PPEAsg--; B=677gi6ouf29bn&b=2&f=s
+     *    Cache-Control: no-cache</pre>
+     * become
+     * <pre>{...
+     *    Date: "Sun, 26 May 2002 18:06:04 GMT",
+     *    Cookie: "Q=q2=PPEAsg--; B=677gi6ouf29bn&b=2&f=s",
+     *    "Cache-Control": "no-cache",
+     * ...}</pre>
+     * It does no further checking or conversion. It does not parse dates.
+     * It does not do '%' transforms on URLs.
+     * @param string An HTTP header string.
+     * @return A JSONObject containing the elements and attributes
+     * of the XML string.
+     * @throws JSONException
+     */
+    public static JSONObject toJSONObject(String string) throws JSONException {
+        JSONObject     jo = new JSONObject();
+        HTTPTokener    x = new HTTPTokener(string);
+        String         token;
+
+        token = x.nextToken();
+        if (token.toUpperCase().startsWith("HTTP")) {
+
+// Response
+
+            jo.put("HTTP-Version", token);
+            jo.put("Status-Code", x.nextToken());
+            jo.put("Reason-Phrase", x.nextTo('\0'));
+            x.next();
+
+        } else {
+
+// Request
+
+            jo.put("Method", token);
+            jo.put("Request-URI", x.nextToken());
+            jo.put("HTTP-Version", x.nextToken());
+        }
+
+// Fields
+
+        while (x.more()) {
+            String name = x.nextTo(':');
+            x.next(':');
+            jo.put(name, x.nextTo('\0'));
+            x.next();
+        }
+        return jo;
+    }
+
+
+    /**
+     * Convert a JSONObject into an HTTP header. A request header must contain
+     * <pre>{
+     *    Method: "POST" (for example),
+     *    "Request-URI": "/" (for example),
+     *    "HTTP-Version": "HTTP/1.1" (for example)
+     * }</pre>
+     * A response header must contain
+     * <pre>{
+     *    "HTTP-Version": "HTTP/1.1" (for example),
+     *    "Status-Code": "200" (for example),
+     *    "Reason-Phrase": "OK" (for example)
+     * }</pre>
+     * Any other members of the JSONObject will be output as HTTP fields.
+     * The result will end with two CRLF pairs.
+     * @param jo A JSONObject
+     * @return An HTTP header string.
+     * @throws JSONException if the object does not contain enough
+     *  information.
+     */
+    public static String toString(JSONObject jo) throws JSONException {
+        Iterator     keys = jo.keys();
+        String       string;
+        StringBuffer sb = new StringBuffer();
+        if (jo.has("Status-Code") && jo.has("Reason-Phrase")) {
+            sb.append(jo.getString("HTTP-Version"));
+            sb.append(' ');
+            sb.append(jo.getString("Status-Code"));
+            sb.append(' ');
+            sb.append(jo.getString("Reason-Phrase"));
+        } else if (jo.has("Method") && jo.has("Request-URI")) {
+            sb.append(jo.getString("Method"));
+            sb.append(' ');
+            sb.append('"');
+            sb.append(jo.getString("Request-URI"));
+            sb.append('"');
+            sb.append(' ');
+            sb.append(jo.getString("HTTP-Version"));
+        } else {
+            throw new JSONException("Not enough material for an HTTP header.");
+        }
+        sb.append(CRLF);
+        while (keys.hasNext()) {
+            string = keys.next().toString();
+            if (!"HTTP-Version".equals(string)      && !"Status-Code".equals(string) &&
+                    !"Reason-Phrase".equals(string) && !"Method".equals(string) &&
+                    !"Request-URI".equals(string)   && !jo.isNull(string)) {
+                sb.append(string);
+                sb.append(": ");
+                sb.append(jo.getString(string));
+                sb.append(CRLF);
+            }
+        }
+        sb.append(CRLF);
+        return sb.toString();
+    }
+}
diff --git a/src/org/json/HTTPTokener.java b/src/org/json/HTTPTokener.java
new file mode 100755
index 0000000..ed41744
--- /dev/null
+++ b/src/org/json/HTTPTokener.java
@@ -0,0 +1,77 @@
+package org.json;
+
+/*
+Copyright (c) 2002 JSON.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+The Software shall be used for Good, not Evil.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+/**
+ * The HTTPTokener extends the JSONTokener to provide additional methods
+ * for the parsing of HTTP headers.
+ * @author JSON.org
+ * @version 2012-11-13
+ */
+public class HTTPTokener extends JSONTokener {
+
+    /**
+     * Construct an HTTPTokener from a string.
+     * @param string A source string.
+     */
+    public HTTPTokener(String string) {
+        super(string);
+    }
+
+
+    /**
+     * Get the next token or string. This is used in parsing HTTP headers.
+     * @throws JSONException
+     * @return A String.
+     */
+    public String nextToken() throws JSONException {
+        char c;
+        char q;
+        StringBuffer sb = new StringBuffer();
+        do {
+            c = next();
+        } while (Character.isWhitespace(c));
+        if (c == '"' || c == '\'') {
+            q = c;
+            for (;;) {
+                c = next();
+                if (c < ' ') {
+                    throw syntaxError("Unterminated string.");
+                }
+                if (c == q) {
+                    return sb.toString();
+                }
+                sb.append(c);
+            }
+        }
+        for (;;) {
+            if (c == 0 || Character.isWhitespace(c)) {
+                return sb.toString();
+            }
+            sb.append(c);
+            c = next();
+        }
+    }
+}
diff --git a/src/org/json/JSONArray.java b/src/org/json/JSONArray.java
new file mode 100644
index 0000000..f8a8a72
--- /dev/null
+++ b/src/org/json/JSONArray.java
@@ -0,0 +1,987 @@
+package org.json;
+
+/*
+ Copyright (c) 2002 JSON.org
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ The Software shall be used for Good, not Evil.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+ */
+
+import java.io.IOException;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.lang.reflect.Array;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * A JSONArray is an ordered sequence of values. Its external text form is a
+ * string wrapped in square brackets with commas separating the values. The
+ * internal form is an object having <code>get</code> and <code>opt</code>
+ * methods for accessing the values by index, and <code>put</code> methods for
+ * adding or replacing values. The values can be any of these types:
+ * <code>Boolean</code>, <code>JSONArray</code>, <code>JSONObject</code>,
+ * <code>Number</code>, <code>String</code>, or the
+ * <code>JSONObject.NULL object</code>.
+ * <p>
+ * The constructor can convert a JSON text into a Java object. The
+ * <code>toString</code> method converts to JSON text.
+ * <p>
+ * A <code>get</code> method returns a value if one can be found, and throws an
+ * exception if one cannot be found. An <code>opt</code> method returns a
+ * default value instead of throwing an exception, and so is useful for
+ * obtaining optional values.
+ * <p>
+ * The generic <code>get()</code> and <code>opt()</code> methods return an
+ * object which you can cast or query for type. There are also typed
+ * <code>get</code> and <code>opt</code> methods that do type checking and type
+ * coercion for you.
+ * <p>
+ * The texts produced by the <code>toString</code> methods strictly conform to
+ * JSON syntax rules. The constructors are more forgiving in the texts they will
+ * accept:
+ * <ul>
+ * <li>An extra <code>,</code> <small>(comma)</small> may appear just
+ * before the closing bracket.</li>
+ * <li>The <code>null</code> value will be inserted when there is <code>,</code>
+ *  <small>(comma)</small> elision.</li>
+ * <li>Strings may be quoted with <code>'</code> <small>(single
+ * quote)</small>.</li>
+ * <li>Strings do not need to be quoted at all if they do not begin with a quote
+ * or single quote, and if they do not contain leading or trailing spaces, and
+ * if they do not contain any of these characters:
+ * <code>{ } [ ] / \ : , #</code> and if they do not look like numbers and
+ * if they are not the reserved words <code>true</code>, <code>false</code>, or
+ * <code>null</code>.</li>
+ * </ul>
+ *
+ * @author JSON.org
+ * @version 2013-04-18
+ */
+public class JSONArray {
+
+    /**
+     * The arrayList where the JSONArray's properties are kept.
+     */
+    private final ArrayList myArrayList;
+
+    protected Object parent = null;
+    
+    public Object getParent() {
+    	return parent;
+    }
+
+    /**
+     * Construct an empty JSONArray.
+     */
+    public JSONArray() {
+        this.myArrayList = new ArrayList();
+    }
+
+    /**
+     * Construct a JSONArray from a JSONTokener.
+     *
+     * @param x
+     *            A JSONTokener
+     * @throws JSONException
+     *             If there is a syntax error.
+     */
+    public JSONArray(JSONTokener x) throws JSONException {
+        this();
+        if (x.nextClean() != '[') {
+            throw x.syntaxError("A JSONArray text must start with '['");
+        }
+        if (x.nextClean() != ']') {
+            x.back();
+            for (;;) {
+                if (x.nextClean() == ',') {
+                    x.back();
+                    this.myArrayList.add(JSONObject.NULL);
+                } else {
+                    x.back();
+                    add(x.nextValue());
+                }
+                switch (x.nextClean()) {
+                case ',':
+                    if (x.nextClean() == ']') {
+                        return;
+                    }
+                    x.back();
+                    break;
+                case ']':
+                    return;
+                default:
+                    throw x.syntaxError("Expected a ',' or ']'");
+                }
+            }
+        }
+    }
+
+    public void add(Object o) {
+    	this.myArrayList.add(o);
+    	if (o instanceof JSONObject) {
+    		((JSONObject)o).parent = this;
+    	}
+    	if (o instanceof JSONArray) {
+    		((JSONArray)o).parent = this;
+    	}
+    }
+
+    public void insert(int index, Object o) {
+    	this.myArrayList.add(index, o);
+    	if (o instanceof JSONObject) {
+    		((JSONObject)o).parent = this;
+    	}
+    	if (o instanceof JSONArray) {
+    		((JSONArray)o).parent = this;
+    	}
+    }
+
+    public int indexOf(Object o) {
+    	return this.myArrayList.indexOf(o);
+    }
+
+    /**
+     * Construct a JSONArray from a source JSON text.
+     *
+     * @param source
+     *            A string that begins with <code>[</code> <small>(left
+     *            bracket)</small> and ends with <code>]</code>
+     *             <small>(right bracket)</small>.
+     * @throws JSONException
+     *             If there is a syntax error.
+     */
+    public JSONArray(String source) throws JSONException {
+        this(new JSONTokener(source));
+    }
+
+    /**
+     * Construct a JSONArray from a Collection.
+     *
+     * @param collection
+     *            A Collection.
+     */
+    public JSONArray(Collection collection) {
+        this.myArrayList = new ArrayList();
+        if (collection != null) {
+            Iterator iter = collection.iterator();
+            while (iter.hasNext()) {
+                add(JSONObject.wrap(iter.next()));
+            }
+        }
+    }
+
+    /**
+     * Construct a JSONArray from an array
+     *
+     * @throws JSONException
+     *             If not an array.
+     */
+    public JSONArray(Object array) throws JSONException {
+        this();
+        if (array.getClass().isArray()) {
+            int length = Array.getLength(array);
+            for (int i = 0; i < length; i += 1) {
+                this.put(JSONObject.wrap(Array.get(array, i)));
+            }
+        } else {
+            throw new JSONException(
+                    "JSONArray initial value should be a string or collection or array.");
+        }
+    }
+
+    /**
+     * Get the object value associated with an index.
+     *
+     * @param index
+     *            The index must be between 0 and length() - 1.
+     * @return An object value.
+     * @throws JSONException
+     *             If there is no value for the index.
+     */
+    public Object get(int index) throws JSONException {
+        Object object = this.opt(index);
+        if (object == null) {
+            throw new JSONException("JSONArray[" + index + "] not found.");
+        }
+        return object;
+    }
+
+    /**
+     * Get the boolean value associated with an index. The string values "true"
+     * and "false" are converted to boolean.
+     *
+     * @param index
+     *            The index must be between 0 and length() - 1.
+     * @return The truth.
+     * @throws JSONException
+     *             If there is no value for the index or if the value is not
+     *             convertible to boolean.
+     */
+    public boolean getBoolean(int index) throws JSONException {
+        Object object = this.get(index);
+        if (object.equals(Boolean.FALSE)
+                || (object instanceof String && ((String) object)
+                        .equalsIgnoreCase("false"))) {
+            return false;
+        } else if (object.equals(Boolean.TRUE)
+                || (object instanceof String && ((String) object)
+                        .equalsIgnoreCase("true"))) {
+            return true;
+        }
+        throw new JSONException("JSONArray[" + index + "] is not a boolean.");
+    }
+
+    /**
+     * Get the double value associated with an index.
+     *
+     * @param index
+     *            The index must be between 0 and length() - 1.
+     * @return The value.
+     * @throws JSONException
+     *             If the key is not found or if the value cannot be converted
+     *             to a number.
+     */
+    public double getDouble(int index) throws JSONException {
+        Object object = this.get(index);
+        try {
+            return object instanceof Number ? ((Number) object).doubleValue()
+                    : Double.parseDouble((String) object);
+        } catch (Exception e) {
+            throw new JSONException("JSONArray[" + index + "] is not a number.");
+        }
+    }
+
+    /**
+     * Get the int value associated with an index.
+     *
+     * @param index
+     *            The index must be between 0 and length() - 1.
+     * @return The value.
+     * @throws JSONException
+     *             If the key is not found or if the value is not a number.
+     */
+    public int getInt(int index) throws JSONException {
+        Object object = this.get(index);
+        try {
+            return object instanceof Number ? ((Number) object).intValue()
+                    : Integer.parseInt((String) object);
+        } catch (Exception e) {
+            throw new JSONException("JSONArray[" + index + "] is not a number.");
+        }
+    }
+
+    /**
+     * Get the JSONArray associated with an index.
+     *
+     * @param index
+     *            The index must be between 0 and length() - 1.
+     * @return A JSONArray value.
+     * @throws JSONException
+     *             If there is no value for the index. or if the value is not a
+     *             JSONArray
+     */
+    public JSONArray getJSONArray(int index) throws JSONException {
+        Object object = this.get(index);
+        if (object instanceof JSONArray) {
+            return (JSONArray) object;
+        }
+        throw new JSONException("JSONArray[" + index + "] is not a JSONArray.");
+    }
+
+    /**
+     * Get the JSONObject associated with an index.
+     *
+     * @param index
+     *            subscript
+     * @return A JSONObject value.
+     * @throws JSONException
+     *             If there is no value for the index or if the value is not a
+     *             JSONObject
+     */
+    public JSONObject getJSONObject(int index) throws JSONException {
+        Object object = this.get(index);
+        if (object instanceof JSONObject) {
+            return (JSONObject) object;
+        }
+        throw new JSONException("JSONArray[" + index + "] is not a JSONObject.");
+    }
+
+    /**
+     * Get the long value associated with an index.
+     *
+     * @param index
+     *            The index must be between 0 and length() - 1.
+     * @return The value.
+     * @throws JSONException
+     *             If the key is not found or if the value cannot be converted
+     *             to a number.
+     */
+    public long getLong(int index) throws JSONException {
+        Object object = this.get(index);
+        try {
+            return object instanceof Number ? ((Number) object).longValue()
+                    : Long.parseLong((String) object);
+        } catch (Exception e) {
+            throw new JSONException("JSONArray[" + index + "] is not a number.");
+        }
+    }
+
+    /**
+     * Get the string associated with an index.
+     *
+     * @param index
+     *            The index must be between 0 and length() - 1.
+     * @return A string value.
+     * @throws JSONException
+     *             If there is no string value for the index.
+     */
+    public String getString(int index) throws JSONException {
+        Object object = this.get(index);
+        if (object instanceof String) {
+            return (String) object;
+        }
+        throw new JSONException("JSONArray[" + index + "] not a string.");
+    }
+
+    /**
+     * Determine if the value is null.
+     *
+     * @param index
+     *            The index must be between 0 and length() - 1.
+     * @return true if the value at the index is null, or if there is no value.
+     */
+    public boolean isNull(int index) {
+        return JSONObject.NULL.equals(this.opt(index));
+    }
+
+    /**
+     * Make a string from the contents of this JSONArray. The
+     * <code>separator</code> string is inserted between each element. Warning:
+     * This method assumes that the data structure is acyclical.
+     *
+     * @param separator
+     *            A string that will be inserted between the elements.
+     * @return a string.
+     * @throws JSONException
+     *             If the array contains an invalid number.
+     */
+    public String join(String separator) throws JSONException {
+        int len = this.length();
+        StringBuffer sb = new StringBuffer();
+
+        for (int i = 0; i < len; i += 1) {
+            if (i > 0) {
+                sb.append(separator);
+            }
+            sb.append(JSONObject.valueToString(this.myArrayList.get(i)));
+        }
+        return sb.toString();
+    }
+
+    /**
+     * Get the number of elements in the JSONArray, included nulls.
+     *
+     * @return The length (or size).
+     */
+    public int length() {
+        return this.myArrayList.size();
+    }
+
+    /**
+     * Get the optional object value associated with an index.
+     *
+     * @param index
+     *            The index must be between 0 and length() - 1.
+     * @return An object value, or null if there is no object at that index.
+     */
+    public Object opt(int index) {
+        return (index < 0 || index >= this.length()) ? null : this.myArrayList
+                .get(index);
+    }
+
+    /**
+     * Get the optional boolean value associated with an index. It returns false
+     * if there is no value at that index, or if the value is not Boolean.TRUE
+     * or the String "true".
+     *
+     * @param index
+     *            The index must be between 0 and length() - 1.
+     * @return The truth.
+     */
+    public boolean optBoolean(int index) {
+        return this.optBoolean(index, false);
+    }
+
+    /**
+     * Get the optional boolean value associated with an index. It returns the
+     * defaultValue if there is no value at that index or if it is not a Boolean
+     * or the String "true" or "false" (case insensitive).
+     *
+     * @param index
+     *            The index must be between 0 and length() - 1.
+     * @param defaultValue
+     *            A boolean default.
+     * @return The truth.
+     */
+    public boolean optBoolean(int index, boolean defaultValue) {
+        try {
+            return this.getBoolean(index);
+        } catch (Exception e) {
+            return defaultValue;
+        }
+    }
+
+    /**
+     * Get the optional double value associated with an index. NaN is returned
+     * if there is no value for the index, or if the value is not a number and
+     * cannot be converted to a number.
+     *
+     * @param index
+     *            The index must be between 0 and length() - 1.
+     * @return The value.
+     */
+    public double optDouble(int index) {
+        return this.optDouble(index, Double.NaN);
+    }
+
+    /**
+     * Get the optional double value associated with an index. The defaultValue
+     * is returned if there is no value for the index, or if the value is not a
+     * number and cannot be converted to a number.
+     *
+     * @param index
+     *            subscript
+     * @param defaultValue
+     *            The default value.
+     * @return The value.
+     */
+    public double optDouble(int index, double defaultValue) {
+        try {
+            return this.getDouble(index);
+        } catch (Exception e) {
+            return defaultValue;
+        }
+    }
+
+    /**
+     * Get the optional int value associated with an index. Zero is returned if
+     * there is no value for the index, or if the value is not a number and
+     * cannot be converted to a number.
+     *
+     * @param index
+     *            The index must be between 0 and length() - 1.
+     * @return The value.
+     */
+    public int optInt(int index) {
+        return this.optInt(index, 0);
+    }
+
+    /**
+     * Get the optional int value associated with an index. The defaultValue is
+     * returned if there is no value for the index, or if the value is not a
+     * number and cannot be converted to a number.
+     *
+     * @param index
+     *            The index must be between 0 and length() - 1.
+     * @param defaultValue
+     *            The default value.
+     * @return The value.
+     */
+    public int optInt(int index, int defaultValue) {
+        try {
+            return this.getInt(index);
+        } catch (Exception e) {
+            return defaultValue;
+        }
+    }
+
+    /**
+     * Get the optional JSONArray associated with an index.
+     *
+     * @param index
+     *            subscript
+     * @return A JSONArray value, or null if the index has no value, or if the
+     *         value is not a JSONArray.
+     */
+    public JSONArray optJSONArray(int index) {
+        Object o = this.opt(index);
+        return o instanceof JSONArray ? (JSONArray) o : null;
+    }
+
+    /**
+     * Get the optional JSONObject associated with an index. Null is returned if
+     * the key is not found, or null if the index has no value, or if the value
+     * is not a JSONObject.
+     *
+     * @param index
+     *            The index must be between 0 and length() - 1.
+     * @return A JSONObject value.
+     */
+    public JSONObject optJSONObject(int index) {
+        Object o = this.opt(index);
+        return o instanceof JSONObject ? (JSONObject) o : null;
+    }
+
+    /**
+     * Get the optional long value associated with an index. Zero is returned if
+     * there is no value for the index, or if the value is not a number and
+     * cannot be converted to a number.
+     *
+     * @param index
+     *            The index must be between 0 and length() - 1.
+     * @return The value.
+     */
+    public long optLong(int index) {
+        return this.optLong(index, 0);
+    }
+
+    /**
+     * Get the optional long value associated with an index. The defaultValue is
+     * returned if there is no value for the index, or if the value is not a
+     * number and cannot be converted to a number.
+     *
+     * @param index
+     *            The index must be between 0 and length() - 1.
+     * @param defaultValue
+     *            The default value.
+     * @return The value.
+     */
+    public long optLong(int index, long defaultValue) {
+        try {
+            return this.getLong(index);
+        } catch (Exception e) {
+            return defaultValue;
+        }
+    }
+
+    /**
+     * Get the optional string value associated with an index. It returns an
+     * empty string if there is no value at that index. If the value is not a
+     * string and is not null, then it is coverted to a string.
+     *
+     * @param index
+     *            The index must be between 0 and length() - 1.
+     * @return A String value.
+     */
+    public String optString(int index) {
+        return this.optString(index, "");
+    }
+
+    /**
+     * Get the optional string associated with an index. The defaultValue is
+     * returned if the key is not found.
+     *
+     * @param index
+     *            The index must be between 0 and length() - 1.
+     * @param defaultValue
+     *            The default value.
+     * @return A String value.
+     */
+    public String optString(int index, String defaultValue) {
+        Object object = this.opt(index);
+        return JSONObject.NULL.equals(object) ? defaultValue : object
+                .toString();
+    }
+
+    /**
+     * Append a boolean value. This increases the array's length by one.
+     *
+     * @param value
+     *            A boolean value.
+     * @return this.
+     */
+    public JSONArray put(boolean value) {
+        this.put(value ? Boolean.TRUE : Boolean.FALSE);
+        return this;
+    }
+
+    /**
+     * Put a value in the JSONArray, where the value will be a JSONArray which
+     * is produced from a Collection.
+     *
+     * @param value
+     *            A Collection value.
+     * @return this.
+     */
+    public JSONArray put(Collection value) {
+        this.put(new JSONArray(value));
+        return this;
+    }
+
+    /**
+     * Append a double value. This increases the array's length by one.
+     *
+     * @param value
+     *            A double value.
+     * @throws JSONException
+     *             if the value is not finite.
+     * @return this.
+     */
+    public JSONArray put(double value) throws JSONException {
+        Double d = new Double(value);
+        JSONObject.testValidity(d);
+        this.put(d);
+        return this;
+    }
+
+    /**
+     * Append an int value. This increases the array's length by one.
+     *
+     * @param value
+     *            An int value.
+     * @return this.
+     */
+    public JSONArray put(int value) {
+        this.put(new Integer(value));
+        return this;
+    }
+
+    /**
+     * Append an long value. This increases the array's length by one.
+     *
+     * @param value
+     *            A long value.
+     * @return this.
+     */
+    public JSONArray put(long value) {
+        this.put(new Long(value));
+        return this;
+    }
+
+    /**
+     * Put a value in the JSONArray, where the value will be a JSONObject which
+     * is produced from a Map.
+     *
+     * @param value
+     *            A Map value.
+     * @return this.
+     */
+    public JSONArray put(Map value) {
+        this.put(new JSONObject(value));
+        return this;
+    }
+
+    /**
+     * Append an object value. This increases the array's length by one.
+     *
+     * @param value
+     *            An object value. The value should be a Boolean, Double,
+     *            Integer, JSONArray, JSONObject, Long, or String, or the
+     *            JSONObject.NULL object.
+     * @return this.
+     */
+    public JSONArray put(Object value) {
+        add(value);
+        return this;
+    }
+
+    /**
+     * Put or replace a boolean value in the JSONArray. If the index is greater
+     * than the length of the JSONArray, then null elements will be added as
+     * necessary to pad it out.
+     *
+     * @param index
+     *            The subscript.
+     * @param value
+     *            A boolean value.
+     * @return this.
+     * @throws JSONException
+     *             If the index is negative.
+     */
+    public JSONArray put(int index, boolean value) throws JSONException {
+        this.put(index, value ? Boolean.TRUE : Boolean.FALSE);
+        return this;
+    }
+
+    /**
+     * Put a value in the JSONArray, where the value will be a JSONArray which
+     * is produced from a Collection.
+     *
+     * @param index
+     *            The subscript.
+     * @param value
+     *            A Collection value.
+     * @return this.
+     * @throws JSONException
+     *             If the index is negative or if the value is not finite.
+     */
+    public JSONArray put(int index, Collection value) throws JSONException {
+        this.put(index, new JSONArray(value));
+        return this;
+    }
+
+    /**
+     * Put or replace a double value. If the index is greater than the length of
+     * the JSONArray, then null elements will be added as necessary to pad it
+     * out.
+     *
+     * @param index
+     *            The subscript.
+     * @param value
+     *            A double value.
+     * @return this.
+     * @throws JSONException
+     *             If the index is negative or if the value is not finite.
+     */
+    public JSONArray put(int index, double value) throws JSONException {
+        this.put(index, new Double(value));
+        return this;
+    }
+
+    /**
+     * Put or replace an int value. If the index is greater than the length of
+     * the JSONArray, then null elements will be added as necessary to pad it
+     * out.
+     *
+     * @param index
+     *            The subscript.
+     * @param value
+     *            An int value.
+     * @return this.
+     * @throws JSONException
+     *             If the index is negative.
+     */
+    public JSONArray put(int index, int value) throws JSONException {
+        this.put(index, new Integer(value));
+        return this;
+    }
+
+    /**
+     * Put or replace a long value. If the index is greater than the length of
+     * the JSONArray, then null elements will be added as necessary to pad it
+     * out.
+     *
+     * @param index
+     *            The subscript.
+     * @param value
+     *            A long value.
+     * @return this.
+     * @throws JSONException
+     *             If the index is negative.
+     */
+    public JSONArray put(int index, long value) throws JSONException {
+        this.put(index, new Long(value));
+        return this;
+    }
+
+    /**
+     * Put a value in the JSONArray, where the value will be a JSONObject that
+     * is produced from a Map.
+     *
+     * @param index
+     *            The subscript.
+     * @param value
+     *            The Map value.
+     * @return this.
+     * @throws JSONException
+     *             If the index is negative or if the the value is an invalid
+     *             number.
+     */
+    public JSONArray put(int index, Map value) throws JSONException {
+        this.put(index, new JSONObject(value));
+        return this;
+    }
+
+    /**
+     * Put or replace an object value in the JSONArray. If the index is greater
+     * than the length of the JSONArray, then null elements will be added as
+     * necessary to pad it out.
+     *
+     * @param index
+     *            The subscript.
+     * @param value
+     *            The value to put into the array. The value should be a
+     *            Boolean, Double, Integer, JSONArray, JSONObject, Long, or
+     *            String, or the JSONObject.NULL object.
+     * @return this.
+     * @throws JSONException
+     *             If the index is negative or if the the value is an invalid
+     *             number.
+     */
+    public JSONArray put(int index, Object value) throws JSONException {
+        JSONObject.testValidity(value);
+        if (index < 0) {
+            throw new JSONException("JSONArray[" + index + "] not found.");
+        }
+        if (index < this.length()) {
+            this.myArrayList.set(index, value);
+        	if (value instanceof JSONObject) {
+        		((JSONObject)value).parent = null;
+        	}
+        	if (value instanceof JSONArray) {
+        		((JSONArray)value).parent = null;
+        	}
+
+        } else {
+            while (index != this.length()) {
+                this.put(JSONObject.NULL);
+            }
+            this.put(value);
+        }
+        return this;
+    }
+
+    /**
+     * Remove an index and close the hole.
+     *
+     * @param index
+     *            The index of the element to be removed.
+     * @return The value that was associated with the index, or null if there
+     *         was no value.
+     */
+    public Object remove(int index) {
+        Object o = this.opt(index);
+        this.myArrayList.remove(index);
+    	if (o instanceof JSONObject) {
+    		((JSONObject)o).parent = null;
+    	}
+    	if (o instanceof JSONArray) {
+    		((JSONArray)o).parent = null;
+    	}
+        return o;
+    }
+
+    /**
+     * Produce a JSONObject by combining a JSONArray of names with the values of
+     * this JSONArray.
+     *
+     * @param names
+     *            A JSONArray containing a list of key strings. These will be
+     *            paired with the values.
+     * @return A JSONObject, or null if there are no names or if this JSONArray
+     *         has no values.
+     * @throws JSONException
+     *             If any of the names are null.
+     */
+    public JSONObject toJSONObject(JSONArray names) throws JSONException {
+        if (names == null || names.length() == 0 || this.length() == 0) {
+            return null;
+        }
+        JSONObject jo = new JSONObject();
+        for (int i = 0; i < names.length(); i += 1) {
+            jo.put(names.getString(i), this.opt(i));
+        }
+        return jo;
+    }
+
+    /**
+     * Make a JSON text of this JSONArray. For compactness, no unnecessary
+     * whitespace is added. If it is not possible to produce a syntactically
+     * correct JSON text then null will be returned instead. This could occur if
+     * the array contains an invalid number.
+     * <p>
+     * Warning: This method assumes that the data structure is acyclical.
+     *
+     * @return a printable, displayable, transmittable representation of the
+     *         array.
+     */
+    public String toString() {
+        try {
+            return this.toString(0);
+        } catch (Exception e) {
+            return null;
+        }
+    }
+
+    /**
+     * Make a prettyprinted JSON text of this JSONArray. Warning: This method
+     * assumes that the data structure is acyclical.
+     *
+     * @param indentFactor
+     *            The number of spaces to add to each level of indentation.
+     * @return a printable, displayable, transmittable representation of the
+     *         object, beginning with <code>[</code> <small>(left
+     *         bracket)</small> and ending with <code>]</code>
+     *          <small>(right bracket)</small>.
+     * @throws JSONException
+     */
+    public String toString(int indentFactor) throws JSONException {
+        StringWriter sw = new StringWriter();
+        synchronized (sw.getBuffer()) {
+            return this.write(sw, indentFactor, 0).toString();
+        }
+    }
+
+    /**
+     * Write the contents of the JSONArray as JSON text to a writer. For
+     * compactness, no whitespace is added.
+     * <p>
+     * Warning: This method assumes that the data structure is acyclical.
+     *
+     * @return The writer.
+     * @throws JSONException
+     */
+    public Writer write(Writer writer) throws JSONException {
+        return this.write(writer, 0, 0);
+    }
+
+    /**
+     * Write the contents of the JSONArray as JSON text to a writer. For
+     * compactness, no whitespace is added.
+     * <p>
+     * Warning: This method assumes that the data structure is acyclical.
+     *
+     * @param indentFactor
+     *            The number of spaces to add to each level of indentation.
+     * @param indent
+     *            The indention of the top level.
+     * @return The writer.
+     * @throws JSONException
+     */
+    Writer write(Writer writer, int indentFactor, int indent)
+            throws JSONException {
+        try {
+            boolean commanate = false;
+            int length = this.length();
+            writer.write('[');
+
+            if (length == 1) {
+                JSONObject.writeValue(writer, this.myArrayList.get(0),
+                        indentFactor, indent);
+            } else if (length != 0) {
+                final int newindent = indent + indentFactor;
+
+                for (int i = 0; i < length; i += 1) {
+                    if (commanate) {
+                        writer.write(',');
+                    }
+                    if (indentFactor > 0) {
+                        writer.write('\n');
+                    }
+                    JSONObject.indent(writer, newindent);
+                    JSONObject.writeValue(writer, this.myArrayList.get(i),
+                            indentFactor, newindent);
+                    commanate = true;
+                }
+                if (indentFactor > 0) {
+                    writer.write('\n');
+                }
+                JSONObject.indent(writer, indent);
+            }
+            writer.write(']');
+            return writer;
+        } catch (IOException e) {
+            throw new JSONException(e);
+        }
+    }
+}
diff --git a/src/org/json/JSONException.java b/src/org/json/JSONException.java
new file mode 100755
index 0000000..971547e
--- /dev/null
+++ b/src/org/json/JSONException.java
@@ -0,0 +1,41 @@
+package org.json;
+
+/**
+ * The JSONException is thrown by the JSON.org classes when things are amiss.
+ *
+ * @author JSON.org
+ * @version 2013-02-10
+ */
+public class JSONException extends RuntimeException {
+    private static final long serialVersionUID = 0;
+    private Throwable cause;
+
+    /**
+     * Constructs a JSONException with an explanatory message.
+     *
+     * @param message
+     *            Detail about the reason for the exception.
+     */
+    public JSONException(String message) {
+        super(message);
+    }
+
+    /**
+     * Constructs a new JSONException with the specified cause.
+     */
+    public JSONException(Throwable cause) {
+        super(cause.getMessage());
+        this.cause = cause;
+    }
+
+    /**
+     * Returns the cause of this exception or null if the cause is nonexistent
+     * or unknown.
+     *
+     * @returns the cause of this exception or null if the cause is nonexistent
+     *          or unknown.
+     */
+    public Throwable getCause() {
+        return this.cause;
+    }
+}
diff --git a/src/org/json/JSONML.java b/src/org/json/JSONML.java
new file mode 100755
index 0000000..4be6863
--- /dev/null
+++ b/src/org/json/JSONML.java
@@ -0,0 +1,467 @@
+package org.json;
+
+/*
+Copyright (c) 2008 JSON.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+The Software shall be used for Good, not Evil.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+import java.util.Iterator;
+
+
+/**
+ * This provides static methods to convert an XML text into a JSONArray or
+ * JSONObject, and to covert a JSONArray or JSONObject into an XML text using
+ * the JsonML transform.
+ *
+ * @author JSON.org
+ * @version 2012-03-28
+ */
+public class JSONML {
+
+    /**
+     * Parse XML values and store them in a JSONArray.
+     * @param x       The XMLTokener containing the source string.
+     * @param arrayForm true if array form, false if object form.
+     * @param ja      The JSONArray that is containing the current tag or null
+     *     if we are at the outermost level.
+     * @return A JSONArray if the value is the outermost tag, otherwise null.
+     * @throws JSONException
+     */
+    private static Object parse(
+        XMLTokener x,
+        boolean    arrayForm,
+        JSONArray  ja
+    ) throws JSONException {
+        String     attribute;
+        char       c;
+        String       closeTag = null;
+        int        i;
+        JSONArray  newja = null;
+        JSONObject newjo = null;
+        Object     token;
+        String       tagName = null;
+
+// Test for and skip past these forms:
+//      <!-- ... -->
+//      <![  ... ]]>
+//      <!   ...   >
+//      <?   ...  ?>
+
+        while (true) {
+            if (!x.more()) {
+                throw x.syntaxError("Bad XML");
+            }
+            token = x.nextContent();
+            if (token == XML.LT) {
+                token = x.nextToken();
+                if (token instanceof Character) {
+                    if (token == XML.SLASH) {
+
+// Close tag </
+
+                        token = x.nextToken();
+                        if (!(token instanceof String)) {
+                            throw new JSONException(
+                                    "Expected a closing name instead of '" +
+                                    token + "'.");
+                        }
+                        if (x.nextToken() != XML.GT) {
+                            throw x.syntaxError("Misshaped close tag");
+                        }
+                        return token;
+                    } else if (token == XML.BANG) {
+
+// <!
+
+                        c = x.next();
+                        if (c == '-') {
+                            if (x.next() == '-') {
+                                x.skipPast("-->");
+                            } else {
+                                x.back();
+                            }
+                        } else if (c == '[') {
+                            token = x.nextToken();
+                            if (token.equals("CDATA") && x.next() == '[') {
+                                if (ja != null) {
+                                    ja.put(x.nextCDATA());
+                                }
+                            } else {
+                                throw x.syntaxError("Expected 'CDATA['");
+                            }
+                        } else {
+                            i = 1;
+                            do {
+                                token = x.nextMeta();
+                                if (token == null) {
+                                    throw x.syntaxError("Missing '>' after '<!'.");
+                                } else if (token == XML.LT) {
+                                    i += 1;
+                                } else if (token == XML.GT) {
+                                    i -= 1;
+                                }
+                            } while (i > 0);
+                        }
+                    } else if (token == XML.QUEST) {
+
+// <?
+
+                        x.skipPast("?>");
+                    } else {
+                        throw x.syntaxError("Misshaped tag");
+                    }
+
+// Open tag <
+
+                } else {
+                    if (!(token instanceof String)) {
+                        throw x.syntaxError("Bad tagName '" + token + "'.");
+                    }
+                    tagName = (String)token;
+                    newja = new JSONArray();
+                    newjo = new JSONObject();
+                    if (arrayForm) {
+                        newja.put(tagName);
+                        if (ja != null) {
+                            ja.put(newja);
+                        }
+                    } else {
+                        newjo.put("tagName", tagName);
+                        if (ja != null) {
+                            ja.put(newjo);
+                        }
+                    }
+                    token = null;
+                    for (;;) {
+                        if (token == null) {
+                            token = x.nextToken();
+                        }
+                        if (token == null) {
+                            throw x.syntaxError("Misshaped tag");
+                        }
+                        if (!(token instanceof String)) {
+                            break;
+                        }
+
+// attribute = value
+
+                        attribute = (String)token;
+                        if (!arrayForm && ("tagName".equals(attribute) || "childNode".equals(attribute))) {
+                            throw x.syntaxError("Reserved attribute.");
+                        }
+                        token = x.nextToken();
+                        if (token == XML.EQ) {
+                            token = x.nextToken();
+                            if (!(token instanceof String)) {
+                                throw x.syntaxError("Missing value");
+                            }
+                            newjo.accumulate(attribute, XML.stringToValue((String)token));
+                            token = null;
+                        } else {
+                            newjo.accumulate(attribute, "");
+                        }
+                    }
+                    if (arrayForm && newjo.length() > 0) {
+                        newja.put(newjo);
+                    }
+
+// Empty tag <.../>
+
+                    if (token == XML.SLASH) {
+                        if (x.nextToken() != XML.GT) {
+                            throw x.syntaxError("Misshaped tag");
+                        }
+                        if (ja == null) {
+                            if (arrayForm) {
+                                return newja;
+                            } else {
+                                return newjo;
+                            }
+                        }
+
+// Content, between <...> and </...>
+
+                    } else {
+                        if (token != XML.GT) {
+                            throw x.syntaxError("Misshaped tag");
+                        }
+                        closeTag = (String)parse(x, arrayForm, newja);
+                        if (closeTag != null) {
+                            if (!closeTag.equals(tagName)) {
+                                throw x.syntaxError("Mismatched '" + tagName +
+                                        "' and '" + closeTag + "'");
+                            }
+                            tagName = null;
+                            if (!arrayForm && newja.length() > 0) {
+                                newjo.put("childNodes", newja);
+                            }
+                            if (ja == null) {
+                                if (arrayForm) {
+                                    return newja;
+                                } else {
+                                    return newjo;
+                                }
+                            }
+                        }
+                    }
+                }
+            } else {
+                if (ja != null) {
+                    ja.put(token instanceof String
+                        ? XML.stringToValue((String)token)
+                        : token);
+                }
+            }
+        }
+    }
+
+
+    /**
+     * Convert a well-formed (but not necessarily valid) XML string into a
+     * JSONArray using the JsonML transform. Each XML tag is represented as
+     * a JSONArray in which the first element is the tag name. If the tag has
+     * attributes, then the second element will be JSONObject containing the
+     * name/value pairs. If the tag contains children, then strings and
+     * JSONArrays will represent the child tags.
+     * Comments, prologs, DTDs, and <code><[ [ ]]></code> are ignored.
+     * @param string The source string.
+     * @return A JSONArray containing the structured data from the XML string.
+     * @throws JSONException
+     */
+    public static JSONArray toJSONArray(String string) throws JSONException {
+        return toJSONArray(new XMLTokener(string));
+    }
+
+
+    /**
+     * Convert a well-formed (but not necessarily valid) XML string into a
+     * JSONArray using the JsonML transform. Each XML tag is represented as
+     * a JSONArray in which the first element is the tag name. If the tag has
+     * attributes, then the second element will be JSONObject containing the
+     * name/value pairs. If the tag contains children, then strings and
+     * JSONArrays will represent the child content and tags.
+     * Comments, prologs, DTDs, and <code><[ [ ]]></code> are ignored.
+     * @param x An XMLTokener.
+     * @return A JSONArray containing the structured data from the XML string.
+     * @throws JSONException
+     */
+    public static JSONArray toJSONArray(XMLTokener x) throws JSONException {
+        return (JSONArray)parse(x, true, null);
+    }
+
+
+    /**
+     * Convert a well-formed (but not necessarily valid) XML string into a
+     * JSONObject using the JsonML transform. Each XML tag is represented as
+     * a JSONObject with a "tagName" property. If the tag has attributes, then
+     * the attributes will be in the JSONObject as properties. If the tag
+     * contains children, the object will have a "childNodes" property which
+     * will be an array of strings and JsonML JSONObjects.
+
+     * Comments, prologs, DTDs, and <code><[ [ ]]></code> are ignored.
+     * @param x An XMLTokener of the XML source text.
+     * @return A JSONObject containing the structured data from the XML string.
+     * @throws JSONException
+     */
+    public static JSONObject toJSONObject(XMLTokener x) throws JSONException {
+           return (JSONObject)parse(x, false, null);
+    }
+
+
+    /**
+     * Convert a well-formed (but not necessarily valid) XML string into a
+     * JSONObject using the JsonML transform. Each XML tag is represented as
+     * a JSONObject with a "tagName" property. If the tag has attributes, then
+     * the attributes will be in the JSONObject as properties. If the tag
+     * contains children, the object will have a "childNodes" property which
+     * will be an array of strings and JsonML JSONObjects.
+
+     * Comments, prologs, DTDs, and <code><[ [ ]]></code> are ignored.
+     * @param string The XML source text.
+     * @return A JSONObject containing the structured data from the XML string.
+     * @throws JSONException
+     */
+    public static JSONObject toJSONObject(String string) throws JSONException {
+        return toJSONObject(new XMLTokener(string));
+    }
+
+
+    /**
+     * Reverse the JSONML transformation, making an XML text from a JSONArray.
+     * @param ja A JSONArray.
+     * @return An XML string.
+     * @throws JSONException
+     */
+    public static String toString(JSONArray ja) throws JSONException {
+        int             i;
+        JSONObject   jo;
+        String       key;
+        Iterator     keys;
+        int             length;
+        Object         object;
+        StringBuffer sb = new StringBuffer();
+        String       tagName;
+        String       value;
+
+// Emit <tagName
+
+        tagName = ja.getString(0);
+        XML.noSpace(tagName);
+        tagName = XML.escape(tagName);
+        sb.append('<');
+        sb.append(tagName);
+
+        object = ja.opt(1);
+        if (object instanceof JSONObject) {
+            i = 2;
+            jo = (JSONObject)object;
+
+// Emit the attributes
+
+            keys = jo.keys();
+            while (keys.hasNext()) {
+                key = keys.next().toString();
+                XML.noSpace(key);
+                value = jo.optString(key);
+                if (value != null) {
+                    sb.append(' ');
+                    sb.append(XML.escape(key));
+                    sb.append('=');
+                    sb.append('"');
+                    sb.append(XML.escape(value));
+                    sb.append('"');
+                }
+            }
+        } else {
+            i = 1;
+        }
+
+//Emit content in body
+
+        length = ja.length();
+        if (i >= length) {
+            sb.append('/');
+            sb.append('>');
+        } else {
+            sb.append('>');
+            do {
+                object = ja.get(i);
+                i += 1;
+                if (object != null) {
+                    if (object instanceof String) {
+                        sb.append(XML.escape(object.toString()));
+                    } else if (object instanceof JSONObject) {
+                        sb.append(toString((JSONObject)object));
+                    } else if (object instanceof JSONArray) {
+                        sb.append(toString((JSONArray)object));
+                    }
+                }
+            } while (i < length);
+            sb.append('<');
+            sb.append('/');
+            sb.append(tagName);
+            sb.append('>');
+        }
+        return sb.toString();
+    }
+
+    /**
+     * Reverse the JSONML transformation, making an XML text from a JSONObject.
+     * The JSONObject must contain a "tagName" property. If it has children,
+     * then it must have a "childNodes" property containing an array of objects.
+     * The other properties are attributes with string values.
+     * @param jo A JSONObject.
+     * @return An XML string.
+     * @throws JSONException
+     */
+    public static String toString(JSONObject jo) throws JSONException {
+        StringBuffer sb = new StringBuffer();
+        int          i;
+        JSONArray    ja;
+        String       key;
+        Iterator     keys;
+        int          length;
+        Object         object;
+        String       tagName;
+        String       value;
+
+//Emit <tagName
+
+        tagName = jo.optString("tagName");
+        if (tagName == null) {
+            return XML.escape(jo.toString());
+        }
+        XML.noSpace(tagName);
+        tagName = XML.escape(tagName);
+        sb.append('<');
+        sb.append(tagName);
+
+//Emit the attributes
+
+        keys = jo.keys();
+        while (keys.hasNext()) {
+            key = keys.next().toString();
+            if (!"tagName".equals(key) && !"childNodes".equals(key)) {
+                XML.noSpace(key);
+                value = jo.optString(key);
+                if (value != null) {
+                    sb.append(' ');
+                    sb.append(XML.escape(key));
+                    sb.append('=');
+                    sb.append('"');
+                    sb.append(XML.escape(value));
+                    sb.append('"');
+                }
+            }
+        }
+
+//Emit content in body
+
+        ja = jo.optJSONArray("childNodes");
+        if (ja == null) {
+            sb.append('/');
+            sb.append('>');
+        } else {
+            sb.append('>');
+            length = ja.length();
+            for (i = 0; i < length; i += 1) {
+                object = ja.get(i);
+                if (object != null) {
+                    if (object instanceof String) {
+                        sb.append(XML.escape(object.toString()));
+                    } else if (object instanceof JSONObject) {
+                        sb.append(toString((JSONObject)object));
+                    } else if (object instanceof JSONArray) {
+                        sb.append(toString((JSONArray)object));
+                    } else {
+                        sb.append(object.toString());
+                    }
+                }
+            }
+            sb.append('<');
+            sb.append('/');
+            sb.append(tagName);
+            sb.append('>');
+        }
+        return sb.toString();
+    }
+}
diff --git a/src/org/json/JSONObject.java b/src/org/json/JSONObject.java
new file mode 100755
index 0000000..929a34d
--- /dev/null
+++ b/src/org/json/JSONObject.java
@@ -0,0 +1,1665 @@
+package org.json;
+
+/*
+ Copyright (c) 2002 JSON.org
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ The Software shall be used for Good, not Evil.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+ */
+
+import java.io.IOException;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.Collection;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.ResourceBundle;
+import java.util.Set;
+
+/**
+ * A JSONObject is an unordered collection of name/value pairs. Its external
+ * form is a string wrapped in curly braces with colons between the names and
+ * values, and commas between the values and names. The internal form is an
+ * object having <code>get</code> and <code>opt</code> methods for accessing
+ * the values by name, and <code>put</code> methods for adding or replacing
+ * values by name. The values can be any of these types: <code>Boolean</code>,
+ * <code>JSONArray</code>, <code>JSONObject</code>, <code>Number</code>,
+ * <code>String</code>, or the <code>JSONObject.NULL</code> object. A
+ * JSONObject constructor can be used to convert an external form JSON text
+ * into an internal form whose values can be retrieved with the
+ * <code>get</code> and <code>opt</code> methods, or to convert values into a
+ * JSON text using the <code>put</code> and <code>toString</code> methods. A
+ * <code>get</code> method returns a value if one can be found, and throws an
+ * exception if one cannot be found. An <code>opt</code> method returns a
+ * default value instead of throwing an exception, and so is useful for
+ * obtaining optional values.
+ * <p>
+ * The generic <code>get()</code> and <code>opt()</code> methods return an
+ * object, which you can cast or query for type. There are also typed
+ * <code>get</code> and <code>opt</code> methods that do type checking and type
+ * coercion for you. The opt methods differ from the get methods in that they
+ * do not throw. Instead, they return a specified value, such as null.
+ * <p>
+ * The <code>put</code> methods add or replace values in an object. For
+ * example,
+ *
+ * <pre>
+ * myString = new JSONObject()
+ *         .put("JSON", "Hello, World!").toString();
+ * </pre>
+ *
+ * produces the string <code>{"JSON": "Hello, World"}</code>.
+ * <p>
+ * The texts produced by the <code>toString</code> methods strictly conform to
+ * the JSON syntax rules. The constructors are more forgiving in the texts they
+ * will accept:
+ * <ul>
+ * <li>An extra <code>,</code> <small>(comma)</small> may appear just
+ * before the closing brace.</li>
+ * <li>Strings may be quoted with <code>'</code> <small>(single
+ * quote)</small>.</li>
+ * <li>Strings do not need to be quoted at all if they do not begin with a
+ * quote or single quote, and if they do not contain leading or trailing
+ * spaces, and if they do not contain any of these characters:
+ * <code>{ } [ ] / \ : , #</code> and if they do not look like numbers and
+ * if they are not the reserved words <code>true</code>, <code>false</code>,
+ * or <code>null</code>.</li>
+ * </ul>
+ *
+ * @author JSON.org
+ * @version 2013-06-17
+ */
+public class JSONObject {
+    /**
+     * JSONObject.NULL is equivalent to the value that JavaScript calls null,
+     * whilst Java's null is equivalent to the value that JavaScript calls
+     * undefined.
+     */
+    private static final class Null {
+
+        /**
+         * There is only intended to be a single instance of the NULL object,
+         * so the clone method returns itself.
+         *
+         * @return NULL.
+         */
+        protected final Object clone() {
+            return this;
+        }
+
+        /**
+         * A Null object is equal to the null value and to itself.
+         *
+         * @param object
+         *            An object to test for nullness.
+         * @return true if the object parameter is the JSONObject.NULL object or
+         *         null.
+         */
+        public boolean equals(Object object) {
+            return object == null || object == this;
+        }
+
+        /**
+         * Get the "null" string value.
+         *
+         * @return The string "null".
+         */
+        public String toString() {
+            return "null";
+        }
+    }
+
+    /**
+     * The map where the JSONObject's properties are kept.
+     */
+    private final Map<String, Object> map;
+    
+    protected Object parent = null;
+    
+    public Object getParent() {
+    	return parent;
+    }
+
+    /**
+     * It is sometimes more convenient and less ambiguous to have a
+     * <code>NULL</code> object than to use Java's <code>null</code> value.
+     * <code>JSONObject.NULL.equals(null)</code> returns <code>true</code>.
+     * <code>JSONObject.NULL.toString()</code> returns <code>"null"</code>.
+     */
+    public static final Object NULL = new Null();
+
+    /**
+     * Construct an empty JSONObject.
+     */
+    public JSONObject() {
+        this.map = new HashMap<String, Object>();
+    }
+
+    /**
+     * Construct a JSONObject from a subset of another JSONObject. An array of
+     * strings is used to identify the keys that should be copied. Missing keys
+     * are ignored.
+     *
+     * @param jo
+     *            A JSONObject.
+     * @param names
+     *            An array of strings.
+     * @throws JSONException
+     * @exception JSONException
+     *                If a value is a non-finite number or if a name is
+     *                duplicated.
+     */
+    public JSONObject(JSONObject jo, String[] names) {
+        this();
+        for (int i = 0; i < names.length; i += 1) {
+            try {
+                this.putOnce(names[i], jo.opt(names[i]));
+            } catch (Exception ignore) {
+            }
+        }
+    }
+
+    /**
+     * Construct a JSONObject from a JSONTokener.
+     *
+     * @param x
+     *            A JSONTokener object containing the source string.
+     * @throws JSONException
+     *             If there is a syntax error in the source string or a
+     *             duplicated key.
+     */
+    public JSONObject(JSONTokener x) throws JSONException {
+        this();
+        char c;
+        String key;
+
+        if (x.nextClean() != '{') {
+            throw x.syntaxError("A JSONObject text must begin with '{'");
+        }
+        for (;;) {
+            c = x.nextClean();
+            switch (c) {
+            case 0:
+                throw x.syntaxError("A JSONObject text must end with '}'");
+            case '}':
+                return;
+            default:
+                x.back();
+                key = x.nextValue().toString();
+            }
+
+// The key is followed by ':'.
+
+            c = x.nextClean();
+            if (c != ':') {
+                throw x.syntaxError("Expected a ':' after a key");
+            }
+            this.putOnce(key, x.nextValue());
+
+// Pairs are separated by ','.
+
+            switch (x.nextClean()) {
+            case ';':
+            case ',':
+                if (x.nextClean() == '}') {
+                    return;
+                }
+                x.back();
+                break;
+            case '}':
+                return;
+            default:
+                throw x.syntaxError("Expected a ',' or '}'");
+            }
+        }
+    }
+
+    /**
+     * Construct a JSONObject from a Map.
+     *
+     * @param map
+     *            A map object that can be used to initialize the contents of
+     *            the JSONObject.
+     * @throws JSONException
+     */
+    public JSONObject(Map<String, Object> map) {
+        this.map = new HashMap<String, Object>();
+        if (map != null) {
+            Iterator<Entry<String, Object>> i = map.entrySet().iterator();
+            while (i.hasNext()) {
+                Map.Entry<String,Object> e = (Map.Entry<String,Object>) i.next();
+                Object value = e.getValue();
+                if (value != null) {
+                    _put((String) e.getKey(), wrap(value));
+                }
+            }
+        }
+    }
+
+    private void _put(String key, Object o) {
+        this.map.put(key, o);
+        if (o instanceof JSONObject) {
+        	((JSONObject) o).parent = this;
+        }
+        if (o instanceof JSONArray) {
+        	((JSONArray) o).parent = this;
+        }
+    }
+    
+    /**
+     * Construct a JSONObject from an Object using bean getters. It reflects on
+     * all of the public methods of the object. For each of the methods with no
+     * parameters and a name starting with <code>"get"</code> or
+     * <code>"is"</code> followed by an uppercase letter, the method is invoked,
+     * and a key and the value returned from the getter method are put into the
+     * new JSONObject.
+     *
+     * The key is formed by removing the <code>"get"</code> or <code>"is"</code>
+     * prefix. If the second remaining character is not upper case, then the
+     * first character is converted to lower case.
+     *
+     * For example, if an object has a method named <code>"getName"</code>, and
+     * if the result of calling <code>object.getName()</code> is
+     * <code>"Larry Fine"</code>, then the JSONObject will contain
+     * <code>"name": "Larry Fine"</code>.
+     *
+     * @param bean
+     *            An object that has getter methods that should be used to make
+     *            a JSONObject.
+     */
+    public JSONObject(Object bean) {
+        this();
+        this.populateMap(bean);
+    }
+
+    /**
+     * Construct a JSONObject from an Object, using reflection to find the
+     * public members. The resulting JSONObject's keys will be the strings from
+     * the names array, and the values will be the field values associated with
+     * those keys in the object. If a key is not found or not visible, then it
+     * will not be copied into the new JSONObject.
+     *
+     * @param object
+     *            An object that has fields that should be used to make a
+     *            JSONObject.
+     * @param names
+     *            An array of strings, the names of the fields to be obtained
+     *            from the object.
+     */
+    public JSONObject(Object object, String names[]) {
+        this();
+        Class c = object.getClass();
+        for (int i = 0; i < names.length; i += 1) {
+            String name = names[i];
+            try {
+                this.putOpt(name, c.getField(name).get(object));
+            } catch (Exception ignore) {
+            }
+        }
+    }
+
+    /**
+     * Construct a JSONObject from a source JSON text string. This is the most
+     * commonly used JSONObject constructor.
+     *
+     * @param source
+     *            A string beginning with <code>{</code> <small>(left
+     *            brace)</small> and ending with <code>}</code>
+     *             <small>(right brace)</small>.
+     * @exception JSONException
+     *                If there is a syntax error in the source string or a
+     *                duplicated key.
+     */
+    public JSONObject(String source) throws JSONException {
+        this(new JSONTokener(source));
+    }
+
+    /**
+     * Construct a JSONObject from a ResourceBundle.
+     *
+     * @param baseName
+     *            The ResourceBundle base name.
+     * @param locale
+     *            The Locale to load the ResourceBundle for.
+     * @throws JSONException
+     *             If any JSONExceptions are detected.
+     */
+    public JSONObject(String baseName, Locale locale) throws JSONException {
+        this();
+        ResourceBundle bundle = ResourceBundle.getBundle(baseName, locale,
+                Thread.currentThread().getContextClassLoader());
+
+// Iterate through the keys in the bundle.
+
+        Enumeration keys = bundle.getKeys();
+        while (keys.hasMoreElements()) {
+            Object key = keys.nextElement();
+            if (key instanceof String) {
+
+// Go through the path, ensuring that there is a nested JSONObject for each
+// segment except the last. Add the value using the last segment's name into
+// the deepest nested JSONObject.
+
+                String[] path = ((String) key).split("\\.");
+                int last = path.length - 1;
+                JSONObject target = this;
+                for (int i = 0; i < last; i += 1) {
+                    String segment = path[i];
+                    JSONObject nextTarget = target.optJSONObject(segment);
+                    if (nextTarget == null) {
+                        nextTarget = new JSONObject();
+                        target.put(segment, nextTarget);
+                    }
+                    target = nextTarget;
+                }
+                target.put(path[last], bundle.getString((String) key));
+            }
+        }
+    }
+
+    /**
+     * Accumulate values under a key. It is similar to the put method except
+     * that if there is already an object stored under the key then a JSONArray
+     * is stored under the key to hold all of the accumulated values. If there
+     * is already a JSONArray, then the new value is appended to it. In
+     * contrast, the put method replaces the previous value.
+     *
+     * If only one value is accumulated that is not a JSONArray, then the result
+     * will be the same as using put. But if multiple values are accumulated,
+     * then the result will be like append.
+     *
+     * @param key
+     *            A key string.
+     * @param value
+     *            An object to be accumulated under the key.
+     * @return this.
+     * @throws JSONException
+     *             If the value is an invalid number or if the key is null.
+     */
+    public JSONObject accumulate(String key, Object value) throws JSONException {
+        testValidity(value);
+        Object object = this.opt(key);
+        if (object == null) {
+            this.put(key,
+                    value instanceof JSONArray ? new JSONArray().put(value)
+                            : value);
+        } else if (object instanceof JSONArray) {
+            ((JSONArray) object).put(value);
+        } else {
+            this.put(key, new JSONArray().put(object).put(value));
+        }
+        return this;
+    }
+
+    /**
+     * Append values to the array under a key. If the key does not exist in the
+     * JSONObject, then the key is put in the JSONObject with its value being a
+     * JSONArray containing the value parameter. If the key was already
+     * associated with a JSONArray, then the value parameter is appended to it.
+     *
+     * @param key
+     *            A key string.
+     * @param value
+     *            An object to be accumulated under the key.
+     * @return this.
+     * @throws JSONException
+     *             If the key is null or if the current value associated with
+     *             the key is not a JSONArray.
+     */
+    public JSONObject append(String key, Object value) throws JSONException {
+        testValidity(value);
+        Object object = this.opt(key);
+        if (object == null) {
+            this.put(key, new JSONArray().put(value));
+        } else if (object instanceof JSONArray) {
+            this.put(key, ((JSONArray) object).put(value));
+        } else {
+            throw new JSONException("JSONObject[" + key
+                    + "] is not a JSONArray.");
+        }
+        return this;
+    }
+
+    /**
+     * Produce a string from a double. The string "null" will be returned if the
+     * number is not finite.
+     *
+     * @param d
+     *            A double.
+     * @return A String.
+     */
+    public static String doubleToString(double d) {
+        if (Double.isInfinite(d) || Double.isNaN(d)) {
+            return "null";
+        }
+
+// Shave off trailing zeros and decimal point, if possible.
+
+        String string = Double.toString(d);
+        if (string.indexOf('.') > 0 && string.indexOf('e') < 0
+                && string.indexOf('E') < 0) {
+            while (string.endsWith("0")) {
+                string = string.substring(0, string.length() - 1);
+            }
+            if (string.endsWith(".")) {
+                string = string.substring(0, string.length() - 1);
+            }
+        }
+        return string;
+    }
+
+    /**
+     * Get the value object associated with a key.
+     *
+     * @param key
+     *            A key string.
+     * @return The object associated with the key.
+     * @throws JSONException
+     *             if the key is not found.
+     */
+    public Object get(String key) throws JSONException {
+        if (key == null) {
+            throw new JSONException("Null key.");
+        }
+        Object object = this.opt(key);
+        if (object == null) {
+            throw new JSONException("JSONObject[" + quote(key) + "] not found.");
+        }
+        return object;
+    }
+
+    /**
+     * Get the boolean value associated with a key.
+     *
+     * @param key
+     *            A key string.
+     * @return The truth.
+     * @throws JSONException
+     *             if the value is not a Boolean or the String "true" or
+     *             "false".
+     */
+    public boolean getBoolean(String key) throws JSONException {
+        Object object = this.get(key);
+        if (object.equals(Boolean.FALSE)
+                || (object instanceof String && ((String) object)
+                        .equalsIgnoreCase("false"))) {
+            return false;
+        } else if (object.equals(Boolean.TRUE)
+                || (object instanceof String && ((String) object)
+                        .equalsIgnoreCase("true"))) {
+            return true;
+        }
+        throw new JSONException("JSONObject[" + quote(key)
+                + "] is not a Boolean.");
+    }
+
+    /**
+     * Get the double value associated with a key.
+     *
+     * @param key
+     *            A key string.
+     * @return The numeric value.
+     * @throws JSONException
+     *             if the key is not found or if the value is not a Number
+     *             object and cannot be converted to a number.
+     */
+    public double getDouble(String key) throws JSONException {
+        Object object = this.get(key);
+        try {
+            return object instanceof Number ? ((Number) object).doubleValue()
+                    : Double.parseDouble((String) object);
+        } catch (Exception e) {
+            throw new JSONException("JSONObject[" + quote(key)
+                    + "] is not a number.");
+        }
+    }
+
+    /**
+     * Get the int value associated with a key.
+     *
+     * @param key
+     *            A key string.
+     * @return The integer value.
+     * @throws JSONException
+     *             if the key is not found or if the value cannot be converted
+     *             to an integer.
+     */
+    public int getInt(String key) throws JSONException {
+        Object object = this.get(key);
+        try {
+            return object instanceof Number ? ((Number) object).intValue()
+                    : Integer.parseInt((String) object);
+        } catch (Exception e) {
+            throw new JSONException("JSONObject[" + quote(key)
+                    + "] is not an int.");
+        }
+    }
+
+    /**
+     * Get the JSONArray value associated with a key.
+     *
+     * @param key
+     *            A key string.
+     * @return A JSONArray which is the value.
+     * @throws JSONException
+     *             if the key is not found or if the value is not a JSONArray.
+     */
+    public JSONArray getJSONArray(String key) throws JSONException {
+        Object object = this.get(key);
+        if (object instanceof JSONArray) {
+            return (JSONArray) object;
+        }
+        throw new JSONException("JSONObject[" + quote(key)
+                + "] is not a JSONArray.");
+    }
+
+    /**
+     * Get the JSONObject value associated with a key.
+     *
+     * @param key
+     *            A key string.
+     * @return A JSONObject which is the value.
+     * @throws JSONException
+     *             if the key is not found or if the value is not a JSONObject.
+     */
+    public JSONObject getJSONObject(String key) throws JSONException {
+        Object object = this.get(key);
+        if (object instanceof JSONObject) {
+            return (JSONObject) object;
+        }
+        throw new JSONException("JSONObject[" + quote(key)
+                + "] is not a JSONObject.");
+    }
+
+    /**
+     * Get the long value associated with a key.
+     *
+     * @param key
+     *            A key string.
+     * @return The long value.
+     * @throws JSONException
+     *             if the key is not found or if the value cannot be converted
+     *             to a long.
+     */
+    public long getLong(String key) throws JSONException {
+        Object object = this.get(key);
+        try {
+            return object instanceof Number ? ((Number) object).longValue()
+                    : Long.parseLong((String) object);
+        } catch (Exception e) {
+            throw new JSONException("JSONObject[" + quote(key)
+                    + "] is not a long.");
+        }
+    }
+
+    /**
+     * Get an array of field names from a JSONObject.
+     *
+     * @return An array of field names, or null if there are no names.
+     */
+    public static String[] getNames(JSONObject jo) {
+        int length = jo.length();
+        if (length == 0) {
+            return null;
+        }
+        Iterator iterator = jo.keys();
+        String[] names = new String[length];
+        int i = 0;
+        while (iterator.hasNext()) {
+            names[i] = (String) iterator.next();
+            i += 1;
+        }
+        return names;
+    }
+
+    /**
+     * Get an array of field names from an Object.
+     *
+     * @return An array of field names, or null if there are no names.
+     */
+    public static String[] getNames(Object object) {
+        if (object == null) {
+            return null;
+        }
+        Class klass = object.getClass();
+        Field[] fields = klass.getFields();
+        int length = fields.length;
+        if (length == 0) {
+            return null;
+        }
+        String[] names = new String[length];
+        for (int i = 0; i < length; i += 1) {
+            names[i] = fields[i].getName();
+        }
+        return names;
+    }
+
+    /**
+     * Get the string associated with a key.
+     *
+     * @param key
+     *            A key string.
+     * @return A string which is the value.
+     * @throws JSONException
+     *             if there is no string value for the key.
+     */
+    public String getString(String key) throws JSONException {
+        Object object = this.get(key);
+        if (object instanceof String) {
+            return (String) object;
+        }
+        throw new JSONException("JSONObject[" + quote(key) + "] not a string.");
+    }
+
+    /**
+     * Determine if the JSONObject contains a specific key.
+     *
+     * @param key
+     *            A key string.
+     * @return true if the key exists in the JSONObject.
+     */
+    public boolean has(String key) {
+        return this.map.containsKey(key);
+    }
+
+    /**
+     * Increment a property of a JSONObject. If there is no such property,
+     * create one with a value of 1. If there is such a property, and if it is
+     * an Integer, Long, Double, or Float, then add one to it.
+     *
+     * @param key
+     *            A key string.
+     * @return this.
+     * @throws JSONException
+     *             If there is already a property with this name that is not an
+     *             Integer, Long, Double, or Float.
+     */
+    public JSONObject increment(String key) throws JSONException {
+        Object value = this.opt(key);
+        if (value == null) {
+            this.put(key, 1);
+        } else if (value instanceof Integer) {
+            this.put(key, ((Integer) value).intValue() + 1);
+        } else if (value instanceof Long) {
+            this.put(key, ((Long) value).longValue() + 1);
+        } else if (value instanceof Double) {
+            this.put(key, ((Double) value).doubleValue() + 1);
+        } else if (value instanceof Float) {
+            this.put(key, ((Float) value).floatValue() + 1);
+        } else {
+            throw new JSONException("Unable to increment [" + quote(key) + "].");
+        }
+        return this;
+    }
+
+    /**
+     * Determine if the value associated with the key is null or if there is no
+     * value.
+     *
+     * @param key
+     *            A key string.
+     * @return true if there is no value associated with the key or if the value
+     *         is the JSONObject.NULL object.
+     */
+    public boolean isNull(String key) {
+        return JSONObject.NULL.equals(this.opt(key));
+    }
+
+    /**
+     * Get an enumeration of the keys of the JSONObject.
+     *
+     * @return An iterator of the keys.
+     */
+    public Iterator keys() {
+        return this.keySet().iterator();
+    }
+
+    /**
+     * Get a set of keys of the JSONObject.
+     *
+     * @return A keySet.
+     */
+    public Set<String> keySet() {
+        return this.map.keySet();
+    }
+
+    /**
+     * Get the number of keys stored in the JSONObject.
+     *
+     * @return The number of keys in the JSONObject.
+     */
+    public int length() {
+        return this.map.size();
+    }
+
+    /**
+     * Produce a JSONArray containing the names of the elements of this
+     * JSONObject.
+     *
+     * @return A JSONArray containing the key strings, or null if the JSONObject
+     *         is empty.
+     */
+    public JSONArray names() {
+        JSONArray ja = new JSONArray();
+        Iterator keys = this.keys();
+        while (keys.hasNext()) {
+            ja.put(keys.next());
+        }
+        return ja.length() == 0 ? null : ja;
+    }
+
+    /**
+     * Produce a string from a Number.
+     *
+     * @param number
+     *            A Number
+     * @return A String.
+     * @throws JSONException
+     *             If n is a non-finite number.
+     */
+    public static String numberToString(Number number) throws JSONException {
+        if (number == null) {
+            throw new JSONException("Null pointer");
+        }
+        testValidity(number);
+
+// Shave off trailing zeros and decimal point, if possible.
+
+        String string = number.toString();
+        if (string.indexOf('.') > 0 && string.indexOf('e') < 0
+                && string.indexOf('E') < 0) {
+            while (string.endsWith("0")) {
+                string = string.substring(0, string.length() - 1);
+            }
+            if (string.endsWith(".")) {
+                string = string.substring(0, string.length() - 1);
+            }
+        }
+        return string;
+    }
+
+    /**
+     * Get an optional value associated with a key.
+     *
+     * @param key
+     *            A key string.
+     * @return An object which is the value, or null if there is no value.
+     */
+    public Object opt(String key) {
+        return key == null ? null : this.map.get(key);
+    }
+
+    /**
+     * Get an optional boolean associated with a key. It returns false if there
+     * is no such key, or if the value is not Boolean.TRUE or the String "true".
+     *
+     * @param key
+     *            A key string.
+     * @return The truth.
+     */
+    public boolean optBoolean(String key) {
+        return this.optBoolean(key, false);
+    }
+
+    /**
+     * Get an optional boolean associated with a key. It returns the
+     * defaultValue if there is no such key, or if it is not a Boolean or the
+     * String "true" or "false" (case insensitive).
+     *
+     * @param key
+     *            A key string.
+     * @param defaultValue
+     *            The default.
+     * @return The truth.
+     */
+    public boolean optBoolean(String key, boolean defaultValue) {
+        try {
+            return this.getBoolean(key);
+        } catch (Exception e) {
+            return defaultValue;
+        }
+    }
+
+    /**
+     * Get an optional double associated with a key, or NaN if there is no such
+     * key or if its value is not a number. If the value is a string, an attempt
+     * will be made to evaluate it as a number.
+     *
+     * @param key
+     *            A string which is the key.
+     * @return An object which is the value.
+     */
+    public double optDouble(String key) {
+        return this.optDouble(key, Double.NaN);
+    }
+
+    /**
+     * Get an optional double associated with a key, or the defaultValue if
+     * there is no such key or if its value is not a number. If the value is a
+     * string, an attempt will be made to evaluate it as a number.
+     *
+     * @param key
+     *            A key string.
+     * @param defaultValue
+     *            The default.
+     * @return An object which is the value.
+     */
+    public double optDouble(String key, double defaultValue) {
+        try {
+            return this.getDouble(key);
+        } catch (Exception e) {
+            return defaultValue;
+        }
+    }
+
+    /**
+     * Get an optional int value associated with a key, or zero if there is no
+     * such key or if the value is not a number. If the value is a string, an
+     * attempt will be made to evaluate it as a number.
+     *
+     * @param key
+     *            A key string.
+     * @return An object which is the value.
+     */
+    public int optInt(String key) {
+        return this.optInt(key, 0);
+    }
+
+    /**
+     * Get an optional int value associated with a key, or the default if there
+     * is no such key or if the value is not a number. If the value is a string,
+     * an attempt will be made to evaluate it as a number.
+     *
+     * @param key
+     *            A key string.
+     * @param defaultValue
+     *            The default.
+     * @return An object which is the value.
+     */
+    public int optInt(String key, int defaultValue) {
+        try {
+            return this.getInt(key);
+        } catch (Exception e) {
+            return defaultValue;
+        }
+    }
+
+    /**
+     * Get an optional JSONArray associated with a key. It returns null if there
+     * is no such key, or if its value is not a JSONArray.
+     *
+     * @param key
+     *            A key string.
+     * @return A JSONArray which is the value.
+     */
+    public JSONArray optJSONArray(String key) {
+        Object o = this.opt(key);
+        return o instanceof JSONArray ? (JSONArray) o : null;
+    }
+
+    /**
+     * Get an optional JSONObject associated with a key. It returns null if
+     * there is no such key, or if its value is not a JSONObject.
+     *
+     * @param key
+     *            A key string.
+     * @return A JSONObject which is the value.
+     */
+    public JSONObject optJSONObject(String key) {
+        Object object = this.opt(key);
+        return object instanceof JSONObject ? (JSONObject) object : null;
+    }
+
+    /**
+     * Get an optional long value associated with a key, or zero if there is no
+     * such key or if the value is not a number. If the value is a string, an
+     * attempt will be made to evaluate it as a number.
+     *
+     * @param key
+     *            A key string.
+     * @return An object which is the value.
+     */
+    public long optLong(String key) {
+        return this.optLong(key, 0);
+    }
+
+    /**
+     * Get an optional long value associated with a key, or the default if there
+     * is no such key or if the value is not a number. If the value is a string,
+     * an attempt will be made to evaluate it as a number.
+     *
+     * @param key
+     *            A key string.
+     * @param defaultValue
+     *            The default.
+     * @return An object which is the value.
+     */
+    public long optLong(String key, long defaultValue) {
+        try {
+            return this.getLong(key);
+        } catch (Exception e) {
+            return defaultValue;
+        }
+    }
+
+    /**
+     * Get an optional string associated with a key. It returns an empty string
+     * if there is no such key. If the value is not a string and is not null,
+     * then it is converted to a string.
+     *
+     * @param key
+     *            A key string.
+     * @return A string which is the value.
+     */
+    public String optString(String key) {
+        return this.optString(key, "");
+    }
+
+    /**
+     * Get an optional string associated with a key. It returns the defaultValue
+     * if there is no such key.
+     *
+     * @param key
+     *            A key string.
+     * @param defaultValue
+     *            The default.
+     * @return A string which is the value.
+     */
+    public String optString(String key, String defaultValue) {
+        Object object = this.opt(key);
+        return NULL.equals(object) ? defaultValue : object.toString();
+    }
+
+    private void populateMap(Object bean) {
+        Class klass = bean.getClass();
+
+// If klass is a System class then set includeSuperClass to false.
+
+        boolean includeSuperClass = klass.getClassLoader() != null;
+
+        Method[] methods = includeSuperClass ? klass.getMethods() : klass
+                .getDeclaredMethods();
+        for (int i = 0; i < methods.length; i += 1) {
+            try {
+                Method method = methods[i];
+                if (Modifier.isPublic(method.getModifiers())) {
+                    String name = method.getName();
+                    String key = "";
+                    if (name.startsWith("get")) {
+                        if ("getClass".equals(name)
+                                || "getDeclaringClass".equals(name)) {
+                            key = "";
+                        } else {
+                            key = name.substring(3);
+                        }
+                    } else if (name.startsWith("is")) {
+                        key = name.substring(2);
+                    }
+                    if (key.length() > 0
+                            && Character.isUpperCase(key.charAt(0))
+                            && method.getParameterTypes().length == 0) {
+                        if (key.length() == 1) {
+                            key = key.toLowerCase();
+                        } else if (!Character.isUpperCase(key.charAt(1))) {
+                            key = key.substring(0, 1).toLowerCase()
+                                    + key.substring(1);
+                        }
+
+                        Object result = method.invoke(bean, (Object[]) null);
+                        if (result != null) {
+                            _put(key, wrap(result));
+                        }
+                    }
+                }
+            } catch (Exception ignore) {
+            }
+        }
+    }
+
+    /**
+     * Put a key/boolean pair in the JSONObject.
+     *
+     * @param key
+     *            A key string.
+     * @param value
+     *            A boolean which is the value.
+     * @return this.
+     * @throws JSONException
+     *             If the key is null.
+     */
+    public JSONObject put(String key, boolean value) throws JSONException {
+        this.put(key, value ? Boolean.TRUE : Boolean.FALSE);
+        return this;
+    }
+
+    /**
+     * Put a key/value pair in the JSONObject, where the value will be a
+     * JSONArray which is produced from a Collection.
+     *
+     * @param key
+     *            A key string.
+     * @param value
+     *            A Collection value.
+     * @return this.
+     * @throws JSONException
+     */
+    public JSONObject put(String key, Collection value) throws JSONException {
+        this.put(key, new JSONArray(value));
+        return this;
+    }
+
+    /**
+     * Put a key/double pair in the JSONObject.
+     *
+     * @param key
+     *            A key string.
+     * @param value
+     *            A double which is the value.
+     * @return this.
+     * @throws JSONException
+     *             If the key is null or if the number is invalid.
+     */
+    public JSONObject put(String key, double value) throws JSONException {
+        this.put(key, new Double(value));
+        return this;
+    }
+
+    /**
+     * Put a key/int pair in the JSONObject.
+     *
+     * @param key
+     *            A key string.
+     * @param value
+     *            An int which is the value.
+     * @return this.
+     * @throws JSONException
+     *             If the key is null.
+     */
+    public JSONObject put(String key, int value) throws JSONException {
+        this.put(key, new Integer(value));
+        return this;
+    }
+
+    /**
+     * Put a key/long pair in the JSONObject.
+     *
+     * @param key
+     *            A key string.
+     * @param value
+     *            A long which is the value.
+     * @return this.
+     * @throws JSONException
+     *             If the key is null.
+     */
+    public JSONObject put(String key, long value) throws JSONException {
+        this.put(key, new Long(value));
+        return this;
+    }
+
+    /**
+     * Put a key/value pair in the JSONObject, where the value will be a
+     * JSONObject which is produced from a Map.
+     *
+     * @param key
+     *            A key string.
+     * @param value
+     *            A Map value.
+     * @return this.
+     * @throws JSONException
+     */
+    public JSONObject put(String key, Map value) throws JSONException {
+        this.put(key, new JSONObject(value));
+        return this;
+    }
+
+    /**
+     * Put a key/value pair in the JSONObject. If the value is null, then the
+     * key will be removed from the JSONObject if it is present.
+     *
+     * @param key
+     *            A key string.
+     * @param value
+     *            An object which is the value. It should be of one of these
+     *            types: Boolean, Double, Integer, JSONArray, JSONObject, Long,
+     *            String, or the JSONObject.NULL object.
+     * @return this.
+     * @throws JSONException
+     *             If the value is non-finite number or if the key is null.
+     */
+    public JSONObject put(String key, Object value) throws JSONException {
+        if (key == null) {
+            throw new NullPointerException("Null key.");
+        }
+        if (value != null) {
+            testValidity(value);
+            _put(key, value);
+        } else {
+            this.remove(key);
+        }
+        return this;
+    }
+
+    /**
+     * Put a key/value pair in the JSONObject, but only if the key and the value
+     * are both non-null, and only if there is not already a member with that
+     * name.
+     *
+     * @param key
+     * @param value
+     * @return his.
+     * @throws JSONException
+     *             if the key is a duplicate
+     */
+    public JSONObject putOnce(String key, Object value) throws JSONException {
+        if (key != null && value != null) {
+            if (this.opt(key) != null) {
+                throw new JSONException("Duplicate key \"" + key + "\"");
+            }
+            this.put(key, value);
+        }
+        return this;
+    }
+
+    /**
+     * Put a key/value pair in the JSONObject, but only if the key and the value
+     * are both non-null.
+     *
+     * @param key
+     *            A key string.
+     * @param value
+     *            An object which is the value. It should be of one of these
+     *            types: Boolean, Double, Integer, JSONArray, JSONObject, Long,
+     *            String, or the JSONObject.NULL object.
+     * @return this.
+     * @throws JSONException
+     *             If the value is a non-finite number.
+     */
+    public JSONObject putOpt(String key, Object value) throws JSONException {
+        if (key != null && value != null) {
+            this.put(key, value);
+        }
+        return this;
+    }
+
+    /**
+     * Produce a string in double quotes with backslash sequences in all the
+     * right places. A backslash will be inserted within </, producing <\/,
+     * allowing JSON text to be delivered in HTML. In JSON text, a string cannot
+     * contain a control character or an unescaped quote or backslash.
+     *
+     * @param string
+     *            A String
+     * @return A String correctly formatted for insertion in a JSON text.
+     */
+    public static String quote(String string) {
+        StringWriter sw = new StringWriter();
+        synchronized (sw.getBuffer()) {
+            try {
+                return quote(string, sw).toString();
+            } catch (IOException ignored) {
+                // will never happen - we are writing to a string writer
+                return "";
+            }
+        }
+    }
+
+    public static Writer quote(String string, Writer w) throws IOException {
+        if (string == null || string.length() == 0) {
+            w.write("\"\"");
+            return w;
+        }
+
+        char b;
+        char c = 0;
+        String hhhh;
+        int i;
+        int len = string.length();
+
+        w.write('"');
+        for (i = 0; i < len; i += 1) {
+            b = c;
+            c = string.charAt(i);
+            switch (c) {
+            case '\\':
+            case '"':
+                w.write('\\');
+                w.write(c);
+                break;
+            case '/':
+                if (b == '<') {
+                    w.write('\\');
+                }
+                w.write(c);
+                break;
+            case '\b':
+                w.write("\\b");
+                break;
+            case '\t':
+                w.write("\\t");
+                break;
+            case '\n':
+                w.write("\\n");
+                break;
+            case '\f':
+                w.write("\\f");
+                break;
+            case '\r':
+                w.write("\\r");
+                break;
+            default:
+                if (c < ' ' || (c >= '\u0080' && c < '\u00a0')
+                        || (c >= '\u2000' && c < '\u2100')) {
+                    w.write("\\u");
+                    hhhh = Integer.toHexString(c);
+                    w.write("0000", 0, 4 - hhhh.length());
+                    w.write(hhhh);
+                } else {
+                    w.write(c);
+                }
+            }
+        }
+        w.write('"');
+        return w;
+    }
+
+    /**
+     * Remove a name and its value, if present.
+     *
+     * @param key
+     *            The name to be removed.
+     * @return The value that was associated with the name, or null if there was
+     *         no value.
+     */
+    public Object remove(String key) {
+    	Object value = this.map.remove(key);
+        if (value instanceof JSONObject) {
+        	((JSONObject) value).parent = null;
+        }
+        if (value instanceof JSONArray) {
+        	((JSONArray) value).parent = null;
+        }
+        return value;
+    }
+
+    /**
+     * Try to convert a string into a number, boolean, or null. If the string
+     * can't be converted, return the string.
+     *
+     * @param string
+     *            A String.
+     * @return A simple JSON value.
+     */
+    public static Object stringToValue(String string) {
+        Double d;
+        if (string.equals("")) {
+            return string;
+        }
+        if (string.equalsIgnoreCase("true")) {
+            return Boolean.TRUE;
+        }
+        if (string.equalsIgnoreCase("false")) {
+            return Boolean.FALSE;
+        }
+        if (string.equalsIgnoreCase("null")) {
+            return JSONObject.NULL;
+        }
+
+        /*
+         * If it might be a number, try converting it. If a number cannot be
+         * produced, then the value will just be a string.
+         */
+
+        char b = string.charAt(0);
+        if ((b >= '0' && b <= '9') || b == '-') {
+            try {
+                if (string.indexOf('.') > -1 || string.indexOf('e') > -1
+                        || string.indexOf('E') > -1) {
+                    d = Double.valueOf(string);
+                    if (!d.isInfinite() && !d.isNaN()) {
+                        return d;
+                    }
+                } else {
+                    Long myLong = new Long(string);
+                    if (string.equals(myLong.toString())) {
+                        if (myLong.longValue() == myLong.intValue()) {
+                            return new Integer(myLong.intValue());
+                        } else {
+                            return myLong;
+                        }
+                    }
+                }
+            } catch (Exception ignore) {
+            }
+        }
+        return string;
+    }
+
+    /**
+     * Throw an exception if the object is a NaN or infinite number.
+     *
+     * @param o
+     *            The object to test.
+     * @throws JSONException
+     *             If o is a non-finite number.
+     */
+    public static void testValidity(Object o) throws JSONException {
+        if (o != null) {
+            if (o instanceof Double) {
+                if (((Double) o).isInfinite() || ((Double) o).isNaN()) {
+                    throw new JSONException(
+                            "JSON does not allow non-finite numbers.");
+                }
+            } else if (o instanceof Float) {
+                if (((Float) o).isInfinite() || ((Float) o).isNaN()) {
+                    throw new JSONException(
+                            "JSON does not allow non-finite numbers.");
+                }
+            }
+        }
+    }
+
+    /**
+     * Produce a JSONArray containing the values of the members of this
+     * JSONObject.
+     *
+     * @param names
+     *            A JSONArray containing a list of key strings. This determines
+     *            the sequence of the values in the result.
+     * @return A JSONArray of values.
+     * @throws JSONException
+     *             If any of the values are non-finite numbers.
+     */
+    public JSONArray toJSONArray(JSONArray names) throws JSONException {
+        if (names == null || names.length() == 0) {
+            return null;
+        }
+        JSONArray ja = new JSONArray();
+        for (int i = 0; i < names.length(); i += 1) {
+            ja.put(this.opt(names.getString(i)));
+        }
+        return ja;
+    }
+
+    /**
+     * Make a JSON text of this JSONObject. For compactness, no whitespace is
+     * added. If this would not result in a syntactically correct JSON text,
+     * then null will be returned instead.
+     * <p>
+     * Warning: This method assumes that the data structure is acyclical.
+     *
+     * @return a printable, displayable, portable, transmittable representation
+     *         of the object, beginning with <code>{</code> <small>(left
+     *         brace)</small> and ending with <code>}</code> <small>(right
+     *         brace)</small>.
+     */
+    public String toString() {
+        try {
+            return this.toString(0);
+        } catch (Exception e) {
+            return null;
+        }
+    }
+
+    /**
+     * Make a prettyprinted JSON text of this JSONObject.
+     * <p>
+     * Warning: This method assumes that the data structure is acyclical.
+     *
+     * @param indentFactor
+     *            The number of spaces to add to each level of indentation.
+     * @return a printable, displayable, portable, transmittable representation
+     *         of the object, beginning with <code>{</code> <small>(left
+     *         brace)</small> and ending with <code>}</code> <small>(right
+     *         brace)</small>.
+     * @throws JSONException
+     *             If the object contains an invalid number.
+     */
+    public String toString(int indentFactor) throws JSONException {
+        StringWriter w = new StringWriter();
+        synchronized (w.getBuffer()) {
+            return this.write(w, indentFactor, 0).toString();
+        }
+    }
+
+    /**
+     * Make a JSON text of an Object value. If the object has an
+     * value.toJSONString() method, then that method will be used to produce the
+     * JSON text. The method is required to produce a strictly conforming text.
+     * If the object does not contain a toJSONString method (which is the most
+     * common case), then a text will be produced by other means. If the value
+     * is an array or Collection, then a JSONArray will be made from it and its
+     * toJSONString method will be called. If the value is a MAP, then a
+     * JSONObject will be made from it and its toJSONString method will be
+     * called. Otherwise, the value's toString method will be called, and the
+     * result will be quoted.
+     *
+     * <p>
+     * Warning: This method assumes that the data structure is acyclical.
+     *
+     * @param value
+     *            The value to be serialized.
+     * @return a printable, displayable, transmittable representation of the
+     *         object, beginning with <code>{</code> <small>(left
+     *         brace)</small> and ending with <code>}</code> <small>(right
+     *         brace)</small>.
+     * @throws JSONException
+     *             If the value is or contains an invalid number.
+     */
+    public static String valueToString(Object value) throws JSONException {
+        if (value == null || value.equals(null)) {
+            return "null";
+        }
+        if (value instanceof JSONString) {
+            Object object;
+            try {
+                object = ((JSONString) value).toJSONString();
+            } catch (Exception e) {
+                throw new JSONException(e);
+            }
+            if (object instanceof String) {
+                return (String) object;
+            }
+            throw new JSONException("Bad value from toJSONString: " + object);
+        }
+        if (value instanceof Number) {
+            return numberToString((Number) value);
+        }
+        if (value instanceof Boolean || value instanceof JSONObject
+                || value instanceof JSONArray) {
+            return value.toString();
+        }
+        if (value instanceof Map) {
+            return new JSONObject((Map) value).toString();
+        }
+        if (value instanceof Collection) {
+            return new JSONArray((Collection) value).toString();
+        }
+        if (value.getClass().isArray()) {
+            return new JSONArray(value).toString();
+        }
+        return quote(value.toString());
+    }
+
+    /**
+     * Wrap an object, if necessary. If the object is null, return the NULL
+     * object. If it is an array or collection, wrap it in a JSONArray. If it is
+     * a map, wrap it in a JSONObject. If it is a standard property (Double,
+     * String, et al) then it is already wrapped. Otherwise, if it comes from
+     * one of the java packages, turn it into a string. And if it doesn't, try
+     * to wrap it in a JSONObject. If the wrapping fails, then null is returned.
+     *
+     * @param object
+     *            The object to wrap
+     * @return The wrapped value
+     */
+    public static Object wrap(Object object) {
+        try {
+            if (object == null) {
+                return NULL;
+            }
+            if (object instanceof JSONObject || object instanceof JSONArray
+                    || NULL.equals(object) || object instanceof JSONString
+                    || object instanceof Byte || object instanceof Character
+                    || object instanceof Short || object instanceof Integer
+                    || object instanceof Long || object instanceof Boolean
+                    || object instanceof Float || object instanceof Double
+                    || object instanceof String) {
+                return object;
+            }
+
+            if (object instanceof Collection) {
+                return new JSONArray((Collection) object);
+            }
+            if (object.getClass().isArray()) {
+                return new JSONArray(object);
+            }
+            if (object instanceof Map) {
+                return new JSONObject((Map) object);
+            }
+            Package objectPackage = object.getClass().getPackage();
+            String objectPackageName = objectPackage != null ? objectPackage
+                    .getName() : "";
+            if (objectPackageName.startsWith("java.")
+                    || objectPackageName.startsWith("javax.")
+                    || object.getClass().getClassLoader() == null) {
+                return object.toString();
+            }
+            return new JSONObject(object);
+        } catch (Exception exception) {
+            return null;
+        }
+    }
+
+    /**
+     * Write the contents of the JSONObject as JSON text to a writer. For
+     * compactness, no whitespace is added.
+     * <p>
+     * Warning: This method assumes that the data structure is acyclical.
+     *
+     * @return The writer.
+     * @throws JSONException
+     */
+    public Writer write(Writer writer) throws JSONException {
+        return this.write(writer, 0, 0);
+    }
+
+    static final Writer writeValue(Writer writer, Object value,
+            int indentFactor, int indent) throws JSONException, IOException {
+        if (value == null || value.equals(null)) {
+            writer.write("null");
+        } else if (value instanceof JSONObject) {
+            ((JSONObject) value).write(writer, indentFactor, indent);
+        } else if (value instanceof JSONArray) {
+            ((JSONArray) value).write(writer, indentFactor, indent);
+        } else if (value instanceof Map) {
+            new JSONObject((Map) value).write(writer, indentFactor, indent);
+        } else if (value instanceof Collection) {
+            new JSONArray((Collection) value).write(writer, indentFactor,
+                    indent);
+        } else if (value.getClass().isArray()) {
+            new JSONArray(value).write(writer, indentFactor, indent);
+        } else if (value instanceof Number) {
+            writer.write(numberToString((Number) value));
+        } else if (value instanceof Boolean) {
+            writer.write(value.toString());
+        } else if (value instanceof JSONString) {
+            Object o;
+            try {
+                o = ((JSONString) value).toJSONString();
+            } catch (Exception e) {
+                throw new JSONException(e);
+            }
+            writer.write(o != null ? o.toString() : quote(value.toString()));
+        } else {
+            quote(value.toString(), writer);
+        }
+        return writer;
+    }
+
+    static final void indent(Writer writer, int indent) throws IOException {
+        for (int i = 0; i < indent; i += 1) {
+            writer.write(' ');
+        }
+    }
+
+    /**
+     * Write the contents of the JSONObject as JSON text to a writer. For
+     * compactness, no whitespace is added.
+     * <p>
+     * Warning: This method assumes that the data structure is acyclical.
+     *
+     * @return The writer.
+     * @throws JSONException
+     */
+    Writer write(Writer writer, int indentFactor, int indent)
+            throws JSONException {
+        try {
+            boolean commanate = false;
+            final int length = this.length();
+            Iterator keys = this.keys();
+            writer.write('{');
+
+            if (length == 1) {
+                Object key = keys.next();
+                writer.write(quote(key.toString()));
+                writer.write(':');
+                if (indentFactor > 0) {
+                    writer.write(' ');
+                }
+                writeValue(writer, this.map.get(key), indentFactor, indent);
+            } else if (length != 0) {
+                final int newindent = indent + indentFactor;
+                while (keys.hasNext()) {
+                    Object key = keys.next();
+                    if (commanate) {
+                        writer.write(',');
+                    }
+                    if (indentFactor > 0) {
+                        writer.write('\n');
+                    }
+                    indent(writer, newindent);
+                    writer.write(quote(key.toString()));
+                    writer.write(':');
+                    if (indentFactor > 0) {
+                        writer.write(' ');
+                    }
+                    writeValue(writer, this.map.get(key), indentFactor,
+                            newindent);
+                    commanate = true;
+                }
+                if (indentFactor > 0) {
+                    writer.write('\n');
+                }
+                indent(writer, indent);
+            }
+            writer.write('}');
+            return writer;
+        } catch (IOException exception) {
+            throw new JSONException(exception);
+        }
+    }
+}
diff --git a/src/org/json/JSONString.java b/src/org/json/JSONString.java
new file mode 100755
index 0000000..1f2d77d
--- /dev/null
+++ b/src/org/json/JSONString.java
@@ -0,0 +1,18 @@
+package org.json;
+/**
+ * The <code>JSONString</code> interface allows a <code>toJSONString()</code>
+ * method so that a class can change the behavior of
+ * <code>JSONObject.toString()</code>, <code>JSONArray.toString()</code>,
+ * and <code>JSONWriter.value(</code>Object<code>)</code>. The
+ * <code>toJSONString</code> method will be used instead of the default behavior
+ * of using the Object's <code>toString()</code> method and quoting the result.
+ */
+public interface JSONString {
+    /**
+     * The <code>toJSONString</code> method allows a class to produce its own JSON
+     * serialization.
+     *
+     * @return A strictly syntactically correct JSON text.
+     */
+    public String toJSONString();
+}
diff --git a/src/org/json/JSONStringer.java b/src/org/json/JSONStringer.java
new file mode 100755
index 0000000..25c2e5d
--- /dev/null
+++ b/src/org/json/JSONStringer.java
@@ -0,0 +1,78 @@
+package org.json;
+
+/*
+Copyright (c) 2006 JSON.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+The Software shall be used for Good, not Evil.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+import java.io.StringWriter;
+
+/**
+ * JSONStringer provides a quick and convenient way of producing JSON text.
+ * The texts produced strictly conform to JSON syntax rules. No whitespace is
+ * added, so the results are ready for transmission or storage. Each instance of
+ * JSONStringer can produce one JSON text.
+ * <p>
+ * A JSONStringer instance provides a <code>value</code> method for appending
+ * values to the
+ * text, and a <code>key</code>
+ * method for adding keys before values in objects. There are <code>array</code>
+ * and <code>endArray</code> methods that make and bound array values, and
+ * <code>object</code> and <code>endObject</code> methods which make and bound
+ * object values. All of these methods return the JSONWriter instance,
+ * permitting cascade style. For example, <pre>
+ * myString = new JSONStringer()
+ *     .object()
+ *         .key("JSON")
+ *         .value("Hello, World!")
+ *     .endObject()
+ *     .toString();</pre> which produces the string <pre>
+ * {"JSON":"Hello, World!"}</pre>
+ * <p>
+ * The first method called must be <code>array</code> or <code>object</code>.
+ * There are no methods for adding commas or colons. JSONStringer adds them for
+ * you. Objects and arrays can be nested up to 20 levels deep.
+ * <p>
+ * This can sometimes be easier than using a JSONObject to build a string.
+ * @author JSON.org
+ * @version 2008-09-18
+ */
+public class JSONStringer extends JSONWriter {
+    /**
+     * Make a fresh JSONStringer. It can be used to build one JSON text.
+     */
+    public JSONStringer() {
+        super(new StringWriter());
+    }
+
+    /**
+     * Return the JSON text. This method is used to obtain the product of the
+     * JSONStringer instance. It will return <code>null</code> if there was a
+     * problem in the construction of the JSON text (such as the calls to
+     * <code>array</code> were not properly balanced with calls to
+     * <code>endArray</code>).
+     * @return The JSON text.
+     */
+    public String toString() {
+        return this.mode == 'd' ? this.writer.toString() : null;
+    }
+}
diff --git a/src/org/json/JSONTokener.java b/src/org/json/JSONTokener.java
new file mode 100644
index 0000000..13c84f1
--- /dev/null
+++ b/src/org/json/JSONTokener.java
@@ -0,0 +1,446 @@
+package org.json;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.io.StringReader;
+
+/*
+Copyright (c) 2002 JSON.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+The Software shall be used for Good, not Evil.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+/**
+ * A JSONTokener takes a source string and extracts characters and tokens from
+ * it. It is used by the JSONObject and JSONArray constructors to parse
+ * JSON source strings.
+ * @author JSON.org
+ * @version 2012-02-16
+ */
+public class JSONTokener {
+
+    private long    character;
+    private boolean eof;
+    private long    index;
+    private long    line;
+    private char    previous;
+    private Reader  reader;
+    private boolean usePrevious;
+
+
+    /**
+     * Construct a JSONTokener from a Reader.
+     *
+     * @param reader     A reader.
+     */
+    public JSONTokener(Reader reader) {
+        this.reader = reader.markSupported()
+            ? reader
+            : new BufferedReader(reader);
+        this.eof = false;
+        this.usePrevious = false;
+        this.previous = 0;
+        this.index = 0;
+        this.character = 1;
+        this.line = 1;
+    }
+
+
+    /**
+     * Construct a JSONTokener from an InputStream.
+     */
+    public JSONTokener(InputStream inputStream) throws JSONException {
+        this(new InputStreamReader(inputStream));
+    }
+
+
+    /**
+     * Construct a JSONTokener from a string.
+     *
+     * @param s     A source string.
+     */
+    public JSONTokener(String s) {
+        this(new StringReader(s));
+    }
+
+
+    /**
+     * Back up one character. This provides a sort of lookahead capability,
+     * so that you can test for a digit or letter before attempting to parse
+     * the next number or identifier.
+     */
+    public void back() throws JSONException {
+        if (this.usePrevious || this.index <= 0) {
+            throw new JSONException("Stepping back two steps is not supported");
+        }
+        this.index -= 1;
+        this.character -= 1;
+        this.usePrevious = true;
+        this.eof = false;
+    }
+
+
+    /**
+     * Get the hex value of a character (base16).
+     * @param c A character between '0' and '9' or between 'A' and 'F' or
+     * between 'a' and 'f'.
+     * @return  An int between 0 and 15, or -1 if c was not a hex digit.
+     */
+    public static int dehexchar(char c) {
+        if (c >= '0' && c <= '9') {
+            return c - '0';
+        }
+        if (c >= 'A' && c <= 'F') {
+            return c - ('A' - 10);
+        }
+        if (c >= 'a' && c <= 'f') {
+            return c - ('a' - 10);
+        }
+        return -1;
+    }
+
+    public boolean end() {
+        return this.eof && !this.usePrevious;
+    }
+
+
+    /**
+     * Determine if the source string still contains characters that next()
+     * can consume.
+     * @return true if not yet at the end of the source.
+     */
+    public boolean more() throws JSONException {
+        this.next();
+        if (this.end()) {
+            return false;
+        }
+        this.back();
+        return true;
+    }
+
+
+    /**
+     * Get the next character in the source string.
+     *
+     * @return The next character, or 0 if past the end of the source string.
+     */
+    public char next() throws JSONException {
+        int c;
+        if (this.usePrevious) {
+            this.usePrevious = false;
+            c = this.previous;
+        } else {
+            try {
+                c = this.reader.read();
+            } catch (IOException exception) {
+                throw new JSONException(exception);
+            }
+
+            if (c <= 0) { // End of stream
+                this.eof = true;
+                c = 0;
+            }
+        }
+        this.index += 1;
+        if (this.previous == '\r') {
+            this.line += 1;
+            this.character = c == '\n' ? 0 : 1;
+        } else if (c == '\n') {
+            this.line += 1;
+            this.character = 0;
+        } else {
+            this.character += 1;
+        }
+        this.previous = (char) c;
+        return this.previous;
+    }
+
+
+    /**
+     * Consume the next character, and check that it matches a specified
+     * character.
+     * @param c The character to match.
+     * @return The character.
+     * @throws JSONException if the character does not match.
+     */
+    public char next(char c) throws JSONException {
+        char n = this.next();
+        if (n != c) {
+            throw this.syntaxError("Expected '" + c + "' and instead saw '" +
+                    n + "'");
+        }
+        return n;
+    }
+
+
+    /**
+     * Get the next n characters.
+     *
+     * @param n     The number of characters to take.
+     * @return      A string of n characters.
+     * @throws JSONException
+     *   Substring bounds error if there are not
+     *   n characters remaining in the source string.
+     */
+     public String next(int n) throws JSONException {
+         if (n == 0) {
+             return "";
+         }
+
+         char[] chars = new char[n];
+         int pos = 0;
+
+         while (pos < n) {
+             chars[pos] = this.next();
+             if (this.end()) {
+                 throw this.syntaxError("Substring bounds error");
+             }
+             pos += 1;
+         }
+         return new String(chars);
+     }
+
+
+    /**
+     * Get the next char in the string, skipping whitespace.
+     * @throws JSONException
+     * @return  A character, or 0 if there are no more characters.
+     */
+    public char nextClean() throws JSONException {
+        for (;;) {
+            char c = this.next();
+            if (c == 0 || c > ' ') {
+                return c;
+            }
+        }
+    }
+
+
+    /**
+     * Return the characters up to the next close quote character.
+     * Backslash processing is done. The formal JSON format does not
+     * allow strings in single quotes, but an implementation is allowed to
+     * accept them.
+     * @param quote The quoting character, either
+     *      <code>"</code> <small>(double quote)</small> or
+     *      <code>'</code> <small>(single quote)</small>.
+     * @return      A String.
+     * @throws JSONException Unterminated string.
+     */
+    public String nextString(char quote) throws JSONException {
+        char c;
+        StringBuffer sb = new StringBuffer();
+        for (;;) {
+            c = this.next();
+            switch (c) {
+            case 0:
+            case '\n':
+            case '\r':
+                throw this.syntaxError("Unterminated string");
+            case '\\':
+                c = this.next();
+                switch (c) {
+                case 'b':
+                    sb.append('\b');
+                    break;
+                case 't':
+                    sb.append('\t');
+                    break;
+                case 'n':
+                    sb.append('\n');
+                    break;
+                case 'f':
+                    sb.append('\f');
+                    break;
+                case 'r':
+                    sb.append('\r');
+                    break;
+                case 'u':
+                    sb.append((char)Integer.parseInt(this.next(4), 16));
+                    break;
+                case '"':
+                case '\'':
+                case '\\':
+                case '/':
+                    sb.append(c);
+                    break;
+                default:
+                    throw this.syntaxError("Illegal escape.");
+                }
+                break;
+            default:
+                if (c == quote) {
+                    return sb.toString();
+                }
+                sb.append(c);
+            }
+        }
+    }
+
+
+    /**
+     * Get the text up but not including the specified character or the
+     * end of line, whichever comes first.
+     * @param  delimiter A delimiter character.
+     * @return   A string.
+     */
+    public String nextTo(char delimiter) throws JSONException {
+        StringBuffer sb = new StringBuffer();
+        for (;;) {
+            char c = this.next();
+            if (c == delimiter || c == 0 || c == '\n' || c == '\r') {
+                if (c != 0) {
+                    this.back();
+                }
+                return sb.toString().trim();
+            }
+            sb.append(c);
+        }
+    }
+
+
+    /**
+     * Get the text up but not including one of the specified delimiter
+     * characters or the end of line, whichever comes first.
+     * @param delimiters A set of delimiter characters.
+     * @return A string, trimmed.
+     */
+    public String nextTo(String delimiters) throws JSONException {
+        char c;
+        StringBuffer sb = new StringBuffer();
+        for (;;) {
+            c = this.next();
+            if (delimiters.indexOf(c) >= 0 || c == 0 ||
+                    c == '\n' || c == '\r') {
+                if (c != 0) {
+                    this.back();
+                }
+                return sb.toString().trim();
+            }
+            sb.append(c);
+        }
+    }
+
+
+    /**
+     * Get the next value. The value can be a Boolean, Double, Integer,
+     * JSONArray, JSONObject, Long, or String, or the JSONObject.NULL object.
+     * @throws JSONException If syntax error.
+     *
+     * @return An object.
+     */
+    public Object nextValue() throws JSONException {
+        char c = this.nextClean();
+        String string;
+
+        switch (c) {
+            case '"':
+            case '\'':
+                return this.nextString(c);
+            case '{':
+                this.back();
+                return new JSONObject(this);
+            case '[':
+                this.back();
+                return new JSONArray(this);
+        }
+
+        /*
+         * Handle unquoted text. This could be the values true, false, or
+         * null, or it can be a number. An implementation (such as this one)
+         * is allowed to also accept non-standard forms.
+         *
+         * Accumulate characters until we reach the end of the text or a
+         * formatting character.
+         */
+
+        StringBuffer sb = new StringBuffer();
+        while (c >= ' ' && ",:]}/\\\"[{;=#".indexOf(c) < 0) {
+            sb.append(c);
+            c = this.next();
+        }
+        this.back();
+
+        string = sb.toString().trim();
+        if ("".equals(string)) {
+            throw this.syntaxError("Missing value");
+        }
+        return JSONObject.stringToValue(string);
+    }
+
+
+    /**
+     * Skip characters until the next character is the requested character.
+     * If the requested character is not found, no characters are skipped.
+     * @param to A character to skip to.
+     * @return The requested character, or zero if the requested character
+     * is not found.
+     */
+    public char skipTo(char to) throws JSONException {
+        char c;
+        try {
+            long startIndex = this.index;
+            long startCharacter = this.character;
+            long startLine = this.line;
+            this.reader.mark(1000000);
+            do {
+                c = this.next();
+                if (c == 0) {
+                    this.reader.reset();
+                    this.index = startIndex;
+                    this.character = startCharacter;
+                    this.line = startLine;
+                    return c;
+                }
+            } while (c != to);
+        } catch (IOException exc) {
+            throw new JSONException(exc);
+        }
+
+        this.back();
+        return c;
+    }
+
+
+    /**
+     * Make a JSONException to signal a syntax error.
+     *
+     * @param message The error message.
+     * @return  A JSONException object, suitable for throwing
+     */
+    public JSONException syntaxError(String message) {
+        return new JSONException(message + this.toString());
+    }
+
+
+    /**
+     * Make a printable string of this JSONTokener.
+     *
+     * @return " at {index} [character {character} line {line}]"
+     */
+    public String toString() {
+        return " at " + this.index + " [character " + this.character + " line " +
+            this.line + "]";
+    }
+}
diff --git a/src/org/json/JSONWriter.java b/src/org/json/JSONWriter.java
new file mode 100755
index 0000000..855b2bd
--- /dev/null
+++ b/src/org/json/JSONWriter.java
@@ -0,0 +1,327 @@
+package org.json;
+
+import java.io.IOException;
+import java.io.Writer;
+
+/*
+Copyright (c) 2006 JSON.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+The Software shall be used for Good, not Evil.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+/**
+ * JSONWriter provides a quick and convenient way of producing JSON text.
+ * The texts produced strictly conform to JSON syntax rules. No whitespace is
+ * added, so the results are ready for transmission or storage. Each instance of
+ * JSONWriter can produce one JSON text.
+ * <p>
+ * A JSONWriter instance provides a <code>value</code> method for appending
+ * values to the
+ * text, and a <code>key</code>
+ * method for adding keys before values in objects. There are <code>array</code>
+ * and <code>endArray</code> methods that make and bound array values, and
+ * <code>object</code> and <code>endObject</code> methods which make and bound
+ * object values. All of these methods return the JSONWriter instance,
+ * permitting a cascade style. For example, <pre>
+ * new JSONWriter(myWriter)
+ *     .object()
+ *         .key("JSON")
+ *         .value("Hello, World!")
+ *     .endObject();</pre> which writes <pre>
+ * {"JSON":"Hello, World!"}</pre>
+ * <p>
+ * The first method called must be <code>array</code> or <code>object</code>.
+ * There are no methods for adding commas or colons. JSONWriter adds them for
+ * you. Objects and arrays can be nested up to 20 levels deep.
+ * <p>
+ * This can sometimes be easier than using a JSONObject to build a string.
+ * @author JSON.org
+ * @version 2011-11-24
+ */
+public class JSONWriter {
+    private static final int maxdepth = 200;
+
+    /**
+     * The comma flag determines if a comma should be output before the next
+     * value.
+     */
+    private boolean comma;
+
+    /**
+     * The current mode. Values:
+     * 'a' (array),
+     * 'd' (done),
+     * 'i' (initial),
+     * 'k' (key),
+     * 'o' (object).
+     */
+    protected char mode;
+
+    /**
+     * The object/array stack.
+     */
+    private final JSONObject stack[];
+
+    /**
+     * The stack top index. A value of 0 indicates that the stack is empty.
+     */
+    private int top;
+
+    /**
+     * The writer that will receive the output.
+     */
+    protected Writer writer;
+
+    /**
+     * Make a fresh JSONWriter. It can be used to build one JSON text.
+     */
+    public JSONWriter(Writer w) {
+        this.comma = false;
+        this.mode = 'i';
+        this.stack = new JSONObject[maxdepth];
+        this.top = 0;
+        this.writer = w;
+    }
+
+    /**
+     * Append a value.
+     * @param string A string value.
+     * @return this
+     * @throws JSONException If the value is out of sequence.
+     */
+    private JSONWriter append(String string) throws JSONException {
+        if (string == null) {
+            throw new JSONException("Null pointer");
+        }
+        if (this.mode == 'o' || this.mode == 'a') {
+            try {
+                if (this.comma && this.mode == 'a') {
+                    this.writer.write(',');
+                }
+                this.writer.write(string);
+            } catch (IOException e) {
+                throw new JSONException(e);
+            }
+            if (this.mode == 'o') {
+                this.mode = 'k';
+            }
+            this.comma = true;
+            return this;
+        }
+        throw new JSONException("Value out of sequence.");
+    }
+
+    /**
+     * Begin appending a new array. All values until the balancing
+     * <code>endArray</code> will be appended to this array. The
+     * <code>endArray</code> method must be called to mark the array's end.
+     * @return this
+     * @throws JSONException If the nesting is too deep, or if the object is
+     * started in the wrong place (for example as a key or after the end of the
+     * outermost array or object).
+     */
+    public JSONWriter array() throws JSONException {
+        if (this.mode == 'i' || this.mode == 'o' || this.mode == 'a') {
+            this.push(null);
+            this.append("[");
+            this.comma = false;
+            return this;
+        }
+        throw new JSONException("Misplaced array.");
+    }
+
+    /**
+     * End something.
+     * @param mode Mode
+     * @param c Closing character
+     * @return this
+     * @throws JSONException If unbalanced.
+     */
+    private JSONWriter end(char mode, char c) throws JSONException {
+        if (this.mode != mode) {
+            throw new JSONException(mode == 'a'
+                ? "Misplaced endArray."
+                : "Misplaced endObject.");
+        }
+        this.pop(mode);
+        try {
+            this.writer.write(c);
+        } catch (IOException e) {
+            throw new JSONException(e);
+        }
+        this.comma = true;
+        return this;
+    }
+
+    /**
+     * End an array. This method most be called to balance calls to
+     * <code>array</code>.
+     * @return this
+     * @throws JSONException If incorrectly nested.
+     */
+    public JSONWriter endArray() throws JSONException {
+        return this.end('a', ']');
+    }
+
+    /**
+     * End an object. This method most be called to balance calls to
+     * <code>object</code>.
+     * @return this
+     * @throws JSONException If incorrectly nested.
+     */
+    public JSONWriter endObject() throws JSONException {
+        return this.end('k', '}');
+    }
+
+    /**
+     * Append a key. The key will be associated with the next value. In an
+     * object, every value must be preceded by a key.
+     * @param string A key string.
+     * @return this
+     * @throws JSONException If the key is out of place. For example, keys
+     *  do not belong in arrays or if the key is null.
+     */
+    public JSONWriter key(String string) throws JSONException {
+        if (string == null) {
+            throw new JSONException("Null key.");
+        }
+        if (this.mode == 'k') {
+            try {
+                this.stack[this.top - 1].putOnce(string, Boolean.TRUE);
+                if (this.comma) {
+                    this.writer.write(',');
+                }
+                this.writer.write(JSONObject.quote(string));
+                this.writer.write(':');
+                this.comma = false;
+                this.mode = 'o';
+                return this;
+            } catch (IOException e) {
+                throw new JSONException(e);
+            }
+        }
+        throw new JSONException("Misplaced key.");
+    }
+
+
+    /**
+     * Begin appending a new object. All keys and values until the balancing
+     * <code>endObject</code> will be appended to this object. The
+     * <code>endObject</code> method must be called to mark the object's end.
+     * @return this
+     * @throws JSONException If the nesting is too deep, or if the object is
+     * started in the wrong place (for example as a key or after the end of the
+     * outermost array or object).
+     */
+    public JSONWriter object() throws JSONException {
+        if (this.mode == 'i') {
+            this.mode = 'o';
+        }
+        if (this.mode == 'o' || this.mode == 'a') {
+            this.append("{");
+            this.push(new JSONObject());
+            this.comma = false;
+            return this;
+        }
+        throw new JSONException("Misplaced object.");
+
+    }
+
+
+    /**
+     * Pop an array or object scope.
+     * @param c The scope to close.
+     * @throws JSONException If nesting is wrong.
+     */
+    private void pop(char c) throws JSONException {
+        if (this.top <= 0) {
+            throw new JSONException("Nesting error.");
+        }
+        char m = this.stack[this.top - 1] == null ? 'a' : 'k';
+        if (m != c) {
+            throw new JSONException("Nesting error.");
+        }
+        this.top -= 1;
+        this.mode = this.top == 0
+            ? 'd'
+            : this.stack[this.top - 1] == null
+            ? 'a'
+            : 'k';
+    }
+
+    /**
+     * Push an array or object scope.
+     * @param c The scope to open.
+     * @throws JSONException If nesting is too deep.
+     */
+    private void push(JSONObject jo) throws JSONException {
+        if (this.top >= maxdepth) {
+            throw new JSONException("Nesting too deep.");
+        }
+        this.stack[this.top] = jo;
+        this.mode = jo == null ? 'a' : 'k';
+        this.top += 1;
+    }
+
+
+    /**
+     * Append either the value <code>true</code> or the value
+     * <code>false</code>.
+     * @param b A boolean.
+     * @return this
+     * @throws JSONException
+     */
+    public JSONWriter value(boolean b) throws JSONException {
+        return this.append(b ? "true" : "false");
+    }
+
+    /**
+     * Append a double value.
+     * @param d A double.
+     * @return this
+     * @throws JSONException If the number is not finite.
+     */
+    public JSONWriter value(double d) throws JSONException {
+        return this.value(new Double(d));
+    }
+
+    /**
+     * Append a long value.
+     * @param l A long.
+     * @return this
+     * @throws JSONException
+     */
+    public JSONWriter value(long l) throws JSONException {
+        return this.append(Long.toString(l));
+    }
+
+
+    /**
+     * Append an object value.
+     * @param object The object to append. It can be null, or a Boolean, Number,
+     *   String, JSONObject, or JSONArray, or an object that implements JSONString.
+     * @return this
+     * @throws JSONException If the value is out of sequence.
+     */
+    public JSONWriter value(Object object) throws JSONException {
+        return this.append(JSONObject.valueToString(object));
+    }
+}
diff --git a/src/org/json/Kim.java b/src/org/json/Kim.java
new file mode 100644
index 0000000..d4770b5
--- /dev/null
+++ b/src/org/json/Kim.java
@@ -0,0 +1,373 @@
+package org.json;
+
+
+/*
+ Copyright (c) 2013 JSON.org
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ The Software shall be used for Good, not Evil.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+ */
+
+/**
+ * Kim makes immutable eight bit Unicode strings. If the MSB of a byte is set,
+ * then the next byte is a continuation byte. The last byte of a character
+ * never has the MSB reset. Every byte that is not the last byte has the MSB
+ * set. Kim stands for "Keep it minimal". A Unicode character is never longer
+ * than 3 bytes. Every byte contributes 7 bits to the character. ASCII is
+ * unmodified.
+ *
+ *                  Kim             UTF-8
+ * one byte         U+007F          U+007F
+ * two bytes        U+3FFF          U+07FF
+ * three bytes      U+10FFF         U+FFFF
+ * four bytes                       U+10FFFF
+ *
+ * Characters in the ranges U+0800..U+3FFF and U+10000..U+10FFFF will be one
+ * byte smaller when encoded in Kim compared to UTF-8.
+ *
+ * Kim is beneficial when using scripts such as Old South Arabian, Aramaic,
+ * Avestan, Balinese, Batak, Bopomofo, Buginese, Buhid, Carian, Cherokee,
+ * Coptic, Cyrillic, Deseret, Egyptian Hieroglyphs, Ethiopic, Georgian,
+ * Glagolitic, Gothic, Hangul Jamo, Hanunoo, Hiragana, Kanbun, Kaithi,
+ * Kannada, Katakana, Kharoshthi, Khmer, Lao, Lepcha, Limbu, Lycian, Lydian,
+ * Malayalam, Mandaic, Meroitic, Miao, Mongolian, Myanmar, New Tai Lue,
+ * Ol Chiki, Old Turkic, Oriya, Osmanya, Pahlavi, Parthian, Phags-Pa,
+ * Phoenician, Samaritan, Sharada, Sinhala, Sora Sompeng, Tagalog, Tagbanwa,
+ * Takri, Tai Le, Tai Tham, Tamil, Telugu, Thai, Tibetan, Tifinagh, UCAS.
+ *
+ * A kim object can be constructed from an ordinary UTF-16 string, or from a
+ * byte array. A kim object can produce a UTF-16 string.
+ *
+ * As with UTF-8, it is possible to detect character boundaries within a byte
+ * sequence. UTF-8 is one of the world's great inventions. While Kim is more
+ * efficient, it is not clear that it is worth the expense of transition.
+ *
+ * @version 2013-04-18
+ */
+public class Kim {
+
+    /**
+     * The byte array containing the kim's content.
+     */
+    private byte[] bytes = null;
+
+    /**
+     * The kim's hashcode, conforming to Java's hashcode conventions.
+     */
+    private int hashcode = 0;
+
+    /**
+     * The number of bytes in the kim. The number of bytes can be as much as
+     * three times the number of characters.
+     */
+    public int length = 0;
+
+    /**
+     * The memoization of toString().
+     */
+    private String string = null;
+
+    /**
+     * Make a kim from a portion of a byte array.
+     *
+     * @param bytes
+     *            A byte array.
+     * @param from
+     *            The index of the first byte.
+     * @param thru
+     *            The index of the last byte plus one.
+     */
+    public Kim(byte[] bytes, int from, int thru) {
+
+// As the bytes are copied into the new kim, a hashcode is computed using a
+// modified Fletcher code.
+
+        int sum = 1;
+        int value;
+        this.hashcode = 0;
+        this.length = thru - from;
+        if (this.length > 0) {
+            this.bytes = new byte[this.length];
+            for (int at = 0; at < this.length; at += 1) {
+                value = (int) bytes[at + from] & 0xFF;
+                sum += value;
+                this.hashcode += sum;
+                this.bytes[at] = (byte) value;
+            }
+            this.hashcode += sum << 16;
+        }
+    }
+
+    /**
+     * Make a kim from a byte array.
+     *
+     * @param bytes
+     *            The byte array.
+     * @param length
+     *            The number of bytes.
+     */
+    public Kim(byte[] bytes, int length) {
+        this(bytes, 0, length);
+    }
+
+    /**
+     * Make a new kim from a substring of an existing kim. The coordinates are
+     * in byte units, not character units.
+     *
+     * @param kim
+     *            The source of bytes.
+     * @param from
+     *            The point at which to take bytes.
+     * @param thru
+     *            The point at which to stop taking bytes.
+     * @return the substring
+     */
+    public Kim(Kim kim, int from, int thru) {
+        this(kim.bytes, from, thru);
+    }
+
+    /**
+     * Make a kim from a string.
+     *
+     * @param string
+     *            The string.
+     * @throws JSONException
+     *             if surrogate pair mismatch.
+     */
+    public Kim(String string) throws JSONException {
+        int stringLength = string.length();
+        this.hashcode = 0;
+        this.length = 0;
+
+// First pass: Determine the length of the kim, allowing for the UTF-16
+// to UTF-32 conversion, and then the UTF-32 to Kim conversion.
+
+        if (stringLength > 0) {
+            for (int i = 0; i < stringLength; i += 1) {
+                int c = string.charAt(i);
+                if (c <= 0x7F) {
+                    this.length += 1;
+                } else if (c <= 0x3FFF) {
+                    this.length += 2;
+                } else {
+                    if (c >= 0xD800 && c <= 0xDFFF) {
+                        i += 1;
+                        int d = string.charAt(i);
+                        if (c > 0xDBFF || d < 0xDC00 || d > 0xDFFF) {
+                            throw new JSONException("Bad UTF16");
+                        }
+                    }
+                    this.length += 3;
+                }
+            }
+
+// Second pass: Allocate a byte array and fill that array with the conversion
+// while computing the hashcode.
+
+            this.bytes = new byte[length];
+            int at = 0;
+            int b;
+            int sum = 1;
+            for (int i = 0; i < stringLength; i += 1) {
+                int character = string.charAt(i);
+                if (character <= 0x7F) {
+                    bytes[at] = (byte) character;
+                    sum += character;
+                    this.hashcode += sum;
+                    at += 1;
+                } else if (character <= 0x3FFF) {
+                    b = 0x80 | (character >>> 7);
+                    bytes[at] = (byte) b;
+                    sum += b;
+                    this.hashcode += sum;
+                    at += 1;
+                    b = character & 0x7F;
+                    bytes[at] = (byte) b;
+                    sum += b;
+                    this.hashcode += sum;
+                    at += 1;
+                } else {
+                    if (character >= 0xD800 && character <= 0xDBFF) {
+                        i += 1;
+                        character = (((character & 0x3FF) << 10) | (string
+                                .charAt(i) & 0x3FF)) + 65536;
+                    }
+                    b = 0x80 | (character >>> 14);
+                    bytes[at] = (byte) b;
+                    sum += b;
+                    this.hashcode += sum;
+                    at += 1;
+                    b = 0x80 | ((character >>> 7) & 0xFF);
+                    bytes[at] = (byte) b;
+                    sum += b;
+                    this.hashcode += sum;
+                    at += 1;
+                    b = character & 0x7F;
+                    bytes[at] = (byte) b;
+                    sum += b;
+                    this.hashcode += sum;
+                    at += 1;
+                }
+            }
+            this.hashcode += sum << 16;
+        }
+    }
+
+    /**
+     * Returns the character at the specified index. The index refers to byte
+     * values and ranges from 0 to length - 1. The index of the next character
+     * is at index + Kim.characterSize(kim.characterAt(index)).
+     *
+     * @param at
+     *            the index of the char value. The first character is at 0.
+     * @returns a Unicode character between 0 and 0x10FFFF.
+     * @throws JSONException
+     *             if at does not point to a valid character.
+     */
+    public int characterAt(int at) throws JSONException {
+        int c = get(at);
+        if ((c & 0x80) == 0) {
+            return c;
+        }
+        int character;
+        int c1 = get(at + 1);
+        if ((c1 & 0x80) == 0) {
+            character = ((c & 0x7F) << 7) | c1;
+            if (character > 0x7F) {
+                return character;
+            }
+        } else {
+            int c2 = get(at + 2);
+            character = ((c & 0x7F) << 14) | ((c1 & 0x7F) << 7) | c2;
+            if ((c2 & 0x80) == 0 && character > 0x3FFF && character <= 0x10FFFF
+                    && (character < 0xD800 || character > 0xDFFF)) {
+                return character;
+            }
+        }
+        throw new JSONException("Bad character at " + at);
+    }
+
+    /**
+     * Returns the number of bytes needed to contain the character in Kim
+     * format.
+     *
+     * @param character
+     *            a Unicode character between 0 and 0x10FFFF.
+     * @return 1, 2, or 3
+     * @throws JSONException
+     *             if the character is not representable in a kim.
+     */
+    public static int characterSize(int character) throws JSONException {
+        if (character < 0 || character > 0x10FFFF) {
+            throw new JSONException("Bad character " + character);
+        }
+        return character <= 0x7F ? 1 : character <= 0x3FFF ? 2 : 3;
+    }
+
+    /**
+     * Copy the contents of this kim to a byte array.
+     *
+     * @param bytes
+     *            A byte array of sufficient size.
+     * @param at
+     *            The position within the byte array to take the byes.
+     * @return The position immediately after the copy.
+     */
+    public int copy(byte[] bytes, int at) {
+        System.arraycopy(this.bytes, 0, bytes, at, this.length);
+        return at + this.length;
+    }
+
+    /**
+     * Two kim objects containing exactly the same bytes in the same order are
+     * equal to each other.
+     *
+     * @param obj
+     *            the other kim with which to compare.
+     * @returns true if this and obj are both kim objects containing identical
+     *          byte sequences.
+     */
+    public boolean equals(Object obj) {
+        if (!(obj instanceof Kim)) {
+            return false;
+        }
+        Kim that = (Kim) obj;
+        if (this == that) {
+            return true;
+        }
+        if (this.hashcode != that.hashcode) {
+            return false;
+        }
+        return java.util.Arrays.equals(this.bytes, that.bytes);
+    }
+
+    /**
+     * Get a byte from a kim.
+     * @param at
+     *            The position of the byte. The first byte is at 0.
+     * @return The byte.
+     * @throws JSONException
+     *             if there is no byte at that position.
+     */
+    public int get(int at) throws JSONException {
+        if (at < 0 || at > this.length) {
+            throw new JSONException("Bad character at " + at);
+        }
+        return ((int) this.bytes[at]) & 0xFF;
+    }
+
+    /**
+     * Returns a hash code value for the kim.
+     */
+    public int hashCode() {
+        return this.hashcode;
+    }
+
+    /**
+     * Produce a UTF-16 String from this kim. The number of codepoints in the
+     * string will not be greater than the number of bytes in the kim, although
+     * it could be less.
+     *
+     * @return The string. A kim memoizes its string representation.
+     * @throws JSONException
+     *             if the kim is not valid.
+     */
+    public String toString() throws JSONException {
+        if (this.string == null) {
+            int c;
+            int length = 0;
+            char chars[] = new char[this.length];
+            for (int at = 0; at < this.length; at += characterSize(c)) {
+                c = this.characterAt(at);
+                if (c < 0x10000) {
+                    chars[length] = (char) c;
+                    length += 1;
+                } else {
+                    chars[length] = (char) (0xD800 | ((c - 0x10000) >>> 10));
+                    length += 1;
+                    chars[length] = (char) (0xDC00 | (c & 0x03FF));
+                    length += 1;
+                }
+            }
+            this.string = new String(chars, 0, length);
+        }
+        return this.string;
+    }
+}
diff --git a/src/org/json/Property.java b/src/org/json/Property.java
new file mode 100644
index 0000000..dbbd7ef
--- /dev/null
+++ b/src/org/json/Property.java
@@ -0,0 +1,74 @@
+package org.json;
+
+/*
+Copyright (c) 2002 JSON.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+The Software shall be used for Good, not Evil.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.Properties;
+
+/**
+ * Converts a Property file data into JSONObject and back.
+ * @author JSON.org
+ * @version 2013-05-23
+ */
+public class Property {
+    /**
+     * Converts a property file object into a JSONObject. The property file object is a table of name value pairs.
+     * @param properties java.util.Properties
+     * @return JSONObject
+     * @throws JSONException
+     */
+    public static JSONObject toJSONObject(java.util.Properties properties) throws JSONException {
+        JSONObject jo = new JSONObject();
+        if (properties != null && !properties.isEmpty()) {
+            Enumeration enumProperties = properties.propertyNames();
+            while(enumProperties.hasMoreElements()) {
+                String name = (String)enumProperties.nextElement();
+                jo.put(name, properties.getProperty(name));
+            }
+        }
+        return jo;
+
+    }
+
+    /**
+     * Converts the JSONObject into a property file object.
+     * @param jo JSONObject
+     * @return java.util.Properties
+     * @throws JSONException
+     */
+    public static Properties toProperties(JSONObject jo)  throws JSONException {
+        Properties  properties = new Properties();
+        if (jo != null) {
+            Iterator keys = jo.keys();
+
+            while (keys.hasNext()) {
+                String name = keys.next().toString();
+                properties.put(name, jo.getString(name));
+            }
+        }
+        return properties;
+    }
+}
\ No newline at end of file
diff --git a/src/org/json/README b/src/org/json/README
new file mode 100755
index 0000000..b77c71a
--- /dev/null
+++ b/src/org/json/README
@@ -0,0 +1,68 @@
+JSON in Java [package org.json]
+
+Douglas Crockford
+douglas at crockford.com
+
+2011-02-02
+
+
+JSON is a light-weight, language independent, data interchange format.
+See http://www.JSON.org/
+
+The files in this package implement JSON encoders/decoders in Java.
+It also includes the capability to convert between JSON and XML, HTTP
+headers, Cookies, and CDL.
+
+This is a reference implementation. There is a large number of JSON packages
+in Java. Perhaps someday the Java community will standardize on one. Until
+then, choose carefully.
+
+The license includes this restriction: "The software shall be used for good,
+not evil." If your conscience cannot live with that, then choose a different
+package.
+
+The package compiles on Java 1.2 thru Java 1.4.
+
+
+JSONObject.java: The JSONObject can parse text from a String or a JSONTokener
+to produce a map-like object. The object provides methods for manipulating its
+contents, and for producing a JSON compliant object serialization.
+
+JSONArray.java: The JSONObject can parse text from a String or a JSONTokener
+to produce a vector-like object. The object provides methods for manipulating
+its contents, and for producing a JSON compliant array serialization.
+
+JSONTokener.java: The JSONTokener breaks a text into a sequence of individual
+tokens. It can be constructed from a String, Reader, or InputStream.
+
+JSONException.java: The JSONException is the standard exception type thrown
+by this package.
+
+
+JSONString.java: The JSONString interface requires a toJSONString method,
+allowing an object to provide its own serialization.
+
+JSONStringer.java: The JSONStringer provides a convenient facility for
+building JSON strings.
+
+JSONWriter.java: The JSONWriter provides a convenient facility for building
+JSON text through a writer.
+
+
+CDL.java: CDL provides support for converting between JSON and comma
+delimited lists.
+
+Cookie.java: Cookie provides support for converting between JSON and cookies.
+
+CookieList.java: CookieList provides support for converting between JSON and
+cookie lists.
+
+HTTP.java: HTTP provides support for converting between JSON and HTTP headers.
+
+HTTPTokener.java: HTTPTokener extends JSONTokener for parsing HTTP headers.
+
+XML.java: XML provides support for converting between JSON and XML.
+
+JSONML.java: JSONML provides support for converting between JSONML and XML.
+
+XMLTokener.java: XMLTokener extends JSONTokener for parsing XML text.
diff --git a/src/org/json/XML.java b/src/org/json/XML.java
new file mode 100755
index 0000000..d49784d
--- /dev/null
+++ b/src/org/json/XML.java
@@ -0,0 +1,508 @@
+package org.json;
+
+/*
+Copyright (c) 2002 JSON.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+The Software shall be used for Good, not Evil.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+import java.util.Iterator;
+
+
+/**
+ * This provides static methods to convert an XML text into a JSONObject,
+ * and to covert a JSONObject into an XML text.
+ * @author JSON.org
+ * @version 2012-10-26
+ */
+public class XML {
+
+    /** The Character '&'. */
+    public static final Character AMP   = new Character('&');
+
+    /** The Character '''. */
+    public static final Character APOS  = new Character('\'');
+
+    /** The Character '!'. */
+    public static final Character BANG  = new Character('!');
+
+    /** The Character '='. */
+    public static final Character EQ    = new Character('=');
+
+    /** The Character '>'. */
+    public static final Character GT    = new Character('>');
+
+    /** The Character '<'. */
+    public static final Character LT    = new Character('<');
+
+    /** The Character '?'. */
+    public static final Character QUEST = new Character('?');
+
+    /** The Character '"'. */
+    public static final Character QUOT  = new Character('"');
+
+    /** The Character '/'. */
+    public static final Character SLASH = new Character('/');
+
+    /**
+     * Replace special characters with XML escapes:
+     * <pre>
+     * & <small>(ampersand)</small> is replaced by &amp;
+     * < <small>(less than)</small> is replaced by &lt;
+     * > <small>(greater than)</small> is replaced by &gt;
+     * " <small>(double quote)</small> is replaced by &quot;
+     * </pre>
+     * @param string The string to be escaped.
+     * @return The escaped string.
+     */
+    public static String escape(String string) {
+        StringBuffer sb = new StringBuffer();
+        for (int i = 0, length = string.length(); i < length; i++) {
+            char c = string.charAt(i);
+            switch (c) {
+            case '&':
+                sb.append("&");
+                break;
+            case '<':
+                sb.append("<");
+                break;
+            case '>':
+                sb.append(">");
+                break;
+            case '"':
+                sb.append(""");
+                break;
+            case '\'':
+                sb.append("'");
+                break;
+            default:
+                sb.append(c);
+            }
+        }
+        return sb.toString();
+    }
+
+    /**
+     * Throw an exception if the string contains whitespace.
+     * Whitespace is not allowed in tagNames and attributes.
+     * @param string
+     * @throws JSONException
+     */
+    public static void noSpace(String string) throws JSONException {
+        int i, length = string.length();
+        if (length == 0) {
+            throw new JSONException("Empty string.");
+        }
+        for (i = 0; i < length; i += 1) {
+            if (Character.isWhitespace(string.charAt(i))) {
+                throw new JSONException("'" + string +
+                        "' contains a space character.");
+            }
+        }
+    }
+
+    /**
+     * Scan the content following the named tag, attaching it to the context.
+     * @param x       The XMLTokener containing the source string.
+     * @param context The JSONObject that will include the new material.
+     * @param name    The tag name.
+     * @return true if the close tag is processed.
+     * @throws JSONException
+     */
+    private static boolean parse(XMLTokener x, JSONObject context,
+                                 String name) throws JSONException {
+        char       c;
+        int        i;
+        JSONObject jsonobject = null;
+        String     string;
+        String     tagName;
+        Object     token;
+
+// Test for and skip past these forms:
+//      <!-- ... -->
+//      <!   ...   >
+//      <![  ... ]]>
+//      <?   ...  ?>
+// Report errors for these forms:
+//      <>
+//      <=
+//      <<
+
+        token = x.nextToken();
+
+// <!
+
+        if (token == BANG) {
+            c = x.next();
+            if (c == '-') {
+                if (x.next() == '-') {
+                    x.skipPast("-->");
+                    return false;
+                }
+                x.back();
+            } else if (c == '[') {
+                token = x.nextToken();
+                if ("CDATA".equals(token)) {
+                    if (x.next() == '[') {
+                        string = x.nextCDATA();
+                        if (string.length() > 0) {
+                            context.accumulate("content", string);
+                        }
+                        return false;
+                    }
+                }
+                throw x.syntaxError("Expected 'CDATA['");
+            }
+            i = 1;
+            do {
+                token = x.nextMeta();
+                if (token == null) {
+                    throw x.syntaxError("Missing '>' after '<!'.");
+                } else if (token == LT) {
+                    i += 1;
+                } else if (token == GT) {
+                    i -= 1;
+                }
+            } while (i > 0);
+            return false;
+        } else if (token == QUEST) {
+
+// <?
+
+            x.skipPast("?>");
+            return false;
+        } else if (token == SLASH) {
+
+// Close tag </
+
+            token = x.nextToken();
+            if (name == null) {
+                throw x.syntaxError("Mismatched close tag " + token);
+            }
+            if (!token.equals(name)) {
+                throw x.syntaxError("Mismatched " + name + " and " + token);
+            }
+            if (x.nextToken() != GT) {
+                throw x.syntaxError("Misshaped close tag");
+            }
+            return true;
+
+        } else if (token instanceof Character) {
+            throw x.syntaxError("Misshaped tag");
+
+// Open tag <
+
+        } else {
+            tagName = (String)token;
+            token = null;
+            jsonobject = new JSONObject();
+            for (;;) {
+                if (token == null) {
+                    token = x.nextToken();
+                }
+
+// attribute = value
+
+                if (token instanceof String) {
+                    string = (String)token;
+                    token = x.nextToken();
+                    if (token == EQ) {
+                        token = x.nextToken();
+                        if (!(token instanceof String)) {
+                            throw x.syntaxError("Missing value");
+                        }
+                        jsonobject.accumulate(string,
+                                XML.stringToValue((String)token));
+                        token = null;
+                    } else {
+                        jsonobject.accumulate(string, "");
+                    }
+
+// Empty tag <.../>
+
+                } else if (token == SLASH) {
+                    if (x.nextToken() != GT) {
+                        throw x.syntaxError("Misshaped tag");
+                    }
+                    if (jsonobject.length() > 0) {
+                        context.accumulate(tagName, jsonobject);
+                    } else {
+                        context.accumulate(tagName, "");
+                    }
+                    return false;
+
+// Content, between <...> and </...>
+
+                } else if (token == GT) {
+                    for (;;) {
+                        token = x.nextContent();
+                        if (token == null) {
+                            if (tagName != null) {
+                                throw x.syntaxError("Unclosed tag " + tagName);
+                            }
+                            return false;
+                        } else if (token instanceof String) {
+                            string = (String)token;
+                            if (string.length() > 0) {
+                                jsonobject.accumulate("content",
+                                        XML.stringToValue(string));
+                            }
+
+// Nested element
+
+                        } else if (token == LT) {
+                            if (parse(x, jsonobject, tagName)) {
+                                if (jsonobject.length() == 0) {
+                                    context.accumulate(tagName, "");
+                                } else if (jsonobject.length() == 1 &&
+                                       jsonobject.opt("content") != null) {
+                                    context.accumulate(tagName,
+                                            jsonobject.opt("content"));
+                                } else {
+                                    context.accumulate(tagName, jsonobject);
+                                }
+                                return false;
+                            }
+                        }
+                    }
+                } else {
+                    throw x.syntaxError("Misshaped tag");
+                }
+            }
+        }
+    }
+
+
+    /**
+     * Try to convert a string into a number, boolean, or null. If the string
+     * can't be converted, return the string. This is much less ambitious than
+     * JSONObject.stringToValue, especially because it does not attempt to
+     * convert plus forms, octal forms, hex forms, or E forms lacking decimal
+     * points.
+     * @param string A String.
+     * @return A simple JSON value.
+     */
+    public static Object stringToValue(String string) {
+        if ("".equals(string)) {
+            return string;
+        }
+        if ("true".equalsIgnoreCase(string)) {
+            return Boolean.TRUE;
+        }
+        if ("false".equalsIgnoreCase(string)) {
+            return Boolean.FALSE;
+        }
+        if ("null".equalsIgnoreCase(string)) {
+            return JSONObject.NULL;
+        }
+        if ("0".equals(string)) {
+            return new Integer(0);
+        }
+
+// If it might be a number, try converting it. If that doesn't work,
+// return the string.
+
+        try {
+            char initial = string.charAt(0);
+            boolean negative = false;
+            if (initial == '-') {
+                initial = string.charAt(1);
+                negative = true;
+            }
+            if (initial == '0' && string.charAt(negative ? 2 : 1) == '0') {
+                return string;
+            }
+            if ((initial >= '0' && initial <= '9')) {
+                if (string.indexOf('.') >= 0) {
+                    return Double.valueOf(string);
+                } else if (string.indexOf('e') < 0 && string.indexOf('E') < 0) {
+                    Long myLong = new Long(string);
+                    if (myLong.longValue() == myLong.intValue()) {
+                        return new Integer(myLong.intValue());
+                    } else {
+                        return myLong;
+                    }
+                }
+            }
+        }  catch (Exception ignore) {
+        }
+        return string;
+    }
+
+
+    /**
+     * Convert a well-formed (but not necessarily valid) XML string into a
+     * JSONObject. Some information may be lost in this transformation
+     * because JSON is a data format and XML is a document format. XML uses
+     * elements, attributes, and content text, while JSON uses unordered
+     * collections of name/value pairs and arrays of values. JSON does not
+     * does not like to distinguish between elements and attributes.
+     * Sequences of similar elements are represented as JSONArrays. Content
+     * text may be placed in a "content" member. Comments, prologs, DTDs, and
+     * <code><[ [ ]]></code> are ignored.
+     * @param string The source string.
+     * @return A JSONObject containing the structured data from the XML string.
+     * @throws JSONException
+     */
+    public static JSONObject toJSONObject(String string) throws JSONException {
+        JSONObject jo = new JSONObject();
+        XMLTokener x = new XMLTokener(string);
+        while (x.more() && x.skipPast("<")) {
+            parse(x, jo, null);
+        }
+        return jo;
+    }
+
+
+    /**
+     * Convert a JSONObject into a well-formed, element-normal XML string.
+     * @param object A JSONObject.
+     * @return  A string.
+     * @throws  JSONException
+     */
+    public static String toString(Object object) throws JSONException {
+        return toString(object, null);
+    }
+
+
+    /**
+     * Convert a JSONObject into a well-formed, element-normal XML string.
+     * @param object A JSONObject.
+     * @param tagName The optional name of the enclosing tag.
+     * @return A string.
+     * @throws JSONException
+     */
+    public static String toString(Object object, String tagName)
+            throws JSONException {
+        StringBuffer sb = new StringBuffer();
+        int          i;
+        JSONArray    ja;
+        JSONObject   jo;
+        String       key;
+        Iterator     keys;
+        int          length;
+        String       string;
+        Object       value;
+        if (object instanceof JSONObject) {
+
+// Emit <tagName>
+
+            if (tagName != null) {
+                sb.append('<');
+                sb.append(tagName);
+                sb.append('>');
+            }
+
+// Loop thru the keys.
+
+            jo = (JSONObject)object;
+            keys = jo.keys();
+            while (keys.hasNext()) {
+                key = keys.next().toString();
+                value = jo.opt(key);
+                if (value == null) {
+                    value = "";
+                }
+                if (value instanceof String) {
+                    string = (String)value;
+                } else {
+                    string = null;
+                }
+
+// Emit content in body
+
+                if ("content".equals(key)) {
+                    if (value instanceof JSONArray) {
+                        ja = (JSONArray)value;
+                        length = ja.length();
+                        for (i = 0; i < length; i += 1) {
+                            if (i > 0) {
+                                sb.append('\n');
+                            }
+                            sb.append(escape(ja.get(i).toString()));
+                        }
+                    } else {
+                        sb.append(escape(value.toString()));
+                    }
+
+// Emit an array of similar keys
+
+                } else if (value instanceof JSONArray) {
+                    ja = (JSONArray)value;
+                    length = ja.length();
+                    for (i = 0; i < length; i += 1) {
+                        value = ja.get(i);
+                        if (value instanceof JSONArray) {
+                            sb.append('<');
+                            sb.append(key);
+                            sb.append('>');
+                            sb.append(toString(value));
+                            sb.append("</");
+                            sb.append(key);
+                            sb.append('>');
+                        } else {
+                            sb.append(toString(value, key));
+                        }
+                    }
+                } else if ("".equals(value)) {
+                    sb.append('<');
+                    sb.append(key);
+                    sb.append("/>");
+
+// Emit a new tag <k>
+
+                } else {
+                    sb.append(toString(value, key));
+                }
+            }
+            if (tagName != null) {
+
+// Emit the </tagname> close tag
+
+                sb.append("</");
+                sb.append(tagName);
+                sb.append('>');
+            }
+            return sb.toString();
+
+// XML does not have good support for arrays. If an array appears in a place
+// where XML is lacking, synthesize an <array> element.
+
+        } else {
+            if (object.getClass().isArray()) {
+                object = new JSONArray(object);
+            }
+            if (object instanceof JSONArray) {
+                ja = (JSONArray)object;
+                length = ja.length();
+                for (i = 0; i < length; i += 1) {
+                    sb.append(toString(ja.opt(i), tagName == null ? "array" : tagName));
+                }
+                return sb.toString();
+            } else {
+                string = (object == null) ? "null" : escape(object.toString());
+                return (tagName == null) ? "\"" + string + "\"" :
+                    (string.length() == 0) ? "<" + tagName + "/>" :
+                    "<" + tagName + ">" + string + "</" + tagName + ">";
+            }
+        }
+    }
+}
diff --git a/src/org/json/XMLTokener.java b/src/org/json/XMLTokener.java
new file mode 100755
index 0000000..be15ebe
--- /dev/null
+++ b/src/org/json/XMLTokener.java
@@ -0,0 +1,365 @@
+package org.json;
+
+/*
+Copyright (c) 2002 JSON.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+The Software shall be used for Good, not Evil.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+/**
+ * The XMLTokener extends the JSONTokener to provide additional methods
+ * for the parsing of XML texts.
+ * @author JSON.org
+ * @version 2012-11-13
+ */
+public class XMLTokener extends JSONTokener {
+
+
+   /** The table of entity values. It initially contains Character values for
+    * amp, apos, gt, lt, quot.
+    */
+   public static final java.util.HashMap entity;
+
+   static {
+       entity = new java.util.HashMap(8);
+       entity.put("amp",  XML.AMP);
+       entity.put("apos", XML.APOS);
+       entity.put("gt",   XML.GT);
+       entity.put("lt",   XML.LT);
+       entity.put("quot", XML.QUOT);
+   }
+
+    /**
+     * Construct an XMLTokener from a string.
+     * @param s A source string.
+     */
+    public XMLTokener(String s) {
+        super(s);
+    }
+
+    /**
+     * Get the text in the CDATA block.
+     * @return The string up to the <code>]]></code>.
+     * @throws JSONException If the <code>]]></code> is not found.
+     */
+    public String nextCDATA() throws JSONException {
+        char         c;
+        int          i;
+        StringBuffer sb = new StringBuffer();
+        for (;;) {
+            c = next();
+            if (end()) {
+                throw syntaxError("Unclosed CDATA");
+            }
+            sb.append(c);
+            i = sb.length() - 3;
+            if (i >= 0 && sb.charAt(i) == ']' &&
+                          sb.charAt(i + 1) == ']' && sb.charAt(i + 2) == '>') {
+                sb.setLength(i);
+                return sb.toString();
+            }
+        }
+    }
+
+
+    /**
+     * Get the next XML outer token, trimming whitespace. There are two kinds
+     * of tokens: the '<' character which begins a markup tag, and the content
+     * text between markup tags.
+     *
+     * @return  A string, or a '<' Character, or null if there is no more
+     * source text.
+     * @throws JSONException
+     */
+    public Object nextContent() throws JSONException {
+        char         c;
+        StringBuffer sb;
+        do {
+            c = next();
+        } while (Character.isWhitespace(c));
+        if (c == 0) {
+            return null;
+        }
+        if (c == '<') {
+            return XML.LT;
+        }
+        sb = new StringBuffer();
+        for (;;) {
+            if (c == '<' || c == 0) {
+                back();
+                return sb.toString().trim();
+            }
+            if (c == '&') {
+                sb.append(nextEntity(c));
+            } else {
+                sb.append(c);
+            }
+            c = next();
+        }
+    }
+
+
+    /**
+     * Return the next entity. These entities are translated to Characters:
+     *     <code>&  '  >  <  "</code>.
+     * @param ampersand An ampersand character.
+     * @return  A Character or an entity String if the entity is not recognized.
+     * @throws JSONException If missing ';' in XML entity.
+     */
+    public Object nextEntity(char ampersand) throws JSONException {
+        StringBuffer sb = new StringBuffer();
+        for (;;) {
+            char c = next();
+            if (Character.isLetterOrDigit(c) || c == '#') {
+                sb.append(Character.toLowerCase(c));
+            } else if (c == ';') {
+                break;
+            } else {
+                throw syntaxError("Missing ';' in XML entity: &" + sb);
+            }
+        }
+        String string = sb.toString();
+        Object object = entity.get(string);
+        return object != null ? object : ampersand + string + ";";
+    }
+
+
+    /**
+     * Returns the next XML meta token. This is used for skipping over <!...>
+     * and <?...?> structures.
+     * @return Syntax characters (<code>< > / = ! ?</code>) are returned as
+     *  Character, and strings and names are returned as Boolean. We don't care
+     *  what the values actually are.
+     * @throws JSONException If a string is not properly closed or if the XML
+     *  is badly structured.
+     */
+    public Object nextMeta() throws JSONException {
+        char c;
+        char q;
+        do {
+            c = next();
+        } while (Character.isWhitespace(c));
+        switch (c) {
+        case 0:
+            throw syntaxError("Misshaped meta tag");
+        case '<':
+            return XML.LT;
+        case '>':
+            return XML.GT;
+        case '/':
+            return XML.SLASH;
+        case '=':
+            return XML.EQ;
+        case '!':
+            return XML.BANG;
+        case '?':
+            return XML.QUEST;
+        case '"':
+        case '\'':
+            q = c;
+            for (;;) {
+                c = next();
+                if (c == 0) {
+                    throw syntaxError("Unterminated string");
+                }
+                if (c == q) {
+                    return Boolean.TRUE;
+                }
+            }
+        default:
+            for (;;) {
+                c = next();
+                if (Character.isWhitespace(c)) {
+                    return Boolean.TRUE;
+                }
+                switch (c) {
+                case 0:
+                case '<':
+                case '>':
+                case '/':
+                case '=':
+                case '!':
+                case '?':
+                case '"':
+                case '\'':
+                    back();
+                    return Boolean.TRUE;
+                }
+            }
+        }
+    }
+
+
+    /**
+     * Get the next XML Token. These tokens are found inside of angle
+     * brackets. It may be one of these characters: <code>/ > = ! ?</code> or it
+     * may be a string wrapped in single quotes or double quotes, or it may be a
+     * name.
+     * @return a String or a Character.
+     * @throws JSONException If the XML is not well formed.
+     */
+    public Object nextToken() throws JSONException {
+        char c;
+        char q;
+        StringBuffer sb;
+        do {
+            c = next();
+        } while (Character.isWhitespace(c));
+        switch (c) {
+        case 0:
+            throw syntaxError("Misshaped element");
+        case '<':
+            throw syntaxError("Misplaced '<'");
+        case '>':
+            return XML.GT;
+        case '/':
+            return XML.SLASH;
+        case '=':
+            return XML.EQ;
+        case '!':
+            return XML.BANG;
+        case '?':
+            return XML.QUEST;
+
+// Quoted string
+
+        case '"':
+        case '\'':
+            q = c;
+            sb = new StringBuffer();
+            for (;;) {
+                c = next();
+                if (c == 0) {
+                    throw syntaxError("Unterminated string");
+                }
+                if (c == q) {
+                    return sb.toString();
+                }
+                if (c == '&') {
+                    sb.append(nextEntity(c));
+                } else {
+                    sb.append(c);
+                }
+            }
+        default:
+
+// Name
+
+            sb = new StringBuffer();
+            for (;;) {
+                sb.append(c);
+                c = next();
+                if (Character.isWhitespace(c)) {
+                    return sb.toString();
+                }
+                switch (c) {
+                case 0:
+                    return sb.toString();
+                case '>':
+                case '/':
+                case '=':
+                case '!':
+                case '?':
+                case '[':
+                case ']':
+                    back();
+                    return sb.toString();
+                case '<':
+                case '"':
+                case '\'':
+                    throw syntaxError("Bad character in a name");
+                }
+            }
+        }
+    }
+
+
+    /**
+     * Skip characters until past the requested string.
+     * If it is not found, we are left at the end of the source with a result of false.
+     * @param to A string to skip past.
+     * @throws JSONException
+     */
+    public boolean skipPast(String to) throws JSONException {
+        boolean b;
+        char c;
+        int i;
+        int j;
+        int offset = 0;
+        int length = to.length();
+        char[] circle = new char[length];
+
+        /*
+         * First fill the circle buffer with as many characters as are in the
+         * to string. If we reach an early end, bail.
+         */
+
+        for (i = 0; i < length; i += 1) {
+            c = next();
+            if (c == 0) {
+                return false;
+            }
+            circle[i] = c;
+        }
+
+        /* We will loop, possibly for all of the remaining characters. */
+
+        for (;;) {
+            j = offset;
+            b = true;
+
+            /* Compare the circle buffer with the to string. */
+
+            for (i = 0; i < length; i += 1) {
+                if (circle[j] != to.charAt(i)) {
+                    b = false;
+                    break;
+                }
+                j += 1;
+                if (j >= length) {
+                    j -= length;
+                }
+            }
+
+            /* If we exit the loop with b intact, then victory is ours. */
+
+            if (b) {
+                return true;
+            }
+
+            /* Get the next character. If there isn't one, then defeat is ours. */
+
+            c = next();
+            if (c == 0) {
+                return false;
+            }
+            /*
+             * Shove the character in the circle buffer and advance the
+             * circle offset. The offset is mod n.
+             */
+            circle[offset] = c;
+            offset += 1;
+            if (offset >= length) {
+                offset -= length;
+            }
+        }
+    }
+}
diff --git a/src/org/json/zip/BitInputStream.java b/src/org/json/zip/BitInputStream.java
new file mode 100644
index 0000000..7864ce1
--- /dev/null
+++ b/src/org/json/zip/BitInputStream.java
@@ -0,0 +1,169 @@
+package org.json.zip;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+/*
+ Copyright (c) 2013 JSON.org
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ The Software shall be used for Good, not Evil.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+ */
+
+/**
+ * This is a big endian bit reader. It reads its bits from an InputStream.
+ *
+ * @version 2013-04-18
+ *
+ */
+public class BitInputStream implements BitReader {
+    /**
+     * 2^n - 1
+     */
+    static final int[] mask = { 0, 1, 3, 7, 15, 31, 63, 127, 255 };
+
+    /**
+     * The number of bits remaining in the current byte.
+     */
+    private int available = 0;
+
+    /**
+     * Up to a byte's worth of unread bits.
+     */
+    private int unread = 0;
+
+    /**
+     * The source of the bits.
+     */
+    private InputStream in;
+
+    /**
+     * The number of bits read so far. This is used in padding.
+     */
+    private long nrBits = 0;
+
+    /**
+     * Make a BitReader from an InputStream. The BitReader will take bytes from
+     * the InputStream and unpack them into bits.
+     *
+     * @param in
+     *            An InputStream.
+     */
+    public BitInputStream(InputStream in) {
+        this.in = in;
+    }
+
+    /**
+     * Make a BitReader. The first byte is passed in explicitly, the remaining
+     * bytes are obtained from the InputStream. This makes it possible to look
+     * at the first byte of a stream before deciding that it should be read as
+     * bits.
+     *
+     * @param in
+     *            An InputStream
+     * @param firstByte
+     *            The first byte, which was probably read from in.
+     */
+    public BitInputStream(InputStream in, int firstByte) {
+        this.in = in;
+        this.unread = firstByte;
+        this.available = 8;
+    }
+
+    /**
+     * Read one bit.
+     *
+     * @return true if it is a 1 bit.
+     */
+    public boolean bit() throws IOException {
+        return read(1) != 0;
+    }
+
+    /**
+     * Get the number of bits that have been read from this BitInputStream.
+     * This includes pad bits that have been skipped, but might not include
+     * bytes that have been read from the underlying InputStream that have not
+     * yet been delivered as bits.
+     *
+     * @return The number of bits read so far.
+     */
+    public long nrBits() {
+        return this.nrBits;
+    }
+
+    /**
+     * Check that the rest of the block has been padded with zeroes.
+     *
+     * @param factor
+     *            The size of the block to pad. This will typically be 8, 16,
+     *            32, 64, 128, 256, etc.
+     * @return true if the block was zero padded, or false if the the padding
+     *         contains any one bits.
+     * @throws IOException
+     */
+    public boolean pad(int factor) throws IOException {
+        int padding = factor - (int) (this.nrBits % factor);
+        boolean result = true;
+
+        for (int i = 0; i < padding; i += 1) {
+            if (bit()) {
+                result = false;
+            }
+        }
+        return result;
+    }
+
+    /**
+     * Read some bits.
+     *
+     * @param width
+     *            The number of bits to read. (0..32)
+     * @throws IOException
+     * @return the bits
+     */
+    public int read(int width) throws IOException {
+        if (width == 0) {
+            return 0;
+        }
+        if (width < 0 || width > 32) {
+            throw new IOException("Bad read width.");
+        }
+        int result = 0;
+        while (width > 0) {
+            if (this.available == 0) {
+                this.unread = this.in.read();
+                if (this.unread < 0) {
+                    throw new IOException("Attempt to read past end.");
+                }
+                this.available = 8;
+            }
+            int take = width;
+            if (take > this.available) {
+                take = this.available;
+            }
+            result |= ((this.unread >>> (this.available - take)) & mask[take])
+                    << (width - take);
+            this.nrBits += take;
+            this.available -= take;
+            width -= take;
+        }
+        return result;
+    }
+}
diff --git a/src/org/json/zip/BitOutputStream.java b/src/org/json/zip/BitOutputStream.java
new file mode 100644
index 0000000..526ad61
--- /dev/null
+++ b/src/org/json/zip/BitOutputStream.java
@@ -0,0 +1,154 @@
+package org.json.zip;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+/*
+ Copyright (c) 2013 JSON.org
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ The Software shall be used for Good, not Evil.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+ */
+
+/**
+ * This is a big endian bit writer. It writes its bits to an OutputStream.
+ *
+ * @version 2013-04-18
+ *
+ */
+public class BitOutputStream implements BitWriter {
+
+    /**
+     * The number of bits written.
+     */
+    private long nrBits = 0;
+
+    /**
+     * The destination of the bits.
+     */
+    private OutputStream out;
+
+    /**
+     * Holder of bits not yet written.
+     */
+    private int unwritten;
+
+    /**
+     * The number of unused bits in this.unwritten.
+     */
+    private int vacant = 8;
+
+    /**
+     * Use an OutputStream to produce a BitWriter. The BitWriter will send its
+     * bits to the OutputStream as each byte is filled.
+     *
+     * @param out
+     *            An Output Stream
+     */
+    public BitOutputStream(OutputStream out) {
+        this.out = out;
+    }
+
+    /**
+     * Returns the number of bits that have been written to this
+     * bitOutputStream. This may include bits that have not yet been written
+     * to the underlying outputStream.
+     */
+    public long nrBits() {
+        return this.nrBits;
+    }
+
+    /**
+     * Write a 1 bit.
+     *
+     * @throws IOException
+     */
+    public void one() throws IOException {
+        write(1, 1);
+    }
+
+    /**
+     * Pad the rest of the block with zeroes and flush. pad(8) flushes the last
+     * unfinished byte. The underlying OutputStream will be flushed.
+     *
+     * @param factor
+     *            The size of the block to pad. This will typically be 8, 16,
+     *            32, 64, 128, 256, etc.
+     * @return this
+     * @throws IOException
+     */
+    public void pad(int factor) throws IOException {
+        int padding = factor - (int) (nrBits % factor);
+        int excess = padding & 7;
+        if (excess > 0) {
+            this.write(0, excess);
+            padding -= excess;
+        }
+        while (padding > 0) {
+            this.write(0, 8);
+            padding -= 8;
+        }
+        this.out.flush();
+    }
+
+    /**
+     * Write some bits. Up to 32 bits can be written at a time.
+     *
+     * @param bits
+     *            The bits to be written.
+     * @param width
+     *            The number of bits to write. (0..32)
+     * @throws IOException
+     */
+    public void write(int bits, int width) throws IOException {
+        if (bits == 0 && width == 0) {
+            return;
+        }
+        if (width <= 0 || width > 32) {
+            throw new IOException("Bad write width.");
+        }
+        while (width > 0) {
+            int actual = width;
+            if (actual > this.vacant) {
+                actual = this.vacant;
+            }
+            this.unwritten |= ((bits >>> (width - actual)) &
+                    BitInputStream.mask[actual]) << (this.vacant - actual);
+            width -= actual;
+            nrBits += actual;
+            this.vacant -= actual;
+            if (this.vacant == 0) {
+                this.out.write(this.unwritten);
+                this.unwritten = 0;
+                this.vacant = 8;
+            }
+        }
+    }
+
+    /**
+     * Write a 0 bit.
+     *
+     * @throws IOException
+     */
+    public void zero() throws IOException {
+        write(0, 1);
+
+    }
+}
diff --git a/src/org/json/zip/BitReader.java b/src/org/json/zip/BitReader.java
new file mode 100644
index 0000000..1987729
--- /dev/null
+++ b/src/org/json/zip/BitReader.java
@@ -0,0 +1,41 @@
+package org.json.zip;
+
+import java.io.IOException;
+
+public interface BitReader {
+    /**
+     * Read one bit.
+     *
+     * @return true if it is a 1 bit.
+     */
+    public boolean bit() throws IOException;
+
+    /**
+     * Returns the number of bits that have been read from this bitreader.
+     *
+     * @return The number of bits read so far.
+     */
+    public long nrBits();
+
+    /**
+     * Check that the rest of the block has been padded with zeroes.
+     *
+     * @param factor
+     *            The size in bits of the block to pad. This will typically be
+     *            8, 16, 32, 64, 128, 256, etc.
+     * @return true if the block was zero padded, or false if the the padding
+     *         contained any one bits.
+     * @throws IOException
+     */
+    public boolean pad(int factor) throws IOException;
+
+    /**
+     * Read some bits.
+     *
+     * @param width
+     *            The number of bits to read. (0..32)
+     * @throws IOException
+     * @return the bits
+     */
+    public int read(int width) throws IOException;
+}
diff --git a/src/org/json/zip/BitWriter.java b/src/org/json/zip/BitWriter.java
new file mode 100644
index 0000000..83eb7e3
--- /dev/null
+++ b/src/org/json/zip/BitWriter.java
@@ -0,0 +1,51 @@
+package org.json.zip;
+
+import java.io.IOException;
+
+/**
+ * A bitwriter is a an interface that allows for doing output at the bit level.
+ * Most IO interfaces only allow for writing at the byte level or higher.
+ */
+public interface BitWriter {
+    /**
+     * Returns the number of bits that have been written to this bitwriter.
+     */
+    public long nrBits();
+
+    /**
+     * Write a 1 bit.
+     *
+     * @throws IOException
+     */
+    public void one() throws IOException;
+
+    /**
+     * Pad the rest of the block with zeros and flush.
+     *
+     * @param factor
+     *            The size in bits of the block to pad. This will typically be
+     *            8, 16, 32, 64, 128, 256, etc.
+     * @return true if the block was zero padded, or false if the the padding
+     *         contains any one bits.
+     * @throws IOException
+     */
+    public void pad(int factor) throws IOException;
+
+    /**
+     * Write some bits. Up to 32 bits can be written at a time.
+     *
+     * @param bits
+     *            The bits to be written.
+     * @param width
+     *            The number of bits to write. (0..32)
+     * @throws IOException
+     */
+    public void write(int bits, int width) throws IOException;
+
+    /**
+     * Write a 0 bit.
+     *
+     * @throws IOException
+     */
+    public void zero() throws IOException;
+}
diff --git a/src/org/json/zip/Compressor.java b/src/org/json/zip/Compressor.java
new file mode 100644
index 0000000..6dddff4
--- /dev/null
+++ b/src/org/json/zip/Compressor.java
@@ -0,0 +1,575 @@
+package org.json.zip;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+import org.json.Kim;
+
+/*
+ Copyright (c) 2013 JSON.org
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ The Software shall be used for Good, not Evil.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+ */
+
+/**
+ * JSONzip is a compression scheme for JSON text.
+ *
+ * @author JSON.org
+ * @version 2013-04-18
+ */
+
+/**
+ * A compressor implements the compression behavior of JSONzip. It provides a
+ * zip method that takes a JSONObject or JSONArray and delivers a stream of
+ * bits to a BitWriter.
+ *
+ * FOR EVALUATION PURPOSES ONLY. THIS PACKAGE HAS NOT BEEN TESTED ADEQUATELY
+ * FOR PRODUCTION USE.
+ */
+public class Compressor extends JSONzip {
+
+    /**
+     * A compressor outputs to a BitWriter.
+     */
+    final BitWriter bitwriter;
+
+    /**
+     * Create a new compressor. It may be used for an entire session or
+     * subsession.
+     *
+     * @param bitwriter
+     *            The BitWriter this Compressor will output to. Don't forget to
+     *            flush.
+     */
+    public Compressor(BitWriter bitwriter) {
+        super();
+        this.bitwriter = bitwriter;
+    }
+
+    /**
+     * Return a 4 bit code for a character in a JSON number. The digits '0' to
+     * '9' get the codes 0 to 9. '.' is 10, '-' is 11, '+' is 12, and 'E' or
+     * 'e' is 13.
+     *
+     * @param digit
+     *            An ASCII character from a JSIN number.
+     * @return
+     */
+    private static int bcd(char digit) {
+        if (digit >= '0' && digit <= '9') {
+            return digit - '0';
+        }
+        switch (digit) {
+        case '.':
+            return 10;
+        case '-':
+            return 11;
+        case '+':
+            return 12;
+        default:
+            return 13;
+        }
+    }
+
+    /**
+     * Finish the final byte and flush the bitwriter. This does the same thing
+     * as pad(8).
+     *
+     * @throws JSONException
+     */
+    public void flush() throws JSONException {
+        pad(8);
+    }
+
+    /**
+     * Output a one bit.
+     *
+     * @throws IOException
+     */
+    private void one() throws JSONException {
+        if (probe) {
+            log(1);
+        }
+        write(1, 1);
+    }
+
+    /**
+     * Pad the output to fill an allotment of bits.
+     *
+     * @param factor
+     *            The size of the bit allotment. A value of 8 will complete and
+     *            flush the current byte. If you don't pad, then some of the
+     *            last bits might not be sent to the Output Stream.
+     * @throws JSONException
+     */
+    public void pad(int factor) throws JSONException {
+        try {
+            this.bitwriter.pad(factor);
+        } catch (Throwable e) {
+            throw new JSONException(e);
+        }
+    }
+
+    /**
+     * Write a number, using the number of bits necessary to hold the number.
+     *
+     * @param integer
+     *            The value to be encoded.
+     * @param width
+     *            The number of bits to encode the value, between 0 and 32.
+     * @throws JSONException
+     */
+    private void write(int integer, int width) throws JSONException {
+        try {
+            this.bitwriter.write(integer, width);
+            if (probe) {
+                log(integer, width);
+            }
+        } catch (Throwable e) {
+            throw new JSONException(e);
+        }
+    }
+
+    /**
+     * Write an integer with Huffman encoding. The bit pattern that is written
+     * will be determined by the Huffman encoder.
+     *
+     * @param integer
+     *            The value to be written.
+     * @param huff
+     *            The Huffman encoder.
+     * @throws JSONException
+     */
+    private void write(int integer, Huff huff) throws JSONException {
+        huff.write(integer, this.bitwriter);
+    }
+
+    /**
+     * Write each of the bytes in a kim with Huffman encoding.
+     *
+     * @param kim
+     *            A kim containing the bytes to be written.
+     * @param huff
+     *            The Huffman encoder.
+     * @throws JSONException
+     */
+    private void write(Kim kim, Huff huff) throws JSONException {
+        write(kim, 0, kim.length, huff);
+    }
+
+    /**
+     * Write a range of bytes from a Kim with Huffman encoding.
+     *
+     * @param kim
+     *            A Kim containing the bytes to be written.
+     * @param from
+     *            The index of the first byte to write.
+     * @param thru
+     *            The index after the last byte to write.
+     * @param huff
+     *            The Huffman encoder.
+     * @throws JSONException
+     */
+    private void write(Kim kim, int from, int thru, Huff huff)
+            throws JSONException {
+        for (int at = from; at < thru; at += 1) {
+            write(kim.get(at), huff);
+        }
+    }
+
+    /**
+     * Write an integer, using the number of bits necessary to hold the number
+     * as determined by its keep, and increment its usage count in the keep.
+     *
+     * @param integer
+     *            The value to be encoded.
+     * @param keep
+     *            The Keep that the integer is one of.
+     * @throws JSONException
+     */
+    private void writeAndTick(int integer, Keep keep) throws JSONException {
+        int width = keep.bitsize();
+        keep.tick(integer);
+        if (probe) {
+            log("\"" + keep.value(integer) + "\"");
+        }
+        write(integer, width);
+    }
+
+    /**
+     * Write a JSON Array.
+     *
+     * @param jsonarray
+     * @throws JSONException
+     */
+    private void writeArray(JSONArray jsonarray) throws JSONException {
+
+// JSONzip has three encodings for arrays:
+// The array is empty (zipEmptyArray).
+// First value in the array is a string (zipArrayString).
+// First value in the array is not a string (zipArrayValue).
+
+        boolean stringy = false;
+        int length = jsonarray.length();
+        if (length == 0) {
+            write(zipEmptyArray, 3);
+        } else {
+            Object value = jsonarray.get(0);
+            if (value == null) {
+                value = JSONObject.NULL;
+            }
+            if (value instanceof String) {
+                stringy = true;
+                write(zipArrayString, 3);
+                writeString((String) value);
+            } else {
+                write(zipArrayValue, 3);
+                writeValue(value);
+            }
+            for (int i = 1; i < length; i += 1) {
+                if (probe) {
+                    log();
+                }
+                value = jsonarray.get(i);
+                if (value == null) {
+                    value = JSONObject.NULL;
+                }
+                if (value instanceof String != stringy) {
+                    zero();
+                }
+                one();
+                if (value instanceof String) {
+                    writeString((String) value);
+                } else {
+                    writeValue(value);
+                }
+            }
+            zero();
+            zero();
+
+        }
+    }
+
+    /**
+     * Write a JSON value.
+     *
+     * @param value
+     *            One of these types: JSONObject, JSONArray (or Map or
+     *            Collection or array), Number (or Integer or Long or Double),
+     *            or String, or Boolean, or JSONObject.NULL, or null.
+     * @throws JSONException
+     */
+    private void writeJSON(Object value) throws JSONException {
+        if (JSONObject.NULL.equals(value)) {
+            write(zipNull, 3);
+        } else if (Boolean.FALSE.equals(value)) {
+            write(zipFalse, 3);
+        } else if (Boolean.TRUE.equals(value)) {
+            write(zipTrue, 3);
+        } else {
+            if (value instanceof Map) {
+                value = new JSONObject((Map) value);
+            } else if (value instanceof Collection) {
+                value = new JSONArray((Collection) value);
+            } else if (value.getClass().isArray()) {
+                value = new JSONArray(value);
+            }
+            if (value instanceof JSONObject) {
+                writeObject((JSONObject) value);
+            } else if (value instanceof JSONArray) {
+                writeArray((JSONArray) value);
+            } else {
+                throw new JSONException("Unrecognized object");
+            }
+        }
+    }
+
+    /**
+     * Write the name of an object property. Names have their own Keep and
+     * Huffman encoder because they are expected to be a more restricted set.
+     *
+     * @param name
+     * @throws JSONException
+     */
+    private void writeName(String name) throws JSONException {
+
+// If this name has already been registered, then emit its integer and
+// increment its usage count.
+
+        Kim kim = new Kim(name);
+        int integer = this.namekeep.find(kim);
+        if (integer != none) {
+            one();
+            writeAndTick(integer, this.namekeep);
+        } else {
+
+// Otherwise, emit the string with Huffman encoding, and register it.
+
+            zero();
+            write(kim, this.namehuff);
+            write(end, namehuff);
+            this.namekeep.register(kim);
+        }
+    }
+
+    /**
+     * Write a JSON object.
+     *
+     * @param jsonobject
+     * @return
+     * @throws JSONException
+     */
+    private void writeObject(JSONObject jsonobject) throws JSONException {
+
+// JSONzip has two encodings for objects: Empty Objects (zipEmptyObject) and
+// non-empty objects (zipObject).
+
+        boolean first = true;
+        Iterator keys = jsonobject.keys();
+        while (keys.hasNext()) {
+            if (probe) {
+                log("\n");
+            }
+            Object key = keys.next();
+            if (key instanceof String) {
+                if (first) {
+                    first = false;
+                    write(zipObject, 3);
+                } else {
+                    one();
+                }
+                writeName((String) key);
+                Object value = jsonobject.get((String) key);
+                if (value instanceof String) {
+                    zero();
+                    writeString((String) value);
+                } else {
+                    one();
+                    writeValue(value);
+                }
+            }
+        }
+        if (first) {
+            write(zipEmptyObject, 3);
+        } else {
+            zero();
+        }
+    }
+
+    /**
+     * Write a string.
+     *
+     * @param string
+     * @throws JSONException
+     */
+    private void writeString(String string) throws JSONException {
+
+// Special case for empty strings.
+
+        if (string.length() == 0) {
+            zero();
+            zero();
+            write(end, this.substringhuff);
+            zero();
+        } else {
+            Kim kim = new Kim(string);
+
+// Look for the string in the strings keep. If it is found, emit its
+// integer and count that as a use.
+
+            int integer = this.stringkeep.find(kim);
+            if (integer != none) {
+                one();
+                writeAndTick(integer, this.stringkeep);
+            } else {
+
+// But if it is not found, emit the string's substrings. Register the string
+// so that the next lookup will succeed.
+
+                writeSubstring(kim);
+                this.stringkeep.register(kim);
+            }
+        }
+    }
+
+    /**
+     * Write a string, attempting to match registered substrings.
+     *
+     * @param kim
+     * @throws JSONException
+     */
+    private void writeSubstring(Kim kim) throws JSONException {
+        this.substringkeep.reserve();
+        zero();
+        int from = 0;
+        int thru = kim.length;
+        int until = thru - JSONzip.minSubstringLength;
+        int previousFrom = none;
+        int previousThru = 0;
+
+// Find a substring from the substring keep.
+
+        while (true) {
+            int at;
+            int integer = none;
+            for (at = from; at <= until; at += 1) {
+                integer = this.substringkeep.match(kim, at, thru);
+                if (integer != none) {
+                    break;
+                }
+            }
+            if (integer == none) {
+                break;
+            }
+
+// If a substring is found, emit any characters that were before the matched
+// substring. Then emit the substring's integer and loop back to match the
+// remainder with another substring.
+
+            if (from != at) {
+                zero();
+                write(kim, from, at, this.substringhuff);
+                write(end, this.substringhuff);
+                if (previousFrom != none) {
+                    this.substringkeep.registerOne(kim, previousFrom,
+                            previousThru);
+                    previousFrom = none;
+                }
+            }
+            one();
+            writeAndTick(integer, this.substringkeep);
+            from = at + this.substringkeep.length(integer);
+            if (previousFrom != none) {
+                this.substringkeep.registerOne(kim, previousFrom,
+                        previousThru);
+                previousFrom = none;
+            }
+            previousFrom = at;
+            previousThru = from + 1;
+        }
+
+// If a substring is not found, then emit the remaining characters.
+
+        zero();
+        if (from < thru) {
+            write(kim, from, thru, this.substringhuff);
+            if (previousFrom != none) {
+                this.substringkeep.registerOne(kim, previousFrom, previousThru);
+            }
+        }
+        write(end, this.substringhuff);
+        zero();
+
+// Register the string's substrings in the trie in hopes of future substring
+// matching.
+
+        substringkeep.registerMany(kim);
+    }
+
+    /**
+     * Write a value.
+     *
+     * @param value
+     *            One of these types: Boolean, Number, etc.
+     * @throws JSONException
+     */
+    private void writeValue(Object value) throws JSONException {
+        if (value instanceof Number) {
+            String string = JSONObject.numberToString((Number) value);
+            int integer = this.values.find(string);
+            if (integer != none) {
+                write(2, 2);
+                writeAndTick(integer, this.values);
+                return;
+            }
+            if (value instanceof Integer || value instanceof Long) {
+                long longer = ((Number) value).longValue();
+                if (longer >= 0 && longer < int14) {
+                    write(0, 2);
+                    if (longer < int4) {
+                        zero();
+                        write((int) longer, 4);
+                        return;
+                    }
+                    one();
+                    if (longer < int7) {
+                        zero();
+                        write((int) longer, 7);
+                        return;
+                    }
+                    one();
+                    write((int) longer, 14);
+                    return;
+                }
+            }
+            write(1, 2);
+            for (int i = 0; i < string.length(); i += 1) {
+                write(bcd(string.charAt(i)), 4);
+            }
+            write(endOfNumber, 4);
+            this.values.register(string);
+        } else {
+            write(3, 2);
+            writeJSON(value);
+        }
+    }
+
+    /**
+     * Output a zero bit.
+     *
+     * @throws JSONException
+     *
+     * @throws IOException
+     */
+    private void zero() throws JSONException {
+        if (probe) {
+            log(0);
+        }
+        write(0, 1);
+    }
+
+    /**
+     * Compress a JSONObject.
+     *
+     * @param jsonobject
+     * @throws JSONException
+     */
+    public void zip(JSONObject jsonobject) throws JSONException {
+        begin();
+        writeJSON(jsonobject);
+    }
+
+    /**
+     * Compress a JSONArray.
+     *
+     * @param jsonarray
+     * @throws JSONException
+     */
+    public void zip(JSONArray jsonarray) throws JSONException {
+        begin();
+        writeJSON(jsonarray);
+    }
+}
diff --git a/src/org/json/zip/Decompressor.java b/src/org/json/zip/Decompressor.java
new file mode 100644
index 0000000..108a2e2
--- /dev/null
+++ b/src/org/json/zip/Decompressor.java
@@ -0,0 +1,325 @@
+package org.json.zip;
+
+import java.io.UnsupportedEncodingException;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+import org.json.Kim;
+
+/*
+ Copyright (c) 2012 JSON.org
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ The Software shall be used for Good, not Evil.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+ */
+
+/**
+ * JSONzip is a compression scheme for JSON text.
+ *
+ * @author JSON.org
+ * @version 2013-04-18
+ */
+
+public class Decompressor extends JSONzip {
+
+    /**
+     * A decompressor reads bits from a BitReader.
+     */
+    BitReader bitreader;
+
+    /**
+     * Create a new compressor. It may be used for an entire session or
+     * subsession.
+     *
+     * @param bitreader
+     *            The bitreader that this decompressor will read from.
+     */
+    public Decompressor(BitReader bitreader) {
+        super();
+        this.bitreader = bitreader;
+    }
+
+    /**
+     * Read one bit.
+     *
+     * @return true if 1, false if 0.
+     * @throws JSONException
+     */
+    private boolean bit() throws JSONException {
+        boolean value;
+        try {
+            value = this.bitreader.bit();
+            if (probe) {
+                log(value ? 1 : 0);
+            }
+            return value;
+        } catch (Throwable e) {
+            throw new JSONException(e);
+        }
+
+    }
+
+    /**
+     * Read enough bits to obtain an integer from the keep, and increase that
+     * integer's weight.
+     *
+     * @param keep
+     * @param bitreader
+     * @return
+     * @throws JSONException
+     */
+    private Object getAndTick(Keep keep, BitReader bitreader)
+            throws JSONException {
+        try {
+            int width = keep.bitsize();
+            int integer = bitreader.read(width);
+            Object value = keep.value(integer);
+            if (JSONzip.probe) {
+                JSONzip.log("\"" + value + "\"");
+                JSONzip.log(integer, width);
+            }
+            if (integer >= keep.length) {
+                throw new JSONException("Deep error.");
+            }
+            keep.tick(integer);
+            return value;
+        } catch (Throwable e) {
+            throw new JSONException(e);
+        }
+    }
+
+    /**
+     * The pad method skips the bits that padded a stream to fit some
+     * allocation. pad(8) will skip over the remainder of a byte.
+     *
+     * @param factor
+     * @return true if all of the padding bits were zero.
+     * @throws JSONException
+     */
+    public boolean pad(int factor) throws JSONException {
+        try {
+            return this.bitreader.pad(factor);
+        } catch (Throwable e) {
+            throw new JSONException(e);
+        }
+    }
+
+    /**
+     * Read an integer, specifying its width in bits.
+     *
+     * @param width
+     *            0 to 32.
+     * @return An unsigned integer.
+     * @throws JSONException
+     */
+    private int read(int width) throws JSONException {
+        try {
+            int value = this.bitreader.read(width);
+            if (probe) {
+                log(value, width);
+            }
+            return value;
+        } catch (Throwable e) {
+            throw new JSONException(e);
+        }
+    }
+
+    /**
+     * Read a JSONArray.
+     *
+     * @param stringy
+     *            true if the first element is a string.
+     * @return
+     * @throws JSONException
+     */
+    private JSONArray readArray(boolean stringy) throws JSONException {
+        JSONArray jsonarray = new JSONArray();
+        jsonarray.put(stringy ? readString() : readValue());
+        while (true) {
+            if (probe) {
+                log("\n");
+            }
+            if (!bit()) {
+                if (!bit()) {
+                    return jsonarray;
+                }
+                jsonarray.put(stringy ? readValue() : readString());
+            } else {
+                jsonarray.put(stringy ? readString() : readValue());
+            }
+        }
+    }
+
+    /**
+     * Read a JSON value. The type of value is determined by the next 3 bits.
+     *
+     * @return
+     * @throws JSONException
+     */
+    private Object readJSON() throws JSONException {
+        switch (read(3)) {
+        case zipObject:
+            return readObject();
+        case zipArrayString:
+            return readArray(true);
+        case zipArrayValue:
+            return readArray(false);
+        case zipEmptyObject:
+            return new JSONObject();
+        case zipEmptyArray:
+            return new JSONArray();
+        case zipTrue:
+            return Boolean.TRUE;
+        case zipFalse:
+            return Boolean.FALSE;
+        default:
+            return JSONObject.NULL;
+        }
+    }
+
+    private String readName() throws JSONException {
+        byte[] bytes = new byte[65536];
+        int length = 0;
+        if (!bit()) {
+            while (true) {
+                int c = this.namehuff.read(this.bitreader);
+                if (c == end) {
+                    break;
+                }
+                bytes[length] = (byte) c;
+                length += 1;
+            }
+            if (length == 0) {
+                return "";
+            }
+            Kim kim = new Kim(bytes, length);
+            this.namekeep.register(kim);
+            return kim.toString();
+        }
+        return getAndTick(this.namekeep, this.bitreader).toString();
+    }
+
+    private JSONObject readObject() throws JSONException {
+        JSONObject jsonobject = new JSONObject();
+        while (true) {
+            if (probe) {
+                log("\n");
+            }
+            String name = readName();
+            jsonobject.put(name, !bit() ? readString() : readValue());
+            if (!bit()) {
+                return jsonobject;
+            }
+        }
+    }
+
+    private String readString() throws JSONException {
+        Kim kim;
+        int from = 0;
+        int thru = 0;
+        int previousFrom = none;
+        int previousThru = 0;
+        if (bit()) {
+            return getAndTick(this.stringkeep, this.bitreader).toString();
+        }
+        byte[] bytes = new byte[65536];
+        boolean one = bit();
+        this.substringkeep.reserve();
+        while (true) {
+            if (one) {
+                from = thru;
+                kim = (Kim) getAndTick(this.substringkeep, this.bitreader);
+                thru = kim.copy(bytes, from);
+                if (previousFrom != none) {
+                    this.substringkeep.registerOne(new Kim(bytes, previousFrom,
+                            previousThru + 1));
+                }
+                previousFrom = from;
+                previousThru = thru;
+                one = bit();
+            } else {
+                from = none;
+                while (true) {
+                    int c = this.substringhuff.read(this.bitreader);
+                    if (c == end) {
+                        break;
+                    }
+                    bytes[thru] = (byte) c;
+                    thru += 1;
+                    if (previousFrom != none) {
+                        this.substringkeep.registerOne(new Kim(bytes,
+                                previousFrom, previousThru + 1));
+                        previousFrom = none;
+                    }
+                }
+                if (!bit()) {
+                    break;
+                }
+                one = true;
+            }
+        }
+        if (thru == 0) {
+            return "";
+        }
+        kim = new Kim(bytes, thru);
+        this.stringkeep.register(kim);
+        this.substringkeep.registerMany(kim);
+        return kim.toString();
+    }
+
+    private Object readValue() throws JSONException {
+        switch (read(2)) {
+        case 0:
+            return new Integer(read(!bit() ? 4 : !bit() ? 7 : 14));
+        case 1:
+            byte[] bytes = new byte[256];
+            int length = 0;
+            while (true) {
+                int c = read(4);
+                if (c == endOfNumber) {
+                    break;
+                }
+                bytes[length] = bcd[c];
+                length += 1;
+            }
+            Object value;
+            try {
+                value = JSONObject.stringToValue(new String(bytes, 0, length,
+                        "US-ASCII"));
+            } catch (UnsupportedEncodingException e) {
+                throw new JSONException(e);
+            }
+            this.values.register(value);
+            return value;
+        case 2:
+            return getAndTick(this.values, this.bitreader);
+        case 3:
+            return readJSON();
+        default:
+            throw new JSONException("Impossible.");
+        }
+    }
+
+    public Object unzip() throws JSONException {
+        begin();
+        return readJSON();
+    }
+}
diff --git a/src/org/json/zip/Huff.java b/src/org/json/zip/Huff.java
new file mode 100644
index 0000000..2e1d1c9
--- /dev/null
+++ b/src/org/json/zip/Huff.java
@@ -0,0 +1,406 @@
+package org.json.zip;
+
+import org.json.JSONException;
+
+/*
+ Copyright (c) 2013 JSON.org
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ The Software shall be used for Good, not Evil.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+ */
+
+/**
+ * JSONzip is a compression scheme for JSON text.
+ * @author JSON.org
+ * @version 2013-04-18
+ */
+
+/**
+ * A Huffman encoder/decoder. It operates over a domain of integers, which may
+ * map to characters or other symbols. Symbols that are used frequently are
+ * given shorter codes than symbols that are used infrequently. This usually
+ * produces shorter messages.
+ *
+ * Initially, all of the symbols are given the same weight. The weight of a
+ * symbol is incremented by the tick method. The generate method is used to
+ * generate the encoding table. The table must be generated before encoding or
+ * decoding. You may regenerate the table with the latest weights at any time.
+ */
+public class Huff implements None, PostMortem {
+
+    /**
+     * The number of symbols known to the encoder.
+     */
+    private final int domain;
+
+    /**
+     * An array that maps symbol values to symbols.
+     */
+    private final Symbol[] symbols;
+
+    /**
+     * The root of the decoding table, and the terminal of the encoding table.
+     */
+    private Symbol table;
+
+    /**
+     * Have any weights changed since the table was last generated?
+     */
+    private boolean upToDate = false;
+
+    /**
+     * The number of bits in the last symbol. This is used in tracing.
+     */
+    private int width;
+
+    private static class Symbol implements PostMortem {
+        public Symbol back;
+        public Symbol next;
+        public Symbol zero;
+        public Symbol one;
+        public final int integer;
+        public long weight;
+
+        /**
+         * Make a symbol representing a character or other value.
+         *
+         * @param integer
+         *            The symbol's number
+         */
+        public Symbol(int integer) {
+            this.integer = integer;
+            this.weight = 0;
+            this.next = null;
+            this.back = null;
+            this.one = null;
+            this.zero = null;
+        }
+
+        public boolean postMortem(PostMortem pm) {
+            boolean result = true;
+            Symbol that = (Symbol) pm;
+
+            if (this.integer != that.integer || this.weight != that.weight) {
+                return false;
+            }
+            if ((this.back != null) != (that.back != null)) {
+                return false;
+            }
+            Symbol zero = this.zero;
+            Symbol one = this.one;
+            if (zero == null) {
+                if (that.zero != null) {
+                    return false;
+                }
+            } else {
+                result = zero.postMortem(that.zero);
+            }
+            if (one == null) {
+                if (that.one != null) {
+                    return false;
+                }
+            } else {
+                result = one.postMortem(that.one);
+            }
+            return result;
+        }
+
+    }
+
+    /**
+     * Construct a Huffman encoder/decoder.
+     *
+     * @param domain
+     *            The number of values known to the object.
+     */
+    public Huff(int domain) {
+        this.domain = domain;
+        int length = domain * 2 - 1;
+        this.symbols = new Symbol[length];
+
+// Make the leaf symbols.
+
+        for (int i = 0; i < domain; i += 1) {
+            symbols[i] = new Symbol(i);
+        }
+
+// SMake the links.
+
+        for (int i = domain; i < length; i += 1) {
+            symbols[i] = new Symbol(none);
+        }
+    }
+
+    /**
+     * Generate the encoding/decoding table. The table determines the bit
+     * sequences used by the read and write methods.
+     *
+     * @return this
+     */
+    public void generate() {
+        if (!this.upToDate) {
+
+// Phase One: Sort the symbols by weight into a linked list.
+
+            Symbol head = this.symbols[0];
+            Symbol next;
+            Symbol previous = head;
+            Symbol symbol;
+
+            this.table = null;
+            head.next = null;
+            for (int i = 1; i < this.domain; i += 1) {
+                symbol = symbols[i];
+
+// If this symbol weights less than the head, then it becomes the new head.
+
+                if (symbol.weight < head.weight) {
+                    symbol.next = head;
+                    head = symbol;
+                } else {
+
+// To save time, we will start the search from the previous symbol instead
+// of the head unless the current symbol weights less than the previous symbol.
+
+                    if (symbol.weight < previous.weight) {
+                        previous = head;
+                    }
+
+// Find a connected pair (previous and next) where the symbol weighs the same
+// or more than previous but less than the next. Link the symbol between them.
+
+                    while (true) {
+                        next = previous.next;
+                        if (next == null || symbol.weight < next.weight) {
+                            break;
+                        }
+                        previous = next;
+                    }
+                    symbol.next = next;
+                    previous.next = symbol;
+                    previous = symbol;
+                }
+            }
+
+// Phase Two: Make new symbols from the two lightest symbols until only one
+// symbol remains. The final symbol becomes the root of the table binary tree.
+
+            int avail = this.domain;
+            Symbol first;
+            Symbol second;
+            previous = head;
+            while (true) {
+                first = head;
+                second = first.next;
+                head = second.next;
+                symbol = this.symbols[avail];
+                avail += 1;
+                symbol.weight = first.weight + second.weight;
+                symbol.zero = first;
+                symbol.one = second;
+                symbol.back = null;
+                first.back = symbol;
+                second.back = symbol;
+                if (head == null) {
+                    break;
+                }
+
+// Insert the new symbol back into the sorted list.
+
+                if (symbol.weight < head.weight) {
+                    symbol.next = head;
+                    head = symbol;
+                    previous = head;
+                } else {
+                    while (true) {
+                        next = previous.next;
+                        if (next == null || symbol.weight < next.weight) {
+                            break;
+                        }
+                        previous = next;
+                    }
+                    symbol.next = next;
+                    previous.next = symbol;
+                    previous = symbol;
+                }
+
+            }
+
+// The last remaining symbol is the root of the table.
+
+            this.table = symbol;
+            this.upToDate = true;
+        }
+    }
+
+    private boolean postMortem(int integer) {
+        int[] bits = new int[this.domain];
+        Symbol symbol = this.symbols[integer];
+        if (symbol.integer != integer) {
+            return false;
+        }
+        int i = 0;
+        while (true) {
+            Symbol back = symbol.back;
+            if (back == null) {
+                break;
+            }
+            if (back.zero == symbol) {
+                bits[i] = 0;
+            } else if (back.one == symbol) {
+                bits[i] = 1;
+            } else {
+                return false;
+            }
+            i += 1;
+            symbol = back;
+        }
+        if (symbol != this.table) {
+            return false;
+        }
+        this.width = 0;
+        symbol = this.table;
+        while (symbol.integer == none) {
+            i -= 1;
+            symbol = bits[i] != 0 ? symbol.one : symbol.zero;
+        }
+        return symbol.integer == integer && i == 0;
+    }
+
+    /**
+     * Compare two Huffman tables.
+     */
+    public boolean postMortem(PostMortem pm) {
+
+// Go through every integer in the domain, generating its bit sequence, and
+// then proving that that bit sequence produces the same integer.
+
+        for (int integer = 0; integer < this.domain; integer += 1) {
+            if (!postMortem(integer)) {
+                JSONzip.log("\nBad huff ");
+                JSONzip.logchar(integer, integer);
+                return false;
+            }
+        }
+        return this.table.postMortem(((Huff) pm).table);
+    }
+
+    /**
+     * Read bits until a symbol can be identified. The weight of the read
+     * symbol will be incremented.
+     *
+     * @param bitreader
+     *            The source of bits.
+     * @return The integer value of the symbol.
+     * @throws JSONException
+     */
+    public int read(BitReader bitreader) throws JSONException {
+        try {
+            this.width = 0;
+            Symbol symbol = this.table;
+            while (symbol.integer == none) {
+                this.width += 1;
+                symbol = bitreader.bit() ? symbol.one : symbol.zero;
+            }
+            tick(symbol.integer);
+            if (JSONzip.probe) {
+                JSONzip.logchar(symbol.integer, this.width);
+            }
+            return symbol.integer;
+        } catch (Throwable e) {
+            throw new JSONException(e);
+        }
+    }
+
+    /**
+     * Increase by 1 the weight associated with a value.
+     *
+     * @param value
+     *            The number of the symbol to tick
+     * @return this
+     */
+    public void tick(int value) {
+        this.symbols[value].weight += 1;
+        this.upToDate = false;
+    }
+
+    /**
+     * Increase by 1 the weight associated with a range of values.
+     *
+     * @param from
+     *            The first symbol to tick
+     * @param to
+     *            The last symbol to tick
+     * @return this
+     */
+    public void tick(int from, int to) {
+        for (int value = from; value <= to; value += 1) {
+            tick(value);
+        }
+    }
+
+    /**
+     * Recur from a symbol back, emitting bits. We recur before emitting to
+     * make the bits come out in the right order.
+     *
+     * @param symbol
+     *            The symbol to write.
+     * @param bitwriter
+     *            The bitwriter to write it to.
+     * @throws JSONException
+     */
+    private void write(Symbol symbol, BitWriter bitwriter)
+            throws JSONException {
+        try {
+            Symbol back = symbol.back;
+            if (back != null) {
+                this.width += 1;
+                write(back, bitwriter);
+                if (back.zero == symbol) {
+                    bitwriter.zero();
+                } else {
+                    bitwriter.one();
+                }
+            }
+        } catch (Throwable e) {
+            throw new JSONException(e);
+        }
+    }
+
+    /**
+     * Write the bits corresponding to a symbol. The weight of the symbol will
+     * be incremented.
+     *
+     * @param value
+     *            The number of the symbol to write
+     * @param bitwriter
+     *            The destination of the bits.
+     * @return this
+     * @throws JSONException
+     */
+    public void write(int value, BitWriter bitwriter) throws JSONException {
+        this.width = 0;
+        write(this.symbols[value], bitwriter);
+        tick(value);
+        if (JSONzip.probe) {
+            JSONzip.logchar(value, this.width);
+        }
+    }
+}
diff --git a/src/org/json/zip/JSONzip.java b/src/org/json/zip/JSONzip.java
new file mode 100644
index 0000000..2128742
--- /dev/null
+++ b/src/org/json/zip/JSONzip.java
@@ -0,0 +1,281 @@
+package org.json.zip;
+
+
+/*
+ Copyright (c) 2013 JSON.org
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ The Software shall be used for Good, not Evil.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+ */
+
+/**
+ * JSONzip is a binary-encoded JSON dialect. It is designed to compress the
+ * messages in a session. It is adaptive, so with each message seen, it should
+ * improve its compression. It minimizes JSON's overhead, reducing punctuation
+ * to a small number of bits. It uses Huffman encoding to reduce the average
+ * size of characters. It uses caches (or Keeps) to keep recently seen strings
+ * and values, so repetitive content (such as object keys) can be
+ * substantially reduced. It uses a character encoding called Kim (Keep it
+ * minimal) that is smaller than UTF-8 for most East European, African, and
+ * Asian scripts.
+ *
+ * JSONzip tends to reduce most content by about half. If there is a lot of
+ * recurring information, the reduction can be much more dramatic.
+ *
+ * FOR EVALUATION PURPOSES ONLY. THIS PACKAGE HAS NOT YET BEEN TESTED
+ * ADEQUATELY FOR PRODUCTION USE.
+ *
+ * @author JSON.org
+ * @version 2013-04-18
+ */
+public abstract class JSONzip implements None, PostMortem {
+    /**
+     * Powers of 2.
+     */
+    public static final int[] twos = {
+        1, 2, 4, 8, 16, 32, 64, 128, 256, 512,
+        1024, 2048, 4096, 8192, 16384, 32768, 65536
+    };
+
+    /**
+     * The characters in JSON numbers can be reduced to 4 bits each.
+     */
+    public static final byte[] bcd = {
+        '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '.', '-', '+', 'E'
+    };
+
+    /**
+     * The number of integers that can be encoded in 4 bits.
+     */
+    public static final long int4 = 16;
+
+    /**
+     * The number of integers that can be encoded in 7 bits.
+     */
+    public static final long int7 = 128;
+
+    /**
+     * The number of integers that can be encoded in 14 bits.
+     */
+    public static final long int14 = 16384;
+
+    /**
+     * The end of string code.
+     */
+    public static final int end = 256;
+
+    /**
+     * The end of number code.
+     */
+    public static final int endOfNumber = bcd.length;
+
+    /**
+     * The maximum substring length when registering many. The registration of
+     * one substring may be longer.
+     */
+    public static final int maxSubstringLength = 10;
+
+    /**
+     * The minimum substring length.
+     */
+    public static final int minSubstringLength = 3;
+
+    /**
+     * The package supports tracing for debugging.
+     */
+    public static final boolean probe = false;
+
+    /**
+     * The maximum number of substrings added to the substrings keep per
+     * string.
+     */
+    public static final int substringLimit = 40;
+
+    /**
+     * The value code for an empty object.
+     */
+    public static final int zipEmptyObject = 0;
+
+    /**
+     * The value code for an empty array.
+     */
+    public static final int zipEmptyArray = 1;
+
+    /**
+     * The value code for true.
+     */
+    public static final int zipTrue = 2;
+
+    /**
+     * The value code for false.
+     */
+    public static final int zipFalse = 3;
+
+    /**
+     * The value code for null.
+     */
+    public static final int zipNull = 4;
+
+    /**
+     * The value code for a non-empty object.
+     */
+    public static final int zipObject = 5;
+
+    /**
+     * The value code for an array with a string as its first element.
+     */
+    public static final int zipArrayString = 6;
+
+    /**
+     * The value code for an array with a non-string value as its first element.
+     */
+    public static final int zipArrayValue = 7;
+
+    /**
+     * A Huffman encoder for names.
+     */
+    protected final Huff namehuff;
+
+    /**
+     * A place to keep the names (keys).
+     */
+    protected final MapKeep namekeep;
+
+    /**
+     * A place to keep the strings.
+     */
+    protected final MapKeep stringkeep;
+
+    /**
+     * A Huffman encoder for string values.
+     */
+    protected final Huff substringhuff;
+
+    /**
+     * A place to keep the strings.
+     */
+    protected final TrieKeep substringkeep;
+
+    /**
+     * A place to keep the values.
+     */
+    protected final MapKeep values;
+
+    /**
+     * Initialize the data structures.
+     */
+    protected JSONzip() {
+        this.namehuff = new Huff(end + 1);
+        this.namekeep = new MapKeep(9);
+        this.stringkeep = new MapKeep(11);
+        this.substringhuff = new Huff(end + 1);
+        this.substringkeep = new TrieKeep(12);
+        this.values = new MapKeep(10);
+
+// Increase the weights of the ASCII letters, digits, and special characters
+// because they are highly likely to occur more frequently. The weight of each
+// character will increase as it is used. The Huffman encoder will tend to
+// use fewer bits to encode heavier characters.
+
+        this.namehuff.tick(' ', '}');
+        this.namehuff.tick('a', 'z');
+        this.namehuff.tick(end);
+        this.namehuff.tick(end);
+        this.substringhuff.tick(' ', '}');
+        this.substringhuff.tick('a', 'z');
+        this.substringhuff.tick(end);
+        this.substringhuff.tick(end);
+    }
+
+    /**
+     *
+     */
+    protected void begin() {
+        this.namehuff.generate();
+        this.substringhuff.generate();
+    }
+
+    /**
+     * Write an end-of-line to the console.
+     */
+    static void log() {
+        log("\n");
+    }
+
+    /**
+     * Write an integer to the console.
+     *
+     * @param integer
+     */
+    static void log(int integer) {
+        log(integer + " ");
+    }
+
+    /**
+     * Write two integers, separated by ':' to the console.
+     *
+     * @param integer
+     * @param width
+     */
+    static void log(int integer, int width) {
+        log(integer + ":" + width + " ");
+    }
+
+    /**
+     * Write a string to the console.
+     *
+     * @param string
+     */
+    static void log(String string) {
+        System.out.print(string);
+    }
+
+    /**
+     * Write a character or its code to the console.
+     *
+     * @param integer
+     * @param width
+     */
+    static void logchar(int integer, int width) {
+        if (integer > ' ' && integer <= '}') {
+            log("'" + (char) integer + "':" + width + " ");
+        } else {
+            log(integer, width);
+        }
+    }
+
+    /**
+     * This method is used for testing the implementation of JSONzip. It is not
+     * suitable for any other purpose. It is used to compare a Compressor and a
+     * Decompressor, verifying that the data structures that were built during
+     * zipping and unzipping were the same.
+     *
+     * @return true if the structures match.
+     */
+    public boolean postMortem(PostMortem pm) {
+        JSONzip that = (JSONzip) pm;
+        return this.namehuff.postMortem(that.namehuff)
+                && this.namekeep.postMortem(that.namekeep)
+                && this.stringkeep.postMortem(that.stringkeep)
+                && this.substringhuff.postMortem(that.substringhuff)
+                && this.substringkeep.postMortem(that.substringkeep)
+                && this.values.postMortem(that.values);
+    }
+}
diff --git a/src/org/json/zip/Keep.java b/src/org/json/zip/Keep.java
new file mode 100644
index 0000000..377e344
--- /dev/null
+++ b/src/org/json/zip/Keep.java
@@ -0,0 +1,84 @@
+package org.json.zip;
+
+
+/*
+ Copyright (c) 2013 JSON.org
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ The Software shall be used for Good, not Evil.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+ */
+
+/**
+ * A keep is a data structure that associates strings (or substrings) with
+ * numbers. This allows the sending of small integers instead of strings.
+ *
+ * @author JSON.org
+ * @version 2013-04-18
+ */
+abstract class Keep implements None, PostMortem {
+    protected int capacity;
+    protected int length;
+    protected int power;
+    protected long[] uses;
+
+    public Keep(int bits) {
+        this.capacity = JSONzip.twos[bits];
+        this.length = 0;
+        this.power = 0;
+        this.uses = new long[this.capacity];
+    }
+
+    /**
+     * When an item ages, its use count is reduced by at least half.
+     *
+     * @param use
+     *            The current use count of an item.
+     * @return The new use count for that item.
+     */
+    public static long age(long use) {
+        return use >= 32 ? 16 : use / 2;
+    }
+
+    /**
+     * Return the number of bits required to contain an integer based on the
+     * current length of the keep. As the keep fills up, the number of bits
+     * required to identify one of its items goes up.
+     */
+    public int bitsize() {
+        while (JSONzip.twos[this.power] < this.length) {
+            this.power += 1;
+        }
+        return this.power;
+    }
+
+    /**
+     * Increase the usage count on an integer value.
+     */
+    public void tick(int integer) {
+        this.uses[integer] += 1;
+    }
+
+    /**
+     * Get the value associated with an integer.
+     * @param integer The number of an item in the keep.
+     * @return The value.
+     */
+    abstract public Object value(int integer);
+}
diff --git a/src/org/json/zip/MapKeep.java b/src/org/json/zip/MapKeep.java
new file mode 100644
index 0000000..1374e08
--- /dev/null
+++ b/src/org/json/zip/MapKeep.java
@@ -0,0 +1,160 @@
+package org.json.zip;
+
+import java.util.HashMap;
+
+import org.json.Kim;
+
+/*
+ Copyright (c) 2013 JSON.org
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ The Software shall be used for Good, not Evil.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+ */
+
+/**
+ * A keep is an associative data structure that maintains usage counts of each
+ * of the associations in its keeping. When the keep becomes full, it purges
+ * little used associations, and ages the survivors. Each key is assigned an
+ * integer value. When the keep is compacted, each key can be given a new
+ * value.
+ */
+class MapKeep extends Keep {
+    private Object[] list;
+    private HashMap map;
+
+    /**
+     * Create a new Keep.
+     * @param bits
+     *              The capacity of the keep expressed in the number of bits
+     *              required to hold an integer.
+     */
+    public MapKeep(int bits) {
+        super(bits);
+        this.list = new Object[this.capacity];
+        this.map = new HashMap(this.capacity);
+    }
+
+    /**
+     * Compact the keep. A keep may contain at most this.capacity elements.
+     * The keep contents can be reduced by deleting all elements with low use
+     * counts, and by reducing the use counts of the survivors.
+     */
+    private void compact() {
+        int from = 0;
+        int to = 0;
+        while (from < this.capacity) {
+            Object key = this.list[from];
+            long usage = age(this.uses[from]);
+            if (usage > 0) {
+                this.uses[to] = usage;
+                this.list[to] = key;
+                this.map.put(key, new Integer(to));
+                to += 1;
+            } else {
+                this.map.remove(key);
+            }
+            from += 1;
+        }
+        if (to < this.capacity) {
+            this.length = to;
+        } else {
+            this.map.clear();
+            this.length = 0;
+        }
+        this.power = 0;
+    }
+
+    /**
+     * Find the integer value associated with this key, or nothing if this key
+     * is not in the keep.
+     *
+     * @param key
+     *            An object.
+     * @return An integer
+     */
+    public int find(Object key) {
+        Object o = this.map.get(key);
+        return o instanceof Integer ? ((Integer) o).intValue() : none;
+    }
+
+    public boolean postMortem(PostMortem pm) {
+        MapKeep that = (MapKeep) pm;
+        if (this.length != that.length) {
+            JSONzip.log(this.length + " <> " + that.length);
+            return false;
+        }
+        for (int i = 0; i < this.length; i += 1) {
+            boolean b;
+            if (this.list[i] instanceof Kim) {
+                b = ((Kim) this.list[i]).equals(that.list[i]);
+            } else {
+                Object o = this.list[i];
+                Object q = that.list[i];
+                if (o instanceof Number) {
+                    o = o.toString();
+                }
+                if (q instanceof Number) {
+                    q = q.toString();
+                }
+                b = o.equals(q);
+            }
+            if (!b) {
+                JSONzip.log("\n[" + i + "]\n " + this.list[i] + "\n "
+                        + that.list[i] + "\n " + this.uses[i] + "\n "
+                        + that.uses[i]);
+                return false;
+            }
+        }
+        return true;
+    }
+
+    /**
+     * Register a value in the keep. Compact the keep if it is full. The next
+     * time this value is encountered, its integer can be sent instead.
+     * @param value A value.
+     */
+    public void register(Object value) {
+        if (JSONzip.probe) {
+            int integer = find(value);
+            if (integer >= 0) {
+                JSONzip.log("\nDuplicate key " + value);
+            }
+        }
+        if (this.length >= this.capacity) {
+            compact();
+        }
+        this.list[this.length] = value;
+        this.map.put(value, new Integer(this.length));
+        this.uses[this.length] = 1;
+        if (JSONzip.probe) {
+            JSONzip.log("<" + this.length + " " + value + "> ");
+        }
+        this.length += 1;
+    }
+
+    /**
+     * Return the value associated with the integer.
+     * @param integer The number of an item in the keep.
+     * @return The value.
+     */
+    public Object value(int integer) {
+        return this.list[integer];
+    }
+}
diff --git a/src/org/json/zip/None.java b/src/org/json/zip/None.java
new file mode 100644
index 0000000..818e68d
--- /dev/null
+++ b/src/org/json/zip/None.java
@@ -0,0 +1,15 @@
+package org.json.zip;
+
+/**
+ * None is an interface that makes the constant <i>none</i> (short for
+ * negative one or long for -1) available to any class that implements it.
+ * The none value is used to stand for an integer that is not an integer,
+ * such as the negative result of a search.
+ */
+public interface None {
+    /**
+     * Negative One.
+     */
+    public static final int none = -1;
+
+}
diff --git a/src/org/json/zip/PostMortem.java b/src/org/json/zip/PostMortem.java
new file mode 100644
index 0000000..22416d7
--- /dev/null
+++ b/src/org/json/zip/PostMortem.java
@@ -0,0 +1,47 @@
+package org.json.zip;
+
+/*
+ Copyright (c) 2013 JSON.org
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ The Software shall be used for Good, not Evil.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+ */
+
+/**
+ * The PostMortem interface allows for testing the internal state of JSONzip
+ * processors. Testing that JSONzip can compress an object and reproduce a
+ * corresponding object is not sufficient. Complete testing requires that the
+ * same internal data structures were constructed on both ends. If those
+ * structures are not equivalent, then it is likely that the implementations
+ * are not correct, even if convention tests are passed.
+ *
+ * PostMortem allows for testing of deep structures without breaking
+ * encapsulation.
+ */
+public interface PostMortem {
+    /**
+     * Determine if two objects are equivalent.
+     *
+     * @param pm
+     *            Another object of the same type.
+     * @return true if they match.
+     */
+    public boolean postMortem(PostMortem pm);
+}
diff --git a/src/org/json/zip/README b/src/org/json/zip/README
new file mode 100644
index 0000000..93e6470
--- /dev/null
+++ b/src/org/json/zip/README
@@ -0,0 +1,2 @@
+FOR EVALUATION PURPOSES ONLY. THIS PACKAGE HAS NOT BEEN TESTED ADEQUATELY FOR
+PRODUCTION USE.
diff --git a/src/org/json/zip/TrieKeep.java b/src/org/json/zip/TrieKeep.java
new file mode 100644
index 0000000..dcb13c7
--- /dev/null
+++ b/src/org/json/zip/TrieKeep.java
@@ -0,0 +1,396 @@
+package org.json.zip;
+
+import org.json.Kim;
+
+/*
+ Copyright (c) 2013 JSON.org
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ The Software shall be used for Good, not Evil.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+ */
+
+/**
+ * A TrieKeep is a Keep that implements a Trie.
+ */
+class TrieKeep extends Keep {
+
+    /**
+     * The trie is made of nodes.
+     */
+    class Node implements PostMortem {
+        private int integer;
+        private Node[] next;
+
+        /**
+         * Each non-leaf node contains links to up to 256 next nodes. Each node
+         * has an integer value.
+         */
+        public Node() {
+            this.integer = none;
+            this.next = null;
+        }
+
+        /**
+         * Get one of a node's 256 links. If it is a leaf node, it returns
+         * null.
+         *
+         * @param cell
+         *            A integer between 0 and 255.
+         * @return
+         */
+        public Node get(int cell) {
+            return this.next == null ? null : this.next[cell];
+        }
+
+        /**
+         * Get one of a node's 256 links. If it is a leap node, it returns
+         * null. The argument is treated as an unsigned integer.
+         *
+         * @param cell
+         *            A byte.
+         * @return
+         */
+        public Node get(byte cell) {
+            return get(((int) cell) & 0xFF);
+        }
+
+        /**
+         * Compare two nodes. Their lengths must be equal. Their links must
+         * also compare.
+         */
+        public boolean postMortem(PostMortem pm) {
+            Node that = (Node) pm;
+            if (that == null) {
+                JSONzip.log("\nMisalign");
+                return false;
+            }
+            if (this.integer != that.integer) {
+                JSONzip.log("\nInteger " + this.integer + " <> " +
+                        that.integer);
+                return false;
+            }
+            if (this.next == null) {
+                if (that.next == null) {
+                    return true;
+                }
+                JSONzip.log("\nNext is null " + this.integer);
+                return false;
+            }
+            for (int i = 0; i < 256; i += 1) {
+                Node node = this.next[i];
+                if (node != null) {
+                    if (!node.postMortem(that.next[i])) {
+                        return false;
+                    }
+                } else if (that.next[i] != null) {
+                    JSONzip.log("\nMisalign " + i);
+                    return false;
+                }
+            }
+            return true;
+        }
+
+        /**
+         * Set a node's link to another node.
+         *
+         * @param cell
+         *            An integer between 0 and 255.
+         * @param node
+         *            The new value for the cell.
+         */
+        public void set(int cell, Node node) {
+            if (this.next == null) {
+                this.next = new Node[256];
+            }
+            if (JSONzip.probe) {
+                if (node == null || this.next[cell] != null) {
+                    JSONzip.log("\nUnexpected set.\n");
+                }
+            }
+            this.next[cell] = node;
+        }
+
+        /**
+         * Set a node's link to another node.
+         *
+         * @param cell
+         *            A byte.
+         * @param node
+         *            The new value for the cell.
+         */
+        public void set(byte cell, Node node) {
+            set(((int) cell) & 0xFF, node);
+        }
+
+        /**
+         * Get one of a node's 256 links. It will not return null. If there is
+         * no link, then a link is manufactured.
+         *
+         * @param cell
+         *            A integer between 0 and 255.
+         * @return
+         */
+        public Node vet(int cell) {
+            Node node = get(cell);
+            if (node == null) {
+                node = new Node();
+                set(cell, node);
+            }
+            return node;
+        }
+
+        /**
+         * Get one of a node's 256 links. It will not return null. If there is
+         * no link, then a link is manufactured.
+         *
+         * @param cell
+         *            A byte.
+         * @return
+         */
+        public Node vet(byte cell) {
+            return vet(((int) cell) & 0xFF);
+        }
+    }
+
+    private int[] froms;
+    private int[] thrus;
+    private Node root;
+    private Kim[] kims;
+
+    /**
+     * Create a new Keep of kims.
+     *
+     * @param bits
+     *            The log2 of the capacity of the Keep. For example, if bits is
+     *            12, then the keep's capacity will be 4096.
+     */
+    public TrieKeep(int bits) {
+        super(bits);
+        this.froms = new int[this.capacity];
+        this.thrus = new int[this.capacity];
+        this.kims = new Kim[this.capacity];
+        this.root = new Node();
+    }
+
+    /**
+     * Get the kim associated with an integer.
+     *
+     * @param integer
+     * @return
+     */
+    public Kim kim(int integer) {
+        Kim kim = this.kims[integer];
+        int from = this.froms[integer];
+        int thru = this.thrus[integer];
+        if (from != 0 || thru != kim.length) {
+            kim = new Kim(kim, from, thru);
+            this.froms[integer] = 0;
+            this.thrus[integer] = kim.length;
+            this.kims[integer] = kim;
+        }
+        return kim;
+    }
+
+    /**
+     * Get the length of the Kim associated with an integer. This is sometimes
+     * much faster than get(integer).length.
+     *
+     * @param integer
+     * @return
+     */
+    public int length(int integer) {
+        return this.thrus[integer] - this.froms[integer];
+    }
+
+    /**
+     * Find the integer value associated with this key, or nothing if this key
+     * is not in the keep.
+     *
+     * @param key
+     *            An object.
+     * @return An integer
+     */
+    public int match(Kim kim, int from, int thru) {
+        Node node = this.root;
+        int best = none;
+        for (int at = from; at < thru; at += 1) {
+            node = node.get(kim.get(at));
+            if (node == null) {
+                break;
+            }
+            if (node.integer != none) {
+                best = node.integer;
+            }
+            from += 1;
+        }
+        return best;
+    }
+
+    public boolean postMortem(PostMortem pm) {
+        boolean result = true;
+        TrieKeep that = (TrieKeep) pm;
+        if (this.length != that.length) {
+            JSONzip.log("\nLength " + this.length + " <> " + that.length);
+            return false;
+        }
+        if (this.capacity != that.capacity) {
+            JSONzip.log("\nCapacity " + this.capacity + " <> " +
+                    that.capacity);
+            return false;
+        }
+        for (int i = 0; i < this.length; i += 1) {
+            Kim thiskim = this.kim(i);
+            Kim thatkim = that.kim(i);
+            if (!thiskim.equals(thatkim)) {
+                JSONzip.log("\n[" + i + "] " + thiskim + " <> " + thatkim);
+                result = false;
+            }
+        }
+        return result && this.root.postMortem(that.root);
+    }
+
+    public void registerMany(Kim kim) {
+        int length = kim.length;
+        int limit = this.capacity - this.length;
+        if (limit > JSONzip.substringLimit) {
+            limit = JSONzip.substringLimit;
+        }
+        int until = length - (JSONzip.minSubstringLength - 1);
+        for (int from = 0; from < until; from += 1) {
+            int len = length - from;
+            if (len > JSONzip.maxSubstringLength) {
+                len = JSONzip.maxSubstringLength;
+            }
+            len += from;
+            Node node = this.root;
+            for (int at = from; at < len; at += 1) {
+                Node next = node.vet(kim.get(at));
+                if (next.integer == none
+                        && at - from >= (JSONzip.minSubstringLength - 1)) {
+                    next.integer = this.length;
+                    this.uses[this.length] = 1;
+                    this.kims[this.length] = kim;
+                    this.froms[this.length] = from;
+                    this.thrus[this.length] = at + 1;
+                    if (JSONzip.probe) {
+                        try {
+                            JSONzip.log("<<" + this.length + " "
+                                    + new Kim(kim, from, at + 1) + ">> ");
+                        } catch (Throwable ignore) {
+                        }
+                    }
+                    this.length += 1;
+                    limit -= 1;
+                    if (limit <= 0) {
+                        return;
+                    }
+                }
+                node = next;
+            }
+        }
+    }
+
+    public void registerOne(Kim kim) {
+        int integer = registerOne(kim, 0, kim.length);
+        if (integer != none) {
+            this.kims[integer] = kim;
+        }
+    }
+
+    public int registerOne(Kim kim, int from, int thru) {
+        if (this.length < this.capacity) {
+            Node node = this.root;
+            for (int at = from; at < thru; at += 1) {
+                node = node.vet(kim.get(at));
+            }
+            if (node.integer == none) {
+                int integer = this.length;
+                node.integer = integer;
+                this.uses[integer] = 1;
+                this.kims[integer] = kim;
+                this.froms[integer] = from;
+                this.thrus[integer] = thru;
+                if (JSONzip.probe) {
+                    try {
+                        JSONzip.log("<<" + integer + " " + new Kim(kim, from, thru) + ">> ");
+                    } catch (Throwable ignore) {
+                    }
+                }
+                this.length += 1;
+                return integer;
+            }
+        }
+        return none;
+    }
+
+    /**
+     * Reserve space in the keep, compacting if necessary. A keep may contain
+     * at most -capacity- elements. The keep contents can be reduced by
+     * deleting all elements with low use counts, rebuilding the trie with the
+     * survivors.
+     */
+    public void reserve() {
+        if (this.capacity - this.length < JSONzip.substringLimit) {
+            int from = 0;
+            int to = 0;
+            this.root = new Node();
+            while (from < this.capacity) {
+                if (this.uses[from] > 1) {
+                    Kim kim = this.kims[from];
+                    int thru = this.thrus[from];
+                    Node node = this.root;
+                    for (int at = this.froms[from]; at < thru; at += 1) {
+                        Node next = node.vet(kim.get(at));
+                        node = next;
+                    }
+                    node.integer = to;
+                    this.uses[to] = age(this.uses[from]);
+                    this.froms[to] = this.froms[from];
+                    this.thrus[to] = thru;
+                    this.kims[to] = kim;
+                    to += 1;
+                }
+                from += 1;
+            }
+
+// It is possible, but highly unlikely, that too many items survive.
+// If that happens, clear the keep.
+
+            if (this.capacity - to < JSONzip.substringLimit) {
+                this.power = 0;
+                this.root = new Node();
+                to = 0;
+            }
+            this.length = to;
+            while (to < this.capacity) {
+                this.uses[to] = 0;
+                this.kims[to] = null;
+                this.froms[to] = 0;
+                this.thrus[to] = 0;
+                to += 1;
+
+            }
+        }
+    }
+
+    public Object value(int integer) {
+        return kim(integer);
+    }
+}
diff --git a/src/test/beast/BEASTTestCase.java b/src/test/beast/BEASTTestCase.java
new file mode 100644
index 0000000..4c0053c
--- /dev/null
+++ b/src/test/beast/BEASTTestCase.java
@@ -0,0 +1,140 @@
+package test.beast;
+
+
+import junit.framework.TestCase;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import beast.evolution.alignment.Alignment;
+import beast.evolution.alignment.Sequence;
+import beast.evolution.tree.Tree;
+import beast.util.TreeParser;
+
+
+public class BEASTTestCase extends TestCase {
+    public static final double PRECISION = 1e-6;
+
+    public Alignment getFourTaxaNoData() throws Exception {
+        Sequence a = new Sequence("A", "A");
+        Sequence b = new Sequence("B", "A");
+        Sequence c = new Sequence("C", "A");
+        Sequence d = new Sequence("D", "A");
+
+        Alignment data = new Alignment();
+        data.initByName("sequence", a, "sequence", b, "sequence", c, "sequence", d, "dataType", "nucleotide");
+        return data;
+    }
+
+    static public Tree getTree(Alignment data, String tree) throws Exception {
+        TreeParser t = new TreeParser();
+        t.initByName("taxa", data,
+                "newick", tree,
+                "IsLabelledNewick", true);
+        return t;
+    }
+
+    static public Alignment getAlignment() throws Exception {
+        Sequence human = new Sequence("human", "AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCT [...]
+        Sequence chimp = new Sequence("chimp", "AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCT [...]
+        Sequence bonobo = new Sequence("bonobo", "AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAGC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAG [...]
+        Sequence gorilla = new Sequence("gorilla", "AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTAAACATAGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA-CAACACTTAATTTCTGTAAGGACTGCAAAACCCTACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCAATGGGACTCAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGA [...]
+        Sequence orangutan = new Sequence("orangutan", "AGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA-CAGCACTTAATTTCTGTAAGGACTGCAAAACCCCACTTTGCATCAACTGAGCGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCCTAGACCGATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAT-TGGCTTCAGTCCAAAGCCCCGGCAGGCC [...]
+        Sequence siamang = new Sequence("siamang", "AGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTAACAAAACTTAATTTCTGCAAGGGCTGCAAAACCCTACTTTGCATCAACCGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCGATGGGACTTAAACCCATAAAAATTTAGTTAACAGCTAAACACCCTAAACAACCTGGCTTCAATCTAAAGCCCCGGCAGA-GTTGA [...]
+
+        Alignment data = new Alignment();
+        data.initByName("sequence", human, "sequence", chimp, "sequence", bonobo, "sequence", gorilla, "sequence", orangutan, "sequence", siamang,
+                "dataType", "nucleotide"
+        );
+        return data;
+    }
+
+    static public Sequence German_ST;
+    static public Sequence Dutch_List;
+    static public Sequence English_ST;
+    static public Sequence French;
+    static public Sequence Italian;
+    static public Sequence Spanish;
+
+    static {
+        try {
+            German_ST = new Sequence("German_ST", "              1000000010000000000000000000000001000000000000000000000000100000000000000000100000000000000000000000000000000000000001000000000000000000000000000000010000000000000000000001000000000000000000000000000000000000000000000000000000000001010000000000000000000000000000000000000100000000000000000000000000000000000000000000000001000000000000000000000000000000001000000000000000000000001000000000000000000100000000000000000000000000000 [...]
+            Dutch_List = new Sequence("Dutch_List", "          100000001000000000000000000000000100000000000000000000000010000000000000000010000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000100000000000000000000000000000000000000000000000000000010000000000000000000000000000000000010000000000000000001000000000000000000000000000000000000000100000000000000000000000000000000100000000000000000000000100000000000000000010000000000000000000000000000001 [...]
+            English_ST = new Sequence("English_ST", "             100000001000000000000000000000000100000000000000000000000000000000000000000010000000000000000000000000000000000000010000000000000000000000100000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000010000010000000000000000000000000000 [...]
+            French = new Sequence("French", "              1000000000100000000000000000000000000100000000000000000000000010000000000000000010000000000000000000000000000000000100000000000000000000000010000000000000000000000000000000010000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000001000000000000000000000000000000001000000000000000000000000100000000000000000010000000000000000000000000000001 [...]
+            Italian = new Sequence("Italian", "             100000000010000000000000000000000000010000000000000000000000001000000000000000001000000000000000000000000000000000010000000000000000000000001000000000000000000000000000000000000000000000000010000000000000000000000000000000000010000000000000000000000000000000000000001100000000000000000000000000000000000000000000000000000000100000000000000000000000000000000100000000000000000000000010000000000000000001000000000000000000000000000000 [...]
+            Spanish = new Sequence("Spanish", "             100000000010000000000000000000000000010000000000000000000000001000000000000000001000000000000000000000000000000000010000000000000000000000001000000000100000000000000000000001000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000001100000000000000000000000000000000000000000000000000000000100000000000000000000000000000000100000000000000000000000010000000000000000001000000000000000000000000000000 [...]
+        } catch (Exception e) {
+            // ignore: handle exception
+        }
+    }
+
+    static public Alignment getBinaryAlignment() throws Exception {
+        Alignment data = new Alignment();
+        data.initByName("sequence", German_ST, "sequence", Dutch_List, "sequence", English_ST, "sequence", French, "sequence", Italian, "sequence", Spanish,
+                "dataType", "binary"
+        );
+        return data;
+    }
+
+    static public Alignment getCovarionAlignment() throws Exception {
+        Alignment data = new Alignment();
+        data.initByName("sequence", German_ST, "sequence", Dutch_List, "sequence", English_ST, "sequence", French, "sequence", Italian, "sequence", Spanish,
+                "dataType", "twoStateCovarion", "strip", true
+        );
+        return data;
+    }
+
+
+    static public Alignment getAminoAcidAlignment() throws Exception {
+        Sequence Struthio_camelus = new Sequence("Struthio_camelus", "VKYPNTNEEGKEVVLPKILSPIGSDGVYSNELANIEYTNVSKAAAAAFATVDDYKPVPLDYMLDSKTSNKNNVVESSGTLRHFGK");
+        Sequence Rhea_americana = new Sequence("Rhea_americana", "VKYPNTNEEGKEVLLPEILNPVGTDGVYSNELANIEYTNVAKDAAAAFATVDDHKPVSLEYMLDSKTSNKDNVVESNGTLSHFGK");
+        Sequence Pterocnemia_pennata = new Sequence("Pterocnemia_pennata", "VKYPNTNEEGKEVLLPEILNPVGADGVYSNELANIEYTNVSKDHDEVFATVDDHKPVSLEYMLDSKTSNKDNVVESNGTLSHFGK");
+        Alignment data = new Alignment();
+        data.initByName("sequence", Struthio_camelus, "sequence", Rhea_americana, "sequence", Pterocnemia_pennata,
+                "dataType", "aminoacid"
+        );
+        return data;
+    }
+
+    static public Alignment getAscertainedAlignment() throws Exception {
+        // same as getAlignment, but with first four sites the constant sites ACTG
+        List<Sequence> sequences = new ArrayList<Sequence>();
+        sequences.add(new Sequence("human", "ACTGAGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGC [...]
+        sequences.add(new Sequence("chimp", "ACTGAGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGC [...]
+        sequences.add(new Sequence("bonobo", "ACTGAGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCTCTCAGTAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAGC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAG [...]
+        sequences.add(new Sequence("gorilla", "ACTGAGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTAAACATAGACCAAGAGCCTTCAAAGCCCTTAGTAAGTTA-CAACACTTAATTTCTGTAAGGACTGCAAAACCCTACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCAATGGGACTCAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAA [...]
+        sequences.add(new Sequence("orangutan", "ACTGAGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA--CACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTCA-CAGCACTTAATTTCTGTAAGGACTGCAAAACCCCACTTTGCATCAACTGAGCGCAAATCAGCCACTTTAATTAAGCTAAGCCCTCCTAGACCGATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAGTCAAT-TGGCTTCAGTCCAAAGCCCCGGCAGGCCTTA [...]
+        sequences.add(new Sequence("siamang", "ACTGAGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTAAACACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTAACAAAACTTAATTTCTGCAAGGGCTGCAAAACCCTACTTTGCATCAACCGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATCGATGGGACTTAAACCCATAAAAATTTAGTTAACAGCTAAACACCCTAAACAACCTGGCTTCAATCTAAAGCCCCGGCAGA-GTTGAA [...]
+        Alignment data = null;
+        data = new Alignment();
+        for (Sequence sequence : sequences) {
+            data.sequenceInput.setValue(sequence, data);
+        }
+        //data.m_nStateCount.setValue(4, data);
+        data.dataTypeInput.setValue("nucleotide", data);
+        data.excludefromInput.setValue(0, data);
+        data.excludetoInput.setValue(4, data);
+        data.excludeeveryInput.setValue(1, data);
+        data.isAscertainedInput.setValue(true, data);
+        data.initAndValidate();
+
+        return data;
+    }
+
+    static public Tree getTree(Alignment data) throws Exception {
+        TreeParser tree = new TreeParser();
+        tree.initByName("taxa", data,
+                "newick", "((((human:0.024003,(chimp:0.010772,bonobo:0.010772):0.013231):0.012035,gorilla:0.036038):0.033087000000000005,orangutan:0.069125):0.030456999999999998,siamang:0.099582);",
+                "IsLabelledNewick", true);
+        return tree;
+    }
+
+    static public Tree getAminoAcidTree(Alignment data) throws Exception {
+        TreeParser tree = new TreeParser();
+        tree.initByName("taxa", data,
+                "newick", "(Struthio_camelus:0.09413496891819266,(Rhea_americana:0.03667415617018579,Pterocnemia_pennata:0.03667415617018579):0.05746081274800687);",
+                "IsLabelledNewick", true);
+        return tree;
+    }
+}
\ No newline at end of file
diff --git a/src/test/beast/app/BeautiSubTemplateTest.java b/src/test/beast/app/BeautiSubTemplateTest.java
new file mode 100644
index 0000000..1e137ff
--- /dev/null
+++ b/src/test/beast/app/BeautiSubTemplateTest.java
@@ -0,0 +1,257 @@
+package test.beast.app;
+
+import org.junit.Test;
+
+import beast.app.beauti.BeautiConnector;
+import beast.app.beauti.BeautiSubTemplate;
+import beast.core.parameter.RealParameter;
+import junit.framework.TestCase;
+
+public class BeautiSubTemplateTest extends TestCase {
+	
+	@Test
+	public void testBeautiSubTemplate() throws Exception {
+		// minimal template
+		BeautiSubTemplate t = new BeautiSubTemplate();
+		t.initByName("class",RealParameter.class.getName(),
+				"mainid", "kappa",
+				"value", "<parameter id='kappa' value='1.0'/>"
+				);
+		assertEquals(0, t.connectorsInput.get().size());
+		String sXML = t.sXMLInput.get().replaceAll("\\s+", " ");
+		assertEquals("<![CDATA[ <parameter id=\"kappa\" value=\"1.0\"/> ]]>", sXML);
+
+		// minimal template + connector
+		t = new BeautiSubTemplate();
+		t.initByName("class",RealParameter.class.getName(),
+				"mainid", "kappa",
+				"value", "<state idref='thestate'><parameter id='kappa' value='1.0'/></state>"
+				);
+		assertEquals(1, t.connectorsInput.get().size());
+		BeautiConnector c = t.connectorsInput.get().get(0);
+		assertEquals("kappa", c.sSourceIDInput.get());
+		assertEquals("thestate", c.sTargetIDInput.get());
+		assertEquals("parameter", c.sInputNameInput.get());
+		assertEquals(null, c.sConditionInput.get());
+		sXML = t.sXMLInput.get().replaceAll("\\s+", " ");
+		assertEquals("<![CDATA[ <parameter id=\"kappa\" value=\"1.0\"/> ]]>", sXML);
+
+		// minimal template + connector + name
+		t = new BeautiSubTemplate();
+		t.initByName("class",RealParameter.class.getName(),
+				"mainid", "kappa",
+				"value", "<state idref='thestate'><parameter id='kappa' name='stateNode' value='1.0'/></state>"
+				);
+		assertEquals(1, t.connectorsInput.get().size());
+		c = t.connectorsInput.get().get(0);
+		assertEquals("kappa", c.sSourceIDInput.get());
+		assertEquals("thestate", c.sTargetIDInput.get());
+		assertEquals("stateNode", c.sInputNameInput.get());
+		assertEquals(null, c.sConditionInput.get());
+		sXML = t.sXMLInput.get().replaceAll("\\s+", " ");
+		assertEquals("<![CDATA[ <parameter id=\"kappa\" name=\"stateNode\" value=\"1.0\"/> ]]>", sXML);
+
+		// minimal template + connector + name + condition
+		t = new BeautiSubTemplate();
+		t.initByName("class",RealParameter.class.getName(),
+				"mainid", "kappa",
+				"value", "<state idref='thestate'><parameter id='kappa' name='stateNode' value='1.0' beauti:if='kappa/estimate=true'/></state>"
+				);
+		assertEquals(1, t.connectorsInput.get().size());
+		c = t.connectorsInput.get().get(0);
+		assertEquals("kappa", c.sSourceIDInput.get());
+		assertEquals("thestate", c.sTargetIDInput.get());
+		assertEquals("stateNode", c.sInputNameInput.get());
+		assertEquals("kappa/estimate=true", c.sConditionInput.get());
+		sXML = t.sXMLInput.get().replaceAll("\\s+", " ");
+		assertEquals("<![CDATA[ <parameter id=\"kappa\" name=\"stateNode\" value=\"1.0\"/> ]]>", sXML);
+	}
+
+	@Test
+	public void testBeautiSubTemplateIfElement() throws Exception {
+		// minimal template
+		BeautiSubTemplate t = new BeautiSubTemplate();
+
+		// minimal template + connector + name + condition
+		t.initByName("class",RealParameter.class.getName(),
+				"mainid", "kappa",
+				"value", "<state idref='thestate'><if cond='kappa/estimate=true'><parameter id='kappa' name='stateNode' value='1.0'/></if></state>"
+				);
+		assertEquals(1, t.connectorsInput.get().size());
+		BeautiConnector c = t.connectorsInput.get().get(0);
+		assertEquals("kappa", c.sSourceIDInput.get());
+		assertEquals("thestate", c.sTargetIDInput.get());
+		assertEquals("stateNode", c.sInputNameInput.get());
+		assertEquals("kappa/estimate=true", c.sConditionInput.get());
+		String sXML = t.sXMLInput.get();
+		assertEquals("<![CDATA[\n<parameter id=\"kappa\" name=\"stateNode\" value=\"1.0\"/>\n]]>", sXML);
+	}
+	
+	@Test
+	public void testBeautiSubTemplateIfMultipleElement() throws Exception {
+		BeautiSubTemplate t = new BeautiSubTemplate();
+		// minimal template + connector + name + condition for 2 entries
+		t.initByName("class",RealParameter.class.getName(),
+				"mainid", "kappa",
+				"value", "<state idref='thestate'>"
+						+ "<if cond='kappa/estimate=true'>"
+						+ "<parameter id='kappa' name='stateNode' value='1.0'/>" 
+						+ "<parameter id='gamma' value='3.0'/>" 
+						+ "</if></state>"
+				);
+		assertEquals(2, t.connectorsInput.get().size());
+		BeautiConnector c = t.connectorsInput.get().get(0);
+		assertEquals("kappa", c.sSourceIDInput.get());
+		assertEquals("thestate", c.sTargetIDInput.get());
+		assertEquals("stateNode", c.sInputNameInput.get());
+		assertEquals("kappa/estimate=true", c.sConditionInput.get());
+		c = t.connectorsInput.get().get(1);
+		assertEquals("gamma", c.sSourceIDInput.get());
+		assertEquals("thestate", c.sTargetIDInput.get());
+		assertEquals("parameter", c.sInputNameInput.get());
+		assertEquals("kappa/estimate=true", c.sConditionInput.get());
+		String sXML = t.sXMLInput.get();
+		assertEquals("<![CDATA[\n"+
+"<parameter id=\"kappa\" name=\"stateNode\" value=\"1.0\"/>\n"+
+"<parameter id=\"gamma\" value=\"3.0\"/>\n"+
+"]]>", sXML);
+
+		t = new BeautiSubTemplate();
+		// minimal template + connector + name + condition for 2 entries
+		t.initByName("class",RealParameter.class.getName(),
+				"mainid", "kappa",
+				"value", "<state idref='thestate'>"
+						+ "<if cond='kappa/estimate=true'>"
+						+ "<parameter id='kappa' name='stateNode' value='1.0'/>" 
+						+ "<parameter idref='gamma'/>" 
+						+ "</if></state>"
+				);
+		assertEquals(2, t.connectorsInput.get().size());
+		c = t.connectorsInput.get().get(0);
+		assertEquals("kappa", c.sSourceIDInput.get());
+		assertEquals("thestate", c.sTargetIDInput.get());
+		assertEquals("stateNode", c.sInputNameInput.get());
+		assertEquals("kappa/estimate=true", c.sConditionInput.get());
+		c = t.connectorsInput.get().get(1);
+		assertEquals("gamma", c.sSourceIDInput.get());
+		assertEquals("thestate", c.sTargetIDInput.get());
+		assertEquals("parameter", c.sInputNameInput.get());
+		assertEquals("kappa/estimate=true", c.sConditionInput.get());
+		sXML = t.sXMLInput.get();
+		assertEquals("<![CDATA[\n"+
+"<parameter id=\"kappa\" name=\"stateNode\" value=\"1.0\"/>\n"+
+"]]>", sXML);
+
+		t = new BeautiSubTemplate();
+		// minimal template + connector + name + condition for 2 entries
+		t.initByName("class",RealParameter.class.getName(),
+				"mainid", "kappa",
+				"value", "<state idref='thestate'>"
+						+ "<if cond='kappa/estimate=true'>"
+						+ "<parameter idref='gamma'/>" 
+						+ "<parameter id='kappa' name='stateNode' value='1.0'/>" 
+						+ "</if></state>"
+				);
+		assertEquals(2, t.connectorsInput.get().size());
+		c = t.connectorsInput.get().get(1);
+		assertEquals("kappa", c.sSourceIDInput.get());
+		assertEquals("thestate", c.sTargetIDInput.get());
+		assertEquals("stateNode", c.sInputNameInput.get());
+		assertEquals("kappa/estimate=true", c.sConditionInput.get());
+		c = t.connectorsInput.get().get(0);
+		assertEquals("gamma", c.sSourceIDInput.get());
+		assertEquals("thestate", c.sTargetIDInput.get());
+		assertEquals("parameter", c.sInputNameInput.get());
+		assertEquals("kappa/estimate=true", c.sConditionInput.get());
+		sXML = t.sXMLInput.get();
+		assertEquals("<![CDATA[\n"+
+"<parameter id=\"kappa\" name=\"stateNode\" value=\"1.0\"/>\n"+
+"]]>", sXML);
+	}
+	
+	@Test
+	public void testBeautiSubTemplateCombined() throws Exception {
+		BeautiSubTemplate t = new BeautiSubTemplate();
+		// minimal template + connector + name + condition for 2 entries
+		t.initByName("class",RealParameter.class.getName(),
+				"mainid", "kappa",
+				"value", "<state idref='thestate'>"
+						+ "  <if cond='kappa/estimate=true'>"
+						+ "    <parameter id='kappa' name='stateNode' value='1.0'/>" 
+						+ "    <parameter id='gamma' value='3.0'/>" 
+						+ "  </if>"
+						+ "</state>"
+						+ "<logger idref='tracer'>"
+						+ "  <if cond='gamma/estimate=true'>"
+						+ "    <log idref='kappa'/>"
+						+ "    <log idref='gamma'/>"
+						+ "  </if>"
+						+ "</logger>"
+				);
+		assertEquals(4, t.connectorsInput.get().size());
+		BeautiConnector c = t.connectorsInput.get().get(0);
+		assertEquals("kappa", c.sSourceIDInput.get());
+		assertEquals("thestate", c.sTargetIDInput.get());
+		assertEquals("stateNode", c.sInputNameInput.get());
+		assertEquals("kappa/estimate=true", c.sConditionInput.get());
+		c = t.connectorsInput.get().get(1);
+		assertEquals("gamma", c.sSourceIDInput.get());
+		assertEquals("thestate", c.sTargetIDInput.get());
+		assertEquals("parameter", c.sInputNameInput.get());
+		assertEquals("kappa/estimate=true", c.sConditionInput.get());
+		c = t.connectorsInput.get().get(2);
+		assertEquals("kappa", c.sSourceIDInput.get());
+		assertEquals("tracer", c.sTargetIDInput.get());
+		assertEquals("log", c.sInputNameInput.get());
+		assertEquals("gamma/estimate=true", c.sConditionInput.get());
+		c = t.connectorsInput.get().get(3);
+		assertEquals("gamma", c.sSourceIDInput.get());
+		assertEquals("tracer", c.sTargetIDInput.get());
+		assertEquals("log", c.sInputNameInput.get());
+		assertEquals("gamma/estimate=true", c.sConditionInput.get());
+		String sXML = t.sXMLInput.get();
+		assertEquals("<![CDATA[      <parameter id=\"kappa\" name=\"stateNode\" value=\"1.0\"/>    <parameter id=\"gamma\" value=\"3.0\"/>              ]]>"
+, sXML);
+	}
+
+	@Test
+	public void testBeautiSubTemplateCombined2() throws Exception {
+		BeautiSubTemplate t = new BeautiSubTemplate();
+		// minimal template + connector + name + condition for 2 entries
+		t.initByName("class",RealParameter.class.getName(),
+				"mainid", "kappa",
+				"value", "<state idref='thestate'>"
+						+ "    <parameter id='kappa' name='stateNode' value='1.0' beauti:if='kappa/estimate=true'/>" 
+						+ "    <parameter id='gamma' value='3.0'  beauti:if='gamma/estimate=true'/>" 
+						+ "</state>"
+						+ "<logger idref='tracer'>"
+						+ "    <log idref='kappa' beauti:if='kappa/estimate=true'/>"
+						+ "    <log idref='gamma' beauti:if='gamma/estimate=true'/>"
+						+ "</logger>"
+				);
+		assertEquals(4, t.connectorsInput.get().size());
+		BeautiConnector c = t.connectorsInput.get().get(0);
+		assertEquals("kappa", c.sSourceIDInput.get());
+		assertEquals("thestate", c.sTargetIDInput.get());
+		assertEquals("stateNode", c.sInputNameInput.get());
+		assertEquals("kappa/estimate=true", c.sConditionInput.get());
+		c = t.connectorsInput.get().get(1);
+		assertEquals("gamma", c.sSourceIDInput.get());
+		assertEquals("thestate", c.sTargetIDInput.get());
+		assertEquals("parameter", c.sInputNameInput.get());
+		assertEquals("gamma/estimate=true", c.sConditionInput.get());
+		c = t.connectorsInput.get().get(2);
+		assertEquals("kappa", c.sSourceIDInput.get());
+		assertEquals("tracer", c.sTargetIDInput.get());
+		assertEquals("log", c.sInputNameInput.get());
+		assertEquals("kappa/estimate=true", c.sConditionInput.get());
+		c = t.connectorsInput.get().get(3);
+		assertEquals("gamma", c.sSourceIDInput.get());
+		assertEquals("tracer", c.sTargetIDInput.get());
+		assertEquals("log", c.sInputNameInput.get());
+		assertEquals("gamma/estimate=true", c.sConditionInput.get());
+		String sXML = t.sXMLInput.get().replaceAll("\\s+", " ");
+		assertEquals("<![CDATA[ <parameter id=\"kappa\" name=\"stateNode\" value=\"1.0\"/> <parameter id=\"gamma\" value=\"3.0\"/> ]]>"
+, sXML);
+	}
+}
diff --git a/src/test/beast/app/BeautiTest.java b/src/test/beast/app/BeautiTest.java
new file mode 100644
index 0000000..e16b54a
--- /dev/null
+++ b/src/test/beast/app/BeautiTest.java
@@ -0,0 +1,152 @@
+package test.beast.app;
+
+import java.io.File;
+import java.io.PrintStream;
+
+import org.junit.Test;
+
+import test.beast.integration.ExampleXmlParsingTest;
+
+import beast.app.beauti.Beauti;
+import beast.app.beauti.BeautiDoc;
+
+
+
+import junit.framework.TestCase;
+
+public class BeautiTest extends TestCase {
+	{
+		ExampleXmlParsingTest.setUpTestDir();
+	}
+	
+    String sFile = "test/tmp123x666.xml";
+    String sTemplateFile = "test/template123x666.xml";
+
+    @Test
+    // test that beauti can merge an alignment with a template and write out a file
+    // this requires that the standard template can be read
+    public void testStandarBatchMode() {
+        BeautiDoc doc = new BeautiDoc();
+        try {
+            doc.processTemplate("templates/Standard.xml");
+        } catch (Exception e) {
+            assertEquals(true, false);
+        }
+
+        // ignore test if no X11 display available
+        if (!java.awt.GraphicsEnvironment.isHeadless()) {
+            File f = new File(sFile);
+            if (f.exists()) {
+                f.delete();
+            }
+            Beauti.main(("-template templates/Standard.xml -nex examples/nexus/dna.nex -out " + sFile + " -exitaction writexml").split(" "));
+            f = new File(sFile);
+            assertEquals(f.exists() && f.length() > 0, true);
+        }
+    }
+
+    @Test
+    // as testStandarBatchMode() but for the *Beast template
+    public void testStarBeastBatchMode() {
+        BeautiDoc doc = new BeautiDoc();
+        try {
+            doc.processTemplate("templates/StarBeast.xml");
+        } catch (Exception e) {
+            assertEquals(true, false);
+        }
+        // ignore test if no X11 display available
+        if (!java.awt.GraphicsEnvironment.isHeadless()) {
+            File f = new File(sFile);
+            if (f.exists()) {
+                f.delete();
+            }
+            Beauti.main(("-template templates/StarBeast.xml -nex examples/nexus/26.nex -nex examples/nexus/29.nex -out " + sFile + " -exitaction writexml").split(" "));
+            f = new File(sFile);
+            assertEquals(f.exists() && f.length() > 0, true);
+        }
+    }
+
+
+    // test that a dataset can be merged with a simple template
+    String template = "<beast version='2.0'       namespace='beast.evolution.alignment:beast.core:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood'>\n" +
+    		"<data id='data' dataType='nucleotide'>\n" +
+    		"    <sequence taxon='human'>\n" +
+    		"        AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTAAATACAGACCAAGAGCCTTCAAAGCCCTCAGTAAGTTG-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGACCAATGGGACTTAAACCCACAAACACTTAGTTAACAGCTAAGCACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-T [...]
+    		"    </sequence>\n" +
+    		"   <sequence taxon='chimp'>\n" +
+    		"        AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTAAGCACAGACCAAGAGCCTTCAAAGCCCTCAGCAAGTTA-CAATACTTAATTTCTGTAAGGACTGCAAAACCCCACTCTGCATCAACTGAACGCAAATCAGCCACTTTAATTAAGCTAAGCCCTTCTAGATTAATGGGACTTAAACCCACAAACATTTAGTTAACAGCTAAACACCCTAATCAAC-TGGCTTCAATCTAAAGCCCCGGCAGG-TTTGAAGCTGCTTCTTCGAATTTGCAATTCAATATGAAAA-T [...]
+    		"   </sequence>\n" +
+    		"</data>\n" +
+    		"    <input spec='HKY' id='hky'>\n" +
+    		"        <kappa idref='hky.kappa'/>\n" +
+    		"        <frequencies id='freqs' spec='Frequencies'>\n" +
+    		"            <data idref='data'/>\n" +
+    		"        </frequencies>\n" +
+    		"    </input>\n" +
+    		"    <input spec='SiteModel' id='siteModel' gammaCategoryCount='1'>\n" +
+    		"        <substModel idref='hky'/>\n" +
+    		"    </input>\n" +
+    		"    <input spec='TreeLikelihood' id='treeLikelihood'>\n" +
+    		"        <data idref='data'/>\n" +
+    		"        <tree idref='tree'/>\n" +
+    		"        <siteModel idref='siteModel'/>\n" +
+    		"    </input>\n" +
+    		"    <parameter id='hky.kappa' value='1.0' lower='0.0'/>\n" +
+    		"    <tree spec='beast.evolution.tree.RandomTree' id='tree' taxa='@data'>\n" +
+    		"        <populationModel spec='ConstantPopulation'>\n" +
+    		"		<popSize spec='parameter.RealParameter' value='1'/>\n" +
+    		"	</populationModel>\n" +
+    		"    </tree>\n" +
+    		"    <run spec='MCMC' id='mcmc' chainLength='10000000'>\n" +
+    		"	<distribution spec='CompoundDistribution' id='posterior'>\n" +
+    		"        	<distribution id='likelihood' idref='treeLikelihood'/>\n" +
+    		"	</distribution>\n" +
+    		"        <operator id='kappaScaler' spec='ScaleOperator' scaleFactor='0.5' weight='1' parameter='@hky.kappa'/>\n" +
+    		"        <operator id='treeScaler' spec='ScaleOperator' scaleFactor='0.5' weight='1' tree='@tree'/>\n" +
+    		"        <operator spec='Uniform' weight='10' tree='@tree'/>\n" +
+    		"        <operator spec='SubtreeSlide' weight='5' gaussian='true' size='1.0' tree='@tree'/>\n" +
+    		"        <operator id='narrow' spec='Exchange' isNarrow='true' weight='1' tree='@tree'/>\n" +
+    		"        <operator id='wide' spec='Exchange' isNarrow='false' weight='1' tree='@tree'/>\n" +
+    		"        <operator spec='WilsonBalding' weight='1' tree='@tree'/>\n" +
+    		"        <logger logEvery='10000' fileName='test.$(seed).log'>\n" +
+    		"	        <model idref='likelihood'/>\n" +
+    		"            <log idref='likelihood'/>\n" +
+    		"            <log idref='hky.kappa'/>\n" +
+    		"            <log spec='beast.evolution.tree.TreeHeightLogger' tree='@tree'/>\n" +
+    		"        </logger>\n" +
+    		"        <logger logEvery='10000' fileName='test.$(seed).trees'>\n" +
+    		"            <log idref='tree'/>\n" +
+    		"        </logger>\n" +
+    		"        <logger logEvery='10000'>\n" +
+    		"	        <model idref='likelihood'/>\n" +
+    		"            <log idref='likelihood'/>\n" +
+    		"    	    <ESS spec='ESS' name='log' arg='@likelihood'/>\n" +
+    		"            <log idref='hky.kappa'/>\n" +
+    		"    	    <ESS spec='ESS' name='log' arg='@hky.kappa'/>\n" +
+    		"        </logger>\n" +
+    		"    </run>\n" +
+    		"</beast>";
+    @Test
+    public void testCustomBatchMode() {
+        BeautiDoc doc = new BeautiDoc();
+        try {
+        	PrintStream out = new PrintStream(sTemplateFile);
+        	out.print(template);
+        	out.close();
+            doc.processTemplate(sTemplateFile);
+        } catch (Exception e) {
+            assertEquals(true, false);
+        }
+        // ignore test if no X11 display available
+        if (!java.awt.GraphicsEnvironment.isHeadless()) {
+            File f = new File(sFile);
+            if (f.exists()) {
+                f.delete();
+            }
+            Beauti.main(("-template " + sTemplateFile + " -nex examples/nexus/anolis.nex -out " + sFile + " -exitaction writexml").split(" "));
+            f = new File(sFile);
+            assertEquals(f.exists() && f.length() > 0, true);
+        }
+    }
+
+}
diff --git a/src/test/beast/app/beauti/BeautiBase.java b/src/test/beast/app/beauti/BeautiBase.java
new file mode 100644
index 0000000..f003f68
--- /dev/null
+++ b/src/test/beast/app/beauti/BeautiBase.java
@@ -0,0 +1,358 @@
+package test.beast.app.beauti;
+
+
+
+import static org.fest.assertions.Assertions.assertThat;
+import static org.fest.swing.edt.GuiActionRunner.execute;
+import static org.fest.swing.finder.JFileChooserFinder.findFileChooser;
+
+import java.awt.Dimension;
+import java.awt.FileDialog;
+import java.awt.event.KeyEvent;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.swing.JFrame;
+
+import org.fest.swing.annotation.RunsInEDT;
+import org.fest.swing.edt.GuiQuery;
+import org.fest.swing.edt.GuiTask;
+import org.fest.swing.fixture.FrameFixture;
+import org.fest.swing.fixture.JFileChooserFixture;
+import org.fest.swing.fixture.JTabbedPaneFixture;
+import org.fest.swing.fixture.JTableFixture;
+import org.fest.swing.junit.testcase.FestSwingJUnitTestCase;
+
+import beast.app.beauti.Beauti;
+import beast.app.beauti.BeautiDoc;
+import beast.app.util.Utils;
+import beast.core.Distribution;
+import beast.core.Logger;
+import beast.core.MCMC;
+import beast.core.Operator;
+import beast.core.State;
+import beast.core.StateNode;
+import beast.core.BEASTObject;
+import beast.core.util.CompoundDistribution;
+import beast.util.XMLParser;
+
+
+
+/**
+ * Basic test methods for Beauti  
+ * 
+ */
+public class BeautiBase extends FestSwingJUnitTestCase {
+
+	protected FrameFixture beautiFrame;
+	protected Beauti beauti;
+	protected BeautiDoc doc;
+
+	protected void onSetUp() {
+		beautiFrame = new FrameFixture(robot(), createNewEditor());
+		beautiFrame.show();
+		beautiFrame.resizeTo(new Dimension(1224, 786));
+		JTabbedPaneFixture f = beautiFrame.tabbedPane();
+		beauti = (Beauti) f.target;
+		doc = beauti.doc;
+	}
+
+	@RunsInEDT
+	private static JFrame createNewEditor() {
+		return execute(new GuiQuery<JFrame>() {
+			protected JFrame executeInEDT() throws Throwable {
+				Beauti beauti = Beauti.main2(new String[] {});
+				return beauti.frame;
+			}
+		});
+	}
+
+	String priorsAsString() {
+		CompoundDistribution prior = (CompoundDistribution) doc.pluginmap.get("prior");
+		List<Distribution> priors = prior.pDistributions.get();
+		return "assertPriorsEqual" + pluginListAsString(priors);
+	}
+	
+	String stateAsString() {
+		State state = (State) doc.pluginmap.get("state");
+		List<StateNode> stateNodes = state.stateNodeInput.get();
+		return "assertStateEquals" + pluginListAsString(stateNodes);
+	}
+
+	String operatorsAsString() {
+		MCMC mcmc = (MCMC) doc.mcmc.get();
+		List<Operator> operators = mcmc.operatorsInput.get();
+		return "assertOperatorsEqual" + pluginListAsString(operators);
+	}
+	
+	String traceLogAsString() {
+		Logger logger = (Logger) doc.pluginmap.get("tracelog");
+		List<BEASTObject> logs = logger.loggersInput.get();
+		return "assertTraceLogEqual" + pluginListAsString(logs);
+	}
+
+	
+	private String pluginListAsString(List<?> list) {
+		if (list.size() == 0) {
+			return "";
+		}
+		StringBuffer bf = new StringBuffer();
+		for (Object o : list) {
+			BEASTObject plugin = (BEASTObject) o;
+			bf.append('"');
+			bf.append(plugin.getID());
+			bf.append("\", ");
+		}
+		String str = bf.toString();
+		return "(" + str.substring(0, str.length()-2) + ");";
+	}
+
+	void assertPriorsEqual(String... ids) {
+		System.err.println("assertPriorsEqual");
+		CompoundDistribution prior = (CompoundDistribution) doc.pluginmap.get("prior");
+		List<Distribution> priors = prior.pDistributions.get();
+		for (String id : ids) {
+			boolean found = false;
+			for (BEASTObject node : priors) {
+				if (node.getID().equals(id)) {
+					found = true;
+				}
+			}
+			assertThat(found).as("Could not find plugin with ID " + id).isEqualTo(true);
+		}
+		assertThat(ids.length).as("list of plugins do not match").isEqualTo(priors.size());;
+	}
+
+	private void asserListsEqual(List<?> list, String[] ids) {
+		// check all ids are in list
+		for (String id : ids) {
+			boolean found = false;
+			for (Object o: list) {
+				BEASTObject node = (BEASTObject) o;
+				if (node.getID().equals(id)) {
+					found = true;
+					break;
+				}
+			}
+			assertThat(found).as("Could not find plugin with ID " + id).isEqualTo(true);
+		}
+		// check all items in list have a unique ie
+		Set<String> idsInList = new HashSet<String>();
+		Set<String> duplicates = new HashSet<String>();
+		for (Object o : list) {
+			String id = ((BEASTObject) o).getID();
+			if (idsInList.contains(id)) {
+				duplicates.add(id);
+			} else {
+				idsInList.add(id);
+			}
+		}
+		assertThat(duplicates.size()).as("Duplicate ids found: " + Arrays.toString(duplicates.toArray())).isEqualTo(0);
+		
+		if (list.size() != ids.length) {
+			// list.size > ids.length, otherwise it would have been picked up above
+			List<String> extraIDs = new ArrayList<String>(); 
+			for (Object o : list) {
+				String id = ((BEASTObject) o).getID();
+				boolean found = false;
+				for (String id2 : ids) {
+					if (id2.equals(id)) {
+						found = true;
+						break;
+					}
+				}
+				if (!found) {
+					extraIDs.add(id);
+				}
+			}
+			assertThat(ids.length).as("list of plugins do not match: found extra items " + Arrays.toString(extraIDs.toArray())).isEqualTo(list.size());
+		}
+	}
+
+	void assertStateEquals(String... ids) {
+		System.err.println("assertStateEquals");
+		State state = (State) doc.pluginmap.get("state");
+		List<StateNode> stateNodes = state.stateNodeInput.get();
+		asserListsEqual(stateNodes, ids);
+	}
+
+	void assertOperatorsEqual(String... ids) {
+		System.err.println("assertOperatorsEqual");
+		MCMC mcmc = (MCMC) doc.mcmc.get();
+		List<Operator> operators = mcmc.operatorsInput.get();
+		asserListsEqual(operators, ids);
+	}
+
+	void assertTraceLogEqual(String... ids) {
+		System.err.println("assertTraceLogEqual");
+		Logger logger = (Logger) doc.pluginmap.get("tracelog");
+		List<BEASTObject> logs = logger.loggersInput.get();
+		asserListsEqual(logs, ids);
+	}
+
+	void assertArrayEquals(Object [] o, String array) {
+		String str = array.substring(1, array.length() - 1);
+		String [] strs = str.split(", ");
+		for (int i = 0; i < o.length && i < strs.length; i++) {
+			assertThat(strs[i]).as("expected array value " + strs[i] + " instead of " + o[i].toString()).isEqualTo(o[i].toString());
+		}
+		assertThat(o.length).as("arrays do not match: different lengths").isEqualTo(strs.length);
+	}
+	
+	void printBeautiState(JTabbedPaneFixture f) throws InterruptedException {
+        doc.scrubAll(true, false);
+		//f.selectTab("MCMC");
+		System.err.println(stateAsString());
+		System.err.println(operatorsAsString());
+		System.err.println(priorsAsString());
+		System.err.println(traceLogAsString());
+	}
+
+
+	void printTableContents(JTableFixture t) {
+		String [][] contents = t.contents();
+		for (int i = 0; i < contents.length; i++) {
+			System.err.print("\"" + Arrays.toString(contents[i]));
+			if (i < contents.length - 1) {
+				System.err.print("*\" +");
+			} else {
+				System.err.print("\"");
+			}
+			System.err.println();
+		}
+	}
+	
+	void checkTableContents(JTableFixture t, String str) {
+		String [][] contents = t.contents();
+		String [] strs = str.split("\\*");
+		assertThat(contents.length).as("tables do not match: different #rows").isEqualTo(strs.length);
+		for (int i = 0; i < contents.length; i++) {
+			assertArrayEquals(contents[i], strs[i]);
+		}
+	}
+
+	void warning(String str) {
+		System.err.println("\n\n=====================================================\n");
+		System.err.println(str);
+		System.err.println("\n=====================================================\n\n");
+	}
+	
+	void makeSureXMLParses() {
+		warning("Make sure that XML that BEAUti produces parses");
+		File XMLFile = new File(org.fest.util.Files.temporaryFolder() + "/x.xml");
+		if (XMLFile.exists()) {
+			XMLFile.delete();
+		}
+		
+		saveFile(""+org.fest.util.Files.temporaryFolder(), "x.xml");
+
+//		JFileChooserFixture fileChooser = findFileChooser().using(robot());
+//		fileChooser.setCurrentDirectory(org.fest.util.Files.temporaryFolder());
+//		fileChooser.selectFile(new File("x.xml")).approve();
+		
+		XMLParser parser = new XMLParser();
+		XMLFile = new File(org.fest.util.Files.temporaryFolder() + "/x.xml");
+		try {
+			parser.parseFile(XMLFile);
+		} catch (Exception e) {
+			e.printStackTrace();
+			assertThat(0).as("Parser exception: " + e.getMessage()).isEqualTo(1);
+		}
+	}
+
+	protected void saveFile(String dir, String file) {
+		if (!Utils.isMac()) {
+			beautiFrame.menuItemWithPath("File", "Save As").click();
+			JFileChooserFixture fileChooser = findFileChooser().using(robot());
+			fileChooser.setCurrentDirectory(new File(dir));
+			fileChooser.selectFile(new File(file)).approve();
+		} else {
+			_file = new File(dir + "/" + file);
+			execute(new GuiTask() {
+		        protected void executeInEDT() {
+		        	try {
+		        		beauti.doc.save(_file);
+		        	} catch (Exception e) {
+						e.printStackTrace();
+					}
+		        }
+		    });
+			
+		}	
+	}
+
+	// for handling file open events on Mac
+	FileDialog fileDlg = null;
+	String _dir;
+	File _file;
+
+	void importAlignment(String dir, File ... files) {
+		if (!Utils.isMac()) {
+			beautiFrame.menuItemWithPath("File", "Import Alignment").click();
+			JFileChooserFixture fileChooser = findFileChooser().using(robot());
+			fileChooser.setCurrentDirectory(new File(dir));
+			fileChooser.selectFiles(files).approve();
+			// close down any popup message
+			robot().pressKey(KeyEvent.VK_ESCAPE);
+		} else {
+			this._dir = dir;
+			for (File file : files) {
+				_file = new File(dir + "/" + file.getName());
+				execute(new GuiTask() {
+			        protected void executeInEDT() {
+			        	try {
+			        		beauti.doc.importNexus(_file);
+			    			beauti.refreshPanel();
+			        	} catch (Exception e) {
+							e.printStackTrace();
+						}
+			        }
+			    });
+			}
+		}			
+	}
+
+	
+//	void openFile(String dir, String file) {
+//		if (!Utils.isMac() && false) {
+//			JFileChooserFixture fileChooser = findFileChooser().using(robot());
+//			fileChooser.setCurrentDirectory(new File(dir));
+//			fileChooser.selectFile(new File(file)).approve();
+//		} else {
+//			fileDlg = null;
+//			this._dir = dir;
+//			this._file = file;
+//			DialogFixture dialog = WindowFinder.findDialog(FileDialog.class).using(robot());
+//			fileDlg = (FileDialog) dialog.target;
+//					
+//			execute(new GuiTask() {
+//		        protected void executeInEDT() {
+//		          fileDlg.setDirectory(_dir);
+//		          fileDlg.setFile(_file);
+//		        }
+//		    });
+//			robot().click(
+//		    	robot().finder().find(new ComponentMatcher() {
+//		    		@Override
+//		    		public boolean matches(Component c) {
+//		    			if (c.getName() == null) {
+//		    				return false;
+//		    			}
+//		    			System.err.println(c.getName());
+//		    			if (c instanceof Button) {
+//		    				System.err.println(">>>" + ((Button)c).getLabel());
+//		    			}
+//		    			return (c.getName().equals("button0") || c.getName().equals("button3"));
+//		    		}
+//		    	})
+//		    );
+//		}
+//	}
+	
+
+	
+}
\ No newline at end of file
diff --git a/src/test/beast/app/beauti/BeautiDivergenceDatingTest.java b/src/test/beast/app/beauti/BeautiDivergenceDatingTest.java
new file mode 100644
index 0000000..b659289
--- /dev/null
+++ b/src/test/beast/app/beauti/BeautiDivergenceDatingTest.java
@@ -0,0 +1,601 @@
+package test.beast.app.beauti;
+
+
+import org.fest.swing.data.Index;
+import org.fest.swing.data.TableCell;
+import org.fest.swing.finder.WindowFinder;
+import org.fest.swing.fixture.*;
+import org.fest.swing.image.ScreenshotTaker;
+import org.junit.Test;
+
+import test.beast.beast2vs1.TestFramework;
+import test.beast.beast2vs1.trace.Expectation;
+
+import javax.swing.*;
+import java.awt.*;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import static org.fest.assertions.Assertions.assertThat;
+
+public class BeautiDivergenceDatingTest extends BeautiBase {
+    final static String PREFIX = "doc/tutorials/DivergenceDating/figures/BEAUti_";
+
+    @Test
+    public void DivergenceDatingTutorial() throws Exception {
+        long t0 = System.currentTimeMillis();
+
+        // 0. Load primate-mtDNA.nex
+        warning("// 0. Load primate-mtDNA.nex");
+        importAlignment("examples/nexus", new File("primate-mtDNA.nex"));
+
+        beautiFrame.menuItemWithPath("Mode", "Automatic set fix mean substitution rate flag").click();
+
+        JTabbedPaneFixture f = beautiFrame.tabbedPane();
+        f.requireVisible();
+        f.requireTitle("Partitions", Index.atIndex(0));
+        String[] titles = f.tabTitles();
+        assertArrayEquals(titles, "[Partitions, Tip Dates, Site Model, Clock Model, Priors, MCMC]");
+        System.err.println(Arrays.toString(titles));
+        f = f.selectTab("Partitions");
+
+        // check table
+        JTableFixture t = beautiFrame.table();
+        printTableContents(t);
+        checkTableContents(f, "[coding, primate-mtDNA, 12, 693, nucleotide, coding, coding, coding, false]*" +
+                "[noncoding, primate-mtDNA, 12, 205, nucleotide, noncoding, noncoding, noncoding, false]*" +
+                "[1stpos, primate-mtDNA, 12, 231, nucleotide, 1stpos, 1stpos, 1stpos, false]*" +
+                "[2ndpos, primate-mtDNA, 12, 231, nucleotide, 2ndpos, 2ndpos, 2ndpos, false]*" +
+                "[3rdpos, primate-mtDNA, 12, 231, nucleotide, 3rdpos, 3rdpos, 3rdpos, false]");
+
+        assertThat(f).isNotNull();
+        printBeautiState(f);
+        assertStateEquals("Tree.t:noncoding", "clockRate.c:noncoding", "birthRate.t:noncoding", "Tree.t:2ndpos", "clockRate.c:2ndpos", "birthRate.t:2ndpos", "Tree.t:1stpos", "clockRate.c:1stpos", "birthRate.t:1stpos", "Tree.t:coding", "birthRate.t:coding", "Tree.t:3rdpos", "clockRate.c:3rdpos", "birthRate.t:3rdpos");
+        assertOperatorsEqual("StrictClockRateScaler.c:noncoding", "YuleBirthRateScaler.t:noncoding", "YuleModelTreeScaler.t:noncoding", "YuleModelTreeRootScaler.t:noncoding", "YuleModelUniformOperator.t:noncoding", "YuleModelSubtreeSlide.t:noncoding", "YuleModelNarrow.t:noncoding", "YuleModelWide.t:noncoding", "YuleModelWilsonBalding.t:noncoding", "StrictClockRateScaler.c:2ndpos", "YuleBirthRateScaler.t:2ndpos", "YuleModelTreeScaler.t:2ndpos", "YuleModelTreeRootScaler.t:2ndpos", "YuleMod [...]
+        assertPriorsEqual("YuleModel.t:coding", "YuleModel.t:noncoding", "YuleModel.t:1stpos", "YuleModel.t:2ndpos", "YuleModel.t:3rdpos", "ClockPrior.c:noncoding", "YuleBirthRatePrior.t:noncoding", "ClockPrior.c:2ndpos", "YuleBirthRatePrior.t:2ndpos", "ClockPrior.c:1stpos", "YuleBirthRatePrior.t:1stpos", "YuleBirthRatePrior.t:coding", "ClockPrior.c:3rdpos", "YuleBirthRatePrior.t:3rdpos");
+
+
+        //1. Delete "coding" partition as it covers the same sites as the 1stpos, 2ndpos and 3rdpos partitions.
+        warning("1. Delete \"coding\" partition as it covers the same sites as the 1stpos, 2ndpos and 3rdpos partitions.");
+        f.selectTab("Partitions");
+        t = beautiFrame.table();
+        t.selectCell(TableCell.row(0).column(2));
+        JButtonFixture deleteButton = beautiFrame.button("-");
+        deleteButton.click();
+        printBeautiState(f);
+        checkTableContents(f, "[noncoding, primate-mtDNA, 12, 205, nucleotide, noncoding, noncoding, noncoding, false]*" +
+                "[1stpos, primate-mtDNA, 12, 231, nucleotide, 1stpos, 1stpos, 1stpos, false]*" +
+                "[2ndpos, primate-mtDNA, 12, 231, nucleotide, 2ndpos, 2ndpos, 2ndpos, false]*" +
+                "[3rdpos, primate-mtDNA, 12, 231, nucleotide, 3rdpos, 3rdpos, 3rdpos, false]");
+        assertStateEquals("Tree.t:noncoding", "birthRate.t:noncoding", "Tree.t:3rdpos", "clockRate.c:3rdpos", "birthRate.t:3rdpos", "Tree.t:1stpos", "clockRate.c:1stpos", "birthRate.t:1stpos", "Tree.t:2ndpos", "clockRate.c:2ndpos", "birthRate.t:2ndpos");
+        assertOperatorsEqual("YuleBirthRateScaler.t:noncoding", "YuleModelTreeScaler.t:noncoding", "YuleModelTreeRootScaler.t:noncoding", "YuleModelUniformOperator.t:noncoding", "YuleModelSubtreeSlide.t:noncoding", "YuleModelNarrow.t:noncoding", "YuleModelWide.t:noncoding", "YuleModelWilsonBalding.t:noncoding", "StrictClockRateScaler.c:3rdpos", "YuleBirthRateScaler.t:3rdpos", "YuleModelTreeScaler.t:3rdpos", "YuleModelTreeRootScaler.t:3rdpos", "YuleModelUniformOperator.t:3rdpos", "YuleMod [...]
+        assertPriorsEqual("YuleModel.t:1stpos", "YuleModel.t:2ndpos", "YuleModel.t:3rdpos", "YuleModel.t:noncoding", "YuleBirthRatePrior.t:1stpos", "YuleBirthRatePrior.t:2ndpos", "YuleBirthRatePrior.t:3rdpos", "YuleBirthRatePrior.t:noncoding", "ClockPrior.c:1stpos", "ClockPrior.c:2ndpos", "ClockPrior.c:3rdpos");
+
+
+        //2a. Link trees...
+        warning("2a. Link trees...");
+        f.selectTab("Partitions");
+        t = beautiFrame.table();
+        t.selectCells(TableCell.row(0).column(2), TableCell.row(1).column(2), TableCell.row(2).column(2), TableCell.row(3).column(2));
+        JButtonFixture linkTreesButton = beautiFrame.button("Link Trees");
+        linkTreesButton.click();
+        printBeautiState(f);
+        assertStateEquals("Tree.t:noncoding", "birthRate.t:noncoding", "clockRate.c:2ndpos", "clockRate.c:3rdpos", "clockRate.c:1stpos");
+        assertOperatorsEqual("YuleBirthRateScaler.t:noncoding", "YuleModelTreeScaler.t:noncoding", "YuleModelTreeRootScaler.t:noncoding", "YuleModelUniformOperator.t:noncoding", "YuleModelSubtreeSlide.t:noncoding", "YuleModelNarrow.t:noncoding", "YuleModelWide.t:noncoding", "YuleModelWilsonBalding.t:noncoding", "StrictClockRateScaler.c:2ndpos", "StrictClockRateScaler.c:3rdpos", "StrictClockRateScaler.c:1stpos", "strictClockUpDownOperator.c:2ndpos", "strictClockUpDownOperator.c:1stpos", " [...]
+        assertPriorsEqual("YuleModel.t:noncoding", "YuleBirthRatePrior.t:noncoding", "ClockPrior.c:1stpos", "ClockPrior.c:2ndpos", "ClockPrior.c:3rdpos");
+
+        //2b. ...and call the tree "tree"
+        warning("2b. ...and call the tree \"tree\"");
+        f.selectTab("Partitions");
+        JTableCellFixture cell = beautiFrame.table().cell(TableCell.row(0).column(7));
+        Component editor = cell.editor();
+        JComboBoxFixture comboBox = new JComboBoxFixture(robot(), (JComboBox) editor);
+        cell.startEditing();
+        comboBox.selectAllText();
+        comboBox.enterText("tree");
+        cell.stopEditing();
+        checkTableContents(f, "[noncoding, primate-mtDNA, 12, 205, nucleotide, noncoding, noncoding, tree, false]*" +
+                "[1stpos, primate-mtDNA, 12, 231, nucleotide, 1stpos, 1stpos, tree, false]*" +
+                "[2ndpos, primate-mtDNA, 12, 231, nucleotide, 2ndpos, 2ndpos, tree, false]*" +
+                "[3rdpos, primate-mtDNA, 12, 231, nucleotide, 3rdpos, 3rdpos, tree, false]");
+        printBeautiState(f);
+        assertStateEquals("clockRate.c:2ndpos", "Tree.t:tree", "birthRate.t:tree", "clockRate.c:1stpos", "clockRate.c:3rdpos");
+        assertOperatorsEqual("StrictClockRateScaler.c:2ndpos", "YuleBirthRateScaler.t:tree", "YuleModelTreeScaler.t:tree", "YuleModelTreeRootScaler.t:tree", "YuleModelUniformOperator.t:tree", "YuleModelSubtreeSlide.t:tree", "YuleModelNarrow.t:tree", "YuleModelWide.t:tree", "YuleModelWilsonBalding.t:tree", "StrictClockRateScaler.c:1stpos", "StrictClockRateScaler.c:3rdpos", "strictClockUpDownOperator.c:3rdpos", "strictClockUpDownOperator.c:2ndpos", "strictClockUpDownOperator.c:1stpos");
+        assertPriorsEqual("YuleModel.t:tree", "YuleBirthRatePrior.t:tree", "ClockPrior.c:1stpos", "ClockPrior.c:2ndpos", "ClockPrior.c:3rdpos");
+
+
+        //3a. Link clocks
+        warning("3a. Link clocks");
+        f.selectTab("Partitions");
+        t = beautiFrame.table();
+        t.selectCells(TableCell.row(0).column(2), TableCell.row(1).column(2), TableCell.row(2).column(2), TableCell.row(3).column(2));
+        JButtonFixture linkClocksButton = beautiFrame.button("Link Clock Models");
+        linkClocksButton.click();
+
+        //3b. and call the uncorrelated relaxed molecular clock "clock"
+        warning("3b. and call the uncorrelated relaxed molecular clock \"clock\"");
+        cell = beautiFrame.table().cell(TableCell.row(0).column(6));
+        editor = cell.editor();
+        comboBox = new JComboBoxFixture(robot(), (JComboBox) editor);
+        cell.startEditing();
+        comboBox.selectAllText();
+        comboBox.enterText("clock");
+        cell.stopEditing();
+        printBeautiState(f);
+        checkTableContents(f, "[noncoding, primate-mtDNA, 12, 205, nucleotide, noncoding, clock, tree, false]*" +
+                "[1stpos, primate-mtDNA, 12, 231, nucleotide, 1stpos, clock, tree, false]*" +
+                "[2ndpos, primate-mtDNA, 12, 231, nucleotide, 2ndpos, clock, tree, false]*" +
+                "[3rdpos, primate-mtDNA, 12, 231, nucleotide, 3rdpos, clock, tree, false]");
+        assertStateEquals("Tree.t:tree", "birthRate.t:tree");
+        assertOperatorsEqual("YuleBirthRateScaler.t:tree", "YuleModelTreeScaler.t:tree", "YuleModelTreeRootScaler.t:tree", "YuleModelUniformOperator.t:tree", "YuleModelSubtreeSlide.t:tree", "YuleModelNarrow.t:tree", "YuleModelWide.t:tree", "YuleModelWilsonBalding.t:tree");
+        assertPriorsEqual("YuleModel.t:tree", "YuleBirthRatePrior.t:tree");
+
+
+        //4. Link site models temporarily in order to set the same model for all of them.
+        warning("4. Link site models temporarily in order to set the same model for all of them.");
+        f.selectTab("Partitions");
+        t = beautiFrame.table();
+        t.selectCells(TableCell.row(0).column(2), TableCell.row(1).column(2), TableCell.row(2).column(2), TableCell.row(3).column(2));
+        JButtonFixture linkSiteModelsButton = beautiFrame.button("Link Site Models");
+        linkSiteModelsButton.click();
+        printBeautiState(f);
+        checkTableContents(f, "[noncoding, primate-mtDNA, 12, 205, nucleotide, noncoding, clock, tree, false]*" +
+                "[1stpos, primate-mtDNA, 12, 231, nucleotide, noncoding, clock, tree, false]*" +
+                "[2ndpos, primate-mtDNA, 12, 231, nucleotide, noncoding, clock, tree, false]*" +
+                "[3rdpos, primate-mtDNA, 12, 231, nucleotide, noncoding, clock, tree, false]");
+        assertStateEquals("Tree.t:tree", "birthRate.t:tree");
+        assertOperatorsEqual("YuleBirthRateScaler.t:tree", "YuleModelTreeScaler.t:tree", "YuleModelTreeRootScaler.t:tree", "YuleModelUniformOperator.t:tree", "YuleModelSubtreeSlide.t:tree", "YuleModelNarrow.t:tree", "YuleModelWide.t:tree", "YuleModelWilsonBalding.t:tree");
+        assertPriorsEqual("YuleModel.t:tree", "YuleBirthRatePrior.t:tree");
+
+        //5. Set the site model to HKY+G4 (estimated)
+        warning("5. Set the site model to HKY+G4 (estimated)");
+        f.selectTab("Site Model");
+        JComboBoxFixture substModel = beautiFrame.comboBox("substModel");
+        substModel.selectItem("HKY");
+
+        JTextComponentFixture categoryCount = beautiFrame.textBox("gammaCategoryCount");
+        categoryCount.setText("4");
+
+        JCheckBoxFixture shapeIsEstimated = beautiFrame.checkBox("shape.isEstimated");
+        shapeIsEstimated.check();
+        printBeautiState(f);
+        checkTableContents(f, "[noncoding, primate-mtDNA, 12, 205, nucleotide, noncoding, clock, tree, false]*" +
+                "[1stpos, primate-mtDNA, 12, 231, nucleotide, noncoding, clock, tree, false]*" +
+                "[2ndpos, primate-mtDNA, 12, 231, nucleotide, noncoding, clock, tree, false]*" +
+                "[3rdpos, primate-mtDNA, 12, 231, nucleotide, noncoding, clock, tree, false]");
+        assertStateEquals("Tree.t:tree", "birthRate.t:tree", "kappa.s:noncoding", "gammaShape.s:noncoding", "freqParameter.s:noncoding");
+        assertOperatorsEqual("YuleBirthRateScaler.t:tree", "YuleModelTreeScaler.t:tree", "YuleModelTreeRootScaler.t:tree", "YuleModelUniformOperator.t:tree", "YuleModelSubtreeSlide.t:tree", "YuleModelNarrow.t:tree", "YuleModelWide.t:tree", "YuleModelWilsonBalding.t:tree", "KappaScaler.s:noncoding", "gammaShapeScaler.s:noncoding", "FrequenciesExchanger.s:noncoding");
+        assertPriorsEqual("YuleModel.t:tree", "YuleBirthRatePrior.t:tree", "KappaPrior.s:noncoding", "GammaShapePrior.s:noncoding");
+
+        //6a. Unlink the site models,
+        warning("6a. Unlink the site models,");
+        f.selectTab("Partitions");
+        t = beautiFrame.table();
+        t.selectCells(TableCell.row(0).column(2), TableCell.row(1).column(2), TableCell.row(2).column(2), TableCell.row(3).column(2));
+        beautiFrame.button("Unlink Site Models").click();
+        printBeautiState(f);
+        checkTableContents(f, "[noncoding, primate-mtDNA, 12, 205, nucleotide, noncoding, clock, tree, false]*" +
+                "[1stpos, primate-mtDNA, 12, 231, nucleotide, 1stpos, clock, tree, false]*" +
+                "[2ndpos, primate-mtDNA, 12, 231, nucleotide, 2ndpos, clock, tree, false]*" +
+                "[3rdpos, primate-mtDNA, 12, 231, nucleotide, 3rdpos, clock, tree, false]");
+
+        //6b. and make sure that site model mutation rates are relative to 3rdpos (i.e. 3rdpos.mutationRate = 1, other 3 estimated).
+        warning("6b. and make sure that site model mutation rates are relative to 3rdpos (i.e. 3rdpos.mutationRate = 1, other 3 estimated).");
+        f.selectTab("Site Model");
+        JListFixture partitionList = beautiFrame.list();
+        partitionList.selectItem("noncoding");
+        JCheckBoxFixture mutationRateIsEstimated = beautiFrame.checkBox("mutationRate.isEstimated");
+        mutationRateIsEstimated.requireNotSelected();
+        mutationRateIsEstimated.check();
+        mutationRateIsEstimated.requireSelected();
+
+        partitionList.selectItem("1stpos");
+        mutationRateIsEstimated = beautiFrame.checkBox("mutationRate.isEstimated");
+        mutationRateIsEstimated.requireNotSelected();
+        mutationRateIsEstimated.check();
+        mutationRateIsEstimated.requireSelected();
+
+        partitionList.selectItem("2ndpos");
+        mutationRateIsEstimated = beautiFrame.checkBox("mutationRate.isEstimated");
+        mutationRateIsEstimated.requireNotSelected();
+        mutationRateIsEstimated.check();
+        mutationRateIsEstimated.requireSelected();
+
+        partitionList.selectItem("3rdpos");
+        mutationRateIsEstimated = beautiFrame.checkBox("mutationRate.isEstimated");
+        mutationRateIsEstimated.requireNotSelected();
+        printBeautiState(f);
+        assertStateEquals("Tree.t:tree", "birthRate.t:tree", "kappa.s:noncoding", "gammaShape.s:noncoding", "gammaShape.s:1stpos", "kappa.s:1stpos", "gammaShape.s:2ndpos", "kappa.s:2ndpos", "gammaShape.s:3rdpos", "kappa.s:3rdpos", "mutationRate.s:noncoding", "mutationRate.s:1stpos", "mutationRate.s:2ndpos", "freqParameter.s:noncoding", "freqParameter.s:1stpos", "freqParameter.s:3rdpos", "freqParameter.s:2ndpos");
+        assertOperatorsEqual("YuleBirthRateScaler.t:tree", "YuleModelTreeScaler.t:tree", "YuleModelTreeRootScaler.t:tree", "YuleModelUniformOperator.t:tree", "YuleModelSubtreeSlide.t:tree", "YuleModelNarrow.t:tree", "YuleModelWide.t:tree", "YuleModelWilsonBalding.t:tree", "KappaScaler.s:noncoding", "gammaShapeScaler.s:noncoding", "gammaShapeScaler.s:1stpos", "KappaScaler.s:1stpos", "gammaShapeScaler.s:2ndpos", "KappaScaler.s:2ndpos", "gammaShapeScaler.s:3rdpos", "KappaScaler.s:3rdpos", " [...]
+        assertPriorsEqual("YuleModel.t:tree", "YuleBirthRatePrior.t:tree", "GammaShapePrior.s:1stpos", "GammaShapePrior.s:2ndpos", "GammaShapePrior.s:3rdpos", "GammaShapePrior.s:noncoding", "KappaPrior.s:1stpos", "KappaPrior.s:2ndpos", "KappaPrior.s:3rdpos", "KappaPrior.s:noncoding", "MutationRatePrior.s:noncoding", "MutationRatePrior.s:1stpos", "MutationRatePrior.s:2ndpos");
+        assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.3rdpos", "treeLikelihood.noncoding", "TreeHeight.t:tree", "YuleModel.t:tree", "birthRate.t:tree", "treeLikelihood.1stpos", "treeLikelihood.2ndpos", "kappa.s:noncoding", "gammaShape.s:noncoding", "kappa.s:1stpos", "gammaShape.s:1stpos", "kappa.s:2ndpos", "gammaShape.s:2ndpos", "kappa.s:3rdpos", "gammaShape.s:3rdpos", "mutationRate.s:noncoding", "mutationRate.s:1stpos", "mutationRate.s:2ndpos", "freqParameter.s [...]
+
+        //7a. Create a Normal calibration prior
+        warning("7a. Create a Normal calibration prior");
+        f.selectTab("Priors");
+        Component c = beautiFrame.robot.finder().findByName("addItem");
+        JButtonFixture addButton = new JButtonFixture(robot(), (JButton) c);
+        addButton.click();
+        JOptionPaneFixture dialog = new JOptionPaneFixture(robot());
+        dialog.textBox("idEntry").setText("Human-Chimp");
+        dialog.list("listOfTaxonCandidates").selectItems("Homo_sapiens", "Pan");
+        dialog.button(">>").click();
+        dialog.okButton().click();
+
+        //7b. and monophyletic constraint on Human-Chimp split of 6 +/- 0.5.
+        warning("7b. and monophyletic constraint on Human-Chimp split of 6 +/- 0.5.");
+        f.selectTab("Priors");
+        beautiFrame.checkBox("Human-Chimp.prior.isMonophyletic").click();
+        beautiFrame.comboBox("Human-Chimp.prior.distr").selectItem("Normal");
+        beautiFrame.button("Human-Chimp.prior.editButton").click();
+        beautiFrame.textBox("mean").selectAll().setText("6");
+        beautiFrame.textBox("sigma").selectAll().setText("0.5");
+        printBeautiState(f);
+        assertStateEquals("Tree.t:tree", "birthRate.t:tree", "kappa.s:noncoding", "gammaShape.s:noncoding", "kappa.s:1stpos", "gammaShape.s:1stpos", "kappa.s:2ndpos", "gammaShape.s:2ndpos", "kappa.s:3rdpos", "gammaShape.s:3rdpos", "mutationRate.s:noncoding", "mutationRate.s:1stpos", "mutationRate.s:2ndpos", "clockRate.c:clock", "freqParameter.s:1stpos", "freqParameter.s:3rdpos", "freqParameter.s:2ndpos", "freqParameter.s:noncoding");
+        assertOperatorsEqual("YuleBirthRateScaler.t:tree", "YuleModelTreeScaler.t:tree", "YuleModelTreeRootScaler.t:tree", "YuleModelUniformOperator.t:tree", "YuleModelSubtreeSlide.t:tree", "YuleModelNarrow.t:tree", "YuleModelWide.t:tree", "YuleModelWilsonBalding.t:tree", "KappaScaler.s:noncoding", "gammaShapeScaler.s:noncoding", "KappaScaler.s:1stpos", "gammaShapeScaler.s:1stpos", "KappaScaler.s:2ndpos", "gammaShapeScaler.s:2ndpos", "KappaScaler.s:3rdpos", "gammaShapeScaler.s:3rdpos", " [...]
+        assertPriorsEqual("YuleModel.t:tree", "YuleBirthRatePrior.t:tree", "GammaShapePrior.s:1stpos", "GammaShapePrior.s:2ndpos", "GammaShapePrior.s:3rdpos", "GammaShapePrior.s:noncoding", "KappaPrior.s:1stpos", "KappaPrior.s:2ndpos", "KappaPrior.s:3rdpos", "KappaPrior.s:noncoding", "MutationRatePrior.s:1stpos", "MutationRatePrior.s:2ndpos", "MutationRatePrior.s:noncoding", "Human-Chimp.prior", "ClockPrior.c:clock");
+        assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.3rdpos", "treeLikelihood.noncoding", "TreeHeight.t:tree", "YuleModel.t:tree", "birthRate.t:tree", "treeLikelihood.1stpos", "treeLikelihood.2ndpos", "kappa.s:noncoding", "gammaShape.s:noncoding", "kappa.s:1stpos", "gammaShape.s:1stpos", "kappa.s:2ndpos", "gammaShape.s:2ndpos", "kappa.s:3rdpos", "gammaShape.s:3rdpos", "mutationRate.s:noncoding", "mutationRate.s:1stpos", "mutationRate.s:2ndpos", "Human-Chimp.pri [...]
+
+        //8. Run MCMC and look at results in Tracer, TreeAnnotator->FigTree
+        warning("8. Run MCMC and look at results in Tracer, TreeAnnotator->FigTree");
+        File fout = new File(org.fest.util.Files.temporaryFolder() + "/primates.xml");
+        if (fout.exists()) {
+            fout.delete();
+        }
+        
+		// 9. Set up MCMC parameters
+		warning("8. Set up MCMC parameters");
+		f = f.selectTab("MCMC");
+		beautiFrame.textBox("chainLength").selectAll().setText("2000000");
+
+
+        fout = new File(org.fest.util.Files.temporaryFolder() + "/divtutorial.xml");
+        if (fout.exists()) {
+            fout.delete();
+        }
+		saveFile(""+org.fest.util.Files.temporaryFolder(), "divtutorial.xml");
+
+		makeSureXMLParses();
+
+		DivergenceDatingRunner runner = new DivergenceDatingRunner(org.fest.util.Files.temporaryFolder());		
+ 		runner.analyse(0);
+
+        long t1 = System.currentTimeMillis();
+        System.err.println("total time: " + (t1 - t0) / 1000 + " seconds");
+
+    }
+
+    private void checkTableContents(JTabbedPaneFixture f, String str) {
+        f.selectTab("Partitions");
+        JTableFixture t = beautiFrame.table();
+        checkTableContents(t, str);
+    }
+
+ // This is for debugging the test only
+// 	DivergenceDatingRunner should be run from DivergenceDatingTutorial()
+// 	@Test
+// 	public void runXML() throws Exception {
+// 		//System.setProperty("file.name.prefix", org.fest.util.Files.temporaryFolder().getAbsolutePath());
+// 		DivergenceDatingRunner runner = new DivergenceDatingRunner(org.fest.util.Files.temporaryFolder());
+// 		runner.analyse(0);
+// 		
+// 	}
+    
+	class DivergenceDatingRunner extends TestFramework {
+		
+		DivergenceDatingRunner(File file) {
+			super();
+			setUp(new String[]{"/x.xml"});
+			sDir = file.getPath();
+			sLogDir = "";
+			useSeed = false;
+			checkESS = false;
+			testFile = "primate-mtDNA";
+			SEED = 126;
+		}
+
+		@Override
+		protected List<Expectation> giveExpectations(int index_XML) throws Exception {
+	        List<Expectation> expList = new ArrayList<Expectation>();
+	        addExpIntoList(expList,"posterior", -5508.64, 0.277076);
+	        addExpIntoList(expList,"likelihood", -5442.24, 0.314717);
+	        addExpIntoList(expList,"prior", -67.5441, 0.197599);
+	        addExpIntoList(expList,"treeLikelihood.1stpos", -1382.86, 0.163746);
+	        // low ESS for seed=128
+	        addExpIntoList(expList,"treeLikelihood.noncoding", -957.075, 0.157176);
+	        addExpIntoList(expList,"treeLikelihood.2ndpos", -954.148, 0.184448);
+	        addExpIntoList(expList,"treeLikelihood.3rdpos", -2148.15, 0.311767);
+	        addExpIntoList(expList,"TreeHeight", 83.46231, 1.039008);
+	        addExpIntoList(expList,"YuleModel", -51.2849, 0.115309);
+	        addExpIntoList(expList,"birthRate", 0.029973, 0.000342);
+	        addExpIntoList(expList,"kappa.noncoding", 14.67406, 0.462209);
+	        addExpIntoList(expList,"kappa.1stpos", 6.812315, 0.113013);
+	        addExpIntoList(expList,"kappa.2ndpos", 8.853521, 0.19871);
+	        // low ESS for seed=128
+	        addExpIntoList(expList,"kappa.3rdpos", 30.52025, 0.772299);
+	        addExpIntoList(expList,"gammaShape.noncoding", 0.241535, 0.005483);
+	        addExpIntoList(expList,"gammaShape.1stpos", 0.480865, 0.006024);
+	        addExpIntoList(expList,"gammaShape.2ndpos", 0.576606, 0.017974);
+	        addExpIntoList(expList,"gammaShape.3rdpos", 2.832824, 0.092259);
+	        // low ESS for seed=128
+	        addExpIntoList(expList,"mutationRate.noncoding", 0.12345, 0.003921);
+	        // low ESS for seed=128
+	        addExpIntoList(expList,"mutationRate.1stpos", 0.157503, 0.002944);
+	        // low ESS for seed=128
+	        addExpIntoList(expList,"mutationRate.2ndpos", 0.061211, 0.001608);
+	        addExpIntoList(expList,"logP(mrca(Human-Chimp))", -0.78481, 0.022675);
+	        addExpIntoList(expList,"mrcatime(Human-Chimp)", 5.845026, 0.014885);
+	        addExpIntoList(expList,"clockRate", 0.034266, 0.000481);
+			return expList;
+		}
+		
+	}
+    
+    
+    @Test
+    public void DivergenceDatingTutorialWithEmpiricalFreqs() throws Exception {
+        try {
+            long t0 = System.currentTimeMillis();
+            ScreenshotTaker screenshotTaker = new ScreenshotTaker();
+            beauti.frame.setSize(1200, 800);
+
+            String BASE_DIR = PREFIX.substring(0, PREFIX.lastIndexOf('/'));
+            for (File file : new File(BASE_DIR).listFiles()) {
+                if (file.getAbsolutePath().contains(PREFIX) && file.getName().endsWith(".png")) {
+                    file.delete();
+                }
+            }
+
+            // 0. Load primate-mtDNA.nex
+            warning("// 0. Load primate-mtDNA.nex");
+            importAlignment("examples/nexus", new File("primate-mtDNA.nex"));
+            screenshotTaker.saveComponentAsPng(beauti.frame, PREFIX + "DataPartitions.png");
+
+            beautiFrame.menuItemWithPath("Mode", "Automatic set fix mean substitution rate flag").click();
+
+            JTabbedPaneFixture f = beautiFrame.tabbedPane();
+            f.requireVisible();
+            f.requireTitle("Partitions", Index.atIndex(0));
+            String[] titles = f.tabTitles();
+            assertArrayEquals(titles, "[Partitions, Tip Dates, Site Model, Clock Model, Priors, MCMC]");
+            System.err.println(Arrays.toString(titles));
+            f = f.selectTab("Partitions");
+
+            // inspect alignment
+            JTableFixture t = beautiFrame.table();
+            t.selectCell(TableCell.row(0).column(2)).doubleClick();
+            DialogFixture dlg = WindowFinder.findDialog("AlignmentViewer").using(robot());
+            dlg.target.setSize(768, 300);
+            dlg.checkBox("UseColor").check();
+            screenshotTaker.saveComponentAsPng(dlg.target, PREFIX + "Alignment.png");
+            dlg.close();
+
+            // check table
+            printTableContents(t);
+            checkTableContents(f, "[coding, primate-mtDNA, 12, 693, nucleotide, coding, coding, coding, false]*" +
+                    "[noncoding, primate-mtDNA, 12, 205, nucleotide, noncoding, noncoding, noncoding, false]*" +
+                    "[1stpos, primate-mtDNA, 12, 231, nucleotide, 1stpos, 1stpos, 1stpos, false]*" +
+                    "[2ndpos, primate-mtDNA, 12, 231, nucleotide, 2ndpos, 2ndpos, 2ndpos, false]*" +
+                    "[3rdpos, primate-mtDNA, 12, 231, nucleotide, 3rdpos, 3rdpos, 3rdpos, false]");
+
+            assertThat(f).isNotNull();
+            printBeautiState(f);
+            assertStateEquals("Tree.t:noncoding", "clockRate.c:noncoding", "birthRate.t:noncoding", "Tree.t:2ndpos", "clockRate.c:2ndpos", "birthRate.t:2ndpos", "Tree.t:1stpos", "clockRate.c:1stpos", "birthRate.t:1stpos", "Tree.t:coding", "birthRate.t:coding", "Tree.t:3rdpos", "clockRate.c:3rdpos", "birthRate.t:3rdpos");
+            assertOperatorsEqual("StrictClockRateScaler.c:noncoding", "YuleBirthRateScaler.t:noncoding", "YuleModelTreeScaler.t:noncoding", "YuleModelTreeRootScaler.t:noncoding", "YuleModelUniformOperator.t:noncoding", "YuleModelSubtreeSlide.t:noncoding", "YuleModelNarrow.t:noncoding", "YuleModelWide.t:noncoding", "YuleModelWilsonBalding.t:noncoding", "StrictClockRateScaler.c:2ndpos", "YuleBirthRateScaler.t:2ndpos", "YuleModelTreeScaler.t:2ndpos", "YuleModelTreeRootScaler.t:2ndpos", "Yul [...]
+            assertPriorsEqual("YuleModel.t:coding", "YuleModel.t:noncoding", "YuleModel.t:1stpos", "YuleModel.t:2ndpos", "YuleModel.t:3rdpos", "ClockPrior.c:noncoding", "YuleBirthRatePrior.t:noncoding", "ClockPrior.c:2ndpos", "YuleBirthRatePrior.t:2ndpos", "ClockPrior.c:1stpos", "YuleBirthRatePrior.t:1stpos", "YuleBirthRatePrior.t:coding", "ClockPrior.c:3rdpos", "YuleBirthRatePrior.t:3rdpos");
+
+
+            //1. Delete "coding" partition as it covers the same sites as the 1stpos, 2ndpos and 3rdpos partitions.
+            warning("1. Delete \"coding\" partition as it covers the same sites as the 1stpos, 2ndpos and 3rdpos partitions.");
+            f.selectTab("Partitions");
+            t = beautiFrame.table();
+            t.selectCell(TableCell.row(0).column(2));
+            JButtonFixture deleteButton = beautiFrame.button("-");
+            deleteButton.click();
+            printBeautiState(f);
+            checkTableContents(f, "[noncoding, primate-mtDNA, 12, 205, nucleotide, noncoding, noncoding, noncoding, false]*" +
+                    "[1stpos, primate-mtDNA, 12, 231, nucleotide, 1stpos, 1stpos, 1stpos, false]*" +
+                    "[2ndpos, primate-mtDNA, 12, 231, nucleotide, 2ndpos, 2ndpos, 2ndpos, false]*" +
+                    "[3rdpos, primate-mtDNA, 12, 231, nucleotide, 3rdpos, 3rdpos, 3rdpos, false]");
+            assertStateEquals("Tree.t:noncoding", "birthRate.t:noncoding", "Tree.t:3rdpos", "clockRate.c:3rdpos", "birthRate.t:3rdpos", "Tree.t:1stpos", "clockRate.c:1stpos", "birthRate.t:1stpos", "Tree.t:2ndpos", "clockRate.c:2ndpos", "birthRate.t:2ndpos");
+            assertOperatorsEqual("YuleBirthRateScaler.t:noncoding", "YuleModelTreeScaler.t:noncoding", "YuleModelTreeRootScaler.t:noncoding", "YuleModelUniformOperator.t:noncoding", "YuleModelSubtreeSlide.t:noncoding", "YuleModelNarrow.t:noncoding", "YuleModelWide.t:noncoding", "YuleModelWilsonBalding.t:noncoding", "StrictClockRateScaler.c:3rdpos", "YuleBirthRateScaler.t:3rdpos", "YuleModelTreeScaler.t:3rdpos", "YuleModelTreeRootScaler.t:3rdpos", "YuleModelUniformOperator.t:3rdpos", "Yul [...]
+            assertPriorsEqual("YuleModel.t:1stpos", "YuleModel.t:2ndpos", "YuleModel.t:3rdpos", "YuleModel.t:noncoding", "YuleBirthRatePrior.t:1stpos", "YuleBirthRatePrior.t:2ndpos", "YuleBirthRatePrior.t:3rdpos", "YuleBirthRatePrior.t:noncoding", "ClockPrior.c:1stpos", "ClockPrior.c:2ndpos", "ClockPrior.c:3rdpos");
+
+            //2a. Link trees...
+            warning("2a. Link trees...");
+            f.selectTab("Partitions");
+            t = beautiFrame.table();
+            t.selectCells(TableCell.row(0).column(2), TableCell.row(1).column(2), TableCell.row(2).column(2), TableCell.row(3).column(2));
+            JButtonFixture linkTreesButton = beautiFrame.button("Link Trees");
+            linkTreesButton.click();
+            printBeautiState(f);
+            assertStateEquals("Tree.t:noncoding", "birthRate.t:noncoding", "clockRate.c:2ndpos", "clockRate.c:3rdpos", "clockRate.c:1stpos");
+            assertOperatorsEqual("YuleBirthRateScaler.t:noncoding", "YuleModelTreeScaler.t:noncoding", "YuleModelTreeRootScaler.t:noncoding", "YuleModelUniformOperator.t:noncoding", "YuleModelSubtreeSlide.t:noncoding", "YuleModelNarrow.t:noncoding", "YuleModelWide.t:noncoding", "YuleModelWilsonBalding.t:noncoding", "StrictClockRateScaler.c:2ndpos", "StrictClockRateScaler.c:3rdpos", "StrictClockRateScaler.c:1stpos", "strictClockUpDownOperator.c:2ndpos", "strictClockUpDownOperator.c:1stpos [...]
+            assertPriorsEqual("YuleModel.t:noncoding", "YuleBirthRatePrior.t:noncoding", "ClockPrior.c:1stpos", "ClockPrior.c:2ndpos", "ClockPrior.c:3rdpos");
+
+            //2b. ...and call the tree "tree"
+            warning("2b. ...and call the tree \"tree\"");
+            f.selectTab("Partitions");
+            JTableCellFixture cell = beautiFrame.table().cell(TableCell.row(0).column(7));
+            Component editor = cell.editor();
+            JComboBoxFixture comboBox = new JComboBoxFixture(robot(), (JComboBox) editor);
+            cell.startEditing();
+            comboBox.selectAllText();
+            comboBox.enterText("tree");
+            cell.stopEditing();
+            checkTableContents(f, "[noncoding, primate-mtDNA, 12, 205, nucleotide, noncoding, noncoding, tree, false]*" +
+                    "[1stpos, primate-mtDNA, 12, 231, nucleotide, 1stpos, 1stpos, tree, false]*" +
+                    "[2ndpos, primate-mtDNA, 12, 231, nucleotide, 2ndpos, 2ndpos, tree, false]*" +
+                    "[3rdpos, primate-mtDNA, 12, 231, nucleotide, 3rdpos, 3rdpos, tree, false]");
+            printBeautiState(f);
+            assertStateEquals("clockRate.c:2ndpos", "Tree.t:tree", "birthRate.t:tree", "clockRate.c:1stpos", "clockRate.c:3rdpos");
+            assertOperatorsEqual("StrictClockRateScaler.c:2ndpos", "YuleBirthRateScaler.t:tree", "YuleModelTreeScaler.t:tree", "YuleModelTreeRootScaler.t:tree", "YuleModelUniformOperator.t:tree", "YuleModelSubtreeSlide.t:tree", "YuleModelNarrow.t:tree", "YuleModelWide.t:tree", "YuleModelWilsonBalding.t:tree", "StrictClockRateScaler.c:1stpos", "StrictClockRateScaler.c:3rdpos", "strictClockUpDownOperator.c:3rdpos", "strictClockUpDownOperator.c:2ndpos", "strictClockUpDownOperator.c:1stpos");
+            assertPriorsEqual("YuleModel.t:tree", "YuleBirthRatePrior.t:tree", "ClockPrior.c:1stpos", "ClockPrior.c:2ndpos", "ClockPrior.c:3rdpos");
+
+
+            //3a. Link clocks
+            warning("3a. Link clocks");
+            f.selectTab("Partitions");
+            t = beautiFrame.table();
+            t.selectCells(TableCell.row(0).column(2), TableCell.row(1).column(2), TableCell.row(2).column(2), TableCell.row(3).column(2));
+            JButtonFixture linkClocksButton = beautiFrame.button("Link Clock Models");
+            linkClocksButton.click();
+
+            //3b. and call the uncorrelated relaxed molecular clock "clock"
+            warning("3b. and call the uncorrelated relaxed molecular clock \"clock\"");
+            cell = beautiFrame.table().cell(TableCell.row(0).column(6));
+            editor = cell.editor();
+            comboBox = new JComboBoxFixture(robot(), (JComboBox) editor);
+            cell.startEditing();
+            comboBox.selectAllText();
+            comboBox.enterText("clock");
+            cell.stopEditing();
+            printBeautiState(f);
+            checkTableContents(f, "[noncoding, primate-mtDNA, 12, 205, nucleotide, noncoding, clock, tree, false]*" +
+                    "[1stpos, primate-mtDNA, 12, 231, nucleotide, 1stpos, clock, tree, false]*" +
+                    "[2ndpos, primate-mtDNA, 12, 231, nucleotide, 2ndpos, clock, tree, false]*" +
+                    "[3rdpos, primate-mtDNA, 12, 231, nucleotide, 3rdpos, clock, tree, false]");
+            assertStateEquals("Tree.t:tree", "birthRate.t:tree");
+            assertOperatorsEqual("YuleBirthRateScaler.t:tree", "YuleModelTreeScaler.t:tree", "YuleModelTreeRootScaler.t:tree", "YuleModelUniformOperator.t:tree", "YuleModelSubtreeSlide.t:tree", "YuleModelNarrow.t:tree", "YuleModelWide.t:tree", "YuleModelWilsonBalding.t:tree");
+            assertPriorsEqual("YuleModel.t:tree", "YuleBirthRatePrior.t:tree");
+            screenshotTaker.saveComponentAsPng(beauti.frame, PREFIX + "DataPartitions_final.png");
+
+            //4. Link site models temporarily in order to set the same model for all of them.
+            warning("4. Link site models temporarily in order to set the same model for all of them.");
+            f.selectTab("Partitions");
+            t = beautiFrame.table();
+            t.selectCells(TableCell.row(0).column(2), TableCell.row(1).column(2), TableCell.row(2).column(2), TableCell.row(3).column(2));
+            JButtonFixture linkSiteModelsButton = beautiFrame.button("Link Site Models");
+            linkSiteModelsButton.click();
+            printBeautiState(f);
+            checkTableContents(f, "[noncoding, primate-mtDNA, 12, 205, nucleotide, noncoding, clock, tree, false]*" +
+                    "[1stpos, primate-mtDNA, 12, 231, nucleotide, noncoding, clock, tree, false]*" +
+                    "[2ndpos, primate-mtDNA, 12, 231, nucleotide, noncoding, clock, tree, false]*" +
+                    "[3rdpos, primate-mtDNA, 12, 231, nucleotide, noncoding, clock, tree, false]");
+            assertStateEquals("Tree.t:tree", "birthRate.t:tree");
+            assertOperatorsEqual("YuleBirthRateScaler.t:tree", "YuleModelTreeScaler.t:tree", "YuleModelTreeRootScaler.t:tree", "YuleModelUniformOperator.t:tree", "YuleModelSubtreeSlide.t:tree", "YuleModelNarrow.t:tree", "YuleModelWide.t:tree", "YuleModelWilsonBalding.t:tree");
+            assertPriorsEqual("YuleModel.t:tree", "YuleBirthRatePrior.t:tree");
+
+            //5. Set the site model to HKY+G4 (estimated)
+            warning("5. Set the site model to HKY+G4 (estimated)");
+            f.selectTab("Site Model");
+            JComboBoxFixture substModel = beautiFrame.comboBox("substModel");
+            substModel.selectItem("HKY");
+
+            JComboBoxFixture freqs = beautiFrame.comboBox("frequencies");
+            freqs.selectItem("Empirical");
+
+            JTextComponentFixture categoryCount = beautiFrame.textBox("gammaCategoryCount");
+            categoryCount.setText("4");
+
+            JCheckBoxFixture shapeIsEstimated = beautiFrame.checkBox("shape.isEstimated");
+            shapeIsEstimated.check();
+
+            beautiFrame.checkBox("mutationRate.isEstimated").check();
+            beautiFrame.checkBox("FixMeanMutationRate").check();
+            screenshotTaker.saveComponentAsPng(beauti.frame, PREFIX + "Model.png");
+            printBeautiState(f);
+            checkTableContents(f, "[noncoding, primate-mtDNA, 12, 205, nucleotide, noncoding, clock, tree, false]*" +
+                    "[1stpos, primate-mtDNA, 12, 231, nucleotide, noncoding, clock, tree, false]*" +
+                    "[2ndpos, primate-mtDNA, 12, 231, nucleotide, noncoding, clock, tree, false]*" +
+                    "[3rdpos, primate-mtDNA, 12, 231, nucleotide, noncoding, clock, tree, false]");
+            assertStateEquals("Tree.t:tree", "birthRate.t:tree", "kappa.s:noncoding", "gammaShape.s:noncoding", "mutationRate.s:noncoding");
+            assertOperatorsEqual("YuleBirthRateScaler.t:tree", "YuleModelTreeScaler.t:tree", "YuleModelTreeRootScaler.t:tree", "YuleModelUniformOperator.t:tree", "YuleModelSubtreeSlide.t:tree", "YuleModelNarrow.t:tree", "YuleModelWide.t:tree", "YuleModelWilsonBalding.t:tree", "KappaScaler.s:noncoding", "gammaShapeScaler.s:noncoding", "FixMeanMutationRatesOperator");
+            assertPriorsEqual("YuleModel.t:tree", "YuleBirthRatePrior.t:tree", "KappaPrior.s:noncoding", "GammaShapePrior.s:noncoding");
+            assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.1stpos", "treeLikelihood.2ndpos", "treeLikelihood.3rdpos", "treeLikelihood.noncoding", "TreeHeight.t:tree", "YuleModel.t:tree", "birthRate.t:tree", "kappa.s:noncoding", "gammaShape.s:noncoding", "mutationRate.s:noncoding");
+
+            //6 Unlink the site models,
+            warning("6 Unlink the site models,");
+            f.selectTab("Partitions");
+            t = beautiFrame.table();
+            t.selectCells(TableCell.row(0).column(2), TableCell.row(1).column(2), TableCell.row(2).column(2), TableCell.row(3).column(2));
+            beautiFrame.button("Unlink Site Models").click();
+            printBeautiState(f);
+            checkTableContents(f, "[noncoding, primate-mtDNA, 12, 205, nucleotide, noncoding, clock, tree, false]*" +
+                    "[1stpos, primate-mtDNA, 12, 231, nucleotide, 1stpos, clock, tree, false]*" +
+                    "[2ndpos, primate-mtDNA, 12, 231, nucleotide, 2ndpos, clock, tree, false]*" +
+                    "[3rdpos, primate-mtDNA, 12, 231, nucleotide, 3rdpos, clock, tree, false]");
+
+            assertStateEquals("Tree.t:tree", "birthRate.t:tree", "kappa.s:noncoding", "gammaShape.s:noncoding", "mutationRate.s:noncoding", "kappa.s:1stpos", "gammaShape.s:1stpos", "mutationRate.s:1stpos", "kappa.s:2ndpos", "gammaShape.s:2ndpos", "mutationRate.s:2ndpos", "kappa.s:3rdpos", "gammaShape.s:3rdpos", "mutationRate.s:3rdpos");
+            assertOperatorsEqual("YuleBirthRateScaler.t:tree", "YuleModelTreeScaler.t:tree", "YuleModelTreeRootScaler.t:tree", "YuleModelUniformOperator.t:tree", "YuleModelSubtreeSlide.t:tree", "YuleModelNarrow.t:tree", "YuleModelWide.t:tree", "YuleModelWilsonBalding.t:tree", "KappaScaler.s:noncoding", "gammaShapeScaler.s:noncoding", "FixMeanMutationRatesOperator", "gammaShapeScaler.s:1stpos", "KappaScaler.s:1stpos", "gammaShapeScaler.s:2ndpos", "KappaScaler.s:2ndpos", "gammaShapeScaler. [...]
+            assertPriorsEqual("YuleModel.t:tree", "YuleBirthRatePrior.t:tree", "KappaPrior.s:noncoding", "GammaShapePrior.s:noncoding", "GammaShapePrior.s:1stpos", "KappaPrior.s:1stpos", "GammaShapePrior.s:2ndpos", "KappaPrior.s:2ndpos", "GammaShapePrior.s:3rdpos", "KappaPrior.s:3rdpos");
+            assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.1stpos", "treeLikelihood.2ndpos", "treeLikelihood.3rdpos", "treeLikelihood.noncoding", "TreeHeight.t:tree", "YuleModel.t:tree", "birthRate.t:tree", "kappa.s:noncoding", "gammaShape.s:noncoding", "mutationRate.s:noncoding", "kappa.s:1stpos", "gammaShape.s:1stpos", "mutationRate.s:1stpos", "kappa.s:2ndpos", "gammaShape.s:2ndpos", "mutationRate.s:2ndpos", "kappa.s:3rdpos", "gammaShape.s:3rdpos", "mutationRat [...]
+
+
+            //7a. Create a Normal calibration prior
+            warning("7a. Create a Normal calibration prior");
+            f.selectTab("Priors");
+            beautiFrame.comboBox("TreeDistribution").selectItem("Calibrated Yule Model");
+            screenshotTaker.saveComponentAsPng(beauti.frame, PREFIX + "Prior1.png");
+
+            Component c = beautiFrame.robot.finder().findByName("addItem");
+            JButtonFixture addButton = new JButtonFixture(robot(), (JButton) c);
+            addButton.click();
+            JOptionPaneFixture dialog = new JOptionPaneFixture(robot());
+            dialog.textBox("idEntry").setText("Human-Chimp");
+            dialog.list("listOfTaxonCandidates").selectItems("Homo_sapiens", "Pan");
+            dialog.button(">>").click();
+            dialog.okButton().click();
+            printBeautiState(f);
+            assertStateEquals("Tree.t:tree", "kappa.s:noncoding", "gammaShape.s:noncoding", "mutationRate.s:noncoding", "kappa.s:1stpos", "gammaShape.s:1stpos", "mutationRate.s:1stpos", "kappa.s:2ndpos", "gammaShape.s:2ndpos", "mutationRate.s:2ndpos", "kappa.s:3rdpos", "gammaShape.s:3rdpos", "mutationRate.s:3rdpos", "birthRateY.t:tree");
+            assertOperatorsEqual("CalibratedYuleModelTreeScaler.t:tree", "CalibratedYuleModelTreeRootScaler.t:tree", "CalibratedYuleModelUniformOperator.t:tree", "CalibratedYuleModelSubtreeSlide.t:tree", "CalibratedYuleModelNarrow.t:tree", "CalibratedYuleModelWide.t:tree", "CalibratedYuleModelWilsonBalding.t:tree", "KappaScaler.s:noncoding", "gammaShapeScaler.s:noncoding", "FixMeanMutationRatesOperator", "gammaShapeScaler.s:1stpos", "KappaScaler.s:1stpos", "gammaShapeScaler.s:2ndpos", "K [...]
+            assertPriorsEqual("CalibratedYuleModel.t:tree", "CalibratedYuleBirthRatePrior.t:tree", "GammaShapePrior.s:1stpos", "GammaShapePrior.s:2ndpos", "GammaShapePrior.s:3rdpos", "GammaShapePrior.s:noncoding", "KappaPrior.s:1stpos", "KappaPrior.s:2ndpos", "KappaPrior.s:3rdpos", "KappaPrior.s:noncoding", "Human-Chimp.prior");
+            assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.1stpos", "treeLikelihood.2ndpos", "treeLikelihood.3rdpos", "treeLikelihood.noncoding", "TreeHeight.t:tree", "kappa.s:noncoding", "gammaShape.s:noncoding", "mutationRate.s:noncoding", "kappa.s:1stpos", "gammaShape.s:1stpos", "mutationRate.s:1stpos", "kappa.s:2ndpos", "gammaShape.s:2ndpos", "mutationRate.s:2ndpos", "kappa.s:3rdpos", "gammaShape.s:3rdpos", "mutationRate.s:3rdpos", "CalibratedYuleModel.t:tree [...]
+
+            //7b. and monophyletic constraint on Human-Chimp split of 6 +/- 0.5.
+            warning("7b. and monophyletic constraint on Human-Chimp split of 6 +/- 0.5.");
+            f.selectTab("Priors");
+            beautiFrame.checkBox("Human-Chimp.prior.isMonophyletic").click();
+            beautiFrame.comboBox("Human-Chimp.prior.distr").selectItem("Normal");
+            beautiFrame.button("Human-Chimp.prior.editButton").click();
+            beautiFrame.textBox("mean").selectAll().setText("6");
+            beautiFrame.textBox("sigma").selectAll().setText("0.5");
+            // beautiFrame.scrollBar().scrollToMaximum();
+            screenshotTaker.saveComponentAsPng(beauti.frame, PREFIX + "TaxonSets.png");
+            printBeautiState(f);
+            assertStateEquals("Tree.t:tree", "kappa.s:noncoding", "gammaShape.s:noncoding", "mutationRate.s:noncoding", "kappa.s:1stpos", "gammaShape.s:1stpos", "mutationRate.s:1stpos", "kappa.s:2ndpos", "gammaShape.s:2ndpos", "mutationRate.s:2ndpos", "kappa.s:3rdpos", "gammaShape.s:3rdpos", "mutationRate.s:3rdpos", "birthRateY.t:tree", "clockRate.c:clock");
+            assertOperatorsEqual("CalibratedYuleModelTreeScaler.t:tree", "CalibratedYuleModelTreeRootScaler.t:tree", "CalibratedYuleModelUniformOperator.t:tree", "CalibratedYuleModelSubtreeSlide.t:tree", "CalibratedYuleModelNarrow.t:tree", "CalibratedYuleModelWide.t:tree", "CalibratedYuleModelWilsonBalding.t:tree", "KappaScaler.s:noncoding", "gammaShapeScaler.s:noncoding", "FixMeanMutationRatesOperator", "gammaShapeScaler.s:1stpos", "KappaScaler.s:1stpos", "gammaShapeScaler.s:2ndpos", "K [...]
+            assertPriorsEqual("CalibratedYuleModel.t:tree", "CalibratedYuleBirthRatePrior.t:tree", "GammaShapePrior.s:1stpos", "GammaShapePrior.s:2ndpos", "GammaShapePrior.s:3rdpos", "GammaShapePrior.s:noncoding", "KappaPrior.s:1stpos", "KappaPrior.s:2ndpos", "KappaPrior.s:3rdpos", "KappaPrior.s:noncoding", "Human-Chimp.prior", "ClockPrior.c:clock");
+            assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.1stpos", "treeLikelihood.2ndpos", "treeLikelihood.3rdpos", "treeLikelihood.noncoding", "TreeHeight.t:tree", "kappa.s:noncoding", "gammaShape.s:noncoding", "mutationRate.s:noncoding", "kappa.s:1stpos", "gammaShape.s:1stpos", "mutationRate.s:1stpos", "kappa.s:2ndpos", "gammaShape.s:2ndpos", "mutationRate.s:2ndpos", "kappa.s:3rdpos", "gammaShape.s:3rdpos", "mutationRate.s:3rdpos", "CalibratedYuleModel.t:tree [...]
+
+
+            //7c. set gamma priors on birth rate and clock rate
+            warning("7c. set gamma priors on birth rate and clock rate");
+            beautiFrame.comboBox("birthRateY.t:tree.distr").selectItem("Gamma");
+            beautiFrame.button("CalibratedYuleBirthRatePrior.t:tree.editButton").click();
+            beautiFrame.textBox("alpha").selectAll().setText("0.001");
+            beautiFrame.textBox("beta").selectAll().setText("1000");
+            beautiFrame.button("CalibratedYuleBirthRatePrior.t:tree.editButton").click();
+
+            beautiFrame.comboBox("clockRate.c:clock.distr").selectItem("Gamma");
+            beautiFrame.button("ClockPrior.c:clock.editButton").click();
+            beautiFrame.textBox("alpha").selectAll().setText("0.001");
+            beautiFrame.textBox("beta").selectAll().setText("1000");
+            printBeautiState(f);
+            assertStateEquals("Tree.t:tree", "kappa.s:noncoding", "gammaShape.s:noncoding", "mutationRate.s:noncoding", "kappa.s:1stpos", "gammaShape.s:1stpos", "mutationRate.s:1stpos", "kappa.s:2ndpos", "gammaShape.s:2ndpos", "mutationRate.s:2ndpos", "kappa.s:3rdpos", "gammaShape.s:3rdpos", "mutationRate.s:3rdpos", "birthRateY.t:tree", "clockRate.c:clock");
+            assertOperatorsEqual("CalibratedYuleModelTreeScaler.t:tree", "CalibratedYuleModelTreeRootScaler.t:tree", "CalibratedYuleModelUniformOperator.t:tree", "CalibratedYuleModelSubtreeSlide.t:tree", "CalibratedYuleModelNarrow.t:tree", "CalibratedYuleModelWide.t:tree", "CalibratedYuleModelWilsonBalding.t:tree", "KappaScaler.s:noncoding", "gammaShapeScaler.s:noncoding", "FixMeanMutationRatesOperator", "gammaShapeScaler.s:1stpos", "KappaScaler.s:1stpos", "gammaShapeScaler.s:2ndpos", "K [...]
+            assertPriorsEqual("CalibratedYuleModel.t:tree", "CalibratedYuleBirthRatePrior.t:tree", "ClockPrior.c:clock", "GammaShapePrior.s:1stpos", "GammaShapePrior.s:2ndpos", "GammaShapePrior.s:3rdpos", "GammaShapePrior.s:noncoding", "KappaPrior.s:1stpos", "KappaPrior.s:2ndpos", "KappaPrior.s:3rdpos", "KappaPrior.s:noncoding", "Human-Chimp.prior");
+            assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.1stpos", "treeLikelihood.2ndpos", "treeLikelihood.3rdpos", "treeLikelihood.noncoding", "TreeHeight.t:tree", "kappa.s:noncoding", "gammaShape.s:noncoding", "mutationRate.s:noncoding", "kappa.s:1stpos", "gammaShape.s:1stpos", "mutationRate.s:1stpos", "kappa.s:2ndpos", "gammaShape.s:2ndpos", "mutationRate.s:2ndpos", "kappa.s:3rdpos", "gammaShape.s:3rdpos", "mutationRate.s:3rdpos", "CalibratedYuleModel.t:tree [...]
+
+
+            //8. Run MCMC and look at results in Tracer, TreeAnnotator->FigTree
+            warning("8. Run MCMC and look at results in Tracer, TreeAnnotator->FigTree");
+            File fout = new File(org.fest.util.Files.temporaryFolder() + "/primates.xml");
+            if (fout.exists()) {
+                fout.delete();
+            }
+            makeSureXMLParses();
+
+            long t1 = System.currentTimeMillis();
+            System.err.println("total time: " + (t1 - t0) / 1000 + " seconds");
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw e;
+        }
+    }
+
+
+}
+
diff --git a/src/test/beast/app/beauti/BeautiRateTutorialTest.java b/src/test/beast/app/beauti/BeautiRateTutorialTest.java
new file mode 100644
index 0000000..b8877e8
--- /dev/null
+++ b/src/test/beast/app/beauti/BeautiRateTutorialTest.java
@@ -0,0 +1,388 @@
+package test.beast.app.beauti;
+
+
+
+
+import static org.fest.swing.edt.GuiActionRunner.execute;
+import static org.fest.swing.finder.JFileChooserFinder.findFileChooser;
+
+import java.awt.Component;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.swing.JComboBox;
+
+import org.fest.swing.data.Index;
+import org.fest.swing.data.TableCell;
+import org.fest.swing.edt.GuiTask;
+import org.fest.swing.fixture.JButtonFixture;
+import org.fest.swing.fixture.JCheckBoxFixture;
+import org.fest.swing.fixture.JComboBoxFixture;
+import org.fest.swing.fixture.JFileChooserFixture;
+import org.fest.swing.fixture.JOptionPaneFixture;
+import org.fest.swing.fixture.JTabbedPaneFixture;
+import org.fest.swing.fixture.JTableCellFixture;
+import org.fest.swing.fixture.JTableFixture;
+import org.fest.swing.image.ScreenshotTaker;
+import org.junit.Test;
+
+import test.beast.beast2vs1.TestFramework;
+import test.beast.beast2vs1.trace.Expectation;
+
+import beast.app.util.Utils;
+
+
+
+public class BeautiRateTutorialTest extends BeautiBase {
+	// file used to store, then reload xml
+	final static String XML_FILE = "rsv.xml";
+	final static String PREFIX = "doc/tutorials/MEPs/figures/generated/BEAUti_";
+
+	@Test
+	public void MEPTutorial() throws Exception {
+		long t0 = System.currentTimeMillis();
+		ScreenshotTaker screenshotTaker = new ScreenshotTaker();
+		beauti.frame.setSize(1024, 640);
+		
+		File dir = new File(PREFIX.substring(0, PREFIX.lastIndexOf('/')));
+		if (!dir.exists()) {
+			dir.mkdir();
+		}
+		for (File file : dir.listFiles()) {
+			file.delete();
+		}
+		
+		// 0. Load primate-mtDNA.nex
+		warning("// 0. Load RSV2.nex");
+		importAlignment("examples/nexus", new File("RSV2.nex"));
+
+        beautiFrame.menuItemWithPath("Mode", "Automatic set fix mean substitution rate flag").click();
+
+		// load anolis.nex
+		JTabbedPaneFixture f = beautiFrame.tabbedPane();
+		f.requireVisible();
+		f.requireTitle("Partitions", Index.atIndex(0));
+		String[] titles = f.tabTitles();
+		assertArrayEquals(titles,"[Partitions, Tip Dates, Site Model, Clock Model, Priors, MCMC]");
+		System.err.println(Arrays.toString(titles));
+
+		
+		f = f.selectTab("Partitions");
+		JTableFixture t = beautiFrame.table();
+		t.selectCell(TableCell.row(0).column(2));
+		
+		//0. Split partition... 
+		warning("0. Split partition...");
+		beautiFrame.button("Split").click();
+		JOptionPaneFixture dialog = new JOptionPaneFixture(robot());
+		dialog.comboBox().selectItem("1 + 2 + 3 frame 3");
+		dialog.okButton().click();
+		// check table
+		t = beautiFrame.table();
+		printTableContents(t);
+		checkTableContents(t, 
+				"[RSV2_1, RSV2, 129, 209, nucleotide, RSV2_1, RSV2_1, RSV2_1, false]*" +
+				"[RSV2_2, RSV2, 129, 210, nucleotide, RSV2_2, RSV2_2, RSV2_2, false]*" +
+				"[RSV2_3, RSV2, 129, 210, nucleotide, RSV2_3, RSV2_3, RSV2_3, false]"
+			);
+		printBeautiState(f);
+		assertStateEquals("Tree.t:RSV2_2", "clockRate.c:RSV2_2", "birthRate.t:RSV2_2", "Tree.t:RSV2_3", "clockRate.c:RSV2_3", "birthRate.t:RSV2_3", "Tree.t:RSV2_1", "birthRate.t:RSV2_1");
+		assertOperatorsEqual("StrictClockRateScaler.c:RSV2_2", "YuleBirthRateScaler.t:RSV2_2", "YuleModelTreeScaler.t:RSV2_2", "YuleModelTreeRootScaler.t:RSV2_2", "YuleModelUniformOperator.t:RSV2_2", "YuleModelSubtreeSlide.t:RSV2_2", "YuleModelNarrow.t:RSV2_2", "YuleModelWide.t:RSV2_2", "YuleModelWilsonBalding.t:RSV2_2", "strictClockUpDownOperator.c:RSV2_2", "StrictClockRateScaler.c:RSV2_3", "YuleBirthRateScaler.t:RSV2_3", "YuleModelTreeScaler.t:RSV2_3", "YuleModelTreeRootScaler.t:RSV2_3", "Yu [...]
+		assertPriorsEqual("YuleModel.t:RSV2_1", "YuleModel.t:RSV2_2", "YuleModel.t:RSV2_3", "ClockPrior.c:RSV2_2", "YuleBirthRatePrior.t:RSV2_2", "ClockPrior.c:RSV2_3", "YuleBirthRatePrior.t:RSV2_3", "YuleBirthRatePrior.t:RSV2_1");
+		assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.RSV2_2", "TreeHeight.t:RSV2_2", "clockRate.c:RSV2_2", "YuleModel.t:RSV2_2", "birthRate.t:RSV2_2", "treeLikelihood.RSV2_3", "TreeHeight.t:RSV2_3", "clockRate.c:RSV2_3", "YuleModel.t:RSV2_3", "birthRate.t:RSV2_3", "treeLikelihood.RSV2_1", "TreeHeight.t:RSV2_1", "YuleModel.t:RSV2_1", "birthRate.t:RSV2_1");
+	
+		//1a. Link trees... 
+		warning("1a. Link trees...");
+		f.selectTab("Partitions");
+		t = beautiFrame.table();
+		t.selectCells(TableCell.row(0).column(2), TableCell.row(1).column(2), TableCell.row(2).column(2));
+		JButtonFixture linkTreesButton = beautiFrame.button("Link Trees");
+		linkTreesButton.click();
+		printBeautiState(f);
+
+		//1b. ...and call the tree "tree"
+		warning("1b. ...and call the tree \"tree\"");
+		f.selectTab("Partitions");
+		JTableCellFixture cell = beautiFrame.table().cell(TableCell.row(0).column(7));
+		Component editor = cell.editor();
+		JComboBoxFixture comboBox = new JComboBoxFixture(robot(), (JComboBox) editor);
+		cell.startEditing();
+		comboBox.selectAllText();
+		comboBox.enterText("tree");
+		cell.stopEditing();
+		printBeautiState(f);
+		assertStateEquals("clockRate.c:RSV2_2", "clockRate.c:RSV2_3", "Tree.t:tree", "birthRate.t:tree");
+		assertOperatorsEqual("StrictClockRateScaler.c:RSV2_2", "StrictClockRateScaler.c:RSV2_3", "YuleBirthRateScaler.t:tree", "YuleModelTreeScaler.t:tree", "YuleModelTreeRootScaler.t:tree", "YuleModelUniformOperator.t:tree", "YuleModelSubtreeSlide.t:tree", "YuleModelNarrow.t:tree", "YuleModelWide.t:tree", "YuleModelWilsonBalding.t:tree", "strictClockUpDownOperator.c:RSV2_3", "strictClockUpDownOperator.c:RSV2_2");
+		assertPriorsEqual("YuleModel.t:tree", "ClockPrior.c:RSV2_2", "ClockPrior.c:RSV2_3", "YuleBirthRatePrior.t:tree");
+		assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.RSV2_2", "clockRate.c:RSV2_2", "treeLikelihood.RSV2_3", "clockRate.c:RSV2_3", "treeLikelihood.RSV2_1", "TreeHeight.t:tree", "YuleModel.t:tree", "birthRate.t:tree");
+
+		
+		//2a. Link clocks 
+		warning("2a. Link clocks");
+		f.selectTab("Partitions");
+		t = beautiFrame.table();
+		t.selectCells(TableCell.row(0).column(2), TableCell.row(1).column(2), TableCell.row(2).column(2));
+		JButtonFixture linkClocksButton = beautiFrame.button("Link Clock Models");
+		linkClocksButton.click();
+
+		//2b. and call the uncorrelated relaxed molecular clock "clock"
+		warning("2b. and call the uncorrelated relaxed molecular clock \"clock\"");
+		cell = beautiFrame.table().cell(TableCell.row(0).column(6));
+		editor = cell.editor();
+		comboBox = new JComboBoxFixture(robot(), (JComboBox) editor);
+		cell.startEditing();
+		comboBox.selectAllText();
+		comboBox.enterText("clock");
+		cell.stopEditing();
+		printBeautiState(f);
+		assertStateEquals("Tree.t:tree", "birthRate.t:tree");
+		assertOperatorsEqual("YuleBirthRateScaler.t:tree", "YuleModelTreeScaler.t:tree", "YuleModelTreeRootScaler.t:tree", "YuleModelUniformOperator.t:tree", "YuleModelSubtreeSlide.t:tree", "YuleModelNarrow.t:tree", "YuleModelWide.t:tree", "YuleModelWilsonBalding.t:tree");
+		assertPriorsEqual("YuleModel.t:tree", "YuleBirthRatePrior.t:tree");
+		assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.RSV2_2", "treeLikelihood.RSV2_3", "treeLikelihood.RSV2_1", "TreeHeight.t:tree", "YuleModel.t:tree", "birthRate.t:tree");
+
+		
+		//3a. Link site models
+		warning("3a. link site models");
+		f.selectTab("Partitions");
+		t = beautiFrame.table();
+		t.selectCells(TableCell.row(0).column(2), TableCell.row(1).column(2), TableCell.row(2).column(2));
+		JButtonFixture linkSiteModelsButton = beautiFrame.button("Link Site Models");
+		linkSiteModelsButton.click();
+		
+		//3b. Set the site model to HKY (empirical)
+		warning("3b. Set the site model to HKY (empirical)");
+		f.selectTab("Site Model");
+		beautiFrame.comboBox("substModel").selectItem("HKY");
+		JComboBoxFixture freqs = beautiFrame.comboBox("frequencies");
+		freqs.selectItem("Empirical");
+		beautiFrame.checkBox("mutationRate.isEstimated").check();
+		JCheckBoxFixture fixMeanMutationRate = beautiFrame.checkBox("FixMeanMutationRate");
+		fixMeanMutationRate.check();
+		screenshotTaker.saveComponentAsPng(beauti.frame, PREFIX + "Site_Model.png");
+		printBeautiState(f);
+		
+		//3c. Unlink site models
+		warning("3c. unlink site models");
+		f.selectTab("Partitions");
+		t = beautiFrame.table();
+		t.selectCells(TableCell.row(0).column(2), TableCell.row(1).column(2), TableCell.row(2).column(2));
+		JButtonFixture unlinkSiteModelsButton = beautiFrame.button("Unlink Site Models");
+		unlinkSiteModelsButton.click();
+		printBeautiState(f);
+		assertStateEquals("Tree.t:tree", "birthRate.t:tree", "kappa.s:RSV2_1", "mutationRate.s:RSV2_1", "kappa.s:RSV2_2", "mutationRate.s:RSV2_2", "kappa.s:RSV2_3", "mutationRate.s:RSV2_3");
+		assertOperatorsEqual("YuleBirthRateScaler.t:tree", "YuleModelTreeScaler.t:tree", "YuleModelTreeRootScaler.t:tree", "YuleModelUniformOperator.t:tree", "YuleModelSubtreeSlide.t:tree", "YuleModelNarrow.t:tree", "YuleModelWide.t:tree", "YuleModelWilsonBalding.t:tree", "KappaScaler.s:RSV2_1", "KappaScaler.s:RSV2_2", "KappaScaler.s:RSV2_3", "FixMeanMutationRatesOperator");
+		assertPriorsEqual("YuleModel.t:tree", "YuleBirthRatePrior.t:tree", "KappaPrior.s:RSV2_1", "KappaPrior.s:RSV2_2", "KappaPrior.s:RSV2_3");
+		assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.RSV2_2", "treeLikelihood.RSV2_3", "treeLikelihood.RSV2_1", "TreeHeight.t:tree", "YuleModel.t:tree", "birthRate.t:tree", "kappa.s:RSV2_1", "mutationRate.s:RSV2_1", "kappa.s:RSV2_2", "mutationRate.s:RSV2_2", "kappa.s:RSV2_3", "mutationRate.s:RSV2_3");
+		
+		screenshotTaker.saveComponentAsPng(beauti.frame, PREFIX + "partition.png");
+		
+		//4. set up tip dates
+		f = f.selectTab("Tip Dates");
+		warning("4. Seting up tip dates");
+		beautiFrame.checkBox().click();
+		beautiFrame.button("Guess").click();
+		JOptionPaneFixture dialog2 = new JOptionPaneFixture(robot());
+		dialog2.textBox("SplitChar").deleteText().enterText("s");
+		screenshotTaker.saveComponentAsPng(dialog2.component(), PREFIX + "GuessDates.png");
+		dialog2.comboBox("delimiterCombo").selectItem("after last");		
+		dialog2.okButton().click();
+		screenshotTaker.saveComponentAsPng(beauti.frame, PREFIX + "dates.png");
+		printBeautiState(f);
+		assertStateEquals("Tree.t:tree", "birthRate.t:tree", "kappa.s:RSV2_1", "mutationRate.s:RSV2_1", "kappa.s:RSV2_2", "mutationRate.s:RSV2_2", "kappa.s:RSV2_3", "mutationRate.s:RSV2_3", "clockRate.c:clock");
+		assertOperatorsEqual("YuleBirthRateScaler.t:tree", "YuleModelTreeScaler.t:tree", "YuleModelTreeRootScaler.t:tree", "YuleModelUniformOperator.t:tree", "YuleModelSubtreeSlide.t:tree", "YuleModelNarrow.t:tree", "YuleModelWide.t:tree", "YuleModelWilsonBalding.t:tree", "KappaScaler.s:RSV2_1", "KappaScaler.s:RSV2_2", "KappaScaler.s:RSV2_3", "FixMeanMutationRatesOperator", "StrictClockRateScaler.c:clock", "strictClockUpDownOperator.c:clock");
+		assertPriorsEqual("YuleModel.t:tree", "YuleBirthRatePrior.t:tree", "KappaPrior.s:RSV2_1", "KappaPrior.s:RSV2_2", "KappaPrior.s:RSV2_3", "ClockPrior.c:clock");
+		assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.RSV2_2", "treeLikelihood.RSV2_3", "treeLikelihood.RSV2_1", "TreeHeight.t:tree", "YuleModel.t:tree", "birthRate.t:tree", "kappa.s:RSV2_1", "mutationRate.s:RSV2_1", "kappa.s:RSV2_2", "mutationRate.s:RSV2_2", "kappa.s:RSV2_3", "mutationRate.s:RSV2_3", "clockRate.c:clock");
+		
+		//5. Change tree prior to Coalescent with constant pop size 
+		warning("5a. Change tree prior to Coalescent with constant pop size");
+		f.selectTab("Priors");
+		beautiFrame.comboBox("TreeDistribution").selectItem("Coalescent Constant Population");
+		
+		warning("5b. Change clock prior to Log Normal with M = -5, S = 1.25");
+		beautiFrame.comboBox("clockRate.c:clock.distr").selectItem("Log Normal");
+		beautiFrame.button("ClockPrior.c:clock.editButton").click();
+		beautiFrame.textBox("M").selectAll().setText("-5");
+		beautiFrame.textBox("S").selectAll().setText("1.25");
+		screenshotTaker.saveComponentAsPng(beauti.frame, PREFIX + "priors.png");
+		printBeautiState(f);
+		assertStateEquals("Tree.t:tree", "kappa.s:RSV2_1", "mutationRate.s:RSV2_1", "kappa.s:RSV2_2", "mutationRate.s:RSV2_2", "kappa.s:RSV2_3", "mutationRate.s:RSV2_3", "clockRate.c:clock", "popSize.t:tree");
+		assertOperatorsEqual("CoalescentConstantTreeScaler.t:tree", "CoalescentConstantTreeRootScaler.t:tree", "CoalescentConstantUniformOperator.t:tree", "CoalescentConstantSubtreeSlide.t:tree", "CoalescentConstantNarrow.t:tree", "CoalescentConstantWide.t:tree", "CoalescentConstantWilsonBalding.t:tree", "KappaScaler.s:RSV2_1", "KappaScaler.s:RSV2_2", "KappaScaler.s:RSV2_3", "FixMeanMutationRatesOperator", "StrictClockRateScaler.c:clock", "strictClockUpDownOperator.c:clock", "PopSizeScaler.t:tree");
+		assertPriorsEqual("CoalescentConstant.t:tree", "ClockPrior.c:clock", "KappaPrior.s:RSV2_1", "KappaPrior.s:RSV2_2", "KappaPrior.s:RSV2_3", "PopSizePrior.t:tree");
+		assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.RSV2_2", "treeLikelihood.RSV2_3", "treeLikelihood.RSV2_1", "TreeHeight.t:tree", "kappa.s:RSV2_1", "mutationRate.s:RSV2_1", "kappa.s:RSV2_2", "mutationRate.s:RSV2_2", "kappa.s:RSV2_3", "mutationRate.s:RSV2_3", "clockRate.c:clock", "popSize.t:tree", "CoalescentConstant.t:tree");
+
+
+		//6. Run MCMC and look at results in Tracer, TreeAnnotator->FigTree
+		warning("6. Setting up MCMC parameters");
+		f = f.selectTab("MCMC");
+		beautiFrame.textBox("chainLength").selectAll().setText("2000000");
+		beautiFrame.button("tracelog.editButton").click();
+		beautiFrame.textBox("logEvery").selectAll().setText("400");
+		beautiFrame.button("tracelog.editButton").click();
+		
+
+		beautiFrame.button("treelog.t:tree.editButton").click();
+		beautiFrame.textBox("logEvery").selectAll().setText("400");
+		screenshotTaker.saveComponentAsPng(beauti.frame, PREFIX + "mcmc.png");
+		beautiFrame.button("treelog.t:tree.editButton").click();
+		printBeautiState(f);
+		assertStateEquals("Tree.t:tree", "kappa.s:RSV2_1", "mutationRate.s:RSV2_1", "kappa.s:RSV2_2", "mutationRate.s:RSV2_2", "kappa.s:RSV2_3", "mutationRate.s:RSV2_3", "clockRate.c:clock", "popSize.t:tree");
+		assertOperatorsEqual("CoalescentConstantTreeScaler.t:tree", "CoalescentConstantTreeRootScaler.t:tree", "CoalescentConstantUniformOperator.t:tree", "CoalescentConstantSubtreeSlide.t:tree", "CoalescentConstantNarrow.t:tree", "CoalescentConstantWide.t:tree", "CoalescentConstantWilsonBalding.t:tree", "KappaScaler.s:RSV2_1", "KappaScaler.s:RSV2_2", "KappaScaler.s:RSV2_3", "FixMeanMutationRatesOperator", "StrictClockRateScaler.c:clock", "strictClockUpDownOperator.c:clock", "PopSizeScaler.t:tree");
+		assertPriorsEqual("CoalescentConstant.t:tree", "ClockPrior.c:clock", "KappaPrior.s:RSV2_1", "KappaPrior.s:RSV2_2", "KappaPrior.s:RSV2_3", "PopSizePrior.t:tree");
+		assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.RSV2_2", "treeLikelihood.RSV2_3", "treeLikelihood.RSV2_1", "TreeHeight.t:tree", "kappa.s:RSV2_1", "mutationRate.s:RSV2_1", "kappa.s:RSV2_2", "mutationRate.s:RSV2_2", "kappa.s:RSV2_3", "mutationRate.s:RSV2_3", "clockRate.c:clock", "popSize.t:tree", "CoalescentConstant.t:tree");
+		
+		
+		//7. Run MCMC and look at results in Tracer, TreeAnnotator->FigTree
+		warning("7. Run MCMC and look at results in Tracer, TreeAnnotator->FigTree");
+		makeSureXMLParses();
+		
+ 		MEPRunner runner = new MEPRunner(org.fest.util.Files.temporaryFolder());
+ 		runner.analyse(0);
+		
+		long t1 = System.currentTimeMillis();
+		System.err.println("total time: " + (t1 - t0)/1000 + " seconds");
+		
+	}
+	
+	
+	 // This is for debugging the test only
+// 	MEPRunner should be run from MEPTutorial()
+// 	@Test
+// 	public void runXML() throws Exception {
+// 		//System.setProperty("file.name.prefix", org.fest.util.Files.temporaryFolder().getAbsolutePath());
+// 		MEPRunner runner = new MEPRunner(org.fest.util.Files.temporaryFolder());
+// 		runner.analyse(0);
+// 		
+// 	}
+    
+	class MEPRunner extends TestFramework {
+		
+		MEPRunner(File file) {
+			super();
+			setUp(new String[]{"/x.xml"});
+			sDir = file.getPath();
+			sLogDir = "";
+			useSeed = false;
+	        checkESS = false;
+			testFile = "RSV2";
+		}
+
+		@Override
+		protected List<Expectation> giveExpectations(int index_XML) throws Exception {
+	        List<Expectation> expList = new ArrayList<Expectation>();
+	        addExpIntoList(expList,"posterior", -6131.89, 0.922052);
+	        addExpIntoList(expList,"likelihood", -5496.28, 0.401133);
+	        // low ESS for seed=128
+	        addExpIntoList(expList,"prior", -635.603, 1.215535);
+	        addExpIntoList(expList,"treeLikelihood.1", -1440.16, 0.197223);
+	        addExpIntoList(expList,"treeLikelihood.3", -2271.52, 0.300608);
+	        addExpIntoList(expList,"treeLikelihood.2", -1784.59, 0.29738);
+	        addExpIntoList(expList,"TreeHeight", 56.06136, 0.125308);
+	        addExpIntoList(expList,"kappa.1", 7.727761, 0.069897);
+	        addExpIntoList(expList,"kappa.2", 10.41839, 0.093578);
+	        addExpIntoList(expList,"kappa.3", 11.97769, 0.090429);
+	        addExpIntoList(expList,"mutationRate.1", 0.698603, 0.000868);
+	        addExpIntoList(expList,"mutationRate.2", 0.960092, 0.00099);
+	        addExpIntoList(expList,"mutationRate.3", 1.33987, 0.001132);
+	        addExpIntoList(expList,"clockRate", 0.002179, 1.16E-5);
+	        addExpIntoList(expList,"popSize", 37.44745, 0.368656);
+	        // low ESS for seed=128
+	        addExpIntoList(expList,"CoalescentConstant", -590.862, 1.164024);
+			return expList;
+		}
+		
+	}
+    
+
+
+	@Test
+	public void MEPBSPTutorial() throws InterruptedException {
+		if (true) {return;}
+		try {
+		long t0 = System.currentTimeMillis();
+		ScreenshotTaker screenshotTaker = new ScreenshotTaker();
+		beauti.frame.setSize(1024, 640);
+
+		// 1. reaload XML file
+		warning("1. reload rsv.xml");
+		String dir = "" + org.fest.util.Files.temporaryFolder();
+		String file = XML_FILE;
+		
+		if (!Utils.isMac()) {
+			beautiFrame.menuItemWithPath("File", "Load").click();
+			JFileChooserFixture fileChooser = findFileChooser().using(robot());
+			fileChooser.setCurrentDirectory(new File(dir));
+			fileChooser.selectFile(new File(file)).approve();
+		} else {
+			_file = new File(dir + "/" + file);
+			execute(new GuiTask() {
+		        protected void executeInEDT() {
+	                doc.newAnalysis();
+	                doc.setFileName(_file.getAbsolutePath());
+	                try {
+		                doc.loadXML(new File(doc.getFileName()));
+		        	} catch (Exception e) {
+						e.printStackTrace();
+					}
+		        }
+		    });
+							
+		}
+		JTabbedPaneFixture f = beautiFrame.tabbedPane();
+		printBeautiState(f);
+
+		// 2. change tree prior to BSP
+		warning("2. change tree prior to BSP");
+		f.selectTab("Priors");
+		beautiFrame.comboBox("TreeDistribution").selectItem("Coalescent Bayesian Skyline");
+		screenshotTaker.saveComponentAsPng(beauti.frame, PREFIX + "priors2.png");
+		printBeautiState(f);
+		
+		// 3. change tree prior to BSP
+		warning("3. change group and population size parameters");
+		beautiFrame.menuItemWithPath("View","Show Initialization panel").click();
+		
+		beautiFrame.button("bPopSizes.t:tree.editButton").click();
+		beautiFrame.textBox("dimension").selectAll().setText("3");
+		beautiFrame.button("bPopSizes.t:tree.editButton").click();
+		
+		beautiFrame.button("bGroupSizes.t:tree.editButton").click();
+		beautiFrame.textBox("dimension").selectAll().setText("3");
+		screenshotTaker.saveComponentAsPng(beauti.frame, PREFIX + "init.png");
+		printBeautiState(f);
+		
+		// 4. set chain-length to 10M, log every 10K
+		warning("4. set chaing-length to 10M, log every 10K");
+		f = f.selectTab("MCMC");
+		beautiFrame.textBox("chainLength").selectAll().setText("10000000");
+		beautiFrame.button("tracelog.editButton").click();
+		beautiFrame.textBox("logEvery").selectAll().setText("10000");
+		beautiFrame.button("tracelog.editButton").click();
+		
+
+		beautiFrame.button("treelog.t:tree.editButton").click();
+		beautiFrame.textBox("logEvery").selectAll().setText("10000");
+		beautiFrame.button("treelog.t:tree.editButton").click();
+		printBeautiState(f);
+		
+		// 5. save XML file
+		warning("5. save XML file");
+		File fout = new File(org.fest.util.Files.temporaryFolder() + "/" + XML_FILE);
+		if (fout.exists()) {
+			fout.delete();
+		}
+		saveFile(""+org.fest.util.Files.temporaryFolder(), XML_FILE);
+
+		//4. Run MCMC and look at results in Tracer, TreeAnnotator->FigTree
+		makeSureXMLParses();
+		long t1 = System.currentTimeMillis();
+		System.err.println("total time: " + (t1 - t0)/1000 + " seconds");
+		} catch (Exception e) {
+			e.printStackTrace();
+		
+		}
+	}
+
+}
+
diff --git a/src/test/beast/app/beauti/BeautiSimpleTest.java b/src/test/beast/app/beauti/BeautiSimpleTest.java
new file mode 100644
index 0000000..edd542d
--- /dev/null
+++ b/src/test/beast/app/beauti/BeautiSimpleTest.java
@@ -0,0 +1,129 @@
+package test.beast.app.beauti;
+
+
+import static org.fest.assertions.Assertions.assertThat;
+import static org.fest.swing.driver.ComponentStateValidator.validateIsEnabledAndShowing;
+import static org.fest.swing.edt.GuiActionRunner.execute;
+import static org.fest.swing.finder.JFileChooserFinder.findFileChooser;
+
+import java.awt.Button;
+import java.awt.Component;
+import java.awt.FileDialog;
+import java.io.File;
+import java.util.Arrays;
+
+import javax.swing.JComboBox;
+
+import org.fest.swing.core.ComponentMatcher;
+import org.fest.swing.core.GenericTypeMatcher;
+import org.fest.swing.data.Index;
+import org.fest.swing.data.TableCell;
+import org.fest.swing.edt.GuiTask;
+import org.fest.swing.finder.DialogFinder;
+import org.fest.swing.finder.WindowFinder;
+import org.fest.swing.fixture.DialogFixture;
+import org.fest.swing.fixture.JCheckBoxFixture;
+import org.fest.swing.fixture.JComboBoxFixture;
+import org.fest.swing.fixture.JFileChooserFixture;
+import org.fest.swing.fixture.JTabbedPaneFixture;
+import org.fest.swing.fixture.JTableCellFixture;
+import org.fest.swing.fixture.JTableFixture;
+import org.fest.swing.fixture.JTextComponentFixture;
+import org.fest.swing.image.ScreenshotTaker;
+import org.junit.Test;
+
+import beast.app.beauti.TaxonSetDialog;
+
+
+
+public class BeautiSimpleTest extends BeautiBase {
+
+	
+	@Test
+	public void simpleTest() throws Exception {
+		
+		importAlignment("examples/nexus", new File("anolis.nex"));
+
+		// load anolis.nex
+		JTabbedPaneFixture f = beautiFrame.tabbedPane();
+		f.requireVisible();
+		f.requireTitle("Partitions", Index.atIndex(0));
+		String[] titles = f.tabTitles();
+		assertArrayEquals(titles,"[Partitions, Tip Dates, Site Model, Clock Model, Priors, MCMC]");
+		System.err.println(Arrays.toString(titles));
+		f = f.selectTab("Partitions");
+		JTableFixture t = beautiFrame.table();
+		String[][] tc = t.contents();
+		System.err.println(Arrays.toString(tc[0]));
+		assertArrayEquals(tc[0],"[anolis, anolis, 29, 1456, nucleotide, anolis, anolis, anolis, false]");
+		assertThat(f).isNotNull();
+		assertStateEquals("Tree.t:anolis", "birthRate.t:anolis");
+		assertOperatorsEqual("YuleBirthRateScaler.t:anolis", "YuleModelTreeScaler.t:anolis", "YuleModelTreeRootScaler.t:anolis", "YuleModelUniformOperator.t:anolis", "YuleModelSubtreeSlide.t:anolis", "YuleModelNarrow.t:anolis", "YuleModelWide.t:anolis", "YuleModelWilsonBalding.t:anolis");
+		assertPriorsEqual("YuleModel.t:anolis", "YuleBirthRatePrior.t:anolis");
+		assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.anolis", "TreeHeight.t:anolis", "YuleModel.t:anolis", "birthRate.t:anolis");
+		
+		
+		ScreenshotTaker screenshotTaker = new ScreenshotTaker();
+		(new File("/tmp/simpleTest1.png")).delete();
+		(new File("/tmp/simpleTest2.png")).delete();
+		(new File("/tmp/simpleTest3.png")).delete();
+		(new File("/tmp/simpleTest4.png")).delete();
+		screenshotTaker.saveComponentAsPng(beauti.frame, "/tmp/simpleTest1.png");		
+		
+		
+		// Set the site model to HKY (estimated)
+		f.selectTab("Site Model");
+		JComboBoxFixture substModel = beautiFrame.comboBox("substModel");
+		substModel.selectItem("HKY");
+		printBeautiState(f);
+		assertStateEquals("Tree.t:anolis", "birthRate.t:anolis", "kappa.s:anolis", "freqParameter.s:anolis");
+		assertOperatorsEqual("YuleBirthRateScaler.t:anolis", "YuleModelTreeScaler.t:anolis", "YuleModelTreeRootScaler.t:anolis", "YuleModelUniformOperator.t:anolis", "YuleModelSubtreeSlide.t:anolis", "YuleModelNarrow.t:anolis", "YuleModelWide.t:anolis", "YuleModelWilsonBalding.t:anolis", "KappaScaler.s:anolis", "FrequenciesExchanger.s:anolis");
+		assertPriorsEqual("YuleModel.t:anolis", "YuleBirthRatePrior.t:anolis", "KappaPrior.s:anolis");
+		assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.anolis", "TreeHeight.t:anolis", "YuleModel.t:anolis", "birthRate.t:anolis", "kappa.s:anolis", "freqParameter.s:anolis");
+
+		
+		// Set the site model to HKY (G4) (estimated)
+		f.selectTab("Site Model");
+		JTextComponentFixture categoryCount = beautiFrame.textBox("gammaCategoryCount");
+		categoryCount.setText("4");
+		printBeautiState(f);
+		assertStateEquals("Tree.t:anolis", "birthRate.t:anolis", "kappa.s:anolis", "freqParameter.s:anolis");
+		assertOperatorsEqual("YuleBirthRateScaler.t:anolis", "YuleModelTreeScaler.t:anolis", "YuleModelTreeRootScaler.t:anolis", "YuleModelUniformOperator.t:anolis", "YuleModelSubtreeSlide.t:anolis", "YuleModelNarrow.t:anolis", "YuleModelWide.t:anolis", "YuleModelWilsonBalding.t:anolis", "KappaScaler.s:anolis", "FrequenciesExchanger.s:anolis");
+		assertPriorsEqual("YuleModel.t:anolis", "YuleBirthRatePrior.t:anolis", "KappaPrior.s:anolis");
+		assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.anolis", "TreeHeight.t:anolis", "YuleModel.t:anolis", "birthRate.t:anolis", "kappa.s:anolis", "freqParameter.s:anolis");
+
+		f.selectTab("Site Model");
+		JCheckBoxFixture shapeIsEstimated = beautiFrame.checkBox("shape.isEstimated");
+		shapeIsEstimated.check();
+		printBeautiState(f);
+		assertStateEquals("Tree.t:anolis", "birthRate.t:anolis", "kappa.s:anolis", "gammaShape.s:anolis", "freqParameter.s:anolis");
+		assertOperatorsEqual("YuleBirthRateScaler.t:anolis", "YuleModelTreeScaler.t:anolis", "YuleModelTreeRootScaler.t:anolis", "YuleModelUniformOperator.t:anolis", "YuleModelSubtreeSlide.t:anolis", "YuleModelNarrow.t:anolis", "YuleModelWide.t:anolis", "YuleModelWilsonBalding.t:anolis", "KappaScaler.s:anolis", "gammaShapeScaler.s:anolis", "FrequenciesExchanger.s:anolis");
+		assertPriorsEqual("YuleModel.t:anolis", "YuleBirthRatePrior.t:anolis", "KappaPrior.s:anolis", "GammaShapePrior.s:anolis");
+		assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.anolis", "TreeHeight.t:anolis", "YuleModel.t:anolis", "birthRate.t:anolis", "kappa.s:anolis", "gammaShape.s:anolis", "freqParameter.s:anolis");
+
+		screenshotTaker.saveComponentAsPng(beauti.frame, "/tmp/simpleTest2.png");		
+		// rename tree from 'anolis' to 'tree'
+		f.selectTab("Partitions");
+		JTableCellFixture cell = beautiFrame.table().cell(TableCell.row(0).column(7));
+		Component editor = cell.editor();
+		JComboBoxFixture comboBox = new JComboBoxFixture(robot(), (JComboBox) editor);
+		cell.startEditing();
+		comboBox.selectAllText();
+		comboBox.enterText("tree");
+		cell.stopEditing();
+		printBeautiState(f);
+		assertStateEquals("Tree.t:tree", "birthRate.t:tree", "kappa.s:anolis", "gammaShape.s:anolis", "freqParameter.s:anolis");
+		assertOperatorsEqual("YuleBirthRateScaler.t:tree", "YuleModelTreeScaler.t:tree", "YuleModelTreeRootScaler.t:tree", "YuleModelUniformOperator.t:tree", "YuleModelSubtreeSlide.t:tree", "YuleModelNarrow.t:tree", "YuleModelWide.t:tree", "YuleModelWilsonBalding.t:tree", "KappaScaler.s:anolis", "gammaShapeScaler.s:anolis", "FrequenciesExchanger.s:anolis");
+		assertPriorsEqual("YuleModel.t:tree", "YuleBirthRatePrior.t:tree", "GammaShapePrior.s:anolis", "KappaPrior.s:anolis");
+		assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.anolis", "TreeHeight.t:tree", "YuleModel.t:tree", "birthRate.t:tree", "kappa.s:anolis", "gammaShape.s:anolis", "freqParameter.s:anolis");
+		
+		screenshotTaker.saveComponentAsPng(beauti.frame, "/tmp/simpleTest3.png");		
+		// Create a Normal calibration prior and monophyletic constraint on Human-Chimp split of 6 +/- 0.5.
+		f.selectTab("Priors");
+
+		screenshotTaker.saveComponentAsPng(beauti.frame, "/tmp/simpleTest4.png");		
+
+		makeSureXMLParses();
+	}
+
+}
diff --git a/src/test/beast/app/beauti/BeautiStarBeastTest.java b/src/test/beast/app/beauti/BeautiStarBeastTest.java
new file mode 100644
index 0000000..50a7992
--- /dev/null
+++ b/src/test/beast/app/beauti/BeautiStarBeastTest.java
@@ -0,0 +1,181 @@
+package test.beast.app.beauti;
+
+
+
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+
+import org.fest.swing.fixture.JComboBoxFixture;
+import org.fest.swing.fixture.JMenuItemFixture;
+import org.fest.swing.fixture.JOptionPaneFixture;
+import org.fest.swing.fixture.JTabbedPaneFixture;
+import org.fest.swing.image.ScreenshotTaker;
+import org.junit.Test;
+
+import test.beast.beast2vs1.TestFramework;
+import test.beast.beast2vs1.trace.Expectation;
+
+public class BeautiStarBeastTest extends BeautiBase {
+	final static String PREFIX = "doc/tutorials/STARBEAST/figures/BEAUti_";
+
+	@Test
+	public void simpleStarBeastTest() throws Exception {
+		ScreenshotTaker screenshotTaker = new ScreenshotTaker();
+		beauti.frame.setSize(1024, 640);
+
+		String BASE_DIR = PREFIX.substring(0, PREFIX.lastIndexOf('/'));
+		for (File file : new File(BASE_DIR).listFiles()) {
+			if (file.getAbsolutePath().contains(PREFIX) && file.getName().endsWith(".png")) {
+				file.delete();
+			}
+		}
+		
+		// create screen-shot showing template menu item
+		warning("Select StarBeast template");
+		beautiFrame.menuItemWithPath("File", "Template").click();
+		screenshotTaker.saveComponentAsPng(beauti.frame, PREFIX + "selectTemplate.png");
+		JMenuItemFixture templateMenu = beautiFrame.menuItemWithPath("File", "Template", "StarBeast");
+		templateMenu.click();
+		// remove menu from screen
+		beautiFrame.menuItemWithPath("File").click();
+		JTabbedPaneFixture f = beautiFrame.tabbedPane();
+		f = f.selectTab("Priors");
+
+
+		// 1. Load gopher data 26.nex, 29.nex, 47.nex
+		warning("1. Load gopher data 26.nex, 29.nex, 47.nex");
+		importAlignment("examples/nexus", new File("26.nex"), new File("29.nex"), new File("47.nex"));
+
+		screenshotTaker.saveComponentAsPng(beauti.frame, PREFIX + "DataPartitions.png");
+		printBeautiState(f);
+
+		
+		// 2. Define Taxon sets
+		warning("2. Define taxon sets");
+		f.selectTab("Taxon sets");
+		beautiFrame.button("Guess").click();
+		JOptionPaneFixture dialog = new JOptionPaneFixture(robot());
+		//DialogFixture dialog = WindowFinder.findDialog("GuessTaxonSets").using(robot());
+		dialog.radioButton("split on character").click();
+		dialog.comboBox("splitCombo").selectItem("2");
+		dialog.textBox("SplitChar2").deleteText().enterText("_");
+		screenshotTaker.saveComponentAsPng(beauti.frame, PREFIX + "Guess_Taxonsets.png");
+		//JButton okButton = dialog.robot.finder().find(JButtonMatcher.withText("OK"));
+		//new JButtonFixture(dialog.robot, okButton).click();
+		dialog.okButton().click();
+		printBeautiState(f);
+
+		// 3. Set site model to HKY + empirical frequencies
+		warning("3. Set site model to HKY + empirical frequencies");
+		f.selectTab("Site Model");
+		for (int i = 0; i < 3; i++) {
+			beautiFrame.list().selectItem(i);
+			beautiFrame.comboBox("substModel").selectItem("HKY");
+			JComboBoxFixture freqs = beautiFrame.comboBox("frequencies");
+			freqs.selectItem("Empirical");
+			//beautiFrame.checkBox("mutationRate.isEstimated").check();
+		}
+		//JCheckBoxFixture fixMeanMutationRate = beautiFrame.checkBox("FixMeanMutationRate");
+		//fixMeanMutationRate.check();
+		screenshotTaker.saveComponentAsPng(beauti.frame, PREFIX + "Site_Model.png");
+		printBeautiState(f);
+		
+		// 4. Inspect clock models
+		warning("4. Inspect clock models");
+		f.selectTab("Clock Model");
+		beautiFrame.list().selectItem(0);
+		screenshotTaker.saveComponentAsPng(beauti.frame, PREFIX + "ClockModel1.png");
+		beautiFrame.list().selectItem(1);
+		screenshotTaker.saveComponentAsPng(beauti.frame, PREFIX + "ClockModel2.png");
+		beautiFrame.list().selectItem(2);
+		screenshotTaker.saveComponentAsPng(beauti.frame, PREFIX + "ClockModel3.png");
+		
+		// 5. Inspect multispecies coalescent
+		warning("5. Inspect multispecies coalescent");
+		f.selectTab("Multi Species Coalescent");
+		beautiFrame.button("treePrior.t:26.editButton").click();
+		beautiFrame.button("treePrior.t:29.editButton").click();
+		beautiFrame.button("treePrior.t:47.editButton").click();
+		beautiFrame.comboBox().selectItem("linear_with_constant_root");
+		beautiFrame.button("treePrior.t:26.editButton").click();
+		beautiFrame.button("treePrior.t:29.editButton").click();
+		beautiFrame.button("treePrior.t:47.editButton").click();
+		screenshotTaker.saveComponentAsPng(beauti.frame, PREFIX + "MSP.png");
+		
+		// 6. Set up MCMC parameters
+		warning("6. Set up MCMC parameters");
+		f = f.selectTab("MCMC");
+		beautiFrame.textBox("chainLength").selectAll().setText("5000000");
+		beautiFrame.button("speciesTreeLogger.editButton").click();
+		beautiFrame.textBox("logEvery").selectAll().setText("1000");
+		beautiFrame.button("speciesTreeLogger.editButton").click();
+
+		beautiFrame.button("screenlog.editButton").click();
+		beautiFrame.textBox("logEvery").selectAll().setText("10000");
+		beautiFrame.button("speciesTreeLogger.editButton").click();
+		screenshotTaker.saveComponentAsPng(beauti.frame, PREFIX + "MCMC.png");
+		
+		makeSureXMLParses();
+		
+		StarBEASTRunner runner = new StarBEASTRunner(org.fest.util.Files.temporaryFolder());
+		runner.analyse(0);
+	}
+
+// This is for debugging the test only
+//	StarBEASTRunner should be run from simpleStarBeastTest()
+//	@Test
+//	public void runXML() throws Exception {
+//		//System.setProperty("file.name.prefix", org.fest.util.Files.temporaryFolder().getAbsolutePath());
+//		StarBEASTRunner runner = new StarBEASTRunner(org.fest.util.Files.temporaryFolder());
+//		runner.analyse(0);
+//		
+//	}
+	
+	class StarBEASTRunner extends TestFramework {
+		
+		StarBEASTRunner(File file) {
+			super();
+			setUp(new String[]{"/x.xml"});
+			sDir = file.getPath();
+			sLogDir = "";
+			testFile = "beast_";
+			checkESS = false;
+		}
+
+		@Override
+		protected List<Expectation> giveExpectations(int index_XML) throws Exception {
+	        List<Expectation> expList = new ArrayList<Expectation>();
+			addExpIntoList(expList,"posterior", -3820.43, 1.405193);
+			addExpIntoList(expList,"likelihood", -4297.21, 0.387458);
+			addExpIntoList(expList,"prior", 21.82193, 0.088263);
+			addExpIntoList(expList,"speciescoalescent", 454.9617, 1.470592);
+			addExpIntoList(expList,"birthRate.t:Species", 147.594, 3.45043);
+			addExpIntoList(expList,"YuleModel.t:Species", 27.19939, 0.091772);
+			addExpIntoList(expList,"TreeHeight.Species", 0.014721, 0.000223);
+			addExpIntoList(expList,"TreeHeight.t:47", 0.018463, 0.000238);
+			addExpIntoList(expList,"TreeHeight.t:26", 0.026735, 0.000143);
+			addExpIntoList(expList,"TreeHeight.t:29", 0.024885, 0.000294);
+			addExpIntoList(expList,"treeLikelihood.47", -1779.19, 0.198595);
+			addExpIntoList(expList,"treeLikelihood.26", -1270.7, 0.239457);
+			addExpIntoList(expList,"treeLikelihood.29", -1247.32, 0.283277);
+			addExpIntoList(expList,"treePrior.t:47", 115.79, 0.432574);
+			addExpIntoList(expList,"treePrior.t:26", 107.3072, 0.263393);
+			addExpIntoList(expList,"treePrior.t:29", 112.1106, 0.439123);
+			addExpIntoList(expList,"clockRate.c:47", 1.57111, 0.021326);
+			addExpIntoList(expList,"clockRate.c:29", 0.930268, 0.01279);
+			addExpIntoList(expList,"kappa.s:26", 4.494062, 0.099191);
+			addExpIntoList(expList,"kappa.s:29", 3.985931, 0.077119);
+			addExpIntoList(expList,"kappa.s:47", 3.628151, 0.063317);
+			return expList;
+		}
+		
+	}
+	
+	
+	
+	
+
+}
diff --git a/src/test/beast/app/beauti/CloneTest.java b/src/test/beast/app/beauti/CloneTest.java
new file mode 100644
index 0000000..0ccb4b7
--- /dev/null
+++ b/src/test/beast/app/beauti/CloneTest.java
@@ -0,0 +1,158 @@
+package test.beast.app.beauti;
+
+
+
+
+
+import java.io.File;
+
+import org.fest.swing.fixture.JButtonFixture;
+import org.fest.swing.fixture.JCheckBoxFixture;
+import org.fest.swing.fixture.JComboBoxFixture;
+import org.fest.swing.fixture.JListFixture;
+import org.fest.swing.fixture.JOptionPaneFixture;
+import org.fest.swing.fixture.JTabbedPaneFixture;
+import org.fest.swing.fixture.JTextComponentFixture;
+import org.junit.Test;
+
+
+public class CloneTest extends BeautiBase {
+
+ 	@Test
+ 	public void simpleSiteModelCloneTest() throws Exception {
+        warning("0. Load primate-mtDNA.nex");
+        importAlignment("examples/nexus", new File("primate-mtDNA.nex"));
+
+		JTabbedPaneFixture f = beautiFrame.tabbedPane();
+		// may need to use the following when not running on Hudson
+//        JOptionPaneFixture op = beautiFrame.optionPane();
+//        if (op.target.isVisible()) {
+//        	op.okButton().click();
+//        }
+
+        //1. Set the site model to HKY+G4 (estimated)
+        warning("1. Set the site model of first partition to HKY+G4 (estimated)");
+        f.selectTab("Site Model");
+        JComboBoxFixture substModel = beautiFrame.comboBox("substModel");
+        substModel.selectItem("HKY");
+
+        JTextComponentFixture categoryCount = beautiFrame.textBox("gammaCategoryCount");
+        categoryCount.setText("4");
+
+        JCheckBoxFixture shapeIsEstimated = beautiFrame.checkBox("shape.isEstimated");
+        shapeIsEstimated.check();
+        printBeautiState(f);
+        assertStateEquals("Tree.t:coding", "birthRate.t:coding", "Tree.t:noncoding", "clockRate.c:noncoding", "birthRate.t:noncoding", "Tree.t:3rdpos", "clockRate.c:3rdpos", "birthRate.t:3rdpos", "Tree.t:1stpos", "clockRate.c:1stpos", "birthRate.t:1stpos", "Tree.t:2ndpos", "clockRate.c:2ndpos", "birthRate.t:2ndpos", "kappa.s:coding", "gammaShape.s:coding", "freqParameter.s:coding");
+        assertOperatorsEqual("YuleBirthRateScaler.t:coding", "YuleModelTreeScaler.t:coding", "YuleModelTreeRootScaler.t:coding", "YuleModelUniformOperator.t:coding", "YuleModelSubtreeSlide.t:coding", "YuleModelNarrow.t:coding", "YuleModelWide.t:coding", "YuleModelWilsonBalding.t:coding", "StrictClockRateScaler.c:noncoding", "YuleBirthRateScaler.t:noncoding", "YuleModelTreeScaler.t:noncoding", "YuleModelTreeRootScaler.t:noncoding", "YuleModelUniformOperator.t:noncoding", "YuleModelSubtree [...]
+        assertPriorsEqual("YuleModel.t:coding", "YuleModel.t:noncoding", "YuleModel.t:1stpos", "YuleModel.t:2ndpos", "YuleModel.t:3rdpos", "YuleBirthRatePrior.t:coding", "ClockPrior.c:noncoding", "YuleBirthRatePrior.t:noncoding", "ClockPrior.c:3rdpos", "YuleBirthRatePrior.t:3rdpos", "ClockPrior.c:1stpos", "YuleBirthRatePrior.t:1stpos", "ClockPrior.c:2ndpos", "YuleBirthRatePrior.t:2ndpos", "KappaPrior.s:coding", "GammaShapePrior.s:coding");
+        assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.coding", "TreeHeight.t:coding", "YuleModel.t:coding", "birthRate.t:coding", "treeLikelihood.noncoding", "TreeHeight.t:noncoding", "clockRate.c:noncoding", "YuleModel.t:noncoding", "birthRate.t:noncoding", "treeLikelihood.3rdpos", "TreeHeight.t:3rdpos", "clockRate.c:3rdpos", "YuleModel.t:3rdpos", "birthRate.t:3rdpos", "treeLikelihood.1stpos", "TreeHeight.t:1stpos", "clockRate.c:1stpos", "YuleModel.t:1stpos", " [...]
+
+        //2. select all models, clone from first model
+        warning("2. select all models, clone from first model");
+        JListFixture partitionlist = beautiFrame.list("listOfPartitions");
+        partitionlist.selectItems(0, 1, 2, 3, 4);
+        
+        JButtonFixture cloneButton = beautiFrame.button("ok");
+        cloneButton.click();
+        printBeautiState(f);
+        assertStateEquals("Tree.t:1stpos", "clockRate.c:1stpos", "birthRate.t:1stpos", "Tree.t:coding", "birthRate.t:coding", "Tree.t:3rdpos", "clockRate.c:3rdpos", "birthRate.t:3rdpos", "Tree.t:2ndpos", "clockRate.c:2ndpos", "birthRate.t:2ndpos", "Tree.t:noncoding", "clockRate.c:noncoding", "birthRate.t:noncoding", "kappa.s:coding", "gammaShape.s:coding", "gammaShape.s:noncoding", "kappa.s:noncoding", "gammaShape.s:1stpos", "kappa.s:1stpos", "gammaShape.s:2ndpos", "kappa.s:2ndpos", "gam [...]
+        assertOperatorsEqual("StrictClockRateScaler.c:1stpos", "YuleBirthRateScaler.t:1stpos", "YuleModelTreeScaler.t:1stpos", "YuleModelTreeRootScaler.t:1stpos", "YuleModelUniformOperator.t:1stpos", "YuleModelSubtreeSlide.t:1stpos", "YuleModelNarrow.t:1stpos", "YuleModelWide.t:1stpos", "YuleModelWilsonBalding.t:1stpos", "strictClockUpDownOperator.c:1stpos", "YuleBirthRateScaler.t:coding", "YuleModelTreeScaler.t:coding", "YuleModelTreeRootScaler.t:coding", "YuleModelUniformOperator.t:cod [...]
+        assertPriorsEqual("YuleModel.t:coding", "YuleModel.t:noncoding", "YuleModel.t:1stpos", "YuleModel.t:2ndpos", "YuleModel.t:3rdpos", "ClockPrior.c:1stpos", "YuleBirthRatePrior.t:1stpos", "YuleBirthRatePrior.t:coding", "ClockPrior.c:3rdpos", "YuleBirthRatePrior.t:3rdpos", "ClockPrior.c:2ndpos", "YuleBirthRatePrior.t:2ndpos", "ClockPrior.c:noncoding", "YuleBirthRatePrior.t:noncoding", "KappaPrior.s:coding", "GammaShapePrior.s:coding", "GammaShapePrior.s:noncoding", "KappaPrior.s:nonc [...]
+        assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.1stpos", "TreeHeight.t:1stpos", "clockRate.c:1stpos", "YuleModel.t:1stpos", "birthRate.t:1stpos", "treeLikelihood.coding", "TreeHeight.t:coding", "YuleModel.t:coding", "birthRate.t:coding", "treeLikelihood.3rdpos", "TreeHeight.t:3rdpos", "clockRate.c:3rdpos", "YuleModel.t:3rdpos", "birthRate.t:3rdpos", "treeLikelihood.2ndpos", "TreeHeight.t:2ndpos", "clockRate.c:2ndpos", "YuleModel.t:2ndpos", "birthRate.t:2nd [...]
+
+        //3. set second model back to JC
+        warning("3. select all models, clone from first model");
+        partitionlist.selectItems(1);
+        beautiFrame.comboBox("substModel").selectItem("JC69");
+        beautiFrame.textBox("gammaCategoryCount").setText("6");
+        printBeautiState(f);
+        assertStateEquals("Tree.t:3rdpos", "clockRate.c:3rdpos", "birthRate.t:3rdpos", "Tree.t:2ndpos", "clockRate.c:2ndpos", "birthRate.t:2ndpos", "Tree.t:noncoding", "clockRate.c:noncoding", "birthRate.t:noncoding", "Tree.t:coding", "birthRate.t:coding", "Tree.t:1stpos", "clockRate.c:1stpos", "birthRate.t:1stpos", "kappa.s:coding", "gammaShape.s:coding", "gammaShape.s:noncoding", "kappa.s:1stpos", "gammaShape.s:1stpos", "kappa.s:2ndpos", "gammaShape.s:2ndpos", "kappa.s:3rdpos", "gammaS [...]
+        assertOperatorsEqual("StrictClockRateScaler.c:3rdpos", "YuleBirthRateScaler.t:3rdpos", "YuleModelTreeScaler.t:3rdpos", "YuleModelTreeRootScaler.t:3rdpos", "YuleModelUniformOperator.t:3rdpos", "YuleModelSubtreeSlide.t:3rdpos", "YuleModelNarrow.t:3rdpos", "YuleModelWide.t:3rdpos", "YuleModelWilsonBalding.t:3rdpos", "strictClockUpDownOperator.c:3rdpos", "StrictClockRateScaler.c:2ndpos", "YuleBirthRateScaler.t:2ndpos", "YuleModelTreeScaler.t:2ndpos", "YuleModelTreeRootScaler.t:2ndpos [...]
+        assertPriorsEqual("YuleModel.t:coding", "YuleModel.t:noncoding", "YuleModel.t:1stpos", "YuleModel.t:2ndpos", "YuleModel.t:3rdpos", "ClockPrior.c:3rdpos", "YuleBirthRatePrior.t:3rdpos", "ClockPrior.c:2ndpos", "YuleBirthRatePrior.t:2ndpos", "ClockPrior.c:noncoding", "YuleBirthRatePrior.t:noncoding", "YuleBirthRatePrior.t:coding", "ClockPrior.c:1stpos", "YuleBirthRatePrior.t:1stpos", "KappaPrior.s:coding", "GammaShapePrior.s:coding", "GammaShapePrior.s:noncoding", "GammaShapePrior.s [...]
+        assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.3rdpos", "TreeHeight.t:3rdpos", "clockRate.c:3rdpos", "YuleModel.t:3rdpos", "birthRate.t:3rdpos", "treeLikelihood.2ndpos", "TreeHeight.t:2ndpos", "clockRate.c:2ndpos", "YuleModel.t:2ndpos", "birthRate.t:2ndpos", "treeLikelihood.noncoding", "TreeHeight.t:noncoding", "clockRate.c:noncoding", "YuleModel.t:noncoding", "birthRate.t:noncoding", "treeLikelihood.coding", "TreeHeight.t:coding", "YuleModel.t:coding", " [...]
+
+        // set category count back to 1
+        beautiFrame.checkBox("shape.isEstimated").uncheck();
+        beautiFrame.textBox("gammaCategoryCount").setText("1");
+        printBeautiState(f);
+        assertStateEquals("Tree.t:3rdpos", "clockRate.c:3rdpos", "birthRate.t:3rdpos", "Tree.t:2ndpos", "clockRate.c:2ndpos", "birthRate.t:2ndpos", "Tree.t:noncoding", "clockRate.c:noncoding", "birthRate.t:noncoding", "Tree.t:coding", "birthRate.t:coding", "Tree.t:1stpos", "clockRate.c:1stpos", "birthRate.t:1stpos", "kappa.s:coding", "gammaShape.s:coding", "kappa.s:1stpos", "gammaShape.s:1stpos", "kappa.s:2ndpos", "gammaShape.s:2ndpos", "kappa.s:3rdpos", "gammaShape.s:3rdpos", "freqParam [...]
+        assertOperatorsEqual("StrictClockRateScaler.c:3rdpos", "YuleBirthRateScaler.t:3rdpos", "YuleModelTreeScaler.t:3rdpos", "YuleModelTreeRootScaler.t:3rdpos", "YuleModelUniformOperator.t:3rdpos", "YuleModelSubtreeSlide.t:3rdpos", "YuleModelNarrow.t:3rdpos", "YuleModelWide.t:3rdpos", "YuleModelWilsonBalding.t:3rdpos", "strictClockUpDownOperator.c:3rdpos", "StrictClockRateScaler.c:2ndpos", "YuleBirthRateScaler.t:2ndpos", "YuleModelTreeScaler.t:2ndpos", "YuleModelTreeRootScaler.t:2ndpos [...]
+        assertPriorsEqual("YuleModel.t:coding", "YuleModel.t:noncoding", "YuleModel.t:1stpos", "YuleModel.t:2ndpos", "YuleModel.t:3rdpos", "ClockPrior.c:3rdpos", "YuleBirthRatePrior.t:3rdpos", "ClockPrior.c:2ndpos", "YuleBirthRatePrior.t:2ndpos", "ClockPrior.c:noncoding", "YuleBirthRatePrior.t:noncoding", "YuleBirthRatePrior.t:coding", "ClockPrior.c:1stpos", "YuleBirthRatePrior.t:1stpos", "KappaPrior.s:coding", "GammaShapePrior.s:coding", "GammaShapePrior.s:1stpos", "KappaPrior.s:1stpos" [...]
+        assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.3rdpos", "TreeHeight.t:3rdpos", "clockRate.c:3rdpos", "YuleModel.t:3rdpos", "birthRate.t:3rdpos", "treeLikelihood.2ndpos", "TreeHeight.t:2ndpos", "clockRate.c:2ndpos", "YuleModel.t:2ndpos", "birthRate.t:2ndpos", "treeLikelihood.noncoding", "TreeHeight.t:noncoding", "clockRate.c:noncoding", "YuleModel.t:noncoding", "birthRate.t:noncoding", "treeLikelihood.coding", "TreeHeight.t:coding", "YuleModel.t:coding", " [...]
+
+
+        // 4. clone second model to first model
+        warning("4. clone second model to first model");
+        beautiFrame.list("listOfPartitions").selectItems(0, 1);
+        beautiFrame.comboBox().selectItem(1);
+        beautiFrame.button("ok").click();
+        
+        printBeautiState(f);
+        assertStateEquals("Tree.t:3rdpos", "clockRate.c:3rdpos", "birthRate.t:3rdpos", "Tree.t:2ndpos", "clockRate.c:2ndpos", "birthRate.t:2ndpos", "Tree.t:noncoding", "clockRate.c:noncoding", "birthRate.t:noncoding", "Tree.t:coding", "birthRate.t:coding", "Tree.t:1stpos", "clockRate.c:1stpos", "birthRate.t:1stpos", "kappa.s:1stpos", "gammaShape.s:1stpos", "kappa.s:2ndpos", "gammaShape.s:2ndpos", "kappa.s:3rdpos", "gammaShape.s:3rdpos", "freqParameter.s:2ndpos", "freqParameter.s:3rdpos", [...]
+        assertOperatorsEqual("StrictClockRateScaler.c:3rdpos", "YuleBirthRateScaler.t:3rdpos", "YuleModelTreeScaler.t:3rdpos", "YuleModelTreeRootScaler.t:3rdpos", "YuleModelUniformOperator.t:3rdpos", "YuleModelSubtreeSlide.t:3rdpos", "YuleModelNarrow.t:3rdpos", "YuleModelWide.t:3rdpos", "YuleModelWilsonBalding.t:3rdpos", "strictClockUpDownOperator.c:3rdpos", "StrictClockRateScaler.c:2ndpos", "YuleBirthRateScaler.t:2ndpos", "YuleModelTreeScaler.t:2ndpos", "YuleModelTreeRootScaler.t:2ndpos [...]
+        assertPriorsEqual("YuleModel.t:coding", "YuleModel.t:noncoding", "YuleModel.t:1stpos", "YuleModel.t:2ndpos", "YuleModel.t:3rdpos", "ClockPrior.c:3rdpos", "YuleBirthRatePrior.t:3rdpos", "ClockPrior.c:2ndpos", "YuleBirthRatePrior.t:2ndpos", "ClockPrior.c:noncoding", "YuleBirthRatePrior.t:noncoding", "YuleBirthRatePrior.t:coding", "ClockPrior.c:1stpos", "YuleBirthRatePrior.t:1stpos", "GammaShapePrior.s:1stpos", "KappaPrior.s:1stpos", "GammaShapePrior.s:2ndpos", "KappaPrior.s:2ndpos" [...]
+        assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.3rdpos", "TreeHeight.t:3rdpos", "clockRate.c:3rdpos", "YuleModel.t:3rdpos", "birthRate.t:3rdpos", "treeLikelihood.2ndpos", "TreeHeight.t:2ndpos", "clockRate.c:2ndpos", "YuleModel.t:2ndpos", "birthRate.t:2ndpos", "treeLikelihood.noncoding", "TreeHeight.t:noncoding", "clockRate.c:noncoding", "YuleModel.t:noncoding", "birthRate.t:noncoding", "treeLikelihood.coding", "TreeHeight.t:coding", "YuleModel.t:coding", " [...]
+
+        makeSureXMLParses();       
+	}
+
+
+	@Test
+	public void simpleClockModelCloneTest() throws Exception {
+        warning("0. Load primate-mtDNA.nex");
+        importAlignment("examples/nexus", new File("primate-mtDNA.nex"));
+
+		JTabbedPaneFixture f = beautiFrame.tabbedPane();
+		// may need to use the following when not running on Hudson
+//        JOptionPaneFixture op = beautiFrame.optionPane();
+//	    if (op.target.isVisible()) {
+//	    	op.okButton().click();
+//	    }
+
+        //1. Set the clock model of second partition to UCLD exponential
+        warning("1. Set the clock model of second partition to UCLD exponential");
+        f.selectTab("Clock Model");
+        beautiFrame.list("listOfPartitions").selectItems(1);
+        beautiFrame.comboBox().selectItem("Relaxed Clock Exponential");
+        printBeautiState(f);
+        assertStateEquals("Tree.t:3rdpos", "clockRate.c:3rdpos", "birthRate.t:3rdpos", "Tree.t:noncoding", "birthRate.t:noncoding", "Tree.t:2ndpos", "clockRate.c:2ndpos", "birthRate.t:2ndpos", "Tree.t:coding", "birthRate.t:coding", "Tree.t:1stpos", "clockRate.c:1stpos", "birthRate.t:1stpos", "ucedMean.c:noncoding", "expRateCategories.c:noncoding");
+        assertOperatorsEqual("StrictClockRateScaler.c:3rdpos", "YuleBirthRateScaler.t:3rdpos", "YuleModelTreeScaler.t:3rdpos", "YuleModelTreeRootScaler.t:3rdpos", "YuleModelUniformOperator.t:3rdpos", "YuleModelSubtreeSlide.t:3rdpos", "YuleModelNarrow.t:3rdpos", "YuleModelWide.t:3rdpos", "YuleModelWilsonBalding.t:3rdpos", "strictClockUpDownOperator.c:3rdpos", "YuleBirthRateScaler.t:noncoding", "YuleModelTreeScaler.t:noncoding", "YuleModelTreeRootScaler.t:noncoding", "YuleModelUniformOpera [...]
+        assertPriorsEqual("YuleModel.t:coding", "YuleModel.t:noncoding", "YuleModel.t:1stpos", "YuleModel.t:2ndpos", "YuleModel.t:3rdpos", "ClockPrior.c:3rdpos", "YuleBirthRatePrior.t:3rdpos", "YuleBirthRatePrior.t:noncoding", "ClockPrior.c:2ndpos", "YuleBirthRatePrior.t:2ndpos", "YuleBirthRatePrior.t:coding", "ClockPrior.c:1stpos", "YuleBirthRatePrior.t:1stpos", "UCMeanRatePrior.c:noncoding");
+        assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.3rdpos", "TreeHeight.t:3rdpos", "clockRate.c:3rdpos", "YuleModel.t:3rdpos", "birthRate.t:3rdpos", "treeLikelihood.noncoding", "TreeHeight.t:noncoding", "YuleModel.t:noncoding", "birthRate.t:noncoding", "treeLikelihood.2ndpos", "TreeHeight.t:2ndpos", "clockRate.c:2ndpos", "YuleModel.t:2ndpos", "birthRate.t:2ndpos", "treeLikelihood.coding", "TreeHeight.t:coding", "YuleModel.t:coding", "birthRate.t:coding", "tre [...]
+
+
+        //2. Clone to first and last partition 
+        beautiFrame.list("listOfPartitions").selectItems(0,1,4);
+        beautiFrame.comboBox().selectItem(1);
+        beautiFrame.button("ok").click();
+        printBeautiState(f);
+        assertStateEquals("birthRate.t:3rdpos", "Tree.t:2ndpos", "clockRate.c:2ndpos", "birthRate.t:2ndpos", "birthRate.t:coding", "Tree.t:1stpos", "clockRate.c:1stpos", "birthRate.t:1stpos", "Tree.t:noncoding", "birthRate.t:noncoding", "ucedMean.c:noncoding", "expRateCategories.c:noncoding", "Tree.t:coding", "expRateCategories.c:coding", "ucedMean.c:3rdpos", "Tree.t:3rdpos", "expRateCategories.c:3rdpos");
+        assertOperatorsEqual("YuleBirthRateScaler.t:3rdpos", "StrictClockRateScaler.c:2ndpos", "YuleBirthRateScaler.t:2ndpos", "YuleModelTreeScaler.t:2ndpos", "YuleModelTreeRootScaler.t:2ndpos", "YuleModelUniformOperator.t:2ndpos", "YuleModelSubtreeSlide.t:2ndpos", "YuleModelNarrow.t:2ndpos", "YuleModelWide.t:2ndpos", "YuleModelWilsonBalding.t:2ndpos", "strictClockUpDownOperator.c:2ndpos", "YuleBirthRateScaler.t:coding", "StrictClockRateScaler.c:1stpos", "YuleBirthRateScaler.t:1stpos", " [...]
+        assertPriorsEqual("YuleModel.t:noncoding", "YuleModel.t:1stpos", "YuleModel.t:2ndpos", "YuleBirthRatePrior.t:3rdpos", "ClockPrior.c:2ndpos", "YuleBirthRatePrior.t:2ndpos", "YuleBirthRatePrior.t:coding", "ClockPrior.c:1stpos", "YuleBirthRatePrior.t:1stpos", "YuleBirthRatePrior.t:noncoding", "UCMeanRatePrior.c:noncoding", "YuleModel.t:coding", "YuleModel.t:3rdpos", "UCMeanRatePrior.c:3rdpos");
+        assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.3rdpos", "birthRate.t:3rdpos", "treeLikelihood.2ndpos", "TreeHeight.t:2ndpos", "clockRate.c:2ndpos", "YuleModel.t:2ndpos", "birthRate.t:2ndpos", "treeLikelihood.coding", "birthRate.t:coding", "treeLikelihood.1stpos", "TreeHeight.t:1stpos", "clockRate.c:1stpos", "YuleModel.t:1stpos", "birthRate.t:1stpos", "treeLikelihood.noncoding", "TreeHeight.t:noncoding", "YuleModel.t:noncoding", "birthRate.t:noncoding", "u [...]
+
+        
+        //3. Set the clock model of third partition to UCLD lognormal
+        warning("3. Set the clock model of third partition to UCLD lognormal");
+        beautiFrame.list("listOfPartitions").selectItems(2);
+        beautiFrame.comboBox().selectItem("Relaxed Clock Log Normal");
+        printBeautiState(f);
+        assertStateEquals("Tree.t:2ndpos", "clockRate.c:2ndpos", "birthRate.t:2ndpos", "birthRate.t:coding", "Tree.t:1stpos", "birthRate.t:1stpos", "Tree.t:noncoding", "birthRate.t:noncoding", "birthRate.t:3rdpos", "ucedMean.c:noncoding", "expRateCategories.c:noncoding", "expRateCategories.c:coding", "Tree.t:coding", "expRateCategories.c:3rdpos", "Tree.t:3rdpos", "ucedMean.c:3rdpos", "ucldMean.c:1stpos", "ucldStdev.c:1stpos", "rateCategories.c:1stpos");
+        assertOperatorsEqual("StrictClockRateScaler.c:2ndpos", "YuleBirthRateScaler.t:2ndpos", "YuleModelTreeScaler.t:2ndpos", "YuleModelTreeRootScaler.t:2ndpos", "YuleModelUniformOperator.t:2ndpos", "YuleModelSubtreeSlide.t:2ndpos", "YuleModelNarrow.t:2ndpos", "YuleModelWide.t:2ndpos", "YuleModelWilsonBalding.t:2ndpos", "strictClockUpDownOperator.c:2ndpos", "YuleBirthRateScaler.t:coding", "YuleBirthRateScaler.t:1stpos", "YuleModelTreeScaler.t:1stpos", "YuleModelTreeRootScaler.t:1stpos", [...]
+        assertPriorsEqual("YuleModel.t:noncoding", "YuleModel.t:1stpos", "YuleModel.t:2ndpos", "ClockPrior.c:2ndpos", "YuleBirthRatePrior.t:2ndpos", "YuleBirthRatePrior.t:coding", "YuleBirthRatePrior.t:1stpos", "YuleBirthRatePrior.t:noncoding", "YuleBirthRatePrior.t:3rdpos", "UCMeanRatePrior.c:noncoding", "YuleModel.t:coding", "UCMeanRatePrior.c:3rdpos", "YuleModel.t:3rdpos", "ucldStdevPrior.c:1stpos", "MeanRatePrior.c:1stpos");
+        assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.2ndpos", "TreeHeight.t:2ndpos", "clockRate.c:2ndpos", "YuleModel.t:2ndpos", "birthRate.t:2ndpos", "treeLikelihood.coding", "birthRate.t:coding", "treeLikelihood.1stpos", "TreeHeight.t:1stpos", "YuleModel.t:1stpos", "birthRate.t:1stpos", "treeLikelihood.noncoding", "TreeHeight.t:noncoding", "YuleModel.t:noncoding", "birthRate.t:noncoding", "treeLikelihood.3rdpos", "birthRate.t:3rdpos", "ucedMean.c:noncoding",  [...]
+
+        //4. Clone the third to fourth partition 
+        warning("4. Clone the third to fourth partition");
+        beautiFrame.list("listOfPartitions").selectItems(2,3);
+        beautiFrame.comboBox().selectItem(2);
+        beautiFrame.button("ok").click();
+        printBeautiState(f);
+        
+        
+        makeSureXMLParses();
+        
+        System.err.println("done");
+	}
+
+}
diff --git a/src/test/beast/app/beauti/FixedMeanRateTest.java b/src/test/beast/app/beauti/FixedMeanRateTest.java
new file mode 100644
index 0000000..3cef921
--- /dev/null
+++ b/src/test/beast/app/beauti/FixedMeanRateTest.java
@@ -0,0 +1,98 @@
+package test.beast.app.beauti;
+
+
+import java.io.File;
+import java.util.List;
+
+import org.fest.assertions.AssertExtension;
+import org.fest.swing.data.TableCell;
+import org.fest.swing.fixture.JTabbedPaneFixture;
+import org.junit.Test;
+
+import junit.framework.TestCase;
+import beast.app.beauti.SiteModelInputEditor;
+import beast.evolution.operators.DeltaExchangeOperator;
+
+/** test how the FixedMeanRate flag interact with link/unlink **/
+public class FixedMeanRateTest extends BeautiBase {
+	
+	@Test
+	public void testFixedMeanRate() throws Exception {
+
+		importAlignment("examples/nexus", new File("26.nex"), new File("29.nex"));
+		
+		beautiFrame.menuItemWithPath("Mode", "Automatic set fix mean substitution rate flag").click();
+
+		
+		warning("Setting fixed mean rates");
+		JTabbedPaneFixture f = beautiFrame.tabbedPane();
+		f = f.selectTab("Site Model");		
+		beautiFrame.checkBox("mutationRate.isEstimated").check();
+		beautiFrame.checkBox("FixMeanMutationRate").check();
+
+		warning("link/unlink site models");
+		f.selectTab("Partitions");
+		beautiFrame.table().selectCells(TableCell.row(0).column(0), TableCell.row(1).column(0));
+		beautiFrame.button("Link Site Models").click();
+		beautiFrame.button("Unlink Site Models").click();
+
+		//saveFile("/Users/remcobouckaert/tmp", "x.xml");
+		makeSureXMLParses();
+		
+
+		
+		DeltaExchangeOperator operator = (DeltaExchangeOperator) beauti.doc.pluginmap.get("FixMeanMutationRatesOperator");
+		int nrOfParameters = operator.parameterInput.get().size();
+		if(nrOfParameters != 2) {
+			throw new Exception("Expected 2 parameters for deltaExchangeOperator, not " + nrOfParameters);
+		}
+	}
+	
+	@Test
+	public void testFixedMeanRateSharedSiteModel() throws Exception {
+
+		importAlignment("examples/nexus", new File("26.nex"), new File("29.nex"), new File("47.nex"));
+		
+		warning("Setting fixed mean rates");
+		JTabbedPaneFixture f = beautiFrame.tabbedPane();
+		f = f.selectTab("Site Model");		
+		beautiFrame.checkBox("mutationRate.isEstimated").check();
+		//beautiFrame.checkBox("FixMeanMutationRate").check();
+
+		warning("link/unlink site models");
+		f.selectTab("Partitions");
+		beautiFrame.table().selectCells(TableCell.row(0).column(1), TableCell.row(1).column(1), TableCell.row(2).column(1));
+		beautiFrame.button("Link Site Models").click();
+		beautiFrame.button("Unlink Site Models").click();
+		
+		DeltaExchangeOperator operator = (DeltaExchangeOperator) beauti.doc.pluginmap.get("FixMeanMutationRatesOperator");
+		int nrOfParameters = operator.parameterInput.get().size();
+		if (nrOfParameters != 3) {
+			throw new Exception("Expected 3 parameters for deltaExchangeOperator, not " + nrOfParameters);
+		}
+
+		List<Integer> weights = operator.parameterWeightsInput.get().valuesInput.get();
+		TestCase.assertEquals(weights.size(), 3);
+		TestCase.assertEquals(weights.get(0), (Integer)614);
+		TestCase.assertEquals(weights.get(1), (Integer)601);
+		TestCase.assertEquals(weights.get(2), (Integer)819);
+
+		beautiFrame.table().selectCells(TableCell.row(0).column(1), TableCell.row(2).column(1));
+		beautiFrame.button("Link Site Models").click();
+		operator = (DeltaExchangeOperator) beauti.doc.pluginmap.get("FixMeanMutationRatesOperator");
+		nrOfParameters = operator.parameterInput.get().size();
+		
+		//SiteModelInputEditor.customConnector(doc);
+		
+		if (nrOfParameters != 2) {
+			throw new Exception("Expected 2 parameters for deltaExchangeOperator, not " + nrOfParameters);
+		}
+		weights = operator.parameterWeightsInput.get().valuesInput.get();
+		TestCase.assertEquals(weights.size(), 2);
+		TestCase.assertEquals(weights.get(0), (Integer)(614 + 819));
+		TestCase.assertEquals(weights.get(1), (Integer)601);
+
+		makeSureXMLParses();
+	}
+
+}
diff --git a/src/test/beast/app/beauti/LinkUnlinkTest.java b/src/test/beast/app/beauti/LinkUnlinkTest.java
new file mode 100644
index 0000000..b7c8355
--- /dev/null
+++ b/src/test/beast/app/beauti/LinkUnlinkTest.java
@@ -0,0 +1,546 @@
+package test.beast.app.beauti;
+
+
+
+
+import java.io.File;
+
+import org.fest.swing.data.TableCell;
+import org.fest.swing.fixture.JTabbedPaneFixture;
+import org.fest.swing.fixture.JTableFixture;
+import org.junit.Test;
+import org.fest.assertions.Assertions;
+
+public class LinkUnlinkTest extends BeautiBase {
+
+	/** robustly select rows -- don't give up after first attempt **/
+	private void selectRows(int ... rows) {
+		JTableFixture t = beautiFrame.table();
+		for (int attempt = 0; attempt < 5; attempt++) {
+			t.selectRows(rows);
+			if (t.target.getSelectedRowCount() == rows.length) {
+				return;
+			}
+			try {
+				Thread.sleep(500);
+			} catch (Exception e) {
+				
+			}
+		}
+	}
+
+	
+	@Test
+	public void simpleLinkUnlinkTwoAlignmentTest() throws Exception {
+		warning("Load gopher data 26.nex, 47.nex");
+		importAlignment("examples/nexus", new File("26.nex"), new File("47.nex"));
+		
+		JTabbedPaneFixture f = beautiFrame.tabbedPane();
+		printBeautiState(f);
+
+		selectRows(0, 1);
+		
+		warning("Link site models");
+		f.selectTab("Partitions");
+		beautiFrame.button("Link Site Models").click();
+		printBeautiState(f);
+
+		warning("Unlink site models");
+		f.selectTab("Partitions");
+		beautiFrame.button("Unlink Site Models").click();
+		printBeautiState(f);
+		assertStateEquals("Tree.t:26", "birthRate.t:26", "Tree.t:47", "clockRate.c:47", "birthRate.t:47");
+		assertOperatorsEqual("YuleBirthRateScaler.t:26", "YuleModelTreeScaler.t:26", "YuleModelTreeRootScaler.t:26", "YuleModelUniformOperator.t:26", "YuleModelSubtreeSlide.t:26", "YuleModelNarrow.t:26", "YuleModelWide.t:26", "YuleModelWilsonBalding.t:26", "StrictClockRateScaler.c:47", "YuleBirthRateScaler.t:47", "YuleModelTreeScaler.t:47", "YuleModelTreeRootScaler.t:47", "YuleModelUniformOperator.t:47", "YuleModelSubtreeSlide.t:47", "YuleModelNarrow.t:47", "YuleModelWide.t:47", "YuleModelWils [...]
+		assertPriorsEqual("YuleModel.t:26", "YuleBirthRatePrior.t:26", "YuleModel.t:47", "ClockPrior.c:47", "YuleBirthRatePrior.t:47");
+		assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.26", "TreeHeight.t:26", "YuleModel.t:26", "birthRate.t:26", "treeLikelihood.47", "TreeHeight.t:47", "clockRate.c:47", "YuleModel.t:47", "birthRate.t:47");
+		
+		warning("Link clock models");
+		f.selectTab("Partitions");
+		beautiFrame.button("Link Clock Models").click();
+		printBeautiState(f);
+
+		warning("Unlink clock models");
+		f.selectTab("Partitions");
+		beautiFrame.button("Unlink Clock Models").click();
+		printBeautiState(f);
+		assertStateEquals("Tree.t:26", "birthRate.t:26", "Tree.t:47", "clockRate.c:47", "birthRate.t:47");
+		assertOperatorsEqual("YuleBirthRateScaler.t:26", "YuleModelTreeScaler.t:26", "YuleModelTreeRootScaler.t:26", "YuleModelUniformOperator.t:26", "YuleModelSubtreeSlide.t:26", "YuleModelNarrow.t:26", "YuleModelWide.t:26", "YuleModelWilsonBalding.t:26", "StrictClockRateScaler.c:47", "YuleBirthRateScaler.t:47", "YuleModelTreeScaler.t:47", "YuleModelTreeRootScaler.t:47", "YuleModelUniformOperator.t:47", "YuleModelSubtreeSlide.t:47", "YuleModelNarrow.t:47", "YuleModelWide.t:47", "YuleModelWils [...]
+		assertPriorsEqual("YuleModel.t:26", "YuleBirthRatePrior.t:26", "YuleModel.t:47", "ClockPrior.c:47", "YuleBirthRatePrior.t:47");
+		assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.26", "TreeHeight.t:26", "YuleModel.t:26", "birthRate.t:26", "treeLikelihood.47", "TreeHeight.t:47", "clockRate.c:47", "YuleModel.t:47", "birthRate.t:47");
+
+		warning("Link trees");
+		f.selectTab("Partitions");
+		beautiFrame.button("Link Trees").click();
+		printBeautiState(f);
+
+		warning("Unlink trees");
+		f.selectTab("Partitions");
+		beautiFrame.button("Unlink Trees").click();
+		printBeautiState(f);
+		assertStateEquals("Tree.t:26", "birthRate.t:26", "Tree.t:47", "clockRate.c:47", "birthRate.t:47");
+		assertOperatorsEqual("YuleBirthRateScaler.t:26", "YuleModelTreeScaler.t:26", "YuleModelTreeRootScaler.t:26", "YuleModelUniformOperator.t:26", "YuleModelSubtreeSlide.t:26", "YuleModelNarrow.t:26", "YuleModelWide.t:26", "YuleModelWilsonBalding.t:26", "StrictClockRateScaler.c:47", "YuleBirthRateScaler.t:47", "YuleModelTreeScaler.t:47", "YuleModelTreeRootScaler.t:47", "YuleModelUniformOperator.t:47", "YuleModelSubtreeSlide.t:47", "YuleModelNarrow.t:47", "YuleModelWide.t:47", "YuleModelWils [...]
+		assertPriorsEqual("YuleModel.t:26", "YuleBirthRatePrior.t:26", "YuleModel.t:47", "ClockPrior.c:47", "YuleBirthRatePrior.t:47");
+		assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.26", "TreeHeight.t:26", "YuleModel.t:26", "birthRate.t:26", "treeLikelihood.47", "TreeHeight.t:47", "clockRate.c:47", "YuleModel.t:47", "birthRate.t:47");
+
+		makeSureXMLParses();
+	}
+
+	@Test
+	public void simpleLinkUnlinkThreeAlignmentsTest() throws Exception {
+		warning("Load gopher data 26.nex, 47.nex, 59.nex");
+		importAlignment("examples/nexus", new File("26.nex"), new File("47.nex"), new File("59.nex"));
+
+		JTabbedPaneFixture f = beautiFrame.tabbedPane();
+		printBeautiState(f);
+		assertStateEquals("Tree.t:26", "birthRate.t:26", "Tree.t:47", "clockRate.c:47", "birthRate.t:47", "Tree.t:59", "clockRate.c:59", "birthRate.t:59");
+		assertOperatorsEqual("YuleBirthRateScaler.t:26", "YuleModelTreeScaler.t:26", "YuleModelTreeRootScaler.t:26", "YuleModelUniformOperator.t:26", "YuleModelSubtreeSlide.t:26", "YuleModelNarrow.t:26", "YuleModelWide.t:26", "YuleModelWilsonBalding.t:26", "StrictClockRateScaler.c:47", "YuleBirthRateScaler.t:47", "YuleModelTreeScaler.t:47", "YuleModelTreeRootScaler.t:47", "YuleModelUniformOperator.t:47", "YuleModelSubtreeSlide.t:47", "YuleModelNarrow.t:47", "YuleModelWide.t:47", "YuleModelWils [...]
+		assertPriorsEqual("YuleModel.t:26", "YuleBirthRatePrior.t:26", "YuleModel.t:47", "ClockPrior.c:47", "YuleBirthRatePrior.t:47", "YuleModel.t:59", "ClockPrior.c:59", "YuleBirthRatePrior.t:59");
+		assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.26", "TreeHeight.t:26", "YuleModel.t:26", "birthRate.t:26", "treeLikelihood.47", "TreeHeight.t:47", "clockRate.c:47", "YuleModel.t:47", "birthRate.t:47", "treeLikelihood.59", "TreeHeight.t:59", "clockRate.c:59", "YuleModel.t:59", "birthRate.t:59");
+
+		selectRows(0, 1, 2);
+
+		warning("Link site models");
+		f.selectTab("Partitions");
+		beautiFrame.button("Link Site Models").click();
+		printBeautiState(f);
+
+		warning("Unlink site models");
+		f.selectTab("Partitions");
+		beautiFrame.button("Unlink Site Models").click();
+		printBeautiState(f);
+		assertStateEquals("Tree.t:26", "birthRate.t:26", "Tree.t:47", "clockRate.c:47", "birthRate.t:47", "Tree.t:59", "clockRate.c:59", "birthRate.t:59");
+		assertOperatorsEqual("YuleBirthRateScaler.t:26", "YuleModelTreeScaler.t:26", "YuleModelTreeRootScaler.t:26", "YuleModelUniformOperator.t:26", "YuleModelSubtreeSlide.t:26", "YuleModelNarrow.t:26", "YuleModelWide.t:26", "YuleModelWilsonBalding.t:26", "StrictClockRateScaler.c:47", "YuleBirthRateScaler.t:47", "YuleModelTreeScaler.t:47", "YuleModelTreeRootScaler.t:47", "YuleModelUniformOperator.t:47", "YuleModelSubtreeSlide.t:47", "YuleModelNarrow.t:47", "YuleModelWide.t:47", "YuleModelWils [...]
+		assertPriorsEqual("YuleModel.t:26", "YuleBirthRatePrior.t:26", "YuleModel.t:47", "ClockPrior.c:47", "YuleBirthRatePrior.t:47", "YuleModel.t:59", "ClockPrior.c:59", "YuleBirthRatePrior.t:59");
+		assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.26", "TreeHeight.t:26", "YuleModel.t:26", "birthRate.t:26", "treeLikelihood.47", "TreeHeight.t:47", "clockRate.c:47", "YuleModel.t:47", "birthRate.t:47", "treeLikelihood.59", "TreeHeight.t:59", "clockRate.c:59", "YuleModel.t:59", "birthRate.t:59");
+		
+		warning("Link clock models");
+		f.selectTab("Partitions");
+		beautiFrame.button("Link Clock Models").click();
+		printBeautiState(f);
+
+		warning("Unlink clock models");
+		f.selectTab("Partitions");
+		beautiFrame.button("Unlink Clock Models").click();
+		printBeautiState(f);
+		assertStateEquals("Tree.t:26", "birthRate.t:26", "Tree.t:47", "clockRate.c:47", "birthRate.t:47", "Tree.t:59", "clockRate.c:59", "birthRate.t:59");
+		assertOperatorsEqual("YuleBirthRateScaler.t:26", "YuleModelTreeScaler.t:26", "YuleModelTreeRootScaler.t:26", "YuleModelUniformOperator.t:26", "YuleModelSubtreeSlide.t:26", "YuleModelNarrow.t:26", "YuleModelWide.t:26", "YuleModelWilsonBalding.t:26", "StrictClockRateScaler.c:47", "YuleBirthRateScaler.t:47", "YuleModelTreeScaler.t:47", "YuleModelTreeRootScaler.t:47", "YuleModelUniformOperator.t:47", "YuleModelSubtreeSlide.t:47", "YuleModelNarrow.t:47", "YuleModelWide.t:47", "YuleModelWils [...]
+		assertPriorsEqual("YuleModel.t:26", "YuleBirthRatePrior.t:26", "YuleModel.t:47", "ClockPrior.c:47", "YuleBirthRatePrior.t:47", "YuleModel.t:59", "ClockPrior.c:59", "YuleBirthRatePrior.t:59");
+		assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.26", "TreeHeight.t:26", "YuleModel.t:26", "birthRate.t:26", "treeLikelihood.47", "TreeHeight.t:47", "clockRate.c:47", "YuleModel.t:47", "birthRate.t:47", "treeLikelihood.59", "TreeHeight.t:59", "clockRate.c:59", "YuleModel.t:59", "birthRate.t:59");
+
+		warning("Link trees");
+		f.selectTab("Partitions");
+		beautiFrame.button("Link Trees").click();
+		printBeautiState(f);
+
+		warning("Unlink trees");
+		f.selectTab("Partitions");
+		beautiFrame.button("Unlink Trees").click();
+		printBeautiState(f);
+		assertStateEquals("Tree.t:26", "birthRate.t:26", "Tree.t:47", "clockRate.c:47", "birthRate.t:47", "Tree.t:59", "clockRate.c:59", "birthRate.t:59");
+		assertPriorsEqual("YuleModel.t:26", "YuleBirthRatePrior.t:26", "YuleModel.t:47", "ClockPrior.c:47", "YuleBirthRatePrior.t:47", "YuleModel.t:59", "ClockPrior.c:59", "YuleBirthRatePrior.t:59");
+		assertOperatorsEqual("YuleBirthRateScaler.t:26", "YuleModelTreeScaler.t:26", "YuleModelTreeRootScaler.t:26", "YuleModelUniformOperator.t:26", "YuleModelSubtreeSlide.t:26", "YuleModelNarrow.t:26", "YuleModelWide.t:26", "YuleModelWilsonBalding.t:26", "StrictClockRateScaler.c:47", "YuleBirthRateScaler.t:47", "YuleModelTreeScaler.t:47", "YuleModelTreeRootScaler.t:47", "YuleModelUniformOperator.t:47", "YuleModelSubtreeSlide.t:47", "YuleModelNarrow.t:47", "YuleModelWide.t:47", "YuleModelWils [...]
+		assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.26", "TreeHeight.t:26", "YuleModel.t:26", "birthRate.t:26", "treeLikelihood.47", "TreeHeight.t:47", "clockRate.c:47", "YuleModel.t:47", "birthRate.t:47", "treeLikelihood.59", "TreeHeight.t:59", "clockRate.c:59", "YuleModel.t:59", "birthRate.t:59");
+
+		makeSureXMLParses();
+	}
+
+	
+	@Test
+	public void linkTreesAndDeleteTest2a() throws Exception {
+		warning("Load gopher data 26.nex, 47.nex");
+		importAlignment("examples/nexus", new File("26.nex"), new File("47.nex"));
+
+		JTabbedPaneFixture f = beautiFrame.tabbedPane();
+		printBeautiState(f);
+
+		selectRows(0, 1);
+
+		warning("Link trees");
+		f.selectTab("Partitions");
+		beautiFrame.button("Link Trees").click();
+		printBeautiState(f);
+
+		warning("Delete second partition");
+		f.selectTab("Partitions");
+		selectRows(1);
+		beautiFrame.button("-").click();
+		printBeautiState(f);
+		assertPriorsEqual("YuleModel.t:26", "YuleBirthRatePrior.t:26");
+		
+		makeSureXMLParses();
+	}
+	
+	@Test
+	public void linkTreesAndDeleteTest2b() throws Exception {
+		warning("Load gopher data 26.nex, 47.nex");
+		importAlignment("examples/nexus", new File("26.nex"), new File("47.nex"));
+
+		JTabbedPaneFixture f = beautiFrame.tabbedPane();
+		printBeautiState(f);
+
+		selectRows(1, 0);
+
+		warning("Link trees");
+		f.selectTab("Partitions");
+		beautiFrame.button("Link Trees").click();
+		printBeautiState(f);
+		assertPriorsEqual("YuleModel.t:26", "YuleBirthRatePrior.t:26", "ClockPrior.c:47");
+
+		warning("Delete first partition");
+		f.selectTab("Partitions");
+		beautiFrame.table().selectCell(TableCell.row(0).column(1));
+		beautiFrame.button("-").click();
+		printBeautiState(f);
+		assertPriorsEqual("YuleModel.t:26", "YuleBirthRatePrior.t:26");
+		
+		makeSureXMLParses();
+	}
+	
+	@Test
+	public void linkTreesAndDeleteTest3() throws Exception {
+		warning("Load gopher data 26.nex, 47.nex, 59.nex");
+		importAlignment("examples/nexus", new File("26.nex"), new File("47.nex"), new File("59.nex"));
+
+		JTabbedPaneFixture f = beautiFrame.tabbedPane();
+		printBeautiState(f);
+		assertStateEquals("Tree.t:26", "birthRate.t:26", "Tree.t:47", "clockRate.c:47", "birthRate.t:47", "Tree.t:59", "clockRate.c:59", "birthRate.t:59");
+		assertOperatorsEqual("YuleBirthRateScaler.t:26", "YuleModelTreeScaler.t:26", "YuleModelTreeRootScaler.t:26", "YuleModelUniformOperator.t:26", "YuleModelSubtreeSlide.t:26", "YuleModelNarrow.t:26", "YuleModelWide.t:26", "YuleModelWilsonBalding.t:26", "StrictClockRateScaler.c:47", "YuleBirthRateScaler.t:47", "YuleModelTreeScaler.t:47", "YuleModelTreeRootScaler.t:47", "YuleModelUniformOperator.t:47", "YuleModelSubtreeSlide.t:47", "YuleModelNarrow.t:47", "YuleModelWide.t:47", "YuleModelWils [...]
+		assertPriorsEqual("YuleModel.t:26", "YuleBirthRatePrior.t:26", "YuleModel.t:47", "ClockPrior.c:47", "YuleBirthRatePrior.t:47", "YuleModel.t:59", "ClockPrior.c:59", "YuleBirthRatePrior.t:59");
+		assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.26", "TreeHeight.t:26", "YuleModel.t:26", "birthRate.t:26", "treeLikelihood.47", "TreeHeight.t:47", "clockRate.c:47", "YuleModel.t:47", "birthRate.t:47", "treeLikelihood.59", "TreeHeight.t:59", "clockRate.c:59", "YuleModel.t:59", "birthRate.t:59");
+
+		selectRows(2, 1, 0);
+
+		warning("Link trees");
+		f.selectTab("Partitions");
+		beautiFrame.button("Link Trees").click();
+		printBeautiState(f);
+		assertPriorsEqual("YuleModel.t:26", "YuleBirthRatePrior.t:26", "ClockPrior.c:47", "ClockPrior.c:59");
+		makeSureXMLParses();
+
+		warning("Delete second partition (47)");
+		f.selectTab("Partitions");
+		selectRows(1);
+		beautiFrame.button("-").click();
+		printBeautiState(f);
+		assertPriorsEqual("YuleModel.t:26", "YuleBirthRatePrior.t:26", "ClockPrior.c:59");
+		makeSureXMLParses();
+
+		warning("Delete first partition (26)");
+		f.selectTab("Partitions");
+		selectRows(0);
+		beautiFrame.button("-").click();
+		printBeautiState(f);
+		assertPriorsEqual("YuleModel.t:26", "YuleBirthRatePrior.t:26");
+
+		makeSureXMLParses();
+	}
+
+
+	@Test
+	public void linkTreesAndClocksAndDeleteTest() throws Exception {
+		warning("Load gopher data 26.nex, 47.nex, 59.nex");
+		importAlignment("examples/nexus", new File("26.nex"), new File("47.nex"), new File("59.nex"));
+
+		JTabbedPaneFixture f = beautiFrame.tabbedPane();
+		printBeautiState(f);
+		assertStateEquals("Tree.t:26", "birthRate.t:26", "Tree.t:47", "clockRate.c:47", "birthRate.t:47", "Tree.t:59", "clockRate.c:59", "birthRate.t:59");
+		assertOperatorsEqual("YuleBirthRateScaler.t:26", "YuleModelTreeScaler.t:26", "YuleModelTreeRootScaler.t:26", "YuleModelUniformOperator.t:26", "YuleModelSubtreeSlide.t:26", "YuleModelNarrow.t:26", "YuleModelWide.t:26", "YuleModelWilsonBalding.t:26", "StrictClockRateScaler.c:47", "YuleBirthRateScaler.t:47", "YuleModelTreeScaler.t:47", "YuleModelTreeRootScaler.t:47", "YuleModelUniformOperator.t:47", "YuleModelSubtreeSlide.t:47", "YuleModelNarrow.t:47", "YuleModelWide.t:47", "YuleModelWils [...]
+		assertPriorsEqual("YuleModel.t:26", "YuleBirthRatePrior.t:26", "YuleModel.t:47", "ClockPrior.c:47", "YuleBirthRatePrior.t:47", "YuleModel.t:59", "ClockPrior.c:59", "YuleBirthRatePrior.t:59");
+		assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.26", "TreeHeight.t:26", "YuleModel.t:26", "birthRate.t:26", "treeLikelihood.47", "TreeHeight.t:47", "clockRate.c:47", "YuleModel.t:47", "birthRate.t:47", "treeLikelihood.59", "TreeHeight.t:59", "clockRate.c:59", "YuleModel.t:59", "birthRate.t:59");
+
+		selectRows(0, 1, 2);
+
+		warning("Link trees");
+		f.selectTab("Partitions");
+		beautiFrame.button("Link Trees").click();
+		printBeautiState(f);
+
+		warning("Link clocks");
+		selectRows(0, 1, 2);
+		f.selectTab("Partitions");
+		beautiFrame.button("Link Clock Models").click();
+		printBeautiState(f);
+
+		warning("Delete second partition");
+		f.selectTab("Partitions");
+		selectRows(1);
+		beautiFrame.button("-").click();
+		printBeautiState(f);
+
+		warning("Delete first partition");
+		f.selectTab("Partitions");
+		selectRows(0, 1);
+		beautiFrame.button("Link Clock Models").click();
+		selectRows(0);
+		beautiFrame.button("-").click();
+		printBeautiState(f);
+		assertPriorsEqual("YuleModel.t:26", "YuleBirthRatePrior.t:26");
+
+		makeSureXMLParses();
+	}
+
+	@Test
+	public void linkSiteModelsAndDeleteTest() throws Exception {
+		warning("Load gopher data 26.nex, 47.nex, 59.nex");
+		importAlignment("examples/nexus", new File("26.nex"), new File("47.nex"), new File("59.nex"));
+
+		JTabbedPaneFixture f = beautiFrame.tabbedPane();
+		printBeautiState(f);
+		assertStateEquals("Tree.t:26", "birthRate.t:26", "Tree.t:47", "clockRate.c:47", "birthRate.t:47", "Tree.t:59", "clockRate.c:59", "birthRate.t:59");
+		assertOperatorsEqual("YuleBirthRateScaler.t:26", "YuleModelTreeScaler.t:26", "YuleModelTreeRootScaler.t:26", "YuleModelUniformOperator.t:26", "YuleModelSubtreeSlide.t:26", "YuleModelNarrow.t:26", "YuleModelWide.t:26", "YuleModelWilsonBalding.t:26", "StrictClockRateScaler.c:47", "YuleBirthRateScaler.t:47", "YuleModelTreeScaler.t:47", "YuleModelTreeRootScaler.t:47", "YuleModelUniformOperator.t:47", "YuleModelSubtreeSlide.t:47", "YuleModelNarrow.t:47", "YuleModelWide.t:47", "YuleModelWils [...]
+		assertPriorsEqual("YuleModel.t:26", "YuleBirthRatePrior.t:26", "YuleModel.t:47", "ClockPrior.c:47", "YuleBirthRatePrior.t:47", "YuleModel.t:59", "ClockPrior.c:59", "YuleBirthRatePrior.t:59");
+		assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.26", "TreeHeight.t:26", "YuleModel.t:26", "birthRate.t:26", "treeLikelihood.47", "TreeHeight.t:47", "clockRate.c:47", "YuleModel.t:47", "birthRate.t:47", "treeLikelihood.59", "TreeHeight.t:59", "clockRate.c:59", "YuleModel.t:59", "birthRate.t:59");
+
+		selectRows(0, 1, 2);
+
+		warning("Link trees");
+		f.selectTab("Partitions");
+		beautiFrame.button("Link Trees").click();
+		printBeautiState(f);
+
+		warning("Link clocks");
+		selectRows(0, 1, 2);
+		f.selectTab("Partitions");
+		beautiFrame.button("Link Clock Models").click();
+		printBeautiState(f);
+
+		warning("Delete second partition");
+		f.selectTab("Partitions");
+		selectRows(1);
+		beautiFrame.button("-").click();
+		printBeautiState(f);
+
+		warning("Delete first partition");
+		f.selectTab("Partitions");
+		selectRows(0, 1);
+		beautiFrame.button("Link Clock Models").click();
+		beautiFrame.table().selectCell(TableCell.row(0).column(1));
+		beautiFrame.button("-").click();
+		printBeautiState(f);
+		assertPriorsEqual("YuleModel.t:26", "YuleBirthRatePrior.t:26");
+
+		makeSureXMLParses();
+	}
+	
+	@Test
+	public void linkUnlinkTreesAndSetTreePriorTest1() throws Exception {
+		warning("Load gopher data 26.nex, 47.nex");
+		importAlignment("examples/nexus", new File("26.nex"));
+
+		JTabbedPaneFixture f = beautiFrame.tabbedPane();
+		printBeautiState(f);
+
+		f.selectTab("Priors");
+		
+		warning("Change to Coalescent - constant population");
+		beautiFrame.comboBox("TreeDistribution").selectItem("Coalescent Constant Population");
+		importAlignment("examples/nexus", new File("47.nex"));
+
+		warning("Link trees");
+		f.selectTab("Partitions");
+		selectRows(1, 0);
+		beautiFrame.button("Link Trees").click();
+		printBeautiState(f);
+		assertPriorsEqual("CoalescentConstant.t:26", "ClockPrior.c:47", "PopSizePrior.t:26");
+
+		warning("Unlink trees");
+		beautiFrame.button("Unlink Trees").click();
+		// should have PopSizePrior.t:47 as well?
+		assertPriorsEqual("CoalescentConstant.t:26", "CoalescentConstant.t:47", "ClockPrior.c:47", "PopSizePrior.t:26", "PopSizePrior.t:47");
+		
+//		warning("Delete partition");
+//		f.selectTab("Partitions");
+//		selectRows(1);
+//		beautiFrame.button("-").click();
+//		printBeautiState(f);
+//		assertPriorsEqual("CoalescentConstant.t:26", "PopSizePrior.t:26");
+
+		warning("Delete partition");
+		f.selectTab("Partitions");
+		selectRows(0);
+		beautiFrame.button("-").click();
+		printBeautiState(f);
+		assertPriorsEqual("CoalescentConstant.t:47", "PopSizePrior.t:47");
+
+		makeSureXMLParses();
+	}
+
+	
+	@Test
+	public void linkClocksAndDeleteTest() throws Exception {
+		warning("Load gopher data 26.nex, 47.nex, 59.nex");
+		importAlignment("examples/nexus", new File("26.nex"), new File("47.nex"), new File("59.nex"));
+
+		JTabbedPaneFixture f = beautiFrame.tabbedPane();
+		printBeautiState(f);
+
+		selectRows(0, 1, 2);
+
+		warning("Link clocks");
+		f.selectTab("Partitions");
+		beautiFrame.button("Link Clock Models").click();
+		printBeautiState(f);
+
+		warning("Delete second partition");
+		f.selectTab("Partitions");
+		selectRows(1);
+		beautiFrame.button("-").click();
+		printBeautiState(f);
+		assertPriorsEqual("YuleModel.t:26", "YuleBirthRatePrior.t:26", "YuleModel.t:59", "YuleBirthRatePrior.t:59");
+
+		JTableFixture t = beautiFrame.table();
+		Assertions.assertThat(t.target.getRowCount()).isEqualTo(2);
+		
+		makeSureXMLParses();
+	}
+
+	@Test
+	public void linkSiteModelssAndDeleteTest() throws Exception {
+		warning("Load gopher data 26.nex, 47.nex, 59.nex");
+		importAlignment("examples/nexus", new File("26.nex"), new File("47.nex"), new File("59.nex"));
+
+		JTabbedPaneFixture f = beautiFrame.tabbedPane();
+		printBeautiState(f);
+
+		selectRows(0, 1, 2);
+
+		warning("Link clocks");
+		f.selectTab("Partitions");
+		beautiFrame.button("Link Site Models").click();
+		printBeautiState(f);
+
+		warning("Delete second partition");
+		f.selectTab("Partitions");
+		selectRows(1);
+		beautiFrame.button("-").click();
+		printBeautiState(f);
+		assertPriorsEqual("YuleModel.t:26", "YuleBirthRatePrior.t:26", "YuleModel.t:59", "ClockPrior.c:59", "YuleBirthRatePrior.t:59");
+
+		JTableFixture t = beautiFrame.table();
+		Assertions.assertThat(t.target.getRowCount()).isEqualTo(2);
+		
+		makeSureXMLParses();
+	}
+
+	@Test
+	public void linkClocksSitesAndDeleteTest() throws Exception {
+		warning("Load gopher data 26.nex, 47.nex, 59.nex");
+		importAlignment("examples/nexus", new File("26.nex"), new File("47.nex"), new File("59.nex"));
+
+		JTabbedPaneFixture f = beautiFrame.tabbedPane();
+		printBeautiState(f);
+
+		selectRows(0, 1, 2);
+
+		warning("Link clocks");
+		f.selectTab("Partitions");
+		beautiFrame.button("Link Clock Models").click();
+
+		warning("Link site models");
+		f.selectTab("Partitions");
+		beautiFrame.button("Link Site Models").click();
+		printBeautiState(f);
+
+		warning("Delete second partition");
+		f.selectTab("Partitions");
+		selectRows(1);
+		beautiFrame.button("-").click();
+		printBeautiState(f);
+		assertPriorsEqual("YuleModel.t:26", "YuleBirthRatePrior.t:26", "YuleModel.t:59", "YuleBirthRatePrior.t:59");
+
+		JTableFixture t = beautiFrame.table();
+		Assertions.assertThat(t.target.getRowCount()).isEqualTo(2);
+		
+		makeSureXMLParses();
+	}
+
+	@Test
+	public void linkClocksSitesTreesAndDeleteTest() throws Exception {
+		warning("Load gopher data 26.nex, 47.nex, 59.nex");
+		importAlignment("examples/nexus", new File("26.nex"), new File("47.nex"), new File("59.nex"));
+
+		JTabbedPaneFixture f = beautiFrame.tabbedPane();
+		printBeautiState(f);
+
+		selectRows(0, 1, 2);
+
+		warning("Link clocks");
+		f.selectTab("Partitions");
+		beautiFrame.button("Link Clock Models").click();
+
+		warning("Link site models");
+		f.selectTab("Partitions");
+		beautiFrame.button("Link Site Models").click();
+		printBeautiState(f);
+
+		warning("Link trees");
+		f.selectTab("Partitions");
+		beautiFrame.button("Link Trees").click();
+		printBeautiState(f);
+
+		warning("Delete second partition");
+		f.selectTab("Partitions");
+		selectRows(1);
+		beautiFrame.button("-").click();
+		printBeautiState(f);
+		assertPriorsEqual("YuleModel.t:26", "YuleBirthRatePrior.t:26");
+
+		JTableFixture t = beautiFrame.table();
+		Assertions.assertThat(t.target.getRowCount()).isEqualTo(2);
+		
+		makeSureXMLParses();
+	}
+	
+	
+	@Test // issue #413
+	public void starBeastLinkTreesAndDeleteTest() throws Exception {
+		warning("Select StarBeast template");
+		beautiFrame.menuItemWithPath("File", "Template", "StarBeast").click();
+
+		warning("Load gopher data 26.nex, 47.nex");
+		importAlignment("examples/nexus", new File("26.nex"), new File("47.nex"));
+
+		JTabbedPaneFixture f = beautiFrame.tabbedPane();
+		printBeautiState(f);
+
+		selectRows(0, 1);
+
+		warning("Link trees");
+		f.selectTab("Partitions");
+		beautiFrame.button("Link Trees").click();
+		printBeautiState(f);
+
+		warning("Delete second partition");
+		f.selectTab("Partitions");
+		selectRows(1);
+		beautiFrame.button("-").click();
+		printBeautiState(f);
+//		assertPriorsEqual("YuleModel.t:26", "YuleBirthRatePrior.t:26");
+		
+		JTableFixture t = beautiFrame.table();
+		Assertions.assertThat(t.target.getRowCount()).isEqualTo(1);
+
+		// does not parse unless taxon set is specified
+		//makeSureXMLParses();
+	}	
+	
+	@Test // issue #414
+	public void linkClocksDeleteAllTest() throws Exception {
+		warning("Load gopher data 26.nex, 47.nex, 59.nex");
+		importAlignment("examples/nexus", new File("26.nex"), new File("47.nex"), new File("59.nex"));
+
+		JTabbedPaneFixture f = beautiFrame.tabbedPane();
+		printBeautiState(f);
+
+		selectRows(0, 1, 2);
+
+		warning("Link clocks");
+		f.selectTab("Partitions");
+		beautiFrame.button("Link Clock Models").click();
+		
+		beautiFrame.button("-").click();
+
+		JTableFixture t = beautiFrame.table();
+		Assertions.assertThat(t.target.getRowCount()).isEqualTo(0);
+	}
+}
diff --git a/src/test/beast/app/beauti/SimpleClockModelTest.java b/src/test/beast/app/beauti/SimpleClockModelTest.java
new file mode 100644
index 0000000..c888528
--- /dev/null
+++ b/src/test/beast/app/beauti/SimpleClockModelTest.java
@@ -0,0 +1,111 @@
+package test.beast.app.beauti;
+
+
+import java.io.File;
+
+import org.fest.swing.fixture.JTabbedPaneFixture;
+import org.junit.Test;
+
+public class SimpleClockModelTest extends BeautiBase {
+
+	/** check the standard clock models are there and result in correct behaviour **/
+	@Test
+	public void simpleClockModelTest() throws Exception {
+		warning("Load anolis.nex");
+		importAlignment("examples/nexus", new File("anolis.nex"));
+
+		JTabbedPaneFixture f = beautiFrame.tabbedPane();
+		f.selectTab("Clock Model");
+
+		warning("Change to Relaxed Clock - exponential");
+		beautiFrame.comboBox().selectItem("Relaxed Clock Exponential");
+		printBeautiState(f);
+		assertStateEquals("Tree.t:anolis", "birthRate.t:anolis", "expRateCategories.c:anolis");
+		assertOperatorsEqual("YuleBirthRateScaler.t:anolis", "YuleModelTreeScaler.t:anolis", "YuleModelTreeRootScaler.t:anolis", "YuleModelUniformOperator.t:anolis", "YuleModelSubtreeSlide.t:anolis", "YuleModelNarrow.t:anolis", "YuleModelWide.t:anolis", "YuleModelWilsonBalding.t:anolis", "ExpCategoriesRandomWalk.c:anolis", "ExpCategoriesSwapOperator.c:anolis", "ExpCategoriesUniform.c:anolis");
+		assertPriorsEqual("YuleModel.t:anolis", "YuleBirthRatePrior.t:anolis");
+		assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.anolis", "TreeHeight.t:anolis", "YuleModel.t:anolis", "birthRate.t:anolis", "rateStat.c:anolis");
+		
+		warning("Change to Relaxed Clock - log normal");
+		beautiFrame.comboBox().selectItem("Relaxed Clock Log Normal");
+		printBeautiState(f);
+		assertStateEquals("Tree.t:anolis", "birthRate.t:anolis", "ucldStdev.c:anolis", "rateCategories.c:anolis");
+		assertOperatorsEqual("YuleBirthRateScaler.t:anolis", "YuleModelTreeScaler.t:anolis", "YuleModelTreeRootScaler.t:anolis", "YuleModelUniformOperator.t:anolis", "YuleModelSubtreeSlide.t:anolis", "YuleModelNarrow.t:anolis", "YuleModelWide.t:anolis", "YuleModelWilsonBalding.t:anolis", "ucldStdevScaler.c:anolis", "CategoriesRandomWalk.c:anolis", "CategoriesSwapOperator.c:anolis", "CategoriesUniform.c:anolis");
+		assertPriorsEqual("YuleModel.t:anolis", "YuleBirthRatePrior.t:anolis", "ucldStdevPrior.c:anolis");
+		assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.anolis", "TreeHeight.t:anolis", "YuleModel.t:anolis", "birthRate.t:anolis", "ucldStdev.c:anolis", "rate.c:anolis");
+
+		warning("Change to Random Local Clock");
+		beautiFrame.comboBox().selectItem("Random Local Clock");
+		printBeautiState(f);
+		assertStateEquals("Tree.t:anolis", "birthRate.t:anolis", "Indicators.c:anolis", "clockrates.c:anolis");
+		assertOperatorsEqual("YuleBirthRateScaler.t:anolis", "YuleModelTreeScaler.t:anolis", "YuleModelTreeRootScaler.t:anolis", "YuleModelUniformOperator.t:anolis", "YuleModelSubtreeSlide.t:anolis", "YuleModelNarrow.t:anolis", "YuleModelWide.t:anolis", "YuleModelWilsonBalding.t:anolis", "IndicatorsBitFlip.c:anolis", "ClockRateScaler.c:anolis");
+		assertPriorsEqual("YuleModel.t:anolis", "YuleBirthRatePrior.t:anolis", "RRatesPrior.c:sanolis", "RRateChangesPrior.c:anolis");
+		assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.anolis", "TreeHeight.t:anolis", "YuleModel.t:anolis", "birthRate.t:anolis", "Indicators.c:anolis", "clockrates.c:anolis", "RRateChanges.c:anolis");
+
+		warning("Change to Strickt Clock");
+		beautiFrame.comboBox().selectItem("Strict Clock");
+		printBeautiState(f);
+		assertStateEquals("Tree.t:anolis", "birthRate.t:anolis");
+		assertOperatorsEqual("YuleBirthRateScaler.t:anolis", "YuleModelTreeScaler.t:anolis", "YuleModelTreeRootScaler.t:anolis", "YuleModelUniformOperator.t:anolis", "YuleModelSubtreeSlide.t:anolis", "YuleModelNarrow.t:anolis", "YuleModelWide.t:anolis", "YuleModelWilsonBalding.t:anolis");
+		assertPriorsEqual("YuleModel.t:anolis", "YuleBirthRatePrior.t:anolis");
+		assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.anolis", "TreeHeight.t:anolis", "YuleModel.t:anolis", "birthRate.t:anolis");
+
+		makeSureXMLParses();
+	}
+
+	/** switch to coalescent tree prior, then 
+	 * check the standard clock models are there and result in correct behaviour **/
+	@Test
+	public void simpleClockModelTest2() throws Exception {
+		warning("Load anolis.nex");
+		importAlignment("examples/nexus", new File("anolis.nex"));
+
+		JTabbedPaneFixture f = beautiFrame.tabbedPane();
+		f.selectTab("Priors");
+		
+		warning("Change to Coalescent - constant population");
+		
+		beautiFrame.comboBox("TreeDistribution").selectItem("Coalescent Constant Population");
+		printBeautiState(f);
+		assertStateEquals("Tree.t:anolis", "popSize.t:anolis");
+		assertOperatorsEqual("CoalescentConstantTreeScaler.t:anolis", "CoalescentConstantTreeRootScaler.t:anolis", "CoalescentConstantUniformOperator.t:anolis", "CoalescentConstantSubtreeSlide.t:anolis", "CoalescentConstantNarrow.t:anolis", "CoalescentConstantWide.t:anolis", "CoalescentConstantWilsonBalding.t:anolis", "PopSizeScaler.t:anolis");
+		assertPriorsEqual("CoalescentConstant.t:anolis", "PopSizePrior.t:anolis");
+		assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.anolis", "TreeHeight.t:anolis", "popSize.t:anolis", "CoalescentConstant.t:anolis");
+		
+		f.selectTab("Clock Model");
+
+		warning("Change to Relaxed Clock - exponential");
+		beautiFrame.comboBox().selectItem("Relaxed Clock Exponential");
+		printBeautiState(f);
+		assertStateEquals("Tree.t:anolis", "popSize.t:anolis", "expRateCategories.c:anolis");
+		assertOperatorsEqual("CoalescentConstantTreeScaler.t:anolis", "CoalescentConstantTreeRootScaler.t:anolis", "CoalescentConstantUniformOperator.t:anolis", "CoalescentConstantSubtreeSlide.t:anolis", "CoalescentConstantNarrow.t:anolis", "CoalescentConstantWide.t:anolis", "CoalescentConstantWilsonBalding.t:anolis", "PopSizeScaler.t:anolis", "ExpCategoriesRandomWalk.c:anolis", "ExpCategoriesSwapOperator.c:anolis", "ExpCategoriesUniform.c:anolis");
+		assertPriorsEqual("CoalescentConstant.t:anolis", "PopSizePrior.t:anolis");
+		assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.anolis", "TreeHeight.t:anolis", "popSize.t:anolis", "CoalescentConstant.t:anolis", "rateStat.c:anolis");
+		
+		warning("Change to Relaxed Clock - log normal");
+		beautiFrame.comboBox().selectItem("Relaxed Clock Log Normal");
+		printBeautiState(f);
+		assertStateEquals("Tree.t:anolis", "popSize.t:anolis", "ucldStdev.c:anolis", "rateCategories.c:anolis");
+		assertOperatorsEqual("CoalescentConstantTreeScaler.t:anolis", "CoalescentConstantTreeRootScaler.t:anolis", "CoalescentConstantUniformOperator.t:anolis", "CoalescentConstantSubtreeSlide.t:anolis", "CoalescentConstantNarrow.t:anolis", "CoalescentConstantWide.t:anolis", "CoalescentConstantWilsonBalding.t:anolis", "PopSizeScaler.t:anolis", "ucldStdevScaler.c:anolis", "CategoriesRandomWalk.c:anolis", "CategoriesSwapOperator.c:anolis", "CategoriesUniform.c:anolis");
+		assertPriorsEqual("CoalescentConstant.t:anolis", "PopSizePrior.t:anolis", "ucldStdevPrior.c:anolis");
+		assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.anolis", "TreeHeight.t:anolis", "popSize.t:anolis", "CoalescentConstant.t:anolis", "ucldStdev.c:anolis", "rate.c:anolis");
+
+		warning("Change to Random Local Clock");
+		beautiFrame.comboBox().selectItem("Random Local Clock");
+		printBeautiState(f);
+		assertStateEquals("Tree.t:anolis", "popSize.t:anolis", "Indicators.c:anolis", "clockrates.c:anolis");
+		assertOperatorsEqual("CoalescentConstantTreeScaler.t:anolis", "CoalescentConstantTreeRootScaler.t:anolis", "CoalescentConstantUniformOperator.t:anolis", "CoalescentConstantSubtreeSlide.t:anolis", "CoalescentConstantNarrow.t:anolis", "CoalescentConstantWide.t:anolis", "CoalescentConstantWilsonBalding.t:anolis", "PopSizeScaler.t:anolis", "IndicatorsBitFlip.c:anolis", "ClockRateScaler.c:anolis");
+		assertPriorsEqual("CoalescentConstant.t:anolis", "PopSizePrior.t:anolis", "RRatesPrior.c:sanolis", "RRateChangesPrior.c:anolis");
+		assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.anolis", "TreeHeight.t:anolis", "popSize.t:anolis", "CoalescentConstant.t:anolis", "Indicators.c:anolis", "clockrates.c:anolis", "RRateChanges.c:anolis");
+
+		warning("Change to Strickt Clock");
+		beautiFrame.comboBox().selectItem("Strict Clock");
+		printBeautiState(f);
+		assertStateEquals("Tree.t:anolis", "popSize.t:anolis");
+		assertOperatorsEqual("CoalescentConstantTreeScaler.t:anolis", "CoalescentConstantTreeRootScaler.t:anolis", "CoalescentConstantUniformOperator.t:anolis", "CoalescentConstantSubtreeSlide.t:anolis", "CoalescentConstantNarrow.t:anolis", "CoalescentConstantWide.t:anolis", "CoalescentConstantWilsonBalding.t:anolis", "PopSizeScaler.t:anolis");
+		assertPriorsEqual("CoalescentConstant.t:anolis", "PopSizePrior.t:anolis");
+		assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.anolis", "TreeHeight.t:anolis", "popSize.t:anolis", "CoalescentConstant.t:anolis");
+
+		makeSureXMLParses();
+	}
+
+}
diff --git a/src/test/beast/app/beauti/SimpleTreePriorTest.java b/src/test/beast/app/beauti/SimpleTreePriorTest.java
new file mode 100644
index 0000000..2f39cdb
--- /dev/null
+++ b/src/test/beast/app/beauti/SimpleTreePriorTest.java
@@ -0,0 +1,64 @@
+package test.beast.app.beauti;
+
+
+import java.io.File;
+
+import org.fest.swing.fixture.JTabbedPaneFixture;
+import org.junit.Test;
+
+public class SimpleTreePriorTest extends BeautiBase {
+	
+	/** check the standard tree priors are there and result in correct behaviour **/
+	@Test
+	public void simpleTreePriorTest() throws Exception {
+		warning("Load anolis.nex");
+		importAlignment("examples/nexus", new File("anolis.nex"));
+
+		JTabbedPaneFixture f = beautiFrame.tabbedPane();
+		f.selectTab("Priors");
+		
+		warning("Change to Coalescent - constant population");
+		
+		beautiFrame.comboBox("TreeDistribution").selectItem("Coalescent Constant Population");
+		printBeautiState(f);
+		assertStateEquals("Tree.t:anolis", "popSize.t:anolis");
+		assertOperatorsEqual("CoalescentConstantTreeScaler.t:anolis", "CoalescentConstantTreeRootScaler.t:anolis", "CoalescentConstantUniformOperator.t:anolis", "CoalescentConstantSubtreeSlide.t:anolis", "CoalescentConstantNarrow.t:anolis", "CoalescentConstantWide.t:anolis", "CoalescentConstantWilsonBalding.t:anolis", "PopSizeScaler.t:anolis");
+		assertPriorsEqual("CoalescentConstant.t:anolis", "PopSizePrior.t:anolis");
+		assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.anolis", "TreeHeight.t:anolis", "popSize.t:anolis", "CoalescentConstant.t:anolis");
+
+		warning("Change to Coalescent - exponential population");
+		beautiFrame.comboBox("TreeDistribution").selectItem("Coalescent Exponential Population");
+		printBeautiState(f);
+		assertStateEquals("Tree.t:anolis", "ePopSize.t:anolis", "growthRate.t:anolis");
+		assertOperatorsEqual("CoalescentExponentialTreeScaler.t:anolis", "CoalescentExponentialTreeRootScaler.t:anolis", "CoalescentExponentialUniformOperator.t:anolis", "CoalescentExponentialSubtreeSlide.t:anolis", "CoalescentExponentialNarrow.t:anolis", "CoalescentExponentialWide.t:anolis", "CoalescentExponentialWilsonBalding.t:anolis", "ePopSizeScaler.t:anolis", "GrowthRateRandomWalk.t:anolis");
+		assertPriorsEqual("CoalescentExponential.t:anolis", "ePopSizePrior.t:anolis", "GrowthRatePrior.t:anolis");
+		assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.anolis", "TreeHeight.t:anolis", "CoalescentExponential.t:anolis", "ePopSize.t:anolis", "growthRate.t:anolis");
+		
+		warning("Change to Coalescent - BPS");
+		beautiFrame.comboBox("TreeDistribution").selectItem("Coalescent Bayesian Skyline");
+		printBeautiState(f);
+		assertStateEquals("Tree.t:anolis", "bPopSizes.t:anolis", "bGroupSizes.t:anolis");
+		assertOperatorsEqual("BayesianSkylineTreeScaler.t:anolis", "BayesianSkylineTreeRootScaler.t:anolis", "BayesianSkylineUniformOperator.t:anolis", "BayesianSkylineSubtreeSlide.t:anolis", "BayesianSkylineNarrow.t:anolis", "BayesianSkylineWide.t:anolis", "BayesianSkylineWilsonBalding.t:anolis", "popSizesScaler.t:anolis", "groupSizesDelta.t:anolis");
+		assertPriorsEqual("BayesianSkyline.t:anolis", "MarkovChainedPopSizes.t:anolis");
+		assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.anolis", "TreeHeight.t:anolis", "BayesianSkyline.t:anolis", "bPopSizes.t:anolis", "bGroupSizes.t:anolis");
+		
+		warning("Change to Yule");
+		beautiFrame.comboBox("TreeDistribution").selectItem("Yule Model");
+		printBeautiState(f);
+		assertStateEquals("Tree.t:anolis", "birthRate.t:anolis");
+		assertOperatorsEqual("YuleModelTreeScaler.t:anolis", "YuleModelTreeRootScaler.t:anolis", "YuleModelUniformOperator.t:anolis", "YuleModelSubtreeSlide.t:anolis", "YuleModelNarrow.t:anolis", "YuleModelWide.t:anolis", "YuleModelWilsonBalding.t:anolis", "YuleBirthRateScaler.t:anolis");
+		assertPriorsEqual("YuleModel.t:anolis", "YuleBirthRatePrior.t:anolis");
+		assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.anolis", "TreeHeight.t:anolis", "YuleModel.t:anolis", "birthRate.t:anolis");
+		
+		warning("Change to Birth-Death");
+		beautiFrame.comboBox("TreeDistribution").selectItem("Birth Death Model");
+		printBeautiState(f);
+		assertStateEquals("Tree.t:anolis", "birthRate2.t:anolis", "relativeDeathRate2.t:anolis");
+		assertOperatorsEqual("BirthDeathTreeScaler.t:anolis", "BirthDeathTreeRootScaler.t:anolis", "BirthDeathUniformOperator.t:anolis", "BirthDeathSubtreeSlide.t:anolis", "BirthDeathNarrow.t:anolis", "BirthDeathWide.t:anolis", "BirthDeathWilsonBalding.t:anolis", "BirthRateScaler.t:anolis", "DeathRateScaler.t:anolis");
+		assertPriorsEqual("BirthDeath.t:anolis", "BirthRatePrior.t:anolis", "DeathRatePrior.t:anolis");
+		assertTraceLogEqual("posterior", "likelihood", "prior", "treeLikelihood.anolis", "TreeHeight.t:anolis", "BirthDeath.t:anolis", "birthRate2.t:anolis", "relativeDeathRate2.t:anolis");
+
+		makeSureXMLParses();
+	}
+
+}
diff --git a/src/test/beast/beast2vs1/ClockModelTest.java b/src/test/beast/beast2vs1/ClockModelTest.java
new file mode 100644
index 0000000..05ce3dc
--- /dev/null
+++ b/src/test/beast/beast2vs1/ClockModelTest.java
@@ -0,0 +1,111 @@
+package test.beast.beast2vs1;
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+import test.beast.beast2vs1.trace.Expectation;
+
+/**
+ * @author Walter Xie
+ */
+public class ClockModelTest extends TestFramework {
+
+    private final String[] XML_FILES = new String[]{"testStrictClock.xml", "testStrictClock2.xml",
+            "testRandomLocalClock.xml", "testUCRelaxedClockLogNormal.xml"};
+
+    public void testStrictClock() throws Exception {
+        analyse(0);
+    }
+
+    public void testStrictClock2() throws Exception {
+        analyse(1);
+    }
+
+    public void testRandomLocalClock() throws Exception {
+        analyse(2);
+    }
+
+    public void testUCRelaxedClockLogNormal() throws Exception {
+        analyse(3);
+    }
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp(XML_FILES);
+    }
+
+    protected List<Expectation> giveExpectations(int index_XML) throws Exception {
+        List<Expectation> expList = new ArrayList<Expectation>();
+
+        // all values below are from BEAST 1.7
+        switch (index_XML) {
+            case 0: // testStrictClock.xml
+//        BEAST 1 testStrictClockNoDate.xml
+                addExpIntoList(expList, "posterior", -1812.939, 0.0581);
+                addExpIntoList(expList, "prior", 3.752, 0.0205);
+                addExpIntoList(expList, "tree.height", 6.32E-02, 6.76E-05);
+                addExpIntoList(expList, "popSize", 9.67E-02, 5.99E-04);
+                addExpIntoList(expList, "hky.kappa", 25.807, 0.1812);
+                addExpIntoList(expList, "hky.frequencies1", 0.327, 6.15E-04);
+                addExpIntoList(expList, "hky.frequencies2", 0.258, 6.09E-04);
+                addExpIntoList(expList, "hky.frequencies3", 0.155, 3.88E-04);
+                addExpIntoList(expList, "hky.frequencies4", 0.261, 5.17E-04);
+                addExpIntoList(expList, "clockRate", 1.0, 0.0);
+                addExpIntoList(expList, "treeLikelihood", -1816.691, 0.0522);
+                addExpIntoList(expList, "coalescent", 7.24, 9.58E-03);
+                break;
+
+            case 1: // testStrictClock2.xml
+//        BEAST 1 testStrictClockNoDate2.xml
+                addExpIntoList(expList, "posterior", -1811.898, 2.89E-02);
+                addExpIntoList(expList, "prior", 3.721, 2.34E-02);
+                addExpIntoList(expList, "tree.height", 6.29E-02, 6.43E-05);
+                addExpIntoList(expList, "popSize", 9.76E-02, 6.68E-04);
+                addExpIntoList(expList, "hky.kappa", 26.491, 0.2089);
+                addExpIntoList(expList, "clockRate", 1.0, 0.0);
+                addExpIntoList(expList, "treeLikelihood", -1815.619, 2.20E-02);
+                addExpIntoList(expList, "coalescent", 7.276, 9.55E-03);
+                break;
+
+            case 2: // testRandomLocalClock.xml
+                addExpIntoList(expList, "posterior", -1821.0538, 0.1647);
+                addExpIntoList(expList, "prior", -4.4935, 0.1553);
+                addExpIntoList(expList, "tree.height", 6.4088E-2, 1.4663E-4);
+                addExpIntoList(expList, "popSize", 9.6541E-2, 6.6609E-4);
+                addExpIntoList(expList, "hky.kappa", 26.544, 0.2648);
+                addExpIntoList(expList, "hky.frequencies1", 0.3253, 7.3002E-4);
+                addExpIntoList(expList, "hky.frequencies2", 0.258, 5.5405E-4);
+                addExpIntoList(expList, "hky.frequencies3", 0.1546, 4.6881E-4);
+                addExpIntoList(expList, "hky.frequencies4", 0.262, 6.1501E-4);
+                addExpIntoList(expList, "treeLikelihood", -1816.5603, 5.5936E-2);
+                addExpIntoList(expList, "coalescent", 7.2815, 1.3472E-2);
+                break;
+
+            case 3: // testUCRelaxedClockLogNormal.xml
+                addExpIntoList(expList, "posterior", -1812.117, 0.1369);
+                addExpIntoList(expList, "prior", 4.3666, 5.2353E-2);
+                addExpIntoList(expList, "treeLikelihood", -1816.4836, 9.4437E-2);
+                addExpIntoList(expList, "tree.height", 6.4535E-2, 4.3471E-4);
+                addExpIntoList(expList, "popSize", 9.4535E-2, 1.7803E-3);
+                addExpIntoList(expList, "hky.kappa", 26.0574, 0.2775);
+                addExpIntoList(expList, "hky.frequencies1", 0.3262, 9.4363E-4);
+                addExpIntoList(expList, "hky.frequencies2", 0.2575, 7.5592E-4);
+                addExpIntoList(expList, "hky.frequencies3", 0.1545, 5.1935E-4);
+                addExpIntoList(expList, "hky.frequencies4", 0.2618, 5.9827E-4);
+                addExpIntoList(expList, "S", 0.1786, 4.9947E-3);
+                addExpIntoList(expList, "coalescent", 7.3012, 3.0267E-2);
+                addExpIntoList(expList, "rate.mean", 0.9962, 3.1704E-3);
+                addExpIntoList(expList, "rate.coefficientOfVariation", 0.1565, 4.3557E-3);
+//                rate.variance   3.526E-2                
+                break;
+
+            default:
+                throw new Exception("No such XML");
+        }
+
+        return expList;
+    }
+
+
+} // class ResumeTest
\ No newline at end of file
diff --git a/src/test/beast/beast2vs1/StarBEASTTest.java b/src/test/beast/beast2vs1/StarBEASTTest.java
new file mode 100644
index 0000000..f2cca5d
--- /dev/null
+++ b/src/test/beast/beast2vs1/StarBEASTTest.java
@@ -0,0 +1,134 @@
+package test.beast.beast2vs1;
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+import test.beast.beast2vs1.trace.Expectation;
+
+/**
+ * Due to different naming, *BEAST 2 speciesCoalescent != *BEAST 1 species.coalescent
+ * <p/>
+ * beast 2 has:
+ * speciesCoalescent	             : the total multispecies coalescent and pop sizes (sum of the next 3)
+ * SpeciesTreePopSizePrior          : prior on population sizes parameters
+ * tree.prior.26	                 : multispecies coalescent  per specific tree (26)
+ * tree.prior.29	                 : multispecies coalescent  per specific tree (29)
+ * SpeciesTreeDivergenceTimesPrior  : overall tree prior (Yule, BD etc)
+ * <p/>
+ * beast 1 has:
+ * species.coalescent               : the total multispecies coalescent
+ * species.popSizesLikelihood       : prior on population sizes parameters
+ * speciation.likelihood           : overall tree prior (Yule, BD etc)
+ *
+ * @author Walter Xie
+ */
+public class StarBEASTTest extends TestFramework {
+
+    String[] XML_FILES = new String[]{"testStarBEASTConstant.xml", "testStarBEASTLinear.xml",
+            "testStarBEASTLinearConstRoot.xml"};//"testStarBEAST.xml" };
+
+    public void testStarBEASTConstant() throws Exception {
+        analyse(0);
+    }
+
+    public void testStarBEASTLinear() throws Exception {
+        analyse(1);
+    }
+
+    public void testStarBEASTLinearConstRoot() throws Exception {
+        analyse(2);
+    }
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp(XML_FILES);
+    }
+
+    protected List<Expectation> giveExpectations(int index_XML) throws Exception {
+        List<Expectation> expList = new ArrayList<Expectation>();
+
+        // all values below are from BEAST 1.6.2
+        switch (index_XML) {
+            case 0: // testStarBEASTConstant.xml
+                // BEAST 1 testStarBEASTConstant.xml
+                addExpIntoList(expList, "posterior", -2211.8038, 0.3671);
+                addExpIntoList(expList, "prior", 301.5082, 0.3341);
+                addExpIntoList(expList, "popMean", 3.9767E-3, 5.2107E-5);
+                addExpIntoList(expList, "birthRate", 210.9752, 2.63);
+                addExpIntoList(expList, "hky.kappa26", 4.3779, 5.395E-2);
+                addExpIntoList(expList, "hky.kappa29", 4.088, 5.169E-2);
+                addExpIntoList(expList, "genetree.priors", 216.6122, 0.2504);
+                addExpIntoList(expList, "SpeciesTreePopSizePrior", 60.2194, 0.1877);
+                addExpIntoList(expList, "SpeciesTreeDivergenceTimesPrior", 29.5342, 6.1007E-2);
+                addExpIntoList(expList, "TreeHeightSP", 1.1798E-2, 1.151E-4);
+                addExpIntoList(expList, "TreeHeight26", 2.6466E-2, 6.3184E-5);
+                addExpIntoList(expList, "TreeHeight29", 2.2388E-2, 4.9647E-5);
+                addExpIntoList(expList, "likelihood", -2513.312, 0.1439);
+                addExpIntoList(expList, "treelikelihood.26", -1266.818, 0.117);
+                addExpIntoList(expList, "treelikelihood.29", -1246.494, 9.6752E-2);
+                break;
+
+            case 1: // testStarBEASTLinear.xml
+                // BEAST 1 testStarBEASTLinear.xml
+                addExpIntoList(expList, "posterior", -2173.5261, 0.4644);
+                addExpIntoList(expList, "prior", 339.8849, 0.4886);
+                addExpIntoList(expList, "popMean", 2.1388E-3, 2.4177E-5);
+                addExpIntoList(expList, "birthRate", 208.8798, 2.5617);
+                addExpIntoList(expList, "hky.kappa26", 4.4586, 6.9657E-2);
+                addExpIntoList(expList, "hky.kappa29", 4.193, 7.2237E-2);
+                addExpIntoList(expList, "genetree.priors", 212.531, 0.2891);
+                addExpIntoList(expList, "SpeciesTreePopSizePrior", 102.1531, 0.2645);
+                addExpIntoList(expList, "SpeciesTreeDivergenceTimesPrior", 29.5246, 7.3365E-2);
+                addExpIntoList(expList, "TreeHeightSP", 1.1882E-2, 1.2088E-4);
+                addExpIntoList(expList, "TreeHeight26", 2.5563E-2, 5.2973E-5);
+                addExpIntoList(expList, "TreeHeight29", 2.2529E-2, 4.4067E-5);
+                addExpIntoList(expList, "likelihood", -2513.411, 0.1569);
+                addExpIntoList(expList, "treelikelihood.26", -1267.0724, 0.1138);
+                addExpIntoList(expList, "treelikelihood.29", -1246.3386, 0.1219);
+                break;
+
+            case 2: // testStarBEASTLinearConstRoot.xml
+                // BEAST 1 testStarBEASTLinearConstRoot.xml
+                addExpIntoList(expList, "posterior", -2177.0138, 0.4211);
+                addExpIntoList(expList, "prior", 336.7861, 0.4327);
+                addExpIntoList(expList, "popMean", 2.0327E-3, 2.2285E-5);
+                addExpIntoList(expList, "birthRate", 211.7118, 2.6749);
+                addExpIntoList(expList, "hky.kappa26", 4.4708, 5.7879E-2);
+                addExpIntoList(expList, "hky.kappa29", 4.0384, 5.5666E-2);
+                addExpIntoList(expList, "genetree.priors", 212.5333, 0.2737);
+                addExpIntoList(expList, "SpeciesTreePopSizePrior", 98.9183, 0.2323);
+                addExpIntoList(expList, "SpeciesTreeDivergenceTimesPrior", 29.5698, 6.714E-2);
+                addExpIntoList(expList, "TreeHeightSP", 1.1574E-2, 9.1978E-5);
+                addExpIntoList(expList, "TreeHeight26", 2.6479E-2, 6.2548E-5);
+                addExpIntoList(expList, "TreeHeight29", 2.2444E-2, 5.1901E-5);
+                addExpIntoList(expList, "likelihood", -2513.7999, 0.1439);
+                addExpIntoList(expList, "treelikelihood.26", -1267.2603, 0.1345);
+                addExpIntoList(expList, "treelikelihood.29", -1246.5396, 0.1015);
+                break;
+
+            // case 0: // testStarBEAST.xml
+            // // BEAST 1 testStarBEAST.xml
+            // addExpIntoList(expList, "posterior", -1884.6966, 6.3796E-2);
+            // addExpIntoList(expList, "prior", -68.0023, 2.114E-2);
+            // addExpIntoList(expList, "tree.height", 6.3129E-2, 6.5853E-5);
+            // addExpIntoList(expList, "mrcatime(human,chimp)", 2.0326E-2,
+            // 3.5906E-5);
+            // addExpIntoList(expList, "popSize", 9.7862E-2, 6.2387E-4);
+            // addExpIntoList(expList, "hky.kappa", 25.8288, 0.1962);
+            // addExpIntoList(expList, "hky.frequencies1", 0.3262, 5.9501E-4);
+            // addExpIntoList(expList, "hky.frequencies2", 0.2569, 5.0647E-4);
+            // addExpIntoList(expList, "hky.frequencies3", 0.1552, 4.4638E-4);
+            // addExpIntoList(expList, "hky.frequencies4", 0.2617, 5.1085E-4);
+            // addExpIntoList(expList, "likelihood", -1816.6943, 5.8444E-2);
+            // addExpIntoList(expList, "coalescent", 7.2378, 9.1912E-3);
+            // break;
+
+            default:
+                throw new Exception("No such XML");
+        }
+
+        return expList;
+    }
+
+} // class ResumeTest
\ No newline at end of file
diff --git a/src/test/beast/beast2vs1/SubstitutionModelTest.java b/src/test/beast/beast2vs1/SubstitutionModelTest.java
new file mode 100644
index 0000000..ce31dcb
--- /dev/null
+++ b/src/test/beast/beast2vs1/SubstitutionModelTest.java
@@ -0,0 +1,117 @@
+package test.beast.beast2vs1;
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+import test.beast.beast2vs1.trace.Expectation;
+
+/**
+ * @author Walter Xie
+ */
+public class SubstitutionModelTest extends TestFramework {
+
+    private final String[] XML_FILES = new String[]{"testHKY.xml", "testSiteModelAlpha.xml",
+            "testMultiSubstModel.xml", "testSRD06CP12_3.xml"};
+
+    public void testHKY() throws Exception {
+        analyse(0);
+    }
+
+    public void testSiteModelAlpha() throws Exception {
+        analyse(1);
+    }
+
+    public void testMultiSubstModel() throws Exception {
+        analyse(2);
+    }
+
+    public void testSRD06CP12_3() throws Exception {
+        analyse(3);
+    }
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp(XML_FILES);
+    }
+
+    protected List<Expectation> giveExpectations(int index_XML) throws Exception {
+        List<Expectation> expList = new ArrayList<Expectation>();
+
+        // all values below are from BEAST 1.7
+        switch (index_XML) {
+            case 0: // testHKY.xml
+//        BEAST 1 testMCMC.xml
+//        <expectation name="likelihood" value="-1815.75"/>
+//        <expectation name="treeModel.rootHeight" value="0.0642048"/>
+//        <expectation name="hky.kappa" value="32.8941"/>
+                addExpIntoList(expList, "treeLikelihood", -1815.766, 0.0202);
+                addExpIntoList(expList, "tree.height", 6.42E-02, 6.53E-05);
+                addExpIntoList(expList, "hky.kappa", 33.019, 0.1157);
+                break;
+
+            case 1: // testSiteModelAlpha.xml
+                addExpIntoList(expList, "posterior", -4433.5759, 0.4005);
+                addExpIntoList(expList, "tree.height", 10.8255, 0.1264);
+                addExpIntoList(expList, "popSize", 10.0706, 0.254);
+                addExpIntoList(expList, "hky.kappa", 9.4378, 2.8498E-2);
+                addExpIntoList(expList, "siteModel.alpha", 0.1771, 1.256E-3);
+                addExpIntoList(expList, "clockRate", 3.9202E-3, 6.6938E-5);
+                addExpIntoList(expList, "treeLikelihood", -4369.4205, 9.9579E-2);
+                addExpIntoList(expList, "coalescent", -64.1553, 0.4559);
+                break;
+
+            case 2: // testMultiSubstModel.xml
+                addExpIntoList(expList, "posterior", -6001.92, 8.1888E-2);
+                addExpIntoList(expList, "prior", -8.24, 1.1349E-2);
+                addExpIntoList(expList, "TreeHeight.firsthalf", 0.2523, 1.2987E-4);
+                addExpIntoList(expList, "kappa.firsthalf", 4.8401, 1.184E-2);
+                addExpIntoList(expList, "freqParameter.firsthalf1", 0.289, 6.1115E-4);
+                addExpIntoList(expList, "freqParameter.firsthalf2", 0.3204, 6.8116E-4);
+                addExpIntoList(expList, "freqParameter.firsthalf3", 0.1081, 3.8843E-4);
+                addExpIntoList(expList, "freqParameter.firsthalf4", 0.2825, 5.1796E-4);
+                addExpIntoList(expList, "kappa.secondhalf", 5.22, 1.121E-2);
+                addExpIntoList(expList, "freqParameter.secondhalf1", 0.3368, 6.3272E-4);
+                addExpIntoList(expList, "freqParameter.secondhalf2", 0.2646, 4.8458E-4);
+                addExpIntoList(expList, "freqParameter.secondhalf3", 0.1018, 2.8896E-4);
+                addExpIntoList(expList, "freqParameter.secondhalf4", 0.2968, 5.2109E-4);
+                addExpIntoList(expList, "likelihood", -5993.68, 8.1194E-2);
+                addExpIntoList(expList, "treeLikelihood.firsthalf", -3049.7192, 6.5715E-2);
+                addExpIntoList(expList, "treeLikelihood.secondhalf", -2943.9608, 5.2473E-2);
+                addExpIntoList(expList, "popSize.firsthalf", 0.5184, 1.8192E-3);
+                addExpIntoList(expList, "CoalescentConstant.firsthalf", -3.1965, 8.9084E-3);
+                break;
+
+            case 3: // testSRD06CP12_3.xml
+                addExpIntoList(expList, "posterior", -1793.4164, 0.2044);
+                addExpIntoList(expList, "prior", 0.8416, 0.2033);
+                addExpIntoList(expList, "tree.height", 9.8986E-2, 3.709E-4);
+                addExpIntoList(expList, "CP12.hky.kappa", 25.0699, 0.2541);
+                addExpIntoList(expList, "CP12.frequencies1", 0.3444, 8.2165E-4);
+                addExpIntoList(expList, "CP12.frequencies2", 0.2447, 6.885E-4);
+                addExpIntoList(expList, "CP12.frequencies3", 0.1444, 5.3526E-4);
+                addExpIntoList(expList, "CP12.frequencies4", 0.2666, 6.174E-4);
+                addExpIntoList(expList, "CP3.hky.kappa", 82.9907, 1.9773);
+                addExpIntoList(expList, "CP3.frequencies1", 0.3197, 1.1763E-3);
+                addExpIntoList(expList, "CP3.frequencies2", 0.264, 9.0478E-4);
+                addExpIntoList(expList, "CP3.frequencies3", 0.1675, 8.6506E-4);
+                addExpIntoList(expList, "CP3.frequencies4", 0.2488, 1.059E-3);
+                addExpIntoList(expList, "CP12.gammaShape", 6.4322E-2, 4.8796E-3);
+                addExpIntoList(expList, "CP3.gammaShape", 8.5652E-2, 6.9946E-3);
+                addExpIntoList(expList, "CP12.mutationRate", 0.9437, 1.195E-3);
+                addExpIntoList(expList, "CP3.mutationRate", 1.1126, 2.3899E-3);
+                addExpIntoList(expList, "likelihood", -1794.258, 9.3476E-2);
+                addExpIntoList(expList, "CP12.treeLikelihood", -1181.4538, 6.0608E-2);
+                addExpIntoList(expList, "CP3.treeLikelihood", -612.8041, 6.0563E-2);
+                addExpIntoList(expList, "popSize", 0.1211, 7.505E-4);
+                addExpIntoList(expList, "coalescent", 6.2171, 1.1266E-2);
+                break;
+
+            default:
+                throw new Exception("No such XML");
+        }
+
+        return expList;
+    }
+
+} // class ResumeTest
\ No newline at end of file
diff --git a/src/test/beast/beast2vs1/TaxonOrderTest.java b/src/test/beast/beast2vs1/TaxonOrderTest.java
new file mode 100644
index 0000000..4da0adb
--- /dev/null
+++ b/src/test/beast/beast2vs1/TaxonOrderTest.java
@@ -0,0 +1,71 @@
+package test.beast.beast2vs1;
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+import test.beast.beast2vs1.trace.Expectation;
+
+public class TaxonOrderTest extends TestFramework {
+
+    private final String[] XML_FILES = new String[]{"testStarBeast2.xml"};
+
+    public void testStarBeast() throws Exception {
+        analyse(0);
+    }
+
+    @Override
+    protected void setUp() throws Exception {
+    	checkESS = false;
+        super.setUp(XML_FILES);
+    }
+
+    protected List<Expectation> giveExpectations(int index_XML) throws Exception {
+        List<Expectation> expList = new ArrayList<Expectation>();
+
+        // all values below are from BEAST2/examples/testStarBeast.xml
+        switch (index_XML) {
+            case 0: // testStarBeast2.xml
+                addExpIntoList(expList, "posterior",-2200.5722,0.6459);
+                addExpIntoList(expList, "prior",312.7396,0.6466);
+                addExpIntoList(expList, "speciesCoalescent",287.4159,0.7055);
+                addExpIntoList(expList, "SpeciesTreePopSizePrior",70.6397,0.5031);
+                addExpIntoList(expList, "tree.prior.26",106.1954,0.2071);
+                addExpIntoList(expList, "tree.prior.29",110.5808,0.2108);
+                addExpIntoList(expList, "SpeciesTreeDivergenceTimesPrior",29.5124,0.1372);
+                addExpIntoList(expList, "likelihood",-2513.3118,0.1979);
+                addExpIntoList(expList, "popMean",0.0019843,0.00007611);
+                addExpIntoList(expList, "birthRate",213.1348,4.9152);
+                addExpIntoList(expList, "hky.kappa26",4.4936,0.0744);
+                addExpIntoList(expList, "hky.kappa29",4.0749,0.0588);
+                /*
+                addExpIntoList(expList, "popSize1",0.0040487,0.00027109);
+                addExpIntoList(expList, "popSize2",0.0062535,0.00026144);
+                addExpIntoList(expList, "popSize3",0.0023299,0.00015953);
+                addExpIntoList(expList, "popSize4",0.0029275,0.00023455);
+                addExpIntoList(expList, "popSize5",0.0021888,0.00022018);
+                addExpIntoList(expList, "popSize6",0.0042746,0.00018535);
+                addExpIntoList(expList, "popSize7",0.004097,0.00035926);
+                addExpIntoList(expList, "popSize8",0.0041803,0.00022475);
+                addExpIntoList(expList, "popSize9",0.0036424,0.00016521);
+                addExpIntoList(expList, "popSize10",0.0037575,0.00032465);
+                addExpIntoList(expList, "popSize11",0.0035904,0.00017545);
+                addExpIntoList(expList, "popSize12",0.0036104,0.00020949);
+                addExpIntoList(expList, "popSize13",0.0040485,0.00019889);
+                addExpIntoList(expList, "popSize14",0.0035229,0.00017978);
+                addExpIntoList(expList, "popSize15",0.005072,0.00017682);
+                */
+                addExpIntoList(expList, "TreeHeightSP",0.0118,0.00025562);
+                addExpIntoList(expList, "TreeHeight26",0.0266,0.00010397);
+                addExpIntoList(expList, "TreeHeight29",0.0224,0.000077373);                
+                break;
+
+            default:
+                throw new Exception("No such XML");
+        }
+
+        return expList;
+    }
+
+
+} // class TaxonOrderTest
\ No newline at end of file
diff --git a/src/test/beast/beast2vs1/TestFramework.java b/src/test/beast/beast2vs1/TestFramework.java
new file mode 100644
index 0000000..560cb65
--- /dev/null
+++ b/src/test/beast/beast2vs1/TestFramework.java
@@ -0,0 +1,86 @@
+package test.beast.beast2vs1;
+
+import junit.framework.TestCase;
+
+import java.io.File;
+import java.util.List;
+
+import beagle.BeagleFlag;
+import beast.core.Logger;
+import beast.util.Randomizer;
+import beast.util.XMLParser;
+import test.beast.beast2vs1.trace.Expectation;
+import test.beast.beast2vs1.trace.LogAnalyser;
+
+public abstract class TestFramework extends TestCase {
+    protected static long SEED = 128;
+    private String[] xmls;
+
+    protected abstract List<Expectation> giveExpectations(int index_XML) throws Exception;
+
+    public String sDir;
+    public String sLogDir;
+    public String testFile = "/test.";
+    public boolean useSeed = true;
+    public boolean checkESS = true;
+    
+    public TestFramework() {
+    	sDir = System.getProperty("user.dir") + "/examples/beast2vs1/";
+    	sLogDir = System.getProperty("user.dir");
+    }
+    
+    protected void setUp(String[] xmls) { // throws Exception {
+        this.xmls = new String[xmls.length];
+        for (int i = 0; i < xmls.length; i++) {
+            this.xmls[i] = xmls[i];
+        }
+    }
+//    protected abstract void analyse() throws Exception;
+
+    public void analyse(int index_XML) throws Exception {
+//        for (int i = 0; i < xmls.length; i++) {
+//            if (giveExpectations(i).size() > 0) {
+        Randomizer.setSeed(SEED);
+        Logger.FILE_MODE = Logger.LogFileMode.overwrite;
+        
+        long beagleFlags = BeagleFlag.PROCESSOR_CPU.getMask() | BeagleFlag.VECTOR_SSE.getMask();
+        System.setProperty("beagle.preferred.flags", Long.toString(beagleFlags));
+
+
+        String sFileName = sDir + xmls[index_XML];
+
+        System.out.println("Processing " + sFileName);
+        XMLParser parser = new XMLParser();
+        beast.core.Runnable runable = parser.parseFile(new File(sFileName));
+        runable.setStateFile("tmp.state", false);
+//		   runable.setInputValue("preBurnin", 0);
+//		   runable.setInputValue("chainLength", 1000);
+        runable.run();
+
+        String logFile = sLogDir + testFile + (useSeed ? SEED : "") + ".log";
+        System.out.println("\nAnalysing log " + logFile);
+        LogAnalyser logAnalyser = new LogAnalyser(logFile, giveExpectations(index_XML)); // burnIn = 0.1 * maxState
+
+        for (Expectation expectation : logAnalyser.m_pExpectations.get()) {
+            TestCase.assertTrue(xmls[index_XML] + ": Expected " + expectation.traceName.get() + " delta mean: "
+                    + expectation.expValue.get() + " - " + expectation.getTraceStatistics().getMean()
+                    + " <= delta stdErr: 2*(" + expectation.getStdError() + " + "
+                    + expectation.getTraceStatistics().getStdErrorOfMean() + ")", expectation.isPassed());
+
+            if (checkESS)
+            	TestCase.assertTrue(xmls[index_XML] + ":  has very low effective sample sizes (ESS) "
+                    + expectation.getTraceStatistics().getESS(), expectation.isValid());
+        }
+
+        System.out.println("\nSucceed " + sFileName);
+        System.out.println("\n***************************************\n");
+//            }
+//        }
+    }
+
+    protected void addExpIntoList(List<Expectation> expList, String traceName, Double expValue, Double stdError) throws Exception {
+        Expectation exp = new Expectation(traceName, expValue, stdError);
+        expList.add(exp);
+    }
+
+}
\ No newline at end of file
diff --git a/src/test/beast/beast2vs1/TipTimeTest.java b/src/test/beast/beast2vs1/TipTimeTest.java
new file mode 100644
index 0000000..4f332cc
--- /dev/null
+++ b/src/test/beast/beast2vs1/TipTimeTest.java
@@ -0,0 +1,114 @@
+package test.beast.beast2vs1;
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+import test.beast.beast2vs1.trace.Expectation;
+
+/**
+ * @author Walter Xie
+ */
+public class TipTimeTest extends TestFramework {
+    private final String[] XML_FILES = new String[]{"testCoalescentTipDates.xml", "testCoalescentTipDates1.xml",
+            "testStrictClockTipTime.xml", "testCoalescentTipDatesSampling.xml", "testStrictClockTipDatesSampling.xml"};//, "testTipDates.xml"};
+
+    public void testCoalescentTipDates() throws Exception {
+        analyse(0);
+    }
+
+    public void testCoalescentTipDates1() throws Exception {
+        analyse(1);
+    }
+
+    public void testStrictClockTipTime() throws Exception {
+        analyse(2);
+    }
+
+    public void testCoalescentTipDatesSampling() throws Exception {
+        analyse(3);
+    }
+
+    public void testStrictClockTipDatesSampling() throws Exception {
+        analyse(4);
+    }
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp(XML_FILES);
+    }
+
+    protected List<Expectation> giveExpectations(int index_XML) throws Exception {
+        List<Expectation> expList = new ArrayList<Expectation>();
+
+        // all values below are from BEAST 1.6.2
+        switch (index_XML) {
+            case 0: // testCoalescentTipDates.xml
+//        BEAST 1 testCoalescent.xml
+                addExpIntoList(expList, "tree.height", 19361.1519, 66.3224);
+                addExpIntoList(expList, "popSize", 10000.0, 0.0);
+                addExpIntoList(expList, "coalescent", -30.6263, 1.2747E-2);
+                break;
+
+            case 1: // testCoalescentTipDates1.xml
+//        BEAST 1 testCoalescent.xml
+                addExpIntoList(expList, "tree.height", 15000.0, 70.0);
+                addExpIntoList(expList, "coalescent", -30.6163, 1.3415E-2);
+                break;
+
+            case 2: // testStrictClockTipTime.xml
+//        BEAST 1 testStrictClockTipTime.xml
+                addExpIntoList(expList, "posterior", -3935.6436, 6.9703E-2);
+                addExpIntoList(expList, "prior", -84.8353, 3.9182E-2);
+                addExpIntoList(expList, "tree.height", 68.2541, 8.7152E-2);
+                addExpIntoList(expList, "popSize", 33.9172, 0.1266);
+                addExpIntoList(expList, "hky.kappa", 17.2562, 7.7984E-2);
+                addExpIntoList(expList, "hky.frequencies1", 0.2838, 4.3904E-4);
+                addExpIntoList(expList, "hky.frequencies2", 0.2116, 3.8223E-4);
+                addExpIntoList(expList, "hky.frequencies3", 0.2516, 4.0877E-4);
+                addExpIntoList(expList, "hky.frequencies4", 0.253, 4.1631E-4);
+                addExpIntoList(expList, "clockRate", 8.1277E-4, 1.405E-6);
+                addExpIntoList(expList, "treeLikelihood", -3850.8083, 6.0429E-2);
+                addExpIntoList(expList, "coalescent", -71.6925, 3.5705E-2);
+                break;
+
+            case 3: // testCoalescentTipDatesSampling.xml
+                addExpIntoList(expList, "coalescent", -41.4962, 1.6251E-4);
+                addExpIntoList(expList, "mrcatime(TaxonSetAll)", 20000.0, 8.9215E-2); // root height.
+                addExpIntoList(expList, "tree.height", 15000.0, 8.9215E-2); // tree height.
+                addExpIntoList(expList, "height(A)", 5000.0, 0.01);
+                addExpIntoList(expList, "height(B)", 5000.0, 0.01);
+                break;
+
+            case 4: // testStrictClockTipDatesSampling.xml
+//        BEAST 1 testStrictClockTipDatesSampling.xml
+//                addExpIntoList(expList, "posterior", -4490.0503, 0.221);
+//                addExpIntoList(expList, "prior", -70.0423, 0.2051);
+                addExpIntoList(expList, "tree.height", 10.848, 5.6709E-2);
+                addExpIntoList(expList, "popSize", 9.4786, 0.1178);
+                addExpIntoList(expList, "hky.kappa", 8.906, 4.4495E-2);
+                addExpIntoList(expList, "hky.frequencies1", 0.3433, 4.5468E-4);
+                addExpIntoList(expList, "hky.frequencies2", 0.1857, 3.3512E-4);
+                addExpIntoList(expList, "hky.frequencies3", 0.2229, 4.1666E-4);
+                addExpIntoList(expList, "hky.frequencies4", 0.2481, 4.3418E-4);
+                addExpIntoList(expList, "clockRate", 3.6834E-3, 2.8931E-5);
+//                addExpIntoList(expList, "height(TREESPARROW_HENAN_1_2004)", 2005 - 1.502, 2.8594E-2);
+                addExpIntoList(expList, "height(CHICKEN_HONGKONG_915_1997)", 2005 - 8.1493, 1.0676E-2);
+                addExpIntoList(expList, "treeLikelihood", -4420.008, 0.1455);
+                addExpIntoList(expList, "coalescent", -64.0766, 0.1959);
+                break;
+
+//            case 8: // testTipDates.xml
+//                addExpIntoList(expList, "treeLikelihood", -15000.435271635279);
+//                addExpIntoList(expList, "tree.height", 38.6109296447932);
+//                addExpIntoList(expList, "hky.kappa", 2179.425239015365);
+//                break;
+            default:
+                throw new Exception("No such XML");
+        }
+
+        return expList;
+    }
+
+
+} // class ResumeTest
\ No newline at end of file
diff --git a/src/test/beast/beast2vs1/TreePriorTest.java b/src/test/beast/beast2vs1/TreePriorTest.java
new file mode 100644
index 0000000..3c37d34
--- /dev/null
+++ b/src/test/beast/beast2vs1/TreePriorTest.java
@@ -0,0 +1,201 @@
+package test.beast.beast2vs1;
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+import test.beast.beast2vs1.trace.Expectation;
+
+/**
+ * @author Walter Xie
+ */
+public class TreePriorTest extends TestFramework {
+    private final String[] XML_FILES = new String[]{"testCoalescentNoClock.xml", "testCoalescentNoClock1.xml",
+            "testExponentialGrowth.xml", "testYuleModel_10taxa.xml", "testBirthDeathModel_10taxa.xml",
+            "testBirthDeathAsYule.xml", "testBSP1.xml", "testBSPNoClock.xml", "testEBSP.xml"};
+
+    public void testCoalescentNoClock() throws Exception {
+        analyse(0);
+    }
+
+    public void testCoalescentNoClock1() throws Exception {
+        analyse(1);
+    }
+
+    public void testExponentialGrowth() throws Exception {
+        analyse(2);
+    }
+
+    public void testYuleModel_10taxa() throws Exception {
+        analyse(3);
+    }
+
+    public void testBirthDeathModel_10taxa() throws Exception {
+        analyse(4);
+    }
+
+    public void testBirthDeathAsYule() throws Exception {
+        analyse(5);
+    }
+
+    public void testBSP() throws Exception {
+        analyse(6);
+    }
+
+    public void testBSPNoClock() throws Exception {
+        analyse(7);
+    }
+
+    public void testEBSP() throws Exception {
+        analyse(8);
+    }
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp(XML_FILES);
+    }
+
+    protected List<Expectation> giveExpectations(int index_XML) throws Exception {
+        List<Expectation> expList = new ArrayList<Expectation>();
+
+        // all values below are from BEAST 1.7
+        switch (index_XML) {
+            case 0: // testCoalescentNoClock.xml
+//        BEAST 1 testCoalescentNoClock.xml
+                addExpIntoList(expList, "posterior", -1813.059, 0.0569);
+                addExpIntoList(expList, "prior", 3.705, 0.025);
+                addExpIntoList(expList, "tree.height", 0.06318, 6.73E-05);
+                addExpIntoList(expList, "popSize", 0.0979, 6.38E-04);
+                addExpIntoList(expList, "hky.kappa", 26.262, 0.2217);
+                addExpIntoList(expList, "hky.frequencies1", 0.326, 6.04E-04);
+                addExpIntoList(expList, "hky.frequencies2", 0.258, 5.23E-04);
+                addExpIntoList(expList, "hky.frequencies3", 0.155, 4.03E-04);
+                addExpIntoList(expList, "hky.frequencies4", 0.261, 5.64E-04);
+                addExpIntoList(expList, "treeLikelihood", -1816.764, 0.0556);
+                addExpIntoList(expList, "coalescent", 7.242, 9.94E-03);
+                break;
+
+            case 1: // testCoalescentNoClock1.xml
+//        BEAST 1 testCoalescentNoClock1.xml
+                addExpIntoList(expList, "posterior", -1809.75, 5.96E-02);
+                addExpIntoList(expList, "tree.height", 6.35E-02, 6.61E-05);
+                addExpIntoList(expList, "popSize", 0.132, 0.2987);
+                addExpIntoList(expList, "hky.kappa", 33.139, 0.1812);
+                addExpIntoList(expList, "hky.frequencies1", 0.326, 5.70E-04);
+                addExpIntoList(expList, "hky.frequencies2", 0.257, 6.15E-04);
+                addExpIntoList(expList, "hky.frequencies3", 0.154, 4.17E-04);
+                addExpIntoList(expList, "hky.frequencies4", 0.262, 4.91E-04);
+                addExpIntoList(expList, "treeLikelihood", -1816.698, 5.82E-02);
+                addExpIntoList(expList, "coalescent", 6.948, 1.24E-02);
+                break;
+
+            case 2: // testExponentialGrowth.xml
+//        BEAST 1 testExponentialGrowthNoClock1.xml
+                addExpIntoList(expList, "posterior", -1818.4448, 6.3697E-2);
+                addExpIntoList(expList, "prior", -1.726, 3.6124E-2);
+                addExpIntoList(expList, "tree.height", 6.1545E-2, 6.6865E-5);
+                addExpIntoList(expList, "popSize", 1.0231, 5.1484E-2);
+                addExpIntoList(expList, "growthRate", 58.5276, 0.6012);
+                addExpIntoList(expList, "hky.kappa", 26.301, 0.211);
+                addExpIntoList(expList, "hky.frequencies1", 0.3266, 5.9862E-4);
+                addExpIntoList(expList, "hky.frequencies2", 0.2569, 5.3533E-4);
+                addExpIntoList(expList, "hky.frequencies3", 0.154, 4.0839E-4);
+                addExpIntoList(expList, "hky.frequencies4", 0.2625, 5.7627E-4);
+                addExpIntoList(expList, "treeLikelihood", -1816.7188, 4.9732E-2);
+                addExpIntoList(expList, "coalescent", 9.4203, 1.31E-2);
+                break;
+
+            case 3: // testYuleModel_10taxa.xml
+//        BEAST 1 testYuleModel_10taxa.xml
+                addExpIntoList(expList, "yule", -2.8068, 3.894E-2); // speciationLikelihood
+                addExpIntoList(expList, "tree.height", 0.9702, 4.2554E-3);
+                break;
+
+            case 4: // testBirthDeathModel_10taxa.xml
+//        BEAST 1 testBirthDeathModel_10taxa.xml
+                addExpIntoList(expList, "birthDeath", 0.981, 4.9536E-2); // speciationLikelihood
+                addExpIntoList(expList, "tree.height", 0.7017, 3.9048E-3);
+                break;
+
+            case 5: // testBirthDeathAsYule.xml
+//        BEAST 1 testBirthDeathAsYule.xml
+                addExpIntoList(expList, "posterior", -84.941, 2.3521E-2);
+                addExpIntoList(expList, "birthDeath", -84.7945, 2.3471E-2); // speciationLikelihood
+                addExpIntoList(expList, "birthRate", 1.1636, 3.8458E-3);
+                break;
+
+            case 6: // testBSP1.xml
+//        BEAST 1 testBSP1.xml
+                addExpIntoList(expList, "posterior", -3865.3635, 8.2236E-2);
+                addExpIntoList(expList, "prior", -92.178, 7.5174E-2);
+                addExpIntoList(expList, "siteModel.alpha", 5.4354E-2, 5.2519E-4);
+                addExpIntoList(expList, "clock.rate", 9.4858E-4, 1.9706E-6);
+                addExpIntoList(expList, "skyline.popSize1", 67.8827, 2.2639);
+                addExpIntoList(expList, "skyline.popSize2", 25.4281, 0.3165);
+                addExpIntoList(expList, "skyline.popSize3", 31.9271, 0.3819);
+                addExpIntoList(expList, "skyline.popSize4", 41.6596, 0.3976);
+                addExpIntoList(expList, "skyline.popSize5", 33.5967, 0.3554);
+                addExpIntoList(expList, "skyline.groupSize1", 2.4686, 4.0465E-2); 
+                addExpIntoList(expList, "skyline.groupSize2", 3.3671, 3.9454E-2); 
+                addExpIntoList(expList, "skyline.groupSize3", 3.181, 3.3807E-2); // TODO diff bigger than 2*delta
+                addExpIntoList(expList, "skyline.groupSize4", 3.723, 5.0187E-2);
+                addExpIntoList(expList, "skyline.groupSize5", 3.2603, 5.9824E-2);
+                addExpIntoList(expList, "hky.kappa", 21.6911, 5.2142E-2);
+                addExpIntoList(expList, "treeModel.rootHeight", 70.3393, 0.1057);
+                addExpIntoList(expList, "likelihood", -3773.1854, 3.9474E-2);
+                addExpIntoList(expList, "skyline", -69.725, 5.435E-2);
+                addExpIntoList(expList, "eml1", -22.453, 3.1115E-2);
+                break;
+
+            case 7: // testBSPNoClock.xml
+//        BEAST 1 testBSPNoClock.xml
+                addExpIntoList(expList, "posterior", -1809.8121, 7.6417E-2);
+                addExpIntoList(expList, "prior", 7.0426, 3.7042E-2);
+                addExpIntoList(expList, "tree.height", 6.2187E-2, 6.4148E-5);
+                addExpIntoList(expList, "popSizes1", 0.2084, 4.4215E-3);
+                addExpIntoList(expList, "popSizes2", 0.1012, 1.1132E-3);
+                addExpIntoList(expList, "popSizes3", 5.0552E-2, 7.8572E-4);
+                addExpIntoList(expList, "groupSizes1", 1.7396, 8.2581E-3);
+                //addExpIntoList(expList, "groupSizes2", 1.78, 8.3052E-3); // TODO diff bigger than 2*delta
+                addExpIntoList(expList, "groupSizes3", 1.4804, 7.7151E-3);
+                addExpIntoList(expList, "hky.kappa", 26.0187, 0.2286);
+                addExpIntoList(expList, "hky.frequencies1", 0.3262, 7.0596E-4);
+                addExpIntoList(expList, "hky.frequencies2", 0.2571, 5.876E-4);
+                addExpIntoList(expList, "hky.frequencies3", 0.1546, 4.8206E-4);
+                addExpIntoList(expList, "hky.frequencies4", 0.262, 5.9621E-4);
+                addExpIntoList(expList, "treeLikelihood", -1816.8547, 6.3527E-2);
+                addExpIntoList(expList, "skyline", 7.9513, 1.6384E-2);
+                addExpIntoList(expList, "eml1", 5.059, 2.1669E-2);
+                break;
+
+            case 8: // testEBSP.xml
+//        BEAST 1 testEBSP.xml
+                addExpIntoList(expList, "posterior", -1826.2014, 0.1562);
+                addExpIntoList(expList, "prior", -9.4517, 0.1782);
+                addExpIntoList(expList, "tree.height", 6.3528E-2, 7.0709E-5);
+                addExpIntoList(expList, "popSizes1", 2435.0409, 132.4556);
+                addExpIntoList(expList, "popSizes2", 2195.7116, 156.2106);
+                addExpIntoList(expList, "popSizes3", 1065.3511, 119.8768);
+                addExpIntoList(expList, "indicators", 1.3275, 2.1211E-2);
+                addExpIntoList(expList, "indicators", 1.5219, 2.9634E-2);
+                addExpIntoList(expList, "indicators", 2.1505, 3.8185E-2);
+                addExpIntoList(expList, "hky.kappa", 26.4814, 0.2725);
+                addExpIntoList(expList, "hky.frequencies1", 0.3252, 7.7972E-4);
+                addExpIntoList(expList, "hky.frequencies2", 0.2581, 5.685E-4);
+                addExpIntoList(expList, "hky.frequencies3", 0.1553, 4.3071E-4);
+                addExpIntoList(expList, "hky.frequencies4", 0.2614, 6.1733E-4);
+                addExpIntoList(expList, "treeLikelihood", -1816.7497, 5.4764E-2);
+                // this is clearly bunk (negative value for a positive parameter)
+                addExpIntoList(expList, "populationMean", -3.4472, 0.1802);
+                break;
+
+
+            default:
+                throw new Exception("No such XML");
+        }
+
+        return expList;
+    }
+
+
+} // class ResumeTest
\ No newline at end of file
diff --git a/src/test/beast/beast2vs1/TreeTest.java b/src/test/beast/beast2vs1/TreeTest.java
new file mode 100644
index 0000000..bd0e4de
--- /dev/null
+++ b/src/test/beast/beast2vs1/TreeTest.java
@@ -0,0 +1,73 @@
+package test.beast.beast2vs1;
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+import test.beast.beast2vs1.trace.Expectation;
+
+/**
+ * @author Walter Xie
+ */
+public class TreeTest extends TestFramework {
+
+    String[] XML_FILES = new String[]{"testCalibration.xml", "testCalibrationMono.xml"};
+
+    public void testCalibration() throws Exception {
+        analyse(0);
+    }
+
+    public void testCalibrationMono() throws Exception {
+        analyse(1);
+    }
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp(XML_FILES);
+    }
+
+    protected List<Expectation> giveExpectations(int index_XML) throws Exception {
+        List<Expectation> expList = new ArrayList<Expectation>();
+
+        // all values below are from BEAST 1.7
+        switch (index_XML) {
+            case 0: // testCalibration.xml
+//        BEAST 1 testCalibration.xml
+                addExpIntoList(expList, "posterior", -1884.6966, 6.3796E-2);
+                addExpIntoList(expList, "prior", -68.0023, 2.114E-2);
+                addExpIntoList(expList, "tree.height", 6.3129E-2, 6.5853E-5);
+                addExpIntoList(expList, "mrcatime(human,chimp)", 2.0326E-2, 3.5906E-5);
+                addExpIntoList(expList, "popSize", 9.7862E-2, 6.2387E-4);
+                addExpIntoList(expList, "hky.kappa", 25.8288, 0.1962);
+                addExpIntoList(expList, "hky.frequencies1", 0.3262, 5.9501E-4);
+                addExpIntoList(expList, "hky.frequencies2", 0.2569, 5.0647E-4);
+                addExpIntoList(expList, "hky.frequencies3", 0.1552, 4.4638E-4);
+                addExpIntoList(expList, "hky.frequencies4", 0.2617, 5.1085E-4);
+                addExpIntoList(expList, "likelihood", -1816.6943, 5.8444E-2);
+                addExpIntoList(expList, "coalescent", 7.2378, 9.1912E-3);
+                break;
+
+            case 1: // testCalibrationMono.xml
+//        BEAST 1 testCalibrationMono.xml
+                addExpIntoList(expList, "posterior", -1897.3811, 6.5818E-2);
+                addExpIntoList(expList, "prior", -68.6144, 1.9896E-2);
+                addExpIntoList(expList, "tree.height", 6.3258E-2, 6.7751E-5);
+                addExpIntoList(expList, "mrcatime(human,chimp)", 1.7069E-2, 3.3455E-5);
+                addExpIntoList(expList, "popSize", 0.1049, 6.4588E-4);
+                addExpIntoList(expList, "hky.kappa", 26.7792, 0.1851);
+                addExpIntoList(expList, "hky.frequencies1", 0.328, 7.1121E-4);
+                addExpIntoList(expList, "hky.frequencies2", 0.2573, 5.4356E-4);
+                addExpIntoList(expList, "hky.frequencies3", 0.1548, 4.2604E-4);
+                addExpIntoList(expList, "hky.frequencies4", 0.2599, 6.0174E-4);
+                addExpIntoList(expList, "likelihood", -1828.7667, 6.527E-2);
+                addExpIntoList(expList, "coalescent", 6.864, 9.7699E-3);
+                break;
+
+            default:
+                throw new Exception("No such XML");
+        }
+
+        return expList;
+    }
+
+} // class ResumeTest
\ No newline at end of file
diff --git a/src/test/beast/beast2vs1/trace/DiscreteStatistics.java b/src/test/beast/beast2vs1/trace/DiscreteStatistics.java
new file mode 100644
index 0000000..56c2509
--- /dev/null
+++ b/src/test/beast/beast2vs1/trace/DiscreteStatistics.java
@@ -0,0 +1,394 @@
+/*
+ * DiscreteStatistics.java
+ *
+ * Copyright (C) 2002-2006 Alexei Drummond and Andrew Rambaut
+ *
+ * This file is part of BEAST.
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership and licensing.
+ *
+ * BEAST 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
+ * of the License, or (at your option) any later version.
+ *
+ *  BEAST 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 BEAST; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+package test.beast.beast2vs1.trace;
+
+import beast.util.HeapSort;
+
+/**
+ * simple discrete statistics (mean, variance, cumulative probability, quantiles etc.)
+ *
+ * @author Korbinian Strimmer
+ * @author Alexei Drummond
+ * @version $Id: DiscreteStatistics.java,v 1.11 2006/07/02 21:14:53 rambaut Exp $
+ */
+public class DiscreteStatistics {
+    /**
+     * compute mean
+     *
+     * @param x list of numbers
+     * @return mean
+     */
+    public static double mean(double[] x) {
+        double m = 0;
+        int count = x.length;
+        for (double aX : x) {
+            if (Double.isNaN(aX)) {
+                count--;
+            } else {
+                m += aX;
+            }
+        }
+
+        return m / (double) count;
+    }
+
+    /**
+     * compute median
+     *
+     * @param x       list of numbers
+     * @param indices index sorting x
+     * @return median
+     */
+    public static double median(double[] x, int[] indices) {
+
+        int pos = x.length / 2;
+        if (x.length % 2 == 1) {
+            return x[indices[pos]];
+        } else {
+            return (x[indices[pos - 1]] + x[indices[pos]]) / 2.0;
+        }
+    }
+
+    /**
+     * compute the mean squared error
+     *
+     * @param x         list of numbers
+     * @param trueValue truth
+     * @return MSE
+     */
+
+    public static double meanSquaredError(double[] x, double trueValue) {
+
+        if (x == null || x.length == 0) {
+            throw new IllegalArgumentException();
+        }
+
+        double total = 0;
+        for (double sample : x) {
+            total += (sample - trueValue) * (sample - trueValue);
+        }
+        total /= x.length;
+        return total;
+    }
+
+    /**
+     * compute median
+     *
+     * @param x list of numbers
+     * @return median
+     */
+    public static double median(double[] x) {
+
+        if (x == null || x.length == 0) {
+            throw new IllegalArgumentException();
+        }
+
+        int[] indices = new int[x.length];
+        HeapSort.sort(x, indices);
+
+        return median(x, indices);
+    }
+
+
+    /**
+     * compute variance (ML estimator)
+     *
+     * @param x    list of numbers
+     * @param mean assumed mean of x
+     * @return variance of x (ML estimator)
+     */
+    public static double variance(double[] x, double mean) {
+        double var = 0;
+        int count = x.length;
+        for (double aX : x) {
+            if (Double.isNaN(aX)) {
+                count--;
+            } else {
+                double diff = aX - mean;
+                var += diff * diff;
+            }
+        }
+
+        if (count < 2) {
+            count = 1; // to avoid division by zero
+        } else {
+            count = count - 1; // for ML estimate
+        }
+
+        return var / (double) count;
+    }
+
+
+    /**
+     * compute covariance
+     *
+     * @param x list of numbers
+     * @param y list of numbers
+     * @return covariance of x and y
+     */
+    @SuppressWarnings({"SuspiciousNameCombination"})
+    public static double covariance(double[] x, double[] y) {
+
+        return covariance(x, y, mean(x), mean(y), stdev(x), stdev(y));
+    }
+
+    /**
+     * compute covariance
+     *
+     * @param x      list of numbers
+     * @param y      list of numbers
+     * @param xmean  assumed mean of x
+     * @param ymean  assumed mean of y
+     * @param xstdev assumed stdev of x
+     * @param ystdev assumed stdev of y
+     * @return covariance of x and y
+     */
+    public static double covariance(double[] x, double[] y, double xmean, double ymean, double xstdev, double ystdev) {
+
+        if (x.length != y.length) throw new IllegalArgumentException("x and y arrays must be same length!");
+
+        int count = x.length;
+        double covar = 0.0;
+        for (int i = 0; i < x.length; i++) {
+            if (Double.isNaN(x[i]) || Double.isNaN(y[i])) {
+                count--;
+            } else {
+                covar += (x[i] - xmean) * (y[i] - ymean);
+            }
+        }
+        covar /= count;
+        covar /= (xstdev * ystdev);
+        return covar;
+    }
+
+    /**
+     * compute fisher skewness
+     *
+     * @param x list of numbers
+     * @return skewness of x
+     */
+    public static double skewness(double[] x) {
+
+        double mean = mean(x);
+        double stdev = stdev(x);
+        double skew = 0.0;
+        double len = x.length;
+
+        for (double xv : x) {
+            double diff = xv - mean;
+            diff /= stdev;
+
+            skew += (diff * diff * diff);
+        }
+
+        skew *= (len / ((len - 1) * (len - 2)));
+
+        return skew;
+    }
+
+    /**
+     * compute standard deviation
+     *
+     * @param x list of numbers
+     * @return standard deviation of x
+     */
+    public static double stdev(double[] x) {
+        return Math.sqrt(variance(x));
+    }
+
+    /**
+     * compute variance (ML estimator)
+     *
+     * @param x list of numbers
+     * @return variance of x (ML estimator)
+     */
+    public static double variance(double[] x) {
+        final double m = mean(x);
+        return variance(x, m);
+    }
+
+
+    /**
+     * compute variance of sample mean (ML estimator)
+     *
+     * @param x    list of numbers
+     * @param mean assumed mean of x
+     * @return variance of x (ML estimator)
+     */
+    public static double varianceSampleMean(double[] x, double mean) {
+        return variance(x, mean) / (double) x.length;
+    }
+
+    /**
+     * compute variance of sample mean (ML estimator)
+     *
+     * @param x list of numbers
+     * @return variance of x (ML estimator)
+     */
+    public static double varianceSampleMean(double[] x) {
+        return variance(x) / (double) x.length;
+    }
+
+
+    /**
+     * compute the q-th quantile for a distribution of x
+     * (= inverse cdf)
+     *
+     * @param q       quantile (0 < q <= 1)
+     * @param x       discrete distribution (an unordered list of numbers)
+     * @param indices index sorting x
+     * @return q-th quantile
+     */
+    public static double quantile(double q, double[] x, int[] indices) {
+        if (q < 0.0 || q > 1.0) throw new IllegalArgumentException("Quantile out of range");
+
+        if (q == 0.0) {
+            // for q==0 we have to "invent" an entry smaller than the smallest x
+
+            return x[indices[0]] - 1.0;
+        }
+
+        return x[indices[(int) Math.ceil(q * indices.length) - 1]];
+    }
+
+    /**
+     * compute the q-th quantile for a distribution of x
+     * (= inverse cdf)
+     *
+     * @param q quantile (0 <= q <= 1)
+     * @param x discrete distribution (an unordered list of numbers)
+     * @return q-th quantile
+     */
+    public static double quantile(double q, double[] x) {
+        int[] indices = new int[x.length];
+        HeapSort.sort(x, indices);
+
+        return quantile(q, x, indices);
+    }
+
+    /**
+     * compute the q-th quantile for a distribution of x
+     * (= inverse cdf)
+     *
+     * @param q     quantile (0 <= q <= 1)
+     * @param x     discrete distribution (an unordered list of numbers)
+     * @param count use only first count entries in x
+     * @return q-th quantile
+     */
+    public static double quantile(double q, double[] x, int count) {
+        int[] indices = new int[count];
+        HeapSort.sort(x, indices);
+
+        return quantile(q, x, indices);
+    }
+
+    /**
+     * Determine the highest posterior density for a list of values.
+     * The HPD is the smallest interval containing the required amount of elements.
+     *
+     * @param proportion of elements inside the interval
+     * @param x          values
+     * @param indices    index sorting x
+     * @return the interval, an array of {low, high} values.
+     */
+    public static double[] HPDInterval(double proportion, double[] x, int[] indices) {
+
+        double minRange = Double.MAX_VALUE;
+        int hpdIndex = 0;
+
+        final int diff = (int) Math.round(proportion * (double) x.length);
+        for (int i = 0; i <= (x.length - diff); i++) {
+            final double minValue = x[indices[i]];
+            final double maxValue = x[indices[i + diff - 1]];
+            final double range = Math.abs(maxValue - minValue);
+            if (range < minRange) {
+                minRange = range;
+                hpdIndex = i;
+            }
+        }
+
+        return new double[]{x[indices[hpdIndex]], x[indices[hpdIndex + diff - 1]]};
+    }
+
+    /**
+     * compute the cumulative probability Pr(x <= z) for a given z
+     * and a distribution of x
+     *
+     * @param z       threshold value
+     * @param x       discrete distribution (an unordered list of numbers)
+     * @param indices index sorting x
+     * @return cumulative probability
+     */
+    public static double cdf(double z, double[] x, int[] indices) {
+        int i;
+        for (i = 0; i < x.length; i++) {
+            if (x[indices[i]] > z) break;
+        }
+
+        return (double) i / (double) x.length;
+    }
+
+    /**
+     * compute the cumulative probability Pr(x <= z) for a given z
+     * and a distribution of x
+     *
+     * @param z threshold value
+     * @param x discrete distribution (an unordered list of numbers)
+     * @return cumulative probability
+     */
+    public static double cdf(double z, double[] x) {
+        int[] indices = new int[x.length];
+        HeapSort.sort(x, indices);
+
+        return cdf(z, x, indices);
+    }
+
+    public static double max(double[] x) {
+        double max = x[0];
+        for (int i = 1; i < x.length; i++) {
+            if (x[i] > max) max = x[i];
+        }
+        return max;
+    }
+
+    public static double min(double[] x) {
+        double min = x[0];
+        for (int i = 1; i < x.length; i++) {
+            if (x[i] < min) min = x[i];
+        }
+        return min;
+    }
+
+    public static double geometricMean(double[] x) {
+        double gm = 0;
+        int len = x.length;
+        for (int i = 0; i < len; i++) {
+            gm += Math.log(x[i]);
+        }
+
+        return Math.exp(gm / (double) len);
+    }
+}
diff --git a/src/test/beast/beast2vs1/trace/Expectation.java b/src/test/beast/beast2vs1/trace/Expectation.java
new file mode 100644
index 0000000..5d4a885
--- /dev/null
+++ b/src/test/beast/beast2vs1/trace/Expectation.java
@@ -0,0 +1,95 @@
+package test.beast.beast2vs1.trace;
+
+import beast.core.Citation;
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.BEASTObject;
+import beast.core.Input.Validate;
+
+
+ at Description("It is used by LogAnalyser. assertExpectation(TraceStatistics) sets TraceStatistics instance " +
+        "passed from LogAnalyser.initAndValidate(), and determines whether expectation is significantly different " +
+        "to statisctial mean considering stand error of mean. If true, then set isPassed = false, which makes JUnit " +
+        "test assertion failed.")
+ at Citation("Created by Walter Xie")
+public class Expectation extends BEASTObject {
+
+    public Input<String> traceName = new Input<String>("traceName", "The trace name of a loggable plugin", Validate.REQUIRED);
+
+    public Input<Double> expValue =
+            new Input<Double>("expectedValue", "The expected value of the referred loggable plugin", Validate.REQUIRED);
+
+    public Input<Double> standErrorOfMean =
+            new Input<Double>("stdError", "The expected standard error of mean. If not given, it will estimate error from log",
+                    Validate.REQUIRED);
+
+    private boolean isPassed = true; // assert result
+    private boolean isValid = true; // assert ESS
+    private TraceStatistics trace;
+
+    // this constructor is used by Unit test
+    public Expectation(String traceName, Double expValue, Double stdError) throws Exception {
+        this.traceName.setValue(traceName, this);
+        this.expValue.setValue(expValue, this);
+        this.standErrorOfMean.setValue(stdError, this);
+    }
+
+    public boolean isPassed() {
+        return isPassed;
+    }
+
+//    public void setFailed(boolean failed) {
+//        isPassed = failed;
+//    }
+
+    public boolean isValid() {
+        return isValid;
+    }
+
+    public boolean assertExpectation(TraceStatistics trace, boolean displayStatistics) {
+        this.trace = trace;
+        double mean = trace.getMean();
+        double stderr = trace.getStdErrorOfMean();
+        double ess = trace.getESS();
+
+        double deltaMean = Math.abs(mean - expValue.get());
+        double deltaStdErr = Math.abs(2 * stderr + 2 * standErrorOfMean.get());
+
+        if (standErrorOfMean.get() == 0) {
+            isPassed = mean == expValue.get(); // used to check whether fixed value is fixed.
+        } else {
+            isPassed = deltaMean <= deltaStdErr;
+            isValid = ess > 100;
+        }
+
+        if (displayStatistics) {
+            System.out.println(traceName.get() + " : " + mean + " +- " + stderr + ", ESS = " + ess + ", expectation is "
+                    + expValue.get() + " +- " + standErrorOfMean.get());
+        }
+        return isPassed;
+    }
+
+    public TraceStatistics getTraceStatistics() {
+        return trace;
+    }
+
+    public double getStdError() {
+        return standErrorOfMean.get();
+//        double stderr = trace.getStdErrorOfMean();
+//        if (standErrorOfMean.get() != 0) {
+//            stderr = standErrorOfMean.get();
+////            System.out.println("User defines standard error of mean = " + stderr);
+//        }
+//        return stderr;
+    }
+
+    public String toString() {
+        return traceName.get() + " " + expValue.get();
+    }
+
+	@Override
+	public void initAndValidate() throws Exception {
+		// TODO Auto-generated method stub
+		
+	}
+}
diff --git a/src/test/beast/beast2vs1/trace/LogAnalyser.java b/src/test/beast/beast2vs1/trace/LogAnalyser.java
new file mode 100644
index 0000000..29368ec
--- /dev/null
+++ b/src/test/beast/beast2vs1/trace/LogAnalyser.java
@@ -0,0 +1,357 @@
+/*
+ * LogAnalyser.java
+ *
+ * Copyright (C) 2002-2006 Alexei Drummond and Andrew Rambaut
+ *
+ * This file is part of BEAST.
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership and licensing.
+ *
+ * BEAST 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
+ * of the License, or (at your option) any later version.
+ *
+ *  BEAST 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 BEAST; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+package test.beast.beast2vs1.trace;
+
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import beast.core.*;
+import beast.core.Input.Validate;
+import beast.core.Runnable;
+
+
+ at Description("Log Analyser: analyse BEAST log and provide statistics result including mean, min, max, median, standard deviation, " +
+        "mean squared error, variance, ESS, hpd lower, hpd upper, cpd lower, cpd upper, standard error of mean, auto correlation time " +
+        "and geometric mean, which does not store the input data values in memory.")
+ at Citation("Created by Alexei Drummond and modified by Walter Xie")
+public class LogAnalyser extends Runnable {
+    public Input<String> m_sFileName =
+            new Input<String>("fileName", "Name of the log file to be analysed", Validate.REQUIRED);
+    public Input<Integer> m_iBurnIn =
+            new Input<Integer>("burnIn", "Number of burn in samples taken before log statistics analysis. " +
+                    "If burnIn = -1 then burnIn = 0.1 * maxState.", -1);
+    public Input<Boolean> m_bDisplayStat =
+            new Input<Boolean>("displayStatistics", "Display a brief statistics result", true);
+    public Input<Boolean> m_bDisplayAll =
+            new Input<Boolean>("displayAll", "Display all availble statistics result", false);
+    public Input<Boolean> m_bReport =
+            new Input<Boolean>("report", "Display all availble information", false);
+
+    public Input<List<Expectation>> m_pExpectations = new Input<List<Expectation>>("expectation",
+            "Expectation of log statistics analysis regarding a loggable plugin.",
+            new ArrayList<Expectation>(), Validate.REQUIRED);
+    public Input<MCMC> m_pMCMC = new Input<MCMC>("expectation",
+            "Expectation of log statistics analysis regarding a loggable plugin.", Validate.REQUIRED);
+
+//    <run spec='beast.trace.LogAnalyser' fileName="test.$(seed).log" report="true">
+//        <input idref='MCMC'/>   
+//        <input spec='beast.trace.Expectation' traceName="hky.kappa" expectedValue="32.724"/>
+//    </run>
+
+    public List<TraceStatistics> traceStatisticsList = new ArrayList<TraceStatistics>(); // use for JUnit test
+
+    static final String error1 = " is significantly different to the expectation : ";
+    static final String error2 = " has very low effective sample sizes (ESS) !";
+    private static final int fieldWidth = 14;
+    private static final int firstField = 25;
+    NumberFormatter formatter = new NumberFormatter(6);
+
+    private List<String> warning = new ArrayList<String>();
+
+    // this constructor is used by Unit test
+    public LogAnalyser(String fileName, List<Expectation> expectations) throws Exception {
+        this.m_sFileName.setValue(fileName, this);
+        this.m_pExpectations.get().addAll(expectations);
+        LogFileTraces traces = readLog(m_sFileName.get(), -1);
+        analyseLog(traces);
+    }
+
+    @Override
+    public void initAndValidate() throws Exception {
+
+    }
+
+    @Override
+    public void run() throws Exception {
+        LogFileTraces traces = readLog(m_sFileName.get(), m_iBurnIn.get()); // if burnIn = -1 then burnIn = 0.1 * maxState
+        analyseLog(traces);
+    }
+
+    public void analyseLog(LogFileTraces traces) throws TraceException, IOException {
+        formatter.setPadding(true);
+        formatter.setFieldWidth(fieldWidth);
+
+        if (m_bReport.get()) tracesTittleReport(traces, m_bDisplayAll.get());
+
+        for (int i = 0; i < traces.getTraceCount(); i++) {
+            TraceStatistics distribution = traces.analyseTrace(i);
+            traceStatisticsList.add(distribution);
+
+            for (Expectation expectation : m_pExpectations.get()) {
+                if (traces.getTraceName(i).equals(expectation.traceName.get())) {
+                    if (!expectation.assertExpectation(distribution, m_bDisplayStat.get())) { // record isPassed in Expectation here
+                        warning.add(" * WARNING: " + expectation.traceName.get() + " has significantly different value "
+                                + distribution.getMean() + " with the expectation " + expectation.expValue.get() + " !");
+                    }
+
+                    if (!expectation.isValid()) {
+                        warning.add(" * WARNING: " + expectation.traceName.get() + " has very low effective sample sizes (ESS) "
+                                + distribution.getESS() + " !");
+                    }
+
+                    if (m_bReport.get()) {
+                        traceStatisticalReport(expectation, m_bDisplayAll.get(), null);
+                    }
+                }
+            }
+        }
+
+        if (m_bReport.get()) {
+            System.out.println();
+            for (String s : warning) { // print warning here
+                System.out.println(s);
+            }
+        }
+    }
+
+    private void tracesTittleReport(LogFileTraces traces, boolean displayAllStatistics) {
+        System.out.println();
+        System.out.println("burnIn   <= " + traces.getBurnIn());
+        System.out.println("maxState  = " + traces.getMaxState());
+        System.out.println();
+
+        System.out.print(formatter.formatToFieldWidth("statistic", firstField));
+        String[] names;
+
+        if (!displayAllStatistics)
+            names = new String[]{"mean", "error", "test", "stdev", "hpdLower", "hpdUpper", "ESS"};
+        else
+            names = new String[]{"mean", "error", "test", "stdev", "hpdLower", "hpdUpper", "ESS", "stdErrorOfMeanFromLog",
+                    "min", "max", "median", "geometricMean", "meanSquaredError", "variance", "cpdLower",
+                    "cpdUpper", "autoCorrelationTime", "stdevAutoCorrelationTime"};
+
+        for (String name : names) {
+            System.out.print(formatter.formatToFieldWidth(name, fieldWidth));
+        }
+        System.out.println();
+
+    }
+
+    public void traceStatisticalReport(Expectation expectation, boolean displayAllStatistics,
+                                       String likelihoodName) throws IOException, TraceException {
+
+        TraceStatistics distribution = expectation.getTraceStatistics();
+        double mean = distribution.getMean();
+        double error = expectation.getStdError();
+
+        System.out.print(formatter.formatToFieldWidth(expectation.traceName.get(), firstField));
+
+        System.out.print(formatter.format(mean));
+        System.out.print("+-" + formatter.format(error));
+
+        if (expectation.isPassed()) {
+            System.out.print(formatter.formatToFieldWidth("OK", fieldWidth));
+        } else {
+            System.out.print(formatter.formatToFieldWidth("FAILED", fieldWidth));
+        }
+
+        System.out.print(formatter.format(distribution.getStdev()));
+        System.out.print(formatter.format(distribution.getHpdLower()));
+        System.out.print(formatter.format(distribution.getHpdUpper()));
+        System.out.print(formatter.format(distribution.getESS()));
+
+        if (displayAllStatistics) {
+            System.out.print(formatter.format(distribution.getStdErrorOfMean()));
+            System.out.print(formatter.format(distribution.getMinimum()));
+            System.out.print(formatter.format(distribution.getMaximum()));
+            System.out.print(formatter.format(distribution.getMedian()));
+            System.out.print(formatter.format(distribution.getGeometricMean()));
+            System.out.print(formatter.format(distribution.getVariance()));
+            System.out.print(formatter.format(distribution.getCpdLower()));
+            System.out.print(formatter.format(distribution.getCpdUpper()));
+            System.out.print(formatter.format(distribution.getAutoCorrelationTime()));
+            System.out.print(formatter.format(distribution.getStdevAutoCorrelationTime()));
+        }
+
+        System.out.println();
+
+        if (likelihoodName != null) {
+//            System.out.println();
+//            int traceIndex = -1;
+//            for (int i = 0; i < traces.getTraceCount(); i++) {
+//                String traceName = traces.getTraceName(i);
+//                if (traceName.equals(likelihoodName)) {
+//                    traceIndex = i;
+//                    break;
+//                }
+//            }
+//
+//            if (traceIndex == -1) {
+//                throw new TraceException("Column '" + likelihoodName +
+//                        "' can not be found for marginal likelihood analysis.");
+//            }
+//
+//            boolean harmonicOnly = false;
+//            int bootstrapLength = 1000;
+//
+//            List<Double> sample = traces.getValues(traceIndex);
+//
+//            MarginalLikelihoodAnalysis analysis = new MarginalLikelihoodAnalysis(sample,
+//                    traces.getTraceName(traceIndex), burnin, harmonicOnly, bootstrapLength);
+//
+//            System.out.println(analysis.toString());
+        }
+
+        System.out.flush();
+    }
+
+    public LogFileTraces readLog(String fileName, long inBurnin) throws TraceException, IOException {
+        File file = new File(fileName);
+        LogFileTraces traces = new LogFileTraces(fileName, file);
+        traces.loadTraces();
+
+        long burnin = inBurnin;
+        if (burnin == -1) {
+            burnin = traces.getMaxState() / 10;
+        }
+
+        traces.setBurnIn(burnin);
+
+        return traces;
+    }
+
+    /**
+     * @param burnin     the number of states of burnin or if -1 then use 10%
+     * @param filename   the file name of the log file to report on
+     * @param drawHeader if true then draw header
+     * @param stdErr     if true then report the standard deviation of the mean
+     * @param hpds       if true then report 95% hpd upper and lower
+     * @param individualESSs minimum number of ESS with which to throw warning
+     * @param likelihoodName column name
+     * @return the traces loaded from given file to create this short report
+     * @throws java.io.IOException if general error reading file
+     * @throws TraceException      if trace file in wrong format or corrupted
+
+    public static TraceList shortReport(String filename,
+    final int burnin, boolean drawHeader,
+    boolean hpds, boolean individualESSs, boolean stdErr,
+    String likelihoodName) throws java.io.IOException, TraceException {
+
+    TraceList traces = analyzeLogFile(filename, burnin);
+
+    int maxState = traces.getMaxState();
+
+    double minESS = Double.MAX_VALUE;
+
+    if (drawHeader) {
+    System.out.print("file\t");
+    for (int i = 0; i < traces.getTraceCount(); i++) {
+    String traceName = traces.getTraceName(i);
+    System.out.print(traceName + "\t");
+    if (stdErr)
+    System.out.print(traceName + " stdErr\t");
+    if (hpds) {
+    System.out.print(traceName + " hpdLower\t");
+    System.out.print(traceName + " hpdUpper\t");
+    }
+    if (individualESSs) {
+    System.out.print(traceName + " ESS\t");
+    }
+    }
+    System.out.print("minESS\t");
+    if (likelihoodName != null) {
+    System.out.print("marginal likelihood\t");
+    System.out.print("stdErr\t");
+    }
+    System.out.println("chainLength");
+    }
+
+    System.out.print(filename + "\t");
+    for (int i = 0; i < traces.getTraceCount(); i++) {
+    //TraceDistribution distribution = traces.getDistributionStatistics(i);
+    TraceCorrelation distribution = traces.getCorrelationStatistics(i);
+    System.out.print(distribution.getMean() + "\t");
+    if (stdErr)
+    System.out.print(distribution.getStdErrorOfMean() + "\t");
+    if (hpds) {
+    System.out.print(distribution.getLowerHPD() + "\t");
+    System.out.print(distribution.getUpperHPD() + "\t");
+    }
+    if (individualESSs) {
+    System.out.print(distribution.getESS() + "\t");
+    }
+    double ess = distribution.getESS();
+    if (ess < minESS) {
+    minESS = ess;
+    }
+    }
+
+    System.out.print(minESS + "\t");
+
+    if (likelihoodName != null) {
+    int traceIndex = -1;
+    for (int i = 0; i < traces.getTraceCount(); i++) {
+    String traceName = traces.getTraceName(i);
+    if (traceName.equals(likelihoodName)) {
+    traceIndex = i;
+    break;
+    }
+    }
+
+    if (traceIndex == -1) {
+    throw new TraceException("Column '" + likelihoodName + "' can not be found in file " + filename + ".");
+    }
+
+    boolean harmonicOnly = false;
+    int bootstrapLength = 1000;
+
+    List<Double> sample = traces.getValues(traceIndex);
+
+    MarginalLikelihoodAnalysis analysis = new MarginalLikelihoodAnalysis(sample,
+    traces.getTraceName(traceIndex), burnin, harmonicOnly, bootstrapLength);
+
+    System.out.print(analysis.getLogMarginalLikelihood() + "\t");
+    System.out.print(analysis.getBootstrappedSE() + "\t");
+    }
+
+    System.out.println(maxState);
+    return traces;
+    } */
+
+    /**
+     * @param fileName the name of the log file to analyze
+     * @param burnin   the state to discard up to
+     * @return an array og analyses of the statistics in a log file.
+     * @throws java.io.IOException if general error reading file
+     * @throws TraceException      if trace file in wrong format or corrupted
+
+    public static LogFileTraces analyzeLogFile(String fileName, int burnin) throws java.io.IOException, TraceException {
+
+    File file = new File(fileName);
+    LogFileTraces traces = new LogFileTraces(fileName, file);
+    traces.loadTraces();
+    traces.setBurnIn(burnin);
+
+    for (int i = 0; i < traces.getTraceCount(); i++) {
+    traces.analyseTrace(i);
+    }
+    return traces;
+    } */
+
+}
diff --git a/src/test/beast/beast2vs1/trace/LogFileTraces.java b/src/test/beast/beast2vs1/trace/LogFileTraces.java
new file mode 100644
index 0000000..a03b831
--- /dev/null
+++ b/src/test/beast/beast2vs1/trace/LogFileTraces.java
@@ -0,0 +1,218 @@
+package test.beast.beast2vs1.trace;
+
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.Reader;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+
+/**
+ * A class that stores a set of traces from a single chain
+ *
+ * @author Andrew Rambaut
+ * @author Alexei Drummond
+ * @author Walter Xie
+ */
+
+public class LogFileTraces {
+    protected final File file;
+    protected final String name;
+
+    private final List<String> tracesNameList = new ArrayList<String>();
+    protected List<List<Double>> valuesList = new ArrayList<List<Double>>();
+    private long burnIn = -1;
+    private long firstState = -1;
+    private long lastState = -1;
+    private long stepSize = -1;
+
+    public LogFileTraces(String name, File file) {
+        this.name = name;
+        this.file = file;
+    }
+
+    /**
+     * @return the name of this traceset
+     */
+    public String getName() {
+        return name;
+    }
+
+    public File getFile() {
+        return file;
+    }
+
+    /**
+     * @return the last state in the chain
+     */
+    public long getMaxState() {
+        return lastState;
+    }
+
+    public boolean isIncomplete() {
+        return false;
+    }
+
+    /**
+     * @return the number of states excluding the burnin
+     */
+    public long getStateCount() {
+        // This is done as two integer divisions to ensure the same rounding for
+        // the burnin...
+        return ((lastState - firstState) / stepSize) - (getBurnIn() / stepSize) + 1;
+    }
+
+    /**
+     * @return the number of states in the burnin
+     */
+    public long getBurninStateCount() {
+        return (getBurnIn() / stepSize);
+    }
+
+    /**
+     * @return the size of the step between states
+     */
+    public long getStepSize() {
+        return stepSize;
+    }
+
+    public long getBurnIn() {
+        return burnIn;
+    }
+
+    /**
+     * @return the number of traces in this traceset
+     */
+    public int getTraceCount() {
+        return tracesNameList.size();
+    }
+
+    public void setBurnIn(long burnIn) {
+        this.burnIn = burnIn;
+    }
+
+
+    public void loadTraces() throws TraceException, IOException {
+        FileReader reader = new FileReader(file);
+        loadTraces(reader);
+        reader.close();
+    }
+
+    public void loadTraces(Reader r) throws TraceException, IOException {
+
+        TrimLineReader reader = new TrimLineReader(r);
+
+        // lines starting with [ are ignored, assuming comments in MrBayes file
+        // lines starting with # are ignored, assuming comments in Migrate or BEAST file
+        StringTokenizer tokens = reader.readTokensIgnoringEmptyLinesAndComments(new String[]{"[", "#"});
+
+        // read label tokens
+        String[] labels = new String[tokens.countTokens()];
+
+        for (int i = 0; i < labels.length; i++) {
+            labels[i] = tokens.nextToken();
+            tracesNameList.add(labels[i]);
+            valuesList.add(new ArrayList<Double>());
+        }
+
+        int traceCount = getTraceCount();
+
+        boolean firstState = true;
+
+        tokens = reader.tokenizeLine();
+        while (tokens != null && tokens.hasMoreTokens()) {
+            String stateString = tokens.nextToken();
+            long state = 0;
+
+            try {
+                try {
+                    // Changed this to parseDouble because LAMARC uses scientific notation for the state number
+                    state = (long) Double.parseDouble(stateString);
+                } catch (NumberFormatException nfe) {
+                    throw new TraceException("Unable to parse state number in column 1 (Line " + reader.getLineNumber() + ")");
+                }
+
+                if (firstState) {
+                    // MrBayes puts 1 as the first state, BEAST puts 0
+                    // In order to get the same gap between subsequent samples,
+                    // we force this to 0.
+                    if (state == 1) state = 0;
+                    firstState = false;
+                }
+
+                if (!addState(state)) {
+                    throw new TraceException("State " + state + " is not consistent with previous spacing (Line " + reader.getLineNumber() + ")");
+                }
+
+            } catch (NumberFormatException nfe) {
+                throw new TraceException("State " + state + ":Expected real value in column " + reader.getLineNumber());
+            }
+
+            for (int i = 0; i < traceCount; i++) {
+                if (tokens.hasMoreTokens()) {
+                    String value = tokens.nextToken();
+
+                    try {
+                        valuesList.get(i).add(Double.parseDouble(value));
+                    } catch (NumberFormatException nfe) {
+                        throw new TraceException("State " + state + ": Expected correct number type (Double) in column "
+                                + (i + 1) + " (Line " + reader.getLineNumber() + ")");
+                    }
+
+                } else {
+                    throw new TraceException("State " + state + ": missing values at line " + reader.getLineNumber());
+                }
+            }
+
+            tokens = reader.tokenizeLine();
+        }
+
+        burnIn = (int) (0.1 * lastState);
+    }
+
+    /**
+     * Add a state number for these traces. This should be
+     * called before adding values for each trace. The spacing
+     * between stateNumbers should remain constant.
+     *
+     * @param stateNumber the state
+     * @return false if the state number is inconsistent
+     */
+    private boolean addState(long stateNumber) {
+        if (firstState < 0) {
+            firstState = stateNumber;
+        } else if (stepSize < 0) {
+            stepSize = stateNumber - firstState;
+        } else {
+        	long step = stateNumber - lastState;
+            if (step != stepSize) {
+                return false;
+            }
+        }
+        lastState = stateNumber;
+        return true;
+    }
+
+    public TraceStatistics analyseTrace(int index) {
+    	int start = (int) (getBurnIn() / getStepSize());
+
+        List<Double> values = valuesList.get(index).subList(start, valuesList.get(index).size());
+        double[] doubleValues = new double[values.size()];
+        for (int i = 0; i < values.size(); i++) {
+            doubleValues[i] = values.get(i);
+        }
+
+        return new TraceStatistics(doubleValues, getStepSize());
+    }
+
+    public String getTraceName(int i) {
+        return tracesNameList.get(i);
+    }
+
+    public int getTraceIndex(String traceName) {
+        return tracesNameList.indexOf(traceName);
+    }
+}
+
diff --git a/src/test/beast/beast2vs1/trace/NumberFormatter.java b/src/test/beast/beast2vs1/trace/NumberFormatter.java
new file mode 100644
index 0000000..ad92809
--- /dev/null
+++ b/src/test/beast/beast2vs1/trace/NumberFormatter.java
@@ -0,0 +1,164 @@
+/*
+ * NumberFormatter.java
+ *
+ * Copyright (C) 2002-2006 Alexei Drummond and Andrew Rambaut
+ *
+ * This file is part of BEAST.
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership and licensing.
+ *
+ * BEAST 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
+ * of the License, or (at your option) any later version.
+ *
+ *  BEAST 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 BEAST; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+package test.beast.beast2vs1.trace;
+
+import java.text.DecimalFormat;
+
+/**
+ * The world's most intelligent number formatter with the following features :-)
+ * <p/>
+ * It guarantee's the display of a user-specified number of significant figures, sf <BR>
+ * It displays decimal format for numbers with absolute values between 1 and 10^(sf-1) <BR>
+ * It displays scientific notation for all other numbers (i.e. really big and really small absolute values) <BR>
+ * <b>note</b>: Its display integers for doubles with integer value <BR>
+ *
+ * @author Alexei Drummond
+ */
+public class NumberFormatter {
+
+    private int sf;
+    private double upperCutoff;
+    private double[] cutoffTable;
+    private final DecimalFormat decimalFormat = new DecimalFormat();
+    private DecimalFormat scientificFormat = null;
+    private boolean isPadding = false;
+    private int fieldWidth;
+
+
+    public NumberFormatter(int sf) {
+        setSignificantFigures(sf);
+    }
+
+    public NumberFormatter(int sf, int fieldWidth) {
+        setSignificantFigures(sf);
+        setPadding(true);
+        setFieldWidth(fieldWidth);
+    }
+
+    public void setSignificantFigures(int sf) {
+        this.sf = sf;
+        upperCutoff = Math.pow(10, sf - 1);
+        cutoffTable = new double[sf];
+        long num = 10;
+        for (int i = 0; i < cutoffTable.length; i++) {
+            cutoffTable[i] = (double) num;
+            num *= 10;
+        }
+        decimalFormat.setMinimumIntegerDigits(1);
+        decimalFormat.setMaximumFractionDigits(sf - 1);
+        decimalFormat.setMinimumFractionDigits(sf - 1);
+        decimalFormat.setGroupingUsed(false);
+        scientificFormat = new DecimalFormat(getScientificPattern(sf));
+        fieldWidth = sf;
+    }
+
+    public void setPadding(boolean padding) {
+        isPadding = padding;
+    }
+
+    public void setFieldWidth(int fw) {
+        if (fw < sf + 4) throw new IllegalArgumentException();
+        fieldWidth = fw;
+    }
+
+    public int getFieldWidth() {
+        return fieldWidth;
+    }
+
+    public String formatToFieldWidth(String s, int fieldWidth) {
+        int size = fieldWidth - s.length();
+        StringBuffer buffer = new StringBuffer(s);
+        for (int i = 0; i < size; i++) {
+            buffer.append(' ');
+        }
+        return buffer.toString();
+    }
+
+    /**
+     * @param value             value
+     * @param numFractionDigits numFractionDigits
+     * @return the given value formatted to have exactly then number of
+     *         fraction digits specified.
+     */
+    public String formatDecimal(double value, int numFractionDigits) {
+
+        decimalFormat.setMaximumFractionDigits(numFractionDigits);
+        decimalFormat.setMinimumFractionDigits(Math.min(numFractionDigits, 1));
+        return decimalFormat.format(value);
+    }
+
+    /**
+     * This method formats a number 'nicely': <BR>
+     * It guarantee's the display of a user-specified total significant figures, sf <BR>
+     * It displays decimal format for numbers with absolute values between 1 and 10^(sf-1) <BR>
+     * It displays scientific notation for all other numbers (i.e. really big and really small absolute values) <BR>
+     * <b>note</b>: Its display integers for doubles with integer value <BR>
+     *
+     * @param value value
+     * @return a nicely formatted number.
+     */
+    public String format(double value) {
+
+        StringBuffer buffer = new StringBuffer();
+
+        double absValue = Math.abs(value);
+
+        if ((absValue > upperCutoff) || (absValue < 0.1 && absValue != 0.0)) {
+            buffer.append(scientificFormat.format(value));
+        } else {
+            int numFractionDigits = 0;
+            if (value != (int) value) {
+                numFractionDigits = getNumFractionDigits(value);
+            }
+            buffer.append(formatDecimal(value, numFractionDigits));
+        }
+
+        if (isPadding) {
+            int size = fieldWidth - buffer.length();
+            for (int i = 0; i < size; i++) {
+                buffer.append(' ');
+            }
+        }
+        return buffer.toString();
+    }
+
+    private int getNumFractionDigits(double value) {
+        value = Math.abs(value);
+        for (int i = 0; i < cutoffTable.length; i++) {
+            if (value < cutoffTable[i]) return sf - i - 1;
+        }
+        return sf - 1;
+    }
+
+    private String getScientificPattern(int sf) {
+        String pattern = "0.";
+        for (int i = 0; i < sf - 1; i++) {
+            pattern += "#";
+        }
+        pattern += "E0";
+        return pattern;
+    }
+}
diff --git a/src/test/beast/beast2vs1/trace/TraceException.java b/src/test/beast/beast2vs1/trace/TraceException.java
new file mode 100644
index 0000000..1d96f63
--- /dev/null
+++ b/src/test/beast/beast2vs1/trace/TraceException.java
@@ -0,0 +1,43 @@
+/*
+ * TraceException.java
+ *
+ * Copyright (C) 2002-2006 Alexei Drummond and Andrew Rambaut
+ *
+ * This file is part of BEAST.
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership and licensing.
+ *
+ * BEAST 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
+ * of the License, or (at your option) any later version.
+ *
+ *  BEAST 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 BEAST; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ */
+
+package test.beast.beast2vs1.trace;
+
+/**
+ * An exception for traces
+ *
+ * @author Andrew Rambaut
+ * @author Alexei Drummond
+ */
+
+public class TraceException extends Exception {
+    public TraceException() {
+        super();
+    }
+
+    public TraceException(String message) {
+        super(message);
+    }
+}
\ No newline at end of file
diff --git a/src/test/beast/beast2vs1/trace/TraceStatistics.java b/src/test/beast/beast2vs1/trace/TraceStatistics.java
new file mode 100644
index 0000000..475b301
--- /dev/null
+++ b/src/test/beast/beast2vs1/trace/TraceStatistics.java
@@ -0,0 +1,209 @@
+package test.beast.beast2vs1.trace;
+
+import beast.util.HeapSort;
+
+/**
+ * @author Alexei Drummond
+ * @author Andrew Rambaut
+ * @author Walter Xie
+ */
+public class TraceStatistics {
+    private static final int MAX_LAG = 2000;
+    private boolean isValid = true;
+    private boolean hasGeometricMean = false;
+
+    private double minimum, maximum;
+    private double mean;
+    private double median;
+    private double geometricMean;
+    private double stdev;
+    private double variance;
+    private double cpdLower, cpdUpper, hpdLower, hpdUpper;
+    private double ESS;
+
+    private double stdErrorOfMean;
+    private double autoCorrelationTime;
+    private double stdevAutoCorrelationTime;
+
+    public TraceStatistics(double[] values) {
+        analyseDistributionContinuous(values, 0.95);
+    }
+
+    public TraceStatistics(double[] values, long stepSize) {
+        this(values);
+
+        if (isValid) {
+            analyseCorrelationContinuous(values, stepSize);
+        }
+    }
+
+    /**
+     * @param valuesC    the values to analyze
+     * @param proportion the proportion of probability mass included within interval.
+     */
+    private void analyseDistributionContinuous(double[] valuesC, double proportion) {
+
+        mean = DiscreteStatistics.mean(valuesC);
+        stdev = DiscreteStatistics.stdev(valuesC);
+        variance = DiscreteStatistics.variance(valuesC);
+
+        minimum = Double.POSITIVE_INFINITY;
+        maximum = Double.NEGATIVE_INFINITY;
+
+        for (double value : valuesC) {
+            if (value < minimum) minimum = value;
+            if (value > maximum) maximum = value;
+        }
+
+        if (minimum > 0) {
+            geometricMean = DiscreteStatistics.geometricMean(valuesC);
+            hasGeometricMean = true;
+        }
+
+        if (maximum == minimum) {
+            isValid = false;
+            return;
+        }
+
+        int[] indices = new int[valuesC.length];
+        HeapSort.sort(valuesC, indices);
+        median = DiscreteStatistics.quantile(0.5, valuesC, indices);
+        cpdLower = DiscreteStatistics.quantile(0.025, valuesC, indices);
+        cpdUpper = DiscreteStatistics.quantile(0.975, valuesC, indices);
+        calculateHPDInterval(proportion, valuesC, indices);
+        ESS = valuesC.length;
+
+    }
+
+
+    /**
+     * @param proportion the proportion of probability mass included within interval.
+     * @param array      the data array
+     * @param indices    the indices of the ranks of the values (sort order)
+     */
+    private void calculateHPDInterval(double proportion, double[] array, int[] indices) {
+        final double[] hpd = DiscreteStatistics.HPDInterval(proportion, array, indices);
+        hpdLower = hpd[0];
+        hpdUpper = hpd[1];
+    }
+
+    /**
+     * Analyze trace
+     *
+     * @param values   the values
+     * @param stepSize the sampling frequency of the values
+     */
+    private void analyseCorrelationContinuous(double[] values, long stepSize) {
+
+        final int samples = values.length;
+        int maxLag = Math.min(samples - 1, MAX_LAG);
+
+        double[] gammaStat = new double[maxLag];
+        //double[] varGammaStat = new double[maxLag];
+        double varStat = 0.0;
+        //double varVarStat = 0.0;
+        //double assVarCor = 1.0;
+        //double del1, del2;
+
+        for (int lag = 0; lag < maxLag; lag++) {
+            for (int j = 0; j < samples - lag; j++) {
+                final double del1 = values[j] - mean;
+                final double del2 = values[j + lag] - mean;
+                gammaStat[lag] += (del1 * del2);
+                //varGammaStat[lag] += (del1*del1*del2*del2);
+            }
+
+            gammaStat[lag] /= ((double) (samples - lag));
+            //varGammaStat[lag] /= ((double) samples-lag);
+            //varGammaStat[lag] -= (gammaStat[0] * gammaStat[0]);
+
+            if (lag == 0) {
+                varStat = gammaStat[0];
+                //varVarStat = varGammaStat[0];
+                //assVarCor = 1.0;
+            } else if (lag % 2 == 0) {
+                // fancy stopping criterion :)
+                if (gammaStat[lag - 1] + gammaStat[lag] > 0) {
+                    varStat += 2.0 * (gammaStat[lag - 1] + gammaStat[lag]);
+                    // varVarStat += 2.0*(varGammaStat[lag-1] + varGammaStat[lag]);
+                    // assVarCor  += 2.0*((gammaStat[lag-1] * gammaStat[lag-1]) + (gammaStat[lag] * gammaStat[lag])) / (gammaStat[0] * gammaStat[0]);
+                }
+                // stop
+                else
+                    maxLag = lag;
+            }
+        }
+
+        // standard error of mean
+        stdErrorOfMean = Math.sqrt(varStat / samples);
+        // auto correlation time
+        autoCorrelationTime = stepSize * varStat / gammaStat[0];
+        // effective sample size
+        ESS = (stepSize * samples) / autoCorrelationTime;
+        // standard deviation of autocorrelation time
+        stdevAutoCorrelationTime = (2.0 * Math.sqrt(2.0 * (2.0 * (double) (maxLag + 1)) / samples) * (varStat / gammaStat[0]) * stepSize);
+
+        isValid = true;
+    }
+
+    public double getMinimum() {
+        return minimum;
+    }
+
+    public double getMaximum() {
+        return maximum;
+    }
+
+    public double getMean() {
+        return mean;
+    }
+
+    public double getMedian() {
+        return median;
+    }
+
+    public double getGeometricMean() {
+        if (hasGeometricMean) return geometricMean;
+        return Double.NaN;
+    }
+
+    public double getStdev() {
+        return stdev;
+    }
+
+    public double getVariance() {
+        return variance;
+    }
+
+    public double getCpdLower() {
+        return cpdLower;
+    }
+
+    public double getCpdUpper() {
+        return cpdUpper;
+    }
+
+    public double getHpdLower() {
+        return hpdLower;
+    }
+
+    public double getHpdUpper() {
+        return hpdUpper;
+    }
+
+    public double getESS() {
+        return ESS;
+    }
+
+    public double getStdErrorOfMean() {
+        return stdErrorOfMean;
+    }
+
+    public double getAutoCorrelationTime() {
+        return autoCorrelationTime;
+    }
+
+    public double getStdevAutoCorrelationTime() {
+        return stdevAutoCorrelationTime;
+    }
+}
diff --git a/src/test/beast/beast2vs1/trace/TraceType.java b/src/test/beast/beast2vs1/trace/TraceType.java
new file mode 100644
index 0000000..32a7ef5
--- /dev/null
+++ b/src/test/beast/beast2vs1/trace/TraceType.java
@@ -0,0 +1,33 @@
+package test.beast.beast2vs1.trace;
+
+/**
+ * @author Alexei Drummond
+ * @author Walter Xie
+ */
+public enum TraceType {
+    DOUBLE("double", "D", Double.class),
+    INTEGER("integer", "I", Integer.class),
+    STRING("string", "S", String.class);
+
+    TraceType(String name, String brief, Class type) {
+        this.name = name;
+        this.brief = brief;
+        this.type = type;
+    }
+
+    public String toString() {
+        return name;
+    }
+
+    public String getBrief() {
+        return brief;
+    }
+
+    public Class getType() {
+        return type;
+    }
+
+    private final String name;
+    private final String brief;
+    private final Class type;
+}
diff --git a/src/test/beast/beast2vs1/trace/TrimLineReader.java b/src/test/beast/beast2vs1/trace/TrimLineReader.java
new file mode 100644
index 0000000..410f65c
--- /dev/null
+++ b/src/test/beast/beast2vs1/trace/TrimLineReader.java
@@ -0,0 +1,78 @@
+package test.beast.beast2vs1.trace;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.Reader;
+import java.util.StringTokenizer;
+
+/**
+ * @author Alexei Drummond
+ * @author Andrew Rambaut
+ * @author Walter Xie
+ */
+public class TrimLineReader extends BufferedReader {
+
+    public TrimLineReader(Reader reader) {
+        super(reader);
+    }
+
+    public String readLine() throws IOException {
+        lineNumber += 1;
+        String line = super.readLine();
+        if (line != null) return line.trim();
+        return null;
+    }
+
+    public StringTokenizer tokenizeLine() throws IOException {
+        String line = readLine();
+        if (line == null) return null;
+        return new StringTokenizer(line, "\t");
+    }
+
+    public StringTokenizer readTokensIgnoringEmptyLinesAndComments(String[] commentSigns) throws IOException {
+        // Read through to first token
+        StringTokenizer tokens = tokenizeLine();
+
+        if (tokens == null) {
+            throw new IOException("File is empty.");
+        }
+
+        // read over empty lines
+        while (!tokens.hasMoreTokens()) {
+            tokens = tokenizeLine();
+        }
+
+        // skip the first column which should be the state number
+        String token = tokens.nextToken();
+
+        // lines starting with [ are ignored, assuming comments in MrBayes file
+        // lines starting with # are ignored, assuming comments in Migrate or BEAST file
+        while (hasComment(commentSigns, token)) {
+            tokens = tokenizeLine();
+
+            // read over empty lines
+            while (!tokens.hasMoreTokens()) {
+                tokens = tokenizeLine();
+            }
+            // read state token and ignore
+            token = tokens.nextToken();
+        }
+
+        return tokens;
+    }
+
+    private boolean hasComment(String[] commentSigns, String token) {
+        for (String c : commentSigns) {
+            if (token.startsWith(c)) return true;
+        }
+        return false;
+    }
+
+    public int getLineNumber() {
+        return lineNumber;
+    }
+
+    private int lineNumber = 0;
+}
+
+
diff --git a/src/test/beast/core/BEASTInterfaceTest.java b/src/test/beast/core/BEASTInterfaceTest.java
new file mode 100644
index 0000000..341f4b9
--- /dev/null
+++ b/src/test/beast/core/BEASTInterfaceTest.java
@@ -0,0 +1,123 @@
+package test.beast.core;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.junit.Test;
+
+import beast.core.BEASTInterface;
+import beast.core.BEASTObject;
+import beast.core.Citation;
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.Input.Validate;
+import junit.framework.TestCase;
+
+public class BEASTInterfaceTest extends TestCase {
+
+	@Description("class that impements BEASTInterface but is not a BEASTObject")
+	@Citation("this is a dummy citation")
+	public class BEASTi implements BEASTInterface {
+		public Input<String> msgInput = new Input<String>("value", "message for this BEASTi object", Validate.REQUIRED);
+		public Input<BEASTi> beastiInput = new Input<BEASTi>("other", "link to another BEASTi object");
+		String ID;
+		Set<BEASTInterface> outputs = new HashSet<BEASTInterface>();
+
+		@Override
+		public String getID() {
+			return ID;
+		}
+
+		@Override
+		public void setID(String ID) {
+			this.ID = ID;
+		}
+
+		@Override
+		public Set getOutputs() {
+			return outputs;
+		}
+
+		@Override
+		public void initAndValidate() throws Exception {
+			// nothting to do;
+		}
+	}
+	
+	
+	@Test
+	public void testBEASTi() throws Exception {
+		BEASTi beasti = new BEASTi();
+		
+		System.err.println("test getCitation");
+		Citation citation = beasti.getCitation();
+		assertEquals("this is a dummy citation", citation.value());
+
+		System.err.println("test initByName");
+		beasti.initByName("value", "hello world");
+		Input<String> input = (Input<String>) beasti.getInput("value");
+		assertEquals("hello world", input.get());
+		
+		System.err.println("test listInputs");
+		List<?> list = beasti.listInputs();
+		assertEquals(2, list.size());
+
+		System.err.println("test initByName");
+		BEASTi beasti2 = new BEASTi();
+		beasti.initByName("value", "hello world",
+				"other", beasti2);
+		
+		System.err.println("test getInputValue");
+		BEASTi beasti3 = (BEASTi) beasti.getInputValue("other");
+		assertEquals(beasti2, beasti3);
+		
+		System.err.println("test getOutputs");
+		assertEquals(1, beasti2.getOutputs().size());
+		
+		String description = beasti.getDescription();
+		assertEquals("class that impements BEASTInterface but is not a BEASTObject", description);
+		
+		List<BEASTInterface> predecessors = new ArrayList<BEASTInterface>();
+		beasti2.getPredecessors(predecessors);
+		assertEquals(1, predecessors.size());
+		beasti.getPredecessors(predecessors);
+		assertEquals(2, predecessors.size());
+		assertEquals(beasti, predecessors.get(1));
+		assertEquals(beasti2, predecessors.get(0));
+		
+		description = beasti.getTipText("other");
+		assertEquals("link to another BEASTi object", description);
+		
+		boolean b = beasti.isPrimitive("value");
+		assertEquals(true, b);
+		b = beasti.isPrimitive("other");
+		assertEquals(false, b);
+		
+		List<BEASTInterface> plugins = beasti.listActivePlugins();
+		assertEquals(1, plugins.size());
+		assertEquals(beasti2, plugins.get(0));
+		plugins = beasti2.listActivePlugins();
+		assertEquals(0, plugins.size());
+		
+		
+		beasti.validateInputs();
+
+		try {
+			beasti2.validateInputs();
+			assertEquals(true, false); // should never get here
+		} catch (Throwable t) {
+			// lucky to be here
+		}
+		
+		
+		beasti2.setInputValue("value", "Goodbye!");
+		String msg = (String) beasti2.getInputValue("value");
+		assertEquals("Goodbye!", msg);
+		
+	}
+	
+	
+	
+}
diff --git a/src/test/beast/core/StateNodeInitialiserTest.java b/src/test/beast/core/StateNodeInitialiserTest.java
new file mode 100644
index 0000000..3b319ec
--- /dev/null
+++ b/src/test/beast/core/StateNodeInitialiserTest.java
@@ -0,0 +1,50 @@
+package test.beast.core;
+
+import org.junit.Test;
+
+import beast.evolution.alignment.Alignment;
+import beast.evolution.tree.Tree;
+import beast.util.ClusterTree;
+import beast.util.TreeParser;
+
+
+import test.beast.BEASTTestCase;
+
+import junit.framework.TestCase;
+
+public class StateNodeInitialiserTest extends TestCase {
+
+    @Test
+    public void testClusterTree() throws Exception {
+        Alignment data = BEASTTestCase.getAlignment();
+        Tree tree = new Tree();
+        tree.initAndValidate();
+        assertEquals(true, tree.getNodeCount() == 1);
+
+        TreeParser tree2 = new TreeParser();
+        tree2.initByName(
+                "initial", tree,
+                "taxa", data,
+                "newick", "((((human:0.024003,(chimp:0.010772,bonobo:0.010772):0.013231):0.012035,gorilla:0.036038):0.033087000000000005,orangutan:0.069125):0.030456999999999998,siamang:0.099582);",
+                "IsLabelledNewick", true);
+
+        assertEquals(true, tree.getNodeCount() > 1);
+        assertEquals(11, tree.getNodeCount());
+    }
+
+    @Test
+    public void testNewickTree() throws Exception {
+        Alignment data = BEASTTestCase.getAlignment();
+        Tree tree = new Tree();
+        tree.initAndValidate();
+        assertEquals(true, tree.getNodeCount() == 1);
+
+        ClusterTree tree2 = new ClusterTree();
+        tree2.initByName(
+                "initial", tree,
+                "clusterType", "upgma",
+                "taxa", data);
+        assertEquals(true, tree.getNodeCount() > 1);
+        assertEquals(11, tree.getNodeCount());
+    }
+}
diff --git a/src/test/beast/core/parameter/BooleanParameterListTest.java b/src/test/beast/core/parameter/BooleanParameterListTest.java
new file mode 100644
index 0000000..7675a5e
--- /dev/null
+++ b/src/test/beast/core/parameter/BooleanParameterListTest.java
@@ -0,0 +1,161 @@
+package test.beast.core.parameter;
+
+import beast.core.Operator;
+import beast.core.State;
+import beast.core.parameter.BooleanParameter;
+import beast.core.parameter.BooleanParameterList;
+import beast.core.parameter.Parameter;
+
+import java.io.ByteArrayInputStream;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.NodeList;
+
+/**
+ * Unit tests for ParameterList class.
+ *
+ * @author Tim Vaughan <tgvaughan at gmail.com>
+ */
+public class BooleanParameterListTest extends Operator {
+    
+    public BooleanParameterListTest() { }
+
+    @Test
+    public void test1() throws Exception {
+
+        BooleanParameterList parameterList = new BooleanParameterList();
+        
+        // Parameters with which to initialise list
+        BooleanParameter param1 = new BooleanParameter();
+        param1.initByName("value", "true false true");
+        
+        BooleanParameter param2 = new BooleanParameter();
+        param2.initByName("value", "false true false");
+        
+        // Initialise parameter list
+        parameterList.initByName(
+                "dimension", 3,
+                "initialParam", param1,
+                "initialParam", param2);
+        
+        // Create dummy state to allow statenode editing
+        State state = new State();
+        state.initByName("stateNode", parameterList);
+        state.initialise();
+        
+        // Test parameter value modification
+        parameterList.get(0).setValue(0, false);
+        
+        // Test parameter creation and modification
+        Parameter<Boolean> newParam = parameterList.addNewParam();
+        newParam.setValue(0, true);
+        newParam.setValue(1, true);
+        newParam.setValue(2, true);
+        
+        assertTrue(parameterList.get(0).getValue(0)==false);
+        assertTrue(parameterList.get(0).getValue(1)==false);
+        assertTrue(parameterList.get(0).getValue(2)==true);
+        assertTrue(parameterList.get(0).getKey()==0);
+        assertTrue(parameterList.get(1).getValue(0)==false);
+        assertTrue(parameterList.get(1).getValue(1)==true);
+        assertTrue(parameterList.get(1).getValue(2)==false);
+        assertTrue(parameterList.get(1).getKey()==1);
+        assertTrue(parameterList.get(2).getValue(0)==true);
+        assertTrue(parameterList.get(2).getValue(1)==true);
+        assertTrue(parameterList.get(2).getValue(2)==true);
+        assertTrue(parameterList.get(2).getKey()==2);
+        assertTrue(parameterList.size()==3);
+        
+        parameterList.remove(1);
+        
+        newParam = parameterList.addNewParam();
+        newParam.setValue(0, false);
+        newParam.setValue(1, false);
+        newParam.setValue(2, false);
+
+        assertTrue(parameterList.get(0).getValue(0)==false);
+        assertTrue(parameterList.get(0).getValue(1)==false);
+        assertTrue(parameterList.get(0).getValue(2)==true);
+        assertTrue(parameterList.get(0).getKey()==0);
+        assertTrue(parameterList.get(1).getValue(0)==true);
+        assertTrue(parameterList.get(1).getValue(1)==true);
+        assertTrue(parameterList.get(1).getValue(2)==true);
+        assertTrue(parameterList.get(1).getKey()==2);
+        assertTrue(parameterList.get(2).getValue(0)==false);
+        assertTrue(parameterList.get(2).getValue(1)==false);
+        assertTrue(parameterList.get(2).getValue(2)==false);
+        assertTrue(parameterList.get(2).getKey()==1);
+        assertTrue(parameterList.size()==3);
+        
+        // Test state restore
+        parameterList.restore();
+        
+        assertTrue(parameterList.get(0).getValue(0)==true);
+        assertTrue(parameterList.get(0).getValue(1)==false);
+        assertTrue(parameterList.get(0).getValue(2)==true);
+        assertTrue(parameterList.get(0).getKey()==0);
+        assertTrue(parameterList.get(1).getValue(0)==false);
+        assertTrue(parameterList.get(1).getValue(1)==true);
+        assertTrue(parameterList.get(1).getValue(2)==false);
+        assertTrue(parameterList.get(1).getKey()==1);
+        assertTrue(parameterList.size()==2);
+        
+
+        
+        // Test serialization
+        parameterList.addNewParam(newParam);
+        
+        String xmlStr = parameterList.toXML();
+        assertEquals(xmlStr,"<statenode id='null'>"
+                + "Dimension: [3, 1], "
+                + "Bounds: [false,true], "
+                + "AvailableKeys: [], "
+                + "NextKey: 3, "
+                + "Parameters: [[true,false,true],[false,true,false],[false,false,false]], "
+                + "ParameterKeys: [0,1,2]"
+                + "</statenode>\n");
+        
+        // Test deserialization
+        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+        Document doc = factory.newDocumentBuilder().parse(new ByteArrayInputStream(xmlStr.getBytes()));
+        doc.normalize();
+        NodeList nodes = doc.getElementsByTagName("*");
+        org.w3c.dom.Node docNode = nodes.item(0);
+        
+        BooleanParameterList newParameterList = new BooleanParameterList();
+        newParameterList.initAndValidate();
+        newParameterList.fromXML(docNode);
+        
+        assertTrue(newParameterList.get(0).getValue(0)==true);
+        assertTrue(newParameterList.get(0).getValue(1)==false);
+        assertTrue(newParameterList.get(0).getValue(2)==true);
+        assertTrue(newParameterList.get(0).getKey()==0);
+        assertTrue(newParameterList.get(1).getValue(0)==false);
+        assertTrue(newParameterList.get(1).getValue(1)==true);
+        assertTrue(newParameterList.get(1).getValue(2)==false);
+        assertTrue(newParameterList.get(1).getKey()==1);
+        assertTrue(newParameterList.get(2).getValue(0)==false);
+        assertTrue(newParameterList.get(2).getValue(1)==false);
+        assertTrue(newParameterList.get(2).getValue(2)==false);
+        assertTrue(newParameterList.get(2).getKey()==2);
+        assertTrue(newParameterList.size()==3);
+        
+    }
+    
+    @Override
+    public double proposal() {
+        return 0.0;
+    }
+
+	@Override
+	public void initAndValidate() throws Exception {
+		// TODO Auto-generated method stub
+		
+	}
+}
\ No newline at end of file
diff --git a/src/test/beast/core/parameter/IntegerParameterListTest.java b/src/test/beast/core/parameter/IntegerParameterListTest.java
new file mode 100644
index 0000000..eee2367
--- /dev/null
+++ b/src/test/beast/core/parameter/IntegerParameterListTest.java
@@ -0,0 +1,129 @@
+package test.beast.core.parameter;
+
+import beast.core.Operator;
+import beast.core.State;
+import beast.core.parameter.Parameter;
+import beast.core.parameter.IntegerParameter;
+import beast.core.parameter.IntegerParameterList;
+
+import java.io.ByteArrayInputStream;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.NodeList;
+
+/**
+ * Unit tests for ParameterList class.
+ *
+ * @author Tim Vaughan <tgvaughan at gmail.com>
+ */
+public class IntegerParameterListTest extends Operator {
+    
+    public IntegerParameterListTest() { }
+
+    @Test
+    public void test1() throws Exception {
+
+        IntegerParameterList parameterList = new IntegerParameterList();
+        
+        // Parameters with which to initialise list
+        IntegerParameter param1 = new IntegerParameter();
+        param1.initByName("value", "2");
+        
+        IntegerParameter param2 = new IntegerParameter();
+        param2.initByName("value", "3");
+        
+        // Initialise parameter list
+        parameterList.initByName(
+                "initialParam", param1,
+                "initialParam", param2);
+        
+        // Create dummy state to allow statenode editing
+        State state = new State();
+        state.initByName("stateNode", parameterList);
+        state.initialise();
+        
+        // Test parameter value modification
+        parameterList.get(0).setValue(20);
+        
+        // Test parameter creation and modification
+        Parameter<Integer> newParam = parameterList.addNewParam();
+        newParam.setValue(53);
+        
+        assertTrue(parameterList.get(0).getValue()==20);
+        assertTrue(parameterList.get(0).getKey()==0);
+        assertTrue(parameterList.get(1).getValue()==3);
+        assertTrue(parameterList.get(1).getKey()==1);
+        assertTrue(parameterList.get(2).getValue()==53);
+        assertTrue(parameterList.get(2).getKey()==2);
+        assertTrue(parameterList.size()==3);
+        
+        parameterList.remove(1);
+        
+        newParam = parameterList.addNewParam();
+        newParam.setValue(42);
+
+        assertTrue(parameterList.get(0).getValue()==20);
+        assertTrue(parameterList.get(0).getKey()==0);
+        assertTrue(parameterList.get(1).getValue()==53);
+        assertTrue(parameterList.get(1).getKey()==2);
+        assertTrue(parameterList.get(2).getValue()==42);
+        assertTrue(parameterList.get(2).getKey()==1);
+        assertTrue(parameterList.size()==3);
+        
+        // Test state restore
+        parameterList.restore();
+        
+        assertTrue(parameterList.get(0).getValue()==2);
+        assertTrue(parameterList.get(0).getKey()==0);
+        assertTrue(parameterList.get(1).getValue()==3);
+        assertTrue(parameterList.get(1).getKey()==1);
+        assertTrue(parameterList.size()==2);
+        
+        
+        // Test serialization
+        String xmlStr = parameterList.toXML();
+        assertEquals(xmlStr,"<statenode id='null'>"
+                + "Dimension: [1, 1], "
+                + "Bounds: [-2147483647,2147483646], "
+                + "AvailableKeys: [], "
+                + "NextKey: 2, "
+                + "Parameters: [[2],[3]], "
+                + "ParameterKeys: [0,1]"
+                + "</statenode>\n");
+        
+        // Test deserialization
+        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+        Document doc = factory.newDocumentBuilder().parse(new ByteArrayInputStream(xmlStr.getBytes()));
+        doc.normalize();
+        NodeList nodes = doc.getElementsByTagName("*");
+        org.w3c.dom.Node docNode = nodes.item(0);
+        
+        IntegerParameterList newParameterList = new IntegerParameterList();
+        newParameterList.initAndValidate();
+        newParameterList.fromXML(docNode);
+        
+        assertTrue(newParameterList.get(0).getValue()==2);
+        assertTrue(newParameterList.get(0).getKey()==0);
+        assertTrue(newParameterList.get(1).getValue()==3);
+        assertTrue(newParameterList.get(1).getKey()==1);
+        assertTrue(newParameterList.size()==2);
+        
+    }
+    
+    @Override
+    public double proposal() {
+        return 0.0;
+    }
+
+	@Override
+	public void initAndValidate() throws Exception {
+		// TODO Auto-generated method stub
+		
+	}
+}
\ No newline at end of file
diff --git a/src/test/beast/core/parameter/ParameterTest.java b/src/test/beast/core/parameter/ParameterTest.java
new file mode 100644
index 0000000..3666e67
--- /dev/null
+++ b/src/test/beast/core/parameter/ParameterTest.java
@@ -0,0 +1,33 @@
+package test.beast.core.parameter;
+
+import org.junit.Test;
+
+import beast.core.parameter.RealParameter;
+
+
+import junit.framework.TestCase;
+
+public class ParameterTest extends TestCase {
+
+    @Test
+    public void testParamter() throws Exception {
+        RealParameter parameter = new RealParameter();
+        parameter.initByName("value", "1.27 1.9");
+        assertEquals(parameter.getDimension(), 2);
+        parameter.setDimension(5);
+        assertEquals(parameter.getDimension(), 5);
+        assertEquals(parameter.getValue(0), parameter.getValue(2));
+        assertEquals(parameter.getValue(0), parameter.getValue(4));
+        assertEquals(parameter.getValue(1), parameter.getValue(3));
+        assertNotSame(parameter.getValue(0), parameter.getValue(1));
+        try {
+            parameter.setValue(2, 2.0); // this will throw an exception
+            assertNotSame(parameter.getValue(0), parameter.getValue(2));
+        } catch (Exception e) {
+            // setValue is not allowed for StateNode not in State
+        }
+        Double[] x = {1.0, 2.0, 3.0, 2.0, 4.0, 5.5};
+        parameter = new RealParameter(x);
+        assertEquals(parameter.getDimension(), 6);
+    }
+}
diff --git a/src/test/beast/core/parameter/RealParameterListTest.java b/src/test/beast/core/parameter/RealParameterListTest.java
new file mode 100644
index 0000000..cf6e1bb
--- /dev/null
+++ b/src/test/beast/core/parameter/RealParameterListTest.java
@@ -0,0 +1,129 @@
+package test.beast.core.parameter;
+
+import beast.core.Operator;
+import beast.core.State;
+import beast.core.parameter.Parameter;
+import beast.core.parameter.GeneralParameterList;
+import beast.core.parameter.RealParameter;
+import beast.core.parameter.RealParameterList;
+
+import java.io.ByteArrayInputStream;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.NodeList;
+
+/**
+ * Unit tests for ParameterList class.
+ *
+ * @author Tim Vaughan <tgvaughan at gmail.com>
+ */
+public class RealParameterListTest extends Operator {
+    
+    public RealParameterListTest() { }
+
+    @Test
+    public void test1() throws Exception {
+
+        RealParameterList parameterList = new RealParameterList();
+        
+        // Parameters with which to initialise list
+        RealParameter param1 = new RealParameter();
+        param1.initByName("value", "2");
+        
+        RealParameter param2 = new RealParameter();
+        param2.initByName("value", "3");
+        
+        // Initialise parameter list
+        parameterList.initByName(
+                "initialParam", param1,
+                "initialParam", param2);
+        
+        // Create dummy state to allow statenode editing
+        State state = new State();
+        state.initByName("stateNode", parameterList);
+        state.initialise();
+        
+        // Test parameter value modification
+        parameterList.get(0).setValue(20.0);
+        
+        // Test parameter creation and modification
+        Parameter<Double> newParam = parameterList.addNewParam();
+        newParam.setValue(53.0);
+        
+        assertEquals(parameterList.get(0).getValue(), 20.0, 1e-15);
+        assertEquals(parameterList.get(0).getKey(), 0);
+        assertEquals(parameterList.get(1).getValue(), 3.0, 1e-15);
+        assertEquals(parameterList.get(1).getKey(), 1);
+        assertEquals(parameterList.get(2).getValue(), 53.0, 1e-15);
+        assertEquals(parameterList.get(2).getKey(), 2);
+        assertEquals(parameterList.size(), 3);
+        
+        parameterList.remove(1);
+        
+        newParam = parameterList.addNewParam();
+        newParam.setValue(42.0);
+
+        assertEquals(parameterList.get(0).getValue(), 20.0, 1e-15);
+        assertEquals(parameterList.get(0).getKey(), 0, 1e-15);
+        assertEquals(parameterList.get(1).getValue(), 53.0, 1e-15);
+        assertEquals(parameterList.get(1).getKey(), 2, 1e-15);
+        assertEquals(parameterList.get(2).getValue(), 42.0, 1e-15);
+        assertEquals(parameterList.get(2).getKey(), 1);
+        assertEquals(parameterList.size(), 3);
+        
+        // Test state restore
+        parameterList.restore();
+        
+        assertEquals(parameterList.get(0).getValue(),2.0, 1e-15);
+        assertEquals(parameterList.get(0).getKey(),0);
+        assertEquals(parameterList.get(1).getValue(),3.0, 1e-15);
+        assertEquals(parameterList.get(1).getKey(),1);
+        assertEquals(parameterList.size(),2);
+        
+        
+        // Test serialization
+        String xmlStr = parameterList.toXML();
+        assertEquals(xmlStr,"<statenode id='null'>"
+                + "Dimension: [1, 1], "
+                + "Bounds: [-Infinity,Infinity], "
+                + "AvailableKeys: [], NextKey: 2, "
+                + "Parameters: [[2.0],[3.0]], "
+                + "ParameterKeys: [0,1]"
+                + "</statenode>\n");
+        
+        // Test deserialization
+        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+        Document doc = factory.newDocumentBuilder().parse(new ByteArrayInputStream(xmlStr.getBytes()));
+        doc.normalize();
+        NodeList nodes = doc.getElementsByTagName("*");
+        org.w3c.dom.Node docNode = nodes.item(0);
+        
+        RealParameterList newParameterList = new RealParameterList();
+        newParameterList.initAndValidate();
+        newParameterList.fromXML(docNode);
+        
+        assertEquals(newParameterList.get(0).getValue(),2.0, 1e-15);
+        assertEquals(newParameterList.get(0).getKey(),0);
+        assertEquals(newParameterList.get(1).getValue(),3.0, 1e-15);
+        assertEquals(newParameterList.get(1).getKey(),1);
+        assertEquals(newParameterList.size(),2);
+        
+    }
+    
+    @Override
+    public double proposal() {
+        return 0.0;
+    }
+
+	@Override
+	public void initAndValidate() throws Exception {
+		// TODO Auto-generated method stub
+		
+	}
+}
\ No newline at end of file
diff --git a/src/test/beast/evolution/alignment/FilteredAlignmentTest.java b/src/test/beast/evolution/alignment/FilteredAlignmentTest.java
new file mode 100644
index 0000000..382fff4
--- /dev/null
+++ b/src/test/beast/evolution/alignment/FilteredAlignmentTest.java
@@ -0,0 +1,284 @@
+package test.beast.evolution.alignment;
+
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import beast.evolution.alignment.*;
+import junit.framework.TestCase;
+import org.junit.Test;
+
+/** test FilteredAlignment as well as some aspects of Alignment **/
+public class FilteredAlignmentTest extends TestCase {
+
+    static public Alignment getAlignment() throws Exception {
+        Sequence human = new Sequence("0human", "AAAACCCCGGGGTTTT");
+        Sequence chimp = new Sequence("1chimp", "ACGTACGTACGTACGT");
+
+        Alignment data = new Alignment();
+        data.initByName("sequence", human, "sequence", chimp,
+                "dataType", "nucleotide"
+        );
+        return data;
+    }
+
+    static public Alignment getAlignmentNoTInHuman() throws Exception {
+        Sequence human = new Sequence("0human", "AAAACCCCGGGGAAAA");
+        Sequence chimp = new Sequence("1chimp", "ACGTACGTACGTACGT");
+
+        Alignment data = new Alignment();
+        data.initByName("sequence", human, "sequence", chimp,
+                "dataType", "nucleotide"
+        );
+        return data;
+    }
+
+    static public Alignment getAlignment2() throws Exception {
+    	// reordered from getAlignment()
+        Sequence human = new Sequence("0human", "AAAACCCCTTTTGGGG");
+        Sequence chimp = new Sequence("1chimp", "ACTGACGTACGTACGT");
+
+        Alignment data = new Alignment();
+        data.initByName("sequence", human, "sequence", chimp,
+                "dataType", "nucleotide"
+        );
+        return data;
+    }
+    
+    static public Alignment getAlignment3() throws Exception {
+    	// reordered from getAlignment() & with duplicates
+        Sequence human = new Sequence("0human", "GGGAAA");
+        Sequence chimp = new Sequence("1chimp", "AGGACA");
+
+        Alignment data = new Alignment();
+        data.initByName("sequence", human, "sequence", chimp,
+                "dataType", "nucleotide"
+        );
+        return data;
+    }
+
+    @Test
+    public void testIndividualsFiltered() throws Exception {
+        Alignment data = getAlignment();
+        FilteredAlignment data2 = new FilteredAlignment();
+        data2.initByName("data", data, "filter", "1");
+        assertEquals(1, data2.getSiteCount());
+
+        data2.initByName("data", data, "filter", "2,5");
+        assertEquals(2, data2.getSiteCount());
+
+        data2.initByName("data", data, "filter", "2,5,3,4");
+        assertEquals(4, data2.getSiteCount());
+    }
+    
+
+    @Test
+    public void testWeightedSites() throws Exception {
+    	// add constant sites to ordinary alignment
+        Alignment data = getAlignment();
+        try {
+        	data.siteWeightsInput.setValue("11232,2,3,4", data);
+        	data.initAndValidate();
+        	throw new Exception("Should have failed by now");
+        } catch (RuntimeException e) {
+        	System.err.println(e.getMessage());
+        }
+
+        // set up weighted alignment
+        data = getAlignment();
+        data.siteWeightsInput.setValue("11232, 2, 3, 4 ,1123,2,3,4,112,2,3,4,11,2,3,	4 ", data);
+        data.initAndValidate();
+        String weights = Arrays.toString(data.getWeights());
+        System.err.println(weights + "\n0human\t" + alignmentToString(data, data.getTaxonIndex("0human")) + "\n1chimp\t"
+                + alignmentToString(data, data.getTaxonIndex("1chimp")));
+        assertEquals("[11232, 2, 3, 4, 1123, 2, 3, 4, 112, 2, 3, 4, 11, 2, 3, 4]", weights);
+
+        data = getAlignment2();
+        data.siteWeightsInput.setValue("11232, 2, 3, 4 ,1123,2,3,4,112,2,3,4,11,2,3,	4 ", data);
+    	data.initAndValidate();
+        weights = Arrays.toString(data.getWeights());
+        System.err.println(weights + "\n" + alignmentToString(data, 0) + "\n" + alignmentToString(data, 1));
+        assertEquals("[11232, 2, 4, 3, 1123, 2, 3, 4, 11, 2, 3, 4, 112, 2, 3, 4]", weights);
+        
+        data = getAlignment3();
+    	data.siteWeightsInput.setValue("1, 10, 100, 1000, 10000, 100000", data);
+    	data.initAndValidate();
+        weights = Arrays.toString(data.getWeights());
+        System.err.println(weights + "\n" + alignmentToString(data, 0) + "\n" + alignmentToString(data, 1));
+        assertEquals("[101000, 10000, 1, 110]", weights);
+        
+
+        // pass alignment to filtered alignment
+        data = getAlignment();
+    	data.siteWeightsInput.setValue("11232, 2, 3, 4 ,1123,2,3,4,112,2,3,4,11,2,3,	4 ", data);
+    	data.initAndValidate();
+
+        FilteredAlignment data2 = new FilteredAlignment();
+        try {
+        	data2.initByName("data", data, "filter", "-");
+        	throw new Exception("Should have failed by now");        	
+        } catch (RuntimeException e) {
+        	System.err.println(e.getMessage());
+        }
+//        weights = Arrays.toString(data2.getWeights());
+//        System.err.println(weights);
+//        assertEquals("[11232, 2, 3, 4, 1123, 2, 3, 4, 112, 2, 3, 4, 11, 2, 3, 4]", weights);
+        
+//        data2 = new FilteredAlignment();
+//        data2.initByName("data", data, "filter", "3-8");
+//        weights = Arrays.toString(data2.getWeights());
+//        System.err.println(weights);
+//        assertEquals("[4, 1123, 2, 3, 4, 112]", weights);
+    }
+
+    public void testWeightedSitesReordered() throws Exception {
+
+        // reorder taxa
+        Alignment data = getAlignmentNoTInHuman();
+        data.setID("data");
+
+        List<Taxon> taxa = new ArrayList<>();
+        taxa.add(new Taxon("1chimp"));
+        taxa.add(new Taxon("0human"));
+        TaxonSet set = new TaxonSet(taxa);
+
+        data.taxonSetInput.setValue(set, data);
+        data.siteWeightsInput.setValue("11232, 2, 3, 4 ,1123,2,3,4,112,2,3,4,11,2,3,	4 ", data);
+        data.initAndValidate();
+
+        String weights = Arrays.toString(data.getWeights());
+
+        System.out.println(weights + "\n0human\t" + alignmentToString(data, data.getTaxonIndex("0human")) + "\n1chimp\t"
+                + alignmentToString(data, data.getTaxonIndex("1chimp")));
+        assertEquals("[11243, 1123, 112, 4, 2, 2, 6, 3, 3, 8, 4, 4]", weights);
+
+    }
+
+    @Test
+    public void testConstantSites() throws Exception {
+        Alignment data = getAlignment();
+
+        FilteredAlignment data2 = new FilteredAlignment();
+        // missing one weight for constant sites (nucleotide data)
+        try {
+            data2.initByName("data", data, "filter", "-", "constantSiteWeights", "11232  2  3");
+        	throw new Exception("Should have failed by now");
+        } catch (RuntimeException e) {
+        	System.err.println(e.getMessage());
+        }
+        
+        // filter alignment with constant sites
+        data2 = new FilteredAlignment();
+        data2.initByName("data", data, "filter", "-", "constantSiteWeights", "11232  2  3 4");
+        String weights = Arrays.toString(data2.getWeights());
+        System.err.println(weights);
+        assertEquals("[11233, 1, 1, 1, 1, 3, 1, 1, 1, 1, 4, 1, 1, 1, 1, 5]", weights);
+
+        // filter alignment with constant sites, so some constant sites are missing from the original alignment
+        data2 = new FilteredAlignment();
+        data2.initByName("data", data, "filter", "-8", "constantSiteWeights", "11232 2 3 4");
+        weights = Arrays.toString(data2.getWeights());
+        System.err.println(weights);
+        assertEquals("[11233, 1, 1, 1, 1, 3, 1, 1, 3, 4]", weights);
+        
+        // add constant sites to ordinary alignment and strip constant sites
+        data2 = new FilteredAlignment();
+        data2.initByName("data", data, "filter", "-8", "constantSiteWeights", "11232 2 3 4", "strip", true);
+        weights = Arrays.toString(data2.getWeights());
+        System.err.println(weights);
+        assertEquals("[11232, 1, 1, 1, 1, 2, 1, 1, 3, 4]", weights);
+    }
+    
+
+    @Test
+    public void testRangeFiltered() throws Exception {
+        Alignment data = getAlignment();
+        FilteredAlignment data2 = new FilteredAlignment();
+        data2.initByName("data", data, "filter", "1-9");
+        assertEquals(9, data2.getSiteCount());
+        assertEquals(9, data2.getPatternCount());
+
+        data2.initByName("data", data, "filter", "2-9");
+        assertEquals(8, data2.getSiteCount());
+        assertEquals(8, data2.getPatternCount());
+
+        data2.initByName("data", data, "filter", "10-");
+        assertEquals(7, data2.getSiteCount());
+
+        data2.initByName("data", data, "filter", "-10");
+        assertEquals(10, data2.getSiteCount());
+
+        data2.initByName("data", data, "filter", "-");
+        assertEquals(16, data2.getSiteCount());
+
+        data2.initByName("data", data, "filter", "2-5,7-10");
+        assertEquals(8, data2.getSiteCount());
+        assertEquals(8, data2.getPatternCount());
+    }
+
+    @Test
+    public void testIteratorFiltered() throws Exception {
+        Alignment data = getAlignment();
+        FilteredAlignment data2 = new FilteredAlignment();
+        data2.initByName("data", data, "filter", "1:16:2");
+        assertEquals(8, data2.getSiteCount());
+        assertEquals(8, data2.getPatternCount());
+
+        int iPattern = data2.getPatternIndex(0);
+        int[] pattern = data2.getPattern(iPattern);
+        assertEquals(0, pattern[0]);
+        assertEquals(0, pattern[1]);
+
+        data2.initByName("data", data, "filter", "2:16:2");
+        assertEquals(8, data2.getSiteCount());
+
+        iPattern = data2.getPatternIndex(0);
+        pattern = data2.getPattern(iPattern);
+        assertEquals(0, pattern[0]);
+        assertEquals(1, pattern[1]);
+
+        data2.initByName("data", data, "filter", "1:10:2");
+        assertEquals(5, data2.getSiteCount());
+
+        data2.initByName("data", data, "filter", "1::3");
+        assertEquals(6, data2.getSiteCount());
+
+        data2.initByName("data", data, "filter", "2::3");
+        assertEquals(5, data2.getSiteCount());
+
+        data2.initByName("data", data, "filter", "::");
+        assertEquals(16, data2.getSiteCount());
+
+        data2.initByName("data", data, "filter", "2:5:");
+        assertEquals(4, data2.getSiteCount());
+
+        data2.initByName("data", data, "filter", ":5:");
+        assertEquals(5, data2.getSiteCount());
+
+        data2.initByName("data", data, "filter", "1::3,2::3");
+        assertEquals(11, data2.getSiteCount());
+
+//        System.out.println(alignmentToString(data2, 1));
+
+        data2.initByName("data", data, "filter", "3::3");
+        assertEquals(5, data2.getSiteCount());
+
+//        System.out.println(alignmentToString(data2, 1));
+    }
+
+    String alignmentToString(Alignment data, int iTaxon) throws Exception {
+        int[] nStates = new int[data.getPatternCount()];
+//        for (int i = 0; i < data.getSiteCount(); i++) {
+//            int iPattern = data.getPatternIndex(i);
+//            int[] sitePattern = data.getPattern(iPattern);
+//            nStates[i] = sitePattern[iTaxon];
+//        }
+
+        for (int i = 0; i < data.getPatternCount(); i++) {
+            int[] sitePattern = data.getPattern(i);
+            nStates[i] = sitePattern[iTaxon];
+        }
+        return data.getDataType().state2string(nStates);
+    }
+}
diff --git a/src/test/beast/evolution/alignment/UncertainAlignmentTest.java b/src/test/beast/evolution/alignment/UncertainAlignmentTest.java
new file mode 100644
index 0000000..cc7bc46
--- /dev/null
+++ b/src/test/beast/evolution/alignment/UncertainAlignmentTest.java
@@ -0,0 +1,119 @@
+package test.beast.evolution.alignment;
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.junit.Test;
+
+import beast.evolution.alignment.Alignment;
+import beast.evolution.alignment.Sequence;
+import beast.evolution.datatype.DataType;
+import beast.evolution.tree.Tree;
+import beast.util.TreeParser;
+
+public class UncertainAlignmentTest extends TestCase {
+
+	static public Tree getTreeB(Alignment data) throws Exception {
+        TreeParser tree = new TreeParser();
+        tree.initByName("taxa", data,
+                "newick", "(seq1:2,(seq2:1,seq3:1):1);",
+                "IsLabelledNewick", true);
+        return tree;
+    }
+	
+	static public Tree getTreeA(Alignment data) throws Exception {
+        TreeParser tree = new TreeParser();
+        tree.initByName("taxa", data,
+                "newick", "((seq1:1,seq2:1):1,seq3:2);",
+                "IsLabelledNewick", true);
+        return tree;
+    }
+	static public Alignment getUncertainAlignment() throws Exception {
+    	return getUncertainAlignment(false);
+    }
+    static public Alignment getUncertainAlignmentDoubled() throws Exception {
+    	return getUncertainAlignment(true);
+    }
+    static public Alignment getUncertainAlignment(boolean duplicate) throws Exception {
+	      
+        String seq1Probs = new String("0.7,0.0,0.3,0.0; 0.0,0.3,0.0,0.7; 0.0,0.0,0.0,1.0;");
+        String seq2Probs = new String("0.7,0.0,0.3,0.0; 0.0,0.3,0.0,0.7; 0.0,1.0,0.0,0.0;");
+        String seq3Probs = new String("0.4,0.0,0.6,0.0; 0.0,0.6,0.0,0.4; 0.0,1.0,0.0,0.0;");
+        
+        if (duplicate) {
+        	seq1Probs += seq1Probs;
+        	seq2Probs += seq2Probs;
+        	seq3Probs += seq3Probs;
+        }
+        Sequence seq1 = new Sequence();
+		seq1.initByName("taxon","seq1","value",seq1Probs,"uncertain",true);
+		Sequence seq2 = new Sequence();
+		seq2.initByName("taxon","seq2","value",seq2Probs,"uncertain",true);
+		Sequence seq3 = new Sequence();
+		seq3.initByName("taxon","seq3","value",seq3Probs,"uncertain",true);
+                
+        Alignment data = new Alignment();
+        
+        data.initByName("sequence", seq1, "sequence", seq2, "sequence", seq3,
+                "dataType", "nucleotide"                
+        );
+
+    	DataType dataType = data.getDataType();
+        System.out.println("Most probable sequences:");
+    	for (List<Integer> seq : data.getCounts()) {
+    		System.out.println(dataType.state2string(seq));    		
+    	}
+    	
+        return data;
+    }
+    
+    static public Alignment getAlignment() throws Exception {
+    	
+    	// The sequences now denote the most likely annotation        
+    	Sequence seq1 = new Sequence("seq1", "ATT");
+        Sequence seq2 = new Sequence("seq2", "ATC");
+        Sequence seq3 = new Sequence("seq3", "GCC");
+        
+        Alignment data = new Alignment();
+        
+        data.initByName("sequence", seq1, "sequence", seq2, "sequence", seq3,
+                "dataType", "nucleotide"                
+        );
+    	
+        return data;
+    }
+
+    @Test
+    public void testUncertainAlignment() throws Exception {
+    	Alignment data = getUncertainAlignment();    	
+    	
+    	DataType dataType = data.getDataType();
+    	
+       	System.out.println("Tip likelihoods:");
+    	int nSites = data.getCounts().get(0).size();
+    	for (int taxon=0; taxon<data.getTaxonCount(); taxon++) {
+    		for (int i=0; i<nSites; i++) {
+	    		double[] probs = data.getTipLikelihoods(taxon,i);
+	    		for (int j=0; j<probs.length; j++) {
+	        		System.out.print(probs[j]+" ");
+	        	}
+	    		System.out.print("; ");
+    		}
+    		System.out.println();
+    	}
+    	
+    	System.out.println("Most likely sequences:");
+    	for (List<Integer> seq : data.getCounts()) {
+    		System.out.println(dataType.state2string(seq));    		
+    	}
+    	
+    	Alignment data2 = getAlignment();
+    	
+    	for (int taxon=0; taxon<data.getTaxonCount(); taxon++) {
+    		assertEquals(data.getCounts().get(taxon),data2.getCounts().get(taxon));
+    	}    	        	    	            	    
+    }  
+}
diff --git a/src/test/beast/evolution/alignment/UnorderedAlignmentsTest.java b/src/test/beast/evolution/alignment/UnorderedAlignmentsTest.java
new file mode 100644
index 0000000..c533503
--- /dev/null
+++ b/src/test/beast/evolution/alignment/UnorderedAlignmentsTest.java
@@ -0,0 +1,107 @@
+package test.beast.evolution.alignment;
+
+
+import beast.app.seqgen.SimulatedAlignment;
+import beast.core.parameter.RealParameter;
+import beast.evolution.alignment.Alignment;
+import beast.evolution.alignment.Taxon;
+import beast.evolution.alignment.TaxonSet;
+import beast.evolution.likelihood.TreeLikelihood;
+import beast.evolution.sitemodel.SiteModel;
+import beast.evolution.substitutionmodel.Frequencies;
+import beast.evolution.substitutionmodel.HKY;
+import beast.evolution.tree.RandomTree;
+import beast.evolution.tree.TraitSet;
+import beast.evolution.tree.Tree;
+import beast.evolution.tree.coalescent.ConstantPopulation;
+import junit.framework.TestCase;
+import org.junit.Test;
+
+import java.util.Collections;
+import java.util.stream.Collectors;
+import java.util.stream.IntStream;
+
+public class UnorderedAlignmentsTest extends TestCase {
+
+    static public TaxonSet getTaxa() throws Exception {
+        return new TaxonSet(IntStream.range(65, 81).mapToObj(i -> ((Character) (char) i).toString()).map((java.util.function.Function<String, Taxon>) (id) -> {
+            try {
+                return new Taxon(id);
+            } catch (Exception e) {
+                throw new RuntimeException(e);
+            }
+        }).collect(Collectors.toList()));
+    }
+
+    static public TraitSet getDates(TaxonSet taxa) throws Exception {
+        TraitSet timeTrait = new TraitSet();
+        String trait = String.join(",", (Iterable<String>) IntStream.range(0, 16).mapToObj(i -> taxa.getTaxonId(i) + "=" + i / 3.0)::iterator);
+        timeTrait.initByName(
+                "traitname", "date-forward",
+                "taxa", taxa,
+                "value", trait);
+        return timeTrait;
+    }
+
+    static public Tree getTree(TaxonSet taxa) throws Exception {
+        Tree tree = new RandomTree();
+        TraitSet dates = getDates(taxa);
+        ConstantPopulation constant = new ConstantPopulation();
+        constant.initByName("popSize", new RealParameter("5.0"));
+        tree.initByName(
+                "taxonset", taxa,
+                "populationModel", constant,
+                "trait", dates);
+        return tree;
+    }
+
+    static public SiteModel getSiteModel() throws Exception {
+        Frequencies frequencies = new Frequencies();
+        frequencies.initByName("frequencies", new RealParameter("0.25 0.25 0.25 0.25"));
+        HKY hky = new HKY();
+        hky.initByName("kappa", new RealParameter("1.0"), "frequencies", frequencies);
+        SiteModel siteModel = new SiteModel();
+        siteModel.initByName("mutationRate", new RealParameter("0.005"), "substModel", hky);
+        return siteModel;
+    }
+
+    static public Alignment getAlignment(TaxonSet taxa, Tree tree, SiteModel siteModel) throws Exception {
+        Alignment dummy = new Alignment();
+        String[] args = new String[2 * taxa.getTaxonCount() + 2];
+        args[args.length - 2] = "dataType";
+        args[args.length - 1] = "nucleotide";
+        for (int i = 0; i < taxa.getTaxonCount(); ++i) {
+            args[2*i] = taxa.getTaxonId(i);
+            args[2*i+1] = "N";
+        }
+        dummy.initByName(args);
+        SimulatedAlignment data = new SimulatedAlignment();
+        data.initByName("data", dummy, "tree", tree, "siteModel", siteModel);
+        return data;
+    }
+
+    @Test
+    public void testUnorderedAlignment() throws Exception {
+        TaxonSet taxa = getTaxa();
+        Tree tree = getTree(taxa);
+        SiteModel siteModel = getSiteModel();
+        double logP = 0.0;
+        double shuffledLogP = 0.0;
+        for (int i = 0; i < 3; ++i) {
+            Alignment data = getAlignment(taxa, tree, siteModel);
+
+            // First calculate in order
+            TreeLikelihood likelihood = new TreeLikelihood();
+            likelihood.initByName("data", data, "tree", tree, "siteModel", siteModel);
+            logP += likelihood.calculateLogP();
+
+            // Now calculate again, with shuffled taxon order
+            Collections.shuffle(data.sequenceInput.get());
+            likelihood = new TreeLikelihood();
+            likelihood.initByName("data", data, "tree", tree, "siteModel", siteModel);
+            shuffledLogP += likelihood.calculateLogP();
+        }
+        assertEquals(logP, shuffledLogP, 1E-9);
+    }
+
+}
diff --git a/src/test/beast/evolution/likelihood/TreeLikelihoodTest.java b/src/test/beast/evolution/likelihood/TreeLikelihoodTest.java
new file mode 100644
index 0000000..07a3032
--- /dev/null
+++ b/src/test/beast/evolution/likelihood/TreeLikelihoodTest.java
@@ -0,0 +1,690 @@
+package test.beast.evolution.likelihood;
+
+
+import junit.framework.TestCase;
+import org.junit.Test;
+
+import beast.core.parameter.RealParameter;
+import beast.evolution.alignment.Alignment;
+import beast.evolution.alignment.Sequence;
+import beast.evolution.datatype.UserDataType;
+import beast.evolution.likelihood.TreeLikelihood;
+import beast.evolution.sitemodel.SiteModel;
+import beast.evolution.substitutionmodel.BinaryCovarion;
+import beast.evolution.substitutionmodel.Blosum62;
+import beast.evolution.substitutionmodel.CPREV;
+import beast.evolution.substitutionmodel.Dayhoff;
+import beast.evolution.substitutionmodel.Frequencies;
+import beast.evolution.substitutionmodel.GTR;
+import beast.evolution.substitutionmodel.GeneralSubstitutionModel;
+import beast.evolution.substitutionmodel.HKY;
+import beast.evolution.substitutionmodel.JTT;
+import beast.evolution.substitutionmodel.JukesCantor;
+import beast.evolution.substitutionmodel.MTREV;
+import beast.evolution.substitutionmodel.MutationDeathModel;
+import beast.evolution.substitutionmodel.SubstitutionModel;
+import beast.evolution.substitutionmodel.WAG;
+import beast.evolution.tree.Tree;
+
+import test.beast.BEASTTestCase;
+import test.beast.evolution.alignment.UncertainAlignmentTest;
+
+/**
+ * This test mimics the testLikelihood.xml file from Beast 1, which compares Beast 1 results to PAUP results.
+ * So, it these tests succeed, then Beast II calculates the same for these simple models as Beast 1 and PAUP.
+ * *
+ */
+public class TreeLikelihoodTest extends TestCase {
+
+    public TreeLikelihoodTest() {
+        super();
+    }
+
+    protected TreeLikelihood newTreeLikelihood() {
+    	System.setProperty("java.only","true");
+        return new TreeLikelihood();
+    }
+
+    @Test
+    public void testJC69Likelihood() throws Exception {
+        // Set up JC69 model: uniform freqs, kappa = 1, 0 gamma categories
+        Alignment data = BEASTTestCase.getAlignment();
+        Tree tree = BEASTTestCase.getTree(data);
+
+        JukesCantor JC = new JukesCantor();
+        JC.initAndValidate();
+
+        SiteModel siteModel = new SiteModel();
+        siteModel.initByName("mutationRate", "1.0", "gammaCategoryCount", 1, "substModel", JC);
+
+        TreeLikelihood likelihood = newTreeLikelihood();
+        likelihood.initByName("data", data, "tree", tree, "siteModel", siteModel);
+        double fLogP = 0;
+        fLogP = likelihood.calculateLogP();
+        assertEquals(fLogP, -1992.2056440317247, BEASTTestCase.PRECISION);
+
+        likelihood.initByName("useAmbiguities", true, "data", data, "tree", tree, "siteModel", siteModel);
+        fLogP = likelihood.calculateLogP();
+        assertEquals(fLogP, -1992.2056440317247, BEASTTestCase.PRECISION);
+    }
+
+    @Test
+    public void testJC69LikelihoodWithUncertainCharacters() throws Exception {
+    	    	    	
+    	Alignment data = UncertainAlignmentTest.getAlignment();
+    	Alignment data2 = UncertainAlignmentTest.getUncertainAlignment();
+    	double[] logL, logL_uncertain;
+    	
+    	System.out.println("\nTree A:");
+    	Tree tree = UncertainAlignmentTest.getTreeA(data2);    	    	
+    	logL = testJC69Likelihood(data,tree);
+    	logL_uncertain = testJC69Likelihood(data2,tree);
+    	double x1 = -11.853202336328778;
+    	double x2 = -12.069603116476458;
+    	assertEquals(logL[0], x1, BEASTTestCase.PRECISION);    	
+    	assertEquals(logL[1], x1, BEASTTestCase.PRECISION);
+    	assertEquals(logL_uncertain[0], x1, BEASTTestCase.PRECISION);    	
+    	assertEquals(logL_uncertain[1], x2, BEASTTestCase.PRECISION);    	
+    	
+    	System.out.println("\nTree B:");
+    	tree = UncertainAlignmentTest.getTreeB(data2);
+    	logL = testJC69Likelihood(data,tree);
+    	logL_uncertain = testJC69Likelihood(data2,tree);
+    	double x3 = -12.421114302827698;
+    	double x4 = -11.62105662310513;
+    	assertEquals(logL[0], x3, BEASTTestCase.PRECISION);    	
+    	assertEquals(logL[1], x3, BEASTTestCase.PRECISION);
+    	assertEquals(logL_uncertain[0], x3, BEASTTestCase.PRECISION);    	
+    	assertEquals(logL_uncertain[1], x4, BEASTTestCase.PRECISION);    	    
+    	
+    	System.out.println("\nTesting alignment doubling:");
+    	Alignment data3 = UncertainAlignmentTest.getUncertainAlignmentDoubled();    	    	
+    	logL_uncertain = testJC69Likelihood(data3,tree);
+    	assertEquals(logL_uncertain[0], 2 * x3, BEASTTestCase.PRECISION);    	
+    	assertEquals(logL_uncertain[1], 2 * x4, BEASTTestCase.PRECISION);    	    
+    	
+    }        
+    
+    public double[] testJC69Likelihood(Alignment data, Tree tree) throws Exception {
+        // Set up JC69 model: uniform freqs, kappa = 1, 0 gamma categories                              
+        JukesCantor JC = new JukesCantor();
+        JC.initAndValidate();
+
+        SiteModel siteModel = new SiteModel();
+        siteModel.initByName("mutationRate", "0.6", "substModel", JC);
+        // NB The rate in the JC model used here is actually alpha * 3 in the usual sense, because
+        // it's divided by 3 before multiplying in the exponent (not sure why)
+
+        System.out.println("Without tip likelihoods:");
+        TreeLikelihood likelihood = newTreeLikelihood();
+        likelihood.initByName("data", data, "tree", tree, "siteModel", siteModel, "scaling", TreeLikelihood.Scaling.none);        
+        double[] fLogP = new double[2];
+        fLogP[0] = likelihood.calculateLogP();
+        System.out.println(fLogP[0]);
+
+        System.out.println("With tip likelihoods:");
+        likelihood.initByName("useTipLikelihoods", true, "data", data, "tree", tree, "siteModel", siteModel, "scaling", TreeLikelihood.Scaling.none);
+        fLogP[1]= likelihood.calculateLogP();
+        System.out.println(fLogP[1]);
+
+        return fLogP;
+    }
+    
+    @Test
+    public void testAscertainedJC69Likelihood() throws Exception {
+        // as testJC69Likelihood but with ascertained alignment
+        Alignment data = BEASTTestCase.getAscertainedAlignment();
+        Tree tree = BEASTTestCase.getTree(data);
+
+        Frequencies freqs = new Frequencies();
+        freqs.initByName("data", data,
+                "estimate", false);
+
+        HKY hky = new HKY();
+        hky.initByName("kappa", "1.0", "frequencies", freqs);
+
+        SiteModel siteModel = new SiteModel();
+        siteModel.initByName("mutationRate", "1.0", "gammaCategoryCount", 1, "substModel", hky);
+
+        TreeLikelihood likelihood = newTreeLikelihood();
+        likelihood.initByName("data", data, "tree", tree, "siteModel", siteModel);
+
+        double fLogP = 0;
+        fLogP = likelihood.calculateLogP();
+        // the following number comes from Beast 1.6        
+        assertEquals(fLogP, -737.7140695360017, BEASTTestCase.PRECISION);
+    }
+
+    @Test
+    public void testK80Likelihood() throws Exception {
+        // Set up K80 model: uniform freqs, kappa = 27.402591, 0 gamma categories
+        Alignment data = BEASTTestCase.getAlignment();
+        Tree tree = BEASTTestCase.getTree(data);
+
+        Frequencies freqs = new Frequencies();
+        freqs.initByName("data", data,
+                "estimate", false);
+
+        HKY hky = new HKY();
+        hky.initByName("kappa", "27.40259", "frequencies", freqs);
+
+        SiteModel siteModel = new SiteModel();
+        siteModel.initByName("mutationRate", "1.0", "gammaCategoryCount", 1, "substModel", hky);
+
+        TreeLikelihood likelihood = newTreeLikelihood();
+        likelihood.initByName("data", data, "tree", tree, "siteModel", siteModel);
+
+        double fLogP = 0;
+        fLogP = likelihood.calculateLogP();
+        assertEquals(fLogP, -1856.303048876734, BEASTTestCase.PRECISION);
+
+        likelihood.initByName("useAmbiguities", true, "data", data, "tree", tree, "siteModel", siteModel);
+        fLogP = likelihood.calculateLogP();
+        assertEquals(fLogP, -1856.303048876734, BEASTTestCase.PRECISION);
+    }
+
+    @Test
+    public void testHKY85Likelihood() throws Exception {
+        // Set up HKY85 model: estimated freqs, kappa = 29.739445, 0 gamma categories
+        Alignment data = BEASTTestCase.getAlignment();
+        Tree tree = BEASTTestCase.getTree(data);
+
+        Frequencies freqs = new Frequencies();
+        freqs.initByName("data", data);
+
+        HKY hky = new HKY();
+        hky.initByName("kappa", "29.739445", "frequencies", freqs);
+
+        SiteModel siteModel = new SiteModel();
+        siteModel.initByName("mutationRate", "1.0", "gammaCategoryCount", 1, "substModel", hky);
+
+        TreeLikelihood likelihood = newTreeLikelihood();
+        likelihood.initByName("data", data, "tree", tree, "siteModel", siteModel);
+
+        double fLogP = 0;
+        fLogP = likelihood.calculateLogP();
+        assertEquals(fLogP, -1825.2131708068507, BEASTTestCase.PRECISION);
+
+        likelihood.initByName("useAmbiguities", true, "data", data, "tree", tree, "siteModel", siteModel);
+        fLogP = likelihood.calculateLogP();
+        assertEquals(fLogP, -1825.2131708068507, BEASTTestCase.PRECISION);
+    }
+
+
+    @Test
+    public void testHKY85GLikelihood() throws Exception {
+        // Set up HKY85+G model: estimated freqs, kappa = 38.82974, 4 gamma categories, shape = 0.137064
+        Alignment data = BEASTTestCase.getAlignment();
+        Tree tree = BEASTTestCase.getTree(data);
+
+        Frequencies freqs = new Frequencies();
+        freqs.initByName("data", data);
+
+        HKY hky = new HKY();
+        hky.initByName("kappa", "38.82974", "frequencies", freqs);
+
+        SiteModel siteModel = new SiteModel();
+        siteModel.initByName("mutationRate", "1.0", "gammaCategoryCount", 4,
+                "shape", "0.137064",
+                "proportionInvariant", "0.0",
+                "substModel", hky);
+
+        TreeLikelihood likelihood = newTreeLikelihood();
+        likelihood.initByName("data", data, "tree", tree, "siteModel", siteModel);
+
+        double fLogP = 0;
+        fLogP = likelihood.calculateLogP();
+        System.err.println(fLogP - -1789.7593576610134);
+        assertEquals(fLogP, -1789.7593576610134, BEASTTestCase.PRECISION);
+
+        likelihood.initByName("useAmbiguities", true, "data", data, "tree", tree, "siteModel", siteModel);
+        fLogP = likelihood.calculateLogP();
+        assertEquals(fLogP, -1789.7593576610134, BEASTTestCase.PRECISION);
+    }
+
+    @Test
+    public void testHKY85ILikelihood() throws Exception {
+        // Set up HKY85+I model: estimated freqs, kappa = 38.564672, 0 gamma categories, prop invariant = 0.701211
+        Alignment data = BEASTTestCase.getAlignment();
+        Tree tree = BEASTTestCase.getTree(data);
+
+        Frequencies freqs = new Frequencies();
+        freqs.initByName("data", data);
+
+        HKY hky = new HKY();
+        hky.initByName("kappa", "38.564672", "frequencies", freqs);
+
+        SiteModel siteModel = new SiteModel();
+        siteModel.initByName("mutationRate", "1.0", "gammaCategoryCount", 1,
+                "shape", "0.137064",
+                "proportionInvariant", "0.701211",
+                "substModel", hky);
+
+        TreeLikelihood likelihood = newTreeLikelihood();
+        likelihood.initByName("data", data, "tree", tree, "siteModel", siteModel);
+
+        double fLogP = 0;
+        fLogP = likelihood.calculateLogP();
+        assertEquals(fLogP, -1789.912401996943, BEASTTestCase.PRECISION);
+
+        likelihood.initByName("useAmbiguities", true, "data", data, "tree", tree, "siteModel", siteModel);
+        fLogP = likelihood.calculateLogP();
+        assertEquals(fLogP, -1789.912401996943, BEASTTestCase.PRECISION);
+    }
+
+    @Test
+    public void testHKY85GILikelihood() throws Exception {
+        // Set up HKY85+G+I model: estimated freqs, kappa = 39.464538, 4 gamma categories, shape = 0.587649, prop invariant = 0.486548
+        Alignment data = BEASTTestCase.getAlignment();
+        Tree tree = BEASTTestCase.getTree(data);
+
+        Frequencies freqs = new Frequencies();
+        freqs.initByName("data", data);
+
+        HKY hky = new HKY();
+        hky.initByName("kappa", "39.464538", "frequencies", freqs);
+
+        SiteModel siteModel = new SiteModel();
+        siteModel.initByName("mutationRate", "1.0", "gammaCategoryCount", 4,
+                "shape", "0.587649",
+                "proportionInvariant", "0.486548",
+                "substModel", hky);
+
+        TreeLikelihood likelihood = newTreeLikelihood();
+        likelihood.initByName("data", data, "tree", tree, "siteModel", siteModel);
+
+        double fLogP = 0;
+        fLogP = likelihood.calculateLogP();
+        assertEquals(fLogP, -1789.639227747059, BEASTTestCase.PRECISION);
+
+        likelihood.initByName("useAmbiguities", true, "data", data, "tree", tree, "siteModel", siteModel);
+        fLogP = likelihood.calculateLogP();
+        assertEquals(fLogP, -1789.639227747059, BEASTTestCase.PRECISION);
+    }
+
+
+    @Test
+    public void testGTRLikelihood() throws Exception {
+        // Set up GTR model: no gamma categories, no proportion invariant
+        Alignment data = BEASTTestCase.getAlignment();
+        Tree tree = BEASTTestCase.getTree(data);
+
+        Frequencies freqs = new Frequencies();
+        freqs.initByName("data", data);
+
+        GTR gsm = new GTR();
+        gsm.initByName("frequencies", freqs);
+
+        SiteModel siteModel = new SiteModel();
+        siteModel.initByName("mutationRate", "1.0", "gammaCategoryCount", 1,
+                "substModel", gsm);
+
+        TreeLikelihood likelihood = newTreeLikelihood();
+        likelihood.initByName("data", data, "tree", tree, "siteModel", siteModel);
+
+        double fLogP = 0;
+        fLogP = likelihood.calculateLogP();
+        assertEquals(fLogP, -1969.145839307625, BEASTTestCase.PRECISION);
+
+        likelihood.initByName("useAmbiguities", false, "data", data, "tree", tree, "siteModel", siteModel);
+        fLogP = likelihood.calculateLogP();
+        assertEquals(fLogP, -1969.145839307625, BEASTTestCase.PRECISION);
+    }
+
+    @Test
+    public void testGTRILikelihood() throws Exception {
+        // Set up GTR model: prop invariant = 0.5
+        Alignment data = BEASTTestCase.getAlignment();
+        Tree tree = BEASTTestCase.getTree(data);
+
+        Frequencies freqs = new Frequencies();
+        freqs.initByName("data", data);
+
+        GeneralSubstitutionModel gsm = new GeneralSubstitutionModel();
+        gsm.initByName("rates", "1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0", "frequencies", freqs);
+
+        SiteModel siteModel = new SiteModel();
+        siteModel.initByName("mutationRate", "1.0", "gammaCategoryCount", 1,
+                "proportionInvariant", "0.5",
+                "substModel", gsm);
+        //siteModel.init("1.0", 1, null, "0.5", gsm);
+
+        TreeLikelihood likelihood = newTreeLikelihood();
+        likelihood.initByName("data", data, "tree", tree, "siteModel", siteModel);
+
+        double fLogP = 0;
+        fLogP = likelihood.calculateLogP();
+        assertEquals(fLogP, -1948.8417455357564, BEASTTestCase.PRECISION);
+
+        likelihood.initByName("useAmbiguities", false, "data", data, "tree", tree, "siteModel", siteModel);
+        fLogP = likelihood.calculateLogP();
+        assertEquals(fLogP, -1948.8417455357564, BEASTTestCase.PRECISION);
+    }
+
+    @Test
+    public void testGTRGLikelihood() throws Exception {
+        // Set up GTR model: 4 gamma categories, gamma shape = 0.5
+        Alignment data = BEASTTestCase.getAlignment();
+        Tree tree = BEASTTestCase.getTree(data);
+
+        Frequencies freqs = new Frequencies();
+        freqs.initByName("data", data);
+
+        GeneralSubstitutionModel gsm = new GeneralSubstitutionModel();
+        gsm.initByName("rates", "1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0", "frequencies", freqs);
+
+        SiteModel siteModel = new SiteModel();
+        siteModel.initByName("mutationRate", "1.0", "gammaCategoryCount", 4,
+                "shape", "0.5",
+                "substModel", gsm);
+
+        TreeLikelihood likelihood = newTreeLikelihood();
+        likelihood.initByName("data", data, "tree", tree, "siteModel", siteModel);
+
+        double fLogP = 0;
+        fLogP = likelihood.calculateLogP();
+        assertEquals(fLogP, -1949.0360143622, BEASTTestCase.PRECISION);
+
+        likelihood.initByName("useAmbiguities", false, "data", data, "tree", tree, "siteModel", siteModel);
+        fLogP = likelihood.calculateLogP();
+        assertEquals(fLogP, -1949.0360143622, BEASTTestCase.PRECISION);
+    }
+
+    @Test
+    public void testGTRGILikelihood() throws Exception {
+        // Set up GTR model: 4 gamma categories, gamma shape = 0.5, prop invariant = 0.5
+        Alignment data = BEASTTestCase.getAlignment();
+        Tree tree = BEASTTestCase.getTree(data);
+
+        Frequencies freqs = new Frequencies();
+        freqs.initByName("data", data);
+
+        GeneralSubstitutionModel gsm = new GeneralSubstitutionModel();
+        gsm.initByName("rates", "1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0", "frequencies", freqs);
+
+        SiteModel siteModel = new SiteModel();
+        siteModel.initByName("mutationRate", "1.0", "gammaCategoryCount", 4,
+                "shape", "0.5",
+                "proportionInvariant", "0.5",
+                "substModel", gsm);
+
+        TreeLikelihood likelihood = newTreeLikelihood();
+        likelihood.initByName("data", data, "tree", tree, "siteModel", siteModel);
+
+        double fLogP = 0;
+        fLogP = likelihood.calculateLogP();
+        assertEquals(fLogP, -1947.5829396144961, BEASTTestCase.PRECISION);
+
+        likelihood.initByName("useAmbiguities", false, "data", data, "tree", tree, "siteModel", siteModel);
+        fLogP = likelihood.calculateLogP();
+        assertEquals(fLogP, -1947.5829396144961, BEASTTestCase.PRECISION);
+    }
+
+    void aminoacidModelTest(SubstitutionModel substModel, double fExpectedValue) throws Exception {
+        Alignment data = BEASTTestCase.getAminoAcidAlignment();
+        Tree tree = BEASTTestCase.getAminoAcidTree(data);
+        SiteModel siteModel = new SiteModel();
+        siteModel.initByName("mutationRate", "1.0", "gammaCategoryCount", 1, "substModel", substModel);
+
+        TreeLikelihood likelihood = newTreeLikelihood();
+        likelihood.initByName("data", data, "tree", tree, "siteModel", siteModel);
+        double fLogP = 0;
+        fLogP = likelihood.calculateLogP();
+        assertEquals(fExpectedValue, fLogP, BEASTTestCase.PRECISION);
+    }
+
+    @Test
+    public void testAminoAcidLikelihoodWAG() throws Exception {
+        // Set up WAG model
+        WAG wag = new WAG();
+        wag.initAndValidate();
+        aminoacidModelTest(wag, -338.6388785157248);
+
+    }
+
+    @Test
+    public void testAminoAcidLikelihoodJTT() throws Exception {
+        // JTT
+        JTT jtt = new JTT();
+        jtt.initAndValidate();
+        aminoacidModelTest(jtt, -338.80761792179726);
+
+    }
+
+    @Test
+    public void testAminoAcidLikelihoodBlosum62() throws Exception {
+        // Blosum62
+        Blosum62 blosum62 = new Blosum62();
+        blosum62.initAndValidate();
+        aminoacidModelTest(blosum62, -345.3825963600176);
+
+    }
+
+    @Test
+    public void testAminoAcidLikelihoodDayhoff() throws Exception {
+        // Dayhoff
+        Dayhoff dayhoff = new Dayhoff();
+        dayhoff.initAndValidate();
+        aminoacidModelTest(dayhoff, -340.6149187667345);
+    }
+
+    @Test
+    public void testAminoAcidLikelihoodcpRev() throws Exception {
+        // cpRev
+        CPREV cpRev = new CPREV();
+        cpRev.initAndValidate();
+        aminoacidModelTest(cpRev, -348.71458467304154);
+    }
+
+    @Test
+    public void testAminoAcidLikelihoodMTRev() throws Exception {
+        // MTRev
+        MTREV mtRev = new MTREV();
+        mtRev.initAndValidate();
+        aminoacidModelTest(mtRev, -369.4791633617842);
+
+    }
+
+    void aminoacidModelTestI(SubstitutionModel substModel, double fExpectedValue) throws Exception {
+        Alignment data = BEASTTestCase.getAminoAcidAlignment();
+        Tree tree = BEASTTestCase.getAminoAcidTree(data);
+        SiteModel siteModel = new SiteModel();
+        siteModel.initByName("mutationRate", "1.0", "gammaCategoryCount", 1, "substModel", substModel,
+                "proportionInvariant", "0.2");
+
+        TreeLikelihood likelihood = newTreeLikelihood();
+        likelihood.initByName("data", data, "tree", tree, "siteModel", siteModel);
+        double fLogP = 0;
+        fLogP = likelihood.calculateLogP();
+        assertEquals(fExpectedValue, fLogP, BEASTTestCase.PRECISION);
+    }
+
+    @Test
+    public void testAminoAcidLikelihoodIWAG() throws Exception {
+        // Set up WAG model
+        WAG wag = new WAG();
+        wag.initAndValidate();
+        aminoacidModelTestI(wag, -338.7631166242887);
+    }
+
+    @Test
+    public void testAminoAcidLikelihoodIJTT() throws Exception {
+        // JTT
+        JTT jtt = new JTT();
+        jtt.initAndValidate();
+        aminoacidModelTestI(jtt, -338.97566093453275);
+    }
+
+    @Test
+    public void testAminoAcidLikelihoodIBlosum62() throws Exception {
+        // Blosum62
+        Blosum62 blosum62 = new Blosum62();
+        blosum62.initAndValidate();
+        aminoacidModelTestI(blosum62, -345.4456979614507);
+    }
+
+    @Test
+    public void testAminoAcidLikelihoodIDayhoff() throws Exception {
+        // Dayhoff
+        Dayhoff dayhoff = new Dayhoff();
+        dayhoff.initAndValidate();
+        aminoacidModelTestI(dayhoff, -340.7630258641759);
+    }
+
+    @Test
+    public void testAminoAcidLikelihoodIcpRev() throws Exception {
+        // cpRev
+        CPREV cpRev = new CPREV();
+        cpRev.initAndValidate();
+        aminoacidModelTestI(cpRev, -348.66316715026977);
+    }
+
+    @Test
+    public void testAminoAcidLikelihoodIMTRev() throws Exception {
+        // MTRev
+        MTREV mtRev = new MTREV();
+        mtRev.initAndValidate();
+        aminoacidModelTestI(mtRev, -369.34449408200175);
+
+    }
+
+    void aminoacidModelTestIG(SubstitutionModel substModel, double fExpectedValue) throws Exception {
+        Alignment data = BEASTTestCase.getAminoAcidAlignment();
+        Tree tree = BEASTTestCase.getAminoAcidTree(data);
+        SiteModel siteModel = new SiteModel();
+        siteModel.initByName("mutationRate", "1.0", "gammaCategoryCount", 1, "substModel", substModel,
+                "gammaCategoryCount", 4,
+                "shape", "0.15",
+                "proportionInvariant", "0.2");
+
+        TreeLikelihood likelihood = newTreeLikelihood();
+        likelihood.initByName("data", data, "tree", tree, "siteModel", siteModel);
+        double fLogP = 0;
+        fLogP = likelihood.calculateLogP();
+        assertEquals(fExpectedValue, fLogP, BEASTTestCase.PRECISION);
+    }
+
+    @Test
+    public void testAminoAcidLikelihoodGIWAG() throws Exception {
+        // Set up WAG model
+        WAG wag = new WAG();
+        wag.initAndValidate();
+        aminoacidModelTestIG(wag, -342.69745607208495);
+    }
+
+    @Test
+    public void testAminoAcidLikelihoodGIJTT() throws Exception {
+        // JTT
+        JTT jtt = new JTT();
+        jtt.initAndValidate();
+        aminoacidModelTestIG(jtt, -343.23738058653373);
+    }
+
+    @Test
+    public void testAminoAcidLikelihoodGIBlosum62() throws Exception {
+        // Blosum62
+        Blosum62 blosum62 = new Blosum62();
+        blosum62.initAndValidate();
+        aminoacidModelTestIG(blosum62, -348.7305212479578);
+    }
+
+    @Test
+    public void testAminoAcidLikelihoodGIDayhoff() throws Exception {
+        // Dayhoff
+        Dayhoff dayhoff = new Dayhoff();
+        dayhoff.initAndValidate();
+        aminoacidModelTestIG(dayhoff, -345.11861069556966);
+    }
+
+    @Test
+    public void testAminoAcidLikelihoodGIcpRev() throws Exception {
+
+        // cpRev
+        CPREV cpRev = new CPREV();
+        cpRev.initAndValidate();
+        aminoacidModelTestIG(cpRev, -351.35553855806137);
+    }
+
+    @Test
+    public void testAminoAcidLikelihoodGIMTRev() throws Exception {
+        // MTRev
+        MTREV mtRev = new MTREV();
+        mtRev.initAndValidate();
+        aminoacidModelTestIG(mtRev, -371.0038574147396);
+
+    }
+
+    @Test
+    public void testSDolloLikelihood() throws Exception {
+        UserDataType dataType = new UserDataType();
+        dataType.initByName("states", 2, "codeMap", "0=1, 1=0, ?=0 1, -=0 1");
+        Alignment data = new Alignment();
+
+        Sequence German_ST = new Sequence("German_ST", BEASTTestCase.German_ST.dataInput.get());
+        Sequence Dutch_List = new Sequence("Dutch_List", BEASTTestCase.Dutch_List.dataInput.get());
+        ;
+        Sequence English_ST = new Sequence("English_ST", BEASTTestCase.English_ST.dataInput.get());
+        ;
+        Sequence French = new Sequence("French", BEASTTestCase.French.dataInput.get());
+        ;
+        Sequence Italian = new Sequence("Italian", BEASTTestCase.Italian.dataInput.get());
+        ;
+        Sequence Spanish = new Sequence("Spanish", BEASTTestCase.Spanish.dataInput.get());
+        ;
+
+
+        data.initByName("sequence", German_ST, "sequence", Dutch_List, "sequence", English_ST, "sequence", French, "sequence", Italian, "sequence", Spanish,
+                "userDataType", dataType
+        );
+
+        Tree tree = BEASTTestCase.getTree(data, "((English_ST:0.22743347188019544,(German_ST:0.10557648379843088,Dutch_List:0.10557648379843088):0.12185698808176457):1.5793160946109988,(Spanish:0.11078392189606047,(Italian:0.10119772534558173,French:0.10119772534558173):0.009586196550478737):1.6959656445951337)");
+
+        RealParameter frequencies = new RealParameter("1 0");
+        Frequencies freqs = new Frequencies();
+        freqs.initByName("frequencies", frequencies);
+
+        RealParameter deathprob = new RealParameter("1.7");
+        MutationDeathModel SDollo = new MutationDeathModel();
+        SDollo.initByName("deathprob", deathprob, "frequencies", freqs);
+
+        SiteModel siteModel = new SiteModel();
+        siteModel.initByName("mutationRate", "1.0", "gammaCategoryCount", 1, "substModel", SDollo);
+
+        TreeLikelihood likelihood = newTreeLikelihood();
+        likelihood.initByName("data", data, "tree", tree, "siteModel", siteModel);
+
+        double fLogP = 0;
+        likelihood.initByName("data", data, "tree", tree, "siteModel", siteModel, "useAmbiguities", true);
+        fLogP = likelihood.calculateLogP();
+        // beast1 xml gives -3551.6436
+        assertEquals(fLogP, -3551.6436270344648, BEASTTestCase.PRECISION);
+    }
+
+
+    @Test
+    public void testBinaryCovarionLikelihood() throws Exception {
+        Alignment data = BEASTTestCase.getCovarionAlignment();
+        Tree tree = BEASTTestCase.getTree(data, "((English_ST:0.22743347188019544,(German_ST:0.10557648379843088,Dutch_List:0.10557648379843088):0.12185698808176457):1.5793160946109988,(Spanish:0.11078392189606047,(Italian:0.10119772534558173,French:0.10119772534558173):0.009586196550478737):1.6959656445951337)");
+
+
+        RealParameter alpha = new RealParameter("0.284");
+        RealParameter switchRate = new RealParameter("0.829");
+        RealParameter frequencies = new RealParameter("0.683 0.317");
+        RealParameter hfrequencies = new RealParameter("0.5 0.5");
+        BinaryCovarion covarion = new BinaryCovarion();
+        covarion.initByName("alpha", alpha, "switchRate", switchRate, "vfrequencies", frequencies, "hfrequencies", hfrequencies);
+
+        SiteModel siteModel = new SiteModel();
+        siteModel.initByName("mutationRate", "1.0", "gammaCategoryCount", 1, "substModel", covarion);
+
+        TreeLikelihood likelihood = newTreeLikelihood();
+        likelihood.initByName("data", data, "tree", tree, "siteModel", siteModel);
+
+        double fLogP = 0;
+        likelihood.initByName("useAmbiguities", true, "data", data, "tree", tree, "siteModel", siteModel);
+        fLogP = likelihood.calculateLogP();
+        // beast1 xml gives -1730.5363
+        assertEquals(fLogP, -1730.53631739, BEASTTestCase.PRECISION);
+    }
+
+} // class TreeLikelihoodTest
diff --git a/src/test/beast/evolution/operator/ExchangeOperatorTest.java b/src/test/beast/evolution/operator/ExchangeOperatorTest.java
new file mode 100644
index 0000000..56b1498
--- /dev/null
+++ b/src/test/beast/evolution/operator/ExchangeOperatorTest.java
@@ -0,0 +1,130 @@
+package test.beast.evolution.operator;
+
+import org.junit.Test;
+
+import beast.core.State;
+import beast.evolution.alignment.Alignment;
+import beast.evolution.alignment.Sequence;
+import beast.evolution.operators.Exchange;
+import beast.util.Randomizer;
+import beast.util.TreeParser;
+
+
+import junit.framework.TestCase;
+
+public class ExchangeOperatorTest extends TestCase {
+	
+	@Test 
+	public void testNarrowExchange4Taxa() throws Exception {
+		
+        int runs = 10000;
+        Randomizer.setSeed(666);
+        // test that going from source tree to target tree 
+        // is as likely as going the other way around
+        // taking the HR in account.
+        Sequence A = new Sequence("A", "A");
+        Sequence B = new Sequence("B", "A");
+        Sequence C = new Sequence("C", "A");
+        Sequence D = new Sequence("D", "A");
+
+        Alignment data = new Alignment();
+        data.initByName("sequence", A, "sequence", B, "sequence", C, "sequence", D,
+                "dataType", "nucleotide"
+        );
+        String sourceTree = "((A:2.0,B:2.0):1.0,(C:1.0,D:1.0):2.0):0.0"; // ((A,B),(C,D))
+        String targetTree = "((A:2.0,(C:1.0,D:1.0):1.0):1.0,B:3.0):0.0"; // ((A,(C,D)),B)
+        testNarrowExchange(sourceTree, targetTree, runs, data);
+	}
+	
+    @Test
+	public void testNarrowExchange5Taxa() throws Exception {
+    	int runs = 10000;
+	    Randomizer.setSeed(666);
+        Sequence A = new Sequence("A", "A");
+        Sequence B = new Sequence("B", "A");
+        Sequence C = new Sequence("C", "A");
+        Sequence D = new Sequence("D", "A");
+        Sequence E = new Sequence("E", "A");
+
+        Alignment data = new Alignment();
+        data.initByName("sequence", A, "sequence", B, "sequence", C, "sequence", D, "sequence", E,
+                "dataType", "nucleotide"
+        );
+        String sourceTree = "(((A:2.0,B:2.0):1.0,(C:1.0,D:1.0):2.0):1.0,E:4.0):0.0"; // (((A,B),(C,D)),E)
+        String targetTree = "(((A:2.0,(C:1.0,D:1.0):1.0):1.0,B:3.0):1.0,E:4.0):0.0"; // (((A,(C,D)),B),E)
+        testNarrowExchange(sourceTree, targetTree, runs, data);
+    }
+
+    @Test
+	public void testNarrowExchange6Taxa() throws Exception {
+    	int runs = 10000;
+	    Randomizer.setSeed(666);
+        Sequence A = new Sequence("A", "A");
+        Sequence B = new Sequence("B", "A");
+        Sequence C = new Sequence("C", "A");
+        Sequence D = new Sequence("D", "A");
+        Sequence E = new Sequence("E", "A");
+        Sequence F = new Sequence("F", "A");
+
+        Alignment data = new Alignment();
+        data.initByName("sequence", A, "sequence", B, "sequence", C, "sequence", D, "sequence", E, "sequence", F,
+                "dataType", "nucleotide"
+        );
+        //String sourceTree = "((((A:2.0,B:2.0):1.0,(C:1.0,D:1.0):2.0):1.0,E:4.0):1.0,F:5.0):0.0"; // ((((A,B),(C,D)),E),F)
+        //String targetTree = "((((A:2.0,(C:1.0,D:1.0):1.0):1.0,B:3.0):1.0,E:4.0):1.0,F:5.0):0.0"; // ((((A,(C,D)),B),E),F)
+
+        String sourceTree = "(((A:5.0,B:5.0):2.0,((C:5.0,D:5.0):1.0,E:6.0):1.0):1.0,F:8.0):0.0"; 
+        String targetTree = "(((A:5.0,B:5.0):2.0,F:7.0):1.0,((C:5.0,D:5.0):1.0,E:6.0):2.0):0.0"; 
+
+        testNarrowExchange(sourceTree, targetTree, runs, data);
+    }
+	
+	void testNarrowExchange(String sourceTree, String targetTree, int runs, Alignment data) throws Exception {
+		
+        // first test going from source to target
+        double match = 0;
+        for (int i = 0; i < runs; i++) {
+            TreeParser tree = new TreeParser();
+            tree.initByName("taxa", data, "newick", sourceTree, "IsLabelledNewick", true);
+    		State state = new State();
+    		state.initByName("stateNode", tree);
+    		state.initialise();
+            Exchange operator = new Exchange();
+            operator.initByName("isNarrow", true, "tree", tree, "weight", 1.0);
+
+            double logHR = operator.proposal();
+            String treeString = tree.getRoot().toNewick();
+            if (treeString.equals(targetTree) && !Double.isInfinite(logHR)) {
+            	// proportion of accepts equals min(HR, 1.0)
+            	match += Math.min(Math.exp(logHR), 1.0);
+            }
+        }
+
+        System.out.println(" Matches: " + match * 100.0/runs+ "%");
+
+        
+        // now test going from target to source
+        double match2 = 0;
+        for (int i = 0; i < runs; i++) {
+            TreeParser tree = new TreeParser();
+            tree.initByName("taxa", data, "newick", targetTree, "IsLabelledNewick", true);
+    		State state = new State();
+    		state.initByName("stateNode", tree);
+    		state.initialise();
+            Exchange operator = new Exchange();
+            operator.initByName("isNarrow", true, "tree", tree, "weight", 1.0);
+
+            double logHR = operator.proposal();
+            String treeString = tree.getRoot().toNewick();
+            if (treeString.equals(sourceTree) && !Double.isInfinite(logHR)) {
+            	// proportion of accepts equals min(HR, 1.0)
+            	match2 += Math.min(Math.exp(logHR), 1.0);
+            }
+        }
+        
+        System.out.println(" Matches: " + match2 * 100.0/runs+ "%");
+        assertTrue("difference(" + 100*(match-match2)/runs + ") exceeds 1.0%", 100.0*Math.abs(match-match2)/runs < 1.0); 
+	
+	}
+
+}
diff --git a/src/test/beast/evolution/operator/IntRandomWalkOperatorTest.java b/src/test/beast/evolution/operator/IntRandomWalkOperatorTest.java
new file mode 100644
index 0000000..bdfe8cd
--- /dev/null
+++ b/src/test/beast/evolution/operator/IntRandomWalkOperatorTest.java
@@ -0,0 +1,79 @@
+package test.beast.evolution.operator;
+
+
+import java.util.Arrays;
+
+import org.junit.Test;
+
+import beast.core.State;
+import beast.core.parameter.IntegerParameter;
+import beast.evolution.operators.IntRandomWalkOperator;
+
+
+import junit.framework.TestCase;
+
+public class IntRandomWalkOperatorTest extends TestCase {
+
+    @Test
+    public void testIntRandomWalkDistribution3x10() {
+    	instantiate(3, 10, 1,new Integer[]{1,2,3,6,10});
+    }
+
+    @Test
+    public void testIntRandomWalkDistribution3x6() {
+    	instantiate(3, 6, 1,new Integer[]{1,2,3,6});
+    }
+
+    @Test
+    public void testIntRandomWalkDistribution6x10() {
+    	instantiate(6, 10, 1,new Integer[]{1,2,3,6,10});
+    }
+
+    public void instantiate(int dimension, int upper, int runs, Integer[]windowSizes) {
+    	for (int r = 0; r < runs; r++) {
+    	for (Integer windowSize : windowSizes) {
+	    	try {
+	    	    int[][] count = new int[dimension][upper + 1];
+		        Integer [] init = new Integer[dimension];
+		        Arrays.fill(init, 0);
+		        IntegerParameter parameter = new IntegerParameter(init);
+		        parameter.setLower(0);
+		        parameter.setUpper(upper);
+	
+	    		State state = new State();
+	    		state.initByName("stateNode", parameter);
+	    		state.initialise();
+	    		
+		        IntRandomWalkOperator operator = new IntRandomWalkOperator();
+		        operator.initByName("parameter", parameter, "windowSize", windowSize, "weight", 1.0);
+	
+		        for (int i = 0; i < 1000000 * (upper + 1); i++) {
+		            operator.proposal();
+		            Integer [] values = parameter.getValues();
+		            for (int k = 0; k < values.length; k++) {
+		                int j = (int) values[k];
+		                count[k][j] += 1; 
+		            }
+		        }
+		        System.out.print("Distribution lower = 0, upper = " + upper +" windowSize = " + windowSize);
+		        for (int j = 0; j < count.length; j++) {
+			        //System.out.println("x[" +j + "] = " + Arrays.toString(count[j]));
+				}
+		
+		        int sum = 0;
+		        for (int i = 0; i < dimension; i++) {
+		        	for (int k = 0; k < count[i].length; k++) {
+		        		sum += Math.abs(count[i][k] - 1000000);
+					}
+		        }
+		        System.out.println(" Average deviation: " + sum/(dimension * (upper + 1)));
+		        assertTrue("average deviation (" + sum/(dimension * (upper + 1)) + ") exceeds 10000", sum/(dimension * (upper + 1)) < 10000); 
+	    	} catch (Exception e) {
+				e.printStackTrace();
+			}
+    	}
+    	}
+    }
+
+
+}
diff --git a/src/test/beast/evolution/operator/UniformIntegerOperatorTest.java b/src/test/beast/evolution/operator/UniformIntegerOperatorTest.java
new file mode 100644
index 0000000..7d8a53b
--- /dev/null
+++ b/src/test/beast/evolution/operator/UniformIntegerOperatorTest.java
@@ -0,0 +1,94 @@
+package test.beast.evolution.operator;
+
+import java.util.Arrays;
+
+import beast.core.State;
+import beast.core.parameter.IntegerParameter;
+import beast.core.parameter.RealParameter;
+import beast.evolution.operators.UniformOperator;
+
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+public class UniformIntegerOperatorTest extends TestCase {
+    private final int dimension = 3;
+    private int[][] count;
+
+    public static Test suite() {
+        return new TestSuite(UniformIntegerOperatorTest.class);
+    }
+
+    public void testParameterBound() {
+    	try {
+	        count = new int[dimension][4]; // 4 vaules {0, 1, 2, 3}
+	        RealParameter parameter = new RealParameter(new Double[]{1.0, 0.0, 2.0});
+	        parameter.setLower(0.0);
+	        parameter.setUpper(3.0);
+
+    		State state = new State();
+    		state.initByName("stateNode", parameter);
+    		state.initialise();
+    		
+	        UniformOperator uniformOperator = new UniformOperator();
+	        uniformOperator.initByName("parameter", parameter, "howMany", 3, "weight", 1.0);
+
+	        for (int i = 0; i < 400; i++) {
+	            uniformOperator.proposal();
+	            Double [] values = parameter.getValues();
+	            for (int k = 0; k < values.length; k++) {
+	                int j = (int)(double) values[k];
+	                count[k][j] += 1; 
+	            }
+	        }
+	        System.out.println("Discretized real distributions lower = 0.0, upper = 3.0");
+	        for (int j = 0; j < count.length; j++) {
+		        System.out.println("x[" +j + "] = " + Arrays.toString(count[j]));
+			}
+	
+	        assertTrue("Expected count[0][0-2] > 0 && count[0][3] == 0", (count[0][0] > 0) && (count[0][1] > 0) && (count[0][2] > 0) && (count[0][3] == 0));
+	        assertTrue("Expected count[1][0-2] > 0 && count[1][3] == 0", (count[1][0] > 0) && (count[1][1] > 0) && (count[1][2] > 0) && (count[1][3] == 0));
+	        assertTrue("Expected count[2][0-2] > 0 && count[2][3] == 0", (count[2][0] > 0) && (count[2][1] > 0) && (count[2][2] > 0) && (count[2][3] == 0));
+    	} catch (Exception e) {
+			e.printStackTrace();
+		}
+    }
+
+    public void testIntegerParameterBound() {
+    	try {
+	        count = new int[dimension][4]; // 4 vaules {0, 1, 2, 3}
+	        IntegerParameter parameter = new IntegerParameter(new Integer[]{1, 0, 3});
+	        parameter.setLower(0);
+	        parameter.setUpper(3);
+
+    		State state = new State();
+    		state.initByName("stateNode", parameter);
+    		state.initialise();
+    		
+	        UniformOperator uniformOperator = new UniformOperator();
+	        uniformOperator.initByName("parameter", parameter, "howMany", 3, "weight", 1.0);
+	       
+	        for (int i = 0; i < 400; i++) {
+	            uniformOperator.proposal();
+	            Integer [] values = parameter.getValues();
+	            for (int k = 0; k < values.length; k++) {
+	                int j = (int)(double) values[k];
+	                count[k][j] += 1; 
+	            }
+	        }
+
+	        System.out.println("Integer distributions lower = 0, upper = 3");
+	        for (int j = 0; j < count.length; j++) {
+		        System.out.println("x[" +j + "] = " + Arrays.toString(count[j]));
+			}
+	
+	        assertTrue("Expected count[0][0-3] > 0", count[0][0] > 0 && count[0][1] > 0 && count[0][2] > 0 && count[0][3] > 0);
+	        assertTrue("Expected count[1][0-3] > 0", count[1][0] > 0 && count[1][1] > 0 && count[1][2] > 0 && count[1][3] > 0);
+	        assertTrue("Expected count[2][0-3] > 0", count[2][0] > 0 && count[2][1] > 0 && count[2][2] > 0 && count[2][3] > 0);
+    	} catch (Exception e) {
+			e.printStackTrace();
+		}
+    }
+
+}
diff --git a/src/test/beast/evolution/speciation/BirthDeathGernhard08ModelTest.java b/src/test/beast/evolution/speciation/BirthDeathGernhard08ModelTest.java
new file mode 100644
index 0000000..bcf1c89
--- /dev/null
+++ b/src/test/beast/evolution/speciation/BirthDeathGernhard08ModelTest.java
@@ -0,0 +1,65 @@
+package test.beast.evolution.speciation;
+
+import org.junit.Test;
+
+import beast.core.parameter.RealParameter;
+import beast.evolution.alignment.Alignment;
+import beast.evolution.speciation.BirthDeathGernhard08Model;
+import beast.evolution.tree.Tree;
+import test.beast.BEASTTestCase;
+import junit.framework.TestCase;
+
+public class BirthDeathGernhard08ModelTest extends TestCase {
+
+
+    @Test
+    public void testJC69Likelihood() throws Exception {
+        // Set up JC69 model: uniform freqs, kappa = 1, 0 gamma categories
+        Alignment data = BEASTTestCase.getAlignment();
+        Tree tree = BEASTTestCase.getTree(data);
+
+        RealParameter birthDiffRate = new RealParameter("1.0");
+        RealParameter relativeDeathRate = new RealParameter("0.5");
+        RealParameter originHeight = new RealParameter("0.1");
+        BirthDeathGernhard08Model likelihood = new BirthDeathGernhard08Model();
+        likelihood.initByName("type", "unscaled",
+                "tree", tree,
+                "birthDiffRate", birthDiffRate,
+                "relativeDeathRate", relativeDeathRate);
+
+
+        double fLogP = 0;
+        fLogP = likelihood.calculateLogP(); // -3.520936119641363
+        assertEquals(fLogP, 2.5878899503981287, BEASTTestCase.PRECISION);
+
+        likelihood.initByName("type", "timesonly",
+                "tree", tree,
+                "birthDiffRate", birthDiffRate,
+                "relativeDeathRate", relativeDeathRate);
+        fLogP = likelihood.calculateLogP();
+        assertEquals(fLogP, 9.16714116240823, BEASTTestCase.PRECISION);
+
+        likelihood.initByName("type", "oriented",
+                "tree", tree,
+                "birthDiffRate", birthDiffRate,
+                "relativeDeathRate", relativeDeathRate);
+        fLogP = likelihood.calculateLogP();
+        assertEquals(fLogP, 4.379649419626184, BEASTTestCase.PRECISION);
+
+        likelihood.initByName("type", "labeled",
+                "tree", tree,
+                "birthDiffRate", birthDiffRate,
+                "relativeDeathRate", relativeDeathRate);
+        fLogP = likelihood.calculateLogP();
+        assertEquals(fLogP, 1.2661341104158121, BEASTTestCase.PRECISION);
+        
+        likelihood.initByName("type", "labeled",
+        		"tree", tree,
+        		"birthDiffRate", birthDiffRate,
+        		"relativeDeathRate", relativeDeathRate,
+        		"originHeight", originHeight);
+        fLogP = likelihood.calculateLogP();
+        assertEquals(fLogP, 8.41413452832378, BEASTTestCase.PRECISION);
+    }
+
+}
diff --git a/src/test/beast/evolution/substmodel/GTRTest.java b/src/test/beast/evolution/substmodel/GTRTest.java
new file mode 100644
index 0000000..02f1c76
--- /dev/null
+++ b/src/test/beast/evolution/substmodel/GTRTest.java
@@ -0,0 +1,188 @@
+package test.beast.evolution.substmodel;
+
+
+import beast.core.Description;
+import beast.core.parameter.RealParameter;
+import beast.evolution.substitutionmodel.Frequencies;
+import beast.evolution.substitutionmodel.GTR;
+import junit.framework.TestCase;
+
+/**
+ * Test GTR matrix exponentiation
+ *
+ */
+ at Description("Test GTR matrix exponentiation")
+public class GTRTest extends TestCase {
+
+    public interface Instance {
+        Double[] getPi();
+
+        Double [] getRates();
+
+        double getDistance();
+
+        double[] getExpectedResult();
+    }
+
+    /*
+     * Results obtained by running the following scilab code,
+     *
+     * k = 5 ; piQ = diag([.2, .3, .25, .25]) ; d = 0.1 ;
+     * % Q matrix with zeroed diagonal
+     * XQ = [0 1 k 1; 1 0 1 k; k 1 0 1; 1 k 1 0];
+     *
+     * xx = XQ * piQ ;
+     *
+     * % fill diagonal and normalize by total substitution rate
+     * q0 = (xx + diag(-sum(xx,2))) / sum(piQ * sum(xx,2)) ;
+     * expm(q0 * d)
+     */
+    protected Instance test0 = new Instance() {
+        public Double[] getPi() {
+            return new Double[]{0.25, 0.25, 0.25, 0.25};
+        }
+
+        public Double [] getRates() {
+            return new Double[] {0.5, 1.0, 0.5, 0.5, 1.0, 0.5};
+        }
+
+        public double getDistance() {
+            return 0.1;
+        }
+
+        public double[] getExpectedResult() {
+            return new double[]{
+                    0.906563342722, 0.023790645491, 0.045855366296, 0.023790645491,
+                    0.023790645491, 0.906563342722, 0.023790645491, 0.045855366296,
+                    0.045855366296, 0.023790645491, 0.906563342722, 0.023790645491,
+                    0.023790645491, 0.045855366296, 0.023790645491, 0.906563342722
+            };
+        }
+    };
+
+    protected Instance test1 = new Instance() {
+        public Double[] getPi() {
+            return new Double[]{0.50, 0.20, 0.2, 0.1};
+        }
+
+        public Double [] getRates() {
+            return new Double[] {0.5, 1.0, 0.5, 0.5, 1.0, 0.5};
+        }
+
+        public double getDistance() {
+            return 0.1;
+        }
+
+        public double[] getExpectedResult() {
+            return new double[]{
+                    0.928287993055, 0.021032136637, 0.040163801989, 0.010516068319,
+                    0.052580341593, 0.906092679369, 0.021032136637, 0.020294842401,
+                    0.100409504972, 0.021032136637, 0.868042290072, 0.010516068319,
+                    0.052580341593, 0.040589684802, 0.021032136637, 0.885797836968
+            };
+        }
+    };
+
+    protected Instance test2 = new Instance() {
+        public Double[] getPi() {
+            return new Double[]{0.20, 0.30, 0.25, 0.25};
+        }
+
+        public Double [] getRates() {
+            return new Double[] {0.2, 1.0, 0.2, 0.2, 1.0, 0.2};
+        }
+
+        public double getDistance() {
+            return 0.1;
+        }
+
+        public double[] getExpectedResult() {
+            return new double[]{
+                    0.904026219693, 0.016708646875, 0.065341261036, 0.013923872396,
+                    0.011139097917, 0.910170587813, 0.013923872396, 0.064766441875,
+                    0.052273008829, 0.016708646875, 0.917094471901, 0.013923872396,
+                    0.011139097917, 0.077719730250, 0.013923872396, 0.897217299437
+            };
+        }
+    };
+
+    protected Instance test3 = new Instance() {
+        public Double[] getPi() {
+            return new Double[]{0.20, 0.30, 0.25, 0.25};
+        }
+
+        public Double [] getRates() {
+            return new Double[] {0.2, 1.0, 0.3, 0.4, 1.0, 0.5};
+        }
+
+        public double getDistance() {
+            return 0.1;
+        }
+
+        public double[] getExpectedResult() {
+            return new double[]{
+            		0.9151233523912986, 0.01419463331835106, 0.053614529507541434, 0.017067484782809166, 
+            		0.009463088878900653, 0.9148659231065082, 0.022324155452048293, 0.05334683256254297, 
+            		0.042891623606033207, 0.026788986542458024, 0.9028769239489847, 0.027442465902524332, 
+            		0.01365398782624723, 0.06401619907505152, 0.027442465902524263, 0.8948873471961769
+            };
+        }
+    };
+    
+    protected Instance test4 = new Instance() {
+        public Double[] getPi() {
+            return new Double[]{0.20, 0.30, 0.25, 0.25};
+        }
+
+        public Double [] getRates() {
+            return new Double[] {0.2, 10.0, 0.3, 0.4, 5.0, 0.5};
+        }
+
+        public double getDistance() {
+            return 0.1;
+        }
+
+        public double[] getExpectedResult() {
+            return new double[]{
+            			0.8780963047046206, 0.0033252855682803723, 0.11461112844510626, 0.003967281281992822, 
+            			0.002216857045520258, 0.9327483979953872, 0.005055665025823634, 0.05997907993326873, 
+            			0.09168890275608481, 0.006066798030988321, 0.8959983003009074, 0.0062459989120190644, 
+            			0.0031738250255942332, 0.07197489591992245, 0.006245998912019033, 0.9186052801424642
+            };
+        }
+    };
+    
+    
+    Instance[] all = {test4, test3, test2, test1, test0};
+
+    public void testGTR() throws Exception {
+        for (Instance test : all) {
+
+            RealParameter f = new RealParameter(test.getPi());
+
+            Frequencies freqs = new Frequencies();
+            freqs.initByName("frequencies", f, "estimate", false);
+
+            GTR gtr = new GTR();
+            Double [] rates = test.getRates();
+            gtr.initByName("rateAC", new RealParameter(rates[0]+""),
+            		"rateAG", new RealParameter(rates[1]+""),
+            		"rateAT", new RealParameter(rates[2]+""),
+            		"rateCG", new RealParameter(rates[3]+""),
+            		"rateCT", new RealParameter(rates[4]+""),
+            		"rateGT", new RealParameter(rates[5]+""),
+            		"frequencies", freqs);
+
+            double distance = test.getDistance();
+
+            double[] mat = new double[4 * 4];
+            gtr.getTransitionProbabilities(null, distance, 0, 1, mat);
+            final double[] result = test.getExpectedResult();
+
+            for (int k = 0; k < mat.length; ++k) {
+                assertEquals(mat[k], result[k], 1e-10);
+                System.out.println(k + " : " + (mat[k] - result[k]));
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/test/beast/evolution/substmodel/HKYTest.java b/src/test/beast/evolution/substmodel/HKYTest.java
new file mode 100644
index 0000000..a675e8f
--- /dev/null
+++ b/src/test/beast/evolution/substmodel/HKYTest.java
@@ -0,0 +1,137 @@
+package test.beast.evolution.substmodel;
+
+import beast.core.Description;
+import beast.core.parameter.RealParameter;
+import beast.evolution.substitutionmodel.Frequencies;
+import beast.evolution.substitutionmodel.HKY;
+import beast.evolution.tree.Node;
+import junit.framework.TestCase;
+
+/**
+ * Test HKY matrix exponentiation
+ *
+ * @author Joseph Heled
+ *         Date: 7/11/2007
+ *         imported by Walter Xie from BEAST 1
+ */
+ at Description("Test HKY matrix exponentiation")
+public class HKYTest extends TestCase {
+
+    public interface Instance {
+        Double[] getPi();
+
+        Double getKappa();
+
+        double getDistance();
+
+        double[] getExpectedResult();
+    }
+
+    /*
+     * Results obtained by running the following scilab code,
+     *
+     * k = 5 ; piQ = diag([.2, .3, .25, .25]) ; d = 0.1 ;
+     * % Q matrix with zeroed diagonal
+     * XQ = [0 1 k 1; 1 0 1 k; k 1 0 1; 1 k 1 0];
+     *
+     * xx = XQ * piQ ;
+     *
+     * % fill diagonal and normalize by total substitution rate
+     * q0 = (xx + diag(-sum(xx,2))) / sum(piQ * sum(xx,2)) ;
+     * expm(q0 * d)
+     */
+    protected Instance test0 = new Instance() {
+        public Double[] getPi() {
+            return new Double[]{0.25, 0.25, 0.25, 0.25};
+        }
+
+        public Double getKappa() {
+            return 2.0;
+        }
+
+        public double getDistance() {
+            return 0.1;
+        }
+
+        public double[] getExpectedResult() {
+            return new double[]{
+                    0.906563342722, 0.023790645491, 0.045855366296, 0.023790645491,
+                    0.023790645491, 0.906563342722, 0.023790645491, 0.045855366296,
+                    0.045855366296, 0.023790645491, 0.906563342722, 0.023790645491,
+                    0.023790645491, 0.045855366296, 0.023790645491, 0.906563342722
+            };
+        }
+    };
+
+    protected Instance test1 = new Instance() {
+        public Double[] getPi() {
+            return new Double[]{0.50, 0.20, 0.2, 0.1};
+        }
+
+        public Double getKappa() {
+            return 2.0;
+        }
+
+        public double getDistance() {
+            return 0.1;
+        }
+
+        public double[] getExpectedResult() {
+            return new double[]{
+                    0.928287993055, 0.021032136637, 0.040163801989, 0.010516068319,
+                    0.052580341593, 0.906092679369, 0.021032136637, 0.020294842401,
+                    0.100409504972, 0.021032136637, 0.868042290072, 0.010516068319,
+                    0.052580341593, 0.040589684802, 0.021032136637, 0.885797836968
+            };
+        }
+    };
+
+    protected Instance test2 = new Instance() {
+        public Double[] getPi() {
+            return new Double[]{0.20, 0.30, 0.25, 0.25};
+        }
+
+        public Double getKappa() {
+            return 5.0;
+        }
+
+        public double getDistance() {
+            return 0.1;
+        }
+
+        public double[] getExpectedResult() {
+            return new double[]{
+                    0.904026219693, 0.016708646875, 0.065341261036, 0.013923872396,
+                    0.011139097917, 0.910170587813, 0.013923872396, 0.064766441875,
+                    0.052273008829, 0.016708646875, 0.917094471901, 0.013923872396,
+                    0.011139097917, 0.077719730250, 0.013923872396, 0.897217299437
+            };
+        }
+    };
+
+    Instance[] all = {test2, test1, test0};
+
+    public void testHKY() throws Exception {
+        for (Instance test : all) {
+
+            RealParameter f = new RealParameter(test.getPi());
+
+            Frequencies freqs = new Frequencies();
+            freqs.initByName("frequencies", f, "estimate", false);
+
+            HKY hky = new HKY();
+            hky.initByName("kappa", test.getKappa().toString(), "frequencies", freqs);
+
+            double distance = test.getDistance();
+
+            double[] mat = new double[4 * 4];
+            hky.getTransitionProbabilities(null, distance, 0, 1, mat);
+            final double[] result = test.getExpectedResult();
+
+            for (int k = 0; k < mat.length; ++k) {
+                assertEquals(mat[k], result[k], 1e-10);
+                System.out.println(k + " : " + (mat[k] - result[k]));
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/test/beast/evolution/tree/RandomTreeTest.java b/src/test/beast/evolution/tree/RandomTreeTest.java
new file mode 100644
index 0000000..824caa7
--- /dev/null
+++ b/src/test/beast/evolution/tree/RandomTreeTest.java
@@ -0,0 +1,158 @@
+/*
+ * Copyright (C) 2014 Tim Vaughan <tgvaughan at gmail.com>.
+ *
+ * This library 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 library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301  USA
+ */
+
+package test.beast.evolution.tree;
+
+import beast.core.parameter.RealParameter;
+import beast.evolution.alignment.Alignment;
+import beast.evolution.alignment.Sequence;
+import beast.evolution.alignment.TaxonSet;
+import beast.evolution.tree.RandomTree;
+import beast.evolution.tree.TraitSet;
+import beast.evolution.tree.coalescent.ConstantPopulation;
+import beast.evolution.tree.coalescent.TreeIntervals;
+import beast.util.Randomizer;
+import java.util.ArrayList;
+import java.util.List;
+import org.junit.Test;
+
+/**
+ * @author Tim Vaughan <tgvaughan at gmail.com>
+ */
+public class RandomTreeTest {
+    
+    public RandomTreeTest() { }
+
+     @Test
+     public void testCoalescentTimes() throws Exception {
+         
+         Randomizer.setSeed(53);
+
+         int Nleaves = 10;
+         int Niter = 5000;
+
+         // (Serially sampled) coalescent time means and variances
+         // estimated from 50000 trees simulated using MASTER
+
+         double[] coalTimeMeansTruth = {
+             1.754662,
+             2.833337,
+             3.843532,
+             4.850805,
+             5.849542,
+             6.847016,
+             7.8482,
+             8.855137,
+             10.15442};
+         
+         double[] coalTimeVarsTruth = {
+             0.2751625,
+             0.2727121,
+             0.2685172,
+             0.2705117,
+             0.2678611,
+             0.2671793,
+             0.2686952,
+             0.2828477,
+             1.076874};
+         
+         
+         // Assemble BEASTObjects needed by RandomTree
+         
+         StringBuilder traitSB = new StringBuilder();
+         List<Sequence> seqList = new ArrayList<Sequence>();
+
+         for (int i=0; i<Nleaves; i++) {
+             String taxonID = "t " + i;
+             seqList.add(new Sequence(taxonID, "?"));
+             
+             if (i>0)
+                 traitSB.append(",");
+             traitSB.append(taxonID).append("=").append(i);
+         }
+
+         Alignment alignment = new Alignment(seqList, "nucleotide");
+         TaxonSet taxonSet = new TaxonSet(alignment);
+         TraitSet timeTrait = new TraitSet();
+
+         timeTrait.initByName(
+                 "traitname", "date-backward",
+                 "taxa", taxonSet,
+                 "value", traitSB.toString());
+         
+         ConstantPopulation popFunc = new ConstantPopulation();
+         popFunc.initByName("popSize", new RealParameter("1.0"));
+         
+         
+         // Create RandomTree and TreeInterval instances
+         RandomTree tree = new RandomTree();
+         TreeIntervals intervals = new TreeIntervals();                  
+
+         // Estimate coalescence time moments
+         
+         double[] coalTimeMeans = new double[Nleaves-1];
+         double[] coalTimeVars = new double[Nleaves-1];
+         double[] coalTimes = new double[Nleaves-1];
+
+         for (int i=0; i<Niter; i++) {
+             tree.initByName(
+                     "taxa", alignment,
+                     "populationModel", popFunc,
+                     "trait", timeTrait);
+
+
+             intervals.initByName("tree", tree);
+             intervals.getCoalescentTimes(coalTimes);
+             
+             for (int j=0; j<Nleaves-1; j++) {
+                 coalTimeMeans[j] += coalTimes[j];
+                 coalTimeVars[j] += coalTimes[j]*coalTimes[j];
+             }
+         }
+         
+         // Normalise means and variances
+         for (int j=0; j<Nleaves-1; j++) {
+             coalTimeMeans[j] /= Niter;
+             coalTimeVars[j] /= Niter;
+             coalTimeVars[j] -= coalTimeMeans[j]*coalTimeMeans[j];
+         }
+
+
+         // Test means and variances against independently estimated values
+         for (int j=0; j<Nleaves-1; j++) {
+//             System.out.format("%d %g %g\n", j,
+//                     relError(coalTimeMeans[j],coalTimeMeansTruth[j]),
+//                     relError(coalTimeVars[j],coalTimeVarsTruth[j]));
+             
+             assert(relError(coalTimeMeans[j],coalTimeMeansTruth[j]) < 5e-3);
+             assert(relError(coalTimeVars[j],coalTimeVarsTruth[j]) < 5e-2);
+         }
+     }
+     
+     /**
+      * Return the relative difference between val and truth.
+      * 
+      * @param val
+      * @param truth
+      * @return relative error
+      */
+     private double relError(double val, double truth) {
+         return 2.0*Math.abs(val-truth)/(val+truth);
+     }
+}
diff --git a/src/test/beast/evolution/tree/TreeAnnotatorTest.java b/src/test/beast/evolution/tree/TreeAnnotatorTest.java
new file mode 100644
index 0000000..8a535c4
--- /dev/null
+++ b/src/test/beast/evolution/tree/TreeAnnotatorTest.java
@@ -0,0 +1,158 @@
+package test.beast.evolution.tree;
+
+import beast.app.treeannotator.CladeSystem;
+import beast.app.treeannotator.TreeAnnotator;
+import beast.evolution.tree.Tree;
+import beast.util.TreeParser;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.BitSet;
+import java.util.Map;
+
+/**
+ * @author Walter Xie
+ */
+public class TreeAnnotatorTest {
+    protected TreeAnnotator treeAnnotator;
+    protected TreeAnnotator treeAnnotatorSA;
+    protected Tree[] trees;
+    protected Tree[] treesSA;
+    protected CladeSystem cladeSystem;
+    protected CladeSystem cladeSystemSA;
+
+    //protected String[] clades = new String[]{"{0, 1}", "{1, 2}", "{0, 1, 2}", "{0, 1, 2, 3}", "{2, 3}"};
+    protected String[] clades = new String[]{"{0, 2}", "{2, 4}", "{0, 2, 4}", "{0, 2, 4, 6}", "{4, 6}"};
+    protected String[] cladesSA = new String[]{"{0, 2}", "{0, 2, 4}", "{0, 2, 4, 6, 7}", "{0, 2, 4, 6, 8}", "{0, 4}", "{6, 8}", "{0, 2, 4, 8}", "{0, 2, 4, 6, 7, 8}"};
+    protected int[] cladesCount = new int[]{2, 1, 2, 3, 1};
+    protected int[] cladesCountSA = new int[]{1, 4, 2, 3, 3, 1, 1, 1};
+    protected double[] logTreeScoresSA = new double[] {-2.367124, -1.268511, -1.961659, -3.060271}; //scores calculated in R
+    protected double[] treeScoresSA = new double[] {2.5, 3.0, 2.27, 2.25}; //scores calculated in R
+
+    @Before
+    public void setUp() throws Exception {
+        final String[] treesString = new String[]{"((A:1,B:1):1,(C:1,D:1):1);",
+                "(((A:1,B:1):1,C:2):2,D:3);", "((A:2,(B:1,C:1):1):2,D:3);"};
+        final String[] treesSAString = new String[]{"((((0:0.5,1:1.0):1.0,2:2.0):1.0,3:0.0):2.0,4:4.0);",
+                "((((0:1.0,2:1.5):1.0,1:2.5):0.5,3:0.0):2.0,4:4.0);", "(((0:0.5,2:1.0):1.0,1:2.0):3.0,(3:0.2,4:2.2):1.8);", "((((0:1.0,2:1.5):1.0,1:2.5):0.2,4:1.7):0.3,3:0.0):0.0;"};
+
+        treeAnnotator = new TreeAnnotator();
+        treeAnnotatorSA = new TreeAnnotator();
+        trees = new Tree[treesString.length];
+        for (int i = 0; i < trees.length; i++) {
+            trees[i] = new TreeParser(treesString[i], false, false, true, 1);
+        }
+        treesSA = new Tree[treesSAString.length];
+        for (int i = 0; i < treesSA.length; i++) {
+            treesSA[i] = new TreeParser(treesSAString[i], false, false, false, 0);
+        }
+
+        cladeSystem = new CladeSystem();
+        cladeSystemSA = new CladeSystem();
+    }
+
+    @Test
+    public void testTreeScoreAndCladeSystem() throws Exception {
+        for (Tree tree : trees) {
+            cladeSystem.add(tree, false);
+        }
+        Assert.assertEquals(clades.length, cladeSystem.getCladeMap().size());
+
+        cladeSystem.calculateCladeCredibilities(trees.length);
+
+        int i=0;
+        for (Map.Entry<BitSet, CladeSystem.Clade> entry : cladeSystem.getCladeMap().entrySet()) {
+//            System.out.println(entry.getKey() + " = " + entry.getValue().getCount());
+            int index = -1;
+            //find the clade in the clades array
+            for (int j=0; j<clades.length; j++) {
+                if (clades[j].equals(entry.getKey().toString())) {
+                    index = j;
+                    break;
+                }
+            }
+            //if the clade is not found then index = -1
+            Assert.assertFalse(index ==  -1);
+            Assert.assertEquals(cladesCount[index], entry.getValue().getCount());
+            i++;
+        }
+
+        int maxScoreIndex = -1;
+        int maxScoreLogIndex = -1;
+        double maxScore = Double.NEGATIVE_INFINITY;
+        double maxScoreLog = Double.NEGATIVE_INFINITY;
+        i = 0;
+        for (Tree tree : trees) {
+            double score = treeAnnotator.scoreTree(tree, cladeSystem, true);
+            double scoreLog = treeAnnotator.scoreTree(tree, cladeSystem, false);
+
+//            System.out.println(i + " => " + score + ", log " + scoreLog);
+            if (maxScore < score) {
+                maxScore = score;
+                maxScoreIndex = i;
+            }
+            if (maxScoreLog < scoreLog) {
+                maxScoreLog = scoreLog;
+                maxScoreLogIndex = i;
+            }
+            i++;
+        }
+//        System.out.println(maxScoreIndex + " => " + maxScore + ", log " + maxScoreLog);
+        Assert.assertEquals(1, maxScoreIndex);
+        Assert.assertEquals(1, maxScoreLogIndex);
+    }
+
+    @Test
+    public void testTreeScoreAndCladeSystemSA() throws Exception {
+        for (Tree tree : treesSA) {
+            cladeSystemSA.add(tree, false);
+        }
+        Assert.assertEquals(cladesSA.length, cladeSystemSA.getCladeMap().size());
+
+        cladeSystemSA.calculateCladeCredibilities(treesSA.length);
+
+        int i=0;
+        for (Map.Entry<BitSet, CladeSystem.Clade> entry : cladeSystemSA.getCladeMap().entrySet()) {
+//            System.out.println(entry.getKey() + " = " + entry.getValue().getCount());
+            int index = -1;
+            //find the clade in the clades array
+            for (int j=0; j<cladesSA.length; j++) {
+                if (cladesSA[j].equals(entry.getKey().toString())) {
+                    index = j;
+                    break;
+                }
+            }
+            //if the clade is not found then index = -1
+            Assert.assertFalse(i == -1);
+            Assert.assertEquals(cladesCountSA[index], entry.getValue().getCount());
+            i++;
+        }
+
+        int maxScoreIndex = -1;
+        int maxScoreLogIndex = -1;
+        double maxScore = Double.NEGATIVE_INFINITY;
+        double maxScoreLog = Double.NEGATIVE_INFINITY;
+        i = 0;
+        for (Tree tree : treesSA) {
+            double score = treeAnnotatorSA.scoreTree(tree, cladeSystemSA, true);
+            double scoreLog = treeAnnotatorSA.scoreTree(tree, cladeSystemSA, false);
+
+//            Assert.assertEquals(logTreeScoresSA[i], scoreLog, 1e-6);
+
+            System.out.println(i + " => " + score + ", log " + scoreLog);
+            if (maxScore < score) {
+                maxScore = score;
+                maxScoreIndex = i;
+            }
+            if (maxScoreLog < scoreLog) {
+                maxScoreLog = scoreLog;
+                maxScoreLogIndex = i;
+            }
+            i++;
+        }
+//        System.out.println(maxScoreIndex + " => " + maxScore + ", log " + maxScoreLog);
+        Assert.assertEquals(1, maxScoreIndex);
+        Assert.assertEquals(1, maxScoreLogIndex);
+    }
+}
diff --git a/src/test/beast/evolution/tree/coalescent/BayesianSkylineTest.java b/src/test/beast/evolution/tree/coalescent/BayesianSkylineTest.java
new file mode 100644
index 0000000..efd3162
--- /dev/null
+++ b/src/test/beast/evolution/tree/coalescent/BayesianSkylineTest.java
@@ -0,0 +1,42 @@
+package test.beast.evolution.tree.coalescent;
+
+
+import junit.framework.TestCase;
+import org.junit.Test;
+
+import beast.evolution.tree.Tree;
+import beast.evolution.tree.coalescent.BayesianSkyline;
+import beast.evolution.tree.coalescent.TreeIntervals;
+
+
+
+/**
+ * @author Alexei Drummond
+ */
+public class BayesianSkylineTest extends TestCase {
+
+    @Test
+    public void testSkyline() throws Exception {
+
+        //RealParameter popSize = new RealParameter("1.0", 0.0, 10.0, 2);
+        //IntegerParameter groupSize = new IntegerParameter("2", 1, 4, 2);
+
+        //popSize.setValue(1, 2.0);
+
+        Tree tree = new Tree("(((1:1,2:1):2.5,(3:1.5,4:1.5):2):2,5:5.5);");
+        TreeIntervals intervals = new TreeIntervals(tree);
+
+        BayesianSkyline skyline = new BayesianSkyline();
+        //skyline.init(popSize, groupSize, intervals);
+        skyline.initByName("popSizes", "1.0 2.0",
+                "groupSizes", "2 2",
+                "treeIntervals", intervals);
+
+        assertEquals(skyline.getPopSize(0.01), 1.0);
+        assertEquals(skyline.getPopSize(1.49), 1.0);
+        assertEquals(skyline.getPopSize(1.51), 2.0);
+        assertEquals(skyline.getPopSize(5.51), 2.0);
+
+    }
+
+}
diff --git a/src/test/beast/evolution/tree/coalescent/CoalescentTest.java b/src/test/beast/evolution/tree/coalescent/CoalescentTest.java
new file mode 100644
index 0000000..a553f60
--- /dev/null
+++ b/src/test/beast/evolution/tree/coalescent/CoalescentTest.java
@@ -0,0 +1,62 @@
+package test.beast.evolution.tree.coalescent;
+
+import beast.evolution.alignment.Alignment;
+import beast.evolution.tree.Tree;
+import beast.evolution.tree.coalescent.Coalescent;
+import beast.evolution.tree.coalescent.ConstantPopulation;
+import beast.evolution.tree.coalescent.TreeIntervals;
+import test.beast.BEASTTestCase;
+
+/**
+ * @author Alexei Drummond
+ * @author Walter Xie
+ */
+public class CoalescentTest extends BEASTTestCase {
+    String[] trees = new String[]{"((A:1.0,B:1.0):1.0,C:2.0);", ""}; //more trees ?
+    Alignment data;
+    final double pop = 10000;
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+        data = getFourTaxaNoData();
+    }
+
+    public void testConstantPopulation() throws Exception {
+        // *********** 3 taxon **********
+        Tree tree = getTree(data, trees[0]);
+        TreeIntervals treeIntervals = new TreeIntervals();
+        treeIntervals.initByName("tree", tree);
+
+        ConstantPopulation cp = new ConstantPopulation();
+        cp.initByName("popSize", Double.toString(pop));
+
+        Coalescent coal = new Coalescent();
+        coal.initByName("treeIntervals", treeIntervals, "populationModel", cp);
+
+        double logL = coal.calculateLogP();
+
+        assertEquals(logL, -(4 / pop) - 2 * Math.log(pop), PRECISION);
+
+        // *********** 4 taxon **********
+//        tree = getTree(data, trees[1]);
+//        treeIntervals = new TreeIntervals();
+//        treeIntervals.initByName("tree", tree);
+//
+//        cp = new ConstantPopulation();
+//        cp.initByName("popSize", Double.toString(pop));
+//
+//        coal = new Coalescent();
+//        coal.initByName("treeIntervals", treeIntervals, "populationModel", cp);
+//
+//        logL = coal.calculateLogP();
+//
+//        assertEquals(logL, -(4 / pop) - 2 * Math.log(pop), PRECISION);
+
+    }
+
+    public void testExponentialGrowth() throws Exception {
+
+    }
+
+}
diff --git a/src/test/beast/evolution/tree/newick/NewickTreeTest.java b/src/test/beast/evolution/tree/newick/NewickTreeTest.java
new file mode 100644
index 0000000..5d89f2d
--- /dev/null
+++ b/src/test/beast/evolution/tree/newick/NewickTreeTest.java
@@ -0,0 +1,39 @@
+package test.beast.evolution.tree.newick;
+
+import beast.util.TreeParser;
+import junit.framework.TestCase;
+
+/**
+ * @author Walter Xie
+ */
+public class NewickTreeTest extends TestCase {
+    String[] trees1 = new String[]{
+            "((A:1.0,B:1.0):1.0,C:2.0);",
+            "((1:1.0,2:1.0):1.0,3:2.0);"
+    }; //more trees ?
+    String[] trees2 = new String[]{
+            "((A:1.5,B:0.5):1.1,C:3.0):0.0;",
+            "((2:1.5,1:0.5):1.1,3:3.0):0.0;"
+    }; //more trees ?
+
+
+    public void testLabeledNewickTrees() throws Exception {
+
+        for (String tree : trees1) {
+
+            TreeParser newickTree = new TreeParser(tree, false, false, true, 1);
+
+//            System.out.println(tree);
+//            System.out.println(newickTree);
+
+            assertEquals("((0:1.0,1:1.0)3:1.0,2:2.0)4:0.0", newickTree.toString());
+        }
+
+        for (String tree : trees2) {
+            TreeParser newickTree = new TreeParser(tree, false, false, true, 1);
+            String newick = newickTree.getRoot().toNewick();
+            assertEquals(tree, newick+";");
+        }
+
+    }
+}
diff --git a/src/test/beast/integration/DocumentationTest.java b/src/test/beast/integration/DocumentationTest.java
new file mode 100644
index 0000000..736b63c
--- /dev/null
+++ b/src/test/beast/integration/DocumentationTest.java
@@ -0,0 +1,119 @@
+package test.beast.integration;
+
+import java.lang.annotation.Annotation;
+import java.util.ArrayList;
+import java.util.List;
+
+import junit.framework.TestCase;
+import org.junit.Test;
+
+import beast.core.Description;
+import beast.core.Input;
+import beast.core.BEASTObject;
+import beast.util.AddOnManager;
+
+
+
+public class DocumentationTest extends TestCase {
+
+    /**
+     * Check all plug-ins have a proper description so that
+     * everything is at least moderately well documented. *
+     */
+    @Test
+    public void testDescriptions() {
+        final List<String> sPluginNames = AddOnManager.find(beast.core.BEASTObject.class, AddOnManager.IMPLEMENTATION_DIR);
+        final List<String> sUndocumentedPlugins = new ArrayList<String>();
+        for (final String sPlugin : sPluginNames) {
+            try {
+                final Class<?> pluginClass = Class.forName(sPlugin);
+                final Annotation[] classAnnotations = pluginClass.getAnnotations();
+                boolean hasSatisfactoryDescription = false;
+                for (final Annotation annotation : classAnnotations) {
+                    if (annotation instanceof Description) {
+                        final Description description = (Description) annotation;
+                        final String sDescription = description.value();
+                        if (isProperDocString(sDescription)) {
+                            hasSatisfactoryDescription = true;
+                        }
+                    }
+                }
+                if (!hasSatisfactoryDescription) {
+                    sUndocumentedPlugins.add(sPlugin);
+                }
+            } catch (Exception e) {
+            }
+        }
+        assertTrue("No proper description for: " + sUndocumentedPlugins.toString(), sUndocumentedPlugins.size() == 0);
+    } // testDescriptions
+
+    /**
+     * Check all inputs of plug-ins have a proper tip text, again
+     * to facilitate proper documentation. *
+     */
+    @Test
+    public void testInputTipText() {
+        final List<String> sPluginNames = AddOnManager.find(beast.core.BEASTObject.class, AddOnManager.IMPLEMENTATION_DIR);
+        final List<String> sUndocumentedInputs = new ArrayList<String>();
+        for (final String sPlugin : sPluginNames) {
+            try {
+                final BEASTObject plugin = (BEASTObject) Class.forName(sPlugin).newInstance();
+                final List<Input<?>> inputs = plugin.listInputs();
+                for (final Input<?> input : inputs) {
+                    boolean hasSatisfactoryDescription = false;
+                    final String sTipText = input.getTipText();
+                    if (isProperDocString(sTipText)) {
+                        hasSatisfactoryDescription = true;
+                    }
+                    if (!hasSatisfactoryDescription) {
+                        sUndocumentedInputs.add(sPlugin + ":" + input.getName());
+                    }
+                }
+            } catch (Exception e) {
+            }
+        }
+
+        assertTrue("No proper input tip text (at least " + N_WORDS + " words and " + N_CHARS + " characters) for: "
+                + sUndocumentedInputs.toString(), sUndocumentedInputs.size() == 0);
+    } // testInputTipText
+
+
+    /**
+     * run DocMaker. This can pick up incorrectly initialised inputs of lists
+     * and some other initialisation stuff *
+     */
+    @Test
+    public void test_DocMaker() throws Exception {
+        // this code runs just fine stand alone, but not in ant. TODO: figure out why
+//		String [] sArgs = {"."};
+//		DocMaker b = new DocMaker(sArgs);
+//		b.generateDocs();
+//		// clean up
+//		String [] sFiles = new File(".").list();
+//		for (String sFile : sFiles) {
+//			if (sFile.endsWith(".html")) {
+//				new File(sFile).delete();
+//			}
+//		}
+    } // test_DocMaker
+
+
+    private final int N_WORDS = 4;
+    private final int N_CHARS = 15;
+
+    // description of at least 15 chars and at least 4 words is satisfactory?!?
+    // TODO: needs a bit more smarts to prevent as df a hsf jasd;fajasdf
+    boolean isProperDocString(final String sStr) {
+        // check length
+        if (sStr.length() < N_CHARS) {
+            return false;
+        }
+        // count nr of words
+        final String[] sWords = sStr.split("\\s+");
+        if (sWords.length < N_WORDS) {
+            return false;
+        }
+        return true;
+    } // isProperDocString
+
+} // class DocumentationTest
diff --git a/src/test/beast/integration/ExampleJSONParsingTest.java b/src/test/beast/integration/ExampleJSONParsingTest.java
new file mode 100644
index 0000000..cb51a1c
--- /dev/null
+++ b/src/test/beast/integration/ExampleJSONParsingTest.java
@@ -0,0 +1,127 @@
+package test.beast.integration;
+
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.Test;
+
+import beast.core.Logger;
+import beast.core.MCMC;
+import beast.util.JSONParser;
+import beast.util.Randomizer;
+
+
+import junit.framework.TestCase;
+
+/**
+ * check whether all example files parse *
+ */
+public class ExampleJSONParsingTest extends TestCase {
+	{
+		ExampleXmlParsingTest.setUpTestDir();
+	}
+	
+    @Test
+    public void test_ThatXmlExamplesParse() {
+        String dir = System.getProperty("user.dir") + "/examples";
+    	test_ThatJSONExamplesParse(dir);
+    }
+    
+    public void test_ThatJSONExamplesParse(String dir) {
+        try {
+            Randomizer.setSeed(127);
+            Logger.FILE_MODE = Logger.LogFileMode.overwrite;
+            System.out.println("Test JSON Examples in " + dir);
+            File sExampleDir = new File(dir);
+            String[] sExampleFiles = sExampleDir.list(new FilenameFilter() {
+                public boolean accept(File dir, String name) {
+                    return name.endsWith(".json");
+                }
+            });
+
+            List<String> sFailedFiles = new ArrayList<String>();
+            for (String fileName : sExampleFiles) {
+                System.out.println("Processing " + fileName);
+                JSONParser parser = new JSONParser();
+                try {
+                    parser.parseFile(new File(dir + "/" + fileName));
+                } catch (Exception e) {
+                    System.out.println("ExampleJSONParsing::Failed for " + fileName
+                            + ": " + e.getMessage());
+                    sFailedFiles.add(fileName);
+                }
+                System.out.println("Done " + fileName);
+            }
+            if (sFailedFiles.size() > 0) {
+                System.out.println("\ntest_ThatJSONExamplesParse::Failed for : " + sFailedFiles.toString());
+            } else {
+                System.out.println("\ntest_ThatJSONExamplesParse::Success");
+            }
+            assertTrue(sFailedFiles.toString(), sFailedFiles.size() == 0);
+        } catch (Exception e) {
+            System.out.println("exception thrown ");
+            System.out.println(e.getMessage());
+        }
+    } // test_JSONExamples
+
+    @Test
+    public void test_ThatJSONExamplesRun() {
+        String dir = System.getProperty("user.dir") + "/examples";
+        test_ThatJSONExamplesRun(dir);
+    }
+    
+    public void test_ThatJSONExamplesRun(String dir) {
+        try {
+            Logger.FILE_MODE = Logger.LogFileMode.overwrite;
+            System.out.println("Test that JSON Examples run in " + dir);
+            File sExampleDir = new File(dir);
+            String[] sExampleFiles = sExampleDir.list(new FilenameFilter() {
+                public boolean accept(File dir, String name) {
+                    return name.endsWith(".json");
+                }
+            });
+
+            List<String> sFailedFiles = new ArrayList<String>();
+            int nSeed = 127;
+            for (String fileName : sExampleFiles) {
+                Randomizer.setSeed(nSeed);
+                nSeed += 10; // need more than one to prevent trouble with multiMCMC logs
+                System.out.println("Processing " + fileName);
+                JSONParser parser = new JSONParser();
+                try {
+                    beast.core.Runnable runable = parser.parseFile(new File(dir + "/" + fileName));
+                    if (runable instanceof MCMC) {
+                        MCMC mcmc = (MCMC) runable;
+                        mcmc.setInputValue("preBurnin", 0);
+                        mcmc.setInputValue("chainLength", 1000);
+                        mcmc.run();
+                    }
+                } catch (Exception e) {
+                    System.out.println("ExampleJSONParsing::Failed for " + fileName
+                            + ": " + e.getMessage());
+                    sFailedFiles.add(fileName);
+                }
+                System.out.println("Done " + fileName);
+            }
+            if (sFailedFiles.size() > 0) {
+                System.out.println("\ntest_ThatJSONExamplesRun::Failed for : " + sFailedFiles.toString());
+            } else {
+                System.out.println("SUCCESS!!!");
+            }
+            assertTrue(sFailedFiles.toString(), sFailedFiles.size() == 0);
+        } catch (Exception e) {
+            System.out.println("exception thrown ");
+            System.out.println(e.getMessage());
+            ;
+        }
+    } // test_ThatXmlExamplesRun
+
+
+    public static void main(String args[]) {
+        org.junit.runner.JUnitCore.main("test.beast.integration.ExampleJSONParsingTest");
+    }
+
+} // ExampleJSONParsingTest
diff --git a/src/test/beast/integration/ExampleXmlParsingTest.java b/src/test/beast/integration/ExampleXmlParsingTest.java
new file mode 100644
index 0000000..5565dde
--- /dev/null
+++ b/src/test/beast/integration/ExampleXmlParsingTest.java
@@ -0,0 +1,137 @@
+package test.beast.integration;
+
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.Test;
+
+import beast.core.Logger;
+import beast.core.MCMC;
+import beast.util.Randomizer;
+import beast.util.XMLParser;
+
+
+import junit.framework.TestCase;
+
+/**
+ * check whether all example files parse *
+ */
+public class ExampleXmlParsingTest extends TestCase {
+	public static void setUpTestDir() {
+		// make sure output goes to test directory
+		File testDir = 	new File("./test");
+		if (!testDir.exists()) {
+			testDir.mkdir();
+		}
+		System.setProperty("file.name.prefix","test/");
+	}
+	
+	{
+		setUpTestDir();
+	}
+
+    @Test
+    public void test_ThatXmlExamplesParse() {
+        String dir = System.getProperty("user.dir") + "/examples";
+    	test_ThatXmlExamplesParse(dir);
+    }
+    
+    public void test_ThatXmlExamplesParse(String dir) {
+        try {
+            Randomizer.setSeed(127);
+            Logger.FILE_MODE = Logger.LogFileMode.overwrite;
+            System.out.println("Test XML Examples in " + dir);
+            File sExampleDir = new File(dir);
+            String[] sExampleFiles = sExampleDir.list(new FilenameFilter() {
+                public boolean accept(File dir, String name) {
+                    return name.endsWith(".xml");
+                }
+            });
+
+            List<String> sFailedFiles = new ArrayList<String>();
+            for (String fileName : sExampleFiles) {
+                System.out.println("Processing " + fileName);
+                XMLParser parser = new XMLParser();
+                try {
+                    parser.parseFile(new File(dir + "/" + fileName));
+                } catch (Exception e) {
+                    System.out.println("ExampleXmlParsing::Failed for " + fileName
+                            + ": " + e.getMessage());
+                    sFailedFiles.add(fileName);
+                }
+                System.out.println("Done " + fileName);
+            }
+            if (sFailedFiles.size() > 0) {
+                System.out.println("\ntest_ThatXmlExamplesParse::Failed for : " + sFailedFiles.toString());
+            } else {
+                System.out.println("\ntest_ThatXmlExamplesParse::Success");
+            }
+            assertTrue(sFailedFiles.toString(), sFailedFiles.size() == 0);
+        } catch (Exception e) {
+            System.out.println("exception thrown ");
+            System.out.println(e.getMessage());
+        }
+    } // test_XmlExamples
+
+    @Test
+    public void test_ThatXmlExamplesRun() {
+        String dir = System.getProperty("user.dir") + "/examples";
+        test_ThatXmlExamplesRun(dir);
+    }
+    
+    public void test_ThatXmlExamplesRun(String dir) {
+        try {
+            Logger.FILE_MODE = Logger.LogFileMode.overwrite;
+            System.out.println("Test that XML Examples run in " + dir);
+            File sExampleDir = new File(dir);
+            String[] sExampleFiles = sExampleDir.list(new FilenameFilter() {
+                public boolean accept(File dir, String name) {
+                    return name.endsWith(".xml");
+                }
+            });
+
+            List<String> sFailedFiles = new ArrayList<String>();
+            int nSeed = 127;
+            for (String fileName : sExampleFiles) {
+                Randomizer.setSeed(nSeed);
+                nSeed += 10; // need more than one to prevent trouble with multiMCMC logs
+                System.out.println("Processing " + fileName);
+                XMLParser parser = new XMLParser();
+                try {
+                    beast.core.Runnable runable = parser.parseFile(new File(dir + "/" + fileName));
+                    if (runable instanceof MCMC) {
+                        MCMC mcmc = (MCMC) runable;
+                        mcmc.setInputValue("preBurnin", 0);
+                        mcmc.setInputValue("chainLength", 1000);
+                        mcmc.run();
+                    }
+                } catch (Exception e) {
+                    System.out.println("ExampleXmlParsing::Failed for " + fileName
+                            + ": " + e.getMessage());
+                    sFailedFiles.add(fileName);
+                }
+                System.out.println("Done " + fileName);
+            }
+            if (sFailedFiles.size() > 0) {
+                System.out.println("\ntest_ThatXmlExamplesRun::Failed for : " + sFailedFiles.toString());
+            } else {
+                System.out.println("SUCCESS!!!");
+            }
+            assertTrue(sFailedFiles.toString(), sFailedFiles.size() == 0);
+        } catch (Exception e) {
+            System.out.println("exception thrown ");
+            System.out.println(e.getMessage());
+            ;
+        }
+    } // test_ThatXmlExamplesRun
+
+
+    public static void main(String args[]) {
+        org.junit.runner.JUnitCore.main("test.beast.integration.ExampleXmlParsingTest");
+    }
+
+
+} // ExampleXmlParsingTest
diff --git a/src/test/beast/integration/InputTypeTest.java b/src/test/beast/integration/InputTypeTest.java
new file mode 100644
index 0000000..3edd32f
--- /dev/null
+++ b/src/test/beast/integration/InputTypeTest.java
@@ -0,0 +1,50 @@
+package test.beast.integration;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.Test;
+
+import beast.core.Input;
+import beast.core.BEASTObject;
+import beast.util.AddOnManager;
+
+
+import junit.framework.TestCase;
+
+public class InputTypeTest  extends TestCase {
+	
+	
+	/* Test that the type of an input can be determined,
+	 * If not, the programmer has to manually initialise the type of the input 
+	 * (most easily done through a constructor of Input) */
+	@Test
+	public void testInputTypeCanBeSet() throws Exception {
+        List<String> sPluginNames = AddOnManager.find(beast.core.BEASTObject.class, AddOnManager.IMPLEMENTATION_DIR);
+        List<String> failingInputs = new ArrayList<String>();
+        for (String sPlugin : sPluginNames) {
+            try {
+                BEASTObject plugin = (BEASTObject) Class.forName(sPlugin).newInstance();
+                List<Input<?>> inputs = plugin.listInputs();
+                for (Input<?> input : inputs) {
+                	if (input.getType() == null) {
+                		try {
+                			input.determineClass(plugin);
+                			if (input.getType() == null) {
+                    			failingInputs.add(sPlugin + ":" + input.getName());
+                			}
+                		} catch (Exception e2) {
+                			failingInputs.add(sPlugin + ":" + input.getName());
+                		}
+                	}
+                }
+            } catch (Exception e) {
+            	// ignore
+            }
+        }
+                
+        assertTrue("Type of input could not be set for these inputs (probably requires to be set by using the appropriate constructure of Input): "
+                + failingInputs.toString(), failingInputs.size() == 0);
+	}
+
+}
diff --git a/src/test/beast/integration/ResumeTest.java b/src/test/beast/integration/ResumeTest.java
new file mode 100644
index 0000000..b1bc758
--- /dev/null
+++ b/src/test/beast/integration/ResumeTest.java
@@ -0,0 +1,60 @@
+package test.beast.integration;
+
+import junit.framework.TestCase;
+
+import org.junit.Test;
+
+import beast.core.Logger;
+import beast.core.MCMC;
+import beast.util.Randomizer;
+import beast.util.XMLParser;
+
+
+
+import java.io.File;
+
+/**
+ * check that a chain can be resumed after termination *
+ */
+public class ResumeTest extends TestCase {
+
+    final static String XML_FILE = "testHKY.xml";
+	{
+		ExampleXmlParsingTest.setUpTestDir();
+	}
+
+    
+    @Test
+    public void test_ThatXmlExampleResumes() throws Exception {
+        Randomizer.setSeed(127);
+        Logger.FILE_MODE = Logger.LogFileMode.overwrite;
+        String dir = System.getProperty("user.dir") + "/examples";
+        String fileName = dir + "/" + XML_FILE;
+
+        System.out.println("Processing " + fileName);
+        XMLParser parser = new XMLParser();
+        beast.core.Runnable runable = parser.parseFile(new File(fileName));
+        runable.setStateFile("tmp.state", false);
+        if (runable instanceof MCMC) {
+            MCMC mcmc = (MCMC) runable;
+            mcmc.setInputValue("preBurnin", 0);
+            mcmc.setInputValue("chainLength", 1000);
+            mcmc.run();
+        }
+        System.out.println("Done " + fileName);
+
+        System.out.println("Resuming " + fileName);
+        Logger.FILE_MODE = Logger.LogFileMode.resume;
+        parser = new XMLParser();
+        runable = parser.parseFile(new File(fileName));
+        runable.setStateFile("tmp.state", true);
+        if (runable instanceof MCMC) {
+            MCMC mcmc = (MCMC) runable;
+            mcmc.setInputValue("preBurnin", 0);
+            mcmc.setInputValue("chainLength", 1000);
+            mcmc.run();
+        }
+        System.out.println("Done " + fileName);
+    } // test_ThatXmlExampleResumes
+
+} // class ResumeTest
diff --git a/src/test/beast/integration/XMLElementNameTest.java b/src/test/beast/integration/XMLElementNameTest.java
new file mode 100644
index 0000000..c241573
--- /dev/null
+++ b/src/test/beast/integration/XMLElementNameTest.java
@@ -0,0 +1,122 @@
+package test.beast.integration;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.junit.Test;
+
+import beast.core.Input;
+import beast.core.BEASTObject;
+import beast.util.AddOnManager;
+import beast.util.XMLParser;
+
+
+
+import junit.framework.TestCase;
+
+
+public class XMLElementNameTest extends TestCase {
+    /**
+     * test that Inputs have a unique name
+     * It can happen that a derived class uses the same Input name as one of its ancestors
+     */
+    @Test
+    public void test_NameUniqueness() {
+        List<String> sPluginNames = AddOnManager.find(beast.core.BEASTObject.class, AddOnManager.IMPLEMENTATION_DIR);
+        List<String> sImproperInputs = new ArrayList<String>();
+        for (String sPlugin : sPluginNames) {
+            try {
+                BEASTObject plugin = (BEASTObject) Class.forName(sPlugin).newInstance();
+                List<Input<?>> inputs = plugin.listInputs();
+                Set<String> sNames = new HashSet<String>();
+                for (Input<?> input : inputs) {
+                    String sName = input.getName();
+                    if (sNames.contains(sName)) {
+                        sImproperInputs.add(sPlugin + "." + sName);
+                        break;
+                    }
+                    sNames.add(sName);
+
+                }
+            } catch (InstantiationException e) {
+                // ignore
+            } catch (Exception e) {
+                // ignore
+            }
+        }
+        if (sImproperInputs.size() > 0) {
+            String sStr = sImproperInputs.toString();
+            sStr = sStr.replaceAll(",", "\n");
+            System.err.println("Input names are not unique:\n" + sStr);
+        }
+        // not activated till problem with naming is solved
+        assertTrue("Input names are not unique: " + sImproperInputs.toString(), sImproperInputs.size() == 0);
+    }
+
+    /**
+     * test that Inputs that use reserved names have the correct type *
+     */
+    @Test
+    public void test_ReservedElementNames() {
+        // retrieve list of reserved names and their classes
+        XMLParser parser = new XMLParser();
+        HashMap<String, String> sElement2ClassMap = parser.getElement2ClassMap();
+
+        // allow 'parameter' for any of the various parameter derivatives, not just RealParameter
+        sElement2ClassMap.put("parameter", "beast.core.parameter.Parameter");
+
+        // check each plugin
+        List<String> sPluginNames = AddOnManager.find(beast.core.BEASTObject.class, AddOnManager.IMPLEMENTATION_DIR);
+        List<String> sImproperInputs = new ArrayList<String>();
+        for (String sPlugin : sPluginNames) {
+            try {
+                BEASTObject plugin = (BEASTObject) Class.forName(sPlugin).newInstance();
+                // check each input
+                List<Input<?>> inputs = plugin.listInputs();
+                for (Input<?> input : inputs) {
+                    if (sElement2ClassMap.containsKey(input.getName())) {
+                        if (plugin.getClass() == null) {
+                            input.determineClass(plugin);
+                        }
+                        Class<?> type = input.getType();
+                        String sBaseType = sElement2ClassMap.get(input.getName());
+                        if (!isDerivedType(type, sBaseType)) {
+                            sImproperInputs.add(sPlugin + "." + input.getName());
+                        }
+                    }
+                }
+            } catch (InstantiationException e) {
+                // ignore
+            } catch (Exception e) {
+                // ignore
+            }
+        }
+        if (sImproperInputs.size() > 0) {
+            String sStr = sImproperInputs.toString();
+            sStr = sStr.replaceAll(",", "\n");
+            System.err.println("Reserved element names used for wrong types in:\n" + sStr);
+        }
+        // not activated till problem with naming is solved
+        assertTrue("Reserved element names used for wrong types in: " + sImproperInputs.toString(), sImproperInputs.size() == 0);
+    }
+
+    /**
+     * true if type is a class equal to or derived from sBaseType *
+     */
+    boolean isDerivedType(Class<?> type, String sBaseType) {
+        if (sBaseType.equals(type.getName())) {
+            return true;
+        }
+        Class<?> superType = type.getSuperclass();
+        if (!superType.equals(Object.class)) {
+            return isDerivedType(superType, sBaseType);
+        }
+
+        return false;
+    }
+
+} // class XMLElementNameTest
+
diff --git a/src/test/beast/integration/XMLProducerTest.java b/src/test/beast/integration/XMLProducerTest.java
new file mode 100644
index 0000000..a4f427a
--- /dev/null
+++ b/src/test/beast/integration/XMLProducerTest.java
@@ -0,0 +1,82 @@
+package test.beast.integration;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.util.ArrayList;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.junit.Test;
+
+import beast.core.BEASTInterface;
+import beast.core.Logger;
+import beast.util.Randomizer;
+import beast.util.XMLParser;
+import beast.util.XMLProducer;
+
+public class XMLProducerTest extends TestCase {
+
+    @Test
+    public void test_ThatXmlExamplesProduces() {
+    	System.setProperty("java.only", "true");
+        String dir = System.getProperty("user.dir") + "/examples";
+        //String dir = "/tmp";
+        List<String> exceptions = new ArrayList<String>();
+        exceptions.add("testExponentialGrowth.xml");
+    	test_ThatXmlExamplesProduces(dir, exceptions);
+    }
+    
+    /** parse all XML files in the given directory, then produce XML from it, and see if the produced XML still parses **/
+    public void test_ThatXmlExamplesProduces(String dir, List<String> exceptions) {
+        try {
+            Randomizer.setSeed(127);
+            Logger.FILE_MODE = Logger.LogFileMode.overwrite;
+            System.out.println("Test XML Examples in " + dir);
+            File sExampleDir = new File(dir);
+            String[] sExampleFiles = sExampleDir.list(new FilenameFilter() {
+                public boolean accept(File dir, String name) {
+                    return name.endsWith(".xml");
+                }
+            });
+
+            List<String> sFailedFiles = new ArrayList<String>();
+            for (String fileName : sExampleFiles) {
+            	if (exceptions.contains(fileName)) {
+                    System.out.println("Skipping exception " + fileName);
+            	} else {
+	                System.out.println("Processing " + fileName);
+	                XMLProducer parser = new XMLProducer();
+	                BEASTInterface o = null;
+	                try {
+	                    o = parser.parseFile(new File(dir + "/" + fileName));
+	                } catch (Exception e) {
+	                	o = null;
+	                }
+	                if (o != null) {
+	                	String xml = parser.toXML(o);
+	                	XMLParser parser2 = new XMLParser();
+	                    try {
+	                    	parser2.parseFragment(xml, false);
+	                    } catch (Exception e) {
+	                        System.out.println("test_ThatXmlExamplesProduces::Failed for " + fileName
+	                                + ": " + e.getMessage());
+	                        sFailedFiles.add(fileName);
+	                    }
+	                }
+	                System.out.println("Done " + fileName);
+            	}
+            }
+            if (sFailedFiles.size() > 0) {
+                System.out.println("\ntest_ThatXmlExamplesProduces::Failed for : " + sFailedFiles.toString());
+            } else {
+                System.out.println("\ntest_ThatXmlExamplesProduces::Success");
+            }
+            assertTrue(sFailedFiles.toString(), sFailedFiles.size() == 0);
+        } catch (Exception e) {
+            System.out.println("exception thrown ");
+            System.out.println(e.getMessage());
+        }
+    } // test_XmlExamples
+
+}
diff --git a/src/test/beast/math/distributions/GammaTest.java b/src/test/beast/math/distributions/GammaTest.java
new file mode 100644
index 0000000..6dd7531
--- /dev/null
+++ b/src/test/beast/math/distributions/GammaTest.java
@@ -0,0 +1,28 @@
+package test.beast.math.distributions;
+
+import org.junit.Test;
+
+import beast.math.distributions.Gamma;
+import junit.framework.TestCase;
+
+public class GammaTest extends TestCase {
+	
+	@Test
+	public void testGammaCummulative() throws Exception {
+		Gamma dist = new Gamma();
+		dist.initByName("alpha", "0.001", "beta", "1000.0");
+		double v = dist.inverseCumulativeProbability(0.5);
+		assertEquals(v, 5.244206e-299, 1e-304);
+		v = dist.inverseCumulativeProbability(0.05);
+		assertEquals(v, 0.0);
+		v = dist.inverseCumulativeProbability(0.025);
+		assertEquals(v, 0.0);
+		
+		v = dist.inverseCumulativeProbability(0.95);
+		assertEquals(v, 2.973588e-20, 1e-24);
+		v = dist.inverseCumulativeProbability(0.975);
+		assertEquals(v, 5.679252e-09, 1e-13);
+		
+	}
+
+}
diff --git a/src/test/beast/math/distributions/LogNormalDistributionModelTest.java b/src/test/beast/math/distributions/LogNormalDistributionModelTest.java
new file mode 100644
index 0000000..19714c6
--- /dev/null
+++ b/src/test/beast/math/distributions/LogNormalDistributionModelTest.java
@@ -0,0 +1,86 @@
+package test.beast.math.distributions;
+
+
+import org.junit.Test;
+
+import beast.core.parameter.RealParameter;
+import beast.math.distributions.LogNormalDistributionModel;
+import beast.util.XMLParser;
+
+
+
+import junit.framework.TestCase;
+
+public class LogNormalDistributionModelTest extends TestCase {
+
+    @Test
+    public void testPDF() throws Exception {
+        System.out.println("Testing 10000 random pdf calls");
+        LogNormalDistributionModel logNormal = new LogNormalDistributionModel();
+        logNormal.init("1.0", "2.0");
+
+        for (int i = 0; i < 10000; i++) {
+            double M = Math.random() * 10.0 - 5.0;
+            double S = Math.random() * 10;
+
+            double x = -1;
+            while( x < 0 ) {
+                x = Math.log(Math.random() * 10);
+            }
+
+            logNormal.MParameterInput.setValue(M + "", logNormal);
+            logNormal.SParameterInput.setValue(S + "", logNormal);
+            logNormal.initAndValidate();
+
+            double pdf = 1.0 / (x * S * Math.sqrt(2 * Math.PI)) * Math.exp(-Math.pow(Math.log(x) - M, 2) / (2 * S * S));
+
+            System.out.println("Testing logNormal[M=" + M + " S=" + S + "].pdf(" + x + ")");
+            double f = logNormal.density(x);
+
+            assertEquals(pdf, f, 1e-10);
+        }
+    }
+
+
+    @Test
+    public void testCalcLogP() throws Exception {
+        LogNormalDistributionModel logNormal = new LogNormalDistributionModel();
+        logNormal.hasMeanInRealSpaceInput.setValue("true", logNormal);
+        logNormal.offsetInput.setValue("1200", logNormal);
+        logNormal.MParameterInput.setValue("2000", logNormal);
+        logNormal.SParameterInput.setValue("0.6", logNormal);
+        logNormal.initAndValidate();
+        RealParameter p = new RealParameter(new Double[]{2952.6747000000014});
+
+        double f0 = logNormal.calcLogP(p);
+        assertEquals(-7.880210654973873, f0, 1e-10);
+    }
+
+    @Test
+    public void testCalcLogP2() throws Exception {
+        // does the same as testCalcLogP(), but with by constructing object through XML
+        String sXML = "<input spec='beast.math.distributions.LogNormalDistributionModel' " +
+                "offset='1200' " +
+                "M='2000' " +
+                "S='0.6' " +
+                "meanInRealSpace='true'/>";
+        RealParameter p = new RealParameter(new Double[]{2952.6747000000014});
+        XMLParser parser = new XMLParser();
+        LogNormalDistributionModel logNormal = (LogNormalDistributionModel) parser.parseBareFragment(sXML, true);
+
+        double f0 = logNormal.calcLogP(p);
+        assertEquals(-7.880210654973873, f0, 1e-10);
+    }
+
+    @Test
+    public void testCalcLogP3() throws Exception {
+        // does the same as testCalcLogP(), but with by constructing object through init
+        LogNormalDistributionModel logNormal = new LogNormalDistributionModel();
+        logNormal.init("2000", "0.6", true, "1200");
+        RealParameter p = new RealParameter(new Double[]{2952.6747000000014});
+
+        double f0 = logNormal.calcLogP(p);
+        assertEquals(-7.880210654973873, f0, 1e-10);
+    }
+}
+
diff --git a/src/test/beast/math/distributions/MRCAPriorTest.java b/src/test/beast/math/distributions/MRCAPriorTest.java
new file mode 100644
index 0000000..5495c70
--- /dev/null
+++ b/src/test/beast/math/distributions/MRCAPriorTest.java
@@ -0,0 +1,123 @@
+package test.beast.math.distributions;
+
+import org.junit.Test;
+
+import beast.evolution.alignment.Alignment;
+import beast.evolution.alignment.Taxon;
+import beast.evolution.alignment.TaxonSet;
+import beast.math.distributions.Exponential;
+import beast.math.distributions.MRCAPrior;
+import beast.util.TreeParser;
+
+import test.beast.BEASTTestCase;
+import junit.framework.TestCase;
+
+public class MRCAPriorTest extends TestCase {
+
+    @Test
+    public void testSingleMonophyleticConstraint() throws Exception {
+        Alignment data = BEASTTestCase.getAlignment();
+        TreeParser tree = new TreeParser();
+        tree.initByName("taxa", data,
+                "newick", "((human:0.024003,(chimp:0.010772,bonobo:0.010772):0.013231):0.012035," +
+                "(gorilla:0.024003,(orangutan:0.010772,siamang:0.010772):0.013231):0.012035);",
+                "IsLabelledNewick", true);
+
+        Taxon human = new Taxon();
+        human.setID("human");
+        Taxon bonobo = new Taxon();
+        bonobo.setID("bonobo");
+        Taxon chimp = new Taxon();
+        chimp.setID("chimp");
+        Taxon gorilla = new Taxon();
+        gorilla.setID("gorilla");
+        Taxon orangutan = new Taxon();
+        orangutan.setID("orangutan");
+        Taxon siamang = new Taxon();
+        siamang.setID("siamang");
+
+        MRCAPrior prior = new MRCAPrior();
+
+        /* check (human, bonobo, chimp) is monophyletic **/
+        TaxonSet set = new TaxonSet();
+        set.initByName("taxon", human, "taxon", bonobo, "taxon", chimp);
+        prior.initByName("tree", tree, "taxonset", set, "monophyletic", true);
+        double fLogP = prior.calculateLogP();
+        assertEquals(fLogP, 0, 0);
+
+        /* check (gorilla, siamang) is NOT monophyletic **/
+        set = new TaxonSet();
+        set.initByName("taxon", gorilla, "taxon", siamang);
+        prior.initByName("tree", tree, "taxonset", set, "monophyletic", true);
+        fLogP = prior.calculateLogP();
+        assertEquals(fLogP, Double.NEGATIVE_INFINITY, 0);
+
+        /* check (gorilla, orangutan, siamang) is monophyletic **/
+        set = new TaxonSet();
+        set.initByName("taxon", gorilla, "taxon", orangutan, "taxon", siamang);
+        prior.initByName("tree", tree, "taxonset", set, "monophyletic", true);
+        fLogP = prior.calculateLogP();
+        assertEquals(fLogP, 0, 0);
+
+        /* check (human, gorilla) is NOT monophyletic **/
+        set = new TaxonSet();
+        set.initByName("taxon", human, "taxon", gorilla);
+        prior.initByName("tree", tree, "taxonset", set, "monophyletic", true);
+        fLogP = prior.calculateLogP();
+        assertEquals(fLogP, Double.NEGATIVE_INFINITY, 0);
+    }
+
+    @Test
+    public void testMRCATimePrior() throws Exception {
+        Alignment data = BEASTTestCase.getAlignment();
+        TreeParser tree = new TreeParser();
+        tree.initByName("taxa", data,
+                "newick", "((human:0.024003,(chimp:0.010772,bonobo:0.010772):0.013231):0.012035," +
+                "(gorilla:0.024003,(orangutan:0.010772,siamang:0.010772):0.013231):0.012035);",
+                "IsLabelledNewick", true);
+
+        Taxon human = new Taxon();
+        human.setID("human");
+        Taxon bonobo = new Taxon();
+        bonobo.setID("bonobo");
+        Taxon chimp = new Taxon();
+        chimp.setID("chimp");
+        Taxon gorilla = new Taxon();
+        gorilla.setID("gorilla");
+        Taxon orangutan = new Taxon();
+        orangutan.setID("orangutan");
+        Taxon siamang = new Taxon();
+        siamang.setID("siamang");
+
+        MRCAPrior prior = new MRCAPrior();
+
+        TaxonSet set = new TaxonSet();
+        set.initByName("taxon", human, "taxon", bonobo, "taxon", chimp);
+        Exponential exp = new Exponential();
+
+        /* get distribution for set (human, bonobo, chimp) */
+        prior.initByName("tree", tree, "taxonset", set, "monophyletic", true, "distr", exp);
+        double fLogP = prior.calculateLogP();
+        assertEquals(-0.024003, fLogP, BEASTTestCase.PRECISION);
+
+        /* get distribution for set (human, chimp), do not require the set to by monophyletic */
+        set = new TaxonSet();
+        set.initByName("taxon", human, "taxon", chimp);
+        prior.initByName("tree", tree, "taxonset", set, "monophyletic", false);
+        fLogP = prior.calculateLogP();
+        assertEquals(-0.024003, fLogP, BEASTTestCase.PRECISION);
+
+        /* get distribution for set (human, chimp), DO require the set to by monophyletic */
+        prior.initByName("tree", tree, "taxonset", set, "monophyletic", true);
+        fLogP = prior.calculateLogP();
+        assertEquals(Double.NEGATIVE_INFINITY, fLogP, 0);
+
+        /* get distribution for set (human, gorilla) = root, not monophyletic */
+        set = new TaxonSet();
+        set.initByName("taxon", human, "taxon", gorilla);
+        prior.initByName("tree", tree, "taxonset", set, "monophyletic", false);
+        fLogP = prior.calculateLogP();
+        assertEquals(-0.024003 - 0.012035, fLogP, BEASTTestCase.PRECISION);
+    }
+
+}
diff --git a/src/test/beast/math/distributions/MeanOfParametricDistributionTest.java b/src/test/beast/math/distributions/MeanOfParametricDistributionTest.java
new file mode 100644
index 0000000..d4d3062
--- /dev/null
+++ b/src/test/beast/math/distributions/MeanOfParametricDistributionTest.java
@@ -0,0 +1,133 @@
+package test.beast.math.distributions;
+
+
+
+import org.junit.Test;
+
+import beast.core.BEASTInterface;
+import beast.math.distributions.Exponential;
+import beast.math.distributions.Gamma;
+import beast.math.distributions.LogNormalDistributionModel;
+import beast.math.distributions.Normal;
+import beast.math.distributions.Uniform;
+import beast.util.XMLParser;
+
+
+
+import junit.framework.TestCase;
+
+public class MeanOfParametricDistributionTest extends TestCase {
+
+	@Test
+    public void testMeanOfNormal() throws Exception {
+		Normal normal = new Normal();
+		normal.initByName("mean","123.0","sigma","3.0");
+		double mean = normal.getMean();
+        assertEquals(mean, 123, 1e-10);
+
+        normal = new Normal();
+		normal.initByName("mean","123.0","sigma","30.0");
+		mean = normal.getMean();
+        assertEquals(mean, 123, 1e-10);
+
+        normal = new Normal();
+		normal.initByName("mean","123.0","sigma","3.0","offset","3.0");
+		mean = normal.getMean();
+        assertEquals(mean, 126, 1e-10);
+	}
+
+	@Test
+    public void testMeanOfGamma() throws Exception {
+		Gamma gamma = new Gamma();
+		gamma.initByName("alpha", "100", "beta", "10");
+		double mean = gamma.getMean();
+        assertEquals(mean, 10, 1e-10);
+
+        gamma = new Gamma();
+		gamma.initByName("alpha", "100", "beta", "100");
+		mean = gamma.getMean();
+        assertEquals(mean, 1, 1e-10);
+
+        gamma = new Gamma();
+		gamma.initByName("alpha", "100", "beta", "10", "offset", "3");
+		mean = gamma.getMean();
+        assertEquals(mean, 13, 1e-10);
+	}
+
+
+	@Test
+    public void testMeanOfExponential() throws Exception {
+		Exponential exp = new Exponential();
+		exp.initByName("mean", "10");
+		double mean = exp.getMean();
+        assertEquals(mean, 10, 1e-10);
+
+        exp = new Exponential();
+		exp.initByName("mean", "1");
+		mean = exp.getMean();
+        assertEquals(mean, 1, 1e-10);
+
+        exp = new Exponential();
+		exp.initByName("mean", "1", "offset", "3");
+		mean = exp.getMean();
+        assertEquals(mean, 4, 1e-10);
+	}
+
+	@Test
+    public void testMeanOfLogNormal() throws Exception {
+		LogNormalDistributionModel exp = new LogNormalDistributionModel();
+		exp.initByName("M", "10" , "S", "1", "meanInRealSpace", true);
+		double mean = exp.getMean();
+        assertEquals(mean, 10, 1e-10);
+
+        exp = new LogNormalDistributionModel();
+		exp.initByName("M", "1", "S", "1", "meanInRealSpace", true);
+		mean = exp.getMean();
+        assertEquals(mean, 1, 1e-10);
+
+        exp = new LogNormalDistributionModel();
+		exp.initByName("M", "1", "S", "1", "meanInRealSpace", true, "offset", "3");
+		mean = exp.getMean();
+        assertEquals(mean, 4, 1e-10);
+
+        try {
+            exp = new LogNormalDistributionModel();
+    		exp.initByName("M", "1", "S", "1", "meanInRealSpace", false, "offset", "3");
+    		mean = exp.getMean();
+            assertEquals(mean, 4, 1e-10);
+        } catch (RuntimeException e) {
+        	// we are fine here
+        }
+	}
+	
+	@Test
+	public void testMeanOfUniform() throws Exception {
+        Uniform dist = (Uniform) fromXML("<input spec='beast.math.distributions.Uniform' lower='0' upper='1.0' offset='0'/>");
+        assertEquals(0.5, dist.getMean(), 1e-10);
+        
+        dist = (Uniform) fromXML("<input spec='beast.math.distributions.Uniform'/>");
+        assertEquals(0.5, dist.getMean(), 1e-10);
+
+        dist = (Uniform) fromXML("<input spec='beast.math.distributions.Uniform' lower='0' upper='1.0' offset='10'/>");
+        assertEquals(10.5, dist.getMean(), 1e-10);
+
+        dist = (Uniform) fromXML("<input spec='beast.math.distributions.Uniform' upper='Infinity'/>");
+        assertEquals(Double.NaN, dist.getMean(), 1e-10);
+
+        dist = (Uniform) fromXML("<input spec='beast.math.distributions.Uniform' lower='-Infinity' offset='10'/>");
+        assertEquals(Double.NaN, dist.getMean(), 1e-10);
+
+        dist = (Uniform) fromXML("<input spec='beast.math.distributions.Uniform' lower='-10' upper='10.0' offset='10'/>");
+        assertEquals(10, dist.getMean(), 1e-10);
+        
+        dist = new Uniform();
+        dist.initByName("lower", "-1.0", "upper", "0.0");
+        assertEquals(-0.5, dist.getMean(), 1e-10);
+        
+	}
+	
+	BEASTInterface fromXML(String xml) throws Exception {
+		return (new XMLParser()).parseBareFragment(xml, true);
+	}
+
+}
diff --git a/src/test/beast/util/ClusterTreeTest.java b/src/test/beast/util/ClusterTreeTest.java
new file mode 100644
index 0000000..21c0071
--- /dev/null
+++ b/src/test/beast/util/ClusterTreeTest.java
@@ -0,0 +1,77 @@
+package test.beast.util;
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+import beast.evolution.alignment.Alignment;
+import beast.evolution.alignment.Sequence;
+import beast.evolution.sitemodel.SiteModel;
+import beast.evolution.substitutionmodel.JukesCantor;
+import beast.util.ClusterTree;
+import junit.framework.TestCase;
+import test.beast.BEASTTestCase;
+
+
+public class ClusterTreeTest extends TestCase {
+
+    public void testUPGMA() throws Exception {
+        Alignment alignment = BEASTTestCase.getAlignment();
+
+        JukesCantor JC = new JukesCantor();
+        JC.initAndValidate();
+
+        SiteModel siteModel = new SiteModel();
+        siteModel.initByName("substModel", JC);
+        
+        ClusterTree tree = new ClusterTree();
+        tree.initByName(
+                "clusterType", "upgma",
+                "taxa", alignment);
+        
+        String expectedNewick = "((((human:0.01903085702575253,(chimp:0.008560512208575313,bonobo:0.008560512208575313):0.010470344817177218):0.007962255880644985,gorilla:0.026993112906397516):0.019197419394211015,orangutan:0.04619053230060853):0.007214240662738673,siamang:0.053404772963347204):0.0";
+        String actualNewick = tree.getRoot().toNewick();
+        assertEquals(expectedNewick, actualNewick);
+        
+        // select 3 sequences
+        List<Sequence> seqs = new ArrayList<Sequence>();
+        seqs.addAll(alignment.sequenceInput.get());
+        List<Sequence> newseqs = alignment.sequenceInput.get();
+        newseqs.clear();
+        newseqs.add(Sequence.getSequenceByTaxon("bonobo", seqs));
+        newseqs.add(Sequence.getSequenceByTaxon("chimp", seqs));
+        newseqs.add(Sequence.getSequenceByTaxon("human", seqs));
+        alignment.initAndValidate();
+        tree = new ClusterTree();
+        tree.initByName(
+                "clusterType", "upgma",
+                "taxa", alignment);
+        expectedNewick = "((bonobo:0.008560512208575313,chimp:0.008560512208575313):0.010470344817177218,human:0.01903085702575253):0.0";
+        
+        System.err.println("Seqs:");
+        for (Sequence s : seqs) {
+        	System.err.println(s.taxonInput.get());
+        }
+        System.err.println("Newseqs:");
+        for (Sequence s : newseqs) {
+        	System.err.println(s.taxonInput.get());
+        }
+        
+        actualNewick = tree.getRoot().toNewick();
+        assertEquals(expectedNewick, actualNewick);
+
+        // same sequences in different order
+        newseqs.clear();
+        newseqs.add(Sequence.getSequenceByTaxon("human", seqs));
+        newseqs.add(Sequence.getSequenceByTaxon("chimp", seqs));
+        newseqs.add(Sequence.getSequenceByTaxon("bonobo", seqs));
+        alignment.initAndValidate();
+        tree = new ClusterTree();
+        tree.initByName(
+                "clusterType", "upgma",
+                "taxa", alignment);
+        actualNewick = tree.getRoot().toNewick();
+        expectedNewick = "(human:0.01903085702575253,(chimp:0.008560512208575313,bonobo:0.008560512208575313):0.010470344817177218):0.0";
+        assertEquals(expectedNewick, actualNewick);
+    }
+}
diff --git a/src/test/beast/util/JSONTest.java b/src/test/beast/util/JSONTest.java
new file mode 100644
index 0000000..9e85d38
--- /dev/null
+++ b/src/test/beast/util/JSONTest.java
@@ -0,0 +1,29 @@
+package test.beast.util;
+
+import java.io.File;
+
+import org.junit.Test;
+
+import beast.app.beauti.BeautiDoc;
+import beast.core.BEASTObject;
+import beast.util.JSONParser;
+import beast.util.JSONProducer;
+
+import junit.framework.TestCase;
+
+public class JSONTest extends TestCase {
+	public static String JSON_FILE = "examples/testHKY.json";
+
+    @Test
+    public void testJSONtoXMLtoJSON() throws Exception {
+    	JSONParser parser = new JSONParser();
+		BEASTObject plugin = parser.parseFile(new File(JSON_FILE));
+		JSONProducer producer = new JSONProducer();
+		String actual = producer.toJSON(plugin).trim().replaceAll("\\s+", " ");
+		
+		String expected = BeautiDoc.load(JSON_FILE).trim().replaceAll("\\s+", " ");
+		assertEquals("Produced JSON differs from original", 
+				expected, 
+				actual);
+    }
+}
diff --git a/src/test/beast/util/NexusParserTest.java b/src/test/beast/util/NexusParserTest.java
new file mode 100644
index 0000000..e3aab78
--- /dev/null
+++ b/src/test/beast/util/NexusParserTest.java
@@ -0,0 +1,162 @@
+package test.beast.util;
+
+import junit.framework.TestCase;
+
+import org.junit.Test;
+
+import beast.util.NexusParser;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.io.StringReader;
+import java.util.*;
+
+public class NexusParserTest extends TestCase {
+
+    @Test
+    public void testThatNexusExamplesParse() {
+        try {
+            String sDir = System.getProperty("user.dir") + "/examples/nexus";
+            System.out.println("Test Nexus Examples in " + sDir);
+            File sExampleDir = new File(sDir);
+            String[] sExampleFiles = sExampleDir.list(new FilenameFilter() {
+                public boolean accept(File dir, String name) {
+                    return name.endsWith(".nex") || name.endsWith(".nxs") ;
+                }
+            });
+
+            List<String> sFailedFiles = new ArrayList<String>();
+            for (String sFileName : sExampleFiles) {
+                System.out.println("Processing " + sFileName);
+                NexusParser parser = new NexusParser();
+                try {
+                    parser.parseFile(new File(sDir + "/" + sFileName));
+                } catch (Exception e) {
+                    System.out.println("ExampleNexusParsing::Failed for " + sFileName
+                            + ": " + e.getMessage());
+                    sFailedFiles.add(sFileName);
+                }
+                System.out.println("Done " + sFileName);
+            }
+            if (sFailedFiles.size() > 0) {
+                System.out.println("\ntest_ThatNexusExamplesParse::Failed for : " + sFailedFiles.toString());
+            } else {
+                System.out.println("\ntest_ThatNexusExamplesParse::Success");
+            }
+            assertTrue(sFailedFiles.toString(), sFailedFiles.size() == 0);
+        } catch (Exception e) {
+            System.out.println("exception thrown ");
+            System.out.println(e.getMessage());
+        }
+    }
+
+    @Test
+    public void testTranslateBlock() {
+
+        String nexusTreeWithTranslateBlock  = "#NEXUS\n" +
+                "\n" +
+                "Begin trees;\n" +
+                "\tTranslate\n" +
+                "\t\t1 ID1,\n" +
+                "\t\t2 ID0,\n" +
+                "\t\t3 ID4,\n" +
+                "\t\t4 ID2,\n" +
+                "\t\t5 ID3,\n" +
+                "\t\t6 ID5,\n" +
+                "\t\t7 ID6\n" +
+                "\t\t;\n" +
+                "tree TREE1  = [&R] (((1[&height_95%_HPD={0.0,2.220446049250313E-16},height_median=0.0,height=3.885354014841496E-17,height_range={0.0,8.881784197001252E-16}]:0.3500782084890231,2[&height_95%_HPD={0.0,2.220446049250313E-16},height_median=0.0,height=3.885336674542856E-17,height_range={0.0,8.881784197001252E-16}]:0.3500782084890231)[&height_95%_HPD={0.07176417767165222,0.32897302210795143},height_median=0.1721780016900536,height=0.18167779468916231,posterior=0.99920031987205 [...]
+                "End;\n";
+
+
+        NexusParser parser = new NexusParser();
+        try {
+
+            Set<String> taxa = new TreeSet<String>();
+            taxa.add("ID0");
+            taxa.add("ID1");
+            taxa.add("ID2");
+            taxa.add("ID3");
+            taxa.add("ID4");
+            taxa.add("ID5");
+            taxa.add("ID6");
+
+            parser.parseFile("testTranslateBlock", new StringReader(nexusTreeWithTranslateBlock));
+
+            assertEquals(1, parser.trees.size());
+
+            assertNotNull(parser.trees.get(0));
+
+            assertEquals(7, parser.trees.get(0).getTaxaNames().length);
+
+            for (String taxaName : parser.trees.get(0).getTaxaNames()) {
+                assertNotNull(taxaName);
+            }
+
+            assertTrue(taxa.containsAll(Arrays.asList(parser.trees.get(0).getTaxaNames())));
+
+        } catch (Exception e) {
+            e.printStackTrace();
+
+            assertTrue(false);
+        }
+    }
+
+
+    
+    @Test
+    public void testTranslateBlock2() {
+
+        String nexusTreeWithTranslateBlock  = "#NEXUS\n" +
+                "\n" +
+                "Begin trees;\n" +
+                "\tTranslate\n" +
+                "\t\t1 C,\n" +
+                "\t\t2 B,\n" +
+                "\t\t3 A\n" +
+                "\t\t;\n" +
+                "tree TREE1  = [&R] (1:10,(3:30,2:20):10);\n" +
+                "End;\n";
+
+
+        NexusParser parser = new NexusParser();
+        try {
+
+            List<String> taxa = new ArrayList<String>();
+            taxa.add("2");
+            taxa.add("0");
+            taxa.add("1");
+
+            parser.parseFile("testTranslateBlock", new StringReader(nexusTreeWithTranslateBlock));
+
+            assertEquals(1, parser.trees.size());
+
+            assertNotNull(parser.trees.get(0));
+            
+            String t = parser.trees.get(0).getRoot().toNewick();
+            System.out.println(t);
+            assertEquals("(C:10.0,(B:20.0,A:30.0):10.0):0.0", t);
+            
+
+
+        } catch (Exception e) {
+            e.printStackTrace();
+
+            assertTrue(false);
+        }
+    }
+    
+    
+    @Test
+    public void testAssumptionsParse() {
+        try {
+            String sFile = System.getProperty("user.dir") + "/examples/nexus/Primates.nex";
+            NexusParser parser = new NexusParser();
+            parser.parseFile(new File(sFile));
+            assertEquals(2, parser.filteredAlignments.size());
+        } catch (Exception e) {
+            System.out.println("exception thrown ");
+            System.out.println(e.getMessage());
+        }
+    }
+}
diff --git a/src/test/beast/util/TreeParserTest.java b/src/test/beast/util/TreeParserTest.java
new file mode 100644
index 0000000..886d62f
--- /dev/null
+++ b/src/test/beast/util/TreeParserTest.java
@@ -0,0 +1,111 @@
+package test.beast.util;
+
+import beast.util.TreeParser;
+import junit.framework.TestCase;
+import org.antlr.v4.runtime.misc.ParseCancellationException;
+import org.junit.Test;
+
+
+public class TreeParserTest extends TestCase {
+
+    @Test
+    public void testFullyLabelledWithIntegers() {
+
+        String newick = "((0:1.0,1:1.0)4:1.0,(2:1.0,3:1.0)5:1.0)6:0.0;";
+
+        try {
+
+            boolean isLabeled = false;
+
+            TreeParser treeParser = new TreeParser(newick, false, false, isLabeled, 0);
+            treeParser.offsetInput.setValue(0, treeParser);
+
+            assertEquals(newick.split(";")[0], treeParser.getRoot().toShortNewick(true));
+
+        } catch (Exception e) {
+            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.  \
+            assertTrue("Exception!", false);
+        }
+
+
+    }
+
+    @Test
+    public void testOnlyLeafLabels() throws Exception {
+
+        String newick = "((A:1.0,B:1.0):1.0,(C:1.0,D:1.0):1.0):0.0;";
+
+//        try {
+
+        boolean isLabeled = true;
+
+        TreeParser treeParser = new TreeParser(newick, false, false, isLabeled, 1);
+        System.out.println("adfgad");
+        assertEquals(newick.split(";")[0], treeParser.getRoot().toNewick());
+        // fix condition for adding the taxa and fix tree parse test
+
+//        } catch (Exception e) {
+//            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.  \
+//            assertTrue("Exception!", false);
+//        }
+
+
+    }
+
+    @Test
+    public void testOnlyLeafLabels2() throws Exception {
+
+        String newick = "((D:5.0,C:4.0):6.0,(A:1.0,B:2.0):3.0):0.0;";
+
+        TreeParser treeParser = new TreeParser();
+        treeParser.initByName("IsLabelledNewick", true, 
+        		"newick", newick,
+        		"adjustTipHeights", false);
+        
+        String newick2 = treeParser.getRoot().toNewick();
+        
+        assertEquals(newick.replaceAll(";", ""), newick2);
+    }
+
+    @Test
+    public void testSomeInternalNodesLabelled() {
+
+        String newick = "((A:1.0,B:1.0)E:1.0,(C:1.0,D:1.0):1.0):0.0;";
+
+        try {
+
+            boolean isLabeled = true;
+
+            TreeParser treeParser = new TreeParser(newick, false, false, isLabeled, 1);
+
+            assertEquals(newick.split(";")[0], treeParser.getRoot().toNewick());
+
+        } catch (Exception e) {
+            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.  \
+            assertTrue("Exception!", false);
+        }
+
+
+    }
+
+
+    @Test
+    public void testDuplicates() throws Exception {
+
+        String newick = "((A:1.0,B:1.0):1.0,(C:1.0,A:1.0):1.0):0.0;";
+
+        boolean exceptionRaised = false;
+
+        try {
+            boolean isLabeled = true;
+            TreeParser treeParser = new TreeParser(newick, false, false, isLabeled, 1);
+        } catch (ParseCancellationException e) {
+            e.printStackTrace();
+            exceptionRaised = true;
+        }
+
+        assertTrue(exceptionRaised);
+    }
+
+
+}
diff --git a/templates/ClockModels.xml b/templates/ClockModels.xml
new file mode 100644
index 0000000..7de69b4
--- /dev/null
+++ b/templates/ClockModels.xml
@@ -0,0 +1,293 @@
+
+<beast version='2.0'
+       namespace='beast.app.beauti:beast.core:beast.evolution.branchratemodel:beast.evolution.speciation:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood:beast.evolution:beast.math.distributions'>
+
+
+    <!-- Clock models -->
+    <mergewith point='clockModelTemplates'>
+
+        <!-- Strict clock -->
+        <subtemplate id='StrictClock' class='beast.evolution.branchratemodel.StrictClockModel'
+                     mainid='StrictClock.c:$(n)'>
+            <![CDATA[
+                <branchRateModel spec='StrictClockModel' id='StrictClock.c:$(n)'>
+                    <clock.rate id='clockRate.c:$(n)' spec='parameter.RealParameter' value='1.0' estimate='false'/>
+                </branchRateModel>
+
+				<operator id='StrictClockRateScaler.c:$(n)' spec='ScaleOperator' scaleFactor="0.75" weight="3" parameter='@clockRate.c:$(n)'/>
+
+				<upDownOperator id='strictClockUpDownOperator.c:$(n)' spec='UpDownOperator' scaleFactor="0.75" weight="3">
+					<up idref="clockRate.c:$(n)"/>
+					<down idref="Tree.t:$(n)"/>
+				</upDownOperator>
+
+		        <prior id='ClockPrior.c:$(n)' x='@clockRate.c:$(n)'><distr spec="beast.math.distributions.Uniform" upper='Infinity'/></prior>
+]]>
+            <connect srcID='clockRate.c:$(n)' targetID='state' inputName='stateNode'
+                     if='inlikelihood(clockRate.c:$(n)) and clockRate.c:$(n)/estimate=true'/>
+
+            <connect srcID='clockRate.c:$(n)' targetID='state' inputName='stateNode'
+                     if='inlikelihood(clockRate.c:$(n)) and clockRate.c:$(n)/estimate=true'/>
+            <connect srcID='ClockPrior.c:$(n)' targetID='prior' inputName='distribution'
+                     if='inlikelihood(clockRate.c:$(n)) and clockRate.c:$(n)/estimate=true'>substitution rate of
+                partition c:$(n)
+            </connect>
+            <connect srcID='StrictClockRateScaler.c:$(n)' targetID='mcmc' inputName='operator'
+                     if='inlikelihood(clockRate.c:$(n)) and clockRate.c:$(n)/estimate=true'>Scale substitution rate of
+                partition c:$(n)
+            </connect>
+            <connect srcID='strictClockUpDownOperator.c:$(n)' targetID='mcmc' inputName='operator'
+                     if='nooperator(FixMeanRatesOperator) and inlikelihood(clockRate.c:$(n)) and inlikelihood(Tree.t:$(n)) and Tree.t:$(n)/estimate=true and clockRate.c:$(n)/estimate=true'>
+                Scale up substitution rate c:$(n) and scale down tree t:($n)
+            </connect>
+        </subtemplate>
+
+        <!-- Relaxed clock exponential -->
+        <subtemplate id='RelaxedClockExponential' class='beast.evolution.branchratemodel.UCRelaxedClockModel'
+                     mainid='ExponentialRelaxedClock.c:$(n)'
+                     suppressInputs='beast.evolution.branchratemodel.UCRelaxedClockModel.distr'>
+            <![CDATA[
+        <plugin spec='UCRelaxedClockModel' id="ExponentialRelaxedClock.c:$(n)" tree='@Tree.t:$(n)'>
+			<parameter name='clock.rate' id='ucedMean.c:$(n)' value='1.0' estimate='false'/>
+            <distr id='Exponential.c:$(n)' name='distr' spec="beast.math.distributions.Exponential">
+				<parameter id='UCExpLambda.c:$(n)' name='mean' value='1.0'/>
+			</distr>
+            <rateCategories spec='parameter.IntegerParameter' id='expRateCategories.c:$(n)' value="1" dimension='10' estimate='true'/>
+        </plugin>
+
+        <operator id='ucedMeanScaler.c:$(n)' spec='ScaleOperator' scaleAll='false' scaleFactor="0.5" weight="1" parameter="@ucedMean.c:$(n)"/>
+        <operator id="ExpCategoriesRandomWalk.c:$(n)" spec="IntRandomWalkOperator" windowSize='1' weight="10" parameter="@expRateCategories.c:$(n)"/>
+		<operator id='ExpCategoriesSwapOperator.c:$(n)' spec='SwapOperator' howMany="1" weight="10" intparameter='@expRateCategories.c:$(n)'/>
+		<operator id='ExpCategoriesUniform.c:$(n)' spec='UniformOperator' weight="10" parameter='@expRateCategories.c:$(n)'/>
+
+		<upDownOperator id='relaxedUpDownOperatorExp.c:$(n)' spec='UpDownOperator' scaleFactor="0.75" weight="3">
+			<up idref="ucedMean.c:$(n)"/>
+			<down idref="Tree.t:$(n)"/>
+		</upDownOperator>
+
+		<log id='rateStat.c:$(n)' spec='RateStatistic' tree='@Tree.t:$(n)' branchratemodel='@ExponentialRelaxedClock.c:$(n)'/>
+        <prior id='UCMeanRatePrior.c:$(n)' x='@ucedMean.c:$(n)'><distr spec="beast.math.distributions.Uniform" upper='Infinity'/></prior>
+]]>
+            <connect srcID='ucedMean.c:$(n)' targetID='state' inputName='stateNode'
+                     if='inlikelihood(ucedMean.c:$(n)) and ucedMean.c:$(n)/estimate=true'/>
+            <connect srcID='expRateCategories.c:$(n)' targetID='state' inputName='stateNode'
+                     if='inlikelihood(expRateCategories.c:$(n))'/>
+
+            <connect srcID='UCMeanRatePrior.c:$(n)' targetID='prior' inputName='distribution'
+                     if='inlikelihood(ucedMean.c:$(n)) and ucedMean.c:$(n)/estimate=true'>uncorrelated exponential
+                relaxed clock mean of partition c:$(n)
+            </connect>
+
+            <connect srcID='ucedMeanScaler.c:$(n)' targetID='mcmc' inputName='operator'
+                     if='inlikelihood(ucedMean.c:$(n)) and ucedMean.c:$(n)/estimate=true'>Scale clock rate of partition
+                c:$(n)
+            </connect>
+            <connect srcID='ExpCategoriesRandomWalk.c:$(n)' targetID='mcmc' inputName='operator'
+                     if='inlikelihood(expRateCategories.c:$(n))'>Randomly change categories of partition c:$(n)
+            </connect>
+            <connect srcID='ExpCategoriesSwapOperator.c:$(n)' targetID='mcmc' inputName='operator'
+                     if='inlikelihood(expRateCategories.c:$(n))'>Swap categories of partition c:$(n)
+            </connect>
+            <connect srcID='ExpCategoriesUniform.c:$(n)' targetID='mcmc' inputName='operator'
+                     if='inlikelihood(expRateCategories.c:$(n))'>Uniformly draw categories of partition c:$(n)
+            </connect>
+            <connect srcID='relaxedUpDownOperatorExp.c:$(n)' targetID='mcmc' inputName='operator'
+                     if='nooperator(FixMeanRatesOperator) and inlikelihood(ucedMean.c:$(n)) and inlikelihood(Tree.t:$(n)) and ucedMean.c:$(n)/estimate=true and Tree.t:$(n)/estimate=true'>
+                Up/down scaler for mean rate and tree of partition c:$(n)
+            </connect>
+            <connect srcID='Tree.t:$(n)' targetID='ExponentialRelaxedClock.c:$(n)' inputName='tree' if='inlikelihood(ExponentialRelaxedClock.c:$(n))'/>
+            <connect srcID='Tree.t:$(n)' targetID='rateStat.c:$(n)' inputName='tree' if='inlikelihood(ExponentialRelaxedClock.c:$(n))'/>
+
+            <connect srcID='ucedMean.c:$(n)' targetID='tracelog' inputName='log'
+                     if='inlikelihood(ucedMean.c:$(n)) and ucedMean.c:$(n)/estimate=true'/>
+            <connect srcID='rateStat.c:$(n)' targetID='tracelog' inputName='log'
+                     if='inposterior(ExponentialRelaxedClock.c:$(n))'/>
+
+            <connect srcID='ExponentialRelaxedClock.c:$(n)' targetID='TreeWithMetaDataLogger.t:$(n)'
+                     inputName='branchratemodel' if='inposterior(ExponentialRelaxedClock.c:$(n))'/>
+        </subtemplate>
+
+
+        <!-- Relaxed clock log normal -->
+        <subtemplate id='RelaxedClockLogNormal' class='beast.evolution.branchratemodel.UCRelaxedClockModel'
+                     mainid='RelaxedClock.c:$(n)'>
+            <![CDATA[
+        <plugin spec='UCRelaxedClockModel' id="RelaxedClock.c:$(n)" tree='@Tree.t:$(n)'>
+			<parameter name='clock.rate' id='ucldMean.c:$(n)' value='1.0'/>
+            <distr id='LogNormalDistributionModel.c:$(n)' name='distr' spec="beast.math.distributions.LogNormalDistributionModel" meanInRealSpace='true'>
+                <parameter name='M' value="1.0" estimate='false' lower='0' upper='1'/>
+                <parameter name='S' id='ucldStdev.c:$(n)' value="0.1" lower="0" estimate='true'/>
+            </distr>
+            <rateCategories spec='parameter.IntegerParameter' id='rateCategories.c:$(n)' value="1" dimension='10' estimate='true'/>
+        </plugin>
+
+        <operator id='ucldMeanScaler.c:$(n)' spec='ScaleOperator' scaleAll='false' scaleFactor="0.5" weight="1" parameter="@ucldMean.c:$(n)"/>
+        <operator id='ucldStdevScaler.c:$(n)' spec='ScaleOperator' scaleAll='false' scaleFactor="0.5" weight="3" parameter="@ucldStdev.c:$(n)"/>
+        <operator id="CategoriesRandomWalk.c:$(n)" spec="IntRandomWalkOperator" windowSize='1' weight="10" parameter="@rateCategories.c:$(n)"/>
+		<operator id='CategoriesSwapOperator.c:$(n)' spec='SwapOperator' howMany="1" weight="10" intparameter='@rateCategories.c:$(n)'/>
+		<operator id='CategoriesUniform.c:$(n)' spec='UniformOperator' weight="10" parameter='@rateCategories.c:$(n)'/>
+
+		<upDownOperator id='relaxedUpDownOperator.c:$(n)' spec='UpDownOperator' scaleFactor="0.75" weight="3">
+			<up idref="ucldMean.c:$(n)"/>
+			<down idref="Tree.t:$(n)"/>
+		</upDownOperator>
+
+        <prior id='ucldStdevPrior.c:$(n)' x='@ucldStdev.c:$(n)'>
+
+            <!-- this prior has a median of 0.1 and 97.5% of its probability is below S=1 -->
+            <distr spec="beast.math.distributions.Gamma">
+                <parameter name='alpha' value="0.5396" estimate='false'/> <!-- shape -->
+                <parameter name='beta' value="0.3819" estimate='false'/> <!-- scale -->
+            </distr>
+
+            <!-- <distr spec="beast.math.distributions.Exponential">
+                <parameter name='mean' value="0.3333" estimate='false'/>
+            </distr> -->
+        </prior>
+
+
+		<log id='rate.c:$(n)' spec='RateStatistic' tree='@Tree.t:$(n)' branchratemodel='@RelaxedClock.c:$(n)'/>
+        <prior id='MeanRatePrior.c:$(n)' x='@ucldMean.c:$(n)'><distr spec="beast.math.distributions.Uniform" upper='Infinity'/></prior>
+]]>
+            <connect srcID='ucldMean.c:$(n)' targetID='state' inputName='stateNode'
+                     if='inlikelihood(ucldMean.c:$(n)) and ucldMean.c:$(n)/estimate=true'/>
+            <connect srcID='ucldStdev.c:$(n)' targetID='state' inputName='stateNode'
+                     if='inlikelihood(ucldStdev.c:$(n)) and ucldStdev.c:$(n)/estimate=true'/>
+            <connect srcID='rateCategories.c:$(n)' targetID='state' inputName='stateNode'
+                     if='inlikelihood(rateCategories.c:$(n))'/>
+
+            <connect srcID='ucldMeanScaler.c:$(n)' targetID='mcmc' inputName='operator'
+                     if='inlikelihood(ucldMean.c:$(n)) and ucldMean.c:$(n)/estimate=true'>Scale clock rate of partition
+                c:$(n)
+            </connect>
+            <connect srcID='ucldStdevScaler.c:$(n)' targetID='mcmc' inputName='operator'
+                     if='inlikelihood(ucldStdev.c:$(n))'>Scale stdev of rate of partition c:$(n)
+            </connect>
+            <connect srcID='CategoriesRandomWalk.c:$(n)' targetID='mcmc' inputName='operator'
+                     if='inlikelihood(rateCategories.c:$(n))'>Randomly change categories of partition c:$(n)
+            </connect>
+            <connect srcID='CategoriesSwapOperator.c:$(n)' targetID='mcmc' inputName='operator'
+                     if='inlikelihood(rateCategories.c:$(n))'>Swap categories of partition c:$(n)
+            </connect>
+            <connect srcID='CategoriesUniform.c:$(n)' targetID='mcmc' inputName='operator'
+                     if='inlikelihood(rateCategories.c:$(n))'>Uniformly draw categories of partition c:$(n)
+            </connect>
+            <connect srcID='relaxedUpDownOperator.c:$(n)' targetID='mcmc' inputName='operator'
+                     if='nooperator(FixMeanRatesOperator) and inlikelihood(ucldMean.c:$(n)) and ucldMean.c:$(n)/estimate=true and Tree.t:$(n)/estimate=true'>
+                Up/down scaler for mean rate and tree of partition c:$(n)
+            </connect>
+            <connect srcID='Tree.t:$(n)' targetID='RelaxedClock.c:$(n)' inputName='tree' if='inlikelihood(RelaxedClock.c:$(n))'/>
+            <connect srcID='Tree.t:$(n)' targetID='rate.c:$(n)' inputName='tree' if='inlikelihood(RelaxedClock.c:$(n))'/>
+
+            <connect srcID='ucldMean.c:$(n)' targetID='tracelog' inputName='log'
+                     if='inlikelihood(ucldMean.c:$(n)) and ucldMean.c:$(n)/estimate=true'/>
+            <connect srcID='ucldStdev.c:$(n)' targetID='tracelog' inputName='log' if='inlikelihood(ucldStdev.c:$(n))'/>
+            <connect srcID='rate.c:$(n)' targetID='tracelog' inputName='log' if='inposterior(RelaxedClock.c:$(n))'/>
+
+            <connect srcID='ucldStdevPrior.c:$(n)' targetID='prior' inputName='distribution'
+                     if='inlikelihood(ucldStdev.c:$(n))'>uncorrelated lognormal relaxed clock stdev of partition c:$(n)
+            </connect>
+            <connect srcID='MeanRatePrior.c:$(n)' targetID='prior' inputName='distribution'
+                     if='inlikelihood(ucldMean.c:$(n)) and inlikelihood(Tree.t:$(n)) and ucldMean.c:$(n)/estimate=true'>
+                uncorrelated lognormal relaxed clock mean of partition c:$(n)
+            </connect>
+
+            <connect srcID='RelaxedClock.c:$(n)' targetID='TreeWithMetaDataLogger.t:$(n)' inputName='branchratemodel'
+                     if='inposterior(RelaxedClock.c:$(n))'/>
+        </subtemplate>
+
+
+        <!-- Random local clock -->
+        <subtemplate id='RandomLocalClock' class='beast.evolution.branchratemodel.RandomLocalClockModel'
+                     mainid='RandomLocalClock.c:$(n)'
+                     suppressInputs='beast.evolution.branchratemodel.RandomLocalClockModel.rates'>
+            <![CDATA[
+        <input spec='RandomLocalClockModel' id="RandomLocalClock.c:$(n)" ratesAreMultipliers="false" tree='@Tree.t:$(n)'>
+            <clock.rate id='meanClockRate.c:$(n)' spec='parameter.RealParameter' value='1.0' estimate='false'/>
+            <parameter spec='parameter.BooleanParameter' name='indicators' id='Indicators.c:$(n)' value="0"/>
+            <parameter name='rates' id='clockrates.c:$(n)' value="1"/>
+        </input>
+
+        <operator id="IndicatorsBitFlip.c:$(n)" spec="BitFlipOperator" weight="15" parameter="@Indicators.c:$(n)"/>
+<!-- this should probably be a DeltaExchange instead of scale operator to keep mean rate to 1 -->
+        <operator id='ClockRateScaler.c:$(n)' spec='ScaleOperator' scaleAll='false' scaleFactor="0.5" weight="15" parameter="@clockrates.c:$(n)"/>
+
+        <operator id='randomClockScaler.c:$(n)' spec='ScaleOperator' scaleAll='false' scaleFactor="0.5" weight="1" parameter="@meanClockRate.c:$(n)"/>
+		<upDownOperator id='randomClockUpDownOperator.c:$(n)' spec='UpDownOperator' scaleFactor="0.75" weight="3">
+			<up idref="meanClockRate.c:$(n)"/>
+			<down idref="Tree.t:$(n)"/>
+		</upDownOperator>
+
+		<distribution idref="prior">
+			<if cond='inlikelihood(RandomLocalClock.c:$(n))'>
+				<!-- prior on rates -->
+			    <prior id='RRatesPrior.c:s$(n)' name="distribution" x='@clockrates.c:$(n)'>
+			        <Gamma id="Gamma.0" name="distr">
+			            <parameter estimate="false" name="alpha">0.5</parameter>
+			            <parameter estimate="false" name="beta">2.0</parameter>
+			        </Gamma>
+				</prior>
+
+				<!-- prior on number of changes -->
+				<prior id="RRateChangesPrior.c:$(n)" name="distribution">
+					<x id="RRateChanges.c:$(n)" spec="beast.core.util.Sum" arg="@Indicators.c:$(n)"/>
+                    <distr spec='beast.math.distributions.Poisson'>
+                          <lambda spec='parameter.RealParameter' estimate='false' value='0.6931471805599453'/>
+                    </distr>
+				</prior>
+			</if>
+		</distribution>
+
+		<logger idref="tracelog">
+			<if cond='inlikelihood(RandomLocalClock.c:$(n))'>
+				<log idref="RRateChanges.c:$(n)"/>
+			</if>
+		</logger>
+
+        <prior id='MeanRRatePrior.c:s$(n)' x='@meanClockRate.c:$(n)'><distr spec="beast.math.distributions.Uniform" upper='Infinity'/></prior>
+]]>
+            <connect srcID='Indicators.c:$(n)' targetID='state' inputName='stateNode'
+                     if='inlikelihood(Indicators.c:$(n))'/>
+            <connect srcID='meanClockRate.c:$(n)' targetID='state' inputName='stateNode'
+                     if='inlikelihood(meanClockRate.c:$(n)) and meanClockRate.c:$(n)/estimate=true'/>
+            <connect srcID='clockrates.c:$(n)' targetID='state' inputName='stateNode'
+                     if='inlikelihood(clockrates.c:$(n))'/>
+
+
+            <connect srcID='randomClockScaler.c:$(n)' targetID='mcmc' inputName='operator'
+                     if='inlikelihood(meanClockRate.c:$(n)) and meanClockRate.c:$(n)/estimate=true'>Scale clock rate of
+                partition c:$(n)
+            </connect>
+            <connect srcID='randomClockUpDownOperator.c:$(n)' targetID='mcmc' inputName='operator'
+                     if='nooperator(FixMeanRatesOperator) and inlikelihood(meanClockRate.c:$(n)) and inlikelihood(Tree.t:$(n)) and meanClockRate.c:$(n)/estimate=true'>
+                Up/down scaler for mean rate and tree of partition c:$(n)
+            </connect>
+            <connect srcID='IndicatorsBitFlip.c:$(n)' targetID='mcmc' inputName='operator'
+                     if='inlikelihood(Indicators.c:$(n))'>Flip indicator bits for random clock of partition c:$(n)
+            </connect>
+            <connect srcID='ClockRateScaler.c:$(n)' targetID='mcmc' inputName='operator'
+                     if='inlikelihood(clockrates.c:$(n))'>Scale random clock rates of partition c:$(n)
+            </connect>
+            <connect srcID='Tree.t:$(n)' targetID='RandomLocalClock.c:$(n)' inputName='tree' if='inlikelihood(RandomLocalClock.c:$(n))'/>
+
+            <connect srcID='Indicators.c:$(n)' targetID='tracelog' inputName='log'
+                     if='inlikelihood(Indicators.c:$(n))'/>
+            <connect srcID='clockrates.c:$(n)' targetID='tracelog' inputName='log'
+                     if='inlikelihood(clockrates.c:$(n))'/>
+            <connect srcID='meanClockRate.c:$(n)' targetID='tracelog' inputName='log'
+                     if='inposterior(RandomLocalClock.c:$(n)) and meanClockRate.c:$(n)/estimate=true'/>
+
+            <connect srcID='MeanRRatePrior.c:$(n)' targetID='prior' inputName='distribution'
+                     if='inlikelihood(meanClockRate.c:$(n)) and meanClockRate.c:$(n)/estimate=true'>substitution rate of
+                partition c:$(n)
+            </connect>
+
+            <connect srcID='RandomLocalClock.c:$(n)' targetID='TreeWithMetaDataLogger.t:$(n)'
+                     inputName='branchratemodel' if='inposterior(RandomLocalClock.c:$(n))'/>
+        </subtemplate>
+
+    </mergewith>
+
+</beast>
+
+
diff --git a/templates/ParametricDistributions.xml b/templates/ParametricDistributions.xml
new file mode 100644
index 0000000..c81b3e6
--- /dev/null
+++ b/templates/ParametricDistributions.xml
@@ -0,0 +1,134 @@
+<beast version='2.0'
+       namespace='beast.app.beauti:beast.core:beast.evolution.branchratemodel:beast.evolution.speciation:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood:beast.evolution:beast.math.distributions'>
+
+
+    <mergewith point='parametricDistributions'>
+        <!-- Parametric distributions, all without hyperpriors -->
+
+        <!-- Uniform -->
+        <subtemplate id='Uniform' class='beast.math.distributions.Uniform' mainid='[top]'>
+            <![CDATA[
+        <distr spec="beast.math.distributions.Uniform" lower='0' upper='Infinity'/>
+]]>
+        </subtemplate>
+
+        <!-- Normal -->
+        <subtemplate id='Normal' class='beast.math.distributions.Normal' mainid='[top]' suppressInputs='beast.math.distributions.Normal.tau'>
+            <![CDATA[
+    <distr offset="0.0" spec="beast.math.distributions.Normal">
+        <parameter name='mean' value='0' estimate='false'/>
+        <parameter name='sigma' value='1' estimate='false'/>
+    </distr>
+]]>
+        </subtemplate>
+
+        <!-- OneOnX -->
+        <subtemplate id='1/X' class='beast.math.distributions.OneOnX' mainid='[top]'>
+            <![CDATA[
+        <distr spec="beast.math.distributions.OneOnX"/>
+]]>
+        </subtemplate>
+
+        <!-- lognormal -->
+        <subtemplate id='LogNormal' class='beast.math.distributions.LogNormalDistributionModel' mainid='[top]'>
+            <![CDATA[
+        <distr name='distr' spec="beast.math.distributions.LogNormalDistributionModel">
+            <parameter name='M' value="1" estimate='false'/>
+            <parameter name='S' value="1.25" lower="0" upper="5" estimate='false'/>
+        </distr>
+]]>
+        </subtemplate>
+
+        <!-- Exponential -->
+        <subtemplate id='Exponential' class='beast.math.distributions.Exponential' mainid='[top]'>
+            <![CDATA[
+        <distr offset="0.0" spec="beast.math.distributions.Exponential">
+            <parameter name='mean' value="1" estimate='false'/>
+        </distr>
+]]>
+        </subtemplate>
+
+        <!-- Gamma -->
+        <subtemplate id='Gamma' class='beast.math.distributions.Gamma' mainid='[top]'>
+            <![CDATA[
+        <distr offset="0.0" spec="beast.math.distributions.Gamma">
+            <parameter name='alpha' value="2" estimate='false'/>
+            <parameter name='beta' value="2" estimate='false'/>
+        </distr>
+]]>
+        </subtemplate>
+
+        <!-- Beta -->
+        <subtemplate id='Beta' class='beast.math.distributions.Beta' mainid='[top]'>
+            <![CDATA[
+        <distr offset="0.0" spec="beast.math.distributions.Beta">
+            <parameter name='alpha' value="2" estimate='false'/>
+            <parameter name='beta' value="2" estimate='false'/>
+        </distr>
+]]>
+        </subtemplate>
+
+        <!-- Laplace -->
+        <subtemplate id='LaplaceDistribution' class='beast.math.distributions.LaplaceDistribution' mainid='[top]'>
+            <![CDATA[
+        <distr offset="0.0" spec="beast.math.distributions.LaplaceDistribution">
+            <parameter name='mu' value="0" estimate='false'/>
+            <parameter name='scale' value="1" estimate='false'/>
+        </distr>
+]]>
+        </subtemplate>
+
+        <!-- InverseGamma -->
+        <subtemplate id='InverseGamma' class='beast.math.distributions.InverseGamma' mainid='[top]'>
+            <![CDATA[
+        <distr offset="0.0" spec="beast.math.distributions.InverseGamma">
+            <parameter name='alpha' value="2" estimate='false'/>
+            <parameter name='beta' value="2" estimate='false'/>
+        </distr>
+]]>
+        </subtemplate>
+
+        <!-- Poisson -->
+        <subtemplate id='Poisson' class='beast.math.distributions.Poisson' mainid='[top]'>
+            <![CDATA[
+		<distr spec='beast.math.distributions.Poisson' offset="0.0">
+			<parameter name="lambda" value="0.693"/>
+		</distr>
+]]>
+        </subtemplate>
+
+
+    </mergewith>
+
+
+    <!-- Tree initialisation -->
+    <!-- Random tree -->
+
+    <subtemplate id='RandomTree' class='beast.evolution.tree.RandomTree' mainid='RandomTree.t:$(n)'>
+        <![CDATA[
+            <tree spec='beast.evolution.tree.RandomTree' id='RandomTree.t:$(n)' estimate='false' trait='@datetrait.$(n)'>
+                <taxa spec='Alignment' idref='$(n)'/>
+                <populationModel id='ConstantPopulation.t:$(n)' spec='ConstantPopulation'>
+            		<popSize id='popSize.t:$(n)' spec='parameter.RealParameter' value='1'/>
+	            </populationModel>
+            </tree>
+]]>
+    </subtemplate>
+
+    <!-- Cluster tree (for UPGMA) -->
+
+    <subtemplate id='UPGMATree' class='beast.util.ClusterTree' mainid='UPGMATree.t:$(n)'>
+        <![CDATA[
+        <tree spec='beast.util.ClusterTree' id='UPGMATree.t:$(n)' clusterType='upgma' estimate='false'  trait='@datetrait.$(n)' taxa='@$(n)'/>
+]]>
+    </subtemplate>
+
+    <!-- Newick tree -->
+    <subtemplate id='NewickTree' class='beast.util.ClusterTree' mainid='NewickTree.t:$(n)'>
+        <![CDATA[
+        <tree spec='beast.util.TreeParser' id='NewickTree.t:$(n)' estimate='false'  trait='@datetrait.$(n)'  taxa='@$(n)' newick=""/>
+]]>
+    </subtemplate>
+
+
+</beast>
diff --git a/templates/Standard.xml b/templates/Standard.xml
new file mode 100644
index 0000000..138450c
--- /dev/null
+++ b/templates/Standard.xml
@@ -0,0 +1,356 @@
+<beast version='2.0'
+       namespace='beast.app.beauti:beast.core:beast.evolution.branchratemodel:beast.evolution.speciation:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood:beast.evolution:beast.math.distributions'
+	templateinfo='template for standard phylogenetic analysis,<br> supporting tip-date analysis and calibrations'>
+
+<map name='connect' reserved='true'>beast.app.beauti.BeautiConnector</map>
+<map name='subtemplate' reserved='true'>beast.app.beauti.BeautiSubTemplate</map>
+<map name='Uniform'>beast.math.distributions.Uniform</map>
+<map name='Normal'>beast.math.distributions.Normal</map>
+<map name='OneOnX'>beast.math.distributions.OneOnX</map>
+<map name='LogNormal'>beast.math.distributions.LogNormalDistributionModel</map>
+<map name='Exponential'>beast.math.distributions.Exponential</map>
+<map name='Gamma'>beast.math.distributions.Gamma</map>
+<map name='Beta'>beast.math.distributions.Beta</map>
+<map name='LaplaceDistribution'>beast.math.distributions.LaplaceDistribution</map>
+<map name='InverseGamma'>beast.math.distributions.InverseGamma</map>
+<map name='prior'>beast.math.distributions.Prior</map>
+
+    <beauticonfig spec='BeautiConfig'
+        inputLabelMap='beast.core.MCMC.operator=Operators,
+	        beast.core.MCMC.logger=Loggers,
+			beast.evolution.sitemodel.SiteModel.mutationRate =Substitution Rate'
+        inlinePlugins ='beast.core.MCMC.distribution,
+            beast.evolution.sitemodel.SiteModel.substModel,
+            beast.evolution.tree.coalescent.ExponentialGrowth,
+            beast.evolution.tree.coalescent.ConstantPopulation,
+            beast.evolution.tree.coalescent.Coalescent,
+            beast.core.State.stateNode'
+        collapsedPlugins ='beast.core.MCMC.logger'
+        suppressPlugins = 'beast.core.MCMC.operator,
+    		beast.core.MCMC.operatorschedule,
+	        beast.evolution.tree.coalescent.Coalescent.treeIntervals,
+	        beast.evolution.tree.coalescent.Coalescent.tree,
+	        beast.core.MCMC.state,
+	        beast.core.MCMC.distribution,
+	        beast.core.MCMC.init,
+	        beast.evolution.speciation.BirthDeathGernhard08Model.treeIntervals,
+	        beast.evolution.speciation.BirthDeathGernhard08Model.tree,
+	        beast.evolution.speciation.BirthDeathGernhard08Model.sampleProbability,
+			beast.evolution.speciation.YuleModel.treeIntervals,
+			beast.evolution.speciation.YuleModel.useTipDates,
+			beast.evolution.speciation.YuleModel.tree,
+	        beast.evolution.tree.Tree,
+	        beast.evolution.tree.Tree.trait,
+	        beast.evolution.tree.Tree.taxa,
+	        beast.evolution.tree.Tree.taxonset,
+	        beast.evolution.tree.RandomTree.trait,
+	        beast.evolution.tree.RandomTree.initial,
+	        beast.evolution.tree.RandomTree.taxa,
+	        beast.evolution.tree.RandomTree.taxonset,
+	        beast.evolution.tree.RandomTree.estimate,
+	        beast.util.TreeParser.initial,
+	        beast.util.TreeParser.taxa,
+	        beast.util.TreeParser.taxonset,
+	        beast.util.TreeParser.trait,
+	        beast.util.TreeParser.estimate,
+	        beast.util.ClusterTree.initial,
+	        beast.util.ClusterTree.taxa,
+	        beast.util.ClusterTree.taxonset,
+	        beast.util.ClusterTree.trait,
+	        beast.util.ClusterTree.estimate,
+	        beast.evolution.substitutionmodel.WAG.rates,
+	        beast.evolution.substitutionmodel.WAG.frequencies,
+	        beast.evolution.substitutionmodel.JTT.rates,
+	        beast.evolution.substitutionmodel.JTT.frequencies,
+	        beast.evolution.substitutionmodel.Blosum62.rates,
+	        beast.evolution.substitutionmodel.Blosum62.frequencies,
+	        beast.evolution.substitutionmodel.Dayhoff.rates,
+	        beast.evolution.substitutionmodel.Dayhoff.frequencies,
+	        beast.evolution.substitutionmodel.CPREV.rates,
+	        beast.evolution.substitutionmodel.CPREV.frequencies,
+	        beast.evolution.substitutionmodel.MTREV.rates,
+	        beast.evolution.substitutionmodel.MTREV.frequencies,
+	        beast.evolution.substitutionmodel.GTR.rates,
+	        beast.evolution.substitutionmodel.JukesCantor.frequencies,
+            beast.math.distributions.Prior.x,
+            beast.math.distributions.MRCAPrior.tree,
+            beast.math.distributions.MRCAPrior.monophyletic,
+            beast.math.distributions.MRCAPrior.taxonset,
+            beast.evolution.branchratemodel.UCRelaxedClockModel.tree,
+            beast.evolution.branchratemodel.UCRelaxedClockModel.rateCategories,
+			beast.evolution.branchratemodel.UCRelaxedClockModel.distr,
+            beast.evolution.branchratemodel.RandomLocalClockModel.tree,
+            beast.evolution.branchratemodel.RandomLocalClockModel.meanRate,
+            beast.evolution.branchratemodel.RandomLocalClockModel.indicators,
+            beast.evolution.operators.ScaleOperator.indicator,
+	        beast.core.Operator.weight,
+            beast.core.Logger.model,
+            beast.evolution.tree.coalescent.BayesianSkyline.treeIntervals,
+            beast.evolution.tree.coalescent.BayesianSkyline.groupSizes,
+            beast.evolution.tree.coalescent.BayesianSkyline.popSizes,
+            beast.evolution.speciation.YuleModel.originHeight
+            '
+        buttonLabelMap='beast.app.beauti.BeautiInitDlg.>> details=Edit parameters'
+    >
+        <!--disableMenus='Mode'-->
+
+        <panel spec='BeautiPanelConfig' panelname="Partitions" tiptext="Data Partitions"
+            path='distribution/distribution[id="likelihood"]/distribution/data'
+            hasPartitions="none" icon='2220.png.x' forceExpansion='FALSE'
+            type='beast.evolution.alignment.Alignment'
+        />
+		<mergepoint id='aux-partitions-panels'/>
+
+		<panel spec='BeautiPanelConfig' panelname="Tip Dates" tiptext="Allows to specify data that a taxon was sampled"
+            path='tree'
+            hasPartitions="Tree" icon='2.png.x' forceExpansion='TRUE'
+            isVisible='true'
+        />
+		<mergepoint id='aux-tipdates-panels'/>
+
+		<panel spec='BeautiPanelConfig' panelname="Site Model" tiptext="Site model and substitution model specifications"
+            path='siteModel'
+            hasPartitions="SiteModel" icon='3.png.x' forceExpansion='TRUE'
+        />
+		<mergepoint id='aux-sitemodel-panels'/>
+
+		<panel spec='BeautiPanelConfig' panelname="Clock Model" tiptext="Clock model"
+            path='branchRateModel'
+            hasPartitions="ClockModel" icon='4.png.x' forceExpansion='TRUE'
+        />
+		<mergepoint id='aux-clockmodel-panels'/>
+		<panel spec='BeautiPanelConfig' panelname="Initialization" tiptext="Initial state"
+            path='state/stateNode'
+            hasPartitions="none" icon='6.png.x' forceExpansion='TRUE_START_COLLAPSED'
+            isVisible='false'
+        />
+		<mergepoint id='aux-initilisation-panels'/>
+
+		<panel spec='BeautiPanelConfig' panelname="Priors" tiptext="Other priors"
+            path='distribution/distribution[id="prior"]/distribution'
+            hasPartitions="none" icon='7.png.x' forceExpansion='TRUE_START_COLLAPSED'
+            type='beast.core.Distribution'
+        />
+		<mergepoint id='aux-priors-panels'/>
+
+		<panel spec='BeautiPanelConfig' panelname="Operators" tiptext="MCMC Operator details"
+            path='operator'
+            hasPartitions="none" icon='8.png.x' forceExpansion='TRUE_START_COLLAPSED'
+            isVisible='false' buttonStatus='ADD_ONLY'
+        />
+		<mergepoint id='aux-operators-panels'/>
+
+		<panel spec='BeautiPanelConfig' panelname="MCMC" tiptext="MCMC parameters"
+            path=''
+            hasPartitions="none" icon='9.png.x' forceExpansion='TRUE'
+        />
+		<mergepoint id='aux-panels'/>
+
+		<alignmentProvider id="Import Alignment" spec='BeautiAlignmentProvider' template='@StandardPartitionTemplate'/>
+
+
+        <partitiontemplate id='StandardPartitionTemplate' spec='BeautiSubTemplate' class='beast.evolution.likelihood.TreeLikelihood' mainid='mcmc'>
+<![CDATA[
+            <!-- site model                                                              -->
+            <plugin spec='SiteModel' id="SiteModel.s:$(n)" gammaCategoryCount='0'>
+                <!--substModel will be automatically detected /-->
+                <proportionInvariant spec='parameter.RealParameter' id='proportionInvariant.s:$(n)' value='0.0' lower='0' upper='1' estimate='false'/>
+                <mutationRate        spec='parameter.RealParameter' id='mutationRate.s:$(n)' value='1.0'        estimate='false'/>
+                <shape               spec='parameter.RealParameter' id='gammaShape.s:$(n)' value='1.0'         estimate='false'/>
+            </plugin>
+
+            <plugin spec='TreeLikelihood' id="treeLikelihood.$(n)">
+                <data idref="data"/>
+                <tree idref="Tree.t:$(n)"/>
+                <siteModel idref="SiteModel.s:$(n)"/>
+                <branchRateModel spec='StrictClockModel' id='StrictClock.c:$(n)'>
+                    <clock.rate id='clockRate.c:$(n)' spec='parameter.RealParameter' value='1.0' estimate='false'/>
+                </branchRateModel>
+            </plugin>
+
+	        <prior id='ClockPrior.c:$(n)' x='@clockRate.c:$(n)'><distr spec="beast.math.distributions.Uniform" upper='Infinity'/></prior>
+	        <prior id='MutationRatePrior.s:$(n)' x='@mutationRate.s:$(n)'><distr spec="OneOnX"/></prior>
+
+            <!-- tree and its properties -->
+            <taxonset id='TaxonSet.$(n)' spec='beast.evolution.alignment.TaxonSet' alignment='@$(n)' />
+            <plugin spec='beast.evolution.tree.Tree' id='Tree.t:$(n)' taxonset='@TaxonSet.$(n)'/>
+
+            <!--plugin spec='beast.evolution.tree.RandomTree' id='RandomTree.t:$(n)' estimate='false' trait='@datetrait.$(n)' initial='@Tree.t:$(n)'-->
+            <plugin spec='beast.evolution.tree.RandomTree' id='RandomTree.t:$(n)' estimate='false' initial='@Tree.t:$(n)'>
+                <taxa spec='Alignment' idref='data'/>
+                <populationModel id='ConstantPopulation0.t:$(n)' spec='ConstantPopulation'>
+            		<popSize id='randomPopSize.t:$(n)' spec='parameter.RealParameter' value='1'/>
+	            </populationModel>
+            </plugin>
+
+            <!-- default tree prior -->
+            <plugin spec='YuleModel' id="YuleModel.t:$(n)" tree='@Tree.t:$(n)'>
+                <parameter name='birthDiffRate' id="birthRate.t:$(n)" value='1.0' estimate='true'/>
+            </plugin>
+
+            <plugin id='TreeHeight.t:$(n)' spec='beast.evolution.tree.TreeHeightLogger' tree='@Tree.t:$(n)'/>
+
+            <logger id='treelog.t:$(n)' spec='beast.core.Logger' logEvery="1000" fileName="$(tree).trees" mode='tree'>
+	            <log id='TreeWithMetaDataLogger.t:$(n)' spec='beast.evolution.tree.TreeWithMetaDataLogger' tree='@Tree.t:$(n)'>
+	            </log>
+            </logger>
+
+            <operator id='proportionInvariantScaler.s:$(n)' spec='ScaleOperator' scaleFactor="0.5" weight="0.1" parameter="@proportionInvariant.s:$(n)"/>
+            <operator id='mutationRateScaler.s:$(n)' spec='ScaleOperator' scaleFactor="0.5" weight="0.1" parameter="@mutationRate.s:$(n)"/>
+            <operator id='gammaShapeScaler.s:$(n)' spec='ScaleOperator' scaleFactor="0.5" weight="0.1" parameter="@gammaShape.s:$(n)"/>
+            <operator id='allTipDatesRandomWalker.t:$(n)' spec='TipDatesRandomWalker' windowSize="1" weight="0" tree="@Tree.t:$(n)"/>
+
+            <operator id='YuleModelTreeScaler.t:$(n)' spec='ScaleOperator' scaleFactor="0.5" weight="3" tree="@Tree.t:$(n)"/>
+            <operator id='YuleModelTreeRootScaler.t:$(n)' spec='ScaleOperator' scaleFactor="0.5" weight="3" tree="@Tree.t:$(n)" rootOnly='true'/>
+            <operator id='YuleModelUniformOperator.t:$(n)' spec='Uniform' weight="30" tree="@Tree.t:$(n)"/>
+            <operator id='YuleModelSubtreeSlide.t:$(n)' spec='SubtreeSlide' weight="15" gaussian="true" size="1.0" tree="@Tree.t:$(n)"/>
+            <operator id='YuleModelNarrow.t:$(n)' spec='Exchange' isNarrow='true' weight="15" tree="@Tree.t:$(n)"/>
+            <operator id='YuleModelWide.t:$(n)' spec='Exchange' isNarrow='false' weight="3" tree="@Tree.t:$(n)"/>
+            <operator id='YuleModelWilsonBalding.t:$(n)' spec='WilsonBalding' weight="3" tree="@Tree.t:$(n)"/>
+
+
+            <prior id='YuleBirthRatePrior.t:$(n)' x='@birthRate.t:$(n)'><distr spec="beast.math.distributions.Uniform" lower='0' upper='Infinity'/></prior>
+            <prior id='GammaShapePrior.s:$(n)' x='@gammaShape.s:$(n)'><distr spec="beast.math.distributions.Exponential" mean='1'/></prior>
+            <prior id='PropInvariantPrior.s:$(n)' x='@proportionInvariant.s:$(n)'><distr spec="beast.math.distributions.Uniform" lower='0' upper='1'/></prior>
+  		    <operator id='YuleBirthRateScaler.t:$(n)' spec='ScaleOperator' scaleFactor="0.75" weight="3" parameter="@birthRate.t:$(n)"/>
+			<operator id='StrictClockRateScaler.c:$(n)' spec='ScaleOperator' scaleFactor="0.75" weight="3" parameter='@clockRate.c:$(n)'/>
+			<!-- need updown operator for clockRate?!? Also in SubstModel.xml -->
+			<upDownOperator id='strictClockUpDownOperator.c:$(n)' spec='UpDownOperator' scaleFactor="0.75" weight="3">
+				<up idref="clockRate.c:$(n)"/>
+				<down idref="Tree.t:$(n)"/>
+			</upDownOperator>
+
+]]>
+            <connect srcID='treeLikelihood.$(n)'            targetID='likelihood' inputName='distribution' if="isInitializing"/>
+            <connect srcID='YuleModel.t:$(n)'               targetID='prior' inputName='distribution' if="isInitializing"/>
+			<connect method="beast.app.beauti.SiteModelInputEditor.customConnector"/>
+
+            <connect srcID='treelog.t:$(n)'                 targetID='mcmc' inputName='logger' if='inposterior(Tree.t:$(n)) and Tree.t:$(n)/estimate=true'/>
+            <connect srcID='RandomTree.t:$(n)'                targetID='mcmc' inputName='init'   if='inposterior(Tree.t:$(n))'/>
+
+            <connect srcID='ClockPrior.c:$(n)'                targetID='prior' inputName='distribution' if='inlikelihood(clockRate.c:$(n)) and clockRate.c:$(n)/estimate=true'/>
+<!-- when FixMeanMutationRatesOperator, the prior is uniform due to the operator -->
+            <connect srcID='MutationRatePrior.s:$(n)'         targetID='prior' inputName='distribution' if='nooperator(FixMeanMutationRatesOperator) and inlikelihood(mutationRate.s:$(n)) and mutationRate.s:$(n)/estimate=true'/>
+
+            <connect srcID='Tree.t:$(n)'                      targetID='state' inputName='stateNode' if='inposterior(Tree.t:$(n)) and Tree.t:$(n)/estimate=true'/>
+            <connect srcID='proportionInvariant.s:$(n)'       targetID='state' inputName='stateNode' if='inlikelihood(proportionInvariant.s:$(n)) and proportionInvariant.s:$(n)/estimate=true'/>
+            <connect srcID='mutationRate.s:$(n)'              targetID='state' inputName='stateNode' if='inlikelihood(mutationRate.s:$(n)) and mutationRate.s:$(n)/estimate=true'/>
+            <connect srcID='gammaShape.s:$(n)'                targetID='state' inputName='stateNode' if='inlikelihood(gammaShape.s:$(n)) and gammaShape.s:$(n)/estimate=true'/>
+            <connect srcID='clockRate.c:$(n)'                 targetID='state' inputName='stateNode' if='inlikelihood(clockRate.c:$(n)) and clockRate.c:$(n)/estimate=true'/>
+            <connect srcID='birthRate.t:$(n)'                 targetID='state' inputName='stateNode' if='inposterior(YuleModel.t:$(n)) and inposterior(Tree.t:$(n)) and birthRate.t:$(n)/estimate=true'/>
+
+
+            <connect srcID='proportionInvariantScaler.s:$(n)' targetID='mcmc' inputName='operator' if='inlikelihood(proportionInvariant.s:$(n)) and proportionInvariant.s:$(n)/estimate=true'>Scales proportion of invariant sites parameter of partition $(n)</connect>
+            <connect srcID='mutationRateScaler.s:$(n)'        targetID='mcmc' inputName='operator' if='nooperator(FixMeanMutationRatesOperator) and inlikelihood(mutationRate.s:$(n)) and mutationRate.s:$(n)/estimate=true'>Scales mutation rate of partition s:$(n)</connect>
+            <connect srcID='gammaShapeScaler.s:$(n)'          targetID='mcmc' inputName='operator' if='inlikelihood(gammaShape.s:$(n)) and gammaShape.s:$(n)/estimate=true'>Scales gamma shape parameter of partition s:$(n)</connect>
+            <connect srcID='StrictClockRateScaler.c:$(n)'     targetID='mcmc' inputName='operator' if='inlikelihood(clockRate.c:$(n)) and clockRate.c:$(n)/estimate=true'>Scale clock rate of partition c:$(n)</connect>
+            <connect srcID='YuleBirthRateScaler.t:$(n)'       targetID='mcmc' inputName='operator' if='inposterior(birthRate.t:$(n)) and birthRate.t:$(n)/estimate=true'>Scales birth rate of Yule prior for partition t:$(n)</connect>
+            <connect srcID='strictClockUpDownOperator.c:$(n)' targetID='mcmc' inputName='operator'
+                     if='nooperator(FixMeanRatesOperator) and inlikelihood(clockRate.c:$(n)) and inlikelihood(Tree.t:$(n)) and Tree.t:$(n)/estimate=true and clockRate.c:$(n)/estimate=true'>
+                Scale up substitution rate c:$(n) and scale down tree t:($n)
+            </connect>
+
+            <connect srcID='allTipDatesRandomWalker.t:$(n)'   targetID='mcmc' inputName='operator' if='inposterior(Tree.t:$(n)) and Tree.t:$(n)/estimate=true and allTipDatesRandomWalker.t:$(n)/weight!=0.0'>Estimates tip dates for tree t:$(n)</connect>
+
+            <connect if="inposterior(YuleModel.t:$(n)) and Tree.t:$(n)/estimate=true" inputName="operator" srcID="YuleModelTreeScaler.t:$(n)" targetID="mcmc">Scales all internal nodes for tree t:$(n)</connect>
+            <connect if="inposterior(YuleModel.t:$(n)) and Tree.t:$(n)/estimate=true" inputName="operator" srcID="YuleModelTreeRootScaler.t:$(n)" targetID="mcmc">Scales root node for tree t:$(n)</connect>
+            <connect if="inposterior(YuleModel.t:$(n)) and Tree.t:$(n)/estimate=true" inputName="operator" srcID="YuleModelUniformOperator.t:$(n)" targetID="mcmc">Draws new internal node heights uniformally for tree t:$(n)</connect>
+            <connect if="inposterior(YuleModel.t:$(n)) and Tree.t:$(n)/estimate=true" inputName="operator" srcID="YuleModelSubtreeSlide.t:$(n)" targetID="mcmc">Performs subtree slide rearrangement of tree t:$(n)</connect>
+            <connect if="inposterior(YuleModel.t:$(n)) and Tree.t:$(n)/estimate=true" inputName="operator" srcID="YuleModelNarrow.t:$(n)" targetID="mcmc">Narrow exchange performs local rearrangement of tree t:$(n)</connect>
+            <connect if="inposterior(YuleModel.t:$(n)) and Tree.t:$(n)/estimate=true" inputName="operator" srcID="YuleModelWide.t:$(n)" targetID="mcmc">Wide exchange performs global rearrangement of tree t:$(n)</connect>
+            <connect if="inposterior(YuleModel.t:$(n)) and Tree.t:$(n)/estimate=true" inputName="operator" srcID="YuleModelWilsonBalding.t:$(n)" targetID="mcmc">Performs Wilson-Balding global rearrangement of tree t:$(n)</connect>
+
+            <connect srcID='treeLikelihood.$(n)'              targetID='tracelog' inputName='log' if='inlikelihood(treeLikelihood.$(n))'/>
+            <connect srcID='TreeHeight.t:$(n)'                targetID='tracelog' inputName='log' if='inposterior(Tree.t:$(n))  and Tree.t:$(n)/estimate=true'/>
+            <connect srcID='proportionInvariant.s:$(n)'       targetID='tracelog' inputName='log' if='inposterior(proportionInvariant.s:$(n)) and proportionInvariant.s:$(n)/estimate=true'/>
+            <connect srcID='mutationRate.s:$(n)'              targetID='tracelog' inputName='log' if='inlikelihood(mutationRate.s:$(n)) and mutationRate.s:$(n)/estimate=true'/>
+            <connect srcID='gammaShape.s:$(n)'                targetID='tracelog' inputName='log' if='inlikelihood(gammaShape.s:$(n)) and gammaShape.s:$(n)/estimate=true'/>
+            <connect srcID='clockRate.c:$(n)'                 targetID='tracelog' inputName='log' if='inlikelihood(clockRate.c:$(n)) and clockRate.c:$(n)/estimate=true'/>
+            <connect srcID='YuleModel.t:$(n)'                 targetID='tracelog' inputName='log' if='inposterior(YuleModel.t:$(n)) and inposterior(Tree.t:$(n)) and Tree.t:$(n)/estimate=true'/>
+            <connect srcID='birthRate.t:$(n)'                 targetID='tracelog' inputName='log' if='inposterior(YuleModel.t:$(n)) and birthRate.t:$(n)/estimate=true'/>
+
+            <connect srcID='GammaShapePrior.s:$(n)'           targetID='prior' inputName='distribution' if='inlikelihood(gammaShape.s:$(n)) and gammaShape.s:$(n)/estimate=true'>Prior on gamma shape for partition s:$(n)</connect>
+            <connect srcID='PropInvariantPrior.s:$(n)'        targetID='prior' inputName='distribution' if='inlikelihood(proportionInvariant.s:$(n)) and proportionInvariant.s:$(n)/estimate=true'>Prior on proportion invariant for partition s:$(n)</connect>
+            <connect srcID='YuleBirthRatePrior.t:$(n)'        targetID='prior' inputName='distribution' if='inposterior(YuleModel.t:$(n)) and inposterior(Tree.t:$(n)) and birthRate.t:$(n)/estimate=true'>Prior on Yule birth rate for partition s:$(n)</connect>
+
+			<mergepoint id='aux-partitiontemplate'/>
+        </partitiontemplate>
+
+		<mergepoint id='substModelTemplates'/>
+		<mergepoint id='clockModelTemplates'/>
+		<mergepoint id='treePriorTemplates'/>
+        <mergepoint id='parametricDistributions'/>
+
+<!-- Tree initialisation -->
+<!-- Random tree -->
+
+        <subtemplate id='RandomTree' class='beast.evolution.tree.RandomTree' mainid='RandomTree.t:$(n)'>
+<![CDATA[
+            <tree spec='beast.evolution.tree.RandomTree' id='RandomTree.t:$(n)' estimate='false' trait='@datetrait.$(n)'>
+                <taxa spec='Alignment' idref='data'/>
+                <populationModel id='ConstantPopulation0.t:$(n)' spec='ConstantPopulation'>
+            		<popSize id='randomPopSize.t:$(n)' spec='parameter.RealParameter' value='1'/>
+	            </populationModel>
+            </tree>
+]]>
+        </subtemplate>
+
+<!-- Cluster tree (for UPGMA) -->
+
+        <subtemplate id='UPGMATree' class='beast.util.ClusterTree' mainid='UPGMATree.t:$(n)'>
+<![CDATA[
+        <tree spec='beast.util.ClusterTree' id='UPGMATree.t:$(n)' clusterType='upgma' estimate='false'  trait='@datetrait.$(n)' taxa='@$(n)'/>
+]]>
+        </subtemplate>
+
+<!-- Newick tree -->
+        <subtemplate id='NewickTree' class='beast.util.ClusterTree' mainid='NewickTree.t:$(n)'>
+<![CDATA[
+        <tree spec='beast.util.TreeParser' id='NewickTree.t:$(n)' estimate='false'  trait='@datetrait.$(n)'  taxa='@$(n)' newick=""/>
+]]>
+        </subtemplate>
+
+    </beauticonfig>
+
+
+	<mergepoint id='misc'/>
+
+    
+<!--
+<operator spec='DeltaExchangeOperator' id='FixMeanRatesOperator' weight='2' delta='0.75'/>
+-->
+
+<!-- framework for main model -->
+
+    <run spec="MCMC" id="mcmc" chainLength="10000000">
+
+        <state storeEvery='5000' id='state'>
+        </state>
+
+        <distribution spec="CompoundDistribution" id="posterior">
+            <distribution spec="CompoundDistribution" id="prior">
+				<mergepoint id='aux-priors'/>
+            </distribution>
+            <distribution spec="CompoundDistribution" id="likelihood">
+				<mergepoint id='aux-likelihoods'/>
+            </distribution>
+        </distribution>
+
+        <logger id='tracelog' logEvery="1000" fileName="beast.log" sort="smart" sanitiseHeaders='true'>
+	        <model idref='posterior'/>
+            <log idref="posterior"/>
+            <log idref="likelihood"/>
+            <log idref="prior"/>
+        </logger>
+
+        <logger id='screenlog' logEvery="1000">
+	        <!--model idref='posterior'/-->
+            <log idref="posterior"/>
+      	    <ESS spec='ESS' name='log' arg="@posterior"/>
+            <log idref="likelihood"/>
+            <log idref="prior"/>
+        </logger>
+    </run>
+
+</beast>
+
diff --git a/templates/StarBeast.xml b/templates/StarBeast.xml
new file mode 100644
index 0000000..0b69a50
--- /dev/null
+++ b/templates/StarBeast.xml
@@ -0,0 +1,437 @@
+<beast version='2.0'
+       namespace='beast.app.beauti:beast.core:beast.evolution.branchratemodel:beast.evolution.speciation:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood:beast.evolution:beast.math.distributions'
+	templateinfo='*BEAST species tree reconstruction from multiple-genes<br>(calibrations supported, but tip-dates are not)'>
+
+
+<map name='connect' reserved='true'>beast.app.beauti.BeautiConnector</map>
+<map name='subtemplate' reserved='true'>beast.app.beauti.BeautiSubTemplate</map>
+<map name='Uniform'>beast.math.distributions.Uniform</map>
+<map name='Normal'>beast.math.distributions.Normal</map>
+<map name='OneOnX'>beast.math.distributions.OneOnX</map>
+<map name='LogNormal'>beast.math.distributions.LogNormalDistributionModel</map>
+<map name='Exponential'>beast.math.distributions.Exponential</map>
+<map name='Gamma'>beast.math.distributions.Gamma</map>
+<map name='Beta'>beast.math.distributions.Beta</map>
+<map name='LaplaceDistribution'>beast.math.distributions.LaplaceDistribution</map>
+<map name='InverseGamma'>beast.math.distributions.InverseGamma</map>
+<map name='prior'>beast.math.distributions.Prior</map>
+
+    <beauticonfig spec='BeautiConfig'
+        inputLabelMap='beast.core.MCMC.operator=Operators,
+	        beast.core.MCMC.logger=Loggers,
+			beast.evolution.sitemodel.SiteModel.mutationRate =Substitution Rate,
+			beast.evolution.speciation.SpeciesTreePrior.gammaParameter=Population Mean'
+        inlinePlugins ='beast.core.MCMC.distribution,
+            beast.evolution.sitemodel.SiteModel.substModel,
+            beast.evolution.tree.coalescent.ExponentialGrowth,
+            beast.evolution.tree.coalescent.ConstantPopulation,
+            beast.evolution.tree.coalescent.Coalescent,
+            beast.core.State.stateNode'
+        collapsedPlugins ='beast.core.MCMC.logger'
+        suppressPlugins = 'beast.core.MCMC.operator,
+		beast.core.MCMC.operatorschedule,
+	        beast.evolution.tree.coalescent.Coalescent.treeIntervals,
+	        beast.evolution.tree.coalescent.Coalescent.tree,
+	        beast.core.MCMC.state,
+	        beast.core.MCMC.distribution,
+	        beast.core.MCMC.init,
+	        beast.evolution.speciation.BirthDeathGernhard08Model.relativeDeathRate,
+	        beast.evolution.speciation.BirthDeathGernhard08Model.treeIntervals,
+	        beast.evolution.speciation.BirthDeathGernhard08Model.type,
+	        beast.evolution.speciation.BirthDeathGernhard08Model.sampleProbability,
+	        beast.evolution.speciation.BirthDeathGernhard08Model.tree,
+	        beast.evolution.tree.Tree,
+	        beast.evolution.tree.Tree.trait,
+	        beast.evolution.tree.Tree.taxa,
+	        beast.evolution.tree.Tree.taxonset,
+	        beast.evolution.tree.RandomTree.trait,
+	        beast.evolution.tree.RandomTree.initial,
+	        beast.evolution.tree.RandomTree.taxa,
+	        beast.evolution.tree.RandomTree.taxonset,
+	        beast.evolution.tree.RandomTree.estimate,
+	        beast.util.TreeParser.initial,
+	        beast.util.TreeParser.taxa,
+	        beast.util.TreeParser.taxonset,
+	        beast.util.TreeParser.trait,
+	        beast.util.TreeParser.estimate,
+	        beast.util.ClusterTree.initial,
+	        beast.util.ClusterTree.taxa,
+	        beast.util.ClusterTree.taxonset,
+	        beast.util.ClusterTree.trait,
+	        beast.util.ClusterTree.estimate,
+	        beast.evolution.substitutionmodel.WAG.rates,
+	        beast.evolution.substitutionmodel.WAG.frequencies,
+	        beast.evolution.substitutionmodel.JTT.rates,
+	        beast.evolution.substitutionmodel.JTT.frequencies,
+	        beast.evolution.substitutionmodel.Blosum62.rates,
+	        beast.evolution.substitutionmodel.Blosum62.frequencies,
+	        beast.evolution.substitutionmodel.Dayhoff.rates,
+	        beast.evolution.substitutionmodel.Dayhoff.frequencies,
+	        beast.evolution.substitutionmodel.CPREV.rates,
+	        beast.evolution.substitutionmodel.CPREV.frequencies,
+	        beast.evolution.substitutionmodel.MTREV.rates,
+	        beast.evolution.substitutionmodel.MTREV.frequencies,
+	        beast.evolution.substitutionmodel.GTR.rates,
+	        beast.evolution.substitutionmodel.JukesCantor.frequencies,
+            beast.math.distributions.Prior.x,
+            beast.math.distributions.MRCAPrior.tree,
+            beast.math.distributions.MRCAPrior.monophyletic,
+            beast.math.distributions.MRCAPrior.taxonset,
+            beast.evolution.branchratemodel.UCRelaxedClockModel.tree,
+            beast.evolution.branchratemodel.UCRelaxedClockModel.rateCategories,
+            beast.evolution.branchratemodel.RandomLocalClockModel.tree,
+            beast.evolution.branchratemodel.RandomLocalClockModel.meanRate,
+            beast.evolution.branchratemodel.RandomLocalClockModel.indicators,
+            beast.evolution.operators.ScaleOperator.indicator,
+	        beast.core.Operator.weight,
+			beast.evolution.speciation.GeneTreeForSpeciesTreeDistribution.speciesTree,
+			beast.evolution.speciation.GeneTreeForSpeciesTreeDistribution.speciesTreePrior,
+			beast.evolution.speciation.GeneTreeForSpeciesTreeDistribution.treetop,
+			beast.evolution.speciation.GeneTreeForSpeciesTreeDistribution.tree,
+			beast.evolution.speciation.GeneTreeForSpeciesTreeDistribution.treeIntervals,
+			beast.evolution.speciation.SpeciesTreePrior.bottomPopSize,
+			beast.evolution.speciation.SpeciesTreePrior.topPopSize,
+			beast.evolution.speciation.SpeciesTreePrior.taxonset,
+			beast.evolution.speciation.SpeciesTreePrior.tree,
+			beast.evolution.speciation.SpeciesTreePrior.treeIntervals,
+			beast.evolution.speciation.YuleModel.treeIntervals,
+			beast.evolution.speciation.YuleModel.useTipDates,
+			beast.evolution.speciation.YuleModel.tree,
+            beast.core.Logger.model
+            '
+        buttonLabelMap='beast.app.beauti.BeautiInitDlg.>> details=Edit parameters'
+    >
+
+
+        <panel spec='BeautiPanelConfig' panelname="Partitions" tiptext="Data Partitions"
+            path='distribution/distribution[id="likelihood"]/distribution/data'
+            hasPartitions="none" icon='2220.pngx' forceExpansion='FALSE'
+            type='beast.evolution.alignment.Alignment'
+        />
+		<mergepoint id='aux-partitions-panels'/>
+
+		<panel spec='BeautiPanelConfig' panelname="Taxon sets" tiptext="Specify taxon sets that make up species"
+            path='distribution/distribution[id="speciescoalescent"]/distribution[id="SpeciesTreePopSize.Species"]/taxonset'
+            hasPartitions="none" icon='1.pngx' forceExpansion='TRUE'
+        />
+		<panel spec='BeautiPanelConfig' panelname="Site Model" tiptext="Site model and substitution model specifications"
+            path='siteModel'
+            hasPartitions="SiteModel" icon='3.pngx' forceExpansion='TRUE'
+        />
+		<mergepoint id='aux-sitemodel-panels'/>
+
+		<panel spec='BeautiPanelConfig' panelname="Clock Model" tiptext="Clock model"
+            path='branchRateModel'
+            hasPartitions="ClockModel" icon='4.pngx' forceExpansion='TRUE'
+        />
+		<mergepoint id='aux-clockmodel-panels'/>
+
+		<panel spec='BeautiPanelConfig' panelname="Initialization" tiptext="Initial state"
+            path='state/stateNode'
+            hasPartitions="none" icon='6.pngx' forceExpansion='TRUE_START_COLLAPSED'
+            isVisible='false'
+        />
+		<mergepoint id='aux-initilisation-panels'/>
+
+		<panel spec='BeautiPanelConfig' panelname="Multi Species Coalescent" tiptext="Multi Species Coalescent specific settings"
+            path='distribution/distribution[id="speciescoalescent"]/distribution'
+            hasPartitions="none" icon='2.pngx' forceExpansion='TRUE'
+        />
+
+		<panel spec='BeautiPanelConfig' panelname="Priors" tiptext="Other priors"
+            path='distribution/distribution[id="prior"]/distribution'
+            hasPartitions="none" icon='7.pngx' forceExpansion='TRUE_START_COLLAPSED'
+            type='beast.core.Distribution'  buttonStatus='ADD_ONLY'
+        />
+		<mergepoint id='aux-priors-panels'/>
+
+		<panel spec='BeautiPanelConfig' panelname="Operators" tiptext="MCMC Operator details"
+            path='operator'
+            hasPartitions="none" icon='8.pngx' forceExpansion='TRUE_START_COLLAPSED'
+            isVisible='false'
+        />
+		<mergepoint id='aux-operators-panels'/>
+
+		<panel spec='BeautiPanelConfig' panelname="MCMC" tiptext="MCMC parameters"
+            path=''
+            hasPartitions="none" icon='9.pngx' forceExpansion='TRUE'
+        />
+		<mergepoint id='aux-panels'/>
+
+		<alignmentProvider id="Import Alignment" spec='BeautiAlignmentProvider' template='@StarBEASTPartitionTemplate'/>
+
+
+        <partitiontemplate id='StarBEASTPartitionTemplate' spec='BeautiSubTemplate' class='beast.evolution.likelihood.TreeLikelihood' mainid='mcmc'>
+<![CDATA[
+
+		    <distribution id='treePrior.t:$(n)' spec='GeneTreeForSpeciesTreeDistribution' tree='@Tree.t:$(n)' speciesTree='@Tree.t:Species' speciesTreePrior='@SpeciesTreePopSize.Species'/>
+
+            <!-- site model                                                              -->
+            <plugin spec='SiteModel' id="SiteModel.s:$(n)" gammaCategoryCount='0'>
+                <!--substModel will be automatically detected /-->
+                <proportionInvariant spec='parameter.RealParameter' id='proportionInvariant.s:$(n)' value='0.0' lower='0' upper='1' estimate='false'/>
+                <mutationRate        spec='parameter.RealParameter' id='mutationRate.s:$(n)' value='1.0'        estimate='false'/>
+                <shape               spec='parameter.RealParameter' id='gammaShape.s:$(n)' value='1.0'         estimate='false'/>
+            </plugin>
+
+            <plugin spec='TreeLikelihood' id="treeLikelihood.$(n)">
+                <data idref="data"/>
+                <tree idref="Tree.t:$(n)"/>
+                <siteModel idref="SiteModel.s:$(n)"/>
+                <branchRateModel spec='StrictClockModel' id='StrictClock.c:$(n)'>
+                    <clock.rate id='clockRate.c:$(n)' spec='parameter.RealParameter' value='1.0' estimate='false'/>
+                </branchRateModel>
+            </plugin>
+
+	        <prior id='ClockPrior.c:$(n)' x='@clockRate.c:$(n)'><distr spec="beast.math.distributions.Uniform" upper='Infinity'/></prior>
+	        <prior id='MutationRatePrior.s:$(n)' x='@mutationRate.s:$(n)'><distr spec="OneOnX"/></prior>
+
+            <!-- tree and its properties -->
+            <taxonset id='TaxonSet.$(n)' spec='beast.evolution.alignment.TaxonSet' alignment='@$(n)' />
+            <plugin spec='beast.evolution.tree.Tree' id='Tree.t:$(n)' taxonset='@TaxonSet.$(n)'/>
+
+            <!--plugin spec='beast.evolution.tree.RandomTree' id='RandomTree.t:$(n)' estimate='false' trait='@datetrait.$(n)' initial='@Tree.t:$(n)'-->
+			<tree spec='RandomGeneTree' id='RandomGeneTree.t:$(n)' initial='@Tree.t:$(n)' speciesTree='@Tree.t:Species' taxa='@$(n)'>
+				<populationModel id='RGTPopulationModel.t:$(n)' spec='ConstantPopulation'>
+					<popSize id='RGTPopSize.t:$(n)' spec='parameter.RealParameter' value='1'/>
+				</populationModel>
+			</tree>
+
+            <plugin id='TreeHeight.t:$(n)' spec='beast.evolution.tree.TreeHeightLogger' tree='@Tree.t:$(n)'/>
+
+            <logger id='treelog.t:$(n)' spec='beast.core.Logger' logEvery="5000" fileName="$(tree).$(seed).trees" mode='tree'>
+	            <log id='TreeWithMetaDataLogger.t:$(n)' spec='beast.evolution.tree.TreeWithMetaDataLogger' tree='@Tree.t:$(n)'>
+	            </log>
+            </logger>
+
+            <operator id='proportionInvariantScaler.s:$(n)' spec='ScaleOperator' scaleFactor="0.5" weight="0.5" parameter="@proportionInvariant.s:$(n)"/>
+            <operator id='mutationRateScaler.s:$(n)' spec='ScaleOperator' scaleFactor="0.5" weight="0.5" parameter="@mutationRate.s:$(n)"/>
+            <operator id='gammaShapeScaler.s:$(n)' spec='ScaleOperator' scaleFactor="0.5" weight="0.5" parameter="@gammaShape.s:$(n)"/>
+
+            <operator id='treeScaler.t:$(n)' spec='ScaleOperator' scaleFactor="0.5" weight="3" tree="@Tree.t:$(n)"/>
+            <operator id='treeRootScaler.t:$(n)' spec='ScaleOperator' scaleFactor="0.5" weight="3" tree="@Tree.t:$(n)" rootOnly='true'/>
+            <operator id='UniformOperator.t:$(n)' spec='Uniform' weight="30" tree="@Tree.t:$(n)"/>
+            <operator id='SubtreeSlide.t:$(n)' spec='SubtreeSlide' weight="15" gaussian="true" size="1.0" tree="@Tree.t:$(n)"/>
+            <operator id='narrow.t:$(n)' spec='Exchange' isNarrow='true' weight="15" tree="@Tree.t:$(n)"/>
+            <operator id='wide.t:$(n)' spec='Exchange' isNarrow='false' weight="3" tree="@Tree.t:$(n)"/>
+            <operator id='WilsonBalding.t:$(n)' spec='WilsonBalding' weight="3" tree="@Tree.t:$(n)"/>
+
+            <operator id='updown.$(n)' spec='UpDownOperator' scaleFactor="0.75" weight="3">
+                <up idref="clockRate.c:$(n)"/>
+                <down idref="Tree.t:$(n)"/>
+            </operator>
+
+            <prior id='GammaShapePrior.s:$(n)' x='@gammaShape.s:$(n)'><distr spec="beast.math.distributions.Exponential" mean='1'/></prior>
+            <prior id='PropInvariantPrior.t:$(n)' x='@proportionInvariant.s:$(n)'><distr spec="beast.math.distributions.Uniform" lower='0' upper='1'/></prior>
+			<operator id='StrictClockRateScaler.c:$(n)' spec='ScaleOperator' scaleFactor="0.75" weight="3" parameter='@clockRate.c:$(n)'/>
+			<!-- need updown operator for clockRate?!? Also in SubstModel.xml -->
+
+
+]]>
+            <connect srcID='treeLikelihood.$(n)'         targetID='likelihood' inputName='distribution' if="isInitializing"/>
+
+            <connect srcID='treelog.t:$(n)'              targetID='mcmc' inputName='logger' if='inposterior(Tree.t:$(n)) and Tree.t:$(n)/estimate=true'/>
+
+            <connect srcID='treePrior.t:$(n)'            targetID='speciescoalescent' inputName='distribution' if='inposterior(Tree.t:$(n)) and Tree.t:$(n)/estimate=true'/>
+<!-- trick to ensure that treePrior.$(n) is always deleted from prior, since it is already part of speciescoalescent -->
+            <connect srcID='treePrior.t:$(n)'            targetID='prior' inputName='distribution' if='Tree.t:$(n)/estimate=nonsense'/>
+
+            <connect srcID='ClockPrior.c:$(n)'           targetID='prior' inputName='distribution' if='inposterior(clockRate.c:$(n)) and clockRate.c:$(n)/estimate=true'/>
+<!-- when FixMeanMutationRatesOperator, the prior is uniform due to the operator -->
+            <connect srcID='MutationRatePrior.s:$(n)'    targetID='prior' inputName='distribution' if='nooperator(FixMeanMutationRatesOperator) and inposterior(mutationRate.s:$(n)) and mutationRate.s:$(n)/estimate=true'/>
+
+            <connect srcID='Tree.t:$(n)'                 targetID='state' inputName='stateNode' if='inposterior(Tree.t:$(n)) and Tree.t:$(n)/estimate=true'/>
+            <connect srcID='proportionInvariant.s:$(n)'  targetID='state' inputName='stateNode' if='inposterior(proportionInvariant.s:$(n)) and proportionInvariant.s:$(n)/estimate=true'/>
+            <connect srcID='mutationRate.s:$(n)'         targetID='state' inputName='stateNode' if='inposterior(mutationRate.s:$(n)) and mutationRate.s:$(n)/estimate=true'/>
+            <connect srcID='gammaShape.s:$(n)'           targetID='state' inputName='stateNode' if='inposterior(gammaShape.s:$(n)) and gammaShape.s:$(n)/estimate=true'/>
+            <connect srcID='clockRate.s:$(n)'            targetID='state' inputName='stateNode' if='inposterior(clockRate.s:$(n)) and clockRate.s:$(n)/estimate=true'/>
+
+            <connect srcID='proportionInvariantScaler.s:$(n)' targetID='mcmc' inputName='operator' if='inposterior(proportionInvariant.s:$(n)) and proportionInvariant.s:$(n)/estimate=true'/>
+            <connect srcID='mutationRateScaler.s:$(n)'        targetID='mcmc' inputName='operator' if='nooperator(FixMeanMutationRatesOperator) and inposterior(mutationRate.s:$(n)) and mutationRate.s:$(n)/estimate=true'/>
+            <connect srcID='gammaShapeScaler.s:$(n)'          targetID='mcmc' inputName='operator' if='inposterior(gammaShape.s:$(n)) and gammaShape.s:$(n)/estimate=true'/>
+            <connect srcID='StrictClockRateScaler.c:$(n)'     targetID='mcmc' inputName='operator' if='inposterior(clockRate.c:$(n)) and clockRate.c:$(n)/estimate=true'/>
+
+            <connect srcID='treeScaler.t:$(n)'                targetID='mcmc' inputName='operator' if='inposterior(Tree.t:$(n)) and Tree.t:$(n)/estimate=true'/>
+            <connect srcID='treeRootScaler.t:$(n)'            targetID='mcmc' inputName='operator' if='inposterior(Tree.t:$(n)) and Tree.t:$(n)/estimate=true'>Scales root node for tree t:$(n)</connect>
+            <connect srcID='UniformOperator.t:$(n)'           targetID='mcmc' inputName='operator' if='inposterior(Tree.t:$(n)) and Tree.t:$(n)/estimate=true'/>
+            <connect srcID='SubtreeSlide.t:$(n)'              targetID='mcmc' inputName='operator' if='inposterior(Tree.t:$(n)) and Tree.t:$(n)/estimate=true'/>
+            <connect srcID='narrow.t:$(n)'                    targetID='mcmc' inputName='operator' if='inposterior(Tree.t:$(n)) and Tree.t:$(n)/estimate=true'/>
+            <connect srcID='wide.t:$(n)'                      targetID='mcmc' inputName='operator' if='inposterior(Tree.t:$(n)) and Tree.t:$(n)/estimate=true'/>
+            <connect srcID='WilsonBalding.t:$(n)'             targetID='mcmc' inputName='operator' if='inposterior(Tree.t:$(n)) and Tree.t:$(n)/estimate=true'/>
+            <connect srcID='updown.$(n)'                      targetID='mcmc' inputName='operator' if='nooperator(FixMeanRatesOperator) and inposterior(Tree.t:$(n)) and Tree.t:$(n)/estimate=true and inlikelihood(clockRate.c:$(n)) and clockRate.c:$(n)/estimate=true'/>
+
+            <connect srcID='treeLikelihood.$(n)'         targetID='tracelog' inputName='log' if='inlikelihood(treeLikelihood.$(n))'/>
+            <connect srcID='treePrior.t:$(n)'            targetID='tracelog' inputName='log' if='inposterior(Tree.t:$(n)) and Tree.t:$(n)/estimate=true'/>
+            <connect srcID='TreeHeight.t:$(n)'           targetID='tracelog' inputName='log' if='inposterior(Tree.t:$(n)) and Tree.t:$(n)/estimate=true'/>
+            <connect srcID='proportionInvariant.s:$(n)'  targetID='tracelog' inputName='log' if='inlikelihood(proportionInvariant.s:$(n)) and proportionInvariant.s:$(n)/estimate=true'/>
+            <connect srcID='mutationRate.s:$(n)'         targetID='tracelog' inputName='log' if='inlikelihood(mutationRate.s:$(n)) and mutationRate.s:$(n)/estimate=true'/>
+            <connect srcID='gammaShape.s:$(n)'           targetID='tracelog' inputName='log' if='inlikelihood(gammaShape.s:$(n)) and gammaShape.s:$(n)/estimate=true'/>
+            <connect srcID='clockRate.c:$(n)'            targetID='tracelog' inputName='log' if='inlikelihood(clockRate.c:$(n)) and clockRate.c:$(n)/estimate=true'/>
+
+            <connect srcID='GammaShapePrior.s:$(n)'      targetID='prior' inputName='distribution' if='inlikelihood(gammaShape.s:$(n)) and gammaShape.s:$(n)/estimate=true'/>
+            <connect srcID='PropInvariantPrior.s:$(n)'   targetID='prior' inputName='distribution' if='inlikelihood(proportionInvariant.s:$(n)) and proportionInvariant.s:$(n)/estimate=true'/>
+            <connect srcID='Tree.t:$(n)'        targetID='Reheight.t:Species' inputName='genetree' if='Tree.t:$(n)/estimate=true'/>
+
+	        <connect srcID='Tree.t:$(n)'        targetID='updown.all.Species' inputName='down' if='inposterior(Tree.t:$(n)) and Tree.t:$(n)/estimate=true'/>
+	        <connect srcID='clockRate.c:$(n)'   targetID='updown.all.Species' inputName='up' if='nooperator(FixMeanRatesOperator) and inlikelihood(clockRate.c:$(n)) and clockRate.c:$(n)/estimate=true'/>
+
+	        <connect srcID='popSizeTop' targetID='updown.all.Species' inputName='down' if='SpeciesTreePopSize.Species/popFunction!=constant'/>
+
+            <connect srcID='popSizeTopScaler.t:Species' targetID='mcmc'  inputName='operator' if='SpeciesTreePopSize.Species/popFunction!=constant'/>
+            <connect srcID='popSizeTop'       targetID='state' inputName='stateNode' if='SpeciesTreePopSize.Species/popFunction!=constant'/>
+            <connect srcID='popSizeTop'       targetID='SpeciesTreePopSize.Species' inputName='topPopSize' if='SpeciesTreePopSize.Species/popFunction!=constant'/>
+            <connect srcID='popSizeTop'       targetID='SpeciesTreeLoggerX' inputName='popSizeTop' if='SpeciesTreePopSize.Species/popFunction!=constant'/>
+
+            <connect srcID='Tree.t:$(n)'      targetID='treeTopFinder' inputName='tree' if='inposterior(Tree.t:$(n)) and Tree.t:$(n)/estimate=true'/>
+            <connect srcID='treeTopFinder'    targetID='treePrior.t:$(n)' inputName='treetop' if='SpeciesTreePopSize.Species/popFunction=linear'/>
+			<!-- 
+			Since 'Species' is treated as a separate partition, we need the following
+			hack to get rid of undesirable Tree.t:Species connections 
+			-->
+            <connect srcID='Tree.t:Species'     targetID='Reheight.t:Species' inputName='genetree' if='Tree.t:$(n)/estimate=XXX'/>
+            <connect srcID='Tree.t:Species'     targetID='treeTopFinder' inputName='tree' if='Tree.t:$(n)/estimate=XXX'/>
+
+			<connect srcID='birthRate.t:Species' targetID='updown.all.Species' inputName='up' if='inposterior(birthRate.t:Species)'/>
+	
+
+            <!-- initialise species and gene trees: if CalibratedYuleModel is used, 
+                use the old initialisation, otherwise use the fancy new SBI -->
+			<connect srcID="SBI"                           targetID='mcmc' inputName='init' if='nooperator(CalibratedYuleBirthRateScaler.t:$(n))'/>
+			<!-- gene tree initialiser by SBI -->
+            <connect srcID='Tree.t:$(n)'                   targetID='SBI' inputName='gene' if='inposterior(Tree.t:$(n))'/>
+			<!-- we don't want Tree.t:Species to be treated as gene, so the condition is guaranteed false -->
+            <connect srcID='Tree.t:Species'                targetID='SBI' inputName='gene' if='popSize/value=-1'/>
+            <connect srcID='Tree.t:Species'                targetID='SBI' inputName='speciesTree' if='inposterior(Tree.t:Species) and nooperator(CalibratedYuleBirthRateScaler.t:$(n))'/>
+			<connect srcID="CalibratedYuleModel.t:Species" targetID='SBI' inputName='calibratedYule' if='inposterior(CalibratedYuleModel.t:Species)'/>
+
+
+			<connect srcID="RandomTree.t:Species"          targetID='mcmc' inputName='init' if='inposterior(CalibratedYuleModel.t:Species)'/>
+            <connect srcID='RandomGeneTree.t:$(n)'         targetID='mcmc' inputName='init' if='inposterior(Tree.t:$(n)) and inposterior(CalibratedYuleModel.t:Species)'/>
+
+
+
+			<mergepoint id='aux-partitiontemplate'/>
+        </partitiontemplate>
+
+		<mergepoint id='substModelTemplates'/>
+		<mergepoint id='clockModelTemplates'/>
+		<mergepoint id='treePriorTemplates'/>
+        <mergepoint id='parametricDistributions'/>
+
+    </beauticonfig>
+
+	<mergepoint id='misc'/>
+
+	<taxonset spec='beast.evolution.alignment.TaxonSet' id='taxonsuperset'>
+		<!-- 
+		need to specify at least one taxon for a TaxonSet, so insert a dummy taxon here
+		This one is cleared by the TaxonSetInputEditor 
+		-->
+		<taxon spec='beast.evolution.alignment.TaxonSet' id='Beauti2DummyTaxonSet'>
+			<taxon spec='beast.evolution.alignment.Taxon' id='dummyTaxon'/>
+		</taxon>
+	</taxonset>
+
+	<tree spec='beast.evolution.tree.Tree' id='Tree.t:Species' taxonset='@taxonsuperset' estimate='true'/>
+
+	<treetop spec='TreeTopFinder' id='treeTopFinder'/>
+
+<!-- framework for main model -->
+    <run spec="MCMC" id="mcmc" storeEvery="5000" chainLength="10000000">
+
+        <state storeEvery='5000' id='state'>
+	        <stateNode idref='popSize'/> 
+	        <stateNode idref='popSizeTop'/> 
+	        <stateNode idref='Tree.t:Species'/> 
+	        <stateNode idref='birthRate.t:Species'/> 
+	        <stateNode idref='popMean'/> 
+        </state>
+
+        <distribution spec="CompoundDistribution" id="posterior">
+            <distribution spec="CompoundDistribution" id="speciescoalescent">
+				<distribution id='SpeciesTreePopSize.Species' spec='SpeciesTreePrior' tree='@Tree.t:Species' 
+						popFunction='constant' taxonset='@taxonsuperset'>
+				    <bottomPopSize spec='parameter.RealParameter' id='popSize' value='1'/> 
+			        <topPopSize spec='parameter.RealParameter' id='popSizeTop' value='1'/> 
+				    <parameter name='gammaParameter' id='popMean' value='1' estimate="true"/>
+				</distribution>
+				<mergepoint id='aux-priors'/>
+			</distribution>
+            <distribution spec="CompoundDistribution" id="prior">
+			    <!-- species tree priors -->
+		        <distribution id="YuleModel.t:Species" spec="speciation.YuleModel" tree='@Tree.t:Species'>
+		            <birthDiffRate spec='parameter.RealParameter' id="birthRate.t:Species" value='1' lower='0' />
+		        </distribution>
+	            <distribution id='YuleBirthRatePrior.t:Species' spec='beast.math.distributions.Prior' x='@birthRate.t:Species'>
+		             <distr spec="beast.math.distributions.OneOnX"/>
+		        </distribution>
+	            <distribution id='popMean.prior' spec='beast.math.distributions.Prior' x='@popMean'>
+		            <distr spec="beast.math.distributions.OneOnX"/>
+		        </distribution>
+            </distribution>
+            <distribution spec="CompoundDistribution" id="likelihood">
+				<mergepoint id='aux-likelihoods'/>
+            </distribution>
+        </distribution>
+
+	    <operator id="Reheight.t:Species" spec="NodeReheight" tree="@Tree.t:Species" weight="94" taxonset='@taxonsuperset'/>
+	    <operator degreesOfFreedom="1" id="popSizeBottomScaler.t:Species" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.5" spec="ScaleOperator" parameter="@popSize" weight="5.0"/>
+	    <operator degreesOfFreedom="1" id="popSizeTopScaler.t:Species" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.5" spec="ScaleOperator" parameter="@popSizeTop" weight="5.0"/>
+	    <operator id='popMeanScale.t:Species' spec='ScaleOperator' scaleFactor="0.75" weight="3" parameter="@popMean"/>
+
+	    <operator id="updown.all.Species" spec='UpDownOperator' scaleFactor="0.75" weight="20">
+	      <up idref="birthRate.t:Species"/>
+	      <down idref="popMean"/>
+	      <down idref="popSize"/>
+
+	      <down idref="Tree.t:Species"/>
+	    </operator>
+	
+	    <operator id='YuleBirthRateScaler.t:Species' spec='ScaleOperator' scaleFactor="0.75" weight="3" parameter="@birthRate.t:Species"/>
+
+        <logger id='tracelog' logEvery="5000" fileName="beast_$(seed).log" sort="smart">
+	        <model idref='posterior'/>
+            <log idref="posterior"/>
+            <log idref="likelihood"/>
+            <log idref="prior"/>
+			<log idref="speciescoalescent"/>
+			<log idref="birthRate.t:Species"/>
+			<log idref="YuleModel.t:Species"/>
+            <log id='TreeHeight.Species' spec='beast.evolution.tree.TreeHeightLogger' tree='@Tree.t:Species'/>
+        </logger>
+
+		<logger fileName="species_$(seed).trees" id="speciesTreeLogger" logEvery="5000" mode="tree">
+		    <log id='SpeciesTreeLoggerX' spec='SpeciesTreeLogger' popSize='@popSize' popSizeTop="@popSizeTop" tree="@Tree.t:Species" speciesTreePrior='@SpeciesTreePopSize.Species' treetop='@treeTopFinder'/>
+		</logger>
+
+        <logger id='screenlog' logEvery="5000">
+	        <model idref='posterior'/>
+            <log idref="posterior"/>
+      	    <ESS spec='ESS' name='log' arg="@posterior"/>
+            <log idref="likelihood"/>
+            <log idref="prior"/>
+        </logger>
+
+
+<!-- use with calibrated yule-->
+        <init spec='beast.evolution.tree.RandomTree' id='RandomTree.t:Species' estimate='false' initial='@Tree.t:Species' taxonset='@taxonsuperset'>
+            <populationModel id='ConstantPopulation0.Species' spec='ConstantPopulation'>
+        		<popSize id='randomPopSize.Species' spec='parameter.RealParameter' value='1'/>
+            </populationModel>
+        </init>
+
+<!-- use without calibrated yule-->
+		<init id="SBI"  spec="beast.evolution.speciation.StarBeastStartState"
+		  speciesTree="@Tree.t:Species"
+		  speciesTreePrior="@SpeciesTreePopSize.Species"
+		  popMean="@popMean"
+		  birthRate="@birthRate.t:Species">
+		  <!--baseRate idref="clockRate.sb_l0_example03"/-->
+		</init>
+    </run>
+
+</beast>
+
+
+
+
diff --git a/templates/SubstModels.xml b/templates/SubstModels.xml
new file mode 100644
index 0000000..aded99c
--- /dev/null
+++ b/templates/SubstModels.xml
@@ -0,0 +1,384 @@
+<beast version='2.0'
+       namespace='beast.app.beauti:beast.core:beast.evolution.branchratemodel:beast.evolution.speciation:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood:beast.evolution:beast.math.distributions'>
+
+       
+       
+       
+    <mergewith point='substModelTemplates'>
+    
+        <!-- gamma site model -->
+        <subtemplate id='Gamma Site Model' class='beast.evolution.sitemodel.SiteModel' mainid='SiteModel.s:$(n)'>
+            <![CDATA[
+            <plugin spec='SiteModel' id="SiteModel.s:$(n)" gammaCategoryCount='0'>
+                <!--substModel will be automatically detected /-->
+                <proportionInvariant spec='parameter.RealParameter' id='proportionInvariant.s:$(n)' value='0.0' lower='0' upper='1' estimate='false'/>
+                <mutationRate        spec='parameter.RealParameter' id='mutationRate.s:$(n)' value='1.0'        estimate='false'/>
+                <shape               spec='parameter.RealParameter' id='gammaShape.s:$(n)' value='1.0'         estimate='false'/>
+            </plugin>
+
+                <prior id='MutationRatePrior.s:$(n)' x='@mutationRate.s:$(n)'><distr spec="OneOnX"/></prior>
+            <prior id='GammaShapePrior.s:$(n)' x='@gammaShape.s:$(n)'><distr spec="beast.math.distributions.Exponential" mean='1'/></prior>
+            <prior id='PropInvariantPrior.s:$(n)' x='@proportionInvariant.s:$(n)'><distr spec="beast.math.distributions.Uniform" lower='0' upper='1'/></prior>
+
+            <operator id='proportionInvariantScaler.s:$(n)' spec='ScaleOperator' scaleFactor="0.5" weight="0.1" parameter="@proportionInvariant.s:$(n)"/>
+            <operator id='mutationRateScaler.s:$(n)' spec='ScaleOperator' scaleFactor="0.5" weight="0.1" parameter="@mutationRate.s:$(n)"/>
+            <operator id='gammaShapeScaler.s:$(n)' spec='ScaleOperator' scaleFactor="0.5" weight="0.1" parameter="@gammaShape.s:$(n)"/>
+            ]]>
+
+                        <connect method="beast.app.beauti.SiteModelInputEditor.customConnector"/>
+
+<!-- when FixMeanMutationRatesOperator, the prior is uniform due to the operator -->
+            <connect srcID='MutationRatePrior.s:$(n)'         targetID='prior' inputName='distribution' if='nooperator(FixMeanMutationRatesOperator) and inlikelihood(mutationRate.s:$(n)) and mutationRate.s:$(n)/estimate=true'/>
+
+            <connect srcID='proportionInvariant.s:$(n)'       targetID='state' inputName='stateNode' if='inlikelihood(proportionInvariant.s:$(n)) and proportionInvariant.s:$(n)/estimate=true'/>
+            <connect srcID='mutationRate.s:$(n)'              targetID='state' inputName='stateNode' if='inlikelihood(mutationRate.s:$(n)) and mutationRate.s:$(n)/estimate=true'/>
+            <connect srcID='gammaShape.s:$(n)'                targetID='state' inputName='stateNode' if='inlikelihood(gammaShape.s:$(n)) and gammaShape.s:$(n)/estimate=true'/>
+
+
+            <connect srcID='proportionInvariantScaler.s:$(n)' targetID='mcmc' inputName='operator' if='inlikelihood(proportionInvariant.s:$(n)) and proportionInvariant.s:$(n)/estimate=true'>Scales proportion of invariant sites parameter of partition $(n)</connect>
+            <connect srcID='mutationRateScaler.s:$(n)'        targetID='mcmc' inputName='operator' if='nooperator(FixMeanMutationRatesOperator) and inlikelihood(mutationRate.s:$(n)) and mutationRate.s:$(n)/estimate=true'>Scales mutation rate of partition s:$(n)</connect>
+            <connect srcID='gammaShapeScaler.s:$(n)'          targetID='mcmc' inputName='operator' if='inlikelihood(gammaShape.s:$(n)) and gammaShape.s:$(n)/estimate=true'>Scales gamma shape parameter of partition s:$(n)</connect>
+
+            <connect srcID='proportionInvariant.s:$(n)'       targetID='tracelog' inputName='log' if='inposterior(proportionInvariant.s:$(n)) and proportionInvariant.s:$(n)/estimate=true'/>
+            <connect srcID='mutationRate.s:$(n)'              targetID='tracelog' inputName='log' if='inlikelihood(mutationRate.s:$(n)) and mutationRate.s:$(n)/estimate=true'/>
+            <connect srcID='gammaShape.s:$(n)'                targetID='tracelog' inputName='log' if='inlikelihood(gammaShape.s:$(n)) and gammaShape.s:$(n)/estimate=true'/>
+
+            <connect srcID='GammaShapePrior.s:$(n)'           targetID='prior' inputName='distribution' if='inlikelihood(gammaShape.s:$(n)) and gammaShape.s:$(n)/estimate=true'>Prior on gamma shape for partition s:$(n)</connect>
+            <connect srcID='PropInvariantPrior.s:$(n)'        targetID='prior' inputName='distribution' if='inlikelihood(proportionInvariant.s:$(n)) and proportionInvariant.s:$(n)/estimate=true'>Prior on proportion invariant for partition s:$(n)</connect>
+
+        </subtemplate>
+
+    
+
+        <!-- substitution models -->
+        <!-- JC69 substitution model -->
+        <subtemplate id='JC69' class='beast.evolution.substitutionmodel.JukesCantor' mainid='JC69.s:$(n)'>
+            <![CDATA[
+        <plugin spec='JukesCantor' id='JC69.s:$(n)'/>
+]]>
+        </subtemplate>
+
+        <!-- HKY substitution model -->
+        <subtemplate id='HKY' class='beast.evolution.substitutionmodel.HKY' mainid='hky.s:$(n)'>
+            <![CDATA[
+        <plugin spec='HKY' id='hky.s:$(n)'>
+            <parameter id="kappa.s:$(n)" name='kappa' value="2.0" lower="0.0" estimate='true'/>
+            <frequencies id='estimatedFreqs.s:$(n)' spec='Frequencies'>
+                <frequencies id='freqParameter.s:$(n)' spec='parameter.RealParameter' dimension='4' value='0.25' lower='0' upper='1'/>
+            </frequencies>
+        </plugin>
+
+        <plugin id='KappaScaler.s:$(n)' spec='ScaleOperator' scaleFactor="0.5" weight="0.1" parameter="@kappa.s:$(n)"/>
+        <plugin id='FrequenciesExchanger.s:$(n)' spec='DeltaExchangeOperator' delta="0.01" weight="0.1" parameter="@freqParameter.s:$(n)"/>
+
+        <prior id='KappaPrior.s:$(n)' x='@kappa.s:$(n)'>
+            <distr spec="LogNormalDistributionModel" meanInRealSpace='false'>
+                <parameter name='M' value="1.0" estimate='false'/>
+                <parameter name='S' value="1.25" estimate='false'/>
+            </distr>
+		</prior>
+<!--
+        <prior id='FrequenciesPrior.s:$(n)' x='@freqParameter.s:$(n)'><distr spec="beast.math.distributions.Uniform" lower='0' upper='1'/></prior>
+-->
+
+]]>
+
+            <connect srcID='kappa.s:$(n)' targetID='state' inputName='stateNode'
+                     if='inlikelihood(kappa.s:$(n)) and kappa.s:$(n)/estimate=true'/>
+            <connect srcID='freqParameter.s:$(n)' targetID='state' inputName='stateNode'
+                     if='inlikelihood(hky.$(n)) and inlikelihood(freqParameter.s:$(n)) and freqParameter.s:$(n)/estimate=true'/>
+
+            <connect srcID='KappaScaler.s:$(n)' targetID='mcmc' inputName='operator'
+                     if='inlikelihood(kappa.s:$(n)) and kappa.s:$(n)/estimate=true'>Scale HKY transition-transversion
+                parameter of partition s:$(n)
+            </connect>
+            <connect srcID='FrequenciesExchanger.s:$(n)' targetID='mcmc' inputName='operator'
+                     if='inlikelihood(hky.$(n)) and inlikelihood(freqParameter.s:$(n)) and freqParameter.s:$(n)/estimate=true'>
+                Exchange values of frequencies of partition s:$(n)
+            </connect>
+
+            <connect srcID='kappa.s:$(n)' targetID='tracelog' inputName='log'
+                     if='inlikelihood(kappa.s:$(n)) and kappa.s:$(n)/estimate=true'/>
+            <connect srcID='freqParameter.s:$(n)' targetID='tracelog' inputName='log'
+                     if='inlikelihood(hky.$(n)) and inlikelihood(freqParameter.s:$(n)) and freqParameter.s:$(n)/estimate=true'/>
+
+            <connect srcID='KappaPrior.s:$(n)' targetID='prior' inputName='distribution'
+                     if='inlikelihood(kappa.s:$(n)) and kappa.s:$(n)/estimate=true'>HKY transition-transversion
+                parameter of partition s:$(n)
+            </connect>
+            <!--
+                        <connect srcID='FrequenciesPrior.s:$(n)'     targetID='prior' inputName='distribution' if='inposterior(hky.s:$(n)) and inposterior(freqParameter.s:$(n)) and freqParameter.s:$(n)/estimate=true'/>
+            -->
+        </subtemplate>
+
+
+        <!-- TN93 substitution model -->
+        <subtemplate id='TN93' class='beast.evolution.substitutionmodel.TN93' mainid='tn93.s:$(n)'>
+            <![CDATA[
+        <plugin spec='TN93' id='tn93.s:$(n)'>
+            <parameter id="kappa1.s:$(n)" name='kappa1' value="2.0" lower="0.0" estimate='true'/>
+            <parameter id="kappa2.s:$(n)" name='kappa2' value="2.0" lower="0.0" estimate='true'/>
+            <frequencies id='estimatedFreqs.s:$(n)' spec='Frequencies'>
+                <frequencies id='freqParameter.s:$(n)' spec='parameter.RealParameter' dimension='4' value='0.25' lower='0' upper='1'/>
+            </frequencies>
+        </plugin>
+
+        <plugin id='kappa1Scaler.s:$(n)' spec='ScaleOperator' scaleFactor="0.5" weight="0.1" parameter="@kappa1.s:$(n)"/>
+        <plugin id='kappa2Scaler.s:$(n)' spec='ScaleOperator' scaleFactor="0.5" weight="0.1" parameter="@kappa2.s:$(n)"/>
+        <plugin id='FrequenciesExchanger.s:$(n)' spec='DeltaExchangeOperator' delta="0.01" weight="0.1" parameter="@freqParameter.s:$(n)"/>
+
+        <prior id='kappa1Prior.s:$(n)' x='@kappa1.s:$(n)'>
+            <distr spec="LogNormalDistributionModel" meanInRealSpace='false'>
+                <parameter name='M' value="1.0" estimate='false'/>
+                <parameter name='S' value="1.25" estimate='false'/>
+            </distr>
+	</prior>
+        <prior id='kappa2Prior.s:$(n)' x='@kappa2.s:$(n)'>
+            <distr spec="LogNormalDistributionModel" meanInRealSpace='false'>
+                <parameter name='M' value="1.0" estimate='false'/>
+                <parameter name='S' value="1.25" estimate='false'/>
+            </distr>
+	</prior>
+<!--
+        <prior id='FrequenciesPrior.s:$(n)' x='@freqParameter.s:$(n)'><distr spec="beast.math.distributions.Uniform" lower='0' upper='1'/></prior>
+-->
+
+]]>
+
+            <connect srcID='kappa1.s:$(n)' targetID='state' inputName='stateNode'
+                     if='inlikelihood(kappa1.s:$(n)) and kappa1.s:$(n)/estimate=true'/>
+            <connect srcID='kappa2.s:$(n)' targetID='state' inputName='stateNode'
+                     if='inlikelihood(kappa2.s:$(n)) and kappa2.s:$(n)/estimate=true'/>
+            <connect srcID='freqParameter.s:$(n)' targetID='state' inputName='stateNode'
+                     if='inlikelihood(hky.$(n)) and inlikelihood(freqParameter.s:$(n)) and freqParameter.s:$(n)/estimate=true'/>
+
+            <connect srcID='kappa1Scaler.s:$(n)' targetID='mcmc' inputName='operator'
+                     if='inlikelihood(kappa1.s:$(n)) and kappa1.s:$(n)/estimate=true'>Scale TN93 kappa1 (rateAG)
+                parameter of partition s:$(n)
+            </connect>
+            <connect srcID='kappa2Scaler.s:$(n)' targetID='mcmc' inputName='operator'
+                     if='inlikelihood(kappa2.s:$(n)) and kappa2.s:$(n)/estimate=true'>Scale TN93 kappa2 (rateCT)
+                parameter of partition s:$(n)
+            </connect>
+            <connect srcID='FrequenciesExchanger.s:$(n)' targetID='mcmc' inputName='operator'
+                     if='inlikelihood(hky.$(n)) and inlikelihood(freqParameter.s:$(n)) and freqParameter.s:$(n)/estimate=true'>
+                Exchange values of frequencies of partition s:$(n)
+            </connect>
+
+            <connect srcID='kappa1.s:$(n)' targetID='tracelog' inputName='log'
+                     if='inlikelihood(kappa1.s:$(n)) and kappa1.s:$(n)/estimate=true'/>
+            <connect srcID='kappa2.s:$(n)' targetID='tracelog' inputName='log'
+                     if='inlikelihood(kappa2.s:$(n)) and kappa2.s:$(n)/estimate=true'/>
+            <connect srcID='freqParameter.s:$(n)' targetID='tracelog' inputName='log'
+                     if='inlikelihood(hky.$(n)) and inlikelihood(freqParameter.s:$(n)) and freqParameter.s:$(n)/estimate=true'/>
+
+            <connect srcID='kappa1Prior.s:$(n)' targetID='prior' inputName='distribution'
+                     if='inlikelihood(kappa1.s:$(n)) and kappa1.s:$(n)/estimate=true'>TN93 kappa1 (rateAG) parameter of
+                partition s:$(n)
+            </connect>
+            <connect srcID='kappa2Prior.s:$(n)' targetID='prior' inputName='distribution'
+                     if='inlikelihood(kappa2.s:$(n)) and kappa2.s:$(n)/estimate=true'>TN93 kappa2 (rateCT) parameter of
+                partition s:$(n)
+            </connect>
+            <!--
+                        <connect srcID='FrequenciesPrior.s:$(n)'     targetID='prior' inputName='distribution' if='inposterior(hky.s:$(n)) and inposterior(freqParameter.s:$(n)) and freqParameter.s:$(n)/estimate=true'/>
+            -->
+        </subtemplate>
+
+
+        <!-- GTR substitution model -->
+        <subtemplate id='GTR' class='beast.evolution.substitutionmodel.GTR' mainid='gtr.s:$(n)'
+                     suppressInputs='beast.evolution.substitutionmodel.GTR.eigenSystem'>
+            <![CDATA[
+        <plugin spec='GTR' id='gtr.s:$(n)'>
+            <parameter id="rateAC.s:$(n)" name='rateAC' value="1.0" lower="0.0" estimate='true'/>
+            <parameter id="rateAG.s:$(n)" name='rateAG' value="1.0" lower="0.0" estimate='true'/>
+            <parameter id="rateAT.s:$(n)" name='rateAT' value="1.0" lower="0.0" estimate='true'/>
+            <parameter id="rateCG.s:$(n)" name='rateCG' value="1.0" lower="0.0" estimate='true'/>
+            <parameter id="rateCT.s:$(n)" name='rateCT' value="1.0" lower="0.0" estimate='false'/>
+            <parameter id="rateGT.s:$(n)" name='rateGT' value="1.0" lower="0.0" estimate='true'/>
+            <frequencies id='estimatedFreqs.s:$(n)' spec='Frequencies'>
+                <frequencies id='freqParameter.s:$(n)' spec='parameter.RealParameter' dimension='4' value='0.25' lower='0' upper='1'/>
+            </frequencies>
+        </plugin>
+
+        <operator id='RateACScaler.s:$(n)' spec='ScaleOperator' scaleFactor="0.5" weight="0.1" parameter="@rateAC.s:$(n)"/>
+        <operator id='RateAGScaler.s:$(n)' spec='ScaleOperator' scaleFactor="0.5" weight="0.1" parameter="@rateAG.s:$(n)"/>
+        <operator id='RateATScaler.s:$(n)' spec='ScaleOperator' scaleFactor="0.5" weight="0.1" parameter="@rateAT.s:$(n)"/>
+        <operator id='RateCGScaler.s:$(n)' spec='ScaleOperator' scaleFactor="0.5" weight="0.1" parameter="@rateCG.s:$(n)"/>
+        <operator id='RateCTScaler.s:$(n)' spec='ScaleOperator' scaleFactor="0.5" weight="0.1" parameter="@rateCT.s:$(n)"/>
+        <operator id='RateGTScaler.s:$(n)' spec='ScaleOperator' scaleFactor="0.5" weight="0.1" parameter="@rateGT.s:$(n)"/>
+        <operator id='FrequenciesExchanger.s:$(n)' spec='DeltaExchangeOperator' delta="0.01" weight="0.1" parameter="@freqParameter.s:$(n)"/>
+
+        <prior id='RateACPrior.s:$(n)' x='@rateAC.s:$(n)'><distr spec="beast.math.distributions.Gamma"><parameter name="alpha" value='0.05' estimate='false'/><parameter name="beta" value='10.0' estimate='false'/></distr></prior>
+        <prior id='RateAGPrior.s:$(n)' x='@rateAG.s:$(n)'><distr spec="beast.math.distributions.Gamma"><parameter name="alpha" value='0.05' estimate="false"/><parameter name="beta" value='20.0' estimate="false"/></distr></prior>
+        <prior id='RateATPrior.s:$(n)' x='@rateAT.s:$(n)'><distr spec="beast.math.distributions.Gamma"><parameter name="alpha" value='0.05' estimate="false"/><parameter name="beta" value='10.0' estimate="false"/></distr></prior>
+        <prior id='RateCGPrior.s:$(n)' x='@rateCG.s:$(n)'><distr spec="beast.math.distributions.Gamma"><parameter name="alpha" value='0.05' estimate="false"/><parameter name="beta" value='10.0' estimate="false"/></distr></prior>
+        <prior id='RateCTPrior.s:$(n)' x='@rateCT.s:$(n)'><distr spec="beast.math.distributions.Gamma"><parameter name="alpha" value='0.05' estimate="false"/><parameter name="beta" value='20.0' estimate="false"/></distr></prior>
+        <prior id='RateGTPrior.s:$(n)' x='@rateGT.s:$(n)'><distr spec="beast.math.distributions.Gamma"><parameter name="alpha" value='0.05' estimate="false"/><parameter name="beta" value='10.0' estimate="false"/></distr></prior>
+]]>
+
+            <connect srcID='freqParameter.s:$(n)' targetID='state' inputName='stateNode'
+                     if='inlikelihood(freqParameter.s:$(n)) and freqParameter.s:$(n)/estimate=true'/>
+            <connect srcID='rateAC.s:$(n)' targetID='state' inputName='stateNode'
+                     if='inlikelihood(rateAC.s:$(n)) and rateAC.s:$(n)/estimate=true'/>
+            <connect srcID='rateAG.s:$(n)' targetID='state' inputName='stateNode'
+                     if='inlikelihood(rateAG.s:$(n)) and rateAG.s:$(n)/estimate=true'/>
+            <connect srcID='rateAT.s:$(n)' targetID='state' inputName='stateNode'
+                     if='inlikelihood(rateAT.s:$(n)) and rateAT.s:$(n)/estimate=true'/>
+            <connect srcID='rateCG.s:$(n)' targetID='state' inputName='stateNode'
+                     if='inlikelihood(rateCG.s:$(n)) and rateCG.s:$(n)/estimate=true'/>
+            <connect srcID='rateCT.s:$(n)' targetID='state' inputName='stateNode'
+                     if='inlikelihood(rateCT.s:$(n)) and rateCT.s:$(n)/estimate=true'/>
+            <connect srcID='rateGT.s:$(n)' targetID='state' inputName='stateNode'
+                     if='inlikelihood(rateGT.s:$(n)) and rateGT.s:$(n)/estimate=true'/>
+
+            <connect srcID='FrequenciesExchanger.s:$(n)' targetID='mcmc' inputName='operator'
+                     if='inlikelihood(freqParameter.s:$(n)) and freqParameter.s:$(n)/estimate=true'>Exchange values of
+                frequencies of partition s:$(n)
+            </connect>
+            <connect srcID='RateACScaler.s:$(n)' targetID='mcmc' inputName='operator'
+                     if='inlikelihood(rateAC.s:$(n)) and rateAC.s:$(n)/estimate=true'>Scale GTR A-C substitution
+                parameter of partition s:$(n)
+            </connect>
+            <connect srcID='RateAGScaler.s:$(n)' targetID='mcmc' inputName='operator'
+                     if='inlikelihood(rateAG.s:$(n)) and rateAG.s:$(n)/estimate=true'>Scale GTR A-G substitution
+                parameter of partition s:$(n)
+            </connect>
+            <connect srcID='RateATScaler.s:$(n)' targetID='mcmc' inputName='operator'
+                     if='inlikelihood(rateAT.s:$(n)) and rateAT.s:$(n)/estimate=true'>Scale GTR A-T substitution
+                parameter of partition s:$(n)
+            </connect>
+            <connect srcID='RateCGScaler.s:$(n)' targetID='mcmc' inputName='operator'
+                     if='inlikelihood(rateCG.s:$(n)) and rateCG.s:$(n)/estimate=true'>Scale GTR C-G substitution
+                parameter of partition s:$(n)
+            </connect>
+            <connect srcID='RateCTScaler.s:$(n)' targetID='mcmc' inputName='operator'
+                     if='inlikelihood(rateCT.s:$(n)) and rateCT.s:$(n)/estimate=true'>Scale GTR C-T substitution
+                parameter of partition s:$(n)
+            </connect>
+            <connect srcID='RateGTScaler.s:$(n)' targetID='mcmc' inputName='operator'
+                     if='inlikelihood(rateGT.s:$(n)) and rateGT.s:$(n)/estimate=true'>Scale GTR G-T substitution
+                parameter of partition s:$(n)
+            </connect>
+
+            <connect srcID='freqParameter.s:$(n)' targetID='tracelog' inputName='log'
+                     if='inlikelihood(freqParameter.s:$(n)) and freqParameter.s:$(n)/estimate=true'/>
+            <connect srcID='rateAC.s:$(n)' targetID='tracelog' inputName='log'
+                     if='inlikelihood(rateAC.s:$(n)) and rateAC.s:$(n)/estimate=true'/>
+            <connect srcID='rateAG.s:$(n)' targetID='tracelog' inputName='log'
+                     if='inlikelihood(rateAG.s:$(n)) and rateAG.s:$(n)/estimate=true'/>
+            <connect srcID='rateAT.s:$(n)' targetID='tracelog' inputName='log'
+                     if='inlikelihood(rateAT.s:$(n)) and rateAT.s:$(n)/estimate=true'/>
+            <connect srcID='rateCG.s:$(n)' targetID='tracelog' inputName='log'
+                     if='inlikelihood(rateCG.s:$(n)) and rateCG.s:$(n)/estimate=true'/>
+            <connect srcID='rateCT.s:$(n)' targetID='tracelog' inputName='log'
+                     if='inlikelihood(rateCT.s:$(n)) and rateCT.s:$(n)/estimate=true'/>
+            <connect srcID='rateGT.s:$(n)' targetID='tracelog' inputName='log'
+                     if='inlikelihood(rateGT.s:$(n)) and rateGT.s:$(n)/estimate=true'/>
+
+            <connect srcID='RateACPrior.s:$(n)' targetID='prior' inputName='distribution'
+                     if='inlikelihood(rateAC.s:$(n)) and rateAC.s:$(n)/estimate=true'>GTR A-C substitution parameter of
+                partition s:$(n)
+            </connect>
+            <connect srcID='RateAGPrior.s:$(n)' targetID='prior' inputName='distribution'
+                     if='inlikelihood(rateAG.s:$(n)) and rateAG.s:$(n)/estimate=true'>GTR A-G substitution parameter of
+                partition s:$(n)
+            </connect>
+            <connect srcID='RateATPrior.s:$(n)' targetID='prior' inputName='distribution'
+                     if='inlikelihood(rateAT.s:$(n)) and rateAT.s:$(n)/estimate=true'>GTR A-T substitution parameter of
+                partition s:$(n)
+            </connect>
+            <connect srcID='RateCGPrior.s:$(n)' targetID='prior' inputName='distribution'
+                     if='inlikelihood(rateCG.s:$(n)) and rateCG.s:$(n)/estimate=true'>GTR C-G substitution parameter of
+                partition s:$(n)
+            </connect>
+            <connect srcID='RateCTPrior.s:$(n)' targetID='prior' inputName='distribution'
+                     if='inlikelihood(rateCT.s:$(n)) and rateCT.s:$(n)/estimate=true'>GTR C-T substitution parameter of
+                partition s:$(n)
+            </connect>
+            <connect srcID='RateGTPrior.s:$(n)' targetID='prior' inputName='distribution'
+                     if='inlikelihood(rateGT.s:$(n)) and rateGT.s:$(n)/estimate=true'>GTR G-T substitution parameter of
+                partition s:$(n)
+            </connect>
+        </subtemplate>
+
+
+        <!-- empirical amino acid substitution models -->
+        <subtemplate id='Blosum62' class='beast.evolution.substitutionmodel.Blosum62'
+                     suppressInputs='beast.evolution.substitutionmodel.Blosum62.eigenSystem'
+                     mainid='Blosum62.s:$(n)'><!--value spec='XML'-->
+            <![CDATA[<plugin spec='Blosum62' id='Blosum62.s:$(n)'/>]]></subtemplate>
+        <subtemplate id='Dayhoff' class='beast.evolution.substitutionmodel.Dayhoff'
+                     suppressInputs='beast.evolution.substitutionmodel.Dayhoff.eigenSystem'
+                     mainid='Dayhoff.s:$(n)'><!--value spec='XML'-->
+            <![CDATA[<plugin spec='Dayhoff' id='Dayhoff.s:$(n)'/>]]></subtemplate>
+        <subtemplate id='JTT' class='beast.evolution.substitutionmodel.JTT'
+                     suppressInputs='beast.evolution.substitutionmodel.JTT.eigenSystem'
+                     mainid='JTT.s:$(n)'><!--value spec='XML'-->
+            <![CDATA[<plugin spec='JTT' id='JTT.s:$(n)'/>]]></subtemplate>
+        <subtemplate id='cpREV' class='beast.evolution.substitutionmodel.CPREV'
+                     suppressInputs='beast.evolution.substitutionmodel.CPREV.eigenSystem'
+                     mainid='CPREV.s:$(n)'><!--value spec='XML'-->
+            <![CDATA[<plugin spec='CPREV' id='CPREV.s:$(n)'/>]]></subtemplate>
+        <subtemplate id='mtREV' class='beast.evolution.substitutionmodel.MTREV'
+                     suppressInputs='beast.evolution.substitutionmodel.MTREV.eigenSystem'
+                     mainid='MTREV.s:$(n)'><!--value spec='XML'-->
+            <![CDATA[<plugin spec='MTREV' id='MTREV.s:$(n)'/>]]></subtemplate>
+        <subtemplate id='WAG' class='beast.evolution.substitutionmodel.WAG'
+                     suppressInputs='beast.evolution.substitutionmodel.WAG.eigenSystem'
+                     mainid='WAG.s:$(n)'><!--value spec='XML'-->
+            <![CDATA[<plugin spec='WAG' id='WAG.s:$(n)'/>]]></subtemplate>
+
+        <!-- binary model -->
+        <subtemplate id='MutationDeathModel' class='beast.evolution.substitutionmodel.MutationDeathModel'
+                     mainid='MutationDeathModel.s:$(n)'
+                     suppressInputs="beast.evolution.substitutionmodel.MutationDeathModel.substmodel,beast.evolution.substitutionmodel.MutationDeathModel.frequencies">
+            <![CDATA[
+		<plugin id='MutationDeathModel.s:$(n)' spec='beast.evolution.substitutionmodel.MutationDeathModel'>
+			<parameter name='deathprob' id='deathprob.s:$(n)' value='0.1' estimate='false'/>
+			<frequencies id='freqs.s:$(n)' spec='Frequencies'>
+				<frequencies spec='parameter.RealParameter' value='1 0'/>
+			</frequencies>
+		</plugin>
+]]>
+        </subtemplate>
+
+
+        <!-- frequency models -->
+        <subtemplate id='Estimated' class='beast.evolution.substitutionmodel.Frequencies'
+                     mainid='estimatedFreqs.s:$(n)'>
+            <![CDATA[
+            <frequencies id='estimatedFreqs.s:$(n)' spec='Frequencies'>
+                <frequencies id='freqParameter.s:$(n)' spec='parameter.RealParameter' dimension='4' value='0.25' lower='0' upper='1'/>
+            </frequencies>
+
+	        <plugin id='FrequenciesExchanger.s:$(n)' spec='DeltaExchangeOperator' delta="0.01" weight="0.1" parameter="@freqParameter.s:$(n)"/>
+]]>
+            <connect srcID='freqParameter.s:$(n)' targetID='state' inputName='stateNode'
+                     if='inposterior(estimatedFreqs.s:$(n)) and inposterior(freqParameter.s:$(n)) and freqParameter.s:$(n)/estimate=true'/>
+            <connect srcID='FrequenciesExchanger.s:$(n)' targetID='mcmc' inputName='operator'
+                     if='inposterior(estimatedFreqs.s:$(n)) and inposterior(freqParameter.s:$(n)) and freqParameter.s:$(n)/estimate=true'>
+                Exchange values of frequencies of partition s:$(n)
+            </connect>
+            <connect srcID='freqParameter.s:$(n)' targetID='tracelog' inputName='log'
+                     if='inposterior(estimatedFreqs.s:$(n)) and inposterior(freqParameter.s:$(n)) and freqParameter.s:$(n)/estimate=true'/>
+        </subtemplate>
+
+        <subtemplate id='Empirical' class='beast.evolution.substitutionmodel.Frequencies'
+                     mainid='empiricalFreqs.s:$(n)'>
+            <![CDATA[
+            <frequencies id='empiricalFreqs.s:$(n)' spec='Frequencies' data='@$(n)' estimate='true'/>
+]]>
+        </subtemplate>
+
+        <subtemplate id='AllEqual' class='beast.evolution.substitutionmodel.Frequencies' mainid='equalFreqs.s:$(n)'>
+            <![CDATA[
+            <frequencies id='equalFreqs.s:$(n)' spec='Frequencies' data='@$(n)' estimate='false'/>
+]]>
+        </subtemplate>
+    </mergewith>
+    
+    
+</beast>
+
diff --git a/templates/TreePriors.xml b/templates/TreePriors.xml
new file mode 100644
index 0000000..aafdf2f
--- /dev/null
+++ b/templates/TreePriors.xml
@@ -0,0 +1,414 @@
+<beast version='2.0'
+       namespace='beast.app.beauti:beast.core:beast.evolution.branchratemodel:beast.evolution.speciation:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood:beast.evolution:beast.math.distributions'>
+
+       
+    <mergewith point='misc'>
+        <fragment id='TreeOperators' spec="beast.app.beauti.Fragment">
+            <![CDATA[
+            <operator id='$(m)TreeScaler.t:$(n)' spec='ScaleOperator' scaleFactor="0.5" weight="3" tree="@Tree.t:$(n)"/>
+            <operator id='$(m)TreeRootScaler.t:$(n)' spec='ScaleOperator' scaleFactor="0.5" weight="3" tree="@Tree.t:$(n)" rootOnly='true'/>
+            <operator id='$(m)UniformOperator.t:$(n)' spec='Uniform' weight="30" tree="@Tree.t:$(n)"/>
+            <operator id='$(m)SubtreeSlide.t:$(n)' spec='SubtreeSlide' weight="15" gaussian="true" size="1.0" tree="@Tree.t:$(n)"/>
+            <operator id='$(m)Narrow.t:$(n)' spec='Exchange' isNarrow='true' weight="15" tree="@Tree.t:$(n)"/>
+            <operator id='$(m)Wide.t:$(n)' spec='Exchange' isNarrow='false' weight="3" tree="@Tree.t:$(n)"/>
+            <operator id='$(m)WilsonBalding.t:$(n)' spec='WilsonBalding' weight="3" tree="@Tree.t:$(n)"/>
+            ]]>
+            <connect srcID='$(m)TreeScaler.t:$(n)'                targetID='mcmc' inputName='operator' if='inposterior($(m).t:$(n)) and Tree.t:$(n)/estimate=true'>Scales all internal nodes for tree t:$(n)</connect>
+            <connect srcID='$(m)TreeRootScaler.t:$(n)'            targetID='mcmc' inputName='operator' if='inposterior($(m).t:$(n)) and Tree.t:$(n)/estimate=true'>Scales root node for tree t:$(n)</connect>
+            <connect srcID='$(m)UniformOperator.t:$(n)'           targetID='mcmc' inputName='operator' if='inposterior($(m).t:$(n)) and Tree.t:$(n)/estimate=true'>Draws new internal node heights uniformally for tree t:$(n)</connect>
+            <connect srcID='$(m)SubtreeSlide.t:$(n)'              targetID='mcmc' inputName='operator' if='inposterior($(m).t:$(n)) and Tree.t:$(n)/estimate=true'>Performs subtree slide rearrangement of tree t:$(n)</connect>
+            <connect srcID='$(m)Narrow.t:$(n)'                    targetID='mcmc' inputName='operator' if='inposterior($(m).t:$(n)) and Tree.t:$(n)/estimate=true'>Narrow exchange performs local rearrangement of tree t:$(n)</connect>
+            <connect srcID='$(m)Wide.t:$(n)'                      targetID='mcmc' inputName='operator' if='inposterior($(m).t:$(n)) and Tree.t:$(n)/estimate=true'>Wide exchange performs global rearrangement of tree t:$(n)</connect>
+            <connect srcID='$(m)WilsonBalding.t:$(n)'             targetID='mcmc' inputName='operator' if='inposterior($(m).t:$(n)) and Tree.t:$(n)/estimate=true'>Performs Wilson-Balding global rearrangement of tree t:$(n)</connect>
+        </fragment>
+    </mergewith>
+       
+    <!-- tree priors -->
+    <mergewith point='treePriorTemplates'>
+        <!-- Yule -->
+        <subtemplate id='YuleModel' class='beast.evolution.speciation.YuleModel' mainid='YuleModel.t:$(n)'>
+            <![CDATA[
+            <plugin spec='YuleModel' id="YuleModel.t:$(n)" tree='@Tree.t:$(n)'>
+                <parameter name='birthDiffRate' id="birthRate.t:$(n)" value='1.0'/>
+            </plugin>
+
+            <prior id='YuleBirthRatePrior.t:$(n)' x='@birthRate.t:$(n)'><distr spec="beast.math.distributions.Uniform" lower='0' upper='1000'/></prior>
+
+  		    <scale id='YuleBirthRateScaler.t:$(n)' spec='ScaleOperator' scaleFactor="0.75" weight="3" parameter="@birthRate.t:$(n)"/>
+]]>
+			<plate fragment="TreeOperators" var="m" range="YuleModel"/>
+
+            <connect srcID='YuleModel.t:$(n)' targetID='prior' inputName='distribution'
+                     if='inposterior(YuleModel.t:$(n)) and inposterior(Tree.t:$(n)) and Tree.t:$(n)/estimate=true'>Yule
+                speciation prior on tree t:$(n)
+            </connect>
+            <connect srcID='birthRate.t:$(n)' targetID='state' inputName='stateNode'
+                     if='inposterior(YuleModel.t:$(n)) and inposterior(Tree.t:$(n)) and inposterior(birthRate.t:$(n)) and birthRate.t:$(n)/estimate=true'/>
+
+            <connect srcID='YuleBirthRatePrior.t:$(n)' targetID='prior' inputName='distribution'
+                     if='inposterior(YuleModel.t:$(n)) and inposterior(Tree.t:$(n)) and birthRate.t:$(n)/estimate=true'>
+                Yule speciation process birth rate of partition t:$(n)
+            </connect>
+            <connect srcID='YuleBirthRateScaler.t:$(n)' targetID='mcmc' inputName='operator'
+                     if='inposterior(YuleModel.t:$(n)) and inposterior(Tree.t:$(n)) and birthRate.t:$(n)/estimate=true'>
+                Scale birth rate of Yule prior of tree t:$(n)
+            </connect>
+
+            <connect srcID='YuleModel.t:$(n)' targetID='tracelog' inputName='log'
+                     if='inposterior(YuleModel.t:$(n)) and inposterior(Tree.t:$(n)) and Tree.t:$(n)/estimate=true'/>
+            <connect srcID='birthRate.t:$(n)' targetID='tracelog' inputName='log'
+                     if='inposterior(YuleModel.t:$(n)) and inposterior(Tree.t:$(n)) and birthRate.t:$(n)/estimate=true'/>
+
+			<connect srcID='birthRate.t:Species' targetID='SBI' inputName='birthRate' if='inposterior(YuleModel.t:Species) and inposterior(birthRate.t:Species)'/>
+        </subtemplate>
+
+        <!-- Calibrated Yule -->
+        <subtemplate id='CalibratedYuleModel' class='beast.evolution.speciation.CalibratedYuleModel'
+                     mainid='CalibratedYuleModel.t:$(n)'
+                     suppressInputs='beast.evolution.speciation.CalibratedYuleModel.logMarginal,beast.evolution.speciation.CalibratedYuleModel.tree,beast.evolution.speciation.CalibratedYuleModel.treeIntervals,beast.evolution.speciation.CalibratedYuleModel.calibrations'>
+            <![CDATA[
+            <plugin spec='CalibratedYuleModel' id="CalibratedYuleModel.t:$(n)" tree='@Tree.t:$(n)'>
+                <parameter name='birthRate' id="birthRateY.t:$(n)" value='1.0'/>
+            </plugin>
+
+            <prior id='CalibratedYuleBirthRatePrior.t:$(n)' x='@birthRateY.t:$(n)'><distr spec="beast.math.distributions.Uniform" lower='0' upper='1000'/></prior>
+
+  		    <scale id='CalibratedYuleBirthRateScaler.t:$(n)' spec='ScaleOperator' scaleFactor="0.75" weight="3" parameter="@birthRateY.t:$(n)"/>
+]]>
+			<plate fragment="TreeOperators" var="m" range="CalibratedYuleModel"/>
+
+            <connect srcID='CalibratedYuleModel.t:$(n)' targetID='prior' inputName='distribution'
+                     if='inposterior(CalibratedYuleModel.t:$(n)) and inposterior(Tree.t:$(n)) and Tree.t:$(n)/estimate=true'>
+                Calibrated Yule speciation prior on tree t:$(n)
+            </connect>
+            <connect srcID='birthRateY.t:$(n)' targetID='state' inputName='stateNode'
+                     if='inposterior(CalibratedYuleModel.t:$(n)) and inposterior(Tree.t:$(n)) and inposterior(birthRateY.t:$(n)) and birthRateY.t:$(n)/estimate=true'/>
+
+            <connect srcID='CalibratedYuleBirthRatePrior.t:$(n)' targetID='prior' inputName='distribution'
+                     if='inposterior(CalibratedYuleModel.t:$(n)) and inposterior(Tree.t:$(n)) and birthRateY.t:$(n)/estimate=true'>
+                Calibrated Yule speciation process birth rate for t:$(n)
+            </connect>
+            <connect srcID='CalibratedYuleBirthRateScaler.t:$(n)' targetID='mcmc' inputName='operator'
+                     if='inposterior(CalibratedYuleModel.t:$(n)) and inposterior(Tree.t:$(n)) and birthRateY.t:$(n)/estimate=true'>
+                Scale birth rate of Calibrated Yule prior of tree t:$(n)
+            </connect>
+
+            <connect srcID='CalibratedYuleModel.t:$(n)' targetID='tracelog' inputName='log'
+                     if='inposterior(CalibratedYuleModel.t:$(n)) and inposterior(Tree.t:$(n)) and Tree.t:$(n)/estimate=true'/>
+            <connect srcID='birthRateY.t:$(n)' targetID='tracelog' inputName='log'
+                     if='inposterior(CalibratedYuleModel.t:$(n)) and inposterior(Tree.t:$(n)) and birthRateY.t:$(n)/estimate=true'/>
+
+			<connect srcID="CalibratedYuleModel.t:Species" targetID='SBI' inputName='calibratedYule' if='inposterior(CalibratedYuleModel.t:Species)'/>
+			<connect srcID='birthRateY.t:Species' targetID='SBI' inputName='birthRate' if='inposterior(YuleModel.t:Species) and inposterior(birthRateY.t:Species)'/>
+        </subtemplate>
+
+        <!-- Birth Death model according to Gernhard'08 -->
+        <subtemplate id='BirthDeathModel' class='beast.evolution.speciation.BirthDeathGernhard08Model'
+                     mainid='BirthDeath.t:$(n)'>
+            <![CDATA[
+            <distribution id="BirthDeath.t:$(n)" spec="speciation.BirthDeathGernhard08Model" tree='@Tree.t:$(n)'>
+                <birthDiffRate spec='parameter.RealParameter' id="birthRate2.t:$(n)" value='1' lower='0' upper='10000' />
+            	<relativeDeathRate spec='parameter.RealParameter' id="relativeDeathRate2.t:$(n)" value='0.5' lower='0' upper='1' />
+            </distribution>
+
+            <prior id='BirthRatePrior.t:$(n)' x='@birthRate2.t:$(n)'><distr spec="beast.math.distributions.Uniform" lower='0' upper='1000'/></prior>
+            <prior id='DeathRatePrior.t:$(n)' x='@relativeDeathRate2.t:$(n)'><distr spec="beast.math.distributions.Uniform" lower='0' upper='1'/></prior>
+
+  		    <scale id='BirthRateScaler.t:$(n)' spec='ScaleOperator' scaleFactor="0.75" weight="3" parameter="@birthRate2.t:$(n)"/>
+  		    <scale id='DeathRateScaler.t:$(n)' spec='ScaleOperator' scaleFactor="0.75" weight="3" parameter="@relativeDeathRate2.t:$(n)"/>
+]]>
+			<plate fragment="TreeOperators" var="m" range="BirthDeath"/>
+
+            <connect srcID='BirthDeath.t:$(n)' targetID='prior' inputName='distribution'
+                     if='inposterior(BirthDeath.t:$(n)) and inposterior(Tree.t:$(n)) and Tree.t:$(n)/estimate=true'>
+                Birth-Death speciation prior on tree t:$(n)
+            </connect>
+            <connect srcID='birthRate2.t:$(n)' targetID='state' inputName='stateNode'
+                     if='inposterior(BirthDeath.t:$(n)) and inposterior(birthRate2.t:$(n)) and birthRate2.t:$(n)/estimate=true'/>
+            <connect srcID='relativeDeathRate2.t:$(n)' targetID='state' inputName='stateNode'
+                     if='inposterior(BirthDeath.t:$(n)) and inposterior(relativeDeathRate2.t:$(n)) and relativeDeathRate2.t:$(n)/estimate=true'/>
+
+            <connect srcID='BirthRatePrior.t:$(n)' targetID='prior' inputName='distribution'
+                     if='inposterior(BirthDeath.t:$(n)) and inposterior(birthRate2.t:$(n)) and birthRate2.t:$(n)/estimate=true'>
+                Birth-Death speciation process rate of partition t:$(n)
+            </connect>
+            <connect srcID='DeathRatePrior.t:$(n)' targetID='prior' inputName='distribution'
+                     if='inposterior(BirthDeath.t:$(n)) and inposterior(relativeDeathRate2.t:$(n)) and relativeDeathRate2.t:$(n)/estimate=true'>
+                Death/Birth speciation process relative death rate of partition t:$(n)
+            </connect>
+
+            <connect srcID='BirthRateScaler.t:$(n)' targetID='mcmc' inputName='operator'
+                     if='inposterior(BirthDeath.t:$(n)) and inposterior(birthRate2.t:$(n)) and birthRate2.t:$(n)/estimate=true'>
+                Scale Death-Birth rate of Yule prior of tree t:$(n)
+            </connect>
+            <connect srcID='DeathRateScaler.t:$(n)' targetID='mcmc' inputName='operator'
+                     if='inposterior(BirthDeath.t:$(n)) and inposterior(relativeDeathRate2.t:$(n)) and relativeDeathRate2.t:$(n)/estimate=true'>
+                Scale Death/Birth rate of Yule prior of tree t:$(n)
+            </connect>
+
+            <connect srcID='BirthDeath.t:$(n)' targetID='tracelog' inputName='log'
+                     if='inposterior(BirthDeath.t:$(n)) and inposterior(Tree.t:$(n)) and Tree.t:$(n)/estimate=true'/>
+            <connect srcID='birthRate2.t:$(n)' targetID='tracelog' inputName='log'
+                     if='inposterior(BirthDeath.t:$(n)) and inposterior(birthRate2.t:$(n)) and birthRate2.t:$(n)/estimate=true'/>
+            <connect srcID='relativeDeathRate2.t:$(n)' targetID='tracelog' inputName='log'
+                     if='inposterior(BirthDeath.t:$(n)) and inposterior(relativeDeathRate2.t:$(n)) and relativeDeathRate2.t:$(n)/estimate=true'/>
+
+			<connect srcID='birthRate2.t:Species' targetID='SBI' inputName='birthRate' if='inposterior(BirthDeath.t:Species) and inposterior(birthRate2.t:Species)'/>
+        </subtemplate>
+
+
+        <!-- Coalescent for Constant population -->
+        <subtemplate id='CoalescentConstantPopulation' class='beast.evolution.tree.coalescent.Coalescent'
+                     mainid='CoalescentConstant.t:$(n)'>
+            <![CDATA[
+            <distribution id="CoalescentConstant.t:$(n)" spec="Coalescent">
+                <treeIntervals spec='TreeIntervals' id='TreeIntervals.t:$(n)' tree='@Tree.t:$(n)'/>
+                <populationModel spec="ConstantPopulation" id='ConstantPopulation.t:$(n)'>
+                     <parameter name="popSize" id="popSize.t:$(n)" value='0.3' estimate='true'/>
+                 </populationModel>
+            </distribution>
+
+  		    <operator id='PopSizeScaler.t:$(n)' spec='ScaleOperator' scaleFactor="0.75" weight="3" parameter="@popSize.t:$(n)"/>
+	        <prior id='PopSizePrior.t:$(n)' x='@popSize.t:$(n)'><distr spec="OneOnX"/></prior>
+]]>
+			<plate fragment="TreeOperators" var="m" range="CoalescentConstant"/>
+
+            <connect srcID='CoalescentConstant.t:$(n)' targetID='prior' inputName='distribution'
+                     if='inposterior(CoalescentConstant.t:$(n)) and Tree.t:$(n)/estimate=true'>Coalescent prior with
+                constant rate on tree t:$(n)
+            </connect>
+            <connect srcID='PopSizePrior.t:$(n)' targetID='prior' inputName='distribution'
+                     if='inposterior(CoalescentConstant.t:$(n)) and inposterior(popSize.t:$(n)) and popSize.t:$(n)/estimate=true'>
+                Coalescent population size parameter of partition t:$(n)
+            </connect>
+
+            <connect srcID='popSize.t:$(n)' targetID='state' inputName='stateNode'
+                     if='inposterior(CoalescentConstant.t:$(n)) and inposterior(popSize.t:$(n)) and popSize.t:$(n)/estimate=true'/>
+
+            <connect srcID='PopSizeScaler.t:$(n)' targetID='mcmc' inputName='operator'
+                     if='inposterior(CoalescentConstant.t:$(n)) and inposterior(popSize.t:$(n)) and popSize.t:$(n)/estimate=true'>
+                Scale population size of Coalescent prior of tree t:$(n)
+            </connect>
+
+            <connect srcID='popSize.t:$(n)' targetID='tracelog' inputName='log'
+                     if='inposterior(CoalescentConstant.t:$(n)) and inposterior(popSize.t:$(n)) and popSize.t:$(n)/estimate=true'/>
+            <connect srcID='CoalescentConstant.t:$(n)' targetID='tracelog' inputName='log'
+                     if='inposterior(CoalescentConstant.t:$(n)) and Tree.t:$(n)/estimate=true'/>
+        </subtemplate>
+
+
+        <!-- Coalescent for Exponential population -->
+        <subtemplate id='CoalescentExponentialPopulation' class='beast.evolution.tree.coalescent.Coalescent'
+                     mainid='CoalescentExponential.t:$(n)'>
+            <![CDATA[
+            <distribution id="CoalescentExponential.t:$(n)" spec="Coalescent">
+                <treeIntervals spec='TreeIntervals' id='TreeIntervals.t:$(n)' tree='@Tree.t:$(n)'/>
+                <populationModel spec="ExponentialGrowth" id="ExponentialGrowth.t:$(n)">
+                    <parameter name="popSize" id="ePopSize.t:$(n)" value='0.3' estimate='true'/>
+                    <parameter name="growthRate" id="growthRate.t:$(n)" value='3e-4' estimate='true'/>
+                </populationModel>
+            </distribution>
+
+  		    <operator id='ePopSizeScaler.t:$(n)' spec='ScaleOperator' scaleFactor="0.75" weight="3" parameter="@ePopSize.t:$(n)"/>
+	        <operator id="GrowthRateRandomWalk.t:$(n)" spec="RealRandomWalkOperator" windowSize='1' weight="3" parameter="@growthRate.t:$(n)"/>
+
+	        <prior id='ePopSizePrior.t:$(n)' x='@ePopSize.t:$(n)'><distr spec="OneOnX"/></prior>
+	        <prior id='GrowthRatePrior.t:$(n)' x='@growthRate.t:$(n)'><distr spec="LaplaceDistribution"><parameter name="mu" value='0.001' estimate="false"/><parameter name="scale" value='30.701135' estimate="false"/></distr></prior>
+
+]]>
+			<plate fragment="TreeOperators" var="m" range="CoalescentExponential"/>
+
+            <connect srcID='CoalescentExponential.t:$(n)' targetID='prior' inputName='distribution'
+                     if='inposterior(CoalescentExponential.t:$(n)) and Tree.t:$(n)/estimate=true'>Coalesenct prior with
+                exponential rate on tree t:$(n)
+            </connect>
+            <connect srcID='ePopSizePrior.t:$(n)' targetID='prior' inputName='distribution'
+                     if='inposterior(CoalescentExponential.t:$(n)) and inposterior(ePopSize.t:$(n)) and ePopSize.t:$(n)/estimate=true'>
+                Coalescent population size parameter of partition t:$(n)
+            </connect>
+            <connect srcID='GrowthRatePrior.t:$(n)' targetID='prior' inputName='distribution'
+                     if='inposterior(CoalescentExponential.t:$(n)) and inposterior(growthRate.t:$(n)) and growthRate.t:$(n)/estimate=true'>
+                Coalescent growth rate of partition t:$(n)
+            </connect>
+
+            <connect srcID='ePopSize.t:$(n)' targetID='state' inputName='stateNode'
+                     if='inposterior(CoalescentExponential.t:$(n)) and inposterior(ePopSize.t:$(n))  and ePopSize.t:$(n)/estimate=true'/>
+            <connect srcID='growthRate.t:$(n)' targetID='state' inputName='stateNode'
+                     if='inposterior(CoalescentExponential.t:$(n)) and inposterior(growthRate.t:$(n)) and growthRate.t:$(n)/estimate=true'/>
+
+            <connect srcID='ePopSizeScaler.t:$(n)' targetID='mcmc' inputName='operator'
+                     if='inposterior(CoalescentExponential.t:$(n)) and inposterior(ePopSize.t:$(n))  and ePopSize.t:$(n)/estimate=true'>
+                Scale population size of Coalescent prior of tree t:$(n)
+            </connect>
+            <connect srcID='GrowthRateRandomWalk.t:$(n)' targetID='mcmc' inputName='operator'
+                     if='inposterior(CoalescentExponential.t:$(n)) and inposterior(growthRate.t:$(n)) and growthRate.t:$(n)/estimate=true'>
+                Scale growth rate of Coalescent prior of tree t:$(n)
+            </connect>
+
+            <connect srcID='CoalescentExponential.t:$(n)' targetID='tracelog' inputName='log'
+                     if='inposterior(CoalescentExponential.t:$(n)) and Tree.t:$(n)/estimate=true'/>
+            <connect srcID='ePopSize.t:$(n)' targetID='tracelog' inputName='log'
+                     if='inposterior(CoalescentExponential.t:$(n)) and inposterior(ePopSize.t:$(n)) and ePopSize.t:$(n)/estimate=true'/>
+            <connect srcID='growthRate.t:$(n)' targetID='tracelog' inputName='log'
+                     if='inposterior(CoalescentExponential.t:$(n)) and inposterior(growthRate.t:$(n)) and growthRate.t:$(n)/estimate=true'/>
+        </subtemplate>
+
+
+        <!-- Coalescent for Bayesian skyline -->
+        <subtemplate id='CoalescentBayesianSkyline' class='beast.evolution.tree.coalescent.Coalescent'
+                     mainid='BayesianSkyline.t:$(n)'
+                     suppressInputs='beast.math.distributions.MarkovChainDistribution.parameter'>
+            <![CDATA[
+            <distribution spec="BayesianSkyline" id='BayesianSkyline.t:$(n)'>
+                <parameter name='popSizes' id='bPopSizes.t:$(n)' dimension="5" value="380.0" lower="0.0" upper="380000.0" estimate='true'/>
+                <groupSizes spec='parameter.IntegerParameter' id='bGroupSizes.t:$(n)' dimension='5' value='1' estimate='true'/>
+                <treeIntervals spec='TreeIntervals' id='BSPTreeIntervals.t:$(n)' tree='@Tree.t:$(n)'/>
+            </distribution>
+
+            <distribution id='MarkovChainedPopSizes.t:$(n)' spec="beast.math.distributions.MarkovChainDistribution" 
+				jeffreys="true"
+				parameter="@bPopSizes.t:$(n)"/>
+
+		    <operator id='popSizesScaler.t:$(n)' spec='ScaleOperator' scaleFactor="0.75" weight="15" parameter="@bPopSizes.t:$(n)"/>
+		    <operator id='groupSizesDelta.t:$(n)' spec='DeltaExchangeOperator' delta="1" weight="6" integer="true"
+		              intparameter="@bGroupSizes.t:$(n)"/>
+
+]]>
+			<plate fragment="TreeOperators" var="m" range="BayesianSkyline"/>
+
+            <connect srcID='BayesianSkyline.t:$(n)' targetID='prior' inputName='distribution'
+                     if='inposterior(BayesianSkyline.t:$(n)) and Tree.t:$(n)/estimate=true'>Coalescent with Bayesian
+                skyline prior tree t:$(n)
+            </connect>
+            <connect srcID='bPopSizes.t:$(n)' targetID='state' inputName='stateNode'
+                     if='inposterior(BayesianSkyline.t:$(n)) and inposterior(bPopSizes.t:$(n))'/>
+            <connect srcID='bGroupSizes.t:$(n)' targetID='state' inputName='stateNode'
+                     if='inposterior(BayesianSkyline.t:$(n)) and inposterior(bGroupSizes.t:$(n))'/>
+
+            <connect srcID='MarkovChainedPopSizes.t:$(n)' targetID='prior' inputName='distribution'
+                     if='inposterior(BayesianSkyline.t:$(n))'>Markov chained prior on population sizes of Bayesian
+                skyline plot
+            </connect>
+
+            <connect srcID='BayesianSkyline.t:$(n)' targetID='tracelog' inputName='log'
+                     if='inposterior(BayesianSkyline.t:$(n))'/>
+            <connect srcID='bPopSizes.t:$(n)' targetID='tracelog' inputName='log'
+                     if='inposterior(BayesianSkyline.t:$(n))'/>
+            <connect srcID='bGroupSizes.t:$(n)' targetID='tracelog' inputName='log'
+                     if='inposterior(BayesianSkyline.t:$(n))'/>
+
+            <connect srcID='popSizesScaler.t:$(n)' targetID='mcmc' inputName='operator'
+                     if='inposterior(BayesianSkyline.t:$(n))'>Scale population size of Coalscent prior of tree t:$(n)
+            </connect>
+            <connect srcID='groupSizesDelta.t:$(n)' targetID='mcmc' inputName='operator'
+                     if='inposterior(BayesianSkyline.t:$(n))'>Exchange group sizes of Coalscent prior of tree t:$(n)
+            </connect>
+        </subtemplate>
+
+
+        <!-- Coalescent for Extended Bayesian skyline -->
+        <subtemplate id='CoalescentExtendedBayesianSkyline' class='beast.evolution.tree.coalescent.Coalescent'
+                     mainid='ExtendedBayesianSkyline.t:$(n)'>
+            <![CDATA[
+	        <stateNode id="indicators.alltrees" spec="parameter.BooleanParameter" value="false"/>
+            <stateNode id="populationMean.alltrees" spec="parameter.RealParameter" value="1"/>
+	        <stateNode id="popSizes.alltrees" spec="parameter.RealParameter" value="1"/>
+
+            <distribution id="ExtendedBayesianSkyline.t:$(n)" spec="Coalescent">
+                 <treeIntervals id="treeIntervals.t:$(n)" spec="TreeIntervals" tree="@Tree.t:$(n)"/>
+                 <populationModel id="scaledDemo.t:$(n)" spec="beast.evolution.tree.coalescent.ScaledPopulationFunction" factor='1' population='@demographic.alltrees'/>
+            </distribution>
+
+            <population id="demographic.alltrees" populationIndicators="@indicators.alltrees" populationSizes="@popSizes.alltrees" spec="beast.evolution.tree.coalescent.CompoundPopulationFunction" type="linear" useIntervalsMiddle="false">
+                <itree idref="treeIntervals.t:$(n)"/>
+			</population>
+
+            <prior id="populationMeanPrior.alltrees" x="@populationMean.alltrees">
+                <distr spec="OneOnX" id='OneOnX.EBSP'/>
+            </prior>
+            <prior id="indicatorsPrior.alltrees">
+                <x arg="@indicators.alltrees" id="indsSun.alltrees" spec="util.Sum"/>
+                <distr spec="Poisson"  id='Poisson.EBSP'>
+                    <parameter name="lambda" upper="0.0" value="0.69314718056" estimate='false'/>
+                </distr>
+            </prior>
+            <prior id="popSizePrior.alltrees" x="@popSizes.alltrees">
+                <distr id="popPriorDist.EBSP" mean="@populationMean.alltrees" spec="Exponential"/>
+            </prior>
+
+            <logger id="EBSPLogger" fileName='EBSP.$(seed).log' logEvery='5000' model="@demographic.alltrees">
+                <log idref='demographic.alltrees'/>
+            </logger>
+            <log id='sumIndicators' spec='beast.core.util.Sum' arg='@indicators.alltrees'/>
+
+
+			<operator id="bitflip.alltrees" parameter="@indicators.alltrees" spec="BitFlipOperator" uniform="true" weight="30.0"/>
+			<operator id="indicatorSampler.alltrees" dist="@popPriorDist.EBSP" indicators="@indicators.alltrees" spec="beast.evolution.tree.coalescent.SampleOffValues" values="@popSizes.alltrees" weight="15.0"/>
+			<operator id="indicatorScaler.alltrees" degreesOfFreedom="1" indicator="@indicators.alltrees" parameter="@popSizes.alltrees" scaleAll="false" scaleAllIndependently="false" scaleFactor="0.5" spec="ScaleOperator" weight="15.0"/>
+			<operator id="EBSPupDownOperator.alltrees" scaleFactor="0.7" spec="UpDownOperator" weight="5.0">
+				<up idref="popSizes.alltrees"/>
+				<up idref="populationMean.alltrees"/>
+			</operator>
+]]>
+			<plate fragment="TreeOperators" var="m" range="ExtendedBayesianSkyline"/>
+
+            <connect srcID='ExtendedBayesianSkyline.t:$(n)' targetID='prior' inputName='distribution'
+                     if='inposterior(ExtendedBayesianSkyline.t:$(n)) and Tree.t:$(n)/estimate=true'>Coalescent with
+                extended Bayesian skyline prior tree t:$(n)
+            </connect>
+            <connect srcID='treeIntervals.t:$(n)' targetID='demographic.alltrees' inputName='itree'
+                     if='inposterior(ExtendedBayesianSkyline.t:$(n)) and Tree.t:$(n)/estimate=true'/>
+
+            <connect srcID='indicators.alltrees' targetID='state' inputName='stateNode'
+                     if='inposterior(ExtendedBayesianSkyline.t:$(n))'/>
+            <connect srcID='populationMean.alltrees' targetID='state' inputName='stateNode'
+                     if='inposterior(ExtendedBayesianSkyline.t:$(n))'/>
+            <connect srcID='popSizes.alltrees' targetID='state' inputName='stateNode'
+                     if='inposterior(ExtendedBayesianSkyline.t:$(n))'/>
+
+            <connect srcID='populationMeanPrior.alltrees' targetID='prior' inputName='distribution'
+                     if='inposterior(ExtendedBayesianSkyline.t:$(n))'>Extended Bayesian Skyline population prior mean of
+                partition t:$(n)
+            </connect>
+            <connect srcID='indicatorsPrior.alltrees' targetID='prior' inputName='distribution'
+                     if='inposterior(ExtendedBayesianSkyline.t:$(n))'>Average number of population change points of
+                partition t:$(n)
+            </connect>
+            <connect srcID='popSizePrior.alltrees' targetID='prior' inputName='distribution'
+                     if='inposterior(ExtendedBayesianSkyline.t:$(n))'>Extended Bayesian Skyline population prior of
+                partition t:$(n)
+            </connect>
+
+            <connect srcID='ExtendedBayesianSkyline.t:$(n)' targetID='tracelog' inputName='log'
+                     if='inposterior(ExtendedBayesianSkyline.t:$(n))'/>
+            <connect srcID='indicators.alltrees' targetID='tracelog' inputName='log'
+                     if='inposterior(ExtendedBayesianSkyline.t:$(n))'/>
+            <connect srcID='populationMean.alltrees' targetID='tracelog' inputName='log'
+                     if='inposterior(ExtendedBayesianSkyline.t:$(n))'/>
+            <connect srcID='popSizes.alltrees' targetID='tracelog' inputName='log'
+                     if='inposterior(ExtendedBayesianSkyline.t:$(n))'/>
+            <connect srcID='sumIndicators' targetID='tracelog' inputName='log'
+                     if='inposterior(ExtendedBayesianSkyline.t:$(n))'/>
+
+            <connect srcID='EBSPLogger' targetID='mcmc' inputName='logger'
+                     if='inposterior(ExtendedBayesianSkyline.t:$(n))'/>
+
+            <connect srcID='bitflip.alltrees' targetID='mcmc' inputName='operator'
+                     if='inposterior(ExtendedBayesianSkyline.t:$(n))'>EBSP bitflip operator
+            </connect>
+            <connect srcID='indicatorSampler.alltrees' targetID='mcmc' inputName='operator'
+                     if='inposterior(ExtendedBayesianSkyline.t:$(n))'>EBSP indicator sampler
+            </connect>
+            <connect srcID='indicatorScaler.alltrees' targetID='mcmc' inputName='operator'
+                     if='inposterior(ExtendedBayesianSkyline.t:$(n))'>EBSP population sizes
+            </connect>
+            <connect srcID='EBSPupDownOperator.alltrees' targetID='mcmc' inputName='operator'
+                     if='inposterior(ExtendedBayesianSkyline.t:$(n))'>Up/down scale substitution rates of EBSP prior and
+                tree
+            </connect>
+        </subtemplate>
+
+    </mergewith>
+</beast>
+
+
diff --git a/test.xml b/test.xml
new file mode 100644
index 0000000..92e0339
--- /dev/null
+++ b/test.xml
@@ -0,0 +1,50 @@
+<!-- Build BEAST II. It is also used by Hudson BEAST_II project. JUnit test is available for this build. -->
+<project basedir="." default="test" name="test_BEAST_2_ii">
+	<description>
+	    Integration test BEAST 2.
+            Also used by Hudson BEAST_2 project.
+	    JUnit test is available for this build.
+	</description>
+
+    <!-- set global properties for this build -->
+    <property name="src" location="src" />
+    <property name="build" location="build" />
+    <property name="lib" location="lib" />
+    <property name="doc" location="doc" />
+    <property name="dist" location="${build}/dist" />
+
+	<property name="main_class_BEAST" value="beast.app.beastapp.BeastMain" />
+	<property name="report" value="${build}/junitreport" />
+
+	<path id="classpath">
+		<fileset dir="${lib}" includes="**/*.jar" />
+	</path>
+
+	<!-- JUnit test -->
+	<target name="test">
+		<mkdir dir="${report}" />
+		<junit printsummary="yes"> <!--showoutput='yes'-->
+			<classpath>
+				<path refid="classpath" />
+				<path location="${build}" />
+			</classpath>
+
+			<formatter type="xml" />
+
+			<batchtest fork="yes" todir="${report}">
+				<fileset dir="${src}">
+                    <include name="test/beast/beast2vs1/**/*Test.java"/>
+				</fileset>
+			</batchtest>
+		</junit>
+		<echo message="JUnit test finished." />
+	</target>
+    
+    <target name="junitreport">
+		<junitreport todir="${report}">
+			<fileset dir="${report}" includes="*.xml"/>
+			<report format="frames" todir="${report}"/>
+		</junitreport>
+		<echo message="JUnit test report finished." />
+	</target>
+</project>

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/beast2-mcmc.git



More information about the debian-med-commit mailing list